@nice2dev/ui-diagrams 1.0.5 → 1.0.8
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/NiceSavedQueryPanel-CUAsdOjJ-CSZLnNPf.cjs +596 -0
- package/dist/NiceSavedQueryPanel-CUAsdOjJ-DTz1kPLr.js +6078 -0
- package/dist/NiceSavedQueryPanel-DUw8plYP-B8ZfDGaR.cjs +596 -0
- package/dist/NiceSavedQueryPanel-DUw8plYP-CAQV8eYE.js +5568 -0
- package/dist/NiceStockChart-Cpmv9_Cc-CLoIAI1L.cjs +287 -0
- package/dist/NiceStockChart-Cpmv9_Cc-I6rQ6rNU.js +2246 -0
- package/dist/index-B5y4azp8.cjs +1257 -0
- package/dist/index-CIl98Vbm-B1-8VqB_.js +46639 -0
- package/dist/index-CIl98Vbm-Uj4gSRsL.cjs +4993 -0
- package/dist/index-CNwVELPJ-BC-pDqbh.cjs +5243 -0
- package/dist/index-CNwVELPJ-Bc5jJdv3.js +37303 -0
- package/dist/index-D8CoTxGO.js +36732 -0
- package/dist/index-DdOXScZS.js +30597 -0
- package/dist/index-Gq4eeeO7.cjs +719 -0
- package/dist/index.cjs +1 -6842
- package/dist/index.mjs +88 -74558
- package/package.json +1 -1
|
@@ -0,0 +1,1257 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),s=require("react");class ua{constructor(a){this.undoStack=[],this.redoStack=[],this.listeners=new Set,this.maxHistory=100,this.doc=a??ua.createEmpty()}static createEmpty(a="flowchart"){const r=new Date().toISOString();return{version:"1.0",id:Nt(),title:"Untitled Diagram",diagramType:a,nodes:[],edges:[],groups:[],animations:[],viewport:{x:0,y:0,zoom:1},metadata:{createdAt:r,updatedAt:r}}}getDocument(){return this.doc}getNodes(){return this.doc.nodes}getEdges(){return this.doc.edges}getGroups(){return this.doc.groups}getAnimations(){return this.doc.animations}getNodeById(a){return this.doc.nodes.find(r=>r.id===a)}getEdgeById(a){return this.doc.edges.find(r=>r.id===a)}getViewport(){return{...this.doc.viewport}}subscribe(a){return this.listeners.add(a),()=>this.listeners.delete(a)}notify(){this.doc.metadata.updatedAt=new Date().toISOString(),this.listeners.forEach(a=>a())}pushUndo(a){this.undoStack.push({label:a,snapshot:JSON.stringify(this.doc)}),this.undoStack.length>this.maxHistory&&this.undoStack.shift(),this.redoStack=[]}undo(){const a=this.undoStack.pop();return a?(this.redoStack.push({label:"redo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(a.snapshot),this.notify(),!0):!1}redo(){const a=this.redoStack.pop();return a?(this.undoStack.push({label:"undo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(a.snapshot),this.notify(),!0):!1}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}addNode(a,r,n="roundedRect",i={width:160,height:60}){this.pushUndo("Add node");const o=Ji(),c={id:Nt(),label:a,position:r,size:i,shape:n,style:{},ports:o};return this.doc.nodes.push(c),this.notify(),c}updateNode(a,r){this.pushUndo("Update node");const n=this.doc.nodes.find(i=>i.id===a);n&&Object.assign(n,r),this.notify()}moveNode(a,r){const n=this.doc.nodes.find(i=>i.id===a);n&&(this.pushUndo("Move node"),n.position=r,this.notify())}resizeNode(a,r){const n=this.doc.nodes.find(i=>i.id===a);n&&(this.pushUndo("Resize node"),n.size=r,this.notify())}removeNode(a){this.pushUndo("Remove node"),this.doc.nodes=this.doc.nodes.filter(r=>r.id!==a),this.doc.edges=this.doc.edges.filter(r=>r.sourceNodeId!==a&&r.targetNodeId!==a),this.doc.groups.forEach(r=>{r.nodeIds=r.nodeIds.filter(n=>n!==a)}),this.doc.animations=this.doc.animations.filter(r=>r.targetId!==a),this.notify()}addEdge(a,r,n,i,o){if(a===n||!this.getNodeById(a)||!this.getNodeById(n))return null;this.pushUndo("Add edge");const c={id:Nt(),sourceNodeId:a,sourcePortId:r,targetNodeId:n,targetPortId:i,label:o,style:{lineType:"bezier",targetArrow:"arrow"}};return this.doc.edges.push(c),this.notify(),c}updateEdge(a,r){this.pushUndo("Update edge");const n=this.doc.edges.find(i=>i.id===a);n&&Object.assign(n,r),this.notify()}removeEdge(a){this.pushUndo("Remove edge"),this.doc.edges=this.doc.edges.filter(r=>r.id!==a),this.doc.animations=this.doc.animations.filter(r=>r.targetId!==a),this.notify()}createGroup(a,r){this.pushUndo("Create group");const n={id:Nt(),label:a,nodeIds:[...r]};return r.forEach(i=>{const o=this.doc.nodes.find(c=>c.id===i);o&&(o.groupId=n.id)}),this.doc.groups.push(n),this.notify(),n}removeGroup(a){this.pushUndo("Remove group");const r=this.doc.groups.find(n=>n.id===a);r&&r.nodeIds.forEach(n=>{const i=this.doc.nodes.find(o=>o.id===n);i&&(i.groupId=void 0)}),this.doc.groups=this.doc.groups.filter(n=>n.id!==a),this.notify()}addAnimation(a){this.pushUndo("Add animation");const r={id:Nt(),...a};return this.doc.animations.push(r),this.notify(),r}removeAnimation(a){this.pushUndo("Remove animation"),this.doc.animations=this.doc.animations.filter(r=>r.id!==a),this.notify()}setViewport(a){this.doc.viewport={...a},this.notify()}toggleGroupCollapse(a){const r=this.doc.groups.find(n=>n.id===a);r&&(this.pushUndo("Toggle group collapse"),r.collapsed=!r.collapsed,r.nodeIds.forEach(n=>{const i=this.doc.nodes.find(o=>o.id===n);i&&(i.hidden=r.collapsed)}),this.notify())}toggleNodeCollapse(a){const r=this.doc.nodes.find(n=>n.id===a);r&&(this.pushUndo("Toggle node collapse"),r.collapsed=!r.collapsed,(r.childNodeIds??[]).forEach(n=>{const i=this.doc.nodes.find(o=>o.id===n);i&&(i.hidden=r.collapsed)}),this.notify())}getAnimationModes(){return this.doc.animationModes??[]}getActiveAnimationMode(){var a;if((a=this.doc.animationModes)!=null&&a.length)return this.doc.animationModes.find(r=>r.id===this.doc.activeAnimationModeId)??this.doc.animationModes.find(r=>r.isDefault)??this.doc.animationModes[0]}addAnimationMode(a,r){this.pushUndo("Add animation mode"),this.doc.animationModes||(this.doc.animationModes=[]);const n={id:Nt(),name:a,animations:r??[],isDefault:this.doc.animationModes.length===0};return this.doc.animationModes.push(n),n.isDefault&&(this.doc.activeAnimationModeId=n.id),this.notify(),n}removeAnimationMode(a){var r;this.doc.animationModes&&(this.pushUndo("Remove animation mode"),this.doc.animationModes=this.doc.animationModes.filter(n=>n.id!==a),this.doc.activeAnimationModeId===a&&(this.doc.activeAnimationModeId=(r=this.doc.animationModes[0])==null?void 0:r.id),this.notify())}setActiveAnimationMode(a){var r;(r=this.doc.animationModes)!=null&&r.find(n=>n.id===a)&&(this.doc.activeAnimationModeId=a,this.notify())}addAnimationToMode(a,r){var o;const n=(o=this.doc.animationModes)==null?void 0:o.find(c=>c.id===a);if(!n)return null;this.pushUndo("Add animation to mode");const i={id:Nt(),...r};return n.animations.push(i),this.notify(),i}removeAnimationFromMode(a,r){var i;const n=(i=this.doc.animationModes)==null?void 0:i.find(o=>o.id===a);n&&(this.pushUndo("Remove animation from mode"),n.animations=n.animations.filter(o=>o.id!==r),this.notify())}setStylePreset(a){this.pushUndo("Set style preset"),this.doc.stylePresetId=a,this.notify()}setStyleOverrides(a){this.pushUndo("Set style overrides"),this.doc.styleOverrides=a,this.notify()}getPlayerConfig(){return this.doc.playerConfig??{mode:"editor",interactionsEnabled:!0,showModeSwitcher:!0,showPlaybackControls:!0,autoPlay:!1,showGhostElements:!0,ghostOpacity:.15,ghostCursorStyle:"pointer"}}setPlayerConfig(a){this.pushUndo("Update player config"),this.doc.playerConfig={...this.getPlayerConfig(),...a},this.notify()}setViewMode(a){const r=this.getPlayerConfig();r.mode=a,this.doc.playerConfig=r,this.notify()}updateAnimation(a,r){this.pushUndo("Update animation");const n=this.doc.animations.find(i=>i.id===a);n&&Object.assign(n,r),this.notify()}loadDocument(a){this.doc=structuredClone(a),this.undoStack=[],this.redoStack=[],this.notify()}}function Nt(){return`ndd_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function Ji(){return[{id:"top",side:"top",offset:.5},{id:"right",side:"right",offset:.5},{id:"bottom",side:"bottom",offset:.5},{id:"left",side:"left",offset:.5}]}function ln(t,a,r){switch(r.algorithm){case"dagre":return cn(t,a,r);case"grid":return Qi(t,r);case"radial":return es(t,a);case"tree":return ts(t,a,r);case"forceDirected":return as(t,a,r);case"manual":default:return{positions:new Map(t.map(n=>[n.id,{...n.position}]))}}}function cn(t,a,r){const n=r.direction??"TB",i=r.nodeSpacing??60,o=r.rankSpacing??100,c=new Map,l=new Map,d=new Set(t.map(v=>v.id));t.forEach(v=>{c.set(v.id,[]),l.set(v.id,[])}),a.forEach(v=>{d.has(v.sourceNodeId)&&d.has(v.targetNodeId)&&(c.get(v.sourceNodeId).push(v.targetNodeId),l.get(v.targetNodeId).push(v.sourceNodeId))});const p=t.filter(v=>{var w;return(((w=l.get(v.id))==null?void 0:w.length)??0)===0});p.length===0&&t.length>0&&p.push(t[0]);const h=new Map,u=[];for(p.forEach(v=>{h.set(v.id,0),u.push(v.id)});u.length>0;){const v=u.shift(),w=h.get(v)??0;for(const y of c.get(v)??[])h.has(y)||(h.set(y,w+1),u.push(y))}t.forEach(v=>{h.has(v.id)||h.set(v.id,0)});const g=new Map;t.forEach(v=>{const w=h.get(v.id)??0;g.has(w)||g.set(w,[]),g.get(w).push(v)});const f=new Map,m=n==="LR"||n==="RL",b=n==="BT"||n==="RL";return[...g.keys()].sort((v,w)=>v-w).forEach((v,w)=>{const y=g.get(v);let k=-(y.reduce((M,_)=>M+_.size.width,0)+(y.length-1)*i)/2;y.forEach(M=>{const _=w*(o+(m?M.size.width:M.size.height)),j=k+M.size.width/2;let z,P;m?(z=b?-_:_,P=j):(z=j,P=b?-_:_),f.set(M.id,{x:z,y:P}),k+=M.size.width+i})}),r.centerGraph&&Ta(f),{positions:f}}function Qi(t,a){const r=a.nodeSpacing??80,n=Math.ceil(Math.sqrt(t.length)),i=new Map;return t.forEach((o,c)=>{const l=c%n,d=Math.floor(c/n);i.set(o.id,{x:l*(o.size.width+r),y:d*(o.size.height+r)})}),a.centerGraph&&Ta(i),{positions:i}}function es(t,a){const r=new Map;if(t.length===0)return{positions:r};const n=new Map;t.forEach(d=>n.set(d.id,0)),a.forEach(d=>{n.set(d.sourceNodeId,(n.get(d.sourceNodeId)??0)+1),n.set(d.targetNodeId,(n.get(d.targetNodeId)??0)+1)});const i=[...t].sort((d,p)=>(n.get(p.id)??0)-(n.get(d.id)??0)),o=i[0];r.set(o.id,{x:0,y:0});const c=i.slice(1),l=200+c.length*20;return c.forEach((d,p)=>{const h=2*Math.PI*p/c.length;r.set(d.id,{x:Math.cos(h)*l,y:Math.sin(h)*l})}),{positions:r}}function ts(t,a,r){return cn(t,a,{...r,direction:r.direction??"TB",nodeSpacing:r.nodeSpacing??40,rankSpacing:r.rankSpacing??80})}function as(t,a,r){const n=new Map;if(t.length===0)return{positions:n};const i=400,o=new Map;t.forEach(u=>{o.set(u.id,{x:(Math.random()-.5)*i,y:(Math.random()-.5)*i})});const c=a.map(u=>({source:u.sourceNodeId,target:u.targetNodeId})),l=r.nodeSpacing??150,d=80,p=.95;let h=i/2;for(let u=0;u<d;u++){const g=new Map;t.forEach(f=>g.set(f.id,{fx:0,fy:0}));for(let f=0;f<t.length;f++)for(let m=f+1;m<t.length;m++){const b=o.get(t[f].id),C=o.get(t[m].id),v=C.x-b.x,w=C.y-b.y,y=Math.max(Math.sqrt(v*v+w*w),1),S=l*l/y,k=v/y*S,M=w/y*S;g.get(t[f].id).fx-=k,g.get(t[f].id).fy-=M,g.get(t[m].id).fx+=k,g.get(t[m].id).fy+=M}for(const f of c){const m=o.get(f.source),b=o.get(f.target);if(!m||!b)continue;const C=b.x-m.x,v=b.y-m.y,w=Math.max(Math.sqrt(C*C+v*v),1),y=w*w/l,S=C/w*y,k=v/w*y;g.get(f.source).fx+=S,g.get(f.source).fy+=k,g.get(f.target).fx-=S,g.get(f.target).fy-=k}t.forEach(f=>{const m=g.get(f.id),b=o.get(f.id),C=Math.sqrt(m.fx*m.fx+m.fy*m.fy);if(C>0){const v=Math.min(C,h);b.x+=m.fx/C*v,b.y+=m.fy/C*v}}),h*=p}return t.forEach(u=>{n.set(u.id,{...o.get(u.id)})}),r.centerGraph&&Ta(n),{positions:n}}function Ta(t){if(t.size===0)return;let a=1/0,r=1/0,n=-1/0,i=-1/0;t.forEach(l=>{a=Math.min(a,l.x),r=Math.min(r,l.y),n=Math.max(n,l.x),i=Math.max(i,l.y)});const o=(a+n)/2,c=(r+i)/2;t.forEach(l=>{l.x-=o,l.y-=c})}function dn(t){const a=s.useRef(null);a.current||(a.current=new ua(t));const r=a.current,[,n]=s.useState(0),i=s.useCallback(()=>n(l=>l+1),[]);s.useEffect(()=>r.subscribe(i),[r,i]);const o=r.getDocument(),c=s.useCallback(l=>{ln(r.getNodes(),r.getEdges(),l).positions.forEach((p,h)=>{r.moveNode(h,p)})},[r]);return s.useMemo(()=>({document:o,nodes:o.nodes,edges:o.edges,groups:o.groups,animations:o.animations,viewport:o.viewport,addNode:(l,d,p,h)=>r.addNode(l,d,p,h),updateNode:(l,d)=>r.updateNode(l,d),moveNode:(l,d)=>r.moveNode(l,d),resizeNode:(l,d)=>r.resizeNode(l,d),removeNode:l=>r.removeNode(l),addEdge:(l,d,p,h,u)=>r.addEdge(l,d,p,h,u),updateEdge:(l,d)=>r.updateEdge(l,d),removeEdge:l=>r.removeEdge(l),createGroup:(l,d)=>r.createGroup(l,d),removeGroup:l=>r.removeGroup(l),toggleGroupCollapse:l=>r.toggleGroupCollapse(l),toggleNodeCollapse:l=>r.toggleNodeCollapse(l),addAnimation:l=>r.addAnimation(l),updateAnimation:(l,d)=>r.updateAnimation(l,d),removeAnimation:l=>r.removeAnimation(l),animationModes:r.getAnimationModes(),activeAnimationMode:r.getActiveAnimationMode(),addAnimationMode:(l,d)=>r.addAnimationMode(l,d),removeAnimationMode:l=>r.removeAnimationMode(l),setActiveAnimationMode:l=>r.setActiveAnimationMode(l),addAnimationToMode:(l,d)=>r.addAnimationToMode(l,d),removeAnimationFromMode:(l,d)=>r.removeAnimationFromMode(l,d),setStylePreset:l=>r.setStylePreset(l),setStyleOverrides:l=>r.setStyleOverrides(l),stylePresetId:o.stylePresetId,playerConfig:r.getPlayerConfig(),setPlayerConfig:l=>r.setPlayerConfig(l),setViewMode:l=>r.setViewMode(l),viewMode:r.getPlayerConfig().mode,applyLayout:c,setViewport:l=>r.setViewport(l),undo:()=>r.undo(),redo:()=>r.redo(),canUndo:r.canUndo(),canRedo:r.canRedo(),loadDocument:l=>r.loadDocument(l),model:r}),[o,r,c])}class un{constructor(a){this.liquidFlows=new Map,this.glowStates=new Map,this.particles=[],this.emitters=[],this.rafId=0,this.running=!1,this.lastTime=0,this.tick=()=>{if(!this.running)return;const r=performance.now(),n=Math.min((r-this.lastTime)/1e3,.1);this.lastTime=r;for(const[,i]of this.liquidFlows)if(i.active){i.gradientOffset=(i.gradientOffset+n*.5)%1;for(const o of i.particles)o.t=(o.t+n*.3)%1,o.offset+=(Math.random()-.5)*n*2,o.offset=Math.max(-4,Math.min(4,o.offset)),o.opacity=.3+Math.sin(o.t*Math.PI)*.5}for(const[,i]of this.glowStates)i.pulse=(i.pulse+n*2)%(Math.PI*2);this.particles=this.particles.filter(i=>(i.life-=n/i.maxLife,i.life<=0?!1:(i.x+=i.vx*n,i.y+=i.vy*n,i.opacity=Math.min(1,i.life*2),!0)));for(const i of this.emitters)for(i.accumulator=(i.accumulator??0)+n*i.rate;i.accumulator>=1;){i.accumulator-=1;const o=Math.random()*Math.PI*2,c=i.speed*(.5+Math.random());this.particles.push({x:i.position.x+(Math.random()-.5)*i.spread,y:i.position.y+(Math.random()-.5)*i.spread,vx:Math.cos(o)*c,vy:Math.sin(o)*c,life:1,maxLife:i.particleLife,size:i.particleSize*(.5+Math.random()),color:i.color,opacity:1})}this.onFrame(this.getState()),this.rafId=requestAnimationFrame(this.tick)},this.onFrame=a}startLiquidFlow(a,r){const n=[],i=r.particleDensity??3;for(let o=0;o<i;o++)n.push({t:Math.random(),offset:(Math.random()-.5)*(r.pipeWidth??6),size:1.5+Math.random()*2,opacity:.4+Math.random()*.5});this.liquidFlows.set(a,{edgeId:a,gradientOffset:0,fillProgress:r.progress??0,particles:n,active:!0}),this.running||this.start()}stopLiquidFlow(a){this.liquidFlows.delete(a),this.liquidFlows.size===0&&this.glowStates.size===0&&this.emitters.length===0&&this.stop()}setGlow(a,r,n){this.glowStates.set(a,{elementId:a,color:r,intensity:n,pulse:0}),this.running||this.start()}removeGlow(a){this.glowStates.delete(a)}addEmitter(a){return this.emitters.push(a),this.running||this.start(),a.id}removeEmitter(a){this.emitters=this.emitters.filter(r=>r.id!==a)}start(){this.running||(this.running=!0,this.lastTime=performance.now(),this.tick())}stop(){this.running=!1,this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0}destroy(){this.stop(),this.liquidFlows.clear(),this.glowStates.clear(),this.particles=[],this.emitters=[]}isRunning(){return this.running}getState(){return{liquidFlows:new Map(this.liquidFlows),glowStates:new Map(this.glowStates),particles:[...this.particles]}}}function rs(t,a,r){if(!r)return{x:0,y:0};const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",t),r.appendChild(n);try{const i=n.getTotalLength(),o=n.getPointAtLength(a*i);return{x:o.x,y:o.y}}finally{r.removeChild(n)}}function pn(t){return`nd-glow-${t.replace(/[^a-zA-Z0-9]/g,"_")}`}function mn(t,a){const r=t*12,n=1+Math.sin(a)*.3;return r*n}const ns=.1,is=5,Jt=8,ya=[{cursor:"nw-resize",dx:0,dy:0,resizeX:-1,resizeY:-1},{cursor:"n-resize",dx:.5,dy:0,resizeX:0,resizeY:-1},{cursor:"ne-resize",dx:1,dy:0,resizeX:1,resizeY:-1},{cursor:"w-resize",dx:0,dy:.5,resizeX:-1,resizeY:0},{cursor:"e-resize",dx:1,dy:.5,resizeX:1,resizeY:0},{cursor:"sw-resize",dx:0,dy:1,resizeX:-1,resizeY:1},{cursor:"s-resize",dx:.5,dy:1,resizeX:0,resizeY:1},{cursor:"se-resize",dx:1,dy:1,resizeX:1,resizeY:1}],dt=({nodes:t,edges:a,groups:r=[],viewport:n,onViewportChange:i,theme:o,selectedId:c,selectedIds:l=[],onSelectElement:d,onMultiSelect:p,onNodeDragStart:h,onNodeDrag:u,onNodeDragEnd:g,onNodeResize:f,onNodeLabelChange:m,animationStates:b,particleState:C,viewMode:v="editor",ghostOpacity:w=.15,onGroupCollapse:y,onNodeCollapse:S,onInteraction:k,interactive:M=!1,showGrid:_=!0,showRulers:j=!1,snapToGrid:z=!0,gridSnapSize:P=10,className:I})=>{const D=s.useRef(null),[T,N]=s.useState(!1),[H,E]=s.useState({x:0,y:0}),[R,x]=s.useState(null),[$,A]=s.useState({x:0,y:0}),[O,F]=s.useState(null),[L,G]=s.useState(null),[V,B]=s.useState(null),[Y,J]=s.useState(null),[me,de]=s.useState(""),[oe,ae]=s.useState([]),ve=(o==null?void 0:o.canvasBackground)??"#f8f9fa",re=(o==null?void 0:o.gridColor)??"#e0e0e0",he=(o==null?void 0:o.gridSize)??20,we=(o==null?void 0:o.selectionColor)??"#2196f3",le=s.useMemo(()=>{const q=new Set(l);return c&&q.add(c),q},[c,l]),ke=s.useCallback(q=>z?Math.round(q/P)*P:q,[z,P]),U=s.useCallback((q,ce,ge)=>{const ye=[],fe=ce.x,X=ce.y,be=fe+ge.width/2,_e=X+ge.height/2,Ne=fe+ge.width,Me=X+ge.height;for(const Fe of t){if(Fe.id===q)continue;const Ee=Fe.position.x,Pe=Fe.position.y,Be=Ee+Fe.size.width/2,Ze=Pe+Fe.size.height/2,Xe=Ee+Fe.size.width,rt=Pe+Fe.size.height;Math.abs(fe-Ee)<5&&ye.push({x:Ee}),Math.abs(Ne-Xe)<5&&ye.push({x:Xe}),Math.abs(be-Be)<5&&ye.push({x:Be}),Math.abs(fe-Xe)<5&&ye.push({x:Xe}),Math.abs(Ne-Ee)<5&&ye.push({x:Ee}),Math.abs(X-Pe)<5&&ye.push({y:Pe}),Math.abs(Me-rt)<5&&ye.push({y:rt}),Math.abs(_e-Ze)<5&&ye.push({y:Ze}),Math.abs(X-rt)<5&&ye.push({y:rt}),Math.abs(Me-Pe)<5&&ye.push({y:Pe})}ae(ye)},[t]),Q=s.useCallback(q=>{if(q.preventDefault(),!i)return;const ce=q.deltaY>0?.9:1.1,ge=Math.min(is,Math.max(ns,n.zoom*ce)),ye=D.current;if(!ye)return;const je=ye.getBoundingClientRect(),fe=q.clientX-je.left,X=q.clientY-je.top,be=ge/n.zoom,_e=fe-(fe-n.x)*be,Ne=X-(X-n.y)*be;i({x:_e,y:Ne,zoom:ge})},[n,i]),W=s.useCallback(q=>{if(q.button===1||q.button===0&&q.target.tagName==="svg"){if(q.button===0&&M&&!q.shiftKey&&q.target.tagName==="svg"){const ce=D.current;if(ce){const ge=ce.getBoundingClientRect(),ye=(q.clientX-ge.left-n.x)/n.zoom,je=(q.clientY-ge.top-n.y)/n.zoom;G({x:ye,y:je}),F({x1:ye,y1:je,x2:ye,y2:je})}d&&d(null),p&&p([]);return}N(!0),E({x:q.clientX-n.x,y:q.clientY-n.y}),d&&q.button===0&&d(null)}},[n,d,p,M]),Z=s.useCallback(q=>{if(L){const ce=D.current;if(!ce)return;const ge=ce.getBoundingClientRect(),ye=(q.clientX-ge.left-n.x)/n.zoom,je=(q.clientY-ge.top-n.y)/n.zoom;F({x1:L.x,y1:L.y,x2:ye,y2:je});return}if(T&&i){i({...n,x:q.clientX-H.x,y:q.clientY-H.y});return}if(V&&f){const ce=D.current;if(!ce)return;const ge=ce.getBoundingClientRect(),ye=(q.clientX-ge.left-n.x)/n.zoom,je=(q.clientY-ge.top-n.y)/n.zoom,fe=ye-V.startMouse.x,X=je-V.startMouse.y,be=ya[V.handleIdx];let _e=V.startSize.width+fe*be.resizeX,Ne=V.startSize.height+X*be.resizeY,Me=V.startPos.x+(be.resizeX<0?fe:0),Fe=V.startPos.y+(be.resizeY<0?X:0);_e=Math.max(30,ke(_e)),Ne=Math.max(20,ke(Ne)),Me=ke(Me),Fe=ke(Fe),f(V.nodeId,{width:_e,height:Ne},{x:Me,y:Fe});return}if(R&&u){const ce=D.current;if(!ce)return;const ge=ce.getBoundingClientRect(),ye=ke((q.clientX-ge.left-n.x)/n.zoom-$.x),je=ke((q.clientY-ge.top-n.y)/n.zoom-$.y);u(R,{x:ye,y:je});const fe=t.find(X=>X.id===R);fe&&U(R,{x:ye,y:je},fe.size)}},[L,T,i,n,H,V,f,R,u,$,ke,t,U]),te=s.useCallback(q=>{if(O&&L){const ce=Math.min(O.x1,O.x2),ge=Math.min(O.y1,O.y2),ye=Math.max(O.x1,O.x2),je=Math.max(O.y1,O.y2);if(Math.abs(ye-ce)>5||Math.abs(je-ge)>5){const fe=t.filter(X=>{const be=X.position.x,_e=X.position.y,Ne=be+X.size.width,Me=_e+X.size.height;return Ne>ce&&be<ye&&Me>ge&&_e<je}).map(X=>X.id);p==null||p(fe),fe.length===1&&(d==null||d(fe[0]))}F(null),G(null);return}if(T&&N(!1),V){B(null);return}if(R&&g){const ce=D.current;if(!ce)return;const ge=ce.getBoundingClientRect(),ye=ke((q.clientX-ge.left-n.x)/n.zoom-$.x),je=ke((q.clientY-ge.top-n.y)/n.zoom-$.y);g(R,{x:ye,y:je})}x(null),ae([])},[O,L,T,V,R,g,n,$,ke,t,p,d]),ee=s.useCallback((q,ce)=>{if(q.stopPropagation(),!M)return;const ge=t.find(be=>be.id===ce);if(!ge||ge.locked)return;if(q.shiftKey&&p){const be=[...l],_e=be.indexOf(ce);_e>=0?be.splice(_e,1):be.push(ce),p(be);return}d==null||d(ce);const ye=D.current;if(!ye)return;const je=ye.getBoundingClientRect(),fe=(q.clientX-je.left-n.x)/n.zoom,X=(q.clientY-je.top-n.y)/n.zoom;A({x:fe-ge.position.x,y:X-ge.position.y}),x(ce),h==null||h(ce)},[M,t,n,d,h,p,l]),ie=s.useCallback((q,ce,ge)=>{if(q.stopPropagation(),!M)return;const ye=t.find(_e=>_e.id===ce);if(!ye||ye.locked)return;const je=D.current;if(!je)return;const fe=je.getBoundingClientRect(),X=(q.clientX-fe.left-n.x)/n.zoom,be=(q.clientY-fe.top-n.y)/n.zoom;B({nodeId:ce,handleIdx:ge,startMouse:{x:X,y:be},startPos:{...ye.position},startSize:{...ye.size}}),d==null||d(ce)},[M,t,n,d]),ne=s.useCallback((q,ce)=>{if(q.stopPropagation(),!M||!m)return;const ge=t.find(ye=>ye.id===ce);!ge||ge.locked||(J(ce),de(ge.label))},[M,t,m]),Ce=s.useCallback(()=>{Y&&m&&m(Y,me),J(null)},[Y,me,m]),ue=s.useCallback((q,ce)=>{q.stopPropagation(),d==null||d(ce)},[d]),$e=s.useCallback(q=>{const ce=t.find(ge=>ge.id===q);return ce?{x:ce.position.x+ce.size.width/2,y:ce.position.y+ce.size.height/2}:{x:0,y:0}},[t]),ze=s.useCallback((q,ce)=>{const ge=t.find(X=>X.id===q);if(!ge)return{x:0,y:0};const ye=ge.ports.find(X=>X.id===ce);if(!ye)return $e(q);const{position:je,size:fe}=ge;switch(ye.side){case"top":return{x:je.x+fe.width*ye.offset,y:je.y};case"bottom":return{x:je.x+fe.width*ye.offset,y:je.y+fe.height};case"left":return{x:je.x,y:je.y+fe.height*ye.offset};case"right":return{x:je.x+fe.width,y:je.y+fe.height*ye.offset};default:return $e(q)}},[t,$e]),Te=s.useCallback(q=>{const ce=ze(q.sourceNodeId,q.sourcePortId),ge=ze(q.targetNodeId,q.targetPortId);switch(q.style.lineType??"bezier"){case"straight":return`M ${ce.x} ${ce.y} L ${ge.x} ${ge.y}`;case"orthogonal":{const je=(ce.x+ge.x)/2;return`M ${ce.x} ${ce.y} L ${je} ${ce.y} L ${je} ${ge.y} L ${ge.x} ${ge.y}`}case"step":{const je=(ce.y+ge.y)/2;return`M ${ce.x} ${ce.y} L ${ce.x} ${je} L ${ge.x} ${je} L ${ge.x} ${ge.y}`}case"bezier":default:{const je=Math.abs(ge.x-ce.x)*.5;return`M ${ce.x} ${ce.y} C ${ce.x+je} ${ce.y}, ${ge.x-je} ${ge.y}, ${ge.x} ${ge.y}`}}},[ze]),Ve=s.useCallback((q,ce)=>{const{size:ge,style:ye,shape:je}=q,fe=ge.width,X=ge.height,_e=!!(ye.gradientColor&&ye.backgroundColor)?`url(#${ce})`:ye.backgroundColor??"#ffffff",Ne=ye.borderColor??"#333333",Me=ye.borderWidth??1,Fe=ye.borderRadius??(je==="roundedRect"?8:0),Ee=ye.borderStyle==="dashed"?"8,4":ye.borderStyle==="dotted"?"2,4":void 0,Pe=ye.shadow?"url(#nd-shadow)":void 0;switch(je){case"ellipse":case"circle":return e.jsx("ellipse",{cx:fe/2,cy:X/2,rx:fe/2,ry:X/2,fill:_e,stroke:Ne,strokeWidth:Me,strokeDasharray:Ee,filter:Pe});case"diamond":return e.jsx("polygon",{points:`${fe/2},0 ${fe},${X/2} ${fe/2},${X} 0,${X/2}`,fill:_e,stroke:Ne,strokeWidth:Me,strokeDasharray:Ee,filter:Pe});case"hexagon":{const Be=fe/4;return e.jsx("polygon",{points:`${Be},0 ${fe-Be},0 ${fe},${X/2} ${fe-Be},${X} ${Be},${X} 0,${X/2}`,fill:_e,stroke:Ne,strokeWidth:Me,strokeDasharray:Ee,filter:Pe})}case"parallelogram":{const Be=fe*.15;return e.jsx("polygon",{points:`${Be},0 ${fe},0 ${fe-Be},${X} 0,${X}`,fill:_e,stroke:Ne,strokeWidth:Me,strokeDasharray:Ee,filter:Pe})}case"cylinder":return e.jsxs("g",{filter:Pe,children:[e.jsx("ellipse",{cx:fe/2,cy:X*.1,rx:fe/2,ry:X*.1,fill:_e,stroke:Ne,strokeWidth:Me}),e.jsx("rect",{x:0,y:X*.1,width:fe,height:X*.8,fill:_e,stroke:"none"}),e.jsx("line",{x1:0,y1:X*.1,x2:0,y2:X*.9,stroke:Ne,strokeWidth:Me}),e.jsx("line",{x1:fe,y1:X*.1,x2:fe,y2:X*.9,stroke:Ne,strokeWidth:Me}),e.jsx("ellipse",{cx:fe/2,cy:X*.9,rx:fe/2,ry:X*.1,fill:_e,stroke:Ne,strokeWidth:Me})]});case"triangle":return e.jsx("polygon",{points:`${fe/2},0 ${fe},${X} 0,${X}`,fill:_e,stroke:Ne,strokeWidth:Me,strokeDasharray:Ee,filter:Pe});case"cloud":{const Be=`M${fe*.25},${X*.8} A${fe*.2},${fe*.2},0,1,1,${fe*.15},${X*.45} A${fe*.18},${fe*.18},0,1,1,${fe*.35},${X*.2} A${fe*.2},${fe*.2},0,1,1,${fe*.65},${X*.2} A${fe*.18},${fe*.18},0,1,1,${fe*.85},${X*.45} A${fe*.2},${fe*.2},0,1,1,${fe*.75},${X*.8} Z`;return e.jsx("path",{d:Be,fill:_e,stroke:Ne,strokeWidth:Me,filter:Pe})}case"document":{const Be=`M 0 0 L ${fe} 0 L ${fe} ${X*.85} Q ${fe*.75} ${X*.7}, ${fe*.5} ${X*.85} Q ${fe*.25} ${X}, 0 ${X*.85} Z`;return e.jsx("path",{d:Be,fill:_e,stroke:Ne,strokeWidth:Me,filter:Pe})}case"actor":return e.jsxs("g",{stroke:Ne,strokeWidth:Me,fill:"none",filter:Pe,children:[e.jsx("circle",{cx:fe/2,cy:X*.15,r:X*.12,fill:_e}),e.jsx("line",{x1:fe/2,y1:X*.27,x2:fe/2,y2:X*.6}),e.jsx("line",{x1:fe*.15,y1:X*.4,x2:fe*.85,y2:X*.4}),e.jsx("line",{x1:fe/2,y1:X*.6,x2:fe*.2,y2:X}),e.jsx("line",{x1:fe/2,y1:X*.6,x2:fe*.8,y2:X})]});case"rectangle":case"roundedRect":case"custom":default:return e.jsx("rect",{width:fe,height:X,rx:Fe,ry:Fe,fill:_e,stroke:Ne,strokeWidth:Me,strokeDasharray:Ee,filter:Pe})}},[]),De=s.useCallback(q=>{if(!b)return{};const ce=b.get(q);if(!ce)return{};const ge=ce.glow>0?`drop-shadow(0 0 ${ce.glow}px gold)`:"",ye=ce.highlightColor?`drop-shadow(0 0 6px ${ce.highlightColor})`:"";return{opacity:ce.opacity,transform:`translate(${ce.translateX}px, ${ce.translateY}px) scale(${ce.scale})`,filter:[ge,ye].filter(Boolean).join(" ")||void 0}},[b]),at=s.useMemo(()=>{if(!C)return null;const q=[];for(const[,ce]of C.glowStates){const ge=pn(ce.elementId),ye=mn(ce.intensity,ce.pulse);q.push(e.jsxs("filter",{id:ge,x:"-50%",y:"-50%",width:"200%",height:"200%",children:[e.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:ye,result:"blur"}),e.jsx("feFlood",{floodColor:ce.color,floodOpacity:.6,result:"color"}),e.jsx("feComposite",{in:"color",in2:"blur",operator:"in",result:"glowColored"}),e.jsxs("feMerge",{children:[e.jsx("feMergeNode",{in:"glowColored"}),e.jsx("feMergeNode",{in:"SourceGraphic"})]})]},ge))}return q},[C]),Ct=s.useMemo(()=>{if(!C)return null;const q=[];for(const[ce,ge]of C.liquidFlows){if(!ge.active)continue;const ye=a.find(_e=>_e.id===ce);if(!(ye!=null&&ye.style.liquidFlow))continue;const{color:je,colorEnd:fe}=ye.style.liquidFlow,X=`nd-liquid-${ce}`,be=ge.gradientOffset;q.push(e.jsxs("linearGradient",{id:X,x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:`${be*100%100}%`,stopColor:je,stopOpacity:.8}),e.jsx("stop",{offset:`${(be+.3)*100%100}%`,stopColor:fe??je,stopOpacity:.4}),e.jsx("stop",{offset:`${(be+.6)*100%100}%`,stopColor:je,stopOpacity:.8})]},X))}return q},[C,a]),yt=s.useMemo(()=>t.filter(q=>q.style.gradientColor&&q.style.backgroundColor).map(q=>{const ce=`nd-grad-${q.id}`,ge=q.style.gradientDirection??"vertical";if(ge==="radial")return e.jsxs("radialGradient",{id:ce,children:[e.jsx("stop",{offset:"0%",stopColor:q.style.backgroundColor}),e.jsx("stop",{offset:"100%",stopColor:q.style.gradientColor})]},ce);const ye=ge==="horizontal"||ge==="diagonal"?"1":"0",je=ge==="vertical"||ge==="diagonal"?"1":"0";return e.jsxs("linearGradient",{id:ce,x1:"0",y1:"0",x2:ye,y2:je,children:[e.jsx("stop",{offset:"0%",stopColor:q.style.backgroundColor}),e.jsx("stop",{offset:"100%",stopColor:q.style.gradientColor})]},ce)}),[t]);return e.jsxs("svg",{ref:D,className:`nice-diagram-canvas ${I??""}`,style:{width:"100%",height:"100%",background:ve,cursor:T?"grabbing":V&&V.nodeId?ya[V.handleIdx].cursor:"default"},onWheel:Q,onMouseDown:W,onMouseMove:Z,onMouseUp:te,onMouseLeave:te,children:[e.jsxs("defs",{children:[e.jsx("marker",{id:"nd-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0 L 10 5 L 0 10 Z",fill:"#333"})}),e.jsx("marker",{id:"nd-open-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0 L 10 5 L 0 10",fill:"none",stroke:"#333",strokeWidth:"1.5"})}),e.jsx("marker",{id:"nd-diamond-marker",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"10",markerHeight:"10",orient:"auto-start-reverse",children:e.jsx("polygon",{points:"5,0 10,5 5,10 0,5",fill:"#333"})}),e.jsx("marker",{id:"nd-circle-marker",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:e.jsx("circle",{cx:"5",cy:"5",r:"4",fill:"#333"})}),e.jsx("filter",{id:"nd-shadow",x:"-10%",y:"-10%",width:"130%",height:"130%",children:e.jsx("feDropShadow",{dx:"2",dy:"2",stdDeviation:"3",floodColor:"#00000033"})}),_&&e.jsx("pattern",{id:"nd-grid",width:he,height:he,patternUnits:"userSpaceOnUse",children:e.jsx("path",{d:`M ${he} 0 L 0 0 0 ${he}`,fill:"none",stroke:re,strokeWidth:"0.5"})}),yt,at,Ct,t.filter(q=>q.style.glowColor).map(q=>{const ce=`nd-node-glow-${q.id}`,ge=(q.style.glowIntensity??.5)*10;return e.jsxs("filter",{id:ce,x:"-50%",y:"-50%",width:"200%",height:"200%",children:[e.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:ge,result:"blur"}),e.jsx("feFlood",{floodColor:q.style.glowColor,floodOpacity:.5,result:"color"}),e.jsx("feComposite",{in:"color",in2:"blur",operator:"in",result:"glowColored"}),e.jsxs("feMerge",{children:[e.jsx("feMergeNode",{in:"glowColored"}),e.jsx("feMergeNode",{in:"SourceGraphic"})]})]},ce)})]}),j&&e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"0",y:"0",width:"100%",height:"20",fill:"#f0f0f0",stroke:"#ccc",strokeWidth:"0.5"}),e.jsx("rect",{x:"0",y:"0",width:"20",height:"100%",fill:"#f0f0f0",stroke:"#ccc",strokeWidth:"0.5"}),Array.from({length:100},(q,ce)=>{const ge=ce*he*n.zoom+n.x,ye=ce*he;return ge>20?e.jsxs("g",{children:[e.jsx("line",{x1:ge,y1:"0",x2:ge,y2:"20",stroke:"#999",strokeWidth:"0.5"}),e.jsx("text",{x:ge+2,y:"14",fontSize:"9",fill:"#666",children:ye})]},`rx${ce}`):null}),Array.from({length:100},(q,ce)=>{const ge=ce*he*n.zoom+n.y,ye=ce*he;return ge>20?e.jsxs("g",{children:[e.jsx("line",{x1:"0",y1:ge,x2:"20",y2:ge,stroke:"#999",strokeWidth:"0.5"}),e.jsx("text",{x:"2",y:ge-2,fontSize:"9",fill:"#666",writingMode:"tb",children:ye})]},`ry${ce}`):null})]}),e.jsxs("g",{transform:`translate(${n.x}, ${n.y}) scale(${n.zoom})`,children:[_&&e.jsx("rect",{x:"-10000",y:"-10000",width:"20000",height:"20000",fill:"url(#nd-grid)"}),r.map(q=>{var be,_e,Ne,Me,Fe,Ee,Pe,Be,Ze,Xe,rt,lt;const ce=t.filter(We=>q.nodeIds.includes(We.id));if(ce.length===0&&!q.collapsed)return null;const ge=((be=q.style)==null?void 0:be.padding)??20;if(q.collapsed){const We=t.find(Dt=>q.nodeIds.includes(Dt.id)),bt=We?We.position.x:0,St=We?We.position.y:0;return e.jsxs("g",{style:{cursor:"pointer"},onClick:()=>y==null?void 0:y(q.id),children:[e.jsx("rect",{x:bt,y:St,width:160,height:40,fill:((_e=q.style)==null?void 0:_e.backgroundColor)??"rgba(200,200,255,0.3)",stroke:((Ne=q.style)==null?void 0:Ne.borderColor)??"#aab",strokeWidth:((Me=q.style)==null?void 0:Me.borderWidth)??1,rx:((Fe=q.style)==null?void 0:Fe.borderRadius)??6,strokeDasharray:"6,3"}),e.jsxs("text",{x:bt+24,y:St+24,fontSize:"12",fill:((Ee=q.style)==null?void 0:Ee.labelColor)??"#666",fontWeight:"bold",children:["▶ ",q.label," (",q.nodeIds.length,")"]})]},q.id)}const ye=Math.min(...ce.map(We=>We.position.x))-ge,je=Math.min(...ce.map(We=>We.position.y))-ge,fe=Math.max(...ce.map(We=>We.position.x+We.size.width))+ge,X=Math.max(...ce.map(We=>We.position.y+We.size.height))+ge;return e.jsxs("g",{children:[e.jsx("rect",{x:ye,y:je,width:fe-ye,height:X-je,fill:((Pe=q.style)==null?void 0:Pe.backgroundColor)??"rgba(200,200,255,0.1)",stroke:((Be=q.style)==null?void 0:Be.borderColor)??"#aab",strokeWidth:((Ze=q.style)==null?void 0:Ze.borderWidth)??1,rx:((Xe=q.style)==null?void 0:Xe.borderRadius)??6,strokeDasharray:((rt=q.style)==null?void 0:rt.borderStyle)==="dashed"?"6,3":void 0}),e.jsx("text",{x:ye+6,y:je-4,fontSize:"12",fill:((lt=q.style)==null?void 0:lt.labelColor)??"#666",fontWeight:"bold",children:q.label}),(M||v!=="editor")&&y&&e.jsxs("g",{style:{cursor:"pointer"},onClick:We=>{We.stopPropagation(),y(q.id)},children:[e.jsx("rect",{x:fe-24,y:je-12,width:20,height:20,rx:4,fill:"white",stroke:"#999",strokeWidth:1}),e.jsx("text",{x:fe-14,y:je+3,textAnchor:"middle",fontSize:"12",fill:"#666",children:"▼"})]})]},q.id)}),oe.map((q,ce)=>e.jsx("line",{x1:q.x!=null?q.x:-1e4,y1:q.y!=null?q.y:-1e4,x2:q.x!=null?q.x:1e4,y2:q.y!=null?q.y:1e4,stroke:"#ff4081",strokeWidth:.5,strokeDasharray:"4,4"},`snap-${ce}`)),a.map(q=>{var Fe;const ce=Te(q),ge=le.has(q.id),ye=q.style.targetArrow==="diamond"?"url(#nd-diamond-marker)":q.style.targetArrow==="circle"?"url(#nd-circle-marker)":q.style.targetArrow==="openArrow"?"url(#nd-open-arrow)":q.style.targetArrow!=="none"?"url(#nd-arrow)":void 0,je=q.style.sourceArrow==="diamond"?"url(#nd-diamond-marker)":q.style.sourceArrow==="circle"?"url(#nd-circle-marker)":q.style.sourceArrow==="openArrow"?"url(#nd-open-arrow)":q.style.sourceArrow==="arrow"?"url(#nd-arrow)":void 0,fe=De(q.id),X=b==null?void 0:b.get(q.id),be=X==null?void 0:X.strokeProgress,_e=be!=null&&be>=0&&be<1?{strokeDasharray:"1000",strokeDashoffset:`${1e3*(1-be)}`}:void 0,Ne=q.style.liquidFlow,Me=C==null?void 0:C.liquidFlows.get(q.id);return e.jsxs("g",{style:fe,onClick:Ee=>ue(Ee,q.id),children:[M&&e.jsx("path",{d:ce,fill:"none",stroke:"transparent",strokeWidth:12,style:{cursor:"pointer"}}),(Ne==null?void 0:Ne.active)&&e.jsx("path",{d:ce,fill:"none",stroke:`url(#nd-liquid-${q.id})`,strokeWidth:Ne.pipeWidth??(q.style.strokeWidth??1.5)*4,strokeLinecap:"round",opacity:.5}),e.jsx("path",{d:ce,fill:"none",stroke:ge?we:q.style.strokeColor??"#333",strokeWidth:q.style.strokeWidth??1.5,strokeDasharray:(_e==null?void 0:_e.strokeDasharray)??((Fe=q.style.strokeDash)==null?void 0:Fe.join(","))??(q.style.animated?"6,4":void 0),strokeDashoffset:_e==null?void 0:_e.strokeDashoffset,markerEnd:ye,markerStart:je,opacity:q.style.opacity??1,style:M?{cursor:"pointer",transition:_e?void 0:"stroke-dashoffset 0.1s"}:void 0}),q.style.animated&&e.jsx("circle",{r:3,fill:we,children:e.jsx("animateMotion",{dur:`${1/(q.style.flowSpeed||1)}s`,repeatCount:"indefinite",path:ce})}),(Me==null?void 0:Me.active)&&Me.particles.map((Ee,Pe)=>e.jsx("circle",{r:Ee.size,fill:(Ne==null?void 0:Ne.color)??"#3b82f6",opacity:Ee.opacity*.6,children:e.jsx("animateMotion",{dur:`${3/(((Ne==null?void 0:Ne.speed)??1)+.5)}s`,repeatCount:"indefinite",path:ce,begin:`${Ee.t*3}s`})},`lp-${q.id}-${Pe}`)),X&&X.particleTrailT>=0&&e.jsxs(e.Fragment,{children:[e.jsx("circle",{r:4,fill:"#fbbf24",opacity:.8,children:e.jsx("animateMotion",{dur:"2s",repeatCount:"indefinite",path:ce,begin:`${X.particleTrailT*2}s`})}),e.jsx("circle",{r:2,fill:"#fbbf24",opacity:.5,children:e.jsx("animateMotion",{dur:"2s",repeatCount:"indefinite",path:ce,begin:`${(X.particleTrailT+.1)*2}s`})})]}),q.label&&(()=>{const Ee=ze(q.sourceNodeId,q.sourcePortId),Pe=ze(q.targetNodeId,q.targetPortId),Be=(Ee.x+Pe.x)/2,Ze=(Ee.y+Pe.y)/2;return e.jsxs("g",{children:[e.jsx("rect",{x:Be-4,y:Ze-16,width:q.label.length*7+8,height:18,rx:3,fill:"white",fillOpacity:.85}),e.jsx("text",{x:Be,y:Ze-2,textAnchor:"start",fontSize:"11",fill:"#555",children:q.label})]})})()]},q.id)}),t.filter(q=>!q.hidden||v==="editor").map(q=>{const ce=le.has(q.id),ge=De(q.id),ye=b==null?void 0:b.get(q.id),je=q.style.fontFamily??(o==null?void 0:o.fontFamily)??"sans-serif",fe=q.style.fontSize??14,X=q.style.fontColor??"#222",be=q.style.fontWeight??"normal",_e=q.style.fontStyle??"normal",Ne=q.style.textAlign??"center",Me=q.style.rotation??0,Fe=`nd-grad-${q.id}`,Ee=!!q.hidden,Pe=Ee?w??.3:q.style.opacity??1,Be=q.style.glowColor?`url(#nd-node-glow-${q.id})`:void 0,Ze=Ne==="left"?"start":Ne==="right"?"end":"middle",Xe=Ne==="left"?8:Ne==="right"?q.size.width-8:q.size.width/2,rt=ye==null?void 0:ye.typewriterChars,lt=rt!=null&&rt>=0?q.label.slice(0,rt):q.label,We=ye==null?void 0:ye.liquidFillProgress,bt=ye==null?void 0:ye.rippleRadius,St=ye==null?void 0:ye.rippleOpacity,Dt=q.childNodeIds&&q.childNodeIds.length>0,K=!!q.collapsed;return e.jsxs("g",{transform:`translate(${q.position.x}, ${q.position.y})${Me?` rotate(${Me}, ${q.size.width/2}, ${q.size.height/2})`:""}`,style:{...ge,cursor:Ee?"pointer":M&&!q.locked?"grab":"default",opacity:Pe,filter:Be},onMouseDown:se=>ee(se,q.id),onDoubleClick:se=>ne(se,q.id),onClick:se=>{se.stopPropagation(),d==null||d(q.id),q.interactions&&q.interactions.length>0&&q.interactions.filter(Ie=>Ie.trigger==="click").forEach(Ie=>k==null?void 0:k(q.id,Ie.id))},onMouseEnter:()=>{q.interactions&&q.interactions.filter(pe=>pe.trigger==="hover").forEach(pe=>k==null?void 0:k(q.id,pe.id))},children:[Ee&&e.jsx("rect",{x:-1,y:-1,width:q.size.width+2,height:q.size.height+2,fill:"none",stroke:"#999",strokeWidth:1,strokeDasharray:"3,3",rx:4,opacity:.5}),Ve(q,Fe),We!=null&&We>0&&We<1&&e.jsx("clipPath",{id:`nd-liquid-clip-${q.id}`,children:e.jsx("rect",{x:0,y:q.size.height*(1-We),width:q.size.width,height:q.size.height*We})}),We!=null&&We>0&&We<1&&e.jsx("rect",{x:0,y:0,width:q.size.width,height:q.size.height,fill:q.style.glowColor??"#3b82f6",opacity:.25,rx:q.style.borderRadius??4,clipPath:`url(#nd-liquid-clip-${q.id})`}),bt!=null&&bt>0&&e.jsx("circle",{cx:q.size.width/2,cy:q.size.height/2,r:bt,fill:"none",stroke:q.style.glowColor??we,strokeWidth:2,opacity:St??.5}),ce&&e.jsx("rect",{x:-3,y:-3,width:q.size.width+6,height:q.size.height+6,fill:"none",stroke:we,strokeWidth:2,strokeDasharray:"4,3",rx:6}),ce&&M&&!q.locked&&ya.map((se,pe)=>e.jsx("rect",{x:se.dx*q.size.width-Jt/2,y:se.dy*q.size.height-Jt/2,width:Jt,height:Jt,fill:"white",stroke:we,strokeWidth:1.5,rx:1,style:{cursor:se.cursor},onMouseDown:Ie=>ie(Ie,q.id,pe)},pe)),Y===q.id?e.jsx("foreignObject",{x:4,y:4,width:q.size.width-8,height:q.size.height-8,children:e.jsx("input",{xmlns:"http://www.w3.org/1999/xhtml",type:"text",value:me,onChange:se=>de(se.target.value),onBlur:Ce,onKeyDown:se=>{se.key==="Enter"&&Ce(),se.key==="Escape"&&J(null)},autoFocus:!0,style:{width:"100%",height:"100%",border:"1px solid "+we,borderRadius:3,padding:"2px 4px",fontSize:fe,fontFamily:je,fontWeight:be,fontStyle:_e,textAlign:Ne,background:"rgba(255,255,255,0.95)",outline:"none"}})}):e.jsxs(e.Fragment,{children:[e.jsx("text",{x:Xe,y:q.size.height/2+(q.description?-4:0),textAnchor:Ze,dominantBaseline:"central",fontFamily:je,fontSize:fe,fontWeight:be,fontStyle:_e,fill:X,pointerEvents:"none",children:lt}),q.description&&e.jsx("text",{x:Xe,y:q.size.height/2+fe*.8,textAnchor:Ze,dominantBaseline:"central",fontFamily:je,fontSize:fe*.75,fill:"#777",pointerEvents:"none",children:q.description}),q.icon&&e.jsx("text",{x:q.size.width/2,y:14,textAnchor:"middle",fontSize:16,pointerEvents:"none",children:q.icon}),q.style.linkUrl&&e.jsx("text",{x:q.size.width-4,y:12,textAnchor:"end",fontSize:10,fill:"#1976d2",pointerEvents:"none",children:"🔗"}),Dt&&M&&e.jsxs("g",{onClick:se=>{se.stopPropagation(),S==null||S(q.id)},style:{cursor:"pointer"},children:[e.jsx("rect",{x:q.size.width-18,y:q.size.height-18,width:16,height:16,rx:3,fill:"white",stroke:"#aaa",strokeWidth:.5}),e.jsx("text",{x:q.size.width-10,y:q.size.height-7,textAnchor:"middle",dominantBaseline:"central",fontSize:10,fill:"#666",children:K?"▶":"▼"})]})]}),M&&q.ports.map(se=>{const pe=ss(q,se.id);return e.jsx("circle",{cx:pe.x,cy:pe.y,r:4,fill:"#fff",stroke:"#666",strokeWidth:1,style:{cursor:"crosshair"}},se.id)})]},q.id)}),C&&C.particles.length>0&&e.jsx("g",{className:"nd-particle-overlay",children:C.particles.map((q,ce)=>e.jsx("circle",{cx:q.x,cy:q.y,r:q.size,fill:q.color,opacity:q.opacity},`ptcl-${ce}`))}),O&&e.jsx("rect",{x:Math.min(O.x1,O.x2),y:Math.min(O.y1,O.y2),width:Math.abs(O.x2-O.x1),height:Math.abs(O.y2-O.y1),fill:"rgba(33,150,243,0.1)",stroke:we,strokeWidth:1,strokeDasharray:"4,2"})]})]})};function ss(t,a){const r=t.ports.find(i=>i.id===a);if(!r)return{x:0,y:0};const{size:n}=t;switch(r.side){case"top":return{x:n.width*r.offset,y:0};case"bottom":return{x:n.width*r.offset,y:n.height};case"left":return{x:0,y:n.height*r.offset};case"right":return{x:n.width,y:n.height*r.offset};default:return{x:0,y:0}}}dt.displayName="DiagramCanvas";const Sr={en:{"toolbar.select":"Select","toolbar.addNode":"Add Node","toolbar.addEdge":"Add Edge","toolbar.group":"Group","toolbar.ungroup":"Ungroup","toolbar.delete":"Delete","toolbar.undo":"Undo","toolbar.redo":"Redo","toolbar.zoomIn":"Zoom In","toolbar.zoomOut":"Zoom Out","toolbar.fitToScreen":"Fit to Screen","toolbar.export":"Export","toolbar.import":"Import","toolbar.autoLayout":"Auto Layout","toolbar.animations":"Animations","toolbar.dataBinding":"Data Binding","layout.dagre":"Hierarchical","layout.forceDirected":"Force-Directed","layout.grid":"Grid","layout.radial":"Radial","layout.tree":"Tree","panel.properties":"Properties","panel.style":"Style","panel.animations":"Animations","panel.data":"Data","node.label":"Label","node.description":"Description","node.shape":"Shape","node.color":"Color","node.border":"Border","edge.label":"Label","edge.lineType":"Line Type","edge.arrow":"Arrow","export.svg":"SVG","export.png":"PNG","export.pdf":"PDF","export.mermaid":"Mermaid","export.ndd":"NDD (Native)","viewer.fullscreen":"Fullscreen","viewer.playAnimations":"Play Animations","viewer.stopAnimations":"Stop","viewer.print":"Print",untitled:"Untitled Diagram"},pl:{"toolbar.select":"Zaznacz","toolbar.addNode":"Dodaj węzeł","toolbar.addEdge":"Dodaj połączenie","toolbar.group":"Grupuj","toolbar.ungroup":"Rozgrupuj","toolbar.delete":"Usuń","toolbar.undo":"Cofnij","toolbar.redo":"Ponów","toolbar.zoomIn":"Powiększ","toolbar.zoomOut":"Pomniejsz","toolbar.fitToScreen":"Dopasuj do ekranu","toolbar.export":"Eksportuj","toolbar.import":"Importuj","toolbar.autoLayout":"Auto układ","toolbar.animations":"Animacje","toolbar.dataBinding":"Dane","layout.dagre":"Hierarchiczny","layout.forceDirected":"Siłowy","layout.grid":"Siatka","layout.radial":"Promieniowy","layout.tree":"Drzewo","panel.properties":"Właściwości","panel.style":"Styl","panel.animations":"Animacje","panel.data":"Dane","node.label":"Etykieta","node.description":"Opis","node.shape":"Kształt","node.color":"Kolor","node.border":"Obramowanie","edge.label":"Etykieta","edge.lineType":"Typ linii","edge.arrow":"Strzałka","export.svg":"SVG","export.png":"PNG","export.pdf":"PDF","export.mermaid":"Mermaid","export.ndd":"NDD (Natywny)","viewer.fullscreen":"Pełny ekran","viewer.playAnimations":"Odtwórz animacje","viewer.stopAnimations":"Zatrzymaj","viewer.print":"Drukuj",untitled:"Diagram bez nazwy"},de:{"toolbar.select":"Auswählen","toolbar.addNode":"Knoten hinzufügen","toolbar.addEdge":"Kante hinzufügen","toolbar.group":"Gruppieren","toolbar.ungroup":"Gruppierung aufheben","toolbar.delete":"Löschen","toolbar.undo":"Rückgängig","toolbar.redo":"Wiederholen","toolbar.zoomIn":"Vergrößern","toolbar.zoomOut":"Verkleinern","toolbar.fitToScreen":"An Bildschirm anpassen","toolbar.export":"Exportieren","toolbar.import":"Importieren","toolbar.autoLayout":"Automatisches Layout","toolbar.animations":"Animationen","toolbar.dataBinding":"Datenbindung","layout.dagre":"Hierarchisch","layout.forceDirected":"Kräftebasiert","layout.grid":"Raster","layout.radial":"Radial","layout.tree":"Baum","panel.properties":"Eigenschaften","panel.style":"Stil","panel.animations":"Animationen","panel.data":"Daten","node.label":"Bezeichnung","node.description":"Beschreibung","node.shape":"Form","node.color":"Farbe","node.border":"Rahmen","edge.label":"Bezeichnung","edge.lineType":"Linientyp","edge.arrow":"Pfeil","export.svg":"SVG","export.png":"PNG","export.pdf":"PDF","export.mermaid":"Mermaid","export.ndd":"NDD (Nativ)","viewer.fullscreen":"Vollbild","viewer.playAnimations":"Animationen abspielen","viewer.stopAnimations":"Stopp","viewer.print":"Drucken",untitled:"Unbenanntes Diagramm"},fr:{"toolbar.select":"Sélectionner","toolbar.addNode":"Ajouter un nœud","toolbar.addEdge":"Ajouter une arête","toolbar.group":"Grouper","toolbar.ungroup":"Dégrouper","toolbar.delete":"Supprimer","toolbar.undo":"Annuler","toolbar.redo":"Rétablir","toolbar.zoomIn":"Agrandir","toolbar.zoomOut":"Réduire","toolbar.fitToScreen":"Ajuster à l'écran","toolbar.export":"Exporter","toolbar.import":"Importer","toolbar.autoLayout":"Mise en page auto","toolbar.animations":"Animations","toolbar.dataBinding":"Liaison de données","layout.dagre":"Hiérarchique","layout.forceDirected":"Force dirigée","layout.grid":"Grille","layout.radial":"Radial","layout.tree":"Arbre","panel.properties":"Propriétés","panel.style":"Style","panel.animations":"Animations","panel.data":"Données","node.label":"Étiquette","node.description":"Description","node.shape":"Forme","node.color":"Couleur","node.border":"Bordure","edge.label":"Étiquette","edge.lineType":"Type de ligne","edge.arrow":"Flèche","export.svg":"SVG","export.png":"PNG","export.pdf":"PDF","export.mermaid":"Mermaid","export.ndd":"NDD (Natif)","viewer.fullscreen":"Plein écran","viewer.playAnimations":"Lire les animations","viewer.stopAnimations":"Arrêter","viewer.print":"Imprimer",untitled:"Diagramme sans titre"},es:{"toolbar.select":"Seleccionar","toolbar.addNode":"Añadir nodo","toolbar.addEdge":"Añadir arista","toolbar.group":"Agrupar","toolbar.ungroup":"Desagrupar","toolbar.delete":"Eliminar","toolbar.undo":"Deshacer","toolbar.redo":"Rehacer","toolbar.zoomIn":"Ampliar","toolbar.zoomOut":"Reducir","toolbar.fitToScreen":"Ajustar a pantalla","toolbar.export":"Exportar","toolbar.import":"Importar","toolbar.autoLayout":"Diseño automático","toolbar.animations":"Animaciones","toolbar.dataBinding":"Enlace de datos","layout.dagre":"Jerárquico","layout.forceDirected":"Fuerza dirigida","layout.grid":"Cuadrícula","layout.radial":"Radial","layout.tree":"Árbol","panel.properties":"Propiedades","panel.style":"Estilo","panel.animations":"Animaciones","panel.data":"Datos","node.label":"Etiqueta","node.description":"Descripción","node.shape":"Forma","node.color":"Color","node.border":"Borde","edge.label":"Etiqueta","edge.lineType":"Tipo de línea","edge.arrow":"Flecha","export.svg":"SVG","export.png":"PNG","export.pdf":"PDF","export.mermaid":"Mermaid","export.ndd":"NDD (Nativo)","viewer.fullscreen":"Pantalla completa","viewer.playAnimations":"Reproducir animaciones","viewer.stopAnimations":"Detener","viewer.print":"Imprimir",untitled:"Diagrama sin título"}},hn=s.createContext({locale:"en",t:(t,a)=>a??t});function Ra({locale:t="en",overrides:a,children:r}){const n=s.useMemo(()=>{const i={...Sr.en,...Sr[t],...a};return{locale:t,t:(c,l)=>i[c]??l??c}},[t,a]);return s.createElement(hn.Provider,{value:n},r)}function qt(){return s.useContext(hn)}function Ke(t){return{primary:"#3b82f6",primaryLight:"#93c5fd",secondary:"#6366f1",accent:"#f59e0b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",text:"#1e293b",textMuted:"#94a3b8",border:"#e2e8f0",surface:"#ffffff",surfaceAlt:"#f8fafc",...t}}function os(t,a={}){return{backgroundColor:t.surface,borderColor:t.primary,borderWidth:2,borderRadius:8,fontColor:t.text,fontSize:14,fontWeight:"normal",opacity:1,shadow:!0,...a}}function ls(t,a={}){return{strokeColor:t.border,strokeWidth:2,lineType:"bezier",targetArrow:"arrow",...a}}function cs(t,a={}){return{backgroundColor:`${t.primaryLight}18`,borderColor:t.primaryLight,borderWidth:1,borderStyle:"dashed",borderRadius:12,labelColor:t.text,padding:16,...a}}function Ye(t,a,r,n,i,o,c){return{canvas:t,nodeDefaults:os(a,n),edgeDefaults:ls(a,i),groupDefaults:cs(a,o),fontFamily:r,palette:a,effects:c}}const ut="'Inter', system-ui, sans-serif",Fa="'Fira Code', 'Cascadia Code', monospace",ds="'Merriweather', 'Georgia', serif",us={id:"default-light",name:"Default Light",category:"corporate",themeSource:"Light",config:Ye({background:"#ffffff",gridColor:"#e2e8f020",gridSize:20,selectionColor:"#3b82f6"},Ke({}),ut)},ps=Ke({primary:"#60a5fa",primaryLight:"#3b82f6",secondary:"#818cf8",accent:"#fbbf24",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee",text:"#f8fafc",textMuted:"#64748b",border:"#334155",surface:"#1e293b",surfaceAlt:"#0f172a"}),ms={id:"default-dark",name:"Default Dark",category:"dark",themeSource:"Dark",config:Ye({background:"#0f172a",gridColor:"#334155",gridSize:20,selectionColor:"#60a5fa"},ps,ut,{shadow:!1},{strokeColor:"#475569"},{backgroundColor:"#60a5fa10",borderColor:"#3b82f680"})},hs=Ke({primary:"#1d4ed8",primaryLight:"#93c5fd",secondary:"#3b82f6",text:"#1e3a5f",textMuted:"#7da0c4",border:"#93c5fd",surface:"#eff6ff",surfaceAlt:"#dbeafe"}),fs={id:"corporate-blue",name:"Corporate Blue",category:"corporate",themeSource:"Blue",config:Ye({background:"#f0f5ff",gridColor:"#93c5fd20",gridSize:20,selectionColor:"#1d4ed8"},hs,ut,{borderWidth:2,borderRadius:6},{strokeColor:"#93c5fd",strokeWidth:2})},gs=Ke({primary:"#00ff88",primaryLight:"#00cc6b",secondary:"#ff00ff",accent:"#00ffff",success:"#00ff88",warning:"#ffff00",error:"#ff3366",info:"#00ffff",text:"#e0e0e0",textMuted:"#808080",border:"#00ff8840",surface:"#1a1a2e",surfaceAlt:"#16213e"}),ys={id:"neon-glow",name:"Neon Glow",category:"dark",config:Ye({background:"#0a0a1a",gridColor:"#00ff8810",gridSize:20,selectionColor:"#00ff88"},gs,Fa,{borderColor:"#00ff88",borderWidth:2,shadow:!0,glowColor:"#00ff88",glowIntensity:.6},{strokeColor:"#00ff8880",strokeWidth:2},{backgroundColor:"#00ff880a",borderColor:"#00ff8840"},{glowColor:"#00ff88",glowIntensity:.8,particleColor:"#00ffff",liquidColor:"#00ff88",liquidColorEnd:"#00ffff"})},bs=Ke({primary:"#ff2d95",primaryLight:"#ff6db6",secondary:"#7928ca",accent:"#00d4ff",success:"#39ff14",warning:"#ffd700",error:"#ff073a",info:"#00d4ff",text:"#ffffff",textMuted:"#b0b0b0",border:"#ff2d9540",surface:"#1a0030",surfaceAlt:"#2d004a"}),xs={id:"cyberpunk",name:"Cyberpunk",category:"dark",config:Ye({background:"#0d001a",gridColor:"#ff2d9510",gridSize:24,selectionColor:"#ff2d95"},bs,Fa,{borderColor:"#ff2d95",borderWidth:2,glowColor:"#ff2d95",glowIntensity:.7,shadow:!0,gradientColor:"#2d004a",gradientDirection:"vertical"},{strokeColor:"#7928ca80",strokeWidth:3},{},{glowColor:"#ff2d95",glowIntensity:.9,particleColor:"#00d4ff",liquidColor:"#ff2d95",liquidColorEnd:"#7928ca"})},vs=Ke({primary:"#ffffff",primaryLight:"#ffffffaa",secondary:"#4da6ff",accent:"#ffffff",text:"#ffffff",textMuted:"#ffffffaa",border:"#ffffff40",surface:"#1e3d6e",surfaceAlt:"#163050"}),ks={id:"blueprint",name:"Technical Blueprint",category:"technical",config:Ye({background:"#0a1929",gridColor:"#4da6ff30",gridSize:16,selectionColor:"#ffffff"},vs,Fa,{backgroundColor:"transparent",borderColor:"#4da6ff",borderWidth:1,borderStyle:"solid",fontColor:"#ffffff",shadow:!1},{strokeColor:"#4da6ff",strokeWidth:1,strokeDash:[4,4]},{backgroundColor:"transparent",borderColor:"#4da6ff40",borderStyle:"dashed",borderWidth:1})},ws=Ke({primary:"#a78bfa",primaryLight:"#c4b5fd",secondary:"#f472b6",accent:"#fbbf24",success:"#6ee7b7",warning:"#fde68a",error:"#fca5a5",info:"#93c5fd",text:"#4a4a68",textMuted:"#9494b0",border:"#e2d8f4",surface:"#faf5ff",surfaceAlt:"#f3e8ff"}),_s={id:"pastel-dream",name:"Pastel Dream",category:"pastel",config:Ye({background:"#fefcff",gridColor:"#e2d8f420",gridSize:20,selectionColor:"#a78bfa"},ws,"'Nunito', 'Quicksand', sans-serif",{borderColor:"#c4b5fd",borderWidth:2,borderRadius:16,shadow:!0},{strokeColor:"#c4b5fd",strokeWidth:2},{backgroundColor:"#a78bfa10",borderColor:"#c4b5fd",borderRadius:16})},js=Ke({primary:"#059669",primaryLight:"#6ee7b7",secondary:"#065f46",accent:"#f59e0b",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#0d9488",text:"#1a3d2f",textMuted:"#6b8f7f",border:"#a7d7c5",surface:"#ecfdf5",surfaceAlt:"#d1fae5"}),Cs={id:"nature-forest",name:"Nature Forest",category:"nature",config:Ye({background:"#f0fdf4",gridColor:"#a7d7c520",gridSize:20,selectionColor:"#059669"},js,ut,{borderColor:"#059669",borderRadius:12},{strokeColor:"#6ee7b7"},{backgroundColor:"#05966910",borderColor:"#6ee7b7"},{liquidColor:"#059669",liquidColorEnd:"#6ee7b7",particleColor:"#f59e0b"})},Ss=Ke({primary:"#00ff00",primaryLight:"#00cc00",secondary:"#00ff00",accent:"#ffff00",text:"#00ff00",textMuted:"#00990088",border:"#00ff0040",surface:"#001100",surfaceAlt:"#002200"}),Ns={id:"retro-terminal",name:"Retro Terminal",category:"retro",config:Ye({background:"#000800",gridColor:"#00ff0010",gridSize:16,selectionColor:"#00ff00"},Ss,"'Courier New', 'Fira Code', monospace",{backgroundColor:"#001100",borderColor:"#00ff0060",borderWidth:1,fontColor:"#00ff00",shadow:!1,glowColor:"#00ff00",glowIntensity:.4},{strokeColor:"#00ff0060",strokeWidth:1},{},{glowColor:"#00ff00",glowIntensity:.6,particleColor:"#00ff00",liquidColor:"#00ff00"})},Ms=Ke({primary:"#0000ff",primaryLight:"#6666ff",secondary:"#ff00ff",accent:"#ffff00",text:"#000000",textMuted:"#555555",border:"#000000",surface:"#ffffff",surfaceAlt:"#eeeeee"}),$s={id:"high-contrast",name:"High Contrast",category:"accessibility",themeSource:"High Contrast",config:Ye({background:"#ffffff",gridColor:"#00000020",gridSize:20,selectionColor:"#0000ff"},Ms,"Arial, sans-serif",{borderColor:"#000000",borderWidth:3,fontColor:"#000000",fontWeight:"bold"},{strokeColor:"#000000",strokeWidth:3},{borderColor:"#000000",borderWidth:2})},zs=Ke({primary:"#1976d2",primaryLight:"#64b5f6",secondary:"#9c27b0",accent:"#ff9800",success:"#4caf50",warning:"#ff9800",error:"#f44336",info:"#03a9f4",text:"#212121",textMuted:"#757575",border:"#e0e0e0",surface:"#fafafa",surfaceAlt:"#f5f5f5"}),Es={id:"material-design",name:"Material Design",category:"theme-based",themeSource:"Material",config:Ye({background:"#fafafa",gridColor:"#e0e0e020",gridSize:20,selectionColor:"#1976d2"},zs,"'Roboto', 'Noto Sans', sans-serif",{borderRadius:4,borderWidth:0,shadow:!0},{strokeColor:"#bdbdbd",strokeWidth:2},{borderRadius:8})},As=Ke({primary:"#0078d4",primaryLight:"#6cb8f7",secondary:"#8661c5",accent:"#ffaa44",success:"#107c10",warning:"#ffaa44",error:"#d13438",info:"#0078d4",text:"#323130",textMuted:"#a19f9d",border:"#edebe9",surface:"#ffffff",surfaceAlt:"#faf9f8"}),Ds={id:"fluent-ui",name:"Fluent UI",category:"theme-based",themeSource:"Fluent",config:Ye({background:"#faf9f8",gridColor:"#edebe920",gridSize:20,selectionColor:"#0078d4"},As,"'Segoe UI', system-ui, sans-serif",{borderRadius:4,borderWidth:1,shadow:!0},{strokeColor:"#c8c6c4",strokeWidth:1})},Ts=Ke({primary:"#e65100",primaryLight:"#ff9e80",secondary:"#ff6f00",accent:"#ffd600",success:"#43a047",warning:"#ff6f00",error:"#c62828",info:"#0277bd",text:"#3e2723",textMuted:"#8d6e63",border:"#ffccbc",surface:"#fff8e1",surfaceAlt:"#fff3e0"}),Rs={id:"sunset-warm",name:"Sunset Warm",category:"creative",config:Ye({background:"#fffde7",gridColor:"#ffccbc20",gridSize:20,selectionColor:"#e65100"},Ts,ut,{borderColor:"#ff9e80",gradientColor:"#fff3e0",gradientDirection:"vertical"},{strokeColor:"#ff9e80"},{},{liquidColor:"#e65100",liquidColorEnd:"#ffd600",particleColor:"#ffd600"})},Fs=Ke({primary:"#006064",primaryLight:"#4dd0e1",secondary:"#00838f",accent:"#ffd54f",success:"#00e676",warning:"#ffd54f",error:"#ff5252",info:"#40c4ff",text:"#004d40",textMuted:"#80cbc4",border:"#b2ebf2",surface:"#e0f7fa",surfaceAlt:"#b2ebf2"}),Is={id:"ocean-deep",name:"Ocean Deep",category:"nature",config:Ye({background:"#e0f7fa",gridColor:"#b2ebf220",gridSize:20,selectionColor:"#006064"},Fs,ut,{borderColor:"#00838f",borderRadius:12},{strokeColor:"#4dd0e1"},{},{liquidColor:"#006064",liquidColorEnd:"#4dd0e1",particleColor:"#ffd54f"})},Ps=Ke({primary:"#5d4037",primaryLight:"#a1887f",secondary:"#795548",accent:"#c6a263",text:"#3e2723",textMuted:"#8d6e63",border:"#bcaaa4",surface:"#fdf6f0",surfaceAlt:"#efebe9"}),Ls={id:"elegant-serif",name:"Elegant Serif",category:"creative",config:Ye({background:"#fdf6f0",gridColor:"#bcaaa420",gridSize:24,selectionColor:"#5d4037"},Ps,ds,{borderColor:"#a1887f",borderWidth:1,borderRadius:2,fontStyle:"normal"},{strokeColor:"#bcaaa4",strokeWidth:1},{borderRadius:4})},Os=Ke({primary:"#333333",primaryLight:"#666666",secondary:"#555555",accent:"#ff6600",text:"#333333",textMuted:"#999999",border:"#cccccc",surface:"#ffffff",surfaceAlt:"#f5f5f5"}),Bs={id:"wireframe",name:"Wireframe",category:"technical",config:Ye({background:"#ffffff",gridColor:"#00000008",gridSize:16,selectionColor:"#ff6600"},Os,"'Balsamiq Sans', 'Comic Sans MS', cursive",{backgroundColor:"transparent",borderColor:"#999999",borderWidth:1,borderStyle:"solid",shadow:!1,borderRadius:4},{strokeColor:"#999999",strokeWidth:1},{backgroundColor:"transparent",borderStyle:"dashed",borderWidth:1,borderColor:"#cccccc"})},Ws=Ke({primary:"#00bfa5",primaryLight:"#64ffda",secondary:"#00897b",accent:"#ff6e40",success:"#00e676",warning:"#ffc400",error:"#ff1744",info:"#00e5ff",text:"#1b5e20",textMuted:"#81c784",border:"#a7ffeb",surface:"#e0f2f1",surfaceAlt:"#b2dfdb"}),Hs={id:"mint-fresh",name:"Mint Fresh",category:"nature",config:Ye({background:"#e8f5e9",gridColor:"#a7ffeb20",gridSize:20,selectionColor:"#00bfa5"},Ws,ut,{borderColor:"#00bfa5",borderRadius:20,borderWidth:2,gradientColor:"#b2dfdb",gradientDirection:"radial"},{strokeColor:"#64ffda",strokeWidth:2},{borderRadius:16},{liquidColor:"#00bfa5",liquidColorEnd:"#64ffda",particleColor:"#ff6e40"})},qs=Ke({primary:"#424242",primaryLight:"#9e9e9e",secondary:"#616161",accent:"#ff5722",text:"#212121",textMuted:"#bdbdbd",border:"#e0e0e0",surface:"#fafafa",surfaceAlt:"#f5f5f5"}),Vs={id:"monochrome",name:"Monochrome",category:"corporate",config:Ye({background:"#fafafa",gridColor:"#e0e0e020",gridSize:20,selectionColor:"#424242"},qs,ut,{borderColor:"#9e9e9e",borderWidth:1,shadow:!0,borderRadius:4},{strokeColor:"#9e9e9e",strokeWidth:1.5})},Ks=Ke({primary:"#e91e63",primaryLight:"#f48fb1",secondary:"#9c27b0",accent:"#ffeb3b",success:"#4caf50",warning:"#ff9800",error:"#f44336",info:"#00bcd4",text:"#4a148c",textMuted:"#ce93d8",border:"#f8bbd0",surface:"#fce4ec",surfaceAlt:"#f3e5f5"}),Ys={id:"candy-pop",name:"Candy Pop",category:"creative",config:Ye({background:"#fff0f5",gridColor:"#f8bbd020",gridSize:20,selectionColor:"#e91e63"},Ks,"'Quicksand', 'Nunito', sans-serif",{borderColor:"#e91e63",borderRadius:24,borderWidth:3,gradientColor:"#f3e5f5",gradientDirection:"diagonal"},{strokeColor:"#f48fb1",strokeWidth:3},{borderRadius:20,borderColor:"#f48fb1"},{glowColor:"#e91e63",glowIntensity:.5,particleColor:"#ffeb3b"})},Gs=Ke({primary:"#475569",primaryLight:"#94a3b8",secondary:"#334155",accent:"#f59e0b",text:"#0f172a",textMuted:"#94a3b8",border:"#cbd5e1",surface:"#f8fafc",surfaceAlt:"#f1f5f9"}),Us={id:"slate-professional",name:"Slate Professional",category:"corporate",config:Ye({background:"#f8fafc",gridColor:"#cbd5e120",gridSize:20,selectionColor:"#475569"},Gs,"'Inter', system-ui, sans-serif",{borderColor:"#cbd5e1",borderWidth:1,borderRadius:6,shadow:!0},{strokeColor:"#94a3b8",strokeWidth:1.5},{borderColor:"#cbd5e1",borderRadius:8})},Zs=Ke({primary:"#7c3aed",primaryLight:"#a78bfa",secondary:"#06b6d4",accent:"#f472b6",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee",text:"#e2e8f0",textMuted:"#94a3b8",border:"#7c3aed40",surface:"#1e1b4b",surfaceAlt:"#312e81"}),Xs={id:"aurora-borealis",name:"Aurora Borealis",category:"dark",config:Ye({background:"#0f0b2e",gridColor:"#7c3aed15",gridSize:24,selectionColor:"#a78bfa"},Zs,ut,{borderColor:"#7c3aed",borderWidth:2,gradientColor:"#312e81",gradientDirection:"vertical",glowColor:"#a78bfa",glowIntensity:.5},{strokeColor:"#7c3aed80",strokeWidth:2},{},{glowColor:"#a78bfa",glowIntensity:.7,particleColor:"#06b6d4",liquidColor:"#7c3aed",liquidColorEnd:"#06b6d4"})},Js=Ke({primary:"#2c3e50",primaryLight:"#7f8c8d",secondary:"#2980b9",accent:"#e74c3c",text:"#2c3e50",textMuted:"#95a5a6",border:"#bdc3c7",surface:"#fdfaf6",surfaceAlt:"#f5f0e8"}),Qs={id:"sketch-hand-drawn",name:"Sketch / Hand-drawn",category:"creative",config:Ye({background:"#fdfaf6",gridColor:"#bdc3c720",gridSize:20,selectionColor:"#2980b9"},Js,"'Caveat', 'Patrick Hand', cursive",{backgroundColor:"#fdfaf6",borderColor:"#2c3e50",borderWidth:2,borderRadius:2,shadow:!1},{strokeColor:"#2c3e50",strokeWidth:2},{borderStyle:"dashed",borderWidth:2})},eo=Ke({primary:"#2196f3",primaryLight:"#64b5f6",secondary:"#ff9800",accent:"#ff5722",success:"#4caf50",warning:"#ffc107",error:"#f44336",info:"#03a9f4",text:"#ffffff",textMuted:"#b0bec5",border:"#ffffff40",surface:"#2196f3",surfaceAlt:"#1565c0"}),to={id:"infographic-bold",name:"Infographic Bold",category:"creative",config:Ye({background:"#eceff1",gridColor:"#b0bec520",gridSize:24,selectionColor:"#ff5722"},eo,"'Montserrat', 'Roboto', sans-serif",{backgroundColor:"#2196f3",borderColor:"#1565c0",borderWidth:0,fontColor:"#ffffff",fontWeight:"bold",borderRadius:12,shadow:!0},{strokeColor:"#90a4ae",strokeWidth:3},{backgroundColor:"#2196f320",borderWidth:2,borderRadius:16})},ao=Ke({primary:"#9333ea",primaryLight:"#c084fc",secondary:"#6366f1",accent:"#f59e0b",text:"#f1f5f9",textMuted:"#a78bfa",border:"#7c3aed40",surface:"#1c1033",surfaceAlt:"#2d1b69"}),ro={id:"midnight-purple",name:"Midnight Purple",category:"dark",config:Ye({background:"#0f0720",gridColor:"#9333ea10",gridSize:20,selectionColor:"#c084fc"},ao,ut,{borderColor:"#9333ea",borderWidth:2,gradientColor:"#2d1b69",gradientDirection:"vertical",shadow:!1},{strokeColor:"#9333ea80",strokeWidth:2},{},{glowColor:"#9333ea",glowIntensity:.6,liquidColor:"#9333ea",liquidColorEnd:"#c084fc"})},pa=[us,ms,fs,Es,Ds,ys,xs,ks,Ns,_s,Rs,Is,Ls,Cs,Bs,$s,Hs,Vs,Ys,Us,Xs,Qs,to,ro],no=[{id:"fill-solid",name:"Solid Fill",category:"fill",style:{opacity:1}},{id:"fill-gradient-v",name:"Vertical Gradient",category:"fill",style:{gradientColor:"#e2e8f0",gradientDirection:"vertical"}},{id:"fill-gradient-h",name:"Horizontal Gradient",category:"fill",style:{gradientColor:"#e2e8f0",gradientDirection:"horizontal"}},{id:"fill-gradient-d",name:"Diagonal Gradient",category:"fill",style:{gradientColor:"#e2e8f0",gradientDirection:"diagonal"}},{id:"fill-gradient-r",name:"Radial Gradient",category:"fill",style:{gradientColor:"#e2e8f0",gradientDirection:"radial"}},{id:"fill-transparent",name:"Transparent",category:"fill",style:{backgroundColor:"transparent",opacity:1}},{id:"fill-semi",name:"Semi-transparent",category:"fill",style:{opacity:.6}},{id:"fill-glass",name:"Glassmorphism",category:"fill",style:{opacity:.7,gradientColor:"#ffffff40",gradientDirection:"vertical",borderWidth:1,borderColor:"#ffffff60"}},{id:"border-none",name:"No Border",category:"border",style:{borderWidth:0}},{id:"border-thin",name:"Thin Border",category:"border",style:{borderWidth:1}},{id:"border-medium",name:"Medium Border",category:"border",style:{borderWidth:2}},{id:"border-thick",name:"Thick Border",category:"border",style:{borderWidth:3}},{id:"border-heavy",name:"Heavy Border",category:"border",style:{borderWidth:4}},{id:"border-solid",name:"Solid",category:"border",style:{borderStyle:"solid"}},{id:"border-dashed",name:"Dashed",category:"border",style:{borderStyle:"dashed"}},{id:"border-dotted",name:"Dotted",category:"border",style:{borderStyle:"dotted"}},{id:"border-rounded-sm",name:"Rounded Small",category:"border",style:{borderRadius:4}},{id:"border-rounded-md",name:"Rounded Medium",category:"border",style:{borderRadius:8}},{id:"border-rounded-lg",name:"Rounded Large",category:"border",style:{borderRadius:16}},{id:"border-rounded-xl",name:"Rounded XL",category:"border",style:{borderRadius:24}},{id:"border-pill",name:"Pill / Capsule",category:"border",style:{borderRadius:999}},{id:"border-sharp",name:"Sharp Corners",category:"border",style:{borderRadius:0}},{id:"effect-shadow",name:"Drop Shadow",category:"effect",style:{shadow:!0}},{id:"effect-no-shadow",name:"No Shadow",category:"effect",style:{shadow:!1}},{id:"effect-glow-blue",name:"Blue Glow",category:"effect",style:{glowColor:"#3b82f6",glowIntensity:.6}},{id:"effect-glow-green",name:"Green Glow",category:"effect",style:{glowColor:"#10b981",glowIntensity:.6}},{id:"effect-glow-red",name:"Red Glow",category:"effect",style:{glowColor:"#ef4444",glowIntensity:.6}},{id:"effect-glow-purple",name:"Purple Glow",category:"effect",style:{glowColor:"#8b5cf6",glowIntensity:.6}},{id:"effect-glow-gold",name:"Gold Glow",category:"effect",style:{glowColor:"#f59e0b",glowIntensity:.6}},{id:"effect-glow-neon",name:"Neon Glow",category:"effect",style:{glowColor:"#00ff88",glowIntensity:.8}}],io=[{id:"line-straight",name:"Straight",category:"type",style:{lineType:"straight"}},{id:"line-bezier",name:"Bezier Curve",category:"type",style:{lineType:"bezier"}},{id:"line-orthogonal",name:"Orthogonal",category:"type",style:{lineType:"orthogonal"}},{id:"line-step",name:"Step",category:"type",style:{lineType:"step"}},{id:"stroke-thin",name:"Thin Stroke",category:"stroke",style:{strokeWidth:1}},{id:"stroke-medium",name:"Medium Stroke",category:"stroke",style:{strokeWidth:2}},{id:"stroke-thick",name:"Thick Stroke",category:"stroke",style:{strokeWidth:3}},{id:"stroke-heavy",name:"Heavy Stroke",category:"stroke",style:{strokeWidth:4}},{id:"stroke-solid",name:"Solid",category:"stroke",style:{strokeDash:[]}},{id:"stroke-dashed",name:"Dashed",category:"stroke",style:{strokeDash:[8,4]}},{id:"stroke-dotted",name:"Dotted",category:"stroke",style:{strokeDash:[2,4]}},{id:"stroke-dash-dot",name:"Dash-Dot",category:"stroke",style:{strokeDash:[8,4,2,4]}},{id:"stroke-long-dash",name:"Long Dash",category:"stroke",style:{strokeDash:[16,8]}},{id:"arrow-target-none",name:"No Target Arrow",category:"arrow",style:{targetArrow:"none"}},{id:"arrow-target-arrow",name:"Arrow →",category:"arrow",style:{targetArrow:"arrow"}},{id:"arrow-target-open",name:"Open Arrow ▷",category:"arrow",style:{targetArrow:"openArrow"}},{id:"arrow-target-diamond",name:"Diamond ◇",category:"arrow",style:{targetArrow:"diamond"}},{id:"arrow-target-circle",name:"Circle ○",category:"arrow",style:{targetArrow:"circle"}},{id:"arrow-source-none",name:"No Source Arrow",category:"arrow",style:{sourceArrow:"none"}},{id:"arrow-source-arrow",name:"← Source Arrow",category:"arrow",style:{sourceArrow:"arrow"}},{id:"arrow-source-open",name:"◁ Open Source",category:"arrow",style:{sourceArrow:"openArrow"}},{id:"arrow-source-diamond",name:"◇ Diamond Source",category:"arrow",style:{sourceArrow:"diamond"}},{id:"arrow-source-circle",name:"○ Circle Source",category:"arrow",style:{sourceArrow:"circle"}},{id:"arrow-bidirectional",name:"↔ Bidirectional",category:"arrow",style:{sourceArrow:"arrow",targetArrow:"arrow"}},{id:"arrow-association",name:" Association (none)",category:"arrow",style:{sourceArrow:"none",targetArrow:"none"}},{id:"arrow-composition",name:"◆→ Composition",category:"arrow",style:{sourceArrow:"diamond",targetArrow:"arrow"}},{id:"arrow-aggregation",name:"◇→ Aggregation",category:"arrow",style:{sourceArrow:"diamond",targetArrow:"arrow"}},{id:"arrow-dependency",name:"- - → Dependency",category:"arrow",style:{targetArrow:"openArrow",strokeDash:[8,4]}},{id:"arrow-inheritance",name:"△→ Inheritance",category:"arrow",style:{targetArrow:"openArrow"}},{id:"effect-animated",name:"Animated Flow",category:"effect",style:{animated:!0,flowSpeed:1}},{id:"effect-animated-fast",name:"Fast Animated",category:"effect",style:{animated:!0,flowSpeed:2}},{id:"effect-animated-slow",name:"Slow Animated",category:"effect",style:{animated:!0,flowSpeed:.5}},{id:"effect-liquid",name:"Liquid Flow",category:"effect",style:{liquidFlow:{active:!0,color:"#3b82f6",speed:1}}},{id:"effect-liquid-neon",name:"Neon Liquid",category:"effect",style:{liquidFlow:{active:!0,color:"#00ff88",colorEnd:"#00ffff",speed:1.5,particleDensity:5}}}],fn=[{id:"tp-fade-in",name:"Fade In",effect:"fadeIn",durationMs:400,easing:"easeOut",description:"Smoothly fades in"},{id:"tp-fade-out",name:"Fade Out",effect:"fadeOut",durationMs:400,easing:"easeIn",description:"Smoothly fades out"},{id:"tp-slide-left",name:"Slide Left",effect:"slideInLeft",durationMs:500,easing:"easeOut",description:"Slides in from left"},{id:"tp-slide-right",name:"Slide Right",effect:"slideInRight",durationMs:500,easing:"easeOut",description:"Slides in from right"},{id:"tp-slide-top",name:"Slide Down",effect:"slideInTop",durationMs:500,easing:"easeOut",description:"Slides in from top"},{id:"tp-slide-bottom",name:"Slide Up",effect:"slideInBottom",durationMs:500,easing:"easeOut",description:"Slides in from bottom"},{id:"tp-zoom-in",name:"Zoom In",effect:"zoomIn",durationMs:400,easing:"spring",description:"Zooms in with spring"},{id:"tp-zoom-out",name:"Zoom Out",effect:"zoomOut",durationMs:400,easing:"easeIn",description:"Zooms out"},{id:"tp-bounce",name:"Bounce In",effect:"bounce",durationMs:800,easing:"bounce",description:"Bounces into place"},{id:"tp-pulse",name:"Pulse",effect:"pulse",durationMs:1e3,easing:"easeInOut",description:"Pulsing scale effect"},{id:"tp-shake",name:"Shake",effect:"shake",durationMs:600,easing:"linear",description:"Shakes horizontally"},{id:"tp-glow",name:"Glow",effect:"glow",durationMs:1200,easing:"easeInOut",description:"Glowing highlight"},{id:"tp-highlight",name:"Highlight",effect:"highlight",durationMs:800,easing:"easeInOut",description:"Golden highlight flash"},{id:"tp-ripple",name:"Ripple",effect:"ripple",durationMs:1e3,easing:"easeOut",description:"Ripple wave effect"},{id:"tp-expand",name:"Expand",effect:"expand",durationMs:500,easing:"spring",description:"Expand from collapsed"},{id:"tp-collapse",name:"Collapse",effect:"collapse",durationMs:400,easing:"easeIn",description:"Collapse to hidden"},{id:"tp-color-shift",name:"Color Shift",effect:"colorShift",durationMs:2e3,easing:"linear",description:"Rainbow color cycle"},{id:"tp-liquid-fill",name:"Liquid Fill",effect:"liquidFill",durationMs:1500,easing:"easeInOut",description:"Liquid filling effect"},{id:"tp-draw-path",name:"Draw Path",effect:"drawPath",durationMs:1200,easing:"easeOut",description:"Edge draws itself"},{id:"tp-particle-trail",name:"Particle Trail",effect:"particleTrail",durationMs:2e3,easing:"linear",description:"Particles along edge"},{id:"tp-typewriter",name:"Typewriter",effect:"typewriter",durationMs:1500,easing:"linear",description:"Text appears letter by letter"}];function so(t){return pa.find(a=>a.id===t)}function oo(t){return pa.filter(a=>a.category===t)}function lo(t){return{canvasBackground:t.canvas.background,gridColor:t.canvas.gridColor,gridSize:t.canvas.gridSize,selectionColor:t.canvas.selectionColor,fontFamily:t.fontFamily,nodeDefaults:t.nodeDefaults,edgeDefaults:t.edgeDefaults,groupDefaults:t.groupDefaults,palette:t.palette,effects:t.effects}}function co(t,a,r,n,i,o){const c=Ke({primary:r.primary,primaryLight:r.primaryHover,secondary:r.info,accent:r.warning,success:r.success,warning:r.warning,error:r.error,info:r.info,text:i.primary,textMuted:i.muted,border:o.color,surface:n.primary,surfaceAlt:n.secondary}),l=uo(n.primary);return{id:t,name:`${a} Theme`,category:"theme-based",themeSource:a,config:Ye({background:n.primary,gridColor:l?`${o.color}40`:`${o.color}20`,gridSize:20,selectionColor:r.primary},c,ut,{shadow:!l,borderWidth:l?1:2},{strokeColor:l?`${o.color}80`:o.color})}}function uo(t){const a=t.replace("#","");if(a.length<6)return!1;const r=parseInt(a.slice(0,2),16),n=parseInt(a.slice(2,4),16),i=parseInt(a.slice(4,6),16);return(r*299+n*587+i*114)/1e3<128}function Ae(t){const a=s.useId();return t||a}function _t(t,a){s.useEffect(()=>{const r=n=>{!t.current||t.current.contains(n.target)||a()};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[t,a])}function po(t,a){s.useEffect(()=>{if(!a||!t.current)return;const r=t.current,n=document.activeElement,i=r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),o=i[0],c=i[i.length-1],l=d=>{d.key==="Tab"&&(d.shiftKey?document.activeElement===o&&(d.preventDefault(),c==null||c.focus()):document.activeElement===c&&(d.preventDefault(),o==null||o.focus()))};return o==null||o.focus(),r.addEventListener("keydown",l),()=>{var d;r.removeEventListener("keydown",l),(d=n==null?void 0:n.focus)==null||d.call(n)}},[t,a])}const mo={ok:"OK",cancel:"Cancel",save:"Save",close:"Close",delete:"Delete",edit:"Edit",add:"Add",remove:"Remove",search:"Search",filter:"Filter",refresh:"Refresh",loading:"Loading…",noData:"No data",error:"Error",success:"Success",warning:"Warning",info:"Information",yes:"Yes",no:"No",confirm:"Confirm",back:"Back",next:"Next",previous:"Previous",finish:"Finish",submit:"Submit",reset:"Reset",apply:"Apply",undo:"Undo",redo:"Redo",copy:"Copy",cut:"Cut",paste:"Paste",selectAll:"Select all",clear:"Clear",upload:"Upload",download:"Download",print:"Print",export:"Export",import:"Import",settings:"Settings",help:"Help",about:"About",more:"More",less:"Less",show:"Show",hide:"Hide",expand:"Expand",collapse:"Collapse",enabled:"Enabled",disabled:"Disabled",required:"Required",optional:"Optional",actions:"Actions",details:"Details",overview:"Overview",all:"All",none:"None",selected:"Selected",total:"Total",of:"of",items:"items",page:"Page",rows:"Rows","app.name":"Application","app.version":"Version","app.about":"About","nav.home":"Home","nav.back":"Back","nav.forward":"Forward","nav.menu":"Menu","nav.sidebar":"Sidebar","nav.search":"Search","nav.favorites":"Favorites","nav.recent":"Recent","nav.notifications":"Notifications","nav.profile":"Profile","nav.logout":"Log out","carousel.prev":"Previous slide","carousel.next":"Next slide","carousel.slide":"Slide","carousel.of":"of","carousel.autoplay":"Auto-play","carousel.pause":"Pause","confirm.yes":"Yes","confirm.no":"No","confirm.ok":"OK","confirm.cancel":"Cancel","confirm.title":"Confirmation","confirm.deleteMessage":"Are you sure you want to delete this?","confirm.unsavedChanges":"You have unsaved changes. Discard?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Enter command…","console.clear":"Clear console","console.run":"Run","console.output":"Output","console.newSession":"New session","console.closeSession":"Close session","controls.save":"Save","controls.cancel":"Cancel","controls.delete":"Delete","controls.edit":"Edit","controls.add":"Add","controls.remove":"Remove","controls.close":"Close","controls.open":"Open","controls.refresh":"Refresh","controls.new":"New","controls.duplicate":"Duplicate","controls.sort":"Sort","controls.group":"Group","controls.pin":"Pin","controls.unpin":"Unpin","controls.lock":"Lock","controls.unlock":"Unlock","controls.share":"Share","controls.archive":"Archive","cookie.title":"Cookie consent","cookie.message":"This site uses cookies to improve your experience.","cookie.accept":"Accept all","cookie.reject":"Reject all","cookie.settings":"Cookie settings","cookie.necessary":"Necessary","cookie.analytics":"Analytics","cookie.marketing":"Marketing","dashboard.title":"Dashboard","dashboard.addWidget":"Add widget","dashboard.removeWidget":"Remove widget","dashboard.layout":"Layout","dashboard.settings":"Settings","dashboard.customize":"Customize","dashboard.resetLayout":"Reset layout","datetime.today":"Today","datetime.yesterday":"Yesterday","datetime.tomorrow":"Tomorrow","datetime.selectDate":"Select date","datetime.selectTime":"Select time","datetime.startDate":"Start date","datetime.endDate":"End date","datetime.startTime":"Start time","datetime.endTime":"End time","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Start","desktop.taskbar":"Taskbar","desktop.systemTray":"System tray","desktop.wallpaper":"Wallpaper","desktop.icons":"Desktop icons","desktop.arrangeIcons":"Arrange icons","dock.pin":"Pin to dock","dock.unpin":"Unpin from dock","dock.close":"Close","dock.minimize":"Minimize","dock.maximize":"Maximize","dock.restore":"Restore","docEditor.paragraph":"Paragraph","docEditor.heading":"Heading","docEditor.heading1":"Heading 1","docEditor.heading2":"Heading 2","docEditor.heading3":"Heading 3","docEditor.bulletList":"Bullet list","docEditor.numberedList":"Numbered list","docEditor.quote":"Quote","docEditor.code":"Code block","docEditor.divider":"Divider","docEditor.image":"Image","docEditor.table":"Table","docEditor.callout":"Callout","docEditor.placeholder":"Start typing…","docEditor.slashCommand":"Type / for commands","files.upload":"Upload file","files.download":"Download","files.delete":"Delete file","files.rename":"Rename","files.newFolder":"New folder","files.selectFile":"Select file","files.dropzone":"Drop files here","files.dragDrop":"Drag & drop files here or click to browse","files.maxSize":"Maximum file size","files.fileType":"File type","forms.required":"This field is required","forms.optional":"Optional","forms.submit":"Submit","forms.reset":"Reset","forms.validate":"Validate","forms.invalid":"Invalid value","forms.minLength":"Minimum length: {0}","forms.maxLength":"Maximum length: {0}","forms.email":"Enter a valid email","forms.phone":"Enter a valid phone number","imageEditor.crop":"Crop","imageEditor.rotate":"Rotate","imageEditor.flip":"Flip","imageEditor.resize":"Resize","imageEditor.filter":"Filter","imageEditor.draw":"Draw","imageEditor.text":"Text","imageEditor.undo":"Undo","imageEditor.redo":"Redo","imageEditor.save":"Save","imageEditor.brightness":"Brightness","imageEditor.contrast":"Contrast","imageEditor.saturation":"Saturation","inbox.compose":"Compose","inbox.reply":"Reply","inbox.replyAll":"Reply all","inbox.forward":"Forward","inbox.delete":"Delete","inbox.archive":"Archive","inbox.markRead":"Mark as read","inbox.markUnread":"Mark as unread","inbox.folders":"Folders","inbox.inbox":"Inbox","inbox.sent":"Sent","inbox.drafts":"Drafts","inbox.trash":"Trash","inbox.spam":"Spam","inbox.starred":"Starred","inbox.to":"To","inbox.cc":"Cc","inbox.bcc":"Bcc","inbox.subject":"Subject","inbox.send":"Send","inbox.discard":"Discard","inbox.attachFile":"Attach file","kanban.addCard":"Add card","kanban.addColumn":"Add column","kanban.moveCard":"Move card","kanban.editCard":"Edit card","kanban.deleteCard":"Delete card","kanban.editColumn":"Edit column","kanban.deleteColumn":"Delete column","lang.en":"English","lang.pl":"Polish","lang.de":"German","lang.fr":"French","lang.es":"Spanish","lang.it":"Italian","lang.pt":"Portuguese","lang.nl":"Dutch","lang.sv":"Swedish","lang.no":"Norwegian","lang.da":"Danish","lang.fi":"Finnish","lang.cs":"Czech","lang.sk":"Slovak","lang.hu":"Hungarian","lang.ro":"Romanian","lang.bg":"Bulgarian","lang.uk":"Ukrainian","lang.ja":"Japanese","lang.ko":"Korean","lang.zh":"Chinese","lang.ar":"Arabic","login.username":"Username","login.password":"Password","login.signIn":"Sign in","login.signOut":"Sign out","login.forgotPassword":"Forgot password?","login.register":"Register","login.rememberMe":"Remember me","login.newPassword":"New password","login.confirmPassword":"Confirm password","login.twoFactor":"Two-factor authentication","password.strength":"Password strength","password.weak":"Weak","password.medium":"Medium","password.strong":"Strong","password.requirements":"Password requirements","pdfviewer.page":"Page","pdfviewer.of":"of","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Fit page","pdfviewer.fitWidth":"Fit width","pdfviewer.download":"Download","pdfviewer.print":"Print","pdfviewer.search":"Search in document","pdfviewer.bookmark":"Bookmarks","pdfviewer.thumbnail":"Thumbnails","picklist.available":"Available","picklist.selected":"Selected","picklist.addAll":"Add all","picklist.removeAll":"Remove all","picklist.filter":"Filter items","scheduling.calendar":"Calendar","scheduling.event":"Event","scheduling.allDay":"All day","scheduling.today":"Today","scheduling.week":"Week","scheduling.month":"Month","scheduling.year":"Year","scheduling.day":"Day","scheduling.agenda":"Agenda","scheduling.addEvent":"Add event","scheduling.editEvent":"Edit event","scheduling.deleteEvent":"Delete event","scheduling.noEvents":"No events","shortcuts.title":"Keyboard shortcuts","shortcuts.description":"Available shortcuts","shortcuts.key":"Key","shortcuts.command":"Command","shortcuts.search":"Search shortcuts","signature.clear":"Clear","signature.save":"Save","signature.sign":"Sign here","signature.draw":"Draw your signature","spreadsheet.cell":"Cell","spreadsheet.row":"Row","spreadsheet.column":"Column","spreadsheet.formula":"Formula","spreadsheet.insert":"Insert","spreadsheet.delete":"Delete","spreadsheet.sort":"Sort","spreadsheet.sortAsc":"Sort ascending","spreadsheet.sortDesc":"Sort descending","spreadsheet.filter":"Filter","spreadsheet.export":"Export","spreadsheet.import":"Import","spreadsheet.addRow":"Add row","spreadsheet.addColumn":"Add column","spreadsheet.deleteRow":"Delete row","spreadsheet.deleteColumn":"Delete column","spreadsheet.freezeRow":"Freeze row","spreadsheet.freezeColumn":"Freeze column","spreadsheet.merge":"Merge cells","spreadsheet.unmerge":"Unmerge cells","terminal.run":"Run","terminal.clear":"Clear","terminal.copy":"Copy","terminal.paste":"Paste","terminal.newSession":"New session","terminal.closeSession":"Close session","terminal.selectAll":"Select all","theme.light":"Light","theme.dark":"Dark","theme.system":"System","theme.custom":"Custom","theme.colors":"Colors","theme.fonts":"Fonts","theme.apply":"Apply theme","theme.preview":"Preview","theme.reset":"Reset to default","theme.gallery":"Theme gallery","users.profile":"Profile","users.settings":"Settings","users.permissions":"Permissions","users.role":"Role","users.active":"Active","users.inactive":"Inactive","users.online":"Online","users.offline":"Offline","users.lastSeen":"Last seen","wm.close":"Close","wm.minimize":"Minimize","wm.maximize":"Maximize","wm.restore":"Restore","wm.tile":"Tile windows","wm.cascade":"Cascade windows","wm.closeAll":"Close all","wm.minimizeAll":"Minimize all","wm.newWindow":"New window","wm.moveToFront":"Move to front","git.commit":"Commit","git.commits":"Commits","git.branch":"Branch","git.branches":"Branches","git.merge":"Merge","git.rebase":"Rebase","git.pull":"Pull","git.push":"Push","git.fetch":"Fetch","git.checkout":"Checkout","git.stash":"Stash","git.diff":"Diff","git.blame":"Blame","git.history":"History","git.conflict":"Conflict","git.resolve":"Resolve","git.createBranch":"Create branch","git.deleteBranch":"Delete branch","git.mergeRequest":"Merge request","git.pullRequest":"Pull request","pipeline.run":"Run pipeline","pipeline.stop":"Stop pipeline","pipeline.status":"Pipeline status","pipeline.logs":"Pipeline logs","pipeline.stages":"Stages","pipeline.jobs":"Jobs","pipeline.artifacts":"Artifacts","pipeline.trigger":"Trigger","pipeline.schedule":"Schedule","pipeline.manual":"Manual","devops.deploy":"Deploy","devops.rollback":"Rollback","devops.release":"Release","devops.environment":"Environment","dataBranching.environment":"Environment","dataBranching.environments":"Environments","dataBranching.dev":"Development","dataBranching.test":"Test","dataBranching.uat":"UAT","dataBranching.staging":"Staging","dataBranching.prod":"Production","dataBranching.snapshot":"Snapshot","dataBranching.createSnapshot":"Create snapshot","dataBranching.restoreSnapshot":"Restore snapshot","dataBranching.diff":"Data diff","dataBranching.compare":"Compare","dataBranching.merge":"Merge data","dataBranching.promote":"Promote","dataBranching.conflict":"Conflict","dataBranching.resolveConflict":"Resolve conflict","dataBranching.accept":"Accept","dataBranching.reject":"Reject","dataBranching.useSource":"Use source","dataBranching.useTarget":"Use target","dataBranching.entity":"Entity","dataBranching.entities":"Entities","dataBranching.record":"Record","dataBranching.records":"Records","dataBranching.changes":"Changes","dataBranching.added":"Added","dataBranching.modified":"Modified","dataBranching.deleted":"Deleted","dataBranching.unchanged":"Unchanged","dataBranching.status":"Status","dataBranching.synced":"Synced","dataBranching.pending":"Pending","dataBranching.inProgress":"In progress","dataBranching.completed":"Completed","dataBranching.failed":"Failed"},ho={ok:"OK",cancel:"Anuluj",save:"Zapisz",close:"Zamknij",delete:"Usuń",edit:"Edytuj",add:"Dodaj",remove:"Usuń",search:"Szukaj",filter:"Filtruj",refresh:"Odśwież",loading:"Ładowanie…",noData:"Brak danych",error:"Błąd",success:"Sukces",warning:"Ostrzeżenie",info:"Informacja",yes:"Tak",no:"Nie",confirm:"Potwierdź",back:"Wstecz",next:"Dalej",previous:"Poprzedni",finish:"Zakończ",submit:"Wyślij",reset:"Resetuj",apply:"Zastosuj",undo:"Cofnij",redo:"Ponów",copy:"Kopiuj",cut:"Wytnij",paste:"Wklej",selectAll:"Zaznacz wszystko",clear:"Wyczyść",upload:"Prześlij",download:"Pobierz",print:"Drukuj",export:"Eksportuj",import:"Importuj",settings:"Ustawienia",help:"Pomoc",about:"O programie",more:"Więcej",less:"Mniej",show:"Pokaż",hide:"Ukryj",expand:"Rozwiń",collapse:"Zwiń",enabled:"Włączony",disabled:"Wyłączony",required:"Wymagane",optional:"Opcjonalne",actions:"Akcje",details:"Szczegóły",overview:"Przegląd",all:"Wszystkie",none:"Żaden",selected:"Zaznaczono",total:"Razem",of:"z",items:"elementów",page:"Strona",rows:"Wiersze","app.name":"Aplikacja","app.version":"Wersja","app.about":"O programie","nav.home":"Strona główna","nav.back":"Wstecz","nav.forward":"Dalej","nav.menu":"Menu","nav.sidebar":"Panel boczny","nav.search":"Szukaj","nav.favorites":"Ulubione","nav.recent":"Ostatnie","nav.notifications":"Powiadomienia","nav.profile":"Profil","nav.logout":"Wyloguj się","carousel.prev":"Poprzedni slajd","carousel.next":"Następny slajd","carousel.slide":"Slajd","carousel.of":"z","carousel.autoplay":"Autoodtwarzanie","carousel.pause":"Pauza","confirm.yes":"Tak","confirm.no":"Nie","confirm.ok":"OK","confirm.cancel":"Anuluj","confirm.title":"Potwierdzenie","confirm.deleteMessage":"Czy na pewno chcesz to usunąć?","confirm.unsavedChanges":"Masz niezapisane zmiany. Odrzucić?","console.shell":"Powłoka","console.terminal":"Terminal","console.prompt":"Wpisz polecenie…","console.clear":"Wyczyść konsolę","console.run":"Uruchom","console.output":"Wyjście","console.newSession":"Nowa sesja","console.closeSession":"Zamknij sesję","controls.save":"Zapisz","controls.cancel":"Anuluj","controls.delete":"Usuń","controls.edit":"Edytuj","controls.add":"Dodaj","controls.remove":"Usuń","controls.close":"Zamknij","controls.open":"Otwórz","controls.refresh":"Odśwież","controls.new":"Nowy","controls.duplicate":"Duplikuj","controls.sort":"Sortuj","controls.group":"Grupuj","controls.pin":"Przypnij","controls.unpin":"Odepnij","controls.lock":"Zablokuj","controls.unlock":"Odblokuj","controls.share":"Udostępnij","controls.archive":"Archiwizuj","cookie.title":"Zgoda na pliki cookie","cookie.message":"Ta strona używa plików cookie.","cookie.accept":"Zaakceptuj wszystkie","cookie.reject":"Odrzuć wszystkie","cookie.settings":"Ustawienia cookie","cookie.necessary":"Niezbędne","cookie.analytics":"Analityczne","cookie.marketing":"Marketingowe","dashboard.title":"Pulpit","dashboard.addWidget":"Dodaj widżet","dashboard.removeWidget":"Usuń widżet","dashboard.layout":"Układ","dashboard.settings":"Ustawienia","dashboard.customize":"Dostosuj","dashboard.resetLayout":"Resetuj układ","datetime.today":"Dzisiaj","datetime.yesterday":"Wczoraj","datetime.tomorrow":"Jutro","datetime.selectDate":"Wybierz datę","datetime.selectTime":"Wybierz godzinę","datetime.startDate":"Data początkowa","datetime.endDate":"Data końcowa","datetime.startTime":"Godzina rozpoczęcia","datetime.endTime":"Godzina zakończenia","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Start","desktop.taskbar":"Pasek zadań","desktop.systemTray":"Zasobnik systemowy","desktop.wallpaper":"Tapeta","desktop.icons":"Ikony pulpitu","desktop.arrangeIcons":"Ułóż ikony","dock.pin":"Przypnij do doku","dock.unpin":"Odepnij z doku","dock.close":"Zamknij","dock.minimize":"Minimalizuj","dock.maximize":"Maksymalizuj","dock.restore":"Przywróć","docEditor.paragraph":"Akapit","docEditor.heading":"Nagłówek","docEditor.heading1":"Nagłówek 1","docEditor.heading2":"Nagłówek 2","docEditor.heading3":"Nagłówek 3","docEditor.bulletList":"Lista punktowana","docEditor.numberedList":"Lista numerowana","docEditor.quote":"Cytat","docEditor.code":"Blok kodu","docEditor.divider":"Separator","docEditor.image":"Obraz","docEditor.table":"Tabela","docEditor.callout":"Wyróżnienie","docEditor.placeholder":"Zacznij pisać…","docEditor.slashCommand":"Wpisz / aby zobaczyć komendy","files.upload":"Prześlij plik","files.download":"Pobierz","files.delete":"Usuń plik","files.rename":"Zmień nazwę","files.newFolder":"Nowy folder","files.selectFile":"Wybierz plik","files.dropzone":"Upuść pliki tutaj","files.dragDrop":"Przeciągnij i upuść pliki lub kliknij aby wybrać","files.maxSize":"Maksymalny rozmiar pliku","files.fileType":"Typ pliku","forms.required":"To pole jest wymagane","forms.optional":"Opcjonalne","forms.submit":"Wyślij","forms.reset":"Resetuj","forms.validate":"Zweryfikuj","forms.invalid":"Nieprawidłowa wartość","forms.minLength":"Minimalna długość: {0}","forms.maxLength":"Maksymalna długość: {0}","forms.email":"Podaj prawidłowy adres e-mail","forms.phone":"Podaj prawidłowy numer telefonu","imageEditor.crop":"Przytnij","imageEditor.rotate":"Obróć","imageEditor.flip":"Odbij","imageEditor.resize":"Zmień rozmiar","imageEditor.filter":"Filtr","imageEditor.draw":"Rysuj","imageEditor.text":"Tekst","imageEditor.undo":"Cofnij","imageEditor.redo":"Ponów","imageEditor.save":"Zapisz","imageEditor.brightness":"Jasność","imageEditor.contrast":"Kontrast","imageEditor.saturation":"Nasycenie","inbox.compose":"Nowa wiadomość","inbox.reply":"Odpowiedz","inbox.replyAll":"Odpowiedz wszystkim","inbox.forward":"Przekaż","inbox.delete":"Usuń","inbox.archive":"Archiwizuj","inbox.markRead":"Oznacz jako przeczytane","inbox.markUnread":"Oznacz jako nieprzeczytane","inbox.folders":"Foldery","inbox.inbox":"Odebrane","inbox.sent":"Wysłane","inbox.drafts":"Wersje robocze","inbox.trash":"Kosz","inbox.spam":"Spam","inbox.starred":"Oznaczone gwiazdką","inbox.to":"Do","inbox.cc":"DW","inbox.bcc":"UDW","inbox.subject":"Temat","inbox.send":"Wyślij","inbox.discard":"Odrzuć","inbox.attachFile":"Załącz plik","kanban.addCard":"Dodaj kartę","kanban.addColumn":"Dodaj kolumnę","kanban.moveCard":"Przenieś kartę","kanban.editCard":"Edytuj kartę","kanban.deleteCard":"Usuń kartę","kanban.editColumn":"Edytuj kolumnę","kanban.deleteColumn":"Usuń kolumnę","lang.en":"Angielski","lang.pl":"Polski","lang.de":"Niemiecki","lang.fr":"Francuski","lang.es":"Hiszpański","lang.it":"Włoski","lang.pt":"Portugalski","lang.nl":"Holenderski","lang.sv":"Szwedzki","lang.no":"Norweski","lang.da":"Duński","lang.fi":"Fiński","lang.cs":"Czeski","lang.sk":"Słowacki","lang.hu":"Węgierski","lang.ro":"Rumuński","lang.bg":"Bułgarski","lang.uk":"Ukraiński","lang.ja":"Japoński","lang.ko":"Koreański","lang.zh":"Chiński","lang.ar":"Arabski","login.username":"Nazwa użytkownika","login.password":"Hasło","login.signIn":"Zaloguj się","login.signOut":"Wyloguj się","login.forgotPassword":"Zapomniałeś hasła?","login.register":"Zarejestruj się","login.rememberMe":"Zapamiętaj mnie","login.newPassword":"Nowe hasło","login.confirmPassword":"Potwierdź hasło","login.twoFactor":"Uwierzytelnianie dwuskładnikowe","password.strength":"Siła hasła","password.weak":"Słabe","password.medium":"Średnie","password.strong":"Silne","password.requirements":"Wymagania dotyczące hasła","pdfviewer.page":"Strona","pdfviewer.of":"z","pdfviewer.zoom":"Powiększenie","pdfviewer.fitPage":"Dopasuj stronę","pdfviewer.fitWidth":"Dopasuj szerokość","pdfviewer.download":"Pobierz","pdfviewer.print":"Drukuj","pdfviewer.search":"Szukaj w dokumencie","pdfviewer.bookmark":"Zakładki","pdfviewer.thumbnail":"Miniatury","picklist.available":"Dostępne","picklist.selected":"Wybrane","picklist.addAll":"Dodaj wszystkie","picklist.removeAll":"Usuń wszystkie","picklist.filter":"Filtruj elementy","scheduling.calendar":"Kalendarz","scheduling.event":"Wydarzenie","scheduling.allDay":"Cały dzień","scheduling.today":"Dzisiaj","scheduling.week":"Tydzień","scheduling.month":"Miesiąc","scheduling.year":"Rok","scheduling.day":"Dzień","scheduling.agenda":"Agenda","scheduling.addEvent":"Dodaj wydarzenie","scheduling.editEvent":"Edytuj wydarzenie","scheduling.deleteEvent":"Usuń wydarzenie","scheduling.noEvents":"Brak wydarzeń","shortcuts.title":"Skróty klawiszowe","shortcuts.description":"Dostępne skróty","shortcuts.key":"Klawisz","shortcuts.command":"Polecenie","shortcuts.search":"Szukaj skrótów","signature.clear":"Wyczyść","signature.save":"Zapisz","signature.sign":"Podpisz tutaj","signature.draw":"Narysuj swój podpis","spreadsheet.cell":"Komórka","spreadsheet.row":"Wiersz","spreadsheet.column":"Kolumna","spreadsheet.formula":"Formuła","spreadsheet.insert":"Wstaw","spreadsheet.delete":"Usuń","spreadsheet.sort":"Sortuj","spreadsheet.sortAsc":"Sortuj rosnąco","spreadsheet.sortDesc":"Sortuj malejąco","spreadsheet.filter":"Filtruj","spreadsheet.export":"Eksportuj","spreadsheet.import":"Importuj","spreadsheet.addRow":"Dodaj wiersz","spreadsheet.addColumn":"Dodaj kolumnę","spreadsheet.deleteRow":"Usuń wiersz","spreadsheet.deleteColumn":"Usuń kolumnę","spreadsheet.freezeRow":"Zamroź wiersz","spreadsheet.freezeColumn":"Zamroź kolumnę","spreadsheet.merge":"Scal komórki","spreadsheet.unmerge":"Rozdziel komórki","terminal.run":"Uruchom","terminal.clear":"Wyczyść","terminal.copy":"Kopiuj","terminal.paste":"Wklej","terminal.newSession":"Nowa sesja","terminal.closeSession":"Zamknij sesję","terminal.selectAll":"Zaznacz wszystko","theme.light":"Jasny","theme.dark":"Ciemny","theme.system":"Systemowy","theme.custom":"Własny","theme.colors":"Kolory","theme.fonts":"Czcionki","theme.apply":"Zastosuj motyw","theme.preview":"Podgląd","theme.reset":"Przywróć domyślne","theme.gallery":"Galeria motywów","users.profile":"Profil","users.settings":"Ustawienia","users.permissions":"Uprawnienia","users.role":"Rola","users.active":"Aktywny","users.inactive":"Nieaktywny","users.online":"Online","users.offline":"Offline","users.lastSeen":"Ostatnio widziano","wm.close":"Zamknij","wm.minimize":"Minimalizuj","wm.maximize":"Maksymalizuj","wm.restore":"Przywróć","wm.tile":"Ułóż kafelkowo","wm.cascade":"Ułóż kaskadowo","wm.closeAll":"Zamknij wszystkie","wm.minimizeAll":"Minimalizuj wszystkie","wm.newWindow":"Nowe okno","wm.moveToFront":"Na wierzch","git.commit":"Commit","git.commits":"Commity","git.branch":"Gałąź","git.branches":"Gałęzie","git.merge":"Scal","git.rebase":"Rebase","git.pull":"Pobierz","git.push":"Wyślij","git.fetch":"Pobierz","git.checkout":"Przełącz","git.stash":"Schowek","git.diff":"Różnice","git.blame":"Blame","git.history":"Historia","git.conflict":"Konflikt","git.resolve":"Rozwiąż","git.createBranch":"Utwórz gałąź","git.deleteBranch":"Usuń gałąź","git.mergeRequest":"Żądanie scalenia","git.pullRequest":"Pull request","pipeline.run":"Uruchom pipeline","pipeline.stop":"Zatrzymaj pipeline","pipeline.status":"Status pipeline","pipeline.logs":"Logi pipeline","pipeline.stages":"Etapy","pipeline.jobs":"Zadania","pipeline.artifacts":"Artefakty","pipeline.trigger":"Wyzwalacz","pipeline.schedule":"Harmonogram","pipeline.manual":"Ręczny","devops.deploy":"Wdróż","devops.rollback":"Wycofaj","devops.release":"Wydanie","devops.environment":"Środowisko","dataBranching.environment":"Środowisko","dataBranching.environments":"Środowiska","dataBranching.dev":"Development","dataBranching.test":"Test","dataBranching.uat":"UAT","dataBranching.staging":"Staging","dataBranching.prod":"Produkcja","dataBranching.snapshot":"Migawka","dataBranching.createSnapshot":"Utwórz migawkę","dataBranching.restoreSnapshot":"Przywróć migawkę","dataBranching.diff":"Różnice danych","dataBranching.compare":"Porównaj","dataBranching.merge":"Scal dane","dataBranching.promote":"Promuj","dataBranching.conflict":"Konflikt","dataBranching.resolveConflict":"Rozwiąż konflikt","dataBranching.accept":"Akceptuj","dataBranching.reject":"Odrzuć","dataBranching.useSource":"Użyj źródła","dataBranching.useTarget":"Użyj celu","dataBranching.entity":"Encja","dataBranching.entities":"Encje","dataBranching.record":"Rekord","dataBranching.records":"Rekordy","dataBranching.changes":"Zmiany","dataBranching.added":"Dodano","dataBranching.modified":"Zmodyfikowano","dataBranching.deleted":"Usunięto","dataBranching.unchanged":"Bez zmian","dataBranching.status":"Status","dataBranching.synced":"Zsynchronizowano","dataBranching.pending":"Oczekuje","dataBranching.inProgress":"W trakcie","dataBranching.completed":"Zakończono","dataBranching.failed":"Niepowodzenie"},fo={ok:"OK",cancel:"Abbrechen",save:"Speichern",close:"Schließen",delete:"Löschen",edit:"Bearbeiten",add:"Hinzufügen",remove:"Entfernen",search:"Suchen",filter:"Filtern",refresh:"Aktualisieren",loading:"Laden…",noData:"Keine Daten",error:"Fehler",success:"Erfolg",warning:"Warnung",info:"Information",yes:"Ja",no:"Nein",confirm:"Bestätigen",back:"Zurück",next:"Weiter",previous:"Vorherige",finish:"Fertig",submit:"Absenden",reset:"Zurücksetzen",apply:"Anwenden",undo:"Rückgängig",redo:"Wiederholen",copy:"Kopieren",cut:"Ausschneiden",paste:"Einfügen",selectAll:"Alle auswählen",clear:"Löschen",upload:"Hochladen",download:"Herunterladen",print:"Drucken",export:"Exportieren",import:"Importieren",settings:"Einstellungen",help:"Hilfe",about:"Über",more:"Mehr",less:"Weniger",show:"Anzeigen",hide:"Ausblenden",expand:"Erweitern",collapse:"Einklappen",enabled:"Aktiviert",disabled:"Deaktiviert",required:"Erforderlich",optional:"Optional",actions:"Aktionen",details:"Details",overview:"Übersicht",all:"Alle",none:"Keine",selected:"Ausgewählt",total:"Gesamt",of:"von",items:"Einträge",page:"Seite",rows:"Zeilen","app.name":"Anwendung","app.version":"Version","app.about":"Über","nav.home":"Startseite","nav.back":"Zurück","nav.forward":"Vorwärts","nav.menu":"Menü","nav.sidebar":"Seitenleiste","nav.search":"Suchen","nav.favorites":"Favoriten","nav.recent":"Zuletzt","nav.notifications":"Benachrichtigungen","nav.profile":"Profil","nav.logout":"Abmelden","carousel.prev":"Vorherige Folie","carousel.next":"Nächste Folie","carousel.slide":"Folie","carousel.of":"von","carousel.autoplay":"Automatisch abspielen","carousel.pause":"Pause","confirm.yes":"Ja","confirm.no":"Nein","confirm.ok":"OK","confirm.cancel":"Abbrechen","confirm.title":"Bestätigung","confirm.deleteMessage":"Möchten Sie dies wirklich löschen?","confirm.unsavedChanges":"Ungespeicherte Änderungen. Verwerfen?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Befehl eingeben…","console.clear":"Konsole leeren","console.run":"Ausführen","console.output":"Ausgabe","console.newSession":"Neue Sitzung","console.closeSession":"Sitzung schließen","controls.save":"Speichern","controls.cancel":"Abbrechen","controls.delete":"Löschen","controls.edit":"Bearbeiten","controls.add":"Hinzufügen","controls.remove":"Entfernen","controls.close":"Schließen","controls.open":"Öffnen","controls.refresh":"Aktualisieren","controls.new":"Neu","controls.duplicate":"Duplizieren","controls.sort":"Sortieren","controls.group":"Gruppieren","controls.pin":"Anheften","controls.unpin":"Lösen","controls.lock":"Sperren","controls.unlock":"Entsperren","controls.share":"Teilen","controls.archive":"Archivieren","cookie.title":"Cookie-Einwilligung","cookie.message":"Diese Website verwendet Cookies.","cookie.accept":"Alle akzeptieren","cookie.reject":"Alle ablehnen","cookie.settings":"Cookie-Einstellungen","cookie.necessary":"Erforderlich","cookie.analytics":"Analyse","cookie.marketing":"Marketing","dashboard.title":"Dashboard","dashboard.addWidget":"Widget hinzufügen","dashboard.removeWidget":"Widget entfernen","dashboard.layout":"Layout","dashboard.settings":"Einstellungen","dashboard.customize":"Anpassen","dashboard.resetLayout":"Layout zurücksetzen","datetime.today":"Heute","datetime.yesterday":"Gestern","datetime.tomorrow":"Morgen","datetime.selectDate":"Datum auswählen","datetime.selectTime":"Uhrzeit auswählen","datetime.startDate":"Startdatum","datetime.endDate":"Enddatum","datetime.startTime":"Startzeit","datetime.endTime":"Endzeit","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Start","desktop.taskbar":"Taskleiste","desktop.systemTray":"Systemleiste","desktop.wallpaper":"Hintergrundbild","desktop.icons":"Desktop-Symbole","desktop.arrangeIcons":"Symbole anordnen","dock.pin":"An Dock anheften","dock.unpin":"Vom Dock lösen","dock.close":"Schließen","dock.minimize":"Minimieren","dock.maximize":"Maximieren","dock.restore":"Wiederherstellen","docEditor.paragraph":"Absatz","docEditor.heading":"Überschrift","docEditor.heading1":"Überschrift 1","docEditor.heading2":"Überschrift 2","docEditor.heading3":"Überschrift 3","docEditor.bulletList":"Aufzählungsliste","docEditor.numberedList":"Nummerierte Liste","docEditor.quote":"Zitat","docEditor.code":"Codeblock","docEditor.divider":"Trennlinie","docEditor.image":"Bild","docEditor.table":"Tabelle","docEditor.callout":"Hervorhebung","docEditor.placeholder":"Schreiben Sie los…","docEditor.slashCommand":"Tippen Sie / für Befehle","files.upload":"Datei hochladen","files.download":"Herunterladen","files.delete":"Datei löschen","files.rename":"Umbenennen","files.newFolder":"Neuer Ordner","files.selectFile":"Datei auswählen","files.dropzone":"Dateien hier ablegen","files.dragDrop":"Dateien hierher ziehen oder klicken","files.maxSize":"Maximale Dateigröße","files.fileType":"Dateityp","forms.required":"Dieses Feld ist erforderlich","forms.optional":"Optional","forms.submit":"Absenden","forms.reset":"Zurücksetzen","forms.validate":"Validieren","forms.invalid":"Ungültiger Wert","forms.minLength":"Mindestlänge: {0}","forms.maxLength":"Maximallänge: {0}","forms.email":"Gültige E-Mail eingeben","forms.phone":"Gültige Telefonnummer eingeben","imageEditor.crop":"Zuschneiden","imageEditor.rotate":"Drehen","imageEditor.flip":"Spiegeln","imageEditor.resize":"Größe ändern","imageEditor.filter":"Filter","imageEditor.draw":"Zeichnen","imageEditor.text":"Text","imageEditor.undo":"Rückgängig","imageEditor.redo":"Wiederholen","imageEditor.save":"Speichern","imageEditor.brightness":"Helligkeit","imageEditor.contrast":"Kontrast","imageEditor.saturation":"Sättigung","inbox.compose":"Verfassen","inbox.reply":"Antworten","inbox.replyAll":"Allen antworten","inbox.forward":"Weiterleiten","inbox.delete":"Löschen","inbox.archive":"Archivieren","inbox.markRead":"Als gelesen markieren","inbox.markUnread":"Als ungelesen markieren","inbox.folders":"Ordner","inbox.inbox":"Posteingang","inbox.sent":"Gesendet","inbox.drafts":"Entwürfe","inbox.trash":"Papierkorb","inbox.spam":"Spam","inbox.starred":"Markiert","inbox.to":"An","inbox.cc":"Cc","inbox.bcc":"Bcc","inbox.subject":"Betreff","inbox.send":"Senden","inbox.discard":"Verwerfen","inbox.attachFile":"Datei anhängen","kanban.addCard":"Karte hinzufügen","kanban.addColumn":"Spalte hinzufügen","kanban.moveCard":"Karte verschieben","kanban.editCard":"Karte bearbeiten","kanban.deleteCard":"Karte löschen","kanban.editColumn":"Spalte bearbeiten","kanban.deleteColumn":"Spalte löschen","lang.en":"Englisch","lang.pl":"Polnisch","lang.de":"Deutsch","lang.fr":"Französisch","lang.es":"Spanisch","lang.it":"Italienisch","lang.pt":"Portugiesisch","lang.nl":"Niederländisch","lang.sv":"Schwedisch","lang.no":"Norwegisch","lang.da":"Dänisch","lang.fi":"Finnisch","lang.cs":"Tschechisch","lang.sk":"Slowakisch","lang.hu":"Ungarisch","lang.ro":"Rumänisch","lang.bg":"Bulgarisch","lang.uk":"Ukrainisch","lang.ja":"Japanisch","lang.ko":"Koreanisch","lang.zh":"Chinesisch","lang.ar":"Arabisch","login.username":"Benutzername","login.password":"Passwort","login.signIn":"Anmelden","login.signOut":"Abmelden","login.forgotPassword":"Passwort vergessen?","login.register":"Registrieren","login.rememberMe":"Angemeldet bleiben","login.newPassword":"Neues Passwort","login.confirmPassword":"Passwort bestätigen","login.twoFactor":"Zwei-Faktor-Authentifizierung","password.strength":"Passwortstärke","password.weak":"Schwach","password.medium":"Mittel","password.strong":"Stark","password.requirements":"Passwortanforderungen","pdfviewer.page":"Seite","pdfviewer.of":"von","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Seite einpassen","pdfviewer.fitWidth":"Breite einpassen","pdfviewer.download":"Herunterladen","pdfviewer.print":"Drucken","pdfviewer.search":"Im Dokument suchen","pdfviewer.bookmark":"Lesezeichen","pdfviewer.thumbnail":"Miniaturansichten","picklist.available":"Verfügbar","picklist.selected":"Ausgewählt","picklist.addAll":"Alle hinzufügen","picklist.removeAll":"Alle entfernen","picklist.filter":"Einträge filtern","scheduling.calendar":"Kalender","scheduling.event":"Termin","scheduling.allDay":"Ganztägig","scheduling.today":"Heute","scheduling.week":"Woche","scheduling.month":"Monat","scheduling.year":"Jahr","scheduling.day":"Tag","scheduling.agenda":"Agenda","scheduling.addEvent":"Termin hinzufügen","scheduling.editEvent":"Termin bearbeiten","scheduling.deleteEvent":"Termin löschen","scheduling.noEvents":"Keine Termine","shortcuts.title":"Tastenkombinationen","shortcuts.description":"Verfügbare Tastenkombinationen","shortcuts.key":"Taste","shortcuts.command":"Befehl","shortcuts.search":"Tastenkombinationen suchen","signature.clear":"Löschen","signature.save":"Speichern","signature.sign":"Hier unterschreiben","signature.draw":"Unterschrift zeichnen","spreadsheet.cell":"Zelle","spreadsheet.row":"Zeile","spreadsheet.column":"Spalte","spreadsheet.formula":"Formel","spreadsheet.insert":"Einfügen","spreadsheet.delete":"Löschen","spreadsheet.sort":"Sortieren","spreadsheet.sortAsc":"Aufsteigend sortieren","spreadsheet.sortDesc":"Absteigend sortieren","spreadsheet.filter":"Filtern","spreadsheet.export":"Exportieren","spreadsheet.import":"Importieren","spreadsheet.addRow":"Zeile hinzufügen","spreadsheet.addColumn":"Spalte hinzufügen","spreadsheet.deleteRow":"Zeile löschen","spreadsheet.deleteColumn":"Spalte löschen","spreadsheet.freezeRow":"Zeile einfrieren","spreadsheet.freezeColumn":"Spalte einfrieren","spreadsheet.merge":"Zellen zusammenführen","spreadsheet.unmerge":"Zellen trennen","terminal.run":"Ausführen","terminal.clear":"Leeren","terminal.copy":"Kopieren","terminal.paste":"Einfügen","terminal.newSession":"Neue Sitzung","terminal.closeSession":"Sitzung schließen","terminal.selectAll":"Alles auswählen","theme.light":"Hell","theme.dark":"Dunkel","theme.system":"System","theme.custom":"Benutzerdefiniert","theme.colors":"Farben","theme.fonts":"Schriftarten","theme.apply":"Design anwenden","theme.preview":"Vorschau","theme.reset":"Standard wiederherstellen","theme.gallery":"Design-Galerie","users.profile":"Profil","users.settings":"Einstellungen","users.permissions":"Berechtigungen","users.role":"Rolle","users.active":"Aktiv","users.inactive":"Inaktiv","users.online":"Online","users.offline":"Offline","users.lastSeen":"Zuletzt gesehen","wm.close":"Schließen","wm.minimize":"Minimieren","wm.maximize":"Maximieren","wm.restore":"Wiederherstellen","wm.tile":"Fenster kacheln","wm.cascade":"Fenster kaskadieren","wm.closeAll":"Alle schließen","wm.minimizeAll":"Alle minimieren","wm.newWindow":"Neues Fenster","wm.moveToFront":"In den Vordergrund","git.commit":"Commit","git.commits":"Commits","git.branch":"Branch","git.branches":"Branches","git.merge":"Zusammenführen","git.rebase":"Rebase","git.pull":"Pull","git.push":"Push","git.fetch":"Fetch","git.checkout":"Auschecken","git.stash":"Stash","git.diff":"Diff","git.blame":"Blame","git.history":"Verlauf","git.conflict":"Konflikt","git.resolve":"Auflösen","git.createBranch":"Branch erstellen","git.deleteBranch":"Branch löschen","git.mergeRequest":"Merge Request","git.pullRequest":"Pull Request","pipeline.run":"Pipeline starten","pipeline.stop":"Pipeline stoppen","pipeline.status":"Pipeline-Status","pipeline.logs":"Pipeline-Protokolle","pipeline.stages":"Phasen","pipeline.jobs":"Jobs","pipeline.artifacts":"Artefakte","pipeline.trigger":"Auslöser","pipeline.schedule":"Zeitplan","pipeline.manual":"Manuell","devops.deploy":"Bereitstellen","devops.rollback":"Zurücksetzen","devops.release":"Release","devops.environment":"Umgebung","dataBranching.environment":"Umgebung","dataBranching.environments":"Umgebungen","dataBranching.dev":"Entwicklung","dataBranching.test":"Test","dataBranching.uat":"UAT","dataBranching.staging":"Staging","dataBranching.prod":"Produktion","dataBranching.snapshot":"Snapshot","dataBranching.createSnapshot":"Snapshot erstellen","dataBranching.restoreSnapshot":"Snapshot wiederherstellen","dataBranching.diff":"Daten-Diff","dataBranching.compare":"Vergleichen","dataBranching.merge":"Daten zusammenführen","dataBranching.promote":"Hochstufen","dataBranching.conflict":"Konflikt","dataBranching.resolveConflict":"Konflikt auflösen","dataBranching.accept":"Akzeptieren","dataBranching.reject":"Ablehnen","dataBranching.useSource":"Quelle verwenden","dataBranching.useTarget":"Ziel verwenden","dataBranching.entity":"Entität","dataBranching.entities":"Entitäten","dataBranching.record":"Datensatz","dataBranching.records":"Datensätze","dataBranching.changes":"Änderungen","dataBranching.added":"Hinzugefügt","dataBranching.modified":"Geändert","dataBranching.deleted":"Gelöscht","dataBranching.unchanged":"Unverändert","dataBranching.status":"Status","dataBranching.synced":"Synchronisiert","dataBranching.pending":"Ausstehend","dataBranching.inProgress":"In Bearbeitung","dataBranching.completed":"Abgeschlossen","dataBranching.failed":"Fehlgeschlagen"},go={ok:"OK",cancel:"Annuler",save:"Enregistrer",close:"Fermer",delete:"Supprimer",edit:"Modifier",add:"Ajouter",remove:"Retirer",search:"Rechercher",filter:"Filtrer",refresh:"Actualiser",loading:"Chargement…",noData:"Aucune donnée",error:"Erreur",success:"Succès",warning:"Avertissement",info:"Information",yes:"Oui",no:"Non",confirm:"Confirmer",back:"Retour",next:"Suivant",previous:"Précédent",finish:"Terminer",submit:"Soumettre",reset:"Réinitialiser",apply:"Appliquer",undo:"Annuler",redo:"Rétablir",copy:"Copier",cut:"Couper",paste:"Coller",selectAll:"Tout sélectionner",clear:"Effacer",upload:"Télécharger",download:"Télécharger",print:"Imprimer",export:"Exporter",import:"Importer",settings:"Paramètres",help:"Aide",about:"À propos",more:"Plus",less:"Moins",show:"Afficher",hide:"Masquer",expand:"Développer",collapse:"Réduire",enabled:"Activé",disabled:"Désactivé",required:"Obligatoire",optional:"Facultatif",actions:"Actions",details:"Détails",overview:"Aperçu",all:"Tous",none:"Aucun",selected:"Sélectionné",total:"Total",of:"de",items:"éléments",page:"Page",rows:"Lignes","app.name":"Application","app.version":"Version","app.about":"À propos","nav.home":"Accueil","nav.back":"Retour","nav.forward":"Suivant","nav.menu":"Menu","nav.sidebar":"Barre latérale","nav.search":"Rechercher","nav.favorites":"Favoris","nav.recent":"Récent","nav.notifications":"Notifications","nav.profile":"Profil","nav.logout":"Déconnexion","carousel.prev":"Diapo précédente","carousel.next":"Diapo suivante","carousel.slide":"Diapo","carousel.of":"de","carousel.autoplay":"Lecture auto","carousel.pause":"Pause","confirm.yes":"Oui","confirm.no":"Non","confirm.ok":"OK","confirm.cancel":"Annuler","confirm.title":"Confirmation","confirm.deleteMessage":"Voulez-vous vraiment supprimer ceci ?","confirm.unsavedChanges":"Modifications non enregistrées. Abandonner ?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Entrez une commande…","console.clear":"Effacer la console","console.run":"Exécuter","console.output":"Sortie","console.newSession":"Nouvelle session","console.closeSession":"Fermer la session","controls.save":"Enregistrer","controls.cancel":"Annuler","controls.delete":"Supprimer","controls.edit":"Modifier","controls.add":"Ajouter","controls.remove":"Retirer","controls.close":"Fermer","controls.open":"Ouvrir","controls.refresh":"Actualiser","controls.new":"Nouveau","controls.duplicate":"Dupliquer","controls.sort":"Trier","controls.group":"Grouper","controls.pin":"Épingler","controls.unpin":"Désépingler","controls.lock":"Verrouiller","controls.unlock":"Déverrouiller","controls.share":"Partager","controls.archive":"Archiver","cookie.title":"Consentement aux cookies","cookie.message":"Ce site utilise des cookies.","cookie.accept":"Tout accepter","cookie.reject":"Tout refuser","cookie.settings":"Paramètres des cookies","cookie.necessary":"Nécessaires","cookie.analytics":"Analytiques","cookie.marketing":"Marketing","dashboard.title":"Tableau de bord","dashboard.addWidget":"Ajouter un widget","dashboard.removeWidget":"Supprimer le widget","dashboard.layout":"Disposition","dashboard.settings":"Paramètres","dashboard.customize":"Personnaliser","dashboard.resetLayout":"Réinitialiser la disposition","datetime.today":"Aujourd'hui","datetime.yesterday":"Hier","datetime.tomorrow":"Demain","datetime.selectDate":"Sélectionner une date","datetime.selectTime":"Sélectionner une heure","datetime.startDate":"Date de début","datetime.endDate":"Date de fin","datetime.startTime":"Heure de début","datetime.endTime":"Heure de fin","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Démarrer","desktop.taskbar":"Barre des tâches","desktop.systemTray":"Zone de notification","desktop.wallpaper":"Fond d'écran","desktop.icons":"Icônes du bureau","desktop.arrangeIcons":"Organiser les icônes","dock.pin":"Épingler au dock","dock.unpin":"Désépingler du dock","dock.close":"Fermer","dock.minimize":"Réduire","dock.maximize":"Agrandir","dock.restore":"Restaurer","docEditor.paragraph":"Paragraphe","docEditor.heading":"Titre","docEditor.heading1":"Titre 1","docEditor.heading2":"Titre 2","docEditor.heading3":"Titre 3","docEditor.bulletList":"Liste à puces","docEditor.numberedList":"Liste numérotée","docEditor.quote":"Citation","docEditor.code":"Bloc de code","docEditor.divider":"Séparateur","docEditor.image":"Image","docEditor.table":"Tableau","docEditor.callout":"Encadré","docEditor.placeholder":"Commencez à écrire…","docEditor.slashCommand":"Tapez / pour les commandes","files.upload":"Envoyer un fichier","files.download":"Télécharger","files.delete":"Supprimer le fichier","files.rename":"Renommer","files.newFolder":"Nouveau dossier","files.selectFile":"Sélectionner un fichier","files.dropzone":"Déposez les fichiers ici","files.dragDrop":"Glissez-déposez les fichiers ou cliquez","files.maxSize":"Taille maximale du fichier","files.fileType":"Type de fichier","forms.required":"Ce champ est obligatoire","forms.optional":"Facultatif","forms.submit":"Soumettre","forms.reset":"Réinitialiser","forms.validate":"Valider","forms.invalid":"Valeur invalide","forms.minLength":"Longueur minimale : {0}","forms.maxLength":"Longueur maximale : {0}","forms.email":"Saisissez un e-mail valide","forms.phone":"Saisissez un numéro valide","imageEditor.crop":"Recadrer","imageEditor.rotate":"Pivoter","imageEditor.flip":"Retourner","imageEditor.resize":"Redimensionner","imageEditor.filter":"Filtre","imageEditor.draw":"Dessiner","imageEditor.text":"Texte","imageEditor.undo":"Annuler","imageEditor.redo":"Rétablir","imageEditor.save":"Enregistrer","imageEditor.brightness":"Luminosité","imageEditor.contrast":"Contraste","imageEditor.saturation":"Saturation","inbox.compose":"Rédiger","inbox.reply":"Répondre","inbox.replyAll":"Répondre à tous","inbox.forward":"Transférer","inbox.delete":"Supprimer","inbox.archive":"Archiver","inbox.markRead":"Marquer comme lu","inbox.markUnread":"Marquer comme non lu","inbox.folders":"Dossiers","inbox.inbox":"Boîte de réception","inbox.sent":"Envoyés","inbox.drafts":"Brouillons","inbox.trash":"Corbeille","inbox.spam":"Spam","inbox.starred":"Favoris","inbox.to":"À","inbox.cc":"Cc","inbox.bcc":"Cci","inbox.subject":"Objet","inbox.send":"Envoyer","inbox.discard":"Annuler","inbox.attachFile":"Joindre un fichier","kanban.addCard":"Ajouter une carte","kanban.addColumn":"Ajouter une colonne","kanban.moveCard":"Déplacer la carte","kanban.editCard":"Modifier la carte","kanban.deleteCard":"Supprimer la carte","kanban.editColumn":"Modifier la colonne","kanban.deleteColumn":"Supprimer la colonne","lang.en":"Anglais","lang.pl":"Polonais","lang.de":"Allemand","lang.fr":"Français","lang.es":"Espagnol","lang.it":"Italien","lang.pt":"Portugais","lang.nl":"Néerlandais","lang.sv":"Suédois","lang.no":"Norvégien","lang.da":"Danois","lang.fi":"Finnois","lang.cs":"Tchèque","lang.sk":"Slovaque","lang.hu":"Hongrois","lang.ro":"Roumain","lang.bg":"Bulgare","lang.uk":"Ukrainien","lang.ja":"Japonais","lang.ko":"Coréen","lang.zh":"Chinois","lang.ar":"Arabe","login.username":"Nom d'utilisateur","login.password":"Mot de passe","login.signIn":"Se connecter","login.signOut":"Se déconnecter","login.forgotPassword":"Mot de passe oublié ?","login.register":"S'inscrire","login.rememberMe":"Se souvenir de moi","login.newPassword":"Nouveau mot de passe","login.confirmPassword":"Confirmer le mot de passe","login.twoFactor":"Authentification à deux facteurs","password.strength":"Force du mot de passe","password.weak":"Faible","password.medium":"Moyen","password.strong":"Fort","password.requirements":"Exigences du mot de passe","pdfviewer.page":"Page","pdfviewer.of":"de","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Ajuster à la page","pdfviewer.fitWidth":"Ajuster à la largeur","pdfviewer.download":"Télécharger","pdfviewer.print":"Imprimer","pdfviewer.search":"Rechercher dans le document","pdfviewer.bookmark":"Signets","pdfviewer.thumbnail":"Miniatures","picklist.available":"Disponible","picklist.selected":"Sélectionné","picklist.addAll":"Tout ajouter","picklist.removeAll":"Tout retirer","picklist.filter":"Filtrer les éléments","scheduling.calendar":"Calendrier","scheduling.event":"Événement","scheduling.allDay":"Toute la journée","scheduling.today":"Aujourd'hui","scheduling.week":"Semaine","scheduling.month":"Mois","scheduling.year":"Année","scheduling.day":"Jour","scheduling.agenda":"Agenda","scheduling.addEvent":"Ajouter un événement","scheduling.editEvent":"Modifier l'événement","scheduling.deleteEvent":"Supprimer l'événement","scheduling.noEvents":"Aucun événement","shortcuts.title":"Raccourcis clavier","shortcuts.description":"Raccourcis disponibles","shortcuts.key":"Touche","shortcuts.command":"Commande","shortcuts.search":"Rechercher des raccourcis","signature.clear":"Effacer","signature.save":"Enregistrer","signature.sign":"Signez ici","signature.draw":"Dessinez votre signature","spreadsheet.cell":"Cellule","spreadsheet.row":"Ligne","spreadsheet.column":"Colonne","spreadsheet.formula":"Formule","spreadsheet.insert":"Insérer","spreadsheet.delete":"Supprimer","spreadsheet.sort":"Trier","spreadsheet.sortAsc":"Tri croissant","spreadsheet.sortDesc":"Tri décroissant","spreadsheet.filter":"Filtrer","spreadsheet.export":"Exporter","spreadsheet.import":"Importer","spreadsheet.addRow":"Ajouter une ligne","spreadsheet.addColumn":"Ajouter une colonne","spreadsheet.deleteRow":"Supprimer la ligne","spreadsheet.deleteColumn":"Supprimer la colonne","spreadsheet.freezeRow":"Figer la ligne","spreadsheet.freezeColumn":"Figer la colonne","spreadsheet.merge":"Fusionner les cellules","spreadsheet.unmerge":"Scinder les cellules","terminal.run":"Exécuter","terminal.clear":"Effacer","terminal.copy":"Copier","terminal.paste":"Coller","terminal.newSession":"Nouvelle session","terminal.closeSession":"Fermer la session","terminal.selectAll":"Tout sélectionner","theme.light":"Clair","theme.dark":"Sombre","theme.system":"Système","theme.custom":"Personnalisé","theme.colors":"Couleurs","theme.fonts":"Polices","theme.apply":"Appliquer le thème","theme.preview":"Aperçu","theme.reset":"Réinitialiser","theme.gallery":"Galerie de thèmes","users.profile":"Profil","users.settings":"Paramètres","users.permissions":"Autorisations","users.role":"Rôle","users.active":"Actif","users.inactive":"Inactif","users.online":"En ligne","users.offline":"Hors ligne","users.lastSeen":"Dernière connexion","wm.close":"Fermer","wm.minimize":"Réduire","wm.maximize":"Agrandir","wm.restore":"Restaurer","wm.tile":"Fenêtres en mosaïque","wm.cascade":"Fenêtres en cascade","wm.closeAll":"Tout fermer","wm.minimizeAll":"Tout réduire","wm.newWindow":"Nouvelle fenêtre","wm.moveToFront":"Au premier plan","git.commit":"Commit","git.commits":"Commits","git.branch":"Branche","git.branches":"Branches","git.merge":"Fusionner","git.rebase":"Rebase","git.pull":"Tirer","git.push":"Pousser","git.fetch":"Récupérer","git.checkout":"Extraire","git.stash":"Remiser","git.diff":"Diff","git.blame":"Blame","git.history":"Historique","git.conflict":"Conflit","git.resolve":"Résoudre","git.createBranch":"Créer une branche","git.deleteBranch":"Supprimer la branche","git.mergeRequest":"Merge Request","git.pullRequest":"Pull Request","pipeline.run":"Exécuter le pipeline","pipeline.stop":"Arrêter le pipeline","pipeline.status":"Statut du pipeline","pipeline.logs":"Journaux du pipeline","pipeline.stages":"Étapes","pipeline.jobs":"Tâches","pipeline.artifacts":"Artefacts","pipeline.trigger":"Déclencheur","pipeline.schedule":"Planification","pipeline.manual":"Manuel","devops.deploy":"Déployer","devops.rollback":"Restaurer","devops.release":"Version","devops.environment":"Environnement","dataBranching.environment":"Environnement","dataBranching.environments":"Environnements","dataBranching.dev":"Développement","dataBranching.test":"Test","dataBranching.uat":"UAT","dataBranching.staging":"Pré-production","dataBranching.prod":"Production","dataBranching.snapshot":"Instantané","dataBranching.createSnapshot":"Créer un instantané","dataBranching.restoreSnapshot":"Restaurer l'instantané","dataBranching.diff":"Diff des données","dataBranching.compare":"Comparer","dataBranching.merge":"Fusionner les données","dataBranching.promote":"Promouvoir","dataBranching.conflict":"Conflit","dataBranching.resolveConflict":"Résoudre le conflit","dataBranching.accept":"Accepter","dataBranching.reject":"Rejeter","dataBranching.useSource":"Utiliser la source","dataBranching.useTarget":"Utiliser la cible","dataBranching.entity":"Entité","dataBranching.entities":"Entités","dataBranching.record":"Enregistrement","dataBranching.records":"Enregistrements","dataBranching.changes":"Modifications","dataBranching.added":"Ajouté","dataBranching.modified":"Modifié","dataBranching.deleted":"Supprimé","dataBranching.unchanged":"Inchangé","dataBranching.status":"Statut","dataBranching.synced":"Synchronisé","dataBranching.pending":"En attente","dataBranching.inProgress":"En cours","dataBranching.completed":"Terminé","dataBranching.failed":"Échoué"},yo={ok:"OK",cancel:"Cancelar",save:"Guardar",close:"Cerrar",delete:"Eliminar",edit:"Editar",add:"Agregar",remove:"Quitar",search:"Buscar",filter:"Filtrar",refresh:"Actualizar",loading:"Cargando…",noData:"Sin datos",error:"Error",success:"Éxito",warning:"Advertencia",info:"Información",yes:"Sí",no:"No",confirm:"Confirmar",back:"Atrás",next:"Siguiente",previous:"Anterior",finish:"Finalizar",submit:"Enviar",reset:"Restablecer",apply:"Aplicar",undo:"Deshacer",redo:"Rehacer",copy:"Copiar",cut:"Cortar",paste:"Pegar",selectAll:"Seleccionar todo",clear:"Borrar",upload:"Subir",download:"Descargar",print:"Imprimir",export:"Exportar",import:"Importar",settings:"Configuración",help:"Ayuda",about:"Acerca de",more:"Más",less:"Menos",show:"Mostrar",hide:"Ocultar",expand:"Expandir",collapse:"Contraer",enabled:"Habilitado",disabled:"Deshabilitado",required:"Obligatorio",optional:"Opcional",actions:"Acciones",details:"Detalles",overview:"Vista general",all:"Todos",none:"Ninguno",selected:"Seleccionado",total:"Total",of:"de",items:"elementos",page:"Página",rows:"Filas","app.name":"Aplicación","app.version":"Versión","app.about":"Acerca de","nav.home":"Inicio","nav.back":"Atrás","nav.forward":"Adelante","nav.menu":"Menú","nav.sidebar":"Barra lateral","nav.search":"Buscar","nav.favorites":"Favoritos","nav.recent":"Reciente","nav.notifications":"Notificaciones","nav.profile":"Perfil","nav.logout":"Cerrar sesión","carousel.prev":"Diapositiva anterior","carousel.next":"Diapositiva siguiente","carousel.slide":"Diapositiva","carousel.of":"de","carousel.autoplay":"Reproducción automática","carousel.pause":"Pausa","confirm.yes":"Sí","confirm.no":"No","confirm.ok":"OK","confirm.cancel":"Cancelar","confirm.title":"Confirmación","confirm.deleteMessage":"¿Seguro que desea eliminar esto?","confirm.unsavedChanges":"Hay cambios sin guardar. ¿Descartar?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Ingrese un comando…","console.clear":"Limpiar consola","console.run":"Ejecutar","console.output":"Salida","console.newSession":"Nueva sesión","console.closeSession":"Cerrar sesión","controls.save":"Guardar","controls.cancel":"Cancelar","controls.delete":"Eliminar","controls.edit":"Editar","controls.add":"Agregar","controls.remove":"Quitar","controls.close":"Cerrar","controls.open":"Abrir","controls.refresh":"Actualizar","controls.new":"Nuevo","controls.duplicate":"Duplicar","controls.sort":"Ordenar","controls.group":"Agrupar","controls.pin":"Fijar","controls.unpin":"Desfijar","controls.lock":"Bloquear","controls.unlock":"Desbloquear","controls.share":"Compartir","controls.archive":"Archivar","cookie.title":"Consentimiento de cookies","cookie.message":"Este sitio utiliza cookies.","cookie.accept":"Aceptar todas","cookie.reject":"Rechazar todas","cookie.settings":"Configuración de cookies","cookie.necessary":"Necesarias","cookie.analytics":"Analíticas","cookie.marketing":"Marketing","dashboard.title":"Panel","dashboard.addWidget":"Agregar widget","dashboard.removeWidget":"Quitar widget","dashboard.layout":"Diseño","dashboard.settings":"Configuración","dashboard.customize":"Personalizar","dashboard.resetLayout":"Restablecer diseño","datetime.today":"Hoy","datetime.yesterday":"Ayer","datetime.tomorrow":"Mañana","datetime.selectDate":"Seleccionar fecha","datetime.selectTime":"Seleccionar hora","datetime.startDate":"Fecha de inicio","datetime.endDate":"Fecha de fin","datetime.startTime":"Hora de inicio","datetime.endTime":"Hora de fin","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Inicio","desktop.taskbar":"Barra de tareas","desktop.systemTray":"Bandeja del sistema","desktop.wallpaper":"Fondo de pantalla","desktop.icons":"Iconos del escritorio","desktop.arrangeIcons":"Organizar iconos","dock.pin":"Fijar al dock","dock.unpin":"Desfijar del dock","dock.close":"Cerrar","dock.minimize":"Minimizar","dock.maximize":"Maximizar","dock.restore":"Restaurar","docEditor.paragraph":"Párrafo","docEditor.heading":"Encabezado","docEditor.heading1":"Encabezado 1","docEditor.heading2":"Encabezado 2","docEditor.heading3":"Encabezado 3","docEditor.bulletList":"Lista con viñetas","docEditor.numberedList":"Lista numerada","docEditor.quote":"Cita","docEditor.code":"Bloque de código","docEditor.divider":"Separador","docEditor.image":"Imagen","docEditor.table":"Tabla","docEditor.callout":"Destacado","docEditor.placeholder":"Empiece a escribir…","docEditor.slashCommand":"Escriba / para comandos","files.upload":"Subir archivo","files.download":"Descargar","files.delete":"Eliminar archivo","files.rename":"Renombrar","files.newFolder":"Nueva carpeta","files.selectFile":"Seleccionar archivo","files.dropzone":"Suelte archivos aquí","files.dragDrop":"Arrastre y suelte archivos o haga clic","files.maxSize":"Tamaño máximo del archivo","files.fileType":"Tipo de archivo","forms.required":"Este campo es obligatorio","forms.optional":"Opcional","forms.submit":"Enviar","forms.reset":"Restablecer","forms.validate":"Validar","forms.invalid":"Valor inválido","forms.minLength":"Longitud mínima: {0}","forms.maxLength":"Longitud máxima: {0}","forms.email":"Ingrese un correo válido","forms.phone":"Ingrese un teléfono válido","imageEditor.crop":"Recortar","imageEditor.rotate":"Rotar","imageEditor.flip":"Voltear","imageEditor.resize":"Redimensionar","imageEditor.filter":"Filtro","imageEditor.draw":"Dibujar","imageEditor.text":"Texto","imageEditor.undo":"Deshacer","imageEditor.redo":"Rehacer","imageEditor.save":"Guardar","imageEditor.brightness":"Brillo","imageEditor.contrast":"Contraste","imageEditor.saturation":"Saturación","inbox.compose":"Redactar","inbox.reply":"Responder","inbox.replyAll":"Responder a todos","inbox.forward":"Reenviar","inbox.delete":"Eliminar","inbox.archive":"Archivar","inbox.markRead":"Marcar como leído","inbox.markUnread":"Marcar como no leído","inbox.folders":"Carpetas","inbox.inbox":"Bandeja de entrada","inbox.sent":"Enviados","inbox.drafts":"Borradores","inbox.trash":"Papelera","inbox.spam":"Spam","inbox.starred":"Destacados","inbox.to":"Para","inbox.cc":"CC","inbox.bcc":"CCO","inbox.subject":"Asunto","inbox.send":"Enviar","inbox.discard":"Descartar","inbox.attachFile":"Adjuntar archivo","kanban.addCard":"Agregar tarjeta","kanban.addColumn":"Agregar columna","kanban.moveCard":"Mover tarjeta","kanban.editCard":"Editar tarjeta","kanban.deleteCard":"Eliminar tarjeta","kanban.editColumn":"Editar columna","kanban.deleteColumn":"Eliminar columna","lang.en":"Inglés","lang.pl":"Polaco","lang.de":"Alemán","lang.fr":"Francés","lang.es":"Español","lang.it":"Italiano","lang.pt":"Portugués","lang.nl":"Neerlandés","lang.sv":"Sueco","lang.no":"Noruego","lang.da":"Danés","lang.fi":"Finlandés","lang.cs":"Checo","lang.sk":"Eslovaco","lang.hu":"Húngaro","lang.ro":"Rumano","lang.bg":"Búlgaro","lang.uk":"Ucraniano","lang.ja":"Japonés","lang.ko":"Coreano","lang.zh":"Chino","lang.ar":"Árabe","login.username":"Nombre de usuario","login.password":"Contraseña","login.signIn":"Iniciar sesión","login.signOut":"Cerrar sesión","login.forgotPassword":"¿Olvidó su contraseña?","login.register":"Registrarse","login.rememberMe":"Recordarme","login.newPassword":"Nueva contraseña","login.confirmPassword":"Confirmar contraseña","login.twoFactor":"Autenticación de dos factores","password.strength":"Fuerza de la contraseña","password.weak":"Débil","password.medium":"Media","password.strong":"Fuerte","password.requirements":"Requisitos de contraseña","pdfviewer.page":"Página","pdfviewer.of":"de","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Ajustar a página","pdfviewer.fitWidth":"Ajustar a ancho","pdfviewer.download":"Descargar","pdfviewer.print":"Imprimir","pdfviewer.search":"Buscar en el documento","pdfviewer.bookmark":"Marcadores","pdfviewer.thumbnail":"Miniaturas","picklist.available":"Disponibles","picklist.selected":"Seleccionados","picklist.addAll":"Agregar todos","picklist.removeAll":"Quitar todos","picklist.filter":"Filtrar elementos","scheduling.calendar":"Calendario","scheduling.event":"Evento","scheduling.allDay":"Todo el día","scheduling.today":"Hoy","scheduling.week":"Semana","scheduling.month":"Mes","scheduling.year":"Año","scheduling.day":"Día","scheduling.agenda":"Agenda","scheduling.addEvent":"Agregar evento","scheduling.editEvent":"Editar evento","scheduling.deleteEvent":"Eliminar evento","scheduling.noEvents":"Sin eventos","shortcuts.title":"Atajos de teclado","shortcuts.description":"Atajos disponibles","shortcuts.key":"Tecla","shortcuts.command":"Comando","shortcuts.search":"Buscar atajos","signature.clear":"Borrar","signature.save":"Guardar","signature.sign":"Firme aquí","signature.draw":"Dibuje su firma","spreadsheet.cell":"Celda","spreadsheet.row":"Fila","spreadsheet.column":"Columna","spreadsheet.formula":"Fórmula","spreadsheet.insert":"Insertar","spreadsheet.delete":"Eliminar","spreadsheet.sort":"Ordenar","spreadsheet.sortAsc":"Orden ascendente","spreadsheet.sortDesc":"Orden descendente","spreadsheet.filter":"Filtrar","spreadsheet.export":"Exportar","spreadsheet.import":"Importar","spreadsheet.addRow":"Agregar fila","spreadsheet.addColumn":"Agregar columna","spreadsheet.deleteRow":"Eliminar fila","spreadsheet.deleteColumn":"Eliminar columna","spreadsheet.freezeRow":"Inmovilizar fila","spreadsheet.freezeColumn":"Inmovilizar columna","spreadsheet.merge":"Combinar celdas","spreadsheet.unmerge":"Separar celdas","terminal.run":"Ejecutar","terminal.clear":"Limpiar","terminal.copy":"Copiar","terminal.paste":"Pegar","terminal.newSession":"Nueva sesión","terminal.closeSession":"Cerrar sesión","terminal.selectAll":"Seleccionar todo","theme.light":"Claro","theme.dark":"Oscuro","theme.system":"Sistema","theme.custom":"Personalizado","theme.colors":"Colores","theme.fonts":"Fuentes","theme.apply":"Aplicar tema","theme.preview":"Vista previa","theme.reset":"Restablecer","theme.gallery":"Galería de temas","users.profile":"Perfil","users.settings":"Configuración","users.permissions":"Permisos","users.role":"Rol","users.active":"Activo","users.inactive":"Inactivo","users.online":"En línea","users.offline":"Desconectado","users.lastSeen":"Última vez visto","wm.close":"Cerrar","wm.minimize":"Minimizar","wm.maximize":"Maximizar","wm.restore":"Restaurar","wm.tile":"Mosaico de ventanas","wm.cascade":"Cascada de ventanas","wm.closeAll":"Cerrar todo","wm.minimizeAll":"Minimizar todo","wm.newWindow":"Nueva ventana","wm.moveToFront":"Al frente","git.commit":"Commit","git.commits":"Commits","git.branch":"Rama","git.branches":"Ramas","git.merge":"Fusionar","git.rebase":"Rebase","git.pull":"Tirar","git.push":"Empujar","git.fetch":"Obtener","git.checkout":"Extraer","git.stash":"Guardar","git.diff":"Diferencias","git.blame":"Blame","git.history":"Historial","git.conflict":"Conflicto","git.resolve":"Resolver","git.createBranch":"Crear rama","git.deleteBranch":"Eliminar rama","git.mergeRequest":"Solicitud de fusión","git.pullRequest":"Pull Request","pipeline.run":"Ejecutar pipeline","pipeline.stop":"Detener pipeline","pipeline.status":"Estado del pipeline","pipeline.logs":"Registros del pipeline","pipeline.stages":"Etapas","pipeline.jobs":"Trabajos","pipeline.artifacts":"Artefactos","pipeline.trigger":"Disparador","pipeline.schedule":"Programación","pipeline.manual":"Manual","devops.deploy":"Desplegar","devops.rollback":"Revertir","devops.release":"Lanzamiento","devops.environment":"Entorno","dataBranching.environment":"Entorno","dataBranching.environments":"Entornos","dataBranching.dev":"Desarrollo","dataBranching.test":"Pruebas","dataBranching.uat":"UAT","dataBranching.staging":"Pre-producción","dataBranching.prod":"Producción","dataBranching.snapshot":"Instantánea","dataBranching.createSnapshot":"Crear instantánea","dataBranching.restoreSnapshot":"Restaurar instantánea","dataBranching.diff":"Diferencias de datos","dataBranching.compare":"Comparar","dataBranching.merge":"Fusionar datos","dataBranching.promote":"Promover","dataBranching.conflict":"Conflicto","dataBranching.resolveConflict":"Resolver conflicto","dataBranching.accept":"Aceptar","dataBranching.reject":"Rechazar","dataBranching.useSource":"Usar origen","dataBranching.useTarget":"Usar destino","dataBranching.entity":"Entidad","dataBranching.entities":"Entidades","dataBranching.record":"Registro","dataBranching.records":"Registros","dataBranching.changes":"Cambios","dataBranching.added":"Agregado","dataBranching.modified":"Modificado","dataBranching.deleted":"Eliminado","dataBranching.unchanged":"Sin cambios","dataBranching.status":"Estado","dataBranching.synced":"Sincronizado","dataBranching.pending":"Pendiente","dataBranching.inProgress":"En progreso","dataBranching.completed":"Completado","dataBranching.failed":"Fallido"},bo={ok:"OK",cancel:"Annulla",save:"Salva",close:"Chiudi",delete:"Elimina",edit:"Modifica",add:"Aggiungi",remove:"Rimuovi",search:"Cerca",filter:"Filtra",refresh:"Aggiorna",loading:"Caricamento…",noData:"Nessun dato",error:"Errore",success:"Successo",warning:"Avviso",info:"Informazione",yes:"Sì",no:"No",confirm:"Conferma",back:"Indietro",next:"Avanti",previous:"Precedente",finish:"Fine",submit:"Invia",reset:"Ripristina",apply:"Applica",undo:"Annulla",redo:"Ripeti",copy:"Copia",cut:"Taglia",paste:"Incolla",selectAll:"Seleziona tutto",clear:"Cancella",upload:"Carica",download:"Scarica",print:"Stampa",export:"Esporta",import:"Importa",settings:"Impostazioni",help:"Aiuto",about:"Info",more:"Altro",less:"Meno",show:"Mostra",hide:"Nascondi",expand:"Espandi",collapse:"Comprimi",enabled:"Abilitato",disabled:"Disabilitato",required:"Obbligatorio",optional:"Facoltativo",actions:"Azioni",details:"Dettagli",overview:"Panoramica",all:"Tutti",none:"Nessuno",selected:"Selezionato",total:"Totale",of:"di",items:"elementi",page:"Pagina",rows:"Righe","nav.home":"Home","nav.back":"Indietro","nav.forward":"Avanti","nav.menu":"Menu","nav.sidebar":"Barra laterale","nav.search":"Cerca","nav.favorites":"Preferiti","nav.recent":"Recenti","nav.notifications":"Notifiche","nav.profile":"Profilo","nav.logout":"Esci","confirm.title":"Conferma","confirm.deleteMessage":"Sei sicuro di voler eliminare?","confirm.unsavedChanges":"Modifiche non salvate. Annullare?","login.username":"Nome utente","login.password":"Password","login.signIn":"Accedi","login.signOut":"Esci","login.forgotPassword":"Password dimenticata?","login.register":"Registrati","login.rememberMe":"Ricordami","theme.light":"Chiaro","theme.dark":"Scuro","theme.system":"Sistema","wm.close":"Chiudi","wm.minimize":"Riduci","wm.maximize":"Ingrandisci","wm.restore":"Ripristina","lang.en":"Inglese","lang.pl":"Polacco","lang.de":"Tedesco","lang.fr":"Francese","lang.es":"Spagnolo","lang.it":"Italiano","lang.pt":"Portoghese","lang.nl":"Olandese","lang.sv":"Svedese","lang.no":"Norvegese","lang.da":"Danese","lang.fi":"Finlandese","lang.cs":"Ceco","lang.sk":"Slovacco","lang.hu":"Ungherese","lang.ro":"Rumeno","lang.bg":"Bulgaro","lang.uk":"Ucraino","lang.ja":"Giapponese","lang.ko":"Coreano","lang.zh":"Cinese","lang.ar":"Arabo"},xo={ok:"OK",cancel:"Cancelar",save:"Salvar",close:"Fechar",delete:"Excluir",edit:"Editar",add:"Adicionar",remove:"Remover",search:"Pesquisar",filter:"Filtrar",refresh:"Atualizar",loading:"Carregando…",noData:"Sem dados",error:"Erro",success:"Sucesso",warning:"Aviso",info:"Informação",yes:"Sim",no:"Não",confirm:"Confirmar",back:"Voltar",next:"Próximo",previous:"Anterior",finish:"Concluir",submit:"Enviar",reset:"Redefinir",apply:"Aplicar",undo:"Desfazer",redo:"Refazer",copy:"Copiar",cut:"Recortar",paste:"Colar",selectAll:"Selecionar tudo",clear:"Limpar",upload:"Enviar",download:"Baixar",print:"Imprimir",export:"Exportar",import:"Importar",settings:"Configurações",help:"Ajuda",about:"Sobre",more:"Mais",less:"Menos",show:"Mostrar",hide:"Ocultar",expand:"Expandir",collapse:"Recolher",enabled:"Ativado",disabled:"Desativado",required:"Obrigatório",optional:"Opcional",actions:"Ações",details:"Detalhes",overview:"Visão geral",all:"Todos",none:"Nenhum",selected:"Selecionado",total:"Total",of:"de",items:"itens",page:"Página",rows:"Linhas","app.name":"Aplicação","app.version":"Versão","app.about":"Sobre","nav.home":"Início","nav.back":"Voltar","nav.forward":"Avançar","nav.menu":"Menu","nav.sidebar":"Barra lateral","nav.search":"Pesquisar","nav.favorites":"Favoritos","nav.recent":"Recentes","nav.notifications":"Notificações","nav.profile":"Perfil","nav.logout":"Sair","carousel.prev":"Slide anterior","carousel.next":"Próximo slide","carousel.slide":"Slide","carousel.of":"de","carousel.autoplay":"Reprodução automática","carousel.pause":"Pausar","confirm.yes":"Sim","confirm.no":"Não","confirm.ok":"OK","confirm.cancel":"Cancelar","confirm.title":"Confirmação","confirm.deleteMessage":"Tem certeza de que deseja excluir?","confirm.unsavedChanges":"Alterações não salvas. Descartar?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Digite o comando…","console.clear":"Limpar console","console.run":"Executar","console.output":"Saída","console.newSession":"Nova sessão","console.closeSession":"Fechar sessão","controls.save":"Salvar","controls.cancel":"Cancelar","controls.delete":"Excluir","controls.edit":"Editar","controls.add":"Adicionar","controls.remove":"Remover","controls.close":"Fechar","controls.open":"Abrir","controls.refresh":"Atualizar","controls.new":"Novo","controls.duplicate":"Duplicar","controls.sort":"Ordenar","controls.group":"Agrupar","controls.pin":"Fixar","controls.unpin":"Desfixar","controls.lock":"Bloquear","controls.unlock":"Desbloquear","controls.share":"Compartilhar","controls.archive":"Arquivar","cookie.title":"Consentimento de cookies","cookie.message":"Este site usa cookies para melhorar sua experiência.","cookie.accept":"Aceitar todos","cookie.reject":"Rejeitar todos","cookie.settings":"Configurações de cookies","cookie.necessary":"Necessários","cookie.analytics":"Analíticos","cookie.marketing":"Marketing","dashboard.title":"Painel","dashboard.addWidget":"Adicionar widget","dashboard.removeWidget":"Remover widget","dashboard.layout":"Layout","dashboard.settings":"Configurações","dashboard.customize":"Personalizar","dashboard.resetLayout":"Redefinir layout","datetime.today":"Hoje","datetime.yesterday":"Ontem","datetime.tomorrow":"Amanhã","datetime.selectDate":"Selecionar data","datetime.selectTime":"Selecionar hora","datetime.startDate":"Data de início","datetime.endDate":"Data de término","datetime.startTime":"Hora de início","datetime.endTime":"Hora de término","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Iniciar","desktop.taskbar":"Barra de tarefas","desktop.systemTray":"Bandeja do sistema","desktop.wallpaper":"Papel de parede","desktop.icons":"Ícones da área de trabalho","desktop.arrangeIcons":"Organizar ícones","dock.pin":"Fixar no dock","dock.unpin":"Desfixar do dock","dock.close":"Fechar","dock.minimize":"Minimizar","dock.maximize":"Maximizar","dock.restore":"Restaurar","docEditor.paragraph":"Parágrafo","docEditor.heading":"Título","docEditor.heading1":"Título 1","docEditor.heading2":"Título 2","docEditor.heading3":"Título 3","docEditor.bulletList":"Lista com marcadores","docEditor.numberedList":"Lista numerada","docEditor.quote":"Citação","docEditor.code":"Bloco de código","docEditor.divider":"Divisor","docEditor.image":"Imagem","docEditor.table":"Tabela","docEditor.callout":"Destaque","docEditor.placeholder":"Comece a digitar…","docEditor.slashCommand":"Digite / para comandos","files.upload":"Enviar arquivo","files.download":"Baixar","files.delete":"Excluir arquivo","files.rename":"Renomear","files.newFolder":"Nova pasta","files.selectFile":"Selecionar arquivo","files.dropzone":"Arraste arquivos aqui","files.dragDrop":"Arraste e solte arquivos ou clique para selecionar","files.maxSize":"Tamanho máximo do arquivo","files.fileType":"Tipo de arquivo","forms.required":"Este campo é obrigatório","forms.optional":"Opcional","forms.submit":"Enviar","forms.reset":"Redefinir","forms.validate":"Validar","forms.invalid":"Valor inválido","forms.minLength":"Comprimento mínimo: {0}","forms.maxLength":"Comprimento máximo: {0}","forms.email":"Insira um e-mail válido","forms.phone":"Insira um telefone válido","imageEditor.crop":"Cortar","imageEditor.rotate":"Girar","imageEditor.flip":"Espelhar","imageEditor.resize":"Redimensionar","imageEditor.filter":"Filtro","imageEditor.draw":"Desenhar","imageEditor.text":"Texto","imageEditor.undo":"Desfazer","imageEditor.redo":"Refazer","imageEditor.save":"Salvar","imageEditor.brightness":"Brilho","imageEditor.contrast":"Contraste","imageEditor.saturation":"Saturação","inbox.compose":"Escrever","inbox.reply":"Responder","inbox.replyAll":"Responder a todos","inbox.forward":"Encaminhar","inbox.delete":"Excluir","inbox.archive":"Arquivar","inbox.markRead":"Marcar como lido","inbox.markUnread":"Marcar como não lido","inbox.folders":"Pastas","inbox.inbox":"Caixa de entrada","inbox.sent":"Enviados","inbox.drafts":"Rascunhos","inbox.trash":"Lixeira","inbox.spam":"Spam","inbox.starred":"Com estrela","inbox.to":"Para","inbox.cc":"Cc","inbox.bcc":"Cco","inbox.subject":"Assunto","inbox.send":"Enviar","inbox.discard":"Descartar","inbox.attachFile":"Anexar arquivo","kanban.addCard":"Adicionar cartão","kanban.addColumn":"Adicionar coluna","kanban.moveCard":"Mover cartão","kanban.editCard":"Editar cartão","kanban.deleteCard":"Excluir cartão","kanban.editColumn":"Editar coluna","kanban.deleteColumn":"Excluir coluna","lang.en":"Inglês","lang.pl":"Polonês","lang.de":"Alemão","lang.fr":"Francês","lang.es":"Espanhol","lang.it":"Italiano","lang.pt":"Português","lang.nl":"Holandês","lang.sv":"Sueco","lang.no":"Norueguês","lang.da":"Dinamarquês","lang.fi":"Finlandês","lang.cs":"Tcheco","lang.sk":"Eslovaco","lang.hu":"Húngaro","lang.ro":"Romeno","lang.bg":"Búlgaro","lang.uk":"Ucraniano","lang.ja":"Japonês","lang.ko":"Coreano","lang.zh":"Chinês","lang.ar":"Árabe","login.username":"Nome de usuário","login.password":"Senha","login.signIn":"Entrar","login.signOut":"Sair","login.forgotPassword":"Esqueceu a senha?","login.register":"Registrar","login.rememberMe":"Lembrar-me","login.newPassword":"Nova senha","login.confirmPassword":"Confirmar senha","login.twoFactor":"Autenticação de dois fatores","password.strength":"Força da senha","password.weak":"Fraca","password.medium":"Média","password.strong":"Forte","password.requirements":"Requisitos de senha","pdfviewer.page":"Página","pdfviewer.of":"de","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Ajustar à página","pdfviewer.fitWidth":"Ajustar à largura","pdfviewer.download":"Baixar","pdfviewer.print":"Imprimir","pdfviewer.search":"Pesquisar no documento","pdfviewer.bookmark":"Marcadores","pdfviewer.thumbnail":"Miniaturas","picklist.available":"Disponíveis","picklist.selected":"Selecionados","picklist.addAll":"Adicionar todos","picklist.removeAll":"Remover todos","picklist.filter":"Filtrar itens","scheduling.calendar":"Calendário","scheduling.event":"Evento","scheduling.allDay":"Dia inteiro","scheduling.today":"Hoje","scheduling.week":"Semana","scheduling.month":"Mês","scheduling.year":"Ano","scheduling.day":"Dia","scheduling.agenda":"Agenda","scheduling.addEvent":"Adicionar evento","scheduling.editEvent":"Editar evento","scheduling.deleteEvent":"Excluir evento","scheduling.noEvents":"Sem eventos","shortcuts.title":"Atalhos de teclado","shortcuts.description":"Atalhos disponíveis","shortcuts.key":"Tecla","shortcuts.command":"Comando","shortcuts.search":"Pesquisar atalhos","signature.clear":"Limpar","signature.save":"Salvar","signature.sign":"Assine aqui","signature.draw":"Desenhe sua assinatura","spreadsheet.cell":"Célula","spreadsheet.row":"Linha","spreadsheet.column":"Coluna","spreadsheet.formula":"Fórmula","spreadsheet.insert":"Inserir","spreadsheet.delete":"Excluir","spreadsheet.sort":"Ordenar","spreadsheet.sortAsc":"Ordem crescente","spreadsheet.sortDesc":"Ordem decrescente","spreadsheet.filter":"Filtrar","spreadsheet.export":"Exportar","spreadsheet.import":"Importar","spreadsheet.addRow":"Adicionar linha","spreadsheet.addColumn":"Adicionar coluna","spreadsheet.deleteRow":"Excluir linha","spreadsheet.deleteColumn":"Excluir coluna","spreadsheet.freezeRow":"Congelar linha","spreadsheet.freezeColumn":"Congelar coluna","spreadsheet.merge":"Mesclar células","spreadsheet.unmerge":"Desfazer mesclagem","terminal.run":"Executar","terminal.clear":"Limpar","terminal.copy":"Copiar","terminal.paste":"Colar","terminal.newSession":"Nova sessão","terminal.closeSession":"Fechar sessão","terminal.selectAll":"Selecionar tudo","theme.light":"Claro","theme.dark":"Escuro","theme.system":"Sistema","theme.custom":"Personalizado","theme.colors":"Cores","theme.fonts":"Fontes","theme.apply":"Aplicar tema","theme.preview":"Visualizar","theme.reset":"Restaurar padrão","theme.gallery":"Galeria de temas","users.profile":"Perfil","users.settings":"Configurações","users.permissions":"Permissões","users.role":"Papel","users.active":"Ativo","users.inactive":"Inativo","users.online":"Online","users.offline":"Offline","users.lastSeen":"Último acesso","wm.close":"Fechar","wm.minimize":"Minimizar","wm.maximize":"Maximizar","wm.restore":"Restaurar","wm.tile":"Organizar janelas","wm.cascade":"Cascata","wm.closeAll":"Fechar todos","wm.minimizeAll":"Minimizar todos","wm.newWindow":"Nova janela","wm.moveToFront":"Trazer para frente"},vo={ok:"OK",cancel:"Annuleren",save:"Opslaan",close:"Sluiten",delete:"Verwijderen",edit:"Bewerken",add:"Toevoegen",remove:"Verwijderen",search:"Zoeken",filter:"Filteren",refresh:"Vernieuwen",loading:"Laden…",noData:"Geen gegevens",error:"Fout",success:"Gelukt",warning:"Waarschuwing",info:"Informatie",yes:"Ja",no:"Nee",confirm:"Bevestigen",back:"Terug",next:"Volgende",previous:"Vorige",finish:"Voltooien",submit:"Indienen",reset:"Herstellen",apply:"Toepassen",undo:"Ongedaan maken",redo:"Opnieuw",copy:"Kopiëren",cut:"Knippen",paste:"Plakken",selectAll:"Alles selecteren",clear:"Wissen",upload:"Uploaden",download:"Downloaden",print:"Afdrukken",export:"Exporteren",import:"Importeren",settings:"Instellingen",help:"Help",required:"Verplicht",optional:"Optioneel","nav.home":"Startpagina","nav.back":"Terug","nav.favorites":"Favorieten","nav.notifications":"Meldingen","nav.profile":"Profiel","nav.logout":"Uitloggen","login.username":"Gebruikersnaam","login.password":"Wachtwoord","login.signIn":"Inloggen","login.signOut":"Uitloggen","login.forgotPassword":"Wachtwoord vergeten?","login.register":"Registreren","theme.light":"Licht","theme.dark":"Donker","theme.system":"Systeem","wm.close":"Sluiten","wm.minimize":"Minimaliseren","wm.maximize":"Maximaliseren","wm.restore":"Herstellen","lang.en":"Engels","lang.pl":"Pools","lang.de":"Duits","lang.fr":"Frans","lang.es":"Spaans","lang.it":"Italiaans","lang.pt":"Portugees","lang.nl":"Nederlands","lang.sv":"Zweeds","lang.no":"Noors","lang.da":"Deens","lang.fi":"Fins","lang.cs":"Tsjechisch","lang.sk":"Slowaaks","lang.hu":"Hongaars","lang.ro":"Roemeens","lang.bg":"Bulgaars","lang.uk":"Oekraïens","lang.ja":"Japans","lang.ko":"Koreaans","lang.zh":"Chinees","lang.ar":"Arabisch"},ko={ok:"OK",cancel:"Avbryt",save:"Spara",close:"Stäng",delete:"Ta bort",edit:"Redigera",add:"Lägg till",remove:"Ta bort",search:"Sök",filter:"Filtrera",refresh:"Uppdatera",loading:"Laddar…",noData:"Ingen data",error:"Fel",success:"Lyckades",warning:"Varning",info:"Information",yes:"Ja",no:"Nej",confirm:"Bekräfta",back:"Tillbaka",next:"Nästa",undo:"Ångra",redo:"Gör om",copy:"Kopiera",cut:"Klipp",paste:"Klistra in",settings:"Inställningar",help:"Hjälp",required:"Obligatoriskt","nav.home":"Hem","nav.favorites":"Favoriter","nav.notifications":"Aviseringar","nav.logout":"Logga ut","login.username":"Användarnamn","login.password":"Lösenord","login.signIn":"Logga in","login.signOut":"Logga ut","login.forgotPassword":"Glömt lösenordet?","login.register":"Registrera","theme.light":"Ljust","theme.dark":"Mörkt","theme.system":"System","wm.close":"Stäng","wm.minimize":"Minimera","wm.maximize":"Maximera","wm.restore":"Återställ","lang.en":"Engelska","lang.pl":"Polska","lang.de":"Tyska","lang.fr":"Franska","lang.es":"Spanska","lang.it":"Italienska","lang.pt":"Portugisiska","lang.nl":"Nederländska","lang.sv":"Svenska","lang.no":"Norska","lang.da":"Danska","lang.fi":"Finska","lang.cs":"Tjeckiska","lang.sk":"Slovakiska","lang.hu":"Ungerska","lang.ro":"Rumänska","lang.bg":"Bulgariska","lang.uk":"Ukrainska","lang.ja":"Japanska","lang.ko":"Koreanska","lang.zh":"Kinesiska","lang.ar":"Arabiska"},wo={ok:"OK",cancel:"Avbryt",save:"Lagre",close:"Lukk",delete:"Slett",edit:"Rediger",add:"Legg til",remove:"Fjern",search:"Søk",filter:"Filtrer",refresh:"Oppdater",loading:"Laster…",noData:"Ingen data",error:"Feil",success:"Vellykket",warning:"Advarsel",yes:"Ja",no:"Nei",confirm:"Bekreft",back:"Tilbake",next:"Neste",undo:"Angre",redo:"Gjør om",copy:"Kopier",paste:"Lim inn",settings:"Innstillinger",help:"Hjelp","nav.home":"Hjem","nav.favorites":"Favoritter","nav.logout":"Logg ut","login.username":"Brukernavn","login.password":"Passord","login.signIn":"Logg inn","theme.light":"Lys","theme.dark":"Mørk","theme.system":"System","wm.close":"Lukk","wm.minimize":"Minimer","wm.maximize":"Maksimer","wm.restore":"Gjenopprett","lang.en":"Engelsk","lang.pl":"Polsk","lang.de":"Tysk","lang.fr":"Fransk","lang.es":"Spansk","lang.it":"Italiensk","lang.pt":"Portugisisk","lang.nl":"Nederlandsk","lang.sv":"Svensk","lang.no":"Norsk","lang.da":"Dansk","lang.fi":"Finsk","lang.cs":"Tsjekkisk","lang.sk":"Slovakisk","lang.hu":"Ungarsk","lang.ro":"Rumensk","lang.bg":"Bulgarsk","lang.uk":"Ukrainsk","lang.ja":"Japansk","lang.ko":"Koreansk","lang.zh":"Kinesisk","lang.ar":"Arabisk"},_o={ok:"OK",cancel:"Annuller",save:"Gem",close:"Luk",delete:"Slet",edit:"Rediger",add:"Tilføj",remove:"Fjern",search:"Søg",filter:"Filtrer",refresh:"Opdater",loading:"Indlæser…",noData:"Ingen data",error:"Fejl",success:"Succes",warning:"Advarsel",yes:"Ja",no:"Nej",confirm:"Bekræft",back:"Tilbage",next:"Næste",undo:"Fortryd",redo:"Gentag",copy:"Kopiér",paste:"Indsæt",settings:"Indstillinger",help:"Hjælp","nav.home":"Hjem","nav.favorites":"Favoritter","nav.logout":"Log ud","login.username":"Brugernavn","login.password":"Adgangskode","login.signIn":"Log ind","theme.light":"Lys","theme.dark":"Mørk","theme.system":"System","wm.close":"Luk","wm.minimize":"Minimer","wm.maximize":"Maksimer","wm.restore":"Gendan","lang.en":"Engelsk","lang.pl":"Polsk","lang.de":"Tysk","lang.fr":"Fransk","lang.es":"Spansk","lang.it":"Italiensk","lang.pt":"Portugisisk","lang.nl":"Nederlandsk","lang.sv":"Svensk","lang.no":"Norsk","lang.da":"Dansk","lang.fi":"Finsk","lang.cs":"Tjekkisk","lang.sk":"Slovakisk","lang.hu":"Ungarsk","lang.ro":"Rumænsk","lang.bg":"Bulgarsk","lang.uk":"Ukrainsk","lang.ja":"Japansk","lang.ko":"Koreansk","lang.zh":"Kinesisk","lang.ar":"Arabisk"},jo={ok:"OK",cancel:"Peruuta",save:"Tallenna",close:"Sulje",delete:"Poista",edit:"Muokkaa",add:"Lisää",remove:"Poista",search:"Hae",filter:"Suodata",refresh:"Päivitä",loading:"Lataa…",noData:"Ei tietoja",error:"Virhe",success:"Onnistui",warning:"Varoitus",yes:"Kyllä",no:"Ei",confirm:"Vahvista",back:"Takaisin",next:"Seuraava",undo:"Kumoa",redo:"Tee uudelleen",copy:"Kopioi",paste:"Liitä",settings:"Asetukset",help:"Ohje","nav.home":"Etusivu","nav.favorites":"Suosikit","nav.logout":"Kirjaudu ulos","login.username":"Käyttäjänimi","login.password":"Salasana","login.signIn":"Kirjaudu sisään","theme.light":"Vaalea","theme.dark":"Tumma","theme.system":"Järjestelmä","wm.close":"Sulje","wm.minimize":"Pienennä","wm.maximize":"Suurenna","wm.restore":"Palauta","lang.en":"Englanti","lang.pl":"Puola","lang.de":"Saksa","lang.fr":"Ranska","lang.es":"Espanja","lang.it":"Italia","lang.pt":"Portugali","lang.nl":"Hollanti","lang.sv":"Ruotsi","lang.no":"Norja","lang.da":"Tanska","lang.fi":"Suomi","lang.cs":"Tšekki","lang.sk":"Slovakia","lang.hu":"Unkari","lang.ro":"Romania","lang.bg":"Bulgaria","lang.uk":"Ukraina","lang.ja":"Japani","lang.ko":"Korea","lang.zh":"Kiina","lang.ar":"Arabia"},Co={ok:"OK",cancel:"Zrušit",save:"Uložit",close:"Zavřít",delete:"Smazat",edit:"Upravit",add:"Přidat",remove:"Odebrat",search:"Hledat",filter:"Filtrovat",refresh:"Obnovit",loading:"Načítání…",noData:"Žádná data",error:"Chyba",success:"Úspěch",warning:"Upozornění",info:"Informace",yes:"Ano",no:"Ne",confirm:"Potvrdit",back:"Zpět",next:"Další",previous:"Předchozí",finish:"Dokončit",submit:"Odeslat",reset:"Obnovit",apply:"Použít",undo:"Zpět",redo:"Znovu",copy:"Kopírovat",cut:"Vyjmout",paste:"Vložit",selectAll:"Vybrat vše",clear:"Vymazat",upload:"Nahrát",download:"Stáhnout",print:"Tisk",export:"Exportovat",import:"Importovat",settings:"Nastavení",help:"Nápověda",about:"O aplikaci",more:"Více",less:"Méně",show:"Zobrazit",hide:"Skrýt",expand:"Rozbalit",collapse:"Sbalit",enabled:"Povoleno",disabled:"Zakázáno",required:"Povinné",optional:"Volitelné",actions:"Akce",details:"Podrobnosti",overview:"Přehled",all:"Vše",none:"Žádné",selected:"Vybráno",total:"Celkem",of:"z",items:"položek",page:"Stránka",rows:"Řádky","app.name":"Aplikace","app.version":"Verze","app.about":"O aplikaci","nav.home":"Domů","nav.back":"Zpět","nav.forward":"Vpřed","nav.menu":"Menu","nav.sidebar":"Postranní panel","nav.search":"Hledat","nav.favorites":"Oblíbené","nav.recent":"Nedávné","nav.notifications":"Oznámení","nav.profile":"Profil","nav.logout":"Odhlásit se","carousel.prev":"Předchozí snímek","carousel.next":"Další snímek","carousel.slide":"Snímek","carousel.of":"z","carousel.autoplay":"Automatické přehrávání","carousel.pause":"Pozastavit","confirm.yes":"Ano","confirm.no":"Ne","confirm.ok":"OK","confirm.cancel":"Zrušit","confirm.title":"Potvrzení","confirm.deleteMessage":"Opravdu chcete smazat?","confirm.unsavedChanges":"Máte neuložené změny. Zahodit?","console.shell":"Příkazový řádek","console.terminal":"Terminál","console.prompt":"Zadejte příkaz…","console.clear":"Vymazat konzoli","console.run":"Spustit","console.output":"Výstup","console.newSession":"Nová relace","console.closeSession":"Zavřít relaci","controls.save":"Uložit","controls.cancel":"Zrušit","controls.delete":"Smazat","controls.edit":"Upravit","controls.add":"Přidat","controls.remove":"Odebrat","controls.close":"Zavřít","controls.open":"Otevřít","controls.refresh":"Obnovit","controls.new":"Nový","controls.duplicate":"Duplikovat","controls.sort":"Řadit","controls.group":"Seskupit","controls.pin":"Připnout","controls.unpin":"Odepnout","controls.lock":"Zamknout","controls.unlock":"Odemknout","controls.share":"Sdílet","controls.archive":"Archivovat","cookie.title":"Souhlas s cookies","cookie.message":"Tento web používá cookies pro zlepšení vašeho zážitku.","cookie.accept":"Přijmout vše","cookie.reject":"Odmítnout vše","cookie.settings":"Nastavení cookies","cookie.necessary":"Nezbytné","cookie.analytics":"Analytické","cookie.marketing":"Marketingové","dashboard.title":"Nástěnka","dashboard.addWidget":"Přidat widget","dashboard.removeWidget":"Odebrat widget","dashboard.layout":"Rozložení","dashboard.settings":"Nastavení","dashboard.customize":"Přizpůsobit","dashboard.resetLayout":"Obnovit rozložení","datetime.today":"Dnes","datetime.yesterday":"Včera","datetime.tomorrow":"Zítra","datetime.selectDate":"Vybrat datum","datetime.selectTime":"Vybrat čas","datetime.startDate":"Datum zahájení","datetime.endDate":"Datum ukončení","datetime.startTime":"Čas zahájení","datetime.endTime":"Čas ukončení","datetime.am":"dop.","datetime.pm":"odp.","desktop.start":"Start","desktop.taskbar":"Hlavní panel","desktop.systemTray":"Systémová lišta","desktop.wallpaper":"Tapeta","desktop.icons":"Ikony plochy","desktop.arrangeIcons":"Uspořádat ikony","dock.pin":"Připnout na dock","dock.unpin":"Odepnout z docku","dock.close":"Zavřít","dock.minimize":"Minimalizovat","dock.maximize":"Maximalizovat","dock.restore":"Obnovit","docEditor.paragraph":"Odstavec","docEditor.heading":"Nadpis","docEditor.heading1":"Nadpis 1","docEditor.heading2":"Nadpis 2","docEditor.heading3":"Nadpis 3","docEditor.bulletList":"Odrážkový seznam","docEditor.numberedList":"Číslovaný seznam","docEditor.quote":"Citace","docEditor.code":"Blok kódu","docEditor.divider":"Oddělovač","docEditor.image":"Obrázek","docEditor.table":"Tabulka","docEditor.callout":"Upozornění","docEditor.placeholder":"Začněte psát…","docEditor.slashCommand":"Napište / pro příkazy","files.upload":"Nahrát soubor","files.download":"Stáhnout","files.delete":"Smazat soubor","files.rename":"Přejmenovat","files.newFolder":"Nová složka","files.selectFile":"Vybrat soubor","files.dropzone":"Přetáhněte soubory sem","files.dragDrop":"Přetáhněte soubory sem nebo klikněte","files.maxSize":"Maximální velikost souboru","files.fileType":"Typ souboru","forms.required":"Toto pole je povinné","forms.optional":"Volitelné","forms.submit":"Odeslat","forms.reset":"Obnovit","forms.validate":"Ověřit","forms.invalid":"Neplatná hodnota","forms.minLength":"Minimální délka: {0}","forms.maxLength":"Maximální délka: {0}","forms.email":"Zadejte platný e-mail","forms.phone":"Zadejte platné telefonní číslo","imageEditor.crop":"Oříznout","imageEditor.rotate":"Otočit","imageEditor.flip":"Překlopit","imageEditor.resize":"Změnit velikost","imageEditor.filter":"Filtr","imageEditor.draw":"Kreslit","imageEditor.text":"Text","imageEditor.undo":"Zpět","imageEditor.redo":"Znovu","imageEditor.save":"Uložit","imageEditor.brightness":"Jas","imageEditor.contrast":"Kontrast","imageEditor.saturation":"Sytost","inbox.compose":"Napsat","inbox.reply":"Odpovědět","inbox.replyAll":"Odpovědět všem","inbox.forward":"Přeposlat","inbox.delete":"Smazat","inbox.archive":"Archivovat","inbox.markRead":"Označit jako přečtené","inbox.markUnread":"Označit jako nepřečtené","inbox.folders":"Složky","inbox.inbox":"Doručená pošta","inbox.sent":"Odeslaná pošta","inbox.drafts":"Koncepty","inbox.trash":"Koš","inbox.spam":"Spam","inbox.starred":"S hvězdičkou","inbox.to":"Komu","inbox.cc":"Kopie","inbox.bcc":"Skrytá kopie","inbox.subject":"Předmět","inbox.send":"Odeslat","inbox.discard":"Zahodit","inbox.attachFile":"Připojit soubor","kanban.addCard":"Přidat kartu","kanban.addColumn":"Přidat sloupec","kanban.moveCard":"Přesunout kartu","kanban.editCard":"Upravit kartu","kanban.deleteCard":"Smazat kartu","kanban.editColumn":"Upravit sloupec","kanban.deleteColumn":"Smazat sloupec","lang.en":"Angličtina","lang.pl":"Polština","lang.de":"Němčina","lang.fr":"Francouzština","lang.es":"Španělština","lang.it":"Italština","lang.pt":"Portugalština","lang.nl":"Nizozemština","lang.sv":"Švédština","lang.no":"Norština","lang.da":"Dánština","lang.fi":"Finština","lang.cs":"Čeština","lang.sk":"Slovenčina","lang.hu":"Maďarština","lang.ro":"Rumunština","lang.bg":"Bulharština","lang.uk":"Ukrajinčina","lang.ja":"Japonština","lang.ko":"Korejština","lang.zh":"Čínština","lang.ar":"Arabština","login.username":"Uživatelské jméno","login.password":"Heslo","login.signIn":"Přihlásit se","login.signOut":"Odhlásit se","login.forgotPassword":"Zapomenuté heslo?","login.register":"Registrovat se","login.rememberMe":"Zapamatovat si mě","login.newPassword":"Nové heslo","login.confirmPassword":"Potvrdit heslo","login.twoFactor":"Dvoufaktorové ověření","password.strength":"Síla hesla","password.weak":"Slabé","password.medium":"Střední","password.strong":"Silné","password.requirements":"Požadavky na heslo","pdfviewer.page":"Stránka","pdfviewer.of":"z","pdfviewer.zoom":"Přiblížení","pdfviewer.fitPage":"Přizpůsobit stránce","pdfviewer.fitWidth":"Přizpůsobit šířce","pdfviewer.download":"Stáhnout","pdfviewer.print":"Tisk","pdfviewer.search":"Hledat v dokumentu","pdfviewer.bookmark":"Záložky","pdfviewer.thumbnail":"Miniatury","picklist.available":"Dostupné","picklist.selected":"Vybrané","picklist.addAll":"Přidat vše","picklist.removeAll":"Odebrat vše","picklist.filter":"Filtrovat položky","scheduling.calendar":"Kalendář","scheduling.event":"Událost","scheduling.allDay":"Celý den","scheduling.today":"Dnes","scheduling.week":"Týden","scheduling.month":"Měsíc","scheduling.year":"Rok","scheduling.day":"Den","scheduling.agenda":"Program","scheduling.addEvent":"Přidat událost","scheduling.editEvent":"Upravit událost","scheduling.deleteEvent":"Smazat událost","scheduling.noEvents":"Žádné události","shortcuts.title":"Klávesové zkratky","shortcuts.description":"Dostupné zkratky","shortcuts.key":"Klávesa","shortcuts.command":"Příkaz","shortcuts.search":"Hledat zkratky","signature.clear":"Vymazat","signature.save":"Uložit","signature.sign":"Podepište zde","signature.draw":"Nakreslete svůj podpis","spreadsheet.cell":"Buňka","spreadsheet.row":"Řádek","spreadsheet.column":"Sloupec","spreadsheet.formula":"Vzorec","spreadsheet.insert":"Vložit","spreadsheet.delete":"Smazat","spreadsheet.sort":"Řadit","spreadsheet.sortAsc":"Řadit vzestupně","spreadsheet.sortDesc":"Řadit sestupně","spreadsheet.filter":"Filtrovat","spreadsheet.export":"Exportovat","spreadsheet.import":"Importovat","spreadsheet.addRow":"Přidat řádek","spreadsheet.addColumn":"Přidat sloupec","spreadsheet.deleteRow":"Smazat řádek","spreadsheet.deleteColumn":"Smazat sloupec","spreadsheet.freezeRow":"Ukotvit řádek","spreadsheet.freezeColumn":"Ukotvit sloupec","spreadsheet.merge":"Sloučit buňky","spreadsheet.unmerge":"Rozdělit buňky","terminal.run":"Spustit","terminal.clear":"Vymazat","terminal.copy":"Kopírovat","terminal.paste":"Vložit","terminal.newSession":"Nová relace","terminal.closeSession":"Zavřít relaci","terminal.selectAll":"Vybrat vše","theme.light":"Světlý","theme.dark":"Tmavý","theme.system":"Systém","theme.custom":"Vlastní","theme.colors":"Barvy","theme.fonts":"Písma","theme.apply":"Použít motiv","theme.preview":"Náhled","theme.reset":"Obnovit výchozí","theme.gallery":"Galerie motivů","users.profile":"Profil","users.settings":"Nastavení","users.permissions":"Oprávnění","users.role":"Role","users.active":"Aktivní","users.inactive":"Neaktivní","users.online":"Online","users.offline":"Offline","users.lastSeen":"Naposledy viděn","wm.close":"Zavřít","wm.minimize":"Minimalizovat","wm.maximize":"Maximalizovat","wm.restore":"Obnovit","wm.tile":"Dlaždice oken","wm.cascade":"Kaskáda oken","wm.closeAll":"Zavřít vše","wm.minimizeAll":"Minimalizovat vše","wm.newWindow":"Nové okno","wm.moveToFront":"Přenést dopředu"},So={ok:"OK",cancel:"Zrušiť",save:"Uložiť",close:"Zavrieť",delete:"Odstrániť",edit:"Upraviť",add:"Pridať",remove:"Odobrať",search:"Hľadať",filter:"Filtrovať",refresh:"Obnoviť",loading:"Načítava sa…",noData:"Žiadne dáta",error:"Chyba",success:"Úspech",warning:"Upozornenie",yes:"Áno",no:"Nie",confirm:"Potvrdiť",back:"Späť",next:"Ďalej",undo:"Späť",redo:"Znova",copy:"Kopírovať",paste:"Vložiť",settings:"Nastavenia",help:"Pomoc","nav.home":"Domov","nav.favorites":"Obľúbené","nav.logout":"Odhlásiť sa","login.username":"Používateľské meno","login.password":"Heslo","login.signIn":"Prihlásiť sa","theme.light":"Svetlý","theme.dark":"Tmavý","theme.system":"Systém","wm.close":"Zavrieť","wm.minimize":"Minimalizovať","wm.maximize":"Maximalizovať","wm.restore":"Obnoviť","lang.en":"Angličtina","lang.pl":"Poľština","lang.de":"Nemčina","lang.fr":"Francúzština","lang.es":"Španielčina","lang.it":"Taliančina","lang.pt":"Portugalčina","lang.nl":"Holandčina","lang.sv":"Švédčina","lang.no":"Nórčina","lang.da":"Dánčina","lang.fi":"Fínčina","lang.cs":"Čeština","lang.sk":"Slovenčina","lang.hu":"Maďarčina","lang.ro":"Rumunčina","lang.bg":"Bulharčina","lang.uk":"Ukrajinčina","lang.ja":"Japončina","lang.ko":"Kórejčina","lang.zh":"Čínština","lang.ar":"Arabčina"},No={ok:"OK",cancel:"Mégse",save:"Mentés",close:"Bezárás",delete:"Törlés",edit:"Szerkesztés",add:"Hozzáadás",remove:"Eltávolítás",search:"Keresés",filter:"Szűrés",refresh:"Frissítés",loading:"Betöltés…",noData:"Nincs adat",error:"Hiba",success:"Sikeres",warning:"Figyelmeztetés",yes:"Igen",no:"Nem",confirm:"Megerősítés",back:"Vissza",next:"Következő",undo:"Visszavonás",redo:"Újra",copy:"Másolás",paste:"Beillesztés",settings:"Beállítások",help:"Segítség","nav.home":"Főoldal","nav.favorites":"Kedvencek","nav.logout":"Kijelentkezés","login.username":"Felhasználónév","login.password":"Jelszó","login.signIn":"Bejelentkezés","theme.light":"Világos","theme.dark":"Sötét","theme.system":"Rendszer","wm.close":"Bezárás","wm.minimize":"Kis méret","wm.maximize":"Teljes méret","wm.restore":"Visszaállítás","lang.en":"Angol","lang.pl":"Lengyel","lang.de":"Német","lang.fr":"Francia","lang.es":"Spanyol","lang.it":"Olasz","lang.pt":"Portugál","lang.nl":"Holland","lang.sv":"Svéd","lang.no":"Norvég","lang.da":"Dán","lang.fi":"Finn","lang.cs":"Cseh","lang.sk":"Szlovák","lang.hu":"Magyar","lang.ro":"Román","lang.bg":"Bolgár","lang.uk":"Ukrán","lang.ja":"Japán","lang.ko":"Koreai","lang.zh":"Kínai","lang.ar":"Arab"},Mo={ok:"OK",cancel:"Anulare",save:"Salvare",close:"Închide",delete:"Șterge",edit:"Editare",add:"Adaugă",remove:"Elimină",search:"Căutare",filter:"Filtrare",refresh:"Actualizare",loading:"Se încarcă…",noData:"Fără date",error:"Eroare",success:"Succes",warning:"Avertisment",yes:"Da",no:"Nu",confirm:"Confirmă",back:"Înapoi",next:"Următor",settings:"Setări",help:"Ajutor","nav.home":"Acasă","nav.favorites":"Favorite","nav.logout":"Deconectare","login.username":"Utilizator","login.password":"Parolă","login.signIn":"Autentificare","theme.light":"Luminos","theme.dark":"Întunecat","theme.system":"Sistem","lang.en":"Engleză","lang.pl":"Poloneză","lang.de":"Germană","lang.fr":"Franceză","lang.es":"Spaniolă","lang.it":"Italiană","lang.pt":"Portugheză","lang.nl":"Olandeză","lang.sv":"Suedeză","lang.no":"Norvegiană","lang.da":"Daneză","lang.fi":"Finlandeză","lang.cs":"Cehă","lang.sk":"Slovacă","lang.hu":"Maghiară","lang.ro":"Română","lang.bg":"Bulgară","lang.uk":"Ucraineană","lang.ja":"Japoneză","lang.ko":"Coreeană","lang.zh":"Chineză","lang.ar":"Arabă"},$o={ok:"OK",cancel:"Отказ",save:"Запис",close:"Затвори",delete:"Изтрий",edit:"Редактирай",add:"Добави",remove:"Премахни",search:"Търси",filter:"Филтрирай",refresh:"Обнови",loading:"Зареждане…",noData:"Няма данни",error:"Грешка",success:"Успех",warning:"Предупреждение",yes:"Да",no:"Не",confirm:"Потвърди",back:"Назад",next:"Напред",settings:"Настройки",help:"Помощ","nav.home":"Начало","nav.favorites":"Любими","nav.logout":"Изход","login.username":"Потребителско име","login.password":"Парола","login.signIn":"Вход","theme.light":"Светла","theme.dark":"Тъмна","theme.system":"Системна","lang.en":"Английски","lang.pl":"Полски","lang.de":"Немски","lang.fr":"Френски","lang.es":"Испански","lang.it":"Италиански","lang.pt":"Португалски","lang.nl":"Нидерландски","lang.sv":"Шведски","lang.no":"Норвежки","lang.da":"Датски","lang.fi":"Фински","lang.cs":"Чешки","lang.sk":"Словашки","lang.hu":"Унгарски","lang.ro":"Румънски","lang.bg":"Български","lang.uk":"Украински","lang.ja":"Японски","lang.ko":"Корейски","lang.zh":"Китайски","lang.ar":"Арабски"},zo={ok:"OK",cancel:"Скасувати",save:"Зберегти",close:"Закрити",delete:"Видалити",edit:"Редагувати",add:"Додати",remove:"Прибрати",search:"Пошук",filter:"Фільтрувати",refresh:"Оновити",loading:"Завантаження…",noData:"Немає даних",error:"Помилка",success:"Успіх",warning:"Попередження",info:"Інформація",yes:"Так",no:"Ні",confirm:"Підтвердити",back:"Назад",next:"Далі",previous:"Попередній",finish:"Завершити",submit:"Надіслати",reset:"Скинути",apply:"Застосувати",undo:"Скасувати",redo:"Повторити",copy:"Копіювати",cut:"Вирізати",paste:"Вставити",selectAll:"Вибрати все",clear:"Очистити",upload:"Завантажити",download:"Завантажити",print:"Друкувати",export:"Експортувати",import:"Імпортувати",settings:"Налаштування",help:"Допомога",about:"Про програму",more:"Більше",less:"Менше",show:"Показати",hide:"Приховати",expand:"Розгорнути",collapse:"Згорнути",enabled:"Увімкнено",disabled:"Вимкнено",required:"Обов'язково",optional:"Необов'язково",actions:"Дії",details:"Деталі",overview:"Огляд",all:"Всі",none:"Немає",selected:"Обрано",total:"Всього",of:"з",items:"елементів",page:"Сторінка",rows:"Рядки","app.name":"Додаток","app.version":"Версія","app.about":"Про програму","nav.home":"Головна","nav.back":"Назад","nav.forward":"Вперед","nav.menu":"Меню","nav.sidebar":"Бічна панель","nav.search":"Пошук","nav.favorites":"Обране","nav.recent":"Нещодавнє","nav.notifications":"Сповіщення","nav.profile":"Профіль","nav.logout":"Вийти","carousel.prev":"Попередній слайд","carousel.next":"Наступний слайд","carousel.slide":"Слайд","carousel.of":"з","carousel.autoplay":"Автопрогравання","carousel.pause":"Пауза","confirm.yes":"Так","confirm.no":"Ні","confirm.ok":"OK","confirm.cancel":"Скасувати","confirm.title":"Підтвердження","confirm.deleteMessage":"Ви впевнені, що хочете видалити?","confirm.unsavedChanges":"Незбережені зміни. Відхилити?","console.shell":"Оболонка","console.terminal":"Термінал","console.prompt":"Введіть команду…","console.clear":"Очистити консоль","console.run":"Виконати","console.output":"Вивід","console.newSession":"Нова сесія","console.closeSession":"Закрити сесію","controls.save":"Зберегти","controls.cancel":"Скасувати","controls.delete":"Видалити","controls.edit":"Редагувати","controls.add":"Додати","controls.remove":"Видалити","controls.close":"Закрити","controls.open":"Відкрити","controls.refresh":"Оновити","controls.new":"Новий","controls.duplicate":"Дублювати","controls.sort":"Сортувати","controls.group":"Групувати","controls.pin":"Закріпити","controls.unpin":"Відкріпити","controls.lock":"Заблокувати","controls.unlock":"Розблокувати","controls.share":"Поділитися","controls.archive":"Архівувати","cookie.title":"Згода на cookies","cookie.message":"Цей сайт використовує cookies.","cookie.accept":"Прийняти всі","cookie.reject":"Відхилити всі","cookie.settings":"Налаштування cookies","cookie.necessary":"Необхідні","cookie.analytics":"Аналітичні","cookie.marketing":"Маркетингові","dashboard.title":"Панель керування","dashboard.addWidget":"Додати віджет","dashboard.removeWidget":"Видалити віджет","dashboard.layout":"Макет","dashboard.settings":"Налаштування","dashboard.customize":"Налаштувати","dashboard.resetLayout":"Скинути макет","datetime.today":"Сьогодні","datetime.yesterday":"Вчора","datetime.tomorrow":"Завтра","datetime.selectDate":"Вибрати дату","datetime.selectTime":"Вибрати час","datetime.startDate":"Дата початку","datetime.endDate":"Дата закінчення","datetime.startTime":"Час початку","datetime.endTime":"Час закінчення","datetime.am":"ДП","datetime.pm":"ПП","desktop.start":"Пуск","desktop.taskbar":"Панель завдань","desktop.systemTray":"Системний лоток","desktop.wallpaper":"Шпалери","desktop.icons":"Значки робочого столу","desktop.arrangeIcons":"Упорядкувати значки","dock.pin":"Закріпити на док-панелі","dock.unpin":"Відкріпити від док-панелі","dock.close":"Закрити","dock.minimize":"Згорнути","dock.maximize":"Розгорнути","dock.restore":"Відновити","docEditor.paragraph":"Абзац","docEditor.heading":"Заголовок","docEditor.heading1":"Заголовок 1","docEditor.heading2":"Заголовок 2","docEditor.heading3":"Заголовок 3","docEditor.bulletList":"Маркований список","docEditor.numberedList":"Нумерований список","docEditor.quote":"Цитата","docEditor.code":"Блок коду","docEditor.divider":"Роздільник","docEditor.image":"Зображення","docEditor.table":"Таблиця","docEditor.callout":"Виноска","docEditor.placeholder":"Почніть писати…","docEditor.slashCommand":"Введіть / для команд","files.upload":"Завантажити файл","files.download":"Завантажити","files.delete":"Видалити файл","files.rename":"Перейменувати","files.newFolder":"Нова папка","files.selectFile":"Вибрати файл","files.dropzone":"Перетягніть файли сюди","files.dragDrop":"Перетягніть файли або натисніть","files.maxSize":"Максимальний розмір файлу","files.fileType":"Тип файлу","forms.required":"Це поле обов'язкове","forms.optional":"Необов'язково","forms.submit":"Надіслати","forms.reset":"Скинути","forms.validate":"Перевірити","forms.invalid":"Недійсне значення","forms.minLength":"Мінімальна довжина: {0}","forms.maxLength":"Максимальна довжина: {0}","forms.email":"Введіть дійсну електронну пошту","forms.phone":"Введіть дійсний номер телефону","imageEditor.crop":"Обрізати","imageEditor.rotate":"Повернути","imageEditor.flip":"Відобразити","imageEditor.resize":"Змінити розмір","imageEditor.filter":"Фільтр","imageEditor.draw":"Малювати","imageEditor.text":"Текст","imageEditor.undo":"Скасувати","imageEditor.redo":"Повторити","imageEditor.save":"Зберегти","imageEditor.brightness":"Яскравість","imageEditor.contrast":"Контрастність","imageEditor.saturation":"Насиченість","inbox.compose":"Написати","inbox.reply":"Відповісти","inbox.replyAll":"Відповісти всім","inbox.forward":"Переслати","inbox.delete":"Видалити","inbox.archive":"Архівувати","inbox.markRead":"Позначити як прочитане","inbox.markUnread":"Позначити як непрочитане","inbox.folders":"Папки","inbox.inbox":"Вхідні","inbox.sent":"Надіслані","inbox.drafts":"Чернетки","inbox.trash":"Кошик","inbox.spam":"Спам","inbox.starred":"Позначені","inbox.to":"Кому","inbox.cc":"Копія","inbox.bcc":"Прихована копія","inbox.subject":"Тема","inbox.send":"Надіслати","inbox.discard":"Скасувати","inbox.attachFile":"Прикріпити файл","kanban.addCard":"Додати картку","kanban.addColumn":"Додати колонку","kanban.moveCard":"Перемістити картку","kanban.editCard":"Редагувати картку","kanban.deleteCard":"Видалити картку","kanban.editColumn":"Редагувати колонку","kanban.deleteColumn":"Видалити колонку","lang.en":"Англійська","lang.pl":"Польська","lang.de":"Німецька","lang.fr":"Французька","lang.es":"Іспанська","lang.it":"Італійська","lang.pt":"Португальська","lang.nl":"Нідерландська","lang.sv":"Шведська","lang.no":"Норвезька","lang.da":"Данська","lang.fi":"Фінська","lang.cs":"Чеська","lang.sk":"Словацька","lang.hu":"Угорська","lang.ro":"Румунська","lang.bg":"Болгарська","lang.uk":"Українська","lang.ja":"Японська","lang.ko":"Корейська","lang.zh":"Китайська","lang.ar":"Арабська","login.username":"Ім'я користувача","login.password":"Пароль","login.signIn":"Увійти","login.signOut":"Вийти","login.forgotPassword":"Забули пароль?","login.register":"Зареєструватися","login.rememberMe":"Запам'ятати мене","login.newPassword":"Новий пароль","login.confirmPassword":"Підтвердити пароль","login.twoFactor":"Двофакторна автентифікація","password.strength":"Надійність пароля","password.weak":"Слабкий","password.medium":"Середній","password.strong":"Сильний","password.requirements":"Вимоги до пароля","pdfviewer.page":"Сторінка","pdfviewer.of":"з","pdfviewer.zoom":"Масштаб","pdfviewer.fitPage":"За розміром сторінки","pdfviewer.fitWidth":"За шириною","pdfviewer.download":"Завантажити","pdfviewer.print":"Друкувати","pdfviewer.search":"Пошук у документі","pdfviewer.bookmark":"Закладки","pdfviewer.thumbnail":"Мініатюри","picklist.available":"Доступні","picklist.selected":"Обрані","picklist.addAll":"Додати всі","picklist.removeAll":"Видалити всі","picklist.filter":"Фільтрувати елементи","scheduling.calendar":"Календар","scheduling.event":"Подія","scheduling.allDay":"Весь день","scheduling.today":"Сьогодні","scheduling.week":"Тиждень","scheduling.month":"Місяць","scheduling.year":"Рік","scheduling.day":"День","scheduling.agenda":"Порядок денний","scheduling.addEvent":"Додати подію","scheduling.editEvent":"Редагувати подію","scheduling.deleteEvent":"Видалити подію","scheduling.noEvents":"Немає подій","shortcuts.title":"Гарячі клавіші","shortcuts.description":"Доступні гарячі клавіші","shortcuts.key":"Клавіша","shortcuts.command":"Команда","shortcuts.search":"Пошук гарячих клавіш","signature.clear":"Очистити","signature.save":"Зберегти","signature.sign":"Підпишіть тут","signature.draw":"Намалюйте підпис","spreadsheet.cell":"Клітинка","spreadsheet.row":"Рядок","spreadsheet.column":"Колонка","spreadsheet.formula":"Формула","spreadsheet.insert":"Вставити","spreadsheet.delete":"Видалити","spreadsheet.sort":"Сортувати","spreadsheet.sortAsc":"За зростанням","spreadsheet.sortDesc":"За спаданням","spreadsheet.filter":"Фільтрувати","spreadsheet.export":"Експортувати","spreadsheet.import":"Імпортувати","spreadsheet.addRow":"Додати рядок","spreadsheet.addColumn":"Додати колонку","spreadsheet.deleteRow":"Видалити рядок","spreadsheet.deleteColumn":"Видалити колонку","spreadsheet.freezeRow":"Закріпити рядок","spreadsheet.freezeColumn":"Закріпити колонку","spreadsheet.merge":"Об'єднати клітинки","spreadsheet.unmerge":"Роз'єднати клітинки","terminal.run":"Виконати","terminal.clear":"Очистити","terminal.copy":"Копіювати","terminal.paste":"Вставити","terminal.newSession":"Нова сесія","terminal.closeSession":"Закрити сесію","terminal.selectAll":"Вибрати все","theme.light":"Світла","theme.dark":"Темна","theme.system":"Системна","theme.custom":"Власна","theme.colors":"Кольори","theme.fonts":"Шрифти","theme.apply":"Застосувати тему","theme.preview":"Попередній перегляд","theme.reset":"Скинути","theme.gallery":"Галерея тем","users.profile":"Профіль","users.settings":"Налаштування","users.permissions":"Дозволи","users.role":"Роль","users.active":"Активний","users.inactive":"Неактивний","users.online":"Онлайн","users.offline":"Офлайн","users.lastSeen":"Востаннє бачено","wm.close":"Закрити","wm.minimize":"Згорнути","wm.maximize":"Розгорнути","wm.restore":"Відновити","wm.tile":"Вікна плиткою","wm.cascade":"Вікна каскадом","wm.closeAll":"Закрити всі","wm.minimizeAll":"Згорнути всі","wm.newWindow":"Нове вікно","wm.moveToFront":"На передній план"},Eo={ok:"OK",cancel:"キャンセル",save:"保存",close:"閉じる",delete:"削除",edit:"編集",add:"追加",remove:"削除",search:"検索",filter:"フィルター",refresh:"更新",loading:"読み込み中…",noData:"データなし",error:"エラー",success:"成功",warning:"警告",info:"情報",yes:"はい",no:"いいえ",confirm:"確認",back:"戻る",next:"次へ",previous:"前へ",finish:"完了",submit:"送信",reset:"リセット",apply:"適用",undo:"元に戻す",redo:"やり直す",copy:"コピー",cut:"切り取り",paste:"貼り付け",selectAll:"すべて選択",clear:"クリア",upload:"アップロード",download:"ダウンロード",print:"印刷",export:"エクスポート",import:"インポート",settings:"設定",help:"ヘルプ",about:"バージョン情報",more:"もっと見る",less:"閉じる",show:"表示",hide:"非表示",expand:"展開",collapse:"折りたたむ",enabled:"有効",disabled:"無効",required:"必須",optional:"任意",actions:"アクション",details:"詳細",overview:"概要",all:"すべて",none:"なし",selected:"選択済み",total:"合計",of:"/",items:"件",page:"ページ",rows:"行","app.name":"アプリケーション","app.version":"バージョン","app.about":"バージョン情報","nav.home":"ホーム","nav.back":"戻る","nav.forward":"進む","nav.menu":"メニュー","nav.sidebar":"サイドバー","nav.search":"検索","nav.favorites":"お気に入り","nav.recent":"最近","nav.notifications":"通知","nav.profile":"プロフィール","nav.logout":"ログアウト","carousel.prev":"前のスライド","carousel.next":"次のスライド","carousel.slide":"スライド","carousel.of":"/","carousel.autoplay":"自動再生","carousel.pause":"一時停止","confirm.yes":"はい","confirm.no":"いいえ","confirm.ok":"OK","confirm.cancel":"キャンセル","confirm.title":"確認","confirm.deleteMessage":"本当に削除しますか?","confirm.unsavedChanges":"未保存の変更があります。破棄しますか?","console.shell":"シェル","console.terminal":"ターミナル","console.prompt":"コマンドを入力…","console.clear":"コンソールをクリア","console.run":"実行","console.output":"出力","console.newSession":"新しいセッション","console.closeSession":"セッションを閉じる","controls.save":"保存","controls.cancel":"キャンセル","controls.delete":"削除","controls.edit":"編集","controls.add":"追加","controls.remove":"削除","controls.close":"閉じる","controls.open":"開く","controls.refresh":"更新","controls.new":"新規","controls.duplicate":"複製","controls.sort":"並べ替え","controls.group":"グループ化","controls.pin":"ピン留め","controls.unpin":"ピン留め解除","controls.lock":"ロック","controls.unlock":"ロック解除","controls.share":"共有","controls.archive":"アーカイブ","cookie.title":"Cookieの同意","cookie.message":"このサイトではCookieを使用しています。","cookie.accept":"すべて許可","cookie.reject":"すべて拒否","cookie.settings":"Cookie設定","cookie.necessary":"必須","cookie.analytics":"分析","cookie.marketing":"マーケティング","dashboard.title":"ダッシュボード","dashboard.addWidget":"ウィジェットを追加","dashboard.removeWidget":"ウィジェットを削除","dashboard.layout":"レイアウト","dashboard.settings":"設定","dashboard.customize":"カスタマイズ","dashboard.resetLayout":"レイアウトをリセット","datetime.today":"今日","datetime.yesterday":"昨日","datetime.tomorrow":"明日","datetime.selectDate":"日付を選択","datetime.selectTime":"時刻を選択","datetime.startDate":"開始日","datetime.endDate":"終了日","datetime.startTime":"開始時刻","datetime.endTime":"終了時刻","datetime.am":"午前","datetime.pm":"午後","desktop.start":"スタート","desktop.taskbar":"タスクバー","desktop.systemTray":"システムトレイ","desktop.wallpaper":"壁紙","desktop.icons":"デスクトップアイコン","desktop.arrangeIcons":"アイコンの整列","dock.pin":"ドックに固定","dock.unpin":"ドックから外す","dock.close":"閉じる","dock.minimize":"最小化","dock.maximize":"最大化","dock.restore":"復元","docEditor.paragraph":"段落","docEditor.heading":"見出し","docEditor.heading1":"見出し1","docEditor.heading2":"見出し2","docEditor.heading3":"見出し3","docEditor.bulletList":"箇条書き","docEditor.numberedList":"番号付きリスト","docEditor.quote":"引用","docEditor.code":"コードブロック","docEditor.divider":"区切り線","docEditor.image":"画像","docEditor.table":"テーブル","docEditor.callout":"注意書き","docEditor.placeholder":"入力を開始…","docEditor.slashCommand":"/でコマンド入力","files.upload":"ファイルをアップロード","files.download":"ダウンロード","files.delete":"ファイルを削除","files.rename":"名前を変更","files.newFolder":"新しいフォルダー","files.selectFile":"ファイルを選択","files.dropzone":"ここにファイルをドロップ","files.dragDrop":"ファイルをドラッグ&ドロップまたはクリック","files.maxSize":"最大ファイルサイズ","files.fileType":"ファイルの種類","forms.required":"この項目は必須です","forms.optional":"任意","forms.submit":"送信","forms.reset":"リセット","forms.validate":"検証","forms.invalid":"無効な値","forms.minLength":"最小文字数: {0}","forms.maxLength":"最大文字数: {0}","forms.email":"有効なメールアドレスを入力してください","forms.phone":"有効な電話番号を入力してください","imageEditor.crop":"トリミング","imageEditor.rotate":"回転","imageEditor.flip":"反転","imageEditor.resize":"サイズ変更","imageEditor.filter":"フィルター","imageEditor.draw":"描画","imageEditor.text":"テキスト","imageEditor.undo":"元に戻す","imageEditor.redo":"やり直す","imageEditor.save":"保存","imageEditor.brightness":"明るさ","imageEditor.contrast":"コントラスト","imageEditor.saturation":"彩度","inbox.compose":"作成","inbox.reply":"返信","inbox.replyAll":"全員に返信","inbox.forward":"転送","inbox.delete":"削除","inbox.archive":"アーカイブ","inbox.markRead":"既読にする","inbox.markUnread":"未読にする","inbox.folders":"フォルダー","inbox.inbox":"受信トレイ","inbox.sent":"送信済み","inbox.drafts":"下書き","inbox.trash":"ゴミ箱","inbox.spam":"スパム","inbox.starred":"スター付き","inbox.to":"宛先","inbox.cc":"CC","inbox.bcc":"BCC","inbox.subject":"件名","inbox.send":"送信","inbox.discard":"破棄","inbox.attachFile":"ファイルを添付","kanban.addCard":"カードを追加","kanban.addColumn":"列を追加","kanban.moveCard":"カードを移動","kanban.editCard":"カードを編集","kanban.deleteCard":"カードを削除","kanban.editColumn":"列を編集","kanban.deleteColumn":"列を削除","lang.en":"英語","lang.pl":"ポーランド語","lang.de":"ドイツ語","lang.fr":"フランス語","lang.es":"スペイン語","lang.it":"イタリア語","lang.pt":"ポルトガル語","lang.nl":"オランダ語","lang.sv":"スウェーデン語","lang.no":"ノルウェー語","lang.da":"デンマーク語","lang.fi":"フィンランド語","lang.cs":"チェコ語","lang.sk":"スロバキア語","lang.hu":"ハンガリー語","lang.ro":"ルーマニア語","lang.bg":"ブルガリア語","lang.uk":"ウクライナ語","lang.ja":"日本語","lang.ko":"韓国語","lang.zh":"中国語","lang.ar":"アラビア語","login.username":"ユーザー名","login.password":"パスワード","login.signIn":"サインイン","login.signOut":"サインアウト","login.forgotPassword":"パスワードをお忘れですか?","login.register":"新規登録","login.rememberMe":"ログイン状態を保持","login.newPassword":"新しいパスワード","login.confirmPassword":"パスワードの確認","login.twoFactor":"二要素認証","password.strength":"パスワード強度","password.weak":"弱い","password.medium":"普通","password.strong":"強い","password.requirements":"パスワード要件","pdfviewer.page":"ページ","pdfviewer.of":"/","pdfviewer.zoom":"ズーム","pdfviewer.fitPage":"ページに合わせる","pdfviewer.fitWidth":"幅に合わせる","pdfviewer.download":"ダウンロード","pdfviewer.print":"印刷","pdfviewer.search":"ドキュメント内を検索","pdfviewer.bookmark":"ブックマーク","pdfviewer.thumbnail":"サムネイル","picklist.available":"利用可能","picklist.selected":"選択済み","picklist.addAll":"すべて追加","picklist.removeAll":"すべて削除","picklist.filter":"項目をフィルター","scheduling.calendar":"カレンダー","scheduling.event":"イベント","scheduling.allDay":"終日","scheduling.today":"今日","scheduling.week":"週","scheduling.month":"月","scheduling.year":"年","scheduling.day":"日","scheduling.agenda":"アジェンダ","scheduling.addEvent":"イベントを追加","scheduling.editEvent":"イベントを編集","scheduling.deleteEvent":"イベントを削除","scheduling.noEvents":"イベントなし","shortcuts.title":"キーボードショートカット","shortcuts.description":"利用可能なショートカット","shortcuts.key":"キー","shortcuts.command":"コマンド","shortcuts.search":"ショートカットを検索","signature.clear":"クリア","signature.save":"保存","signature.sign":"ここに署名","signature.draw":"署名を描いてください","spreadsheet.cell":"セル","spreadsheet.row":"行","spreadsheet.column":"列","spreadsheet.formula":"数式","spreadsheet.insert":"挿入","spreadsheet.delete":"削除","spreadsheet.sort":"並べ替え","spreadsheet.sortAsc":"昇順","spreadsheet.sortDesc":"降順","spreadsheet.filter":"フィルター","spreadsheet.export":"エクスポート","spreadsheet.import":"インポート","spreadsheet.addRow":"行を追加","spreadsheet.addColumn":"列を追加","spreadsheet.deleteRow":"行を削除","spreadsheet.deleteColumn":"列を削除","spreadsheet.freezeRow":"行を固定","spreadsheet.freezeColumn":"列を固定","spreadsheet.merge":"セルを結合","spreadsheet.unmerge":"セルの結合を解除","terminal.run":"実行","terminal.clear":"クリア","terminal.copy":"コピー","terminal.paste":"貼り付け","terminal.newSession":"新しいセッション","terminal.closeSession":"セッションを閉じる","terminal.selectAll":"すべて選択","theme.light":"ライト","theme.dark":"ダーク","theme.system":"システム","theme.custom":"カスタム","theme.colors":"色","theme.fonts":"フォント","theme.apply":"テーマを適用","theme.preview":"プレビュー","theme.reset":"デフォルトに戻す","theme.gallery":"テーマギャラリー","users.profile":"プロフィール","users.settings":"設定","users.permissions":"権限","users.role":"ロール","users.active":"アクティブ","users.inactive":"非アクティブ","users.online":"オンライン","users.offline":"オフライン","users.lastSeen":"最終ログイン","wm.close":"閉じる","wm.minimize":"最小化","wm.maximize":"最大化","wm.restore":"復元","wm.tile":"ウィンドウの並替","wm.cascade":"カスケード","wm.closeAll":"すべて閉じる","wm.minimizeAll":"すべて最小化","wm.newWindow":"新しいウィンドウ","wm.moveToFront":"最前面に移動"},Ao={ok:"확인",cancel:"취소",save:"저장",close:"닫기",delete:"삭제",edit:"편집",add:"추가",remove:"제거",search:"검색",filter:"필터",refresh:"새로고침",loading:"로딩 중…",noData:"데이터 없음",error:"오류",success:"성공",warning:"경고",info:"정보",yes:"예",no:"아니오",confirm:"확인",back:"뒤로",next:"다음",previous:"이전",finish:"완료",submit:"제출",reset:"초기화",apply:"적용",undo:"실행취소",redo:"다시실행",copy:"복사",cut:"잘라내기",paste:"붙여넣기",selectAll:"전체선택",clear:"지우기",upload:"업로드",download:"다운로드",print:"인쇄",export:"내보내기",import:"가져오기",settings:"설정",help:"도움말",about:"정보",more:"더보기",less:"줄이기",show:"표시",hide:"숨기기",expand:"펼치기",collapse:"접기",enabled:"활성",disabled:"비활성",required:"필수",optional:"선택사항",actions:"작업",details:"상세",overview:"개요",all:"전체",none:"없음",selected:"선택됨",total:"합계",of:"/",items:"개",page:"페이지",rows:"행","app.name":"애플리케이션","app.version":"버전","app.about":"정보","nav.home":"홈","nav.back":"뒤로","nav.forward":"앞으로","nav.menu":"메뉴","nav.sidebar":"사이드바","nav.search":"검색","nav.favorites":"즐겨찾기","nav.recent":"최근","nav.notifications":"알림","nav.profile":"프로필","nav.logout":"로그아웃","carousel.prev":"이전 슬라이드","carousel.next":"다음 슬라이드","carousel.slide":"슬라이드","carousel.of":"/","carousel.autoplay":"자동재생","carousel.pause":"일시정지","confirm.yes":"예","confirm.no":"아니오","confirm.ok":"확인","confirm.cancel":"취소","confirm.title":"확인","confirm.deleteMessage":"정말 삭제하시겠습니까?","confirm.unsavedChanges":"저장되지 않은 변경사항이 있습니다. 취소하시겠습니까?","console.shell":"셸","console.terminal":"터미널","console.prompt":"명령어 입력…","console.clear":"콘솔 지우기","console.run":"실행","console.output":"출력","console.newSession":"새 세션","console.closeSession":"세션 닫기","controls.save":"저장","controls.cancel":"취소","controls.delete":"삭제","controls.edit":"편집","controls.add":"추가","controls.remove":"제거","controls.close":"닫기","controls.open":"열기","controls.refresh":"새로고침","controls.new":"새로 만들기","controls.duplicate":"복제","controls.sort":"정렬","controls.group":"그룹화","controls.pin":"고정","controls.unpin":"고정 해제","controls.lock":"잠금","controls.unlock":"잠금 해제","controls.share":"공유","controls.archive":"보관","cookie.title":"쿠키 동의","cookie.message":"이 사이트는 쿠키를 사용합니다.","cookie.accept":"모두 허용","cookie.reject":"모두 거부","cookie.settings":"쿠키 설정","cookie.necessary":"필수","cookie.analytics":"분석","cookie.marketing":"마케팅","dashboard.title":"대시보드","dashboard.addWidget":"위젯 추가","dashboard.removeWidget":"위젯 제거","dashboard.layout":"레이아웃","dashboard.settings":"설정","dashboard.customize":"사용자 정의","dashboard.resetLayout":"레이아웃 초기화","datetime.today":"오늘","datetime.yesterday":"어제","datetime.tomorrow":"내일","datetime.selectDate":"날짜 선택","datetime.selectTime":"시간 선택","datetime.startDate":"시작일","datetime.endDate":"종료일","datetime.startTime":"시작 시간","datetime.endTime":"종료 시간","datetime.am":"오전","datetime.pm":"오후","desktop.start":"시작","desktop.taskbar":"작업 표시줄","desktop.systemTray":"시스템 트레이","desktop.wallpaper":"배경화면","desktop.icons":"바탕화면 아이콘","desktop.arrangeIcons":"아이콘 정렬","dock.pin":"독에 고정","dock.unpin":"독에서 해제","dock.close":"닫기","dock.minimize":"최소화","dock.maximize":"최대화","dock.restore":"복원","docEditor.paragraph":"단락","docEditor.heading":"제목","docEditor.heading1":"제목 1","docEditor.heading2":"제목 2","docEditor.heading3":"제목 3","docEditor.bulletList":"글머리 기호 목록","docEditor.numberedList":"번호 매기기 목록","docEditor.quote":"인용","docEditor.code":"코드 블록","docEditor.divider":"구분선","docEditor.image":"이미지","docEditor.table":"표","docEditor.callout":"설명","docEditor.placeholder":"입력 시작…","docEditor.slashCommand":"/로 명령 입력","files.upload":"파일 업로드","files.download":"다운로드","files.delete":"파일 삭제","files.rename":"이름 변경","files.newFolder":"새 폴더","files.selectFile":"파일 선택","files.dropzone":"여기에 파일을 드롭하세요","files.dragDrop":"파일을 드래그 앤 드롭하거나 클릭","files.maxSize":"최대 파일 크기","files.fileType":"파일 유형","forms.required":"이 항목은 필수입니다","forms.optional":"선택사항","forms.submit":"제출","forms.reset":"초기화","forms.validate":"검증","forms.invalid":"잘못된 값","forms.minLength":"최소 길이: {0}","forms.maxLength":"최대 길이: {0}","forms.email":"유효한 이메일을 입력하세요","forms.phone":"유효한 전화번호를 입력하세요","imageEditor.crop":"자르기","imageEditor.rotate":"회전","imageEditor.flip":"뒤집기","imageEditor.resize":"크기 조정","imageEditor.filter":"필터","imageEditor.draw":"그리기","imageEditor.text":"텍스트","imageEditor.undo":"실행취소","imageEditor.redo":"다시실행","imageEditor.save":"저장","imageEditor.brightness":"밝기","imageEditor.contrast":"대비","imageEditor.saturation":"채도","inbox.compose":"작성","inbox.reply":"답장","inbox.replyAll":"전체 답장","inbox.forward":"전달","inbox.delete":"삭제","inbox.archive":"보관","inbox.markRead":"읽음으로 표시","inbox.markUnread":"읽지 않음으로 표시","inbox.folders":"폴더","inbox.inbox":"받은편지함","inbox.sent":"보낸편지함","inbox.drafts":"임시보관함","inbox.trash":"휴지통","inbox.spam":"스팸","inbox.starred":"별표","inbox.to":"받는 사람","inbox.cc":"참조","inbox.bcc":"숨은 참조","inbox.subject":"제목","inbox.send":"보내기","inbox.discard":"취소","inbox.attachFile":"파일 첨부","kanban.addCard":"카드 추가","kanban.addColumn":"열 추가","kanban.moveCard":"카드 이동","kanban.editCard":"카드 편집","kanban.deleteCard":"카드 삭제","kanban.editColumn":"열 편집","kanban.deleteColumn":"열 삭제","lang.en":"영어","lang.pl":"폴란드어","lang.de":"독일어","lang.fr":"프랑스어","lang.es":"스페인어","lang.it":"이탈리아어","lang.pt":"포르투갈어","lang.nl":"네덜란드어","lang.sv":"스웨덴어","lang.no":"노르웨이어","lang.da":"덴마크어","lang.fi":"핀란드어","lang.cs":"체코어","lang.sk":"슬로바키아어","lang.hu":"헝가리어","lang.ro":"루마니아어","lang.bg":"불가리아어","lang.uk":"우크라이나어","lang.ja":"일본어","lang.ko":"한국어","lang.zh":"중국어","lang.ar":"아랍어","login.username":"사용자 이름","login.password":"비밀번호","login.signIn":"로그인","login.signOut":"로그아웃","login.forgotPassword":"비밀번호를 잊으셨나요?","login.register":"회원가입","login.rememberMe":"로그인 상태 유지","login.newPassword":"새 비밀번호","login.confirmPassword":"비밀번호 확인","login.twoFactor":"이중 인증","password.strength":"비밀번호 강도","password.weak":"약함","password.medium":"보통","password.strong":"강함","password.requirements":"비밀번호 요구사항","pdfviewer.page":"페이지","pdfviewer.of":"/","pdfviewer.zoom":"확대/축소","pdfviewer.fitPage":"페이지에 맞추기","pdfviewer.fitWidth":"너비에 맞추기","pdfviewer.download":"다운로드","pdfviewer.print":"인쇄","pdfviewer.search":"문서 내 검색","pdfviewer.bookmark":"북마크","pdfviewer.thumbnail":"썸네일","picklist.available":"사용 가능","picklist.selected":"선택됨","picklist.addAll":"전체 추가","picklist.removeAll":"전체 제거","picklist.filter":"항목 필터","scheduling.calendar":"캘린더","scheduling.event":"이벤트","scheduling.allDay":"종일","scheduling.today":"오늘","scheduling.week":"주","scheduling.month":"월","scheduling.year":"년","scheduling.day":"일","scheduling.agenda":"일정","scheduling.addEvent":"이벤트 추가","scheduling.editEvent":"이벤트 편집","scheduling.deleteEvent":"이벤트 삭제","scheduling.noEvents":"이벤트 없음","shortcuts.title":"키보드 단축키","shortcuts.description":"사용 가능한 단축키","shortcuts.key":"키","shortcuts.command":"명령","shortcuts.search":"단축키 검색","signature.clear":"지우기","signature.save":"저장","signature.sign":"여기에 서명","signature.draw":"서명을 그려주세요","spreadsheet.cell":"셀","spreadsheet.row":"행","spreadsheet.column":"열","spreadsheet.formula":"수식","spreadsheet.insert":"삽입","spreadsheet.delete":"삭제","spreadsheet.sort":"정렬","spreadsheet.sortAsc":"오름차순","spreadsheet.sortDesc":"내림차순","spreadsheet.filter":"필터","spreadsheet.export":"내보내기","spreadsheet.import":"가져오기","spreadsheet.addRow":"행 추가","spreadsheet.addColumn":"열 추가","spreadsheet.deleteRow":"행 삭제","spreadsheet.deleteColumn":"열 삭제","spreadsheet.freezeRow":"행 고정","spreadsheet.freezeColumn":"열 고정","spreadsheet.merge":"셀 병합","spreadsheet.unmerge":"셀 병합 해제","terminal.run":"실행","terminal.clear":"지우기","terminal.copy":"복사","terminal.paste":"붙여넣기","terminal.newSession":"새 세션","terminal.closeSession":"세션 닫기","terminal.selectAll":"전체선택","theme.light":"라이트","theme.dark":"다크","theme.system":"시스템","theme.custom":"사용자 정의","theme.colors":"색상","theme.fonts":"글꼴","theme.apply":"테마 적용","theme.preview":"미리보기","theme.reset":"기본값으로 복원","theme.gallery":"테마 갤러리","users.profile":"프로필","users.settings":"설정","users.permissions":"권한","users.role":"역할","users.active":"활성","users.inactive":"비활성","users.online":"온라인","users.offline":"오프라인","users.lastSeen":"마지막 접속","wm.close":"닫기","wm.minimize":"최소화","wm.maximize":"최대화","wm.restore":"복원","wm.tile":"창 정렬","wm.cascade":"계단식 배열","wm.closeAll":"모두 닫기","wm.minimizeAll":"모두 최소화","wm.newWindow":"새 창","wm.moveToFront":"맨 앞으로"},Do={ok:"确定",cancel:"取消",save:"保存",close:"关闭",delete:"删除",edit:"编辑",add:"添加",remove:"移除",search:"搜索",filter:"筛选",refresh:"刷新",loading:"加载中…",noData:"暂无数据",error:"错误",success:"成功",warning:"警告",info:"信息",yes:"是",no:"否",confirm:"确认",back:"返回",next:"下一步",previous:"上一步",finish:"完成",submit:"提交",reset:"重置",apply:"应用",undo:"撤销",redo:"重做",copy:"复制",cut:"剪切",paste:"粘贴",selectAll:"全选",clear:"清除",upload:"上传",download:"下载",print:"打印",export:"导出",import:"导入",settings:"设置",help:"帮助",about:"关于",more:"更多",less:"收起",show:"显示",hide:"隐藏",expand:"展开",collapse:"折叠",enabled:"已启用",disabled:"已禁用",required:"必填",optional:"选填",actions:"操作",details:"详情",overview:"概览",all:"全部",none:"无",selected:"已选择",total:"合计",of:"/",items:"项",page:"页",rows:"行","app.name":"应用程序","app.version":"版本","app.about":"关于","nav.home":"首页","nav.back":"返回","nav.forward":"前进","nav.menu":"菜单","nav.sidebar":"侧边栏","nav.search":"搜索","nav.favorites":"收藏","nav.recent":"最近","nav.notifications":"通知","nav.profile":"个人资料","nav.logout":"退出登录","carousel.prev":"上一张","carousel.next":"下一张","carousel.slide":"幻灯片","carousel.of":"/","carousel.autoplay":"自动播放","carousel.pause":"暂停","confirm.yes":"是","confirm.no":"否","confirm.ok":"确定","confirm.cancel":"取消","confirm.title":"确认","confirm.deleteMessage":"确定要删除吗?","confirm.unsavedChanges":"有未保存的更改。要放弃吗?","console.shell":"命令行","console.terminal":"终端","console.prompt":"输入命令…","console.clear":"清空控制台","console.run":"运行","console.output":"输出","console.newSession":"新建会话","console.closeSession":"关闭会话","controls.save":"保存","controls.cancel":"取消","controls.delete":"删除","controls.edit":"编辑","controls.add":"添加","controls.remove":"移除","controls.close":"关闭","controls.open":"打开","controls.refresh":"刷新","controls.new":"新建","controls.duplicate":"复制","controls.sort":"排序","controls.group":"分组","controls.pin":"固定","controls.unpin":"取消固定","controls.lock":"锁定","controls.unlock":"解锁","controls.share":"分享","controls.archive":"归档","cookie.title":"Cookie 同意","cookie.message":"本网站使用 Cookie 以改善您的体验。","cookie.accept":"全部接受","cookie.reject":"全部拒绝","cookie.settings":"Cookie 设置","cookie.necessary":"必要","cookie.analytics":"分析","cookie.marketing":"营销","dashboard.title":"仪表盘","dashboard.addWidget":"添加小部件","dashboard.removeWidget":"移除小部件","dashboard.layout":"布局","dashboard.settings":"设置","dashboard.customize":"自定义","dashboard.resetLayout":"重置布局","datetime.today":"今天","datetime.yesterday":"昨天","datetime.tomorrow":"明天","datetime.selectDate":"选择日期","datetime.selectTime":"选择时间","datetime.startDate":"开始日期","datetime.endDate":"结束日期","datetime.startTime":"开始时间","datetime.endTime":"结束时间","datetime.am":"上午","datetime.pm":"下午","desktop.start":"开始","desktop.taskbar":"任务栏","desktop.systemTray":"系统托盘","desktop.wallpaper":"壁纸","desktop.icons":"桌面图标","desktop.arrangeIcons":"排列图标","dock.pin":"固定到 Dock","dock.unpin":"从 Dock 取消固定","dock.close":"关闭","dock.minimize":"最小化","dock.maximize":"最大化","dock.restore":"还原","docEditor.paragraph":"段落","docEditor.heading":"标题","docEditor.heading1":"标题 1","docEditor.heading2":"标题 2","docEditor.heading3":"标题 3","docEditor.bulletList":"无序列表","docEditor.numberedList":"有序列表","docEditor.quote":"引用","docEditor.code":"代码块","docEditor.divider":"分割线","docEditor.image":"图片","docEditor.table":"表格","docEditor.callout":"提示框","docEditor.placeholder":"开始输入…","docEditor.slashCommand":"输入 / 查看命令","files.upload":"上传文件","files.download":"下载","files.delete":"删除文件","files.rename":"重命名","files.newFolder":"新建文件夹","files.selectFile":"选择文件","files.dropzone":"将文件拖放到此处","files.dragDrop":"拖放文件或点击浏览","files.maxSize":"最大文件大小","files.fileType":"文件类型","forms.required":"此字段为必填项","forms.optional":"选填","forms.submit":"提交","forms.reset":"重置","forms.validate":"验证","forms.invalid":"无效值","forms.minLength":"最小长度:{0}","forms.maxLength":"最大长度:{0}","forms.email":"请输入有效的电子邮件","forms.phone":"请输入有效的电话号码","imageEditor.crop":"裁剪","imageEditor.rotate":"旋转","imageEditor.flip":"翻转","imageEditor.resize":"调整大小","imageEditor.filter":"滤镜","imageEditor.draw":"绘制","imageEditor.text":"文字","imageEditor.undo":"撤销","imageEditor.redo":"重做","imageEditor.save":"保存","imageEditor.brightness":"亮度","imageEditor.contrast":"对比度","imageEditor.saturation":"饱和度","inbox.compose":"撰写","inbox.reply":"回复","inbox.replyAll":"全部回复","inbox.forward":"转发","inbox.delete":"删除","inbox.archive":"归档","inbox.markRead":"标为已读","inbox.markUnread":"标为未读","inbox.folders":"文件夹","inbox.inbox":"收件箱","inbox.sent":"已发送","inbox.drafts":"草稿箱","inbox.trash":"回收站","inbox.spam":"垃圾邮件","inbox.starred":"星标邮件","inbox.to":"收件人","inbox.cc":"抄送","inbox.bcc":"密送","inbox.subject":"主题","inbox.send":"发送","inbox.discard":"放弃","inbox.attachFile":"添加附件","kanban.addCard":"添加卡片","kanban.addColumn":"添加列","kanban.moveCard":"移动卡片","kanban.editCard":"编辑卡片","kanban.deleteCard":"删除卡片","kanban.editColumn":"编辑列","kanban.deleteColumn":"删除列","lang.en":"英语","lang.pl":"波兰语","lang.de":"德语","lang.fr":"法语","lang.es":"西班牙语","lang.it":"意大利语","lang.pt":"葡萄牙语","lang.nl":"荷兰语","lang.sv":"瑞典语","lang.no":"挪威语","lang.da":"丹麦语","lang.fi":"芬兰语","lang.cs":"捷克语","lang.sk":"斯洛伐克语","lang.hu":"匈牙利语","lang.ro":"罗马尼亚语","lang.bg":"保加利亚语","lang.uk":"乌克兰语","lang.ja":"日语","lang.ko":"韩语","lang.zh":"中文","lang.ar":"阿拉伯语","login.username":"用户名","login.password":"密码","login.signIn":"登录","login.signOut":"退出","login.forgotPassword":"忘记密码?","login.register":"注册","login.rememberMe":"记住我","login.newPassword":"新密码","login.confirmPassword":"确认密码","login.twoFactor":"两步验证","password.strength":"密码强度","password.weak":"弱","password.medium":"中","password.strong":"强","password.requirements":"密码要求","pdfviewer.page":"页","pdfviewer.of":"/","pdfviewer.zoom":"缩放","pdfviewer.fitPage":"适合页面","pdfviewer.fitWidth":"适合宽度","pdfviewer.download":"下载","pdfviewer.print":"打印","pdfviewer.search":"在文档中搜索","pdfviewer.bookmark":"书签","pdfviewer.thumbnail":"缩略图","picklist.available":"可用","picklist.selected":"已选择","picklist.addAll":"全部添加","picklist.removeAll":"全部移除","picklist.filter":"筛选项目","scheduling.calendar":"日历","scheduling.event":"事件","scheduling.allDay":"全天","scheduling.today":"今天","scheduling.week":"周","scheduling.month":"月","scheduling.year":"年","scheduling.day":"日","scheduling.agenda":"日程","scheduling.addEvent":"添加事件","scheduling.editEvent":"编辑事件","scheduling.deleteEvent":"删除事件","scheduling.noEvents":"暂无事件","shortcuts.title":"键盘快捷键","shortcuts.description":"可用快捷键","shortcuts.key":"按键","shortcuts.command":"命令","shortcuts.search":"搜索快捷键","signature.clear":"清除","signature.save":"保存","signature.sign":"在此签名","signature.draw":"请绘制您的签名","spreadsheet.cell":"单元格","spreadsheet.row":"行","spreadsheet.column":"列","spreadsheet.formula":"公式","spreadsheet.insert":"插入","spreadsheet.delete":"删除","spreadsheet.sort":"排序","spreadsheet.sortAsc":"升序","spreadsheet.sortDesc":"降序","spreadsheet.filter":"筛选","spreadsheet.export":"导出","spreadsheet.import":"导入","spreadsheet.addRow":"添加行","spreadsheet.addColumn":"添加列","spreadsheet.deleteRow":"删除行","spreadsheet.deleteColumn":"删除列","spreadsheet.freezeRow":"冻结行","spreadsheet.freezeColumn":"冻结列","spreadsheet.merge":"合并单元格","spreadsheet.unmerge":"取消合并","terminal.run":"运行","terminal.clear":"清除","terminal.copy":"复制","terminal.paste":"粘贴","terminal.newSession":"新建会话","terminal.closeSession":"关闭会话","terminal.selectAll":"全选","theme.light":"浅色","theme.dark":"深色","theme.system":"跟随系统","theme.custom":"自定义","theme.colors":"颜色","theme.fonts":"字体","theme.apply":"应用主题","theme.preview":"预览","theme.reset":"恢复默认","theme.gallery":"主题库","users.profile":"个人资料","users.settings":"设置","users.permissions":"权限","users.role":"角色","users.active":"活跃","users.inactive":"不活跃","users.online":"在线","users.offline":"离线","users.lastSeen":"最后在线","wm.close":"关闭","wm.minimize":"最小化","wm.maximize":"最大化","wm.restore":"还原","wm.tile":"平铺窗口","wm.cascade":"层叠窗口","wm.closeAll":"关闭全部","wm.minimizeAll":"最小化全部","wm.newWindow":"新建窗口","wm.moveToFront":"置于最前"},To={ok:"حسناً",cancel:"إلغاء",save:"حفظ",close:"إغلاق",delete:"حذف",edit:"تعديل",add:"إضافة",remove:"إزالة",search:"بحث",filter:"تصفية",refresh:"تحديث",loading:"جاري التحميل…",noData:"لا توجد بيانات",error:"خطأ",success:"نجاح",warning:"تحذير",info:"معلومات",yes:"نعم",no:"لا",confirm:"تأكيد",back:"رجوع",next:"التالي",previous:"السابق",finish:"إنهاء",submit:"إرسال",reset:"إعادة تعيين",apply:"تطبيق",undo:"تراجع",redo:"إعادة",copy:"نسخ",cut:"قص",paste:"لصق",selectAll:"تحديد الكل",clear:"مسح",upload:"رفع",download:"تنزيل",print:"طباعة",export:"تصدير",import:"استيراد",settings:"إعدادات",help:"مساعدة",about:"حول",more:"المزيد",less:"أقل",show:"إظهار",hide:"إخفاء",expand:"توسيع",collapse:"طي",enabled:"مُفعّل",disabled:"مُعطّل",required:"مطلوب",optional:"اختياري",actions:"إجراءات",details:"تفاصيل",overview:"نظرة عامة",all:"الكل",none:"لا شيء",selected:"محدد",total:"المجموع",of:"من",items:"عناصر",page:"صفحة",rows:"صفوف","app.name":"التطبيق","app.version":"الإصدار","app.about":"حول","nav.home":"الرئيسية","nav.back":"رجوع","nav.forward":"تقدم","nav.menu":"القائمة","nav.sidebar":"الشريط الجانبي","nav.search":"بحث","nav.favorites":"المفضلة","nav.recent":"الأخيرة","nav.notifications":"الإشعارات","nav.profile":"الملف الشخصي","nav.logout":"تسجيل خروج","carousel.prev":"الشريحة السابقة","carousel.next":"الشريحة التالية","carousel.slide":"شريحة","carousel.of":"من","carousel.autoplay":"تشغيل تلقائي","carousel.pause":"إيقاف مؤقت","confirm.yes":"نعم","confirm.no":"لا","confirm.ok":"حسناً","confirm.cancel":"إلغاء","confirm.title":"تأكيد","confirm.deleteMessage":"هل أنت متأكد أنك تريد الحذف؟","confirm.unsavedChanges":"لديك تغييرات غير محفوظة. هل تريد التجاهل؟","console.shell":"سطر أوامر","console.terminal":"طرفية","console.prompt":"أدخل أمراً…","console.clear":"مسح وحدة التحكم","console.run":"تشغيل","console.output":"المخرجات","console.newSession":"جلسة جديدة","console.closeSession":"إغلاق الجلسة","controls.save":"حفظ","controls.cancel":"إلغاء","controls.delete":"حذف","controls.edit":"تعديل","controls.add":"إضافة","controls.remove":"إزالة","controls.close":"إغلاق","controls.open":"فتح","controls.refresh":"تحديث","controls.new":"جديد","controls.duplicate":"تكرار","controls.sort":"ترتيب","controls.group":"تجميع","controls.pin":"تثبيت","controls.unpin":"إلغاء التثبيت","controls.lock":"قفل","controls.unlock":"فتح القفل","controls.share":"مشاركة","controls.archive":"أرشفة","cookie.title":"موافقة ملفات تعريف الارتباط","cookie.message":"يستخدم هذا الموقع ملفات تعريف الارتباط لتحسين تجربتك.","cookie.accept":"قبول الكل","cookie.reject":"رفض الكل","cookie.settings":"إعدادات ملفات تعريف الارتباط","cookie.necessary":"ضرورية","cookie.analytics":"تحليلية","cookie.marketing":"تسويقية","dashboard.title":"لوحة المعلومات","dashboard.addWidget":"إضافة عنصر","dashboard.removeWidget":"إزالة عنصر","dashboard.layout":"التخطيط","dashboard.settings":"الإعدادات","dashboard.customize":"تخصيص","dashboard.resetLayout":"إعادة تعيين التخطيط","datetime.today":"اليوم","datetime.yesterday":"أمس","datetime.tomorrow":"غداً","datetime.selectDate":"اختر تاريخاً","datetime.selectTime":"اختر وقتاً","datetime.startDate":"تاريخ البداية","datetime.endDate":"تاريخ النهاية","datetime.startTime":"وقت البداية","datetime.endTime":"وقت النهاية","datetime.am":"ص","datetime.pm":"م","desktop.start":"ابدأ","desktop.taskbar":"شريط المهام","desktop.systemTray":"علبة النظام","desktop.wallpaper":"خلفية","desktop.icons":"أيقونات سطح المكتب","desktop.arrangeIcons":"ترتيب الأيقونات","dock.pin":"تثبيت في الشريط","dock.unpin":"إلغاء التثبيت من الشريط","dock.close":"إغلاق","dock.minimize":"تصغير","dock.maximize":"تكبير","dock.restore":"استعادة","docEditor.paragraph":"فقرة","docEditor.heading":"عنوان","docEditor.heading1":"عنوان 1","docEditor.heading2":"عنوان 2","docEditor.heading3":"عنوان 3","docEditor.bulletList":"قائمة نقطية","docEditor.numberedList":"قائمة مرقمة","docEditor.quote":"اقتباس","docEditor.code":"كتلة برمجية","docEditor.divider":"فاصل","docEditor.image":"صورة","docEditor.table":"جدول","docEditor.callout":"تنبيه","docEditor.placeholder":"ابدأ بالكتابة…","docEditor.slashCommand":"اكتب / للأوامر","files.upload":"رفع ملف","files.download":"تنزيل","files.delete":"حذف ملف","files.rename":"إعادة تسمية","files.newFolder":"مجلد جديد","files.selectFile":"اختر ملفاً","files.dropzone":"اسحب الملفات هنا","files.dragDrop":"اسحب وأفلت الملفات أو انقر للتصفح","files.maxSize":"الحجم الأقصى للملف","files.fileType":"نوع الملف","forms.required":"هذا الحقل مطلوب","forms.optional":"اختياري","forms.submit":"إرسال","forms.reset":"إعادة تعيين","forms.validate":"تحقق","forms.invalid":"قيمة غير صالحة","forms.minLength":"الحد الأدنى للطول: {0}","forms.maxLength":"الحد الأقصى للطول: {0}","forms.email":"أدخل بريداً إلكترونياً صالحاً","forms.phone":"أدخل رقم هاتف صالحاً","imageEditor.crop":"اقتصاص","imageEditor.rotate":"تدوير","imageEditor.flip":"قلب","imageEditor.resize":"تغيير الحجم","imageEditor.filter":"مرشح","imageEditor.draw":"رسم","imageEditor.text":"نص","imageEditor.undo":"تراجع","imageEditor.redo":"إعادة","imageEditor.save":"حفظ","imageEditor.brightness":"السطوع","imageEditor.contrast":"التباين","imageEditor.saturation":"التشبع","inbox.compose":"إنشاء","inbox.reply":"رد","inbox.replyAll":"الرد على الكل","inbox.forward":"إعادة توجيه","inbox.delete":"حذف","inbox.archive":"أرشفة","inbox.markRead":"تحديد كمقروء","inbox.markUnread":"تحديد كغير مقروء","inbox.folders":"المجلدات","inbox.inbox":"البريد الوارد","inbox.sent":"المرسل","inbox.drafts":"المسودات","inbox.trash":"المحذوفات","inbox.spam":"البريد العشوائي","inbox.starred":"المميز بنجمة","inbox.to":"إلى","inbox.cc":"نسخة","inbox.bcc":"نسخة مخفية","inbox.subject":"الموضوع","inbox.send":"إرسال","inbox.discard":"تجاهل","inbox.attachFile":"إرفاق ملف","kanban.addCard":"إضافة بطاقة","kanban.addColumn":"إضافة عمود","kanban.moveCard":"نقل بطاقة","kanban.editCard":"تعديل بطاقة","kanban.deleteCard":"حذف بطاقة","kanban.editColumn":"تعديل عمود","kanban.deleteColumn":"حذف عمود","lang.en":"الإنجليزية","lang.pl":"البولندية","lang.de":"الألمانية","lang.fr":"الفرنسية","lang.es":"الإسبانية","lang.it":"الإيطالية","lang.pt":"البرتغالية","lang.nl":"الهولندية","lang.sv":"السويدية","lang.no":"النرويجية","lang.da":"الدانماركية","lang.fi":"الفنلندية","lang.cs":"التشيكية","lang.sk":"السلوفاكية","lang.hu":"المجرية","lang.ro":"الرومانية","lang.bg":"البلغارية","lang.uk":"الأوكرانية","lang.ja":"اليابانية","lang.ko":"الكورية","lang.zh":"الصينية","lang.ar":"العربية","login.username":"اسم المستخدم","login.password":"كلمة المرور","login.signIn":"تسجيل الدخول","login.signOut":"تسجيل الخروج","login.forgotPassword":"نسيت كلمة المرور؟","login.register":"إنشاء حساب","login.rememberMe":"تذكرني","login.newPassword":"كلمة مرور جديدة","login.confirmPassword":"تأكيد كلمة المرور","login.twoFactor":"المصادقة الثنائية","password.strength":"قوة كلمة المرور","password.weak":"ضعيفة","password.medium":"متوسطة","password.strong":"قوية","password.requirements":"متطلبات كلمة المرور","pdfviewer.page":"صفحة","pdfviewer.of":"من","pdfviewer.zoom":"تكبير","pdfviewer.fitPage":"ملاءمة الصفحة","pdfviewer.fitWidth":"ملاءمة العرض","pdfviewer.download":"تنزيل","pdfviewer.print":"طباعة","pdfviewer.search":"البحث في المستند","pdfviewer.bookmark":"إشارات مرجعية","pdfviewer.thumbnail":"صور مصغرة","picklist.available":"متاح","picklist.selected":"محدد","picklist.addAll":"إضافة الكل","picklist.removeAll":"إزالة الكل","picklist.filter":"تصفية العناصر","scheduling.calendar":"التقويم","scheduling.event":"حدث","scheduling.allDay":"طوال اليوم","scheduling.today":"اليوم","scheduling.week":"أسبوع","scheduling.month":"شهر","scheduling.year":"سنة","scheduling.day":"يوم","scheduling.agenda":"جدول أعمال","scheduling.addEvent":"إضافة حدث","scheduling.editEvent":"تعديل حدث","scheduling.deleteEvent":"حذف حدث","scheduling.noEvents":"لا توجد أحداث","shortcuts.title":"اختصارات لوحة المفاتيح","shortcuts.description":"الاختصارات المتاحة","shortcuts.key":"مفتاح","shortcuts.command":"أمر","shortcuts.search":"البحث عن اختصارات","signature.clear":"مسح","signature.save":"حفظ","signature.sign":"وقّع هنا","signature.draw":"ارسم توقيعك","spreadsheet.cell":"خلية","spreadsheet.row":"صف","spreadsheet.column":"عمود","spreadsheet.formula":"صيغة","spreadsheet.insert":"إدراج","spreadsheet.delete":"حذف","spreadsheet.sort":"ترتيب","spreadsheet.sortAsc":"ترتيب تصاعدي","spreadsheet.sortDesc":"ترتيب تنازلي","spreadsheet.filter":"تصفية","spreadsheet.export":"تصدير","spreadsheet.import":"استيراد","spreadsheet.addRow":"إضافة صف","spreadsheet.addColumn":"إضافة عمود","spreadsheet.deleteRow":"حذف صف","spreadsheet.deleteColumn":"حذف عمود","spreadsheet.freezeRow":"تجميد صف","spreadsheet.freezeColumn":"تجميد عمود","spreadsheet.merge":"دمج خلايا","spreadsheet.unmerge":"إلغاء دمج خلايا","terminal.run":"تشغيل","terminal.clear":"مسح","terminal.copy":"نسخ","terminal.paste":"لصق","terminal.newSession":"جلسة جديدة","terminal.closeSession":"إغلاق الجلسة","terminal.selectAll":"تحديد الكل","theme.light":"فاتح","theme.dark":"داكن","theme.system":"النظام","theme.custom":"مخصص","theme.colors":"الألوان","theme.fonts":"الخطوط","theme.apply":"تطبيق السمة","theme.preview":"معاينة","theme.reset":"استعادة الافتراضي","theme.gallery":"معرض السمات","users.profile":"الملف الشخصي","users.settings":"الإعدادات","users.permissions":"الصلاحيات","users.role":"الدور","users.active":"نشط","users.inactive":"غير نشط","users.online":"متصل","users.offline":"غير متصل","users.lastSeen":"آخر ظهور","wm.close":"إغلاق","wm.minimize":"تصغير","wm.maximize":"تكبير","wm.restore":"استعادة","wm.tile":"ترتيب النوافذ","wm.cascade":"تتالي النوافذ","wm.closeAll":"إغلاق الكل","wm.minimizeAll":"تصغير الكل","wm.newWindow":"نافذة جديدة","wm.moveToFront":"نقل إلى الأمام"},Nr={en:mo,pl:ho,de:fo,fr:go,es:yo,it:bo,pt:xo,nl:vo,sv:ko,no:wo,da:_o,fi:jo,cs:Co,sk:So,hu:No,ro:Mo,bg:$o,uk:zo,ja:Eo,ko:Ao,zh:Do,ar:To},Ro=(t,a)=>a,gn=s.createContext(Ro),Fo=({t,lang:a="en",overrides:r,children:n})=>{const i=s.useMemo(()=>{if(t)return t;const o=Nr[a]??Nr.en,c=r?{...o,...r}:o;return(l,d)=>c[l]??d},[t,a,r]);return e.jsx(gn.Provider,{value:i,children:n})};function Re(){return{t:s.useContext(gn)}}const yn={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M18 15l-6-6-6 6","chevron-left":"M15 18l-6-6 6-6","chevron-right":"M9 6l6 6-6 6","arrow-left":"M19 12H5m0 0l7 7m-7-7l7-7","arrow-right":"M5 12h14m0 0l-7-7m7 7l-7 7","arrow-up":"M12 19V5m0 0l-7 7m7-7l7 7","arrow-down":"M12 5v14m0 0l7-7m-7 7l-7-7",close:"M18 6L6 18M6 6l12 12",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",check:"M5 13l4 4L19 7",edit:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 113 3L12 15l-4 1 1-4 9.5-9.5z",trash:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",upload:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",refresh:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z","sort-asc":"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12","sort-desc":"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4",menu:"M4 6h16M4 12h16M4 18h16","more-vertical":"M12 5v.01M12 12v.01M12 19v.01","more-horizontal":"M5 12h.01M12 12h.01M19 12h.01",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",eye:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M15 12a3 3 0 11-6 0 3 3 0 016 0z","eye-off":"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24 M1 1l22 22",lock:"M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2zm-3-4a4 4 0 10-8 0v4h8V7z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",help:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",clock:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",file:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",image:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",phone:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",users:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",grip:"M4 6h2m4 0h2m4 0h2M4 12h2m4 0h2m4 0h2M4 18h2m4 0h2m4 0h2",play:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",pause:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stop:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",expand:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",collapse:"M9 9V5m0 4H5m4 0L4 4m11 5h4m-4 0V5m0 4l5-5M9 15v4m0-4H5m4 0l-5 5m15-5h-4m4 0v4m0-4l-5 5","external-link":"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},Io={xs:12,sm:16,md:20,lg:24,xl:32},Po=s.createContext({});function Lo({path:t,size:a,className:r,style:n,color:i,title:o,onClick:c}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:i||"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:`nice-icon ${r||""}`,style:n,role:o?"img":"presentation","aria-label":o,"aria-hidden":!o,onClick:c,children:[o&&e.jsx("title",{children:o}),e.jsx("path",{d:t})]})}const Oo=({name:t,size:a="md",className:r,style:n,color:i,title:o,onClick:c})=>{const{resolver:l}=s.useContext(Po),d=typeof a=="number"?a:Io[a];if(l){const h=l(t,d);if(h)return e.jsx("span",{className:`nice-icon-wrap ${r||""}`,style:n,onClick:c,children:h})}const p=yn[t];return p?e.jsx(Lo,{path:p,size:d,className:r,style:n,color:i,title:o,onClick:c}):null},Bo=Object.keys(yn);s.createContext(null);const qe={submit:{key:"Enter",description:"Submit / Confirm",descriptionKey:"shortcuts.submit"},cancel:{key:"Escape",description:"Cancel / Close",descriptionKey:"shortcuts.cancel"},moveUp:{key:"ArrowUp",description:"Move up",descriptionKey:"shortcuts.moveUp"},moveDown:{key:"ArrowDown",description:"Move down",descriptionKey:"shortcuts.moveDown"},moveLeft:{key:"ArrowLeft",description:"Move left",descriptionKey:"shortcuts.moveLeft"},moveRight:{key:"ArrowRight",description:"Move right",descriptionKey:"shortcuts.moveRight"},first:{key:"Home",description:"Go to first",descriptionKey:"shortcuts.first"},last:{key:"End",description:"Go to last",descriptionKey:"shortcuts.last"},pageUp:{key:"PageUp",description:"Page up",descriptionKey:"shortcuts.pageUp"},pageDown:{key:"PageDown",description:"Page down",descriptionKey:"shortcuts.pageDown"},increment:{key:"ArrowUp",description:"Increase value",descriptionKey:"shortcuts.increment"},decrement:{key:"ArrowDown",description:"Decrease value",descriptionKey:"shortcuts.decrement"},incrementBig:{key:"PageUp",description:"Increase by 10",descriptionKey:"shortcuts.incrementBig"},decrementBig:{key:"PageDown",description:"Decrease by 10",descriptionKey:"shortcuts.decrementBig"}};function Wo(t){var r,n,i,o;const a=[];return(r=t.modifiers)!=null&&r.includes("ctrl")&&a.push("Ctrl"),(n=t.modifiers)!=null&&n.includes("alt")&&a.push("Alt"),(i=t.modifiers)!=null&&i.includes("shift")&&a.push("Shift"),(o=t.modifiers)!=null&&o.includes("meta")&&a.push("⌘"),a.push(t.key),a.join("+")}function Ho(t,a){if(!(t.key===a.key||t.key.toLowerCase()===a.key.toLowerCase()))return!1;const r=a.modifiers??[];return!(r.includes("ctrl")!==(t.ctrlKey||t.metaKey)||r.includes("alt")!==t.altKey||r.includes("shift")!==t.shiftKey)}const tt=({shortcuts:t,position:a="top",icon:r,size:n="sm",className:i})=>{const[o,c]=s.useState(!1),l=s.useRef(null),[d,p]=s.useState({top:0,left:0}),h=s.useCallback(()=>{if(!l.current)return;const f=l.current.getBoundingClientRect(),m=8;let b=0,C=0;switch(a){case"top":b=f.top-m,C=f.left+f.width/2;break;case"bottom":b=f.bottom+m,C=f.left+f.width/2;break;case"left":b=f.top+f.height/2,C=f.left-m;break;case"right":b=f.top+f.height/2,C=f.right+m;break}p({top:b,left:C})},[a]),u=s.useCallback(()=>{h(),c(!0)},[h]),g=s.useCallback(()=>{h(),c(!0)},[h]);return t.length===0?null:e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:l,type:"button",className:`nice-keyboard-hint nice-keyboard-hint--${n} ${i||""}`,onMouseEnter:u,onMouseLeave:()=>c(!1),onFocus:g,onBlur:()=>c(!1),"aria-label":"Keyboard shortcuts",tabIndex:-1,children:r||"?"}),o&&e.jsxs("div",{className:`nice-keyboard-hint__tooltip nice-keyboard-hint__tooltip--${a}`,style:{position:"fixed",top:d.top,left:d.left,transform:a==="top"?"translate(-50%, -100%)":a==="bottom"?"translate(-50%, 0)":a==="left"?"translate(-100%, -50%)":"translate(0, -50%)"},role:"tooltip",children:[e.jsx("div",{className:"nice-keyboard-hint__title",children:"Keyboard Shortcuts"}),e.jsx("ul",{className:"nice-keyboard-hint__list",children:t.map((f,m)=>e.jsxs("li",{className:"nice-keyboard-hint__item",children:[e.jsx("kbd",{className:"nice-keyboard-hint__key",children:Wo(f)}),e.jsx("span",{className:"nice-keyboard-hint__desc",children:f.description})]},m))})]})]})};tt.displayName="NiceKeyboardHint";function Ia(t={}){const{enabled:a=!1,onSubmit:r,preventDefault:n=!0,requireCtrl:i=!1,skipTextarea:o=!0}=t;return s.useCallback(c=>{!a||!r||c.key==="Enter"&&(i&&!c.ctrlKey&&!c.metaKey||o&&c.target.tagName==="TEXTAREA"||(n&&c.preventDefault(),r()))},[a,r,n,i,o])}s.createContext(null);s.createContext({direction:"ltr",isRTL:!1,flip:t=>t,flipStyle:(t,a)=>({[t]:a})});const qo=s.createContext({permissions:{},getAccessMode:()=>"full"});function Oe(t,a,r){const n=s.useContext(qo);return t||n.getAccessMode(a,r)}const Vo=s.createContext(null);function vt(){const t=s.useContext(Vo);if(!t)throw new Error("useNiceAI must be used within a NiceAIProvider");return t}function Ko(t={}){const a=vt(),[r,n]=s.useState(""),[i,o]=s.useState(!1),c=s.useCallback(async(h,u="")=>{o(!0),n("");try{const g=(await a.complete([{role:"user",content:`Complete the following ${t.language||""} code. Return ONLY the completion text, no explanation.
|
|
2
|
+
|
|
3
|
+
Code before cursor:
|
|
4
|
+
\`\`\`
|
|
5
|
+
${h}
|
|
6
|
+
\`\`\`
|
|
7
|
+
|
|
8
|
+
Code after cursor:
|
|
9
|
+
\`\`\`
|
|
10
|
+
${u}
|
|
11
|
+
\`\`\`
|
|
12
|
+
|
|
13
|
+
Completion:`}],{model:t.model,temperature:.2,maxTokens:200})).content.trim();return n(g),g}catch{return""}finally{o(!1)}},[a,t]),l=s.useCallback(async h=>{o(!0);try{return(await a.complete([{role:"user",content:`Explain the following ${t.language||""} code concisely:
|
|
14
|
+
|
|
15
|
+
\`\`\`
|
|
16
|
+
${h}
|
|
17
|
+
\`\`\``}],{model:t.model,temperature:.3})).content}finally{o(!1)}},[a,t]),d=s.useCallback(async(h,u)=>{o(!0);try{const g=await a.complete([{role:"user",content:`Refactor the following ${t.language||""} code according to the instruction. Return ONLY the refactored code.
|
|
18
|
+
|
|
19
|
+
Code:
|
|
20
|
+
\`\`\`
|
|
21
|
+
${h}
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
Instruction: ${u}
|
|
25
|
+
|
|
26
|
+
Refactored code:`}],{model:t.model,temperature:.2}),f=g.content.match(/```[\w]*\n?([\s\S]*?)```/);return f?f[1].trim():g.content.trim()}finally{o(!1)}},[a,t]),p=s.useCallback(async h=>{o(!0);try{const u=await a.complete([{role:"user",content:`Generate ${t.language||""} code from this comment/description. Return ONLY the code.
|
|
27
|
+
|
|
28
|
+
Description: ${h}
|
|
29
|
+
|
|
30
|
+
Code:`}],{model:t.model,temperature:.3}),g=u.content.match(/```[\w]*\n?([\s\S]*?)```/);return g?g[1].trim():u.content.trim()}finally{o(!1)}},[a,t]);return{suggestion:r,isLoading:i,complete:c,explain:l,refactor:d,generateFromComment:p}}function Yo(){const t=vt(),[a,r]=s.useState(!1);return{parseFilter:s.useCallback(async(n,i)=>{r(!0);try{const o=await t.complete([{role:"user",content:`Convert this natural language query to filter conditions. Available columns: ${JSON.stringify(i)}
|
|
31
|
+
|
|
32
|
+
Query: "${n}"
|
|
33
|
+
|
|
34
|
+
Return a JSON array of filter objects with: field, operator (eq, ne, gt, gte, lt, lte, contains, startsWith, endsWith), value.
|
|
35
|
+
Only return the JSON array, no explanation.`}],{temperature:.1,maxTokens:500});try{const c=JSON.parse(o.content);return Array.isArray(c)?c:[]}catch{return[]}}finally{r(!1)}},[t]),isLoading:a}}function Go(){const t=vt(),[a,r]=s.useState(!1),n=s.useCallback(async(o,c)=>{r(!0);try{const l=o.slice(0,5),d=await t.complete([{role:"user",content:`Analyze this data and suggest the best chart type. Data sample: ${JSON.stringify(l)}
|
|
36
|
+
${c?`Context: ${c}`:""}
|
|
37
|
+
|
|
38
|
+
Return JSON with: type (line, bar, pie, scatter, area, donut), reason (brief explanation), config (suggested chart configuration like xField, yField, etc.)
|
|
39
|
+
Only return JSON.`}],{temperature:.2,maxTokens:500});try{return JSON.parse(d.content)}catch{return{type:"bar",reason:"Default chart type",config:{}}}}finally{r(!1)}},[t]),i=s.useCallback(async(o,c)=>{r(!0);try{const l=await t.complete([{role:"user",content:`Analyze this ${c} chart data and provide 3-5 key insights. Data: ${JSON.stringify(o.slice(0,20))}
|
|
40
|
+
|
|
41
|
+
Return a JSON array of insight strings.`}],{temperature:.3,maxTokens:500});try{return JSON.parse(l.content)}catch{return[]}}finally{r(!1)}},[t]);return{suggestChartType:n,generateInsights:i,isLoading:a}}function Uo(){const t=vt(),[a,r]=s.useState(!1);return{generateForm:s.useCallback(async n=>{r(!0);try{const i=await t.complete([{role:"user",content:`Generate a form definition from this description: "${n}"
|
|
42
|
+
|
|
43
|
+
Return a JSON array of field objects with: label, field (camelCase), type (text, number, email, date, select, checkbox, textarea), required (boolean), options (for select type).
|
|
44
|
+
Only return JSON.`}],{temperature:.3,maxTokens:1e3});try{return JSON.parse(i.content)}catch{return[]}}finally{r(!1)}},[t]),isLoading:a}}function Zo(){const t=vt(),[a,r]=s.useState(!1),n=s.useCallback(async(c,l)=>{r(!0);try{return(await t.complete([{role:"user",content:`Improve this text to be more ${l||"professional"}. Keep the same meaning. Return only the improved text.
|
|
45
|
+
|
|
46
|
+
Text: ${c}
|
|
47
|
+
|
|
48
|
+
Improved:`}],{temperature:.4})).content.trim()}finally{r(!1)}},[t]),i=s.useCallback(async(c,l)=>{r(!0);try{return(await t.complete([{role:"user",content:`Translate this text to ${l}. Return only the translation.
|
|
49
|
+
|
|
50
|
+
Text: ${c}
|
|
51
|
+
|
|
52
|
+
Translation:`}],{temperature:.2})).content.trim()}finally{r(!1)}},[t]),o=s.useCallback(async c=>{r(!0);try{const l=await t.complete([{role:"user",content:`Generate clean semantic HTML from this prompt. Use proper tags (h1-h6, p, ul, ol, table, etc.). Return only HTML.
|
|
53
|
+
|
|
54
|
+
Prompt: ${c}
|
|
55
|
+
|
|
56
|
+
HTML:`}],{temperature:.3}),d=l.content.match(/```html?\n?([\s\S]*?)```/);return d?d[1].trim():l.content.trim()}finally{r(!1)}},[t]);return{improveText:n,translate:i,generateHtml:o,isLoading:a}}function Xo(t,a){const r=(a==null?void 0:a.autoLoad)??!0,n=(a==null?void 0:a.defaultPageSize)??20,[i,o]=s.useState([]),[c,l]=s.useState(0),[d,p]=s.useState(!1),[h,u]=s.useState(null),[g,f]=s.useState(1),[m,b]=s.useState(n),[C,v]=s.useState((a==null?void 0:a.defaultSort)??[]),[w,y]=s.useState(a==null?void 0:a.defaultFilter),[S,k]=s.useState((a==null?void 0:a.defaultSearch)??""),M=s.useRef(0),_=a==null?void 0:a.loadOptions,j=s.useCallback(async()=>{if(!t)return;const E=++M.current;p(!0),u(null);try{const R=await t.load({skip:(g-1)*m,take:m,sort:C.length?C:void 0,filter:w,search:S||void 0,..._});if(E!==M.current)return;o(R.data),l(R.totalCount)}catch(R){if(E!==M.current)return;u(R instanceof Error?R.message:String(R))}finally{E===M.current&&p(!1)}},[t,g,m,C,w,S,_]);s.useEffect(()=>{r&&j()},[j,r]),s.useEffect(()=>{if(t)return t.on("changed",()=>{j()})},[t,j]);const z=s.useCallback((E,R)=>{v([{field:E,direction:R}]),f(1)},[]),P=s.useCallback(E=>{y(E),f(1)},[]),I=s.useCallback(E=>{k(E),f(1)},[]),D=s.useCallback(E=>{b(E),f(1)},[]),T=s.useCallback(async E=>{if(!(t!=null&&t.insert))throw new Error("DataSource is not writable");await t.insert(E)},[t]),N=s.useCallback(async(E,R)=>{if(!(t!=null&&t.update))throw new Error("DataSource is not writable");await t.update(E,R)},[t]),H=s.useCallback(async E=>{if(!(t!=null&&t.remove))throw new Error("DataSource is not writable");await t.remove(E)},[t]);return{data:i,totalCount:c,loading:d,error:h,page:g,pageSize:m,sort:C,filter:w,search:S,setPage:f,setPageSize:D,setSort:v,setSortField:z,setFilter:P,setSearch:I,reload:j,insert:T,update:N,remove:H}}function Jo(t,a){const[r,n]=s.useState(void 0),[i,o]=s.useState({}),[c,l]=s.useState(!1),[d,p]=s.useState(null),h=s.useRef(0),u=s.useCallback(async()=>{if(!t||a==null){n(void 0);return}const w=++h.current;l(!0),p(null);try{const y=await t.byKey(a);if(w!==h.current)return;n(y),o({})}catch(y){if(w!==h.current)return;p(y instanceof Error?y.message:String(y))}finally{w===h.current&&l(!1)}},[t,a]);s.useEffect(()=>{u()},[u]),s.useEffect(()=>{if(t)return t.on("changed",()=>{u()})},[t,u]);const g=s.useMemo(()=>({...r??{},...i}),[r,i]),f=Object.keys(i).length>0,m=s.useCallback((w,y)=>{o(S=>({...S,[w]:y}))},[]),b=s.useCallback(w=>{o(y=>({...y,...w}))},[]),C=s.useCallback(async()=>{if(!(t!=null&&t.update))throw new Error("DataSource is not writable");f&&await t.update(a,i)},[t,a,i,f]),v=s.useCallback(()=>{o({})},[]);return{data:r,editData:g,loading:c,error:d,changes:i,isDirty:f,set:m,setMany:b,save:C,reload:u,reset:v}}function Qo(t,a,r,n){const[c,l]=s.useState([]),[d,p]=s.useState(!1),[h,u]=s.useState(null),g=s.useRef(0),f=s.useCallback(async C=>{if(!t)return;const v=++g.current;p(!0),u(null);try{const w=await t.load({take:200,search:C||void 0,searchFields:n==null?void 0:n.searchFields});if(v!==g.current)return;l(w.data)}catch(w){if(v!==g.current)return;u(w instanceof Error?w.message:String(w))}finally{v===g.current&&p(!1)}},[t,200,n==null?void 0:n.searchFields]);s.useEffect(()=>{f()},[f,!0]);const m=s.useMemo(()=>c.map(C=>{const v=C;return{value:String(v[a]??""),label:String(v[r]??"")}}),[c,a,r,n==null?void 0:n.iconField,n==null?void 0:n.descriptionField,n==null?void 0:n.groupField]),b=s.useCallback(C=>{f(C)},[f]);return{options:m,loading:d,error:h,search:b,reload:()=>f()}}const Ft={cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",source:"default",requiresConsentBanner:!1,resolvedAt:Date.now(),version:"1.0.0"},el=new Map;let tl=class{constructor(a,r="nice2dev",n="local"){this.policy=a,this.namespace=r,this.defaultBackend=n}getBackend(a){const r=a||this.defaultBackend;if(r==="local"&&this.policy.localStorageAllowed)try{if(typeof localStorage<"u")return localStorage}catch{}if((r==="session"||r==="local")&&this.policy.sessionStorageAllowed)try{if(typeof sessionStorage<"u")return sessionStorage}catch{}return el}getKey(a){return`${this.namespace}:${a}`}get(a,r){const n=this.getBackend(r),i=this.getKey(a);try{const o=n instanceof Map?n.get(i):n.getItem(i);if(o==null)return null;try{return JSON.parse(o)}catch{return o}}catch{return null}}set(a,r,n){const i=this.getBackend(n),o=this.getKey(a);try{const c=typeof r=="string"?r:JSON.stringify(r);return i instanceof Map?i.set(o,c):i.setItem(o,c),!0}catch{return!1}}remove(a,r){const n=this.getBackend(r),i=this.getKey(a);try{return n instanceof Map?n.delete(i):(n.removeItem(i),!0)}catch{return!1}}clear(a){const r=this.getBackend(a),n=`${this.namespace}:`;try{if(r instanceof Map)for(const i of r.keys())i.startsWith(n)&&r.delete(i);else{const i=[];for(let o=0;o<r.length;o++){const c=r.key(o);c&&c.startsWith(n)&&i.push(c)}i.forEach(o=>r.removeItem(o))}}catch{}}keys(a){const r=this.getBackend(a),n=`${this.namespace}:`,i=[];try{if(r instanceof Map)for(const o of r.keys())o.startsWith(n)&&i.push(o.slice(n.length));else for(let o=0;o<r.length;o++){const c=r.key(o);c&&c.startsWith(n)&&i.push(c.slice(n.length))}}catch{}return i}has(a,r){return this.get(a,r)!==null}getCapabilities(){return{canUseCookies:this.policy.cookiesAllowed,canUseLocalStorage:this.policy.localStorageAllowed,canUseSessionStorage:this.policy.sessionStorageAllowed,canPersist:this.policy.localStorageAllowed,effectiveMode:this.policy.effectiveMode,actualBackend:this.getActualBackendType()}}getActualBackendType(){const a=this.getBackend();return a instanceof Map?"memory":a===sessionStorage?"session":"local"}updatePolicy(a){this.policy=a}};function al(t,a,r){return{generatedAt:new Date().toISOString(),instanceId:a,tenantId:r,effectiveMode:t.effectiveMode,cookies:{count:0,allowed:t.cookiesAllowed,strictAuthOnly:t.strictAuthCookieOnly,thirdParty:!1,tracking:!1},localStorage:{bytesUsed:0,allowed:t.localStorageAllowed,keysCount:0},sessionStorage:{bytesUsed:0,allowed:t.sessionStorageAllowed,keysCount:0},consentBanner:{required:t.requiresConsentBanner,shown:t.requiresConsentBanner},compliance:{ePrivacyCompliant:!t.cookiesAllowed||t.requiresConsentBanner,gdprCompliant:!0,pecrCompliant:!t.cookiesAllowed||t.requiresConsentBanner},statement:rl(t)}}function rl(t){return t.effectiveMode==="traceless"?"This OmniVerk instance operates in Traceless™ mode. No cookies are set (0), no data is saved to localStorage (0), and no sessionStorage is used (0). No cookie consent banner is required under ePrivacy Directive Art. 5(3) as no similar technologies are employed.":t.effectiveMode==="ephemeral"?"This OmniVerk instance operates in Ephemeral mode. No cookies are set, no localStorage is used. sessionStorage is used for session-only data that is automatically cleared when the browser tab is closed. No cookie consent banner is required.":t.effectiveMode==="private"?"This OmniVerk instance operates in Private mode. One strictly necessary httpOnly authentication cookie may be set. sessionStorage is used for session preferences. No consent banner is required as only strictly necessary technologies are used.":t.effectiveMode==="balanced"?"This OmniVerk instance operates in Balanced mode. localStorage is used for user preferences. sessionStorage is used for session data. No cookies are set. Depending on jurisdiction, a consent banner may be shown.":"This OmniVerk instance operates in Full mode. Cookies, localStorage, and sessionStorage are enabled. A consent banner is displayed to users before any non-essential storage is used."}function nl(t){const{effectiveMode:a}=t;switch(a){case"traceless":return{mode:"traceless",icon:"🟢",color:"#10b981",label:"Traceless™",tooltip:"Your data is not stored on this device. Zero cookies, zero localStorage, zero traces.",cssClass:"nice-traceless-badge--traceless"};case"ephemeral":return{mode:"ephemeral",icon:"🔵",color:"#3b82f6",label:"Ephemeral",tooltip:"Session-only storage. Data is cleared when you close this tab.",cssClass:"nice-traceless-badge--ephemeral"};case"private":return{mode:"private",icon:"🟡",color:"#eab308",label:"Private",tooltip:"Minimal storage with one secure authentication cookie.",cssClass:"nice-traceless-badge--private"};case"balanced":return{mode:"balanced",icon:"🟠",color:"#f97316",label:"Balanced",tooltip:"Preferences are saved locally. No tracking cookies.",cssClass:"nice-traceless-badge--balanced"};case"full":return{mode:"full",icon:"🔴",color:"#ef4444",label:"Full",tooltip:"All storage enabled including analytics. You control what is stored via consent.",cssClass:"nice-traceless-badge--full"};case"custom":default:return{mode:"custom",icon:"⚪",color:"#6b7280",label:"Custom",tooltip:"Custom storage configuration.",cssClass:"nice-traceless-badge--custom"}}}function il(t){const a=[];if(!t.cookiesAllowed&&typeof document<"u"){const r=document.cookie;r&&r.length>0&&a.push({type:"cookie",severity:"high",message:`Cookies found but not allowed: ${r.split(";").length} cookie(s)`,data:r})}if(!t.localStorageAllowed)try{typeof localStorage<"u"&&localStorage.length>0&&a.push({type:"localStorage",severity:"high",message:`localStorage has ${localStorage.length} item(s) but not allowed`})}catch{}if(!t.sessionStorageAllowed)try{typeof sessionStorage<"u"&&sessionStorage.length>0&&a.push({type:"sessionStorage",severity:"medium",message:`sessionStorage has ${sessionStorage.length} item(s) but not allowed`})}catch{}return{compliant:a.length===0,violations:a,auditedAt:Date.now(),policy:t.effectiveMode}}const sl=s.createContext(null);function ol(){const t=s.useContext(sl);if(t)return t;const a=new tl(Ft);return{policy:Ft,canUseCookies:!1,canUseLocalStorage:!1,canUseSessionStorage:!1,canPersist:!1,mode:"traceless",requiresConsentBanner:!1,badgeInfo:nl(Ft),setUserPreference:()=>{},generateReport:()=>al(Ft,"default"),runAudit:()=>il(Ft),refreshPolicy:async()=>{},getStorageAdapter:()=>a,isLoading:!1,error:null}}function bn(t="nice2dev"){const{getStorageAdapter:a}=ol();return s.useMemo(()=>a(t),[a,t])}const xn={"colors.primary":"--color-primary","colors.primaryHover":"--color-primary-hover","colors.success":"--color-success","colors.warning":"--color-warning","colors.error":"--color-error","colors.info":"--color-info","colors.accent":"--color-accent","colors.accentHover":"--color-accent-hover","colors.link":"--color-link","colors.linkHover":"--color-link-hover","colors.focus":"--color-focus","colors.overlay":"--color-overlay","colors.surface":"--color-surface","colors.surfaceHover":"--color-surface-hover","colors.disabled":"--color-disabled","colors.disabledText":"--color-disabled-text","backgrounds.primary":"--bg-primary","backgrounds.secondary":"--bg-secondary","backgrounds.tertiary":"--bg-tertiary","backgrounds.hover":"--hover-bg","backgrounds.elevated":"--bg-elevated","backgrounds.inset":"--bg-inset","backgrounds.canvas":"--bg-canvas","text.primary":"--text-primary","text.secondary":"--text-secondary","text.muted":"--text-muted","text.inverse":"--text-inverse","text.onPrimary":"--text-on-primary","text.onAccent":"--text-on-accent","borders.color":"--border-color","borders.radiusSm":"--nice-radius-sm","borders.radiusMd":"--nice-radius-md","borders.radiusLg":"--nice-radius-lg","borders.radiusXl":"--nice-radius-xl","borders.radiusFull":"--nice-radius-full","borders.width":"--border-width","borders.focusColor":"--border-focus-color","borders.divider":"--border-divider","shadows.sm":"--shadow-sm","shadows.md":"--shadow-md","shadows.lg":"--shadow-lg","shadows.xl":"--shadow-xl","shadows.inner":"--shadow-inner","shadows.glow":"--shadow-glow","spacing.space1":"--nice-space-1","spacing.space2":"--nice-space-2","spacing.space3":"--nice-space-3","spacing.space4":"--nice-space-4","spacing.space5":"--nice-space-5","spacing.space6":"--nice-space-6","spacing.space8":"--nice-space-8","spacing.space10":"--nice-space-10","spacing.space12":"--nice-space-12","spacing.space16":"--nice-space-16","typography.fontFamily":"--nice-font-family","typography.fontSizeXs":"--nice-font-size-xs","typography.fontSizeSm":"--nice-font-size-sm","typography.fontSizeMd":"--nice-font-size-md","typography.fontSizeLg":"--nice-font-size-lg","typography.fontSizeXl":"--nice-font-size-xl","typography.fontSize2xl":"--nice-font-size-2xl","typography.fontSize3xl":"--nice-font-size-3xl","typography.fontWeightNormal":"--nice-font-weight-normal","typography.fontWeightMedium":"--nice-font-weight-medium","typography.fontWeightSemibold":"--nice-font-weight-semibold","typography.fontWeightBold":"--nice-font-weight-bold","typography.lineHeight":"--nice-line-height","typography.headingFontFamily":"--nice-heading-font-family","typography.monoFontFamily":"--nice-mono-font-family","typography.letterSpacing":"--nice-letter-spacing","typography.headingLetterSpacing":"--nice-heading-letter-spacing","transitions.fast":"--nice-transition-fast","transitions.normal":"--nice-transition","transitions.slow":"--nice-transition-slow"};function ll(t,a){return a.split(".").reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},t)}function Pa(t){const a={};for(const[r,n]of Object.entries(xn)){const i=ll(t,r);i!==void 0&&(a[n]=String(i))}return a}function cl(t,a){const r=document.documentElement,n=Pa(t);for(const[i,o]of Object.entries(n))r.style.setProperty(i,o);ul(t.backgroundImage,r),t.darkMode&&(r.dataset.ntdColorScheme=t.darkMode)}const dl={dots:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="currentColor" opacity="0.15"/></svg>',grid:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M20 0H0v20" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',diagonal:'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0" stroke="currentColor" stroke-opacity="0.08"/></svg>',"cross-hatch":'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0M-1 1L1 -1M9 11L11 9" stroke="currentColor" stroke-opacity="0.06"/></svg>',waves:'<svg width="40" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6c5 0 5-6 10-6s5 6 10 6 5-6 10-6 5 6 10 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',hexagons:'<svg width="28" height="49" xmlns="http://www.w3.org/2000/svg"><path d="M14 0l14 8.5v16L14 33 0 24.5v-16z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',triangles:'<svg width="20" height="17" xmlns="http://www.w3.org/2000/svg"><path d="M0 17L10 0l10 17z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',circles:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="6" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',zigzag:'<svg width="20" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6l5-6 5 6 5-6 5 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',noise:'<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency=".9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#n)"/></svg>'};function ul(t,a){if(a.style.removeProperty("--ntd-bg-image"),a.style.removeProperty("--ntd-bg-image-size"),a.style.removeProperty("--ntd-bg-image-position"),a.style.removeProperty("--ntd-bg-image-attachment"),a.style.removeProperty("--ntd-bg-image-repeat"),a.style.removeProperty("--ntd-bg-image-opacity"),a.style.removeProperty("--ntd-bg-image-blend"),!(!t||t.type==="none")){if(t.type==="gradient"&&t.gradient)a.style.setProperty("--ntd-bg-image",t.gradient);else if(t.type==="image"&&t.imageUrl)a.style.setProperty("--ntd-bg-image",`url("${t.imageUrl}")`),t.imageSize&&a.style.setProperty("--ntd-bg-image-size",t.imageSize),t.imagePosition&&a.style.setProperty("--ntd-bg-image-position",t.imagePosition),t.imageAttachment&&a.style.setProperty("--ntd-bg-image-attachment",t.imageAttachment),t.imageRepeat&&a.style.setProperty("--ntd-bg-image-repeat",t.imageRepeat);else if(t.type==="pattern"&&t.pattern){const r=dl[t.pattern];if(r){const n=`url("data:image/svg+xml,${encodeURIComponent(r)}")`;a.style.setProperty("--ntd-bg-image",n),a.style.setProperty("--ntd-bg-image-repeat","repeat")}}t.opacity!==void 0&&a.style.setProperty("--ntd-bg-image-opacity",String(t.opacity)),t.blendMode&&a.style.setProperty("--ntd-bg-image-blend",t.blendMode)}}function pl(t){const a=t??document.documentElement;for(const r of Object.values(xn))a.style.removeProperty(r);for(const r of["--ntd-bg-image","--ntd-bg-image-size","--ntd-bg-image-position","--ntd-bg-image-attachment","--ntd-bg-image-repeat","--ntd-bg-image-opacity","--ntd-bg-image-blend"])a.style.removeProperty(r);delete a.dataset.ntdColorScheme}function ml(t){return JSON.stringify(t,null,2)}function hl(t){const a=JSON.parse(t);if(!a||typeof a!="object"||!a.name||!a.colors||!a.backgrounds)throw new Error("Invalid theme format: missing required fields (name, colors, backgrounds)");return a}const fl=s.createContext(null);/**
|
|
57
|
+
* @file themeVariants.ts
|
|
58
|
+
* @description Extended theme variants - radius, shadows, fills, gradients, effects
|
|
59
|
+
*
|
|
60
|
+
* Allows fine-grained customization of theme appearance
|
|
61
|
+
*
|
|
62
|
+
* @version 1.0.0
|
|
63
|
+
* @since 2026-03
|
|
64
|
+
* @license MIT
|
|
65
|
+
*/const gl={none:{xs:"0",sm:"0",md:"0",lg:"0",xl:"0",full:"0"},sm:{xs:"2px",sm:"3px",md:"4px",lg:"6px",xl:"8px",full:"9999px"},md:{xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px",full:"9999px"},lg:{xs:"6px",sm:"10px",md:"14px",lg:"20px",xl:"28px",full:"9999px"},xl:{xs:"10px",sm:"16px",md:"24px",lg:"32px",xl:"48px",full:"9999px"},"2xl":{xs:"16px",sm:"24px",md:"32px",lg:"48px",xl:"64px",full:"9999px"},full:{xs:"9999px",sm:"9999px",md:"9999px",lg:"9999px",xl:"9999px",full:"9999px"}},yl={none:"none",subtle:"0 1px 2px 0 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)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.05)",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.4))",glow:"0 0 20px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))"},bl={none:"none",subtle:"0 1px 2px 0 rgba(0, 0, 0, 0.2)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.3)",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))",glow:"0 0 30px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.6))"},xl={compact:{paddingX:"8px",paddingY:"4px",gap:"4px",fontSize:"13px",lineHeight:"1.3",inputHeight:"28px",buttonHeight:"28px"},normal:{paddingX:"12px",paddingY:"8px",gap:"8px",fontSize:"14px",lineHeight:"1.5",inputHeight:"36px",buttonHeight:"36px"},comfortable:{paddingX:"16px",paddingY:"12px",gap:"12px",fontSize:"15px",lineHeight:"1.6",inputHeight:"44px",buttonHeight:"44px"},spacious:{paddingX:"24px",paddingY:"16px",gap:"16px",fontSize:"16px",lineHeight:"1.7",inputHeight:"52px",buttonHeight:"52px"}},vl={none:{duration:"0ms",easing:"linear",hoverScale:"1",clickScale:"1",enterAnimation:"none",exitAnimation:"none"},subtle:{duration:"150ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.01",clickScale:"0.99",enterAnimation:"ntd-fade-in 150ms ease-out",exitAnimation:"ntd-fade-out 100ms ease-in"},normal:{duration:"200ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.02",clickScale:"0.98",enterAnimation:"ntd-slide-up 200ms ease-out",exitAnimation:"ntd-slide-down 150ms ease-in"},playful:{duration:"300ms",easing:"cubic-bezier(0.34, 1.56, 0.64, 1)",hoverScale:"1.05",clickScale:"0.95",enterAnimation:"ntd-bounce-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",exitAnimation:"ntd-bounce-out 200ms ease-in"},dramatic:{duration:"400ms",easing:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",hoverScale:"1.08",clickScale:"0.92",enterAnimation:"ntd-zoom-in 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55)",exitAnimation:"ntd-zoom-out 250ms ease-in"}};function kl(t,a){const r={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(t){case"flat":return{...r,background:a,boxShadow:"none",border:"none"};case"raised":return{...r,background:a,boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:"none"};case"outlined":return{...r,background:"transparent",border:`2px solid ${a}`,color:a};case"ghost":return{...r,background:"transparent",border:"none",color:a};case"soft":return{...r,background:`${a}20`,border:"none",color:a};case"gradient":return{...r,background:`linear-gradient(135deg, ${a} 0%, ${Ma(a,-20)} 100%)`,border:"none",boxShadow:`0 4px 14px ${a}40`};case"3d":return{...r,background:a,border:"none",boxShadow:`0 4px 0 ${Ma(a,-30)}, 0 6px 10px rgba(0, 0, 0, 0.2)`,transform:"translateY(-2px)"};case"neumorphic":return{...r,background:"var(--ntd-bg-surface)",border:"none",boxShadow:"5px 5px 10px rgba(0, 0, 0, 0.1), -5px -5px 10px rgba(255, 255, 255, 0.8)",color:a};case"pill":return{...r,background:a,border:"none",borderRadius:"9999px",paddingLeft:"24px",paddingRight:"24px"};case"link":return{...r,background:"transparent",border:"none",color:a,textDecoration:"underline",padding:"0"};case"brutal":return{...r,background:a,border:"3px solid #000",boxShadow:"4px 4px 0 #000",borderRadius:"0"};default:return r}}function wl(t){const a={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(t){case"bordered":return{...a,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"var(--ntd-radius-md, 8px)"};case"filled":return{...a,background:"var(--ntd-bg-input-filled, #f3f4f6)",border:"2px solid transparent",borderRadius:"var(--ntd-radius-md, 8px)"};case"underlined":return{...a,background:"transparent",border:"none",borderBottom:"2px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"0",paddingLeft:"0",paddingRight:"0"};case"floating":return{...a,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"var(--ntd-radius-md, 8px)",paddingTop:"20px"};case"soft":return{...a,background:"var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.1))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)"};case"neumorphic":return{...a,background:"var(--ntd-bg-surface)",border:"none",borderRadius:"var(--ntd-radius-md, 8px)",boxShadow:"inset 3px 3px 6px rgba(0, 0, 0, 0.1), inset -3px -3px 6px rgba(255, 255, 255, 0.8)"};case"pill":return{...a,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"9999px",paddingLeft:"20px",paddingRight:"20px"};case"flush":return{...a,background:"transparent",border:"none",borderRadius:"0",padding:"0",outline:"none"};default:return a}}function _l(t){const a={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(t){case"flat":return{...a,background:"var(--ntd-bg-surface, #fff)",border:"none",boxShadow:"none"};case"elevated":return{...a,background:"var(--ntd-bg-surface, #fff)",border:"none",boxShadow:"var(--ntd-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1))"};case"bordered":return{...a,background:"var(--ntd-bg-surface, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",boxShadow:"none"};case"glass":return{...a,background:"rgba(255, 255, 255, 0.1)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid rgba(255, 255, 255, 0.2)",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.1)"};case"gradient":return{...a,background:"linear-gradient(135deg, var(--ntd-bg-surface) 0%, var(--ntd-bg-elevated) 100%)",border:"none",boxShadow:"var(--ntd-shadow-md)"};case"neumorphic":return{...a,background:"var(--ntd-bg-surface)",border:"none",boxShadow:"8px 8px 16px rgba(0, 0, 0, 0.1), -8px -8px 16px rgba(255, 255, 255, 0.8)"};case"outlined":return{...a,background:"transparent",border:"2px solid var(--ntd-border-color, #e5e7eb)",boxShadow:"none"};case"paper":return{...a,background:"#fffef9",border:"none",boxShadow:"2px 3px 8px rgba(0,0,0,0.06)",borderRadius:"2px"};default:return a}}function jl(t,a){const r={display:"inline-flex",alignItems:"center",fontSize:"0.75rem",fontWeight:"600",lineHeight:"1"};switch(t){case"solid":return{...r,background:a,color:"#fff",padding:"2px 8px",borderRadius:"4px"};case"soft":return{...r,background:`${a}20`,color:a,padding:"2px 8px",borderRadius:"4px"};case"outlined":return{...r,background:"transparent",border:`1px solid ${a}`,color:a,padding:"2px 8px",borderRadius:"4px"};case"dot":return{...r,background:a,width:"8px",height:"8px",borderRadius:"50%",padding:"0"};case"pill":return{...r,background:a,color:"#fff",padding:"2px 12px",borderRadius:"9999px"};case"gradient":return{...r,background:`linear-gradient(135deg, ${a}, ${Ma(a,-20)})`,color:"#fff",padding:"2px 8px",borderRadius:"4px"};default:return r}}function Cl(t,a){switch(t){case"underline":return{borderBottom:`2px solid ${a}`,background:"transparent",color:a};case"pills":return{background:a,color:"#fff",borderRadius:"9999px",padding:"6px 16px"};case"enclosed":return{background:"var(--ntd-bg-surface,#fff)",border:"1px solid var(--ntd-border-color,#e5e7eb)",borderBottom:"none",borderRadius:"8px 8px 0 0"};case"soft":return{background:`${a}15`,color:a,borderRadius:"6px",padding:"6px 16px"};case"lifted":return{background:"var(--ntd-bg-surface,#fff)",boxShadow:"0 -2px 8px rgba(0,0,0,0.06)",borderRadius:"8px 8px 0 0",transform:"translateY(-2px)"};case"bordered":return{border:`2px solid ${a}`,borderBottom:"none",background:"transparent",borderRadius:"8px 8px 0 0"};default:return{}}}function Sl(t){switch(t){case"default":return{borderRadius:"12px",width:"44px",height:"24px"};case"ios":return{borderRadius:"16px",width:"51px",height:"31px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"};case"flat":return{borderRadius:"4px",width:"40px",height:"22px"};case"pill":return{borderRadius:"9999px",width:"48px",height:"24px"};case"square":return{borderRadius:"0",width:"40px",height:"22px"};default:return{}}}function Nl(t){switch(t){case"dark":return{background:"#1f2937",color:"#f9fafb",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"};case"light":return{background:"#fff",color:"#374151",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",border:"1px solid #e5e7eb"};case"primary":return{background:"var(--color-primary,#6366f1)",color:"#fff",borderRadius:"6px",padding:"6px 12px"};case"glass":return{background:"rgba(255,255,255,0.15)",backdropFilter:"blur(12px)",color:"#fff",borderRadius:"8px",padding:"8px 14px"};case"bordered":return{background:"#fff",color:"#374151",borderRadius:"6px",padding:"6px 12px",border:"2px solid var(--color-primary,#6366f1)"};default:return{}}}function Ml(t){switch(t){case"default":return{borderCollapse:"collapse"};case"striped":return{borderCollapse:"collapse"};case"bordered":return{border:"1px solid var(--ntd-border-color,#e5e7eb)",borderCollapse:"collapse"};case"compact":return{borderCollapse:"collapse",fontSize:"0.8125rem"};case"hoverable":return{borderCollapse:"collapse"};case"minimal":return{borderCollapse:"collapse",borderBottom:"1px solid var(--ntd-border-color,#e5e7eb)"};default:return{}}}const sa={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"},$l={minimal:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},rounded:{radius:"xl",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"comfortable"},sharp:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"subtle",density:"compact"},glass:{radius:"lg",shadow:"none",fill:"glass",buttonStyle:"ghost",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"normal"},neumorphic:{radius:"lg",shadow:"none",fill:"solid",buttonStyle:"neumorphic",inputStyle:"neumorphic",cardStyle:"neumorphic",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"default",animation:"subtle",density:"comfortable"},playful:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},enterprise:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},modern3d:{radius:"lg",shadow:"xl",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},brutalist:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},luxe:{radius:"sm",shadow:"lg",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"floating",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"underline",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"normal",density:"comfortable"},pill:{radius:"full",shadow:"md",fill:"solid",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},flat:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},editorial:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},dashboard:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},softCloud:{radius:"xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"normal",density:"comfortable"},cosmic:{radius:"lg",shadow:"glow",fill:"mesh",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},corporate:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"compact"},bank:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},government:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"flat",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"normal"},military:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},legal:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"none",density:"comfortable"},medical:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"striped",animation:"subtle",density:"normal"},swiss:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},scandinavian:{radius:"lg",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},bauhaus:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},notebook:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},terminal:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},hacker:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"compact"},retro8bit:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},vapor:{radius:"lg",shadow:"glow",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"playful",density:"comfortable"},synthwave:{radius:"md",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"normal"},cyberpunk:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"compact"},steampunk:{radius:"sm",shadow:"inner",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"normal"},origami:{radius:"none",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"default",animation:"normal",density:"normal"},watercolor:{radius:"2xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},neon:{radius:"md",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},candy:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},bubblegum:{radius:"full",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},cartoon:{radius:"xl",shadow:"colored",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"pill",tooltipStyle:"bordered",tableStyle:"bordered",animation:"playful",density:"comfortable"},kawaii:{radius:"full",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"dramatic",density:"spacious"},circus:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"},paper:{radius:"sm",shadow:"md",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},zen:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},monochrome:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},windows95:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},material:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},fluent:{radius:"md",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"subtle",density:"normal"},cupertino:{radius:"xl",shadow:"md",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},ant:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"subtle",density:"normal"},bootstrap:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"normal"},chakra:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},notion:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"flush",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},linear:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"subtle",density:"compact"},vercel:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"minimal",animation:"subtle",density:"normal"},gaming:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"gradient",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},kiddo:{radius:"2xl",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},disco:{radius:"full",shadow:"glow",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},clown:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"brutal",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"}};function zl(t){const a=gl[t.radius],r=t.shadow,n=xl[t.density],i=vl[t.animation],o=[":root {"];for(const[c,l]of Object.entries(a))o.push(` --ntd-radius-${c}: ${l};`);o.push(` --ntd-shadow: ${yl[r]};`),o.push(` --ntd-shadow-dark: ${bl[r]};`);for(const[c,l]of Object.entries(n)){const d=c.replace(/([A-Z])/g,"-$1").toLowerCase();o.push(` --ntd-${d}: ${l};`)}for(const[c,l]of Object.entries(i)){const d=c.replace(/([A-Z])/g,"-$1").toLowerCase();o.push(` --ntd-animation-${d}: ${l};`)}return t.backgroundImage&&o.push(` --ntd-bg-image: url('${t.backgroundImage}');`),t.backgroundOverlay&&o.push(` --ntd-bg-overlay: ${t.backgroundOverlay};`),o.push("}"),o.join(`
|
|
66
|
+
`)}function El(t,a=document.documentElement){const r=zl(t);let n=document.getElementById("ntd-variant-styles");n||(n=document.createElement("style"),n.id="ntd-variant-styles",document.head.appendChild(n)),n.textContent=r,a.dataset.ntdRadius=t.radius,a.dataset.ntdShadow=t.shadow,a.dataset.ntdFill=t.fill,a.dataset.ntdButton=t.buttonStyle,a.dataset.ntdInput=t.inputStyle,a.dataset.ntdCard=t.cardStyle,a.dataset.ntdAnimation=t.animation,a.dataset.ntdDensity=t.density,t.badgeStyle&&(a.dataset.ntdBadge=t.badgeStyle),t.tabStyle&&(a.dataset.ntdTab=t.tabStyle),t.toggleStyle&&(a.dataset.ntdToggle=t.toggleStyle),t.tooltipStyle&&(a.dataset.ntdTooltip=t.tooltipStyle),t.modalStyle&&(a.dataset.ntdModal=t.modalStyle),t.tableStyle&&(a.dataset.ntdTable=t.tableStyle),t.menuStyle&&(a.dataset.ntdMenu=t.menuStyle)}function Ma(t,a){if(t.startsWith("#")){const r=t.slice(1),n=parseInt(r,16),i=Math.max(0,Math.min(255,(n>>16&255)+a)),o=Math.max(0,Math.min(255,(n>>8&255)+a)),c=Math.max(0,Math.min(255,(n&255)+a));return`#${(i<<16|o<<8|c).toString(16).padStart(6,"0")}`}return t}function oa(t){return t==="default"?sa:$l[t]??sa}const vn=s.createContext({displayStyle:"default",variantConfig:sa,setDisplayStyle:()=>{}});function kn(t){const a=s.useContext(vn),r=t??a.displayStyle??"default",n=oa(r);return{style:r,config:n}}function gt(t,a,r="var(--color-primary, #6366f1)"){const{config:n}=kn(a);return Al(t,n,r)}function it(t,a){const{config:r}=kn(a);switch(t){case"button":return r.buttonStyle;case"input":return r.inputStyle;case"card":return r.cardStyle;case"badge":return r.badgeStyle??"solid";case"tab":return r.tabStyle??"underline";case"toggle":return r.toggleStyle??"default";case"tooltip":return r.tooltipStyle??"dark";case"modal":return r.modalStyle??"default";case"table":return r.tableStyle??"default";case"menu":return r.menuStyle??"default";default:return"default"}}function Al(t,a,r="#6366f1"){switch(t){case"button":return kl(a.buttonStyle,r);case"input":return wl(a.inputStyle);case"card":return _l(a.cardStyle);case"badge":return jl(a.badgeStyle??"solid",r);case"tab":return Cl(a.tabStyle??"underline",r);case"toggle":return Sl(a.toggleStyle??"default");case"tooltip":return Nl(a.tooltipStyle??"dark");case"table":return Ml(a.tableStyle??"default");case"menu":return{};case"modal":return{};default:return{}}}function Dl(t){const a=oa(t);return{"data-ntd-display-style":t,"data-ntd-density":a.density,"data-ntd-animation":a.animation,"data-ntd-radius":a.radius,"data-ntd-button":a.buttonStyle,"data-ntd-input":a.inputStyle,"data-ntd-card":a.cardStyle}}function la(t){if(!t)return"";let a=t;return a=a.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),a=a.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""),a=a.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi,'$1=""'),a=a.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi,'$1=""'),a=a.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi,""),a}const Vt={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Kt={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},Yt={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},La=t=>({color:t,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),wn={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)"},Tl={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 Se(t,a,r,n,i){return{name:t,colors:a,backgrounds:r,text:n,borders:La(i),shadows:wn,spacing:Vt,typography:Kt,transitions:Yt}}function Ge(t,a,r,n,i){return{name:t,colors:a,backgrounds:r,text:n,borders:La(i),shadows:Tl,spacing:Vt,typography:Kt,transitions:Yt}}const Rl=Se("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"),Fl=Se("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"),Il=Se("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"),Pl=Se("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"),Ll=Se("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"),Ol=Se("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"),Bl=Se("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"),Wl=Se("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"),Hl=Se("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"),ql=Se("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"),Vl=Se("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"),Kl=Se("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"),Yl=Se("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"),Gl=Se("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"),Ul=Se("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"),Zl=Se("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"),Xl=Se("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"),Jl=Se("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"),Ql=Se("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"),ec=Se("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"),tc=Se("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"),ac=Se("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"),rc=Ge("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"),nc=Ge("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"),ic=Ge("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"),sc=Ge("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"),oc=Ge("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"),lc=Ge("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"),cc=Ge("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"),dc=Ge("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"),uc=Ge("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"),pc=Ge("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"),mc=Se("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"),hc=Se("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"),fc=Se("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"),gc=Se("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"),yc=Se("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"),bc=Se("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"),xc=Se("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"),vc=Se("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"),kc=Se("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"),wc=Se("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"),_c=Se("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"),jc=Se("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"),Cc=Se("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"),Sc=Se("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"),Nc=Se("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"),Mc=Se("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"),$c=Se("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"),zc=Se("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"),Ec=Se("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"),Ac=Se("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"),Dc=Se("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"),Tc=Se("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"),Rc=Se("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"),Fc=Se("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"),Ic=Se("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"),Pc=Se("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"),Lc=Se("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"),Oc=Ge("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"),Bc=Se("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"),Wc=Ge("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"),Hc=Ge("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"),qc=Ge("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"),Vc=Ge("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"),Kc=Se("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"),Yc=Ge("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"),Gc=Se("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"),Uc=Se("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"),Zc=Ge("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"),Xc=Ge("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"),Jc=Ge("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"),Qc=Se("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"),ed=Ge("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"),td=Se("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"),ad=Se("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"),rd=Se("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"),nd=Se("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"),id=Se("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"),sd=Se("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"),od=Se("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"),ld=Se("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"),cd=Se("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"),dd=Se("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"),ud=Se("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"),pd=Se("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"),md=Se("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"),hd=Se("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"),fd=Ge("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"),gd=Se("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"),yd=Se("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"),bd={name:"Large Text",colors:{primary:"#2563eb",primaryHover:"#1d4ed8",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8"},borders:La("#e2e8f0"),shadows:wn,spacing:{space1:"6px",space2:"12px",space3:"16px",space4:"20px",space5:"24px",space6:"32px",space8:"40px"},typography:{fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.875rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6},transitions:Yt},xd={name:"Glassmorphism",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},backgrounds:{primary:"rgba(255,255,255,0.7)",secondary:"rgba(255,255,255,0.5)",tertiary:"rgba(255,255,255,0.3)",hover:"rgba(255,255,255,0.5)"},text:{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},borders:{color:"rgba(255,255,255,0.3)",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,0,0,0.04)",md:"0 4px 16px rgba(0,0,0,0.08)",lg:"0 8px 32px rgba(0,0,0,0.12)",xl:"0 16px 48px rgba(0,0,0,0.16)"},spacing:Vt,typography:Kt,transitions:{fast:"150ms ease",normal:"250ms ease",slow:"350ms ease"}},vd={name:"Neumorphism Light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},backgrounds:{primary:"#e0e5ec",secondary:"#d5dae2",tertiary:"#ccd1d9",hover:"#d5dae2"},text:{primary:"#2d3748",secondary:"#4a5568",muted:"#718096"},borders:{color:"#d0d5dd",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #b8bec7, -3px -3px 6px #ffffff",md:"5px 5px 10px #b8bec7, -5px -5px 10px #ffffff",lg:"8px 8px 16px #b8bec7, -8px -8px 16px #ffffff",xl:"12px 12px 24px #b8bec7, -12px -12px 24px #ffffff"},spacing:Vt,typography:Kt,transitions:Yt},kd={name:"Neumorphism Dark",colors:{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},backgrounds:{primary:"#2d3748",secondary:"#283141",tertiary:"#232b3a",hover:"#283141"},text:{primary:"#e2e8f0",secondary:"#a0aec0",muted:"#718096"},borders:{color:"#3a4556",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #1a202c, -3px -3px 6px #404d64",md:"5px 5px 10px #1a202c, -5px -5px 10px #404d64",lg:"8px 8px 16px #1a202c, -8px -8px 16px #404d64",xl:"12px 12px 24px #1a202c, -12px -12px 24px #404d64"},spacing:Vt,typography:Kt,transitions:Yt},wd=Se("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"),_d=Ge("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"),jd=Ge("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"),Cd=Se("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"),Sd=Se("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"),Nd=[Rl,Fl,Il,Pl,Ll,Ol,Bl,Wl,Hl,ql,Vl,Kl,Yl,Gl,Ul,Zl,Xl,Jl,Ql,ec,tc,ac,rc,nc,ic,sc,oc,lc,cc,dc,uc,pc,mc,hc,fc,gc,yc,bc,xc,vc,kc,wc,_c,jc,Cc,Sc,Nc,Mc,$c,zc,Ec,Ac,Dc,Tc,Rc,Fc,Ic,Pc,Lc,Oc,Bc,Wc,Hc,qc,Vc,Kc,Yc,Gc,Uc,Zc,Xc,Jc,Qc,ed,td,ad,rd,nd,id,sd,od,ld,cd,dd,ud,pd,md,hd,fd,gd,yd,bd,xd,vd,kd,wd,_d,jd,Cd,Sd],At={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},ma={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},Gt={color:"#e2e8f0",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},Ut={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},_n={name:"Light",colors:{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#f8fafc"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:Gt,shadows:{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)"},spacing:At,typography:ma,transitions:Ut},Md={name:"Dark",colors:{primary:"#3b82f6",primaryHover:"#60a5fa",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4",surface:"#141414",surfaceHover:"#1e1e1e"},backgrounds:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1e1e1e",hover:"#1a1a1a",elevated:"#141414",inset:"#0a0a0a",canvas:"#0a0a0a"},text:{primary:"#ffffff",secondary:"#a1a1a1",muted:"#6b6b6b",inverse:"#0f172a"},borders:{...Gt,color:"#2a2a2a"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 6px -1px rgba(0,0,0,0.6)",lg:"0 10px 15px -3px rgba(0,0,0,0.6)",xl:"0 20px 25px -5px rgba(0,0,0,0.6)"},spacing:At,typography:ma,transitions:Ut},$d={name:"Blue",colors:{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#eff6ff",surfaceHover:"#dbeafe"},backgrounds:{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe",elevated:"#ffffff",inset:"#dbeafe",canvas:"#eff6ff"},text:{primary:"#1e3a5f",secondary:"#3b628a",muted:"#7da0c4",inverse:"#ffffff"},borders:{...Gt,color:"#93c5fd"},shadows:{sm:"0 1px 2px rgba(29,78,216,0.08)",md:"0 4px 6px -1px rgba(29,78,216,0.12)",lg:"0 10px 15px -3px rgba(29,78,216,0.15)",xl:"0 20px 25px -5px rgba(29,78,216,0.18)"},spacing:At,typography:ma,transitions:Ut},zd={name:"High Contrast",colors:{primary:"#0000ff",primaryHover:"#0000cc",success:"#008000",warning:"#ff8c00",error:"#ff0000",info:"#008b8b",surface:"#ffffff",surfaceHover:"#f0f0f0"},backgrounds:{primary:"#ffffff",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0",elevated:"#ffffff",inset:"#e0e0e0",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#4d4d4d",inverse:"#ffffff"},borders:{...Gt,color:"#000000"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.15)",md:"0 4px 6px rgba(0,0,0,0.2)",lg:"0 10px 15px rgba(0,0,0,0.25)",xl:"0 20px 25px rgba(0,0,0,0.3)"},spacing:At,typography:ma,transitions:Ut},Ed={name:"Material",colors:{primary:"#6750a4",primaryHover:"#4f378b",success:"#386a20",warning:"#7c5800",error:"#ba1a1a",info:"#00629e",surface:"#fffbfe",surfaceHover:"#f6edff"},backgrounds:{primary:"#fffbfe",secondary:"#f6edff",tertiary:"#ece6f0",hover:"#eaddff",elevated:"#ffffff",inset:"#ece6f0",canvas:"#fffbfe"},text:{primary:"#1c1b1f",secondary:"#49454f",muted:"#79747e",inverse:"#ffffff"},borders:{...Gt,color:"#cac4d0",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"28px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15)",md:"0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15)",lg:"0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3)",xl:"0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3)"},spacing:At,typography:{fontFamily:"'Roboto', 'Noto Sans', system-ui, sans-serif",fontSizeXs:"0.6875rem",fontSizeSm:"0.75rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:{fast:"100ms cubic-bezier(0.2,0,0,1)",normal:"200ms cubic-bezier(0.2,0,0,1)",slow:"300ms cubic-bezier(0.2,0,0,1)"}},Ad={name:"Bootstrap",colors:{primary:"#0d6efd",primaryHover:"#0b5ed7",success:"#198754",warning:"#ffc107",error:"#dc3545",info:"#0dcaf0",surface:"#ffffff",surfaceHover:"#f8f9fa"},backgrounds:{primary:"#ffffff",secondary:"#f8f9fa",tertiary:"#e9ecef",hover:"#e9ecef",elevated:"#ffffff",inset:"#e9ecef",canvas:"#f8f9fa"},text:{primary:"#212529",secondary:"#6c757d",muted:"#adb5bd",inverse:"#ffffff"},borders:{color:"#dee2e6",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"16px",radiusFull:"50rem"},shadows:{sm:"0 0.125rem 0.25rem rgba(0,0,0,0.075)",md:"0 0.5rem 1rem rgba(0,0,0,0.15)",lg:"0 1rem 3rem rgba(0,0,0,0.175)",xl:"0 1rem 3rem rgba(0,0,0,0.25)"},spacing:At,typography:{fontFamily:"system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:Ut},Dd={name:"Fluent",colors:{primary:"#0078d4",primaryHover:"#106ebe",success:"#107c10",warning:"#fce100",error:"#d13438",info:"#00b7c3",surface:"#ffffff",surfaceHover:"#faf9f8"},backgrounds:{primary:"#ffffff",secondary:"#faf9f8",tertiary:"#f3f2f1",hover:"#edebe9",elevated:"#ffffff",inset:"#f3f2f1",canvas:"#faf9f8"},text:{primary:"#323130",secondary:"#605e5c",muted:"#a19f9d",inverse:"#ffffff"},borders:{color:"#e1dfdd",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108)",md:"0 3.2px 7.2px 0 rgba(0,0,0,0.132), 0 0.6px 1.8px 0 rgba(0,0,0,0.108)",lg:"0 6.4px 14.4px 0 rgba(0,0,0,0.132), 0 1.2px 3.6px 0 rgba(0,0,0,0.108)",xl:"0 25.6px 57.6px 0 rgba(0,0,0,0.22), 0 4.8px 14.4px 0 rgba(0,0,0,0.18)"},spacing:At,typography:{fontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",fontSizeXs:"10px",fontSizeSm:"12px",fontSizeMd:"14px",fontSizeLg:"16px",fontSizeXl:"20px",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.42857},transitions:{fast:"100ms cubic-bezier(0.1,0.9,0.2,1)",normal:"200ms cubic-bezier(0.1,0.9,0.2,1)",slow:"300ms cubic-bezier(0.1,0.9,0.2,1)"}},Td=[_n,Md,$d,zd,Ed,Ad,Dd,...Nd],jn=({theme:t,darkTheme:a,variantConfig:r,darkMode:n,displayStyle:i,animateTransitions:o=!0,children:c})=>{const l=s.useRef(null),[d,p]=s.useState(t),[h,u]=s.useState(!1),[g,f]=s.useState(i??"default");s.useEffect(()=>{i!==void 0&&f(i)},[i]),s.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)");u(y.matches);const S=k=>u(k.matches);return y.addEventListener("change",S),()=>y.removeEventListener("change",S)},[]);const m=n??t.darkMode??"light",b=m==="dark"||m==="auto"&&h;s.useEffect(()=>{p(b&&a?a:t)},[t,a,b]),s.useEffect(()=>{const y=l.current;if(!y)return;o&&(y.style.transition="background-color 300ms ease, color 300ms ease");const S=Pa(d);for(const[M,_]of Object.entries(S))y.style.setProperty(M,_);y.style.colorScheme=b?"dark":"light",y.dataset.ntdColorScheme=b?"dark":"light";const k=d.backgroundImage;return k&&k.type!=="none"&&k.type==="gradient"&&k.gradient&&y.style.setProperty("--ntd-bg-image",k.gradient),()=>{y&&pl(y)}},[d,b,o]),s.useEffect(()=>{const y=l.current;if(!y)return;const S=r?{...sa,...r}:oa(g);El(S,y);const k=Dl(g);for(const[M,_]of Object.entries(k))y.setAttribute(M,_)},[r,g]);const C=s.useCallback(y=>{p(y)},[]),v=s.useMemo(()=>({theme:d,setTheme:C}),[d,C]),w=s.useMemo(()=>({displayStyle:g,variantConfig:oa(g),setDisplayStyle:f}),[g]);return e.jsx(fl.Provider,{value:v,children:e.jsx(vn.Provider,{value:w,children:e.jsx("div",{ref:l,className:"nice-theme-scope",style:{display:"contents"},children:c})})})};jn.displayName="NiceThemeProvider";const Et=({height:t=200})=>e.jsx("div",{className:"ntd-lazy-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",height:t,background:"var(--ntd-color-surface, #f5f5f5)",borderRadius:"var(--ntd-radius, 8px)",animation:"ntd-pulse 1.5s ease-in-out infinite"},children:e.jsx("div",{className:"ntd-lazy-loading-spinner",style:{width:24,height:24,border:"2px solid var(--ntd-color-border, #ddd)",borderTopColor:"var(--ntd-color-primary, #6366f1)",borderRadius:"50%",animation:"ntd-spin 0.8s linear infinite"}})}),Rd=(t,a)=>e.jsxs("div",{className:"ntd-lazy-error",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,background:"var(--ntd-color-error-bg, #fee2e2)",borderRadius:"var(--ntd-radius, 8px)",color:"var(--ntd-color-error, #dc2626)"},children:[e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),e.jsx("p",{style:{margin:"12px 0 8px",fontWeight:500},children:"Failed to load component"}),e.jsx("p",{style:{margin:0,fontSize:"0.875em",opacity:.8},children:t.message}),e.jsx("button",{onClick:a,style:{marginTop:16,padding:"8px 16px",border:"none",borderRadius:"var(--ntd-radius, 8px)",background:"var(--ntd-color-error, #dc2626)",color:"#fff",cursor:"pointer",fontSize:"0.875em"},children:"Retry"})]});class Fd extends s.Component{constructor(){super(...arguments),this.state={error:null},this.handleRetry=()=>{this.setState({error:null})}}static getDerivedStateFromError(a){return{error:a}}render(){return this.state.error?this.props.fallback(this.state.error,this.handleRetry):this.props.children}}function pt(t,a={}){const{fallback:r=e.jsx(Et,{}),preloadOnMount:n=!1,preloadOnHover:i=!1,preloadAfterIdle:o,minLoadingTime:c=0,ssrFallback:l,errorFallback:d=Rd,displayName:p}=a;let h=null,u=!1;const g=async()=>{if(h)return h;const v=Date.now();h=t();const w=await h;if(c>0){const y=Date.now()-v;y<c&&await new Promise(S=>setTimeout(S,c-y))}return u=!0,w},f=s.lazy(g),m=v=>{const w=s.useRef(null);return s.useEffect(()=>{n&&!u&&g()},[]),s.useEffect(()=>{if(o&&!u){const y="requestIdleCallback"in window?window.requestIdleCallback(()=>g(),{timeout:o}):setTimeout(()=>g(),o);return()=>{"cancelIdleCallback"in window?window.cancelIdleCallback(y):clearTimeout(y)}}},[]),s.useEffect(()=>{if(!i||u)return;const y=w.current;if(!y)return;const S=()=>{u||g()};return y.addEventListener("mouseenter",S,{once:!0}),()=>y.removeEventListener("mouseenter",S)},[]),typeof window>"u"&&l?e.jsx(e.Fragment,{children:l}):e.jsx("div",{ref:w,className:"ntd-lazy-wrapper",children:e.jsx(Fd,{fallback:d,children:e.jsx(s.Suspense,{fallback:r,children:e.jsx(f,{...v})})})})},b=async()=>{u||await g()},C=m;return C.preload=b,C.displayName=p||"LazyComponent",C}const Mr=()=>e.jsx(Et,{height:400}),$r=()=>e.jsx(Et,{height:300}),zr=()=>e.jsx(Et,{height:500}),Er=()=>e.jsx(Et,{height:600}),mt=t=>t;pt(mt(()=>Promise.resolve().then(()=>Jr).then(t=>t.ar).then(t=>({default:t.NiceCodeEditor}))),{fallback:e.jsx(Mr,{}),preloadOnHover:!0,displayName:"LazyCodeEditor"}),pt(mt(()=>Promise.resolve().then(()=>Jr).then(t=>t.aq).then(t=>({default:t.NiceHtmlEditor}))),{fallback:e.jsx(Mr,{}),preloadOnHover:!0,displayName:"LazyHtmlEditor"}),pt(mt(()=>Promise.resolve().then(()=>require("./index-CIl98Vbm-Uj4gSRsL.cjs")).then(t=>t.fP).then(t=>({default:t.NiceDocumentViewer}))),{fallback:e.jsx(Et,{height:600}),displayName:"LazyDocumentViewer"}),pt(mt(()=>Promise.resolve().then(()=>xa).then(t=>t.A).then(t=>({default:t.NiceChart}))),{fallback:e.jsx($r,{}),preloadAfterIdle:3e3,displayName:"LazyChart"}),pt(mt(()=>Promise.resolve().then(()=>xa).then(t=>t.D).then(t=>({default:t.NiceVectorMap}))),{fallback:e.jsx(Et,{height:400}),displayName:"LazyVectorMap"}),pt(mt(()=>Promise.resolve().then(()=>xa).then(t=>t.B).then(t=>({default:t.NiceSankey}))),{fallback:e.jsx($r,{}),displayName:"LazySankey"}),pt(mt(()=>Promise.resolve().then(()=>require("./index-CIl98Vbm-Uj4gSRsL.cjs")).then(t=>t.fN).then(t=>({default:t.NiceScheduler}))),{fallback:e.jsx(Er,{}),displayName:"LazyScheduler"}),pt(mt(()=>Promise.resolve().then(()=>require("./index-CIl98Vbm-Uj4gSRsL.cjs")).then(t=>t.fO).then(t=>({default:t.NiceGantt}))),{fallback:e.jsx(Er,{}),displayName:"LazyGantt"}),pt(mt(()=>Promise.resolve().then(()=>require("./NiceSavedQueryPanel-CUAsdOjJ-CSZLnNPf.cjs")).then(t=>t.s).then(t=>({default:t.NicePivotGrid}))),{fallback:e.jsx(zr,{}),displayName:"LazyPivotGrid"}),pt(mt(()=>Promise.resolve().then(()=>require("./NiceSavedQueryPanel-CUAsdOjJ-CSZLnNPf.cjs")).then(t=>t.r).then(t=>({default:t.NiceDataGrid}))),{fallback:e.jsx(zr,{}),preloadAfterIdle:2e3,displayName:"LazyDataGrid"});process.env.NODE_ENV;const Id=process.env.NODE_ENV==="development";let Cn={enabled:Id,slowRenderThreshold:16};const Sn=[],Oa=new Map,Nn=new Map;function Pd(){Sn.length=0,Oa.clear(),Nn.clear()}function Ld(t){const a=Cn.slowRenderThreshold;return Sn.filter(r=>r.actualDuration>a)}function Mt(t){return t<1?`${(t*1e3).toFixed(0)}μs`:t<1e3?`${t.toFixed(2)}ms`:`${(t/1e3).toFixed(2)}s`}function Od(){const t=Array.from(Oa.values()),a=Ld(),r=t.reduce((o,c)=>o+c.renderCount,0),n=t.length>0?t.reduce((o,c)=>o+c.avgRenderTime,0)/t.length:0,i=Array.from(Nn.values());return{stats:t,slowRenders:a,totalRenders:r,avgRenderTime:n,marks:i}}function Bd(){const t=Od();console.group("%c[Nice2Dev Performance Report]","color: #6366f1; font-weight: bold; font-size: 14px"),console.log(`Total renders: ${t.totalRenders}`),console.log(`Average render time: ${Mt(t.avgRenderTime)}`),console.log(`Slow renders: ${t.slowRenders.length}`),console.group("Component Stats"),console.table(t.stats.sort((a,r)=>r.totalRenderTime-a.totalRenderTime).map(a=>({Name:a.componentName,Renders:a.renderCount,"Avg Time":Mt(a.avgRenderTime),"Max Time":Mt(a.maxRenderTime),"Total Time":Mt(a.totalRenderTime),"Slow Renders":a.slowRenderCount}))),console.groupEnd(),t.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(t.slowRenders.slice(-10).map(a=>({Component:a.componentName,Phase:a.phase,Duration:Mt(a.actualDuration),Time:new Date(a.timestamp).toLocaleTimeString()}))),console.groupEnd()),t.marks.length>0&&(console.group("Custom Marks"),console.table(t.marks.filter(a=>a.duration).map(a=>({Name:a.name,Duration:Mt(a.duration)}))),console.groupEnd()),console.groupEnd()}const Wd=s.memo(({position:t="bottom-right",defaultCollapsed:a=!0})=>{const[r,n]=s.useState(a),[i,o]=s.useState([]),[c,l]=s.useState({used:0,total:0});if(s.useEffect(()=>{const p=()=>{const u=Array.from(Oa.values());o(u.sort((f,m)=>m.totalRenderTime-f.totalRenderTime).slice(0,10));const g=window.performance;g.memory&&l({used:g.memory.usedJSHeapSize/1024/1024,total:g.memory.totalJSHeapSize/1024/1024})};p();const h=setInterval(p,2e3);return()=>clearInterval(h)},[]),!Cn.enabled)return null;const d={position:"fixed",zIndex:99999,...t.includes("top")?{top:8}:{bottom:8},...t.includes("left")?{left:8}:{right:8}};return e.jsxs("div",{style:{...d,background:"rgba(0, 0, 0, 0.85)",color:"#fff",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:r?"4px 8px":8,maxWidth:r?"auto":300,maxHeight:r?"auto":400,overflow:"auto"},children:[e.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>n(p=>!p),children:[e.jsx("span",{style:{color:"#22c55e"},children:"●"}),e.jsx("span",{children:"Profiler"}),c.used>0&&e.jsxs("span",{style:{color:c.used>100?"#f59e0b":"#64748b"},children:[c.used.toFixed(0),"MB"]}),e.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:r?"▼":"▲"})]}),!r&&e.jsxs("div",{style:{marginTop:8},children:[e.jsx("div",{style:{borderBottom:"1px solid #333",paddingBottom:4,marginBottom:8},children:e.jsx("strong",{children:"Top Components"})}),i.map(p=>e.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:p.componentName}),e.jsx("span",{style:{color:p.avgRenderTime>16?"#f59e0b":"#22c55e"},children:Mt(p.avgRenderTime)}),e.jsxs("span",{style:{color:"#64748b",minWidth:30,textAlign:"right"},children:["x",p.renderCount]})]},p.componentName)),e.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[e.jsx("button",{onClick:Bd,style:{flex:1,padding:"4px 8px",background:"#333",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:10},children:"Print Report"}),e.jsx("button",{onClick:Pd,style:{flex:1,padding:"4px 8px",background:"#333",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});Wd.displayName="ProfilerOverlay";s.createContext(null);s.createContext(null);const ht=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,displayStyle:g,value:f,defaultValue:m,onChange:b,onBlur:C,onKeyDown:v,placeholder:w,type:y="text",maxLength:S,prefix:k,suffix:M,clearable:_,autoFocus:j,submitOnEnter:z,onSubmit:P,showKeyboardHints:I,...D},T)=>{const N=Oe(u,d);if(N==="hidden")return null;N==="disabled"&&(i=!0),N==="readOnly"&&(o=!0);const{t:H}=Re(),E=Ae(d),R=gt("input",g),x=it("input",g),$=s.useCallback(()=>b==null?void 0:b(""),[b]),A=Ia({enabled:z,onSubmit:P}),O=s.useCallback(L=>{A(L),v==null||v(L)},[A,v]),F=s.useMemo(()=>{const L=[];return z&&L.push({key:"Enter",description:H("shortcuts.submit","Submit")}),_&&L.push({key:"Escape",description:H("shortcuts.clear","Clear")}),L},[z,_,H]);return e.jsxs("div",{className:`nice-field ${p||""}`,style:h,children:[t&&e.jsxs("label",{htmlFor:E,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:[t,I&&F.length>0&&e.jsx(tt,{shortcuts:F,size:"sm"})]}),e.jsxs("div",{className:`nice-input nice-input--${c} nice-input--ds-${x} ${r?"nice-input--error":""} ${i?"nice-input--disabled":""} ${o?"nice-input--readonly":""}`,style:R,children:[k&&e.jsx("span",{className:"nice-input__icon",children:k}),e.jsx("input",{ref:T,id:E,className:"nice-input__native",type:y,name:l,value:f,defaultValue:m,placeholder:w,disabled:i,readOnly:o,maxLength:S,autoFocus:j,"aria-invalid":!!r,"aria-describedby":r?`${E}-error`:a?`${E}-helper`:void 0,onChange:L=>b==null?void 0:b(L.target.value),onBlur:C,onKeyDown:O,...D}),_&&f&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:$,"aria-label":H("controls.clear","Clear"),children:"✕"}),M&&e.jsx("span",{className:"nice-input__icon",children:M})]}),r&&e.jsx("div",{id:`${E}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{id:`${E}-helper`,className:"nice-field__helper",children:a})]})});ht.displayName="NiceTextInput";const Qe=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,size:o="md",name:c,id:l,className:d,style:p,accessMode:h,displayStyle:u,options:g,value:f,onChange:m,placeholder:b,multiple:C=!1,searchable:v=!1,clearable:w=!1,emptyText:y,maxHeight:S=240,optionsSource:k,valueField:M,labelField:_,virtualScroll:j,optionHeight:z=36,onSearch:P,loading:I,renderOption:D,showKeyboardHints:T},N)=>{const H=Oe(h,l);if(H==="hidden")return null;(H==="disabled"||H==="readOnly")&&(i=!0);const{t:E}=Re(),R=gt("input",u),x=it("input",u),$=Ae(l),[A,O]=s.useState(!1),[F,L]=s.useState(""),[G,V]=s.useState(-1),[B,Y]=s.useState(0),J=s.useRef(null),me=Qo(k??null,M??(k==null?void 0:k.keyField)??"id",_??"name"),de=k?me.options:g??[];_t(J,()=>{O(!1),L("")});const oe=s.useMemo(()=>f?Array.isArray(f)?f:[f]:[],[f]),ae=s.useMemo(()=>{if(!F&&!P||P)return de;const U=F.toLowerCase();return de.filter(Q=>Q.label.toLowerCase().includes(U)||String(Q.value).toLowerCase().includes(U))},[de,F,P]),ve=s.useMemo(()=>{const U=new Map;for(const Q of ae){const W=Q.group||"";U.has(W)||U.set(W,[]),U.get(W).push(Q)}return U},[ae]),re=s.useCallback(U=>{if(C){const Q=oe.includes(U)?oe.filter(W=>W!==U):[...oe,U];m==null||m(Q)}else m==null||m(U),O(!1),L("")},[C,oe,m]),he=s.useCallback(U=>{if(U.key==="Escape"){O(!1),L("");return}if(U.key==="Enter"||U.key===" "){if(!A){O(!0),U.preventDefault();return}G>=0&&ae[G]&&(re(ae[G].value),U.preventDefault());return}U.key==="ArrowDown"&&(U.preventDefault(),V(Q=>Math.min(Q+1,ae.length-1))),U.key==="ArrowUp"&&(U.preventDefault(),V(Q=>Math.max(Q-1,0)))},[A,G,ae,re]),we=s.useMemo(()=>{var U;return oe.length===0?null:C?oe.map(Q=>{var W;return((W=de.find(Z=>Z.value===Q))==null?void 0:W.label)||Q}).join(", "):((U=de.find(Q=>Q.value===oe[0]))==null?void 0:U.label)||oe[0]},[oe,de,C]),le=s.useCallback(U=>{U.stopPropagation(),m==null||m(C?[]:"")},[m,C]),ke=s.useMemo(()=>[{key:"Enter",description:E("shortcuts.select","Select")},{key:"Space",description:E("shortcuts.openDropdown","Open dropdown")},qe.moveUp,qe.moveDown,qe.cancel],[E]);return e.jsxs("div",{className:`nice-field ${d||""}`,style:p,children:[t&&e.jsxs("label",{htmlFor:$,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:[t,T&&e.jsx(tt,{shortcuts:ke,size:"sm"})]}),e.jsxs("div",{className:"nice-select",ref:J,children:[e.jsxs("button",{ref:N,type:"button",id:$,role:"combobox","aria-expanded":A,"aria-haspopup":"listbox","aria-invalid":!!r,className:`nice-select__trigger nice-select__trigger--${o} nice-select--ds-${x} ${A?"nice-select__trigger--open":""} ${r?"nice-select__trigger--error":""} ${i?"nice-select__trigger--disabled":""}`,style:R,disabled:i,onClick:()=>O(!A),onKeyDown:he,children:[we?e.jsx("span",{children:we}):e.jsx("span",{className:"nice-select__placeholder",children:b||E("controls.select","Select...")}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[w&&oe.length>0&&e.jsx("span",{className:"nice-input__clear",onClick:le,role:"button","aria-label":E("controls.clear","Clear"),children:"✕"}),e.jsx("svg",{className:`nice-select__chevron ${A?"nice-select__chevron--open":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]})]}),A&&e.jsxs("div",{className:"nice-select__dropdown",role:"listbox",style:{maxHeight:S},onScroll:j?U=>Y(U.currentTarget.scrollTop):void 0,children:[(v||P)&&e.jsx("div",{className:"nice-select__search",children:e.jsx("input",{type:"text",value:F,onChange:U=>{L(U.target.value),V(0),P==null||P(U.target.value)},placeholder:E("controls.search","Search..."),autoFocus:!0})}),I&&e.jsx("div",{className:"nice-select__loading",children:e.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!I&&ae.length===0?e.jsx("div",{className:"nice-select__empty",children:y||E("controls.noResults","No results found")}):j&&!Array.from(ve.keys()).some(U=>U!=="")?(()=>{const U=ae.length*z,Q=Math.max(0,Math.floor(B/z)-3),W=Math.min(ae.length,Math.ceil((B+S)/z)+3),Z=ae.slice(Q,W);return e.jsx("div",{style:{height:U,position:"relative"},children:Z.map((te,ee)=>{const ie=Q+ee,ne=oe.includes(te.value);return e.jsx("div",{role:"option","aria-selected":ne,className:`nice-select__option ${ne?"nice-select__option--selected":""} ${ie===G?"nice-select__option--highlighted":""} ${te.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:ie*z,left:0,right:0,height:z,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!te.disabled&&re(String(te.value)),onMouseEnter:()=>V(ie),children:D?D(te,ne):e.jsxs(e.Fragment,{children:[te.icon&&e.jsx("span",{children:te.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:te.label}),te.description&&e.jsx("div",{className:"nice-select__option-desc",children:te.description})]}),ne&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},te.value)})})})():Array.from(ve.entries()).map(([U,Q])=>e.jsxs(s.Fragment,{children:[U&&e.jsx("div",{className:"nice-select__group-label",children:U}),Q.map(W=>{const Z=oe.includes(W.value),te=ae.indexOf(W);return e.jsx("div",{role:"option","aria-selected":Z,className:`nice-select__option ${Z?"nice-select__option--selected":""} ${te===G?"nice-select__option--highlighted":""} ${W.disabled?"nice-select__option--disabled":""}`,onClick:()=>!W.disabled&&re(String(W.value)),onMouseEnter:()=>V(te),children:D?D(W,Z):e.jsxs(e.Fragment,{children:[W.icon&&e.jsx("span",{children:W.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{children:W.label}),W.description&&e.jsx("div",{className:"nice-select__option-desc",children:W.description})]}),Z&&e.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},W.value)})]},U))]})]}),r&&e.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]})});Qe.displayName="NiceSelect";const Hd=["#ef4444","#f97316","#f59e0b","#84cc16","#10b981","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#ec4899","#64748b","#1e293b"];function qd(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}const st=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,id:o,className:c,style:l,accessMode:d,displayStyle:p,value:h="#3b82f6",onChange:u,presets:g=Hd,showInput:f=!0,showRandom:m=!0,showKeyboardHints:b},C)=>{const v=Oe(d,o);if(v==="hidden")return null;(v==="disabled"||v==="readOnly")&&(i=!0);const{t:w}=Re(),y=Ae(o);it("input",p);const S=s.useRef(null),k=s.useCallback(()=>{i||(u==null||u(qd()))},[i,u]),M=s.useMemo(()=>[{key:"Enter",description:w("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:w("shortcuts.navigatePresets","Navigate presets")}],[w]);return e.jsxs("div",{className:`nice-field ${c||""}`,style:l,children:[t&&e.jsxs("label",{htmlFor:y,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:[t,b&&e.jsx(tt,{shortcuts:M,size:"sm"})]}),e.jsxs("div",{className:"nice-color-picker",children:[e.jsxs("div",{className:"nice-color-picker__preview-row",children:[e.jsx("div",{className:"nice-color-picker__swatch",style:{background:h},onClick:()=>{var _;return(_=S.current)==null?void 0:_.click()},role:"button",tabIndex:0,"aria-label":"Pick color",children:e.jsx("input",{ref:_=>{S.current=_,typeof C=="function"?C(_):C&&(C.current=_)},type:"color",className:"nice-color-picker__native",id:y,value:h,disabled:i,onChange:_=>u==null?void 0:u(_.target.value)})}),f&&e.jsx("div",{className:"nice-input nice-input--sm",style:{width:100},children:e.jsx("input",{className:"nice-input__native",type:"text",value:h,disabled:i,onChange:_=>u==null?void 0:u(_.target.value),maxLength:7})}),m&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:k,disabled:i,title:"Random color","aria-label":"Random color",children:"🎲"})]}),g.length>0&&e.jsx("div",{className:"nice-color-picker__presets",children:g.map(_=>e.jsx("div",{className:`nice-color-picker__preset ${h===_?"nice-color-picker__preset--active":""}`,style:{background:_},onClick:()=>u==null?void 0:u(_),role:"button",tabIndex:0,"aria-label":_},_))})]}),r&&e.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]})});st.displayName="NiceColorPicker";const xe=s.forwardRef(({children:t,variant:a="primary",size:r="md",type:n="button",disabled:i,loading:o,fullWidth:c,onClick:l,leftIcon:d,rightIcon:p,className:h,style:u,id:g,accessMode:f,displayStyle:m,...b},C)=>{const v=Oe(f,g);if(v==="hidden")return null;(v==="disabled"||v==="readOnly")&&(i=!0);const w=gt("button",m),y=it("button",m);return e.jsxs("button",{ref:C,type:n,id:g,className:`nice-btn nice-btn--${a} nice-btn--${r} nice-btn--ds-${y} ${c?"nice-btn--full-width":""} ${o?"nice-btn--loading":""} ${h||""}`,style:{...w,...u},disabled:i||o,"aria-busy":o||void 0,"aria-disabled":i||o||void 0,onClick:l,...b,children:[o&&e.jsx("svg",{className:"nice-btn__spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})}),!o&&d&&e.jsx("span",{"aria-hidden":"true",children:d}),e.jsx("span",{children:t}),!o&&p&&e.jsx("span",{"aria-hidden":"true",children:p})]})});xe.displayName="NiceButton";const Vd=(t,a)=>a,Kd=s.createContext(Vd);function Zt(){return{t:s.useContext(Kd)}}s.createContext({dir:"ltr",isRTL:!1,flip:t=>t,value:t=>t.ltr});s.createContext(null);s.createContext(null);const Qt=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#06b6d4","#84cc16"],Xt=({series:t,categories:a,width:r=600,height:n=400,title:i,showLegend:o=!0,showGrid:c=!0,yAxisLabel:l,xAxisLabel:d,stacked:p,zoomable:h,crosshair:u,annotations:g,legendInteractive:f,onDataPointClick:m,exportable:b,className:C,style:v})=>{var he,we;const w=s.useRef(null),[y,S]=s.useState(new Set),[k,M]=s.useState(null),[_,j]=s.useState(null),[z,P]=s.useState(!1),I=s.useRef(null),D=s.useMemo(()=>t.filter(le=>!y.has(le.name)),[t,y]),T=s.useCallback(le=>{f&&S(ke=>{const U=new Set(ke);return U.has(le)?U.delete(le):U.add(le),U})},[f]),N={top:i?40:20,right:20,bottom:d?60:40,left:l?60:50},H=r-N.left-N.right,E=n-N.top-N.bottom,R=((he=D[0])==null?void 0:he.data.length)??((we=t[0])==null?void 0:we.data.length)??0,x=(_==null?void 0:_.start)??0,$=(_==null?void 0:_.end)??R,A=$-x,O=s.useMemo(()=>D.map(le=>({...le,data:le.data.slice(x,$)})),[D,x,$]),F=s.useMemo(()=>a==null?void 0:a.slice(x,$),[a,x,$]),{minY:L,maxY:G,yTicks:V}=s.useMemo(()=>{let le;if(p){le=[];for(let ie=0;ie<A;ie++)le.push(O.reduce((ne,Ce)=>ne+(Ce.data[ie]||0),0))}else le=O.flatMap(ie=>ie.data);le.length===0&&(le=[0]);const ke=Math.min(0,...le),U=Math.max(0,...le),Q=U-ke||1,W=Math.pow(10,Math.floor(Math.log10(Q)))||1,Z=Math.floor(ke/W)*W,te=Math.ceil(U/W)*W,ee=[];for(let ie=Z;ie<=te;ie+=W)ee.push(Math.round(ie*1e6)/1e6);return ee.length<2&&ee.push(te),{minY:Z,maxY:te,yTicks:ee}},[O,A,p]),B=le=>E-(le-L)/(G-L||1)*E,Y=le=>(le+.5)/A*H,J=A>0?H/A/(p?1.5:Math.max(D.length,1)*1.5):20,me=s.useCallback(le=>{if(!h)return;le.preventDefault();const ke=_??{start:0,end:R},U=ke.end-ke.start,Q=(ke.start+ke.end)/2,W=le.deltaY>0?1.2:.8,Z=Math.max(2,Math.min(R,Math.round(U*W))),te=Math.max(0,Math.round(Q-Z/2)),ee=Math.min(R,te+Z);j({start:te,end:ee})},[h,_,R]),de=s.useCallback(le=>{h&&(P(!0),I.current={x:le.clientX,range:_??{start:0,end:R}})},[h,_,R]),oe=s.useCallback(le=>{var U;const ke=(U=w.current)==null?void 0:U.getBoundingClientRect();if(ke&&M({x:le.clientX-ke.left-N.left,y:le.clientY-ke.top-N.top}),z&&I.current&&h){const Q=le.clientX-I.current.x,W=H/A,Z=-Math.round(Q/W),te=I.current.range,ee=te.end-te.start;let ie=te.start+Z;ie<0&&(ie=0),ie+ee>R&&(ie=R-ee),j({start:ie,end:ie+ee})}},[z,h,H,A,R,N.left,N.top]),ae=s.useCallback(()=>{P(!1),I.current=null},[]),ve=s.useCallback(()=>{M(null),P(!1),I.current=null},[]),re=s.useCallback(()=>{const le=w.current;if(!le)return;const ke=new XMLSerializer().serializeToString(le),U=document.createElement("canvas");U.width=r,U.height=n+(o?30:0);const Q=U.getContext("2d");if(!Q)return;const W=new Image;W.onload=()=>{Q.fillStyle="#fff",Q.fillRect(0,0,U.width,U.height),Q.drawImage(W,0,0);const Z=document.createElement("a");Z.download="chart.png",Z.href=U.toDataURL("image/png"),Z.click()},W.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(ke)},[r,n,o]);return e.jsxs("div",{className:`nice-chart ${C||""}`,style:v,children:[b&&e.jsx("button",{type:"button",className:"nice-chart__export-btn",onClick:re,title:"Export PNG",children:"📷"}),e.jsxs("svg",{ref:w,width:r,height:n+(o?30:0),className:"nice-chart__svg",onWheel:me,onMouseDown:de,onMouseMove:oe,onMouseUp:ae,onMouseLeave:ve,children:[e.jsxs("g",{transform:`translate(${N.left},${N.top})`,children:[i&&e.jsx("text",{x:H/2,y:-10,textAnchor:"middle",className:"nice-chart__title",children:i}),c&&V.map(le=>e.jsxs("g",{children:[e.jsx("line",{x1:0,y1:B(le),x2:H,y2:B(le),className:"nice-chart__grid-line"}),e.jsx("text",{x:-8,y:B(le)+4,textAnchor:"end",className:"nice-chart__axis-label",children:le})]},le)),F&&F.map((le,ke)=>e.jsx("text",{x:Y(ke),y:E+20,textAnchor:"middle",className:"nice-chart__axis-label",children:le},ke)),l&&e.jsx("text",{x:-N.left+14,y:E/2,textAnchor:"middle",transform:`rotate(-90, -${N.left-14}, ${E/2})`,className:"nice-chart__axis-title",children:l}),d&&e.jsx("text",{x:H/2,y:E+45,textAnchor:"middle",className:"nice-chart__axis-title",children:d}),e.jsx("line",{x1:0,y1:0,x2:0,y2:E,className:"nice-chart__axis"}),e.jsx("line",{x1:0,y1:E,x2:H,y2:E,className:"nice-chart__axis"}),g==null?void 0:g.map((le,ke)=>{if(le.type==="line"){const U=B(le.value);return e.jsxs("g",{children:[e.jsx("line",{x1:0,y1:U,x2:H,y2:U,stroke:le.color||"#ef4444",strokeWidth:1.5,strokeDasharray:le.dash||"6,3"}),le.label&&e.jsx("text",{x:H+4,y:U+4,className:"nice-chart__annotation-label",fill:le.color||"#ef4444",children:le.label})]},ke)}return e.jsx("text",{x:Y(le.value),y:-4,textAnchor:"middle",className:"nice-chart__annotation-label",fill:le.color||"#6b7280",children:le.label},ke)}),u&&k&&k.x>=0&&k.x<=H&&k.y>=0&&k.y<=E&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:k.x,y1:0,x2:k.x,y2:E,stroke:"#9ca3af",strokeWidth:1,strokeDasharray:"4,2"}),e.jsx("line",{x1:0,y1:k.y,x2:H,y2:k.y,stroke:"#9ca3af",strokeWidth:1,strokeDasharray:"4,2"})]}),O.map((le,ke)=>{const U=le.color||Qt[ke%Qt.length],Q=le.type||"bar";if(Q==="bar")return e.jsx("g",{children:le.data.map((Z,te)=>{let ee,ie;if(p){const Ce=O.slice(0,ke).reduce((ue,$e)=>ue+($e.data[te]||0),0);ee=B(Ce+Z),ie=B(Ce)-ee}else ee=B(Math.max(0,Z)),ie=Math.abs(B(Z)-B(0));const ne=p?Y(te)-J/2:Y(te)-O.length*J/2+ke*J;return e.jsx("rect",{x:ne,y:ee,width:J*.9,height:Math.max(0,ie),fill:U,rx:2,style:m?{cursor:"pointer"}:void 0,onClick:m?()=>m(le.name,x+te,Z):void 0,children:e.jsx("title",{children:`${le.name}: ${Z}`})},te)})},le.name);const W=le.data.map((Z,te)=>`${Y(te)},${B(Z)}`);return e.jsxs("g",{children:[Q==="area"&&e.jsx("polygon",{points:`${Y(0)},${B(0)} ${W.join(" ")} ${Y(A-1)},${B(0)}`,fill:U,opacity:.15}),e.jsx("polyline",{points:W.join(" "),fill:"none",stroke:U,strokeWidth:2}),le.data.map((Z,te)=>e.jsx("circle",{cx:Y(te),cy:B(Z),r:3,fill:U,style:m?{cursor:"pointer"}:void 0,onClick:m?()=>m(le.name,x+te,Z):void 0,children:e.jsx("title",{children:`${le.name}: ${Z}`})},te))]},le.name)})]}),o&&e.jsx("g",{transform:`translate(${N.left}, ${n})`,children:t.map((le,ke)=>{const U=ke*120,Q=y.has(le.name);return e.jsxs("g",{transform:`translate(${U}, 10)`,style:f?{cursor:"pointer"}:void 0,onClick:()=>T(le.name),opacity:Q?.35:1,children:[e.jsx("rect",{width:12,height:12,rx:2,fill:le.color||Qt[ke%Qt.length]}),e.jsx("text",{x:16,y:10,className:"nice-chart__legend-text",style:Q?{textDecoration:"line-through"}:void 0,children:le.name})]},le.name)})})]})]})},Yd=Object.freeze(Object.defineProperty({__proto__:null,NiceChart:Xt},Symbol.toStringTag,{value:"Module"}));function Gd(t){if(!t.length)return{categories:[],numericFields:[],sampleValues:{}};const a=t[0],r=[],n={};let i=null;for(const[o,c]of Object.entries(a))typeof c=="number"?(r.push(o),n[o]=t.map(l=>Number(l[o])||0)):!i&&(typeof c=="string"||c instanceof Date)&&(i=o);return{categories:i?t.map(o=>String(o[i]||"")):t.map((o,c)=>`Item ${c+1}`),numericFields:r,sampleValues:n}}function Ud(t,a){const{categories:r,numericFields:n,sampleValues:i}=Gd(t);return{series:n.map((o,c)=>({name:o.replace(/([A-Z])/g," $1").replace(/^./,l=>l.toUpperCase()).trim(),data:i[o],type:a==="area"?"area":a==="line"?"line":"bar"})),categories:r}}s.forwardRef(function(t,a){const{rawData:r,enableAI:n=!0,aiModel:i,enableAutoType:o=!0,enableInsights:c=!0,dataDescription:l,onChartSuggestion:d,onInsights:p,showAIToolbar:h=!0,showInsightsOnLoad:u=!1,series:g,categories:f,...m}=t,[b,C]=s.useState("bar"),[v,w]=s.useState(null),[y,S]=s.useState([]),[k,M]=s.useState(u),[_,j]=s.useState(null),{t:z}=Zt(),P=vt(),{suggestChartType:I,generateInsights:D,isLoading:T}=Go(),N=n&&P.isConfigured,{series:H,categories:E}=r?Ud(r,_||b):{series:g||[],categories:f},R=s.useCallback(async()=>{if(!N||!o)return{type:"bar",reason:"Default",config:{}};const F=r||(g!=null&&g.length?g.flatMap(L=>L.data.map((G,V)=>({[L.name]:G,index:V}))):[]);try{const L=await I(F,l),G={type:L.type,reason:L.reason,config:L.config};return w(G),C(G.type),d==null||d(G),G}catch{return{type:"bar",reason:"Default fallback",config:{}}}},[N,o,r,g,l,I,d]),x=s.useCallback(async()=>{if(!N||!c)return[];const F=r||(g!=null&&g.length?g.flatMap(L=>L.data.map((G,V)=>({[L.name]:G,category:(f==null?void 0:f[V])||V}))):[]);try{const L=await D(F,_||b);return S(L),p==null||p(L),L}catch{return[]}},[N,c,r,g,f,b,_,D,p]),$=s.useCallback(()=>_||b,[_,b]);s.useEffect(()=>{N&&o&&(r!=null&&r.length||g!=null&&g.length)&&R()},[N,o,r,g]),s.useImperativeHandle(a,()=>({getSuggestion:R,generateInsights:x,getCurrentType:$}));const A=[{type:"bar",icon:"📊",label:"Bar"},{type:"line",icon:"📈",label:"Line"},{type:"area",icon:"🏔️",label:"Area"},{type:"pie",icon:"🥧",label:"Pie"},{type:"donut",icon:"🍩",label:"Donut"},{type:"scatter",icon:"⭐",label:"Scatter"}],O=_||b;return e.jsxs("div",{className:"nice-chart-ai","data-testid":t["data-testid"],children:[h&&N&&e.jsxs("div",{className:"nice-chart-ai__toolbar",children:[e.jsxs("div",{className:"nice-chart-ai__toolbar-left",children:[e.jsx("span",{className:"nice-chart-ai__badge",children:"AI"}),v&&e.jsxs("div",{className:"nice-chart-ai__suggestion",children:[e.jsx("span",{className:"nice-chart-ai__suggestion-icon",children:"💡"}),e.jsxs("span",{className:"nice-chart-ai__suggestion-text",children:[z("chartAI.suggestedType","Suggested:")," ",v.type]}),e.jsxs("span",{className:"nice-chart-ai__suggestion-reason",title:v.reason,children:["(",v.reason,")"]})]}),T&&e.jsx("span",{className:"nice-chart-ai__loading",children:z("chartAI.analyzing","Analyzing...")})]}),e.jsx("div",{className:"nice-chart-ai__toolbar-center",children:e.jsx("div",{className:"nice-chart-ai__type-selector",children:A.filter(F=>["bar","line","area"].includes(F.type)).map(({type:F,icon:L,label:G})=>e.jsx("button",{type:"button",className:`nice-chart-ai__type-btn ${O===F?"nice-chart-ai__type-btn--active":""}`,onClick:()=>j(F),title:G,children:L},F))})}),e.jsxs("div",{className:"nice-chart-ai__toolbar-right",children:[e.jsxs("button",{type:"button",className:"nice-chart-ai__auto-btn",onClick:()=>R(),disabled:T,title:z("chartAI.autoDetect","Auto-detect best chart type"),children:["🔮 ",z("chartAI.auto","Auto")]}),c&&e.jsxs("button",{type:"button",className:"nice-chart-ai__insights-btn",onClick:()=>{y.length||x(),M(!k)},disabled:T,title:z("chartAI.showInsights","Show data insights"),children:["💡 ",z("chartAI.insights","Insights")]})]})]}),e.jsx("div",{className:"nice-chart-ai__chart-wrapper",children:e.jsx(Xt,{series:H,categories:E,...m})}),k&&y.length>0&&e.jsxs("div",{className:"nice-chart-ai__insights",children:[e.jsxs("div",{className:"nice-chart-ai__insights-header",children:[e.jsxs("h4",{children:["💡 ",z("chartAI.dataInsights","Data Insights")]}),e.jsx("button",{type:"button",className:"nice-chart-ai__insights-close",onClick:()=>M(!1),children:"✕"})]}),e.jsx("ul",{className:"nice-chart-ai__insights-list",children:y.map((F,L)=>e.jsxs("li",{className:"nice-chart-ai__insight",children:[e.jsx("span",{className:"nice-chart-ai__insight-icon",children:"•"}),F]},L))}),e.jsx("div",{className:"nice-chart-ai__insights-footer",children:e.jsxs("button",{type:"button",className:"nice-chart-ai__refresh",onClick:()=>x(),disabled:T,children:["🔄 ",z("chartAI.refresh","Refresh")]})})]}),k&&T&&e.jsx("div",{className:"nice-chart-ai__insights nice-chart-ai__insights--loading",children:e.jsxs("div",{className:"nice-chart-ai__loading-content",children:[e.jsx("span",{className:"nice-chart-ai__spinner"}),z("chartAI.generatingInsights","Generating insights...")]})})]})});function Zd(t,a){const r=t?typeof t=="number"?new Date(t):new Date(t):new Date,n=d=>d.toString().padStart(2,"0"),i=n(r.getHours()),o=n(r.getMinutes()),c=n(r.getSeconds()),l=r.getMilliseconds().toString().padStart(3,"0");switch(a){case"HH:mm:ss":return`${i}:${o}:${c}`;case"HH:mm":return`${i}:${o}`;case"mm:ss":return`${o}:${c}`;case"ss.SSS":return`${c}.${l}`;case"ISO":return r.toISOString();default:return`${i}:${o}:${c}`}}function Ar(t){if(t.length===0)return null;const a=Math.min(...t),r=Math.max(...t),n=t.reduce((o,c)=>o+c,0)/t.length,i=t[t.length-1];return{min:a,max:r,avg:n,current:i,count:t.length}}const Mn=s.forwardRef(({series:t,maxPoints:a=100,slidingWindow:r=!0,refreshRate:n=16,dataSource:i,width:o=600,height:c=400,title:l,showLegend:d=!0,showGrid:p=!0,yAxisLabel:h,xAxisLabel:u,stacked:g,zoomable:f,crosshair:m,annotations:b=[],legendInteractive:C,onDataPointClick:v,exportable:w,showControls:y=!0,showStatus:S=!0,initialPaused:k=!1,onDataReceived:M,onDataDropped:_,timeFormat:j="HH:mm:ss",showStats:z,thresholds:P=[],className:I,style:D},T)=>{const[N,H]=s.useState(()=>{var ae;const oe=new Map;for(const ve of t)oe.set(ve.name,((ae=ve.initialData)==null?void 0:ae.slice())??[]);return oe}),[E,R]=s.useState([]),[x,$]=s.useState(k),[A,O]=s.useState(!1),F=s.useRef([]),L=s.useRef(Date.now()),G=s.useRef(null),V=s.useCallback(()=>{const oe=F.current;oe.length!==0&&(F.current=[],H(ae=>{const ve=new Map(ae);for(const re of oe){const he=ve.get(re.series);if(!he)continue;const we=[...he,re.value];if(r&&we.length>a){const le=we.length-a;_==null||_(le,re.series),we.splice(0,le)}ve.set(re.series,we)}return ve}),oe.length>0&&R(ae=>{const ve=[...ae];for(const re of oe){const he=re.category??Zd(re.timestamp,j);ve.push(he)}return r&&ve.length>a&&ve.splice(0,ve.length-a),ve}))},[r,a,j,_]),B=s.useCallback(()=>{const oe=Date.now();oe-L.current>=n&&(V(),L.current=oe),G.current=requestAnimationFrame(B)},[n,V]);s.useEffect(()=>(x||(G.current=requestAnimationFrame(B)),()=>{G.current!==null&&(cancelAnimationFrame(G.current),G.current=null)}),[x,B]);const Y=s.useCallback(oe=>{if(x)return;const ae="points"in oe?oe.points:[oe];for(const ve of ae)N.has(ve.series)&&(F.current.push(ve),M==null||M(ve))},[x,N,M]);s.useEffect(()=>{if(!i)return;const oe=i.subscribe(Y);let ae;return i.onStatusChange?ae=i.onStatusChange(O):O(!0),i.fetchHistory&&i.fetchHistory(a).then(ve=>{for(const re of ve)F.current.push(re);V()}),()=>{oe(),ae==null||ae()}},[i,Y,a,V]);const J=s.useMemo(()=>t.map(oe=>({name:oe.name,color:oe.color,type:oe.type,data:N.get(oe.name)??[]})),[t,N]),me=s.useMemo(()=>{const oe=[...b];for(const ae of P)oe.push({type:"line",value:ae.value,color:ae.color,label:ae.label,dash:ae.style==="dashed"?"5,5":ae.style==="dotted"?"2,2":void 0});return oe},[b,P]);s.useImperativeHandle(T,()=>({pause(){$(!0)},resume(){$(!1)},isPaused(){return x},clear(){H(oe=>{const ae=new Map(oe);for(const ve of ae.keys())ae.set(ve,[]);return ae}),R([]),F.current=[]},addPoint(oe){Y(oe)},addPoints(oe){Y({points:oe})},getData(oe){return N.get(oe)??[]},getCategories(){return E},exportData(){return{series:J,categories:E}},getStats(oe){const ae=N.get(oe);return ae?Ar(ae):null}}),[x,N,E,J,Y]);const de=s.useMemo(()=>{if(!z)return null;const oe={};for(const[ae,ve]of N)oe[ae]=Ar(ve);return oe},[z,N]);return e.jsxs("div",{className:I,style:{position:"relative",...D},children:[S&&e.jsxs("div",{style:{position:"absolute",top:8,right:8,display:"flex",alignItems:"center",gap:4,fontSize:12,color:A?"#22c55e":"#ef4444",zIndex:10},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:A?"#22c55e":"#ef4444"}}),A?"Live":"Disconnected"]}),y&&e.jsx("div",{style:{position:"absolute",top:8,left:8,display:"flex",gap:4,zIndex:10},children:e.jsx("button",{onClick:()=>$(oe=>!oe),style:{padding:"4px 8px",fontSize:12,border:"1px solid #ddd",borderRadius:4,background:x?"#fef3c7":"#fff",cursor:"pointer"},title:x?"Resume":"Pause",children:x?"▶":"⏸"})}),z&&de&&e.jsx("div",{style:{position:"absolute",bottom:50,right:8,background:"rgba(255,255,255,0.9)",border:"1px solid #ddd",borderRadius:4,padding:8,fontSize:11,zIndex:10},children:Object.entries(de).map(([oe,ae])=>ae?e.jsxs("div",{style:{marginBottom:4},children:[e.jsx("strong",{children:oe}),e.jsxs("div",{children:["Min: ",ae.min.toFixed(2)," | Max: ",ae.max.toFixed(2)]}),e.jsxs("div",{children:["Avg: ",ae.avg.toFixed(2)," | Now: ",ae.current.toFixed(2)]})]},oe):null)}),e.jsx(Xt,{series:J,categories:E,width:o,height:c,title:l,showLegend:d,showGrid:p,yAxisLabel:h,xAxisLabel:u,stacked:g,zoomable:f,crosshair:m,annotations:me,legendInteractive:C,onDataPointClick:v,exportable:w})]})});Mn.displayName="NiceLiveChart";const et=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#06b6d4","#84cc16"],$n=({data:t,width:a=400,height:r=400,innerRadius:n=0,title:i,showLegend:o=!0,showLabels:c=!0,className:l,style:d})=>{const p=a/2,h=(r-(o?30:0))/2+(i?10:0),u=Math.min(p,h)-40,g=t.reduce((b,C)=>b+C.value,0);let f=-Math.PI/2;const m=t.map((b,C)=>{const v=b.value/(g||1)*Math.PI*2,w=f;f+=v;const y=f,S=(w+y)/2,k=p+u*Math.cos(w),M=h+u*Math.sin(w),_=p+u*Math.cos(y),j=h+u*Math.sin(y),z=v>Math.PI?1:0,P=b.color||et[C%et.length];let I;if(n>0){const H=p+n*Math.cos(w),E=h+n*Math.sin(w),R=p+n*Math.cos(y),x=h+n*Math.sin(y);I=`M${k},${M} A${u},${u} 0 ${z},1 ${_},${j} L${R},${x} A${n},${n} 0 ${z},0 ${H},${E} Z`}else I=`M${p},${h} L${k},${M} A${u},${u} 0 ${z},1 ${_},${j} Z`;const D=p+u*.7*Math.cos(S),T=h+u*.7*Math.sin(S),N=g>0?Math.round(b.value/g*100):0;return{...b,path:I,labelX:D,labelY:T,pct:N,color:P}});return e.jsx("div",{className:`nice-piechart ${l||""}`,style:d,children:e.jsxs("svg",{width:a,height:r,className:"nice-piechart__svg",children:[i&&e.jsx("text",{x:p,y:20,textAnchor:"middle",className:"nice-chart__title",children:i}),m.map((b,C)=>e.jsxs("g",{children:[e.jsx("path",{d:b.path,fill:b.color,stroke:"var(--bg-primary, #fff)",strokeWidth:2,children:e.jsx("title",{children:`${b.label}: ${b.value} (${b.pct}%)`})}),c&&b.pct>=5&&e.jsxs("text",{x:b.labelX,y:b.labelY,textAnchor:"middle",dominantBaseline:"middle",className:"nice-piechart__label",children:[b.pct,"%"]})]},C)),o&&e.jsx("g",{transform:`translate(10, ${r-25})`,children:t.map((b,C)=>e.jsxs("g",{transform:`translate(${C*100}, 0)`,children:[e.jsx("rect",{width:10,height:10,rx:2,fill:b.color||et[C%et.length]}),e.jsx("text",{x:14,y:9,className:"nice-chart__legend-text",children:b.label})]},C))})]})})},zn=({series:t,categories:a,width:r=400,height:n=400,maxValue:i,title:o,showLegend:c=!0,className:l,style:d})=>{const p=r/2,h=(n-(c?30:0))/2+(o?10:0),u=Math.min(p,h)-40,g=a.length,f=i??Math.max(...t.flatMap(v=>v.data),1),m=Math.PI*2/g,b=5,C=(v,w)=>{const y=v*m-Math.PI/2,S=w/f*u;return{x:p+S*Math.cos(y),y:h+S*Math.sin(y)}};return e.jsx("div",{className:`nice-polarchart ${l||""}`,style:d,children:e.jsxs("svg",{width:r,height:n,className:"nice-polarchart__svg",children:[o&&e.jsx("text",{x:p,y:20,textAnchor:"middle",className:"nice-chart__title",children:o}),Array.from({length:b},(v,w)=>{const y=u*((w+1)/b);return e.jsx("circle",{cx:p,cy:h,r:y,fill:"none",stroke:"var(--border-color, #ddd)",strokeWidth:.5},w)}),a.map((v,w)=>{const y=C(w,f),S=C(w,f*1.12);return e.jsxs("g",{children:[e.jsx("line",{x1:p,y1:h,x2:y.x,y2:y.y,stroke:"var(--border-color, #ddd)",strokeWidth:.5}),e.jsx("text",{x:S.x,y:S.y,textAnchor:"middle",dominantBaseline:"middle",className:"nice-chart__axis-label",children:v})]},w)}),t.map((v,w)=>{const y=v.color||et[w%et.length],S=v.data.map((k,M)=>{const _=C(M,k);return`${_.x},${_.y}`}).join(" ");return e.jsxs("g",{children:[e.jsx("polygon",{points:S,fill:v.fill!==!1?y:"none",fillOpacity:.15,stroke:y,strokeWidth:2}),v.data.map((k,M)=>{const _=C(M,k);return e.jsx("circle",{cx:_.x,cy:_.y,r:3,fill:y,children:e.jsx("title",{children:`${v.name} - ${a[M]}: ${k}`})},M)})]},v.name)}),c&&e.jsx("g",{transform:`translate(10, ${n-25})`,children:t.map((v,w)=>e.jsxs("g",{transform:`translate(${w*100}, 0)`,children:[e.jsx("rect",{width:10,height:10,rx:2,fill:v.color||et[w%et.length]}),e.jsx("text",{x:14,y:9,className:"nice-chart__legend-text",children:v.name})]},w))})]})})},En=({value:t,min:a=0,max:r=100,width:n=200,height:i=200,startAngle:o=225,endAngle:c=-45,color:l="#3b82f6",trackColor:d,label:p,formatValue:h,ranges:u,className:g,style:f})=>{const m=n/2,b=i/2,C=Math.min(m,b)-20,v=Math.max(0,Math.min(1,(t-a)/(r-a||1))),w=z=>z*Math.PI/180,y=(o-c+360)%360||360,S=z=>({x:m+C*Math.cos(w(z)),y:b-C*Math.sin(w(z))}),k=(z,P)=>{const I=S(z),D=S(P),T=(z-P+360)%360>180?1:0;return`M${I.x},${I.y} A${C},${C} 0 ${T},1 ${D.x},${D.y}`},M=o-v*y,_=S(M);let j=l;if(u){for(const z of u)if(t>=z.start&&t<=z.end){j=z.color;break}}return e.jsx("div",{className:`nice-gauge nice-gauge--circular ${g||""}`,style:f,children:e.jsxs("svg",{width:n,height:i,children:[e.jsx("path",{d:k(o,c),fill:"none",stroke:d||"var(--border-color, #e2e8f0)",strokeWidth:12,strokeLinecap:"round"}),v>0&&e.jsx("path",{d:k(o,M),fill:"none",stroke:j,strokeWidth:12,strokeLinecap:"round"}),e.jsx("line",{x1:m,y1:b,x2:_.x,y2:_.y,stroke:"var(--text-primary, #333)",strokeWidth:2,strokeLinecap:"round"}),e.jsx("circle",{cx:m,cy:b,r:4,fill:"var(--text-primary, #333)"}),e.jsx("text",{x:m,y:b+C*.35,textAnchor:"middle",className:"nice-gauge__value",children:h?h(t):t}),p&&e.jsx("text",{x:m,y:b+C*.55,textAnchor:"middle",className:"nice-gauge__label",children:p})]})})},An=({value:t,min:a=0,max:r=100,width:n=300,height:i=60,orientation:o="horizontal",color:c="#3b82f6",label:l,formatValue:d,ranges:p,showTicks:h=!0,tickCount:u=5,className:g,style:f})=>{const m=o==="horizontal",b=m?n-40:i-40,C=Math.max(0,Math.min(1,(t-a)/(r-a||1))),v=10;let w=c;if(p){for(const S of p)if(t>=S.start&&t<=S.end){w=S.color;break}}const y=Array.from({length:u},(S,k)=>a+(r-a)*(k/(u-1)));return m?e.jsx("div",{className:`nice-gauge nice-gauge--linear ${g||""}`,style:f,children:e.jsxs("svg",{width:n,height:i,children:[l&&e.jsx("text",{x:n/2,y:14,textAnchor:"middle",className:"nice-gauge__label",children:l}),e.jsx("rect",{x:20,y:i/2-v/2,width:b,height:v,rx:5,fill:"var(--border-color, #e2e8f0)"}),e.jsx("rect",{x:20,y:i/2-v/2,width:b*C,height:v,rx:5,fill:w}),e.jsx("polygon",{points:`${20+b*C},${i/2-v/2-2} ${20+b*C-5},${i/2-v/2-10} ${20+b*C+5},${i/2-v/2-10}`,fill:"var(--text-primary, #333)"}),e.jsx("text",{x:20+b*C,y:i/2-v/2-12,textAnchor:"middle",className:"nice-gauge__value",style:{fontSize:11},children:d?d(t):t}),h&&y.map((S,k)=>{const M=20+(S-a)/(r-a)*b;return e.jsx("text",{x:M,y:i/2+v/2+14,textAnchor:"middle",className:"nice-gauge__tick",children:S},k)})]})}):e.jsx("div",{className:`nice-gauge nice-gauge--linear nice-gauge--vertical ${g||""}`,style:f,children:e.jsxs("svg",{width:n,height:i,children:[e.jsx("rect",{x:n/2-v/2,y:20,width:v,height:b,rx:5,fill:"var(--border-color, #e2e8f0)"}),e.jsx("rect",{x:n/2-v/2,y:20+b*(1-C),width:v,height:b*C,rx:5,fill:w}),e.jsx("text",{x:n/2,y:14,textAnchor:"middle",className:"nice-gauge__value",children:d?d(t):t}),l&&e.jsx("text",{x:n/2,y:i-4,textAnchor:"middle",className:"nice-gauge__label",children:l})]})})},Dn=({items:t,min:a=0,max:r=100,width:n=300,height:i=300,startAngle:o=225,endAngle:c=-45,formatValue:l,title:d,className:p,style:h})=>{const u=n/2,g=i/2,f=Math.min(u,g)-30,m=Math.min(20,f/(t.length+1)),b=4,C=y=>y*Math.PI/180,v=(o-c+360)%360||360,w=(y,S,k)=>{const M=u+y*Math.cos(C(S)),_=g-y*Math.sin(C(S)),j=u+y*Math.cos(C(k)),z=g-y*Math.sin(C(k)),P=(S-k+360)%360;return`M${M},${_} A${y},${y} 0 ${P>180?1:0},1 ${j},${z}`};return e.jsx("div",{className:`nice-bargauge ${p||""}`,style:h,children:e.jsxs("svg",{width:n,height:i,children:[d&&e.jsx("text",{x:u,y:20,textAnchor:"middle",className:"nice-chart__title",children:d}),t.map((y,S)=>{const k=f-S*(m+b),M=Math.max(0,Math.min(1,(y.value-a)/(r-a||1))),_=o-M*v,j=y.color||et[S%et.length];return e.jsxs("g",{children:[e.jsx("path",{d:w(k,o,c),fill:"none",stroke:"var(--border-color, #e2e8f0)",strokeWidth:m,strokeLinecap:"round"}),M>0&&e.jsx("path",{d:w(k,o,_),fill:"none",stroke:j,strokeWidth:m,strokeLinecap:"round"})]},S)}),e.jsx("g",{children:t.map((y,S)=>e.jsxs("text",{x:u,y:g-((t.length-1)/2-S)*16,textAnchor:"middle",dominantBaseline:"middle",className:"nice-gauge__value",style:{fontSize:12},children:[y.label?`${y.label}: `:"",l?l(y.value):y.value]},S))})]})})},Tn=({data:t,width:a=120,height:r=30,type:n="line",color:i="#3b82f6",showMinMax:o,showLastPoint:c=!0,className:l,style:d})=>{if(t.length===0)return null;const p=2,h=Math.min(...t),u=Math.max(...t),g=u-h||1,f=a-p*2,m=r-p*2,b=k=>p+k/(t.length-1||1)*f,C=k=>p+m-(k-h)/g*m;if(n==="bar"){const k=Math.max(1,f/t.length-1);return e.jsx("svg",{width:a,height:r,className:`nice-sparkline ${l||""}`,style:d,children:t.map((M,_)=>e.jsx("rect",{x:p+_/t.length*f,y:C(M),width:k,height:m-(C(M)-p),fill:i,rx:1},_))})}const v=t.map((k,M)=>`${b(M)},${C(k)}`).join(" "),w=t.indexOf(h),y=t.indexOf(u),S=t.length-1;return e.jsxs("svg",{width:a,height:r,className:`nice-sparkline ${l||""}`,style:d,children:[n==="area"&&e.jsx("polygon",{points:`${b(0)},${p+m} ${v} ${b(S)},${p+m}`,fill:i,opacity:.15}),e.jsx("polyline",{points:v,fill:"none",stroke:i,strokeWidth:1.5}),o&&e.jsx("circle",{cx:b(w),cy:C(h),r:2,fill:"#ef4444"}),o&&e.jsx("circle",{cx:b(y),cy:C(u),r:2,fill:"#22c55e"}),c&&e.jsx("circle",{cx:b(S),cy:C(t[S]),r:2,fill:i})]})},Rn=({value:t,target:a,min:r=0,max:n=100,width:i=200,height:o=30,color:c="#3b82f6",targetColor:l="#ef4444",className:d,style:p})=>{const h=i-8,u=o-8,g=Math.max(0,Math.min(1,(t-r)/(n-r||1))),f=a!=null?Math.max(0,Math.min(1,(a-r)/(n-r||1))):null;return e.jsxs("svg",{width:i,height:o,className:`nice-bullet ${d||""}`,style:p,children:[e.jsx("rect",{x:4,y:4,width:h,height:u,rx:3,fill:"var(--border-color, #e2e8f0)"}),e.jsx("rect",{x:4,y:4+u*.2,width:h*g,height:u*.6,rx:2,fill:c}),f!=null&&e.jsx("line",{x1:4+h*f,y1:6,x2:4+h*f,y2:4+u-2,stroke:l,strokeWidth:2})]})},Fn=({data:t,width:a=400,height:r=300,inverted:n,showLabels:i=!0,showValues:o=!0,title:c,className:l,style:d})=>{const p={top:c?30:10,bottom:10,x:40},h=a-p.x*2,u=r-p.top-p.bottom,g=n?[...t].reverse():t,f=Math.max(...g.map(b=>b.value),1),m=u/g.length;return e.jsx("div",{className:`nice-funnel ${l||""}`,style:d,children:e.jsxs("svg",{width:a,height:r,children:[c&&e.jsx("text",{x:a/2,y:20,textAnchor:"middle",className:"nice-chart__title",children:c}),g.map((b,C)=>{const v=b.value/f*h,w=C<g.length-1?g[C+1].value/f*h:v*.3,y=p.top+C*m,S=y+m,k=a/2,M=`${k-v/2},${y} ${k+v/2},${y} ${k+w/2},${S} ${k-w/2},${S}`,_=b.color||et[C%et.length];return e.jsxs("g",{children:[e.jsx("polygon",{points:M,fill:_,stroke:"var(--bg-primary, #fff)",strokeWidth:1,children:e.jsx("title",{children:`${b.label}: ${b.value}`})}),i&&e.jsx("text",{x:k,y:y+m/2-(o?4:0),textAnchor:"middle",dominantBaseline:"middle",className:"nice-funnel__label",children:b.label}),o&&e.jsx("text",{x:k,y:y+m/2+10,textAnchor:"middle",dominantBaseline:"middle",className:"nice-funnel__value",children:b.value})]},C)})]})})},Ba=({nodes:t,links:a,width:r=600,height:n=400,nodeWidth:i=20,nodePadding:o=10,title:c,className:l,style:d})=>{const p={top:c?40:20,bottom:20,left:20,right:20},h=r-p.left-p.right,u=n-p.top-p.bottom,g=new Set(a.map(z=>z.source)),f=new Set(a.map(z=>z.target)),m=t.filter(z=>g.has(z.id)&&!f.has(z.id)),b=t.filter(z=>f.has(z.id)),C=t.filter(z=>g.has(z.id)&&f.has(z.id)),v=[m,...C.length?[C]:[],b].filter(z=>z.length>0),w=v.length,y=new Map;t.forEach(z=>{const P=a.filter(D=>D.source===z.id).reduce((D,T)=>D+T.value,0),I=a.filter(D=>D.target===z.id).reduce((D,T)=>D+T.value,0);y.set(z.id,Math.max(P,I))});const S=v.map(z=>z.reduce((P,I)=>P+(y.get(I.id)||0),0)+(z.length-1)*o),k=Math.max(...S,1),M=new Map;v.forEach((z,P)=>{const I=p.left+P/(w-1||1)*(h-i);let D=0;z.forEach(T=>{const N=(y.get(T.id)||0)/k*u;M.set(T.id,{x:I,y:p.top+D,h:N}),D+=N+o})});const _=new Map,j=new Map;return t.forEach(z=>{_.set(z.id,0),j.set(z.id,0)}),e.jsx("div",{className:`nice-sankey ${l||""}`,style:d,children:e.jsxs("svg",{width:r,height:n,children:[c&&e.jsx("text",{x:r/2,y:20,textAnchor:"middle",className:"nice-chart__title",children:c}),a.map((z,P)=>{var F;const I=M.get(z.source),D=M.get(z.target);if(!I||!D)return null;const T=_.get(z.source)||0,N=j.get(z.target)||0,H=z.value/k*u;_.set(z.source,T+H),j.set(z.target,N+H);const E=I.x+i,R=I.y+T,x=D.x,$=D.y+N,A=(E+x)/2,O=((F=t.find(L=>L.id===z.source))==null?void 0:F.color)||et[P%et.length];return e.jsx("path",{d:`M${E},${R} C${A},${R} ${A},${$} ${x},${$} L${x},${$+H} C${A},${$+H} ${A},${R+H} ${E},${R+H} Z`,fill:O,fillOpacity:.3,stroke:O,strokeOpacity:.5,strokeWidth:.5,children:e.jsx("title",{children:`${z.source} → ${z.target}: ${z.value}`})},P)}),t.map((z,P)=>{const I=M.get(z.id);if(!I)return null;const D=z.color||et[P%et.length];return e.jsxs("g",{children:[e.jsx("rect",{x:I.x,y:I.y,width:i,height:Math.max(I.h,2),fill:D,rx:2}),e.jsx("text",{x:I.x<h/2?I.x+i+4:I.x-4,y:I.y+I.h/2,textAnchor:I.x<h/2?"start":"end",dominantBaseline:"middle",className:"nice-chart__legend-text",children:z.label})]},z.id)})]})})},Xd=Object.freeze(Object.defineProperty({__proto__:null,NiceSankey:Ba},Symbol.toStringTag,{value:"Module"})),In=({data:t,min:a,max:r,start:n,end:i,onChange:o,width:c=500,height:l=100,step:d=1,formatValue:p,chartColor:h="#3b82f6",className:u,style:g})=>{const f={top:10,bottom:30,left:10,right:10},m=c-f.left-f.right,b=l-f.top-f.bottom,C=k=>f.left+(k-a)/(r-a||1)*m,v=k=>{const M=Math.max(0,Math.min(1,(k-f.left)/m)),_=a+M*(r-a);return Math.round(_/d)*d},w=(k,M)=>{M.preventDefault();const _=M.target.closest("svg");if(!_)return;const j=P=>{const I=_.getBoundingClientRect(),D=v(P.clientX-I.left);k==="start"?o(Math.min(D,i),i):o(n,Math.max(D,n))},z=()=>{document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",z)};document.addEventListener("pointermove",j),document.addEventListener("pointerup",z)},y=t?Math.min(...t):0,S=(t?Math.max(...t):1)-y||1;return e.jsx("div",{className:`nice-rangeselector ${u||""}`,style:g,children:e.jsxs("svg",{width:c,height:l,children:[t&&t.length>1&&e.jsx("polygon",{points:`${f.left},${f.top+b} ${t.map((k,M)=>`${f.left+M/(t.length-1)*m},${f.top+b-(k-y)/S*b}`).join(" ")} ${f.left+m},${f.top+b}`,fill:h,opacity:.15}),e.jsx("rect",{x:C(n),y:f.top,width:C(i)-C(n),height:b,fill:h,opacity:.1}),e.jsx("rect",{x:f.left,y:f.top,width:C(n)-f.left,height:b,fill:"var(--bg-secondary, #f5f5f5)",opacity:.6}),e.jsx("rect",{x:C(i),y:f.top,width:f.left+m-C(i),height:b,fill:"var(--bg-secondary, #f5f5f5)",opacity:.6}),e.jsx("rect",{x:C(n)-4,y:f.top,width:8,height:b,fill:h,rx:2,cursor:"ew-resize",onPointerDown:k=>w("start",k)}),e.jsx("rect",{x:C(i)-4,y:f.top,width:8,height:b,fill:h,rx:2,cursor:"ew-resize",onPointerDown:k=>w("end",k)}),e.jsx("text",{x:C(n),y:f.top+b+18,textAnchor:"middle",className:"nice-chart__axis-label",children:p?p(n):n}),e.jsx("text",{x:C(i),y:f.top+b+18,textAnchor:"middle",className:"nice-chart__axis-label",children:p?p(i):i})]})})},Wa=({regions:t,width:a=600,height:r=400,viewBox:n="0 0 1000 600",colorRange:i=["#dbeafe","#1d4ed8"],maxValue:o,onRegionClick:c,selectedRegionId:l,title:d,showTooltip:p=!0,className:h,style:u})=>{const g=o??Math.max(...t.map(m=>m.value??0),1),f=m=>{const b=z=>[parseInt(z.slice(1,3),16),parseInt(z.slice(3,5),16),parseInt(z.slice(5,7),16)],[C,v,w]=b(i[0]),[y,S,k]=b(i[1]),M=Math.round(C+(y-C)*m),_=Math.round(v+(S-v)*m),j=Math.round(w+(k-w)*m);return`rgb(${M},${_},${j})`};return e.jsxs("div",{className:`nice-vectormap ${h||""}`,style:u,children:[d&&e.jsx("div",{className:"nice-vectormap__title",children:d}),e.jsx("svg",{width:a,height:r,viewBox:n,children:t.map(m=>{const b=m.value!=null?Math.max(0,Math.min(1,m.value/g)):0,C=m.value!=null?f(b):"var(--bg-tertiary, #e5e7eb)",v=m.id===l;return e.jsx("path",{d:m.path,fill:C,stroke:v?"var(--color-primary, #3b82f6)":"var(--border-color, #d1d5db)",strokeWidth:v?2:.5,cursor:c?"pointer":void 0,onClick:()=>c==null?void 0:c(m),children:p&&e.jsx("title",{children:`${m.name}${m.value!=null?`: ${m.value}`:""}`})},m.id)})})]})},Jd=Object.freeze(Object.defineProperty({__proto__:null,NiceVectorMap:Wa},Symbol.toStringTag,{value:"Module"})),Qd=`
|
|
67
|
+
.nice-forecast-chart {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
71
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
72
|
+
border-radius: 0.5rem;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.nice-forecast-chart__header {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: space-between;
|
|
80
|
+
padding: 0.75rem 1rem;
|
|
81
|
+
border-bottom: 1px solid var(--nice-border-color, #e5e7eb);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.nice-forecast-chart__title {
|
|
85
|
+
font-size: 1rem;
|
|
86
|
+
font-weight: 600;
|
|
87
|
+
color: var(--nice-text-primary);
|
|
88
|
+
margin: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.nice-forecast-chart__actions {
|
|
92
|
+
display: flex;
|
|
93
|
+
gap: 0.5rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.nice-forecast-chart__btn {
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
width: 2rem;
|
|
101
|
+
height: 2rem;
|
|
102
|
+
font-size: 1rem;
|
|
103
|
+
border-radius: 0.375rem;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
transition: all 0.15s ease;
|
|
106
|
+
border: 1px solid var(--nice-border-color, #d1d5db);
|
|
107
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
108
|
+
color: var(--nice-text-secondary);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.nice-forecast-chart__btn:hover {
|
|
112
|
+
background: var(--nice-bg-hover, #f3f4f6);
|
|
113
|
+
color: var(--nice-text-primary);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.nice-forecast-chart__btn:disabled {
|
|
117
|
+
opacity: 0.5;
|
|
118
|
+
cursor: not-allowed;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.nice-forecast-chart__container {
|
|
122
|
+
position: relative;
|
|
123
|
+
width: 100%;
|
|
124
|
+
padding: 1rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.nice-forecast-chart__svg {
|
|
128
|
+
width: 100%;
|
|
129
|
+
overflow: visible;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.nice-forecast-chart__grid-line {
|
|
133
|
+
stroke: var(--nice-border-divider, #f3f4f6);
|
|
134
|
+
stroke-width: 1;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.nice-forecast-chart__axis-line {
|
|
138
|
+
stroke: var(--nice-border-color, #e5e7eb);
|
|
139
|
+
stroke-width: 1;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.nice-forecast-chart__axis-label {
|
|
143
|
+
font-size: 0.6875rem;
|
|
144
|
+
fill: var(--nice-text-secondary);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.nice-forecast-chart__axis-title {
|
|
148
|
+
font-size: 0.75rem;
|
|
149
|
+
font-weight: 500;
|
|
150
|
+
fill: var(--nice-text-primary);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.nice-forecast-chart__historical-line {
|
|
154
|
+
fill: none;
|
|
155
|
+
stroke-width: 2;
|
|
156
|
+
stroke-linecap: round;
|
|
157
|
+
stroke-linejoin: round;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.nice-forecast-chart__forecast-line {
|
|
161
|
+
fill: none;
|
|
162
|
+
stroke-width: 2;
|
|
163
|
+
stroke-linecap: round;
|
|
164
|
+
stroke-linejoin: round;
|
|
165
|
+
stroke-dasharray: 6, 4;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.nice-forecast-chart__confidence-band {
|
|
169
|
+
opacity: 0.2;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.nice-forecast-chart__forecast-region {
|
|
173
|
+
fill: var(--nice-bg-secondary, #f9fafb);
|
|
174
|
+
opacity: 0.5;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.nice-forecast-chart__point {
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
transition: r 0.15s ease;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.nice-forecast-chart__point:hover {
|
|
183
|
+
r: 6;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.nice-forecast-chart__annotation-line {
|
|
187
|
+
stroke-dasharray: 4, 2;
|
|
188
|
+
stroke-width: 1;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.nice-forecast-chart__annotation-marker {
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
transition: transform 0.15s ease;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.nice-forecast-chart__annotation-marker:hover {
|
|
197
|
+
transform: scale(1.2);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.nice-forecast-chart__reference-line {
|
|
201
|
+
stroke-width: 1;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.nice-forecast-chart__reference-label {
|
|
205
|
+
font-size: 0.625rem;
|
|
206
|
+
fill: var(--nice-text-secondary);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.nice-forecast-chart__cash-runway {
|
|
210
|
+
pointer-events: none;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.nice-forecast-chart__cash-runway-line {
|
|
214
|
+
stroke: #ef4444;
|
|
215
|
+
stroke-width: 2;
|
|
216
|
+
stroke-dasharray: 8, 4;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.nice-forecast-chart__cash-runway-label-bg {
|
|
220
|
+
fill: #ef4444;
|
|
221
|
+
rx: 4;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.nice-forecast-chart__cash-runway-label {
|
|
225
|
+
font-size: 0.6875rem;
|
|
226
|
+
font-weight: 600;
|
|
227
|
+
fill: #ffffff;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.nice-forecast-chart__cash-runway-date {
|
|
231
|
+
font-size: 0.625rem;
|
|
232
|
+
fill: #ef4444;
|
|
233
|
+
font-weight: 500;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.nice-forecast-chart__tooltip {
|
|
237
|
+
position: absolute;
|
|
238
|
+
pointer-events: none;
|
|
239
|
+
z-index: 100;
|
|
240
|
+
padding: 0.75rem;
|
|
241
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
242
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
243
|
+
border-radius: 0.5rem;
|
|
244
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
245
|
+
font-size: 0.8125rem;
|
|
246
|
+
max-width: 250px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.nice-forecast-chart__tooltip-date {
|
|
250
|
+
font-weight: 600;
|
|
251
|
+
color: var(--nice-text-primary);
|
|
252
|
+
margin-bottom: 0.5rem;
|
|
253
|
+
padding-bottom: 0.5rem;
|
|
254
|
+
border-bottom: 1px solid var(--nice-border-divider, #f3f4f6);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.nice-forecast-chart__tooltip-item {
|
|
258
|
+
display: flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
gap: 0.5rem;
|
|
261
|
+
margin-bottom: 0.25rem;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.nice-forecast-chart__tooltip-color {
|
|
265
|
+
width: 10px;
|
|
266
|
+
height: 10px;
|
|
267
|
+
border-radius: 2px;
|
|
268
|
+
flex-shrink: 0;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.nice-forecast-chart__tooltip-label {
|
|
272
|
+
color: var(--nice-text-secondary);
|
|
273
|
+
flex: 1;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.nice-forecast-chart__tooltip-value {
|
|
277
|
+
font-weight: 600;
|
|
278
|
+
color: var(--nice-text-primary);
|
|
279
|
+
font-variant-numeric: tabular-nums;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.nice-forecast-chart__tooltip-confidence {
|
|
283
|
+
font-size: 0.75rem;
|
|
284
|
+
color: var(--nice-text-tertiary);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.nice-forecast-chart__legend {
|
|
288
|
+
display: flex;
|
|
289
|
+
flex-wrap: wrap;
|
|
290
|
+
gap: 1rem;
|
|
291
|
+
padding: 0.75rem 1rem;
|
|
292
|
+
border-top: 1px solid var(--nice-border-color, #e5e7eb);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.nice-forecast-chart__legend-item {
|
|
296
|
+
display: flex;
|
|
297
|
+
align-items: center;
|
|
298
|
+
gap: 0.375rem;
|
|
299
|
+
font-size: 0.8125rem;
|
|
300
|
+
color: var(--nice-text-secondary);
|
|
301
|
+
cursor: pointer;
|
|
302
|
+
user-select: none;
|
|
303
|
+
transition: opacity 0.15s ease;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.nice-forecast-chart__legend-item:hover {
|
|
307
|
+
color: var(--nice-text-primary);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.nice-forecast-chart__legend-item--hidden {
|
|
311
|
+
opacity: 0.4;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.nice-forecast-chart__legend-color {
|
|
315
|
+
width: 16px;
|
|
316
|
+
height: 3px;
|
|
317
|
+
border-radius: 1px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.nice-forecast-chart__legend-color--dashed {
|
|
321
|
+
background: repeating-linear-gradient(
|
|
322
|
+
90deg,
|
|
323
|
+
currentColor,
|
|
324
|
+
currentColor 4px,
|
|
325
|
+
transparent 4px,
|
|
326
|
+
transparent 6px
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.nice-forecast-chart__empty {
|
|
331
|
+
display: flex;
|
|
332
|
+
align-items: center;
|
|
333
|
+
justify-content: center;
|
|
334
|
+
height: 300px;
|
|
335
|
+
color: var(--nice-text-secondary);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/* Dark mode */
|
|
339
|
+
.dark .nice-forecast-chart {
|
|
340
|
+
background: var(--nice-bg-primary-dark, #111827);
|
|
341
|
+
border-color: var(--nice-border-color-dark, #374151);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.dark .nice-forecast-chart__tooltip {
|
|
345
|
+
background: var(--nice-bg-secondary-dark, #1f2937);
|
|
346
|
+
border-color: var(--nice-border-color-dark, #374151);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.dark .nice-forecast-chart__forecast-region {
|
|
350
|
+
fill: var(--nice-bg-secondary-dark, #1f2937);
|
|
351
|
+
}
|
|
352
|
+
`,Dr=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#f97316"];function Je(t){return t instanceof Date?t:new Date(t)}function ba(t,a="pl-PL"){return t.toLocaleDateString(a,{year:"numeric",month:"short",day:"numeric"})}function ea(t,a="pl-PL"){return new Intl.NumberFormat(a,{minimumFractionDigits:0,maximumFractionDigits:2}).format(t)}s.forwardRef(function(t,a){var U,Q;const{scenarios:r,annotations:n=[],referenceLines:i=[],forecastStartDate:o,cashRunway:c,xAxis:l,yAxis:d,confidenceBands:p=[{level:95,color:"#3b82f6",opacity:.15}],tooltip:h,legend:u={enabled:!0,position:"bottom",interactive:!0},height:g=350,showForecastRegion:f=!0,lineWidth:m=2,showPoints:b=!1,pointRadius:C=4,enableZoom:v=!1,animationDuration:w=300,responsive:y=!0,onPointClick:S,onAnnotationClick:k,onScenarioToggle:M,onViewportChange:_,size:j="medium",disabled:z=!1,labels:P={},locale:I="pl-PL",className:D,style:T}=t,[N,H]=s.useState(()=>r.map((W,Z)=>({...W,color:W.color??Dr[Z%Dr.length],visible:W.visible!==!1}))),[E,R]=s.useState(null),[x,$]=s.useState({x:0,y:0}),A=s.useRef(null),O=s.useRef(null),F={top:20,right:30,bottom:40,left:60},[L,G]=s.useState({width:600,height:typeof g=="number"?g:350});s.useEffect(()=>{if(!y||!A.current)return;const W=new ResizeObserver(Z=>{for(const te of Z)G(ee=>({width:te.contentRect.width,height:ee.height}))});return W.observe(A.current),()=>W.disconnect()},[y]),s.useEffect(()=>{const W="nice-forecast-chart-styles";if(!document.getElementById(W)){const Z=document.createElement("style");Z.id=W,Z.textContent=Qd,document.head.appendChild(Z)}},[]);const{xScale:V,yScale:B,allDates:Y,minY:J,maxY:me}=s.useMemo(()=>{const W=N.filter(De=>De.visible!==!1).flatMap(De=>De.data);if(W.length===0)return{xScale:()=>0,yScale:()=>0,allDates:[],minY:0,maxY:100};const Z=W.map(De=>Je(De.date).getTime()),te=Math.min(...Z),ee=Math.max(...Z),ie=W.flatMap(De=>[De.value,De.forecast,De.lowerBound,De.upperBound]).filter(De=>De!=null),ne=(d==null?void 0:d.min)??Math.min(...ie)*.95,Ce=(d==null?void 0:d.max)??Math.max(...ie)*1.05,ue=L.width-F.left-F.right,$e=L.height-F.top-F.bottom,ze=De=>{const at=typeof De=="number"?De:De.getTime();return F.left+(at-te)/(ee-te)*ue},Te=De=>F.top+$e-(De-ne)/(Ce-ne)*$e,Ve=[...new Set(Z)].sort((De,at)=>De-at).map(De=>new Date(De));return{xScale:ze,yScale:Te,allDates:Ve,minY:ne,maxY:Ce}},[N,L,F,d]),de=o?Je(o):null,oe=s.useMemo(()=>{if(!(c!=null&&c.enabled))return null;const W=c.threshold??0,Z=c.scenarioId?N.find(ee=>ee.id===c.scenarioId&&ee.visible!==!1):N.find(ee=>ee.visible!==!1);if(!Z)return null;const te=Z.data.sort((ee,ie)=>Je(ee.date).getTime()-Je(ie.date).getTime());for(let ee=1;ee<te.length;ee++){const ie=te[ee-1],ne=te[ee],Ce=ie.forecast??ie.value,ue=ne.forecast??ne.value;if(Ce!=null&&ue!=null&&Ce>W&&ue<=W){const $e=(Ce-W)/(Ce-ue),ze=Je(ie.date).getTime(),Te=Je(ne.date).getTime(),Ve=ze+$e*(Te-ze);return new Date(Ve)}}return null},[c,N]),ae=s.useCallback((W,Z)=>{const te=W.filter(ee=>ee[Z]!=null).map(ee=>({x:V(Je(ee.date)),y:B(ee[Z])}));return te.length===0?"":`M ${te.map(ee=>`${ee.x},${ee.y}`).join(" L ")}`},[V,B]),ve=s.useCallback(W=>{const Z=W.filter(ie=>ie.lowerBound!=null&&ie.upperBound!=null);if(Z.length===0)return"";const te=Z.map(ie=>({x:V(Je(ie.date)),y:B(ie.upperBound)})),ee=Z.map(ie=>({x:V(Je(ie.date)),y:B(ie.lowerBound)})).reverse();return`M ${te.map(ie=>`${ie.x},${ie.y}`).join(" L ")} L ${ee.map(ie=>`${ie.x},${ie.y}`).join(" L ")} Z`},[V,B]),re=s.useCallback(W=>{if(!O.current||(h==null?void 0:h.enabled)===!1)return;const Z=O.current.getBoundingClientRect(),te=W.clientX-Z.left;W.clientY-Z.top;let ee=null,ie=1/0;for(const ne of Y){const Ce=V(ne),ue=Math.abs(Ce-te);ue<ie&&(ie=ue,ee=ne)}if(ee&&ie<50){const ne=N.filter(ue=>ue.visible!==!1).map(ue=>{const $e=ue.data.find(ze=>Je(ze.date).getTime()===ee.getTime());return{scenario:ue,value:$e==null?void 0:$e.value,forecast:$e==null?void 0:$e.forecast,lowerBound:$e==null?void 0:$e.lowerBound,upperBound:$e==null?void 0:$e.upperBound}}),Ce=n.filter(ue=>Math.abs(Je(ue.date).getTime()-ee.getTime())<864e5);R({date:ee,values:ne,annotations:Ce}),$({x:W.clientX-Z.left+10,y:W.clientY-Z.top-10})}else R(null)},[V,Y,N,n,h]),he=s.useCallback(W=>{if(!u.interactive)return;H(te=>te.map(ee=>ee.id===W?{...ee,visible:!ee.visible}:ee));const Z=N.find(te=>te.id===W);Z&&(M==null||M(W,!Z.visible))},[u.interactive,N,M]);s.useImperativeHandle(a,()=>({getScenarios:()=>N,updateScenario:(W,Z)=>{H(te=>te.map(ee=>ee.id===W?{...ee,data:Z}:ee))},toggleScenario:he,setZoomRange:()=>{},resetZoom:()=>{},exportImage:W=>{if(!O.current)return null;const Z=O.current,te=new XMLSerializer().serializeToString(Z);return`data:image/svg+xml;base64,${btoa(te)}`},getDataAtDate:W=>{const Z=N.filter(te=>te.visible!==!1).map(te=>{const ee=te.data.find(ie=>Je(ie.date).getTime()===W.getTime());return{scenario:te,value:ee==null?void 0:ee.value,forecast:ee==null?void 0:ee.forecast,lowerBound:ee==null?void 0:ee.lowerBound,upperBound:ee==null?void 0:ee.upperBound}});return{date:W,values:Z,annotations:n.filter(te=>Je(te.date).getTime()===W.getTime())}}}),[N,n,he]),L.width-F.left-F.right;const we=L.height-F.top-F.bottom,le=s.useMemo(()=>{const W=(d==null?void 0:d.tickCount)??5,Z=[],te=(me-J)/(W-1);for(let ee=0;ee<W;ee++)Z.push(J+te*ee);return Z},[J,me,d==null?void 0:d.tickCount]),ke=s.useMemo(()=>{const W=(l==null?void 0:l.tickCount)??6;if(Y.length===0)return[];const Z=Math.max(1,Math.floor(Y.length/(W-1)));return Y.filter((te,ee)=>ee%Z===0||ee===Y.length-1)},[Y,l==null?void 0:l.tickCount]);return N.length===0||N.every(W=>W.data.length===0)?e.jsx("div",{className:`nice-forecast-chart ${D??""}`,style:T,children:e.jsx("div",{className:"nice-forecast-chart__empty",children:P.noData??"No data available"})}):e.jsxs("div",{className:`nice-forecast-chart ${D??""}`,style:{...T,height:g},children:[e.jsxs("div",{ref:A,className:"nice-forecast-chart__container",children:[e.jsxs("svg",{ref:O,className:"nice-forecast-chart__svg",width:L.width,height:L.height,onMouseMove:re,onMouseLeave:()=>R(null),children:[(d==null?void 0:d.showGrid)!==!1&&le.map(W=>e.jsx("line",{className:"nice-forecast-chart__grid-line",x1:F.left,x2:L.width-F.right,y1:B(W),y2:B(W)},W)),f&&de&&e.jsx("rect",{className:"nice-forecast-chart__forecast-region",x:V(de),y:F.top,width:L.width-F.right-V(de),height:we}),i.map(W=>e.jsxs("g",{children:[e.jsx("line",{className:"nice-forecast-chart__reference-line",x1:F.left,x2:L.width-F.right,y1:B(W.value),y2:B(W.value),stroke:W.color??"#9ca3af",strokeDasharray:W.dashArray??"4,2"}),W.label&&e.jsx("text",{className:"nice-forecast-chart__reference-label",x:L.width-F.right-4,y:B(W.value)-4,textAnchor:"end",children:W.label})]},W.id)),oe&&(c==null?void 0:c.enabled)&&e.jsxs("g",{className:"nice-forecast-chart__cash-runway",children:[e.jsx("line",{className:"nice-forecast-chart__cash-runway-line",x1:V(oe),x2:V(oe),y1:F.top,y2:L.height-F.bottom,stroke:c.color??"#ef4444"}),c.showLabel!==!1&&e.jsxs(e.Fragment,{children:[e.jsx("rect",{className:"nice-forecast-chart__cash-runway-label-bg",x:V(oe)-60,y:F.top-2,width:120,height:c.showDate!==!1?32:20,fill:c.color??"#ef4444",rx:4}),e.jsx("text",{className:"nice-forecast-chart__cash-runway-label",x:V(oe),y:F.top+12,textAnchor:"middle",fill:"#ffffff",children:c.label??P.cashRunsOut??"💰 Cash runs out"}),c.showDate!==!1&&e.jsx("text",{className:"nice-forecast-chart__cash-runway-label",x:V(oe),y:F.top+26,textAnchor:"middle",fill:"#ffffff",style:{fontSize:"0.625rem",opacity:.9},children:ba(oe,I)})]})]}),N.filter(W=>W.visible!==!1&&W.showConfidenceBand).map(W=>e.jsx("path",{className:"nice-forecast-chart__confidence-band",d:ve(W.data),fill:W.color},`band-${W.id}`)),N.filter(W=>W.visible!==!1).map(W=>{const Z=de?W.data.filter(ee=>Je(ee.date)<de):W.data.filter(ee=>ee.value!=null),te=de?W.data.filter(ee=>Je(ee.date)>=de):W.data.filter(ee=>ee.forecast!=null);return e.jsxs("g",{children:[e.jsx("path",{className:"nice-forecast-chart__historical-line",d:ae(Z,"value"),stroke:W.color,strokeWidth:m}),e.jsx("path",{className:"nice-forecast-chart__forecast-line",d:ae(te,de?"value":"forecast"),stroke:W.color,strokeWidth:m}),te.length>0&&W.data.some(ee=>ee.forecast!=null)&&e.jsx("path",{className:"nice-forecast-chart__forecast-line",d:ae(W.data,"forecast"),stroke:W.color,strokeWidth:m}),b&&W.data.map((ee,ie)=>{const ne=ee.value??ee.forecast;return ne==null?null:e.jsx("circle",{className:"nice-forecast-chart__point",cx:V(Je(ee.date)),cy:B(ne),r:C,fill:W.color,onClick:()=>S==null?void 0:S(ee,W)},ie)})]},W.id)}),n.map(W=>{const Z=V(Je(W.date));return e.jsxs("g",{className:"nice-forecast-chart__annotation-marker",onClick:()=>k==null?void 0:k(W),children:[W.showLine!==!1&&e.jsx("line",{className:"nice-forecast-chart__annotation-line",x1:Z,x2:Z,y1:F.top,y2:L.height-F.bottom,stroke:W.color??"#9ca3af"}),e.jsx("circle",{cx:Z,cy:F.top+10,r:8,fill:W.color??"#9ca3af"}),e.jsx("text",{x:Z,y:F.top+14,textAnchor:"middle",fill:"white",fontSize:"10",children:W.icon??"!"})]},W.id)}),e.jsx("line",{className:"nice-forecast-chart__axis-line",x1:F.left,x2:F.left,y1:F.top,y2:L.height-F.bottom}),e.jsx("line",{className:"nice-forecast-chart__axis-line",x1:F.left,x2:L.width-F.right,y1:L.height-F.bottom,y2:L.height-F.bottom}),le.map(W=>e.jsx("text",{className:"nice-forecast-chart__axis-label",x:F.left-8,y:B(W)+4,textAnchor:"end",children:d!=null&&d.format?d.format(W):ea(W,I)},W)),ke.map(W=>e.jsx("text",{className:"nice-forecast-chart__axis-label",x:V(W),y:L.height-F.bottom+16,textAnchor:"middle",children:l!=null&&l.format?l.format(W):ba(W,I)},W.getTime())),(d==null?void 0:d.title)&&e.jsx("text",{className:"nice-forecast-chart__axis-title",x:15,y:L.height/2,textAnchor:"middle",transform:`rotate(-90, 15, ${L.height/2})`,children:d.title})]}),E&&e.jsxs("div",{className:"nice-forecast-chart__tooltip",style:{left:x.x,top:x.y},children:[e.jsx("div",{className:"nice-forecast-chart__tooltip-date",children:ba(E.date,I)}),E.values.map(W=>{const Z=W.value??W.forecast;return Z==null?null:e.jsxs("div",{className:"nice-forecast-chart__tooltip-item",children:[e.jsx("span",{className:"nice-forecast-chart__tooltip-color",style:{background:W.scenario.color}}),e.jsx("span",{className:"nice-forecast-chart__tooltip-label",children:W.scenario.name}),e.jsx("span",{className:"nice-forecast-chart__tooltip-value",children:ea(Z,I)})]},W.scenario.id)}),E.values.some(W=>W.lowerBound!=null)&&e.jsxs("div",{className:"nice-forecast-chart__tooltip-confidence",children:[P.confidence??"CI",":"," ",ea(((U=E.values[0])==null?void 0:U.lowerBound)??0,I)," –"," ",ea(((Q=E.values[0])==null?void 0:Q.upperBound)??0,I)]})]})]}),u.enabled&&e.jsx("div",{className:"nice-forecast-chart__legend",children:N.map(W=>e.jsxs("div",{className:`nice-forecast-chart__legend-item ${W.visible===!1?"nice-forecast-chart__legend-item--hidden":""}`,onClick:()=>he(W.id),children:[e.jsx("span",{className:`nice-forecast-chart__legend-color ${W.isBase?"":"nice-forecast-chart__legend-color--dashed"}`,style:{background:W.color}}),W.name]},W.id))})]})});const eu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#06b6d4","#84cc16","#f97316","#6366f1"],Pn=s.forwardRef((t,a)=>{var A,O;const{levels:r,initialLevelId:n,chartType:i="bar",width:o=600,height:c=400,showBreadcrumbs:l=!0,showBackButton:d=!0,animationDuration:p=300,onLevelChange:h,onItemClick:u,colors:g=eu,showValues:f=!0,showLegend:m=!0,className:b,style:C,...v}=t,[w,y]=s.useState(n||((A=r[0])==null?void 0:A.id)),[S,k]=s.useState([n||((O=r[0])==null?void 0:O.id)]),[M,_]=s.useState(!1),[j,z]=s.useState("in"),P=s.useMemo(()=>r.find(F=>F.id===w),[r,w]),I=s.useCallback(F=>{r.find(L=>L.id===F)&&(z("in"),_(!0),setTimeout(()=>{y(F),k(L=>[...L,F]),h==null||h(F,[...S,F]),_(!1)},p/2))},[r,S,p,h]),D=s.useCallback(()=>{if(S.length<=1)return;z("out"),_(!0);const F=S.slice(0,-1),L=F[F.length-1];setTimeout(()=>{y(L),k(F),h==null||h(L,F),_(!1)},p/2)},[S,p,h]),T=s.useCallback(()=>{var L;const F=(L=r[0])==null?void 0:L.id;F&&(z("out"),_(!0),setTimeout(()=>{y(F),k([F]),h==null||h(F,[F]),_(!1)},p/2))},[r,p,h]);s.useImperativeHandle(a,()=>({drillDown:I,drillUp:D,resetToRoot:T,getCurrentLevel:()=>w,getPath:()=>S}),[I,D,T,w,S]);const N=s.useCallback((F,L)=>{u==null||u(F,w);const G=r.find(V=>{var B;return V.parentId===w&&V.id===((B=F.metadata)==null?void 0:B.childLevelId)});G&&I(G.id)},[w,r,I,u]),H=s.useMemo(()=>(P==null?void 0:P.data.reduce((F,L)=>F+L.value,0))||0,[P]),E=s.useMemo(()=>S.map(F=>{var L;return((L=r.find(G=>G.id===F))==null?void 0:L.label)||F}),[S,r]),R=()=>{if(!P)return null;const F=P.data,L=Math.max(...F.map(V=>V.value)),G=Math.min(40,(c-100)/F.length-8);return e.jsx("div",{className:"nice-drilldown-bars",children:F.map((V,B)=>{const Y=V.value/L*100;return e.jsxs("div",{className:"nice-drilldown-bar-row",onClick:()=>N(V,B),children:[e.jsx("span",{className:"nice-drilldown-bar-label",children:V.label||`Item ${B+1}`}),e.jsx("div",{className:"nice-drilldown-bar-track",children:e.jsx("div",{className:"nice-drilldown-bar-fill",style:{width:`${Y}%`,backgroundColor:V.color||g[B%g.length],height:G}})}),f&&e.jsx("span",{className:"nice-drilldown-bar-value",children:V.value.toLocaleString()})]},B)})})},x=()=>{if(!P)return null;const F=P.data,L=o/2,G=(c-60)/2+30,V=Math.min(L,G)-40;let B=-90;const Y=F.map((J,me)=>{const de=J.value/H*360,oe=B+de,ae=de>180?1:0,ve=B*Math.PI/180,re=oe*Math.PI/180,he=L+V*Math.cos(ve),we=G+V*Math.sin(ve),le=L+V*Math.cos(re),ke=G+V*Math.sin(re),U=(B+de/2)*Math.PI/180,Q=L+V*.7*Math.cos(U),W=G+V*.7*Math.sin(U),Z=`M ${L} ${G} L ${he} ${we} A ${V} ${V} 0 ${ae} 1 ${le} ${ke} Z`;return B=oe,{path:Z,color:J.color||g[me%g.length],label:J.label||`Item ${me+1}`,value:J.value,percentage:(J.value/H*100).toFixed(1),labelX:Q,labelY:W,item:J,index:me}});return e.jsx("svg",{width:o,height:c-40,className:"nice-drilldown-pie",children:e.jsx("g",{children:Y.map((J,me)=>e.jsxs("g",{onClick:()=>N(J.item,J.index),children:[e.jsx("path",{d:J.path,fill:J.color,stroke:"white",strokeWidth:2,className:"nice-drilldown-pie-slice"}),f&&parseFloat(J.percentage)>5&&e.jsxs("text",{x:J.labelX,y:J.labelY,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontSize:"12",fontWeight:"600",children:[J.percentage,"%"]})]},me))})})},$=()=>{if(!P)return null;const F=P.data,L=Math.max(...F.map(B=>B.value)),G=Math.min(60,(o-100)/F.length-8),V=c-100;return e.jsx("svg",{width:o,height:c-40,className:"nice-drilldown-columns",children:e.jsxs("g",{transform:"translate(50, 20)",children:[[0,.25,.5,.75,1].map((B,Y)=>e.jsxs("g",{children:[e.jsx("line",{x1:0,y1:V*(1-B),x2:o-80,y2:V*(1-B),stroke:"#e5e7eb",strokeDasharray:B===0?void 0:"4"}),e.jsx("text",{x:-8,y:V*(1-B),textAnchor:"end",dominantBaseline:"middle",fontSize:"11",fill:"#6b7280",children:Math.round(L*B).toLocaleString()})]},Y)),F.map((B,Y)=>{const J=B.value/L*V,me=Y*((o-100)/F.length)+((o-100)/F.length-G)/2;return e.jsxs("g",{onClick:()=>N(B,Y),children:[e.jsx("rect",{x:me,y:V-J,width:G,height:J,fill:B.color||g[Y%g.length],rx:4,className:"nice-drilldown-column-bar"}),e.jsx("text",{x:me+G/2,y:V+16,textAnchor:"middle",fontSize:"11",fill:"#374151",children:(B.label||`${Y+1}`).slice(0,10)}),f&&e.jsx("text",{x:me+G/2,y:V-J-8,textAnchor:"middle",fontSize:"11",fill:"#374151",fontWeight:"500",children:B.value.toLocaleString()})]},Y)})]})})};return e.jsxs("div",{className:`nice-drilldown-chart ${M?`animating ${j}`:""} ${b||""}`,style:{width:o,...C},...v,children:[e.jsxs("div",{className:"nice-drilldown-header",children:[d&&S.length>1&&e.jsx("button",{className:"nice-drilldown-back",onClick:D,children:"← Wstecz"}),l&&e.jsx("div",{className:"nice-drilldown-breadcrumbs",children:E.map((F,L)=>e.jsxs(s.Fragment,{children:[L>0&&e.jsx("span",{className:"nice-drilldown-separator",children:"/"}),e.jsx("span",{className:`nice-drilldown-crumb ${L===E.length-1?"active":""}`,onClick:()=>{if(L<E.length-1){const G=S.slice(0,L+1);k(G),y(G[G.length-1])}},children:F})]},L))})]}),e.jsxs("div",{className:"nice-drilldown-content",style:{height:c-40},children:[i==="bar"&&R(),i==="pie"&&x(),i==="column"&&$()]}),m&&P&&e.jsx("div",{className:"nice-drilldown-legend",children:P.data.map((F,L)=>e.jsxs("div",{className:"nice-drilldown-legend-item",children:[e.jsx("span",{className:"nice-drilldown-legend-color",style:{backgroundColor:F.color||g[L%g.length]}}),e.jsx("span",{className:"nice-drilldown-legend-label",children:F.label||`Item ${L+1}`})]},L))}),e.jsx("style",{children:`
|
|
353
|
+
.nice-drilldown-chart {
|
|
354
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
355
|
+
background: white;
|
|
356
|
+
border-radius: 8px;
|
|
357
|
+
overflow: hidden;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.nice-drilldown-header {
|
|
361
|
+
display: flex;
|
|
362
|
+
align-items: center;
|
|
363
|
+
gap: 12px;
|
|
364
|
+
padding: 12px 16px;
|
|
365
|
+
border-bottom: 1px solid #e5e7eb;
|
|
366
|
+
min-height: 40px;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.nice-drilldown-back {
|
|
370
|
+
background: #f3f4f6;
|
|
371
|
+
border: none;
|
|
372
|
+
padding: 6px 12px;
|
|
373
|
+
border-radius: 6px;
|
|
374
|
+
cursor: pointer;
|
|
375
|
+
font-size: 13px;
|
|
376
|
+
color: #374151;
|
|
377
|
+
transition: background 0.2s;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.nice-drilldown-back:hover {
|
|
381
|
+
background: #e5e7eb;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.nice-drilldown-breadcrumbs {
|
|
385
|
+
display: flex;
|
|
386
|
+
align-items: center;
|
|
387
|
+
gap: 4px;
|
|
388
|
+
font-size: 13px;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.nice-drilldown-separator {
|
|
392
|
+
color: #9ca3af;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.nice-drilldown-crumb {
|
|
396
|
+
color: #6b7280;
|
|
397
|
+
cursor: pointer;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.nice-drilldown-crumb:hover:not(.active) {
|
|
401
|
+
color: #3b82f6;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.nice-drilldown-crumb.active {
|
|
405
|
+
color: #111827;
|
|
406
|
+
font-weight: 500;
|
|
407
|
+
cursor: default;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.nice-drilldown-content {
|
|
411
|
+
padding: 16px;
|
|
412
|
+
transition: opacity 0.15s, transform 0.15s;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.nice-drilldown-chart.animating .nice-drilldown-content {
|
|
416
|
+
opacity: 0;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.nice-drilldown-chart.animating.in .nice-drilldown-content {
|
|
420
|
+
transform: translateX(20px);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.nice-drilldown-chart.animating.out .nice-drilldown-content {
|
|
424
|
+
transform: translateX(-20px);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.nice-drilldown-bars {
|
|
428
|
+
display: flex;
|
|
429
|
+
flex-direction: column;
|
|
430
|
+
gap: 8px;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.nice-drilldown-bar-row {
|
|
434
|
+
display: flex;
|
|
435
|
+
align-items: center;
|
|
436
|
+
gap: 12px;
|
|
437
|
+
cursor: pointer;
|
|
438
|
+
padding: 4px 8px;
|
|
439
|
+
margin: -4px -8px;
|
|
440
|
+
border-radius: 6px;
|
|
441
|
+
transition: background 0.2s;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.nice-drilldown-bar-row:hover {
|
|
445
|
+
background: #f9fafb;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.nice-drilldown-bar-label {
|
|
449
|
+
width: 120px;
|
|
450
|
+
font-size: 13px;
|
|
451
|
+
color: #374151;
|
|
452
|
+
overflow: hidden;
|
|
453
|
+
text-overflow: ellipsis;
|
|
454
|
+
white-space: nowrap;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.nice-drilldown-bar-track {
|
|
458
|
+
flex: 1;
|
|
459
|
+
background: #f3f4f6;
|
|
460
|
+
border-radius: 6px;
|
|
461
|
+
overflow: hidden;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.nice-drilldown-bar-fill {
|
|
465
|
+
transition: width 0.3s ease;
|
|
466
|
+
border-radius: 6px;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.nice-drilldown-bar-value {
|
|
470
|
+
width: 80px;
|
|
471
|
+
text-align: right;
|
|
472
|
+
font-size: 13px;
|
|
473
|
+
font-weight: 500;
|
|
474
|
+
color: #111827;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.nice-drilldown-pie-slice {
|
|
478
|
+
cursor: pointer;
|
|
479
|
+
transition: transform 0.2s, opacity 0.2s;
|
|
480
|
+
transform-origin: center;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.nice-drilldown-pie-slice:hover {
|
|
484
|
+
opacity: 0.85;
|
|
485
|
+
transform: scale(1.02);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.nice-drilldown-column-bar {
|
|
489
|
+
cursor: pointer;
|
|
490
|
+
transition: opacity 0.2s;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.nice-drilldown-column-bar:hover {
|
|
494
|
+
opacity: 0.8;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.nice-drilldown-legend {
|
|
498
|
+
display: flex;
|
|
499
|
+
flex-wrap: wrap;
|
|
500
|
+
gap: 16px;
|
|
501
|
+
padding: 12px 16px;
|
|
502
|
+
border-top: 1px solid #e5e7eb;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.nice-drilldown-legend-item {
|
|
506
|
+
display: flex;
|
|
507
|
+
align-items: center;
|
|
508
|
+
gap: 6px;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.nice-drilldown-legend-color {
|
|
512
|
+
width: 12px;
|
|
513
|
+
height: 12px;
|
|
514
|
+
border-radius: 3px;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.nice-drilldown-legend-label {
|
|
518
|
+
font-size: 12px;
|
|
519
|
+
color: #6b7280;
|
|
520
|
+
}
|
|
521
|
+
`})]})});Pn.displayName="NiceDrillDownChart";const Ln=s.forwardRef((t,a)=>{const{initialData:r=[],maxPoints:n=60,updateInterval:i=1e3,fetchData:o,width:c=600,height:l=200,chartType:d="line",color:p="#3b82f6",showGrid:h=!0,showTimeAxis:u=!0,showCurrentValue:g=!0,title:f,valueFormatter:m=J=>J.toFixed(2),timeFormatter:b=J=>new Date(J).toLocaleTimeString(),onDataUpdate:C,paused:v,className:w,style:y,...S}=t,[k,M]=s.useState(r),[_,j]=s.useState(v||!1),z=s.useRef();s.useEffect(()=>{v!==void 0&&j(v)},[v]),s.useEffect(()=>{if(_||!o)return;const J=async()=>{try{const me=await o();M(de=>{const oe=[...de,me].slice(-n);return C==null||C(oe),oe})}catch(me){console.error("Failed to fetch realtime data:",me)}};return z.current=setInterval(J,i),()=>{z.current&&clearInterval(z.current)}},[_,o,i,n,C]);const P=s.useCallback(J=>{M(me=>{const de=[...me,J].slice(-n);return C==null||C(de),de})},[n,C]),I=s.useCallback(()=>{M([]),C==null||C([])},[C]),D=s.useCallback(()=>j(!0),[]),T=s.useCallback(()=>j(!1),[]);s.useImperativeHandle(a,()=>({addDataPoint:P,clearData:I,pause:D,resume:T,getData:()=>k}),[P,I,k]);const N={top:20,right:60,bottom:u?40:20,left:50},H=c-N.left-N.right,E=l-N.top-N.bottom,R=k.map(J=>J.value),x=R.length?Math.min(...R):0,$=R.length?Math.max(...R):100,A=($-x||1)*.1,O=x-A,F=$+A-O,L=J=>N.left+J/(n-1)*H,G=J=>N.top+E-(J-O)/F*E,V=k.map((J,me)=>`${L(me)},${G(J.value)}`).join(" "),B=k.length>0?`M ${L(0)},${N.top+E} L ${V} L ${L(k.length-1)},${N.top+E} Z`:"",Y=k.length>0?k[k.length-1].value:null;return e.jsxs("div",{className:`nice-realtime-chart ${w||""}`,style:{width:c,...y},...S,children:[f&&e.jsxs("div",{className:"nice-realtime-header",children:[e.jsx("span",{className:"nice-realtime-title",children:f}),e.jsxs("div",{className:"nice-realtime-controls",children:[e.jsx("button",{className:`nice-realtime-btn ${_?"paused":""}`,onClick:()=>j(!_),children:_?"▶️":"⏸️"}),g&&Y!==null&&e.jsx("span",{className:"nice-realtime-value",children:m(Y)})]})]}),e.jsxs("svg",{width:c,height:l,className:"nice-realtime-svg",children:[h&&e.jsx("g",{className:"nice-realtime-grid",children:[0,.25,.5,.75,1].map((J,me)=>{const de=N.top+E*(1-J),oe=O+F*J;return e.jsxs("g",{children:[e.jsx("line",{x1:N.left,y1:de,x2:c-N.right,y2:de,stroke:"#e5e7eb",strokeDasharray:J===0?void 0:"3"}),e.jsx("text",{x:N.left-8,y:de,textAnchor:"end",dominantBaseline:"middle",fontSize:"10",fill:"#6b7280",children:m(oe)})]},me)})}),d==="area"&&k.length>0&&e.jsx("path",{d:B,fill:p,fillOpacity:.2}),k.length>1&&e.jsx("polyline",{points:V,fill:"none",stroke:p,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),k.length>0&&e.jsx("circle",{cx:L(k.length-1),cy:G(k[k.length-1].value),r:4,fill:p,className:"nice-realtime-point"}),u&&k.length>0&&e.jsx("g",{className:"nice-realtime-time-axis",children:[0,Math.floor(k.length/2),k.length-1].filter(J=>k[J]).map(J=>e.jsx("text",{x:L(J),y:l-8,textAnchor:"middle",fontSize:"10",fill:"#6b7280",children:b(k[J].timestamp)},J))})]}),e.jsxs("div",{className:`nice-realtime-status ${_?"paused":"live"}`,children:[e.jsx("span",{className:"nice-realtime-status-dot"}),e.jsx("span",{children:_?"Wstrzymano":"Na żywo"})]}),e.jsx("style",{children:`
|
|
522
|
+
.nice-realtime-chart {
|
|
523
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
524
|
+
background: white;
|
|
525
|
+
border-radius: 8px;
|
|
526
|
+
position: relative;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.nice-realtime-header {
|
|
530
|
+
display: flex;
|
|
531
|
+
justify-content: space-between;
|
|
532
|
+
align-items: center;
|
|
533
|
+
padding: 12px 16px;
|
|
534
|
+
border-bottom: 1px solid #e5e7eb;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.nice-realtime-title {
|
|
538
|
+
font-size: 14px;
|
|
539
|
+
font-weight: 600;
|
|
540
|
+
color: #111827;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.nice-realtime-controls {
|
|
544
|
+
display: flex;
|
|
545
|
+
align-items: center;
|
|
546
|
+
gap: 12px;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.nice-realtime-btn {
|
|
550
|
+
background: none;
|
|
551
|
+
border: none;
|
|
552
|
+
cursor: pointer;
|
|
553
|
+
font-size: 16px;
|
|
554
|
+
padding: 4px;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.nice-realtime-value {
|
|
558
|
+
font-size: 18px;
|
|
559
|
+
font-weight: 600;
|
|
560
|
+
color: ${p};
|
|
561
|
+
font-variant-numeric: tabular-nums;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.nice-realtime-point {
|
|
565
|
+
animation: realtime-pulse 1s ease-out infinite;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
@keyframes realtime-pulse {
|
|
569
|
+
0% { opacity: 1; transform: scale(1); }
|
|
570
|
+
50% { opacity: 0.5; transform: scale(1.5); }
|
|
571
|
+
100% { opacity: 1; transform: scale(1); }
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.nice-realtime-status {
|
|
575
|
+
position: absolute;
|
|
576
|
+
bottom: 8px;
|
|
577
|
+
right: 8px;
|
|
578
|
+
display: flex;
|
|
579
|
+
align-items: center;
|
|
580
|
+
gap: 6px;
|
|
581
|
+
font-size: 11px;
|
|
582
|
+
color: #6b7280;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.nice-realtime-status-dot {
|
|
586
|
+
width: 8px;
|
|
587
|
+
height: 8px;
|
|
588
|
+
border-radius: 50%;
|
|
589
|
+
background: #22c55e;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.nice-realtime-status.paused .nice-realtime-status-dot {
|
|
593
|
+
background: #f59e0b;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.nice-realtime-status.live .nice-realtime-status-dot {
|
|
597
|
+
animation: live-pulse 2s ease-in-out infinite;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
@keyframes live-pulse {
|
|
601
|
+
0%, 100% { opacity: 1; }
|
|
602
|
+
50% { opacity: 0.4; }
|
|
603
|
+
}
|
|
604
|
+
`})]})});Ln.displayName="NiceRealtimeChart";const Ha=s.forwardRef(({data:t,renderNode:a,selectable:r,selectedKey:n,onSelect:i,direction:o="top-down",collapsible:c=!0,className:l,style:d,id:p},h)=>{const u=Ae(p),[g,f]=s.useState(new Set),m=s.useCallback(v=>{f(w=>{const y=new Set(w);return y.has(v)?y.delete(v):y.add(v),y})},[]),b=s.useCallback(v=>{r&&(i==null||i(v))},[r,i]),C=s.useCallback(v=>{const w=g.has(v.key),y=v.children&&v.children.length>0;return e.jsxs("li",{className:"nice-org-chart__item",children:[e.jsxs("div",{className:`nice-org-chart__node${n===v.key?" nice-org-chart__node--selected":""}`,onClick:()=>b(v.key),role:r?"button":void 0,children:[a?a(v):e.jsx("span",{children:v.label}),c&&y&&e.jsx("button",{type:"button",className:"nice-org-chart__toggle",onClick:S=>{S.stopPropagation(),m(v.key)},"aria-label":w?"Expand":"Collapse",children:w?"+":"−"})]}),y&&!w&&e.jsx("ul",{className:"nice-org-chart__children",children:v.children.map(S=>C(S))})]},v.key)},[g,n,a,r,c,b,m]);return e.jsx("div",{ref:h,id:u,className:`nice-org-chart nice-org-chart--${o} ${l||""}`,style:d,children:e.jsx("ul",{className:"nice-org-chart__root",children:C(t)})})});Ha.displayName="NiceOrganizationChart";function tu(t,a,r){const n=f=>{const m=f.replace("#","");return[parseInt(m.slice(0,2),16),parseInt(m.slice(2,4),16),parseInt(m.slice(4,6),16)]},[i,o,c]=n(t),[l,d,p]=n(a),h=Math.round(i+(l-i)*r),u=Math.round(o+(d-o)*r),g=Math.round(c+(p-c)*r);return`rgb(${h},${u},${g})`}const qa=s.forwardRef(({data:t,xLabels:a,yLabels:r,colors:n=["#e0f2fe","#1d4ed8"],onCellClick:i,cellSize:o=40,showValues:c=!0,className:l,style:d,id:p},h)=>{const u=Ae(p),{minVal:g,maxVal:f}=s.useMemo(()=>{let b=1/0,C=-1/0;for(const v of t)for(const w of v)w<b&&(b=w),w>C&&(C=w);return{minVal:b,maxVal:C}},[t]),m=s.useCallback(b=>f===g?.5:(b-g)/(f-g),[g,f]);return e.jsx("div",{ref:h,id:u,className:`nice-heatmap ${l||""}`,style:d,children:e.jsxs("table",{className:"nice-heatmap__table",children:[a&&e.jsx("thead",{children:e.jsxs("tr",{children:[r&&e.jsx("th",{}),a.map((b,C)=>e.jsx("th",{className:"nice-heatmap__header",children:b},C))]})}),e.jsx("tbody",{children:t.map((b,C)=>e.jsxs("tr",{children:[r&&e.jsx("th",{className:"nice-heatmap__row-label",children:r[C]}),b.map((v,w)=>e.jsx("td",{className:"nice-heatmap__cell",style:{background:tu(n[0],n[1],m(v)),width:o,height:o,textAlign:"center",color:m(v)>.6?"#fff":"#333",cursor:i?"pointer":void 0},onClick:()=>i==null?void 0:i(C,w,v),title:String(v),children:c?v:""},w))]},C))})]})})});qa.displayName="NiceHeatMap";function au(t,a){const r=t.reduce((p,h)=>p+h.value,0);if(r===0||t.length===0)return[];const n=[];let{x:i,y:o,w:c,h:l}=a;const d=[...t].sort((p,h)=>h.value-p.value);for(const p of d){const h=p.value/r;if(c>=l){const u=c*h;n.push({x:i,y:o,w:u,h:l,node:p}),i+=u,c-=u}else{const u=l*h;n.push({x:i,y:o,w:c,h:u,node:p}),o+=u,l-=u}}return n}const ru=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#84cc16"],Va=s.forwardRef(({data:t,width:a=600,height:r=400,onNodeClick:n,colors:i=ru,className:o,style:c,id:l},d)=>{const p=Ae(l),h=s.useMemo(()=>{const u=t.children??[t];return au(u,{x:0,y:0,w:a,h:r})},[t,a,r]);return e.jsx("div",{ref:d,id:p,className:`nice-treemap ${o||""}`,style:c,children:e.jsx("svg",{width:a,height:r,className:"nice-treemap__svg",children:h.map((u,g)=>e.jsxs("g",{onClick:()=>n==null?void 0:n(u.node),style:{cursor:n?"pointer":void 0},children:[e.jsx("rect",{x:u.x,y:u.y,width:Math.max(u.w-1,0),height:Math.max(u.h-1,0),fill:u.node.color??i[g%i.length],rx:2}),u.w>40&&u.h>20&&e.jsx("text",{x:u.x+u.w/2,y:u.y+u.h/2,textAnchor:"middle",dominantBaseline:"central",fill:"#fff",fontSize:Math.min(12,u.w/6),className:"nice-treemap__label",children:u.node.label})]},u.node.key))})})});Va.displayName="NiceTreeMap";const Ka=s.forwardRef(({data:t,type:a="candlestick",showVolume:r=!0,width:n=800,height:i=400,bullColor:o="#22c55e",bearColor:c="#ef4444",className:l,style:d,id:p},h)=>{const u=Ae(p),g={top:20,right:20,bottom:r?80:30,left:60},f=n-g.left-g.right,m=r?50:0,b=i-g.top-g.bottom-m,{minP:C,maxP:v,maxVol:w}=s.useMemo(()=>{let _=1/0,j=-1/0,z=0;for(const P of t)P.low<_&&(_=P.low),P.high>j&&(j=P.high),P.volume&&P.volume>z&&(z=P.volume);return{minP:_,maxP:j,maxVol:z}},[t]),y=Math.max(1,f/t.length*.7),S=_=>g.left+(_+.5)*(f/t.length),k=_=>g.top+b-(_-C)/(v-C||1)*b,M=_=>i-g.bottom-m+m*(1-_/(w||1));return e.jsx("div",{ref:h,id:u,className:`nice-stock-chart ${l||""}`,style:d,children:e.jsxs("svg",{width:n,height:i,className:"nice-stock-chart__svg",children:[[0,.25,.5,.75,1].map(_=>{const j=C+_*(v-C);return e.jsxs("g",{children:[e.jsx("line",{x1:g.left,x2:n-g.right,y1:k(j),y2:k(j),stroke:"#e5e7eb",strokeDasharray:"2,2"}),e.jsx("text",{x:g.left-4,y:k(j)+4,textAnchor:"end",fontSize:10,fill:"#888",children:j.toFixed(2)})]},_)}),a==="line"?e.jsx("polyline",{points:t.map((_,j)=>`${S(j)},${k(_.close)}`).join(" "),fill:"none",stroke:o,strokeWidth:1.5}):t.map((_,j)=>{const z=_.close>=_.open,P=z?o:c,I=S(j);if(a==="ohlc")return e.jsxs("g",{children:[e.jsx("line",{x1:I,x2:I,y1:k(_.high),y2:k(_.low),stroke:P,strokeWidth:1}),e.jsx("line",{x1:I-y/2,x2:I,y1:k(_.open),y2:k(_.open),stroke:P,strokeWidth:1.5}),e.jsx("line",{x1:I,x2:I+y/2,y1:k(_.close),y2:k(_.close),stroke:P,strokeWidth:1.5})]},j);const D=k(Math.max(_.open,_.close)),T=k(Math.min(_.open,_.close));return e.jsxs("g",{children:[e.jsx("line",{x1:I,x2:I,y1:k(_.high),y2:k(_.low),stroke:P,strokeWidth:1}),e.jsx("rect",{x:I-y/2,y:D,width:y,height:Math.max(T-D,1),fill:z?"transparent":P,stroke:P,strokeWidth:1})]},j)}),r&&t.map((_,j)=>{if(!_.volume)return null;const z=_.close>=_.open;return e.jsx("rect",{x:S(j)-y/2,y:M(_.volume),width:y,height:i-g.bottom-M(_.volume),fill:z?o:c,opacity:.3},`v${j}`)}),t.map((_,j)=>j%Math.max(1,Math.floor(t.length/8))!==0?null:e.jsx("text",{x:S(j),y:i-g.bottom+m+14,textAnchor:"middle",fontSize:9,fill:"#888",children:_.date},`l${j}`))]})})});Ka.displayName="NiceStockChart";const xa=Object.freeze(Object.defineProperty({__proto__:null,A:Yd,B:Xd,C:et,D:Jd,N:Wa,R:Zt,a:In,b:Ha,c:Ka,d:Va,e:qa,f:Ba,g:Fn,h:Rn,i:Tn,j:Dn,k:An,l:En,m:zn,n:$n,o:Xt,q:Pn,s:Mn,u:Ln},Symbol.toStringTag,{value:"Module"})),Ya=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,displayStyle:g,value:f,defaultValue:m,onChange:b,onBlur:C,onKeyDown:v,placeholder:w,rows:y=3,maxLength:S,resize:k="vertical",autoFocus:M,showCount:_,submitOnEnter:j,onSubmit:z,showKeyboardHints:P},I)=>{const D=Oe(u,d);if(D==="hidden")return null;D==="disabled"&&(i=!0),D==="readOnly"&&(o=!0);const{t:T}=Re(),N=Ae(d),H=gt("input",g),E=it("input",g),R=(f==null?void 0:f.length)??0,x=S?R>S:!1,$={key:"Enter",ctrl:!0,description:T("shortcuts.submit","Submit")},A=s.useCallback(F=>{j&&Ho(F,$)&&(F.preventDefault(),z==null||z()),v==null||v(F)},[j,z,v,$]),O=s.useMemo(()=>{const F=[];return j&&F.push($),F.push({key:"Tab",description:T("shortcuts.indent","Indent (when supported)")}),F},[j,T,$]);return e.jsxs("div",{className:`nice-field ${p||""}`,style:h,children:[t&&e.jsxs("label",{htmlFor:N,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:[t,P&&O.length>0&&e.jsx(tt,{shortcuts:O,size:"sm"})]}),e.jsx("textarea",{ref:I,id:N,className:`nice-textarea nice-input--${c} nice-textarea--ds-${E} ${r?"nice-textarea--error":""} ${i?"nice-textarea--disabled":""}`,style:{...H,resize:k},name:l,value:f,defaultValue:m,placeholder:w,rows:y,maxLength:S,disabled:i,readOnly:o,autoFocus:M,"aria-invalid":!!r,"aria-describedby":r?`${N}-error`:a?`${N}-helper`:void 0,onChange:F=>b==null?void 0:b(F.target.value),onBlur:C,onKeyDown:A}),(_||S)&&e.jsxs("div",{className:`nice-textarea__counter ${x?"nice-textarea__counter--over":""}`,children:[R,S?` / ${S}`:""]}),r&&e.jsx("div",{id:`${N}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{id:`${N}-helper`,className:"nice-field__helper",children:a})]})});Ya.displayName="NiceTextArea";const Ga=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,value:g,onChange:f,onBlur:m,onKeyDown:b,min:C,max:v,type:w="date",submitOnEnter:y,onSubmit:S,showKeyboardHints:k,displayStyle:M},_)=>{gt("input",M),it("input",M);const j=Oe(u,d);if(j==="hidden")return null;j==="disabled"&&(i=!0),j==="readOnly"&&(o=!0);const{t:z}=Re(),P=Ae(d),I=Ia({enabled:y,onSubmit:S}),D=s.useCallback(N=>{I(N),b==null||b(N)},[I,b]),T=s.useMemo(()=>{const N=[];return y&&N.push(qe.submit),N.push({key:"ArrowUp",description:z("shortcuts.increaseDate","Increase value")}),N.push({key:"ArrowDown",description:z("shortcuts.decreaseDate","Decrease value")}),N},[y,z]);return e.jsxs("div",{className:`nice-field ${p||""}`,style:h,children:[t&&e.jsxs("label",{htmlFor:P,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:[t,k&&T.length>0&&e.jsx(tt,{shortcuts:T,size:"sm"})]}),e.jsx("div",{className:`nice-input nice-input--${c} ${r?"nice-input--error":""} ${i?"nice-input--disabled":""} ${o?"nice-input--readonly":""}`,children:e.jsx("input",{ref:_,id:P,className:"nice-input__native",type:w,name:l,value:g??"",min:C,max:v,disabled:i,readOnly:o,"aria-invalid":!!r,onChange:N=>f==null?void 0:f(N.target.value),onBlur:m,onKeyDown:D})}),r&&e.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]})});Ga.displayName="NiceDatePicker";const On=({label:t,helperText:a,error:r,required:n,disabled:i,size:o="md",name:c,id:l,className:d,style:p,accessMode:h,options:u,value:g,onChange:f,direction:m="horizontal",showKeyboardHints:b,displayStyle:C})=>{it("toggle",C);const v=Oe(h,l);if(v==="hidden")return null;(v==="disabled"||v==="readOnly")&&(i=!0);const{t:w}=Re(),y=Ae(l),S=c||y,k=s.useMemo(()=>[{key:"ArrowUp",description:w("shortcuts.previousOption","Previous option")},{key:"ArrowDown",description:w("shortcuts.nextOption","Next option")},{key:"Space",description:w("shortcuts.select","Select")}],[w]);return e.jsxs("div",{className:`nice-field ${d||""}`,style:p,role:"radiogroup","aria-labelledby":`${y}-label`,children:[t&&e.jsxs("span",{id:`${y}-label`,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:[t,b&&e.jsx(tt,{shortcuts:k,size:"sm"})]}),e.jsx("div",{className:`nice-radio-group ${m==="vertical"?"nice-radio-group--vertical":""}`,children:u.map(M=>e.jsxs("label",{className:`nice-radio ${i||M.disabled?"nice-radio--disabled":""}`,children:[e.jsx("input",{type:"radio",className:"nice-radio__input",name:S,value:M.value,checked:g===M.value,disabled:i||M.disabled,onChange:()=>f==null?void 0:f(M.value)}),e.jsx("span",{className:"nice-radio__circle",children:e.jsx("span",{className:"nice-radio__dot"})}),e.jsx("span",{children:M.label})]},M.value))}),r&&e.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]})},wt=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,id:o,className:c,style:l,accessMode:d,value:p=0,onChange:h,min:u=0,max:g=100,step:f=1,showValue:m=!0,showMinMax:b=!1,formatValue:C,showKeyboardHints:v,displayStyle:w},y)=>{it("input",w);const S=Oe(d,o);if(S==="hidden")return null;(S==="disabled"||S==="readOnly")&&(i=!0),Re();const k=Ae(o),M=s.useMemo(()=>(p-u)/(g-u)*100,[p,u,g]),_=C?C(p):p.toString(),j=s.useMemo(()=>[qe.increment,qe.decrement,qe.first,qe.last,qe.incrementBig,qe.decrementBig],[]);return e.jsxs("div",{className:`nice-field ${c||""}`,style:l,children:[(t||m||v)&&e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t&&e.jsxs("label",{htmlFor:k,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:[t,v&&e.jsx(tt,{shortcuts:j,size:"sm"})]}),m&&e.jsx("span",{className:"nice-slider__value",children:_})]}),e.jsxs("div",{className:`nice-slider ${i?"nice-slider--disabled":""}`,children:[e.jsxs("div",{className:"nice-slider__track-wrapper",children:[e.jsx("div",{className:"nice-slider__track",children:e.jsx("div",{className:"nice-slider__fill",style:{width:`${M}%`}})}),e.jsx("input",{ref:y,id:k,type:"range",className:"nice-slider__native",min:u,max:g,step:f,value:p,disabled:i,"aria-valuenow":p,"aria-valuemin":u,"aria-valuemax":g,onChange:z=>h==null?void 0:h(parseFloat(z.target.value))}),e.jsx("div",{className:"nice-slider__thumb-visual",style:{left:`${M}%`}})]}),b&&e.jsxs("div",{className:"nice-slider__labels",children:[e.jsx("span",{children:C?C(u):u}),e.jsx("span",{children:C?C(g):g})]})]}),r&&e.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]})});wt.displayName="NiceSlider";function Tr(t,a,r){return Math.max(a,Math.min(r,t))}function Bn({h:t,s:a,v:r}){t=(t%360+360)%360;const n=r*a,i=n*(1-Math.abs(t/60%2-1)),o=r-n;let c=0,l=0,d=0;return t<60?(c=n,l=i):t<120?(c=i,l=n):t<180?(l=n,d=i):t<240?(l=i,d=n):t<300?(c=i,d=n):(c=n,d=i),{r:Math.round((c+o)*255),g:Math.round((l+o)*255),b:Math.round((d+o)*255)}}function Ua({r:t,g:a,b:r}){t/=255,a/=255,r/=255;const n=Math.max(t,a,r),i=Math.min(t,a,r),o=n-i;let c=0;return o!==0&&(n===t?c=(a-r)/o%6:n===a?c=(r-t)/o+2:c=(t-a)/o+4,c=(c*60+360)%360),{h:c,s:n===0?0:o/n,v:n}}function Wn({r:t,g:a,b:r}){t/=255,a/=255,r/=255;const n=Math.max(t,a,r),i=Math.min(t,a,r),o=(n+i)/2;if(n===i)return{h:0,s:0,l:o};const c=n-i,l=o>.5?c/(2-n-i):c/(n+i);let d=0;return n===t?d=((a-r)/c+(a<r?6:0))/6:n===a?d=((r-t)/c+2)/6:d=((t-a)/c+4)/6,{h:d*360,s:l,l:o}}function Ht(t){const a=t.replace("#",""),r=a.length===3?a[0]+a[0]+a[1]+a[1]+a[2]+a[2]:a,n=parseInt(r,16);return{r:n>>16&255,g:n>>8&255,b:n&255}}function Hn({r:t,g:a,b:r}){return"#"+[t,a,r].map(n=>n.toString(16).padStart(2,"0")).join("")}function ft(t){return Hn(Bn(t))}function Lt(t){return Ua(Ht(t))}function qn(t,a){const r=[];for(let n=0;n<a;n++){const i=a<=1?.5:n/(a-1),o=Tr(t.s*(.3+i*.7),0,1),c=Tr(t.v*(1.2-i*.7),0,1);r.push(ft({h:t.h,s:o,v:c}))}return r}function Za(t,a){const r=a??30;switch(t){case"monochromatic":return[0];case"complementary":return[0,180];case"split-complementary":return[0,180-r,180+r];case"analogous":return[0,-r,r];case"triadic":return[0,120,240];case"tetradic":return[0,60,180,240];case"square":return[0,90,180,270]}}function Bt(t,a,r){return Za(a,r).map(n=>((t+n)%360+360)%360)}function Rr({r:t,g:a,b:r}){const[n,i,o]=[t,a,r].map(c=>{const l=c/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)});return .2126*n+.7152*i+.0722*o}function ra(t,a){const r=Rr(Ht(t)),n=Rr(Ht(a)),i=Math.max(r,n),o=Math.min(r,n);return(i+.05)/(o+.05)}function na(t){return t>=7?"AAA":t>=4.5?"AA":t>=3?"AA-lg":"Fail"}const Vn={"lightest-pastel":{sRange:[.1,.25],vRange:[.92,1]},"bright-pastel":{sRange:[.25,.45],vRange:[.9,1]},shiny:{sRange:[.7,.95],vRange:[.9,1]},pastel:{sRange:[.3,.55],vRange:[.75,.92]},full:{sRange:[.75,1],vRange:[.75,1]},dark:{sRange:[.6,.9],vRange:[.3,.55]},deep:{sRange:[.85,1],vRange:[.45,.65]},muted:{sRange:[.15,.35],vRange:[.5,.7]},earth:{sRange:[.3,.6],vRange:[.4,.65]}};function ia(t,a){const r=Vn[a];return t.map(n=>{const i=(r.sRange[0]+r.sRange[1])/2,o=(r.vRange[0]+r.vRange[1])/2;return ft({h:n,s:i,v:o})})}function nu(){return Math.floor(Math.random()*360)}function Kn(t,a,r){const n=nu(),i=Bt(n,t,r),o=[];for(let c=0;c<a;c++){const l=i[c%i.length],d=.55+Math.random()*.4,p=.5+Math.random()*.45;o.push(ft({h:l+(Math.random()-.5)*8,s:d,v:p}))}return o}const iu=({hues:t,baseHue:a,onBaseHueChange:r,mode:n,distance:i,disabled:o})=>{const c=s.useCallback(u=>{if(o)return;const g=u.currentTarget.getBoundingClientRect(),f=u.clientX-g.left-120,m=u.clientY-g.top-120,b=(Math.atan2(m,f)*180/Math.PI+360)%360;r(Math.round(b))},[120,120,o,r]),l=[];for(let u=0;u<360;u+=2){const g=(u-1)*Math.PI/180,f=(u+1)*Math.PI/180,m=ft({h:u,s:1,v:1});l.push(e.jsx("path",{d:`M${120+55*Math.cos(g)},${120+55*Math.sin(g)} L${120+110*Math.cos(g)},${120+110*Math.sin(g)} A110,110 0 0,1 ${120+110*Math.cos(f)},${120+110*Math.sin(f)} L${120+55*Math.cos(f)},${120+55*Math.sin(f)} A55,55 0 0,0 ${120+55*Math.cos(g)},${120+55*Math.sin(g)} Z`,fill:m},u))}const d=`wheel-center-${n}`,p=t.map((u,g)=>{const f=u*Math.PI/180;return e.jsx("circle",{cx:120+82.5*Math.cos(f),cy:120+82.5*Math.sin(f),r:g===0?8:6,fill:ft({h:u,s:.85,v:.9}),stroke:g===0?"#fff":"#ccc",strokeWidth:g===0?3:2},g)});let h=null;if(n==="analogous"||n==="split-complementary"){const u=Za(n,i).slice(1).map((g,f)=>{const m=(a+g)*Math.PI/180;return e.jsx("line",{x1:120,y1:120,x2:120+82.5*Math.cos(m),y2:120+82.5*Math.sin(m),stroke:"rgba(255,255,255,0.3)",strokeWidth:1,strokeDasharray:"3,3"},`dline-${f}`)});h=e.jsx(e.Fragment,{children:u})}return e.jsxs("svg",{className:"nice-palette__wheel",viewBox:"0 0 240 240",width:240,height:240,onClick:c,style:{cursor:o?"default":"crosshair"},children:[e.jsx("defs",{children:e.jsxs("radialGradient",{id:d,children:[e.jsx("stop",{offset:"0%",stopColor:"#fff"}),e.jsx("stop",{offset:"100%",stopColor:"transparent"})]})}),l,e.jsx("circle",{cx:120,cy:120,r:53,fill:ft({h:a,s:.6,v:.85})}),e.jsx("circle",{cx:120,cy:120,r:53,fill:`url(#${d})`,opacity:.4}),h,p]})},su=({colors:t})=>{if(t.length<2)return null;const a=[];for(let r=0;r<t.length;r++){const n=ra(t[r],"#ffffff"),i=ra(t[r],"#000000");a.push({a:t[r],b:"#ffffff",ratio:n,level:na(n)}),a.push({a:t[r],b:"#000000",ratio:i,level:na(i)});for(let o=r+1;o<t.length;o++){const c=ra(t[r],t[o]);a.push({a:t[r],b:t[o],ratio:c,level:na(c)})}}return e.jsxs("div",{className:"nice-palette__contrast",children:[e.jsx("div",{className:"nice-palette__section-title",children:"Contrast Analysis (WCAG 2.1)"}),e.jsx("div",{className:"nice-palette__contrast-grid",children:a.map((r,n)=>e.jsxs("div",{className:"nice-palette__contrast-pair",children:[e.jsxs("div",{className:"nice-palette__contrast-swatches",children:[e.jsx("span",{className:"nice-palette__contrast-dot",style:{background:r.a}}),e.jsx("span",{className:"nice-palette__contrast-vs",children:"vs"}),e.jsx("span",{className:"nice-palette__contrast-dot",style:{background:r.b}})]}),e.jsxs("span",{className:"nice-palette__contrast-ratio",children:[r.ratio.toFixed(1),":1"]}),e.jsx("span",{className:`nice-palette__contrast-level nice-palette__contrast-level--${r.level.toLowerCase().replace("-","")}`,children:r.level})]},n))})]})},ou=({hex:t})=>{const a=Ht(t),r=Wn(a),n=Ua(a);return e.jsxs("div",{className:"nice-palette__color-info",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"HEX"})," ",t.toUpperCase()]}),e.jsxs("div",{children:[e.jsx("strong",{children:"RGB"})," ",a.r,", ",a.g,", ",a.b]}),e.jsxs("div",{children:[e.jsx("strong",{children:"HSL"})," ",Math.round(r.h),"°, ",Math.round(r.s*100),"%,"," ",Math.round(r.l*100),"%"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"HSV"})," ",Math.round(n.h),"°, ",Math.round(n.s*100),"%,"," ",Math.round(n.v*100),"%"]})]})},Fr={monochromatic:"Monochromatic",complementary:"Complementary","split-complementary":"Split-Complementary",analogous:"Analogous",triadic:"Triadic",tetradic:"Tetradic (Rectangle)",square:"Square"},lu={"lightest-pastel":"Lightest Pastel","bright-pastel":"Bright Pastel",shiny:"Shiny",pastel:"Pastel",full:"Full Colors",dark:"Dark",deep:"Deep Colors",muted:"Muted",earth:"Earth Tones"},cu=["monochromatic","complementary","split-complementary","analogous","triadic","tetradic","square"],du=["lightest-pastel","bright-pastel","shiny","pastel","full","dark","deep","muted","earth"],Xa=s.forwardRef(({id:t,className:a,style:r,accessMode:n,value:i,onChange:o,minColors:c=1,maxColors:l=8,harmonyMode:d,onHarmonyModeChange:p,distance:h,onDistanceChange:u,preset:g,onPresetChange:f,showWheel:m=!0,showContrast:b=!0,showInfo:C=!0,showPresets:v=!0,showVariations:w=!0,showRandom:y=!0,variationCount:S=5,label:k,disabled:M},_)=>{const j=Oe(n,t);if(j==="hidden")return null;(j==="disabled"||j==="readOnly")&&(M=!0);const z=Ae(t),[P,I]=s.useState("analogous"),[D,T]=s.useState(30),[N,H]=s.useState(""),[E,R]=s.useState(0),x=d??P,$=h??D,A=g??N,O=s.useCallback(W=>{I(W),p==null||p(W)},[p]),F=s.useCallback(W=>{T(W),u==null||u(W)},[u]),L=s.useCallback(W=>{H(W),W&&(f==null||f(W))},[f]),G=s.useMemo(()=>["#3b82f6","#ef4444","#22c55e"],[]),V=i&&i.length>0?i:G,B=V[0],Y=s.useMemo(()=>Lt(B),[B]),J=s.useMemo(()=>Bt(Y.h,x,$),[Y.h,x,$]),me=s.useCallback((W,Z,te,ee)=>{const ie=Bt(W,Z,te);let ne;for(ee&&Vn[ee]?ne=ia(ie,ee):ne=ie.map(Ce=>ft({h:Ce,s:Y.s||.7,v:Y.v||.85}));ne.length<c;)ne.push(ne[ne.length-1]||"#888888");ne.length>l&&(ne=ne.slice(0,l)),o==null||o(ne)},[Y.s,Y.v,c,l,o]),de=s.useCallback(W=>{M||me(W,x,$,A)},[M,x,$,A,me]),oe=s.useCallback(W=>{M||(O(W),me(Y.h,W,$,A))},[M,Y.h,$,A,O,me]),ae=s.useCallback(W=>{M||(F(W),me(Y.h,x,W,A))},[M,Y.h,x,A,F,me]),ve=s.useCallback(W=>{if(M)return;L(W);const Z=Bt(Y.h,x,$),te=ia(Z,W);o==null||o(te.slice(0,l))},[M,Y.h,x,$,l,L,o]),re=s.useCallback((W,Z)=>{if(M)return;const te=[...V];te[W]=Z,o==null||o(te)},[M,V,o]),he=s.useCallback(()=>{if(M||V.length>=l)return;const W=Lt(V[V.length-1]),Z=ft({h:(W.h+30)%360,s:W.s,v:W.v});o==null||o([...V,Z])},[M,V,l,o]),we=s.useCallback(W=>{if(M||V.length<=c)return;const Z=V.filter((te,ee)=>ee!==W);o==null||o(Z),E>=Z.length&&R(Math.max(0,Z.length-1))},[M,V,c,o,E]),le=s.useCallback(()=>{if(M)return;const W=Math.max(c,Math.min(l,Za(x).length)),Z=Kn(x,W,$);o==null||o(Z)},[M,c,l,x,$,o]),ke=s.useMemo(()=>{if(!w)return[];const W=V[E]||V[0];return qn(Lt(W),S)},[w,V,E,S]),U=V[E]||V[0],Q=s.useMemo(()=>{const W=Lt(U);return ft({h:(W.h+180)%360,s:W.s,v:W.v})},[U]);return e.jsxs("div",{ref:_,id:z,className:`nice-palette ${M?"nice-palette--disabled":""} ${a||""}`,style:r,children:[k&&e.jsx("div",{className:"nice-palette__label",children:k}),e.jsx("div",{className:"nice-palette__modes",children:cu.map(W=>e.jsx("button",{type:"button",className:`nice-palette__mode-btn ${x===W?"nice-palette__mode-btn--active":""}`,onClick:()=>oe(W),disabled:M,title:Fr[W],children:Fr[W]},W))}),e.jsxs("div",{className:"nice-palette__main",children:[m&&e.jsxs("div",{className:"nice-palette__wheel-container",children:[e.jsx(iu,{hues:J,baseHue:Y.h,onBaseHueChange:de,mode:x,distance:$,disabled:M}),(x==="analogous"||x==="split-complementary")&&e.jsxs("div",{className:"nice-palette__distance",children:[e.jsxs("label",{children:["Distance: ",$,"°"]}),e.jsx("input",{type:"range",min:10,max:90,value:$,onChange:W=>ae(Number(W.target.value)),disabled:M,className:"nice-palette__distance-slider"})]})]}),e.jsxs("div",{className:"nice-palette__strips",children:[e.jsxs("div",{className:"nice-palette__swatches",children:[V.map((W,Z)=>e.jsxs("div",{className:`nice-palette__swatch-wrapper ${E===Z?"nice-palette__swatch-wrapper--selected":""}`,onClick:()=>R(Z),children:[e.jsx("div",{className:"nice-palette__swatch",style:{background:W},children:V.length>c&&e.jsx("button",{type:"button",className:"nice-palette__swatch-remove",onClick:te=>{te.stopPropagation(),we(Z)},disabled:M,"aria-label":"Remove color",children:"×"})}),e.jsx("input",{type:"text",className:"nice-palette__hex-input",value:W.toUpperCase(),maxLength:7,disabled:M,onChange:te=>re(Z,te.target.value)})]},Z)),V.length<l&&e.jsx("button",{type:"button",className:"nice-palette__add-btn",onClick:he,disabled:M,title:"Add color",children:"+"})]}),e.jsxs("div",{className:"nice-palette__complementary",children:[e.jsx("span",{className:"nice-palette__section-tag",children:"Complementary"}),e.jsx("div",{className:"nice-palette__swatch nice-palette__swatch--sm",style:{background:Q},title:Q.toUpperCase()}),e.jsx("span",{className:"nice-palette__hex-label",children:Q.toUpperCase()})]}),w&&ke.length>0&&e.jsxs("div",{className:"nice-palette__variations",children:[e.jsx("span",{className:"nice-palette__section-tag",children:"Tints & Shades"}),e.jsx("div",{className:"nice-palette__variation-strip",children:ke.map((W,Z)=>e.jsx("div",{className:"nice-palette__variation-chip",style:{background:W},title:W.toUpperCase(),onClick:()=>{M||re(E,W)},role:"button",tabIndex:0},Z))})]}),y&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-palette__random-btn",onClick:le,disabled:M,title:"Random palette","aria-label":"Random palette",children:"🎲 Random Palette"})]})]}),v&&e.jsxs("div",{className:"nice-palette__presets",children:[e.jsx("div",{className:"nice-palette__section-title",children:"Style Presets"}),e.jsx("div",{className:"nice-palette__preset-grid",children:du.map(W=>{const Z=ia(J,W);return e.jsxs("button",{type:"button",className:`nice-palette__preset-card ${A===W?"nice-palette__preset-card--active":""}`,onClick:()=>ve(W),disabled:M,children:[e.jsx("div",{className:"nice-palette__preset-strip",children:Z.map((te,ee)=>e.jsx("span",{className:"nice-palette__preset-dot",style:{background:te}},ee))}),e.jsx("span",{className:"nice-palette__preset-label",children:lu[W]})]},W)})})]}),C&&e.jsxs("div",{className:"nice-palette__info-panel",children:[e.jsx("div",{className:"nice-palette__section-title",children:"Selected Color Info"}),e.jsx(ou,{hex:U})]}),b&&e.jsx(su,{colors:V})]})});Xa.displayName="NiceColorPalette";function $a(){return{type:"linear",angle:90,stops:[{color:"#3b82f6",position:0},{color:"#8b5cf6",position:100}]}}function za(t){const a=t.stops.slice().sort((n,i)=>n.position-i.position).map(n=>`${n.color} ${n.position}%`).join(", "),r=t.repeating?"repeating-":"";switch(t.type){case"linear":return`${r}linear-gradient(${t.angle}deg, ${a})`;case"radial":{const n=t.shape||"ellipse",i=t.size||"farthest-corner",o=t.positionX??50,c=t.positionY??50;return`${r}radial-gradient(${n} ${i} at ${o}% ${c}%, ${a})`}case"conic":{const n=t.angle??0,i=t.positionX??50,o=t.positionY??50;return`${r}conic-gradient(from ${n}deg at ${i}% ${o}%, ${a})`}}}function Yn(t){var n,i,o;const a=t.trim(),r=a.startsWith("repeating-");if(a.includes("linear-gradient")){const c=(n=a.match(/linear-gradient\((.+)\)/))==null?void 0:n[1];if(!c)return null;const l=c.split(",").map(g=>g.trim());let d=90,p=0;const h=l[0].match(/^(\d+)deg$/);h&&(d=parseInt(h[1]),p=1);const u=va(l.slice(p));return{type:"linear",angle:d,repeating:r,stops:u}}if(a.includes("radial-gradient")){const c=(i=a.match(/radial-gradient\((.+)\)/))==null?void 0:i[1];if(!c)return null;const l=c.split(",").map(p=>p.trim()),d=va(l.filter(p=>p.includes("#")||p.includes("rgb")));return{type:"radial",angle:0,repeating:r,stops:d.length>=2?d:$a().stops}}if(a.includes("conic-gradient")){const c=(o=a.match(/conic-gradient\((.+)\)/))==null?void 0:o[1];if(!c)return null;const l=c.split(",").map(p=>p.trim()),d=va(l.filter(p=>p.includes("#")||p.includes("rgb")));return{type:"conic",angle:0,repeating:r,stops:d.length>=2?d:$a().stops}}return null}function va(t){return t.map((a,r,n)=>{const i=a.match(/^(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\))\s*(\d+%?)?$/);if(i){const o=i[2]?parseFloat(i[2]):r/Math.max(1,n.length-1)*100;return{color:i[1],position:o}}return{color:a,position:r/Math.max(1,n.length-1)*100}})}function uu(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function pu(t=2){const a=["linear","radial","conic"],r=a[Math.floor(Math.random()*a.length)],n=[];for(let i=0;i<t;i++)n.push({color:uu(),position:Math.round(i/(t-1)*100)});return{type:r,angle:Math.floor(Math.random()*360),stops:n,shape:r==="radial"?Math.random()>.5?"circle":"ellipse":void 0,positionX:r!=="linear"?Math.round(Math.random()*100):void 0,positionY:r!=="linear"?Math.round(Math.random()*100):void 0}}const Gn=[{name:"Sunset",value:{type:"linear",angle:135,stops:[{color:"#ff6b6b",position:0},{color:"#feca57",position:100}]}},{name:"Ocean",value:{type:"linear",angle:180,stops:[{color:"#667eea",position:0},{color:"#764ba2",position:100}]}},{name:"Forest",value:{type:"linear",angle:120,stops:[{color:"#11998e",position:0},{color:"#38ef7d",position:100}]}},{name:"Fire",value:{type:"linear",angle:90,stops:[{color:"#f12711",position:0},{color:"#f5af19",position:100}]}},{name:"Aurora",value:{type:"linear",angle:135,stops:[{color:"#a18cd1",position:0},{color:"#fbc2eb",position:50},{color:"#a6c1ee",position:100}]}},{name:"Midnight",value:{type:"linear",angle:180,stops:[{color:"#0f0c29",position:0},{color:"#302b63",position:50},{color:"#24243e",position:100}]}},{name:"Candy",value:{type:"linear",angle:45,stops:[{color:"#fc5c7d",position:0},{color:"#6a82fb",position:100}]}},{name:"Radial Glow",value:{type:"radial",angle:0,shape:"circle",stops:[{color:"#ffecd2",position:0},{color:"#fcb69f",position:100}],positionX:50,positionY:50}},{name:"Rainbow",value:{type:"conic",angle:0,stops:[{color:"#ff0000",position:0},{color:"#ff8800",position:17},{color:"#ffff00",position:33},{color:"#00ff00",position:50},{color:"#0088ff",position:67},{color:"#8800ff",position:83},{color:"#ff0000",position:100}],positionX:50,positionY:50}}],Ja=s.forwardRef(({id:t,className:a,style:r,accessMode:n,value:i,onChange:o,showCssOutput:c=!0,showPresets:l=!0,showRandom:d=!0,maxStops:p=10,label:h,disabled:u},g)=>{const f=Oe(n,t);if(f==="hidden")return null;(f==="disabled"||f==="readOnly")&&(u=!0);const m=Ae(t),b=i??$a(),C=s.useMemo(()=>za(b),[b]),[v,w]=s.useState(0),[y,S]=s.useState(""),k=s.useRef(null),M=s.useCallback(x=>{o==null||o(x)},[o]),_=s.useCallback(x=>{u||M({...b,type:x})},[u,b,M]),j=s.useCallback(x=>{u||M({...b,angle:x})},[u,b,M]),z=s.useCallback(x=>{u||M({...b,repeating:x})},[u,b,M]),P=s.useCallback(x=>{u||M({...b,shape:x})},[u,b,M]),I=s.useCallback((x,$)=>{if(u)return;const A=b.stops.map((O,F)=>F===x?{...O,...$}:O);M({...b,stops:A})},[u,b,M]),D=s.useCallback(()=>{if(u||b.stops.length>=p)return;const x=b.stops.slice().sort((L,G)=>L.position-G.position);let $=0,A=x[0];for(let L=0;L<x.length-1;L++){const G=x[L+1].position-x[L].position;G>$&&($=G,A=x[L])}const O=Math.round(A.position+$/2),F="#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0");M({...b,stops:[...b.stops,{color:F,position:O}]})},[u,b,p,M]),T=s.useCallback(x=>{if(u||b.stops.length<=2)return;const $=b.stops.filter((A,O)=>O!==x);M({...b,stops:$}),v>=$.length&&w($.length-1)},[u,b,v,M]),N=s.useCallback(()=>{if(u)return;const x=2+Math.floor(Math.random()*3);M(pu(x))},[u,M]),H=s.useCallback(()=>{if(u||!y.trim())return;const x=Yn(y);x&&M(x)},[u,y,M]),E=s.useCallback(x=>{if(u||!k.current||b.stops.length>=p)return;const $=k.current.getBoundingClientRect(),A=Math.round((x.clientX-$.left)/$.width*100),O="#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0"),F=[...b.stops,{color:O,position:A}];M({...b,stops:F}),w(F.length-1)},[u,b,p,M]),R=s.useMemo(()=>b.stops.slice().sort((x,$)=>x.position-$.position),[b.stops]);return e.jsxs("div",{ref:g,id:m,className:`nice-gradient ${u?"nice-gradient--disabled":""} ${a||""}`,style:r,children:[h&&e.jsx("div",{className:"nice-gradient__label",children:h}),e.jsx("div",{className:"nice-gradient__preview",style:{background:C}}),e.jsxs("div",{className:"nice-gradient__type-row",children:[["linear","radial","conic"].map(x=>e.jsx("button",{type:"button",className:`nice-gradient__type-btn ${b.type===x?"nice-gradient__type-btn--active":""}`,onClick:()=>_(x),disabled:u,children:x.charAt(0).toUpperCase()+x.slice(1)},x)),e.jsxs("label",{className:"nice-gradient__repeat-label",children:[e.jsx("input",{type:"checkbox",checked:b.repeating??!1,onChange:x=>z(x.target.checked),disabled:u}),"Repeating"]})]}),e.jsxs("div",{className:"nice-gradient__controls",children:[b.type==="linear"&&e.jsxs("div",{className:"nice-gradient__control-group",children:[e.jsxs("label",{children:["Angle: ",b.angle,"°"]}),e.jsx("input",{type:"range",min:0,max:360,value:b.angle,onChange:x=>j(Number(x.target.value)),disabled:u,className:"nice-gradient__slider"}),e.jsx("div",{className:"nice-gradient__angle-presets",children:[0,45,90,135,180,225,270,315].map(x=>e.jsx("button",{type:"button",className:`nice-gradient__angle-btn ${b.angle===x?"nice-gradient__angle-btn--active":""}`,onClick:()=>j(x),disabled:u,title:`${x}°`,children:e.jsx("span",{style:{transform:`rotate(${x}deg)`,display:"inline-block"},children:"→"})},x))})]}),b.type==="radial"&&e.jsxs("div",{className:"nice-gradient__control-group",children:[e.jsx("label",{children:"Shape:"}),e.jsx("div",{className:"nice-gradient__shape-btns",children:["circle","ellipse"].map(x=>e.jsx("button",{type:"button",className:`nice-gradient__shape-btn ${(b.shape||"ellipse")===x?"nice-gradient__shape-btn--active":""}`,onClick:()=>P(x),disabled:u,children:x},x))})]}),(b.type==="radial"||b.type==="conic")&&e.jsxs("div",{className:"nice-gradient__control-group",children:[e.jsxs("label",{children:["Center: ",b.positionX??50,"%, ",b.positionY??50,"%"]}),e.jsxs("div",{className:"nice-gradient__center-inputs",children:[e.jsx("input",{type:"range",min:0,max:100,value:b.positionX??50,onChange:x=>M({...b,positionX:Number(x.target.value)}),disabled:u,className:"nice-gradient__slider"}),e.jsx("input",{type:"range",min:0,max:100,value:b.positionY??50,onChange:x=>M({...b,positionY:Number(x.target.value)}),disabled:u,className:"nice-gradient__slider"})]})]}),b.type==="conic"&&e.jsxs("div",{className:"nice-gradient__control-group",children:[e.jsxs("label",{children:["Start angle: ",b.angle,"°"]}),e.jsx("input",{type:"range",min:0,max:360,value:b.angle,onChange:x=>j(Number(x.target.value)),disabled:u,className:"nice-gradient__slider"})]})]}),e.jsxs("div",{className:"nice-gradient__bar-container",children:[e.jsx("div",{ref:k,className:"nice-gradient__bar",style:{background:C},onClick:E,children:b.stops.map((x,$)=>e.jsx("div",{className:`nice-gradient__stop-marker ${v===$?"nice-gradient__stop-marker--active":""}`,style:{left:`${x.position}%`},onClick:A=>{A.stopPropagation(),w($)},title:`${x.color} @ ${x.position}%`,children:e.jsx("div",{className:"nice-gradient__stop-dot",style:{background:x.color}})},$))}),e.jsx("button",{type:"button",className:"nice-gradient__add-stop",onClick:D,disabled:u||b.stops.length>=p,title:"Add stop",children:"+"})]}),e.jsx("div",{className:"nice-gradient__stop-editor",children:e.jsx("div",{className:"nice-gradient__stop-list",children:R.map((x,$)=>{const A=b.stops.indexOf(x);return e.jsxs("div",{className:`nice-gradient__stop-row ${v===A?"nice-gradient__stop-row--active":""}`,onClick:()=>w(A),children:[e.jsx("input",{type:"color",value:x.color,onChange:O=>I(A,{color:O.target.value}),disabled:u,className:"nice-gradient__stop-color"}),e.jsx("input",{type:"text",value:x.color.toUpperCase(),maxLength:7,onChange:O=>I(A,{color:O.target.value}),disabled:u,className:"nice-gradient__stop-hex"}),e.jsx("input",{type:"number",min:0,max:100,value:x.position,onChange:O=>I(A,{position:Number(O.target.value)}),disabled:u,className:"nice-gradient__stop-pos"}),e.jsx("span",{className:"nice-gradient__stop-pct",children:"%"}),b.stops.length>2&&e.jsx("button",{type:"button",className:"nice-gradient__stop-del",onClick:()=>T(A),disabled:u,"aria-label":"Remove stop",children:"×"})]},A)})})}),d&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-gradient__random-btn",onClick:N,disabled:u,title:"Random gradient","aria-label":"Random gradient",children:"🎲 Random Gradient"}),l&&e.jsxs("div",{className:"nice-gradient__presets",children:[e.jsx("div",{className:"nice-gradient__section-title",children:"Presets"}),e.jsx("div",{className:"nice-gradient__preset-grid",children:Gn.map((x,$)=>e.jsxs("button",{type:"button",className:"nice-gradient__preset-card",onClick:()=>{u||M(x.value)},disabled:u,title:x.name,children:[e.jsx("div",{className:"nice-gradient__preset-preview",style:{background:za(x.value)}}),e.jsx("span",{className:"nice-gradient__preset-name",children:x.name})]},$))})]}),c&&e.jsxs("div",{className:"nice-gradient__css",children:[e.jsx("div",{className:"nice-gradient__section-title",children:"CSS Output"}),e.jsxs("div",{className:"nice-gradient__css-output",children:[e.jsx("code",{children:`background: ${C};`}),e.jsx("button",{type:"button",className:"nice-gradient__copy-btn",onClick:()=>{var x;return(x=navigator.clipboard)==null?void 0:x.writeText(`background: ${C};`)},title:"Copy CSS",children:"📋"})]}),e.jsxs("div",{className:"nice-gradient__css-import",children:[e.jsx("input",{type:"text",className:"nice-gradient__css-input",placeholder:"Paste CSS gradient to import...",value:y,onChange:x=>S(x.target.value),disabled:u}),e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",onClick:H,disabled:u,children:"Import"})]})]})]})});Ja.displayName="NiceGradientPicker";function mu({text:t,query:a}){if(!a)return e.jsx(e.Fragment,{children:t});const r=t.toLowerCase().indexOf(a.toLowerCase());return r<0?e.jsx(e.Fragment,{children:t}):e.jsxs(e.Fragment,{children:[t.slice(0,r),e.jsx("strong",{children:t.slice(r,r+a.length)}),t.slice(r+a.length)]})}const Un=({options:t,value:a,onChange:r,minSearchLength:n=1,maxResults:i=10,onSearch:o,clearable:c,loading:l,multiple:d,renderOption:p,highlightMatch:h=!0,label:u,error:g,helperText:f,required:m,disabled:b,size:C="md",id:v,className:w,style:y,accessMode:S,showKeyboardHints:k,displayStyle:M})=>{gt("input",M),it("input",M);const _=Oe(S,v);if(_==="hidden")return null;(_==="disabled"||_==="readOnly")&&(b=!0);const j=Ae(v),{t:z}=Re(),P=s.useMemo(()=>d?Array.isArray(a)?a:a?[a]:[]:[],[a,d]),[I,D]=s.useState(d||Array.isArray(a)?"":a),[T,N]=s.useState(!1),[H,E]=s.useState(-1),R=s.useRef(null),x=s.useRef(null);_t(R,()=>N(!1));const $=s.useMemo(()=>{const B=[qe.moveDown,qe.moveUp,qe.submit,qe.cancel];return d&&B.push({key:"Backspace",description:z("shortcuts.removeLastTag","Remove last tag")}),B},[d,z]);s.useEffect(()=>{d||D(Array.isArray(a)?"":a)},[a,d]);const A=s.useMemo(()=>{if(I.length<n)return[];if(o)return t.slice(0,i);const B=I.toLowerCase();return t.filter(Y=>Y.label.toLowerCase().includes(B)).slice(0,i)},[t,I,n,i,o]),O=s.useMemo(()=>{const B=new Map;for(const Y of A){const J=Y.group||"";B.has(J)||B.set(J,[]),B.get(J).push(Y)}return B},[A]),F=s.useCallback(B=>{D(B),N(B.length>=n),E(-1),o==null||o(B)},[n,o]),L=s.useCallback(B=>{if(d){const Y=String(B.value),J=P.includes(Y)?P.filter(me=>me!==Y):[...P,Y];r==null||r(J),D("")}else D(B.label),r==null||r(String(B.value)),N(!1)},[r,d,P]),G=B=>{if(d&&B.key==="Backspace"&&!I&&P.length>0){r==null||r(P.slice(0,-1));return}T&&(B.key==="ArrowDown"?(B.preventDefault(),E(Y=>Math.min(Y+1,A.length-1))):B.key==="ArrowUp"?(B.preventDefault(),E(Y=>Math.max(Y-1,0))):B.key==="Enter"&&H>=0?(B.preventDefault(),L(A[H])):B.key==="Escape"&&N(!1))},V=s.useCallback(B=>{r==null||r(P.filter(Y=>Y!==B))},[P,r]);return e.jsxs("div",{className:`nice-field nice-field--${C} ${g?"nice-field--error":""} ${w||""}`,style:y,ref:R,children:[u&&e.jsxs("label",{className:"nice-field__label",htmlFor:j,children:[u,m&&e.jsx("span",{className:"nice-field__required",children:"*"}),k&&e.jsx(tt,{shortcuts:$,size:"sm"})]}),e.jsxs("div",{className:"nice-field__input-wrap",style:d?{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"}:void 0,children:[d&&P.map(B=>{const Y=t.find(J=>String(J.value)===B);return e.jsxs("span",{className:"nice-autocomplete__tag",children:[(Y==null?void 0:Y.label)||B,e.jsx("button",{type:"button",className:"nice-autocomplete__tag-remove",onClick:()=>V(B),children:"✕"})]},B)}),e.jsx("input",{ref:x,id:j,type:"text",className:"nice-input",value:I,onChange:B=>F(B.target.value),onFocus:()=>I.length>=n&&N(!0),onKeyDown:G,disabled:b,required:m,role:"combobox","aria-expanded":T,"aria-autocomplete":"list",autoComplete:"off",style:d?{flex:1,minWidth:60,border:"none",outline:"none"}:void 0}),c&&!d&&I&&!b&&e.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>{D(""),r==null||r("")},"aria-label":z("controls.clear","Clear"),children:"✕"}),l&&e.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)"}})]}),T&&A.length>0&&e.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:Array.from(O.entries()).map(([B,Y])=>e.jsxs(s.Fragment,{children:[B&&e.jsx("li",{className:"nice-dropdown__group-label",children:B}),Y.map(J=>{const me=A.indexOf(J)===H,de=d&&P.includes(String(J.value));return e.jsx("li",{role:"option",className:`nice-dropdown__option ${me?"nice-dropdown__option--active":""} ${de?"nice-dropdown__option--selected":""}`,onMouseDown:oe=>{oe.preventDefault(),L(J)},"aria-selected":me,children:p?p(J,I):h?e.jsx(mu,{text:J.label,query:I}):J.label},String(J.value))})]},B))}),g&&e.jsx("div",{className:"nice-field__error",children:g}),f&&!g&&e.jsx("div",{className:"nice-field__hint",children:f})]})},Zn=({options:t,value:a,onChange:r,searchable:n=!0,clearable:i,loading:o,placeholder:c,label:l,error:d,helperText:p,required:h,disabled:u,size:g="md",id:f,className:m,style:b})=>{const C=Ae(f),{t:v}=Re(),[w,y]=s.useState(!1),[S,k]=s.useState(""),M=s.useRef(null);_t(M,()=>y(!1));const _=t.find(z=>String(z.value)===a),j=s.useMemo(()=>{if(!S)return t;const z=S.toLowerCase();return t.filter(P=>P.label.toLowerCase().includes(z))},[t,S]);return e.jsxs("div",{className:`nice-field nice-field--${g} ${d?"nice-field--error":""} ${m||""}`,style:b,ref:M,children:[l&&e.jsxs("label",{className:"nice-field__label",htmlFor:C,children:[l,h&&e.jsx("span",{className:"nice-field__required",children:"*"})]}),e.jsxs("div",{className:"nice-field__input-wrap",children:[e.jsxs("button",{type:"button",id:C,className:"nice-select__trigger",onClick:()=>!u&&y(!w),disabled:u,children:[e.jsx("span",{children:(_==null?void 0:_.label)||c||v("controls.select","Select...")}),e.jsx("span",{className:"nice-select__arrow",children:"▾"})]}),i&&a&&!u&&e.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>r(""),"aria-label":v("controls.clear","Clear"),children:"✕"})]}),w&&e.jsxs("div",{className:"nice-dropdown",children:[n&&e.jsx("div",{className:"nice-dropdown__search",children:e.jsx("input",{type:"text",value:S,onChange:z=>k(z.target.value),placeholder:v("controls.search","Search..."),autoFocus:!0})}),e.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:j.length===0?e.jsx("li",{className:"nice-dropdown__empty",children:v("controls.noResults","No results")}):j.map(z=>e.jsx("li",{role:"option",className:`nice-dropdown__option ${String(z.value)===a?"nice-dropdown__option--selected":""}`,onClick:()=>{r(String(z.value)),y(!1),k("")},"aria-selected":String(z.value)===a,children:z.label},String(z.value)))})]}),d&&e.jsx("div",{className:"nice-field__error",children:d}),p&&!d&&e.jsx("div",{className:"nice-field__hint",children:p})]})},hu=["Su","Mo","Tu","We","Th","Fr","Sa"];function fu(t,a){return new Date(t,a+1,0).getDate()}function gu(t,a){return new Date(t,a,1).getDay()}function Ir(t,a,r){return`${t}-${String(a+1).padStart(2,"0")}-${String(r).padStart(2,"0")}`}function yu(t){const a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));a.setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7));const r=new Date(Date.UTC(a.getUTCFullYear(),0,1));return Math.ceil(((a.getTime()-r.getTime())/864e5+1)/7)}const Pr=["January","February","March","April","May","June","July","August","September","October","November","December"],ha=({value:t,onChange:a,min:r,max:n,disabledDates:i=[],firstDayOfWeek:o=1,size:c="md",showWeekNumbers:l,onMonthChange:d,className:p,style:h,accessMode:u,id:g,multiple:f,selectedDates:m=[],onSelectedDatesChange:b,renderDay:C,showKeyboardHints:v,persistPreferences:w=!1,cookies:y=!1,localStorage:S=!0,sessionStorage:k=!1,storageMode:M,storageKey:_})=>{const j=Oe(u,g);if(j==="hidden")return null;const z=j==="disabled"||j==="readOnly",{t:P}=Re(),I=new Date,D=t?new Date(t):I,T=bn(_??"nice-calendar"),N=s.useMemo(()=>w?T.get("prefs")??{}:{},[w,T]),H=N.firstDayOfWeek??o,[E,R]=s.useState(N.lastViewYear??D.getFullYear()),[x,$]=s.useState(N.lastViewMonth??D.getMonth()),[A,O]=s.useState(N.preferredView??"days"),F=s.useCallback(Z=>{if(!w)return;const te=T.get("prefs")??{};T.set("prefs",{...te,...Z})},[w,T]),L=s.useCallback(Z=>{O(Z),F({preferredView:Z})},[F]),G=s.useCallback((Z,te)=>{F({lastViewYear:Z,lastViewMonth:te})},[F]),V=s.useMemo(()=>[qe.moveUp,qe.moveDown,qe.moveLeft,qe.moveRight,{key:"Enter",description:P("shortcuts.selectDate","Select date")},qe.pageUp,qe.pageDown],[P]),B=s.useMemo(()=>fu(E,x),[E,x]),Y=s.useMemo(()=>(gu(E,x)-H+7)%7,[E,x,H]),J=s.useMemo(()=>{const Z=[...hu];for(let te=0;te<H;te++)Z.push(Z.shift());return Z},[H]),me=s.useCallback(Z=>r&&Z<r||n&&Z>n?!0:i.includes(Z),[r,n,i]),de=s.useCallback(Z=>{if(A==="years"){R(ie=>ie+Z*10);return}if(A==="months"){R(ie=>ie+Z);return}let te=x+Z,ee=E;te<0&&(te=11,ee--),te>11&&(te=0,ee++),$(te),R(ee),G(ee,te),d==null||d(ee,te)},[x,E,d,A,G]),oe=Ir(I.getFullYear(),I.getMonth(),I.getDate()),ae=s.useCallback(Z=>f?m.includes(Z):Z===t,[f,m,t]),ve=s.useCallback(Z=>{if(!z){if(f){const te=m.includes(Z)?m.filter(ee=>ee!==Z):[...m,Z];b==null||b(te)}a==null||a(Z)}},[f,m,a,b]),re=s.useCallback(()=>{A==="days"?L("months"):A==="months"&&L("years")},[A,L]),he=s.useCallback(Z=>{$(Z),L("days"),G(E,Z),d==null||d(E,Z)},[E,d,L,G]),we=s.useCallback(Z=>{R(Z),L("months")},[L]),le=A==="years"?`${E-E%10} – ${E-E%10+9}`:A==="months"?`${E}`:`${Pr[x]} ${E}`,ke=A==="years"?"decade":A==="months"?"year":"month",U=[];for(let Z=0;Z<Y;Z++)U.push(null);for(let Z=1;Z<=B;Z++)U.push(Z);for(;U.length%7!==0;)U.push(null);const Q=[];for(let Z=0;Z<U.length;Z+=7)Q.push(U.slice(Z,Z+7));const W=E-E%10;return e.jsxs("div",{className:`nice-calendar nice-calendar--${c} ${p||""}`,style:h,children:[e.jsxs("div",{className:"nice-calendar__header",children:[e.jsx("button",{type:"button",className:"nice-calendar__nav",onClick:()=>de(-1),"aria-label":`Previous ${ke}`,children:"‹"}),e.jsx("button",{type:"button",className:"nice-calendar__title",onClick:re,"aria-label":A==="days"?"Show month picker":A==="months"?"Show year picker":void 0,disabled:A==="years",children:le}),e.jsx("button",{type:"button",className:"nice-calendar__nav",onClick:()=>de(1),"aria-label":`Next ${ke}`,children:"›"}),v&&e.jsx(tt,{shortcuts:V,size:"sm"})]}),A==="days"&&e.jsxs("table",{className:"nice-calendar__grid",role:"grid",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[l&&e.jsx("th",{className:"nice-calendar__wk",children:"W"}),J.map(Z=>e.jsx("th",{children:Z},Z))]})}),e.jsx("tbody",{children:Q.map((Z,te)=>e.jsxs("tr",{children:[l&&e.jsx("td",{className:"nice-calendar__wk",children:Z.find(ee=>ee!=null)?yu(new Date(E,x,Z.find(ee=>ee!=null))):""}),Z.map((ee,ie)=>{if(ee==null)return e.jsx("td",{className:"nice-calendar__empty-cell"},ie);const ne=Ir(E,x,ee),Ce=me(ne),ue=ae(ne);return e.jsx("td",{className:`nice-calendar__day${ue?" nice-calendar__day--selected":""}${ne===oe?" nice-calendar__day--today":""}${Ce?" nice-calendar__day--disabled":""}`,onClick:()=>!Ce&&ve(ne),role:"gridcell","aria-selected":ue,"aria-disabled":Ce,children:C?C(ne,ee):ee},ie)})]},te))})]}),A==="months"&&e.jsx("div",{className:"nice-calendar__picker-grid",children:Pr.map((Z,te)=>e.jsx("button",{type:"button",className:`nice-calendar__picker-cell${te===x&&E===D.getFullYear()?" nice-calendar__picker-cell--selected":""}`,onClick:()=>he(te),children:Z.slice(0,3)},te))}),A==="years"&&e.jsx("div",{className:"nice-calendar__picker-grid",children:Array.from({length:12},(Z,te)=>W-1+te).map(Z=>e.jsx("button",{type:"button",className:`nice-calendar__picker-cell${Z===E?" nice-calendar__picker-cell--selected":""}${Z<W||Z>W+9?" nice-calendar__picker-cell--other":""}`,onClick:()=>we(Z),children:Z},Z))})]})};ha.displayName="NiceCalendar";const Xn=({startDate:t,endDate:a,onStartChange:r,onEndChange:n,min:i,max:o,clearable:c,placeholder:l,startPlaceholder:d,endPlaceholder:p,label:h,error:u,helperText:g,required:f,disabled:m,size:b="md",id:C,className:v,style:w,accessMode:y,showKeyboardHints:S})=>{const k=Oe(y,C);if(k==="hidden")return null;(k==="disabled"||k==="readOnly")&&(m=!0);const M=Ae(C),{t:_}=Re(),[j,z]=s.useState(null),P=s.useRef(null);_t(P,()=>z(null));const I=s.useMemo(()=>[{key:"Tab",description:_("shortcuts.switchField","Switch between start/end")},qe.cancel],[_]),D=s.useCallback(N=>{r(N),(!a||N>a)&&n(N),z("end")},[r,n,a]),T=s.useCallback(N=>{n(N),z(null)},[n]);return e.jsxs("div",{className:`nice-field nice-field--${b} ${u?"nice-field--error":""} ${v||""}`,style:w,ref:P,children:[h&&e.jsxs("label",{className:"nice-field__label",htmlFor:M,children:[h,f&&e.jsx("span",{className:"nice-field__required",children:"*"}),S&&e.jsx(tt,{shortcuts:I,size:"sm"})]}),e.jsxs("div",{className:"nice-daterange",children:[e.jsx("input",{id:M,type:"text",className:"nice-input nice-daterange__start",value:t,readOnly:!0,placeholder:d||_("controls.startDate","Start date"),onClick:()=>!m&&z("start"),disabled:m}),e.jsx("span",{className:"nice-daterange__separator",children:"–"}),e.jsx("input",{type:"text",className:"nice-input nice-daterange__end",value:a,readOnly:!0,placeholder:p||_("controls.endDate","End date"),onClick:()=>!m&&z("end"),disabled:m}),c&&(t||a)&&!m&&e.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>{r(""),n("")},"aria-label":_("controls.clear","Clear"),children:"✕"})]}),j&&e.jsx("div",{className:"nice-daterange__popup",children:e.jsx(ha,{value:j==="start"?t:a,onChange:j==="start"?D:T,min:j==="end"&&t?t:i,max:o,size:b})}),u&&e.jsx("div",{className:"nice-field__error",children:u}),g&&!u&&e.jsx("div",{className:"nice-field__hint",children:g})]})},Jn=({options:t,value:a,onChange:r,searchable:n=!0,clearable:i,maxTags:o,allowCustom:c,placeholder:l,label:d,error:p,helperText:h,required:u,disabled:g,size:f="md",id:m,className:b,style:C,accessMode:v,showKeyboardHints:w})=>{const y=Oe(v,m);if(y==="hidden")return null;(y==="disabled"||y==="readOnly")&&(g=!0);const S=Ae(m),{t:k}=Re(),[M,_]=s.useState(!1),[j,z]=s.useState(""),P=s.useRef(null),I=s.useRef(null);_t(P,()=>_(!1));const D=s.useMemo(()=>[qe.submit,qe.cancel,{key:"Backspace",description:k("shortcuts.removeLastTag","Remove last tag")}],[k]),T=s.useMemo(()=>{let x=t.filter($=>!a.includes(String($.value)));if(j){const $=j.toLowerCase();x=x.filter(A=>A.label.toLowerCase().includes($))}return x},[t,a,j]),N=s.useCallback(x=>{o&&a.length>=o||(a.includes(x)||r([...a,x]),z(""))},[a,r,o]),H=s.useCallback(x=>{r(a.filter($=>$!==x))},[a,r]),E=x=>{x.key==="Backspace"&&!j&&a.length>0?H(a[a.length-1]):x.key==="Enter"&&j?(x.preventDefault(),T.length>0?N(String(T[0].value)):c&&N(j)):x.key==="Escape"&&_(!1)},R=x=>{var $;return(($=t.find(A=>String(A.value)===x))==null?void 0:$.label)??x};return e.jsxs("div",{className:`nice-field nice-field--${f} ${p?"nice-field--error":""} ${b||""}`,style:C,ref:P,children:[d&&e.jsxs("label",{className:"nice-field__label",htmlFor:S,children:[d,u&&e.jsx("span",{className:"nice-field__required",children:"*"}),w&&e.jsx(tt,{shortcuts:D,size:"sm"})]}),e.jsxs("div",{className:"nice-tagbox",onClick:()=>{var x;g||(_(!0),(x=I.current)==null||x.focus())},children:[e.jsxs("div",{className:"nice-tagbox__tags",children:[a.map(x=>e.jsxs("span",{className:"nice-tag nice-tagbox__tag",children:[R(x),!g&&e.jsx("button",{type:"button",className:"nice-tag__remove",onClick:$=>{$.stopPropagation(),H(x)},children:"✕"})]},x)),n&&e.jsx("input",{ref:I,id:S,type:"text",className:"nice-tagbox__input",value:j,onChange:x=>{z(x.target.value),_(!0)},onFocus:()=>_(!0),onKeyDown:E,placeholder:a.length===0?l||k("controls.select","Select..."):"",disabled:g,autoComplete:"off"})]}),i&&a.length>0&&!g&&e.jsx("button",{type:"button",className:"nice-field__clear",onClick:x=>{x.stopPropagation(),r([])},"aria-label":k("controls.clear","Clear"),children:"✕"})]}),M&&T.length>0&&e.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:T.map(x=>e.jsx("li",{role:"option",className:"nice-dropdown__option",onMouseDown:$=>{$.preventDefault(),N(String(x.value))},children:x.label},String(x.value)))}),p&&e.jsx("div",{className:"nice-field__error",children:p}),h&&!p&&e.jsx("div",{className:"nice-field__hint",children:h})]})},Qn=({min:t=0,max:a=100,step:r=1,startValue:n,endValue:i,onChange:o,showLabels:c=!0,formatLabel:l,label:d,error:p,helperText:h,required:u,disabled:g,size:f="md",id:m,className:b,style:C,accessMode:v,showKeyboardHints:w})=>{const y=Oe(v,m);if(y==="hidden")return null;(y==="disabled"||y==="readOnly")&&(g=!0);const{t:S}=Re(),k=Ae(m),M=s.useRef(null),_=s.useMemo(()=>[qe.increment,qe.decrement,qe.first,qe.last,{key:"Tab",description:S("shortcuts.switchThumb","Switch thumb")}],[S]),j=D=>(D-t)/(a-t)*100,z=D=>l?l(D):String(D),P=D=>{const T=Math.round(D/r)*r;return Math.max(t,Math.min(a,T))},I=s.useCallback((D,T)=>{D.preventDefault();const N=M.current;if(!N||g)return;const H=R=>{const x=N.getBoundingClientRect(),$=Math.max(0,Math.min(1,(R.clientX-x.left)/x.width)),A=P(t+$*(a-t));T==="start"?o(Math.min(A,i),i):o(n,Math.max(A,n))},E=()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",E)};document.addEventListener("pointermove",H),document.addEventListener("pointerup",E)},[t,a,r,n,i,o,g]);return e.jsxs("div",{className:`nice-field nice-field--${f} ${p?"nice-field--error":""} ${b||""}`,style:C,children:[d&&e.jsxs("label",{className:"nice-field__label",htmlFor:k,children:[d,u&&e.jsx("span",{className:"nice-field__required",children:"*"}),w&&e.jsx(tt,{shortcuts:_,size:"sm"})]}),e.jsxs("div",{className:"nice-range-slider",ref:M,children:[e.jsx("div",{className:"nice-range-slider__track",children:e.jsx("div",{className:"nice-range-slider__fill",style:{left:`${j(n)}%`,width:`${j(i)-j(n)}%`}})}),e.jsx("div",{className:"nice-range-slider__thumb",style:{left:`${j(n)}%`},onPointerDown:D=>I(D,"start"),role:"slider","aria-valuemin":t,"aria-valuemax":i,"aria-valuenow":n,tabIndex:g?-1:0,id:k}),e.jsx("div",{className:"nice-range-slider__thumb",style:{left:`${j(i)}%`},onPointerDown:D=>I(D,"end"),role:"slider","aria-valuemin":n,"aria-valuemax":a,"aria-valuenow":i,tabIndex:g?-1:0}),c&&e.jsxs("div",{className:"nice-range-slider__labels",children:[e.jsx("span",{style:{left:`${j(n)}%`},children:z(n)}),e.jsx("span",{style:{left:`${j(i)}%`},children:z(i)})]})]}),p&&e.jsx("div",{className:"nice-field__error",children:p}),h&&!p&&e.jsx("div",{className:"nice-field__hint",children:h})]})},ei=({displayValue:t,placeholder:a,clearable:r,children:n,onClear:i,open:o,onOpenChange:c,dropdownWidth:l,label:d,error:p,helperText:h,required:u,disabled:g,size:f="md",id:m,className:b,style:C,accessMode:v,showKeyboardHints:w,displayStyle:y})=>{gt("input",y),it("input",y);const S=Oe(v,m);if(S==="hidden")return null;(S==="disabled"||S==="readOnly")&&(g=!0);const k=Ae(m),{t:M}=Re(),[_,j]=s.useState(!1),z=s.useRef(null),P=o??_,I=s.useMemo(()=>[{key:"Enter",description:M("shortcuts.openDropdown","Open dropdown")},qe.cancel],[M]),D=T=>{c?c(T):j(T)};return _t(z,()=>D(!1)),e.jsxs("div",{className:`nice-field nice-field--${f} ${p?"nice-field--error":""} ${b||""}`,style:C,ref:z,children:[d&&e.jsxs("label",{className:"nice-field__label",htmlFor:k,children:[d,u&&e.jsx("span",{className:"nice-field__required",children:"*"}),w&&e.jsx(tt,{shortcuts:I,size:"sm"})]}),e.jsxs("div",{className:"nice-field__input-wrap",children:[e.jsxs("button",{type:"button",id:k,className:"nice-select__trigger",onClick:()=>!g&&D(!P),disabled:g,children:[e.jsx("span",{children:t||a||M("controls.select","Select...")}),e.jsx("span",{className:"nice-select__arrow",children:"▾"})]}),r&&t&&!g&&e.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>i==null?void 0:i(),"aria-label":M("controls.clear","Clear"),children:"✕"})]}),P&&e.jsx("div",{className:"nice-dropdown",style:{width:l},children:n}),p&&e.jsx("div",{className:"nice-field__error",children:p}),h&&!p&&e.jsx("div",{className:"nice-field__hint",children:h})]})},Qa=({items:t,data:a,onFieldChange:r,onSubmit:n,dataSource:i,recordKey:o,columns:c=1,responsiveColumns:l,gap:d=16,labelPosition:p="top",size:h="md",readOnly:u,disabled:g,className:f,style:m,accessMode:b,id:C,autoSaveDelay:v,onDirtyChange:w})=>{const y=Oe(b,C);if(y==="hidden")return null;y==="disabled"&&(g=!0),y==="readOnly"&&(u=!0);const S=Jo(i??null,o),k=!!i&&o!=null,M=k?S.editData:a??{},[_]=s.useState(()=>({...M})),[j,z]=s.useState([]),P=s.useMemo(()=>Object.keys(M).some(G=>M[G]!==_[G]),[M,_]),I=s.useRef(!1);s.useEffect(()=>{P!==I.current&&(I.current=P,w==null||w(P))},[P,w]);const D=s.useRef(null),T=s.useCallback(()=>{v&&(D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{k?S.save():n==null||n(M)},v))},[v,k,S,n,M]),N=s.useCallback((G,V)=>{u||g||(z(B=>[...B,{field:G,prev:M[G]}]),k?S.set(G,V):r==null||r(G,V),T())},[k,S,r,u,g,M,T]);s.useCallback(()=>{if(j.length===0)return;const G=j[j.length-1];z(V=>V.slice(0,-1)),k?S.set(G.field,G.prev):r==null||r(G.field,G.prev)},[j,k,S,r]);const H=s.useCallback(G=>{G.preventDefault(),D.current&&clearTimeout(D.current),k?S.save():n==null||n(M)},[M,n,k,S]),E=s.useRef(null),[R,x]=s.useState(c);s.useEffect(()=>{if(!l||!E.current){x(c);return}const G=E.current,V=new ResizeObserver(B=>{var me;const Y=((me=B[0])==null?void 0:me.contentRect.width)??0,J=Object.keys(l).map(Number).sort((de,oe)=>oe-de);for(const de of J)if(Y>=de){x(l[de]);return}x(c)});return V.observe(G),()=>V.disconnect()},[l,c]);const $=s.useMemo(()=>t.filter(G=>!(G.visible===!1||G.visibleWhen&&!G.visibleWhen(M))),[t,M]),A=s.useMemo(()=>{const G=[];let V=null;for(const B of $)!V||V.name!==B.group?(V={name:B.group,items:[B]},G.push(V)):V.items.push(B);return G},[$]),O=G=>{var V;return e.jsxs("div",{className:"nice-form__item",style:{gridColumn:G.colSpan?`span ${G.colSpan}`:void 0},children:[G.label&&e.jsxs("label",{className:"nice-form__label",children:[G.label,G.required&&e.jsx("span",{className:"nice-field__required",children:"*"})]}),e.jsx("div",{className:"nice-form__control",children:(V=G.render)==null?void 0:V.call(G,M[G.field],B=>N(G.field,B))}),G.hint&&e.jsx("div",{className:"nice-form__hint",children:G.hint})]},G.field)},F={display:"grid",gridTemplateColumns:`repeat(${R}, 1fr)`,gap:d},L=A.some(G=>G.name!=null);return e.jsx("form",{ref:E,className:`nice-form nice-form--label-${p}${P?" nice-form--dirty":""} ${f||""}`,style:L?{...m}:{...F,...m},onSubmit:H,noValidate:!0,children:L?A.map((G,V)=>e.jsxs("fieldset",{className:G.name?"nice-form__group":"nice-form__group nice-form__group--no-title",children:[G.name&&e.jsx("legend",{className:"nice-form__group-title",children:G.name}),e.jsx("div",{style:F,children:G.items.map(O)})]},V)):$.map(O)})};Qa.displayName="NiceForm";function Lr(t){const a=t.trim().toLowerCase();return a.startsWith("http://")||a.startsWith("https://")||a.startsWith("/")||a.startsWith("./")||a.startsWith("../")?!0:!(a.startsWith("javascript:")||a.startsWith("vbscript:")||a.startsWith("data:text"))}const bu=["bold","italic","underline","strikethrough","h1","h2","h3","ul","ol","blockquote","hr","link","unlink","image","table","code","alignLeft","alignCenter","alignRight","fontSize","fontColor","undo","redo","clear","findReplace","emoji","source","fullscreen","markdown"],xu={bold:"B",italic:"I",underline:"U",strikethrough:"S",h1:"H1",h2:"H2",h3:"H3",ul:"⊞",ol:"⊟",link:"🔗",unlink:"⛓️💥",undo:"↩",redo:"↪",clear:"⌧",table:"⊞T",image:"🖼",code:"</>",markdown:"MD",blockquote:"❝",hr:"─",subscript:"x₂",superscript:"x²",indent:"→⊞",outdent:"←⊞",alignLeft:"⬅",alignCenter:"⬌",alignRight:"➡",alignJustify:"⬌⬌",fullscreen:"⛶",removeFormat:"⌧F",print:"🖨",source:"🗏",emoji:"😀",findReplace:"🔍"},vu=[{value:"1",label:"8pt"},{value:"2",label:"10pt"},{value:"3",label:"12pt"},{value:"4",label:"14pt"},{value:"5",label:"18pt"},{value:"6",label:"24pt"},{value:"7",label:"36pt"}],ku=[{label:"Faces",emojis:["😀","😂","😊","😍","🤔","😢","😎","🥳","😤","🤯","🥰","😴"]},{label:"Hands",emojis:["👍","👎","👏","🤝","✌️","🤞","💪","🙌","👋","🤙"]},{label:"Symbols",emojis:["❤️","⭐","🔥","✅","❌","⚡","💡","📌","🎯","🏆","🎉","💬"]},{label:"Arrows",emojis:["➡️","⬅️","⬆️","⬇️","↩️","🔄","▶️","⏸️","⏹️","⏩"]}];function wu(t){let a=t;return a=a.replace(/<h1[^>]*>(.*?)<\/h1>/gi,`# $1
|
|
605
|
+
`),a=a.replace(/<h2[^>]*>(.*?)<\/h2>/gi,`## $1
|
|
606
|
+
`),a=a.replace(/<h3[^>]*>(.*?)<\/h3>/gi,`### $1
|
|
607
|
+
`),a=a.replace(/<strong[^>]*>(.*?)<\/strong>/gi,"**$1**"),a=a.replace(/<b[^>]*>(.*?)<\/b>/gi,"**$1**"),a=a.replace(/<em[^>]*>(.*?)<\/em>/gi,"*$1*"),a=a.replace(/<i[^>]*>(.*?)<\/i>/gi,"*$1*"),a=a.replace(/<code[^>]*>(.*?)<\/code>/gi,"`$1`"),a=a.replace(/<pre[^>]*>(.*?)<\/pre>/gis,"```\n$1\n```\n"),a=a.replace(/<br\s*\/?>/gi,`
|
|
608
|
+
`),a=a.replace(/<li[^>]*>(.*?)<\/li>/gi,`- $1
|
|
609
|
+
`),a=a.replace(/<\/?(?:ul|ol|p|div)[^>]*>/gi,`
|
|
610
|
+
`),a=a.replace(/<[^>]+>/g,""),a=a.replace(/\n{3,}/g,`
|
|
611
|
+
|
|
612
|
+
`),a.trim()}function _u(t){let a=t;return a=a.replace(/^### (.+)$/gm,"<h3>$1</h3>"),a=a.replace(/^## (.+)$/gm,"<h2>$1</h2>"),a=a.replace(/^# (.+)$/gm,"<h1>$1</h1>"),a=a.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),a=a.replace(/\*(.+?)\*/g,"<em>$1</em>"),a=a.replace(/`([^`]+)`/g,"<code>$1</code>"),a=a.replace(/```\n?([\s\S]*?)\n?```/g,"<pre>$1</pre>"),a=a.replace(/^- (.+)$/gm,"<li>$1</li>"),a=a.replace(/(<li>.*<\/li>)/gs,"<ul>$1</ul>"),a=a.replace(/\n/g,"<br>"),a}const fa=({value:t,onChange:a,placeholder:r,height:n=200,toolbar:i=bu,readOnly:o,onImageUpload:c,mentionTrigger:l,mentionSuggestions:d,onMentionSearch:p,onFileDrop:h,pasteCleanup:u=!0,maxLength:g=0,showWordCount:f=!1,templates:m,label:b,error:C,helperText:v,required:w,disabled:y,size:S="md",id:k,className:M,style:_,accessMode:j})=>{const z=Oe(j,k);if(z==="hidden")return null;z==="disabled"&&(y=!0),z==="readOnly"&&(o=!0);const P=Ae(k),I=s.useRef(null),D=s.useRef(null),T=s.useRef(null),[N,H]=s.useState(!1),[E,R]=s.useState(""),[x,$]=s.useState(!1),[A,O]=s.useState(""),[F,L]=s.useState(!1),[G,V]=s.useState(""),[B,Y]=s.useState(0),[J,me]=s.useState(!1),[de,oe]=s.useState("#000000"),[ae,ve]=s.useState("#ffff00"),[re,he]=s.useState(0),[we,le]=s.useState(0),[ke,U]=s.useState(!1),[Q,W]=s.useState(""),[Z,te]=s.useState(""),[ee,ie]=s.useState(!1),[ne,Ce]=s.useState(!1),ue=s.useCallback((X,be)=>{var Ne,Me,Fe;if(o||y)return;const _e=I.current;if(_e){if(X==="markdown"){if(!N)R(wu(t)),H(!0),$(!1);else{const Ee=_u(E);a(Ee),H(!1)}return}if(X==="source"){x?(a(A),$(!1)):(O(t),$(!0),H(!1));return}if(X==="fullscreen"){me(Ee=>!Ee);return}if(X==="emoji"){ie(Ee=>!Ee);return}if(X==="findReplace"){U(Ee=>!Ee);return}if(X==="image"){if(c)(Ne=D.current)==null||Ne.click();else{const Ee=prompt("Image URL:");Ee&&Lr(Ee)&&(_e.focus(),document.execCommand("insertImage",!1,Ee),a(la(_e.innerHTML)))}return}switch(_e.focus(),X){case"bold":document.execCommand("bold");break;case"italic":document.execCommand("italic");break;case"underline":document.execCommand("underline");break;case"strikethrough":document.execCommand("strikeThrough");break;case"h1":document.execCommand("formatBlock",!1,"h1");break;case"h2":document.execCommand("formatBlock",!1,"h2");break;case"h3":document.execCommand("formatBlock",!1,"h3");break;case"ul":document.execCommand("insertUnorderedList");break;case"ol":document.execCommand("insertOrderedList");break;case"blockquote":document.execCommand("formatBlock",!1,"blockquote");break;case"hr":document.execCommand("insertHorizontalRule");break;case"subscript":document.execCommand("subscript");break;case"superscript":document.execCommand("superscript");break;case"indent":document.execCommand("indent");break;case"outdent":document.execCommand("outdent");break;case"alignLeft":document.execCommand("justifyLeft");break;case"alignCenter":document.execCommand("justifyCenter");break;case"alignRight":document.execCommand("justifyRight");break;case"alignJustify":document.execCommand("justifyFull");break;case"removeFormat":document.execCommand("removeFormat");break;case"print":window.print();return;case"link":{const Ee=prompt("URL:");Ee&&Lr(Ee)&&document.execCommand("createLink",!1,Ee);break}case"unlink":document.execCommand("unlink");break;case"undo":document.execCommand("undo");break;case"redo":document.execCommand("redo");break;case"clear":document.execCommand("removeFormat");break;case"fontSize":{be&&document.execCommand("fontSize",!1,be);break}case"fontColor":{be&&document.execCommand("foreColor",!1,be);break}case"bgColor":{be&&document.execCommand("hiliteColor",!1,be);break}case"table":{document.execCommand("insertHTML",!1,'<table class="nice-htmleditor__table"><thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table><p> </p>');break}case"code":{const Ee=((Me=window.getSelection())==null?void 0:Me.toString())||"";Ee.includes(`
|
|
613
|
+
`)||Ee.length>60?document.execCommand("insertHTML",!1,`<pre class="nice-htmleditor__code-block">${Ee||"// code"}</pre>`):document.execCommand("insertHTML",!1,`<code>${Ee||"code"}</code>`);break}}a(la(_e.innerHTML)),he(((Fe=_e.textContent)==null?void 0:Fe.length)??0)}},[a,o,y,N,E,t,c,x,A]),$e=s.useCallback(async X=>{var Me;const be=(Me=X.target.files)==null?void 0:Me[0];if(!be||!c)return;const _e=await c(be),Ne=I.current;Ne&&_e&&(Ne.focus(),document.execCommand("insertImage",!1,_e),a(Ne.innerHTML)),X.target.value=""},[c,a]),ze=s.useCallback(()=>{var _e;const X=I.current;if(!X)return;const be=((_e=X.textContent)==null?void 0:_e.length)??0;if(g>0&&be>g&&(X.textContent=(X.textContent??"").slice(0,g)),he(be),le((X.textContent??"").trim().split(/\s+/).filter(Boolean).length),a(X.innerHTML),l){const Ne=window.getSelection();if(Ne&&Ne.rangeCount>0){const Me=Ne.getRangeAt(0),Fe=Me.startContainer;if(Fe.nodeType===Node.TEXT_NODE){const Ee=Fe.textContent||"",Pe=Me.startOffset,Be=Ee.slice(0,Pe),Ze=Be.lastIndexOf(l);if(Ze>=0&&(Ze===0||/\s/.test(Be[Ze-1]))){const Xe=Be.slice(Ze+l.length);if(!/\s/.test(Xe)){L(!0),V(Xe),Y(0),p==null||p(Xe);return}}}}L(!1)}},[a,l,p]),Te=(d==null?void 0:d.filter(X=>X.label.toLowerCase().includes(G.toLowerCase())).slice(0,8))??[],Ve=s.useCallback(X=>{var Fe;const be=I.current;if(!be)return;const _e=window.getSelection();if(!_e||_e.rangeCount===0)return;const Ne=_e.getRangeAt(0),Me=Ne.startContainer;if(Me.nodeType===Node.TEXT_NODE&&l){const Ee=Me.textContent||"",Pe=Ne.startOffset,Be=Ee.slice(0,Pe).lastIndexOf(l);if(Be>=0){const Ze=Ee.slice(0,Be),Xe=Ee.slice(Pe),rt=`<span class="nice-htmleditor__mention" data-mention="${X.key}" contenteditable="false">${l}${X.label}</span> `;Me.textContent=Ze;const lt=document.createRange();lt.setStartAfter(Me),lt.collapse(!0);const We=lt.createContextualFragment(rt+Xe);(Fe=Me.parentNode)==null||Fe.insertBefore(We,Me.nextSibling),_e.collapseToEnd(),a(be.innerHTML)}}L(!1)},[l,a]),De=s.useCallback(X=>{if(F&&Te.length>0){X.key==="ArrowDown"?(X.preventDefault(),Y(be=>Math.min(be+1,Te.length-1))):X.key==="ArrowUp"?(X.preventDefault(),Y(be=>Math.max(be-1,0))):X.key==="Enter"?(X.preventDefault(),Ve(Te[B])):X.key==="Escape"&&L(!1);return}(X.ctrlKey||X.metaKey)&&X.key==="b"?(X.preventDefault(),ue("bold")):(X.ctrlKey||X.metaKey)&&X.key==="i"?(X.preventDefault(),ue("italic")):(X.ctrlKey||X.metaKey)&&X.key==="u"?(X.preventDefault(),ue("underline")):(X.ctrlKey||X.metaKey)&&X.key==="f"?(X.preventDefault(),U(be=>!be)):(X.ctrlKey||X.metaKey)&&X.key==="z"&&!X.shiftKey?(X.preventDefault(),ue("undo")):(X.ctrlKey||X.metaKey)&&(X.key==="y"||X.key==="z"&&X.shiftKey)&&(X.preventDefault(),ue("redo"))},[F,Te,B,Ve,ue]),at=s.useCallback(X=>{var Me;if(!u)return;X.preventDefault();const be=X.clipboardData.getData("text/html"),_e=X.clipboardData.getData("text/plain");if(be){const Fe=be.replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<script[\s\S]*?<\/script>/gi,"").replace(/class="[^"]*"/gi,"").replace(/style="[^"]*"/gi,"").replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,"").replace(/<!--[\s\S]*?-->/g,"").replace(/<\/?(?:xml|meta|link|font|span)[^>]*>/gi,"");document.execCommand("insertHTML",!1,Fe)}else _e&&document.execCommand("insertText",!1,_e);const Ne=I.current;Ne&&(a(Ne.innerHTML),he(((Me=Ne.textContent)==null?void 0:Me.length)??0))},[u,a]),Ct=s.useCallback(async X=>{if(!h)return;X.preventDefault();const be=Array.from(X.dataTransfer.files);if(be.length===0)return;const _e=await h(be),Ne=I.current;if(Ne){Ne.focus();for(const Me of _e)if(/\.(png|jpe?g|gif|webp|svg|bmp|ico)$/i.test(Me)||Me.startsWith("data:image/"))document.execCommand("insertImage",!1,Me);else{const Fe=`<a href="${Me}">${Me.split("/").pop()??Me}</a>`;document.execCommand("insertHTML",!1,Fe)}a(Ne.innerHTML)}},[h,a]),yt=s.useCallback(X=>{h&&X.preventDefault()},[h]),q=s.useCallback(X=>{var Fe;const be=I.current;if(!be||!Q)return;const _e=be.textContent??"",Ne=Q.toLowerCase(),Me=_e.toLowerCase();(X===1?Me.indexOf(Ne):Me.lastIndexOf(Ne))!==-1&&(be.focus(),(Fe=window.find)==null||Fe.call(window,Q))},[Q]),ce=s.useCallback(()=>{const X=I.current;!X||!Q||(X.innerHTML=X.innerHTML.split(Q).join(Z),a(X.innerHTML))},[Q,Z,a]),ge=s.useCallback(()=>{if(!Q)return;const X=t.split(Q).join(Z);a(X);const be=I.current;be&&(be.innerHTML=X)},[Q,Z,t,a]),ye=s.useCallback(X=>{const be=I.current;be&&(be.focus(),document.execCommand("insertText",!1,X),a(be.innerHTML),ie(!1))},[a]),je=s.useCallback(X=>{const be=I.current;be&&(be.focus(),document.execCommand("insertHTML",!1,X),a(be.innerHTML),Ce(!1))},[a]),fe=s.useCallback(X=>{const be=y||o;return X==="fontSize"?e.jsx(Qe,{size:"sm",value:"",onChange:_e=>ue("fontSize",String(_e)),disabled:be,placeholder:"Size",options:vu.map(_e=>({value:_e.value,label:_e.label})),style:{minWidth:70,maxWidth:80}},X):X==="fontColor"?e.jsx(st,{value:de,onChange:_e=>{oe(_e),ue("fontColor",_e)},disabled:be,size:"sm",label:"",title:"Text color"},X):X==="bgColor"?e.jsx(st,{value:ae,onChange:_e=>{ve(_e),ue("bgColor",_e)},disabled:be,size:"sm",label:"",title:"Highlight color"},X):e.jsx(xe,{size:"sm",variant:X==="markdown"&&N||X==="fullscreen"&&J||X==="source"&&x||X==="findReplace"&&ke||X==="emoji"&&ee?"primary":"ghost",onClick:()=>ue(X),title:X,disabled:be,children:xu[X]||X},X)},[y,o,ue,N,J,de,ae,x,ke,ee]);return e.jsxs("div",{className:`nice-field nice-field--${S} ${C?"nice-field--error":""} ${M||""}`,style:_,children:[b&&e.jsxs("label",{className:"nice-field__label",htmlFor:P,children:[b,w&&e.jsx("span",{className:"nice-field__required",children:"*"})]}),e.jsxs("div",{ref:T,className:`nice-htmleditor${J?" nice-htmleditor--fullscreen":""}`,children:[e.jsxs("div",{className:"nice-htmleditor__toolbar",style:{display:"flex",flexWrap:"wrap",gap:2,alignItems:"center"},children:[i.map(fe),m&&m.length>0&&e.jsxs("div",{style:{position:"relative"},children:[e.jsx(xe,{size:"sm",variant:ne?"primary":"ghost",onClick:()=>Ce(X=>!X),title:"Insert template",children:"📋"}),ne&&e.jsx("ul",{style:{position:"absolute",top:"100%",right:0,zIndex:200,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,.12)",listStyle:"none",margin:0,padding:4,minWidth:160,maxHeight:200,overflow:"auto"},children:m.map((X,be)=>e.jsx("li",{style:{padding:"6px 10px",cursor:"pointer",borderRadius:4},onMouseDown:_e=>{_e.preventDefault(),je(X.html)},children:X.label},be))})]})]}),ke&&e.jsxs("div",{className:"nice-htmleditor__find-bar",style:{display:"flex",gap:4,alignItems:"center",padding:"4px 8px",background:"#f8f9fa",borderBottom:"1px solid #ddd",fontSize:"0.875em"},children:[e.jsx("input",{type:"text",placeholder:"Find...",value:Q,onChange:X=>W(X.target.value),style:{flex:1,maxWidth:180,padding:"2px 6px",border:"1px solid #ccc",borderRadius:4}}),e.jsx("input",{type:"text",placeholder:"Replace...",value:Z,onChange:X=>te(X.target.value),style:{flex:1,maxWidth:180,padding:"2px 6px",border:"1px solid #ccc",borderRadius:4}}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>q(1),title:"Find next",children:"▶"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>q(-1),title:"Find previous",children:"◀"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:ce,disabled:y||o,children:"Replace"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:ge,disabled:y||o,children:"All"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>U(!1),children:"✕"})]}),ee&&e.jsx("div",{className:"nice-htmleditor__emoji-picker",style:{padding:8,background:"#fff",borderBottom:"1px solid #ddd",maxHeight:180,overflowY:"auto"},children:ku.map(X=>e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"0.7em",fontWeight:600,color:"#999",padding:"4px 0"},children:X.label}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:2},children:X.emojis.map(be=>e.jsx("span",{style:{cursor:"pointer",fontSize:"1.2em",padding:2,borderRadius:4},onClick:()=>ye(be),title:be,children:be},be))})]},X.label))}),e.jsx("input",{ref:D,type:"file",accept:"image/*",style:{display:"none"},onChange:$e}),x?e.jsx("textarea",{className:"nice-htmleditor__source",value:A,onChange:X=>O(X.target.value),style:{minHeight:n,width:"100%",fontFamily:"monospace",resize:"vertical",whiteSpace:"pre",fontSize:"0.85em"},disabled:y||o}):N?e.jsx("textarea",{className:"nice-htmleditor__markdown",value:E,onChange:X=>R(X.target.value),style:{minHeight:n,width:"100%",fontFamily:"monospace",resize:"vertical"},disabled:y||o}):e.jsxs("div",{style:{position:"relative"},children:[e.jsx("div",{ref:I,id:P,className:"nice-htmleditor__content",contentEditable:!y&&!o,dangerouslySetInnerHTML:{__html:t},onInput:ze,onKeyDown:De,onPaste:at,onDrop:Ct,onDragOver:yt,style:{minHeight:n},"data-placeholder":r,role:"textbox","aria-multiline":"true",suppressContentEditableWarning:!0}),F&&Te.length>0&&e.jsx("ul",{className:"nice-htmleditor__mention-list",children:Te.map((X,be)=>e.jsx("li",{className:`nice-htmleditor__mention-item ${be===B?"nice-htmleditor__mention-item--active":""}`,onMouseDown:_e=>{_e.preventDefault(),Ve(X)},children:X.label},X.key))})]}),e.jsxs("div",{className:"nice-htmleditor__statusbar",style:{display:"flex",gap:12,padding:"2px 8px",fontSize:"0.75em",color:"#666",borderTop:"1px solid #eee"},children:[g>0&&e.jsxs("span",{children:[re," / ",g]}),f&&e.jsxs("span",{children:[we," words"]}),f&&e.jsxs("span",{children:[re," chars"]}),x&&e.jsx("span",{style:{fontWeight:600},children:"HTML Source"}),N&&e.jsx("span",{style:{fontWeight:600},children:"Markdown"})]})]}),C&&e.jsx("div",{className:"nice-field__error",children:C}),v&&!C&&e.jsx("div",{className:"nice-field__hint",children:v})]})},ju=Object.freeze(Object.defineProperty({__proto__:null,NiceHtmlEditor:fa},Symbol.toStringTag,{value:"Module"})),Cu=[{code:"en",label:"English"},{code:"es",label:"Spanish"},{code:"fr",label:"French"},{code:"de",label:"German"},{code:"it",label:"Italian"},{code:"pt",label:"Portuguese"},{code:"pl",label:"Polish"},{code:"ru",label:"Russian"},{code:"zh",label:"Chinese"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"ar",label:"Arabic"}],Su=[{style:"professional",label:"Professional"},{style:"casual",label:"Casual"},{style:"formal",label:"Formal"},{style:"concise",label:"Concise"}];s.forwardRef(function(t,a){var le,ke;const{enableAI:r=!0,aiModel:n,enableImprove:i=!0,enableTranslate:o=!0,enableGenerate:c=!0,toolbar:l,languages:d=Cu,textStyles:p=Su,onImprove:h,onTranslate:u,onGenerate:g,showAIToolbar:f=!0,value:m,onChange:b,...C}=t,v=s.useRef(null),[w,y]=s.useState(!1),[S,k]=s.useState(!1),[M,_]=s.useState(!1),[j,z]=s.useState(""),[P,I]=s.useState(""),[D,T]=s.useState("professional"),[N,H]=s.useState(""),[E,R]=s.useState(((le=d[0])==null?void 0:le.code)||"en"),[x,$]=s.useState(""),[A,O]=s.useState(""),{t:F}=Zt(),L=vt(),{improveText:G,translate:V,generateHtml:B,isLoading:Y}=Zo(),J=r&&L.isConfigured,me=s.useCallback(()=>{const U=window.getSelection();return U&&U.toString().trim()?U.toString():""},[]),de=s.useCallback(U=>{const Q=window.getSelection();if(Q&&Q.rangeCount>0){const W=Q.getRangeAt(0);W.deleteContents();const Z=document.createElement("div");Z.innerHTML=U;const te=document.createDocumentFragment();for(;Z.firstChild;)te.appendChild(Z.firstChild);if(W.insertNode(te),v.current){const ee=v.current.innerHTML;b(ee)}}},[b]),oe=s.useCallback(async(U="professional")=>{if(!J||!i)return"";const Q=me();if(!Q)return"";z(Q),T(U),y(!0),I("");try{const W=await G(Q,U);return I(W),h==null||h(Q,W,U),W}catch{return I(F("htmlEditorAI.improveFailed","Failed to improve text")),""}},[J,i,me,G,h,F]),ae=s.useCallback(async U=>{var W;if(!J||!o)return"";const Q=me();if(!Q)return"";z(Q),R(U),k(!0),H("");try{const Z=((W=d.find(ee=>ee.code===U))==null?void 0:W.label)||U,te=await V(Q,Z);return H(te),u==null||u(Q,te,U),te}catch{return H(F("htmlEditorAI.translateFailed","Failed to translate text")),""}},[J,o,me,V,d,u,F]),ve=s.useCallback(async U=>{if(!J||!c||!U.trim())return"";$(U),O("");try{const Q=await B(U);return O(Q),g==null||g(U,Q),Q}catch{return O(F("htmlEditorAI.generateFailed","Failed to generate HTML")),""}},[J,c,B,g,F]),re=s.useCallback(()=>{P&&de(P),y(!1),I("")},[P,de]),he=s.useCallback(()=>{N&&de(N),k(!1),H("")},[N,de]),we=s.useCallback(()=>{if(A&&v.current){document.execCommand("insertHTML",!1,A);const U=v.current.innerHTML;b(U)}_(!1),O(""),$("")},[A,b]);return s.useImperativeHandle(a,()=>({getEditor:()=>v.current,focus:()=>{var U;return(U=v.current)==null?void 0:U.focus()},getValue:()=>{var U;return((U=v.current)==null?void 0:U.innerHTML)||""},setValue:U=>{v.current&&(v.current.innerHTML=U,b(U))},getSelection:me,insertHtml:U=>{document.execCommand("insertHTML",!1,U),v.current&&b(v.current.innerHTML)},improveSelection:oe,translateSelection:ae,generateHtml:ve})),s.useCallback(U=>{v.current=U},[]),e.jsxs("div",{className:"nice-html-editor-ai","data-testid":t["data-testid"],children:[f&&J&&e.jsxs("div",{className:"nice-html-editor-ai__toolbar",children:[e.jsxs("div",{className:"nice-html-editor-ai__toolbar-left",children:[e.jsx("span",{className:"nice-html-editor-ai__badge",children:"AI"}),Y&&e.jsx("span",{className:"nice-html-editor-ai__loading",children:F("htmlEditorAI.processing","Processing...")})]}),e.jsxs("div",{className:"nice-html-editor-ai__toolbar-right",children:[i&&e.jsxs("div",{className:"nice-html-editor-ai__dropdown",children:[e.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",onClick:()=>oe(),disabled:Y,title:F("htmlEditorAI.improveText","Improve selected text"),children:["✨ ",F("htmlEditorAI.improve","Improve")]}),e.jsx("div",{className:"nice-html-editor-ai__dropdown-menu",children:p.map(({style:U,label:Q})=>e.jsx("button",{type:"button",className:"nice-html-editor-ai__dropdown-item",onClick:()=>oe(U),children:Q},U))})]}),o&&e.jsxs("div",{className:"nice-html-editor-ai__dropdown",children:[e.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",disabled:Y,title:F("htmlEditorAI.translateText","Translate selected text"),children:["🌐 ",F("htmlEditorAI.translate","Translate")]}),e.jsx("div",{className:"nice-html-editor-ai__dropdown-menu nice-html-editor-ai__dropdown-menu--languages",children:d.map(({code:U,label:Q})=>e.jsx("button",{type:"button",className:"nice-html-editor-ai__dropdown-item",onClick:()=>ae(U),children:Q},U))})]}),c&&e.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",onClick:()=>_(!0),disabled:Y,title:F("htmlEditorAI.generateHtml","Generate HTML from description"),children:["⚡ ",F("htmlEditorAI.generate","Generate")]})]})]}),e.jsx("div",{className:"nice-html-editor-ai__editor-wrapper",children:e.jsx(fa,{value:m,onChange:b,toolbar:l,...C})}),w&&e.jsxs("div",{className:"nice-html-editor-ai__panel",children:[e.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[e.jsxs("h4",{children:["✨ ",F("htmlEditorAI.improveText","Improve Text")]}),e.jsx("div",{className:"nice-html-editor-ai__style-selector",children:p.map(({style:U,label:Q})=>e.jsx("button",{type:"button",className:`nice-html-editor-ai__style-btn ${D===U?"nice-html-editor-ai__style-btn--active":""}`,onClick:()=>{T(U),oe(U)},children:Q},U))}),e.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>y(!1),children:"✕"})]}),e.jsx("div",{className:"nice-html-editor-ai__panel-body",children:Y?e.jsx("div",{className:"nice-html-editor-ai__loading-panel",children:F("htmlEditorAI.improving","Improving text...")}):e.jsxs("div",{className:"nice-html-editor-ai__comparison",children:[e.jsxs("div",{className:"nice-html-editor-ai__text-block",children:[e.jsx("h5",{children:F("htmlEditorAI.original","Original")}),e.jsx("div",{className:"nice-html-editor-ai__text-content",children:j})]}),e.jsxs("div",{className:"nice-html-editor-ai__text-block nice-html-editor-ai__text-block--improved",children:[e.jsx("h5",{children:F("htmlEditorAI.improved","Improved")}),e.jsx("div",{className:"nice-html-editor-ai__text-content",children:P})]})]})}),e.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[e.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:re,disabled:!P||Y,children:["✓ ",F("htmlEditorAI.apply","Apply")]}),e.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{y(!1),I("")},children:F("htmlEditorAI.cancel","Cancel")})]})]}),S&&e.jsxs("div",{className:"nice-html-editor-ai__panel",children:[e.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[e.jsxs("h4",{children:["🌐 ",F("htmlEditorAI.translateText","Translate Text")]}),e.jsx("div",{className:"nice-html-editor-ai__language-selector",children:e.jsx("select",{value:E,onChange:U=>{R(U.target.value),ae(U.target.value)},className:"nice-html-editor-ai__language-select",children:d.map(({code:U,label:Q})=>e.jsx("option",{value:U,children:Q},U))})}),e.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>k(!1),children:"✕"})]}),e.jsx("div",{className:"nice-html-editor-ai__panel-body",children:Y?e.jsx("div",{className:"nice-html-editor-ai__loading-panel",children:F("htmlEditorAI.translating","Translating...")}):e.jsxs("div",{className:"nice-html-editor-ai__comparison",children:[e.jsxs("div",{className:"nice-html-editor-ai__text-block",children:[e.jsx("h5",{children:F("htmlEditorAI.original","Original")}),e.jsx("div",{className:"nice-html-editor-ai__text-content",children:j})]}),e.jsxs("div",{className:"nice-html-editor-ai__text-block nice-html-editor-ai__text-block--translated",children:[e.jsx("h5",{children:((ke=d.find(U=>U.code===E))==null?void 0:ke.label)||E}),e.jsx("div",{className:"nice-html-editor-ai__text-content",children:N})]})]})}),e.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[e.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:he,disabled:!N||Y,children:["✓ ",F("htmlEditorAI.apply","Apply")]}),e.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{k(!1),H("")},children:F("htmlEditorAI.cancel","Cancel")})]})]}),M&&e.jsxs("div",{className:"nice-html-editor-ai__panel nice-html-editor-ai__panel--generate",children:[e.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[e.jsxs("h4",{children:["⚡ ",F("htmlEditorAI.generateHtml","Generate HTML")]}),e.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>{_(!1),O(""),$("")},children:"✕"})]}),e.jsxs("div",{className:"nice-html-editor-ai__panel-body",children:[e.jsxs("div",{className:"nice-html-editor-ai__generate-input",children:[e.jsx("textarea",{placeholder:F("htmlEditorAI.generatePlaceholder",'Describe what you want to create (e.g., "A pricing table with 3 tiers", "A contact form with name, email, and message")'),value:x,onChange:U=>$(U.target.value),className:"nice-html-editor-ai__generate-textarea",rows:3}),e.jsx("button",{type:"button",className:"nice-html-editor-ai__generate-btn",onClick:()=>ve(x),disabled:Y||!x.trim(),children:Y?F("htmlEditorAI.generating","Generating..."):F("htmlEditorAI.generate","Generate")})]}),A&&e.jsxs("div",{className:"nice-html-editor-ai__generate-result",children:[e.jsx("h5",{children:F("htmlEditorAI.preview","Preview")}),e.jsx("div",{className:"nice-html-editor-ai__preview",dangerouslySetInnerHTML:{__html:A}}),e.jsx("h5",{children:F("htmlEditorAI.htmlCode","HTML Code")}),e.jsx("pre",{className:"nice-html-editor-ai__code",children:A})]})]}),e.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[e.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:we,disabled:!A||Y,children:["✓ ",F("htmlEditorAI.insert","Insert")]}),e.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{_(!1),O(""),$("")},children:F("htmlEditorAI.cancel","Cancel")})]})]})]})});function xt(t){return t.toString().padStart(2,"0")}function Nu(t){if(!t)return{date:"",hours:0,minutes:0,seconds:0};const a=new Date(t);if(isNaN(a.getTime()))return{date:"",hours:0,minutes:0,seconds:0};const r=a.getFullYear(),n=xt(a.getMonth()+1),i=xt(a.getDate());return{date:`${r}-${n}-${i}`,hours:a.getHours(),minutes:a.getMinutes(),seconds:a.getSeconds()}}function Mu(t,a,r,n){return t?`${t}T${xt(a)}:${xt(r)}:${xt(n)}`:""}const er=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,value:u,onChange:g,onBlur:f,min:m,max:b,hourFormat:C="24",minuteStep:v=1,showSeconds:w=!1,showNow:y=!1,clearable:S=!1,...k},M)=>{const{t:_}=Re(),j=Ae(d),z=s.useRef(null),P=s.useMemo(()=>Nu(u),[u]),I=s.useCallback((L,G,V,B)=>{g==null||g(Mu(L,G,V,B))},[g]),D=s.useCallback(L=>{I(L.target.value,P.hours,P.minutes,P.seconds)},[I,P]),T=s.useCallback(L=>{const G=Math.max(0,Math.min(23,parseInt(L.target.value,10)||0));I(P.date,G,P.minutes,P.seconds)},[I,P]),N=s.useCallback(L=>{const G=Math.max(0,Math.min(59,parseInt(L.target.value,10)||0));I(P.date,P.hours,G,P.seconds)},[I,P]),H=s.useCallback(L=>{const G=Math.max(0,Math.min(59,parseInt(L.target.value,10)||0));I(P.date,P.hours,P.minutes,G)},[I,P]),E=s.useCallback(()=>{const L=P.hours>=12?P.hours-12:P.hours+12;I(P.date,L,P.minutes,P.seconds)},[I,P]),R=s.useCallback(()=>{const L=new Date,G=`${L.getFullYear()}-${xt(L.getMonth()+1)}-${xt(L.getDate())}`;I(G,L.getHours(),L.getMinutes(),L.getSeconds())},[I]),x=s.useCallback(()=>{g==null||g("")},[g]),$=C==="12"?P.hours===0?12:P.hours>12?P.hours-12:P.hours:P.hours,A=P.hours>=12?"PM":"AM",O=m?m.split("T")[0]:void 0,F=b?b.split("T")[0]:void 0;return e.jsxs("div",{ref:M,className:`nice-field ${p||""}`,style:h,...k,children:[t&&e.jsx("label",{htmlFor:j,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:`nice-datetime nice-datetime--${c} ${r?"nice-datetime--error":""} ${i?"nice-datetime--disabled":""} ${o?"nice-datetime--readonly":""}`,children:[e.jsx("input",{ref:z,id:j,type:"date",className:"nice-datetime__date",name:l?`${l}_date`:void 0,value:P.date,min:O,max:F,disabled:i,readOnly:o,"aria-invalid":!!r,"aria-describedby":r?`${j}-error`:a?`${j}-helper`:void 0,onChange:D,onBlur:f}),e.jsx("span",{className:"nice-datetime__separator",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M10 2a8 8 0 100 16 8 8 0 000-16zm.75 4a.75.75 0 00-1.5 0v4c0 .2.08.39.22.53l2 2a.75.75 0 101.06-1.06L10.75 9.69V6z"})})}),e.jsx("input",{type:"number",className:"nice-datetime__time-part",value:$,min:C==="12"?1:0,max:C==="12"?12:23,disabled:i,readOnly:o,"aria-label":_("datetime.hours","Hours"),onChange:T}),e.jsx("span",{className:"nice-datetime__colon",children:":"}),e.jsx("input",{type:"number",className:"nice-datetime__time-part",value:xt(P.minutes),min:0,max:59,step:v,disabled:i,readOnly:o,"aria-label":_("datetime.minutes","Minutes"),onChange:N}),w&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"nice-datetime__colon",children:":"}),e.jsx("input",{type:"number",className:"nice-datetime__time-part",value:xt(P.seconds),min:0,max:59,disabled:i,readOnly:o,"aria-label":_("datetime.seconds","Seconds"),onChange:H})]}),C==="12"&&e.jsx("button",{type:"button",className:"nice-datetime__ampm",disabled:i||o,onClick:E,"aria-label":_("datetime.toggleAmPm","Toggle AM/PM"),children:A}),y&&e.jsx("button",{type:"button",className:"nice-datetime__now",disabled:i||o,onClick:R,"aria-label":_("datetime.now","Now"),children:_("datetime.now","Now")}),S&&u&&e.jsx("button",{type:"button",className:"nice-input__clear",disabled:i||o,onClick:x,"aria-label":_("controls.clear","Clear"),children:"✕"})]}),r&&e.jsx("div",{id:`${j}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{id:`${j}-helper`,className:"nice-field__helper",children:a})]})});er.displayName="NiceDateTimePicker";function $t(t){return t.toString().padStart(2,"0")}function ka(t){if(!t)return{hours:0,minutes:0,seconds:0};const a=t.split(":").map(Number);return{hours:Math.max(0,Math.min(23,a[0]||0)),minutes:Math.max(0,Math.min(59,a[1]||0)),seconds:Math.max(0,Math.min(59,a[2]||0))}}function $u(t,a,r,n){return n?`${$t(t)}:${$t(a)}:${$t(r)}`:`${$t(t)}:${$t(a)}`}const tr=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,value:u,onChange:g,onBlur:f,hourFormat:m="24",minuteStep:b=1,showSeconds:C=!1,min:v,max:w,clearable:y=!1,...S},k)=>{const{t:M}=Re(),_=Ae(d),j=s.useMemo(()=>ka(u),[u]),z=s.useCallback(($,A,O)=>{g==null||g($u($,A,O,C))},[g,C]),P=s.useCallback(($,A,O)=>{if(v){const F=ka(v),L=F.hours*3600+F.minutes*60+F.seconds;if($*3600+A*60+O<L)return[F.hours,F.minutes,F.seconds]}if(w){const F=ka(w),L=F.hours*3600+F.minutes*60+F.seconds;if($*3600+A*60+O>L)return[F.hours,F.minutes,F.seconds]}return[$,A,O]},[v,w]),I=s.useCallback($=>{let A=parseInt($.target.value,10)||0;if(m==="12"){const G=j.hours<12;A=Math.max(1,Math.min(12,A)),A===12?A=G?0:12:A=G?A:A+12}else A=Math.max(0,Math.min(23,A));const[O,F,L]=P(A,j.minutes,j.seconds);z(O,F,L)},[z,j,m,P]),D=s.useCallback($=>{const A=Math.max(0,Math.min(59,parseInt($.target.value,10)||0)),[O,F,L]=P(j.hours,A,j.seconds);z(O,F,L)},[z,j,P]),T=s.useCallback($=>{const A=Math.max(0,Math.min(59,parseInt($.target.value,10)||0)),[O,F,L]=P(j.hours,j.minutes,A);z(O,F,L)},[z,j,P]),N=s.useCallback(()=>{const $=j.hours>=12?j.hours-12:j.hours+12,[A,O,F]=P($,j.minutes,j.seconds);z(A,O,F)},[z,j,P]),H=s.useCallback(()=>{g==null||g("")},[g]),E=s.useCallback(($,A)=>{if(o||i)return;const O=$==="m"?b:1;if(A.key==="ArrowUp"||A.key==="ArrowDown"){A.preventDefault();const F=A.key==="ArrowUp"?O:-O;let L=j.hours,G=j.minutes,V=j.seconds;$==="h"?L=((L+F)%24+24)%24:$==="m"?G=((G+F)%60+60)%60:V=((V+F)%60+60)%60;const[B,Y,J]=P(L,G,V);z(B,Y,J)}},[j,b,z,P,o,i]),R=m==="12"?j.hours===0?12:j.hours>12?j.hours-12:j.hours:j.hours,x=j.hours>=12?"PM":"AM";return e.jsxs("div",{ref:k,className:`nice-field ${p||""}`,style:h,...S,children:[t&&e.jsx("label",{htmlFor:_,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:`nice-timepicker nice-timepicker--${c} ${r?"nice-timepicker--error":""} ${i?"nice-timepicker--disabled":""} ${o?"nice-timepicker--readonly":""}`,children:[e.jsx("svg",{className:"nice-timepicker__icon",width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M10 2a8 8 0 100 16 8 8 0 000-16zm.75 4a.75.75 0 00-1.5 0v4c0 .2.08.39.22.53l2 2a.75.75 0 101.06-1.06L10.75 9.69V6z"})}),e.jsx("input",{id:_,type:"number",className:"nice-timepicker__part",value:R,min:m==="12"?1:0,max:m==="12"?12:23,disabled:i,readOnly:o,name:l,"aria-invalid":!!r,"aria-describedby":r?`${_}-error`:a?`${_}-helper`:void 0,"aria-label":M("datetime.hours","Hours"),onChange:I,onKeyDown:$=>E("h",$),onBlur:f}),e.jsx("span",{className:"nice-timepicker__colon",children:":"}),e.jsx("input",{type:"number",className:"nice-timepicker__part",value:$t(j.minutes),min:0,max:59,step:b,disabled:i,readOnly:o,"aria-label":M("datetime.minutes","Minutes"),onChange:D,onKeyDown:$=>E("m",$)}),C&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"nice-timepicker__colon",children:":"}),e.jsx("input",{type:"number",className:"nice-timepicker__part",value:$t(j.seconds),min:0,max:59,disabled:i,readOnly:o,"aria-label":M("datetime.seconds","Seconds"),onChange:T,onKeyDown:$=>E("s",$)})]}),m==="12"&&e.jsx("button",{type:"button",className:"nice-timepicker__ampm",disabled:i||o,onClick:N,"aria-label":M("datetime.toggleAmPm","Toggle AM/PM"),children:x}),y&&u&&e.jsx("button",{type:"button",className:"nice-input__clear",disabled:i||o,onClick:H,"aria-label":M("controls.clear","Clear"),children:"✕"})]}),r&&e.jsx("div",{id:`${_}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{id:`${_}-helper`,className:"nice-field__helper",children:a})]})});tr.displayName="NiceTimePicker";function zu(t){return[...t].map(a=>a==="9"?{type:"digit"}:a==="a"?{type:"letter"}:a==="*"?{type:"alphanum"}:{type:"literal",literal:a})}function Eu(t,a){return a.type==="digit"?/\d/.test(t):a.type==="letter"?/[a-zA-Z]/.test(t):a.type==="alphanum"?/[a-zA-Z0-9]/.test(t):!1}function Or(t,a,r){let n=0,i="";for(const o of a)o.type==="literal"?i+=o.literal:n<t.length?(i+=t[n],n++):i+=r;return i}function Au(t,a){return t.map(r=>r.type==="literal"?r.literal:a).join("")}function Du(t,a){for(let r=a;r<t.length;r++)if(t[r].type!=="literal")return r;return t.length}const ar=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,value:u="",onChange:g,onBlur:f,onKeyDown:m,mask:b,maskChar:C="_",placeholder:v,showMaskAsPlaceholder:w=!0,clearable:y=!1,autoFocus:S,...k},M)=>{const{t:_}=Re(),j=Ae(d),z=s.useRef(null),[P,I]=s.useState(!1),D=s.useMemo(()=>zu(b),[b]),T=s.useMemo(()=>Or(u,D,C),[u,D,C]),N=P||u?T:"",H=v??(w?Au(D,C):void 0),E=s.useCallback(L=>{z.current=L,typeof M=="function"?M(L):M&&(M.current=L)},[M]),R=s.useCallback(L=>{const G=Or(L,D,C);g==null||g(L,G)},[g,D,C]),x=s.useCallback(L=>{const G=L.currentTarget,V=G.value;let B="",Y=0;for(let J=0;J<V.length&&Y<D.length;J++){const me=V[J];for(;Y<D.length&&D[Y].type==="literal";)Y++;if(Y>=D.length)break;Eu(me,D[Y])&&(B+=me,Y++)}R(B),requestAnimationFrame(()=>{Du(D,0);let J=0,me=0;for(let de=0;de<D.length;de++)if(D[de].type==="literal")J=de+1;else if(me<B.length)me++,J=de+1;else{J=de;break}me>=B.length&&B.length>0&&(J=Math.min(J,D.length)),G.setSelectionRange(J,J)})},[D,R]),$=s.useCallback(L=>{if(L.key==="Backspace"&&u.length>0){L.preventDefault();const G=u.slice(0,-1);R(G)}m==null||m(L)},[u,R,m]),A=s.useCallback(()=>I(!0),[]),O=s.useCallback(L=>{I(!1),f==null||f(L)},[f]),F=s.useCallback(()=>{var L;R(""),(L=z.current)==null||L.focus()},[R]);return e.jsxs("div",{className:`nice-field ${p||""}`,style:h,children:[t&&e.jsx("label",{htmlFor:j,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:`nice-input nice-input--${c} ${r?"nice-input--error":""} ${i?"nice-input--disabled":""} ${o?"nice-input--readonly":""}`,children:[e.jsx("input",{ref:E,id:j,className:"nice-input__native nice-masked-input",type:"text",name:l,value:N,placeholder:H,disabled:i,readOnly:o,autoFocus:S,"aria-invalid":!!r,"aria-describedby":r?`${j}-error`:a?`${j}-helper`:void 0,onInput:x,onChange:()=>{},onKeyDown:$,onFocus:A,onBlur:O,...k}),y&&u&&e.jsx("button",{type:"button",className:"nice-input__clear",disabled:i||o,onClick:F,"aria-label":_("controls.clear","Clear"),children:"✕"})]}),r&&e.jsx("div",{id:`${j}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{id:`${j}-helper`,className:"nice-field__helper",children:a})]})});ar.displayName="NiceMaskedInput";const Tu=({filled:t,size:a})=>e.jsxs("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t==="half"&&e.jsx("defs",{children:e.jsxs("linearGradient",{id:"halfGrad",children:[e.jsx("stop",{offset:"50%",stopColor:"currentColor"}),e.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),e.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z",fill:t==="full"?"currentColor":t==="half"?"url(#halfGrad)":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]}),Ru={xxs:10,xs:14,sm:18,md:22,lg:28,xl:34,xxl:42},rr=s.forwardRef(({value:t=0,onChange:a,count:r=5,half:n=!1,readOnly:i=!1,disabled:o=!1,size:c="md",label:l,icon:d,name:p,error:h,id:u,className:g,style:f,...m},b)=>{const{t:C}=Re(),v=Ae(u),[w,y]=s.useState(null),S=Ru[c],k=!i&&!o,M=w??t,_=D=>M>=D+1?"full":n&&M>=D+.5?"half":"empty",j=s.useCallback((D,T)=>{if(!k)return;const N=T&&n?D+.5:D+1;a==null||a(N===t?0:N)},[k,n,a,t]),z=s.useCallback((D,T)=>{if(k)if(n){const N=T.currentTarget.getBoundingClientRect(),H=T.clientX-N.left<N.width/2;y(H?D+.5:D+1)}else y(D+1)},[k,n]),P=s.useCallback(()=>{k&&y(null)},[k]),I=s.useCallback(D=>{if(!k)return;const T=n?.5:1;if(D.key==="ArrowRight"||D.key==="ArrowUp"){D.preventDefault();const N=Math.min(r,t+T);a==null||a(N)}else if(D.key==="ArrowLeft"||D.key==="ArrowDown"){D.preventDefault();const N=Math.max(0,t-T);a==null||a(N)}},[k,n,r,t,a]);return e.jsxs("div",{className:`nice-field ${g||""}`,style:f,...m,children:[l&&e.jsx("label",{htmlFor:v,className:"nice-field__label",children:l}),e.jsxs("div",{ref:b,id:v,className:`nice-rating nice-rating--${c} ${o?"nice-rating--disabled":""} ${i?"nice-rating--readonly":""}`,role:"slider","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":r,"aria-label":l||C("controls.rating","Rating"),"aria-invalid":!!h,tabIndex:k?0:-1,onMouseLeave:P,onKeyDown:I,children:[p&&e.jsx("input",{type:"hidden",name:p,value:t}),Array.from({length:r},(D,T)=>{const N=_(T);return e.jsx("span",{className:`nice-rating__star nice-rating__star--${N}`,onClick:H=>{if(!k)return;const E=H.currentTarget.getBoundingClientRect(),R=n&&H.clientX-E.left<E.width/2;j(T,R)},onMouseMove:H=>z(T,H),"aria-label":`${T+1} ${C("controls.star","star")}`,children:d?d(N):e.jsx(Tu,{filled:N,size:S})},T)})]}),h&&e.jsx("div",{className:"nice-field__error",role:"alert",children:h})]})});rr.displayName="NiceRating";const Fu=[{id:"length",label:"At least 8 characters",test:t=>t.length>=8},{id:"uppercase",label:"At least one uppercase letter",test:t=>/[A-Z]/.test(t)},{id:"lowercase",label:"At least one lowercase letter",test:t=>/[a-z]/.test(t)},{id:"digit",label:"At least one digit",test:t=>/\d/.test(t)},{id:"special",label:"At least one special character",test:t=>/[^a-zA-Z0-9]/.test(t)}];function Iu(t,a){if(!t)return{level:"none",passed:[],ratio:0};const r=a.filter(o=>o.test(t)).map(o=>o.id),n=r.length/a.length;let i="weak";return n>=1?i="strong":n>=.75?i="good":n>=.5&&(i="fair"),{level:i,passed:r,ratio:n}}const nr=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,value:u="",onChange:g,onBlur:f,onKeyDown:m,placeholder:b,maxLength:C,showToggle:v=!0,showStrength:w=!1,strengthRules:y,autoFocus:S,autoComplete:k,...M},_)=>{const{t:j}=Re(),z=Ae(d),[P,I]=s.useState(!1),D=y??Fu,T=s.useMemo(()=>w?Iu(u,D):null,[w,u,D]),N=s.useCallback(()=>I(H=>!H),[]);return e.jsxs("div",{className:`nice-field ${p||""}`,style:h,children:[t&&e.jsx("label",{htmlFor:z,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:t}),e.jsxs("div",{className:`nice-input nice-input--${c} ${r?"nice-input--error":""} ${i?"nice-input--disabled":""} ${o?"nice-input--readonly":""}`,children:[e.jsx("input",{ref:_,id:z,className:"nice-input__native",type:P?"text":"password",name:l,value:u,placeholder:b,disabled:i,readOnly:o,maxLength:C,autoFocus:S,autoComplete:k,"aria-invalid":!!r,"aria-describedby":r?`${z}-error`:a?`${z}-helper`:void 0,onChange:H=>g==null?void 0:g(H.target.value),onBlur:f,onKeyDown:m,...M}),v&&e.jsx("button",{type:"button",className:"nice-password__toggle",onClick:N,disabled:i,tabIndex:-1,"aria-label":P?j("password.hide","Hide password"):j("password.show","Show password"),children:P?e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"}),e.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),w&&T&&u&&e.jsxs("div",{className:"nice-password__strength",children:[e.jsx("div",{className:"nice-password__meter",children:e.jsx("div",{className:`nice-password__meter-fill nice-password__meter-fill--${T.level}`,style:{width:`${T.ratio*100}%`}})}),e.jsx("span",{className:`nice-password__strength-label nice-password__strength-label--${T.level}`,children:j(`password.strength.${T.level}`,T.level.charAt(0).toUpperCase()+T.level.slice(1))}),e.jsx("ul",{className:"nice-password__rules",children:D.map(H=>{const E=T.passed.includes(H.id);return e.jsxs("li",{className:`nice-password__rule ${E?"nice-password__rule--passed":""}`,children:[e.jsx("span",{className:"nice-password__rule-icon",children:E?"✓":"✗"}),H.label]},H.id)})})]}),r&&e.jsx("div",{id:`${z}-error`,className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{id:`${z}-helper`,className:"nice-field__helper",children:a})]})});nr.displayName="NicePasswordInput";const ir=s.forwardRef(({length:t=6,value:a="",onChange:r,masked:n=!1,onComplete:i,label:o,helperText:c,error:l,required:d,disabled:p,readOnly:h,size:u="md",name:g,id:f,className:m,style:b,autoFocus:C,...v},w)=>{const y=Ae(f),S=s.useRef([]),k=a.padEnd(t,"").slice(0,t).split(""),M=s.useCallback(I=>{var T;const D=Math.max(0,Math.min(t-1,I));(T=S.current[D])==null||T.focus()},[t]),_=s.useCallback(I=>{const D=I.join("");r==null||r(D),D.length===t&&D.indexOf("")===-1&&/^\d+$/.test(D)&&(i==null||i(D))},[r,i,t]),j=s.useCallback((I,D)=>{const T=D.target.value.replace(/\D/g,"").slice(-1);if(!T)return;const N=[...k];N[I]=T,_(N),M(I+1)},[k,_,M]),z=s.useCallback((I,D)=>{if(D.key==="Backspace"){D.preventDefault();const T=[...k];k[I]?(T[I]="",_(T)):I>0&&(T[I-1]="",_(T),M(I-1))}else D.key==="ArrowLeft"?(D.preventDefault(),M(I-1)):D.key==="ArrowRight"&&(D.preventDefault(),M(I+1))},[k,_,M]),P=s.useCallback(I=>{I.preventDefault();const D=I.clipboardData.getData("text").replace(/\D/g,"").slice(0,t);if(!D)return;const T=D.padEnd(t,"").slice(0,t).split("");for(let N=D.length;N<t;N++)T[N]=k[N]||"";_(T),M(Math.min(D.length,t-1))},[t,k,_,M]);return e.jsxs("div",{className:`nice-field ${m||""}`,style:b,...v,children:[o&&e.jsx("label",{htmlFor:`${y}-0`,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:o}),e.jsxs("div",{ref:w,className:`nice-otp nice-otp--${u} ${l?"nice-otp--error":""} ${p?"nice-otp--disabled":""}`,onPaste:P,children:[Array.from({length:t},(I,D)=>e.jsx("input",{ref:T=>{S.current[D]=T},id:D===0?`${y}-0`:void 0,className:"nice-otp__digit",type:n?"password":"text",inputMode:"numeric",maxLength:2,value:k[D]||"",disabled:p,readOnly:h,autoFocus:C&&D===0,"aria-invalid":!!l,"aria-label":`${D+1}`,onChange:T=>j(D,T),onKeyDown:T=>z(D,T),onFocus:T=>T.target.select()},D)),g&&e.jsx("input",{type:"hidden",name:g,value:a})]}),l&&e.jsx("div",{id:`${y}-error`,className:"nice-field__error",role:"alert",children:l}),!l&&c&&e.jsx("div",{id:`${y}-helper`,className:"nice-field__helper",children:c})]})});ir.displayName="NiceInputOtp";const Pu={xxs:36,xs:48,sm:64,md:80,lg:100,xl:128,xxl:160},ta=6,ot=135,Ot=405,wa=Ot-ot;function Ea(t,a,r,n){const i=(n-90)*(Math.PI/180);return{x:t+r*Math.cos(i),y:a+r*Math.sin(i)}}function Br(t,a,r,n,i){const o=Ea(t,a,r,n),c=Ea(t,a,r,i),l=i-n>180?1:0;return`M ${o.x} ${o.y} A ${r} ${r} 0 ${l} 1 ${c.x} ${c.y}`}const sr=s.forwardRef(({value:t=0,onChange:a,min:r=0,max:n=100,step:i=1,showValue:o=!0,valueTemplate:c="{value}",label:l,helperText:d,error:p,required:h,disabled:u,readOnly:g,size:f="md",name:m,id:b,className:C,style:v,...w},y)=>{const S=Ae(b),k=s.useRef(!1),M=s.useRef(null),_=typeof f=="number"?f:Pu[f],j=_/2,z=_/2,P=(_-ta*2)/2,I=n>r?(t-r)/(n-r):0,D=ot+I*wa,T=s.useCallback(x=>{let $=x<0?x+360:x;$=$+90,$>360&&($-=360),$<ot&&($=ot),$>Ot-360&&$<ot&&($=ot);let A=$;A<ot&&(A+=360);let O=(A-ot)/wa;O=Math.max(0,Math.min(1,O));const F=r+O*(n-r);return Math.round(F/i)*i},[r,n,i]),N=s.useCallback(x=>{if(u||g)return;const $=M.current;if(!$)return;const A=$.getBoundingClientRect(),O=x.clientX-A.left-A.width/2,F=x.clientY-A.top-A.height/2,L=Math.atan2(F,O)*(180/Math.PI)+90;let G=L<0?L+360:L;G<ot-360+wa&&G>Ot-360&&(G=G<180?Ot-360:ot);const V=T(G-90),B=Math.max(r,Math.min(n,V));a==null||a(B)},[T,u,g,r,n,a]);s.useEffect(()=>{const x=A=>{k.current&&N(A)},$=()=>{k.current=!1};return window.addEventListener("pointermove",x),window.addEventListener("pointerup",$),()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",$)}},[N]);const H=s.useCallback(x=>{if(u||g)return;let $=t;x.key==="ArrowUp"||x.key==="ArrowRight"?(x.preventDefault(),$=Math.min(n,t+i)):(x.key==="ArrowDown"||x.key==="ArrowLeft")&&(x.preventDefault(),$=Math.max(r,t-i)),$!==t&&(a==null||a($))},[t,a,r,n,i,u,g]),E=c.replace("{value}",String(t)),R=Ea(j,z,P,D);return e.jsxs("div",{className:`nice-field ${C||""}`,style:v,...w,children:[l&&e.jsx("label",{htmlFor:S,className:`nice-field__label ${h?"nice-field__label--required":""}`,children:l}),e.jsxs("div",{ref:x=>{M.current=x,typeof y=="function"?y(x):y&&(y.current=x)},className:`nice-knob nice-knob--${f} ${u?"nice-knob--disabled":""} ${p?"nice-knob--error":""}`,role:"slider",id:S,tabIndex:u?-1:0,"aria-valuenow":t,"aria-valuemin":r,"aria-valuemax":n,"aria-disabled":u,"aria-invalid":!!p,onPointerDown:x=>{u||g||(k.current=!0,N(x))},onKeyDown:H,children:[e.jsxs("svg",{width:_,height:_,viewBox:`0 0 ${_} ${_}`,children:[e.jsx("path",{d:Br(j,z,P,ot,Ot),fill:"none",stroke:"var(--nice-border-color, #d1d5db)",strokeWidth:ta,strokeLinecap:"round"}),I>0&&e.jsx("path",{d:Br(j,z,P,ot,D),fill:"none",stroke:"var(--nice-primary, #3b82f6)",strokeWidth:ta,strokeLinecap:"round"}),e.jsx("circle",{cx:R.x,cy:R.y,r:ta,fill:"var(--nice-primary, #3b82f6)"})]}),o&&e.jsx("span",{className:"nice-knob__value",children:E}),m&&e.jsx("input",{type:"hidden",name:m,value:t})]}),p&&e.jsx("div",{className:"nice-field__error",role:"alert",children:p}),!p&&d&&e.jsx("div",{className:"nice-field__helper",children:d})]})});sr.displayName="NiceKnob";const or=s.forwardRef(({value:t="",onChange:a,suggestions:r=[],onSearch:n,trigger:i="@",renderSuggestion:o,placeholder:c,rows:l=3,label:d,helperText:p,error:h,required:u,disabled:g,readOnly:f,size:m="md",name:b,id:C,className:v,style:w,...y},S)=>{const k=Ae(C),[M,_]=s.useState(!1),[j,z]=s.useState(""),[P,I]=s.useState(0),[D,T]=s.useState({top:0,left:0}),N=s.useRef(null),H=s.useRef(-1),E=r.map(O=>typeof O=="string"?{key:O,label:O}:O).filter(O=>O.label.toLowerCase().includes(j.toLowerCase())),R=s.useCallback(()=>{_(!1),z(""),I(0),H.current=-1},[]),x=s.useCallback(O=>{const F=N.current;if(!F||H.current<0)return;const L=t.slice(0,H.current),G=t.slice(F.selectionStart),V=`${i}${O.label} `,B=L+V+G;a==null||a(B),R(),requestAnimationFrame(()=>{const Y=L.length+V.length;F.setSelectionRange(Y,Y),F.focus()})},[t,a,i,R]),$=s.useCallback(O=>{const F=O.target.value;a==null||a(F);const L=O.target.selectionStart,G=F.slice(0,L),V=G.lastIndexOf(i);if(V>=0){const B=V>0?G[V-1]:" ",Y=G.slice(V+i.length);if(/\s/.test(B)&&!/\s/.test(Y)){H.current=V;const J=Y;z(J),_(!0),I(0),n==null||n(J);const me=O.target,de=me.getBoundingClientRect(),oe=parseInt(getComputedStyle(me).lineHeight)||20,ae=G.split(`
|
|
614
|
+
`);T({top:de.top+ae.length*oe+4-me.scrollTop,left:de.left+8});return}}R()},[a,i,n,R]),A=s.useCallback(O=>{!M||E.length===0||(O.key==="ArrowDown"?(O.preventDefault(),I(F=>(F+1)%E.length)):O.key==="ArrowUp"?(O.preventDefault(),I(F=>(F-1+E.length)%E.length)):O.key==="Enter"?(O.preventDefault(),E[P]&&x(E[P])):O.key==="Escape"&&R())},[M,E,P,x,R]);return s.useEffect(()=>{if(!M)return;const O=F=>{const L=N.current;L&&!L.contains(F.target)&&R()};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[M,R]),e.jsxs("div",{className:`nice-field ${v||""}`,style:w,...y,children:[d&&e.jsx("label",{htmlFor:k,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:d}),e.jsxs("div",{className:`nice-mention nice-mention--${m} ${h?"nice-mention--error":""} ${g?"nice-mention--disabled":""}`,children:[e.jsx("textarea",{ref:O=>{N.current=O,typeof S=="function"?S(O):S&&(S.current=O)},id:k,name:b,className:"nice-mention__input",value:t,onChange:$,onKeyDown:A,placeholder:c,rows:l,disabled:g,readOnly:f,"aria-invalid":!!h,"aria-describedby":h?`${k}-error`:p?`${k}-helper`:void 0,"aria-autocomplete":"list","aria-expanded":M}),M&&E.length>0&&e.jsx("ul",{className:"nice-mention__suggestions",role:"listbox",style:{position:"fixed",top:D.top,left:D.left},children:E.map((O,F)=>e.jsx("li",{role:"option","aria-selected":F===P,className:`nice-mention__suggestion ${F===P?"nice-mention__suggestion--active":""}`,onMouseDown:L=>{L.preventDefault(),x(O)},onMouseEnter:()=>I(F),children:o?o(O):e.jsxs(e.Fragment,{children:[O.icon&&e.jsx("span",{className:"nice-mention__suggestion-icon",children:O.icon}),e.jsx("span",{children:O.label})]})},O.key))})]}),h&&e.jsx("div",{id:`${k}-error`,className:"nice-field__error",role:"alert",children:h}),!h&&p&&e.jsx("div",{id:`${k}-helper`,className:"nice-field__helper",children:p})]})});or.displayName="NiceMention";function Lu(t){const a=[],r=n=>{for(const i of n)a.push(i),i.children&&r(i.children)};return r(t),a}function ti(t,a){const r=a.toLowerCase();return t.reduce((n,i)=>{const o=i.children?ti(i.children,a):[];return(i.label.toLowerCase().includes(r)||o.length>0)&&n.push({...i,children:o.length>0?o:i.children}),n},[])}const ai=({node:t,level:a,selectedKeys:r,expandedKeys:n,onToggleExpand:i,onSelect:o,selectableLeafsOnly:c})=>{const l=t.children&&t.children.length>0,d=n.has(t.key),p=r.has(t.key),h=!l,u=!t.disabled&&(!c||h);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`nice-tree-select__node ${p?"nice-tree-select__node--selected":""} ${t.disabled?"nice-tree-select__node--disabled":""}`,style:{paddingLeft:a*16+8},onClick:()=>u&&o(t.key),role:"treeitem","aria-selected":p,"aria-expanded":l?d:void 0,"aria-disabled":t.disabled,children:[l?e.jsx("button",{type:"button",className:"nice-tree-select__toggle",onClick:g=>{g.stopPropagation(),i(t.key)},"aria-label":"Toggle",children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",style:{transform:d?"rotate(90deg)":"none",transition:"transform 0.15s"},children:e.jsx("path",{d:"M4.5 2l4 4-4 4"})})}):e.jsx("span",{style:{width:12,display:"inline-block"}}),t.icon&&e.jsx("span",{className:"nice-tree-select__node-icon",children:t.icon}),e.jsx("span",{className:"nice-tree-select__node-label",children:t.label})]}),l&&d&&t.children.map(g=>e.jsx(ai,{node:g,level:a+1,selectedKeys:r,expandedKeys:n,onToggleExpand:i,onSelect:o,selectableLeafsOnly:c},g.key))]})},lr=s.forwardRef(({nodes:t,value:a,onChange:r,multiple:n=!1,searchable:i=!1,placeholder:o,selectableLeafsOnly:c=!1,clearable:l=!1,label:d,helperText:p,error:h,required:u,disabled:g,readOnly:f,size:m="md",name:b,id:C,className:v,style:w,...y},S)=>{const{t:k}=Re(),M=Ae(C),[_,j]=s.useState(!1),[z,P]=s.useState(""),[I,D]=s.useState(new Set),T=s.useRef(null);_t(T,()=>j(!1));const N=s.useMemo(()=>a==null?new Set:new Set(Array.isArray(a)?a:[a]),[a]),H=s.useMemo(()=>z?ti(t,z):t,[t,z]),E=s.useMemo(()=>{const A=Lu(t);return Array.from(N).map(O=>{var F;return(F=A.find(L=>L.key===O))==null?void 0:F.label}).filter(Boolean)},[N,t]),R=s.useCallback(A=>{D(O=>{const F=new Set(O);return F.has(A)?F.delete(A):F.add(A),F})},[]),x=s.useCallback(A=>{if(n){const O=new Set(N);O.has(A)?O.delete(A):O.add(A),r==null||r(Array.from(O))}else r==null||r(A),j(!1)},[n,N,r]),$=s.useCallback(A=>{A.stopPropagation(),r==null||r(n?[]:"")},[r,n]);return e.jsxs("div",{className:`nice-field ${v||""}`,style:w,...y,children:[d&&e.jsx("label",{htmlFor:M,className:`nice-field__label ${u?"nice-field__label--required":""}`,children:d}),e.jsxs("div",{ref:T,className:"nice-tree-select",style:{position:"relative"},children:[e.jsxs("div",{ref:S,id:M,className:`nice-input nice-input--${m} ${h?"nice-input--error":""} ${g?"nice-input--disabled":""} ${f?"nice-input--readonly":""}`,role:"combobox","aria-expanded":_,"aria-haspopup":"tree","aria-invalid":!!h,tabIndex:g?-1:0,onClick:()=>!g&&!f&&j(!_),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),!g&&!f&&j(!_))},children:[e.jsx("span",{className:"nice-tree-select__display",children:E.length>0?E.join(", "):e.jsx("span",{className:"nice-tree-select__placeholder",children:o??k("controls.select","Select...")})}),l&&N.size>0&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:$,"aria-label":k("controls.clear","Clear"),children:"✕"}),e.jsx("svg",{className:"nice-tree-select__arrow",width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",style:{transform:_?"rotate(180deg)":"none",transition:"transform 0.15s"},children:e.jsx("path",{d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"})})]}),_&&e.jsxs("div",{className:"nice-tree-select__dropdown",role:"tree",children:[i&&e.jsx("div",{className:"nice-tree-select__search",children:e.jsx("input",{className:"nice-input__native",type:"text",placeholder:k("controls.search","Search..."),value:z,onChange:A=>P(A.target.value),autoFocus:!0,onClick:A=>A.stopPropagation()})}),e.jsx("div",{className:"nice-tree-select__list",children:H.length===0?e.jsx("div",{className:"nice-tree-select__empty",children:k("controls.noResults","No results")}):H.map(A=>e.jsx(ai,{node:A,level:0,selectedKeys:N,expandedKeys:I,onToggleExpand:R,onSelect:x,selectableLeafsOnly:c},A.key))})]})]}),b&&e.jsx("input",{type:"hidden",name:b,value:Array.isArray(a)?a.join(","):a??""}),h&&e.jsx("div",{id:`${M}-error`,className:"nice-field__error",role:"alert",children:h}),!h&&p&&e.jsx("div",{id:`${M}-helper`,className:"nice-field__helper",children:p})]})});lr.displayName="NiceTreeSelect";function It(t,a){return String(t[a])}const cr=s.forwardRef(({source:t,target:a,onChange:r,keyField:n="id",labelField:i="label",renderItem:o,filterable:c=!1,sourceHeader:l,targetHeader:d,disabled:p=!1,size:h="md",className:u,style:g,id:f,...m},b)=>{const{t:C}=Re(),[v,w]=s.useState(new Set),[y,S]=s.useState(new Set),[k,M]=s.useState(""),[_,j]=s.useState(""),z=s.useCallback((E,R,x)=>{R($=>{const A=new Set($);return A.has(x)?A.delete(x):A.add(x),A})},[]),P=s.useCallback(()=>{const E=t.filter(x=>v.has(It(x,n))),R=t.filter(x=>!v.has(It(x,n)));r(R,[...a,...E]),w(new Set)},[t,a,v,n,r]),I=s.useCallback(()=>{const E=a.filter(x=>y.has(It(x,n))),R=a.filter(x=>!y.has(It(x,n)));r([...t,...E],R),S(new Set)},[t,a,y,n,r]),D=s.useCallback(()=>{r([],[...a,...t]),w(new Set)},[t,a,r]),T=s.useCallback(()=>{r([...t,...a],[]),S(new Set)},[t,a,r]),N=(E,R)=>{if(!R)return E;const x=R.toLowerCase();return E.filter($=>String($[i]).toLowerCase().includes(x))},H=(E,R,x,$,A,O)=>{const F=N(E,$);return e.jsxs("div",{className:"nice-picklist__panel",children:[O&&e.jsx("div",{className:"nice-picklist__header",children:O}),c&&e.jsx("div",{className:"nice-picklist__filter",children:e.jsx("input",{className:"nice-input__native",type:"text",placeholder:C("controls.search","Search..."),value:$,onChange:L=>A(L.target.value)})}),e.jsxs("div",{className:"nice-picklist__list",role:"listbox","aria-multiselectable":"true",children:[F.map(L=>{const G=It(L,n),V=R.has(G);return e.jsx("div",{className:`nice-picklist__item ${V?"nice-picklist__item--selected":""}`,role:"option","aria-selected":V,onClick:()=>!p&&z(R,x,G),children:o?o(L):String(L[i])},G)}),F.length===0&&e.jsx("div",{className:"nice-picklist__empty",children:C("controls.noItems","No items")})]})]})};return e.jsxs("div",{ref:b,id:f,className:`nice-picklist nice-picklist--${h} ${p?"nice-picklist--disabled":""} ${u||""}`,style:g,...m,children:[H(t,v,w,k,M,l??C("picklist.source","Available")),e.jsxs("div",{className:"nice-picklist__controls",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:p||v.size===0,onClick:P,"aria-label":C("picklist.moveRight","Move right"),children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"})})}),e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:p||t.length===0,onClick:D,"aria-label":C("picklist.moveAllRight","Move all right"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:[e.jsx("path",{d:"M4.293 14.707a1 1 0 010-1.414L7.586 10 4.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"}),e.jsx("path",{d:"M10.293 14.707a1 1 0 010-1.414L13.586 10 10.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"})]})}),e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:p||y.size===0,onClick:I,"aria-label":C("picklist.moveLeft","Move left"),children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"})})}),e.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:p||a.length===0,onClick:T,"aria-label":C("picklist.moveAllLeft","Move all left"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:[e.jsx("path",{d:"M15.707 5.293a1 1 0 010 1.414L12.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"}),e.jsx("path",{d:"M9.707 5.293a1 1 0 010 1.414L6.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"})]})})]}),H(a,y,S,_,j,d??C("picklist.target","Selected"))]})});cr.displayName="NicePickList";let _a=null,Pt=null;const Wr="https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min/vs";function ri(){return Pt?Promise.resolve(Pt):_a||(_a=new Promise((t,a)=>{if(window.monaco){Pt=window.monaco,t(Pt);return}const r=document.createElement("script");r.src=`${Wr}/loader.min.js`,r.async=!0,r.onload=()=>{const n=window.require;n.config({paths:{vs:Wr}}),n(["vs/editor/editor.main"],i=>{Pt=i,t(i)})},r.onerror=()=>{a(new Error("Failed to load Monaco Editor"))},document.head.appendChild(r)}),_a)}const dr=s.forwardRef(function(t,a){const{value:r,onChange:n,language:i="plaintext",theme:o="vs",options:c={},height:l=400,width:d="100%",markers:p=[],decorations:h=[],completionProvider:u,onMount:g,onCursorPositionChange:f,onSelectionChange:m,onSave:b,loading:C,disabled:v=!1,showToolbar:w=!1,showStatusBar:y=!1,editorSize:S="standard",className:k,"data-testid":M}=t,_=s.useRef(null),j=s.useRef(null),z=s.useRef(null),P=s.useRef([]),I=s.useRef(null),[D,T]=s.useState(!0),[N,H]=s.useState(null),[E,R]=s.useState({lineNumber:1,column:1}),[x,$]=s.useState(""),[A,O]=s.useState(c.wordWrap==="on"),F=s.useMemo(()=>({automaticLayout:!0,readOnly:v||c.readOnly,minimap:{enabled:c.minimap??!0},lineNumbers:c.lineNumbers??"on",wordWrap:c.wordWrap??"off",tabSize:c.tabSize??2,insertSpaces:c.insertSpaces??!0,fontSize:c.fontSize??14,fontFamily:c.fontFamily??"'Fira Code', 'Consolas', 'Monaco', monospace",fontLigatures:c.fontLigatures??!0,cursorStyle:c.cursorStyle??"line",cursorBlinking:c.cursorBlinking??"blink",autoClosingBrackets:c.autoClosingBrackets??"languageDefined",autoClosingQuotes:c.autoClosingQuotes??"languageDefined",formatOnPaste:c.formatOnPaste??!1,formatOnType:c.formatOnType??!1,renderWhitespace:c.renderWhitespace??"selection",renderControlCharacters:c.renderControlCharacters??!1,scrollBeyondLastLine:c.scrollBeyondLastLine??!0,smoothScrolling:c.smoothScrolling??!0,folding:c.folding??!0,showFoldingControls:c.showFoldingControls??"mouseover","bracketPairColorization.enabled":c.bracketPairColorization??!0,guides:c.guides??{bracketPairs:!0,indentation:!0,highlightActiveIndentation:!0},stickyScroll:{enabled:c.stickyScroll??!1},quickSuggestions:c.quickSuggestions??!0,suggestOnTriggerCharacters:c.suggestOnTriggerCharacters??!0,acceptSuggestionOnEnter:c.acceptSuggestionOnEnter??"on",inlayHints:{enabled:c.inlayHints?"on":"off"}}),[c,v]);s.useEffect(()=>{if(!_.current)return;let B=!0;return ri().then(Y=>{if(!B||!_.current)return;z.current=Y;const J=Y.editor.create(_.current,{value:r,language:i,theme:o,...F});j.current=J,T(!1),J.onDidChangeModelContent(()=>{const me=J.getValue();n==null||n(me)}),J.onDidChangeCursorPosition(me=>{R({lineNumber:me.position.lineNumber,column:me.position.column}),f==null||f({lineNumber:me.position.lineNumber,column:me.position.column})}),J.onDidChangeCursorSelection(me=>{var ae;const de=me.selection,oe=((ae=J.getModel())==null?void 0:ae.getValueInRange(de))??"";$(oe),m==null||m({startLineNumber:de.startLineNumber,startColumn:de.startColumn,endLineNumber:de.endLineNumber,endColumn:de.endColumn})}),J.addCommand(Y.KeyMod.CtrlCmd|Y.KeyCode.KeyS,()=>{b==null||b(J.getValue())}),g==null||g(J,Y)}).catch(Y=>{B&&(H(Y.message??"Failed to load editor"),T(!1))}),()=>{var Y,J;B=!1,(Y=j.current)==null||Y.dispose(),(J=I.current)==null||J.dispose()}},[]),s.useEffect(()=>{const B=j.current;if(B&&r!==B.getValue()){const Y=B.getPosition();B.setValue(r),Y&&B.setPosition(Y)}},[r]),s.useEffect(()=>{const B=j.current,Y=z.current;if(B&&Y){const J=B.getModel();J&&Y.editor.setModelLanguage(J,i)}},[i]),s.useEffect(()=>{const B=z.current;B&&B.editor.setTheme(o)},[o]),s.useEffect(()=>{const B=j.current;B&&B.updateOptions(F)},[F]),s.useEffect(()=>{const B=j.current,Y=z.current;if(B&&Y){const J=B.getModel();if(J){const me=p.map(de=>({startLineNumber:de.startLineNumber,startColumn:de.startColumn,endLineNumber:de.endLineNumber,endColumn:de.endColumn,message:de.message,severity:de.severity}));Y.editor.setModelMarkers(J,"owner",me)}}},[p]),s.useEffect(()=>{const B=j.current;if(B&&h.length>0){const Y=h.map(J=>({range:{startLineNumber:J.range.startLineNumber,startColumn:J.range.startColumn,endLineNumber:J.range.endLineNumber,endColumn:J.range.endColumn},options:{className:J.className,glyphMarginClassName:J.glyphMarginClassName,hoverMessage:J.hoverMessage?{value:J.hoverMessage}:void 0,isWholeLine:J.isWholeLine}}));P.current=B.deltaDecorations(P.current,Y)}},[h]),s.useEffect(()=>{var J;const B=z.current;if(!B||!u)return;(J=I.current)==null||J.dispose();const Y={text:0,method:1,function:2,constructor:3,field:4,variable:5,class:6,interface:7,module:8,property:9,keyword:13,snippet:14,color:15,file:16,reference:17,folder:18};return I.current=B.languages.registerCompletionItemProvider(i,{provideCompletionItems:async(me,de)=>({suggestions:(await u(me,de)).map(oe=>({label:oe.label,kind:Y[oe.kind]??0,insertText:oe.insertText,insertTextRules:oe.insertTextRules==="insertAsSnippet"?4:void 0,documentation:oe.documentation,detail:oe.detail,range:{startLineNumber:de.lineNumber,startColumn:de.column,endLineNumber:de.lineNumber,endColumn:de.column}}))})}),()=>{var me;(me=I.current)==null||me.dispose()}},[i,u]),s.useImperativeHandle(a,()=>({getEditor:()=>j.current,getMonaco:()=>z.current,focus:()=>{var B;return(B=j.current)==null?void 0:B.focus()},getValue:()=>{var B;return((B=j.current)==null?void 0:B.getValue())??""},setValue:B=>{var Y;return(Y=j.current)==null?void 0:Y.setValue(B)},getSelection:()=>{var J;const B=j.current;if(!B)return"";const Y=B.getSelection();return Y?((J=B.getModel())==null?void 0:J.getValueInRange(Y))??"":""},insertText:B=>{const Y=j.current;if(!Y)return;const J=Y.getSelection();J&&Y.executeEdits("",[{range:J,text:B}])},formatDocument:()=>{var B,Y;(Y=(B=j.current)==null?void 0:B.getAction("editor.action.formatDocument"))==null||Y.run()},goToLine:(B,Y=1)=>{const J=j.current;J&&(J.setPosition({lineNumber:B,column:Y}),J.revealLineInCenter(B),J.focus())},findReplace:()=>{var B,Y;(Y=(B=j.current)==null?void 0:B.getAction("editor.action.startFindReplaceAction"))==null||Y.run()},undo:()=>{var B;(B=j.current)==null||B.trigger("keyboard","undo",null)},redo:()=>{var B;(B=j.current)==null||B.trigger("keyboard","redo",null)},getCursorPosition:()=>{var Y;const B=(Y=j.current)==null?void 0:Y.getPosition();return{lineNumber:(B==null?void 0:B.lineNumber)??1,column:(B==null?void 0:B.column)??1}},setMarkers:B=>{const Y=j.current,J=z.current;if(Y&&J){const me=Y.getModel();if(me){const de=B.map(oe=>({startLineNumber:oe.startLineNumber,startColumn:oe.startColumn,endLineNumber:oe.endLineNumber,endColumn:oe.endColumn,message:oe.message,severity:oe.severity}));J.editor.setModelMarkers(me,"owner",de)}}}}),[]);const L=s.useMemo(()=>({format:()=>{var B,Y;return(Y=(B=j.current)==null?void 0:B.getAction("editor.action.formatDocument"))==null?void 0:Y.run()},undo:()=>{var B;return(B=j.current)==null?void 0:B.trigger("keyboard","undo",null)},redo:()=>{var B;return(B=j.current)==null?void 0:B.trigger("keyboard","redo",null)},find:()=>{var B,Y;return(Y=(B=j.current)==null?void 0:B.getAction("editor.action.startFindReplaceAction"))==null?void 0:Y.run()},toggleWordWrap:()=>{var Y;const B=!A;O(B),(Y=j.current)==null||Y.updateOptions({wordWrap:B?"on":"off"})},toggleMinimap:()=>{var Y,J,me,de,oe,ae;const B=(oe=(Y=j.current)==null?void 0:Y.getOption)==null?void 0:oe.call(Y,(de=(me=(J=z.current)==null?void 0:J.editor)==null?void 0:me.EditorOption)==null?void 0:de.minimap);(ae=j.current)==null||ae.updateOptions({minimap:{enabled:!(B!=null&&B.enabled)}})},foldAll:()=>{var B,Y;return(Y=(B=j.current)==null?void 0:B.getAction("editor.foldAll"))==null?void 0:Y.run()},unfoldAll:()=>{var B,Y;return(Y=(B=j.current)==null?void 0:B.getAction("editor.unfoldAll"))==null?void 0:Y.run()}}),[A]),G=r.split(`
|
|
615
|
+
`).length,V=r.length;return D?e.jsx("div",{className:`nice-code-editor nice-code-editor--loading ${k??""}`,style:{height:l,width:d},"data-testid":M,children:C??e.jsx("div",{className:"nice-code-editor__loader",children:"Loading editor..."})}):N?e.jsx("div",{className:`nice-code-editor nice-code-editor--error ${k??""}`,style:{height:l,width:d},"data-testid":M,children:e.jsxs("div",{className:"nice-code-editor__error",children:[e.jsxs("span",{children:["⚠️ ",N]}),e.jsx("textarea",{value:r,onChange:B=>n==null?void 0:n(B.target.value),readOnly:v||c.readOnly,style:{width:"100%",height:"100%",fontFamily:"monospace"}})]})}):e.jsxs("div",{className:`nice-code-editor-wrap nice-editor--${S} ${k??""}`,style:{height:l,width:d,display:"flex",flexDirection:"column"},"data-testid":M,children:[w&&e.jsxs("div",{className:"nice-code-editor__toolbar",children:[e.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:L.undo,title:"Undo (Ctrl+Z)",children:"↶"}),e.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:L.redo,title:"Redo (Ctrl+Y)",children:"↷"}),e.jsx("span",{className:"nice-code-editor__toolbar-sep"}),e.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:L.format,title:"Format (Shift+Alt+F)",children:"⎘"}),e.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:L.find,title:"Find & Replace (Ctrl+H)",children:"🔍"}),e.jsx("span",{className:"nice-code-editor__toolbar-sep"}),e.jsx("button",{className:`nice-code-editor__toolbar-btn${A?" nice-code-editor__toolbar-btn--active":""}`,onClick:L.toggleWordWrap,title:"Toggle Word Wrap",children:"↩"}),e.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:L.toggleMinimap,title:"Toggle Minimap",children:"▥"}),e.jsx("span",{className:"nice-code-editor__toolbar-sep"}),e.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:L.foldAll,title:"Fold All",children:"⊟"}),e.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:L.unfoldAll,title:"Unfold All",children:"⊞"})]}),e.jsx("div",{ref:_,className:"nice-code-editor",style:{flex:1,minHeight:0}}),y&&e.jsxs("div",{className:"nice-code-editor__statusbar",children:[e.jsxs("span",{children:["Ln ",E.lineNumber,", Col ",E.column]}),x.length>0&&e.jsxs("span",{children:["(",x.length," selected)"]}),e.jsx("span",{className:"nice-code-editor__statusbar-spacer"}),e.jsxs("span",{children:[G," lines · ",V," chars"]}),e.jsx("span",{className:"nice-code-editor__statusbar-lang",children:i}),p.length>0&&e.jsxs("span",{className:"nice-code-editor__statusbar-markers",children:["⚠ ",p.length]})]})]})});function ni(t){const{original:a,modified:r,language:n="plaintext",theme:i="vs",height:o=400,width:c="100%",inline:l=!1,renderSideBySide:d=!0,originalEditable:p=!1,modifiedEditable:h=!1,onOriginalChange:u,onModifiedChange:g,loading:f,className:m,"data-testid":b}=t,C=s.useRef(null),v=s.useRef(null),[w,y]=s.useState(!0);return s.useEffect(()=>{if(!C.current)return;let S=!0;return ri().then(k=>{if(!S||!C.current)return;const M=k.editor.createModel(a,n),_=k.editor.createModel(r,n),j=k.editor.createDiffEditor(C.current,{automaticLayout:!0,theme:i,renderSideBySide:!l&&d,originalEditable:p,readOnly:!h});j.setModel({original:M,modified:_}),v.current=j,y(!1),p&&M.onDidChangeContent(()=>{u==null||u(M.getValue())}),h&&_.onDidChangeContent(()=>{g==null||g(_.getValue())})}),()=>{var k;S=!1,(k=v.current)==null||k.dispose()}},[]),s.useEffect(()=>{const S=v.current;if(!S)return;const k=S.getModel();k&&(k.original.getValue()!==a&&k.original.setValue(a),k.modified.getValue()!==r&&k.modified.setValue(r))},[a,r]),w?e.jsx("div",{className:`nice-code-diff-editor nice-code-diff-editor--loading ${m??""}`,style:{height:o,width:c},"data-testid":b,children:f??e.jsx("div",{className:"nice-code-editor__loader",children:"Loading diff editor..."})}):e.jsx("div",{ref:C,className:`nice-code-diff-editor ${m??""}`,style:{height:o,width:c},"data-testid":b})}function ii(t){const{value:a,onChange:r,language:n="plaintext",height:i=300,width:o="100%",readOnly:c=!1,tabSize:l=2,lineNumbers:d=!0,placeholder:p,className:h,"data-testid":u}=t,g=s.useRef(null),f=s.useCallback(b=>{var C;if(b.key==="Tab"){b.preventDefault();const v=b.currentTarget,w=v.selectionStart,y=v.selectionEnd,S=" ".repeat(l);if(b.shiftKey){const k=a.substring(0,w).lastIndexOf(`
|
|
616
|
+
`)+1;if((((C=a.substring(k,w).match(/^(\s*)/))==null?void 0:C[1])??"").length>=l){const M=a.substring(0,k)+a.substring(k+l);r==null||r(M),setTimeout(()=>{v.selectionStart=v.selectionEnd=w-l},0)}}else{const k=a.substring(0,w)+S+a.substring(y);r==null||r(k),setTimeout(()=>{v.selectionStart=v.selectionEnd=w+l},0)}}},[a,r,l]),m=a.split(`
|
|
617
|
+
`).length;return e.jsxs("div",{className:`nice-simple-code-editor ${h??""}`,style:{height:i,width:o},"data-testid":u,"data-language":n,children:[d&&e.jsx("div",{className:"nice-simple-code-editor__line-numbers",children:Array.from({length:m},(b,C)=>e.jsx("div",{className:"nice-simple-code-editor__line-number",children:C+1},C))}),e.jsx("textarea",{ref:g,className:"nice-simple-code-editor__textarea",value:a,onChange:b=>r==null?void 0:r(b.target.value),onKeyDown:f,readOnly:c,placeholder:p,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off"})]})}const Hr="nice-code-editor-styles";if(typeof document<"u"&&!document.getElementById(Hr)){const t=document.createElement("style");t.id=Hr,t.textContent=`
|
|
618
|
+
.nice-code-editor,
|
|
619
|
+
.nice-code-diff-editor {
|
|
620
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
621
|
+
border-radius: 4px;
|
|
622
|
+
overflow: hidden;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.nice-code-editor--loading,
|
|
626
|
+
.nice-code-editor--error,
|
|
627
|
+
.nice-code-diff-editor--loading {
|
|
628
|
+
display: flex;
|
|
629
|
+
align-items: center;
|
|
630
|
+
justify-content: center;
|
|
631
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.nice-code-editor__loader {
|
|
635
|
+
color: var(--nice-text-secondary, #666);
|
|
636
|
+
font-size: 14px;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.nice-code-editor__error {
|
|
640
|
+
display: flex;
|
|
641
|
+
flex-direction: column;
|
|
642
|
+
width: 100%;
|
|
643
|
+
height: 100%;
|
|
644
|
+
padding: 8px;
|
|
645
|
+
gap: 8px;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
.nice-code-editor__error span {
|
|
649
|
+
color: var(--nice-error, #d32f2f);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/* Simple code editor */
|
|
653
|
+
.nice-simple-code-editor {
|
|
654
|
+
display: flex;
|
|
655
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
656
|
+
border-radius: 4px;
|
|
657
|
+
overflow: hidden;
|
|
658
|
+
font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
|
|
659
|
+
font-size: 14px;
|
|
660
|
+
line-height: 1.5;
|
|
661
|
+
background: var(--nice-bg-surface, #fff);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.nice-simple-code-editor__line-numbers {
|
|
665
|
+
padding: 8px 0;
|
|
666
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
667
|
+
border-right: 1px solid var(--nice-border, #e0e0e0);
|
|
668
|
+
user-select: none;
|
|
669
|
+
text-align: right;
|
|
670
|
+
color: var(--nice-text-secondary, #999);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.nice-simple-code-editor__line-number {
|
|
674
|
+
padding: 0 12px;
|
|
675
|
+
min-width: 40px;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.nice-simple-code-editor__textarea {
|
|
679
|
+
flex: 1;
|
|
680
|
+
padding: 8px 12px;
|
|
681
|
+
border: none;
|
|
682
|
+
outline: none;
|
|
683
|
+
resize: none;
|
|
684
|
+
font: inherit;
|
|
685
|
+
background: transparent;
|
|
686
|
+
color: var(--nice-text-primary, #333);
|
|
687
|
+
white-space: pre;
|
|
688
|
+
overflow-wrap: normal;
|
|
689
|
+
overflow-x: auto;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.nice-simple-code-editor__textarea::placeholder {
|
|
693
|
+
color: var(--nice-text-secondary, #999);
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
/* Toolbar */
|
|
697
|
+
.nice-code-editor-wrap {
|
|
698
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
699
|
+
border-radius: 4px;
|
|
700
|
+
overflow: hidden;
|
|
701
|
+
}
|
|
702
|
+
.nice-code-editor-wrap .nice-code-editor {
|
|
703
|
+
border: none;
|
|
704
|
+
border-radius: 0;
|
|
705
|
+
}
|
|
706
|
+
.nice-code-editor__toolbar {
|
|
707
|
+
display: flex;
|
|
708
|
+
align-items: center;
|
|
709
|
+
gap: 2px;
|
|
710
|
+
padding: 3px 6px;
|
|
711
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
712
|
+
border-bottom: 1px solid var(--nice-border, #e0e0e0);
|
|
713
|
+
}
|
|
714
|
+
.nice-code-editor__toolbar-btn {
|
|
715
|
+
display: inline-flex;
|
|
716
|
+
align-items: center;
|
|
717
|
+
justify-content: center;
|
|
718
|
+
width: 26px;
|
|
719
|
+
height: 26px;
|
|
720
|
+
border: none;
|
|
721
|
+
border-radius: 3px;
|
|
722
|
+
background: transparent;
|
|
723
|
+
color: var(--nice-text-secondary, #666);
|
|
724
|
+
cursor: pointer;
|
|
725
|
+
font-size: 14px;
|
|
726
|
+
transition: background 0.15s, color 0.15s;
|
|
727
|
+
}
|
|
728
|
+
.nice-code-editor__toolbar-btn:hover {
|
|
729
|
+
background: var(--nice-hover, #e0e0e0);
|
|
730
|
+
color: var(--nice-text-primary, #333);
|
|
731
|
+
}
|
|
732
|
+
.nice-code-editor__toolbar-btn--active {
|
|
733
|
+
background: var(--nice-accent, #1976d2);
|
|
734
|
+
color: #fff;
|
|
735
|
+
}
|
|
736
|
+
.nice-code-editor__toolbar-sep {
|
|
737
|
+
width: 1px;
|
|
738
|
+
height: 18px;
|
|
739
|
+
background: var(--nice-border, #e0e0e0);
|
|
740
|
+
margin: 0 4px;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/* Status bar */
|
|
744
|
+
.nice-code-editor__statusbar {
|
|
745
|
+
display: flex;
|
|
746
|
+
align-items: center;
|
|
747
|
+
gap: 12px;
|
|
748
|
+
padding: 2px 10px;
|
|
749
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
750
|
+
border-top: 1px solid var(--nice-border, #e0e0e0);
|
|
751
|
+
font-size: 12px;
|
|
752
|
+
color: var(--nice-text-secondary, #666);
|
|
753
|
+
user-select: none;
|
|
754
|
+
}
|
|
755
|
+
.nice-code-editor__statusbar-spacer { flex: 1; }
|
|
756
|
+
.nice-code-editor__statusbar-lang {
|
|
757
|
+
text-transform: uppercase;
|
|
758
|
+
font-weight: 600;
|
|
759
|
+
font-size: 11px;
|
|
760
|
+
}
|
|
761
|
+
.nice-code-editor__statusbar-markers {
|
|
762
|
+
color: var(--nice-warning, #f39c12);
|
|
763
|
+
font-weight: 600;
|
|
764
|
+
}
|
|
765
|
+
`,document.head.appendChild(t)}const Ou=Object.freeze(Object.defineProperty({__proto__:null,NiceCodeDiffEditor:ni,NiceCodeEditor:dr,NiceSimpleCodeEditor:ii},Symbol.toStringTag,{value:"Module"}));s.forwardRef(function(t,a){const{enableAI:r=!0,aiModel:n,enableInlineCompletion:i=!0,completionDelay:o=500,enableExplain:c=!0,enableRefactor:l=!0,enableGenerate:d=!0,systemPrompt:p,onExplain:h,onRefactor:u,showAIToolbar:g=!0,aiShortcutKey:f="Ctrl",language:m="plaintext",value:b,onChange:C,...v}=t,w=s.useRef(null),[y,S]=s.useState(null),[k,M]=s.useState(!1),[_,j]=s.useState(""),[z,P]=s.useState(!1),[I,D]=s.useState(""),[T,N]=s.useState(""),[H,E]=s.useState(""),R=s.useRef(),{t:x}=Zt(),$=vt(),{complete:A,explain:O,refactor:F,generateFromComment:L,isLoading:G}=Ko({language:m,model:n}),V=r&&$.isConfigured,B=s.useCallback(async()=>{if(!V||!i||!w.current||!w.current.getEditor())return;const re=w.current.getCursorPosition(),he=w.current.getValue().split(`
|
|
766
|
+
`),we=he.slice(0,re.lineNumber-1),le=he[re.lineNumber-1]||"",ke=[...we,le.slice(0,re.column-1)].join(`
|
|
767
|
+
`),U=[le.slice(re.column-1),...he.slice(re.lineNumber)].join(`
|
|
768
|
+
`);try{const Q=await A(ke,U);Q&&S({lineNumber:re.lineNumber,column:re.column,text:Q})}catch{}},[V,i,A]),Y=s.useCallback(async()=>{if(!V||!c||!w.current)return"";const re=w.current.getSelection();if(!re)return"";E(re),M(!0),j("");try{const he=await O(re);return j(he),h==null||h(re,he),he}catch{return j(x("codeEditorAI.explanationFailed","Failed to explain code")),""}},[V,c,O,h,x]),J=s.useCallback(async re=>{if(!V||!l||!w.current)return"";const he=w.current.getSelection();if(!he)return"";try{const we=await F(he,re);return N(we),u==null||u(he,we),we}catch{return""}},[V,l,F,u]),me=s.useCallback(async()=>{var le;if(!V||!d||!w.current)return;const re=w.current.getCursorPosition(),he=w.current.getValue().split(`
|
|
769
|
+
`);let we="";for(let ke=re.lineNumber-1;ke>=0&&ke>=re.lineNumber-3;ke--){const U=((le=he[ke])==null?void 0:le.trim())||"";if(U.startsWith("//")||U.startsWith("#")||U.startsWith("/*")||U.startsWith("*")){we=U.replace(/^\/\/\s*|^#\s*|^\/\*\s*|\*\/\s*$|^\*\s*/g,"").trim();break}}if(we)try{const ke=await L(we);ke&&w.current&&w.current.insertText(`
|
|
770
|
+
`+ke)}catch{}},[V,d,L]),de=s.useCallback(()=>{!y||!w.current||(w.current.insertText(y.text),S(null))},[y]),oe=s.useCallback(()=>{S(null)},[]),ae=s.useCallback(re=>{var he;(he=t.onCursorPositionChange)==null||he.call(t,re),!(!V||!i)&&(R.current&&clearTimeout(R.current),S(null),R.current=setTimeout(()=>{B()},o))},[t.onCursorPositionChange,V,i,o,B]);s.useEffect(()=>{var he;if(!((he=w.current)!=null&&he.getEditor())||!V)return;const re=we=>{var le;if(f==="Ctrl"&&we.ctrlKey||f==="Alt"&&we.altKey||f==="Meta"&&we.metaKey){if(we.key===" "&&i&&(we.preventDefault(),B()),we.key==="e"&&c&&(we.preventDefault(),Y()),we.key==="r"&&l){we.preventDefault();const ke=(le=w.current)==null?void 0:le.getSelection();ke&&(E(ke),P(!0))}we.key==="g"&&d&&(we.preventDefault(),me())}we.key==="Tab"&&y&&(we.preventDefault(),de()),we.key==="Escape"&&y&&oe()};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[V,f,i,c,l,d,B,Y,me,y,de,oe]),s.useEffect(()=>()=>{R.current&&clearTimeout(R.current)},[]);const ve=s.useCallback(()=>{if(!T||!w.current)return;const re=w.current.getEditor();if(re!=null&&re.executeEdits&&(re!=null&&re.getSelection)){const he=re.getSelection();re.executeEdits("ai-refactor",[{range:he,text:T}])}P(!1),N(""),D("")},[T]);return s.useImperativeHandle(a,()=>({...w.current,getEditor:()=>{var re;return(re=w.current)==null?void 0:re.getEditor()},getMonaco:()=>{var re;return(re=w.current)==null?void 0:re.getMonaco()},focus:()=>{var re;return(re=w.current)==null?void 0:re.focus()},getValue:()=>{var re;return((re=w.current)==null?void 0:re.getValue())||""},setValue:re=>{var he;return(he=w.current)==null?void 0:he.setValue(re)},getSelection:()=>{var re;return((re=w.current)==null?void 0:re.getSelection())||""},insertText:re=>{var he;return(he=w.current)==null?void 0:he.insertText(re)},formatDocument:()=>{var re;return(re=w.current)==null?void 0:re.formatDocument()},goToLine:(re,he)=>{var we;return(we=w.current)==null?void 0:we.goToLine(re,he)},findReplace:()=>{var re;return(re=w.current)==null?void 0:re.findReplace()},undo:()=>{var re;return(re=w.current)==null?void 0:re.undo()},redo:()=>{var re;return(re=w.current)==null?void 0:re.redo()},getCursorPosition:()=>{var re;return((re=w.current)==null?void 0:re.getCursorPosition())||{lineNumber:1,column:1}},setMarkers:re=>{var he;return(he=w.current)==null?void 0:he.setMarkers(re)},triggerCompletion:B,explainSelection:Y,refactorSelection:J,generateFromComment:me,acceptCompletion:de,dismissCompletion:oe})),e.jsxs("div",{className:"nice-code-editor-ai","data-testid":t["data-testid"],children:[g&&V&&e.jsxs("div",{className:"nice-code-editor-ai__toolbar",children:[e.jsxs("div",{className:"nice-code-editor-ai__toolbar-left",children:[e.jsx("span",{className:"nice-code-editor-ai__toolbar-badge",children:"AI"}),G&&e.jsx("span",{className:"nice-code-editor-ai__loading",children:x("codeEditorAI.loading","Thinking...")})]}),e.jsxs("div",{className:"nice-code-editor-ai__toolbar-right",children:[i&&e.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>B(),disabled:G,title:`${x("codeEditorAI.complete","Complete")} (${f}+Space)`,children:["💡 ",x("codeEditorAI.complete","Complete")]}),c&&e.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>Y(),disabled:G,title:`${x("codeEditorAI.explain","Explain")} (${f}+E)`,children:["📖 ",x("codeEditorAI.explain","Explain")]}),l&&e.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>{var he;const re=(he=w.current)==null?void 0:he.getSelection();re&&(E(re),P(!0))},disabled:G,title:`${x("codeEditorAI.refactor","Refactor")} (${f}+R)`,children:["🔧 ",x("codeEditorAI.refactor","Refactor")]}),d&&e.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>me(),disabled:G,title:`${x("codeEditorAI.generate","Generate")} (${f}+G)`,children:["⚡ ",x("codeEditorAI.generate","Generate")]})]})]}),e.jsxs("div",{className:"nice-code-editor-ai__editor-wrapper",children:[e.jsx(dr,{ref:w,value:b,onChange:C,language:m,onCursorPositionChange:ae,...v}),y&&e.jsxs("div",{className:"nice-code-editor-ai__ghost-text",style:{top:`calc(${(y.lineNumber-1)*19}px + 4px)`,left:`calc(${(y.column-1)*7.8}px + 60px)`},children:[e.jsx("span",{className:"nice-code-editor-ai__ghost-text-content",children:y.text}),e.jsxs("span",{className:"nice-code-editor-ai__ghost-text-hint",children:["Tab ",x("codeEditorAI.toAccept","to accept")]})]})]}),k&&e.jsxs("div",{className:"nice-code-editor-ai__panel nice-code-editor-ai__panel--explain",children:[e.jsxs("div",{className:"nice-code-editor-ai__panel-header",children:[e.jsxs("h4",{children:["📖 ",x("codeEditorAI.explanation","Explanation")]}),e.jsx("button",{type:"button",className:"nice-code-editor-ai__panel-close",onClick:()=>M(!1),children:"✕"})]}),e.jsx("div",{className:"nice-code-editor-ai__panel-body",children:G?e.jsx("div",{className:"nice-code-editor-ai__panel-loading",children:x("codeEditorAI.analyzing","Analyzing code...")}):e.jsxs("div",{className:"nice-code-editor-ai__explanation",children:[e.jsx("pre",{className:"nice-code-editor-ai__code-preview",children:H}),e.jsx("div",{className:"nice-code-editor-ai__explanation-text",children:_||x("codeEditorAI.noExplanation","Select code and click Explain")})]})})]}),z&&e.jsxs("div",{className:"nice-code-editor-ai__panel nice-code-editor-ai__panel--refactor",children:[e.jsxs("div",{className:"nice-code-editor-ai__panel-header",children:[e.jsxs("h4",{children:["🔧 ",x("codeEditorAI.refactorCode","Refactor Code")]}),e.jsx("button",{type:"button",className:"nice-code-editor-ai__panel-close",onClick:()=>{P(!1),N(""),D("")},children:"✕"})]}),e.jsxs("div",{className:"nice-code-editor-ai__panel-body",children:[e.jsx("pre",{className:"nice-code-editor-ai__code-preview",children:H}),e.jsxs("div",{className:"nice-code-editor-ai__refactor-input",children:[e.jsx("input",{type:"text",placeholder:x("codeEditorAI.refactorInstruction",'Describe how to refactor (e.g., "extract function", "add error handling")'),value:I,onChange:re=>D(re.target.value),onKeyDown:re=>{re.key==="Enter"&&I&&J(I)}}),e.jsx("button",{type:"button",className:"nice-code-editor-ai__refactor-btn",onClick:()=>J(I),disabled:G||!I,children:G?x("codeEditorAI.refactoring","Refactoring..."):x("codeEditorAI.refactor","Refactor")})]}),T&&e.jsxs("div",{className:"nice-code-editor-ai__refactor-result",children:[e.jsx("h5",{children:x("codeEditorAI.refactoredCode","Refactored Code")}),e.jsx("pre",{className:"nice-code-editor-ai__code-preview nice-code-editor-ai__code-preview--result",children:T}),e.jsxs("div",{className:"nice-code-editor-ai__refactor-actions",children:[e.jsxs("button",{type:"button",className:"nice-code-editor-ai__refactor-apply",onClick:ve,children:["✓ ",x("codeEditorAI.apply","Apply")]}),e.jsxs("button",{type:"button",className:"nice-code-editor-ai__refactor-discard",onClick:()=>{N(""),D("")},children:["✕ ",x("codeEditorAI.discard","Discard")]})]})]})]})]})]})});function qr(t,a){const r=a.getBoundingClientRect();let n,i,o;if("touches"in t){const d=t.touches[0];n=d.clientX-r.left,i=d.clientY-r.top,o=d.force}else"pressure"in t?(n=t.clientX-r.left,i=t.clientY-r.top,o=t.pressure):(n=t.clientX-r.left,i=t.clientY-r.top);const c=a.width/r.width,l=a.height/r.height;return{x:n*c,y:i*l,time:Date.now(),pressure:o!==void 0?o:.5}}function Vr(t,a,r,n,i){if(!a)return(r+n)/2;const o=Math.sqrt(Math.pow(t.x-a.x,2)+Math.pow(t.y-a.y,2))/Math.max(1,t.time-a.time),c=Math.min(o/5,1),l=n-c*(n-r),d=t.pressure??.5,p=r+d*(n-r);return l*.7+p*.3}function Kr(t,a,r,n){t.beginPath(),t.moveTo(a.x,a.y),t.lineTo(r.x,r.y),t.lineWidth=n,t.lineCap="round",t.lineJoin="round",t.stroke()}s.forwardRef(function(t,a){const{value:r,onChange:n,width:i="100%",height:o=200,penColor:c="#000000",penWidth:l=2,minWidth:d=.5,maxWidth:p=4,backgroundColor:h="#ffffff",placeholder:u="Sign here",showClearButton:g=!0,showUndoButton:f=!0,showColorPicker:m=!1,showSizeSlider:b=!1,velocityFilterWeight:C=.7,throttle:v=16,disabled:w=!1,readOnly:y=!1,onBegin:S,onEnd:k,className:M,"data-testid":_}=t,j=s.useRef(null),[z,P]=s.useState((r==null?void 0:r.strokes)??[]),[I,D]=s.useState([]),[T,N]=s.useState(!1),[H,E]=s.useState(c),[R,x]=s.useState(l),$=s.useRef(null),A=s.useRef(0),O=z.length===0&&I.length===0;s.useEffect(()=>{const ae=j.current;if(!ae)return;const ve=ae.getContext("2d");if(!ve)return;const re=ae.getBoundingClientRect(),he=window.devicePixelRatio||1;ae.width=re.width*he,ae.height=re.height*he,ve.scale(he,he),F()},[i,o]);const F=s.useCallback(()=>{const ae=j.current;if(!ae)return;const ve=ae.getContext("2d");if(!ve)return;const re=ae.getBoundingClientRect();ve.fillStyle=h,ve.fillRect(0,0,re.width,re.height),z.forEach(he=>{if(ve.strokeStyle=he.color,!(he.points.length<2))for(let we=1;we<he.points.length;we++){const le=he.points[we-1],ke=he.points[we],U=Vr(ke,le,d,p);Kr(ve,le,ke,U)}})},[z,h,d,p,C]);s.useEffect(()=>{F()},[F]),s.useEffect(()=>{r!=null&&r.strokes&&P(r.strokes)},[r]),s.useEffect(()=>{const ae=j.current;if(ae)if(z.length===0)n==null||n(null);else{const ve=ae.getBoundingClientRect();n==null||n({strokes:z,width:ve.width,height:ve.height,timestamp:Date.now()})}},[z,n]);const L=s.useCallback(ae=>{if(w||y)return;const ve=j.current;if(!ve)return;ve.setPointerCapture(ae.pointerId);const re=qr(ae.nativeEvent,ve);N(!0),D([re]),$.current=re,A.current=re.time,S==null||S()},[w,y,S]),G=s.useCallback(ae=>{if(!T||w||y)return;const ve=j.current;if(!ve)return;const re=ve.getContext("2d");if(!re)return;const he=Date.now();if(he-A.current<v)return;const we=qr(ae.nativeEvent,ve),le=$.current;if(le){re.strokeStyle=H;const ke=Vr(we,le,d,p);Kr(re,le,we,ke)}D(ke=>[...ke,we]),$.current=we,A.current=he},[T,w,y,H,d,p,C,v]),V=s.useCallback(ae=>{if(!T)return;const ve=j.current;if(ve&&ve.releasePointerCapture(ae.pointerId),I.length>0){const re={points:I,color:H,width:R};P(he=>[...he,re])}N(!1),D([]),$.current=null,k==null||k()},[T,I,H,R,k]),B=s.useCallback(()=>{P([]),D([]),F()},[F]),Y=s.useCallback(()=>{P(ae=>ae.slice(0,-1))},[]),J=s.useCallback((ae="png",ve=.92)=>{const re=j.current;if(!re)return"";const he=ae==="jpeg"?"image/jpeg":"image/png";return re.toDataURL(he,ve)},[]),me=s.useCallback(async(ae="png",ve=.92)=>{const re=j.current;return re?new Promise(he=>{const we=ae==="jpeg"?"image/jpeg":"image/png";re.toBlob(le=>he(le),we,ve)}):null},[]),de=s.useCallback(()=>{const ae=j.current;if(!ae)return"";const ve=ae.getBoundingClientRect(),re=z.map(he=>he.points.length<2?"":`<path d="${he.points.reduce((we,le,ke)=>ke===0?`M ${le.x} ${le.y}`:`${we} L ${le.x} ${le.y}`,"")}" stroke="${he.color}" stroke-width="${he.width}" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`).join(`
|
|
771
|
+
`);return`<svg xmlns="http://www.w3.org/2000/svg" width="${ve.width}" height="${ve.height}" viewBox="0 0 ${ae.width} ${ae.height}">
|
|
772
|
+
<rect width="100%" height="100%" fill="${h}"/>
|
|
773
|
+
${re}
|
|
774
|
+
</svg>`},[z,h]);s.useImperativeHandle(a,()=>({clear:B,undo:Y,isEmpty:()=>z.length===0,getData:()=>{const ae=j.current;if(!ae||z.length===0)return null;const ve=ae.getBoundingClientRect();return{strokes:z,width:ve.width,height:ve.height,timestamp:Date.now()}},setData:ae=>{P(ae.strokes)},toDataURL:J,toBlob:me,toSVG:de,getCanvas:()=>j.current}),[z,B,Y,J,me,de]),s.useEffect(()=>{const ae=j.current;if(!ae)return;const ve=re=>{T&&re.preventDefault()};return ae.addEventListener("touchmove",ve,{passive:!1}),()=>ae.removeEventListener("touchmove",ve)},[T]);const oe=g||f||m||b;return e.jsxs("div",{className:`nice-signature ${w?"nice-signature--disabled":""} ${y?"nice-signature--readonly":""} ${M??""}`,style:{width:i},"data-testid":_,children:[oe&&e.jsxs("div",{className:"nice-signature__toolbar",children:[m&&e.jsx("div",{className:"nice-signature__color-picker",children:e.jsx("input",{type:"color",value:H,onChange:ae=>E(ae.target.value),disabled:w||y,title:"Pen color"})}),b&&e.jsx("div",{className:"nice-signature__size-slider",children:e.jsx("input",{type:"range",min:d,max:p,step:.5,value:R,onChange:ae=>x(parseFloat(ae.target.value)),disabled:w||y,title:"Pen size"})}),e.jsxs("div",{className:"nice-signature__actions",children:[f&&e.jsx("button",{type:"button",onClick:Y,disabled:w||y||z.length===0,className:"nice-signature__btn",title:"Undo",children:"↩️"}),g&&e.jsx("button",{type:"button",onClick:B,disabled:w||y||O,className:"nice-signature__btn",title:"Clear",children:"🗑️"})]})]}),e.jsxs("div",{className:"nice-signature__canvas-wrapper",style:{height:o},children:[e.jsx("canvas",{ref:j,className:"nice-signature__canvas",style:{width:"100%",height:"100%",cursor:w||y?"not-allowed":"crosshair",touchAction:"none"},onPointerDown:L,onPointerMove:G,onPointerUp:V,onPointerLeave:V}),O&&!T&&u&&e.jsx("div",{className:"nice-signature__placeholder",children:u}),e.jsx("div",{className:"nice-signature__line"})]})]})});const Yr="nice-signature-styles";if(typeof document<"u"&&!document.getElementById(Yr)){const t=document.createElement("style");t.id=Yr,t.textContent=`
|
|
775
|
+
.nice-signature {
|
|
776
|
+
display: flex;
|
|
777
|
+
flex-direction: column;
|
|
778
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
779
|
+
border-radius: 4px;
|
|
780
|
+
overflow: hidden;
|
|
781
|
+
background: var(--nice-bg-surface, #fff);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
.nice-signature--disabled {
|
|
785
|
+
opacity: 0.6;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.nice-signature__toolbar {
|
|
789
|
+
display: flex;
|
|
790
|
+
align-items: center;
|
|
791
|
+
gap: 8px;
|
|
792
|
+
padding: 8px;
|
|
793
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
794
|
+
border-bottom: 1px solid var(--nice-border, #e0e0e0);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.nice-signature__color-picker input {
|
|
798
|
+
width: 32px;
|
|
799
|
+
height: 32px;
|
|
800
|
+
padding: 2px;
|
|
801
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
802
|
+
border-radius: 4px;
|
|
803
|
+
cursor: pointer;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
.nice-signature__size-slider {
|
|
807
|
+
flex: 1;
|
|
808
|
+
max-width: 120px;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.nice-signature__size-slider input {
|
|
812
|
+
width: 100%;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.nice-signature__actions {
|
|
816
|
+
display: flex;
|
|
817
|
+
gap: 4px;
|
|
818
|
+
margin-left: auto;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.nice-signature__btn {
|
|
822
|
+
padding: 6px 10px;
|
|
823
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
824
|
+
border-radius: 4px;
|
|
825
|
+
background: var(--nice-bg-surface, #fff);
|
|
826
|
+
cursor: pointer;
|
|
827
|
+
font-size: 14px;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.nice-signature__btn:hover:not(:disabled) {
|
|
831
|
+
background: var(--nice-bg-hover, #f0f0f0);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
.nice-signature__btn:disabled {
|
|
835
|
+
opacity: 0.4;
|
|
836
|
+
cursor: not-allowed;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
.nice-signature__canvas-wrapper {
|
|
840
|
+
position: relative;
|
|
841
|
+
background: #fff;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
.nice-signature__canvas {
|
|
845
|
+
display: block;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
.nice-signature__placeholder {
|
|
849
|
+
position: absolute;
|
|
850
|
+
top: 50%;
|
|
851
|
+
left: 50%;
|
|
852
|
+
transform: translate(-50%, -50%);
|
|
853
|
+
color: var(--nice-text-secondary, #999);
|
|
854
|
+
font-size: 14px;
|
|
855
|
+
pointer-events: none;
|
|
856
|
+
user-select: none;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
.nice-signature__line {
|
|
860
|
+
position: absolute;
|
|
861
|
+
bottom: 30px;
|
|
862
|
+
left: 20px;
|
|
863
|
+
right: 20px;
|
|
864
|
+
height: 1px;
|
|
865
|
+
background: var(--nice-border, #ccc);
|
|
866
|
+
pointer-events: none;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/* Display component */
|
|
870
|
+
.nice-signature-display {
|
|
871
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
872
|
+
border-radius: 4px;
|
|
873
|
+
overflow: hidden;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
.nice-signature-display__canvas-wrapper {
|
|
877
|
+
position: relative;
|
|
878
|
+
background: #fff;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
.nice-signature-display__canvas {
|
|
882
|
+
display: block;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
.nice-signature-display__placeholder {
|
|
886
|
+
position: absolute;
|
|
887
|
+
top: 50%;
|
|
888
|
+
left: 50%;
|
|
889
|
+
transform: translate(-50%, -50%);
|
|
890
|
+
color: var(--nice-text-secondary, #999);
|
|
891
|
+
font-size: 14px;
|
|
892
|
+
}
|
|
893
|
+
`,document.head.appendChild(t)}const si=s.forwardRef(({label:t,helperText:a,error:r,success:n=!1,startIcon:i,endIcon:o,showCounter:c=!1,variant:l="outlined",size:d="md",fullWidth:p=!1,className:h="",disabled:u=!1,required:g=!1,maxLength:f,value:m,defaultValue:b,onFocus:C,onBlur:v,onChange:w,"data-testid":y="nice-floating-input",...S},k)=>{Re();const M=s.useId(),[_,j]=s.useState(!1),[z,P]=s.useState(b??""),I=m!==void 0?m:z,D=String(I).length>0,T=_||D,N=s.useCallback(x=>{j(!0),C==null||C(x)},[C]),H=s.useCallback(x=>{j(!1),v==null||v(x)},[v]),E=s.useCallback(x=>{m===void 0&&P(x.target.value),w==null||w(x)},[m,w]),R=["nice-floating-input",`nice-floating-input--${l}`,`nice-floating-input--${d}`,_&&"nice-floating-input--focused",D&&"nice-floating-input--has-value",u&&"nice-floating-input--disabled",r&&"nice-floating-input--error",n&&"nice-floating-input--success",i&&"nice-floating-input--has-start-icon",o&&"nice-floating-input--has-end-icon",p&&"nice-floating-input--full-width",h].filter(Boolean).join(" ");return e.jsxs("div",{className:R,"data-testid":y,children:[e.jsxs("div",{className:"nice-floating-input__container",children:[i&&e.jsx("span",{className:"nice-floating-input__icon nice-floating-input__icon--start",children:i}),e.jsxs("div",{className:"nice-floating-input__field",children:[e.jsx("input",{ref:k,id:M,className:"nice-floating-input__input",value:I,onChange:E,onFocus:N,onBlur:H,disabled:u,required:g,maxLength:f,"aria-invalid":!!r,"aria-describedby":r?`${M}-error`:a?`${M}-helper`:void 0,"data-testid":`${y}-input`,...S}),e.jsxs("label",{htmlFor:M,className:`nice-floating-input__label ${T?"nice-floating-input__label--floating":""}`,children:[t,g&&e.jsx("span",{className:"nice-floating-input__required",children:"*"})]}),l==="outlined"&&e.jsx("fieldset",{className:"nice-floating-input__fieldset","aria-hidden":"true",children:e.jsx("legend",{className:`nice-floating-input__legend ${T?"nice-floating-input__legend--floating":""}`,children:e.jsxs("span",{children:[t,g&&" *"]})})})]}),o&&e.jsx("span",{className:"nice-floating-input__icon nice-floating-input__icon--end",children:o})]}),e.jsxs("div",{className:"nice-floating-input__footer",children:[r?e.jsx("span",{id:`${M}-error`,className:"nice-floating-input__error",role:"alert",children:r}):a?e.jsx("span",{id:`${M}-helper`,className:"nice-floating-input__helper",children:a}):e.jsx("span",{}),c&&f!==void 0&&e.jsxs("span",{className:"nice-floating-input__counter",children:[String(I).length,"/",f]})]})]})});si.displayName="NiceFloatingLabelInput";const oi=s.forwardRef(({label:t,helperText:a,error:r,success:n=!1,showCounter:i=!1,variant:o="outlined",size:c="md",fullWidth:l=!1,autoResize:d=!1,minRows:p=3,maxRows:h=10,className:u="",disabled:g=!1,required:f=!1,maxLength:m,value:b,defaultValue:C,onFocus:v,onBlur:w,onChange:y,"data-testid":S="nice-floating-textarea",...k},M)=>{Re();const _=s.useId(),j=s.useRef(null),[z,P]=s.useState(!1),[I,D]=s.useState(C??""),T=b!==void 0?b:I,N=String(T).length>0,H=z||N;s.useEffect(()=>{if(!d||!j.current)return;const O=j.current,F=parseInt(getComputedStyle(O).lineHeight)||20,L=p*F,G=h*F;O.style.height="auto";const V=O.scrollHeight;O.style.height=`${Math.min(Math.max(V,L),G)}px`},[T,d,p,h]);const E=s.useCallback(O=>{j.current=O,typeof M=="function"?M(O):M&&(M.current=O)},[M]),R=s.useCallback(O=>{P(!0),v==null||v(O)},[v]),x=s.useCallback(O=>{P(!1),w==null||w(O)},[w]),$=s.useCallback(O=>{b===void 0&&D(O.target.value),y==null||y(O)},[b,y]),A=["nice-floating-input","nice-floating-input--textarea",`nice-floating-input--${o}`,`nice-floating-input--${c}`,z&&"nice-floating-input--focused",N&&"nice-floating-input--has-value",g&&"nice-floating-input--disabled",r&&"nice-floating-input--error",n&&"nice-floating-input--success",l&&"nice-floating-input--full-width",u].filter(Boolean).join(" ");return e.jsxs("div",{className:A,"data-testid":S,children:[e.jsx("div",{className:"nice-floating-input__container",children:e.jsxs("div",{className:"nice-floating-input__field",children:[e.jsx("textarea",{ref:E,id:_,className:"nice-floating-input__input nice-floating-input__input--textarea",value:T,onChange:$,onFocus:R,onBlur:x,disabled:g,required:f,maxLength:m,rows:p,"aria-invalid":!!r,"aria-describedby":r?`${_}-error`:a?`${_}-helper`:void 0,"data-testid":`${S}-textarea`,...k}),e.jsxs("label",{htmlFor:_,className:`nice-floating-input__label ${H?"nice-floating-input__label--floating":""}`,children:[t,f&&e.jsx("span",{className:"nice-floating-input__required",children:"*"})]}),o==="outlined"&&e.jsx("fieldset",{className:"nice-floating-input__fieldset","aria-hidden":"true",children:e.jsx("legend",{className:`nice-floating-input__legend ${H?"nice-floating-input__legend--floating":""}`,children:e.jsxs("span",{children:[t,f&&" *"]})})})]})}),e.jsxs("div",{className:"nice-floating-input__footer",children:[r?e.jsx("span",{id:`${_}-error`,className:"nice-floating-input__error",role:"alert",children:r}):a?e.jsx("span",{id:`${_}-helper`,className:"nice-floating-input__helper",children:a}):e.jsx("span",{}),i&&m!==void 0&&e.jsxs("span",{className:"nice-floating-input__counter",children:[String(T).length,"/",m]})]})]})});oi.displayName="NiceFloatingLabelTextarea";const Bu={strokeColor:"#ff3333",fillColor:"transparent",strokeWidth:2,opacity:1,fontSize:16,fontFamily:"sans-serif"};function Wu(t,a){switch(a.type){case"SET_TOOL":return{...t,activeTool:a.tool,selectedId:null};case"SET_STYLE":return{...t,style:{...t.style,...a.style}};case"ADD_ANNOTATION":return{...t,annotations:[...t.annotations,a.annotation],past:[...t.past,t.annotations],future:[]};case"UPDATE_ANNOTATION":return{...t,annotations:t.annotations.map(r=>r.id===a.id?{...r,...a.updates}:r),past:[...t.past,t.annotations],future:[]};case"DELETE_ANNOTATION":return{...t,annotations:t.annotations.filter(r=>r.id!==a.id),selectedId:t.selectedId===a.id?null:t.selectedId,past:[...t.past,t.annotations],future:[]};case"SELECT":return{...t,selectedId:a.id};case"SET_ANNOTATIONS":return{...t,annotations:a.annotations,past:[],future:[]};case"SET_ZOOM":return{...t,zoom:a.zoom};case"SET_PAN":return{...t,panX:a.panX,panY:a.panY};case"UNDO":{if(t.past.length===0)return t;const r=t.past[t.past.length-1];return{...t,annotations:r,past:t.past.slice(0,-1),future:[t.annotations,...t.future]}}case"REDO":{if(t.future.length===0)return t;const r=t.future[0];return{...t,annotations:r,past:[...t.past,t.annotations],future:t.future.slice(1)}}case"CLEAR":return{...t,annotations:[],selectedId:null,past:[...t.past,t.annotations],future:[]};default:return t}}let Hu=0;function qu(){return`ann-${Date.now()}-${Hu++}`}function Vu(t){const{style:a}=t,r=`stroke="${a.strokeColor}" stroke-width="${a.strokeWidth}" fill="${a.fillColor}" opacity="${a.opacity}"`;switch(t.tool){case"rectangle":return`<rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" ${r} />`;case"ellipse":{const n=t.x+t.width/2,i=t.y+t.height/2;return`<ellipse cx="${n}" cy="${i}" rx="${t.width/2}" ry="${t.height/2}" ${r} />`}case"arrow":{const n=t,i=Math.atan2(n.endY-n.y,n.endX-n.x),o=12,c=n.endX-o*Math.cos(i-Math.PI/6),l=n.endY-o*Math.sin(i-Math.PI/6),d=n.endX-o*Math.cos(i+Math.PI/6),p=n.endY-o*Math.sin(i+Math.PI/6);return`<line x1="${n.x}" y1="${n.y}" x2="${n.endX}" y2="${n.endY}" ${r} />
|
|
894
|
+
<polygon points="${n.endX},${n.endY} ${c},${l} ${d},${p}" fill="${a.strokeColor}" opacity="${a.opacity}" />`}case"line":{const n=t;return`<line x1="${n.x}" y1="${n.y}" x2="${n.endX}" y2="${n.endY}" ${r} />`}case"text":{const n=t;return`<text x="${n.x}" y="${n.y+(n.style.fontSize??16)}" fill="${a.strokeColor}" font-size="${a.fontSize}" font-family="${a.fontFamily}" opacity="${a.opacity}">${Ku(n.text)}</text>`}case"freehand":{const n=t;return n.points.length<2?"":`<path d="${n.points.map((i,o)=>`${o===0?"M":"L"}${i.x},${i.y}`).join(" ")}" ${r} fill="none" />`}case"blur":{const n=t,i=`blur-${n.id}`;return`<defs><filter id="${i}"><feGaussianBlur stdDeviation="${n.intensity??5}" /></filter></defs>
|
|
895
|
+
<rect x="${n.x}" y="${n.y}" width="${n.width}" height="${n.height}" fill="transparent" stroke="none" filter="url(#${i})" />`}default:return""}}function Ku(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const li=s.forwardRef(({src:t,alt:a="Annotatable image",annotations:r,activeTool:n,defaultStyle:i,onAnnotationsChange:o,className:c,readOnly:l=!1,minZoom:d=.1,maxZoom:p=5},h)=>{const u=s.useRef(null),g=s.useRef(null),f=s.useRef(null),[m,b]=s.useState(!1),[C,v]=s.useState({width:0,height:0}),[w,y]=s.useReducer(Wu,{annotations:r??[],selectedId:null,activeTool:n??"select",style:{...Bu,...i},zoom:1,panX:0,panY:0,past:[],future:[]});s.useEffect(()=>{n&&y({type:"SET_TOOL",tool:n})},[n]),s.useEffect(()=>{o==null||o(w.annotations)},[w.annotations,o]),s.useEffect(()=>{const T=new Image;T.crossOrigin="anonymous",T.onload=()=>{f.current=T,v({width:T.naturalWidth,height:T.naturalHeight}),b(!0)},T.src=t},[t]);const S=s.useRef({isDrawing:!1,startX:0,startY:0,currentAnnotation:null,freehandPoints:[]}),k=s.useCallback((T,N)=>{const H=u.current;if(!H)return{x:0,y:0};const E=H.getBoundingClientRect();return{x:(T-E.left-w.panX)/w.zoom,y:(N-E.top-w.panY)/w.zoom}},[w.zoom,w.panX,w.panY]),M=s.useCallback(()=>{var R,x;const T=u.current,N=T==null?void 0:T.getContext("2d"),H=f.current;if(!T||!N||!H||!m)return;T.width=((R=g.current)==null?void 0:R.clientWidth)??H.naturalWidth,T.height=((x=g.current)==null?void 0:x.clientHeight)??H.naturalHeight,N.clearRect(0,0,T.width,T.height),N.save(),N.translate(w.panX,w.panY),N.scale(w.zoom,w.zoom),N.drawImage(H,0,0);for(const $ of w.annotations){switch(N.save(),N.globalAlpha=$.style.opacity,N.strokeStyle=$.style.strokeColor,N.fillStyle=$.style.fillColor,N.lineWidth=$.style.strokeWidth,$.tool){case"rectangle":N.strokeRect($.x,$.y,$.width,$.height),$.style.fillColor!=="transparent"&&N.fillRect($.x,$.y,$.width,$.height);break;case"ellipse":{N.beginPath(),N.ellipse($.x+$.width/2,$.y+$.height/2,Math.abs($.width/2),Math.abs($.height/2),0,0,Math.PI*2),N.stroke(),$.style.fillColor!=="transparent"&&N.fill();break}case"arrow":{const A=$;N.beginPath(),N.moveTo(A.x,A.y),N.lineTo(A.endX,A.endY),N.stroke();const O=Math.atan2(A.endY-A.y,A.endX-A.x),F=12;N.beginPath(),N.moveTo(A.endX,A.endY),N.lineTo(A.endX-F*Math.cos(O-Math.PI/6),A.endY-F*Math.sin(O-Math.PI/6)),N.lineTo(A.endX-F*Math.cos(O+Math.PI/6),A.endY-F*Math.sin(O+Math.PI/6)),N.closePath(),N.fillStyle=$.style.strokeColor,N.fill();break}case"line":{const A=$;N.beginPath(),N.moveTo(A.x,A.y),N.lineTo(A.endX,A.endY),N.stroke();break}case"text":{const A=$;N.font=`${A.style.fontSize??16}px ${A.style.fontFamily??"sans-serif"}`,N.fillStyle=A.style.strokeColor,N.fillText(A.text,A.x,A.y+(A.style.fontSize??16));break}case"freehand":{const A=$;if(A.points.length<2)break;N.beginPath(),N.moveTo(A.points[0].x,A.points[0].y);for(let O=1;O<A.points.length;O++)N.lineTo(A.points[O].x,A.points[O].y);N.stroke();break}case"blur":{const A=$;N.filter=`blur(${A.intensity??5}px)`,N.drawImage(H,A.x,A.y,A.width,A.height,A.x,A.y,A.width,A.height),N.filter="none";break}}$.id===w.selectedId&&(N.strokeStyle="#4488ff",N.lineWidth=1,N.setLineDash([4,4]),N.strokeRect($.x-2,$.y-2,$.width+4,$.height+4),N.setLineDash([])),N.restore()}const E=S.current;if(E.isDrawing&&E.currentAnnotation){N.save();const $=E.currentAnnotation;if(N.globalAlpha=$.style.opacity,N.strokeStyle=$.style.strokeColor,N.lineWidth=$.style.strokeWidth,N.setLineDash([6,3]),$.tool==="freehand"){const A=$;if(A.points.length>=2){N.beginPath(),N.moveTo(A.points[0].x,A.points[0].y);for(let O=1;O<A.points.length;O++)N.lineTo(A.points[O].x,A.points[O].y);N.stroke()}}else if($.tool==="rectangle")N.strokeRect($.x,$.y,$.width,$.height);else if($.tool==="ellipse")N.beginPath(),N.ellipse($.x+$.width/2,$.y+$.height/2,Math.abs($.width/2),Math.abs($.height/2),0,0,Math.PI*2),N.stroke();else if($.tool==="arrow"||$.tool==="line"){const A=$;N.beginPath(),N.moveTo(A.x,A.y),N.lineTo(A.endX,A.endY),N.stroke()}N.restore()}N.restore()},[w,m]);s.useEffect(()=>{M()},[M]);const _=s.useCallback(T=>{if(l)return;const N=k(T.clientX,T.clientY),H=w.activeTool;if(H==="select"){const x=[...w.annotations].reverse().find($=>$.tool==="freehand"?!1:N.x>=$.x&&N.x<=$.x+$.width&&N.y>=$.y&&N.y<=$.y+$.height);y({type:"SELECT",id:(x==null?void 0:x.id)??null});return}const E=S.current;E.isDrawing=!0,E.startX=N.x,E.startY=N.y;const R={id:qu(),style:{...w.style},x:N.x,y:N.y,width:0,height:0};switch(H){case"rectangle":E.currentAnnotation={...R,tool:"rectangle"};break;case"ellipse":E.currentAnnotation={...R,tool:"ellipse"};break;case"arrow":E.currentAnnotation={...R,tool:"arrow",endX:N.x,endY:N.y};break;case"line":E.currentAnnotation={...R,tool:"line",endX:N.x,endY:N.y};break;case"text":E.currentAnnotation={...R,tool:"text",text:"Text",width:100,height:w.style.fontSize??16};break;case"freehand":E.freehandPoints=[N],E.currentAnnotation={...R,tool:"freehand",points:[N]};break;case"blur":E.currentAnnotation={...R,tool:"blur",intensity:5};break}},[l,k,w.activeTool,w.style,w.annotations]),j=s.useCallback(T=>{const N=S.current;if(!N.isDrawing||!N.currentAnnotation)return;const H=k(T.clientX,T.clientY),E=N.currentAnnotation;if(E.tool==="freehand"){N.freehandPoints.push(H),E.points=[...N.freehandPoints];const R=N.freehandPoints.map($=>$.x),x=N.freehandPoints.map($=>$.y);E.x=Math.min(...R),E.y=Math.min(...x),E.width=Math.max(...R)-E.x,E.height=Math.max(...x)-E.y}else if(E.tool==="arrow"||E.tool==="line")E.endX=H.x,E.endY=H.y,E.width=Math.abs(H.x-N.startX),E.height=Math.abs(H.y-N.startY);else{const R=Math.min(N.startX,H.x),x=Math.min(N.startY,H.y);E.x=R,E.y=x,E.width=Math.abs(H.x-N.startX),E.height=Math.abs(H.y-N.startY)}M()},[k,M]),z=s.useCallback(()=>{const T=S.current;if(!T.isDrawing||!T.currentAnnotation)return;const N=T.currentAnnotation;(N.tool==="text"||N.tool==="freehand"||Math.abs(N.width)>2||Math.abs(N.height)>2)&&y({type:"ADD_ANNOTATION",annotation:N}),T.isDrawing=!1,T.currentAnnotation=null,T.freehandPoints=[]},[]),P=s.useCallback(T=>{T.preventDefault();const N=T.deltaY>0?.9:1.1,H=Math.max(d,Math.min(p,w.zoom*N));y({type:"SET_ZOOM",zoom:H})},[w.zoom,d,p]);s.useEffect(()=>{if(l)return;const T=N=>{(N.metaKey||N.ctrlKey)&&N.key==="z"&&!N.shiftKey?(N.preventDefault(),y({type:"UNDO"})):(N.metaKey||N.ctrlKey)&&(N.key==="y"||N.key==="z"&&N.shiftKey)?(N.preventDefault(),y({type:"REDO"})):(N.key==="Delete"||N.key==="Backspace")&&w.selectedId&&y({type:"DELETE_ANNOTATION",id:w.selectedId})};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[l,w.selectedId]),s.useImperativeHandle(h,()=>({exportAsDataURL:async(T="png",N=.92)=>{const H=document.createElement("canvas"),E=f.current;if(!E)return"";H.width=E.naturalWidth,H.height=E.naturalHeight;const R=H.getContext("2d");R.drawImage(E,0,0);for(const x of w.annotations){if(R.save(),R.globalAlpha=x.style.opacity,R.strokeStyle=x.style.strokeColor,R.fillStyle=x.style.fillColor,R.lineWidth=x.style.strokeWidth,x.tool==="rectangle")R.strokeRect(x.x,x.y,x.width,x.height);else if(x.tool==="ellipse")R.beginPath(),R.ellipse(x.x+x.width/2,x.y+x.height/2,Math.abs(x.width/2),Math.abs(x.height/2),0,0,Math.PI*2),R.stroke();else if(x.tool==="freehand"){const $=x;if($.points.length>=2){R.beginPath(),R.moveTo($.points[0].x,$.points[0].y);for(let A=1;A<$.points.length;A++)R.lineTo($.points[A].x,$.points[A].y);R.stroke()}}else if(x.tool==="text"){const $=x;R.font=`${$.style.fontSize??16}px ${$.style.fontFamily??"sans-serif"}`,R.fillStyle=$.style.strokeColor,R.fillText($.text,$.x,$.y+($.style.fontSize??16))}R.restore()}return H.toDataURL(`image/${T}`,N)},exportAnnotations:()=>[...w.annotations],importAnnotations:T=>{y({type:"SET_ANNOTATIONS",annotations:T})},exportAsSVG:()=>{const{width:T,height:N}=C,H=w.annotations.map(Vu);return`<svg xmlns="http://www.w3.org/2000/svg" width="${T}" height="${N}" viewBox="0 0 ${T} ${N}">
|
|
896
|
+
${H.join(`
|
|
897
|
+
`)}
|
|
898
|
+
</svg>`},undo:()=>y({type:"UNDO"}),redo:()=>y({type:"REDO"}),setZoom:T=>{y({type:"SET_ZOOM",zoom:Math.max(d,Math.min(p,T))})},fitToScreen:()=>{const T=g.current,N=f.current;if(!T||!N)return;const H=T.clientWidth/N.naturalWidth,E=T.clientHeight/N.naturalHeight,R=Math.min(H,E,1);y({type:"SET_ZOOM",zoom:R}),y({type:"SET_PAN",panX:0,panY:0})},clear:()=>y({type:"CLEAR"})}),[w.annotations,C,d,p]);const I=s.useCallback(T=>{if(T.touches.length!==1)return;const N=T.touches[0];_({clientX:N.clientX,clientY:N.clientY,preventDefault:()=>{}})},[_]),D=s.useCallback(T=>{if(T.touches.length!==1)return;const N=T.touches[0];j({clientX:N.clientX,clientY:N.clientY})},[j]);return e.jsx("div",{ref:g,className:`nice-image-annotator ${c??""}`,style:{position:"relative",overflow:"hidden",width:"100%",height:"100%"},children:e.jsx("canvas",{ref:u,className:"nice-image-annotator__canvas",style:{cursor:w.activeTool==="select"?"default":"crosshair"},onMouseDown:_,onMouseMove:j,onMouseUp:z,onMouseLeave:z,onWheel:P,onTouchStart:I,onTouchMove:D,onTouchEnd:z,role:"img","aria-label":a})})});li.displayName="NiceImageAnnotator";const ur=s.forwardRef(({options:t,value:a=[],onChange:r,placeholder:n,disabled:i,size:o="md",className:c,style:l,id:d},p)=>{const h=Ae(d),{t:u}=Re(),[g,f]=s.useState(!1),m=s.useMemo(()=>{const v=[t];let w=t;for(const y of a){const S=w.find(k=>k.value===y);if(S!=null&&S.children)v.push(S.children),w=S.children;else break}return v},[t,a]),b=s.useCallback((v,w)=>{var k;const y=[...a.slice(0,v),w],S=(k=m[v])==null?void 0:k.find(M=>M.value===w);(!(S!=null&&S.children)||S.children.length===0)&&f(!1),r==null||r(y)},[a,m,r]),C=a.length>0?a.map((v,w)=>{var y,S;return((S=(y=m[w])==null?void 0:y.find(k=>k.value===v))==null?void 0:S.label)??v}).join(" › "):n??u("controls.select","Select...");return e.jsxs("div",{ref:p,id:h,className:`nice-cascade-select nice-cascade-select--${o}${i?" nice-cascade-select--disabled":""} ${c||""}`,style:l,children:[e.jsxs("button",{type:"button",className:"nice-cascade-select__trigger",onClick:()=>!i&&f(v=>!v),"aria-haspopup":"listbox","aria-expanded":g,disabled:i,children:[e.jsx("span",{className:`nice-cascade-select__display${a.length===0?" nice-cascade-select__display--placeholder":""}`,children:C}),e.jsx("span",{className:"nice-cascade-select__arrow",children:"▾"})]}),g&&e.jsx("div",{className:"nice-cascade-select__dropdown",children:m.map((v,w)=>e.jsx("div",{className:"nice-cascade-select__column",role:"listbox",children:v.map(y=>e.jsxs("div",{className:`nice-cascade-select__option${a[w]===y.value?" nice-cascade-select__option--selected":""}`,role:"option","aria-selected":a[w]===y.value,onClick:()=>b(w,y.value),children:[e.jsx("span",{children:y.label}),y.children&&y.children.length>0&&e.jsx("span",{className:"nice-cascade-select__chevron",children:"›"})]},y.value))},w))})]})});ur.displayName="NiceCascadeSelect";const pr=s.forwardRef(({columns:t,data:a,value:r,onChange:n,displayExpr:i="label",valueExpr:o="id",placeholder:c,disabled:l,size:d="md",filterable:p=!0,className:h,style:u,id:g},f)=>{const m=Ae(g),{t:b}=Re(),[C,v]=s.useState(!1),[w,y]=s.useState(""),S=s.useRef(null);s.useEffect(()=>{if(!C)return;const z=P=>{S.current&&!S.current.contains(P.target)&&v(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[C]);const k=s.useMemo(()=>{if(!p||!w)return a;const z=w.toLowerCase();return a.filter(P=>t.some(I=>String(P[I.field]??"").toLowerCase().includes(z)))},[a,w,t,p]),M=a.find(z=>String(z[o])===r),_=M?String(M[i]):"",j=s.useCallback(z=>{n==null||n(String(z[o])),v(!1),y("")},[n,o]);return e.jsx("div",{ref:f,id:m,className:`nice-mc-combo nice-mc-combo--${d}${l?" nice-mc-combo--disabled":""} ${h||""}`,style:u,children:e.jsxs("div",{ref:S,className:"nice-mc-combo__wrap",children:[e.jsx("input",{className:"nice-mc-combo__input",type:"text",value:C?w:_,placeholder:c??b("controls.select","Select..."),disabled:l,onFocus:()=>{v(!0),y("")},onChange:z=>y(z.target.value),"aria-autocomplete":"list","aria-expanded":C}),e.jsx("button",{type:"button",className:"nice-mc-combo__toggle",onClick:()=>!l&&v(z=>!z),tabIndex:-1,"aria-label":"Toggle",children:"▾"}),C&&e.jsx("div",{className:"nice-mc-combo__dropdown",children:e.jsxs("table",{className:"nice-mc-combo__table",children:[e.jsx("thead",{children:e.jsx("tr",{children:t.map(z=>e.jsx("th",{style:{width:z.width},children:z.header},z.field))})}),e.jsxs("tbody",{children:[k.map((z,P)=>e.jsx("tr",{className:`nice-mc-combo__row${String(z[o])===r?" nice-mc-combo__row--selected":""}`,onClick:()=>j(z),children:t.map(I=>e.jsx("td",{children:String(z[I.field]??"")},I.field))},P)),k.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:t.length,className:"nice-mc-combo__empty",children:b("controls.noData","No data")})})]})]})})]})})});pr.displayName="NiceMultiColumnComboBox";const mr=s.forwardRef(({value:t,onChange:a,type:r="text",options:n=[],submitOnBlur:i=!0,placeholder:o,disabled:c,size:l="md",className:d,style:p,id:h},u)=>{var _;const g=Ae(h),[f,m]=s.useState(!1),[b,C]=s.useState(t),v=s.useRef(null);s.useEffect(()=>{C(t)},[t]),s.useEffect(()=>{f&&v.current&&v.current.focus()},[f]);const w=s.useCallback(()=>{c||(C(t),m(!0))},[c,t]),y=s.useCallback(()=>{m(!1),b!==t&&a(b)},[b,t,a]),S=s.useCallback(()=>{m(!1),C(t)},[t]),k=s.useCallback(j=>{j.key==="Enter"&&r!=="textarea"&&y(),j.key==="Escape"&&S()},[y,S,r]),M=r==="select"&&((_=n.find(j=>j.value===t))==null?void 0:_.label)||t;return e.jsx("div",{ref:u,id:g,className:`nice-inplace nice-inplace--${l}${c?" nice-inplace--disabled":""} ${d||""}`,style:p,children:f?e.jsxs("span",{className:"nice-inplace__editor",children:[r==="textarea"?e.jsx("textarea",{ref:v,className:"nice-inplace__input",value:b,onChange:j=>C(j.target.value),onBlur:i?y:void 0,onKeyDown:j=>j.key==="Escape"&&S(),rows:3}):r==="select"?e.jsx("select",{ref:v,className:"nice-inplace__input",value:b,onChange:j=>{C(j.target.value)},onBlur:i?y:void 0,onKeyDown:k,children:n.map(j=>e.jsx("option",{value:j.value,children:j.label},j.value))}):e.jsx("input",{ref:v,className:"nice-inplace__input",type:r==="number"?"number":r==="date"?"date":"text",value:b,onChange:j=>C(j.target.value),onBlur:i?y:void 0,onKeyDown:k}),e.jsx("button",{type:"button",className:"nice-inplace__save",onClick:y,"aria-label":"Save",children:"✓"}),e.jsx("button",{type:"button",className:"nice-inplace__cancel",onClick:S,"aria-label":"Cancel",children:"✕"})]}):e.jsxs("span",{className:"nice-inplace__display",onClick:w,role:"button",tabIndex:0,onKeyDown:j=>j.key==="Enter"&&w(),children:[M||e.jsx("span",{className:"nice-inplace__placeholder",children:o||"Click to edit"}),!c&&e.jsx("span",{className:"nice-inplace__icon",children:"✎"})]})})});mr.displayName="NiceInPlaceEditor";function Yu(t){let a=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");return a=a.replace(/```(\w*)\n([\s\S]*?)```/g,(r,n,i)=>`<pre><code class="language-${n}">${i.trim()}</code></pre>`),a=a.replace(/^(\|.+\|)\n(\|[-| :]+\|)\n((?:\|.+\|\n?)+)/gm,(r,n,i,o)=>{const c=n.split("|").filter(d=>d.trim()).map(d=>`<th>${d.trim()}</th>`).join(""),l=o.trim().split(`
|
|
899
|
+
`).map(d=>`<tr>${d.split("|").filter(p=>p.trim()).map(p=>`<td>${p.trim()}</td>`).join("")}</tr>`).join("");return`<table><thead><tr>${c}</tr></thead><tbody>${l}</tbody></table>`}),a=a.replace(/^#### (.+)$/gm,"<h4>$1</h4>"),a=a.replace(/^### (.+)$/gm,"<h3>$1</h3>"),a=a.replace(/^## (.+)$/gm,"<h2>$1</h2>"),a=a.replace(/^# (.+)$/gm,"<h1>$1</h1>"),a=a.replace(/^> (.+)$/gm,"<blockquote>$1</blockquote>"),a=a.replace(/^---$/gm,"<hr/>"),a=a.replace(/^- \[x\] (.+)$/gm,'<li class="task done">☑ $1</li>'),a=a.replace(/^- \[ \] (.+)$/gm,'<li class="task">☐ $1</li>'),a=a.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),a=a.replace(/\*(.+?)\*/g,"<em>$1</em>"),a=a.replace(/~~(.+?)~~/g,"<del>$1</del>"),a=a.replace(/`(.+?)`/g,"<code>$1</code>"),a=a.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1" style="max-width:100%"/>'),a=a.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>'),a=a.replace(/^\- (.+)$/gm,"<li>$1</li>"),a=a.replace(/^\d+\. (.+)$/gm,"<li>$1</li>"),a=a.replace(/\n/g,"<br/>"),a}const Gu=[{key:"bold",label:"B",md:"**",tip:"Bold",shortcut:"Ctrl+B",group:"format"},{key:"italic",label:"I",md:"*",tip:"Italic",shortcut:"Ctrl+I",group:"format"},{key:"strike",label:"S̶",md:"~~",tip:"Strikethrough",group:"format"},{key:"code",label:"< >",md:"`",tip:"Inline code",group:"format"},{key:"h1",label:"H1",md:"# ",tip:"Heading 1",group:"heading"},{key:"h2",label:"H2",md:"## ",tip:"Heading 2",group:"heading"},{key:"h3",label:"H3",md:"### ",tip:"Heading 3",group:"heading"},{key:"ul",label:"•",md:"- ",tip:"Unordered list",group:"list"},{key:"ol",label:"1.",md:"1. ",tip:"Ordered list",group:"list"},{key:"task",label:"☑",md:"- [ ] ",tip:"Task list",group:"list"},{key:"quote",label:"❝",md:"> ",tip:"Blockquote",group:"block"},{key:"hr",label:"—",md:`---
|
|
900
|
+
`,tip:"Horizontal rule",group:"block"},{key:"link",label:"🔗",md:"[](url)",tip:"Link",shortcut:"Ctrl+K",group:"insert"},{key:"image",label:"🖼",md:"",tip:"Image",group:"insert"},{key:"table",label:"⊞",md:`| H1 | H2 | H3 |
|
|
901
|
+
| --- | --- | --- |
|
|
902
|
+
| c1 | c2 | c3 |
|
|
903
|
+
`,tip:"Table",group:"insert"},{key:"codeblock",label:"```",md:"```\n",tip:"Code block",group:"insert"}],Uu=["format","heading","list","block","insert"],hr=s.forwardRef(({value:t="",onChange:a,preview:r="side",placeholder:n,disabled:i,readOnly:o,size:c="md",editorSize:l="standard",toolbar:d=!0,minHeight:p=200,showWordCount:h=!1,showLineNumbers:u=!1,onExportHtml:g,onImageUpload:f,className:m,style:b,id:C},v)=>{const w=Ae(C),[y,S]=s.useState("edit"),[k,M]=s.useState(!1),_=s.useRef(null),j=s.useMemo(()=>Yu(t),[t]),z=s.useMemo(()=>{const E=t.trim()?t.trim().split(/\s+/).length:0,R=t.length,x=t.split(`
|
|
904
|
+
`).length;return{words:E,chars:R,lines:x}},[t]),P=s.useCallback(E=>{const R=_.current;if(!R)return;const x=R.selectionStart,$=R.selectionEnd,A=t.slice(x,$);let O,F;E==="[](url)"?(O=t.slice(0,x)+`[${A||"text"}](url)`+t.slice($),F=x+1+(A||"text").length+2):E===""?(O=t.slice(0,x)+``+t.slice($),F=x+2+(A||"alt").length+2):E.endsWith(`
|
|
905
|
+
`)||E.endsWith(" ")?(O=t.slice(0,x)+E+A+t.slice($),F=x+E.length+A.length):(O=t.slice(0,x)+E+A+E+t.slice($),F=x+E.length+A.length+E.length),a==null||a(O),requestAnimationFrame(()=>{R.focus(),R.setSelectionRange(F,F)})},[t,a]),I=s.useCallback(E=>{if((E.ctrlKey||E.metaKey)&&(E.key==="b"?(E.preventDefault(),P("**")):E.key==="i"?(E.preventDefault(),P("*")):E.key==="k"&&(E.preventDefault(),P("[](url)"))),E.key==="Tab"){E.preventDefault();const R=E.currentTarget,x=R.selectionStart,$=R.selectionEnd,A=" ";if(E.shiftKey){const O=t.slice(0,x).lastIndexOf(`
|
|
906
|
+
`)+1;if(t.slice(O,O+A.length)===A){const F=t.slice(0,O)+t.slice(O+A.length);a==null||a(F),requestAnimationFrame(()=>{R.selectionStart=R.selectionEnd=x-A.length})}}else{const O=t.slice(0,x)+A+t.slice($);a==null||a(O),requestAnimationFrame(()=>{R.selectionStart=R.selectionEnd=x+A.length})}}},[t,a,P]),D=s.useCallback(async E=>{if(!f)return;const R=Array.from(E.dataTransfer.files).filter(x=>x.type.startsWith("image/"));if(R.length!==0){E.preventDefault();for(const x of R){const $=await f(x),A=_.current;if(!A)continue;const O=A.selectionStart,F=`
|
|
907
|
+
`,L=t.slice(0,O)+F+t.slice(O);a==null||a(L)}}},[t,a,f]),T=r!=="tab"||y==="edit",N=r==="side"||r==="tab"&&y==="preview"||r===!0,H=`nice-md-editor nice-md-editor--${c} nice-editor--${l} nice-md-editor--preview-${r}${k?" nice-md-editor--fullscreen":""} ${m||""}`;return e.jsxs("div",{ref:v,id:w,className:H,style:b,children:[d&&e.jsxs("div",{className:"nice-md-editor__toolbar",children:[Uu.map((E,R)=>e.jsxs(s.Fragment,{children:[R>0&&e.jsx("span",{className:"nice-md-editor__sep"}),Gu.filter(x=>x.group===E).map(x=>e.jsx("button",{type:"button",className:"nice-md-editor__btn",title:x.shortcut?`${x.tip} (${x.shortcut})`:x.tip,disabled:i||o,onClick:()=>P(x.md),children:x.label},x.key))]},E)),e.jsx("span",{className:"nice-md-editor__sep"}),e.jsx("button",{type:"button",className:"nice-md-editor__btn",title:"Fullscreen",onClick:()=>M(!k),children:k?"⊙":"⛶"}),g&&e.jsx("button",{type:"button",className:"nice-md-editor__btn",title:"Export HTML",onClick:()=>g(j),children:"↗"}),r==="tab"&&e.jsxs("span",{className:"nice-md-editor__tabs",children:[e.jsx("button",{type:"button",className:`nice-md-editor__tab${y==="edit"?" nice-md-editor__tab--active":""}`,onClick:()=>S("edit"),children:"Edit"}),e.jsx("button",{type:"button",className:`nice-md-editor__tab${y==="preview"?" nice-md-editor__tab--active":""}`,onClick:()=>S("preview"),children:"Preview"})]})]}),e.jsxs("div",{className:"nice-md-editor__body",style:{minHeight:p},children:[T&&e.jsxs("div",{className:"nice-md-editor__editor-wrap",children:[u&&e.jsx("div",{className:"nice-md-editor__line-numbers",children:Array.from({length:z.lines},(E,R)=>e.jsx("div",{className:"nice-md-editor__line-no",children:R+1},R))}),e.jsx("textarea",{ref:_,className:"nice-md-editor__textarea",value:t,onChange:E=>a==null?void 0:a(E.target.value),onKeyDown:I,onDrop:D,placeholder:n,disabled:i,readOnly:o,style:{minHeight:p}})]}),N&&e.jsx("div",{className:"nice-md-editor__preview",dangerouslySetInnerHTML:{__html:la(j)},style:{minHeight:p}})]}),h&&e.jsxs("div",{className:"nice-md-editor__statusbar",children:[e.jsxs("span",{children:[z.words," words"]}),e.jsxs("span",{children:[z.chars," chars"]}),e.jsxs("span",{children:[z.lines," lines"]})]})]})});hr.displayName="NiceMarkdownEditor";const Gr={rotation:0,flipH:!1,flipV:!1,brightness:100,contrast:100,saturate:100,blur:0,crop:null,annotations:[]},Zu=["crop","rotate","flip","brightness","contrast","saturate","blur","annotate"],fr=s.forwardRef(({src:t,size:a="md",editorSize:r="standard",tools:n=Zu,showToolbar:i=!0,showZoom:o=!0,maxUndo:c=30,onSave:l,onCancel:d,onChange:p,width:h="100%",height:u=500,className:g,style:f,id:m,...b},C)=>{const v=Ae(m),{t:w}=Re(),y=s.useRef(null),S=s.useRef(null),[k,M]=s.useState({...Gr}),[_,j]=s.useState(null),[z,P]=s.useState(!1),[I,D]=s.useState(1),[T,N]=s.useState("rect"),[H,E]=s.useState("#ff0000"),[R,x]=s.useState({w:0,h:0}),[$,A]=s.useState([]),[O,F]=s.useState([]),[L,G]=s.useState(null),[V,B]=s.useState(null),[Y,J]=s.useState(null),me=s.useCallback(U=>{A(Q=>[...Q.slice(-(c-1)),U]),F([])},[c]),de=s.useCallback(U=>{M(Q=>{me(Q);const W={...Q,...U};return p==null||p(W),W})},[p,me]),oe=s.useCallback(()=>{if($.length===0)return;const U=$[$.length-1];A(Q=>Q.slice(0,-1)),F(Q=>[...Q,k]),M(U),p==null||p(U)},[$,k,p]),ae=s.useCallback(()=>{if(O.length===0)return;const U=O[O.length-1];F(Q=>Q.slice(0,-1)),A(Q=>[...Q,k]),M(U),p==null||p(U)},[O,k,p]);s.useEffect(()=>{const U=new Image;U.crossOrigin="anonymous",U.onload=()=>{S.current=U,x({w:U.width,h:U.height}),P(!0)},U.src=t},[t]),s.useEffect(()=>{if(!z||!y.current||!S.current)return;const U=y.current,Q=U.getContext("2d");if(!Q)return;const W=S.current,Z=k.rotation%180!==0,te=Z?W.height:W.width,ee=Z?W.width:W.height;U.width=te,U.height=ee,Q.clearRect(0,0,te,ee),Q.save(),Q.filter=`brightness(${k.brightness}%) contrast(${k.contrast}%) saturate(${k.saturate}%) blur(${k.blur}px)`,Q.translate(te/2,ee/2),Q.rotate(k.rotation*Math.PI/180),Q.scale(k.flipH?-1:1,k.flipV?-1:1),Q.drawImage(W,-W.width/2,-W.height/2),Q.restore(),k.annotations.forEach(ie=>{switch(Q.save(),Q.strokeStyle=ie.color??"red",Q.fillStyle=ie.color??"red",Q.lineWidth=ie.strokeWidth??2,Q.font=`${ie.fontSize??16}px sans-serif`,ie.type){case"text":Q.fillText(ie.text??"",ie.x,ie.y);break;case"rect":Q.strokeRect(ie.x,ie.y,ie.width??100,ie.height??50);break;case"circle":{const ne=(ie.width??50)/2,Ce=(ie.height??50)/2;Q.beginPath(),Q.ellipse(ie.x+ne,ie.y+Ce,ne,Ce,0,0,Math.PI*2),Q.stroke();break}case"line":Q.beginPath(),Q.moveTo(ie.x,ie.y),Q.lineTo(ie.x+(ie.width??100),ie.y+(ie.height??0)),Q.stroke();break;case"arrow":{const ne=ie.x+(ie.width??100),Ce=ie.y+(ie.height??0);Q.beginPath(),Q.moveTo(ie.x,ie.y),Q.lineTo(ne,Ce),Q.stroke();const ue=Math.atan2(Ce-ie.y,ne-ie.x),$e=10;Q.beginPath(),Q.moveTo(ne,Ce),Q.lineTo(ne-$e*Math.cos(ue-.4),Ce-$e*Math.sin(ue-.4)),Q.lineTo(ne-$e*Math.cos(ue+.4),Ce-$e*Math.sin(ue+.4)),Q.closePath(),Q.fill();break}}Q.restore()}),V&&(Q.save(),Q.fillStyle="rgba(0,0,0,0.5)",Q.fillRect(0,0,te,ee),Q.clearRect(V.x,V.y,V.w,V.h),Q.strokeStyle="#fff",Q.lineWidth=2,Q.setLineDash([5,5]),Q.strokeRect(V.x,V.y,V.w,V.h),Q.restore())},[z,k,V]);const ve=s.useCallback(U=>{if(!y.current)return;const Q=y.current.getBoundingClientRect(),W=y.current.width/Q.width,Z=y.current.height/Q.height,te=(U.clientX-Q.left)*W,ee=(U.clientY-Q.top)*Z;_==="crop"?G({startX:te,startY:ee}):_==="annotate"&&J({startX:te,startY:ee})},[_]),re=s.useCallback(U=>{if(!y.current)return;const Q=y.current.getBoundingClientRect(),W=y.current.width/Q.width,Z=y.current.height/Q.height,te=(U.clientX-Q.left)*W,ee=(U.clientY-Q.top)*Z;L&&B({x:Math.min(L.startX,te),y:Math.min(L.startY,ee),w:Math.abs(te-L.startX),h:Math.abs(ee-L.startY)})},[L]),he=s.useCallback(U=>{if(L&&V&&V.w>5&&V.h>5&&de({crop:{x:V.x,y:V.y,width:V.w,height:V.h}}),G(null),Y&&y.current){const Q=y.current.getBoundingClientRect(),W=y.current.width/Q.width,Z=y.current.height/Q.height,te=(U.clientX-Q.left)*W,ee=(U.clientY-Q.top)*Z,ie=te-Y.startX,ne=ee-Y.startY;if(Math.abs(ie)>3||Math.abs(ne)>3||T==="text"){const Ce={type:T,x:Y.startX,y:Y.startY,width:Math.abs(ie)||100,height:Math.abs(ne)||50,color:H,strokeWidth:2,text:T==="text"?prompt(w("imageEditor.annotationText","Text:"))??"":void 0};de({annotations:[...k.annotations,Ce]})}J(null)}},[L,V,Y,T,H,k.annotations,de,w]),we=s.useCallback(()=>{if(!k.crop||!y.current)return;const U=y.current,Q=U.getContext("2d");if(!Q)return;const{x:W,y:Z,width:te,height:ee}=k.crop,ie=Q.getImageData(W,Z,te,ee);U.width=te,U.height=ee,Q.putImageData(ie,0,0),B(null),j(null)},[k.crop]),le=s.useCallback(()=>{if(!y.current)return;const U=y.current.toDataURL("image/png");l==null||l(U,k)},[l,k]),ke=s.useCallback(()=>{M({...Gr}),B(null),j(null)},[]);return s.useMemo(()=>`brightness(${k.brightness}%) contrast(${k.contrast}%) saturate(${k.saturate}%) blur(${k.blur}px)`,[k.brightness,k.contrast,k.saturate,k.blur]),e.jsxs("div",{ref:C,id:v,className:`nice-image-editor nice-image-editor--${a} nice-editor--${r} ${g??""}`,style:{...f,width:h,height:u},role:"application","aria-label":w("imageEditor.label","Image Editor"),...b,children:[i&&e.jsxs("div",{className:"nice-image-editor__toolbar",role:"toolbar",children:[e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:oe,disabled:$.length===0,title:w("imageEditor.undo","Undo"),children:"↶"}),e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:ae,disabled:O.length===0,title:w("imageEditor.redo","Redo"),children:"↷"}),e.jsx("span",{className:"nice-image-editor__sep"}),n.includes("rotate")&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>de({rotation:(k.rotation-90+360)%360}),title:w("imageEditor.rotateLeft","Rotate left"),children:"↺"}),e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>de({rotation:(k.rotation+90)%360}),title:w("imageEditor.rotateRight","Rotate right"),children:"↻"})]}),n.includes("flip")&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>de({flipH:!k.flipH}),title:w("imageEditor.flipH","Flip horizontal"),children:"⇔"}),e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>de({flipV:!k.flipV}),title:w("imageEditor.flipV","Flip vertical"),children:"⇕"})]}),n.includes("crop")&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:`nice-image-editor__btn ${_==="crop"?"nice-image-editor__btn--active":""}`,onClick:()=>j(_==="crop"?null:"crop"),title:w("imageEditor.crop","Crop"),children:"⊡"}),_==="crop"&&k.crop&&e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:we,title:w("imageEditor.applyCrop","Apply crop"),children:"✓"})]}),n.includes("brightness")&&e.jsxs("label",{className:"nice-image-editor__slider-label",children:[w("imageEditor.brightness","☀"),e.jsx("input",{type:"range",min:0,max:200,value:k.brightness,onChange:U=>de({brightness:Number(U.target.value)}),className:"nice-image-editor__slider",title:w("imageEditor.brightness","Brightness")})]}),n.includes("contrast")&&e.jsxs("label",{className:"nice-image-editor__slider-label",children:[w("imageEditor.contrast","◑"),e.jsx("input",{type:"range",min:0,max:200,value:k.contrast,onChange:U=>de({contrast:Number(U.target.value)}),className:"nice-image-editor__slider",title:w("imageEditor.contrast","Contrast")})]}),n.includes("saturate")&&e.jsxs("label",{className:"nice-image-editor__slider-label",children:[w("imageEditor.saturate","🎨"),e.jsx("input",{type:"range",min:0,max:200,value:k.saturate,onChange:U=>de({saturate:Number(U.target.value)}),className:"nice-image-editor__slider",title:w("imageEditor.saturate","Saturation")})]}),n.includes("blur")&&e.jsxs("label",{className:"nice-image-editor__slider-label",children:[w("imageEditor.blur","⊘"),e.jsx("input",{type:"range",min:0,max:20,step:.5,value:k.blur,onChange:U=>de({blur:Number(U.target.value)}),className:"nice-image-editor__slider",title:w("imageEditor.blur","Blur")})]}),n.includes("annotate")&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"nice-image-editor__sep"}),e.jsx("button",{type:"button",className:`nice-image-editor__btn ${_==="annotate"?"nice-image-editor__btn--active":""}`,onClick:()=>j(_==="annotate"?null:"annotate"),title:w("imageEditor.annotate","Annotate"),children:"✎"}),_==="annotate"&&e.jsxs(e.Fragment,{children:[e.jsxs("select",{className:"nice-image-editor__select",value:T,onChange:U=>N(U.target.value),children:[e.jsx("option",{value:"rect",children:"□ Rect"}),e.jsx("option",{value:"circle",children:"○ Circle"}),e.jsx("option",{value:"line",children:"╱ Line"}),e.jsx("option",{value:"arrow",children:"→ Arrow"}),e.jsx("option",{value:"text",children:"T Text"})]}),e.jsx("input",{type:"color",value:H,onChange:U=>E(U.target.value),className:"nice-image-editor__color",title:w("imageEditor.color","Color")}),k.annotations.length>0&&e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>de({annotations:k.annotations.slice(0,-1)}),title:w("imageEditor.removeLastAnnotation","Remove last"),children:"⌫"})]})]}),e.jsx("span",{className:"nice-image-editor__sep"}),e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:ke,title:w("imageEditor.reset","Reset"),children:"⟲"}),l&&e.jsx("button",{type:"button",className:"nice-image-editor__btn nice-image-editor__btn--save",onClick:le,children:w("imageEditor.save","Save")}),d&&e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:d,children:w("imageEditor.cancel","Cancel")})]}),e.jsx("div",{className:"nice-image-editor__canvas-wrap",children:e.jsx("canvas",{ref:y,className:"nice-image-editor__canvas",onMouseDown:ve,onMouseMove:re,onMouseUp:he,style:{cursor:_==="crop"||_==="annotate"?"crosshair":"default",transform:`scale(${I})`,transformOrigin:"center center"}})}),o&&e.jsxs("div",{className:"nice-image-editor__footer",children:[e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>D(U=>Math.max(.1,U-.1)),title:"Zoom out",children:"−"}),e.jsxs("span",{style:{fontSize:"0.85em",minWidth:40,textAlign:"center"},children:[Math.round(I*100),"%"]}),e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>D(U=>Math.min(5,U+.1)),title:"Zoom in",children:"+"}),e.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>D(1),title:"Reset zoom",children:"1:1"}),e.jsx("span",{style:{flex:1}}),e.jsxs("span",{style:{fontSize:"0.8em",color:"var(--nice-text-secondary, #666)"},children:[R.w,"×",R.h,"px · ",k.rotation,"°"]})]})]})});fr.displayName="NiceImageEditor";const gr=s.forwardRef(({value:t,onChange:a,penColor:r="#000",penWidth:n=2,backgroundColor:i="#fff",width:o=400,height:c=200,size:l="md",disabled:d=!1,readOnly:p=!1,showClear:h=!0,showUndo:u=!0,label:g,exportFormat:f="image/png",className:m,style:b,id:C,...v},w)=>{const y=Ae(C),{t:S}=Re(),k=s.useRef(null),[M,_]=s.useState(!1),j=s.useRef([]),z=s.useRef([]),[P,I]=s.useState(!0),D=s.useCallback(()=>{const $=k.current;if(!$)return;const A=$.getContext("2d");if(A){A.fillStyle=i,A.fillRect(0,0,$.width,$.height),A.strokeStyle=r,A.lineWidth=n,A.lineCap="round",A.lineJoin="round";for(const O of j.current)if(!(O.length<2)){A.beginPath(),A.moveTo(O[0].x,O[0].y);for(let F=1;F<O.length;F++)A.lineTo(O[F].x,O[F].y);A.stroke()}}},[i,r,n]);s.useEffect(()=>{if(t&&k.current){const $=new Image;$.onload=()=>{var O;const A=(O=k.current)==null?void 0:O.getContext("2d");!A||!k.current||(A.fillStyle=i,A.fillRect(0,0,k.current.width,k.current.height),A.drawImage($,0,0),I(!1))},$.src=t}else t||(j.current=[],I(!0),D())},[t,i,D]),s.useEffect(()=>{const $=k.current;$&&($.width=o,$.height=c,D())},[o,c,D]);const T=s.useCallback($=>{const A=k.current,O=A.getBoundingClientRect(),F=A.width/O.width,L=A.height/O.height;if("touches"in $){const G=$.touches[0];return{x:(G.clientX-O.left)*F,y:(G.clientY-O.top)*L}}return{x:($.clientX-O.left)*F,y:($.clientY-O.top)*L}},[]),N=s.useCallback($=>{if(d||p)return;$.preventDefault();const A=T($);z.current=[A],_(!0)},[d,p,T]),H=s.useCallback($=>{if(!M)return;$.preventDefault();const A=T($);z.current.push(A);const O=k.current,F=O==null?void 0:O.getContext("2d");if(!F||!O)return;const L=z.current;L.length>=2&&(F.strokeStyle=r,F.lineWidth=n,F.lineCap="round",F.beginPath(),F.moveTo(L[L.length-2].x,L[L.length-2].y),F.lineTo(A.x,A.y),F.stroke())},[M,T,r,n]),E=s.useCallback(()=>{if(M&&(_(!1),z.current.length>0&&(j.current.push([...z.current]),z.current=[],I(!1),k.current))){const $=k.current.toDataURL(f);a==null||a($)}},[M,f,a]),R=s.useCallback(()=>{j.current=[],z.current=[],I(!0),D(),a==null||a(null)},[D,a]),x=s.useCallback(()=>{if(j.current.length!==0&&(j.current.pop(),I(j.current.length===0),D(),k.current)){const $=j.current.length>0?k.current.toDataURL(f):null;a==null||a($)}},[D,f,a]);return e.jsxs("div",{ref:w,id:y,className:`nice-signature nice-signature--${l} ${d?"nice-signature--disabled":""} ${p?"nice-signature--readonly":""} ${m??""}`,style:b,...v,children:[g&&e.jsx("label",{className:"nice-signature__label",children:g}),e.jsx("div",{className:"nice-signature__canvas-wrap",style:{width:o,height:c},children:e.jsx("canvas",{ref:k,className:"nice-signature__canvas",onMouseDown:N,onMouseMove:H,onMouseUp:E,onMouseLeave:E,onTouchStart:N,onTouchMove:H,onTouchEnd:E,style:{touchAction:"none",cursor:d||p?"default":"crosshair"},"aria-label":g??S("signature.label","Signature pad"),role:"img"})}),(h||u)&&!p&&!d&&e.jsxs("div",{className:"nice-signature__actions",children:[u&&e.jsx("button",{type:"button",className:"nice-signature__btn",onClick:x,disabled:P,children:S("signature.undo","Undo")}),h&&e.jsx("button",{type:"button",className:"nice-signature__btn",onClick:R,disabled:P,children:S("signature.clear","Clear")})]})]})});gr.displayName="NiceSignaturePad";const ci=s.createContext(null),di=()=>{const t=s.useContext(ci);if(!t)throw new Error("useUploadContext must be used within NiceFileUpload");return t},Xu=()=>`file-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,Wt=t=>{if(t===0)return"0 B";const a=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(t)/Math.log(a));return parseFloat((t/Math.pow(a,n)).toFixed(2))+" "+r[n]},ui=t=>t.startsWith("image/")?"🖼️":t.startsWith("video/")?"🎬":t.startsWith("audio/")?"🎵":t.includes("pdf")?"📄":t.includes("word")||t.includes("document")?"📝":t.includes("excel")||t.includes("spreadsheet")?"📊":t.includes("powerpoint")||t.includes("presentation")?"📽️":t.includes("zip")||t.includes("rar")||t.includes("7z")?"📦":t.includes("text/")||t.includes("json")||t.includes("xml")?"📃":"📁",pi=t=>t.startsWith("image/"),mi=t=>t.startsWith("video/"),Ju=t=>t.startsWith("audio/"),Qu=t=>{if(pi(t.type)||mi(t.type)||Ju(t.type))return URL.createObjectURL(t)},ep=(t,a)=>async r=>{const n=new FormData;r.chunk?(n.append("chunk",r.chunk),n.append("chunkIndex",String(r.chunkIndex)),n.append("totalChunks",String(r.totalChunks)),n.append("fileName",r.file.name),n.append("fileId",r.fileId||"")):n.append("file",r.file);const i=new XMLHttpRequest;return new Promise((o,c)=>{i.upload.addEventListener("progress",l=>{l.lengthComputable&&r.onProgress&&r.onProgress(l.loaded/l.total*100)}),i.addEventListener("load",()=>{if(i.status>=200&&i.status<300)try{const l=JSON.parse(i.responseText);o({success:!0,url:l.url,fileId:l.fileId||l.id,metadata:l})}catch{o({success:!0,url:i.responseText})}else o({success:!1,error:`Upload failed: ${i.status} ${i.statusText}`})}),i.addEventListener("error",()=>{o({success:!1,error:"Network error"})}),i.addEventListener("abort",()=>{o({success:!1,error:"Upload cancelled"})}),r.signal&&r.signal.addEventListener("abort",()=>i.abort()),i.open("POST",t),a&&Object.entries(a).forEach(([l,d])=>{i.setRequestHeader(l,d)}),i.send(n)})},ja=({progress:t,status:a})=>{const r=()=>{switch(a){case"success":return"#22c55e";case"error":return"#ef4444";case"cancelled":return"#6b7280";default:return"#3b82f6"}};return e.jsxs("div",{className:"nice-upload-progress",children:[e.jsx("div",{className:"nice-upload-progress-bar",style:{width:`${t}%`,backgroundColor:r()}}),e.jsxs("span",{className:"nice-upload-progress-text",children:[Math.round(t),"%"]})]})},Ur=({file:t,size:a="md",customRender:r})=>{if(r)return e.jsx(e.Fragment,{children:r(t)});const n={xxs:24,xs:32,sm:48,md:80,lg:120,xl:160,xxl:200}[a]??80;return t.previewUrl&&pi(t.type)?e.jsx("div",{className:"nice-upload-preview",style:{width:n,height:n},children:e.jsx("img",{src:t.previewUrl,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:4}})}):t.previewUrl&&mi(t.type)?e.jsxs("div",{className:"nice-upload-preview",style:{width:n,height:n},children:[e.jsx("video",{src:t.previewUrl,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:4},muted:!0}),e.jsx("span",{className:"nice-upload-preview-overlay",children:"▶️"})]}):e.jsx("div",{className:"nice-upload-preview nice-upload-preview-icon",style:{width:n,height:n,fontSize:n*.5},children:ui(t.type)})},tp=({file:t,actions:a,showPreview:r=!0,previewSize:n="md",customRenderPreview:i,customRender:o,mode:c="list"})=>{const{disabled:l,readOnly:d}=di();if(o)return e.jsx(e.Fragment,{children:o(t,a)});const p=()=>{switch(t.status){case"pending":return e.jsx("span",{className:"nice-upload-badge pending",children:"Oczekuje"});case"uploading":return e.jsx("span",{className:"nice-upload-badge uploading",children:"Wysyłanie..."});case"success":return e.jsx("span",{className:"nice-upload-badge success",children:"✓ Przesłano"});case"error":return e.jsx("span",{className:"nice-upload-badge error",children:"✗ Błąd"});case"cancelled":return e.jsx("span",{className:"nice-upload-badge cancelled",children:"Anulowano"})}};return c==="compact"?e.jsxs("div",{className:`nice-upload-item compact ${t.status}`,children:[e.jsx("span",{className:"nice-upload-item-icon",children:ui(t.type)}),e.jsx("span",{className:"nice-upload-item-name",title:t.name,children:t.name}),e.jsx("span",{className:"nice-upload-item-size",children:Wt(t.size)}),t.status==="uploading"&&e.jsx(ja,{progress:t.progress,status:t.status}),p(),!d&&!l&&t.status!=="uploading"&&e.jsx("button",{className:"nice-upload-item-remove",onClick:a.remove,title:"Usuń",children:"✕"})]}):c==="grid"?e.jsxs("div",{className:`nice-upload-item grid ${t.status}`,children:[r&&e.jsx(Ur,{file:t,size:"lg",customRender:i}),e.jsxs("div",{className:"nice-upload-item-info",children:[e.jsx("span",{className:"nice-upload-item-name",title:t.name,children:t.name}),e.jsx("span",{className:"nice-upload-item-size",children:Wt(t.size)})]}),t.status==="uploading"&&e.jsx(ja,{progress:t.progress,status:t.status}),p(),t.error&&e.jsx("span",{className:"nice-upload-item-error",children:t.error}),!d&&!l&&e.jsxs("div",{className:"nice-upload-item-actions",children:[t.status==="pending"&&e.jsx("button",{onClick:a.upload,className:"nice-upload-btn upload",children:"Wyślij"}),t.status==="uploading"&&e.jsx("button",{onClick:a.cancel,className:"nice-upload-btn cancel",children:"Anuluj"}),t.status==="error"&&e.jsx("button",{onClick:a.retry,className:"nice-upload-btn retry",children:"Ponów"}),t.status!=="uploading"&&e.jsx("button",{onClick:a.remove,className:"nice-upload-btn remove",children:"Usuń"})]})]}):e.jsxs("div",{className:`nice-upload-item list ${t.status}`,children:[r&&e.jsx(Ur,{file:t,size:n,customRender:i}),e.jsxs("div",{className:"nice-upload-item-content",children:[e.jsxs("div",{className:"nice-upload-item-header",children:[e.jsx("span",{className:"nice-upload-item-name",title:t.name,children:t.name}),p()]}),e.jsx("span",{className:"nice-upload-item-size",children:Wt(t.size)}),t.status==="uploading"&&e.jsx(ja,{progress:t.progress,status:t.status}),t.error&&e.jsx("span",{className:"nice-upload-item-error",children:t.error}),t.uploadedUrl&&e.jsx("a",{href:t.uploadedUrl,target:"_blank",rel:"noopener noreferrer",className:"nice-upload-item-link",children:"Otwórz plik"})]}),!d&&!l&&e.jsxs("div",{className:"nice-upload-item-actions",children:[t.status==="pending"&&e.jsx("button",{onClick:a.upload,className:"nice-upload-btn upload",title:"Wyślij",children:"⬆️"}),t.status==="uploading"&&e.jsx("button",{onClick:a.cancel,className:"nice-upload-btn cancel",title:"Anuluj",children:"⏹️"}),t.status==="error"&&e.jsx("button",{onClick:a.retry,className:"nice-upload-btn retry",title:"Ponów",children:"🔄"}),t.status!=="uploading"&&e.jsx("button",{onClick:a.remove,className:"nice-upload-btn remove",title:"Usuń",children:"🗑️"})]})]})},ap=({files:t,mode:a="list",showPreview:r=!0,previewSize:n,renderPreview:i,renderFileItem:o})=>{const c=di();return t.length===0?null:e.jsx("div",{className:`nice-upload-list ${a}`,children:t.map(l=>e.jsx(tp,{file:l,actions:{upload:()=>c.uploadFile(l.id),cancel:()=>c.cancelFile(l.id),retry:()=>c.retryFile(l.id),remove:()=>c.removeFile(l.id)},mode:a,showPreview:r,previewSize:n,customRenderPreview:i,customRender:o},l.id))})},rp=({onFiles:t,accept:a,multiple:r=!0,disabled:n,readOnly:i,dropzoneText:o="Przeciągnij pliki tutaj lub",browseText:c="wybierz z dysku",dragActiveText:l="Upuść pliki tutaj",className:d,inputRef:p})=>{const[h,u]=s.useState(!1),g=s.useRef(0),f=s.useCallback(y=>{y.preventDefault(),y.stopPropagation(),g.current++,y.dataTransfer.items&&y.dataTransfer.items.length>0&&u(!0)},[]),m=s.useCallback(y=>{y.preventDefault(),y.stopPropagation(),g.current--,g.current===0&&u(!1)},[]),b=s.useCallback(y=>{y.preventDefault(),y.stopPropagation()},[]),C=s.useCallback(y=>{if(y.preventDefault(),y.stopPropagation(),u(!1),g.current=0,n||i)return;const S=Array.from(y.dataTransfer.files);S.length>0&&t(r?S:[S[0]])},[n,i,r,t]),v=s.useCallback(()=>{!n&&!i&&p.current&&p.current.click()},[n,i,p]),w=s.useCallback(y=>{const S=y.target.files?Array.from(y.target.files):[];S.length>0&&t(S),p.current&&(p.current.value="")},[t,p]);return e.jsxs("div",{className:`nice-upload-dropzone ${h?"drag-active":""} ${n?"disabled":""} ${i?"readonly":""} ${d||""}`,onDragEnter:f,onDragLeave:m,onDragOver:b,onDrop:C,onClick:v,children:[e.jsx("input",{ref:p,type:"file",accept:a,multiple:r,onChange:w,style:{display:"none"},disabled:n||i}),e.jsxs("div",{className:"nice-upload-dropzone-content",children:[e.jsx("span",{className:"nice-upload-dropzone-icon",children:"📁"}),h?e.jsx("span",{className:"nice-upload-dropzone-text active",children:l}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"nice-upload-dropzone-text",children:o}),e.jsx("button",{type:"button",className:"nice-upload-browse-btn",disabled:n||i,children:c})]})]})]})},hi=s.forwardRef((t,a)=>{const{accept:r,multiple:n=!0,maxFileSize:i,maxFiles:o,minFileSize:c,chunkSize:l=5*1024*1024,chunkThreshold:d=10*1024*1024,autoUpload:p=!1,uploadHandler:h,uploadUrl:u,uploadHeaders:g,onFilesAdded:f,onUploadComplete:m,onUploadError:b,onProgress:C,onFileRemoved:v,onChange:w,renderPreview:y,renderFileItem:S,showPreview:k=!0,showFileList:M=!0,listMode:_="list",previewSize:j="md",dropzoneText:z,browseText:P,dragActiveText:I,disabled:D,readOnly:T,dropzoneClassName:N,maxRetries:H=3,concurrentUploads:E=3,validateFile:R,keepFilesAfterUpload:x=!0,initialFiles:$=[],className:A,style:O,...F}=t,[L,G]=s.useState($),V=s.useRef(null),B=s.useRef(new Map),Y=s.useRef([]),J=s.useRef(new Set);s.useEffect(()=>()=>{L.forEach(ne=>{ne.previewUrl&&URL.revokeObjectURL(ne.previewUrl)})},[]),s.useEffect(()=>{w==null||w(L)},[L,w]);const me=s.useCallback(()=>h||(u?ep(u,g):null),[h,u,g]),de=s.useCallback(ne=>{var Ce;if(R){const ue=R(ne);if(ue)return ue}if(i&&ne.size>i)return`Plik jest za duży. Maksymalny rozmiar: ${Wt(i)}`;if(c&&ne.size<c)return`Plik jest za mały. Minimalny rozmiar: ${Wt(c)}`;if(r){const ue=r.split(",").map(Te=>Te.trim().toLowerCase()),$e=ne.type.toLowerCase(),ze="."+((Ce=ne.name.split(".").pop())==null?void 0:Ce.toLowerCase());if(!ue.some(Te=>Te.startsWith(".")?ze===Te:Te.endsWith("/*")?$e.startsWith(Te.replace("/*","/")):$e===Te))return`Niedozwolony typ pliku. Akceptowane typy: ${r}`}return null},[R,i,c,r]),oe=s.useCallback(ne=>{if(D||T)return;const Ce=L.length;let ue=ne;o&&Ce+ue.length>o&&(ue=ue.slice(0,o-Ce));const $e=ue.map(ze=>{const Te=de(ze);return{id:Xu(),file:ze,name:ze.name,size:ze.size,type:ze.type,status:Te?"error":"pending",progress:0,error:Te||void 0,previewUrl:Qu(ze)}});G(ze=>[...ze,...$e]),f==null||f($e),p&&($e.filter(ze=>ze.status==="pending").forEach(ze=>{Y.current.push(ze.id)}),ae())},[D,T,L.length,o,de,p,f]),ae=s.useCallback(()=>{const ne=me();if(ne)for(;Y.current.length>0&&J.current.size<E;){const Ce=Y.current.shift();Ce&&ve(Ce,ne)}},[E,me]),ve=s.useCallback(async(ne,Ce)=>{const ue=L.find(ze=>ze.id===ne);if(!ue||ue.status==="uploading"||ue.status==="success")return;const $e=new AbortController;B.current.set(ne,$e),J.current.add(ne),G(ze=>ze.map(Te=>Te.id===ne?{...Te,status:"uploading",progress:0,error:void 0}:Te));try{const ze=ue.file;let Te;if(ze.size>d?Te=await re(ue,Ce,$e.signal):Te=await Ce({file:ze,onProgress:Ve=>{G(De=>De.map(at=>at.id===ne?{...at,progress:Ve}:at)),C==null||C(ue,Ve)},signal:$e.signal}),Te.success)G(Ve=>Ve.map(De=>De.id===ne?{...De,status:"success",progress:100,uploadedUrl:Te.url,uploadedAt:new Date}:De)),m==null||m({...ue,status:"success",uploadedUrl:Te.url});else throw new Error(Te.error||"Upload failed")}catch(ze){if(ze.name==="AbortError"||ze.message==="Upload cancelled")G(Te=>Te.map(Ve=>Ve.id===ne?{...Ve,status:"cancelled",error:"Anulowano"}:Ve));else{const Te=ze.message||"Błąd uploadu";G(Ve=>Ve.map(De=>De.id===ne?{...De,status:"error",error:Te}:De)),b==null||b(ue,Te)}}finally{B.current.delete(ne),J.current.delete(ne),ae()}},[L,d,C,m,b,ae]),re=async(ne,Ce,ue)=>{const $e=ne.file,ze=Math.ceil($e.size/l);let Te=0,Ve={success:!1};for(let De=0;De<ze;De++){if(ue.aborted)throw new Error("Upload cancelled");const at=De*l,Ct=Math.min(at+l,$e.size),yt=$e.slice(at,Ct);let q=0,ce=!1;for(;!ce&&q<H;)try{Ve=await Ce({file:$e,chunk:yt,chunkIndex:De,totalChunks:ze,fileId:ne.id,onProgress:ge=>{const ye=(Te+yt.size*ge/100)/$e.size*100;G(je=>je.map(fe=>fe.id===ne.id?{...fe,progress:ye}:fe))},signal:ue}),Ve.success?(ce=!0,Te+=yt.size):q++}catch(ge){if(q++,q>=H)throw ge}if(!ce)throw new Error(`Failed to upload chunk ${De+1}/${ze}`)}return Ve},he=s.useCallback(ne=>{const Ce=me();if(!Ce){console.error("No upload handler configured");return}ve(ne,Ce)},[me,ve]),we=s.useCallback(ne=>{const Ce=B.current.get(ne);Ce&&Ce.abort(),G(ue=>ue.map($e=>$e.id===ne&&$e.status==="uploading"?{...$e,status:"cancelled",error:"Anulowano"}:$e))},[]),le=s.useCallback(ne=>{G(Ce=>Ce.map(ue=>ue.id===ne?{...ue,status:"pending",progress:0,error:void 0}:ue)),he(ne)},[he]),ke=s.useCallback(ne=>{const Ce=L.find(ue=>ue.id===ne);if(Ce){const ue=B.current.get(ne);ue&&ue.abort(),Ce.previewUrl&&URL.revokeObjectURL(Ce.previewUrl),G($e=>$e.filter(ze=>ze.id!==ne)),v==null||v(Ce)}},[L,v]),U=s.useCallback(()=>{L.filter(ne=>ne.status==="pending").forEach(ne=>{Y.current.push(ne.id)}),ae()},[L,ae]),Q=s.useCallback(()=>{B.current.forEach(ne=>ne.abort()),G(ne=>ne.map(Ce=>Ce.status==="uploading"?{...Ce,status:"cancelled",error:"Anulowano"}:Ce))},[]),W=s.useCallback(()=>{Q(),L.forEach(ne=>{ne.previewUrl&&URL.revokeObjectURL(ne.previewUrl)}),G([])},[Q,L]),Z=s.useCallback(()=>{L.filter(ne=>ne.status==="error").forEach(ne=>le(ne.id))},[L,le]),te=s.useCallback(()=>{var ne;(ne=V.current)==null||ne.click()},[]);s.useImperativeHandle(a,()=>({addFiles:oe,uploadAll:U,cancelAll:Q,clearAll:W,getFiles:()=>L,getFile:ne=>L.find(Ce=>Ce.id===ne),retryFailed:Z,openFileBrowser:te}),[oe,U,Q,W,L,Z,te]);const ee=s.useMemo(()=>({files:L,uploadFile:he,cancelFile:we,retryFile:le,removeFile:ke,disabled:D,readOnly:T}),[L,he,we,le,ke,D,T]),ie=s.useMemo(()=>({total:L.length,pending:L.filter(ne=>ne.status==="pending").length,uploading:L.filter(ne=>ne.status==="uploading").length,success:L.filter(ne=>ne.status==="success").length,error:L.filter(ne=>ne.status==="error").length}),[L]);return e.jsx(ci.Provider,{value:ee,children:e.jsxs("div",{className:`nice-file-upload ${D?"disabled":""} ${T?"readonly":""} ${A||""}`,style:O,...F,children:[!T&&e.jsx(rp,{onFiles:oe,accept:r,multiple:n,disabled:D,readOnly:T,dropzoneText:z,browseText:P,dragActiveText:I,className:N,inputRef:V}),M&&L.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-upload-stats",children:[e.jsxs("span",{children:[ie.total," ",ie.total===1?"plik":"plików"]}),ie.pending>0&&e.jsxs("span",{className:"pending",children:[ie.pending," oczekuje"]}),ie.uploading>0&&e.jsxs("span",{className:"uploading",children:[ie.uploading," wysyłanie"]}),ie.success>0&&e.jsxs("span",{className:"success",children:[ie.success," przesłano"]}),ie.error>0&&e.jsxs("span",{className:"error",children:[ie.error," błędów"]})]}),!T&&!D&&ie.pending>0&&e.jsxs("div",{className:"nice-upload-actions",children:[e.jsxs("button",{onClick:U,className:"nice-upload-btn primary",children:["Wyślij wszystkie (",ie.pending,")"]}),ie.error>0&&e.jsxs("button",{onClick:Z,className:"nice-upload-btn secondary",children:["Ponów nieudane (",ie.error,")"]}),e.jsx("button",{onClick:W,className:"nice-upload-btn danger",children:"Wyczyść"})]}),e.jsx(ap,{files:L,mode:_,showPreview:k,previewSize:j,renderPreview:y,renderFileItem:S})]}),e.jsx("style",{children:`
|
|
908
|
+
.nice-file-upload {
|
|
909
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.nice-file-upload.disabled {
|
|
913
|
+
opacity: 0.5;
|
|
914
|
+
pointer-events: none;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.nice-upload-dropzone {
|
|
918
|
+
border: 2px dashed #d1d5db;
|
|
919
|
+
border-radius: 12px;
|
|
920
|
+
padding: 40px 24px;
|
|
921
|
+
text-align: center;
|
|
922
|
+
cursor: pointer;
|
|
923
|
+
transition: all 0.2s ease;
|
|
924
|
+
background: #fafafa;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
.nice-upload-dropzone:hover:not(.disabled):not(.readonly) {
|
|
928
|
+
border-color: #3b82f6;
|
|
929
|
+
background: #eff6ff;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
.nice-upload-dropzone.drag-active {
|
|
933
|
+
border-color: #3b82f6;
|
|
934
|
+
background: #dbeafe;
|
|
935
|
+
transform: scale(1.01);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
.nice-upload-dropzone.disabled,
|
|
939
|
+
.nice-upload-dropzone.readonly {
|
|
940
|
+
cursor: default;
|
|
941
|
+
background: #f3f4f6;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
.nice-upload-dropzone-content {
|
|
945
|
+
display: flex;
|
|
946
|
+
flex-direction: column;
|
|
947
|
+
align-items: center;
|
|
948
|
+
gap: 12px;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.nice-upload-dropzone-icon {
|
|
952
|
+
font-size: 48px;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
.nice-upload-dropzone-text {
|
|
956
|
+
font-size: 14px;
|
|
957
|
+
color: #6b7280;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
.nice-upload-dropzone-text.active {
|
|
961
|
+
font-size: 16px;
|
|
962
|
+
color: #3b82f6;
|
|
963
|
+
font-weight: 500;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
.nice-upload-browse-btn {
|
|
967
|
+
background: #3b82f6;
|
|
968
|
+
color: white;
|
|
969
|
+
border: none;
|
|
970
|
+
padding: 8px 20px;
|
|
971
|
+
border-radius: 6px;
|
|
972
|
+
font-size: 14px;
|
|
973
|
+
cursor: pointer;
|
|
974
|
+
transition: background 0.2s;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
.nice-upload-browse-btn:hover:not(:disabled) {
|
|
978
|
+
background: #2563eb;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.nice-upload-browse-btn:disabled {
|
|
982
|
+
background: #9ca3af;
|
|
983
|
+
cursor: not-allowed;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
.nice-upload-stats {
|
|
987
|
+
display: flex;
|
|
988
|
+
gap: 16px;
|
|
989
|
+
padding: 12px 0;
|
|
990
|
+
font-size: 13px;
|
|
991
|
+
color: #6b7280;
|
|
992
|
+
border-bottom: 1px solid #e5e7eb;
|
|
993
|
+
margin-top: 16px;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
.nice-upload-stats .pending { color: #f59e0b; }
|
|
997
|
+
.nice-upload-stats .uploading { color: #3b82f6; }
|
|
998
|
+
.nice-upload-stats .success { color: #22c55e; }
|
|
999
|
+
.nice-upload-stats .error { color: #ef4444; }
|
|
1000
|
+
|
|
1001
|
+
.nice-upload-actions {
|
|
1002
|
+
display: flex;
|
|
1003
|
+
gap: 8px;
|
|
1004
|
+
padding: 12px 0;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
.nice-upload-btn {
|
|
1008
|
+
padding: 6px 14px;
|
|
1009
|
+
border-radius: 6px;
|
|
1010
|
+
font-size: 13px;
|
|
1011
|
+
cursor: pointer;
|
|
1012
|
+
border: 1px solid transparent;
|
|
1013
|
+
transition: all 0.2s;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
.nice-upload-btn.primary {
|
|
1017
|
+
background: #3b82f6;
|
|
1018
|
+
color: white;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.nice-upload-btn.primary:hover {
|
|
1022
|
+
background: #2563eb;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
.nice-upload-btn.secondary {
|
|
1026
|
+
background: white;
|
|
1027
|
+
border-color: #d1d5db;
|
|
1028
|
+
color: #374151;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
.nice-upload-btn.secondary:hover {
|
|
1032
|
+
background: #f3f4f6;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
.nice-upload-btn.danger {
|
|
1036
|
+
background: white;
|
|
1037
|
+
border-color: #fca5a5;
|
|
1038
|
+
color: #dc2626;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
.nice-upload-btn.danger:hover {
|
|
1042
|
+
background: #fef2f2;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.nice-upload-btn.upload { background: #22c55e; color: white; border: none; }
|
|
1046
|
+
.nice-upload-btn.cancel { background: #f59e0b; color: white; border: none; }
|
|
1047
|
+
.nice-upload-btn.retry { background: #3b82f6; color: white; border: none; }
|
|
1048
|
+
.nice-upload-btn.remove { background: #ef4444; color: white; border: none; }
|
|
1049
|
+
|
|
1050
|
+
.nice-upload-list {
|
|
1051
|
+
margin-top: 12px;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
.nice-upload-list.grid {
|
|
1055
|
+
display: grid;
|
|
1056
|
+
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
|
1057
|
+
gap: 16px;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
.nice-upload-item {
|
|
1061
|
+
display: flex;
|
|
1062
|
+
align-items: center;
|
|
1063
|
+
gap: 12px;
|
|
1064
|
+
padding: 12px;
|
|
1065
|
+
background: #f9fafb;
|
|
1066
|
+
border-radius: 8px;
|
|
1067
|
+
border: 1px solid #e5e7eb;
|
|
1068
|
+
margin-bottom: 8px;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
.nice-upload-item.error {
|
|
1072
|
+
border-color: #fca5a5;
|
|
1073
|
+
background: #fef2f2;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
.nice-upload-item.success {
|
|
1077
|
+
border-color: #86efac;
|
|
1078
|
+
background: #f0fdf4;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
.nice-upload-item.grid {
|
|
1082
|
+
flex-direction: column;
|
|
1083
|
+
text-align: center;
|
|
1084
|
+
padding: 16px;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
.nice-upload-item.compact {
|
|
1088
|
+
padding: 8px 12px;
|
|
1089
|
+
font-size: 13px;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
.nice-upload-preview {
|
|
1093
|
+
flex-shrink: 0;
|
|
1094
|
+
display: flex;
|
|
1095
|
+
align-items: center;
|
|
1096
|
+
justify-content: center;
|
|
1097
|
+
background: #e5e7eb;
|
|
1098
|
+
border-radius: 6px;
|
|
1099
|
+
overflow: hidden;
|
|
1100
|
+
position: relative;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
.nice-upload-preview-icon {
|
|
1104
|
+
background: #f3f4f6;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
.nice-upload-preview-overlay {
|
|
1108
|
+
position: absolute;
|
|
1109
|
+
font-size: 24px;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
.nice-upload-item-content {
|
|
1113
|
+
flex: 1;
|
|
1114
|
+
min-width: 0;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
.nice-upload-item-header {
|
|
1118
|
+
display: flex;
|
|
1119
|
+
align-items: center;
|
|
1120
|
+
gap: 8px;
|
|
1121
|
+
margin-bottom: 4px;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
.nice-upload-item-name {
|
|
1125
|
+
font-weight: 500;
|
|
1126
|
+
font-size: 14px;
|
|
1127
|
+
color: #111827;
|
|
1128
|
+
overflow: hidden;
|
|
1129
|
+
text-overflow: ellipsis;
|
|
1130
|
+
white-space: nowrap;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
.nice-upload-item-size {
|
|
1134
|
+
font-size: 12px;
|
|
1135
|
+
color: #6b7280;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
.nice-upload-item-error {
|
|
1139
|
+
font-size: 12px;
|
|
1140
|
+
color: #dc2626;
|
|
1141
|
+
margin-top: 4px;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
.nice-upload-item-link {
|
|
1145
|
+
font-size: 12px;
|
|
1146
|
+
color: #3b82f6;
|
|
1147
|
+
text-decoration: none;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
.nice-upload-item-link:hover {
|
|
1151
|
+
text-decoration: underline;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
.nice-upload-item-actions {
|
|
1155
|
+
display: flex;
|
|
1156
|
+
gap: 4px;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
.nice-upload-item-actions button {
|
|
1160
|
+
padding: 4px 8px;
|
|
1161
|
+
font-size: 12px;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
.nice-upload-item-remove {
|
|
1165
|
+
background: none;
|
|
1166
|
+
border: none;
|
|
1167
|
+
color: #9ca3af;
|
|
1168
|
+
cursor: pointer;
|
|
1169
|
+
padding: 4px;
|
|
1170
|
+
font-size: 14px;
|
|
1171
|
+
line-height: 1;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
.nice-upload-item-remove:hover {
|
|
1175
|
+
color: #ef4444;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
.nice-upload-badge {
|
|
1179
|
+
font-size: 11px;
|
|
1180
|
+
padding: 2px 8px;
|
|
1181
|
+
border-radius: 10px;
|
|
1182
|
+
font-weight: 500;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
.nice-upload-badge.pending { background: #fef3c7; color: #92400e; }
|
|
1186
|
+
.nice-upload-badge.uploading { background: #dbeafe; color: #1e40af; }
|
|
1187
|
+
.nice-upload-badge.success { background: #dcfce7; color: #166534; }
|
|
1188
|
+
.nice-upload-badge.error { background: #fee2e2; color: #991b1b; }
|
|
1189
|
+
.nice-upload-badge.cancelled { background: #f3f4f6; color: #4b5563; }
|
|
1190
|
+
|
|
1191
|
+
.nice-upload-progress {
|
|
1192
|
+
height: 6px;
|
|
1193
|
+
background: #e5e7eb;
|
|
1194
|
+
border-radius: 3px;
|
|
1195
|
+
overflow: hidden;
|
|
1196
|
+
margin-top: 6px;
|
|
1197
|
+
position: relative;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
.nice-upload-progress-bar {
|
|
1201
|
+
height: 100%;
|
|
1202
|
+
transition: width 0.2s ease;
|
|
1203
|
+
border-radius: 3px;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
.nice-upload-progress-text {
|
|
1207
|
+
position: absolute;
|
|
1208
|
+
right: 0;
|
|
1209
|
+
top: -18px;
|
|
1210
|
+
font-size: 11px;
|
|
1211
|
+
color: #6b7280;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
.nice-upload-item.compact .nice-upload-progress {
|
|
1215
|
+
flex: 1;
|
|
1216
|
+
margin: 0 8px;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
.nice-upload-item.compact .nice-upload-progress-text {
|
|
1220
|
+
position: static;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
.nice-upload-item-info {
|
|
1224
|
+
margin-top: 8px;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
.nice-upload-item.grid .nice-upload-item-name {
|
|
1228
|
+
font-size: 13px;
|
|
1229
|
+
max-width: 100%;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
@media (max-width: 640px) {
|
|
1233
|
+
.nice-upload-dropzone {
|
|
1234
|
+
padding: 24px 16px;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
.nice-upload-actions {
|
|
1238
|
+
flex-wrap: wrap;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
.nice-upload-list.grid {
|
|
1242
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
`})]})})});hi.displayName="NiceFileUpload";let np=0;function yr(){return`blk-${++np}-${Date.now().toString(36)}`}function Zr(t=""){return{id:yr(),type:"paragraph",content:t}}function ip(t,a=""){const r={id:yr(),type:t,content:a};return t==="heading"&&(r.level=2),t==="list"&&(r.listType="unordered"),t==="callout"&&(r.icon="ℹ️"),t==="toggle"&&(r.open=!0),r}const sp=[{type:"paragraph",label:"Text",icon:"¶",keywords:"paragraph text"},{type:"heading",label:"Heading",icon:"H",keywords:"heading title"},{type:"list",label:"Bulleted list",icon:"•",keywords:"bullet unordered list"},{type:"list",label:"Numbered list",icon:"1.",keywords:"numbered ordered list"},{type:"list",label:"Checklist",icon:"☑",keywords:"check todo list"},{type:"quote",label:"Quote",icon:"❝",keywords:"quote blockquote"},{type:"callout",label:"Callout",icon:"ℹ️",keywords:"callout info alert"},{type:"toggle",label:"Toggle",icon:"▶",keywords:"toggle collapse expand"},{type:"code",label:"Code",icon:"</>",keywords:"code snippet"},{type:"image",label:"Image",icon:"🖼",keywords:"image photo picture"},{type:"video",label:"Video",icon:"🎬",keywords:"video embed"},{type:"table",label:"Table",icon:"⊞",keywords:"table grid"},{type:"divider",label:"Divider",icon:"─",keywords:"divider line separator"},{type:"pageBreak",label:"Page Break",icon:"⤓",keywords:"page break"}];function op(t){const a=[t.align?`text-align:${t.align}`:"",t.color?`color:${t.color}`:"",t.bgColor?`background-color:${t.bgColor}`:"",t.indent?`margin-left:${t.indent*24}px`:""].filter(Boolean).join(";"),r=a?` style="${a}"`:"",n=(i,o)=>{let c=o;return t.bold&&(c=`<strong>${c}</strong>`),t.italic&&(c=`<em>${c}</em>`),t.underline&&(c=`<u>${c}</u>`),t.strikethrough&&(c=`<s>${c}</s>`),`<${i}${r}>${c}</${i}>`};switch(t.type){case"heading":return n(`h${t.level??2}`,t.content);case"paragraph":return n("p",t.content||" ");case"list":{const i=t.listType==="ordered"?"ol":"ul",o=t.content.split(`
|
|
1246
|
+
`).map((c,l)=>{var d;return t.listType==="checklist"?`<li><input type="checkbox" ${((d=t.checked)==null?void 0:d[l])??!1?"checked":""} disabled />${c}</li>`:`<li>${c}</li>`}).join("");return`<${i}${r}>${o}</${i}>`}case"image":return`<figure${r}><img src="${t.src??""}" alt="${t.alt??""}" /></figure>`;case"video":return`<figure${r}><video src="${t.src??""}" controls></video></figure>`;case"divider":return"<hr />";case"pageBreak":return'<div style="page-break-after:always"></div>';case"code":return`<pre><code class="language-${t.language??""}">${t.content}</code></pre>`;case"quote":return n("blockquote",t.content);case"callout":return`<div class="nice-doc-callout"${r}><span>${t.icon??"ℹ️"}</span><div>${t.content}</div></div>`;case"toggle":return`<details${r}><summary>${t.content.split(`
|
|
1247
|
+
`)[0]}</summary>${t.content.split(`
|
|
1248
|
+
`).slice(1).join("<br>")}</details>`;case"table":return`<table${r}>${t.content}</table>`;case"embed":return`<iframe src="${t.src??""}" style="width:100%;border:none;min-height:300px"></iframe>`;default:return n("p",t.content)}}function lp(t){let a=0,r=0;for(const n of t){const i=n.content??"";a+=i.length;const o=i.trim().split(/\s+/).filter(Boolean);r+=o.length}return{words:r,chars:a,readingTime:Math.max(1,Math.ceil(r/200))}}const br=s.forwardRef(({blocks:t,onChange:a,readOnly:r=!1,showToolbar:n=!0,size:i="md",editorSize:o="standard",placeholder:c,onExport:l,onImageUpload:d,maxUndo:p=50,slashCommands:h=!0,showWordCount:u=!1,showToc:g=!1,showFindReplace:f=!0,className:m,style:b,id:C,...v},w)=>{var be,_e,Ne,Me,Fe,Ee,Pe,Be,Ze,Xe,rt,lt,We,bt,St,Dt;const y=Ae(C),{t:S}=Re(),[k,M]=s.useState(()=>t??[Zr()]),_=t??k,[j,z]=s.useState(0),P=s.useRef(new Map),I=s.useRef(null),[D,T]=s.useState(!1),[N,H]=s.useState(""),[E,R]=s.useState(""),[x,$]=s.useState([]),[A,O]=s.useState(0),[F,L]=s.useState(!1),G=s.useRef([]),V=s.useRef([]),B=s.useCallback(K=>{G.current.push(K.map(se=>({...se,checked:se.checked?[...se.checked]:void 0}))),G.current.length>p&&G.current.shift(),V.current=[]},[p]),Y=s.useCallback(()=>{if(G.current.length===0)return;const K=G.current.pop();V.current.push(_.map(se=>({...se}))),t||M(K),a==null||a(K)},[_,t,a]),J=s.useCallback(()=>{if(V.current.length===0)return;const K=V.current.pop();G.current.push(_.map(se=>({...se}))),t||M(K),a==null||a(K)},[_,t,a]),[me,de]=s.useState(!1),[oe,ae]=s.useState(""),[ve,re]=s.useState(0),he=s.useMemo(()=>{if(!me||!h)return[];const K=oe.toLowerCase();return sp.filter(se=>se.label.toLowerCase().includes(K)||se.keywords.includes(K))},[me,oe,h]),[we,le]=s.useState(null),[ke,U]=s.useState(null),Q=s.useCallback(K=>{B(_);const se=K(_);t||M(se),a==null||a(se)},[_,t,a,B]),W=s.useCallback((K,se)=>{Q(pe=>pe.map((Ie,Ue)=>Ue===K?{...Ie,...se}:Ie))},[Q]),Z=s.useCallback((K,se)=>{const pe=se??Zr();Q(Ie=>{const Ue=[...Ie];return Ue.splice(K+1,0,pe),Ue}),z(K+1)},[Q]),te=s.useCallback(K=>{const se={..._[K],id:yr()};Z(K,se)},[_,Z]),ee=s.useCallback(K=>{_.length<=1||(Q(se=>se.filter((pe,Ie)=>Ie!==K)),z(Math.max(0,K-1)))},[_.length,Q]),ie=s.useCallback((K,se)=>{const pe=K+se;pe<0||pe>=_.length||(Q(Ie=>{const Ue=[...Ie];return[Ue[K],Ue[pe]]=[Ue[pe],Ue[K]],Ue}),z(pe))},[_.length,Q]),ne=s.useCallback((K,se)=>{const pe={type:se};se==="heading"&&(pe.level=2),se==="list"&&(pe.listType="unordered"),se==="callout"&&(pe.icon="ℹ️"),se==="toggle"&&(pe.open=!0),W(K,pe)},[W]),Ce=s.useCallback(K=>{var pe,Ie;const se=ip(K.type);K.type==="list"&&K.label.includes("Numbered")&&(se.listType="ordered"),K.type==="list"&&K.label.includes("Checklist")&&(se.listType="checklist",se.checked=[]),((pe=_[j])==null?void 0:pe.content)===""||((Ie=_[j])==null?void 0:Ie.content)==="/"?Q(Ue=>Ue.map((kt,Tt)=>Tt===j?{...se,id:kt.id}:kt)):Z(j,se),de(!1),ae("")},[_,j,Q,Z]),ue=s.useCallback((K,se)=>{if(r)return;const pe=_[se];if(!(pe!=null&&pe.locked)){if((K.ctrlKey||K.metaKey)&&K.key==="z"&&!K.shiftKey){K.preventDefault(),Y();return}if((K.ctrlKey||K.metaKey)&&(K.key==="y"||K.key==="z"&&K.shiftKey)){K.preventDefault(),J();return}if((K.ctrlKey||K.metaKey)&&K.key==="d"){K.preventDefault(),te(se);return}if((K.ctrlKey||K.metaKey)&&K.key==="b"){K.preventDefault(),W(se,{bold:!(pe!=null&&pe.bold)});return}if((K.ctrlKey||K.metaKey)&&K.key==="i"){K.preventDefault(),W(se,{italic:!(pe!=null&&pe.italic)});return}if((K.ctrlKey||K.metaKey)&&K.key==="u"){K.preventDefault(),W(se,{underline:!(pe!=null&&pe.underline)});return}if((K.ctrlKey||K.metaKey)&&K.key==="e"){K.preventDefault(),W(se,{strikethrough:!(pe!=null&&pe.strikethrough)});return}if(K.key==="Tab"&&!K.shiftKey){K.preventDefault(),W(se,{indent:Math.min(((pe==null?void 0:pe.indent)??0)+1,4)});return}if(K.key==="Tab"&&K.shiftKey){K.preventDefault(),W(se,{indent:Math.max(((pe==null?void 0:pe.indent)??0)-1,0)});return}if((K.ctrlKey||K.metaKey)&&K.key==="f"&&f){K.preventDefault(),T(Ie=>!Ie);return}if(me&&he.length>0){if(K.key==="ArrowDown"){K.preventDefault(),re(Ie=>Math.min(Ie+1,he.length-1));return}if(K.key==="ArrowUp"){K.preventDefault(),re(Ie=>Math.max(Ie-1,0));return}if(K.key==="Enter"){K.preventDefault(),Ce(he[ve]);return}if(K.key==="Escape"){de(!1);return}}K.key==="Enter"&&!K.shiftKey?(K.preventDefault(),Z(se)):K.key==="Backspace"&&_[se].content===""&&_.length>1?(K.preventDefault(),ee(se)):K.key==="ArrowUp"&&K.altKey?(K.preventDefault(),ie(se,-1)):K.key==="ArrowDown"&&K.altKey&&(K.preventDefault(),ie(se,1))}},[r,_,Z,ee,ie,Y,J,te,W,me,he,ve,Ce,f]),$e=s.useCallback((K,se)=>{const pe=K.target.textContent??"";h&&pe.startsWith("/")?(de(!0),ae(pe.slice(1)),re(0)):me&&de(!1),B(_);const Ie=_.map((Ue,kt)=>kt===se?{...Ue,content:pe}:Ue);t||M(Ie),a==null||a(Ie)},[_,t,a,B,h,me]),ze=s.useCallback((K,se)=>{le(se),K.dataTransfer.effectAllowed="move"},[]),Te=s.useCallback((K,se)=>{K.preventDefault(),K.dataTransfer.dropEffect="move",U(se)},[]),Ve=s.useCallback((K,se)=>{if(K.preventDefault(),we===null||we===se){le(null),U(null);return}Q(pe=>{const Ie=[...pe],[Ue]=Ie.splice(we,1);return Ie.splice(se>we?se-1:se,0,Ue),Ie}),z(se>we?se-1:se),le(null),U(null)},[we,Q]);s.useEffect(()=>{if(!D||!N){$([]);return}const K=N.toLowerCase(),se=[];_.forEach((pe,Ie)=>{const Ue=(pe.content??"").toLowerCase();let kt=0;for(;kt<Ue.length;){const Tt=Ue.indexOf(K,kt);if(Tt===-1)break;se.push({blockIdx:Ie,start:Tt,end:Tt+K.length}),kt=Tt+1}}),$(se),O(0)},[N,D,_]);const De=s.useCallback(()=>{if(x.length===0)return;const K=(A+1)%x.length;O(K),z(x[K].blockIdx)},[x,A]),at=s.useCallback(()=>{if(x.length===0)return;const K=(A-1+x.length)%x.length;O(K),z(x[K].blockIdx)},[x,A]),Ct=s.useCallback(()=>{if(x.length===0||!N)return;const K=x[A],se=_[K.blockIdx],pe=se.content.slice(0,K.start),Ie=se.content.slice(K.end);W(K.blockIdx,{content:pe+E+Ie})},[x,A,N,E,_,W]),yt=s.useCallback(()=>{if(!N)return;const K=N;Q(se=>se.map(pe=>({...pe,content:pe.content.split(K).join(E)})))},[N,E,Q]),q=s.useMemo(()=>g?_.map((K,se)=>K.type==="heading"?{idx:se,level:K.level??2,text:K.content}:null).filter(Boolean):[],[_,g]),ce=s.useCallback(async K=>{var pe;const se=(pe=K.target.files)==null?void 0:pe[0];if(se){if(d){const Ie=await d(se);W(j,{src:Ie})}K.target.value=""}},[d,j,W]);s.useEffect(()=>{const K=_[j];if(K){const se=P.current.get(K.id);se&&se.focus()}},[j,_]);const ge=s.useCallback(()=>{const K=_.map(op).join(`
|
|
1249
|
+
`);l==null||l(K)},[_,l]),ye=s.useMemo(()=>u?lp(_):null,[_,u]),[je,fe]=s.useState(null),X=s.useCallback((K,se)=>{r||(K.preventDefault(),fe({x:K.clientX,y:K.clientY,idx:se}))},[r]);return s.useEffect(()=>{if(!je)return;const K=()=>fe(null);return window.addEventListener("click",K),()=>window.removeEventListener("click",K)},[je]),e.jsxs("div",{ref:w,id:y,className:`nice-doc-editor nice-doc-editor--${i} nice-editor--${o} ${r?"nice-doc-editor--readonly":""} ${m??""}`,style:b,role:"application","aria-label":S("docEditor.label","Document Editor"),...v,children:[n&&!r&&e.jsxs("div",{className:"nice-doc-editor__toolbar",role:"toolbar",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center",padding:"4px 8px"},children:[e.jsx(xe,{size:"sm",variant:"ghost",onClick:Y,title:S("docEditor.undo","Undo (Ctrl+Z)"),children:"↩"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:J,title:S("docEditor.redo","Redo (Ctrl+Y)"),children:"↪"}),e.jsx("span",{className:"nice-doc-editor__sep"}),e.jsx(Qe,{size:"sm",value:((be=_[j])==null?void 0:be.type)??"paragraph",onChange:K=>ne(j,K),label:"",options:[{value:"paragraph",label:S("docEditor.paragraph","Paragraph")},{value:"heading",label:S("docEditor.heading","Heading")},{value:"list",label:S("docEditor.list","List")},{value:"code",label:S("docEditor.code","Code")},{value:"quote",label:S("docEditor.quote","Quote")},{value:"callout",label:S("docEditor.callout","Callout")},{value:"toggle",label:S("docEditor.toggle","Toggle")},{value:"divider",label:S("docEditor.divider","Divider")},{value:"image",label:S("docEditor.image","Image")},{value:"video",label:S("docEditor.video","Video")},{value:"pageBreak",label:S("docEditor.pageBreak","Page Break")}],style:{minWidth:100}}),((_e=_[j])==null?void 0:_e.type)==="heading"&&e.jsx(Qe,{size:"sm",value:String(((Ne=_[j])==null?void 0:Ne.level)??2),onChange:K=>W(j,{level:Number(K)}),label:"",options:[{value:"1",label:"H1"},{value:"2",label:"H2"},{value:"3",label:"H3"},{value:"4",label:"H4"},{value:"5",label:"H5"},{value:"6",label:"H6"}],style:{minWidth:55}}),((Me=_[j])==null?void 0:Me.type)==="list"&&e.jsx(Qe,{size:"sm",value:((Fe=_[j])==null?void 0:Fe.listType)??"unordered",onChange:K=>W(j,{listType:K}),label:"",options:[{value:"unordered",label:"• Bullets"},{value:"ordered",label:"1. Numbers"},{value:"checklist",label:"☑ Checklist"}],style:{minWidth:90}}),e.jsx("span",{className:"nice-doc-editor__sep"}),e.jsx(xe,{size:"sm",variant:(Ee=_[j])!=null&&Ee.bold?"primary":"ghost",onClick:()=>{var K;return W(j,{bold:!((K=_[j])!=null&&K.bold)})},title:S("docEditor.bold","Bold (Ctrl+B)"),children:e.jsx("strong",{children:"B"})}),e.jsx(xe,{size:"sm",variant:(Pe=_[j])!=null&&Pe.italic?"primary":"ghost",onClick:()=>{var K;return W(j,{italic:!((K=_[j])!=null&&K.italic)})},title:S("docEditor.italic","Italic (Ctrl+I)"),children:e.jsx("em",{children:"I"})}),e.jsx(xe,{size:"sm",variant:(Be=_[j])!=null&&Be.underline?"primary":"ghost",onClick:()=>{var K;return W(j,{underline:!((K=_[j])!=null&&K.underline)})},title:S("docEditor.underline","Underline (Ctrl+U)"),children:e.jsx("u",{children:"U"})}),e.jsx(xe,{size:"sm",variant:(Ze=_[j])!=null&&Ze.strikethrough?"primary":"ghost",onClick:()=>{var K;return W(j,{strikethrough:!((K=_[j])!=null&&K.strikethrough)})},title:S("docEditor.strikethrough","Strikethrough (Ctrl+E)"),children:e.jsx("s",{children:"S"})}),e.jsx("span",{className:"nice-doc-editor__sep"}),e.jsx(xe,{size:"sm",variant:((Xe=_[j])==null?void 0:Xe.align)==="left"?"primary":"ghost",onClick:()=>W(j,{align:"left"}),title:S("docEditor.alignLeft","Left"),children:"⬅"}),e.jsx(xe,{size:"sm",variant:((rt=_[j])==null?void 0:rt.align)==="center"?"primary":"ghost",onClick:()=>W(j,{align:"center"}),title:S("docEditor.alignCenter","Center"),children:"⬌"}),e.jsx(xe,{size:"sm",variant:((lt=_[j])==null?void 0:lt.align)==="right"?"primary":"ghost",onClick:()=>W(j,{align:"right"}),title:S("docEditor.alignRight","Right"),children:"➡"}),e.jsx("span",{className:"nice-doc-editor__sep"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>{var K;return W(j,{indent:Math.min((((K=_[j])==null?void 0:K.indent)??0)+1,4)})},title:S("docEditor.indent","Indent (Tab)"),children:"→⊞"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>{var K;return W(j,{indent:Math.max((((K=_[j])==null?void 0:K.indent)??0)-1,0)})},title:S("docEditor.outdent","Outdent (Shift+Tab)"),children:"←⊞"}),e.jsx("span",{className:"nice-doc-editor__sep"}),e.jsx(st,{size:"sm",label:"",value:((We=_[j])==null?void 0:We.color)??"#000000",onChange:K=>W(j,{color:K}),title:"Text color"}),e.jsx(st,{size:"sm",label:"",value:((bt=_[j])==null?void 0:bt.bgColor)??"#ffffff",onChange:K=>W(j,{bgColor:K}),title:"Block background"}),e.jsx("span",{className:"nice-doc-editor__sep"}),e.jsx(xe,{size:"sm",variant:(St=_[j])!=null&&St.locked?"primary":"ghost",onClick:()=>{var K;return W(j,{locked:!((K=_[j])!=null&&K.locked)})},title:S("docEditor.lock","Lock/Unlock block"),children:"🔒"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>te(j),title:S("docEditor.duplicate","Duplicate (Ctrl+D)"),children:"⧉"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>ee(j),title:S("docEditor.delete","Delete block"),children:"🗑"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>Z(j),title:S("docEditor.addBlock","Add block"),children:"+"}),f&&e.jsx(xe,{size:"sm",variant:D?"primary":"ghost",onClick:()=>T(K=>!K),title:S("docEditor.find","Find & Replace (Ctrl+F)"),children:"🔍"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>L(K=>!K),title:S("docEditor.shortcuts","Keyboard shortcuts"),children:"⌨"}),l&&e.jsx(xe,{size:"sm",variant:"ghost",onClick:ge,children:S("docEditor.export","Export HTML")})]}),e.jsx("input",{ref:I,type:"file",accept:"image/*,video/*",style:{display:"none"},onChange:ce}),D&&e.jsxs("div",{className:"nice-doc-editor__find-bar",style:{display:"flex",gap:4,alignItems:"center",padding:"4px 8px",background:"var(--nice-doc-find-bg, #f8f9fa)",borderBottom:"1px solid #ddd"},children:[e.jsx(ht,{size:"sm",placeholder:S("docEditor.findPlaceholder","Find..."),value:N,onChange:H,style:{flex:1,maxWidth:200}}),e.jsx(ht,{size:"sm",placeholder:S("docEditor.replacePlaceholder","Replace..."),value:E,onChange:R,style:{flex:1,maxWidth:200}}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:at,title:S("docEditor.findPrev","Previous"),children:"◀"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:De,title:S("docEditor.findNext","Next"),children:"▶"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:Ct,title:S("docEditor.replaceOne","Replace"),disabled:r,children:S("docEditor.replace","Replace")}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:yt,title:S("docEditor.replaceAll","Replace all"),disabled:r,children:S("docEditor.replaceAllBtn","All")}),e.jsx("span",{style:{fontSize:"0.75em",color:"#666"},children:x.length>0?`${A+1}/${x.length}`:"0/0"}),e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>T(!1),children:"✕"})]}),F&&e.jsx("div",{className:"nice-doc-editor__shortcuts-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>L(!1),children:e.jsxs("div",{style:{background:"#fff",borderRadius:8,padding:24,maxWidth:420,width:"90%",boxShadow:"0 8px 32px rgba(0,0,0,.2)"},onClick:K=>K.stopPropagation(),children:[e.jsx("h3",{style:{margin:"0 0 12px"},children:S("docEditor.shortcutsTitle","Keyboard Shortcuts")}),e.jsx("table",{style:{width:"100%",fontSize:"0.875em",borderCollapse:"collapse"},children:e.jsx("tbody",{children:[["Ctrl+B",S("docEditor.bold","Bold")],["Ctrl+I",S("docEditor.italic","Italic")],["Ctrl+U",S("docEditor.underline","Underline")],["Ctrl+E",S("docEditor.strikethrough","Strikethrough")],["Ctrl+D",S("docEditor.duplicate","Duplicate block")],["Ctrl+Z",S("docEditor.undo","Undo")],["Ctrl+Y",S("docEditor.redo","Redo")],["Ctrl+F",S("docEditor.find","Find & Replace")],["Enter",S("docEditor.newBlock","New block")],["Backspace",S("docEditor.deleteEmpty","Delete empty block")],["Alt+↑",S("docEditor.moveUp","Move block up")],["Alt+↓",S("docEditor.moveDown","Move block down")],["Tab",S("docEditor.indent","Indent")],["Shift+Tab",S("docEditor.outdent","Outdent")],["/",S("docEditor.slashCmd","Slash commands")]].map(([K,se])=>e.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[e.jsx("td",{style:{padding:"4px 8px",fontFamily:"monospace",fontWeight:600},children:K}),e.jsx("td",{style:{padding:"4px 8px"},children:se})]},K))})}),e.jsx("div",{style:{textAlign:"right",marginTop:12},children:e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>L(!1),children:S("docEditor.close","Close")})})]})}),e.jsxs("div",{style:{display:"flex",gap:0},children:[g&&q.length>0&&e.jsxs("nav",{className:"nice-doc-editor__toc",style:{width:200,minWidth:160,borderRight:"1px solid #eee",padding:"8px 4px",fontSize:"0.8em",overflowY:"auto",maxHeight:500},children:[e.jsx("div",{style:{fontWeight:600,padding:"4px 8px",fontSize:"0.75em",textTransform:"uppercase",color:"#999"},children:S("docEditor.toc","Contents")}),q.map(K=>e.jsx("div",{style:{padding:"3px 8px",paddingLeft:8+(K.level-1)*12,cursor:"pointer",borderRadius:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",background:K.idx===j?"#e8f0fe":void 0},onClick:()=>z(K.idx),title:K.text,children:K.text||S("docEditor.untitled","Untitled")},K.idx))]}),e.jsx("div",{className:"nice-doc-editor__body",style:{flex:1},children:_.map((K,se)=>e.jsxs("div",{className:`nice-doc-editor__block nice-doc-editor__block--${K.type} ${se===j?"nice-doc-editor__block--focused":""} ${ke===se?"nice-doc-editor__block--drop-target":""} ${K.locked?"nice-doc-editor__block--locked":""}`,onClick:()=>z(se),onContextMenu:pe=>X(pe,se),draggable:!r&&!K.locked,onDragStart:pe=>ze(pe,se),onDragOver:pe=>Te(pe,se),onDrop:pe=>Ve(pe,se),onDragEnd:()=>{le(null),U(null)},style:{opacity:we===se?.4:1,marginLeft:(K.indent??0)*24},children:[!r&&!K.locked&&e.jsx("div",{className:"nice-doc-editor__block-handle",title:S("docEditor.drag","Drag to reorder"),children:"⠿"}),K.locked&&e.jsx("span",{className:"nice-doc-editor__lock-icon",style:{position:"absolute",top:2,right:4,fontSize:"0.7em",opacity:.5},children:"🔒"}),K.type==="divider"?e.jsx("hr",{className:"nice-doc-editor__divider"}):K.type==="pageBreak"?e.jsxs("div",{className:"nice-doc-editor__page-break",style:{borderTop:"2px dashed #ccc",textAlign:"center",padding:4,fontSize:"0.75em",color:"#999"},children:["— ",S("docEditor.pageBreak","Page Break")," —"]}):K.type==="image"||K.type==="video"?e.jsx("div",{className:"nice-doc-editor__media-block",children:K.src?K.type==="image"?e.jsx("img",{src:K.src,alt:K.alt??"",className:"nice-doc-editor__image",style:{maxWidth:"100%"}}):e.jsx("video",{src:K.src,controls:!0,className:"nice-doc-editor__video",style:{maxWidth:"100%"}}):!r&&e.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[e.jsx(ht,{size:"sm",placeholder:S("docEditor.mediaUrl",K.type==="image"?"Image URL":"Video URL"),value:K.src??"",onChange:pe=>W(se,{src:pe})}),d&&e.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>{var pe;z(se),(pe=I.current)==null||pe.click()},children:"📎"})]})}):K.type==="callout"?e.jsxs("div",{className:"nice-doc-editor__callout",style:{display:"flex",gap:8,padding:"8px 12px",background:K.bgColor??"#f0f7ff",borderRadius:4,color:K.color},children:[e.jsx("span",{style:{fontSize:"1.2em"},children:K.icon??"ℹ️"}),e.jsx("div",{ref:pe=>{pe&&P.current.set(K.id,pe)},className:"nice-doc-editor__content",contentEditable:!r&&!K.locked,suppressContentEditableWarning:!0,onInput:pe=>$e(pe,se),onFocus:()=>z(se),onKeyDown:pe=>ue(pe,se),"data-placeholder":S("docEditor.calloutPlaceholder","Callout text..."),role:"textbox","aria-multiline":"true",style:{flex:1,outline:"none"},children:K.content})]}):K.type==="toggle"?e.jsxs("details",{open:K.open,className:"nice-doc-editor__toggle",onToggle:pe=>W(se,{open:pe.target.open}),children:[e.jsx("summary",{style:{cursor:"pointer",fontWeight:500},children:K.content.split(`
|
|
1250
|
+
`)[0]||S("docEditor.toggleTitle","Toggle")}),e.jsx("div",{ref:pe=>{pe&&P.current.set(K.id,pe)},className:"nice-doc-editor__content",contentEditable:!r&&!K.locked,suppressContentEditableWarning:!0,onInput:pe=>$e(pe,se),onFocus:()=>z(se),onKeyDown:pe=>ue(pe,se),role:"textbox","aria-multiline":"true",style:{padding:"4px 0"},children:K.content.split(`
|
|
1251
|
+
`).slice(1).join(`
|
|
1252
|
+
`)})]}):K.type==="code"?e.jsxs("div",{className:"nice-doc-editor__code-block",style:{position:"relative"},children:[!r&&e.jsx(ht,{size:"sm",value:K.language??"",onChange:pe=>W(se,{language:pe}),placeholder:"Language",style:{position:"absolute",top:4,right:4,width:80,opacity:.7}}),e.jsx("pre",{ref:pe=>{pe&&P.current.set(K.id,pe)},className:"nice-doc-editor__content",contentEditable:!r&&!K.locked,suppressContentEditableWarning:!0,onInput:pe=>$e(pe,se),onFocus:()=>z(se),onKeyDown:pe=>ue(pe,se),role:"textbox","aria-multiline":"true",style:{fontFamily:"monospace",background:"#1e1e1e",color:"#d4d4d4",padding:12,borderRadius:4,overflow:"auto"},children:K.content})]}):e.jsxs("div",{style:{position:"relative"},children:[e.jsx("div",{ref:pe=>{pe&&P.current.set(K.id,pe)},className:"nice-doc-editor__content",contentEditable:!r&&!K.locked,suppressContentEditableWarning:!0,style:{textAlign:K.align,fontWeight:K.bold?"bold":void 0,fontStyle:K.italic?"italic":void 0,textDecoration:[K.underline?"underline":"",K.strikethrough?"line-through":""].filter(Boolean).join(" ")||void 0,color:K.color,backgroundColor:K.bgColor},onInput:pe=>$e(pe,se),onFocus:()=>z(se),onKeyDown:pe=>ue(pe,se),"data-placeholder":!K.content&&c?c:void 0,role:"textbox","aria-multiline":"true",children:K.content}),me&&se===j&&he.length>0&&e.jsx("ul",{className:"nice-doc-editor__slash-menu",style:{position:"absolute",left:0,top:"100%",zIndex:100,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,.12)",listStyle:"none",margin:0,padding:4,minWidth:180,maxHeight:240,overflow:"auto"},children:he.map((pe,Ie)=>e.jsxs("li",{className:Ie===ve?"nice-doc-editor__slash-item--active":"",style:{padding:"6px 10px",cursor:"pointer",borderRadius:4,display:"flex",gap:8,alignItems:"center",background:Ie===ve?"#e8f0fe":void 0},onMouseDown:Ue=>{Ue.preventDefault(),Ce(pe)},onMouseEnter:()=>re(Ie),children:[e.jsx("span",{style:{width:24,textAlign:"center"},children:pe.icon}),e.jsx("span",{children:pe.label})]},`${pe.type}-${pe.label}`))})]})]},K.id))})]}),je&&e.jsxs("div",{className:"nice-doc-editor__ctx-menu",style:{position:"fixed",left:je.x,top:je.y,zIndex:1e3,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,.12)",padding:4,minWidth:160},children:[e.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{te(je.idx),fe(null)},children:"⧉ Duplicate"}),e.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{Z(je.idx),fe(null)},children:"+ Insert below"}),e.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{ie(je.idx,-1),fe(null)},children:"↑ Move up"}),e.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{ie(je.idx,1),fe(null)},children:"↓ Move down"}),e.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{var K;W(je.idx,{locked:!((K=_[je.idx])!=null&&K.locked)}),fe(null)},children:(Dt=_[je.idx])!=null&&Dt.locked?"🔓 Unlock":"🔒 Lock"}),e.jsx("hr",{style:{margin:"2px 0",border:"none",borderTop:"1px solid #eee"}}),e.jsx("div",{style:{padding:"6px 12px",cursor:"pointer",color:"#d32f2f"},onClick:()=>{ee(je.idx),fe(null)},children:"🗑 Delete"})]}),u&&ye&&e.jsxs("div",{className:"nice-doc-editor__footer",style:{padding:"4px 12px",fontSize:"0.75em",color:"#666",borderTop:"1px solid #eee",display:"flex",gap:16},children:[e.jsxs("span",{children:[ye.words," ",S("docEditor.words","words")]}),e.jsxs("span",{children:[ye.chars," ",S("docEditor.chars","characters")]}),e.jsxs("span",{children:[_.length," ",S("docEditor.blocks","blocks")]}),e.jsxs("span",{children:["~",ye.readingTime," ",S("docEditor.readingTime","min read")]})]})]})});br.displayName="NiceDocumentEditor";const cp=["street","streetNumber","apartment","city","postalCode","state","country"],aa={street:"Street",streetNumber:"Number",apartment:"Apt/Suite",city:"City",postalCode:"Postal Code",state:"State/Province",country:"Country"},fi=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,value:g={},onChange:f,fields:m=cp,placeholders:b={},countries:C,layout:v="vertical",countryFirst:w=!1,validatePostalCode:y},S)=>{const k=Oe(u,d);if(k==="hidden")return null;k==="disabled"&&(i=!0),k==="readOnly"&&(o=!0);const{t:M}=Re(),_=Ae(d),j=s.useCallback((D,T)=>{f==null||f({...g,[D]:T})},[g,f]),z=s.useMemo(()=>{if(y&&g.postalCode)return y(g.postalCode,g.country)},[y,g.postalCode,g.country]),P=s.useMemo(()=>w&&m.includes("country")?["country",...m.filter(D=>D!=="country")]:m,[m,w]),I=`nice-address nice-address--${v} nice-size-${c}`;return e.jsxs("div",{ref:S,id:_,className:`${I}${p?` ${p}`:""}${r?" nice-error":""}${i?" nice-disabled":""}`,style:h,role:"group","aria-label":t??M("address","Address"),children:[t&&e.jsxs("label",{className:"nice-address__label",children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),e.jsx("div",{className:"nice-address__fields",children:P.map(D=>D==="country"&&C?e.jsxs("div",{className:`nice-address__field nice-address__field--${D}`,children:[e.jsx("label",{className:"nice-address__field-label",children:M(D,aa[D])}),e.jsxs("select",{className:"nice-input nice-select",value:g.country??"",onChange:T=>j("country",T.target.value),disabled:i,"aria-label":M(D,aa[D]),children:[e.jsx("option",{value:"",children:b.country??M("selectCountry","— Select country —")}),C.map(T=>e.jsx("option",{value:T.code,children:T.name},T.code))]})]},D):e.jsxs("div",{className:`nice-address__field nice-address__field--${D}`,children:[e.jsx("label",{className:"nice-address__field-label",children:M(D,aa[D])}),e.jsx("input",{className:`nice-input${D==="postalCode"&&z?" nice-input--error":""}`,type:"text",name:l?`${l}.${D}`:D,value:g[D]??"",onChange:T=>j(D,T.target.value),placeholder:b[D]??"",disabled:i,readOnly:o,"aria-label":M(D,aa[D])}),D==="postalCode"&&z&&e.jsx("span",{className:"nice-error-text",children:z})]},D))}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});fi.displayName="NiceAddressInput";const dp=[{code:"PL",dialCode:"+48",name:"Poland",mask:"### ### ###"},{code:"US",dialCode:"+1",name:"United States",mask:"(###) ###-####"},{code:"GB",dialCode:"+44",name:"United Kingdom",mask:"#### ######"},{code:"DE",dialCode:"+49",name:"Germany",mask:"### ########"},{code:"FR",dialCode:"+33",name:"France",mask:"# ## ## ## ##"},{code:"CZ",dialCode:"+420",name:"Czech Republic",mask:"### ### ###"},{code:"SK",dialCode:"+421",name:"Slovakia",mask:"### ### ###"}],Xr=127397;function up(t){return String.fromCodePoint(t.charCodeAt(0)+Xr,t.charCodeAt(1)+Xr)}function pp(t,a){if(!a)return t;const r=t.replace(/\D/g,"");let n="",i=0;for(let o=0;o<a.length&&i<r.length;o++)a[o]==="#"?n+=r[i++]:n+=a[o];return n}function Ca(t,a){return`${t}${a.replace(/\D/g,"")}`}const gi=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,value:g={},onChange:f,onBlur:m,countryCodes:b=dp,defaultCountry:C="PL",placeholder:v,showFlag:w=!0,validateE164:y=!1},S)=>{var E;const k=Oe(u,d);if(k==="hidden")return null;k==="disabled"&&(i=!0),k==="readOnly"&&(o=!0);const{t:M}=Re(),_=Ae(d),j=s.useMemo(()=>{const R=g.countryCode??C;return b.find(x=>x.code===R)??b[0]},[g.countryCode,C,b]),[z,P]=s.useState(),I=s.useMemo(()=>pp(g.number??"",j==null?void 0:j.mask),[g.number,j]),D=s.useCallback(R=>{const x=b.find(A=>A.code===R);if(!x)return;const $=g.number??"";f==null||f({countryCode:x.code,dialCode:x.dialCode,number:$,e164:Ca(x.dialCode,$)})},[b,g.number,f]),T=s.useCallback(R=>{const x=R.replace(/\D/g,""),$=j;f==null||f({countryCode:$==null?void 0:$.code,dialCode:$==null?void 0:$.dialCode,number:x,e164:$?Ca($.dialCode,x):x}),P(void 0)},[j,f]),N=s.useCallback(R=>{if(y&&g.number){const x=Ca((j==null?void 0:j.dialCode)??"",g.number);/^\+\d{7,15}$/.test(x)||P(M("invalidPhone","Invalid phone number"))}m==null||m(R)},[y,g.number,j,m,M]),H=r||z;return e.jsxs("div",{ref:S,id:_,className:`nice-phone nice-size-${c}${p?` ${p}`:""}${H?" nice-error":""}${i?" nice-disabled":""}`,style:h,children:[t&&e.jsxs("label",{className:"nice-phone__label",children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),e.jsxs("div",{className:"nice-phone__row",children:[e.jsx("select",{className:"nice-phone__country nice-select",value:j==null?void 0:j.code,onChange:R=>D(R.target.value),disabled:i,"aria-label":M("countryCode","Country code"),children:b.map(R=>e.jsxs("option",{value:R.code,children:[w?`${up(R.code)} `:"",R.dialCode," ",R.name]},R.code))}),e.jsx("input",{className:"nice-input nice-phone__number",type:"tel",name:l,value:I,onChange:R=>T(R.target.value),onBlur:N,placeholder:v??((E=j==null?void 0:j.mask)==null?void 0:E.replace(/#/g,"_"))??"",disabled:i,readOnly:o,"aria-label":M("phoneNumber","Phone number")})]}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),H&&typeof H=="string"&&e.jsx("span",{className:"nice-error-text",children:H})]})});gi.displayName="NicePhoneInput";const mp=[{code:"PLN",symbol:"zł",name:"Polish Zloty"},{code:"EUR",symbol:"€",name:"Euro"},{code:"USD",symbol:"$",name:"US Dollar"},{code:"GBP",symbol:"£",name:"British Pound"},{code:"CZK",symbol:"Kč",name:"Czech Koruna"},{code:"CHF",symbol:"Fr",name:"Swiss Franc"}],yi=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,value:g,onChange:f,onBlur:m,currency:b="PLN",onCurrencyChange:C,currencies:v=mp,useMinorUnit:w=!1,min:y,max:S,locale:k,placeholder:M,showCurrencySelector:_},j)=>{const z=Oe(u,d);if(z==="hidden")return null;z==="disabled"&&(i=!0),z==="readOnly"&&(o=!0);const{t:P}=Re(),I=Ae(d),D=s.useMemo(()=>v.find(x=>x.code===b)??v[0],[b,v]),T=(D==null?void 0:D.decimals)??2,N=s.useMemo(()=>g==null?"":(w?g/Math.pow(10,T):g).toFixed(T),[g,w,T]),H=s.useCallback(x=>{const $=x.replace(/[^\d.,\-]/g,"").replace(",",".");if($===""||$==="-"){f==null||f(null);return}const A=parseFloat($);if(isNaN(A))return;const O=w?Math.round(A*Math.pow(10,T)):A;y!=null&&O<y||S!=null&&O>S||(f==null||f(O))},[f,w,T,y,S]),E=_??v.length>1,R=s.useMemo(()=>{if(g==null)return"";const x=w?g/Math.pow(10,T):g;try{return new Intl.NumberFormat(k,{style:"currency",currency:(D==null?void 0:D.code)??"USD",minimumFractionDigits:T}).format(x)}catch{return`${x.toFixed(T)} ${D==null?void 0:D.code}`}},[g,w,T,k,D]);return e.jsxs("div",{ref:j,id:I,className:`nice-currency nice-size-${c}${p?` ${p}`:""}${r?" nice-error":""}${i?" nice-disabled":""}`,style:h,children:[t&&e.jsxs("label",{className:"nice-currency__label",children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),e.jsxs("div",{className:"nice-currency__row",children:[E&&e.jsx("select",{className:"nice-currency__select nice-select",value:b,onChange:x=>C==null?void 0:C(x.target.value),disabled:i,"aria-label":P("currency","Currency"),children:v.map(x=>e.jsxs("option",{value:x.code,children:[x.symbol," ",x.code]},x.code))}),!E&&e.jsx("span",{className:"nice-currency__symbol",children:D==null?void 0:D.symbol}),e.jsx("input",{className:"nice-input nice-currency__amount",type:"text",inputMode:"decimal",name:l,value:N,onChange:x=>H(x.target.value),onBlur:m,placeholder:M??`0.${"0".repeat(T)}`,disabled:i,readOnly:o,"aria-label":P("amount","Amount")})]}),R&&g!=null&&e.jsx("span",{className:"nice-currency__formatted",children:R}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});yi.displayName="NiceCurrencyInput";let hp=1;function fp(t){return{id:`new-${hp++}`,description:"",quantity:1,unitPrice:0,vatRate:t,discount:0,unit:"szt."}}function bi(t){const a=t.quantity*t.unitPrice*(1-(t.discount??0)/100),r=Math.round(a*100)/100,n=Math.round(r*(t.vatRate??0)/100*100)/100;return{...t,netAmount:r,grossAmount:r+n}}function gp(t){const a=t.map(bi),r=a.reduce((l,d)=>l+(d.netAmount??0),0),n=a.reduce((l,d)=>l+(d.grossAmount??0),0),i=n-r,o=new Map;for(const l of a){const d=l.vatRate??0,p=o.get(d)??{base:0,amount:0};p.base+=l.netAmount??0,p.amount+=(l.grossAmount??0)-(l.netAmount??0),o.set(d,p)}const c=Array.from(o.entries()).map(([l,d])=>({rate:l,base:Math.round(d.base*100)/100,amount:Math.round(d.amount*100)/100}));return{totalNet:Math.round(r*100)/100,totalVat:Math.round(i*100)/100,totalGross:Math.round(n*100)/100,vatBreakdown:c}}const xi=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,value:g=[],onChange:f,onTotalsChange:m,currencySymbol:b="zł",defaultVatRate:C=23,vatRates:v=[0,5,8,23],units:w=["szt.","h","kg","m","usł."],showDiscount:y=!0,showUnit:S=!0,showTotals:k=!0,editable:M=!0,maxLines:_},j)=>{const z=Oe(u,d);if(z==="hidden")return null;z==="disabled"&&(i=!0),z==="readOnly"&&(o=!0);const{t:P}=Re(),I=Ae(d),D=s.useMemo(()=>g.map(bi),[g]),T=s.useMemo(()=>gp(g),[g]);s.useEffect(()=>{m==null||m(T)},[T,m]);const N=s.useCallback((x,$,A)=>{const O=[...g];O[x]={...O[x],[$]:A},f==null||f(O)},[g,f]),H=s.useCallback(()=>{_&&g.length>=_||(f==null||f([...g,fp(C)]))},[g,f,C,_]),E=s.useCallback(x=>{f==null||f(g.filter(($,A)=>A!==x))},[g,f]),R=x=>`${x.toFixed(2)} ${b}`;return e.jsxs("div",{ref:j,id:I,className:`nice-invoice-lines nice-size-${c}${p?` ${p}`:""}${r?" nice-error":""}${i?" nice-disabled":""}`,style:h,children:[t&&e.jsxs("label",{className:"nice-invoice-lines__label",children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),e.jsxs("table",{className:"nice-invoice-lines__table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"nice-il__th-num",children:"#"}),e.jsx("th",{className:"nice-il__th-desc",children:P("description","Description")}),e.jsx("th",{className:"nice-il__th-qty",children:P("qty","Qty")}),S&&e.jsx("th",{className:"nice-il__th-unit",children:P("unit","Unit")}),e.jsx("th",{className:"nice-il__th-price",children:P("unitPrice","Unit Price")}),y&&e.jsx("th",{className:"nice-il__th-disc",children:P("discount","Disc %")}),e.jsx("th",{className:"nice-il__th-vat",children:P("vat","VAT %")}),e.jsx("th",{className:"nice-il__th-net",children:P("net","Net")}),e.jsx("th",{className:"nice-il__th-gross",children:P("gross","Gross")}),M&&!o&&e.jsx("th",{className:"nice-il__th-actions"})]})}),e.jsx("tbody",{children:D.map((x,$)=>e.jsxs("tr",{children:[e.jsx("td",{className:"nice-il__cell-num",children:$+1}),e.jsx("td",{className:"nice-il__cell-desc",children:e.jsx("input",{className:"nice-input",type:"text",value:x.description,onChange:A=>N($,"description",A.target.value),disabled:i,readOnly:o,placeholder:P("itemDescription","Item description")})}),e.jsx("td",{className:"nice-il__cell-qty",children:e.jsx("input",{className:"nice-input",type:"number",value:x.quantity,onChange:A=>N($,"quantity",parseFloat(A.target.value)||0),disabled:i,readOnly:o,min:0,step:"any"})}),S&&e.jsx("td",{className:"nice-il__cell-unit",children:e.jsx("select",{className:"nice-select",value:x.unit??"",onChange:A=>N($,"unit",A.target.value),disabled:i,children:w.map(A=>e.jsx("option",{value:A,children:A},A))})}),e.jsx("td",{className:"nice-il__cell-price",children:e.jsx("input",{className:"nice-input",type:"number",value:x.unitPrice,onChange:A=>N($,"unitPrice",parseFloat(A.target.value)||0),disabled:i,readOnly:o,min:0,step:"0.01"})}),y&&e.jsx("td",{className:"nice-il__cell-disc",children:e.jsx("input",{className:"nice-input",type:"number",value:x.discount??0,onChange:A=>N($,"discount",parseFloat(A.target.value)||0),disabled:i,readOnly:o,min:0,max:100})}),e.jsx("td",{className:"nice-il__cell-vat",children:e.jsx("select",{className:"nice-select",value:x.vatRate??0,onChange:A=>N($,"vatRate",parseInt(A.target.value,10)),disabled:i,children:v.map(A=>e.jsxs("option",{value:A,children:[A,"%"]},A))})}),e.jsx("td",{className:"nice-il__cell-net",children:R(x.netAmount??0)}),e.jsx("td",{className:"nice-il__cell-gross",children:R(x.grossAmount??0)}),M&&!o&&e.jsx("td",{className:"nice-il__cell-actions",children:e.jsx("button",{type:"button",className:"nice-btn nice-btn--icon nice-btn--sm",onClick:()=>E($),disabled:i,title:P("remove","Remove"),children:"✕"})})]},x.id))})]}),M&&!o&&e.jsxs("button",{type:"button",className:"nice-btn nice-btn--outlined nice-btn--sm nice-invoice-lines__add",onClick:H,disabled:i||_!=null&&g.length>=_,children:["+ ",P("addLine","Add line")]}),k&&e.jsxs("div",{className:"nice-invoice-lines__totals",children:[e.jsxs("div",{className:"nice-il__total-row",children:[e.jsxs("span",{children:[P("totalNet","Net total"),":"]}),e.jsx("span",{className:"nice-il__total-value",children:R(T.totalNet)})]}),T.vatBreakdown.map(x=>e.jsxs("div",{className:"nice-il__total-row nice-il__total-row--vat",children:[e.jsxs("span",{children:["VAT ",x.rate,"%:"]}),e.jsx("span",{className:"nice-il__total-value",children:R(x.amount)})]},x.rate)),e.jsxs("div",{className:"nice-il__total-row nice-il__total-row--gross",children:[e.jsxs("span",{children:[P("totalGross","Gross total"),":"]}),e.jsx("span",{className:"nice-il__total-value nice-il__total-value--gross",children:R(T.totalGross)})]})]}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});xi.displayName="NiceInvoiceLineEditor";const vi=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,value:g=[],onChange:f,contacts:m=[],onSearch:b,searchDelay:C=300,multiple:v=!1,placeholder:w,onContactClick:y,maxSelections:S},k)=>{const M=Oe(u,d);if(M==="hidden")return null;M==="disabled"&&(i=!0),M==="readOnly"&&(o=!0);const{t:_}=Re(),j=Ae(d),[z,P]=s.useState(""),[I,D]=s.useState([]),[T,N]=s.useState(!1),[H,E]=s.useState(!1),R=s.useMemo(()=>{const O=[...m,...I],F=new Map(O.map(L=>[L.id,L]));return g.map(L=>F.get(L)).filter(Boolean)},[g,m,I]),x=s.useCallback(O=>{if(P(O),O.length<1){D([]),N(!1);return}if(b){E(!0);const G=setTimeout(async()=>{const V=await b(O);D(V),N(!0),E(!1)},C);return()=>clearTimeout(G)}const F=O.toLowerCase(),L=m.filter(G=>{var V,B;return G.name.toLowerCase().includes(F)||((V=G.email)==null?void 0:V.toLowerCase().includes(F))||((B=G.phone)==null?void 0:B.includes(O))});D(L),N(!0)},[b,m,C]),$=s.useCallback(O=>{if(v)if(g.includes(O.id))f==null||f(g.filter(F=>F!==O.id));else{if(S&&g.length>=S)return;f==null||f([...g,O.id])}else f==null||f([O.id]),N(!1),P("")},[g,f,v,S]),A=s.useCallback(O=>{f==null||f(g.filter(F=>F!==O))},[g,f]);return e.jsxs("div",{ref:k,id:j,className:`nice-contact-picker nice-size-${c}${p?` ${p}`:""}${r?" nice-error":""}${i?" nice-disabled":""}`,style:h,children:[t&&e.jsxs("label",{className:"nice-contact-picker__label",children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),R.length>0&&e.jsx("div",{className:"nice-contact-picker__chips",children:R.map(O=>e.jsxs("span",{className:"nice-contact-picker__chip",onClick:()=>y==null?void 0:y(O),children:[O.avatarUrl&&e.jsx("img",{src:O.avatarUrl,alt:"",className:"nice-contact-picker__chip-avatar"}),e.jsx("span",{children:O.name}),!o&&e.jsx("button",{type:"button",className:"nice-contact-picker__chip-remove",onClick:F=>{F.stopPropagation(),A(O.id)},disabled:i,children:"×"})]},O.id))}),!o&&e.jsxs("div",{className:"nice-contact-picker__search",children:[e.jsx("input",{className:"nice-input",type:"text",value:z,onChange:O=>x(O.target.value),onFocus:()=>z.length>0&&N(!0),onBlur:()=>setTimeout(()=>N(!1),200),placeholder:w??_("searchContacts","Search contacts…"),disabled:i,"aria-label":_("searchContacts","Search contacts")}),H&&e.jsx("span",{className:"nice-contact-picker__spinner",children:"⏳"})]}),T&&I.length>0&&e.jsx("div",{className:"nice-contact-picker__dropdown",role:"listbox",children:I.map(O=>e.jsxs("div",{className:`nice-contact-picker__option${g.includes(O.id)?" nice-contact-picker__option--selected":""}`,role:"option","aria-selected":g.includes(O.id),onClick:()=>$(O),children:[O.avatarUrl&&e.jsx("img",{src:O.avatarUrl,alt:"",className:"nice-contact-picker__option-avatar"}),e.jsxs("div",{className:"nice-contact-picker__option-info",children:[e.jsx("span",{className:"nice-contact-picker__option-name",children:O.name}),O.subtitle&&e.jsx("span",{className:"nice-contact-picker__option-subtitle",children:O.subtitle}),O.email&&e.jsx("span",{className:"nice-contact-picker__option-email",children:O.email})]}),O.type&&e.jsx("span",{className:"nice-contact-picker__option-type",children:O.type==="person"?"👤":"🏢"})]},O.id))}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});vi.displayName="NiceContactPicker";const yp=["highlight","underline","strikethrough","freehand","text","rect","arrow"],bp={highlight:"🖍️",underline:"⎁",strikethrough:"S̶",freehand:"✏️",text:"T",rect:"▭",arrow:"→",stamp:"🔏"},ki=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",id:l,className:d,style:p,accessMode:h,src:u,annotations:g=[],onAnnotationsChange:f,activeTool:m,onToolChange:b,currentPage:C=1,onPageChange:v,totalPages:w=1,defaultColor:y="#FFFF00",tools:S=yp,author:k,zoom:M=1,onZoomChange:_,onAnnotationClick:j,onAnnotationDelete:z},P)=>{const I=Oe(h,l);if(I==="hidden")return null;I==="disabled"&&(i=!0),I==="readOnly"&&(o=!0);const{t:D}=Re(),T=Ae(l),N=g.filter(R=>R.page===C),H=s.useCallback(R=>{b==null||b(m===R?null:R)},[m,b]),E=s.useCallback(R=>{if(o||!m||m==="freehand")return;const x=R.currentTarget.getBoundingClientRect(),$=(R.clientX-x.left)/x.width,A=(R.clientY-x.top)/x.height,O={id:`ann-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,tool:m,page:C,x:$,y:A,color:y,author:k,createdAt:new Date().toISOString(),text:m==="text"?"":void 0};f==null||f([...g,O])},[o,m,C,y,k,g,f]);return e.jsxs("div",{ref:P,id:T,className:`nice-pdf-annotation nice-size-${c}${d?` ${d}`:""}${r?" nice-error":""}${i?" nice-disabled":""}`,style:p,children:[t&&e.jsxs("div",{className:"nice-pdf-annotation__label",children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),!o&&e.jsxs("div",{className:"nice-pdf-annotation__toolbar",children:[S.map(R=>e.jsx("button",{type:"button",className:`nice-pdf-annotation__tool-btn${m===R?" nice-pdf-annotation__tool-btn--active":""}`,onClick:()=>H(R),disabled:i,title:D(`pdfTool_${R}`,R),children:bp[R]},R)),e.jsx("span",{className:"nice-pdf-annotation__toolbar-sep"}),e.jsx("button",{type:"button",disabled:i,onClick:()=>_==null?void 0:_(Math.max(.25,M-.25)),title:D("zoomOut","Zoom out"),children:"−"}),e.jsxs("span",{className:"nice-pdf-annotation__zoom",children:[Math.round(M*100),"%"]}),e.jsx("button",{type:"button",disabled:i,onClick:()=>_==null?void 0:_(Math.min(4,M+.25)),title:D("zoomIn","Zoom in"),children:"+"})]}),e.jsxs("div",{className:"nice-pdf-annotation__viewport",style:{transform:`scale(${M})`,transformOrigin:"top left"},children:[e.jsx("iframe",{src:u,className:"nice-pdf-annotation__frame",title:D("pdfViewer","PDF Viewer")}),e.jsx("div",{className:"nice-pdf-annotation__layer",onClick:E,children:N.map(R=>e.jsxs("div",{className:`nice-pdf-annotation__mark nice-pdf-annotation__mark--${R.tool}`,style:{left:`${R.x*100}%`,top:`${R.y*100}%`,backgroundColor:R.color},onClick:x=>{x.stopPropagation(),j==null||j(R)},title:R.text??R.tool,children:[R.text&&e.jsx("span",{children:R.text}),!o&&e.jsx("button",{type:"button",className:"nice-pdf-annotation__mark-delete",onClick:x=>{x.stopPropagation(),z==null||z(R.id)},children:"×"})]},R.id))})]}),e.jsxs("div",{className:"nice-pdf-annotation__pager",children:[e.jsx("button",{type:"button",disabled:i||C<=1,onClick:()=>v==null?void 0:v(C-1),children:"◀"}),e.jsx("span",{children:D("pageOf","{page} / {total}").replace("{page}",String(C)).replace("{total}",String(w))}),e.jsx("button",{type:"button",disabled:i||C>=w,onClick:()=>v==null?void 0:v(C+1),children:"▶"})]}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});ki.displayName="NicePDFAnnotationEditor";const wi=s.forwardRef(({label:t,helperText:a,error:r,disabled:n,readOnly:i,size:o="md",id:c,className:l,style:d,accessMode:p,pages:h,selectedPageId:u,content:g="",contentFormat:f="html",editing:m=!1,onPageSelect:b,onContentChange:C,onSave:v,onCreatePage:w,onDeletePage:y,onEditToggle:S,onVersionHistory:k,sidebarWidth:M=260,sidebarCollapsed:_=!1,onSidebarToggle:j,searchable:z=!0,onSearch:P},I)=>{const D=Oe(p,c);if(D==="hidden")return null;D==="disabled"&&(n=!0),D==="readOnly"&&(i=!0);const{t:T}=Re(),N=Ae(c),[H,E]=s.useState(""),[R,x]=s.useState(""),[$,A]=s.useState(!1),O=s.useMemo(()=>{const V=B=>{for(const Y of B){if(Y.id===u)return Y;if(Y.children){const J=V(Y.children);if(J)return J}}};return V(h)},[h,u]),F=s.useCallback(V=>{E(V),P==null||P(V)},[P]),L=s.useCallback(()=>{R.trim()&&(w==null||w(u??null,R.trim()),x(""),A(!1))},[R,u,w]),G=(V,B=0)=>e.jsx("ul",{className:"nice-wiki__tree",style:{paddingLeft:B>0?16:0},children:V.map(Y=>{var J;return e.jsxs("li",{className:"nice-wiki__tree-item",children:[e.jsxs("div",{className:`nice-wiki__tree-node${Y.id===u?" nice-wiki__tree-node--active":""}${Y.isDraft?" nice-wiki__tree-node--draft":""}`,onClick:()=>b==null?void 0:b(Y),role:"treeitem","aria-selected":Y.id===u,children:[e.jsx("span",{className:"nice-wiki__tree-icon",children:(J=Y.children)!=null&&J.length?"📁":"📄"}),e.jsx("span",{className:"nice-wiki__tree-title",children:Y.title}),Y.isDraft&&e.jsx("span",{className:"nice-wiki__tree-draft",children:T("draft","Draft")})]}),Y.children&&Y.children.length>0&&G(Y.children,B+1)]},Y.id)})});return e.jsxs("div",{ref:I,id:N,className:`nice-wiki nice-size-${o}${l?` ${l}`:""}${n?" nice-disabled":""}`,style:d,children:[!_&&e.jsxs("aside",{className:"nice-wiki__sidebar",style:{width:M},children:[e.jsxs("div",{className:"nice-wiki__sidebar-header",children:[e.jsx("span",{className:"nice-wiki__sidebar-title",children:t??T("wiki","Wiki")}),j&&e.jsx("button",{type:"button",className:"nice-wiki__sidebar-toggle",onClick:()=>j(!0),children:"«"})]}),z&&e.jsx("input",{type:"text",className:"nice-input nice-wiki__search",value:H,onChange:V=>F(V.target.value),placeholder:T("searchPages","Search pages…"),disabled:n}),e.jsx("div",{className:"nice-wiki__page-tree",role:"tree",children:G(h)}),w&&!i&&e.jsx("div",{className:"nice-wiki__sidebar-footer",children:$?e.jsxs("div",{className:"nice-wiki__create-form",children:[e.jsx("input",{type:"text",className:"nice-input",value:R,onChange:V=>x(V.target.value),placeholder:T("pageTitle","Page title"),onKeyDown:V=>V.key==="Enter"&&L(),disabled:n}),e.jsx("button",{type:"button",disabled:n||!R.trim(),onClick:L,children:"✓"}),e.jsx("button",{type:"button",onClick:()=>A(!1),children:"✕"})]}):e.jsxs("button",{type:"button",className:"nice-wiki__add-page",onClick:()=>A(!0),disabled:n,children:["+ ",T("newPage","New page")]})})]}),_&&j&&e.jsx("button",{type:"button",className:"nice-wiki__sidebar-expand",onClick:()=>j(!1),children:"»"}),e.jsx("main",{className:"nice-wiki__content",children:O?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-wiki__content-header",children:[e.jsx("h1",{className:"nice-wiki__page-title",children:O.title}),e.jsxs("div",{className:"nice-wiki__content-actions",children:[S&&!i&&e.jsx("button",{type:"button",disabled:n,onClick:()=>S(!m),children:m?T("preview","Preview"):T("edit","Edit")}),k&&e.jsx("button",{type:"button",disabled:n,onClick:()=>k(O.id),children:T("history","History")}),y&&!i&&e.jsx("button",{type:"button",className:"nice-btn--danger",disabled:n,onClick:()=>y(O.id),children:T("delete","Delete")})]})]}),O.updatedAt&&e.jsxs("div",{className:"nice-wiki__page-meta",children:[O.updatedBy&&e.jsxs("span",{children:[T("lastEditedBy","Last edited by")," ",O.updatedBy]}),e.jsx("span",{children:new Date(O.updatedAt).toLocaleDateString()})]}),m?e.jsxs("div",{className:"nice-wiki__editor",children:[e.jsx("textarea",{className:"nice-wiki__editor-textarea",value:g,onChange:V=>C==null?void 0:C(V.target.value),disabled:n}),v&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",disabled:n,onClick:()=>v(O.id,g),children:T("save","Save")})]}):e.jsx("div",{className:"nice-wiki__viewer",children:f==="html"?e.jsx("div",{className:"nice-wiki__html",dangerouslySetInnerHTML:{__html:la(g)}}):e.jsx("pre",{className:"nice-wiki__markdown",children:g})})]}):e.jsx("div",{className:"nice-wiki__empty",children:e.jsx("p",{children:T("selectPage","Select a page from the sidebar or create a new one.")})})}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});wi.displayName="NiceWiki";const xp=[{code:"PL",label:"Polska",prefix:"PL",pattern:/^\d{10}$/,placeholder:"1234567890"},{code:"DE",label:"Deutschland",prefix:"DE",pattern:/^\d{9}$/,placeholder:"123456789"},{code:"GB",label:"United Kingdom",prefix:"GB",pattern:/^\d{9}(\d{3})?$/,placeholder:"123456789"},{code:"FR",label:"France",prefix:"FR",pattern:/^[A-Z0-9]{2}\d{9}$/,placeholder:"XX123456789"},{code:"CZ",label:"Česko",prefix:"CZ",pattern:/^\d{8,10}$/,placeholder:"12345678"},{code:"SK",label:"Slovensko",prefix:"SK",pattern:/^\d{10}$/,placeholder:"1234567890"},{code:"IT",label:"Italia",prefix:"IT",pattern:/^\d{11}$/,placeholder:"12345678901"},{code:"ES",label:"España",prefix:"ES",pattern:/^[A-Z0-9]\d{7}[A-Z0-9]$/,placeholder:"X1234567X"}],_i=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,value:g="",onChange:f,countryCode:m="PL",onCountryChange:b,countries:C=xp,showCountrySelector:v=!0,autoPrefixVat:w=!0,validationResult:y,onValidateRequest:S,placeholder:k},M)=>{const _=Oe(u,d);if(_==="hidden")return null;_==="disabled"&&(i=!0),_==="readOnly"&&(o=!0);const{t:j}=Re(),z=Ae(d),P=s.useMemo(()=>C.find(H=>H.code===m)??C[0],[C,m]),I=s.useCallback(H=>{let E=H.toUpperCase();return P&&E.startsWith(P.prefix)&&(E=E.slice(P.prefix.length)),P?P.pattern.test(E):E.length>0},[P]),D=s.useCallback(H=>{const E=H.target.value.replace(/\s/g,"");f==null||f(E,I(E))},[f,I]),T=w&&g&&P&&!g.toUpperCase().startsWith(P.prefix)?`${P.prefix}${g}`:g,N=I(g);return e.jsxs("div",{ref:M,id:z,className:`nice-vat-input nice-size-${c}${p?` ${p}`:""}${r||!N&&g.length>0?" nice-error":""}${i?" nice-disabled":""}`,style:h,children:[t&&e.jsxs("label",{className:"nice-vat-input__label",htmlFor:`${z}-input`,children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),e.jsxs("div",{className:"nice-vat-input__row",children:[v&&e.jsx("select",{className:"nice-vat-input__country",value:m,onChange:H=>b==null?void 0:b(H.target.value),disabled:i||o,children:C.map(H=>e.jsx("option",{value:H.code,children:H.prefix},H.code))}),e.jsx("input",{id:`${z}-input`,className:"nice-input nice-vat-input__field",type:"text",name:l,value:g,onChange:D,readOnly:o,disabled:i,placeholder:k??(P==null?void 0:P.placeholder),required:n,"aria-invalid":!N&&g.length>0}),S&&g.length>0&&e.jsx("button",{type:"button",className:"nice-vat-input__verify",disabled:i||!N,onClick:()=>S(w?T:g,m),title:j("verifyVat","Verify VAT number"),children:"🔍"})]}),y&&e.jsxs("div",{className:`nice-vat-input__result nice-vat-input__result--${y.valid?"valid":"invalid"}`,children:[y.valid?"✅":"❌"," ",y.companyName??y.error??(y.valid?j("vatValid","VAT number valid"):j("vatInvalid","VAT number invalid"))]}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});_i.displayName="NiceVatInput";const vp=[{id:"pl-23",label:"23%",rate:.23,countryCode:"PL",category:"standard",isDefault:!0},{id:"pl-8",label:"8%",rate:.08,countryCode:"PL",category:"reduced"},{id:"pl-5",label:"5%",rate:.05,countryCode:"PL",category:"reduced"},{id:"pl-0",label:"0%",rate:0,countryCode:"PL",category:"zero"},{id:"pl-zw",label:"zw.",rate:0,countryCode:"PL",category:"exempt"},{id:"pl-np",label:"n.p.",rate:0,countryCode:"PL",category:"exempt"}],ji=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,value:g,onChange:f,rates:m,countryCode:b,placeholder:C,showPercentage:v=!0},w)=>{const y=Oe(u,d);if(y==="hidden")return null;y==="disabled"&&(i=!0),y==="readOnly"&&(o=!0);const{t:S}=Re(),k=Ae(d),M=s.useMemo(()=>{const j=m??vp;return b?j.filter(z=>!z.countryCode||z.countryCode===b):j},[m,b]),_=s.useCallback(j=>{const z=j.target.value,P=M.find(I=>I.id===z);P&&(f==null||f(z,P))},[f,M]);return e.jsxs("div",{ref:w,id:k,className:`nice-tax-rate nice-size-${c}${p?` ${p}`:""}${r?" nice-error":""}${i?" nice-disabled":""}`,style:h,children:[t&&e.jsxs("label",{className:"nice-tax-rate__label",htmlFor:`${k}-select`,children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),e.jsxs("select",{id:`${k}-select`,className:"nice-select nice-tax-rate__select",name:l,value:g??"",onChange:_,disabled:i||o,required:n,children:[e.jsx("option",{value:"",disabled:!0,children:C??S("selectRate","Select rate…")}),M.map(j=>e.jsxs("option",{value:j.id,children:[j.label,v&&j.category!=="exempt"?` (${(j.rate*100).toFixed(0)}%)`:""]},j.id))]}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});ji.displayName="NiceTaxRatePicker";const kp={asset:"var(--nice-color-info, #5bc0de)",liability:"var(--nice-color-warning, #f0ad4e)",equity:"var(--nice-color-success, #5cb85c)",revenue:"var(--nice-color-primary, #337ab7)",expense:"var(--nice-color-error, #d9534f)"},Ci=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,value:g,onChange:f,accounts:m,treeView:b=!1,placeholder:C,searchable:v=!0,showType:w=!0,onSearch:y},S)=>{const k=Oe(u,d);if(k==="hidden")return null;k==="disabled"&&(i=!0),k==="readOnly"&&(o=!0);const{t:M}=Re(),_=Ae(d),[j,z]=s.useState(""),[P,I]=s.useState(!1),D=s.useMemo(()=>{const R=x=>{for(const $ of x){if($.code===g)return $;if($.children){const A=R($.children);if(A)return A}}};return R(m)},[m,g]),T=s.useMemo(()=>{const R=[],x=$=>{for(const A of $)R.push(A),A.children&&x(A.children)};return x(m),R},[m]),N=s.useMemo(()=>{if(!j)return T;const R=j.toLowerCase();return T.filter(x=>x.code.toLowerCase().includes(R)||x.name.toLowerCase().includes(R))},[T,j]),H=s.useCallback(R=>{z(R),y==null||y(R),I(!0)},[y]),E=s.useCallback(R=>{f==null||f(R.code,R),I(!1),z("")},[f]);return e.jsxs("div",{ref:S,id:_,className:`nice-account-picker nice-size-${c}${p?` ${p}`:""}${r?" nice-error":""}${i?" nice-disabled":""}`,style:h,children:[t&&e.jsxs("label",{className:"nice-account-picker__label",htmlFor:`${_}-input`,children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),e.jsx("div",{className:"nice-account-picker__control",children:v&&!o?e.jsx("input",{id:`${_}-input`,className:"nice-input",type:"text",value:P?j:D?`${D.code} — ${D.name}`:"",onChange:R=>H(R.target.value),onFocus:()=>{z(""),I(!0)},onBlur:()=>setTimeout(()=>I(!1),200),placeholder:C??M("searchAccount","Search account…"),disabled:i,required:n}):e.jsx("div",{className:"nice-account-picker__display",children:D?`${D.code} — ${D.name}`:C??M("selectAccount","Select account…")})}),P&&N.length>0&&e.jsx("div",{className:"nice-account-picker__dropdown",role:"listbox",children:N.map(R=>e.jsxs("div",{className:`nice-account-picker__option${R.code===g?" nice-account-picker__option--selected":""}${R.isActive===!1?" nice-account-picker__option--inactive":""}`,role:"option","aria-selected":R.code===g,onClick:()=>E(R),children:[w&&R.type&&e.jsx("span",{className:"nice-account-picker__type",style:{color:kp[R.type]},title:R.type,children:"●"}),e.jsx("span",{className:"nice-account-picker__code",children:R.code}),e.jsx("span",{className:"nice-account-picker__name",children:R.name})]},R.code))}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});Ci.displayName="NiceAccountPicker";const Si=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",id:l,className:d,style:p,accessMode:h,mode:u="manual",onScan:g,onModeChange:f,beepOnScan:m=!0,beepFrequency:b=1800,beepDuration:C=150,placeholder:v,scanHistory:w=[],showHistory:y=!0,maxHistory:S=10,autoFocus:k=!0,onCameraFrame:M},_)=>{const j=Oe(h,l);if(j==="hidden")return null;j==="disabled"&&(i=!0),j==="readOnly"&&(o=!0);const{t:z}=Re(),P=Ae(l),[I,D]=s.useState(""),T=s.useRef(null),N=s.useRef(null),H=s.useCallback(()=>{if(m)try{N.current||(N.current=new AudioContext);const x=N.current,$=x.createOscillator(),A=x.createGain();$.connect(A),A.connect(x.destination),$.frequency.value=b,$.type="square",A.gain.value=.3,$.start(),$.stop(x.currentTime+C/1e3)}catch{}},[m,b,C]),E=s.useCallback(()=>{var x;I.trim()&&(H(),g==null||g({value:I.trim(),format:"manual",scannedAt:new Date}),D(""),(x=T.current)==null||x.focus())},[I,g,H]),R=w.slice(0,S);return e.jsxs("div",{ref:_,id:P,className:`nice-scanner nice-size-${c}${d?` ${d}`:""}${r?" nice-error":""}${i?" nice-disabled":""}`,style:p,children:[t&&e.jsxs("div",{className:"nice-scanner__label",children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),e.jsxs("div",{className:"nice-scanner__modes",children:[e.jsxs("button",{type:"button",className:`nice-scanner__mode-btn${u==="camera"?" nice-scanner__mode-btn--active":""}`,onClick:()=>f==null?void 0:f("camera"),disabled:i,children:["📷 ",z("camera","Camera")]}),e.jsxs("button",{type:"button",className:`nice-scanner__mode-btn${u==="manual"?" nice-scanner__mode-btn--active":""}`,onClick:()=>f==null?void 0:f("manual"),disabled:i,children:["⌨️ ",z("manual","Manual")]})]}),u==="camera"&&e.jsx("div",{className:"nice-scanner__camera",children:e.jsx("div",{className:"nice-scanner__viewfinder",children:e.jsxs("div",{className:"nice-scanner__viewfinder-overlay",children:[e.jsx("span",{children:"📷"}),e.jsx("p",{children:z("cameraPlaceholder","Camera preview — connect scanner adapter")})]})})}),u==="manual"&&!o&&e.jsxs("div",{className:"nice-scanner__manual",children:[e.jsx("input",{ref:T,className:"nice-input nice-scanner__input",type:"text",value:I,onChange:x=>D(x.target.value),onKeyDown:x=>x.key==="Enter"&&E(),placeholder:v??z("enterCode","Enter or scan code…"),disabled:i,autoFocus:k}),e.jsx("button",{type:"button",className:"nice-scanner__submit",onClick:E,disabled:i||!I.trim(),children:"✓"})]}),y&&R.length>0&&e.jsxs("div",{className:"nice-scanner__history",children:[e.jsx("div",{className:"nice-scanner__history-label",children:z("recentScans","Recent scans")}),R.map((x,$)=>e.jsxs("div",{className:"nice-scanner__history-item",children:[e.jsx("span",{className:"nice-scanner__history-value",children:x.value}),x.format&&e.jsx("span",{className:"nice-scanner__history-format",children:x.format}),e.jsx("span",{className:"nice-scanner__history-time",children:x.scannedAt.toLocaleTimeString()})]},$))]}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});Si.displayName="NiceScannerControl";const Ni=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",id:l,className:d,style:p,accessMode:h,value:u="",onChange:g,onComplete:f,length:m=4,masked:b=!0,showKeypad:C=!1,autoSubmit:v=!0,shake:w=!1,placeholderChar:y="·"},S)=>{const k=Oe(h,l);if(k==="hidden")return null;k==="disabled"&&(i=!0),k==="readOnly"&&(o=!0);const{t:M}=Re(),_=Ae(l),j=s.useRef([]),[z,P]=s.useState(!1);s.useEffect(()=>{if(w){P(!0);const H=setTimeout(()=>P(!1),500);return()=>clearTimeout(H)}},[w]);const I=u.split("").slice(0,m);for(;I.length<m;)I.push("");const D=s.useCallback((H,E)=>{var $;const R=[...I];R[H]=E;const x=R.join("");g==null||g(x),E&&H<m-1&&(($=j.current[H+1])==null||$.focus()),v&&x.length===m&&x.indexOf("")===-1&&(f==null||f(x))},[I,m,g,f,v]),T=s.useCallback((H,E)=>{var R,x,$;H.key==="Backspace"&&!I[E]&&E>0&&((R=j.current[E-1])==null||R.focus(),D(E-1,"")),H.key==="ArrowLeft"&&E>0&&((x=j.current[E-1])==null||x.focus()),H.key==="ArrowRight"&&E<m-1&&(($=j.current[E+1])==null||$.focus())},[I,m,D]),N=s.useCallback(H=>{var E,R,x;if(H==="clear"){g==null||g(""),(E=j.current[0])==null||E.focus();return}if(H==="backspace"){const $=u.slice(0,-1);g==null||g($);const A=Math.max(0,$.length-1);(R=j.current[A])==null||R.focus();return}if(u.length<m){const $=u+H;g==null||g($),$.length<m&&((x=j.current[$.length])==null||x.focus()),v&&$.length===m&&(f==null||f($))}},[u,m,g,f,v]);return e.jsxs("div",{ref:S,id:_,className:`nice-pin nice-size-${c}${z?" nice-pin--shake":""}${d?` ${d}`:""}${r?" nice-error":""}${i?" nice-disabled":""}`,style:p,children:[t&&e.jsxs("label",{className:"nice-pin__label",children:[t,n&&e.jsx("span",{className:"nice-required",children:"*"})]}),e.jsx("div",{className:"nice-pin__boxes",children:I.map((H,E)=>e.jsx("input",{ref:R=>{j.current[E]=R},className:"nice-pin__box",type:b?"password":"text",inputMode:"numeric",maxLength:1,value:H,onChange:R=>{const x=R.target.value.replace(/\D/g,"");x.length<=1&&D(E,x)},onKeyDown:R=>T(R,E),disabled:i,readOnly:o,placeholder:y,"aria-label":`${M("digit","Digit")} ${E+1}`},E))}),C&&!o&&e.jsx("div",{className:"nice-pin__keypad",children:["1","2","3","4","5","6","7","8","9","clear","0","backspace"].map(H=>e.jsx("button",{type:"button",className:`nice-pin__key${H==="clear"||H==="backspace"?" nice-pin__key--action":""}`,onClick:()=>N(H),disabled:i,children:H==="clear"?"C":H==="backspace"?"⌫":H},H))}),a&&e.jsx("span",{className:"nice-helper-text",children:a}),r&&typeof r=="string"&&e.jsx("span",{className:"nice-error-text",children:r})]})});Ni.displayName="NicePinCodeInput";const Jr=Object.freeze(Object.defineProperty({__proto__:null,$:_i,A:ir,B:xi,C:sr,D:Zn,E:hr,F:ar,G:or,H:pr,I:ki,J:nr,K:gi,L:cr,M:Ni,N:Ci,O:On,P:Qn,Q:rr,R:Si,T:gr,U:wt,V:Jn,W:ji,X:Ya,Y:tr,_:lr,a:fi,a0:wi,a4:Gn,a5:ni,a8:oi,aa:ii,ab:ia,ac:ra,ad:Yn,ae:Bt,af:qn,ag:za,ah:Lt,ai:Ht,aj:ft,ak:Bn,al:Kn,am:Hn,an:Wn,ao:Ua,ap:na,aq:ju,ar:Ou,b:Un,c:ha,d:ur,e:dr,g:Xa,h:vi,k:yi,l:Ga,m:Xn,n:er,o:br,p:ei,r:hi,s:si,t:Qa,u:Ja,v:fa,x:li,y:fr,z:mr},Symbol.toStringTag,{value:"Module"})),ct=s.forwardRef(({label:t,helperText:a,error:r,required:n,disabled:i,readOnly:o,size:c="md",name:l,id:d,className:p,style:h,accessMode:u,displayStyle:g,value:f,onChange:m,onBlur:b,onKeyDown:C,placeholder:v,min:w,max:y,step:S=1,precision:k,prefix:M,suffix:_,showStepper:j=!0,submitOnEnter:z,onSubmit:P,showKeyboardHints:I},D)=>{const T=Oe(u,d);if(T==="hidden")return null;T==="disabled"&&(i=!0),T==="readOnly"&&(o=!0);const{t:N}=Re(),H=Ae(d),E=gt("input",g),R=it("input",g),x=s.useCallback(V=>{let B=V;return w!==void 0&&(B=Math.max(w,B)),y!==void 0&&(B=Math.min(y,B)),k!==void 0&&(B=parseFloat(B.toFixed(k))),B},[w,y,k]),$=s.useCallback(V=>{const B=V.target.value;if(B===""){m==null||m(null);return}const Y=parseFloat(B);isNaN(Y)||(m==null||m(x(Y)))},[m,x]),A=s.useCallback(()=>{m==null||m(x((f??0)+S))},[f,S,m,x]),O=s.useCallback(()=>{m==null||m(x((f??0)-S))},[f,S,m,x]),F=Ia({enabled:z,onSubmit:P}),L=s.useCallback(V=>{F(V),C==null||C(V)},[F,C]),G=s.useMemo(()=>{const V=[];return z&&V.push(qe.submit),j&&(V.push({key:"ArrowUp",description:N("shortcuts.increment","Increase value")}),V.push({key:"ArrowDown",description:N("shortcuts.decrement","Decrease value")})),V},[z,j,N]);return e.jsxs("div",{className:`nice-field ${p||""}`,style:h,children:[t&&e.jsxs("label",{htmlFor:H,className:`nice-field__label ${n?"nice-field__label--required":""}`,children:[t,I&&G.length>0&&e.jsx(tt,{shortcuts:G,size:"sm"})]}),e.jsxs("div",{className:`nice-input nice-input--${c} nice-input--ds-${R} ${r?"nice-input--error":""} ${i?"nice-input--disabled":""} ${o?"nice-input--readonly":""}`,style:E,children:[M&&e.jsx("span",{className:"nice-input__icon",children:M}),j&&!o&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:O,disabled:i,"aria-label":N("controls.decrement","Decrement"),children:"−"}),e.jsx("input",{ref:D,id:H,className:"nice-input__native",type:"number",name:l,value:f??"",placeholder:v,min:w,max:y,step:S,disabled:i,readOnly:o,"aria-invalid":!!r,onChange:$,onBlur:b,onKeyDown:L}),j&&!o&&e.jsx("button",{type:"button",className:"nice-input__clear",onClick:A,disabled:i,"aria-label":N("controls.increment","Increment"),children:"+"}),_&&e.jsx("span",{className:"nice-input__icon",children:_})]}),r&&e.jsx("div",{className:"nice-field__error",role:"alert",children:r}),!r&&a&&e.jsx("div",{className:"nice-field__helper",children:a})]})});ct.displayName="NiceNumberInput";const zt=s.forwardRef(({label:t,checked:a=!1,indeterminate:r=!1,onChange:n,disabled:i,size:o="md",name:c,id:l,className:d,style:p,error:h,accessMode:u,displayStyle:g,showKeyboardHints:f},m)=>{const b=Oe(u,l);if(b==="hidden")return null;(b==="disabled"||b==="readOnly")&&(i=!0);const{t:C}=Re(),v=Ae(l);it("toggle",g);const w=s.useMemo(()=>[{key:"Space",description:C("shortcuts.toggle","Toggle")}],[C]),y=s.useCallback(S=>{S&&(S.indeterminate=r),typeof m=="function"?m(S):m&&(m.current=S)},[r,m]);return e.jsxs("div",{className:d,style:p,children:[e.jsxs("label",{className:`nice-checkbox ${o!=="md"?`nice-checkbox--${o}`:""} ${i?"nice-checkbox--disabled":""}`,htmlFor:v,children:[e.jsx("input",{ref:y,id:v,type:"checkbox",className:"nice-checkbox__input",name:c,checked:a,disabled:i,"aria-invalid":!!h,onChange:S=>n==null?void 0:n(S.target.checked)}),e.jsx("span",{className:"nice-checkbox__box",children:e.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r?e.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"}):e.jsx("polyline",{points:"2 6 5 9 10 3"})})}),t&&e.jsx("span",{children:t}),f&&e.jsx(tt,{shortcuts:w,size:"sm"})]}),h&&e.jsx("div",{className:"nice-field__error",role:"alert",children:h})]})});zt.displayName="NiceCheckbox";const Mi=s.forwardRef(({label:t,checked:a=!1,onChange:r,disabled:n,size:i="md",name:o,id:c,className:l,style:d,accessMode:p,displayStyle:h,showKeyboardHints:u},g)=>{const f=Oe(p,c);if(f==="hidden")return null;(f==="disabled"||f==="readOnly")&&(n=!0);const{t:m}=Re(),b=Ae(c),C=gt("toggle",h),v=it("toggle",h),w=s.useMemo(()=>[{key:"Space",description:m("shortcuts.toggle","Toggle on/off")}],[m]);return e.jsxs("label",{className:`nice-toggle nice-toggle--ds-${v} ${i!=="md"?`nice-toggle--${i}`:""} ${n?"nice-toggle--disabled":""} ${l||""}`,htmlFor:b,style:{...C,...d},children:[e.jsx("input",{ref:g,id:b,type:"checkbox",className:"nice-toggle__input",name:o,checked:a,disabled:n,role:"switch","aria-checked":a,onChange:y=>r==null?void 0:r(y.target.checked)}),e.jsx("span",{className:"nice-toggle__track",children:e.jsx("span",{className:"nice-toggle__thumb"})}),t&&e.jsx("span",{children:t}),u&&e.jsx(tt,{shortcuts:w,size:"sm"})]})});Mi.displayName="NiceToggle";const Qr={flowchart:["rectangle","roundedRect","diamond","parallelogram","ellipse","circle","document","cylinder"],orgchart:["roundedRect","ellipse","rectangle"],mindmap:["roundedRect","ellipse","cloud","rectangle"],bpmn:["rectangle","roundedRect","circle","diamond","document"],er:["rectangle","diamond","ellipse"],sequence:["rectangle","actor","circle"],stateMachine:["roundedRect","circle","diamond"],networkTopology:["rectangle","circle","cloud","cylinder","hexagon"],decisionTree:["rectangle","diamond","roundedRect"],custom:["rectangle","roundedRect","ellipse","circle","diamond","hexagon","parallelogram","cylinder","triangle","cloud","document","actor"]},wp=["dagre","forceDirected","grid","radial","tree"],_p=["sans-serif","serif","monospace","Arial","Helvetica","Times New Roman","Courier New","Georgia","Verdana","Tahoma","Trebuchet MS"],jp=[8,9,10,11,12,14,16,18,20,24,28,32,36,48,72],xr=({activeTool:t,onToolChange:a,diagramType:r,onAddNode:n,onApplyLayout:i,onUndo:o,onRedo:c,canUndo:l=!1,canRedo:d=!1,onExport:p,onZoomIn:h,onZoomOut:u,onZoomReset:g,zoomLevel:f=1,onToggleBold:m,onToggleItalic:b,isBold:C=!1,isItalic:v=!1,onFontFamilyChange:w,currentFontFamily:y="sans-serif",onFontSizeChange:S,currentFontSize:k=14,onAlignLeft:M,onAlignCenterH:_,onAlignRight:j,onAlignTop:z,onAlignCenterV:P,onAlignBottom:I,onDistributeH:D,onDistributeV:T,onBringToFront:N,onSendToBack:H,onGroupSelected:E,onUngroupSelected:R,onCopy:x,onPaste:$,onDuplicate:A,onSelectAll:O,selectionCount:F=0,onFind:L,showFind:G=!1,findQuery:V="",onFindQueryChange:B,viewMode:Y="editor",onViewModeChange:J,stylePresetId:me,onStylePresetChange:de,className:oe})=>{const{t:ae}=qt(),[ve,re]=s.useState(!1),[he,we]=s.useState(!1),[le,ke]=s.useState(!1),[U,Q]=s.useState(!1),[W,Z]=s.useState(!1),[te,ee]=s.useState(!1),ie=Qr[r]??Qr.custom,ne=s.useCallback(ue=>{n==null||n(ue),re(!1)},[n]),Ce=s.useCallback(ue=>{i==null||i(ue),we(!1)},[i]);return e.jsxs("div",{className:`nice-diagram-toolbar ${oe??""}`,children:[e.jsxs("div",{className:"nice-diagram-toolbar__row",children:[e.jsxs("div",{className:"nice-diagram-toolbar__group",children:[e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:t==="select"?"primary":"ghost",size:"sm",onClick:()=>a("select"),title:`${ae("toolbar.select")} (V)`,children:"◇"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:t==="pan"?"primary":"ghost",size:"sm",onClick:()=>a("pan"),title:`${ae("toolbar.pan")} (H)`,children:"✋"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:t==="addEdge"?"primary":"ghost",size:"sm",onClick:()=>a("addEdge"),title:`${ae("toolbar.addEdge")} (C)`,children:"↗"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:t==="text"?"primary":"ghost",size:"sm",onClick:()=>a("text"),title:"Text (T)",children:"T"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:t==="freehand"?"primary":"ghost",size:"sm",onClick:()=>a("freehand"),title:"Freehand (F)",children:"✎"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:t==="delete"?"primary":"ghost",size:"sm",onClick:()=>a("delete"),title:`${ae("toolbar.delete")} (Del)`,children:"🗑"})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[e.jsxs(xe,{className:"nice-diagram-toolbar__btn",variant:t==="addNode"?"primary":"ghost",size:"sm",onClick:()=>re(ue=>!ue),title:ae("toolbar.addNode"),children:["+ ",ae("toolbar.addNode")]}),ve&&e.jsx("div",{className:"nice-diagram-toolbar__dropdown nice-diagram-toolbar__dropdown--shapes",children:ie.map(ue=>e.jsxs(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>ne(ue),children:[Cp(ue)," ",ue]},ue))})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group",children:[e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:x,title:"Copy (Ctrl+C)",children:"📋"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:$,title:"Paste (Ctrl+V)",children:"📃"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:A,title:"Duplicate (Ctrl+D)",children:"⧉"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:O,title:"Select All (Ctrl+A)",children:"⬚"})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group",children:[e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:o,disabled:!l,title:`${ae("toolbar.undo")} (Ctrl+Z)`,children:"↩"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:c,disabled:!d,title:`${ae("toolbar.redo")} (Ctrl+Y)`,children:"↪"})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group",children:[e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:u,title:ae("toolbar.zoomOut"),children:"−"}),e.jsxs("span",{className:"nice-diagram-toolbar__zoom-label",children:[Math.round(f*100),"%"]}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:h,title:ae("toolbar.zoomIn"),children:"+"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:g,title:ae("toolbar.zoomReset"),children:"1:1"})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group",children:[e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:L,title:"Find (Ctrl+F)",children:"🔍"}),G&&e.jsx(ht,{className:"nice-diagram-toolbar__search",placeholder:"Search nodes…",value:V,onChange:ue=>B==null?void 0:B(ue),autoFocus:!0})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[e.jsxs(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>ke(ue=>!ue),title:ae("toolbar.export"),children:["⤓ ",ae("toolbar.export")]}),le&&e.jsxs("div",{className:"nice-diagram-toolbar__dropdown",children:[e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{p==null||p("ndd"),ke(!1)},children:".ndd.json"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{p==null||p("svg"),ke(!1)},children:"SVG"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{p==null||p("mermaid"),ke(!1)},children:"Mermaid"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{p==null||p("png"),ke(!1)},children:"PNG"})]})]})]}),e.jsxs("div",{className:"nice-diagram-toolbar__row nice-diagram-toolbar__format-bar",children:[e.jsxs("div",{className:"nice-diagram-toolbar__group",children:[e.jsx(Qe,{className:"nice-diagram-toolbar__font-select",value:y,onChange:ue=>w==null?void 0:w(ue),options:_p.map(ue=>({value:ue,label:ue})),title:"Font Family"}),e.jsx(Qe,{className:"nice-diagram-toolbar__size-select",value:String(k),onChange:ue=>S==null?void 0:S(Number(ue)),options:jp.map(ue=>({value:String(ue),label:String(ue)})),title:"Font Size"})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group",children:[e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:C?"primary":"ghost",size:"sm",onClick:m,title:"Bold (Ctrl+B)",children:e.jsx("strong",{children:"B"})}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:v?"primary":"ghost",size:"sm",onClick:b,title:"Italic (Ctrl+I)",children:e.jsx("em",{children:"I"})})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>Q(ue=>!ue),title:"Alignment & Distribution",children:"≡ Align"}),U&&e.jsxs("div",{className:"nice-diagram-toolbar__dropdown nice-diagram-toolbar__dropdown--align",children:[e.jsx("div",{className:"nice-diagram-toolbar__dropdown-section",children:"Align"}),e.jsxs("div",{className:"nice-diagram-toolbar__dropdown-row",children:[e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{M==null||M(),Q(!1)},title:"Align Left",children:"⫷ Left"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{_==null||_(),Q(!1)},title:"Align Center",children:"⫿ Center"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{j==null||j(),Q(!1)},title:"Align Right",children:"⫸ Right"})]}),e.jsxs("div",{className:"nice-diagram-toolbar__dropdown-row",children:[e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{z==null||z(),Q(!1)},title:"Align Top",children:"⫠ Top"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{P==null||P(),Q(!1)},title:"Align Middle",children:"⫟ Middle"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{I==null||I(),Q(!1)},title:"Align Bottom",children:"⫡ Bottom"})]}),e.jsx("div",{className:"nice-diagram-toolbar__dropdown-section",children:"Distribute"}),e.jsxs("div",{className:"nice-diagram-toolbar__dropdown-row",children:[e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{D==null||D(),Q(!1)},title:"Distribute Horizontally",children:"⟺ H"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{T==null||T(),Q(!1)},title:"Distribute Vertically",children:"⟺ V"})]})]})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>Z(ue=>!ue),title:"Arrange",children:"☰ Arrange"}),W&&e.jsxs("div",{className:"nice-diagram-toolbar__dropdown",children:[e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{N==null||N(),Z(!1)},children:"↑ Bring to Front"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{H==null||H(),Z(!1)},children:"↓ Send to Back"}),e.jsx("div",{className:"nice-diagram-toolbar__dropdown-divider"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{E==null||E(),Z(!1)},disabled:F<2,children:"⊞ Group"}),e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{R==null||R(),Z(!1)},children:"⊟ Ungroup"})]})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[e.jsxs(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>we(ue=>!ue),title:ae("toolbar.layout"),children:["⊞ ",ae("toolbar.layout")]}),he&&e.jsx("div",{className:"nice-diagram-toolbar__dropdown",children:wp.map(ue=>e.jsx(xe,{className:"nice-diagram-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>Ce(ue),children:ae(`layout.${ue}`)},ue))})]}),F>1&&e.jsxs("span",{className:"nice-diagram-toolbar__selection-info",children:[F," selected"]}),e.jsxs("div",{className:"nice-diagram-toolbar__group",children:[e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:Y==="editor"?"primary":"ghost",size:"sm",onClick:()=>J==null?void 0:J("editor"),title:"Editor Mode",children:"🖊 Editor"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:Y==="player"?"primary":"ghost",size:"sm",onClick:()=>J==null?void 0:J("player"),title:"Player Mode",children:"▶ Player"}),e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:Y==="playerAnimated"?"primary":"ghost",size:"sm",onClick:()=>J==null?void 0:J("playerAnimated"),title:"Animated Player Mode",children:"⚡ Animated"})]}),e.jsxs("div",{className:"nice-diagram-toolbar__group nice-diagram-toolbar__group--relative",children:[e.jsx(xe,{className:"nice-diagram-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>ee(ue=>!ue),title:"Style Presets",children:"🎨 Style"}),te&&e.jsx("div",{className:"nice-diagram-toolbar__dropdown nice-diagram-toolbar__dropdown--presets",style:{maxHeight:320,overflowY:"auto",width:220},children:Object.entries(pa.reduce((ue,$e)=>{const ze=$e.category??"Other";return ue[ze]||(ue[ze]=[]),ue[ze].push($e),ue},{})).map(([ue,$e])=>e.jsxs("div",{children:[e.jsx("div",{className:"nice-diagram-toolbar__dropdown-section",style:{fontSize:10,color:"#888",padding:"6px 8px 2px",textTransform:"uppercase"},children:ue}),$e.map(ze=>e.jsxs(xe,{className:`nice-diagram-toolbar__dropdown-item ${me===ze.id?"nice-diagram-toolbar__dropdown-item--active":""}`,variant:me===ze.id?"primary":"ghost",size:"sm",onClick:()=>{de==null||de(ze.id),ee(!1)},style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{width:16,height:16,borderRadius:3,background:ze.config.palette.primary,border:"1px solid "+(ze.config.palette.border??"#ccc"),display:"inline-block",flexShrink:0}}),e.jsx("span",{style:{fontSize:12},children:ze.name})]},ze.id))]},ue))})]})]})]})};function Cp(t){switch(t){case"rectangle":return"▭";case"roundedRect":return"▢";case"ellipse":return"⬭";case"circle":return"●";case"diamond":return"◇";case"hexagon":return"⬡";case"parallelogram":return"▱";case"cylinder":return"⌂";case"triangle":return"△";case"cloud":return"☁";case"document":return"📄";case"actor":return"🧑";default:return"▢"}}xr.displayName="DiagramToolbar";const Sp=["rectangle","roundedRect","ellipse","circle","diamond","hexagon","parallelogram","cylinder","triangle","cloud","document","actor"],vr=({selectedNode:t,selectedEdge:a,onNodeChange:r,onEdgeChange:n,onRemove:i,className:o})=>{var p,h,u,g,f;const{t:c}=qt(),l=s.useCallback((m,b)=>{!t||!r||r(t.id,{style:{...t.style,[m]:b}})},[t,r]),d=s.useCallback((m,b)=>{!a||!n||n(a.id,{style:{...a.style,[m]:b}})},[a,n]);return!t&&!a?e.jsx("div",{className:`nice-diagram-property-panel nice-diagram-property-panel--empty ${o??""}`,children:e.jsx("p",{className:"nice-diagram-property-panel__hint",children:c("panel.noSelection")})}):t?e.jsxs("div",{className:`nice-diagram-property-panel ${o??""}`,children:[e.jsx("h3",{className:"nice-diagram-property-panel__title",children:c("panel.nodeProperties")}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:[c("node.label"),e.jsx(ht,{value:t.label,onChange:m=>r==null?void 0:r(t.id,{label:m}),className:"nice-diagram-property-panel__input"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:[c("node.description"),e.jsx(ht,{value:t.description??"",onChange:m=>r==null?void 0:r(t.id,{description:m||void 0}),className:"nice-diagram-property-panel__input"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:[c("node.shape"),e.jsx(Qe,{value:t.shape,onChange:m=>r==null?void 0:r(t.id,{shape:m}),options:Sp.map(m=>({value:m,label:m})),className:"nice-diagram-property-panel__select"})]}),e.jsxs("div",{className:"nice-diagram-property-panel__row",children:[e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.width"),e.jsx(ct,{value:t.size.width,min:20,onChange:m=>r==null?void 0:r(t.id,{size:{...t.size,width:m??40}}),className:"nice-diagram-property-panel__input"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.height"),e.jsx(ct,{value:t.size.height,min:20,onChange:m=>r==null?void 0:r(t.id,{size:{...t.size,height:m??40}}),className:"nice-diagram-property-panel__input"})]})]}),e.jsxs("div",{className:"nice-diagram-property-panel__row",children:[e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.bgColor"),e.jsx(st,{value:t.style.backgroundColor??"#ffffff",onChange:m=>l("backgroundColor",m),className:"nice-diagram-property-panel__color"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.borderColor"),e.jsx(st,{value:t.style.borderColor??"#333333",onChange:m=>l("borderColor",m),className:"nice-diagram-property-panel__color"})]})]}),e.jsxs("div",{className:"nice-diagram-property-panel__row",children:[e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.fontSize"),e.jsx(ct,{value:t.style.fontSize??14,min:8,max:72,onChange:m=>l("fontSize",m??14),className:"nice-diagram-property-panel__input"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("node.fontColor"),e.jsx(st,{value:t.style.fontColor??"#222222",onChange:m=>l("fontColor",m),className:"nice-diagram-property-panel__color"})]})]}),e.jsx(zt,{checked:t.locked??!1,onChange:m=>r==null?void 0:r(t.id,{locked:m}),label:c("node.locked"),className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--check"}),e.jsx("h4",{className:"nice-diagram-property-panel__section-title",style:{fontSize:12,marginTop:12,marginBottom:4,color:"#666"},children:"Effects"}),e.jsxs("div",{className:"nice-diagram-property-panel__row",children:[e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Glow Color",e.jsx(st,{value:t.style.glowColor??"#3b82f6",onChange:m=>l("glowColor",m),className:"nice-diagram-property-panel__color"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Glow Intensity",e.jsx(wt,{min:0,max:3,step:.1,value:t.style.glowIntensity??0,onChange:m=>l("glowIntensity",m),className:"nice-diagram-property-panel__input"})]})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Opacity",e.jsx(wt,{min:0,max:1,step:.05,value:t.style.opacity??1,onChange:m=>l("opacity",m),className:"nice-diagram-property-panel__input"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Border Radius",e.jsx(ct,{min:0,max:50,value:t.style.borderRadius??4,onChange:m=>l("borderRadius",m??4),className:"nice-diagram-property-panel__input"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Border Width",e.jsx(ct,{min:0,max:10,step:.5,value:t.style.borderWidth??1,onChange:m=>l("borderWidth",m??1),className:"nice-diagram-property-panel__input"})]}),e.jsx(zt,{checked:t.style.shadow??!1,onChange:m=>l("shadow",m),label:"Shadow",className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--check"}),e.jsxs("div",{className:"nice-diagram-property-panel__row",children:[e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Gradient End",e.jsx(st,{value:t.style.gradientColor??"#ffffff",onChange:m=>l("gradientColor",m),className:"nice-diagram-property-panel__color"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Gradient Dir",e.jsx(Qe,{value:t.style.gradientDirection??"vertical",onChange:m=>l("gradientDirection",m),options:[{value:"vertical",label:"Vertical"},{value:"horizontal",label:"Horizontal"},{value:"diagonal",label:"Diagonal"},{value:"radial",label:"Radial"}],className:"nice-diagram-property-panel__select"})]})]}),e.jsx(zt,{checked:t.hidden??!1,onChange:m=>r==null?void 0:r(t.id,{hidden:m}),label:"Hidden (ghost in editor)",className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--check"}),e.jsx(xe,{className:"nice-diagram-property-panel__btn nice-diagram-property-panel__btn--danger",variant:"ghost",size:"sm",onClick:()=>i==null?void 0:i(t.id),children:c("toolbar.delete")})]}):a?e.jsxs("div",{className:`nice-diagram-property-panel ${o??""}`,children:[e.jsx("h3",{className:"nice-diagram-property-panel__title",children:c("panel.edgeProperties")}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:[c("edge.label"),e.jsx(ht,{value:a.label??"",onChange:m=>n==null?void 0:n(a.id,{label:m||void 0}),className:"nice-diagram-property-panel__input"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:[c("edge.lineType"),e.jsx(Qe,{value:a.style.lineType??"bezier",onChange:m=>d("lineType",m),options:[{value:"straight",label:"Straight"},{value:"bezier",label:"Bezier"},{value:"orthogonal",label:"Orthogonal"},{value:"step",label:"Step"}],className:"nice-diagram-property-panel__select"})]}),e.jsxs("div",{className:"nice-diagram-property-panel__row",children:[e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("edge.color"),e.jsx(st,{value:a.style.strokeColor??"#333333",onChange:m=>d("strokeColor",m),className:"nice-diagram-property-panel__color"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:[c("edge.width"),e.jsx(ct,{value:a.style.strokeWidth??1.5,min:.5,max:10,step:.5,onChange:m=>d("strokeWidth",m??1.5),className:"nice-diagram-property-panel__input"})]})]}),e.jsx(zt,{checked:a.style.animated??!1,onChange:m=>d("animated",m),label:c("edge.animated"),className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--check"}),a.style.animated&&e.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Flow Speed",e.jsx(wt,{min:.1,max:5,step:.1,value:a.style.flowSpeed??1,onChange:m=>d("flowSpeed",m),className:"nice-diagram-property-panel__input"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Dash Style",e.jsx(Qe,{value:a.style.strokeDash?a.style.strokeDash.join(","):"solid",onChange:m=>{const b=m;b==="solid"?d("strokeDash",[]):d("strokeDash",b.split(",").map(Number))},options:[{value:"solid",label:"Solid"},{value:"6,4",label:"Dashed"},{value:"2,2",label:"Dotted"},{value:"8,4,2,4",label:"Dash-Dot"},{value:"12,6",label:"Long Dash"}],className:"nice-diagram-property-panel__select"})]}),e.jsxs("div",{className:"nice-diagram-property-panel__row",children:[e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Target Arrow",e.jsx(Qe,{value:a.style.targetArrow??"arrow",onChange:m=>d("targetArrow",m),options:[{value:"arrow",label:"Arrow"},{value:"openArrow",label:"Open Arrow"},{value:"diamond",label:"Diamond"},{value:"circle",label:"Circle"},{value:"none",label:"None"}],className:"nice-diagram-property-panel__select"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Source Arrow",e.jsx(Qe,{value:a.style.sourceArrow??"none",onChange:m=>d("sourceArrow",m),options:[{value:"none",label:"None"},{value:"arrow",label:"Arrow"},{value:"openArrow",label:"Open Arrow"},{value:"diamond",label:"Diamond"},{value:"circle",label:"Circle"}],className:"nice-diagram-property-panel__select"})]})]}),e.jsx("h4",{className:"nice-diagram-property-panel__section-title",style:{fontSize:12,marginTop:12,marginBottom:4,color:"#666"},children:"Liquid Flow"}),e.jsx(zt,{checked:((p=a.style.liquidFlow)==null?void 0:p.active)??!1,onChange:m=>{const b=a.style.liquidFlow??{active:!1,color:"#3b82f6",speed:1,pipeWidth:6};n==null||n(a.id,{style:{...a.style,liquidFlow:{...b,active:m}}})},label:"Enable Liquid Flow",className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--check"}),((h=a.style.liquidFlow)==null?void 0:h.active)&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-diagram-property-panel__row",children:[e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Color",e.jsx(st,{value:((u=a.style.liquidFlow)==null?void 0:u.color)??"#3b82f6",onChange:m=>{const b=a.style.liquidFlow;n==null||n(a.id,{style:{...a.style,liquidFlow:{...b,color:m}}})},className:"nice-diagram-property-panel__color"})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label nice-diagram-property-panel__label--half",children:["Speed",e.jsx(wt,{min:.1,max:5,step:.1,value:((g=a.style.liquidFlow)==null?void 0:g.speed)??1,onChange:m=>{const b=a.style.liquidFlow;n==null||n(a.id,{style:{...a.style,liquidFlow:{...b,speed:m}}})},className:"nice-diagram-property-panel__input"})]})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Pipe Width",e.jsx(ct,{min:2,max:20,value:((f=a.style.liquidFlow)==null?void 0:f.pipeWidth)??6,onChange:m=>{const b=a.style.liquidFlow;n==null||n(a.id,{style:{...a.style,liquidFlow:{...b,pipeWidth:m??6}}})},className:"nice-diagram-property-panel__input"})]})]}),e.jsxs("label",{className:"nice-diagram-property-panel__label",children:["Opacity",e.jsx(wt,{min:0,max:1,step:.05,value:a.style.opacity??1,onChange:m=>d("opacity",m),className:"nice-diagram-property-panel__input"})]}),e.jsx(xe,{className:"nice-diagram-property-panel__btn nice-diagram-property-panel__btn--danger",variant:"ghost",size:"sm",onClick:()=>i==null?void 0:i(a.id),children:c("toolbar.delete")})]}):null};vr.displayName="DiagramPropertyPanel";const Np=180,Mp=120,kr=({nodes:t,edges:a,viewport:r,onViewportChange:n,canvasWidth:i=800,canvasHeight:o=600,width:c=Np,height:l=Mp,className:d})=>{const p=s.useMemo(()=>{if(t.length===0)return{minX:0,minY:0,maxX:400,maxY:300};let b=1/0,C=1/0,v=-1/0,w=-1/0;for(const S of t)b=Math.min(b,S.position.x),C=Math.min(C,S.position.y),v=Math.max(v,S.position.x+S.size.width),w=Math.max(w,S.position.y+S.size.height);const y=50;return{minX:b-y,minY:C-y,maxX:v+y,maxY:w+y}},[t]),h=p.maxX-p.minX,u=p.maxY-p.minY,g=Math.min(c/h,l/u),f=s.useMemo(()=>{const b=(-r.x/r.zoom-p.minX)*g,C=(-r.y/r.zoom-p.minY)*g,v=i/r.zoom*g,w=o/r.zoom*g;return{x:b,y:C,w:v,h:w}},[r,p,g,i,o]),m=s.useCallback(b=>{if(!n)return;const C=b.currentTarget.getBoundingClientRect(),v=b.clientX-C.left,w=b.clientY-C.top,y=v/g+p.minX,S=w/g+p.minY;n({...r,x:-(y*r.zoom-i/2),y:-(S*r.zoom-o/2)})},[n,r,g,p,i,o]);return e.jsxs("svg",{className:`nice-diagram-minimap ${d??""}`,width:c,height:l,style:{border:"1px solid #ccc",background:"#fff",borderRadius:4,cursor:"pointer"},onClick:m,children:[a.map(b=>{const C=t.find(M=>M.id===b.sourceNodeId),v=t.find(M=>M.id===b.targetNodeId);if(!C||!v)return null;const w=(C.position.x+C.size.width/2-p.minX)*g,y=(C.position.y+C.size.height/2-p.minY)*g,S=(v.position.x+v.size.width/2-p.minX)*g,k=(v.position.y+v.size.height/2-p.minY)*g;return e.jsx("line",{x1:w,y1:y,x2:S,y2:k,stroke:"#aaa",strokeWidth:.5},b.id)}),t.map(b=>e.jsx("rect",{x:(b.position.x-p.minX)*g,y:(b.position.y-p.minY)*g,width:b.size.width*g,height:b.size.height*g,fill:b.style.backgroundColor??"#ddd",stroke:"#999",strokeWidth:.5},b.id)),e.jsx("rect",{x:f.x,y:f.y,width:f.w,height:f.h,fill:"rgba(33,150,243,0.15)",stroke:"#2196f3",strokeWidth:1})]})};kr.displayName="DiagramMinimap";const $p=["fadeIn","fadeOut","slideInLeft","slideInRight","slideInTop","slideInBottom","zoomIn","zoomOut","pulse","shake","highlight","flowPulse","bounce","glow","colorShift","liquidFill","expand","collapse","ripple","typewriter","morphShape","drawPath","particleTrail"],zp=["linear","easeIn","easeOut","easeInOut","spring","bounce"],wr=({animations:t,onAdd:a,onRemove:r,onUpdate:n,onPlay:i,onStop:o,isPlaying:c=!1,availableTargets:l=[],className:d})=>{const{t:p}=qt(),[h,u]=s.useState(!1),[g,f]=s.useState(null),m=s.useCallback(()=>{if(!a||l.length===0)return;const v=l[0];a({name:`Animation ${t.length+1}`,targetId:v.id,targetType:v.type,effect:"fadeIn",startMs:t.length*500,durationMs:600,easing:"easeOut"})},[a,t.length,l]),b=s.useCallback(v=>{if(!a||l.length===0)return;const w=l[0];a({name:v.name,targetId:w.id,targetType:w.type,effect:v.effect,startMs:t.length*500,durationMs:v.durationMs,easing:v.easing}),u(!1)},[a,t.length,l]),C=Math.max(2e3,...t.map(v=>v.startMs+v.durationMs+(v.delayMs??0)));return e.jsxs("div",{className:`nice-diagram-timeline ${d??""}`,children:[e.jsxs("div",{className:"nice-diagram-timeline__header",children:[e.jsx("h4",{className:"nice-diagram-timeline__title",children:p("animation.timeline")}),e.jsxs("div",{className:"nice-diagram-timeline__controls",children:[c?e.jsxs(xe,{className:"nice-diagram-timeline__btn",variant:"ghost",size:"sm",onClick:o,children:["⏹ ",p("animation.stop")]}):e.jsxs(xe,{className:"nice-diagram-timeline__btn",variant:"ghost",size:"sm",onClick:i,children:["▶ ",p("animation.play")]}),e.jsxs(xe,{className:"nice-diagram-timeline__btn",variant:"ghost",size:"sm",onClick:m,disabled:l.length===0,children:["+ ",p("animation.add")]}),e.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[e.jsx(xe,{className:"nice-diagram-timeline__btn",variant:"ghost",size:"sm",onClick:()=>u(v=>!v),disabled:l.length===0,title:"Add from preset",children:"🎬 Presets"}),h&&e.jsx("div",{style:{position:"absolute",bottom:"100%",left:0,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",maxHeight:280,overflowY:"auto",width:200,zIndex:100},children:fn.map(v=>e.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>b(v),style:{display:"block",width:"100%",textAlign:"left",padding:"6px 10px",fontSize:12,borderBottom:"1px solid #f0f0f0"},title:`${v.effect} — ${v.durationMs}ms ${v.easing}`,children:v.name},v.id))})]})]})]}),e.jsxs("div",{className:"nice-diagram-timeline__tracks",children:[t.length===0&&e.jsx("p",{className:"nice-diagram-timeline__empty",children:p("animation.noAnimations")}),t.map(v=>{const w=v.startMs/C*100,y=v.durationMs/C*100,S=g===v.id;return e.jsxs("div",{className:"nice-diagram-timeline__track",children:[e.jsxs("div",{className:"nice-diagram-timeline__track-label",children:[e.jsx("span",{className:"nice-diagram-timeline__track-name",onClick:()=>f(S?null:v.id),style:{cursor:"pointer"},title:"Click to edit",children:v.name}),e.jsx("span",{className:"nice-diagram-timeline__track-effect",children:v.effect}),e.jsx(xe,{className:"nice-diagram-timeline__track-remove",variant:"ghost",size:"sm",onClick:()=>r==null?void 0:r(v.id),title:p("toolbar.delete"),children:"×"})]}),S&&e.jsxs("div",{className:"nice-diagram-timeline__track-editor",style:{display:"flex",gap:4,padding:"4px 0",flexWrap:"wrap",fontSize:11},children:[e.jsx(Qe,{value:v.effect,onChange:k=>n==null?void 0:n(v.id,{effect:k}),options:$p.map(k=>({value:k,label:k})),style:{fontSize:11,padding:"1px 4px"}}),e.jsx(Qe,{value:v.easing,onChange:k=>n==null?void 0:n(v.id,{easing:k}),options:zp.map(k=>({value:k,label:k})),style:{fontSize:11,padding:"1px 4px"}}),e.jsx(Qe,{value:v.targetId,onChange:k=>{const M=l.find(_=>_.id===k);M&&(n==null||n(v.id,{targetId:M.id,targetType:M.type}))},options:l.map(k=>({value:k.id,label:k.label})),style:{fontSize:11,padding:"1px 4px",maxWidth:100}}),e.jsx(ct,{value:v.startMs,min:0,step:100,onChange:k=>n==null?void 0:n(v.id,{startMs:k??0}),style:{width:60,fontSize:11},title:"Start (ms)"}),e.jsx(ct,{value:v.durationMs,min:50,step:50,onChange:k=>n==null?void 0:n(v.id,{durationMs:k??50}),style:{width:60,fontSize:11},title:"Duration (ms)"})]}),e.jsx("div",{className:"nice-diagram-timeline__track-bar",children:e.jsx("div",{className:"nice-diagram-timeline__track-segment",style:{left:`${w}%`,width:`${y}%`},title:`${v.effect} ${v.startMs}ms → ${v.startMs+v.durationMs}ms (${v.easing})`})})]},v.id)})]}),e.jsx("div",{className:"nice-diagram-timeline__ruler",children:Array.from({length:5}).map((v,w)=>{const y=Math.round(C/4*w);return e.jsxs("span",{className:"nice-diagram-timeline__ruler-mark",style:{left:`${w/4*100}%`},children:[y,"ms"]},w)})})]})};wr.displayName="AnimationTimeline";function Ep(t){const a=[];let r;try{r=JSON.parse(t)}catch{return{ok:!1,errors:["Invalid JSON: parse failed"]}}if(typeof r!="object"||r===null||Array.isArray(r))return{ok:!1,errors:["Root must be a JSON object"]};const n=r;if(n.version!=="1.0"&&a.push(`Unsupported version "${String(n.version)}", expected "1.0"`),(typeof n.id!="string"||n.id.length===0)&&a.push('Missing or invalid "id" field'),typeof n.title!="string"&&a.push('Missing or invalid "title" field'),Array.isArray(n.nodes)||a.push('Missing or invalid "nodes" array'),Array.isArray(n.edges)||a.push('Missing or invalid "edges" array'),Array.isArray(n.nodes)&&Array.isArray(n.edges)){const i=new Set(n.nodes.map(o=>o.id).filter(Boolean));for(const o of n.edges)o.sourceNodeId&&!i.has(o.sourceNodeId)&&a.push(`Edge "${o.id}" references non-existent source node "${o.sourceNodeId}"`),o.targetNodeId&&!i.has(o.targetNodeId)&&a.push(`Edge "${o.id}" references non-existent target node "${o.targetNodeId}"`)}return a.length>0?{ok:!1,errors:a}:{ok:!0,document:r,errors:[]}}function $i(t,a=!0){return JSON.stringify(t,null,a?2:void 0)}function Aa(t,a){const r=(a==null?void 0:a.scale)??1,n=(a==null?void 0:a.background)??"transparent";let i=1/0,o=1/0,c=-1/0,l=-1/0;for(const m of t.nodes)i=Math.min(i,m.position.x),o=Math.min(o,m.position.y),c=Math.max(c,m.position.x+m.size.width),l=Math.max(l,m.position.y+m.size.height);t.nodes.length===0&&(i=o=0,c=l=100);const d=40,p=(c-i+d*2)*r,h=(l-o+d*2)*r,u=-i+d,g=-o+d,f=[];f.push(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${p} ${h}" width="${p}" height="${h}">`),f.push("<defs>"),f.push('<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">'),f.push(' <polygon points="0 0, 10 3.5, 0 7" fill="#666" />'),f.push("</marker>"),f.push("</defs>"),n!=="transparent"&&f.push(`<rect width="${p}" height="${h}" fill="${n}" />`),f.push(`<g transform="translate(${u*r}, ${g*r}) scale(${r})">`);for(const m of t.edges){const b=t.nodes.find(j=>j.id===m.sourceNodeId),C=t.nodes.find(j=>j.id===m.targetNodeId);if(!b||!C)continue;const v=b.position.x+b.size.width/2,w=b.position.y+b.size.height/2,y=C.position.x+C.size.width/2,S=C.position.y+C.size.height/2,k=m.style.strokeColor??"#666",M=m.style.strokeWidth??2,_=m.style.targetArrow!=="none"?' marker-end="url(#arrowhead)"':"";if(m.style.lineType==="bezier"){const j=(v+y)/2,z=w,P=(v+y)/2,I=S;f.push(`<path d="M${v},${w} C${j},${z} ${P},${I} ${y},${S}" fill="none" stroke="${k}" stroke-width="${M}"${_} />`)}else f.push(`<line x1="${v}" y1="${w}" x2="${y}" y2="${S}" stroke="${k}" stroke-width="${M}"${_} />`);if(m.label){const j=(v+y)/2,z=(w+S)/2;f.push(`<text x="${j}" y="${z-6}" text-anchor="middle" font-size="12" fill="#333">${en(m.label)}</text>`)}}for(const m of t.nodes){const{x:b,y:C}=m.position,{width:v,height:w}=m.size,y=m.style.backgroundColor??"#fff",S=m.style.borderColor??"#ccc",k=m.style.borderWidth??1,M=m.style.borderRadius??(m.shape==="roundedRect"?8:0),_=m.style.fontColor??"#333",j=m.style.fontSize??14;switch(m.shape){case"ellipse":case"circle":f.push(`<ellipse cx="${b+v/2}" cy="${C+w/2}" rx="${v/2}" ry="${w/2}" fill="${y}" stroke="${S}" stroke-width="${k}" />`);break;case"diamond":f.push(`<polygon points="${b+v/2},${C} ${b+v},${C+w/2} ${b+v/2},${C+w} ${b},${C+w/2}" fill="${y}" stroke="${S}" stroke-width="${k}" />`);break;default:f.push(`<rect x="${b}" y="${C}" width="${v}" height="${w}" rx="${M}" fill="${y}" stroke="${S}" stroke-width="${k}" />`)}f.push(`<text x="${b+v/2}" y="${C+w/2+j/3}" text-anchor="middle" font-size="${j}" fill="${_}" font-family="sans-serif">${en(m.label)}</text>`)}return f.push("</g>"),f.push("</svg>"),f.join(`
|
|
1253
|
+
`)}function zi(t){const a=[],r=t.diagramType==="orgchart"||t.diagramType==="mindmap"?"graph TB":t.diagramType==="stateMachine"?"stateDiagram-v2":"flowchart TD";a.push(r);for(const n of t.nodes){const i=Sa(n.id),o=n.label.replace(/"/g,"'");switch(n.shape){case"diamond":a.push(` ${i}{${o}}`);break;case"circle":case"ellipse":a.push(` ${i}((${o}))`);break;case"cylinder":a.push(` ${i}[(${o})]`);break;default:a.push(` ${i}["${o}"]`)}}for(const n of t.edges){const i=Sa(n.sourceNodeId),o=Sa(n.targetNodeId),c=n.label?`|${n.label}|`:"",l=n.style.targetArrow==="none"?"---":"-->";a.push(` ${i} ${l}${c} ${o}`)}return a.join(`
|
|
1254
|
+
`)}function Sa(t){return t.replace(/[^a-zA-Z0-9_]/g,"_")}function en(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const Ei=({initialDocument:t,diagramType:a="flowchart",onChange:r,onExport:n,lang:i="en",showToolbar:o=!0,showPropertyPanel:c=!0,showMinimap:l=!0,showTimeline:d=!0,className:p,style:h})=>{var O;const u=dn(t),[g,f]=s.useState("select"),[m,b]=s.useState(null),C=s.useRef(null),[v,w]=s.useState("editor"),y=s.useRef(null),[S,k]=s.useState({particles:[],liquidFlows:new Map,glowStates:new Map});s.useEffect(()=>{const F=new un(L=>{k(L)});return y.current=F,F.start(),()=>{F.stop(),y.current=null}},[]),s.useEffect(()=>{var L;const F=y.current;if(F)for(const G of u.edges)(L=G.style.liquidFlow)!=null&&L.active?F.startLiquidFlow(G.id,G.style.liquidFlow):F.stopLiquidFlow(G.id)},[u.edges]),s.useEffect(()=>{const F=y.current;if(F)for(const L of u.nodes)L.style.glowColor?F.setGlow(L.id,L.style.glowColor,L.style.glowIntensity??1):F.removeGlow(L.id)},[u.nodes]);const M=s.useCallback(F=>{u.setStylePreset(F)},[u]),_=s.useCallback((F,L)=>{const G=u.nodes.find(B=>B.id===F);if(!(G!=null&&G.interactions))return;const V=G.interactions.find(B=>B.id===L);if(V)switch(V.action){case"reveal":{if(V.targetId){const B=u.nodes.find(Y=>Y.id===V.targetId);B!=null&&B.hidden&&u.updateNode(V.targetId,{hidden:!1})}break}case"navigate":{if(V.targetId){const B=u.nodes.find(Y=>Y.id===V.targetId);B&&(u.setViewport({x:-B.position.x+300,y:-B.position.y+200,zoom:u.viewport.zoom}),b(V.targetId))}break}case"switchAnimationMode":{V.targetId&&u.setActiveAnimationMode(V.targetId);break}case"highlight":{V.targetId&&b(V.targetId);break}case"toggleCollapse":{u.toggleNodeCollapse(F);break}}},[u]),j=s.useRef(u.document);u.document!==j.current&&(j.current=u.document,r==null||r(u.document));const z=s.useMemo(()=>m?u.nodes.find(F=>F.id===m)??null:null,[m,u.nodes]),P=s.useMemo(()=>m?u.edges.find(F=>F.id===m)??null:null,[m,u.edges]),I=s.useCallback(F=>{const L=u.viewport,G=(-L.x+400)/L.zoom,V=(-L.y+300)/L.zoom,B=u.addNode("New Node",{x:G,y:V},F);b(B.id),f("select")},[u]),D=s.useCallback(F=>{u.applyLayout({algorithm:F,centerGraph:!0})},[u]),T=s.useCallback((F,L)=>{u.moveNode(F,L)},[u]),N=s.useCallback((F,L)=>{u.moveNode(F,L)},[u]),H=s.useCallback(F=>{u.nodes.find(L=>L.id===F)?u.removeNode(F):u.edges.find(L=>L.id===F)&&u.removeEdge(F),b(null)},[u]),E=s.useCallback(F=>{const L=u.document;let G;switch(F){case"ndd":G=$i(L,!0);break;case"svg":G=Aa(L);break;case"mermaid":G=zi(L);break;case"png":G=Aa(L);break}n==null||n(F,G)},[u,n]),R=s.useCallback(()=>{u.setViewport({...u.viewport,zoom:Math.min(5,u.viewport.zoom*1.2)})},[u]),x=s.useCallback(()=>{u.setViewport({...u.viewport,zoom:Math.max(.1,u.viewport.zoom/1.2)})},[u]),$=s.useCallback(()=>{u.setViewport({x:0,y:0,zoom:1})},[u]),A=s.useMemo(()=>[...u.nodes.map(F=>({id:F.id,label:F.label,type:"node"})),...u.edges.map(F=>({id:F.id,label:F.label??F.id,type:"edge"}))],[u.nodes,u.edges]);return e.jsx(Ra,{locale:i,children:e.jsxs("div",{ref:C,className:`nice-diagram-editor ${p??""}`,style:{display:"flex",flexDirection:"column",height:"100%",...h},children:[o&&e.jsx(xr,{activeTool:g,onToolChange:f,diagramType:u.document.diagramType,onAddNode:I,onApplyLayout:D,onUndo:u.undo,onRedo:u.redo,canUndo:u.canUndo,canRedo:u.canRedo,onExport:E,onZoomIn:R,onZoomOut:x,onZoomReset:$,viewMode:v,onViewModeChange:w,stylePresetId:u.stylePresetId,onStylePresetChange:M}),u.animationModes.length>0&&e.jsxs("div",{className:"nice-diagram-editor__mode-tabs",style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #e0e0e0",background:"#f9f9f9",fontSize:12,alignItems:"center"},children:[e.jsx("span",{style:{color:"#888",marginRight:4},children:"Modes:"}),u.animationModes.map(F=>{var L;return e.jsx(xe,{variant:((L=u.activeAnimationMode)==null?void 0:L.id)===F.id?"primary":"ghost",size:"sm",onClick:()=>u.setActiveAnimationMode(F.id),style:{padding:"2px 10px",fontSize:11},children:F.name},F.id)}),e.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>u.addAnimationMode(`Mode ${u.animationModes.length+1}`),style:{padding:"2px 8px",fontSize:11,color:"#888"},title:"Add animation mode",children:"+"})]}),e.jsxs("div",{className:"nice-diagram-editor__body",style:{display:"flex",flex:1,overflow:"hidden",position:"relative"},children:[e.jsxs("div",{className:"nice-diagram-editor__canvas",style:{flex:1,position:"relative"},children:[e.jsx(dt,{nodes:u.nodes,edges:u.edges,groups:u.groups,viewport:u.viewport,onViewportChange:u.setViewport,selectedId:m,onSelectElement:b,onNodeDrag:T,onNodeDragEnd:N,interactive:v==="editor",showGrid:v==="editor",particleState:S,viewMode:v,ghostOpacity:((O=u.playerConfig)==null?void 0:O.ghostOpacity)??.3,onGroupCollapse:u.toggleGroupCollapse,onNodeCollapse:u.toggleNodeCollapse,onInteraction:_}),l&&e.jsx("div",{style:{position:"absolute",bottom:8,left:8},children:e.jsx(kr,{nodes:u.nodes,edges:u.edges,viewport:u.viewport,onViewportChange:u.setViewport})})]}),c&&e.jsx("div",{className:"nice-diagram-editor__panel",style:{width:260,borderLeft:"1px solid #ddd",overflowY:"auto"},children:e.jsx(vr,{selectedNode:z,selectedEdge:P,onNodeChange:u.updateNode,onEdgeChange:u.updateEdge,onRemove:H})})]}),d&&e.jsx("div",{className:"nice-diagram-editor__timeline",style:{borderTop:"1px solid #ddd"},children:e.jsx(wr,{animations:u.animations,onAdd:u.addAnimation,onRemove:u.removeAnimation,availableTargets:A})})]})})};Ei.displayName="NiceDiagramEditor";const tn={linear:t=>t,easeIn:t=>t*t,easeOut:t=>t*(2-t),easeInOut:t=>t<.5?2*t*t:-1+(4-2*t)*t,spring:t=>1-Math.cos(t*Math.PI*.5)*Math.exp(-6*t),bounce:t=>{if(t<1/2.75)return 7.5625*t*t;if(t<2/2.75){const r=t-.5454545454545454;return 7.5625*r*r+.75}if(t<2.5/2.75){const r=t-.8181818181818182;return 7.5625*r*r+.9375}const a=t-2.625/2.75;return 7.5625*a*a+.984375}};function Ai(t){return tn[t]??tn.linear}const Di={opacity:1,scale:1,translateX:0,translateY:0,glow:0,highlightColor:"",strokeProgress:1,rippleRadius:0,rippleOpacity:0,typewriterChars:-1,liquidFillProgress:-1,particleTrailT:-1};class Ti{constructor(a,r){this.startTime=0,this.playing=!1,this.rafId=0,this.stateMap=new Map,this.tick=()=>{if(!this.playing)return;const n=performance.now()-this.startTime;this.stateMap.clear();let i=!1;for(const o of this.animations){const c=o.startMs+(o.delayMs??0);c+o.durationMs;const l=o.repeat??0;let d=n-c;if(d<0){this.stateMap.set(o.targetId,Dp(o)),i=!0;continue}if(l===-1)d=d%o.durationMs,i=!0;else if(l>0){const g=o.durationMs*(l+1);if(d>g)continue;d=d%o.durationMs,i=!0}else{if(d>o.durationMs)continue;i=!0}const p=Math.min(d/o.durationMs,1),h=Ai(o.easing)(p),u=Ap(o,h);this.stateMap.set(o.targetId,u)}this.onFrame(this.stateMap),i?this.rafId=requestAnimationFrame(this.tick):this.playing=!1},this.animations=[...a].sort((n,i)=>n.startMs-i.startMs),this.onFrame=r}play(){this.playing||(this.playing=!0,this.startTime=performance.now(),this.tick())}stop(){this.playing=!1,this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.stateMap.clear(),this.onFrame(this.stateMap)}pause(){this.playing=!1,this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0}isPlaying(){return this.playing}}function Ap(t,a){const r={...Di};switch(t.effect){case"fadeIn":r.opacity=a;break;case"fadeOut":r.opacity=1-a;break;case"slideInLeft":r.translateX=-200*(1-a),r.opacity=a;break;case"slideInRight":r.translateX=200*(1-a),r.opacity=a;break;case"slideInTop":r.translateY=-200*(1-a),r.opacity=a;break;case"slideInBottom":r.translateY=200*(1-a),r.opacity=a;break;case"zoomIn":r.scale=a,r.opacity=a;break;case"zoomOut":r.scale=1-a*.5,r.opacity=1-a;break;case"pulse":r.scale=1+.15*Math.sin(a*Math.PI*2);break;case"shake":r.translateX=10*Math.sin(a*Math.PI*6)*(1-a);break;case"highlight":r.highlightColor=`rgba(255, 200, 0, ${.6*(1-Math.abs(2*a-1))})`;break;case"flowPulse":r.opacity=1,r.translateX=a;break;case"bounce":r.translateY=-40*Math.abs(Math.sin(a*Math.PI*3))*(1-a);break;case"glow":r.glow=12*Math.sin(a*Math.PI);break;case"colorShift":r.highlightColor=`hsl(${a*360}, 70%, 60%)`;break;case"liquidFill":r.liquidFillProgress=a;break;case"expand":r.scale=a,r.opacity=a;break;case"collapse":r.scale=1-a,r.opacity=1-a;break;case"ripple":r.rippleRadius=a*40,r.rippleOpacity=1-a;break;case"typewriter":r.typewriterChars=Math.floor(a*100);break;case"morphShape":r.scale=1+.1*Math.sin(a*Math.PI*4)*(1-a),r.translateX=2*Math.sin(a*Math.PI*3)*(1-a);break;case"drawPath":r.strokeProgress=a;break;case"particleTrail":r.particleTrailT=a;break}return r}function Dp(t){const a={...Di};switch(t.effect){case"fadeIn":case"slideInLeft":case"slideInRight":case"slideInTop":case"slideInBottom":case"zoomIn":case"expand":a.opacity=0;break;case"drawPath":a.strokeProgress=0;break;case"typewriter":a.typewriterChars=0;break;case"liquidFill":a.liquidFillProgress=0;break}return a}const Ri=({document:t,lang:a="en",autoPlay:r=!1,showControls:n=!0,showGrid:i=!1,className:o,style:c})=>{const[l,d]=s.useState({...t.viewport}),[p,h]=s.useState(new Map),[u,g]=s.useState(!1),f=s.useRef(null),m=s.useCallback(()=>{f.current&&f.current.stop();const y=new Ti(t.animations,S=>{h(new Map(S)),y.isPlaying()||g(!1)});f.current=y,y.play(),g(!0)},[t.animations]),b=s.useCallback(()=>{var y;(y=f.current)==null||y.stop(),g(!1),h(new Map)},[]);s.useEffect(()=>(r&&t.animations.length>0&&m(),()=>{var y;(y=f.current)==null||y.stop()}),[r]);const C=s.useCallback(()=>d(y=>({...y,zoom:Math.min(5,y.zoom*1.2)})),[]),v=s.useCallback(()=>d(y=>({...y,zoom:Math.max(.1,y.zoom/1.2)})),[]),w=s.useCallback(()=>d({x:0,y:0,zoom:1}),[]);return e.jsx(Ra,{locale:a,children:e.jsxs("div",{className:`nice-diagram-viewer ${o??""}`,style:{display:"flex",flexDirection:"column",height:"100%",...c},children:[n&&e.jsx(Tp,{isPlaying:u,hasAnimations:t.animations.length>0,onPlay:m,onStop:b,onZoomIn:C,onZoomOut:v,onZoomReset:w}),e.jsx("div",{style:{flex:1,position:"relative"},children:e.jsx(dt,{nodes:t.nodes,edges:t.edges,groups:t.groups,viewport:l,onViewportChange:d,theme:t.theme,animationStates:p,interactive:!1,showGrid:i})})]})})},Tp=({isPlaying:t,hasAnimations:a,onPlay:r,onStop:n,onZoomIn:i,onZoomOut:o,onZoomReset:c})=>{const{t:l}=qt();return e.jsxs("div",{className:"nice-diagram-viewer__controls",style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #ddd",background:"#fafafa"},children:[a&&(t?e.jsxs(xe,{className:"nice-diagram-viewer__btn",variant:"ghost",size:"sm",onClick:n,children:["⏹ ",l("animation.stop")]}):e.jsxs(xe,{className:"nice-diagram-viewer__btn",variant:"ghost",size:"sm",onClick:r,children:["▶ ",l("animation.play")]})),e.jsx("span",{style:{flex:1}}),e.jsx(xe,{className:"nice-diagram-viewer__btn",variant:"ghost",size:"sm",onClick:i,children:"🔍+"}),e.jsx(xe,{className:"nice-diagram-viewer__btn",variant:"ghost",size:"sm",onClick:o,children:"🔍−"}),e.jsx(xe,{className:"nice-diagram-viewer__btn",variant:"ghost",size:"sm",onClick:c,children:"1:1"})]})};Ri.displayName="NiceDiagramViewer";const Rp="_cell_10q3j_9",Fp="_expandable_10q3j_29",Ip="_svg_10q3j_57",Pp="_emptyText_10q3j_67",Lp="_badge_10q3j_79",Op="_expandIcon_10q3j_117",Bp="_modalOverlay_10q3j_165",Wp="_modalContent_10q3j_213",Hp="_modalHeader_10q3j_263",qp="_modalTitle_10q3j_281",Vp="_modalClose_10q3j_295",Kp="_modalBody_10q3j_333",Yp="_modalSvg_10q3j_353",Gp="_modalFooter_10q3j_367",Up="_modalInfo_10q3j_385",nt={cell:Rp,expandable:Fp,svg:Ip,emptyText:Pp,badge:Lp,expandIcon:Op,modalOverlay:Bp,modalContent:Wp,modalHeader:Hp,modalTitle:qp,modalClose:Vp,modalBody:Kp,modalSvg:Yp,modalFooter:Gp,modalInfo:Up},Zp=120,Xp=48,Jp=4,an={default:"#3b82f6",process:"#22c55e",decision:"#f59e0b",start:"#6366f1",end:"#ef4444",data:"#8b5cf6",custom:"#64748b"};function _r(t){if(t.length===0)return{minX:0,minY:0,maxX:100,maxY:100,width:100,height:100};let a=1/0,r=1/0,n=-1/0,i=-1/0;for(const o of t){const c=o.position.x,l=o.position.y,d=o.position.x+o.size.width,p=o.position.y+o.size.height;c<a&&(a=c),l<r&&(r=l),d>n&&(n=d),p>i&&(i=p)}return{minX:a,minY:r,maxX:n,maxY:i,width:n-a,height:i-r}}function Fi(t){var r;if((r=t.style)!=null&&r.fill)return t.style.fill;const a=t.type??"default";return an[a]??an.default}function Ii(t,a){const r=a.get(t.sourceNodeId),n=a.get(t.targetNodeId);if(!r||!n)return null;const i=r.position.x+r.size.width/2,o=r.position.y+r.size.height/2,c=n.position.x+n.size.width/2,l=n.position.y+n.size.height/2;return`M ${i} ${o} L ${c} ${l}`}function Qp(t,a){const r=_r(t);return{id:`mini-diagram-${Date.now()}`,name:"Mini Diagram",nodes:t,edges:a,groups:[],viewport:{x:r.minX-20,y:r.minY-20,zoom:1},animations:[],metadata:{author:"",createdAt:new Date().toISOString(),modifiedAt:new Date().toISOString(),version:"1.0.0",tags:[]}}}const em=({document:t,onClose:a})=>{const r=_r(t.nodes),n=40,i=r.width+n*2,o=r.height+n*2,c=s.useMemo(()=>new Map(t.nodes.map(l=>[l.id,l])),[t.nodes]);return e.jsx("div",{className:nt.modalOverlay,onClick:a,children:e.jsxs("div",{className:nt.modalContent,onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:nt.modalHeader,children:[e.jsx("h3",{className:nt.modalTitle,children:t.name||"Diagram"}),e.jsx("button",{className:nt.modalClose,onClick:a,children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsx("div",{className:nt.modalBody,children:e.jsxs("svg",{viewBox:`${r.minX-n} ${r.minY-n} ${i} ${o}`,className:nt.modalSvg,children:[t.edges.map(l=>{var p,h,u;const d=Ii(l,c);return d?e.jsx("path",{d,stroke:((p=l.style)==null?void 0:p.stroke)??"#64748b",strokeWidth:((h=l.style)==null?void 0:h.strokeWidth)??1.5,fill:"none",markerEnd:(u=l.style)!=null&&u.arrowHead?"url(#arrowhead-modal)":void 0},l.id):null}),t.nodes.map(l=>{var d,p;return e.jsxs("g",{children:[e.jsx("rect",{x:l.position.x,y:l.position.y,width:l.size.width,height:l.size.height,rx:((d=l.style)==null?void 0:d.borderRadius)??4,fill:Fi(l),stroke:((p=l.style)==null?void 0:p.stroke)??"#1e293b",strokeWidth:1}),e.jsx("text",{x:l.position.x+l.size.width/2,y:l.position.y+l.size.height/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#ffffff",fontSize:12,fontFamily:"system-ui, sans-serif",children:l.label.substring(0,30)})]},l.id)}),e.jsx("defs",{children:e.jsx("marker",{id:"arrowhead-modal",markerWidth:"10",markerHeight:"7",refX:"9",refY:"3.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#64748b"})})})]})}),e.jsx("div",{className:nt.modalFooter,children:e.jsxs("span",{className:nt.modalInfo,children:[t.nodes.length," nodes • ",t.edges.length," edges"]})})]})})},tm=({document:t,nodes:a,edges:r,width:n=Zp,height:i=Xp,showCount:o=!0,expandable:c=!0,onExpand:l,padding:d=Jp,backgroundColor:p="transparent",borderRadius:h=4,showLabels:u=!1,edgeColor:g="#94a3b8",tooltip:f})=>{const[m,b]=s.useState(!1),C=s.useMemo(()=>t||(a||r?Qp(a??[],r??[]):null),[t,a,r]),v=s.useMemo(()=>C?new Map(C.nodes.map(_=>[_.id,_])):new Map,[C]),{bounds:w,scale:y,translateX:S,translateY:k}=s.useMemo(()=>{if(!C||C.nodes.length===0)return{bounds:{minX:0,minY:0,width:100,height:100},scale:1,translateX:0,translateY:0};const _=_r(C.nodes),j=n-d*2,z=i-d*2,P=j/_.width,I=z/_.height,D=Math.min(P,I,1),T=_.width*D,N=_.height*D,H=(n-T)/2-_.minX*D,E=(i-N)/2-_.minY*D;return{bounds:_,scale:D,translateX:H,translateY:E}},[C,n,i,d]),M=s.useCallback(()=>{!C||!c||(l?l(C):b(!0))},[C,c,l]);return!C||C.nodes.length===0?e.jsx("div",{className:nt.cell,style:{width:n,height:i,backgroundColor:p,borderRadius:h},title:f,children:e.jsx("span",{className:nt.emptyText,children:"—"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`${nt.cell} ${c?nt.expandable:""}`,style:{width:n,height:i,backgroundColor:p,borderRadius:h},onClick:M,title:f??`${C.nodes.length} nodes, ${C.edges.length} edges`,children:[e.jsx("svg",{width:n,height:i,viewBox:`0 0 ${n} ${i}`,className:nt.svg,children:e.jsxs("g",{transform:`translate(${S}, ${k}) scale(${y})`,children:[C.edges.map(_=>{const j=Ii(_,v);return j?e.jsx("path",{d:j,stroke:g,strokeWidth:1/y,fill:"none"},_.id):null}),C.nodes.map(_=>{const j=Fi(_);return e.jsxs("g",{children:[e.jsx("rect",{x:_.position.x,y:_.position.y,width:_.size.width,height:_.size.height,rx:Math.min(4,_.size.width/4),fill:j}),u&&y>.3&&e.jsx("text",{x:_.position.x+_.size.width/2,y:_.position.y+_.size.height/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#ffffff",fontSize:10/y,fontFamily:"system-ui, sans-serif",children:_.label.substring(0,5)})]},_.id)})]})}),o&&e.jsx("span",{className:nt.badge,children:C.nodes.length}),c&&e.jsx("span",{className:nt.expandIcon,children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:e.jsx("path",{d:"M2 10V7M2 10h3M2 10l4-4M10 2v3M10 2H7M10 2L6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})})})]}),m&&C&&e.jsx(em,{document:C,onClose:()=>b(!1)})]})};function Pi(t,a,r="roundedRect"){const n=[],i=[],o=new Map;for(const c of t){const l=String(c[a.nodeMapping.idField]??"");if(!l)continue;const d=String(c[a.nodeMapping.labelField]??l),p=a.nodeMapping.descriptionField?String(c[a.nodeMapping.descriptionField]??""):void 0,h=a.nodeMapping.iconField?String(c[a.nodeMapping.iconField]??""):void 0,u=a.nodeMapping.colorField?String(c[a.nodeMapping.colorField]??""):void 0,g={id:`data_${l}`,label:d,description:p,icon:h,position:{x:0,y:0},size:{width:180,height:70},shape:r,style:u?{backgroundColor:u}:{},ports:[{id:"top",side:"top",offset:.5},{id:"right",side:"right",offset:.5},{id:"bottom",side:"bottom",offset:.5},{id:"left",side:"left",offset:.5}],data:c};n.push(g),o.set(l,g)}if(a.nodeMapping.parentField)for(const c of t){const l=String(c[a.nodeMapping.idField]??""),d=String(c[a.nodeMapping.parentField]??"");if(!l||!d)continue;const p=o.get(l),h=o.get(d);!p||!h||i.push({id:`edge_${d}_${l}`,sourceNodeId:h.id,sourcePortId:"bottom",targetNodeId:p.id,targetPortId:"top",style:{lineType:"orthogonal",targetArrow:"arrow"}})}if(a.edgeMapping)for(const c of t){const l=String(c[a.edgeMapping.sourceField]??""),d=String(c[a.edgeMapping.targetField]??"");if(!l||!d)continue;const p=o.get(l),h=o.get(d);if(!p||!h)continue;const u=a.edgeMapping.labelField?String(c[a.edgeMapping.labelField]??""):void 0;i.push({id:`edge_${l}_${d}`,sourceNodeId:p.id,sourcePortId:"right",targetNodeId:h.id,targetPortId:"left",label:u,style:{lineType:"bezier",targetArrow:"arrow"}})}return{nodes:n,edges:i}}async function am(t,a,r){const n=await fetch(t.sourceUrl,{signal:r});if(!n.ok)throw new Error(`Failed to fetch data: ${n.status} ${n.statusText}`);const i=await n.json(),o=Array.isArray(i)?i:i.value??[];return Pi(o,t,a)}function rm(t){return{rectangle:"rectangle",roundedRect:"roundedRect",ellipse:"ellipse",circle:"circle",diamond:"diamond",hexagon:"hexagon",cylinder:"cylinder",cloud:"cloud",triangle:"triangle"}[t||"rectangle"]||"rectangle"}function nm(t){return t?{backgroundColor:t.fill,borderColor:t.stroke,borderWidth:t.strokeWidth,fontColor:t.fontColor,fontSize:t.fontSize,borderRadius:t.borderRadius,borderStyle:t.strokeDasharray?"dashed":"solid"}:{}}function im(t){if(!t)return{};let a="straight";return t.lineType==="orthogonal"?a="orthogonal":t.lineType==="curved"||t.lineType==="bezier"?a="bezier":t.lineType==="step"&&(a="step"),{strokeColor:t.stroke,strokeWidth:t.strokeWidth,strokeDash:t.strokeDasharray?t.strokeDasharray.split(",").map(Number):void 0,lineType:a,sourceArrow:"none",targetArrow:t.arrowHead?"arrow":"none",opacity:t.opacity}}function sm(t){if(t)return{backgroundColor:t.fill,borderColor:t.stroke,borderWidth:t.strokeWidth}}function Li(t){return{id:t.id,label:t.label,position:{x:t.x,y:t.y},size:{width:t.width,height:t.height},shape:rm(t.shape),style:nm(t.style),ports:(t.ports||[]).map((a,r)=>({id:a.id,side:a.position||"right",offset:.5})),data:t.data}}function Oi(t,a){var c,l;const r=a.find(d=>d.id===t.source),n=a.find(d=>d.id===t.target),i=t.sourcePort||((c=r==null?void 0:r.ports[0])==null?void 0:c.id)||`${t.source}-out`,o=t.targetPort||((l=n==null?void 0:n.ports[0])==null?void 0:l.id)||`${t.target}-in`;return{id:t.id,sourceNodeId:t.source,sourcePortId:i,targetNodeId:t.target,targetPortId:o,label:t.label,style:im(t.style),data:t.data}}function Bi(t){return{id:t.id,label:t.label,nodeIds:t.nodeIds,style:sm(t.style)}}function Wi(t){var a;return{id:t.id,name:t.id,targetId:t.targetId||((a=t.targets)==null?void 0:a[0])||"",targetType:"node",effect:t.type==="highlight"?"highlight":"fadeIn",startMs:t.delay,durationMs:t.duration,easing:"easeInOut"}}function jt(t){const a=t.nodes.map(Li);return a.forEach((r,n)=>{r.ports.length===0&&(r.ports=[{id:`${r.id}-out`,side:"right",offset:.5},{id:`${r.id}-in`,side:"left",offset:.5},{id:`${r.id}-top`,side:"top",offset:.5},{id:`${r.id}-bottom`,side:"bottom",offset:.5}])}),{version:"1.0",id:t.id,title:t.title,diagramType:t.diagramType,nodes:a,edges:t.edges.map(r=>Oi(r,a)),groups:(t.groups||[]).map(Bi),animations:(t.animations||[]).map(Wi),viewport:{x:0,y:0,zoom:1},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),...t.metadata}}}const om={pending:"#9CA3AF",active:"#3B82F6",completed:"#10B981",failed:"#EF4444",skipped:"#F59E0B",waiting:"#8B5CF6"},lm={start:"ellipse",end:"ellipse",task:"rectangle",decision:"diamond",parallel:"rectangle",join:"rectangle",subprocess:"rectangle",timer:"ellipse",message:"rectangle",error:"rectangle"},cm={start:"▶",end:"⬛",task:"📋",decision:"❓",parallel:"⫘",join:"⫗",subprocess:"📦",timer:"⏱",message:"✉",error:"⚠"},dm=({data:t,onStepClick:a,onTransitionClick:r,autoPlay:n=!1,animationDelay:i=1e3,showTooltips:o=!0,showMinimap:c=!0,statusColors:l=om,typeShapes:d=lm,direction:p="horizontal",className:h,style:u})=>{const[g,f]=s.useState(0),m=s.useMemo(()=>{const w=t.steps.map((k,M)=>{const _=k.id===t.currentStepId,j=k.status||"pending",z=l[j],P=d[k.type],I=p==="horizontal"?M*200:100,D=p==="horizontal"?100:M*150;return{id:k.id,label:k.name,x:I,y:D,width:150,height:60,shape:P,style:{fill:z,stroke:_?"#1F2937":z,strokeWidth:_?3:1,fontColor:"#FFFFFF",fontSize:12},data:{type:k.type,status:k.status,assignee:k.assignee,dueDate:k.dueDate,icon:cm[k.type],...k.metadata},ports:[{id:`${k.id}-in`,position:"left"},{id:`${k.id}-out`,position:"right"}]}}),y=t.transitions.map(k=>{const M=t.steps.find(z=>z.id===k.from),_=t.steps.find(z=>z.id===k.to);let j="#9CA3AF";return(M==null?void 0:M.status)==="completed"&&(_==null?void 0:_.status)!=="pending"?j="#10B981":(M==null?void 0:M.status)==="failed"&&(j="#EF4444"),{id:k.id,source:k.from,target:k.to,sourcePort:`${k.from}-out`,targetPort:`${k.to}-in`,label:k.label||k.condition,style:{stroke:j,strokeWidth:2,arrowHead:"arrow",lineType:"bezier"},data:{condition:k.condition}}}),S=n?um(t.steps):[];return jt({id:t.id,title:t.name,diagramType:"flowchart",nodes:w,edges:y,animations:S,metadata:{type:"workflow",...t.metadata}})},[t,l,d,p,n]);s.useEffect(()=>{if(!n)return;const w=t.steps.filter(S=>S.status==="completed").length;if(g>=w)return;const y=setTimeout(()=>{f(S=>S+1)},i);return()=>clearTimeout(y)},[n,g,i,t.steps]),s.useCallback(w=>{if(!a)return;const y=t.steps.find(S=>S.id===w);y&&a(y)},[t.steps,a]);const[b,C]=s.useState({x:0,y:0,zoom:1}),v=s.useCallback(w=>{if(w&&a){const y=t.steps.find(S=>S.id===w);y&&a(y)}if(w&&r){const y=t.transitions.find(S=>S.id===w);y&&r(y)}},[t.steps,t.transitions,a,r]);return e.jsx("div",{className:`nice-workflow-visualizer ${h||""}`,style:{position:"relative",width:"100%",height:"100%",...u},children:e.jsx(dt,{nodes:m.nodes,edges:m.edges,groups:m.groups,viewport:b,onViewportChange:C,onSelectElement:v,showGrid:!0})})};function um(t){return t.filter(r=>r.status==="completed").map((r,n)=>({id:`anim-${r.id}`,targetId:r.id,type:"highlight",delay:n*500,duration:300,easing:"ease-out"}))}function pm(t){var o,c;const r=new DOMParser().parseFromString(t,"text/xml"),n=[],i=[];return r.querySelectorAll("startEvent").forEach(l=>{n.push({id:l.getAttribute("id")||`start-${n.length}`,name:l.getAttribute("name")||"Start",type:"start"})}),r.querySelectorAll("task, userTask, serviceTask").forEach(l=>{n.push({id:l.getAttribute("id")||`task-${n.length}`,name:l.getAttribute("name")||"Task",type:"task"})}),r.querySelectorAll("exclusiveGateway, parallelGateway").forEach(l=>{const d=l.tagName==="parallelGateway";n.push({id:l.getAttribute("id")||`gateway-${n.length}`,name:l.getAttribute("name")||(d?"Parallel":"Decision"),type:d?"parallel":"decision"})}),r.querySelectorAll("endEvent").forEach(l=>{n.push({id:l.getAttribute("id")||`end-${n.length}`,name:l.getAttribute("name")||"End",type:"end"})}),r.querySelectorAll("sequenceFlow").forEach(l=>{i.push({id:l.getAttribute("id")||`flow-${i.length}`,from:l.getAttribute("sourceRef")||"",to:l.getAttribute("targetRef")||"",label:l.getAttribute("name")||void 0})}),{id:((o=r.querySelector("process"))==null?void 0:o.getAttribute("id"))||"workflow",name:((c=r.querySelector("process"))==null?void 0:c.getAttribute("name"))||"Workflow",steps:n,transitions:i}}function mm(t,a){const r=[],n=[];r.push({id:"start",name:"Start",type:"start",status:"completed"}),t.forEach((i,o)=>{r.push({id:`step-${o}`,name:i,type:"task",status:"pending"})}),r.push({id:"end",name:"End",type:"end",status:"pending"}),n.push({id:"start-to-first",from:"start",to:"step-0"});for(let i=0;i<t.length-1;i++)n.push({id:`step-${i}-to-${i+1}`,from:`step-${i}`,to:`step-${i+1}`});return n.push({id:"last-to-end",from:`step-${t.length-1}`,to:"end"}),{id:"linear-workflow",name:"Linear Workflow",steps:r,transitions:n}}const hm={dbo:"#3B82F6",public:"#10B981",auth:"#8B5CF6",billing:"#F59E0B",audit:"#EF4444"},fm={"one-to-one":{left:"1",right:"1"},"one-to-many":{left:"1",right:"*"},"many-to-one":{left:"*",right:"1"},"many-to-many":{left:"*",right:"*"}},gm=({schema:t,onTableClick:a,onColumnClick:r,onRelationClick:n,showColumnDetails:i=!0,showOnlyKeys:o=!1,highlightTables:c=[],showMinimap:l=!0,schemaColors:d=hm,layout:p="auto",maxColumnsDisplay:h=15,className:u,style:g})=>{const[f,m]=s.useState(null),b=s.useMemo(()=>{const y=ym(t.tables,p),S=t.tables.map((M,_)=>{const j=y[M.name]||{x:_%4*300,y:Math.floor(_/4)*400},z=c.includes(M.name),P=f===M.name,I=d[M.schema||"dbo"]||"#6B7280";let D=M.columns;o&&(D=D.filter(E=>E.primaryKey||E.foreignKey)),D.length>h&&(D=D.slice(0,h));const T=40,N=i?28:20,H=T+D.length*N+10;return{id:M.name,label:M.schema?`${M.schema}.${M.name}`:M.name,x:j.x,y:j.y,width:250,height:H,shape:"rectangle",style:{fill:z||P?I:"#FFFFFF",stroke:I,strokeWidth:P?3:z?2:1,fontColor:z||P?"#FFFFFF":"#1F2937",fontSize:14,borderRadius:8},data:{type:"table",schema:M.schema,columns:D.map(E=>({...E,icon:bm(E)})),totalColumns:M.columns.length,truncated:M.columns.length>h,comment:M.comment,...M.metadata},ports:[...M.columns.filter(E=>E.primaryKey).map(E=>({id:`${M.name}.${E.name}-pk`,position:"left"})),...M.columns.filter(E=>E.foreignKey).map(E=>({id:`${M.name}.${E.name}-fk`,position:"right"}))]}}),k=t.relations.map(M=>{const _=fm[M.type];return{id:M.id,source:M.fromTable,target:M.toTable,sourcePort:`${M.fromTable}.${M.fromColumn}-fk`,targetPort:`${M.toTable}.${M.toColumn}-pk`,label:M.name||`${_.left}─${_.right}`,style:{stroke:"#6B7280",strokeWidth:1.5,arrowHead:xm(M.type),arrowTail:vm(M.type),lineType:"orthogonal",strokeDasharray:M.type==="many-to-many"?"5,5":void 0},data:{type:M.type,fromColumn:M.fromColumn,toColumn:M.toColumn}}});return jt({id:`schema-${t.name}`,title:t.name,diagramType:"er",nodes:S,edges:k,metadata:{type:"er-diagram",...t.metadata}})},[t,i,o,c,f,d,p,h]);s.useCallback(y=>{if(m(S=>S===y?null:y),a){const S=t.tables.find(k=>k.name===y);S&&a(S)}},[t.tables,a]),s.useCallback(y=>{if(!n)return;const S=t.relations.find(k=>k.id===y);S&&n(S)},[t.relations,n]);const[C,v]=s.useState({x:0,y:0,zoom:1}),w=s.useCallback(y=>{if(y){if(m(S=>S===y?null:y),a){const S=t.tables.find(k=>k.name===y);S&&a(S)}if(n){const S=t.relations.find(k=>k.id===y);S&&n(S)}}},[t.tables,t.relations,a,n]);return e.jsx("div",{className:`nice-database-schema-viewer ${u||""}`,style:{position:"relative",width:"100%",height:"100%",...g},children:e.jsx(dt,{nodes:b.nodes,edges:b.edges,groups:b.groups,viewport:C,onViewportChange:v,onSelectElement:w,showGrid:!0})})};function ym(t,a){const r={};if(a==="grid"){const n=Math.ceil(Math.sqrt(t.length));t.forEach((i,o)=>{r[i.name]={x:o%n*320+50,y:Math.floor(o/n)*450+50}})}else if(a==="hierarchical"){const n={};t.forEach(o=>{const c=o.schema||"default";n[c]||(n[c]=[]),n[c].push(o)});let i=50;Object.entries(n).forEach(([o,c])=>{c.forEach((l,d)=>{r[l.name]={x:d*320+50,y:i}}),i+=500})}else t.forEach((n,i)=>{const o=i/t.length*2*Math.PI,c=300+t.length*20;r[n.name]={x:Math.cos(o)*c+500,y:Math.sin(o)*c+400}});return r}function bm(t){return t.primaryKey?"🔑":t.foreignKey?"🔗":t.unique?"⚡":"📄"}function xm(t){switch(t){case"one-to-one":case"many-to-one":return"none";case"one-to-many":case"many-to-many":return"crow"}}function vm(t){switch(t){case"one-to-one":case"one-to-many":return"none";case"many-to-one":case"many-to-many":return"crow"}}function km(t){const a=[],r=[],n=/CREATE\s+TABLE\s+(?:`?(\w+)`?\.)?`?(\w+)`?\s*\(([\s\S]*?)\);/gi;let i;for(;(i=n.exec(t))!==null;){const o=i[1]||"dbo",c=i[2],l=i[3],d=[],p=/`?(\w+)`?\s+(\w+(?:\([^)]+\))?)\s*(NOT\s+NULL|NULL)?/gi;let h;for(;(h=p.exec(l))!==null;)d.push({name:h[1],type:h[2],nullable:!h[3]||h[3].toUpperCase()!=="NOT NULL"});const u=/PRIMARY\s+KEY\s*\(`?(\w+)`?\)/i.exec(l);if(u){const m=d.find(b=>b.name===u[1]);m&&(m.primaryKey=!0)}const g=/FOREIGN\s+KEY\s*\(`?(\w+)`?\)\s*REFERENCES\s+`?(\w+)`?\s*\(`?(\w+)`?\)/gi;let f;for(;(f=g.exec(l))!==null;){const m=f,b=d.find(C=>C.name===m[1]);b&&(b.foreignKey={table:m[2],column:m[3]},r.push({id:`fk-${c}-${m[1]}`,fromTable:c,fromColumn:m[1],toTable:m[2],toColumn:m[3],type:"many-to-one"}))}a.push({name:c,schema:o,columns:d})}return{name:"Parsed Schema",tables:a,relations:r}}function wm(t,a="postgres"){const r=[];for(const n of t.tables){const i=n.schema?`${n.schema}.${n.name}`:n.name;r.push(`CREATE TABLE ${i} (`);const o=n.columns.map(l=>{let d=` ${l.name} ${l.type}`;return l.nullable||(d+=" NOT NULL"),l.primaryKey&&(d+=" PRIMARY KEY"),l.unique&&(d+=" UNIQUE"),l.defaultValue&&(d+=` DEFAULT ${l.defaultValue}`),d}),c=n.columns.filter(l=>l.foreignKey).map(l=>` FOREIGN KEY (${l.name}) REFERENCES ${l.foreignKey.table}(${l.foreignKey.column})`);r.push([...o,...c].join(`,
|
|
1255
|
+
`)),r.push(`);
|
|
1256
|
+
`)}return r.join(`
|
|
1257
|
+
`)}const _m={active:"#10B981",away:"#F59E0B",busy:"#EF4444",offline:"#6B7280",vacation:"#8B5CF6",leave:"#3B82F6"},ca=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#14B8A6","#6366F1"],jm=({data:t,rootEmployeeId:a,onEmployeeClick:r,onDepartmentClick:n,showAvatars:i=!0,showContactInfo:o=!1,groupByDepartment:c=!0,collapsedDepartments:l=[],maxLevels:d=0,orientation:p="vertical",spacing:h={horizontal:200,vertical:150},statusColors:u=_m,showMinimap:g=!0,className:f,style:m})=>{const[b,C]=s.useState(new Set),[v,w]=s.useState(null),y=s.useMemo(()=>{var P;if(a)return a;const z=t.employees.find(I=>!I.managerId);return(z==null?void 0:z.id)||((P=t.employees[0])==null?void 0:P.id)},[t.employees,a]),S=s.useMemo(()=>Cm(t.employees,y),[t.employees,y]),k=s.useMemo(()=>{const z=Sm(S,p,h,d),P=[],I={};c&&t.departments&&t.departments.forEach((H,E)=>{const R=H.color||ca[E%ca.length];I[H.id]=R;const x=t.employees.filter($=>$.department===H.id);x.length!==0&&P.push({id:`dept-${H.id}`,label:H.name,nodeIds:x.map($=>$.id),style:{fill:`${R}15`,stroke:R,strokeWidth:2},data:{department:H}})});const D=[],T=[],N=(H,E=0)=>{if(d>0&&E>=d||H.employee.department&&l.includes(H.employee.department))return;const R=z[H.employee.id]||{x:0,y:0},x=v===H.employee.id,$=H.employee.status||"active",A=H.employee.department?I[H.employee.department]:"#6B7280",O=180,F=o?120:i?90:70;D.push({id:H.employee.id,label:H.employee.name,x:R.x,y:R.y,width:O,height:F,shape:"rectangle",style:{fill:x?A:"#FFFFFF",stroke:A,strokeWidth:x?3:1,fontColor:x?"#FFFFFF":"#1F2937",fontSize:13,borderRadius:12},data:{type:"employee",employee:H.employee,statusColor:u[$],hasChildren:H.children.length>0,childrenCount:H.children.length}}),H.employee.managerId&&T.push({id:`rel-${H.employee.managerId}-${H.employee.id}`,source:H.employee.managerId,target:H.employee.id,style:{stroke:"#CBD5E1",strokeWidth:2,arrowHead:"none",lineType:p==="vertical"?"orthogonal":"curved"}}),H.children.forEach(L=>N(L,E+1))};return S&&N(S),jt({id:"org-chart",title:"Organization Chart",diagramType:"orgchart",nodes:D,edges:T,groups:P,metadata:{type:"org-chart",...t.metadata}})},[t,S,p,h,d,c,l,i,o,u,v]);s.useCallback(z=>{if(w(P=>P===z?null:z),C(P=>{const I=new Set(P);return I.has(z)?I.delete(z):I.add(z),I}),r){const P=t.employees.find(I=>I.id===z);P&&r(P)}},[t.employees,r]),s.useCallback(z=>{if(!n||!t.departments)return;const P=z.replace("dept-",""),I=t.departments.find(D=>D.id===P);I&&n(I)},[t.departments,n]);const[M,_]=s.useState({x:0,y:0,zoom:1}),j=s.useCallback(z=>{if(z&&(w(P=>P===z?null:z),r)){const P=t.employees.find(I=>I.id===z);P&&r(P)}},[t.employees,r]);return e.jsx("div",{className:`nice-org-chart-visualizer ${f||""}`,style:{position:"relative",width:"100%",height:"100%",...m},children:e.jsx(dt,{nodes:k.nodes,edges:k.edges,groups:k.groups,viewport:M,onViewportChange:_,onSelectElement:j,showGrid:!1})})};function Cm(t,a){const n=new Map(t.map(o=>[o.id,o])).get(a);if(!n)return null;const i=(o,c)=>{const l=t.filter(d=>d.managerId===o.id);return{employee:o,children:l.map(d=>i(d,c+1)),level:c}};return i(n,0)}function Sm(t,a,r,n){const i={};if(!t)return i;const o=(d,p)=>n>0&&p>=n?0:d.children.length===0?1:d.children.reduce((h,u)=>h+o(u,p+1),0),c=(d,p,h,u)=>{if(n>0&&p>=n)return;const g=h+u*r.horizontal/2,f=p*r.vertical+50;i[d.employee.id]=a==="vertical"?{x:g,y:f}:{x:f,y:g};let m=h;d.children.forEach(b=>{const C=o(b,p+1);c(b,p+1,m,C),m+=C*r.horizontal})},l=o(t,0);return c(t,0,0,l),i}function Nm(t){const r=[...new Set(t.map(n=>n.department).filter(Boolean))].map((n,i)=>({id:n,name:n,color:ca[i%ca.length],headcount:t.filter(o=>o.department===n).length}));return{employees:t,departments:r}}function Mm(t){var l;const a=new Set(t.employees.map(d=>d.managerId).filter(Boolean)),r=(d,p=new Set)=>{if(p.has(d))return 0;p.add(d);const h=t.employees.find(u=>u.id===d);return h!=null&&h.managerId?1+r(h.managerId,p):1},n=t.employees.map(d=>r(d.id)),i=Math.max(...n,0),o=Array.from(a).map(d=>t.employees.filter(p=>p.managerId===d).length),c=o.length>0?o.reduce((d,p)=>d+p,0)/o.length:0;return{totalEmployees:t.employees.length,departmentCount:((l=t.departments)==null?void 0:l.length)||0,maxDepth:i,averageSpan:Math.round(c*10)/10,managers:a.size}}const $m=({data:t,onActivityClick:a,onTransitionClick:r,minEdgeFrequency:n=.05,showFrequency:i=!0,showDuration:o=!0,highlightBottlenecks:c=!0,bottleneckThreshold:l=.9,colorScheme:d="frequency",activityColors:p,layout:h="hierarchical",animationSpeed:u=0,showMinimap:g=!0,className:f,style:m})=>{const[b,C]=s.useState(null),v=s.useMemo(()=>"activities"in t?t:Hi(t),[t]),w=s.useMemo(()=>{if(!c)return new Set;const _=v.activities.filter(z=>z.avgDuration!==void 0).map(z=>z.avgDuration);if(_.length===0)return new Set;_.sort((z,P)=>z-P);const j=_[Math.floor(_.length*l)]||0;return new Set(v.activities.filter(z=>(z.avgDuration||0)>=j).map(z=>z.name))},[v.activities,c,l]),y=s.useMemo(()=>{const _=Math.max(...v.activities.map(T=>T.frequency),1),j=zm(v,h),z=v.transitions.filter(T=>T.frequency/v.totalCases>=n),P=v.activities.map(T=>{const N=j[T.name]||{x:0,y:0},H=v.startActivities.includes(T.name),E=v.endActivities.includes(T.name),R=w.has(T.name),x=b===T.name,$=Am(T,d,_,p,R);return{id:T.name,label:T.name,x:N.x,y:N.y,width:140,height:60,shape:H?"ellipse":E?"roundedRect":"rectangle",style:{fill:x?$:"#FFFFFF",stroke:$,strokeWidth:R?4:x?3:2,fontColor:x?"#FFFFFF":"#1F2937",fontSize:12,borderRadius:E?20:8},data:{type:"activity",activity:T,isStart:H,isEnd:E,isBottleneck:R,frequencyPercent:Math.round(T.frequency/v.totalCases*100)}}}),I=z.map((T,N)=>{const H=T.probability||T.frequency/v.totalCases,E=H>.5,R=[];return i&&R.push(`${T.frequency}x`),o&&T.avgDuration&&R.push(Dm(T.avgDuration)),{id:`trans-${N}`,source:T.from,target:T.to,label:R.join(" | "),style:{stroke:E?"#3B82F6":"#9CA3AF",strokeWidth:Math.max(1,Math.min(6,H*8)),arrowHead:"triangle",lineType:"curved",opacity:Math.max(.3,H)},data:{type:"transition",transition:T,probability:H}}}),D=u>0?Tm(v,u):[];return jt({id:"process-mining",title:"Process Mining Diagram",diagramType:"flowchart",nodes:P,edges:I,animations:D,metadata:{type:"process-mining",totalCases:v.totalCases,avgCaseDuration:v.avgCaseDuration}})},[v,n,i,o,c,w,d,p,h,u,b]);s.useCallback(_=>{if(C(j=>j===_?null:_),a){const j=v.activities.find(z=>z.name===_);j&&a(j)}},[v.activities,a]),s.useCallback(_=>{if(!r)return;const j=parseInt(_.replace("trans-",""),10),z=v.transitions[j];z&&r(z)},[v.transitions,r]);const[S,k]=s.useState({x:0,y:0,zoom:1}),M=s.useCallback(_=>{if(_&&(C(j=>j===_?null:_),a)){const j=v.activities.find(z=>z.name===_);j&&a(j)}},[v.activities,a]);return e.jsx("div",{className:`nice-process-mining-diagram ${f||""}`,style:{position:"relative",width:"100%",height:"100%",...m},children:e.jsx(dt,{nodes:y.nodes,edges:y.edges,groups:y.groups,viewport:S,onViewportChange:k,onSelectElement:M,showGrid:!0})})};function zm(t,a){const r={};if(a==="circular"){const n=t.activities;n.forEach((i,o)=>{const c=o/n.length*2*Math.PI-Math.PI/2,l=200+n.length*15;r[i.name]={x:Math.cos(c)*l+400,y:Math.sin(c)*l+300}})}else{const n=Em(t),i={};t.activities.forEach(c=>{const l=n[c.name]||0;i[l]=(i[l]||0)+1});const o={};t.activities.forEach(c=>{const l=n[c.name]||0,d=o[l]||0;o[l]=d+1;const p=i[l],h=(d-(p-1)/2)*180;r[c.name]={x:400+h,y:50+l*120}})}return r}function Em(t){const a={},r=new Set,n=t.startActivities.map(i=>({activity:i,level:0}));for(;n.length>0;){const{activity:i,level:o}=n.shift();if(r.has(i))continue;r.add(i),a[i]=o,t.transitions.filter(l=>l.from===i).forEach(l=>{r.has(l.to)||n.push({activity:l.to,level:o+1})})}return t.activities.forEach(i=>{a[i.name]===void 0&&(a[i.name]=0)}),a}function Am(t,a,r,n,i){if(i)return"#EF4444";if(n!=null&&n[t.name])return n[t.name];const o=t.frequency/r;switch(a){case"frequency":return Na("#10B981","#3B82F6",o);case"duration":return t.avgDuration?Na("#10B981","#F59E0B",o):"#6B7280";case"cost":return t.avgCost?Na("#10B981","#EF4444",o):"#6B7280";default:return"#3B82F6"}}function Na(t,a,r){const n=p=>{const h=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(p);return h?{r:parseInt(h[1],16),g:parseInt(h[2],16),b:parseInt(h[3],16)}:{r:0,g:0,b:0}},i=n(t),o=n(a),c=Math.round(i.r+(o.r-i.r)*r),l=Math.round(i.g+(o.g-i.g)*r),d=Math.round(i.b+(o.b-i.b)*r);return`#${[c,l,d].map(p=>p.toString(16).padStart(2,"0")).join("")}`}function Dm(t){return t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:t<36e5?`${(t/6e4).toFixed(1)}m`:t<864e5?`${(t/36e5).toFixed(1)}h`:`${(t/864e5).toFixed(1)}d`}function Tm(t,a){var n;const r=(n=t.variants)==null?void 0:n[0];return r?r.activities.map((i,o)=>({id:`flow-${o}`,type:"highlight",targets:[i],duration:a,delay:o*a})):[]}function Hi(t){const a=t.events.map(f=>({...f,timestamp:f.timestamp instanceof Date?f.timestamp:new Date(f.timestamp)})),r=new Map;a.forEach(f=>{r.has(f.caseId)||r.set(f.caseId,[]),r.get(f.caseId).push(f)}),r.forEach(f=>{f.sort((m,b)=>m.timestamp.getTime()-b.timestamp.getTime())});const n=new Map,i=new Map,o=new Set,c=new Set;r.forEach(f=>{if(f.length!==0){o.add(f[0].activity),c.add(f[f.length-1].activity);for(let m=0;m<f.length;m++){const b=f[m];n.has(b.activity)||n.set(b.activity,{frequency:0,durations:[],resources:new Set,costs:[]});const C=n.get(b.activity);if(C.frequency++,b.resource&&C.resources.add(b.resource),b.cost!==void 0&&C.costs.push(b.cost),m<f.length-1){const v=f[m+1],w=v.timestamp.getTime()-b.timestamp.getTime();C.durations.push(w);const y=`${b.activity}→${v.activity}`;i.has(y)||i.set(y,{frequency:0,durations:[]});const S=i.get(y);S.frequency++,S.durations.push(w)}}}});const l=Array.from(n.entries()).map(([f,m])=>({name:f,frequency:m.frequency,avgDuration:m.durations.length>0?m.durations.reduce((b,C)=>b+C,0)/m.durations.length:void 0,minDuration:m.durations.length>0?Math.min(...m.durations):void 0,maxDuration:m.durations.length>0?Math.max(...m.durations):void 0,resources:Array.from(m.resources),avgCost:m.costs.length>0?m.costs.reduce((b,C)=>b+C,0)/m.costs.length:void 0})),d=Array.from(i.entries()).map(([f,m])=>{const[b,C]=f.split("→");return{from:b,to:C,frequency:m.frequency,avgDuration:m.durations.length>0?m.durations.reduce((v,w)=>v+w,0)/m.durations.length:void 0,probability:m.frequency/r.size}}),p=new Map;r.forEach((f,m)=>{const b=f.map(v=>v.activity).join("→");p.has(b)||p.set(b,{caseIds:[],durations:[]});const C=p.get(b);if(C.caseIds.push(m),f.length>=2){const v=f[f.length-1].timestamp.getTime()-f[0].timestamp.getTime();C.durations.push(v)}});const h=Array.from(p.entries()).map(([f,m])=>({activities:f.split("→"),frequency:m.caseIds.length,avgDuration:m.durations.length>0?m.durations.reduce((b,C)=>b+C,0)/m.durations.length:0,caseIds:m.caseIds})).sort((f,m)=>m.frequency-f.frequency),u=Array.from(r.values()).filter(f=>f.length>=2).map(f=>f[f.length-1].timestamp.getTime()-f[0].timestamp.getTime()),g=u.length>0?u.reduce((f,m)=>f+m,0)/u.length:void 0;return{activities:l,transitions:d,variants:h,startActivities:Array.from(o),endActivities:Array.from(c),totalCases:r.size,avgCaseDuration:g}}const qi={module:"#3B82F6",package:"#10B981",microservice:"#8B5CF6",library:"#F59E0B",api:"#EC4899",database:"#14B8A6",external:"#6B7280",deprecated:"#EF4444"},Vi={healthy:"#10B981",warning:"#F59E0B",critical:"#EF4444",unknown:"#6B7280",deprecated:"#9CA3AF"},rn={import:{color:"#3B82F6"},runtime:{color:"#10B981"},dev:{color:"#6B7280",dash:"5,5"},peer:{color:"#F59E0B",dash:"10,5"},"api-call":{color:"#8B5CF6"},database:{color:"#14B8A6"},event:{color:"#EC4899",dash:"2,2"},circular:{color:"#EF4444"}},Rm={module:"📦",package:"📁",microservice:"🔲",library:"📚",api:"🔌",database:"🗄️",external:"🌐",deprecated:"⚠️"},Fm=({data:t,onNodeClick:a,onEdgeClick:r,visibleTypes:n,visibleEdgeTypes:i,highlightCircular:o=!0,showOnlyIssues:c=!1,layout:l="force",groupBy:d="type",nodeSizeBy:p="dependencies",colorScheme:h="type",nodeColors:u,showMetrics:g=!0,interactive:f=!0,showMinimap:m=!0,className:b,style:C})=>{const[v,w]=s.useState(null),[y,S]=s.useState(null),k=s.useMemo(()=>o?Ki(t):new Set,[t,o]),M=s.useMemo(()=>{let D=t.nodes;return n&&n.length>0&&(D=D.filter(T=>n.includes(T.type))),c&&(D=D.filter(T=>{var N;return T.status==="critical"||T.status==="warning"||((N=T.metrics)==null?void 0:N.issues)&&T.metrics.issues>0})),D},[t.nodes,n,c]),_=s.useMemo(()=>{const D=new Set(M.map(N=>N.id));let T=t.edges.filter(N=>D.has(N.source)&&D.has(N.target));return i&&i.length>0&&(T=T.filter(N=>i.includes(N.type))),T},[t.edges,M,i]),j=s.useMemo(()=>{const D=Im(M,_,l),T=Lm(M,p),N=[];if(d!=="none"){const R=new Map;M.forEach($=>{const A=d==="type"?$.type:$.group||"ungrouped";R.has(A)||R.set(A,[]),R.get(A).push($.id)});let x=0;R.forEach(($,A)=>{var F,L;const O=d==="type"?qi[A]||"#6B7280":((L=(F=t.groups)==null?void 0:F.find(G=>G.id===A))==null?void 0:L.color)||da[x%da.length];N.push({id:`group-${A}`,label:A,nodeIds:$,style:{fill:`${O}10`,stroke:O,strokeWidth:1}}),x++})}const H=M.map(R=>{const x=D[R.id]||{x:0,y:0},$=v===R.id,A=y===R.id,O=k.has(R.id),F=Om(R,p,T),L=Bm(R,h,u,O);return{id:R.id,label:R.name,x:x.x,y:x.y,width:F.width,height:F.height,shape:Wm(R.type),style:{fill:$||A?L:"#FFFFFF",stroke:L,strokeWidth:O?4:$?3:2,fontColor:$||A?"#FFFFFF":"#1F2937",fontSize:11,borderRadius:8,strokeDasharray:R.status==="deprecated"?"4,4":void 0},data:{type:"dependency",node:R,icon:Rm[R.type],isCircular:O,statusColor:Vi[R.status||"unknown"]}}}),E=_.map((R,x)=>{const $=R.type==="circular"||k.has(R.source)&&k.has(R.target),A=rn[R.type]||rn.import;return{id:R.id||`edge-${x}`,source:R.source,target:R.target,label:R.optional?"(optional)":void 0,style:{stroke:$?"#EF4444":A.color,strokeWidth:Math.max(1,Math.min(4,R.weight||1)),strokeDasharray:A.dash,arrowHead:"triangle",lineType:"curved",opacity:R.optional?.5:1},data:{type:R.type,edge:R,isCircular:$}}});return jt({id:"dependency-graph",title:"Dependency Graph",diagramType:"custom",nodes:H,edges:E,groups:N,metadata:{type:"dependency-graph",...t.metadata}})},[M,_,l,d,t.groups,p,h,u,k,v,y]);s.useCallback(D=>{if(w(T=>T===D?null:D),a){const T=t.nodes.find(N=>N.id===D);T&&a(T)}},[t.nodes,a]),s.useCallback(D=>{if(!r)return;const T=t.edges.find(N=>N.id===D);T&&r(T)},[t.edges,r]),s.useCallback(D=>{S(D)},[]);const[z,P]=s.useState({x:0,y:0,zoom:1}),I=s.useCallback(D=>{if(D){if(w(T=>T===D?null:D),a){const T=t.nodes.find(N=>N.id===D);T&&a(T)}if(r){const T=t.edges.find(N=>N.id===D);T&&r(T)}}},[t.nodes,t.edges,a,r]);return e.jsx("div",{className:`nice-dependency-graph ${b||""}`,style:{position:"relative",width:"100%",height:"100%",...C},children:e.jsx(dt,{nodes:j.nodes,edges:j.edges,groups:j.groups,viewport:z,onViewportChange:P,onSelectElement:I,interactive:f,showGrid:!0})})},da=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#14B8A6","#6366F1"];function Ki(t){const a=new Set,r=new Map;t.nodes.forEach(c=>r.set(c.id,[])),t.edges.forEach(c=>{var l;(l=r.get(c.source))==null||l.push(c.target)});const n=new Set,i=new Set,o=(c,l)=>{n.add(c),i.add(c),l.push(c);const d=r.get(c)||[];for(const p of d)if(n.has(p)){if(i.has(p)){const h=l.indexOf(p);l.slice(h).forEach(g=>a.add(g))}}else if(o(p,[...l]))return!0;return i.delete(c),!1};return t.nodes.forEach(c=>{n.has(c.id)||o(c.id,[])}),a}function Im(t,a,r){const n={};switch(r){case"circular":{t.forEach((i,o)=>{const c=o/t.length*2*Math.PI-Math.PI/2,l=150+t.length*12;n[i.id]={x:Math.cos(c)*l+400,y:Math.sin(c)*l+300}});break}case"grid":{const i=Math.ceil(Math.sqrt(t.length));t.forEach((o,c)=>{n[o.id]={x:c%i*200+100,y:Math.floor(c/i)*150+100}});break}case"hierarchical":{const i=Pm(t,a),o={},c={};t.forEach(l=>{const d=i[l.id]||0;o[d]=(o[d]||0)+1}),t.forEach(l=>{const d=i[l.id]||0,p=c[d]||0;c[d]=p+1;const h=o[d],u=(p-(h-1)/2)*200;n[l.id]={x:400+u,y:80+d*130}});break}default:{t.forEach((i,o)=>{const c=o/t.length*2*Math.PI,l=200+t.length*10;n[i.id]={x:Math.cos(c)*l+400,y:Math.sin(c)*l+300}});for(let i=0;i<50;i++){const o={};t.forEach(c=>o[c.id]={x:0,y:0});for(let c=0;c<t.length;c++)for(let l=c+1;l<t.length;l++){const d=t[c].id,p=t[l].id,h=n[p].x-n[d].x,u=n[p].y-n[d].y,g=Math.max(1,Math.sqrt(h*h+u*u)),f=5e3/(g*g);o[d].x-=h/g*f,o[d].y-=u/g*f,o[p].x+=h/g*f,o[p].y+=u/g*f}a.forEach(c=>{const l=n[c.target].x-n[c.source].x,d=n[c.target].y-n[c.source].y,p=Math.sqrt(l*l+d*d),h=p*.01;o[c.source].x+=l/p*h,o[c.source].y+=d/p*h,o[c.target].x-=l/p*h,o[c.target].y-=d/p*h}),t.forEach(c=>{n[c.id].x+=Math.max(-10,Math.min(10,o[c.id].x)),n[c.id].y+=Math.max(-10,Math.min(10,o[c.id].y))})}break}}return n}function Pm(t,a){const r={},n={};t.forEach(o=>{r[o.id]=0,n[o.id]=0}),a.forEach(o=>{n[o.target]=(n[o.target]||0)+1});const i=t.filter(o=>n[o.id]===0).map(o=>o.id);for(;i.length>0;){const o=i.shift();a.filter(l=>l.source===o).forEach(l=>{r[l.target]=Math.max(r[l.target],r[o]+1),n[l.target]--,n[l.target]===0&&i.push(l.target)})}return r}function Lm(t,a){const r=t.map(n=>{var i,o,c;switch(a){case"dependencies":return((i=n.metrics)==null?void 0:i.dependencies)||0;case"dependents":return((o=n.metrics)==null?void 0:o.dependents)||0;case"complexity":return((c=n.metrics)==null?void 0:c.complexity)||0;case"size":return n.size||0;default:return 1}});return{min:Math.min(...r,0),max:Math.max(...r,1)}}function Om(t,a,r){var d,p,h;if(a==="fixed")return{width:140,height:70};let n;switch(a){case"dependencies":n=((d=t.metrics)==null?void 0:d.dependencies)||0;break;case"dependents":n=((p=t.metrics)==null?void 0:p.dependents)||0;break;case"complexity":n=((h=t.metrics)==null?void 0:h.complexity)||0;break;case"size":n=t.size||0;break;default:n=1}const i=r.max>r.min?(n-r.min)/(r.max-r.min):.5,o=100,l=o+i*(180-o);return{width:l,height:l*.5}}function Bm(t,a,r,n){if(n)return"#EF4444";if(r!=null&&r[t.id])return r[t.id];switch(a){case"status":return Vi[t.status||"unknown"];case"group":return da[Hm(t.group||"")%da.length];default:return qi[t.type]||"#6B7280"}}function Wm(t){switch(t){case"database":return"cylinder";case"microservice":return"hexagon";case"api":return"diamond";case"external":return"cloud";default:return"rectangle"}}function Hm(t){let a=0;for(let r=0;r<t.length;r++)a=(a<<5)-a+t.charCodeAt(r),a|=0;return Math.abs(a)}function qm(t){const a=[{id:t.name,name:t.name,version:t.version,type:"package",status:"healthy"}],r=[];let n=0;const i=(o,c)=>{o&&Object.entries(o).forEach(([l,d])=>{a.find(p=>p.id===l)||a.push({id:l,name:l,version:d.replace(/[\^~>=<]/g,""),type:"library",status:"unknown"}),r.push({id:`edge-${n++}`,source:t.name,target:l,type:c})})};return i(t.dependencies,"runtime"),i(t.devDependencies,"dev"),i(t.peerDependencies,"peer"),a.forEach(o=>{o.metrics={dependencies:r.filter(c=>c.source===o.id).length,dependents:r.filter(c=>c.target===o.id).length}}),{nodes:a,edges:r}}function Vm(t){const a=new Map,r=new Map;t.nodes.forEach(h=>{a.set(h.id,0),r.set(h.id,0)}),t.edges.forEach(h=>{a.set(h.target,(a.get(h.target)||0)+1),r.set(h.source,(r.get(h.source)||0)+1)}),Ki(t);let n=null,i=0;t.nodes.forEach(h=>{const u=a.get(h.id)||0;u>i&&(i=u,n=h)});let o=null,c=0;t.nodes.forEach(h=>{const u=r.get(h.id)||0;u>c&&(c=u,o=h)});const l=t.nodes.filter(h=>(a.get(h.id)||0)===0&&(r.get(h.id)||0)===0),d=Array.from(r.values()).reduce((h,u)=>h+u,0),p=t.nodes.length>0?d/t.nodes.length:0;return{totalNodes:t.nodes.length,totalEdges:t.edges.length,circularDependencies:[],mostDependent:n,mostDependencies:o,orphanNodes:l,avgDependencies:Math.round(p*10)/10}}const Km={online:"#10B981",offline:"#6B7280",warning:"#F59E0B",critical:"#EF4444",maintenance:"#3B82F6",unknown:"#9CA3AF"},Ym={router:"🔀",switch:"🔌",firewall:"🛡️",server:"🖥️",workstation:"💻",laptop:"💻",phone:"📱",printer:"🖨️",camera:"📷",iot:"📡",loadbalancer:"⚖️",storage:"💾",cloud:"☁️",internet:"🌐",unknown:"❓"},Gm={ethernet:"#3B82F6",fiber:"#10B981",wireless:"#8B5CF6",vpn:"#F59E0B",wan:"#EC4899",trunk:"#14B8A6"},Um=({data:t,onDeviceClick:a,onConnectionClick:r,onRefresh:n,autoRefreshInterval:i=0,visibleDeviceTypes:o,showOnlyIssues:c=!1,layout:l="hierarchical",groupBy:d="group",showMetrics:p=!0,showBandwidth:h=!0,showLatency:u=!1,animateTraffic:g=!1,statusColors:f=Km,showMinimap:m=!0,className:b,style:C})=>{const[v,w]=s.useState(null),[y,S]=s.useState(new Date);s.useEffect(()=>{if(i<=0||!n)return;const I=setInterval(()=>{n(),S(new Date)},i);return()=>clearInterval(I)},[i,n]);const k=s.useMemo(()=>{let I=t.devices;return o&&o.length>0&&(I=I.filter(D=>o.includes(D.type))),c&&(I=I.filter(D=>D.status==="critical"||D.status==="warning"||D.status==="offline")),I},[t.devices,o,c]),M=s.useMemo(()=>{const I=new Set(k.map(D=>D.id));return t.connections.filter(D=>I.has(D.source)&&I.has(D.target))},[t.connections,k]),_=s.useMemo(()=>{const I=Zm(k,M,l,t.groups),D=[];if(d!=="none"){const E=new Map;k.forEach(x=>{let $;switch(d){case"type":$=x.type;break;case"location":$=x.location||"Unknown Location";break;default:$=x.group||"ungrouped"}E.has($)||E.set($,[]),E.get($).push(x.id)});let R=0;E.forEach((x,$)=>{var F;const A=(F=t.groups)==null?void 0:F.find(L=>L.id===$||L.name===$),O=(A==null?void 0:A.color)||nn[R%nn.length];D.push({id:`group-${$}`,label:(A==null?void 0:A.name)||$,nodeIds:x,style:{fill:`${O}15`,stroke:O,strokeWidth:2}}),R++})}const T=k.map(E=>{const R=I[E.id]||{x:0,y:0},x=v===E.id,$=f[E.status],A=Ym[E.type];return{id:E.id,label:E.name,x:R.x,y:R.y,width:120,height:p?90:70,shape:Xm(E.type),style:{fill:x?$:"#FFFFFF",stroke:$,strokeWidth:x?3:2,fontColor:x?"#FFFFFF":"#1F2937",fontSize:11,borderRadius:8},data:{type:"network-device",device:E,icon:A,statusColor:$}}}),N=M.map((E,R)=>{const x=Gm[E.type]||"#6B7280",$=E.status==="active",A=E.status==="degraded"||E.status==="error",O=[];if(h&&E.bandwidth){const F=Math.round(E.bandwidth.used/E.bandwidth.total*100);O.push(`${F}%`)}return u&&E.latency!==void 0&&O.push(`${E.latency}ms`),{id:E.id||`conn-${R}`,source:E.source,target:E.target,sourcePort:E.sourcePort,targetPort:E.targetPort,label:O.join(" | ")||void 0,style:{stroke:A?"#EF4444":x,strokeWidth:Math.max(1,Math.min(6,(E.speed||1e3)/1e3)),strokeDasharray:$?void 0:"5,5",arrowHead:"none",lineType:E.type==="wireless"?"curved":"orthogonal",opacity:E.status==="inactive"?.3:1},data:{type:E.type,connection:E,isActive:$,isDegraded:A}}}),H=g?Jm(M):[];return jt({id:"network-topology",title:"Network Topology",diagramType:"networkTopology",nodes:T,edges:N,groups:D,animations:H,metadata:{type:"network-topology",lastRefresh:y.toISOString(),...t.metadata}})},[k,M,l,d,t.groups,p,h,u,g,f,v,y]);s.useCallback(I=>{if(w(D=>D===I?null:I),a){const D=t.devices.find(T=>T.id===I);D&&a(D)}},[t.devices,a]),s.useCallback(I=>{if(!r)return;const D=t.connections.find(T=>T.id===I);D&&r(D)},[t.connections,r]);const[j,z]=s.useState({x:0,y:0,zoom:1}),P=s.useCallback(I=>{if(I&&(w(D=>D===I?null:I),a)){const D=t.devices.find(T=>T.id===I);D&&a(D)}},[t.devices,a]);return e.jsx("div",{className:`nice-network-topology ${b||""}`,style:{position:"relative",width:"100%",height:"100%",...C},children:e.jsx(dt,{nodes:_.nodes,edges:_.edges,groups:_.groups,viewport:j,onViewportChange:z,onSelectElement:P,showGrid:!0})})},nn=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#14B8A6","#6366F1"];function Zm(t,a,r,n){var o;const i={};switch(r){case"star":{const c=new Map;t.forEach(h=>c.set(h.id,0)),a.forEach(h=>{c.set(h.source,(c.get(h.source)||0)+1),c.set(h.target,(c.get(h.target)||0)+1)});let l=(o=t[0])==null?void 0:o.id,d=0;c.forEach((h,u)=>{h>d&&(d=h,l=u)}),i[l]={x:400,y:300};const p=t.filter(h=>h.id!==l);p.forEach((h,u)=>{const g=u/p.length*2*Math.PI-Math.PI/2,f=200;i[h.id]={x:Math.cos(g)*f+400,y:Math.sin(g)*f+300}});break}case"mesh":{const c=Math.ceil(Math.sqrt(t.length));t.forEach((l,d)=>{i[l.id]={x:d%c*150+100,y:Math.floor(d/c)*130+100}});break}case"tree":{const c=t.filter(g=>g.type==="internet"||g.type==="cloud"||g.type==="router"),l=new Map,d=c.map(g=>g.id);d.forEach(g=>l.set(g,0));const p=new Set(d);for(;d.length>0;){const g=d.shift(),f=l.get(g)||0;a.forEach(m=>{let b=null;m.source===g&&!p.has(m.target)&&(b=m.target),m.target===g&&!p.has(m.source)&&(b=m.source),b&&(p.add(b),l.set(b,f+1),d.push(b))})}const h={},u={};t.forEach(g=>{const f=l.get(g.id)||0;h[f]=(h[f]||0)+1}),t.forEach(g=>{const f=l.get(g.id)||0,m=u[f]||0;u[f]=m+1;const b=h[f],C=(m-(b-1)/2)*160;i[g.id]={x:400+C,y:80+f*120}});break}case"hierarchical":default:{const c=["internet","cloud","router","firewall","loadbalancer","switch","server","storage","workstation","laptop","phone","printer","camera","iot","unknown"],l=new Map;t.forEach(p=>{l.has(p.type)||l.set(p.type,[]),l.get(p.type).push(p)});let d=50;c.forEach(p=>{const h=l.get(p);!h||h.length===0||(h.forEach((u,g)=>{const f=(g-(h.length-1)/2)*150;i[u.id]={x:400+f,y:d}}),d+=130)});break}}return i}function Xm(t){switch(t){case"router":case"switch":return"diamond";case"firewall":return"hexagon";case"server":case"storage":return"rectangle";case"cloud":case"internet":return"cloud";default:return"rectangle"}}function Jm(t){return t.filter(a=>a.status==="active"&&a.bandwidth&&a.bandwidth.used>0).map((a,r)=>({id:`traffic-${r}`,type:"flow",targets:[a.id],duration:2e3,delay:r*200}))}async function Qm(t={}){return console.log("Network discovery with options:",t),{devices:[{id:"internet",name:"Internet",type:"internet",status:"online"},{id:"router-1",name:"Edge Router",type:"router",ipAddress:"192.168.1.1",status:"online",metrics:{cpu:45,memory:60,latency:5}},{id:"firewall-1",name:"Firewall",type:"firewall",ipAddress:"192.168.1.2",status:"online",metrics:{cpu:30,memory:55}},{id:"switch-1",name:"Core Switch",type:"switch",ipAddress:"192.168.1.10",status:"online"},{id:"server-1",name:"Web Server",type:"server",ipAddress:"192.168.1.100",status:"online",metrics:{cpu:75,memory:80}},{id:"server-2",name:"Database Server",type:"server",ipAddress:"192.168.1.101",status:"warning",metrics:{cpu:90,memory:85}}],connections:[{id:"c1",source:"internet",target:"router-1",type:"wan",status:"active",speed:1e3},{id:"c2",source:"router-1",target:"firewall-1",type:"ethernet",status:"active",speed:1e4},{id:"c3",source:"firewall-1",target:"switch-1",type:"ethernet",status:"active",speed:1e4},{id:"c4",source:"switch-1",target:"server-1",type:"ethernet",status:"active",speed:1e4},{id:"c5",source:"switch-1",target:"server-2",type:"ethernet",status:"active",speed:1e4}]}}function eh(t){const a=t.devices.filter(u=>u.status==="online").length,r=t.devices.filter(u=>u.status==="offline").length,n=t.devices.filter(u=>u.status==="warning").length,i=t.devices.filter(u=>u.status==="critical").length,o=t.connections.filter(u=>u.status==="active").length,c=t.connections.filter(u=>u.status==="degraded"||u.status==="error").length,l=t.devices.length>0?a/t.devices.length*100:0,d=t.connections.length>0?o/t.connections.length*100:0,p=i*10+n*5+c*5;return{score:Math.max(0,Math.min(100,Math.round(l*.5+d*.5-p))),onlineDevices:a,offlineDevices:r,warningDevices:n,criticalDevices:i,activeConnections:o,degradedConnections:c}}const th={root:"#8B5CF6",decision:"#3B82F6",leaf:"#10B981",chance:"#F59E0B",end:"#EF4444"},ah=({data:t,onChange:a,onNodeClick:r,editable:n=!1,showMetrics:i=!0,showProbabilities:o=!0,showSamples:c=!0,highlightPath:l,colorScheme:d="outcome",nodeColors:p,orientation:h="vertical",spacing:u={horizontal:180,vertical:120},showMinimap:g=!0,className:f,style:m})=>{const[b,C]=s.useState(null),[v,w]=s.useState(new Set),y=s.useMemo(()=>l?oh(t.root,l):new Set,[t.root,l]),{nodes:S,edges:k}=s.useMemo(()=>rh(t.root,t.edges),[t.root,t.edges]),M=s.useMemo(()=>ih(S),[S]),_=s.useMemo(()=>{var N,H;const I=nh(t.root,h,u),D=S.map(E=>{const R=I[E.id]||{x:0,y:0},x=b===E.id,$=y.has(E.id),A=E.type==="leaf"||E.type==="end",O=sh(E,d,p,M),F=A?120:160,L=i?80:A?60:70;return{id:E.id,label:E.label,x:R.x,y:R.y,width:F,height:L,shape:A?"roundedRect":"diamond",style:{fill:x||$?O:"#FFFFFF",stroke:O,strokeWidth:$?4:x?3:2,fontColor:x||$?"#FFFFFF":"#1F2937",fontSize:11,borderRadius:A?8:0},data:{type:"decision-tree-node",node:E,isLeaf:A,isHighlighted:$}}}),T=k.map((E,R)=>{const x=y.has(E.source)&&y.has(E.target);let $=E.label||"";return o&&E.probability!==void 0&&($+=$?` (${(E.probability*100).toFixed(0)}%)`:`${(E.probability*100).toFixed(0)}%`),{id:E.id||`edge-${R}`,source:E.source,target:E.target,label:$||void 0,style:{stroke:x?"#3B82F6":"#9CA3AF",strokeWidth:x?3:2,arrowHead:"triangle",lineType:h==="vertical"?"orthogonal":"curved"},data:{type:"decision-edge",edge:E,isHighlighted:x}}});return jt({id:"decision-tree",title:"Decision Tree",diagramType:"decisionTree",nodes:D,edges:T,animations:l?lh(Array.from(y)):[],metadata:{type:"decision-tree",algorithm:(N=t.metadata)==null?void 0:N.algorithm,accuracy:(H=t.metadata)==null?void 0:H.accuracy}})},[S,k,h,u,i,o,d,p,M,b,y,l,t.metadata]);s.useCallback(I=>{C(T=>T===I?null:I);const D=S.find(T=>T.id===I);D&&D.type!=="leaf"&&D.type!=="end"&&w(T=>{const N=new Set(T);return N.has(I)?N.delete(I):N.add(I),N}),r&&D&&r(D)},[S,r]);const[j,z]=s.useState({x:0,y:0,zoom:1}),P=s.useCallback(I=>{if(!I)return;C(T=>T===I?null:I);const D=S.find(T=>T.id===I);D&&D.type!=="leaf"&&D.type!=="end"&&w(T=>{const N=new Set(T);return N.has(I)?N.delete(I):N.add(I),N}),r&&D&&r(D)},[S,r]);return e.jsx("div",{className:`nice-decision-tree-editor ${f||""}`,style:{position:"relative",width:"100%",height:"100%",...m},children:e.jsx(dt,{nodes:_.nodes,edges:_.edges,groups:_.groups,viewport:j,onViewportChange:z,onSelectElement:P,interactive:!0,showGrid:!1})})};function rh(t,a){const r=[],n=a?[...a]:[],i=new Set(n.map(c=>`${c.source}-${c.target}`)),o=(c,l)=>{r.push(c),l&&!i.has(`${l}-${c.id}`)&&n.push({id:`e-${l}-${c.id}`,source:l,target:c.id}),c.children&&c.children.forEach((d,p)=>{let h="";c.condition&&(h=p===0?"Yes":"No");const u=`${c.id}-${d.id}`;i.has(u)||(n.push({id:`e-${u}`,source:c.id,target:d.id,label:h,branch:p===0?"yes":"no"}),i.add(u)),o(d,c.id)})};return o(t),{nodes:r,edges:n}}function nh(t,a,r){const n={},i=l=>!l.children||l.children.length===0?1:l.children.reduce((d,p)=>d+i(p),0),o=(l,d,p,h)=>{const u=p+h*r.horizontal/2,g=d*r.vertical+50;if(n[l.id]=a==="vertical"?{x:u,y:g}:{x:g,y:u},l.children){let f=p;l.children.forEach(m=>{const b=i(m);o(m,d+1,f,b),f+=b*r.horizontal})}},c=i(t);return o(t,0,0,c),n}function ih(t){const a=t.filter(n=>{var i;return((i=n.metrics)==null?void 0:i.impurity)!==void 0}).map(n=>n.metrics.impurity),r=t.filter(n=>{var i;return((i=n.metrics)==null?void 0:i.samples)!==void 0}).map(n=>n.metrics.samples);return{impurity:{min:Math.min(...a,0),max:Math.max(...a,1)},samples:{min:Math.min(...r,0),max:Math.max(...r,100)}}}function sh(t,a,r,n){var i,o,c;if(r!=null&&r[t.id])return r[t.id];switch(a){case"impurity":if(((i=t.metrics)==null?void 0:i.impurity)!==void 0&&n){const l=(t.metrics.impurity-n.impurity.min)/(n.impurity.max-n.impurity.min||1);return sn("#10B981","#EF4444",l)}break;case"samples":if(((o=t.metrics)==null?void 0:o.samples)!==void 0&&n){const l=(t.metrics.samples-n.samples.min)/(n.samples.max-n.samples.min||1);return sn("#FEF3C7","#F59E0B",l)}break;case"outcome":if(t.type==="leaf"&&((c=t.outcome)!=null&&c.class))return{positive:"#10B981",negative:"#EF4444",true:"#10B981",false:"#EF4444",yes:"#10B981",no:"#EF4444"}[t.outcome.class.toLowerCase()]||"#3B82F6";break}return th[t.type]||"#6B7280"}function sn(t,a,r){const n=p=>({r:parseInt(p.slice(1,3),16),g:parseInt(p.slice(3,5),16),b:parseInt(p.slice(5,7),16)}),i=n(t),o=n(a),c=Math.round(i.r+(o.r-i.r)*r),l=Math.round(i.g+(o.g-i.g)*r),d=Math.round(i.b+(o.b-i.b)*r);return`#${[c,l,d].map(p=>p.toString(16).padStart(2,"0")).join("")}`}function oh(t,a){const r=new Set,n=i=>{if(r.add(i.id),i.type==="leaf"||i.type==="end"||!i.children)return!0;if(i.condition){const o=a[i.condition.feature],l=Yi(o,i.condition.operator,i.condition.value)?0:1;if(i.children[l])return n(i.children[l])}return i.children[0]?n(i.children[0]):!0};return n(t),r}function Yi(t,a,r){switch(a){case"=":return t===r;case"!=":return t!==r;case"<":return Number(t)<Number(r);case"<=":return Number(t)<=Number(r);case">":return Number(t)>Number(r);case">=":return Number(t)>=Number(r);case"in":return Array.isArray(r)&&r.includes(t);case"not_in":return Array.isArray(r)&&!r.includes(t);case"contains":return String(t).includes(String(r));default:return!1}}function lh(t){return t.map((a,r)=>({id:`path-${r}`,type:"highlight",targets:[a],duration:500,delay:r*300}))}function ch(t){const{tree:a,feature_names:r,class_names:n}=t;a.children_left.length;const i=c=>{const l=a.children_left[c]===-1,d=a.n_node_samples[c],p=a.impurity[c],h=a.value[c];if(l){const C=Array.isArray(h)?h:[h],v=Array.isArray(C[0])?C[0]:C,w=v.indexOf(Math.max(...v)),y=(n==null?void 0:n[w])||`Class ${w}`,S=v.reduce((M,_)=>M+_,0),k=S>0?v[w]/S:0;return{id:`node-${c}`,type:"leaf",label:y,outcome:{value:y,class:y,probability:k,samples:d},metrics:{samples:d,impurity:p}}}const u=a.feature[c],g=a.threshold[c],f=r[u]||`feature_${u}`,m=i(a.children_left[c]),b=i(a.children_right[c]);return{id:`node-${c}`,type:c===0?"root":"decision",label:`${f} <= ${g.toFixed(2)}`,condition:{feature:f,operator:"<=",value:g},children:[m,b],metrics:{samples:d,impurity:p,giniIndex:p}}},o=i(0);return{root:o,features:r,classes:n,metadata:{algorithm:"sklearn.DecisionTreeClassifier",maxDepth:Gi(o)}}}function Gi(t,a=0){return!t.children||t.children.length===0?a:Math.max(...t.children.map(r=>Gi(r,a+1)))}function dh(t){const a=(n,i)=>typeof n=="string"?{id:i,type:"leaf",label:n,outcome:{value:n}}:{...n,id:i};return{root:{id:"root",type:"root",label:t.question,condition:{feature:t.feature,operator:typeof t.threshold=="number"?"<=":"=",value:t.threshold},children:[a(t.yesOutcome,"yes-outcome"),a(t.noOutcome,"no-outcome")]}}}function uh(t,a){const r=[],n=o=>{var c,l;if(r.push(o.id),o.type==="leaf"||o.type==="end"||!o.children)return{value:((c=o.outcome)==null?void 0:c.value)??o.label,probability:(l=o.outcome)==null?void 0:l.probability};if(o.condition){const d=a[o.condition.feature],h=Yi(d,o.condition.operator,o.condition.value)?0:1;if(o.children[h])return n(o.children[h])}return o.children[0]?n(o.children[0]):{value:null}},i=n(t.root);return{prediction:i.value,probability:i.probability,path:r}}const ph={size:20,enabled:!0,guideThreshold:5,showGuides:!0};function Da(t,a){return Math.round(t/a)*a}function Ui(t,a){return{x:Da(t.x,a),y:Da(t.y,a)}}function mh(t,a,r){return Ui(t,r)}function on(t,a,r){return{id:t,left:a.x,right:a.x+r.width,top:a.y,bottom:a.y+r.height,centerX:a.x+r.width/2,centerY:a.y+r.height/2}}function hh(t,a,r,n,i=5){const o=[],c=on(t,a,r);for(const l of n){if(l.id===t)continue;const d=on(l.id,l.position,l.size);Math.abs(c.centerX-d.centerX)<=i&&o.push({axis:"vertical",position:d.centerX,sourceNodeIds:[t,l.id],type:"center"}),Math.abs(c.left-d.left)<=i&&o.push({axis:"vertical",position:d.left,sourceNodeIds:[t,l.id],type:"edge"}),Math.abs(c.right-d.right)<=i&&o.push({axis:"vertical",position:d.right,sourceNodeIds:[t,l.id],type:"edge"}),Math.abs(c.centerY-d.centerY)<=i&&o.push({axis:"horizontal",position:d.centerY,sourceNodeIds:[t,l.id],type:"center"}),Math.abs(c.top-d.top)<=i&&o.push({axis:"horizontal",position:d.top,sourceNodeIds:[t,l.id],type:"edge"}),Math.abs(c.bottom-d.bottom)<=i&&o.push({axis:"horizontal",position:d.bottom,sourceNodeIds:[t,l.id],type:"edge"})}return gh(o)}function fh(t,a,r){let n=t.x,i=t.y;const o=[],c=r.filter(d=>d.axis==="vertical");if(c.length>0){const d=t.x+a.width/2;let p=null,h=1/0;for(const u of c){const g=u.type==="center"?Math.abs(d-u.position):Math.abs(t.x-u.position);g<h&&(h=g,p=u)}p&&(n=p.type==="center"?p.position-a.width/2:p.position,o.push(p))}const l=r.filter(d=>d.axis==="horizontal");if(l.length>0){const d=t.y+a.height/2;let p=null,h=1/0;for(const u of l){const g=u.type==="center"?Math.abs(d-u.position):Math.abs(t.y-u.position);g<h&&(h=g,p=u)}p&&(i=p.type==="center"?p.position-a.height/2:p.position,o.push(p))}return{snappedPosition:{x:n,y:i},activeGuides:o}}function gh(t){const a=new Set;return t.filter(r=>{const n=`${r.axis}-${r.position}-${r.type}`;return a.has(n)?!1:(a.add(n),!0)})}let yh=0;function jr(){return`tmpl-${++yh}-${Date.now().toString(36)}`}function Le(t,a,r="roundedRect",n={width:160,height:60},i){return{id:jr(),label:t,position:a,size:n,shape:r,style:{},ports:[{id:"top",side:"top",offset:.5},{id:"right",side:"right",offset:.5},{id:"bottom",side:"bottom",offset:.5},{id:"left",side:"left",offset:.5}],data:i}}function He(t,a,r="bottom",n="top",i){return{id:jr(),sourceNodeId:t.id,sourcePortId:r,targetNodeId:a.id,targetPortId:n,label:i,style:{lineType:"bezier",targetArrow:"arrow"}}}function Rt(t,a,r,n){const i=new Date().toISOString();return{version:"1.0",id:jr(),title:t,diagramType:a,nodes:r,edges:n,groups:[],animations:[],viewport:{x:0,y:0,zoom:1},metadata:{createdAt:i,updatedAt:i}}}function bh(){const t=Le("Commit",{x:40,y:200},"circle",{width:80,height:80}),a=Le("Build",{x:200,y:200},"roundedRect"),r=Le("Test",{x:420,y:200},"roundedRect"),n=Le("Deploy",{x:640,y:200},"roundedRect"),i=Le("Production",{x:860,y:200},"hexagon",{width:140,height:80});return Rt("CI/CD Pipeline","flowchart",[t,a,r,n,i],[He(t,a,"right","left"),He(a,r,"right","left"),He(r,n,"right","left"),He(n,i,"right","left")])}function xh(){const t=Le("API Gateway",{x:350,y:40},"hexagon",{width:160,height:80}),a=Le("Auth Service",{x:80,y:200},"roundedRect"),r=Le("User Service",{x:300,y:200},"roundedRect"),n=Le("Order Service",{x:520,y:200},"roundedRect"),i=Le("Notification",{x:740,y:200},"roundedRect"),o=Le("Users DB",{x:180,y:380},"cylinder",{width:120,height:70}),c=Le("Orders DB",{x:520,y:380},"cylinder",{width:120,height:70}),l=Le("Message Queue",{x:620,y:380},"parallelogram",{width:160,height:60}),d=[t,a,r,n,i,o,c,l],p=[He(t,a,"bottom","top"),He(t,r,"bottom","top"),He(t,n,"bottom","top"),He(n,i,"right","left"),He(r,o,"bottom","top"),He(n,c,"bottom","top"),He(i,l,"bottom","top")];return Rt("Microservices Architecture","flowchart",d,p)}function vh(){const t=Le("Start",{x:350,y:20},"circle",{width:70,height:70}),a=Le("Landing Page",{x:310,y:140},"roundedRect"),r=Le("Sign Up",{x:140,y:280},"roundedRect"),n=Le("Log In",{x:480,y:280},"roundedRect"),i=Le("Dashboard",{x:310,y:420},"roundedRect"),o=Le("End",{x:350,y:560},"circle",{width:70,height:70});return Rt("User Flow","flowchart",[t,a,r,n,i,o],[He(t,a,"bottom","top"),He(a,r,"bottom","top","New user"),He(a,n,"bottom","top","Returning"),He(r,i,"bottom","top"),He(n,i,"bottom","top"),He(i,o,"bottom","top")])}function kh(){const t=Le("Users",{x:80,y:100},"rectangle",{width:180,height:100}),a=Le("Orders",{x:380,y:100},"rectangle",{width:180,height:100}),r=Le("Products",{x:380,y:320},"rectangle",{width:180,height:100}),n=Le("Categories",{x:680,y:320},"rectangle",{width:180,height:100});return Rt("Entity Relationship","er",[t,a,r,n],[He(t,a,"right","left","1:N"),He(a,r,"bottom","top","N:M"),He(r,n,"right","left","N:1")])}function wh(){const t=Le("CEO",{x:350,y:40},"roundedRect"),a=Le("CTO",{x:150,y:180},"roundedRect"),r=Le("CFO",{x:550,y:180},"roundedRect"),n=Le("Engineering",{x:50,y:320},"roundedRect"),i=Le("DevOps",{x:250,y:320},"roundedRect"),o=Le("Accounting",{x:550,y:320},"roundedRect");return Rt("Organization Chart","orgchart",[t,a,r,n,i,o],[He(t,a,"bottom","top"),He(t,r,"bottom","top"),He(a,n,"bottom","top"),He(a,i,"bottom","top"),He(r,o,"bottom","top")])}function _h(){const t=Le("Idle",{x:80,y:200},"circle",{width:90,height:90}),a=Le("Loading",{x:300,y:80},"roundedRect"),r=Le("Success",{x:520,y:80},"roundedRect"),n=Le("Error",{x:520,y:320},"roundedRect"),i=Le("Retry",{x:300,y:320},"diamond",{width:100,height:100});return Rt("State Machine","stateMachine",[t,a,r,n,i],[He(t,a,"right","left","fetch"),He(a,r,"right","left","ok"),He(a,n,"bottom","top","fail"),He(n,i,"left","right"),He(i,a,"top","bottom","retry"),He(i,t,"left","right","cancel")])}const ga=[{id:"cicd-pipeline",name:"CI/CD Pipeline",description:"Continuous integration and deployment pipeline",category:"software",diagramType:"flowchart",tags:["devops","ci","cd","pipeline","deployment"],create:bh},{id:"microservices",name:"Microservices Architecture",description:"Microservices with API gateway, databases, and message queue",category:"software",diagramType:"flowchart",tags:["architecture","microservices","api","backend"],create:xh},{id:"user-flow",name:"User Flow",description:"User journey through signup, login, and dashboard",category:"general",diagramType:"flowchart",tags:["ux","user-flow","journey","wireframe"],create:vh},{id:"er-diagram",name:"Entity Relationship",description:"Database ER diagram with tables and relations",category:"software",diagramType:"er",tags:["database","er","schema","sql"],create:kh},{id:"org-chart",name:"Organization Chart",description:"Company organizational hierarchy",category:"business",diagramType:"orgchart",tags:["org","hierarchy","team","management"],create:wh},{id:"state-machine",name:"State Machine",description:"Finite state machine with transitions",category:"software",diagramType:"stateMachine",tags:["state","fsm","transitions","machine"],create:_h}];function jh(t){return ga.find(a=>a.id===t)}function Ch(t){return ga.filter(a=>a.category===t)}function Sh(t){const a=t.toLowerCase();return ga.filter(r=>r.name.toLowerCase().includes(a)||r.description.toLowerCase().includes(a)||r.tags.some(n=>n.includes(a)))}class Zi{constructor(a={}){this.versions=[],this.currentVersionIndex=-1,this.autoSaveTimer=null,this.lastDocument=null,this.listeners=new Set,this.config={maxVersions:a.maxVersions??100,autoSaveInterval:a.autoSaveInterval??3e4,compressOldVersions:a.compressOldVersions??!1,userId:a.userId??"",userName:a.userName??"Anonymous"}}startAutoSave(a){this.config.autoSaveInterval<=0||(this.autoSaveTimer=setInterval(()=>{const r=a();this.hasChanges(r)&&this.saveVersion(r,"Auto-save")},this.config.autoSaveInterval))}stopAutoSave(){this.autoSaveTimer&&(clearInterval(this.autoSaveTimer),this.autoSaveTimer=null)}hasChanges(a){return this.lastDocument?JSON.stringify(a)!==JSON.stringify(this.lastDocument):!0}saveVersion(a,r){const n=this.lastDocument?this.calculateChanges(this.lastDocument,a):[{type:"node-added",description:"Initial version"}],i={id:Nh(),number:this.versions.length+1,timestamp:new Date().toISOString(),userId:this.config.userId,userName:this.config.userName,label:r,snapshot:JSON.stringify(a),changes:n};return this.currentVersionIndex<this.versions.length-1&&(this.versions=this.versions.slice(0,this.currentVersionIndex+1)),this.versions.push(i),this.currentVersionIndex=this.versions.length-1,this.lastDocument=JSON.parse(JSON.stringify(a)),this.versions.length>this.config.maxVersions&&(this.versions.shift(),this.currentVersionIndex--),this.notify(),i}getVersions(){return this.versions}getCurrentVersionIndex(){return this.currentVersionIndex}getCurrentVersion(){return this.versions[this.currentVersionIndex]??null}getVersion(a){return this.versions.find(r=>r.id===a)}getDocumentAtVersion(a){const r=this.getVersion(a);return r?JSON.parse(r.snapshot):null}restoreToVersion(a){const r=this.versions.findIndex(i=>i.id===a);if(r===-1)return null;this.currentVersionIndex=r;const n=JSON.parse(this.versions[r].snapshot);return this.lastDocument=JSON.parse(JSON.stringify(n)),this.notify(),n}diff(a,r){const n=this.getVersion(a),i=this.getVersion(r);if(!n||!i)return null;const o=JSON.parse(n.snapshot),c=JSON.parse(i.snapshot),l=this.calculateChanges(o,c),d={nodesAdded:l.filter(p=>p.type==="node-added").length,nodesRemoved:l.filter(p=>p.type==="node-removed").length,nodesMoved:l.filter(p=>p.type==="node-moved").length,nodesRestyled:l.filter(p=>p.type==="node-restyled").length,edgesAdded:l.filter(p=>p.type==="edge-added").length,edgesRemoved:l.filter(p=>p.type==="edge-removed").length,edgesRestyled:l.filter(p=>p.type==="edge-restyled").length,groupsModified:l.filter(p=>p.type.startsWith("group-")).length,totalChanges:l.length};return{fromVersionId:a,toVersionId:r,changes:l,summary:d}}calculateChanges(a,r){const n=[];a.title!==r.title&&n.push({type:"title-changed",elementType:"document",previousValue:a.title,newValue:r.title,description:`Title changed from "${a.title}" to "${r.title}"`});const i=new Set(a.nodes.map(h=>h.id)),o=new Set(r.nodes.map(h=>h.id));for(const h of r.nodes)i.has(h.id)||n.push({type:"node-added",elementId:h.id,elementType:"node",newValue:h,description:`Node "${h.label||h.id}" added`});for(const h of a.nodes)o.has(h.id)||n.push({type:"node-removed",elementId:h.id,elementType:"node",previousValue:h,description:`Node "${h.label||h.id}" removed`});for(const h of r.nodes){const u=a.nodes.find(g=>g.id===h.id);u&&((u.position.x!==h.position.x||u.position.y!==h.position.y)&&n.push({type:"node-moved",elementId:h.id,elementType:"node",previousValue:{x:u.position.x,y:u.position.y},newValue:{x:h.position.x,y:h.position.y},description:`Node "${h.label||h.id}" moved`}),(u.size.width!==h.size.width||u.size.height!==h.size.height)&&n.push({type:"node-resized",elementId:h.id,elementType:"node",previousValue:{width:u.size.width,height:u.size.height},newValue:{width:h.size.width,height:h.size.height},description:`Node "${h.label||h.id}" resized`}),u.label!==h.label&&n.push({type:"node-relabeled",elementId:h.id,elementType:"node",previousValue:u.label,newValue:h.label,description:`Node label changed from "${u.label}" to "${h.label}"`}),JSON.stringify(u.style)!==JSON.stringify(h.style)&&n.push({type:"node-restyled",elementId:h.id,elementType:"node",previousValue:u.style,newValue:h.style,description:`Node "${h.label||h.id}" style changed`}))}const c=new Set(a.edges.map(h=>h.id)),l=new Set(r.edges.map(h=>h.id));for(const h of r.edges)c.has(h.id)||n.push({type:"edge-added",elementId:h.id,elementType:"edge",newValue:h,description:`Edge from "${h.sourceNodeId}" to "${h.targetNodeId}" added`});for(const h of a.edges)l.has(h.id)||n.push({type:"edge-removed",elementId:h.id,elementType:"edge",previousValue:h,description:`Edge from "${h.sourceNodeId}" to "${h.targetNodeId}" removed`});for(const h of r.edges){const u=a.edges.find(g=>g.id===h.id);u&&((u.sourceNodeId!==h.sourceNodeId||u.targetNodeId!==h.targetNodeId)&&n.push({type:"edge-rerouted",elementId:h.id,elementType:"edge",previousValue:{source:u.sourceNodeId,target:u.targetNodeId},newValue:{source:h.sourceNodeId,target:h.targetNodeId},description:"Edge rerouted"}),JSON.stringify(u.style)!==JSON.stringify(h.style)&&n.push({type:"edge-restyled",elementId:h.id,elementType:"edge",previousValue:u.style,newValue:h.style,description:"Edge style changed"}))}const d=new Set(a.groups.map(h=>h.id)),p=new Set(r.groups.map(h=>h.id));for(const h of r.groups)d.has(h.id)||n.push({type:"group-added",elementId:h.id,elementType:"group",newValue:h,description:`Group "${h.label||h.id}" added`});for(const h of a.groups)p.has(h.id)||n.push({type:"group-removed",elementId:h.id,elementType:"group",previousValue:h,description:`Group "${h.label||h.id}" removed`});return(a.viewport.x!==r.viewport.x||a.viewport.y!==r.viewport.y||a.viewport.zoom!==r.viewport.zoom)&&n.push({type:"viewport-changed",elementType:"document",previousValue:a.viewport,newValue:r.viewport,description:"Viewport changed"}),JSON.stringify(a.theme)!==JSON.stringify(r.theme)&&n.push({type:"theme-changed",elementType:"document",previousValue:a.theme,newValue:r.theme,description:"Theme changed"}),n}subscribe(a){return this.listeners.add(a),()=>this.listeners.delete(a)}notify(){this.listeners.forEach(a=>a())}exportHistory(){return JSON.stringify({versions:this.versions,currentVersionIndex:this.currentVersionIndex})}importHistory(a){const r=JSON.parse(a);this.versions=r.versions??[],this.currentVersionIndex=r.currentVersionIndex??-1,this.versions.length>0&&this.currentVersionIndex>=0&&(this.lastDocument=JSON.parse(this.versions[this.currentVersionIndex].snapshot)),this.notify()}clearHistory(){this.versions=[],this.currentVersionIndex=-1,this.lastDocument=null,this.notify()}}function Nh(){return`v_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function Mh(t){const a=new Zi(t);return{manager:a,saveVersion:a.saveVersion.bind(a),getVersions:a.getVersions.bind(a),restoreToVersion:a.restoreToVersion.bind(a),diff:a.diff.bind(a)}}class $h{constructor(a){this.comments=new Map,this.listeners=new Set,this.mentionListeners=new Set,this.config=a}addComment(a,r,n){const i=this.parseMentions(r),o={id:zh(),anchor:a,status:"open",authorId:this.config.userId,authorName:this.config.userName,authorAvatar:this.config.userAvatar,text:r,mentions:i,replies:[],createdAt:new Date().toISOString(),style:(n==null?void 0:n.style)??this.config.defaultStyle,tags:n==null?void 0:n.tags,priority:n==null?void 0:n.priority};return this.comments.set(o.id,o),this.notify(),i.forEach(c=>this.notifyMention(o,c.userId)),o}updateComment(a,r){const n=this.comments.get(a);return n?(r.text!==void 0&&(n.text=r.text,n.mentions=this.parseMentions(r.text),n.editedAt=new Date().toISOString()),r.style!==void 0&&(n.style=r.style),r.tags!==void 0&&(n.tags=r.tags),r.priority!==void 0&&(n.priority=r.priority),r.anchor!==void 0&&(n.anchor=r.anchor),this.notify(),n):null}deleteComment(a){const r=this.comments.delete(a);return r&&this.notify(),r}resolveComment(a,r="resolved"){const n=this.comments.get(a);return n?(n.status=r,n.resolvedBy=this.config.userId,n.resolvedAt=new Date().toISOString(),this.notify(),n):null}reopenComment(a){const r=this.comments.get(a);return r?(r.status="open",r.resolvedBy=void 0,r.resolvedAt=void 0,this.notify(),r):null}addReply(a,r){const n=this.comments.get(a);if(!n)return null;const i=this.parseMentions(r),o={id:Eh(),authorId:this.config.userId,authorName:this.config.userName,authorAvatar:this.config.userAvatar,text:r,mentions:i,createdAt:new Date().toISOString()};return n.replies.push(o),this.notify(),i.forEach(c=>this.notifyMention(n,c.userId)),o}editReply(a,r,n){const i=this.comments.get(a);if(!i)return null;const o=i.replies.find(c=>c.id===r);return o?(o.text=n,o.mentions=this.parseMentions(n),o.editedAt=new Date().toISOString(),this.notify(),o):null}deleteReply(a,r){const n=this.comments.get(a);if(!n)return!1;const i=n.replies.find(o=>o.id===r);return i?(i.deleted=!0,i.text="[deleted]",this.notify(),!0):!1}getComment(a){return this.comments.get(a)}getAllComments(){return Array.from(this.comments.values())}getCommentsForElement(a){return Array.from(this.comments.values()).filter(r=>r.anchor.elementId===a)}getOpenComments(){return Array.from(this.comments.values()).filter(a=>a.status==="open")}getCommentsMentioningUser(a){return Array.from(this.comments.values()).filter(r=>{const n=r.mentions.some(o=>o.userId===a),i=r.replies.some(o=>o.mentions.some(c=>c.userId===a));return n||i})}filterComments(a){return Array.from(this.comments.values()).filter(r=>{if(a.status&&!a.status.includes(r.status)||a.authorId&&r.authorId!==a.authorId||a.priority&&r.priority&&!a.priority.includes(r.priority)||a.tags&&a.tags.length>0&&(!r.tags||!a.tags.some(n=>r.tags.includes(n)))||a.anchorType&&!a.anchorType.includes(r.anchor.type)||a.elementId&&r.anchor.elementId!==a.elementId)return!1;if(a.searchText){const n=a.searchText.toLowerCase();if(![r.text,...r.replies.map(o=>o.text)].join(" ").toLowerCase().includes(n))return!1}return!(a.mentionedUserId&&!(r.mentions.some(i=>i.userId===a.mentionedUserId)||r.replies.some(i=>i.mentions.some(o=>o.userId===a.mentionedUserId))))})}parseMentions(a){var o;const r=[],n=/@(\w+)/g;let i;for(;(i=n.exec(a))!==null;){const c=i[1],l=(o=this.config.availableUsers)==null?void 0:o.find(d=>d.name.toLowerCase()===c.toLowerCase()||d.id===c);l&&r.push({userId:l.id,userName:l.name,startIndex:i.index,endIndex:i.index+i[0].length})}return r}subscribe(a){return this.listeners.add(a),()=>this.listeners.delete(a)}onMention(a){return this.mentionListeners.add(a),()=>this.mentionListeners.delete(a)}notify(){this.listeners.forEach(a=>a())}notifyMention(a,r){this.mentionListeners.forEach(n=>n(a,r))}exportComments(){return JSON.stringify(Array.from(this.comments.values()))}importComments(a){const r=JSON.parse(a);this.comments.clear(),r.forEach(n=>this.comments.set(n.id,n)),this.notify()}getCounts(){const a=Array.from(this.comments.values());return{open:a.filter(r=>r.status==="open").length,resolved:a.filter(r=>r.status==="resolved").length,wontfix:a.filter(r=>r.status==="wontfix").length,total:a.length}}updateConfig(a){Object.assign(this.config,a)}}function zh(){return`comment_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function Eh(){return`reply_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}const Ah={low:{backgroundColor:"#e3f2fd",borderColor:"#2196f3",textColor:"#1565c0",icon:"info"},medium:{backgroundColor:"#fff3e0",borderColor:"#ff9800",textColor:"#e65100",icon:"warning"},high:{backgroundColor:"#ffebee",borderColor:"#f44336",textColor:"#c62828",icon:"error"},critical:{backgroundColor:"#fce4ec",borderColor:"#e91e63",textColor:"#880e4f",icon:"flame"}};function Dh(t){const a=new Date(t),n=new Date().getTime()-a.getTime(),i=Math.floor(n/(1e3*60)),o=Math.floor(i/60),c=Math.floor(o/24);return i<1?"just now":i<60?`${i}m ago`:o<24?`${o}h ago`:c<7?`${c}d ago`:a.toLocaleDateString()}function Th(t,a){if(a.length===0)return t;const r=[...a].sort((i,o)=>o.startIndex-i.startIndex);let n=t;for(const i of r){const o=n.slice(0,i.startIndex),c=n.slice(i.endIndex);n=`${o}<span class="mention" data-user-id="${i.userId}">@${i.userName}</span>${c}`}return n}class Xi{constructor(){this.profiles=new Map,this.activeProfileId=null,this.listeners=new Set,this.cache=new Map,this.profiles.set("default",{id:"default",name:"Default",description:"Default conditional styling profile",rules:[],enabled:!0}),this.activeProfileId="default"}addRule(a,r="default"){const n=this.profiles.get(r);n&&(n.rules=n.rules.filter(i=>i.id!==a.id),n.rules.push(a),n.rules.sort((i,o)=>i.priority-o.priority),this.invalidateCache(),this.notify())}removeRule(a,r="default"){const n=this.profiles.get(r);n&&(n.rules=n.rules.filter(i=>i.id!==a),this.invalidateCache(),this.notify())}updateRule(a,r,n="default"){const i=this.profiles.get(n);if(!i)return;const o=i.rules.find(c=>c.id===a);o&&(Object.assign(o,r),i.rules.sort((c,l)=>c.priority-l.priority),this.invalidateCache(),this.notify())}toggleRule(a,r,n="default"){this.updateRule(a,{enabled:r},n)}addProfile(a){this.profiles.set(a.id,a),this.notify()}removeProfile(a){a!=="default"&&(this.profiles.delete(a),this.activeProfileId===a&&(this.activeProfileId="default"),this.invalidateCache(),this.notify())}setActiveProfile(a){this.profiles.has(a)&&(this.activeProfileId=a,this.invalidateCache(),this.notify())}getProfiles(){return Array.from(this.profiles.values())}getActiveProfile(){return this.activeProfileId?this.profiles.get(this.activeProfileId)??null:null}applyToNode(a){const r=`node_${a.id}_${JSON.stringify(a.data)}`,n=this.cache.get(r);if(n)return n;const i=this.getActiveProfile();if(!(i!=null&&i.enabled))return this.emptyStyles(a.id);const o=i.rules.filter(l=>l.enabled&&(l.target==="node"||l.target==="both")&&(!l.elementShapes||l.elementShapes.includes(a.shape))),c=this.processRules(a.id,o,a);return this.cache.set(r,c),c}applyToEdge(a){const r=`edge_${a.id}_${JSON.stringify(a.data)}`,n=this.cache.get(r);if(n)return n;const i=this.getActiveProfile();if(!(i!=null&&i.enabled))return this.emptyStyles(a.id);const o=i.rules.filter(l=>l.enabled&&(l.target==="edge"||l.target==="both")),c=this.processRules(a.id,o,a);return this.cache.set(r,c),c}applyToAll(a,r){const n=new Map;for(const i of a)n.set(i.id,this.applyToNode(i));for(const i of r)n.set(i.id,this.applyToEdge(i));return n}processRules(a,r,n){const i={elementId:a,matchedRules:[],styleOverrides:{},addedClasses:[]};for(const o of r)if(this.evaluateCondition(o.condition,n)&&(i.matchedRules.push(o.id),this.applyActions(o.actions,i),o.stopProcessing))break;return i}evaluateCondition(a,r){if("logic"in a)return a.logic==="and"?a.conditions.every(i=>this.evaluateCondition(i,r)):a.conditions.some(i=>this.evaluateCondition(i,r));const n=this.getPropertyValue(r,a.property);return this.compareValues(n,a)}getPropertyValue(a,r){const n=r.split(".");let i=a;for(const o of n){if(i==null)return;i=i[o]}return i}compareValues(a,r){const{operator:n,value:i,valueTo:o,caseInsensitive:c}=r;if(n==="is_null")return a==null;if(n==="is_not_null")return a!=null;if(n==="is_empty")return a===""||Array.isArray(a)&&a.length===0;if(n==="is_not_empty")return a!==""&&(!Array.isArray(a)||a.length>0);const l=c&&typeof a=="string"?a.toLowerCase():a,d=c&&typeof i=="string"?i.toLowerCase():i;switch(n){case"equals":return l===d;case"not_equals":return l!==d;case"greater_than":return a>i;case"greater_than_or_equals":return a>=i;case"less_than":return a<i;case"less_than_or_equals":return a<=i;case"contains":return typeof l=="string"&&typeof d=="string"?l.includes(d):Array.isArray(a)?a.includes(i):!1;case"not_contains":return typeof l=="string"&&typeof d=="string"?!l.includes(d):Array.isArray(a)?!a.includes(i):!0;case"starts_with":return typeof l=="string"&&typeof d=="string"&&l.startsWith(d);case"ends_with":return typeof l=="string"&&typeof d=="string"&&l.endsWith(d);case"regex":if(typeof a!="string"||typeof i!="string")return!1;try{const p=c?"i":"";return new RegExp(i,p).test(a)}catch{return!1}case"in":return Array.isArray(i)&&i.includes(a);case"not_in":return!Array.isArray(i)||!i.includes(a);case"between":return a>=i&&a<=o;default:return!1}}applyActions(a,r){for(const n of a)switch(n.type){case"set_fill":r.styleOverrides.backgroundColor=n.value;break;case"set_stroke":r.styleOverrides.borderColor=n.value;break;case"set_stroke_width":r.styleOverrides.borderWidth=n.value;break;case"set_text_color":r.styleOverrides.fontColor=n.value;break;case"set_opacity":r.styleOverrides.opacity=n.value;break;case"set_icon":r.icon=n.value;break;case"set_class":r.addedClasses=[n.value];break;case"add_class":r.addedClasses.includes(n.value)||r.addedClasses.push(n.value);break;case"remove_class":r.addedClasses=r.addedClasses.filter(i=>i!==n.value);break;case"set_shadow":r.styleOverrides.shadow=n.value;break;case"set_border_radius":r.styleOverrides.borderRadius=n.value;break;case"set_dash_array":r.styleOverrides.strokeDash=n.value;break;case"set_animation":r.animation=n.value;break;case"set_badge":r.badge=n.value;break;case"set_tooltip":r.tooltip=n.value;break}}emptyStyles(a){return{elementId:a,matchedRules:[],styleOverrides:{},addedClasses:[]}}invalidateCache(){this.cache.clear()}subscribe(a){return this.listeners.add(a),()=>this.listeners.delete(a)}notify(){this.listeners.forEach(a=>a())}exportConfig(){return JSON.stringify({profiles:Array.from(this.profiles.values()),activeProfileId:this.activeProfileId})}importConfig(a){const r=JSON.parse(a);this.profiles.clear();for(const n of r.profiles)this.profiles.set(n.id,n);this.activeProfileId=r.activeProfileId,this.invalidateCache(),this.notify()}}const Cr=[{id:"status-success",name:"Status: Success",description:"Green fill for successful status",enabled:!0,priority:10,target:"node",condition:{property:"data.status",operator:"in",value:["success","completed","done","active","healthy"],caseInsensitive:!0},actions:[{type:"set_fill",value:"#4caf50"},{type:"set_stroke",value:"#2e7d32"},{type:"set_text_color",value:"#ffffff"}]},{id:"status-warning",name:"Status: Warning",description:"Orange fill for warning status",enabled:!0,priority:10,target:"node",condition:{property:"data.status",operator:"in",value:["warning","pending","processing","degraded"],caseInsensitive:!0},actions:[{type:"set_fill",value:"#ff9800"},{type:"set_stroke",value:"#e65100"},{type:"set_text_color",value:"#000000"}]},{id:"status-error",name:"Status: Error",description:"Red fill for error status",enabled:!0,priority:10,target:"node",condition:{property:"data.status",operator:"in",value:["error","failed","critical","down","unhealthy"],caseInsensitive:!0},actions:[{type:"set_fill",value:"#f44336"},{type:"set_stroke",value:"#b71c1c"},{type:"set_text_color",value:"#ffffff"},{type:"set_animation",value:"pulse"}]},{id:"high-value",name:"High Value Highlight",description:"Bold border for high-value nodes",enabled:!1,priority:20,target:"node",condition:{property:"data.value",operator:"greater_than",value:1e6},actions:[{type:"set_stroke_width",value:4},{type:"set_stroke",value:"#ffd700"},{type:"set_badge",value:{text:"$$$",color:"#ffd700"}}]},{id:"inactive-dim",name:"Dim Inactive",description:"Reduce opacity for inactive elements",enabled:!1,priority:5,target:"both",condition:{property:"data.active",operator:"equals",value:!1},actions:[{type:"set_opacity",value:.5}]}];function Rh(t){const a=Cr.find(r=>r.id===t);return a?{...a,id:`${a.id}_${Date.now()}`}:null}function Fh(t=!1){const a=new Xi;if(t)for(const r of Cr)a.addRule(r);return a}class Ih{constructor(){this.nodes=[],this.edges=[],this.groups=[],this.presets=new Map,this.state={query:"",results:[],selectedIndex:-1,filters:[],isActive:!1,totalCount:0},this.listeners=new Set}updateData(a,r,n){this.nodes=a,this.edges=r,this.groups=n,this.state.isActive&&this.state.query&&this.search(this.state.query)}search(a,r={}){const{scope:n="all",matchType:i="contains",caseSensitive:o=!1,searchData:c=!0,dataProperties:l=[],maxResults:d=100,nodeShapes:p=[],groupIds:h=[]}=r;if(!a.trim())return this.state={...this.state,query:"",results:[],selectedIndex:-1,isActive:!1,totalCount:0},this.notify(),[];const u=[],g=o?a:a.toLowerCase();if(n==="all"||n==="nodes"||n==="labels")for(const f of this.nodes){if(u.length>=d)break;if(p.length>0&&!p.includes(f.shape)||h.length>0&&f.groupId&&!h.includes(f.groupId))continue;const m=this.matchElement(f,g,i,o,c,l);m&&u.push({id:f.id,type:"node",label:f.label||f.id,element:f,matchText:m.text,matchProperty:m.property,matchPositions:m.positions,score:m.score})}if(n==="all"||n==="edges"||n==="labels")for(const f of this.edges){if(u.length>=d)break;const m=this.matchElement(f,g,i,o,c,l);m&&u.push({id:f.id,type:"edge",label:f.label||`${f.sourceNodeId} → ${f.targetNodeId}`,element:f,matchText:m.text,matchProperty:m.property,matchPositions:m.positions,score:m.score})}if(n==="all"||n==="groups")for(const f of this.groups){if(u.length>=d)break;if(h.length>0&&!h.includes(f.id))continue;const m=this.matchElement(f,g,i,o,c,l);m&&u.push({id:f.id,type:"group",label:f.label||f.id,element:f,matchText:m.text,matchProperty:m.property,matchPositions:m.positions,score:m.score})}return u.sort((f,m)=>m.score-f.score),this.state={...this.state,query:a,results:u,selectedIndex:u.length>0?0:-1,isActive:!0,totalCount:u.length},this.notify(),u}matchElement(a,r,n,i,o,c){let l=null;const d=(h,u,g,f)=>{(!l||f>l.score)&&(l={text:h,property:u,positions:g,score:f})},p=this.matchText(a.id,r,n,i);if(p&&d(a.id,"id",p.positions,100+p.positions.length*10),"label"in a&&a.label){const h=this.matchText(a.label,r,n,i);h&&d(a.label,"label",h.positions,150+h.positions.length*10)}if("shape"in a&&a.shape){const h=this.matchText(a.shape,r,n,i);h&&d(a.shape,"shape",h.positions,80+h.positions.length*10)}if(o&&"data"in a&&a.data){const h=this.searchInData(a.data,r,n,i,c);for(const u of h)d(u.text,`data.${u.property}`,u.positions,50+u.positions.length*10)}return l}matchText(a,r,n,i){const o=i?a:a.toLowerCase(),c=i?r:r.toLowerCase(),l=[];switch(n){case"exact":o===c&&l.push({start:0,end:a.length});break;case"starts_with":o.startsWith(c)&&l.push({start:0,end:r.length});break;case"ends_with":o.endsWith(c)&&l.push({start:a.length-r.length,end:a.length});break;case"regex":try{const p=i?"g":"gi",h=new RegExp(r,p);let u;for(;(u=h.exec(a))!==null&&(l.push({start:u.index,end:u.index+u[0].length}),!!h.global););}catch{}break;case"contains":default:let d=0;for(;(d=o.indexOf(c,d))!==-1;)l.push({start:d,end:d+r.length}),d+=r.length;break}return l.length>0?{positions:l}:null}searchInData(a,r,n,i,o,c=""){const l=[];for(const[d,p]of Object.entries(a)){const h=c?`${c}.${d}`:d;if(!(o.length>0&&!o.some(u=>h.startsWith(u))))if(typeof p=="string"){const u=this.matchText(p,r,n,i);u&&l.push({text:p,property:h,positions:u.positions})}else if(typeof p=="number"||typeof p=="boolean"){const u=String(p),g=this.matchText(u,r,n,i);g&&l.push({text:u,property:h,positions:g.positions})}else p!=null&&typeof p=="object"&&!Array.isArray(p)&&l.push(...this.searchInData(p,r,n,i,o,h))}return l}filter(a){if(this.state.filters=a,a.length===0)return{nodes:this.nodes,edges:this.edges,groups:this.groups};const r=this.nodes.filter(o=>this.matchFilters(o,a)),n=this.edges.filter(o=>this.matchFilters(o,a)),i=this.groups.filter(o=>this.matchFilters(o,a));return this.notify(),{nodes:r,edges:n,groups:i}}matchFilters(a,r){return r.every(n=>this.matchFilter(a,n))}matchFilter(a,r){const n=this.getPropertyValue(a,r.property);switch(r.operator){case"equals":return n===r.value;case"not_equals":return n!==r.value;case"contains":return typeof n=="string"&&typeof r.value=="string"?n.toLowerCase().includes(r.value.toLowerCase()):Array.isArray(n)?n.includes(r.value):!1;case"greater_than":return typeof n=="number"&&n>r.value;case"less_than":return typeof n=="number"&&n<r.value;case"in":return Array.isArray(r.value)&&r.value.includes(n);case"not_in":return!Array.isArray(r.value)||!r.value.includes(n);case"is_null":return n==null;case"is_not_null":return n!=null;default:return!0}}getPropertyValue(a,r){const n=r.split(".");let i=a;for(const o of n){if(i==null)return;i=i[o]}return i}nextResult(){return this.state.results.length===0?null:(this.state.selectedIndex=(this.state.selectedIndex+1)%this.state.results.length,this.notify(),this.state.results[this.state.selectedIndex])}previousResult(){return this.state.results.length===0?null:(this.state.selectedIndex=(this.state.selectedIndex-1+this.state.results.length)%this.state.results.length,this.notify(),this.state.results[this.state.selectedIndex])}selectResult(a){return a<0||a>=this.state.results.length?null:(this.state.selectedIndex=a,this.notify(),this.state.results[a])}getState(){return{...this.state}}getSelectedResult(){return this.state.selectedIndex<0?null:this.state.results[this.state.selectedIndex]??null}clearSearch(){this.state={query:"",results:[],selectedIndex:-1,filters:this.state.filters,isActive:!1,totalCount:0},this.notify()}clearFilters(){this.state.filters=[],this.notify()}clearAll(){this.state={query:"",results:[],selectedIndex:-1,filters:[],isActive:!1,totalCount:0},this.notify()}savePreset(a,r){const n={id:`preset_${Date.now()}`,name:a,description:r,filters:[...this.state.filters],searchQuery:this.state.query||void 0,searchOptions:void 0};return this.presets.set(n.id,n),n}loadPreset(a){const r=this.presets.get(a);r&&(this.state.filters=[...r.filters],r.searchQuery&&this.search(r.searchQuery,r.searchOptions),this.notify())}deletePreset(a){return this.presets.delete(a)}getPresets(){return Array.from(this.presets.values())}subscribe(a){return this.listeners.add(a),()=>this.listeners.delete(a)}notify(){this.listeners.forEach(a=>a(this.state))}getUniqueValues(a,r){const n=new Set;if(!r||r==="node")for(const i of this.nodes){const o=this.getPropertyValue(i,a);o!=null&&n.add(o)}if(!r||r==="edge")for(const i of this.edges){const o=this.getPropertyValue(i,a);o!=null&&n.add(o)}if(!r||r==="group")for(const i of this.groups){const o=this.getPropertyValue(i,a);o!=null&&n.add(o)}return Array.from(n)}getNodeShapes(){return[...new Set(this.nodes.map(a=>a.shape))]}getEdgeLineTypes(){return[...new Set(this.edges.filter(a=>{var r;return(r=a.style)==null?void 0:r.lineType}).map(a=>a.style.lineType))]}getGroups(){return this.groups}exportPresets(){return JSON.stringify(Array.from(this.presets.values()))}importPresets(a){JSON.parse(a).forEach(n=>this.presets.set(n.id,n))}}function Ph(t,a,r="search-highlight"){if(a.length===0)return t;const n=[...a].sort((o,c)=>c.start-o.start);let i=t;for(const o of n){const c=i.slice(0,o.start),l=i.slice(o.start,o.end),d=i.slice(o.end);i=`${c}<span class="${r}">${l}</span>${d}`}return i}function Lh(t,a){switch(t){case"by-type":return{id:`filter_type_${Date.now()}`,property:"type",operator:"equals",value:a};case"by-layer":return{id:`filter_layer_${Date.now()}`,property:"layer",operator:"equals",value:a};case"by-status":return{id:`filter_status_${Date.now()}`,property:"data.status",operator:"equals",value:a};case"custom":default:return{id:`filter_custom_${Date.now()}`,property:"",operator:"equals",value:a}}}exports.$i=nr;exports.$o=jn;exports.Ae=st;exports.An=Ga;exports.AnimationPlayer=Ti;exports.AnimationTimeline=wr;exports.COMMENT_PRIORITY_STYLES=Ah;exports.ConditionalStylingEngine=Xi;exports.DEFAULT_GRID_CONFIG=ph;exports.DIAGRAM_STYLE_PRESETS=pa;exports.DIAGRAM_TEMPLATES=ga;exports.De=Qe;exports.Di=lr;exports.DiagramCanvas=dt;exports.DiagramCellRenderer=tm;exports.DiagramCommentManager=$h;exports.DiagramMinimap=kr;exports.DiagramModel=ua;exports.DiagramParticleEngine=un;exports.DiagramPropertyPanel=vr;exports.DiagramSearchFilterEngine=Ih;exports.DiagramToolbar=xr;exports.DiagramVersioningManager=Zi;exports.Dn=wt;exports.EDGE_STYLE_CATALOG=io;exports.Ei=or;exports.En=Ya;exports.Es=Fo;exports.Fe=xe;exports.Ht=Pa;exports.Ii=cr;exports.Je=Wa;exports.Ke=bn;exports.Lo=_n;exports.Mi=ir;exports.Ms=Bo;exports.Mt=In;exports.NODE_STYLE_CATALOG=no;exports.NiceDatabaseSchemaViewer=gm;exports.NiceDecisionTreeEditor=ah;exports.NiceDependencyGraph=Fm;exports.NiceDiagramEditor=Ei;exports.NiceDiagramViewer=Ri;exports.NiceI18nProvider=Ra;exports.NiceNetworkTopology=Um;exports.NiceOrgChartVisualizer=jm;exports.NiceProcessMiningDiagram=$m;exports.NiceWorkflowVisualizer=dm;exports.PRESET_RULES=Cr;exports.Qa=On;exports.Qi=cl;exports.Qi$1=ur;exports.Re=ht;exports.TRANSITION_PRESETS=fn;exports.Ti=sr;exports.Ve=Zt;exports.Vn=Xa;exports.We=Va;exports.Zn=Ja;exports._t=Rn;exports.analyzeDependencyGraph=Vm;exports.ao=Qn;exports.applyAlignmentSnap=fh;exports.at=qa;exports.bt=Dn;exports.ca=fr;exports.calculateNetworkHealth=eh;exports.calculateOrgStats=Mm;exports.cl=it;exports.cn=ha;exports.computeAlignmentGuides=hh;exports.computeGlowRadius=mn;exports.computeLayout=ln;exports.convertAnimation=Wi;exports.convertEdge=Oi;exports.convertGroup=Bi;exports.convertNode=Li;exports.createConditionalStylingEngine=Fh;exports.createDecisionTree=dh;exports.createDiagramDocument=jt;exports.createGlowFilterId=pn;exports.createLinearWorkflow=mm;exports.createOrgChartFromEmployees=Nm;exports.createPresetFromTheme=co;exports.createQuickFilter=Lh;exports.createRuleFromPreset=Rh;exports.createVersioningHook=Mh;exports.de=Re;exports.discoverNetworkTopology=Qm;exports.ea=pr;exports.ei=Oe;exports.eo=Un;exports.exportToMermaid=zi;exports.exportToSvg=Aa;exports.fetchAndGenerateDiagram=am;exports.fi=tr;exports.fl=Td;exports.formatCommentDate=Dh;exports.generateDiagramFromData=Pi;exports.getDiagramStylePreset=so;exports.getDiagramStylePresetsByCategory=oo;exports.getEasing=Ai;exports.getPointOnPath=rs;exports.getTemplateById=jh;exports.getTemplatesByCategory=Ch;exports.gi=Uo;exports.gt=zn;exports.hi=er;exports.highlightMatches=Ph;exports.ie=ct;exports.ii=Qa;exports.io=Jn;exports.ki=ar;exports.ki$1=Xo;exports.le=Mi;exports.ll=gt;exports.mineProcessFromLog=Hi;exports.mt=$n;exports.no=Xn;exports.oa=hr;exports.oo=ei;exports.ot=Ka;exports.parseBPMNToWorkflow=pm;exports.parseNddJson=Ep;exports.parsePackageJsonToDependencies=qm;exports.parseSQLToSchema=km;exports.parseSklearnTree=ch;exports.pi=Yo;exports.predictWithTree=uh;exports.presetToThemeOverrides=lo;exports.qe=Ba;exports.qr=Oo;exports.renderTextWithMentions=Th;exports.rl=hl;exports.sa=gr;exports.schemaToSQL=wm;exports.se=zt;exports.searchTemplates=Sh;exports.sn=fa;exports.snapNodePosition=mh;exports.snapPointToGrid=Ui;exports.snapToGrid=Da;exports.stringifyNddJson=$i;exports.ta=mr;exports.tl=ml;exports.to=Zn;exports.tt=Ha;exports.ue=vt;exports.useDiagramEditor=dn;exports.useNiceTranslation=qt;exports.vs=_t;exports.vt=Tn;exports.wa=br;exports.ws=po;exports.wt=Fn;exports.xi=rr;exports.xt=En;exports.ys=Ae;exports.yt=An;exports.ze=Xt;
|