@superdangerous/app-framework 4.16.4 → 4.16.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ui/dist/index.js CHANGED
@@ -51,7 +51,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
51
51
  `))})}function a4(e){var t=e.codeString,r=e.codeStyle,n=e.containerStyle,o=n===void 0?{float:"left",paddingRight:"10px"}:n,a=e.numberStyle,i=a===void 0?{}:a,s=e.startingLineNumber;return tr__namespace.default.createElement("code",{style:Object.assign({},r,o)},o4({lines:t.replace(/\n$/,"").split(`
52
52
  `),style:i,startingLineNumber:s}))}function i4(e){return "".concat(e.toString().length,".25em")}function JS(e,t){return {type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function ek(e,t,r){var n={display:"inline-block",minWidth:i4(r),paddingRight:"1em",textAlign:"right",userSelect:"none"},o=typeof e=="function"?e(t):e,a=Or(Or({},n),o);return a}function ai(e){var t=e.children,r=e.lineNumber,n=e.lineNumberStyle,o=e.largestLineNumber,a=e.showInlineLineNumbers,i=e.lineProps,s=i===void 0?{}:i,l=e.className,c=l===void 0?[]:l,d=e.showLineNumbers,u=e.wrapLongLines,g=e.wrapLines,p=g===void 0?false:g,m=p?Or({},typeof s=="function"?s(r):s):{};if(m.className=m.className?[].concat(ti(m.className.trim().split(/\s+/)),ti(c)):c,r&&a){var f=ek(n,r,o);t.unshift(JS(r,f));}return u&d&&(m.style=Or({display:"flex"},m.style)),{type:"element",tagName:"span",properties:m,children:t}}function tk(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=0;n<e.length;n++){var o=e[n];if(o.type==="text")r.push(ai({children:[o],className:ti(new Set(t))}));else if(o.children){var a=t.concat(o.properties.className);tk(o.children,a).forEach(function(i){return r.push(i)});}}return r}function s4(e,t,r,n,o,a,i,s,l){var c,d=tk(e.value),u=[],g=-1,p=0;function m(R,x){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return ai({children:R,lineNumber:x,lineNumberStyle:s,largestLineNumber:i,showInlineLineNumbers:o,lineProps:r,className:D,showLineNumbers:n,wrapLongLines:l,wrapLines:t})}function f(R,x){if(n&&x&&o){var D=ek(s,x,i);R.unshift(JS(x,D));}return R}function b(R,x){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||D.length>0?m(R,x,D):f(R,x)}for(var h=function(){var x=d[p],D=x.children[0].value,F=n4(D);if(F){var A=D.split(`
53
53
  `);A.forEach(function(v,H){var _=n&&u.length+a,P={type:"text",value:"".concat(v,`
54
- `)};if(H===0){var L=d.slice(g+1,p).concat(ai({children:[P],className:x.properties.className})),M=b(L,_);u.push(M);}else if(H===A.length-1){var $=d[p+1]&&d[p+1].children&&d[p+1].children[0],j={type:"text",value:"".concat(v)};if($){var re=ai({children:[j],className:x.properties.className});d.splice(p+1,0,re);}else {var Q=[j],w=b(Q,_,x.properties.className);u.push(w);}}else {var z=[P],te=b(z,_,x.properties.className);u.push(te);}}),g=p;}p++;};p<d.length;)h();if(g!==d.length-1){var S=d.slice(g+1,d.length);if(S&&S.length){var E=n&&u.length+a,N=b(S,E);u.push(N);}}return t?u:(c=[]).concat.apply(c,u)}function l4(e){var t=e.rows,r=e.stylesheet,n=e.useInlineStyles;return t.map(function(o,a){return oi({node:o,stylesheet:r,useInlineStyles:n,key:"code-segment-".concat(a)})})}function rk(e){return e&&typeof e.highlightAuto<"u"}function c4(e){var t=e.astGenerator,r=e.language,n=e.code,o=e.defaultCodeValue;if(rk(t)){var a=ZS(t,r);return r==="text"?{value:o,language:"text"}:a?t.highlight(r,n):t.highlightAuto(n)}try{return r&&r!=="text"?{value:t.highlight(n,r)}:{value:o}}catch{return {value:o}}}function nk(e,t){return function(n){var o,a,i=n.language,s=n.children,l=n.style,c=l===void 0?t:l,d=n.customStyle,u=d===void 0?{}:d,g=n.codeTagProps,p=g===void 0?{className:i?"language-".concat(i):void 0,style:Or(Or({},c['code[class*="language-"]']),c['code[class*="language-'.concat(i,'"]')])}:g,m=n.useInlineStyles,f=m===void 0?true:m,b=n.showLineNumbers,h=b===void 0?false:b,S=n.showInlineLineNumbers,E=S===void 0?true:S,N=n.startingLineNumber,R=N===void 0?1:N,x=n.lineNumberContainerStyle,D=n.lineNumberStyle,F=D===void 0?{}:D,A=n.wrapLines,v=n.wrapLongLines,H=v===void 0?false:v,_=n.lineProps,P=_===void 0?{}:_,L=n.renderer,M=n.PreTag,$=M===void 0?"pre":M,j=n.CodeTag,re=j===void 0?"code":j,Q=n.code,w=Q===void 0?(Array.isArray(s)?s[0]:s)||"":Q,z=n.astGenerator,te=GS(n,t4);z=z||e;var T=h?tr__namespace.default.createElement(a4,{containerStyle:x,codeStyle:p.style||{},numberStyle:F,startingLineNumber:R,codeString:w}):null,ye=c.hljs||c['pre[class*="language-"]']||{backgroundColor:"#fff"},Ce=rk(z)?"hljs":"prismjs",et=f?Object.assign({},te,{style:Object.assign({},ye,u)}):Object.assign({},te,{className:te.className?"".concat(Ce," ").concat(te.className):Ce,style:Object.assign({},u)});if(H?p.style=Or({whiteSpace:"pre-wrap"},p.style):p.style=Or({whiteSpace:"pre"},p.style),!z)return tr__namespace.default.createElement($,et,T,tr__namespace.default.createElement(re,p,w));(A===void 0&&L||H)&&(A=true),L=L||l4;var _e=[{type:"text",value:w}],Se=c4({astGenerator:z,language:i,code:w,defaultCodeValue:_e});Se.language===null&&(Se.value=_e);var st=(o=(a=w.match(/\n/g))===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0,ve=R+st,Oe=s4(Se,A,P,h,E,R,ve,F,H);return tr__namespace.default.createElement($,et,tr__namespace.default.createElement(re,p,!E&&T,L({rows:Oe,stylesheet:c,useInlineStyles:f})))}}var ok=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","bash","basic","batch","bbcode","bicep","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","clike","clojure","cmake","cobol","coffeescript","concurnas","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gherkin","git","glsl","gml","gn","go-module","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","matlab","maxscript","mel","mermaid","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","squirrel","stan","stylus","swift","systemd","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tremor","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","uorazor","uri","v","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","web-idl","wiki","wolfram","wren","xeora","xml-doc","xojo","xquery","yaml","yang","zig"];var qE={'code[class*="language-"]':{color:"black",background:"none",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"black",background:"#f5f2f0",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto"},'pre[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},':not(pre) > code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};var OI=$o(_I());var LI=nk(OI.default,qE);LI.supportedLanguages=ok;var _o=LI;var A_=$o(T_());function vf({content:e,className:t,showCopyButton:r=true}){let[n,o]=tr.useState(null),a=s=>{navigator.clipboard.writeText(s),o(s),setTimeout(()=>o(null),2e3);},i=tr.useMemo(()=>({code({node:s,inline:l,className:c,children:d,...u}){let g=/language-(\w+)/.exec(c||""),p=String(d).replace(/\n$/,"");return !l&&g?jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsx(_o,{style:A_.oneDark,language:g[1],PreTag:"div",className:"!rounded-md !my-4",...u,children:p}),r&&jsxRuntime.jsx(W,{size:"sm",variant:"ghost",className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>a(p),children:n===p?jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Copy,{className:"h-4 w-4"})})]}):jsxRuntime.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-sm font-mono",...u,children:d})},pre({children:s}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:s})},h1:({children:s})=>jsxRuntime.jsx("h1",{className:"text-2xl font-bold mt-6 mb-4",children:s}),h2:({children:s})=>jsxRuntime.jsx("h2",{className:"text-xl font-semibold mt-5 mb-3",children:s}),h3:({children:s})=>jsxRuntime.jsx("h3",{className:"text-lg font-semibold mt-4 mb-2",children:s}),p:({children:s})=>jsxRuntime.jsx("p",{className:"mb-4 leading-relaxed",children:s}),ul:({children:s})=>jsxRuntime.jsx("ul",{className:"list-disc list-inside mb-4 space-y-1",children:s}),ol:({children:s})=>jsxRuntime.jsx("ol",{className:"list-decimal list-inside mb-4 space-y-1",children:s}),blockquote:({children:s})=>jsxRuntime.jsx("blockquote",{className:"border-l-4 border-muted-foreground/30 pl-4 my-4 italic",children:s}),a:({href:s,children:l})=>jsxRuntime.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:l}),table:({children:s})=>jsxRuntime.jsx("div",{className:"overflow-x-auto my-4",children:jsxRuntime.jsx("table",{className:"min-w-full divide-y divide-border",children:s})}),th:({children:s})=>jsxRuntime.jsx("th",{className:"px-4 py-2 text-left font-medium",children:s}),td:({children:s})=>jsxRuntime.jsx("td",{className:"px-4 py-2 border-t",children:s})}),[n,r]);return jsxRuntime.jsx("div",{className:he("prose prose-sm dark:prose-invert max-w-none",t),children:jsxRuntime.jsx(nc,{remarkPlugins:[ei],components:i,children:e})})}function tz({content:e,className:t,title:r,...n}){return jsxRuntime.jsxs(Ie,{className:he("p-6",t),children:[r&&jsxRuntime.jsx("h2",{className:"text-xl font-semibold mb-4",children:r}),jsxRuntime.jsx(vf,{content:e,...n})]})}function rz({content:e,className:t,height:r="400px",...n}){return jsxRuntime.jsx(Bs,{className:he("w-full",t),style:{height:r},children:jsxRuntime.jsx("div",{className:"pr-4",children:jsxRuntime.jsx(vf,{content:e,...n})})})}function lz({children:e,className:t,maxWidth:r,tooltipSide:n="top"}){let o=tr.useRef(null),[a,i]=tr.useState(false),s=tr.useCallback(()=>{o.current&&i(o.current.scrollWidth>o.current.clientWidth);},[]);tr.useEffect(()=>{let c=o.current;if(!c)return;s();let d=new ResizeObserver(()=>{requestAnimationFrame(s);});return d.observe(c),()=>{d.disconnect();}},[s,e]);let l=r?{maxWidth:r}:void 0;return jsxRuntime.jsxs(Ko,{children:[jsxRuntime.jsx(Xo,{asChild:true,disabled:!a,children:jsxRuntime.jsx("span",{ref:o,className:I("truncate block",a&&"cursor-help",t),style:l,children:e})}),a&&jsxRuntime.jsx(Qn,{side:n,className:"max-w-md break-words",children:e})]})}var mr=[{hex:"#3b82f6",name:"Blue"},{hex:"#6366f1",name:"Indigo"},{hex:"#8b5cf6",name:"Violet"},{hex:"#a855f7",name:"Purple"},{hex:"#d946ef",name:"Fuchsia"},{hex:"#ec4899",name:"Pink"},{hex:"#f43f5e",name:"Rose"},{hex:"#ef4444",name:"Red"},{hex:"#f97316",name:"Orange"},{hex:"#f59e0b",name:"Amber"},{hex:"#eab308",name:"Yellow"},{hex:"#84cc16",name:"Lime"},{hex:"#22c55e",name:"Green"},{hex:"#10b981",name:"Emerald"},{hex:"#14b8a6",name:"Teal"},{hex:"#06b6d4",name:"Cyan"},{hex:"#0ea5e9",name:"Sky"},{hex:"#64748b",name:"Slate"},{hex:"#78716c",name:"Stone"},{hex:"#737373",name:"Gray"}];function dz({value:e,onChange:t,columns:r=10,className:n}){return jsxRuntime.jsx("div",{className:I("flex flex-wrap gap-1.5",n),style:{maxWidth:r*28+(r-1)*6},children:mr.map(o=>{let a=e.toLowerCase()===o.hex.toLowerCase();return jsxRuntime.jsx("button",{type:"button",onClick:()=>t(o.hex),className:I("w-6 h-6 rounded-md transition-all focus:outline-none flex items-center justify-center","hover:brightness-110",a&&"ring-2 ring-foreground/70"),style:{backgroundColor:o.hex},title:o.name,children:a&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5 text-white drop-shadow-[0_1px_1px_rgba(0,0,0,0.5)]"})},o.hex)})})}function pz(){let e=Math.floor(Math.random()*mr.length);return mr[e].hex}function gz(e){let r=(mr.findIndex(n=>n.hex===e)+1)%mr.length;return mr[r].hex}function mz(e){let t=new Set(e.map(n=>n.toLowerCase()));for(let n of mr)if(!t.has(n.hex.toLowerCase()))return n.hex;let r=mr.map(n=>({hex:n.hex,count:e.filter(o=>o.toLowerCase()===n.hex.toLowerCase()).length}));return r.sort((n,o)=>n.count-o.count),r[0].hex}var kz={default:{icon:lucideReact.Info,iconColor:"text-blue-600",iconBg:"bg-blue-50 border-blue-100"},success:{icon:lucideReact.Play,iconColor:"text-emerald-600",iconBg:"bg-emerald-50 border-emerald-100"},warning:{icon:lucideReact.Pause,iconColor:"text-amber-600",iconBg:"bg-amber-50 border-amber-100"},destructive:{icon:lucideReact.Trash2,iconColor:"text-red-600",iconBg:"bg-red-50 border-red-100"}};function N_({open:e,onOpenChange:t,title:r,description:n,confirmLabel:o="Confirm",cancelLabel:a="Cancel",variant:i="default",icon:s,onConfirm:l,onCancel:c,loading:d=false}){let u=kz[i],g=s||u.icon,p=()=>{c?.(),t(false);},m=()=>{l(),d||t(false);};return jsxRuntime.jsx(hn,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(Ur,{className:"sm:max-w-[380px] p-0 gap-0 overflow-hidden",children:[jsxRuntime.jsx("div",{className:"px-5 pt-5 pb-4",children:jsxRuntime.jsxs(Hr,{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(g,{className:I("h-5 w-5 flex-shrink-0",u.iconColor)}),jsxRuntime.jsx(Gr,{className:"text-base font-semibold",children:r})]}),jsxRuntime.jsx($n,{className:"text-sm text-muted-foreground leading-relaxed pl-8",children:n})]})}),jsxRuntime.jsxs("div",{className:"flex border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:p,disabled:d,className:"flex-1 px-4 py-2.5 text-sm font-medium text-muted-foreground hover:bg-muted/50 transition-colors disabled:opacity-50 border-r border-border",children:a}),jsxRuntime.jsx("button",{type:"button",onClick:m,disabled:d,className:I("flex-1 px-4 py-2.5 text-sm font-medium transition-colors disabled:opacity-50",i==="destructive"?"text-red-600 hover:bg-red-50":i==="success"?"text-emerald-600 hover:bg-emerald-50":i==="warning"?"text-amber-600 hover:bg-amber-50":"text-primary hover:bg-muted/50"),children:d?"Processing...":o})]})]})})}function Ez(){let[e,t]=tr.useState({open:false,title:"",description:"",onConfirm:()=>{}}),r=o=>new Promise(a=>{t({...o,open:true,onConfirm:()=>{a(true),t(i=>({...i,open:false}));}});}),n={...e,onOpenChange:o=>{o||t(a=>({...a,open:false}));},onCancel:()=>{t(o=>({...o,open:false}));}};return {confirm:r,dialogProps:n,ConfirmDialog:N_}}function Cz({open:e,onOpenChange:t,title:r,children:n,footer:o,defaultWidth:a=800,defaultHeight:i=600,minWidth:s=400,minHeight:l=300,className:c,onFullscreenChange:d}){let[u,g]=tr.useState(false),[p,m]=tr.useState({x:0,y:0}),[f,b]=tr.useState(()=>({width:Math.min(a,typeof window<"u"?window.innerWidth-32:a),height:Math.min(i,typeof window<"u"?window.innerHeight-32:i)})),[h,S]=tr.useState(false),E=tr.useRef(null),N=tr.useRef({type:null,direction:null,startMouseX:0,startMouseY:0,startPosX:0,startPosY:0,startWidth:0,startHeight:0});tr.useEffect(()=>{if(e&&!u){let A=Math.min(a,window.innerWidth-32),v=Math.min(i,window.innerHeight-32);b({width:A,height:v});let H=(window.innerWidth-A)/2,_=(window.innerHeight-v)/2;m({x:H,y:Math.max(16,_)});}},[e,u,a,i]);let R=tr.useCallback(A=>{u||!E.current||(A.preventDefault(),N.current={type:"drag",direction:null,startMouseX:A.clientX,startMouseY:A.clientY,startPosX:p.x,startPosY:p.y,startWidth:f.width,startHeight:f.height},S(true),document.body.style.cursor="grabbing",document.body.style.userSelect="none");},[u,p,f]),x=tr.useCallback((A,v)=>{u||!E.current||(A.preventDefault(),A.stopPropagation(),N.current={type:"resize",direction:v,startMouseX:A.clientX,startMouseY:A.clientY,startPosX:p.x,startPosY:p.y,startWidth:f.width,startHeight:f.height},S(true),document.body.style.userSelect="none");},[u,p,f]);tr.useEffect(()=>{if(!h)return;let A=H=>{let _=N.current,P=E.current;if(!_.type||!P)return;let L=H.clientX-_.startMouseX,M=H.clientY-_.startMouseY;if(_.type==="drag"){let $=_.startPosX+L,j=Math.max(0,_.startPosY+M);P.style.left=`${$}px`,P.style.top=`${j}px`;}else if(_.type==="resize"&&_.direction){let $=_.startWidth,j=_.startHeight,re=_.startPosX,Q=_.startPosY;if(_.direction.includes("e")&&($=Math.max(s,_.startWidth+L)),_.direction.includes("w")){let w=Math.min(L,_.startWidth-s);$=_.startWidth-w,re=_.startPosX+w;}if(_.direction.includes("s")&&(j=Math.max(l,_.startHeight+M)),_.direction.includes("n")){let w=Math.min(M,_.startHeight-l);j=_.startHeight-w,Q=Math.max(0,_.startPosY+w);}P.style.width=`${$}px`,P.style.height=`${j}px`,P.style.left=`${re}px`,P.style.top=`${Q}px`;}},v=()=>{let H=N.current,_=E.current;if(_&&H.type){let P=_.getBoundingClientRect();m({x:P.left,y:P.top}),b({width:P.width,height:P.height});}N.current.type=null,N.current.direction=null,S(false),document.body.style.cursor="",document.body.style.userSelect="";};return document.addEventListener("mousemove",A),document.addEventListener("mouseup",v),()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",v);}},[h,s,l]);let D=tr.useCallback(()=>{g(A=>{let v=!A;return d?.(v),v});},[d]),F=tr.useMemo(()=>u?{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",maxWidth:"100vw",maxHeight:"100vh",borderRadius:0,transform:"none"}:{position:"fixed",top:p.y,left:p.x,width:f.width,height:f.height,maxWidth:"none",maxHeight:"none",transform:"none",willChange:h?"left, top, width, height":"auto"},[u,p.x,p.y,f.width,f.height,h]);return jsxRuntime.jsx(hn,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(Ur,{ref:E,style:F,hideCloseButton:true,className:I("flex flex-col p-0 gap-0",h&&"transition-none duration-0 [&_*]:transition-none",u?"rounded-none":"rounded-lg",c),children:[jsxRuntime.jsxs("div",{className:I("flex items-center gap-2 px-4 py-3 border-b bg-muted/30 flex-shrink-0",!u&&"cursor-grab active:cursor-grabbing"),onMouseDown:R,children:[!u&&jsxRuntime.jsx(lucideReact.GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),jsxRuntime.jsx("div",{className:"flex-1 min-w-0",children:r&&jsxRuntime.jsx(Hr,{className:"p-0 space-y-0",children:jsxRuntime.jsx(Gr,{className:"text-base font-semibold leading-tight truncate",children:r})})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[jsxRuntime.jsx(W,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:D,children:u?jsxRuntime.jsx(lucideReact.Minimize2,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Maximize2,{className:"h-4 w-4"})}),jsxRuntime.jsx(W,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>t(false),children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:typeof n=="function"?n({isFullscreen:u}):n}),o&&jsxRuntime.jsx(Gn,{className:"px-4 py-3 border-t bg-muted/30 flex-shrink-0",children:o}),!u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"absolute top-0 left-2 right-2 h-1 cursor-n-resize",onMouseDown:A=>x(A,"n")}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-2 right-2 h-1 cursor-s-resize",onMouseDown:A=>x(A,"s")}),jsxRuntime.jsx("div",{className:"absolute left-0 top-2 bottom-2 w-1 cursor-w-resize",onMouseDown:A=>x(A,"w")}),jsxRuntime.jsx("div",{className:"absolute right-0 top-2 bottom-2 w-1 cursor-e-resize",onMouseDown:A=>x(A,"e")}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 w-3 h-3 cursor-nw-resize",onMouseDown:A=>x(A,"nw")}),jsxRuntime.jsx("div",{className:"absolute top-0 right-0 w-3 h-3 cursor-ne-resize",onMouseDown:A=>x(A,"ne")}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 w-3 h-3 cursor-sw-resize",onMouseDown:A=>x(A,"sw")}),jsxRuntime.jsx("div",{className:"absolute bottom-0 right-0 w-3 h-3 cursor-se-resize",onMouseDown:A=>x(A,"se")})]})]})})}function __({position:e,onClose:t,children:r,className:n}){let o=tr.useRef(null),[a,i]=tr.useState(e);tr.useLayoutEffect(()=>{if(!o.current)return;let c=o.current.getBoundingClientRect(),d=window.innerWidth,u=window.innerHeight,g=8,p=e.x,m=e.y;e.x+c.width>d-g&&(p=Math.max(g,d-c.width-g)),e.y+c.height>u-g&&(m=Math.max(g,u-c.height-g)),p<g&&(p=g),m<g&&(m=g),(p!==e.x||m!==e.y)&&i({x:p,y:m});},[e]),tr.useEffect(()=>{let l=()=>t(),c=()=>t();return document.addEventListener("click",l),document.addEventListener("scroll",c,true),()=>{document.removeEventListener("click",l),document.removeEventListener("scroll",c,true);}},[t]);let s=tr.useCallback(l=>{l.stopPropagation();},[]);return jsxRuntime.jsx("div",{ref:o,role:"menu","aria-label":"Context menu",className:I("fixed z-50 min-w-[180px] rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",n),style:{top:a.y,left:a.x},onClick:s,children:r})}var Mz={default:"hover:bg-accent hover:text-accent-foreground",success:"text-green-600 hover:bg-green-50 hover:text-green-700:bg-green-950",warning:"text-amber-600 hover:bg-amber-50 hover:text-amber-700:bg-amber-950",destructive:"text-destructive hover:bg-destructive hover:text-destructive-foreground",purple:"text-purple-600 hover:bg-purple-50 hover:text-purple-700:bg-purple-950"};function O_({onClick:e,onMouseEnter:t,icon:r,children:n,variant:o="default",disabled:a=false,className:i}){return jsxRuntime.jsxs("button",{role:"menuitem",onClick:e,onMouseEnter:t,disabled:a,"aria-disabled":a,className:I("relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",Mz[o],a&&"opacity-50 cursor-not-allowed",i),children:[r&&jsxRuntime.jsx("span",{className:"mr-2 h-4 w-4 flex items-center justify-center","aria-hidden":"true",children:r}),n]})}function L_(){return jsxRuntime.jsx("div",{role:"separator",className:"h-px bg-border my-1"})}function M_({label:e,icon:t,children:r,onOpen:n,isOpen:o,onOpenChange:a,className:i}){let[s,l]=tr.useState(false),c=o!==void 0,d=c?o:s,u=()=>{c?a?.(true):l(true),n?.();},g=()=>{c?a?.(false):l(false);};return jsxRuntime.jsxs("div",{className:I("relative",i),onMouseEnter:u,onMouseLeave:g,children:[jsxRuntime.jsxs("button",{role:"menuitem","aria-haspopup":"menu","aria-expanded":d,className:"relative flex w-full cursor-pointer select-none items-center justify-between rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground",children:[jsxRuntime.jsxs("span",{className:"flex items-center",children:[t&&jsxRuntime.jsx("span",{className:"mr-2 h-4 w-4 flex items-center justify-center","aria-hidden":"true",children:t}),e]}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4","aria-hidden":"true"})]}),d&&jsxRuntime.jsx("div",{role:"menu","aria-label":`${e} submenu`,className:"absolute left-full top-0 ml-1 min-w-[160px] max-h-[300px] overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md",children:r})]})}var If={'code[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"]::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},prolog:{color:"hsl(220, 10%, 40%)"},cdata:{color:"hsl(220, 10%, 40%)"},doctype:{color:"hsl(220, 14%, 71%)"},punctuation:{color:"hsl(220, 14%, 71%)"},entity:{color:"hsl(220, 14%, 71%)",cursor:"help"},"attr-name":{color:"hsl(29, 54%, 61%)"},"class-name":{color:"hsl(29, 54%, 61%)"},boolean:{color:"hsl(29, 54%, 61%)"},constant:{color:"hsl(29, 54%, 61%)"},number:{color:"hsl(29, 54%, 61%)"},atrule:{color:"hsl(29, 54%, 61%)"},keyword:{color:"hsl(286, 60%, 67%)"},property:{color:"hsl(355, 65%, 65%)"},tag:{color:"hsl(355, 65%, 65%)"},symbol:{color:"hsl(355, 65%, 65%)"},deleted:{color:"hsl(355, 65%, 65%)"},important:{color:"hsl(355, 65%, 65%)"},selector:{color:"hsl(95, 38%, 62%)"},string:{color:"hsl(95, 38%, 62%)"},char:{color:"hsl(95, 38%, 62%)"},builtin:{color:"hsl(95, 38%, 62%)"},inserted:{color:"hsl(95, 38%, 62%)"},regex:{color:"hsl(95, 38%, 62%)"},"attr-value":{color:"hsl(95, 38%, 62%)"},"attr-value > .token.punctuation":{color:"hsl(95, 38%, 62%)"},variable:{color:"hsl(207, 82%, 66%)"},operator:{color:"hsl(207, 82%, 66%)"},function:{color:"hsl(207, 82%, 66%)"},url:{color:"hsl(187, 47%, 55%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(220, 14%, 71%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(220, 14%, 71%)"},".language-css .token.selector":{color:"hsl(355, 65%, 65%)"},".language-css .token.property":{color:"hsl(220, 14%, 71%)"},".language-css .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.string.url":{color:"hsl(95, 38%, 62%)"},".language-css .token.important":{color:"hsl(286, 60%, 67%)"},".language-css .token.atrule .token.rule":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.operator":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(5, 48%, 51%)"},".language-json .token.operator":{color:"hsl(220, 14%, 71%)"},".language-json .token.null.keyword":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.url":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.operator":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.content":{color:"hsl(207, 82%, 66%)"},".language-markdown .token.url > .token.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.url-reference.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(95, 38%, 62%)"},".language-markdown .token.bold .token.content":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.italic .token.content":{color:"hsl(286, 60%, 67%)"},".language-markdown .token.strike .token.content":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.list.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(355, 65%, 65%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.cr:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.lf:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.space:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},".line-highlight.line-highlight":{background:"hsla(220, 100%, 80%, 0.04)"},".line-highlight.line-highlight:before":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(220, 100%, 80%, 0.04)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".command-line .command-line-prompt":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(220, 14%, 45%)"},".command-line .command-line-prompt > span:before":{color:"hsl(220, 14%, 45%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(286, 60%, 67%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(224, 13%, 17%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(224, 13%, 17%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(224, 13%, 17%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(224, 13%, 17%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(219, 13%, 22%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(220, 14%, 71%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(220, 14%, 71%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(220, 14%, 71%)"}};var _f={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}};function Uz(e){let t=e.split(".").pop()?.toLowerCase()||"";return {ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",cs:"csharp",cpp:"cpp",c:"c",h:"c",hpp:"cpp",php:"php",html:"html",css:"css",scss:"scss",less:"less",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",md:"markdown",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",dockerfile:"docker",makefile:"makefile"}[t]||"text"}function Hz(){return typeof window>"u"?false:document.documentElement.classList.contains("dark")}function B_({code:e,language:t,filename:r,lineStart:n=1,highlightLines:o=[],className:a,showLineNumbers:i=true,showFilename:s=true,autoScrollToHighlight:l=true}){let c=Hz(),d=t||(r?Uz(r):"text"),u=tr.useRef(null),g=tr.useRef(false),p=new Set(o),m=tr.useCallback(()=>{if(!l||o.length===0||!u.current||g.current)return;let b=Math.min(...o)-n,h=u.current,S=h.querySelector("pre");if(!S)return;let E=S.querySelector("code");if(!E)return;let N=E.children;if(b>=0&&b<N.length){let R=N[b];if(R){let x=R.offsetHeight,D=R.offsetTop-x*3;h.scrollTop=Math.max(0,D),g.current=true;}}},[l,o,n]);return tr.useEffect(()=>{g.current=false;},[e,o.join(",")]),tr.useEffect(()=>{let f=setTimeout(m,100);return ()=>clearTimeout(f)},[m,e]),jsxRuntime.jsxs("div",{className:I("rounded-lg border flex flex-col",a),children:[r&&s&&jsxRuntime.jsxs("div",{className:"px-3 py-2 bg-muted/50 border-b text-xs font-mono text-muted-foreground flex items-center gap-2 flex-shrink-0",children:[jsxRuntime.jsx("span",{className:"truncate",children:r}),n>1&&jsxRuntime.jsxs("span",{className:"text-muted-foreground/60",children:["starting at line ",n]})]}),jsxRuntime.jsx("div",{ref:u,className:"flex-1 overflow-auto",children:jsxRuntime.jsx(_o,{language:d,style:c?If:_f,showLineNumbers:i,startingLineNumber:n,wrapLines:true,lineProps:f=>{let b={display:"block",width:"100%"};return p.has(f)&&(b.backgroundColor=c?"rgba(255, 255, 0, 0.1)":"rgba(255, 255, 0, 0.2)",b.borderLeft="3px solid #f59e0b",b.paddingLeft="0.5rem",b.marginLeft="-0.5rem"),{style:b}},customStyle:{margin:0,padding:"1rem",fontSize:"0.8125rem",lineHeight:"1.5",backgroundColor:c?"#1e1e1e":"#fafafa"},codeTagProps:{style:{fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'}},children:e})})]})}function Gz({code:e,language:t,filename:r,className:n}){return jsxRuntime.jsx(B_,{code:e,language:t,filename:r,showLineNumbers:false,className:I("text-sm",n)})}function kle(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/1e3);if(isNaN(n))return "Unknown";if(n<0)return "In the future";if(n<10)return "Just now";if(n<60)return `${n} seconds ago`;let o=Math.floor(n/60);if(o===1)return "1 minute ago";if(o<60)return `${o} minutes ago`;let a=Math.floor(o/60);if(a===1)return "1 hour ago";if(a<24)return `${a} hours ago`;let i=Math.floor(a/24);if(i===1)return "1 day ago";if(i<7)return `${i} days ago`;let s=Math.floor(i/7);if(s===1)return "1 week ago";if(s<4)return `${s} weeks ago`;let l=Math.floor(i/30);if(l===1)return "1 month ago";if(l<12)return `${l} months ago`;let c=Math.floor(i/365);return c===1?"1 year ago":`${c} years ago`}function Ele(e,t={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}){try{let r=new Date(e);return isNaN(r.getTime())?"Invalid date":r.toLocaleString(void 0,t)}catch{return "Invalid date"}}function wle(e){if(e<60)return `${Math.floor(e)}s`;let t=Math.floor(e/60);if(t<60)return `${t}m`;let r=Math.floor(t/60),n=t%60;if(r<24)return n>0?`${r}h ${n}m`:`${r}h`;let o=Math.floor(r/24),a=r%24;return a>0?`${o}d ${a}h`:`${o}d`}function xle(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/1e3);if(isNaN(n)||n<0)return "--";if(n<60)return `${n}s`;let o=Math.floor(n/60);if(o<60)return `${o}m`;let a=Math.floor(o/60);if(a<24)return `${a}h`;let i=Math.floor(a/24);return i<365?`${i}d`:`${Math.floor(i/365)}y`}function Tle(e){if(e===0)return "0 B";let t=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(1024));return `${(e/Math.pow(1024,r)).toFixed(2)} ${t[r]}`}function Ale(e){if(e<1e3)return String(e);if(e<1e6){let r=e/1e3;return `${Number.isInteger(r)?r:r.toFixed(1).replace(/\.0$/,"")}K`}let t=e/1e6;return `${Number.isInteger(t)?t:t.toFixed(1).replace(/\.0$/,"")}M`}function Cle(e){let t=Math.floor(e/1e3),r=Math.floor(t/60),n=Math.floor(r/60);return n>0?`${n}h ${r%60}m`:r>0?`${r}m ${t%60}s`:`${t}s`}var z_=[{bg:"bg-blue-100",text:"text-blue-800",border:"border-blue-300"},{bg:"bg-green-100",text:"text-green-800",border:"border-green-300"},{bg:"bg-yellow-100",text:"text-yellow-800",border:"border-yellow-300"},{bg:"bg-purple-100",text:"text-purple-800",border:"border-purple-300"},{bg:"bg-pink-100",text:"text-pink-800",border:"border-pink-300"},{bg:"bg-indigo-100",text:"text-indigo-800",border:"border-indigo-300"},{bg:"bg-red-100",text:"text-red-800",border:"border-red-300"},{bg:"bg-orange-100",text:"text-orange-800",border:"border-orange-300"},{bg:"bg-teal-100",text:"text-teal-800",border:"border-teal-300"},{bg:"bg-cyan-100",text:"text-cyan-800",border:"border-cyan-300"}];function $z(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t;}return Math.abs(t)}function qz(e){let t=$z(e)%z_.length;return z_[t]}function Rle(e){let t=qz(e);return t?`${t.bg} ${t.text} ${t.border} border`:"bg-gray-100 text-gray-700 border-gray-300 border"}function Wz(e,t){let r=new Date,n=new Date(e),o=Math.floor((r.getTime()-n.getTime())/1e3);if(o<60)return t?.justNow?"just now":`${o}s ago`;let a=Math.floor(o/60);if(a<60)return `${a}m ago`;let i=Math.floor(a/60);if(i<24)return `${i}h ago`;let s=Math.floor(i/24);if(s<30)return `${s}d ago`;let l=Math.floor(s/30);return l<12?`${l}mo ago`:`${Math.floor(l/12)}y ago`}function _le(e){return Wz(e,{justNow:true})}async function Lf(e,t=5e3){try{let r=new AbortController,n=setTimeout(()=>r.abort(),t),o=await fetch(`${e}/api/health`,{signal:r.signal,method:"GET",headers:{Accept:"application/json"}});return clearTimeout(n),o.ok?(await o.json(),{ready:!0}):{ready:!1,error:`Server returned ${o.status}: ${o.statusText}`,retryAfter:2e3}}catch(r){return r.name==="AbortError"?{ready:false,error:"Request timeout",retryAfter:3e3}:r.code==="ECONNREFUSED"||r.message.includes("fetch")?{ready:false,error:"Server not ready",retryAfter:2e3}:{ready:false,error:r.message,retryAfter:5e3}}}async function U_(e,t={}){let{maxAttempts:r=10,initialDelay:n=1e3,maxDelay:o=1e4,timeout:a=5e3}=t,i=0,s=n;for(;i<r;){i++,console.log(`\u{1F50D} Checking API readiness (attempt ${i}/${r})...`);let l=await Lf(e,a);if(l.ready)return console.log("\u2705 API is ready!"),true;console.log(`\u23F3 API not ready: ${l.error}. Retrying in ${s}ms...`),i<r&&(await new Promise(c=>setTimeout(c,s)),s=Math.min(s*2,o));}return console.error("\u274C API failed to become ready after all attempts"),false}async function jz(e,t,r={}){let n=await Lf(e);if(!n.ready)throw new Error(`API not ready: ${n.error}`);let o=t.startsWith("http")?t:`${e}${t}`,a=await fetch(o,{...r,headers:{"Content-Type":"application/json",...r.headers}});if(!a.ok)throw new Error(`API request failed: ${a.status} ${a.statusText}`);return a.json()}function Vz(e,t={}){if(typeof window>"u")return {ready:true,error:null,checking:false};let[r,n]=window.React?.useState?.({ready:false,error:null,checking:true})||{ready:false,error:null,checking:true};return window.React?.useEffect?.(()=>{let o=true;async function a(){if(!o)return;n(s=>({...s,checking:true}));let i=await U_(e,t);o&&n({ready:i,error:i?null:"API is not available",checking:false});}return a(),()=>{o=false;}},[e]),r}function Df(e,t){if(e===t)return true;if(e==null||t==null||typeof e!="object"||typeof t!="object")return false;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return false;for(let o of r)if(!n.includes(o)||!Df(e[o],t[o]))return false;return true}function Yz({initialValues:e,defaultValues:t,onSave:r,timeout:n=1e4,validateChanges:o}){let[a,i]=tr.useState(e),[s,l]=tr.useState(false),[c,d]=tr.useState(false),[u,g]=tr.useState(null),p=tr.useRef(e),m=tr.useRef();tr.useEffect(()=>{let E=o?o(a):!Df(a,p.current);l(E);},[a,o]);let f=tr.useCallback((E,N)=>{i(R=>({...R,[E]:N}));},[]),b=tr.useCallback(async()=>{if(!s||c)return;d(true),g(null);let E=new Promise((N,R)=>{m.current=setTimeout(()=>{R(new Error("Save operation timed out"));},n);});try{await Promise.race([r(a),E]),p.current=a,l(!1);}catch(N){let R=N instanceof Error?N.message:"Failed to save changes";g(R),console.error("Save failed:",N);}finally{m.current&&clearTimeout(m.current),d(false);}},[a,s,c,r,n]),h=tr.useCallback(()=>{i(p.current),l(false),g(null);},[]),S=tr.useCallback(()=>{t&&(i(t),g(null),l(!Df(t,p.current)));},[t]);return tr.useEffect(()=>()=>{m.current&&clearTimeout(m.current);},[]),{values:a,isDirty:s,isSaving:c,error:u,setValues:i,setFieldValue:f,save:b,reset:h,resetToDefaults:S,canSave:s&&!c}}function Qz({appName:e,appVersion:t,navigation:r,children:n,logoSrc:o="/assets/logo.png",logoClassName:a="h-8 w-auto",logoOffset:i,headerHeight:s="h-16",showLogout:l=false,onLogout:c,authenticated:d=true,connectionStatusUrl:u,className:g,primaryColor:p="#3b82f6"}){let m={pathname:"/"};try{let S=reactRouterDom.useLocation();S&&(m=S);}catch{}let[f,b]=tr.useState(false),h=async()=>{if(c)c();else try{await fetch("/api/logout",{method:"POST"}),window.location.href="/login";}catch(S){console.error("Logout failed:",S);}};return jsxRuntime.jsxs("div",{className:I("min-h-screen bg-gray-50",g),children:[jsxRuntime.jsx("header",{className:"bg-black",children:jsxRuntime.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:jsxRuntime.jsxs("div",{className:I("flex justify-between items-center",s),children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("img",{src:o,alt:"Logo",className:I(a,"mr-3"),style:i?{position:"relative",top:i.top??0,left:i.left??0}:void 0,onError:S=>{S.target.style.display="none";}}),e&&jsxRuntime.jsx("h1",{className:"text-xl font-semibold text-white",children:e}),t&&jsxRuntime.jsxs("span",{className:"ml-2 text-xs text-gray-400",children:["v",t]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-4",children:[jsxRuntime.jsx(na,{url:u,className:"text-xs text-gray-400"}),l&&d&&jsxRuntime.jsxs("button",{onClick:h,className:"text-gray-400 hover:text-white flex items-center gap-2 text-sm",children:[jsxRuntime.jsx(lucideReact.LogOut,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Logout"})]}),jsxRuntime.jsx("button",{className:"md:hidden p-2 text-white",onClick:()=>b(!f),children:f?jsxRuntime.jsx(lucideReact.X,{className:"h-6 w-6"}):jsxRuntime.jsx(lucideReact.Menu,{className:"h-6 w-6"})})]})]})})}),jsxRuntime.jsx("nav",{className:"bg-[#444444]",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[jsxRuntime.jsx("div",{className:"hidden md:flex space-x-0",children:r.map(S=>{let E=m.pathname===S.href||S.href==="/"&&m.pathname==="/"||S.href!=="/"&&m.pathname.startsWith(S.href);return jsxRuntime.jsxs(reactRouterDom.Link,{to:S.href,className:I("flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors",E?"text-white":"text-gray-300 hover:bg-[#555555] hover:text-white"),style:E?{backgroundColor:p}:void 0,children:[S.icon,S.name]},S.href)})}),f&&jsxRuntime.jsx("div",{className:"md:hidden py-2 space-y-1",children:r.map(S=>{let E=m.pathname===S.href||S.href==="/"&&m.pathname==="/"||S.href!=="/"&&m.pathname.startsWith(S.href);return jsxRuntime.jsxs(reactRouterDom.Link,{to:S.href,className:I("flex items-center gap-2 px-3 py-2 rounded text-sm font-medium",E?"text-white":"text-gray-300 hover:text-white hover:bg-[#555555]"),style:E?{backgroundColor:p}:void 0,onClick:()=>b(false),children:[S.icon,S.name]},S.href)})})]})}),jsxRuntime.jsx("main",{className:"flex-1 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:n})]})}function Jz({appName:e,appVersion:t,navigation:r,children:n,logoSrc:o="/assets/logo.png",logoClassName:a="h-8 w-auto",logoOffset:i,headerHeight:s="h-16",showLogout:l=false,onLogout:c,authenticated:d=true,connectionStatusUrl:u,sidebarWidth:g=256,className:p}){let m={pathname:"/"};try{m=reactRouterDom.useLocation();}catch{console.warn("SidebarLayout: useLocation called outside Router context, using default pathname");}let f=async()=>{if(c)c();else try{await fetch("/api/logout",{method:"POST"}),window.location.href="/login";}catch(b){console.error("Logout failed:",b);}};return jsxRuntime.jsxs("div",{className:I("h-screen flex flex-col bg-gray-50",p),children:[jsxRuntime.jsx("header",{className:"bg-black",children:jsxRuntime.jsx("div",{className:"px-4 sm:px-6 lg:px-8",children:jsxRuntime.jsxs("div",{className:I("flex justify-between items-center",s),children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("img",{src:o,alt:"Logo",className:I(a,"mr-3"),style:i?{position:"relative",top:i.top??0,left:i.left??0}:void 0,onError:b=>{b.target.style.display="none";}}),e&&jsxRuntime.jsx("h1",{className:"text-xl font-semibold text-white",children:e}),t&&jsxRuntime.jsxs("span",{className:"ml-2 text-xs text-gray-400",children:["v",t]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-4",children:[jsxRuntime.jsx(na,{url:u,className:"text-white"}),l&&d&&jsxRuntime.jsxs("button",{onClick:f,className:"text-gray-400 hover:text-white flex items-center gap-2 text-sm",children:[jsxRuntime.jsx(lucideReact.LogOut,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:"Logout"})]})]})]})})}),jsxRuntime.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[jsxRuntime.jsx("nav",{className:"bg-white border-r border-gray-200",style:{width:`${g}px`},children:jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.jsx("ul",{className:"space-y-1",children:r.map(b=>{let h=m.pathname===b.href||b.href==="/"&&m.pathname==="/"||b.href!=="/"&&m.pathname.startsWith(b.href);return jsxRuntime.jsx("li",{children:jsxRuntime.jsxs(reactRouterDom.Link,{to:b.href,className:I("flex items-center space-x-3 px-3 py-2 rounded-lg transition-colors",h?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100"),children:[b.icon,jsxRuntime.jsx("span",{className:"font-medium",children:b.name})]})},b.href)})})})}),jsxRuntime.jsx("main",{className:"flex-1 overflow-auto",children:n})]})]})}var eU={active:{bg:"bg-green-500",ring:"ring-green-400"},success:{bg:"bg-emerald-500",ring:"ring-emerald-400"},inactive:{bg:"bg-gray-400",ring:"ring-gray-300"},warning:{bg:"bg-yellow-500",ring:"ring-yellow-400"},error:{bg:"bg-red-500",ring:"ring-red-400"}},tU={xs:"h-2 w-2",sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"};function Ff({status:e,size:t="sm",animate:r=true,label:n,className:o}){let a=eU[e],i=r&&(e==="active"||e==="warning"||e==="error");return jsxRuntime.jsxs("div",{className:I("inline-flex items-center gap-2",o),children:[jsxRuntime.jsxs("span",{className:"relative inline-flex",children:[i&&jsxRuntime.jsx("span",{className:I("absolute inline-flex h-full w-full rounded-full opacity-75",a.bg,e==="active"&&"animate-ping",e==="warning"&&"animate-pulse",e==="error"&&"animate-pulse")}),jsxRuntime.jsx("span",{className:I("relative inline-flex rounded-full",tU[t],a.bg,i&&"ring-1",i&&a.ring)})]}),n&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function Bf({data:e,width:t=100,height:r=30,color:n="#10b981",strokeWidth:o=2,fill:a=false,className:i}){let s=tr.useMemo(()=>{if(!e||e.length===0)return "";let c=Math.max(...e),d=Math.min(...e),u=c-d||1;return e.map((g,p)=>{let m=p/(e.length-1)*t,f=r-(g-d)/u*r;return `${m},${f}`}).join(" ")},[e,t,r]);if(!e||e.length===0)return jsxRuntime.jsx("svg",{width:t,height:r,className:i,children:jsxRuntime.jsx("line",{x1:"0",y1:r/2,x2:t,y2:r/2,stroke:"#e5e7eb",strokeWidth:1})});let l=s?`0,${r} ${s} ${t},${r}`:"";return jsxRuntime.jsxs("svg",{width:t,height:r,className:i,children:[a&&s&&jsxRuntime.jsx("polygon",{points:l,fill:n,fillOpacity:.1}),s&&jsxRuntime.jsx("polyline",{points:s,fill:"none",stroke:n,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),e.length>0&&jsxRuntime.jsx("circle",{cx:t,cy:r-(e[e.length-1]-Math.min(...e))/(Math.max(...e)-Math.min(...e)||1)*r,r:o,fill:n})]})}function aU({data:e,columns:t,keyField:r,title:n,description:o,showActivity:a=false,activityField:i="activity",activityDecay:s=1e3,showSparkline:l=false,sparklineField:c="value",sparklineHistory:d,sparklineColor:u="#10b981",showStatus:g=false,statusField:p="status",statusConfig:m,expandable:f=false,childrenField:b="children",defaultExpanded:h=false,className:S,striped:E=false,hover:N=true,compact:R=false,onRowClick:x,onRefresh:D}){let[F,A]=tr.useState(new Set),[v,H]=tr.useState(new Map);tr.useEffect(()=>{if(h&&f){let L=e.map(M=>M[r]);A(new Set(L));}},[h,f,e,r]),tr.useEffect(()=>{if(a){let L=new Map;e.forEach(M=>{let $=M[r],j=M[i];j&&j!=="inactive"&&(L.set($,j),setTimeout(()=>{H(re=>{let Q=new Map(re);return Q.delete($),Q});},s));}),H(M=>new Map([...M,...L]));}},[e,a,r,i,s]);let _=tr.useCallback(L=>{A(M=>{let $=new Set(M);return $.has(L)?$.delete(L):$.add(L),$});},[]),P=(L,M=0)=>{let $=L[r],j=F.has($),re=f&&L[b]&&L[b].length>0,Q=v.get($)||"inactive";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(sr,{className:I(N&&"hover:bg-gray-50 transition-colors",x&&"cursor-pointer",M>0&&"bg-gray-50/50"),onClick:()=>x?.(L),children:t.map((w,z)=>jsxRuntime.jsx(lr,{className:I(w.align==="center"&&"text-center",w.align==="right"&&"text-right",R&&"py-2",z===0&&M>0&&`pl-${4+M*4}`),style:{width:w.width},children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[z===0&&re&&jsxRuntime.jsx("button",{onClick:te=>{te.stopPropagation(),_($);},className:"p-0.5 hover:bg-gray-200 rounded",children:j?"\u25BC":"\u25B6"}),z===0&&a&&jsxRuntime.jsx(Ff,{status:Q,size:"sm"}),w.render?w.render(w.accessor(L),L):w.accessor(L),w.key===p&&g&&m&&jsxRuntime.jsxs(tt,{variant:m[L[p]]?.variant||"default",children:[m[L[p]]?.icon,m[L[p]]?.label||L[p]]}),w.key===c&&l&&d&&jsxRuntime.jsx(Bf,{data:d.get($)||[],color:u,width:60,height:20})]})},w.key))},$),j&&re&&L[b].map(w=>P(w,M+1))]})};return jsxRuntime.jsxs(Ie,{className:S,children:[(n||o)&&jsxRuntime.jsxs("div",{className:"p-4 border-b",children:[n&&jsxRuntime.jsx("h3",{className:"font-semibold text-lg",children:n}),o&&jsxRuntime.jsx("p",{className:"text-sm text-gray-600 mt-1",children:o})]}),jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs(Kn,{children:[jsxRuntime.jsx(Xn,{children:jsxRuntime.jsx(sr,{children:t.map(L=>jsxRuntime.jsx($r,{className:I(L.align==="center"&&"text-center",L.align==="right"&&"text-right"),style:{width:L.width},children:L.label},L.key))})}),jsxRuntime.jsx(Zn,{children:e.length===0?jsxRuntime.jsx(sr,{children:jsxRuntime.jsx(lr,{colSpan:t.length,className:"text-center py-8 text-gray-500",children:"No data available"})}):e.map(L=>P(L))})]})})]})}function sU({stats:e,columns:t=4,className:r}){let n={1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4",5:"grid-cols-1 md:grid-cols-2 lg:grid-cols-5",6:"grid-cols-1 md:grid-cols-3 lg:grid-cols-6"},o={default:"",primary:"border-blue-200 bg-blue-50/50",success:"border-green-200 bg-green-50/50",warning:"border-yellow-200 bg-yellow-50/50",danger:"border-red-200 bg-red-50/50"},a={default:"text-gray-600",primary:"text-blue-600",success:"text-green-600",warning:"text-yellow-600",danger:"text-red-600"};return jsxRuntime.jsx("div",{className:I(`grid gap-4 ${n[t]}`,r),children:e.map((i,s)=>{let l=i.icon,c=i.color||"default";return jsxRuntime.jsx(Ie,{className:I("p-4 transition-all hover:shadow-md",o[c],i.className),children:jsxRuntime.jsx("div",{className:"flex items-start justify-between",children:jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[l&&jsxRuntime.jsx(l,{className:I("h-4 w-4",a[c])}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-600",children:i.label})]}),jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:i.value}),i.description&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 mt-1",children:i.description}),i.trend&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[jsxRuntime.jsxs("span",{className:I("text-xs font-medium",i.trend.positive?"text-green-600":"text-red-600"),children:[i.trend.positive?"\u2191":"\u2193",Math.abs(i.trend.value),"%"]}),i.trend.label&&jsxRuntime.jsx("span",{className:"text-xs text-gray-500",children:i.trend.label})]})]})]})})},s)})})}function lU({label:e,value:t,icon:r,trend:n,className:o}){return jsxRuntime.jsxs("div",{className:I("flex items-center justify-between p-3 bg-white rounded-lg border",o),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[r&&jsxRuntime.jsx("div",{className:"p-2 bg-gray-100 rounded",children:jsxRuntime.jsx(r,{className:"h-4 w-4 text-gray-600"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-gray-600",children:e}),jsxRuntime.jsx("p",{className:"font-semibold",children:t})]})]}),n!==void 0&&jsxRuntime.jsxs("span",{className:I("text-xs font-medium",n>=0?"text-green-600":"text-red-600"),children:[n>=0?"\u2191":"\u2193"," ",Math.abs(n),"%"]})]})}function cU({stats:e}){if(!e)return null;let{total:t,error:r,warn:n,info:o,debug:a,fileSize:i,oldestEntry:s,newestEntry:l}=e;return jsxRuntime.jsxs(Ie,{className:"p-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Total"}),jsxRuntime.jsx("div",{className:"text-xl font-semibold",children:t??0})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Errors"}),jsxRuntime.jsx(tt,{variant:"destructive",children:r??0})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Warnings"}),jsxRuntime.jsx(tt,{variant:"secondary",children:n??0})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Info"}),jsxRuntime.jsx(tt,{variant:"outline",children:o??0})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Debug"}),jsxRuntime.jsx(tt,{variant:"outline",children:a??0})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"File Size"}),jsxRuntime.jsx("div",{className:"text-xl font-semibold",children:String(i??"-")})]})]}),(s||l)&&jsxRuntime.jsxs("div",{className:"mt-3 text-xs text-muted-foreground",children:[s&&jsxRuntime.jsxs("span",{children:["Oldest: ",s," "]}),l&&jsxRuntime.jsxs("span",{children:["Newest: ",l]})]})]})}function mU({categories:e,onSave:t,onLoad:r,onValidate:n,onRestartRequired:o,title:a="Settings",description:i="Configure application preferences",showResetButton:s=true,showUndoButton:l=true,customFields:c={},renderCategory:d,renderSetting:u,autoSave:g=false,autoSaveDelay:p=3e3,confirmReset:m=true,persistState:f=true,className:b,containerClassName:h,categoryClassName:S,settingClassName:E}){let[N,R]=tr.useState({}),[x,D]=tr.useState({}),[F,A]=tr.useState({}),[v,H]=tr.useState(true),[_,P]=tr.useState(false),[L,M]=tr.useState(e?.[0]?.id||""),[$,j]=tr.useState({}),[re,Q]=tr.useState(false),[w,z]=tr.useState(false),[te,T]=tr.useState(null),ye=()=>{let C={};return e.forEach(V=>{V.settings.forEach(J=>{C[J.key]=J.defaultValue;});}),C};tr.useEffect(()=>{(async()=>{H(true);try{let V=r?await r():ye();if(R(V),D(V),f){let J=localStorage.getItem("settings-active-category");J&&e.find(pe=>pe.id===J)&&M(J);}}catch(V){console.error("Failed to load settings:",V),R(ye()),D(ye());}finally{H(false);}})();},[]),tr.useEffect(()=>{let C=JSON.stringify(N)!==JSON.stringify(x);z(C);},[N,x]),tr.useEffect(()=>{if(!g||!w)return;let C=setTimeout(()=>{_e();},p);return ()=>clearTimeout(C)},[N,g,p,w]),tr.useEffect(()=>{f&&localStorage.setItem("settings-active-category",L);},[L,f]);let Ce=(C,V)=>C.validation?C.validation(V):null,et=()=>{let C={},V=false;if(e.forEach(J=>{J.settings.forEach(pe=>{let Te=Ce(pe,N[pe.key]);Te&&(C[pe.key]=Te,V=true);});}),n){let J=n(N);J&&(Object.assign(C,J),V=true);}return A(C),!V},_e=async()=>{if(et()){P(true);try{let V=Object.keys(N).filter(J=>N[J]!==x[J]).filter(J=>e.flatMap(Te=>Te.settings).find(Te=>Te.key===J)?.requiresRestart);V.length>0&&(Q(!0),o?.(V)),await t(N),D(N);}catch(C){console.error("Failed to save settings:",C),T(C instanceof Error?C.message:"Failed to save settings. Please try again.");}finally{P(false);}}},Se=()=>{if(m&&!confirm("Reset all settings to defaults? This will override your current configuration."))return;let C=ye();R(C);},st=()=>{R(x);},ve=(C,V)=>{R(J=>({...J,[C]:V})),F[C]&&A(J=>{let pe={...J};return delete pe[C],pe}),te&&T(null);},Oe=C=>{if(C.hidden)return null;let V=N[C.key]??C.defaultValue,J=F[C.key],pe=$[C.key];if(C.showIf&&!C.showIf(N))return null;let Te=C.inputWidth==="small"?"max-w-[180px]":C.inputWidth==="medium"?"max-w-sm":C.inputWidth==="large"?"w-full":void 0;if(C.type==="custom"||C.customComponent){let ze=C.customComponent||c[C.type];if(ze)return jsxRuntime.jsx(ze,{value:V,onChange:Br=>ve(C.key,Br),error:J,disabled:_,setting:C})}let hr=c[C.type];if(hr)return jsxRuntime.jsx(hr,{value:V,onChange:ze=>ve(C.key,ze),error:J,disabled:_,setting:C});switch(C.type){case "string":case "text":case "password":return jsxRuntime.jsxs("div",{className:I("flex items-center gap-2",Te),children:[jsxRuntime.jsx(ht,{id:C.key,type:C.type==="password"&&!pe?"password":"text",value:V||"",onChange:ze=>ve(C.key,ze.target.value),className:I(J&&"border-red-500",Te),placeholder:C.placeholder||(C.type==="password"?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":void 0),disabled:_}),C.suffix&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:C.suffix})]});case "number":return jsxRuntime.jsxs("div",{className:I("flex items-center gap-2",Te),children:[jsxRuntime.jsx(ht,{id:C.key,type:"number",value:V??"",onChange:ze=>ve(C.key,parseFloat(ze.target.value)||0),className:I(J&&"border-red-500",Te),placeholder:C.placeholder,disabled:_,step:C.step,min:C.min,max:C.max}),C.suffix&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:C.suffix})]});case "boolean":return jsxRuntime.jsx(xr,{id:C.key,checked:V||false,onCheckedChange:ze=>ve(C.key,ze),disabled:_});case "select":return jsxRuntime.jsxs(yt,{value:String(V||C.defaultValue),onValueChange:ze=>ve(C.key,ze),disabled:_,children:[jsxRuntime.jsx(ct,{id:C.key,className:I(J&&"border-red-500"),children:jsxRuntime.jsx(St,{})}),jsxRuntime.jsx(ut,{children:C.options?.map(ze=>jsxRuntime.jsx(Be,{value:String(ze.value),children:ze.label},ze.value))})]});default:return null}},Ge=e.find(C=>C.id===L);return jsxRuntime.jsxs("div",{className:I("space-y-6",b),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-3xl font-bold",children:a}),jsxRuntime.jsx("p",{className:"text-muted-foreground",children:i})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[l&&w&&jsxRuntime.jsxs(W,{variant:"outline",onClick:st,disabled:_,children:[jsxRuntime.jsx(lucideReact.Undo,{className:"h-4 w-4 mr-2"}),"Undo"]}),s&&jsxRuntime.jsxs(W,{variant:"outline",onClick:Se,disabled:_,children:[jsxRuntime.jsx(lucideReact.RotateCcw,{className:"h-4 w-4 mr-2"}),"Defaults"]}),jsxRuntime.jsx(W,{onClick:_e,disabled:!w||_,className:I("transition-all",w&&"ring-2 ring-primary/20"),children:_?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-4 w-4 mr-2 animate-spin"}),"Saving..."]}):w?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Save,{className:"h-4 w-4 mr-2"}),"Save"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4 mr-2"}),"Saved"]})})]})]}),te&&jsxRuntime.jsxs(nt,{variant:"destructive",className:"mb-6",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-4 w-4"}),jsxRuntime.jsx(ot,{children:te})]}),jsxRuntime.jsxs("div",{className:I("flex gap-6",h),children:[jsxRuntime.jsx(Ie,{className:"w-64 h-fit",children:jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold mb-4",children:"Categories"}),jsxRuntime.jsx("div",{className:"space-y-1",children:e.map(C=>jsxRuntime.jsxs("button",{onClick:()=>M(C.id),className:I("w-full flex items-center gap-3 px-3 py-2 rounded-md text-sm transition-colors",L===C.id?"bg-primary text-primary-foreground":"hover:bg-muted",S),children:[typeof C.icon=="function"&&(()=>{let V=C.icon;return jsxRuntime.jsx(V,{className:"h-4 w-4"})})(),jsxRuntime.jsx("span",{className:"text-left",children:C.label})]},C.id))})]})}),jsxRuntime.jsx("div",{className:"flex-1",children:v?jsxRuntime.jsx(Ie,{className:"p-8",children:jsxRuntime.jsx("div",{className:"flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}):Ge?jsxRuntime.jsx(Ie,{className:"p-6",children:d?d(Ge,jsxRuntime.jsx("div",{className:"space-y-6",children:Ge.settings.map(C=>{let V=Oe(C);if(!V)return null;let J=jsxRuntime.jsxs("div",{className:I("space-y-2",E),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs(zt,{htmlFor:C.key,className:"text-sm font-medium",children:[C.label,C.requiresRestart&&jsxRuntime.jsx("span",{className:"ml-2 text-xs text-amber-600 dark:text-amber-400",children:"(Requires restart)"})]}),C.help&&jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors",title:C.help,children:jsxRuntime.jsx(lucideReact.Info,{className:"h-3 w-3"})})]}),C.type==="password"&&N[C.key]&&jsxRuntime.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>j(pe=>({...pe,[C.key]:!pe[C.key]})),children:$[C.key]?jsxRuntime.jsx(lucideReact.EyeOff,{className:"h-3 w-3"}):jsxRuntime.jsx(lucideReact.Eye,{className:"h-3 w-3"})})]}),C.description&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:C.description}),C.hint&&jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:C.hint}),V,F[C.key]&&jsxRuntime.jsx("p",{className:"text-xs text-red-500",children:F[C.key]})]},C.key);return u?u(C,J):J})})):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h2",{className:"text-xl font-semibold",children:Ge.label}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:Ge.description})]}),jsxRuntime.jsx("div",{className:"space-y-6",children:Ge.settings.map(C=>{let V=Oe(C);if(!V)return null;let J=jsxRuntime.jsxs("div",{className:I("space-y-2",E),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs(zt,{htmlFor:C.key,className:"text-sm font-medium",children:[C.label,C.requiresRestart&&jsxRuntime.jsx("span",{className:"ml-2 text-xs text-amber-600 dark:text-amber-400",children:"(Requires restart)"})]}),C.help&&jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors",title:C.help,children:jsxRuntime.jsx(lucideReact.Info,{className:"h-3 w-3"})})]}),C.type==="password"&&N[C.key]&&jsxRuntime.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>j(pe=>({...pe,[C.key]:!pe[C.key]})),children:$[C.key]?jsxRuntime.jsx(lucideReact.EyeOff,{className:"h-3 w-3"}):jsxRuntime.jsx(lucideReact.Eye,{className:"h-3 w-3"})})]}),C.description&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:C.description}),V,F[C.key]&&jsxRuntime.jsx("p",{className:"text-xs text-red-500",children:F[C.key]})]},C.key);return u?u(C,J):J})})]})}):jsxRuntime.jsx(Ie,{className:"p-8",children:jsxRuntime.jsxs(nt,{children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-4 w-4"}),jsxRuntime.jsx(ot,{children:"No settings available for this category"})]})})})]}),re&&jsxRuntime.jsxs(nt,{className:"border-amber-500",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-4 w-4 text-amber-600"}),jsxRuntime.jsx(ot,{children:"Some settings require a restart to take effect."})]})]})}var ys={colors:{primary:{DEFAULT:"#3b82f6",hover:"#2563eb",light:"#60a5fa",dark:"#1d4ed8"},dark:{bg:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1a1a1a",elevated:"#242424"},border:{DEFAULT:"#2a2a2a",subtle:"#1f1f1f",strong:"#3a3a3a"}},light:{bg:{primary:"#ffffff",secondary:"#f8f9fa",tertiary:"#f3f4f6",elevated:"#ffffff"},border:{DEFAULT:"#e5e7eb",subtle:"#f3f4f6",strong:"#d1d5db"}},success:{DEFAULT:"#10b981",light:"#34d399",dark:"#059669"},warning:{DEFAULT:"#f59e0b",light:"#fbbf24",dark:"#d97706"},error:{DEFAULT:"#ef4444",light:"#f87171",dark:"#dc2626"},info:{DEFAULT:"#3b82f6",light:"#60a5fa",dark:"#2563eb"},intelligent:{DEFAULT:"#8b5cf6",light:"#a78bfa",dark:"#7c3aed"},activity:{read:"#10b981",write:"#3b82f6",inactive:"#6b7280"}},gradients:{subtle:"linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%)",card:"linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%)",glow:"radial-gradient(circle at 50% 0%, rgba(226,19,80,0.15) 0%, transparent 70%)",intelligent:"linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(139,92,246,0.05) 100%)"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",DEFAULT:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",glow:"0 0 20px rgba(226,19,80,0.3)","glow-intelligent":"0 0 20px rgba(139,92,246,0.3)"},radius:{sm:"0.25rem",DEFAULT:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem","2xl":"1.5rem",full:"9999px"},spacing:{xs:"0.5rem",sm:"0.75rem",DEFAULT:"1rem",md:"1.5rem",lg:"2rem",xl:"3rem","2xl":"4rem"},typography:{fonts:{sans:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',mono:'"JetBrains Mono", "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},sizes:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},weights:{light:"300",normal:"400",medium:"500",semibold:"600",bold:"700"}},transitions:{fast:"150ms",DEFAULT:"200ms",slow:"300ms",timing:"cubic-bezier(0.4, 0, 0.2, 1)"},zIndex:{base:0,elevated:10,dropdown:20,sticky:30,fixed:40,modal:50,popover:60,tooltip:70},opacity:{hover:.8,disabled:.5,backdrop:.7,subtle:.1}},Cce=(e=false)=>{let t=e?ys.colors.dark:ys.colors.light;return {"--color-bg-primary":t.bg.primary,"--color-bg-secondary":t.bg.secondary,"--color-bg-tertiary":t.bg.tertiary,"--color-bg-elevated":t.bg.elevated,"--color-border":t.border.DEFAULT,"--color-border-subtle":t.border.subtle,"--color-border-strong":t.border.strong,"--color-text":e?"#ffffff":"#000000","--color-text-secondary":e?"#a1a1aa":"#6b7280","--color-text-tertiary":e?"#71717a":"#9ca3af"}};var J_=tr.createContext(void 0);function hU({children:e,defaultMode:t="system",theme:r=ys,customColors:n,persistPreference:o=true}){let[a,i]=tr.useState({mode:t,theme:r,customColors:n}),[s,l]=tr.useState(false);tr.useEffect(()=>{if(o){let g=localStorage.getItem("theme-mode");g&&i(p=>({...p,mode:g}));}},[o]),tr.useEffect(()=>{let g=document.documentElement;if(a.mode==="system"){let p=window.matchMedia("(prefers-color-scheme: dark)"),m=p.matches;l(m),g.classList.toggle("dark",m);let f=b=>{let h=b.matches;l(h),g.classList.toggle("dark",h);};return p.addEventListener("change",f),()=>{p.removeEventListener("change",f);}}else {let p=a.mode==="dark";l(p),g.classList.toggle("dark",p);return}},[a.mode]),tr.useEffect(()=>{if(n){let g=document.documentElement;if(n.primary){let p=Hf(n.primary);g.style.setProperty("--primary",p);}if(n.secondary){let p=Hf(n.secondary);g.style.setProperty("--secondary",p);}if(n.accent){let p=Hf(n.accent);g.style.setProperty("--accent",p);}}},[n]);let c=g=>{i(p=>({...p,mode:g})),o&&localStorage.setItem("theme-mode",g);},u={themeConfig:a,setThemeMode:c,toggleTheme:()=>{c(s?"light":"dark");},isDark:s};return jsxRuntime.jsx(J_.Provider,{value:u,children:e})}function Ss(){let e=tr.useContext(J_);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}function Hf(e){e=e.replace("#","");let t=parseInt(e.substr(0,2),16)/255,r=parseInt(e.substr(2,2),16)/255,n=parseInt(e.substr(4,2),16)/255,o=Math.max(t,r,n),a=Math.min(t,r,n),i=0,s=0,l=(o+a)/2;if(o!==a){let c=o-a;switch(s=l>.5?c/(2-o-a):c/(o+a),o){case t:i=((r-n)/c+(r<n?6:0))/6;break;case r:i=((n-t)/c+2)/6;break;case n:i=((t-r)/c+4)/6;break}}return `${Math.round(i*360)} ${Math.round(s*100)}% ${Math.round(l*100)}%`}function kU({className:e,showLabel:t=true,variant:r="select"}){let{themeConfig:n,setThemeMode:o,toggleTheme:a,isDark:i}=Ss();return r==="button"?jsxRuntime.jsxs("div",{className:I("flex items-center gap-2",e),children:[t&&jsxRuntime.jsx(zt,{children:"Theme"}),jsxRuntime.jsx(W,{variant:"outline",size:"icon",onClick:a,className:"w-10 h-10",children:i?jsxRuntime.jsx(lucideReact.Sun,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Moon,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:I("flex flex-col gap-2",e),children:[t&&jsxRuntime.jsx(zt,{htmlFor:"theme-select",children:"Theme"}),jsxRuntime.jsxs(yt,{value:n.mode,onValueChange:s=>o(s),children:[jsxRuntime.jsx(ct,{id:"theme-select",className:"w-[180px]",children:jsxRuntime.jsx(St,{placeholder:"Select theme"})}),jsxRuntime.jsxs(ut,{children:[jsxRuntime.jsx(Be,{value:"light",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Sun,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:"Light"})]})}),jsxRuntime.jsx(Be,{value:"dark",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Moon,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:"Dark"})]})}),jsxRuntime.jsx(Be,{value:"system",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Monitor,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:"System"})]})})]})]})]})}function EU({className:e}){let{toggleTheme:t,isDark:r}=Ss();return jsxRuntime.jsx(W,{variant:"ghost",size:"icon",onClick:t,className:I("w-8 h-8",e),title:`Switch to ${r?"light":"dark"} theme`,children:r?jsxRuntime.jsx(lucideReact.Sun,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Moon,{className:"h-4 w-4"})})}var CU=[{id:"general",label:"General",description:"Basic application settings",icon:jsxRuntime.jsx(lucideReact.Settings,{className:"h-4 w-4"}),settings:[]},{id:"network",label:"Network",description:"Network and connectivity",icon:jsxRuntime.jsx(lucideReact.Network,{className:"h-4 w-4"}),settings:[]},{id:"logging",label:"Logging",description:"Logging configuration",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"h-4 w-4"}),settings:[]},{id:"security",label:"Security",description:"Security settings",icon:jsxRuntime.jsx(lucideReact.Shield,{className:"h-4 w-4"}),settings:[]},{id:"notifications",label:"Notifications",description:"Email and alerts",icon:jsxRuntime.jsx(lucideReact.Mail,{className:"h-4 w-4"}),settings:[]},{id:"appearance",label:"Appearance",description:"UI preferences",icon:jsxRuntime.jsx(lucideReact.Palette,{className:"h-4 w-4"}),settings:[]},{id:"advanced",label:"Advanced",description:"Advanced settings",icon:jsxRuntime.jsx(lucideReact.Activity,{className:"h-4 w-4"}),settings:[]}];function NU(e,t,r,n){return {id:e,label:t,description:n,icon:RU[r]||jsxRuntime.jsx(lucideReact.Settings,{className:"h-4 w-4"})}}var RU={Server:jsxRuntime.jsx(lucideReact.Server,{className:"h-4 w-4"}),Network:jsxRuntime.jsx(lucideReact.Network,{className:"h-4 w-4"}),FileText:jsxRuntime.jsx(lucideReact.FileText,{className:"h-4 w-4"}),Shield:jsxRuntime.jsx(lucideReact.Shield,{className:"h-4 w-4"}),Mail:jsxRuntime.jsx(lucideReact.Mail,{className:"h-4 w-4"}),Settings:jsxRuntime.jsx(lucideReact.Settings,{className:"h-4 w-4"}),Database:jsxRuntime.jsx(lucideReact.Database,{className:"h-4 w-4"}),Bell:jsxRuntime.jsx(lucideReact.Bell,{className:"h-4 w-4"}),Users:jsxRuntime.jsx(lucideReact.Users,{className:"h-4 w-4"}),Palette:jsxRuntime.jsx(lucideReact.Palette,{className:"h-4 w-4"}),Globe:jsxRuntime.jsx(lucideReact.Globe,{className:"h-4 w-4"}),Activity:jsxRuntime.jsx(lucideReact.Activity,{className:"h-4 w-4"})};function LU({apiUrl:e="/api/updates",checkInterval:t=36e5,onDownload:r}){let[n,o]=tr.useState(null),[a,i]=tr.useState(false),[s,l]=tr.useState(false),[c,d]=tr.useState(false);tr.useEffect(()=>{u();let m=setInterval(u,t);return ()=>clearInterval(m)},[t]);let u=async(m=false)=>{i(true);try{let f=await fetch(`${e}/check${m?"?force=true":""}`);if(f.ok){let b=await f.json();o(b),b.updateAvailable&&s&&localStorage.getItem("dismissedUpdateVersion")!==b.latestRelease?.version&&l(!1);}}catch(f){console.error("Failed to check for updates:",f);}finally{i(false);}},g=()=>{l(true),n?.latestRelease&&localStorage.setItem("dismissedUpdateVersion",n.latestRelease.version);},p=async()=>{if(r&&n)r(n);else try{let m=await fetch(`${e}/download-url`);if(m.ok){let{url:f}=await m.json();window.open(f,"_blank");}}catch{n?.latestRelease?.url&&window.open(n.latestRelease.url,"_blank");}};return !n?.updateAvailable||s?null:jsxRuntime.jsx("div",{className:"fixed bottom-4 right-4 z-50 max-w-md animate-in slide-in-from-bottom-2",children:jsxRuntime.jsxs(nt,{className:"border-green-500 bg-green-50 dark:bg-green-950/20",children:[jsxRuntime.jsx(lucideReact.Download,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),jsxRuntime.jsxs(ot,{className:"pr-8",children:[jsxRuntime.jsxs("div",{className:"font-semibold text-green-800 dark:text-green-200 mb-1",children:["Update Available: v",n.latestRelease?.version]}),jsxRuntime.jsx("div",{className:"text-sm text-green-700 dark:text-green-300 mb-3",children:n.latestRelease?.name||"A new version is available"}),c&&n.latestRelease?.body&&jsxRuntime.jsx("div",{className:"mt-3 p-2 bg-white/50 dark:bg-black/20 rounded text-xs",children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:n.latestRelease.body})}),jsxRuntime.jsxs("div",{className:"flex gap-2 mt-3",children:[jsxRuntime.jsxs(W,{size:"sm",variant:"default",onClick:p,className:"bg-green-600 hover:bg-green-700",children:[jsxRuntime.jsx(lucideReact.Download,{className:"h-3 w-3 mr-1"}),"Download"]}),jsxRuntime.jsxs(W,{size:"sm",variant:"outline",onClick:()=>d(!c),children:[c?"Hide":"Show"," Changes"]}),jsxRuntime.jsx(W,{size:"sm",variant:"ghost",onClick:()=>window.open(n.latestRelease?.url,"_blank"),children:jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3 w-3"})})]})]}),jsxRuntime.jsx(W,{size:"sm",variant:"ghost",className:"absolute top-2 right-2 h-6 w-6 p-0",onClick:g,children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})})}function PU(e,t){let[r,n]=tr.useState(e);return tr.useEffect(()=>{let o=setTimeout(()=>{n(e);},t);return ()=>{clearTimeout(o);}},[e,t]),r}function FU(e){let[t,r]=to(e);return {connected:t.connected,connecting:t.connecting,transport:t.transport,error:t.error,retryCount:t.retryCount,reconnect:r.reconnect}}var Wf=class{constructor(t={}){this.config={loginEndpoint:t.loginEndpoint||"/api/login",logoutEndpoint:t.logoutEndpoint||"/api/logout",refreshEndpoint:t.refreshEndpoint||"/api/refresh",tokenKey:t.tokenKey||"auth_token",authKey:t.authKey||"authenticated",tokenExpiry:t.tokenExpiry||36e5};}async login(t,r){try{let n=await fetch(this.config.loginEndpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t,password:r})}),o=await n.json();return n.ok&&o.success?(localStorage.setItem(this.config.authKey,"true"),o.token&&(localStorage.setItem(this.config.tokenKey,o.token),this.scheduleTokenRefresh(o.expiresIn||this.config.tokenExpiry)),o.user&&localStorage.setItem("user",JSON.stringify(o.user)),{success:!0,token:o.token,user:o.user,expiresIn:o.expiresIn}):{success:!1,error:o.error||"Invalid credentials"}}catch(n){return console.error("Login error:",n),{success:false,error:"Login failed. Please try again."}}}async logout(){try{let t=this.getToken();t&&await fetch(this.config.logoutEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});}catch(t){console.error("Logout error:",t);}finally{localStorage.removeItem(this.config.authKey),localStorage.removeItem(this.config.tokenKey),localStorage.removeItem("user"),this.refreshTimer&&clearTimeout(this.refreshTimer);}}isAuthenticated(){return localStorage.getItem(this.config.authKey)==="true"}getToken(){return localStorage.getItem(this.config.tokenKey)}getUser(){let t=localStorage.getItem("user");if(t)try{return JSON.parse(t)}catch{return null}return null}async refreshToken(){try{let t=this.getToken();if(!t)return !1;let r=await fetch(this.config.refreshEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(r.ok){let n=await r.json();if(n.token)return localStorage.setItem(this.config.tokenKey,n.token),this.scheduleTokenRefresh(n.expiresIn||this.config.tokenExpiry),!0}return !1}catch(t){return console.error("Token refresh error:",t),false}}scheduleTokenRefresh(t){this.refreshTimer&&clearTimeout(this.refreshTimer);let r=Math.max(0,t-3e5);this.refreshTimer=setTimeout(()=>{this.refreshToken();},r);}async authenticatedFetch(t,r={}){let n=this.getToken(),o=new Headers(r.headers);n&&o.set("Authorization",`Bearer ${n}`);let a=await fetch(t,{...r,headers:o});if(a.status===401&&await this.refreshToken()){let s=this.getToken();return s&&o.set("Authorization",`Bearer ${s}`),fetch(t,{...r,headers:o})}return a}requireAuth(t="/login"){return this.isAuthenticated()?true:(window.location.href=t,false)}},BU=new Wf;var oue={base:"transition-all duration-200",interactive:"hover:shadow-md hover:border-gray-300 dark:hover:border-gray-700 cursor-pointer",elevation:"shadow-sm"},aue={primary:"gap-2",icon:"h-4 w-4"},iue={container:"flex flex-col items-center justify-center py-12 text-center",icon:"h-12 w-12 text-muted-foreground mb-4",title:"text-lg font-medium mb-2",description:"text-sm text-muted-foreground max-w-sm"},sue={led:"w-2 h-2 rounded-full transition-all duration-200",pulse:"animate-pulse",colors:{read:"bg-green-500",write:"bg-blue-500",inactive:"bg-gray-400",error:"bg-red-500"}},lue={badge:{success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",error:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",info:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",default:"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200"}};var UU=25,HU=[10,25,50,100];function Do({data:e,pageSize:t=UU,storageKey:r}){let[n,o]=tr.useState(()=>{if(r)try{let h=localStorage.getItem(`pagination-${r}`);if(h)return {page:1,pageSize:JSON.parse(h).pageSize||t}}catch{}return {page:1,pageSize:t}}),{page:a,pageSize:i}=n,s=tr.useMemo(()=>Math.max(1,Math.ceil(e.length/i)),[e.length,i]);tr.useEffect(()=>{a>s&&o(h=>({...h,page:Math.max(1,s)}));},[s,a]),tr.useEffect(()=>{if(r)try{localStorage.setItem(`pagination-${r}`,JSON.stringify({pageSize:i}));}catch{}},[i,r]);let l=(a-1)*i,c=Math.min(l+i,e.length),d=tr.useMemo(()=>e.slice(l,c),[e,l,c]),u=tr.useCallback(h=>{o(S=>({...S,page:Math.max(1,Math.min(h,s))}));},[s]),g=tr.useCallback(h=>{o({page:1,pageSize:h});},[]),p=tr.useCallback(()=>{u(a+1);},[a,u]),m=tr.useCallback(()=>{u(a-1);},[a,u]),f=tr.useCallback(()=>{u(1);},[u]),b=tr.useCallback(()=>{u(s);},[s,u]);return {paginatedData:d,page:a,pageSize:i,totalPages:s,totalItems:e.length,setPage:u,setPageSize:g,nextPage:p,prevPage:m,firstPage:f,lastPage:b,startIndex:l+1,endIndex:c,canGoNext:a<s,canGoPrev:a>1,pageSizeOptions:HU}}function Mo({columns:e,storageKey:t}){let r=`column-visibility-${t}`,[n,o]=tr.useState(()=>{let c={};if(e.forEach(d=>{c[d.id]=d.defaultVisible!==false;}),typeof window>"u")return c;try{let d=localStorage.getItem(r);if(d){let u=JSON.parse(d),g={};return e.forEach(p=>{p.locked?g[p.id]=!0:u[p.id]!==void 0?g[p.id]=u[p.id]:g[p.id]=p.defaultVisible!==!1;}),g}}catch(d){console.error("Error loading column visibility state:",d);}return c});tr.useEffect(()=>{if(!(typeof window>"u"))try{localStorage.setItem(r,JSON.stringify(n));}catch(c){console.error("Error saving column visibility state:",c);}},[n,r]);let a=tr.useCallback(c=>e.find(u=>u.id===c)?.locked?true:n[c]!==false,[n,e]),i=tr.useCallback(c=>{e.find(u=>u.id===c)?.locked||o(u=>({...u,[c]:!u[c]}));},[e]),s=tr.useCallback(()=>{let c={};e.forEach(d=>{c[d.id]=true;}),o(c);},[e]),l=tr.useCallback(()=>{let c={};e.forEach(d=>{c[d.id]=d.locked===true;}),o(c);},[e]);return {visibleColumns:n,isColumnVisible:a,toggleColumn:i,showAllColumns:s,hideAllColumns:l,columns:e}}var WU=50,xs=150,jU=3;function Po({tableId:e,columns:t,storageKey:r}){let n=r||`table-columns-${e}`,o=tr.useCallback(()=>t.reduce((R,x)=>(R[x.key]=x.defaultWidth||xs,R),{}),[t]),[a,i]=tr.useState(()=>{try{let R=localStorage.getItem(n);if(R){let x=JSON.parse(R);return {widths:{...o(),...x},isResizing:!1,resizingColumn:null}}}catch{}return {widths:o(),isResizing:false,resizingColumn:null}}),s=tr.useRef(0),l=tr.useRef(0),c=tr.useRef(null),d=tr.useRef(false),u=tr.useRef(t);tr.useEffect(()=>{u.current=t;},[t]);let g=tr.useCallback(R=>u.current.find(x=>x.key===R),[]);tr.useEffect(()=>{try{localStorage.setItem(n,JSON.stringify(a.widths));}catch{}},[a.widths,n]);let p=tr.useRef(null);p.current||(p.current={onPointerMove:R=>{if(!c.current)return;let x=R.clientX-s.current;if(!d.current){if(Math.abs(x)<jU)return;d.current=true,i(H=>({...H,isResizing:true,resizingColumn:c.current})),document.body.style.cursor="col-resize",document.body.style.userSelect="none";}let D=g(c.current),F=D?.minWidth||WU,A=D?.maxWidth,v=Math.max(F,l.current+x);A&&(v=Math.min(A,v)),i(H=>({...H,widths:{...H.widths,[c.current]:v}}));},onPointerUp:()=>{c.current=null,d.current=false,i(R=>({...R,isResizing:false,resizingColumn:null})),document.removeEventListener("pointermove",p.current.onPointerMove),document.removeEventListener("pointerup",p.current.onPointerUp),document.removeEventListener("pointercancel",p.current.onPointerUp),document.body.style.cursor="",document.body.style.userSelect="";}}),tr.useEffect(()=>()=>{p.current&&(document.removeEventListener("pointermove",p.current.onPointerMove),document.removeEventListener("pointerup",p.current.onPointerUp),document.removeEventListener("pointercancel",p.current.onPointerUp)),document.body.style.cursor="",document.body.style.userSelect="";},[]);let m=tr.useRef(a.widths);tr.useEffect(()=>{m.current=a.widths;},[a.widths]);let f=tr.useCallback((R,x)=>{s.current=x,l.current=m.current[R]||xs,c.current=R,d.current=false,document.addEventListener("pointermove",p.current.onPointerMove),document.addEventListener("pointerup",p.current.onPointerUp),document.addEventListener("pointercancel",p.current.onPointerUp);},[]),b=tr.useCallback(R=>({onPointerDown:x=>{x.preventDefault(),x.stopPropagation(),f(R,x.clientX);},onMouseDown:x=>{x.preventDefault(),x.stopPropagation();},draggable:false,onDragStart:x=>{x.preventDefault(),x.stopPropagation();},className:"resize-handle","data-resizing":a.resizingColumn===R}),[f,a.resizingColumn]),h=tr.useCallback(R=>{let x=a.widths[R]||xs;return {width:x,minWidth:x,position:"relative"}},[a.widths]),S=t.reduce((R,x)=>R+(a.widths[x.key]||x.defaultWidth||xs),0),E=tr.useCallback(()=>({minWidth:S}),[S]),N=tr.useCallback(()=>{i(R=>({...R,widths:o()}));},[o]);return {widths:a.widths,isResizing:a.isResizing,totalWidth:S,getResizeHandleProps:b,getColumnStyle:h,getTableStyle:E,resetToDefaults:N}}function Fo({storageKey:e,defaultOrder:t}){let[r,n]=tr.useState(()=>{try{let l=localStorage.getItem(e);if(l){let c=JSON.parse(l),d=new Set(c),u=new Set(t),g=c.filter(m=>u.has(m)),p=t.filter(m=>!d.has(m));if(p.length>0){let m=[...g];for(let f of p){let b=t.indexOf(f),h=m.length;for(let S=0;S<m.length;S++)if(t.indexOf(m[S])>b){h=S;break}m.splice(h,0,f);}return m}return g.length>0?g:t}}catch(l){console.warn("Failed to load column order from localStorage:",l);}return t});tr.useEffect(()=>{try{localStorage.setItem(e,JSON.stringify(r));}catch(l){console.warn("Failed to save column order to localStorage:",l);}},[e,r]);let o=tr.useCallback((l,c)=>{l!==c&&n(d=>{let u=[...d],[g]=u.splice(l,1);return g!==void 0&&u.splice(c,0,g),u});},[]),a=tr.useCallback((l,c)=>{n(d=>{let u=d.indexOf(l);if(u===-1)return d;let g=c==="left"?Math.max(0,u-1):Math.min(d.length-1,u+1);if(u===g)return d;let p=[...d],[m]=p.splice(u,1);return m!==void 0&&p.splice(g,0,m),p});},[]),i=tr.useCallback(()=>{n(t);},[t]),s=tr.useCallback(l=>{let c=new Map(l.map(d=>[d.id,d]));return r.map(d=>c.get(d)).filter(d=>d!==void 0)},[r]);return {columnOrder:r,moveColumn:o,moveColumnById:a,resetOrder:i,getOrderedColumns:s}}function Bo(e,t,r=[]){let[n,o]=tr.useState({isDragging:false,draggedId:null,dropIndex:null}),a=tr.useCallback(u=>{r.includes(u)||o({isDragging:true,draggedId:u,dropIndex:null});},[r]),i=tr.useCallback((u,g)=>{if(r.includes(u))return;let p=e.indexOf(u);if(p===-1)return;let m=g.currentTarget.getBoundingClientRect(),f=m.left+m.width/2,b=g.clientX<f?p:p+1;o(h=>({...h,dropIndex:b}));},[r,e]),s=tr.useCallback(()=>{if(!n.draggedId||n.dropIndex===null){o({isDragging:false,draggedId:null,dropIndex:null});return}let u=e.indexOf(n.draggedId),g=n.dropIndex;u<g&&(g=g-1),u!==-1&&g!==-1&&u!==g&&t(u,g),o({isDragging:false,draggedId:null,dropIndex:null});},[n.draggedId,n.dropIndex,e,t]),l=tr.useCallback(()=>{o({isDragging:false,draggedId:null,dropIndex:null});},[]),c=tr.useCallback(u=>({draggable:!r.includes(u),onDragStart:g=>{if(r.includes(u)){g.preventDefault();return}g.dataTransfer.effectAllowed="move",a(u);},onDragOver:g=>{g.preventDefault(),g.dataTransfer.dropEffect="move",i(u,g);},onDrop:g=>{g.preventDefault(),s();},onDragEnd:l}),[r,a,i,s,l]),d=tr.useCallback(u=>!n.isDragging||n.dropIndex===null?false:e.indexOf(u)===n.dropIndex,[n.isDragging,n.dropIndex,e]);return {dragState:n,getDragHandleProps:c,showDropIndicator:d}}function zo({page:e,pageSize:t,totalPages:r,totalItems:n,startIndex:o,endIndex:a,canGoNext:i,canGoPrev:s,pageSizeOptions:l,onPageChange:c,onPageSizeChange:d,onNextPage:u,onPrevPage:g,onFirstPage:p,onLastPage:m,className:f}){let b=()=>{let h=[],E=Math.floor(2.5),N=Math.max(1,e-E),R=Math.min(r,e+E);e<=E&&(R=Math.min(r,5)),e>r-E&&(N=Math.max(1,r-5+1)),N>1&&(h.push(1),N>2&&h.push("ellipsis"));for(let x=N;x<=R;x++)x!==1&&x!==r&&h.push(x);return R<r&&(R<r-1&&h.push("ellipsis"),h.push(r)),h};return n===0?null:jsxRuntime.jsxs("div",{className:I("flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-3",f),children:[jsxRuntime.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",o," to ",a," of ",n," items"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:"Per page:"}),jsxRuntime.jsxs(yt,{value:String(t),onValueChange:h=>d(Number(h)),children:[jsxRuntime.jsx(ct,{className:"w-20 h-8",children:jsxRuntime.jsx(St,{})}),jsxRuntime.jsx(ut,{children:l.map(h=>jsxRuntime.jsx(Be,{value:String(h),children:h},h))})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:p,disabled:!s,title:"First page",children:jsxRuntime.jsx(lucideReact.ChevronsLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:g,disabled:!s,title:"Previous page",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"flex items-center gap-1",children:b().map((h,S)=>h==="ellipsis"?jsxRuntime.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${S}`):jsxRuntime.jsx(W,{variant:e===h?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>c(h),children:h},h))}),jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:u,disabled:!i,title:"Next page",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})}),jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:m,disabled:!i,title:"Last page",children:jsxRuntime.jsx(lucideReact.ChevronsRight,{className:"h-4 w-4"})})]})]})]})}function jf({data:e,columns:t,storageKey:r,getRowId:n,selectable:o=false,selectedIds:a,onSelectionChange:i,onRowClick:s,onRowContextMenu:l,sortField:c,sortOrder:d,onSort:u,actionsColumn:g,actionsColumnWidth:p=80,pageSize:m=25,pagination:f,hidePagination:b=false,className:h,rowClassName:S,enableHeaderContextMenu:E=true,lockedColumns:N=[],defaultColumnOrder:R,loading:x=false,emptyState:D}){let F=tr.useMemo(()=>{let C=[];return o&&C.push({key:"select",defaultWidth:40,minWidth:40}),t.forEach(V=>{C.push({key:V.id,defaultWidth:V.width?.default??150,minWidth:V.width?.min??80,maxWidth:V.width?.max});}),g&&C.push({key:"actions",defaultWidth:p,minWidth:60}),C},[t,o,g,p]),A=tr.useMemo(()=>t.map(C=>({id:C.id,label:typeof C.header=="string"?C.header:C.id,defaultVisible:C.visibility?.default??true,locked:C.visibility?.locked})),[t]),v=tr.useMemo(()=>{if(R)return R;let C=[];return o&&C.push("select"),t.forEach(V=>C.push(V.id)),g&&C.push("actions"),C},[R,t,o,g]),{getResizeHandleProps:H,getColumnStyle:_,getTableStyle:P}=Po({tableId:r,columns:F}),L=Mo({columns:A,storageKey:r}),{columnOrder:M,moveColumn:$}=Fo({storageKey:`${r}-order`,defaultOrder:v}),{dragState:j,getDragHandleProps:re,showDropIndicator:Q}=Bo(M,$,[...N,"select","actions"]),w=Do({data:e,pageSize:m,storageKey:r}),z=f||w,[te,T]=tr.useState(null),ye=tr.useCallback(C=>{E&&(C.preventDefault(),T({x:C.clientX,y:C.clientY}));},[E]);tr.useEffect(()=>{if(!te)return;let C=()=>T(null);return window.addEventListener("click",C),()=>{window.removeEventListener("click",C);}},[te]);let Ce=tr.useMemo(()=>!o||!a||z.paginatedData.length===0?false:z.paginatedData.every(C=>a.has(n(C))),[o,a,z.paginatedData,n]),et=tr.useMemo(()=>{if(!o||!a)return false;let C=z.paginatedData.filter(V=>a.has(n(V)));return C.length>0&&C.length<z.paginatedData.length},[o,a,z.paginatedData,n]),_e=tr.useCallback(C=>{if(!i||!a)return;let V=new Set(a);V.has(C)?V.delete(C):V.add(C),i(V);},[a,i]),Se=tr.useCallback(()=>{if(!i)return;let C=new Set(z.paginatedData.map(n));i(C);},[z.paginatedData,n,i]),st=tr.useCallback(()=>{i&&i(new Set);},[i]),ve=tr.useCallback(C=>c!==C?jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?jsxRuntime.jsx(lucideReact.ChevronUp,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-3.5 w-3.5"}),[c,d]),Oe=tr.useCallback(C=>t.find(V=>V.id===C),[t]),Ge=tr.useCallback(C=>{let V={columnId:C.id,isSorted:c===C.sortKey,sortDirection:c===C.sortKey?d:void 0};return typeof C.header=="function"?C.header(V):C.sortKey&&u?jsxRuntime.jsxs("button",{onClick:()=>u(C.sortKey),className:I("flex items-center gap-1 hover:text-foreground transition-colors",c===C.sortKey&&"text-primary font-medium"),children:[C.header,ve(C.sortKey)]}):C.header},[c,d,u,ve]);return jsxRuntime.jsx(Yo,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"overflow-auto border rounded-lg max-h-[calc(100vh-16rem)]",children:jsxRuntime.jsxs(Kn,{style:P(),className:I("resizable-table sticky-actions-table",h),children:[jsxRuntime.jsx(Xn,{className:"sticky top-0 z-20 bg-muted",children:jsxRuntime.jsxs(sr,{onContextMenu:ye,className:"border-t-0",children:[M.map(C=>{if(C==="select"&&o)return jsxRuntime.jsx($r,{className:"sticky-select-header w-10 sticky left-0 z-20 bg-muted relative after:absolute after:right-0 after:top-0 after:bottom-0 after:w-px after:bg-border",children:jsxRuntime.jsx("input",{type:"checkbox",checked:Ce,ref:J=>{J&&(J.indeterminate=et);},onChange:J=>J.target.checked?Se():st(),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary cursor-pointer",title:Ce?"Deselect all":"Select all visible"})},"select");let V=Oe(C);return !V||!L.isColumnVisible(C)?null:jsxRuntime.jsxs($r,{style:_(C),...re(C),className:I("cursor-grab relative",j.draggedId===C&&"column-dragging opacity-50",Q(C)&&"drop-indicator"),children:[Ge(V),jsxRuntime.jsx("div",{...H(C)})]},C)}),g&&jsxRuntime.jsx($r,{className:"sticky right-0 z-20 bg-muted text-center relative before:absolute before:left-0 before:top-0 before:bottom-0 before:w-px before:bg-border",style:{width:p,minWidth:p,maxWidth:p},children:"Actions"})]})}),jsxRuntime.jsx(Zn,{children:x?jsxRuntime.jsx(sr,{children:jsxRuntime.jsx(lr,{colSpan:M.length+(g?1:0),className:"!p-0 h-32",children:jsxRuntime.jsx("div",{className:"sticky left-0 w-screen max-w-full h-full bg-background flex justify-center items-center",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-5 w-5 animate-spin"}),"Loading..."]})})})}):z.paginatedData.length===0?null:z.paginatedData.map(C=>{let V=n(C),J=a?.has(V)??false;return jsxRuntime.jsxs(sr,{className:I("group cursor-pointer bg-background hover:bg-muted",J&&"bg-primary/5",S?.(C)),onClick:()=>s?.(C),onContextMenu:pe=>{l&&(pe.preventDefault(),l(C,{x:pe.clientX,y:pe.clientY}));},children:[M.map(pe=>{if(pe==="select"&&o)return jsxRuntime.jsx(lr,{className:I("sticky-select-cell w-10 sticky left-0 z-10 relative after:absolute after:right-0 after:top-0 after:bottom-0 after:w-px after:bg-border","bg-background group-hover:bg-muted",J&&"bg-primary/5 group-hover:bg-primary/10"),onClick:ze=>ze.stopPropagation(),children:jsxRuntime.jsx("input",{type:"checkbox",checked:J,onChange:()=>_e(V),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary cursor-pointer"})},"select");let Te=Oe(pe);if(!Te||!L.isColumnVisible(pe))return null;let hr={columnId:pe,isDragging:j.draggedId===pe};return jsxRuntime.jsx(lr,{style:_(pe),className:I(Te.className,j.draggedId===pe&&"column-dragging"),children:Te.cell(C,hr)},pe)}),g&&jsxRuntime.jsx(lr,{className:I("sticky right-0 z-10 text-center relative before:absolute before:left-0 before:top-0 before:bottom-0 before:w-px before:bg-border","bg-background group-hover:bg-muted",J&&"bg-primary/5 group-hover:bg-primary/10"),style:{width:p,minWidth:p,maxWidth:p},onClick:pe=>pe.stopPropagation(),children:g(C)})]},V)})})]})}),!x&&z.paginatedData.length===0&&jsxRuntime.jsx("div",{className:"empty-state-container flex-1 flex items-center justify-center bg-background",children:D||jsxRuntime.jsx("span",{className:"block text-center text-muted-foreground py-8",children:"No data"})}),!b&&!x&&z.totalPages>1&&jsxRuntime.jsx(zo,{page:z.page,pageSize:z.pageSize,totalItems:z.totalItems,totalPages:z.totalPages,startIndex:z.startIndex,endIndex:z.endIndex,canGoPrev:z.canGoPrev,canGoNext:z.canGoNext,onPageChange:z.setPage,onPageSizeChange:z.setPageSize,onNextPage:z.nextPage,onPrevPage:z.prevPage,onFirstPage:"firstPage"in z?z.firstPage:()=>z.setPage(1),onLastPage:"lastPage"in z?z.lastPage:()=>z.setPage(z.totalPages),pageSizeOptions:z.pageSizeOptions}),te&&jsxRuntime.jsxs("div",{className:"fixed z-50 min-w-[200px] overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",style:{top:te.y,left:te.x,maxHeight:`calc(100vh - ${te.y}px - 20px)`},onClick:C=>C.stopPropagation(),children:[jsxRuntime.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Toggle columns"}),jsxRuntime.jsx("div",{className:"h-px bg-border my-1"}),L.columns.map(C=>{let V=L.isColumnVisible(C.id),J=C.locked===true;return jsxRuntime.jsxs("button",{onClick:()=>!J&&L.toggleColumn(C.id),disabled:J,className:I("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent",J&&"opacity-50 cursor-not-allowed"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:V&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5 text-primary"})}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:C.label}),J&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Required"})]},C.id)}),jsxRuntime.jsx("div",{className:"h-px bg-border my-1"}),jsxRuntime.jsxs("button",{onClick:()=>L.showAllColumns(),className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent",children:[jsxRuntime.jsx(lucideReact.Eye,{className:"h-4 w-4"}),"Show All"]}),jsxRuntime.jsxs("button",{onClick:()=>L.hideAllColumns(),className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent",children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"h-4 w-4"}),"Hide Optional"]})]})]})})}function Ho({page:e,pageSize:t,totalPages:r,totalItems:n,startIndex:o,endIndex:a,canGoNext:i,canGoPrev:s,pageSizeOptions:l,setPage:c,setPageSize:d,nextPage:u,prevPage:g,className:p}){return n===0?null:jsxRuntime.jsxs("div",{className:I("flex items-center gap-3 text-sm",p),children:[jsxRuntime.jsxs("div",{className:"hidden md:flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground hidden lg:inline",children:"Rows:"}),jsxRuntime.jsxs(yt,{value:String(t),onValueChange:m=>d(Number(m)),children:[jsxRuntime.jsx(ct,{className:"w-16 h-8 text-xs",children:jsxRuntime.jsx(St,{})}),jsxRuntime.jsx(ut,{children:l.map(m=>jsxRuntime.jsx(Be,{value:String(m),children:m},m))})]})]}),r>1&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:g,disabled:!s,title:"Previous page",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsxs("span",{className:"hidden sm:inline px-2 text-muted-foreground tabular-nums min-w-[60px] text-center",children:[e," / ",r]}),jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:u,disabled:!i,title:"Next page",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})})]}),jsxRuntime.jsxs("span",{className:"text-muted-foreground whitespace-nowrap hidden lg:inline",children:["Showing ",o,"\u2013",a," of ",n]})]})}function Vf({title:e,description:t,search:r,onSearchChange:n,searchPlaceholder:o="Search...",filters:a,activeFilterCount:i=0,onClearFilters:s,pagination:l,actions:c,beforeTable:d,children:u,className:g,loading:p,loadingComponent:m}){let f=l&&l.totalItems>0;return jsxRuntime.jsxs("div",{className:I("flex flex-col h-full",g),children:[jsxRuntime.jsxs("div",{className:"data-table-page-header flex-shrink-0 space-y-4 pb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-3xl font-bold",children:e}),t&&jsxRuntime.jsx("p",{className:"text-muted-foreground",children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[n!==void 0&&jsxRuntime.jsxs("div",{className:"relative w-full sm:w-auto sm:min-w-[200px] sm:max-w-xs",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none z-10"}),jsxRuntime.jsx(ht,{placeholder:o,value:r||"",onChange:b=>n(b.target.value),className:"pl-9 h-9"}),r&&jsxRuntime.jsx("button",{type:"button",onClick:()=>n(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 p-1 rounded-sm hover:bg-muted",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3 text-muted-foreground"})})]}),a&&a.length>0&&jsxRuntime.jsxs(kr,{children:[jsxRuntime.jsx(Er,{asChild:true,children:jsxRuntime.jsxs(W,{variant:"outline",size:"sm",className:"gap-2 h-9",children:[jsxRuntime.jsx(lucideReact.Filter,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Filters"}),i>0&&jsxRuntime.jsx("span",{className:"rounded-full bg-primary text-primary-foreground px-2 py-0.5 text-xs font-medium",children:i})]})}),jsxRuntime.jsx(nr,{className:"w-80 overflow-y-auto",align:"start",collisionPadding:16,style:{maxHeight:"var(--radix-popover-content-available-height)"},children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:"Filters"}),i>0&&s&&jsxRuntime.jsx(W,{variant:"ghost",size:"sm",onClick:s,className:"h-auto p-0 text-xs text-destructive hover:text-destructive",children:"Clear all"})]}),jsxRuntime.jsx("div",{className:"space-y-3",children:a.map(b=>jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:b.label}),b.render()]},b.id))})]})})]}),i>0&&s&&jsxRuntime.jsxs(W,{variant:"ghost",size:"sm",onClick:s,className:"h-9 gap-1.5 text-muted-foreground hover:text-foreground",title:"Clear filters",children:[jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Clear"})]}),f&&jsxRuntime.jsx(Ho,{...l}),jsxRuntime.jsx("div",{className:"flex-1"}),c&&jsxRuntime.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:c})]})]}),d&&jsxRuntime.jsx("div",{className:"px-6 pb-2",children:d}),jsxRuntime.jsx("div",{className:"relative flex-1 min-h-0",children:jsxRuntime.jsx("div",{className:"data-table-scroll-container h-full",children:p?m||jsxRuntime.jsx("div",{className:"flex items-center justify-center h-full",children:jsxRuntime.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}):u})})]})}function Kf({selectedCount:e,onClear:t,children:r,itemLabel:n,className:o}){if(e===0)return null;let a=n??(e===1?"item":"items");return jsxRuntime.jsx(Ie,{className:I("p-3 bg-primary/5 border-primary/20",o),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"font-medium text-sm",role:"status","aria-live":"polite",children:[e," ",a," selected"]}),jsxRuntime.jsxs(W,{variant:"ghost",size:"sm",onClick:t,"aria-label":"Clear selection",children:[jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4 mr-1","aria-hidden":"true"}),"Clear"]})]}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",role:"group","aria-label":"Batch actions",children:r})]})})}function Xf({columns:e,isColumnVisible:t,toggleColumn:r,showAllColumns:n,hideAllColumns:o}){let a=e.filter(s=>t(s.id)).length,i=e.filter(s=>!s.locked);return jsxRuntime.jsxs(rb,{children:[jsxRuntime.jsx(nb,{asChild:true,children:jsxRuntime.jsxs(W,{variant:"outline",size:"sm",className:"gap-2",children:[jsxRuntime.jsx(lucideReact.Columns3,{className:"h-4 w-4"}),"Columns",jsxRuntime.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",a,"/",e.length,")"]})]})}),jsxRuntime.jsxs(Ls,{align:"end",className:"w-48",children:[jsxRuntime.jsx(Ds,{className:"font-normal text-xs text-muted-foreground",children:"Toggle columns"}),jsxRuntime.jsx(jo,{}),e.map(s=>{let l=t(s.id),c=s.locked===true;return jsxRuntime.jsxs(qn,{onClick:d=>{d.preventDefault(),c||r(s.id);},className:I("gap-2 cursor-pointer",c&&"opacity-50 cursor-not-allowed"),disabled:c,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:l?jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5 text-primary"}):jsxRuntime.jsx("div",{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("span",{className:"flex-1",children:s.label}),c&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Required"})]},s.id)}),i.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(jo,{}),jsxRuntime.jsxs(qn,{onClick:s=>{s.preventDefault(),n();},className:"gap-2 cursor-pointer",children:[jsxRuntime.jsx(lucideReact.Eye,{className:"h-4 w-4"}),"Show All"]}),jsxRuntime.jsxs(qn,{onClick:s=>{s.preventDefault(),o();},className:"gap-2 cursor-pointer",children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"h-4 w-4"}),"Hide Optional"]})]})]})]})}function Zf({search:e,onSearchChange:t,searchPlaceholder:r="Search...",filters:n,activeFilterCount:o=0,onClearFilters:a,className:i,children:s}){return jsxRuntime.jsxs("div",{className:I("flex items-center gap-3 flex-wrap",i),children:[t!==void 0&&jsxRuntime.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none z-10"}),jsxRuntime.jsx(ht,{placeholder:r,value:e||"",onChange:l=>t(l.target.value),className:"pl-9 h-9"}),e&&jsxRuntime.jsx("button",{type:"button",onClick:()=>t(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 p-1 rounded-sm hover:bg-muted",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3 text-muted-foreground"})})]}),n&&n.length>0&&jsxRuntime.jsxs(kr,{children:[jsxRuntime.jsx(Er,{asChild:true,children:jsxRuntime.jsxs(W,{variant:"outline",size:"sm",className:"gap-2 h-9",children:[jsxRuntime.jsx(lucideReact.Filter,{className:"h-4 w-4"}),"Filters",o>0&&jsxRuntime.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-2 py-0.5 text-xs font-medium",children:o})]})}),jsxRuntime.jsx(nr,{className:"w-80 overflow-y-auto",align:"start",collisionPadding:16,style:{maxHeight:"var(--radix-popover-content-available-height)"},children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:"Filters"}),o>0&&a&&jsxRuntime.jsx(W,{variant:"ghost",size:"sm",onClick:a,className:"h-auto p-0 text-xs text-destructive hover:text-destructive",children:"Clear all"})]}),jsxRuntime.jsx("div",{className:"space-y-3",children:n.map(l=>jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l.label}),l.render()]},l.id))})]})})]}),o>0&&a&&jsxRuntime.jsxs(W,{variant:"ghost",size:"sm",onClick:a,className:"h-9 gap-1.5 text-muted-foreground hover:text-foreground",children:[jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"}),"Clear"]}),jsxRuntime.jsx("div",{className:"flex-1"}),s]})}/*! Bundled license information:
54
+ `)};if(H===0){var L=d.slice(g+1,p).concat(ai({children:[P],className:x.properties.className})),M=b(L,_);u.push(M);}else if(H===A.length-1){var $=d[p+1]&&d[p+1].children&&d[p+1].children[0],j={type:"text",value:"".concat(v)};if($){var re=ai({children:[j],className:x.properties.className});d.splice(p+1,0,re);}else {var Q=[j],w=b(Q,_,x.properties.className);u.push(w);}}else {var z=[P],te=b(z,_,x.properties.className);u.push(te);}}),g=p;}p++;};p<d.length;)h();if(g!==d.length-1){var S=d.slice(g+1,d.length);if(S&&S.length){var E=n&&u.length+a,N=b(S,E);u.push(N);}}return t?u:(c=[]).concat.apply(c,u)}function l4(e){var t=e.rows,r=e.stylesheet,n=e.useInlineStyles;return t.map(function(o,a){return oi({node:o,stylesheet:r,useInlineStyles:n,key:"code-segment-".concat(a)})})}function rk(e){return e&&typeof e.highlightAuto<"u"}function c4(e){var t=e.astGenerator,r=e.language,n=e.code,o=e.defaultCodeValue;if(rk(t)){var a=ZS(t,r);return r==="text"?{value:o,language:"text"}:a?t.highlight(r,n):t.highlightAuto(n)}try{return r&&r!=="text"?{value:t.highlight(n,r)}:{value:o}}catch{return {value:o}}}function nk(e,t){return function(n){var o,a,i=n.language,s=n.children,l=n.style,c=l===void 0?t:l,d=n.customStyle,u=d===void 0?{}:d,g=n.codeTagProps,p=g===void 0?{className:i?"language-".concat(i):void 0,style:Or(Or({},c['code[class*="language-"]']),c['code[class*="language-'.concat(i,'"]')])}:g,m=n.useInlineStyles,f=m===void 0?true:m,b=n.showLineNumbers,h=b===void 0?false:b,S=n.showInlineLineNumbers,E=S===void 0?true:S,N=n.startingLineNumber,R=N===void 0?1:N,x=n.lineNumberContainerStyle,D=n.lineNumberStyle,F=D===void 0?{}:D,A=n.wrapLines,v=n.wrapLongLines,H=v===void 0?false:v,_=n.lineProps,P=_===void 0?{}:_,L=n.renderer,M=n.PreTag,$=M===void 0?"pre":M,j=n.CodeTag,re=j===void 0?"code":j,Q=n.code,w=Q===void 0?(Array.isArray(s)?s[0]:s)||"":Q,z=n.astGenerator,te=GS(n,t4);z=z||e;var T=h?tr__namespace.default.createElement(a4,{containerStyle:x,codeStyle:p.style||{},numberStyle:F,startingLineNumber:R,codeString:w}):null,ye=c.hljs||c['pre[class*="language-"]']||{backgroundColor:"#fff"},Ce=rk(z)?"hljs":"prismjs",et=f?Object.assign({},te,{style:Object.assign({},ye,u)}):Object.assign({},te,{className:te.className?"".concat(Ce," ").concat(te.className):Ce,style:Object.assign({},u)});if(H?p.style=Or({whiteSpace:"pre-wrap"},p.style):p.style=Or({whiteSpace:"pre"},p.style),!z)return tr__namespace.default.createElement($,et,T,tr__namespace.default.createElement(re,p,w));(A===void 0&&L||H)&&(A=true),L=L||l4;var _e=[{type:"text",value:w}],Se=c4({astGenerator:z,language:i,code:w,defaultCodeValue:_e});Se.language===null&&(Se.value=_e);var st=(o=(a=w.match(/\n/g))===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0,ve=R+st,Oe=s4(Se,A,P,h,E,R,ve,F,H);return tr__namespace.default.createElement($,et,tr__namespace.default.createElement(re,p,!E&&T,L({rows:Oe,stylesheet:c,useInlineStyles:f})))}}var ok=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","bash","basic","batch","bbcode","bicep","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","clike","clojure","cmake","cobol","coffeescript","concurnas","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gherkin","git","glsl","gml","gn","go-module","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","matlab","maxscript","mel","mermaid","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","squirrel","stan","stylus","swift","systemd","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tremor","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","uorazor","uri","v","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","web-idl","wiki","wolfram","wren","xeora","xml-doc","xojo","xquery","yaml","yang","zig"];var qE={'code[class*="language-"]':{color:"black",background:"none",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"black",background:"#f5f2f0",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto"},'pre[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},':not(pre) > code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};var OI=$o(_I());var LI=nk(OI.default,qE);LI.supportedLanguages=ok;var _o=LI;var A_=$o(T_());function vf({content:e,className:t,showCopyButton:r=true}){let[n,o]=tr.useState(null),a=s=>{navigator.clipboard.writeText(s),o(s),setTimeout(()=>o(null),2e3);},i=tr.useMemo(()=>({code({node:s,inline:l,className:c,children:d,...u}){let g=/language-(\w+)/.exec(c||""),p=String(d).replace(/\n$/,"");return !l&&g?jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsx(_o,{style:A_.oneDark,language:g[1],PreTag:"div",className:"!rounded-md !my-4",...u,children:p}),r&&jsxRuntime.jsx(W,{size:"sm",variant:"ghost",className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>a(p),children:n===p?jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Copy,{className:"h-4 w-4"})})]}):jsxRuntime.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-sm font-mono",...u,children:d})},pre({children:s}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:s})},h1:({children:s})=>jsxRuntime.jsx("h1",{className:"text-2xl font-bold mt-6 mb-4",children:s}),h2:({children:s})=>jsxRuntime.jsx("h2",{className:"text-xl font-semibold mt-5 mb-3",children:s}),h3:({children:s})=>jsxRuntime.jsx("h3",{className:"text-lg font-semibold mt-4 mb-2",children:s}),p:({children:s})=>jsxRuntime.jsx("p",{className:"mb-4 leading-relaxed",children:s}),ul:({children:s})=>jsxRuntime.jsx("ul",{className:"list-disc list-inside mb-4 space-y-1",children:s}),ol:({children:s})=>jsxRuntime.jsx("ol",{className:"list-decimal list-inside mb-4 space-y-1",children:s}),blockquote:({children:s})=>jsxRuntime.jsx("blockquote",{className:"border-l-4 border-muted-foreground/30 pl-4 my-4 italic",children:s}),a:({href:s,children:l})=>jsxRuntime.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:l}),table:({children:s})=>jsxRuntime.jsx("div",{className:"overflow-x-auto my-4",children:jsxRuntime.jsx("table",{className:"min-w-full divide-y divide-border",children:s})}),th:({children:s})=>jsxRuntime.jsx("th",{className:"px-4 py-2 text-left font-medium",children:s}),td:({children:s})=>jsxRuntime.jsx("td",{className:"px-4 py-2 border-t",children:s})}),[n,r]);return jsxRuntime.jsx("div",{className:he("prose prose-sm dark:prose-invert max-w-none",t),children:jsxRuntime.jsx(nc,{remarkPlugins:[ei],components:i,children:e})})}function tz({content:e,className:t,title:r,...n}){return jsxRuntime.jsxs(Ie,{className:he("p-6",t),children:[r&&jsxRuntime.jsx("h2",{className:"text-xl font-semibold mb-4",children:r}),jsxRuntime.jsx(vf,{content:e,...n})]})}function rz({content:e,className:t,height:r="400px",...n}){return jsxRuntime.jsx(Bs,{className:he("w-full",t),style:{height:r},children:jsxRuntime.jsx("div",{className:"pr-4",children:jsxRuntime.jsx(vf,{content:e,...n})})})}function lz({children:e,className:t,maxWidth:r,tooltipSide:n="top"}){let o=tr.useRef(null),[a,i]=tr.useState(false),s=tr.useCallback(()=>{o.current&&i(o.current.scrollWidth>o.current.clientWidth);},[]);tr.useEffect(()=>{let c=o.current;if(!c)return;s();let d=new ResizeObserver(()=>{requestAnimationFrame(s);});return d.observe(c),()=>{d.disconnect();}},[s,e]);let l=r?{maxWidth:r}:void 0;return jsxRuntime.jsxs(Ko,{children:[jsxRuntime.jsx(Xo,{asChild:true,disabled:!a,children:jsxRuntime.jsx("span",{ref:o,className:I("truncate block",a&&"cursor-help",t),style:l,children:e})}),a&&jsxRuntime.jsx(Qn,{side:n,className:"max-w-md break-words",children:e})]})}var mr=[{hex:"#3b82f6",name:"Blue"},{hex:"#6366f1",name:"Indigo"},{hex:"#8b5cf6",name:"Violet"},{hex:"#a855f7",name:"Purple"},{hex:"#d946ef",name:"Fuchsia"},{hex:"#ec4899",name:"Pink"},{hex:"#f43f5e",name:"Rose"},{hex:"#ef4444",name:"Red"},{hex:"#f97316",name:"Orange"},{hex:"#f59e0b",name:"Amber"},{hex:"#eab308",name:"Yellow"},{hex:"#84cc16",name:"Lime"},{hex:"#22c55e",name:"Green"},{hex:"#10b981",name:"Emerald"},{hex:"#14b8a6",name:"Teal"},{hex:"#06b6d4",name:"Cyan"},{hex:"#0ea5e9",name:"Sky"},{hex:"#64748b",name:"Slate"},{hex:"#78716c",name:"Stone"},{hex:"#737373",name:"Gray"}];function dz({value:e,onChange:t,columns:r=10,className:n}){return jsxRuntime.jsx("div",{className:I("flex flex-wrap gap-1.5",n),style:{maxWidth:r*28+(r-1)*6},children:mr.map(o=>{let a=e.toLowerCase()===o.hex.toLowerCase();return jsxRuntime.jsx("button",{type:"button",onClick:()=>t(o.hex),className:I("w-6 h-6 rounded-md transition-all focus:outline-none flex items-center justify-center","hover:brightness-110",a&&"ring-2 ring-foreground/70"),style:{backgroundColor:o.hex},title:o.name,children:a&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5 text-white drop-shadow-[0_1px_1px_rgba(0,0,0,0.5)]"})},o.hex)})})}function pz(){let e=Math.floor(Math.random()*mr.length);return mr[e].hex}function gz(e){let r=(mr.findIndex(n=>n.hex===e)+1)%mr.length;return mr[r].hex}function mz(e){let t=new Set(e.map(n=>n.toLowerCase()));for(let n of mr)if(!t.has(n.hex.toLowerCase()))return n.hex;let r=mr.map(n=>({hex:n.hex,count:e.filter(o=>o.toLowerCase()===n.hex.toLowerCase()).length}));return r.sort((n,o)=>n.count-o.count),r[0].hex}var kz={default:{icon:lucideReact.Info,iconColor:"text-blue-600",iconBg:"bg-blue-50 border-blue-100"},success:{icon:lucideReact.Play,iconColor:"text-emerald-600",iconBg:"bg-emerald-50 border-emerald-100"},warning:{icon:lucideReact.Pause,iconColor:"text-amber-600",iconBg:"bg-amber-50 border-amber-100"},destructive:{icon:lucideReact.Trash2,iconColor:"text-red-600",iconBg:"bg-red-50 border-red-100"}};function N_({open:e,onOpenChange:t,title:r,description:n,confirmLabel:o="Confirm",cancelLabel:a="Cancel",variant:i="default",icon:s,onConfirm:l,onCancel:c,loading:d=false}){let u=kz[i],g=s||u.icon,p=()=>{c?.(),t(false);},m=()=>{l(),d||t(false);};return jsxRuntime.jsx(hn,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(Ur,{className:"sm:max-w-[380px] p-0 gap-0 overflow-hidden",children:[jsxRuntime.jsx("div",{className:"px-5 pt-5 pb-4",children:jsxRuntime.jsxs(Hr,{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(g,{className:I("h-5 w-5 flex-shrink-0",u.iconColor)}),jsxRuntime.jsx(Gr,{className:"text-base font-semibold",children:r})]}),jsxRuntime.jsx($n,{className:"text-sm text-muted-foreground leading-relaxed pl-8",children:n})]})}),jsxRuntime.jsxs("div",{className:"flex border-t border-border",children:[jsxRuntime.jsx("button",{type:"button",onClick:p,disabled:d,className:"flex-1 px-4 py-2.5 text-sm font-medium text-muted-foreground hover:bg-muted/50 transition-colors disabled:opacity-50 border-r border-border",children:a}),jsxRuntime.jsx("button",{type:"button",onClick:m,disabled:d,className:I("flex-1 px-4 py-2.5 text-sm font-medium transition-colors disabled:opacity-50",i==="destructive"?"text-red-600 hover:bg-red-50":i==="success"?"text-emerald-600 hover:bg-emerald-50":i==="warning"?"text-amber-600 hover:bg-amber-50":"text-primary hover:bg-muted/50"),children:d?"Processing...":o})]})]})})}function Ez(){let[e,t]=tr.useState({open:false,title:"",description:"",onConfirm:()=>{}}),r=o=>new Promise(a=>{t({...o,open:true,onConfirm:()=>{a(true),t(i=>({...i,open:false}));}});}),n={...e,onOpenChange:o=>{o||t(a=>({...a,open:false}));},onCancel:()=>{t(o=>({...o,open:false}));}};return {confirm:r,dialogProps:n,ConfirmDialog:N_}}function Cz({open:e,onOpenChange:t,title:r,children:n,footer:o,defaultWidth:a=800,defaultHeight:i=600,minWidth:s=400,minHeight:l=300,className:c,onFullscreenChange:d}){let[u,g]=tr.useState(false),[p,m]=tr.useState({x:0,y:0}),[f,b]=tr.useState(()=>({width:Math.min(a,typeof window<"u"?window.innerWidth-32:a),height:Math.min(i,typeof window<"u"?window.innerHeight-32:i)})),[h,S]=tr.useState(false),E=tr.useRef(null),N=tr.useRef({type:null,direction:null,startMouseX:0,startMouseY:0,startPosX:0,startPosY:0,startWidth:0,startHeight:0});tr.useEffect(()=>{if(e&&!u){let A=Math.min(a,window.innerWidth-32),v=Math.min(i,window.innerHeight-32);b({width:A,height:v});let H=(window.innerWidth-A)/2,_=(window.innerHeight-v)/2;m({x:H,y:Math.max(16,_)});}},[e,u,a,i]);let R=tr.useCallback(A=>{u||!E.current||(A.preventDefault(),N.current={type:"drag",direction:null,startMouseX:A.clientX,startMouseY:A.clientY,startPosX:p.x,startPosY:p.y,startWidth:f.width,startHeight:f.height},S(true),document.body.style.cursor="grabbing",document.body.style.userSelect="none");},[u,p,f]),x=tr.useCallback((A,v)=>{u||!E.current||(A.preventDefault(),A.stopPropagation(),N.current={type:"resize",direction:v,startMouseX:A.clientX,startMouseY:A.clientY,startPosX:p.x,startPosY:p.y,startWidth:f.width,startHeight:f.height},S(true),document.body.style.userSelect="none");},[u,p,f]);tr.useEffect(()=>{if(!h)return;let A=H=>{let _=N.current,P=E.current;if(!_.type||!P)return;let L=H.clientX-_.startMouseX,M=H.clientY-_.startMouseY;if(_.type==="drag"){let $=_.startPosX+L,j=Math.max(0,_.startPosY+M);P.style.left=`${$}px`,P.style.top=`${j}px`;}else if(_.type==="resize"&&_.direction){let $=_.startWidth,j=_.startHeight,re=_.startPosX,Q=_.startPosY;if(_.direction.includes("e")&&($=Math.max(s,_.startWidth+L)),_.direction.includes("w")){let w=Math.min(L,_.startWidth-s);$=_.startWidth-w,re=_.startPosX+w;}if(_.direction.includes("s")&&(j=Math.max(l,_.startHeight+M)),_.direction.includes("n")){let w=Math.min(M,_.startHeight-l);j=_.startHeight-w,Q=Math.max(0,_.startPosY+w);}P.style.width=`${$}px`,P.style.height=`${j}px`,P.style.left=`${re}px`,P.style.top=`${Q}px`;}},v=()=>{let H=N.current,_=E.current;if(_&&H.type){let P=_.getBoundingClientRect();m({x:P.left,y:P.top}),b({width:P.width,height:P.height});}N.current.type=null,N.current.direction=null,S(false),document.body.style.cursor="",document.body.style.userSelect="";};return document.addEventListener("mousemove",A),document.addEventListener("mouseup",v),()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",v);}},[h,s,l]);let D=tr.useCallback(()=>{g(A=>{let v=!A;return d?.(v),v});},[d]),F=tr.useMemo(()=>u?{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",maxWidth:"100vw",maxHeight:"100vh",borderRadius:0,transform:"none"}:{position:"fixed",top:p.y,left:p.x,width:f.width,height:f.height,maxWidth:"none",maxHeight:"none",transform:"none",willChange:h?"left, top, width, height":"auto"},[u,p.x,p.y,f.width,f.height,h]);return jsxRuntime.jsx(hn,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(Ur,{ref:E,style:F,hideCloseButton:true,className:I("flex flex-col p-0 gap-0",h&&"transition-none duration-0 [&_*]:transition-none",u?"rounded-none":"rounded-lg",c),children:[jsxRuntime.jsxs("div",{className:I("flex items-center gap-2 px-4 py-3 border-b bg-muted/30 flex-shrink-0",!u&&"cursor-grab active:cursor-grabbing"),onMouseDown:R,children:[!u&&jsxRuntime.jsx(lucideReact.GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),jsxRuntime.jsx("div",{className:"flex-1 min-w-0",children:r&&jsxRuntime.jsx(Hr,{className:"p-0 space-y-0",children:jsxRuntime.jsx(Gr,{className:"text-base font-semibold leading-tight truncate",children:r})})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[jsxRuntime.jsx(W,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:D,children:u?jsxRuntime.jsx(lucideReact.Minimize2,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Maximize2,{className:"h-4 w-4"})}),jsxRuntime.jsx(W,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>t(false),children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:typeof n=="function"?n({isFullscreen:u}):n}),o&&jsxRuntime.jsx(Gn,{className:"px-4 py-3 border-t bg-muted/30 flex-shrink-0",children:o}),!u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"absolute top-0 left-2 right-2 h-1 cursor-n-resize",onMouseDown:A=>x(A,"n")}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-2 right-2 h-1 cursor-s-resize",onMouseDown:A=>x(A,"s")}),jsxRuntime.jsx("div",{className:"absolute left-0 top-2 bottom-2 w-1 cursor-w-resize",onMouseDown:A=>x(A,"w")}),jsxRuntime.jsx("div",{className:"absolute right-0 top-2 bottom-2 w-1 cursor-e-resize",onMouseDown:A=>x(A,"e")}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 w-3 h-3 cursor-nw-resize",onMouseDown:A=>x(A,"nw")}),jsxRuntime.jsx("div",{className:"absolute top-0 right-0 w-3 h-3 cursor-ne-resize",onMouseDown:A=>x(A,"ne")}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 w-3 h-3 cursor-sw-resize",onMouseDown:A=>x(A,"sw")}),jsxRuntime.jsx("div",{className:"absolute bottom-0 right-0 w-3 h-3 cursor-se-resize",onMouseDown:A=>x(A,"se")})]})]})})}function __({position:e,onClose:t,children:r,className:n}){let o=tr.useRef(null),[a,i]=tr.useState(e);tr.useLayoutEffect(()=>{if(!o.current)return;let c=o.current.getBoundingClientRect(),d=window.innerWidth,u=window.innerHeight,g=8,p=e.x,m=e.y;e.x+c.width>d-g&&(p=Math.max(g,d-c.width-g)),e.y+c.height>u-g&&(m=Math.max(g,u-c.height-g)),p<g&&(p=g),m<g&&(m=g),(p!==e.x||m!==e.y)&&i({x:p,y:m});},[e]),tr.useEffect(()=>{let l=()=>t(),c=()=>t();return document.addEventListener("click",l),document.addEventListener("scroll",c,true),()=>{document.removeEventListener("click",l),document.removeEventListener("scroll",c,true);}},[t]);let s=tr.useCallback(l=>{l.stopPropagation();},[]);return jsxRuntime.jsx("div",{ref:o,role:"menu","aria-label":"Context menu",className:I("fixed z-50 min-w-[180px] rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",n),style:{top:a.y,left:a.x},onClick:s,children:r})}var Mz={default:"hover:bg-accent hover:text-accent-foreground",success:"text-green-600 hover:bg-green-50 hover:text-green-700:bg-green-950",warning:"text-amber-600 hover:bg-amber-50 hover:text-amber-700:bg-amber-950",destructive:"text-destructive hover:bg-destructive hover:text-destructive-foreground",purple:"text-purple-600 hover:bg-purple-50 hover:text-purple-700:bg-purple-950"};function O_({onClick:e,onMouseEnter:t,icon:r,children:n,variant:o="default",disabled:a=false,className:i}){return jsxRuntime.jsxs("button",{role:"menuitem",onClick:e,onMouseEnter:t,disabled:a,"aria-disabled":a,className:I("relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",Mz[o],a&&"opacity-50 cursor-not-allowed",i),children:[r&&jsxRuntime.jsx("span",{className:"mr-2 h-4 w-4 flex items-center justify-center","aria-hidden":"true",children:r}),n]})}function L_(){return jsxRuntime.jsx("div",{role:"separator",className:"h-px bg-border my-1"})}function M_({label:e,icon:t,children:r,onOpen:n,isOpen:o,onOpenChange:a,className:i}){let[s,l]=tr.useState(false),c=o!==void 0,d=c?o:s,u=()=>{c?a?.(true):l(true),n?.();},g=()=>{c?a?.(false):l(false);};return jsxRuntime.jsxs("div",{className:I("relative",i),onMouseEnter:u,onMouseLeave:g,children:[jsxRuntime.jsxs("button",{role:"menuitem","aria-haspopup":"menu","aria-expanded":d,className:"relative flex w-full cursor-pointer select-none items-center justify-between rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground",children:[jsxRuntime.jsxs("span",{className:"flex items-center",children:[t&&jsxRuntime.jsx("span",{className:"mr-2 h-4 w-4 flex items-center justify-center","aria-hidden":"true",children:t}),e]}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4","aria-hidden":"true"})]}),d&&jsxRuntime.jsx("div",{role:"menu","aria-label":`${e} submenu`,className:"absolute left-full top-0 ml-1 min-w-[160px] max-h-[300px] overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md",children:r})]})}var If={'code[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"]::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},prolog:{color:"hsl(220, 10%, 40%)"},cdata:{color:"hsl(220, 10%, 40%)"},doctype:{color:"hsl(220, 14%, 71%)"},punctuation:{color:"hsl(220, 14%, 71%)"},entity:{color:"hsl(220, 14%, 71%)",cursor:"help"},"attr-name":{color:"hsl(29, 54%, 61%)"},"class-name":{color:"hsl(29, 54%, 61%)"},boolean:{color:"hsl(29, 54%, 61%)"},constant:{color:"hsl(29, 54%, 61%)"},number:{color:"hsl(29, 54%, 61%)"},atrule:{color:"hsl(29, 54%, 61%)"},keyword:{color:"hsl(286, 60%, 67%)"},property:{color:"hsl(355, 65%, 65%)"},tag:{color:"hsl(355, 65%, 65%)"},symbol:{color:"hsl(355, 65%, 65%)"},deleted:{color:"hsl(355, 65%, 65%)"},important:{color:"hsl(355, 65%, 65%)"},selector:{color:"hsl(95, 38%, 62%)"},string:{color:"hsl(95, 38%, 62%)"},char:{color:"hsl(95, 38%, 62%)"},builtin:{color:"hsl(95, 38%, 62%)"},inserted:{color:"hsl(95, 38%, 62%)"},regex:{color:"hsl(95, 38%, 62%)"},"attr-value":{color:"hsl(95, 38%, 62%)"},"attr-value > .token.punctuation":{color:"hsl(95, 38%, 62%)"},variable:{color:"hsl(207, 82%, 66%)"},operator:{color:"hsl(207, 82%, 66%)"},function:{color:"hsl(207, 82%, 66%)"},url:{color:"hsl(187, 47%, 55%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(220, 14%, 71%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(220, 14%, 71%)"},".language-css .token.selector":{color:"hsl(355, 65%, 65%)"},".language-css .token.property":{color:"hsl(220, 14%, 71%)"},".language-css .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.string.url":{color:"hsl(95, 38%, 62%)"},".language-css .token.important":{color:"hsl(286, 60%, 67%)"},".language-css .token.atrule .token.rule":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.operator":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(5, 48%, 51%)"},".language-json .token.operator":{color:"hsl(220, 14%, 71%)"},".language-json .token.null.keyword":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.url":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.operator":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.content":{color:"hsl(207, 82%, 66%)"},".language-markdown .token.url > .token.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.url-reference.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(95, 38%, 62%)"},".language-markdown .token.bold .token.content":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.italic .token.content":{color:"hsl(286, 60%, 67%)"},".language-markdown .token.strike .token.content":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.list.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(355, 65%, 65%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.cr:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.lf:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.space:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},".line-highlight.line-highlight":{background:"hsla(220, 100%, 80%, 0.04)"},".line-highlight.line-highlight:before":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(220, 100%, 80%, 0.04)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".command-line .command-line-prompt":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(220, 14%, 45%)"},".command-line .command-line-prompt > span:before":{color:"hsl(220, 14%, 45%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(286, 60%, 67%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(224, 13%, 17%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(224, 13%, 17%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(224, 13%, 17%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(224, 13%, 17%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(219, 13%, 22%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(220, 14%, 71%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(220, 14%, 71%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(220, 14%, 71%)"}};var _f={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}};function Uz(e){let t=e.split(".").pop()?.toLowerCase()||"";return {ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",cs:"csharp",cpp:"cpp",c:"c",h:"c",hpp:"cpp",php:"php",html:"html",css:"css",scss:"scss",less:"less",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",md:"markdown",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",dockerfile:"docker",makefile:"makefile"}[t]||"text"}function Hz(){return typeof window>"u"?false:document.documentElement.classList.contains("dark")}function B_({code:e,language:t,filename:r,lineStart:n=1,highlightLines:o=[],className:a,showLineNumbers:i=true,showFilename:s=true,autoScrollToHighlight:l=true}){let c=Hz(),d=t||(r?Uz(r):"text"),u=tr.useRef(null),g=tr.useRef(false),p=new Set(o),m=tr.useCallback(()=>{if(!l||o.length===0||!u.current||g.current)return;let b=Math.min(...o)-n,h=u.current,S=h.querySelector("pre");if(!S)return;let E=S.querySelector("code");if(!E)return;let N=E.children;if(b>=0&&b<N.length){let R=N[b];if(R){let x=R.offsetHeight,D=R.offsetTop-x*3;h.scrollTop=Math.max(0,D),g.current=true;}}},[l,o,n]);return tr.useEffect(()=>{g.current=false;},[e,o.join(",")]),tr.useEffect(()=>{let f=setTimeout(m,100);return ()=>clearTimeout(f)},[m,e]),jsxRuntime.jsxs("div",{className:I("rounded-lg border flex flex-col",a),children:[r&&s&&jsxRuntime.jsxs("div",{className:"px-3 py-2 bg-muted/50 border-b text-xs font-mono text-muted-foreground flex items-center gap-2 flex-shrink-0",children:[jsxRuntime.jsx("span",{className:"truncate",children:r}),n>1&&jsxRuntime.jsxs("span",{className:"text-muted-foreground/60",children:["starting at line ",n]})]}),jsxRuntime.jsx("div",{ref:u,className:"flex-1 overflow-auto",children:jsxRuntime.jsx(_o,{language:d,style:c?If:_f,showLineNumbers:i,startingLineNumber:n,wrapLines:true,lineProps:f=>{let b={display:"block",width:"100%"};return p.has(f)&&(b.backgroundColor=c?"rgba(255, 255, 0, 0.1)":"rgba(255, 255, 0, 0.2)",b.borderLeft="3px solid #f59e0b",b.paddingLeft="0.5rem",b.marginLeft="-0.5rem"),{style:b}},customStyle:{margin:0,padding:"1rem",fontSize:"0.8125rem",lineHeight:"1.5",backgroundColor:c?"#1e1e1e":"#fafafa"},codeTagProps:{style:{fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'}},children:e})})]})}function Gz({code:e,language:t,filename:r,className:n}){return jsxRuntime.jsx(B_,{code:e,language:t,filename:r,showLineNumbers:false,className:I("text-sm",n)})}function kle(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/1e3);if(isNaN(n))return "Unknown";if(n<0)return "In the future";if(n<10)return "Just now";if(n<60)return `${n} seconds ago`;let o=Math.floor(n/60);if(o===1)return "1 minute ago";if(o<60)return `${o} minutes ago`;let a=Math.floor(o/60);if(a===1)return "1 hour ago";if(a<24)return `${a} hours ago`;let i=Math.floor(a/24);if(i===1)return "1 day ago";if(i<7)return `${i} days ago`;let s=Math.floor(i/7);if(s===1)return "1 week ago";if(s<4)return `${s} weeks ago`;let l=Math.floor(i/30);if(l===1)return "1 month ago";if(l<12)return `${l} months ago`;let c=Math.floor(i/365);return c===1?"1 year ago":`${c} years ago`}function Ele(e,t={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}){try{let r=new Date(e);return isNaN(r.getTime())?"Invalid date":r.toLocaleString(void 0,t)}catch{return "Invalid date"}}function wle(e){if(e<60)return `${Math.floor(e)}s`;let t=Math.floor(e/60);if(t<60)return `${t}m`;let r=Math.floor(t/60),n=t%60;if(r<24)return n>0?`${r}h ${n}m`:`${r}h`;let o=Math.floor(r/24),a=r%24;return a>0?`${o}d ${a}h`:`${o}d`}function xle(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/1e3);if(isNaN(n)||n<0)return "--";if(n<60)return `${n}s`;let o=Math.floor(n/60);if(o<60)return `${o}m`;let a=Math.floor(o/60);if(a<24)return `${a}h`;let i=Math.floor(a/24);return i<365?`${i}d`:`${Math.floor(i/365)}y`}function Tle(e){if(e===0)return "0 B";let t=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(1024));return `${(e/Math.pow(1024,r)).toFixed(2)} ${t[r]}`}function Ale(e){if(e<1e3)return String(e);if(e<1e6){let r=e/1e3;return `${Number.isInteger(r)?r:r.toFixed(1).replace(/\.0$/,"")}K`}let t=e/1e6;return `${Number.isInteger(t)?t:t.toFixed(1).replace(/\.0$/,"")}M`}function Cle(e){let t=Math.floor(e/1e3),r=Math.floor(t/60),n=Math.floor(r/60);return n>0?`${n}h ${r%60}m`:r>0?`${r}m ${t%60}s`:`${t}s`}var z_=[{bg:"bg-blue-100",text:"text-blue-800",border:"border-blue-300"},{bg:"bg-green-100",text:"text-green-800",border:"border-green-300"},{bg:"bg-yellow-100",text:"text-yellow-800",border:"border-yellow-300"},{bg:"bg-purple-100",text:"text-purple-800",border:"border-purple-300"},{bg:"bg-pink-100",text:"text-pink-800",border:"border-pink-300"},{bg:"bg-indigo-100",text:"text-indigo-800",border:"border-indigo-300"},{bg:"bg-red-100",text:"text-red-800",border:"border-red-300"},{bg:"bg-orange-100",text:"text-orange-800",border:"border-orange-300"},{bg:"bg-teal-100",text:"text-teal-800",border:"border-teal-300"},{bg:"bg-cyan-100",text:"text-cyan-800",border:"border-cyan-300"}];function $z(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t;}return Math.abs(t)}function qz(e){let t=$z(e)%z_.length;return z_[t]}function Rle(e){let t=qz(e);return t?`${t.bg} ${t.text} ${t.border} border`:"bg-gray-100 text-gray-700 border-gray-300 border"}function Wz(e,t){let r=new Date,n=new Date(e),o=Math.floor((r.getTime()-n.getTime())/1e3);if(o<60)return t?.justNow?"just now":`${o}s ago`;let a=Math.floor(o/60);if(a<60)return `${a}m ago`;let i=Math.floor(a/60);if(i<24)return `${i}h ago`;let s=Math.floor(i/24);if(s<30)return `${s}d ago`;let l=Math.floor(s/30);return l<12?`${l}mo ago`:`${Math.floor(l/12)}y ago`}function _le(e){return Wz(e,{justNow:true})}async function Lf(e,t=5e3){try{let r=new AbortController,n=setTimeout(()=>r.abort(),t),o=await fetch(`${e}/api/health`,{signal:r.signal,method:"GET",headers:{Accept:"application/json"}});return clearTimeout(n),o.ok?(await o.json(),{ready:!0}):{ready:!1,error:`Server returned ${o.status}: ${o.statusText}`,retryAfter:2e3}}catch(r){return r.name==="AbortError"?{ready:false,error:"Request timeout",retryAfter:3e3}:r.code==="ECONNREFUSED"||r.message.includes("fetch")?{ready:false,error:"Server not ready",retryAfter:2e3}:{ready:false,error:r.message,retryAfter:5e3}}}async function U_(e,t={}){let{maxAttempts:r=10,initialDelay:n=1e3,maxDelay:o=1e4,timeout:a=5e3}=t,i=0,s=n;for(;i<r;){i++,console.log(`\u{1F50D} Checking API readiness (attempt ${i}/${r})...`);let l=await Lf(e,a);if(l.ready)return console.log("\u2705 API is ready!"),true;console.log(`\u23F3 API not ready: ${l.error}. Retrying in ${s}ms...`),i<r&&(await new Promise(c=>setTimeout(c,s)),s=Math.min(s*2,o));}return console.error("\u274C API failed to become ready after all attempts"),false}async function jz(e,t,r={}){let n=await Lf(e);if(!n.ready)throw new Error(`API not ready: ${n.error}`);let o=t.startsWith("http")?t:`${e}${t}`,a=await fetch(o,{...r,headers:{"Content-Type":"application/json",...r.headers}});if(!a.ok)throw new Error(`API request failed: ${a.status} ${a.statusText}`);return a.json()}function Vz(e,t={}){if(typeof window>"u")return {ready:true,error:null,checking:false};let[r,n]=window.React?.useState?.({ready:false,error:null,checking:true})||{ready:false,error:null,checking:true};return window.React?.useEffect?.(()=>{let o=true;async function a(){if(!o)return;n(s=>({...s,checking:true}));let i=await U_(e,t);o&&n({ready:i,error:i?null:"API is not available",checking:false});}return a(),()=>{o=false;}},[e]),r}function Df(e,t){if(e===t)return true;if(e==null||t==null||typeof e!="object"||typeof t!="object")return false;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return false;for(let o of r)if(!n.includes(o)||!Df(e[o],t[o]))return false;return true}function Yz({initialValues:e,defaultValues:t,onSave:r,timeout:n=1e4,validateChanges:o}){let[a,i]=tr.useState(e),[s,l]=tr.useState(false),[c,d]=tr.useState(false),[u,g]=tr.useState(null),p=tr.useRef(e),m=tr.useRef();tr.useEffect(()=>{let E=o?o(a):!Df(a,p.current);l(E);},[a,o]);let f=tr.useCallback((E,N)=>{i(R=>({...R,[E]:N}));},[]),b=tr.useCallback(async()=>{if(!s||c)return;d(true),g(null);let E=new Promise((N,R)=>{m.current=setTimeout(()=>{R(new Error("Save operation timed out"));},n);});try{await Promise.race([r(a),E]),p.current=a,l(!1);}catch(N){let R=N instanceof Error?N.message:"Failed to save changes";g(R),console.error("Save failed:",N);}finally{m.current&&clearTimeout(m.current),d(false);}},[a,s,c,r,n]),h=tr.useCallback(()=>{i(p.current),l(false),g(null);},[]),S=tr.useCallback(()=>{t&&(i(t),g(null),l(!Df(t,p.current)));},[t]);return tr.useEffect(()=>()=>{m.current&&clearTimeout(m.current);},[]),{values:a,isDirty:s,isSaving:c,error:u,setValues:i,setFieldValue:f,save:b,reset:h,resetToDefaults:S,canSave:s&&!c}}function Qz({appName:e,appVersion:t,navigation:r,children:n,logoSrc:o="/assets/logo.png",logoClassName:a="h-8 w-auto",logoOffset:i,headerHeight:s="h-16",showLogout:l=false,onLogout:c,authenticated:d=true,connectionStatusUrl:u,className:g,primaryColor:p="#3b82f6"}){let m={pathname:"/"};try{let S=reactRouterDom.useLocation();S&&(m=S);}catch{}let[f,b]=tr.useState(false),h=async()=>{if(c)c();else try{await fetch("/api/logout",{method:"POST"}),window.location.href="/login";}catch(S){console.error("Logout failed:",S);}};return jsxRuntime.jsxs("div",{className:I("min-h-screen bg-gray-50",g),children:[jsxRuntime.jsx("header",{className:"bg-black",children:jsxRuntime.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:jsxRuntime.jsxs("div",{className:I("flex justify-between items-center",s),children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("img",{src:o,alt:"Logo",className:I(a,"mr-3"),style:i?{position:"relative",top:i.top??0,left:i.left??0}:void 0,onError:S=>{S.target.style.display="none";}}),e&&jsxRuntime.jsx("h1",{className:"text-xl font-semibold text-white",children:e}),t&&jsxRuntime.jsxs("span",{className:"ml-2 text-xs text-gray-400",children:["v",t]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-4",children:[jsxRuntime.jsx(na,{url:u,className:"text-xs text-gray-400"}),l&&d&&jsxRuntime.jsxs("button",{onClick:h,className:"text-gray-400 hover:text-white flex items-center gap-2 text-sm",children:[jsxRuntime.jsx(lucideReact.LogOut,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Logout"})]}),jsxRuntime.jsx("button",{className:"md:hidden p-2 text-white",onClick:()=>b(!f),children:f?jsxRuntime.jsx(lucideReact.X,{className:"h-6 w-6"}):jsxRuntime.jsx(lucideReact.Menu,{className:"h-6 w-6"})})]})]})})}),jsxRuntime.jsx("nav",{className:"bg-[#444444]",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[jsxRuntime.jsx("div",{className:"hidden md:flex space-x-0",children:r.map(S=>{let E=m.pathname===S.href||S.href==="/"&&m.pathname==="/"||S.href!=="/"&&m.pathname.startsWith(S.href);return jsxRuntime.jsxs(reactRouterDom.Link,{to:S.href,className:I("flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors",E?"text-white":"text-gray-300 hover:bg-[#555555] hover:text-white"),style:E?{backgroundColor:p}:void 0,children:[S.icon,S.name]},S.href)})}),f&&jsxRuntime.jsx("div",{className:"md:hidden py-2 space-y-1",children:r.map(S=>{let E=m.pathname===S.href||S.href==="/"&&m.pathname==="/"||S.href!=="/"&&m.pathname.startsWith(S.href);return jsxRuntime.jsxs(reactRouterDom.Link,{to:S.href,className:I("flex items-center gap-2 px-3 py-2 rounded text-sm font-medium",E?"text-white":"text-gray-300 hover:text-white hover:bg-[#555555]"),style:E?{backgroundColor:p}:void 0,onClick:()=>b(false),children:[S.icon,S.name]},S.href)})})]})}),jsxRuntime.jsx("main",{className:"flex-1 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:n})]})}function Jz({appName:e,appVersion:t,navigation:r,children:n,logoSrc:o="/assets/logo.png",logoClassName:a="h-8 w-auto",logoOffset:i,headerHeight:s="h-16",showLogout:l=false,onLogout:c,authenticated:d=true,connectionStatusUrl:u,sidebarWidth:g=256,className:p}){let m={pathname:"/"};try{m=reactRouterDom.useLocation();}catch{console.warn("SidebarLayout: useLocation called outside Router context, using default pathname");}let f=async()=>{if(c)c();else try{await fetch("/api/logout",{method:"POST"}),window.location.href="/login";}catch(b){console.error("Logout failed:",b);}};return jsxRuntime.jsxs("div",{className:I("h-screen flex flex-col bg-gray-50",p),children:[jsxRuntime.jsx("header",{className:"bg-black",children:jsxRuntime.jsx("div",{className:"px-4 sm:px-6 lg:px-8",children:jsxRuntime.jsxs("div",{className:I("flex justify-between items-center",s),children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("img",{src:o,alt:"Logo",className:I(a,"mr-3"),style:i?{position:"relative",top:i.top??0,left:i.left??0}:void 0,onError:b=>{b.target.style.display="none";}}),e&&jsxRuntime.jsx("h1",{className:"text-xl font-semibold text-white",children:e}),t&&jsxRuntime.jsxs("span",{className:"ml-2 text-xs text-gray-400",children:["v",t]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-4",children:[jsxRuntime.jsx(na,{url:u,className:"text-white"}),l&&d&&jsxRuntime.jsxs("button",{onClick:f,className:"text-gray-400 hover:text-white flex items-center gap-2 text-sm",children:[jsxRuntime.jsx(lucideReact.LogOut,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:"Logout"})]})]})]})})}),jsxRuntime.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[jsxRuntime.jsx("nav",{className:"bg-white border-r border-gray-200",style:{width:`${g}px`},children:jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.jsx("ul",{className:"space-y-1",children:r.map(b=>{let h=m.pathname===b.href||b.href==="/"&&m.pathname==="/"||b.href!=="/"&&m.pathname.startsWith(b.href);return jsxRuntime.jsx("li",{children:jsxRuntime.jsxs(reactRouterDom.Link,{to:b.href,className:I("flex items-center space-x-3 px-3 py-2 rounded-lg transition-colors",h?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100"),children:[b.icon,jsxRuntime.jsx("span",{className:"font-medium",children:b.name})]})},b.href)})})})}),jsxRuntime.jsx("main",{className:"flex-1 overflow-auto",children:n})]})]})}var eU={active:{bg:"bg-green-500",ring:"ring-green-400"},success:{bg:"bg-emerald-500",ring:"ring-emerald-400"},inactive:{bg:"bg-gray-400",ring:"ring-gray-300"},warning:{bg:"bg-yellow-500",ring:"ring-yellow-400"},error:{bg:"bg-red-500",ring:"ring-red-400"}},tU={xs:"h-2 w-2",sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"};function Ff({status:e,size:t="sm",animate:r=true,label:n,className:o}){let a=eU[e],i=r&&(e==="active"||e==="warning"||e==="error");return jsxRuntime.jsxs("div",{className:I("inline-flex items-center gap-2",o),children:[jsxRuntime.jsxs("span",{className:"relative inline-flex",children:[i&&jsxRuntime.jsx("span",{className:I("absolute inline-flex h-full w-full rounded-full opacity-75",a.bg,e==="active"&&"animate-ping",e==="warning"&&"animate-pulse",e==="error"&&"animate-pulse")}),jsxRuntime.jsx("span",{className:I("relative inline-flex rounded-full",tU[t],a.bg,i&&"ring-1",i&&a.ring)})]}),n&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function Bf({data:e,width:t=100,height:r=30,color:n="#10b981",strokeWidth:o=2,fill:a=false,className:i}){let s=tr.useMemo(()=>{if(!e||e.length===0)return "";let c=Math.max(...e),d=Math.min(...e),u=c-d||1;return e.map((g,p)=>{let m=p/(e.length-1)*t,f=r-(g-d)/u*r;return `${m},${f}`}).join(" ")},[e,t,r]);if(!e||e.length===0)return jsxRuntime.jsx("svg",{width:t,height:r,className:i,children:jsxRuntime.jsx("line",{x1:"0",y1:r/2,x2:t,y2:r/2,stroke:"#e5e7eb",strokeWidth:1})});let l=s?`0,${r} ${s} ${t},${r}`:"";return jsxRuntime.jsxs("svg",{width:t,height:r,className:i,children:[a&&s&&jsxRuntime.jsx("polygon",{points:l,fill:n,fillOpacity:.1}),s&&jsxRuntime.jsx("polyline",{points:s,fill:"none",stroke:n,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),e.length>0&&jsxRuntime.jsx("circle",{cx:t,cy:r-(e[e.length-1]-Math.min(...e))/(Math.max(...e)-Math.min(...e)||1)*r,r:o,fill:n})]})}function aU({data:e,columns:t,keyField:r,title:n,description:o,showActivity:a=false,activityField:i="activity",activityDecay:s=1e3,showSparkline:l=false,sparklineField:c="value",sparklineHistory:d,sparklineColor:u="#10b981",showStatus:g=false,statusField:p="status",statusConfig:m,expandable:f=false,childrenField:b="children",defaultExpanded:h=false,className:S,striped:E=false,hover:N=true,compact:R=false,onRowClick:x,onRefresh:D}){let[F,A]=tr.useState(new Set),[v,H]=tr.useState(new Map);tr.useEffect(()=>{if(h&&f){let L=e.map(M=>M[r]);A(new Set(L));}},[h,f,e,r]),tr.useEffect(()=>{if(a){let L=new Map;e.forEach(M=>{let $=M[r],j=M[i];j&&j!=="inactive"&&(L.set($,j),setTimeout(()=>{H(re=>{let Q=new Map(re);return Q.delete($),Q});},s));}),H(M=>new Map([...M,...L]));}},[e,a,r,i,s]);let _=tr.useCallback(L=>{A(M=>{let $=new Set(M);return $.has(L)?$.delete(L):$.add(L),$});},[]),P=(L,M=0)=>{let $=L[r],j=F.has($),re=f&&L[b]&&L[b].length>0,Q=v.get($)||"inactive";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(sr,{className:I(N&&"hover:bg-gray-50 transition-colors",x&&"cursor-pointer",M>0&&"bg-gray-50/50"),onClick:()=>x?.(L),children:t.map((w,z)=>jsxRuntime.jsx(lr,{className:I(w.align==="center"&&"text-center",w.align==="right"&&"text-right",R&&"py-2",z===0&&M>0&&`pl-${4+M*4}`),style:{width:w.width},children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[z===0&&re&&jsxRuntime.jsx("button",{onClick:te=>{te.stopPropagation(),_($);},className:"p-0.5 hover:bg-gray-200 rounded",children:j?"\u25BC":"\u25B6"}),z===0&&a&&jsxRuntime.jsx(Ff,{status:Q,size:"sm"}),w.render?w.render(w.accessor(L),L):w.accessor(L),w.key===p&&g&&m&&jsxRuntime.jsxs(tt,{variant:m[L[p]]?.variant||"default",children:[m[L[p]]?.icon,m[L[p]]?.label||L[p]]}),w.key===c&&l&&d&&jsxRuntime.jsx(Bf,{data:d.get($)||[],color:u,width:60,height:20})]})},w.key))},$),j&&re&&L[b].map(w=>P(w,M+1))]})};return jsxRuntime.jsxs(Ie,{className:S,children:[(n||o)&&jsxRuntime.jsxs("div",{className:"p-4 border-b",children:[n&&jsxRuntime.jsx("h3",{className:"font-semibold text-lg",children:n}),o&&jsxRuntime.jsx("p",{className:"text-sm text-gray-600 mt-1",children:o})]}),jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs(Kn,{children:[jsxRuntime.jsx(Xn,{children:jsxRuntime.jsx(sr,{children:t.map(L=>jsxRuntime.jsx($r,{className:I(L.align==="center"&&"text-center",L.align==="right"&&"text-right"),style:{width:L.width},children:L.label},L.key))})}),jsxRuntime.jsx(Zn,{children:e.length===0?jsxRuntime.jsx(sr,{children:jsxRuntime.jsx(lr,{colSpan:t.length,className:"text-center py-8 text-gray-500",children:"No data available"})}):e.map(L=>P(L))})]})})]})}function sU({stats:e,columns:t=4,className:r}){let n={1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4",5:"grid-cols-1 md:grid-cols-2 lg:grid-cols-5",6:"grid-cols-1 md:grid-cols-3 lg:grid-cols-6"},o={default:"",primary:"border-blue-200 bg-blue-50/50",success:"border-green-200 bg-green-50/50",warning:"border-yellow-200 bg-yellow-50/50",danger:"border-red-200 bg-red-50/50"},a={default:"text-gray-600",primary:"text-blue-600",success:"text-green-600",warning:"text-yellow-600",danger:"text-red-600"};return jsxRuntime.jsx("div",{className:I(`grid gap-4 ${n[t]}`,r),children:e.map((i,s)=>{let l=i.icon,c=i.color||"default";return jsxRuntime.jsx(Ie,{className:I("p-4 transition-all hover:shadow-md",o[c],i.className),children:jsxRuntime.jsx("div",{className:"flex items-start justify-between",children:jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[l&&jsxRuntime.jsx(l,{className:I("h-4 w-4",a[c])}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-600",children:i.label})]}),jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:i.value}),i.description&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 mt-1",children:i.description}),i.trend&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[jsxRuntime.jsxs("span",{className:I("text-xs font-medium",i.trend.positive?"text-green-600":"text-red-600"),children:[i.trend.positive?"\u2191":"\u2193",Math.abs(i.trend.value),"%"]}),i.trend.label&&jsxRuntime.jsx("span",{className:"text-xs text-gray-500",children:i.trend.label})]})]})]})})},s)})})}function lU({label:e,value:t,icon:r,trend:n,className:o}){return jsxRuntime.jsxs("div",{className:I("flex items-center justify-between p-3 bg-white rounded-lg border",o),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[r&&jsxRuntime.jsx("div",{className:"p-2 bg-gray-100 rounded",children:jsxRuntime.jsx(r,{className:"h-4 w-4 text-gray-600"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-gray-600",children:e}),jsxRuntime.jsx("p",{className:"font-semibold",children:t})]})]}),n!==void 0&&jsxRuntime.jsxs("span",{className:I("text-xs font-medium",n>=0?"text-green-600":"text-red-600"),children:[n>=0?"\u2191":"\u2193"," ",Math.abs(n),"%"]})]})}function cU({stats:e}){if(!e)return null;let{total:t,error:r,warn:n,info:o,debug:a,fileSize:i,oldestEntry:s,newestEntry:l}=e;return jsxRuntime.jsxs(Ie,{className:"p-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Total"}),jsxRuntime.jsx("div",{className:"text-xl font-semibold",children:t??0})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Errors"}),jsxRuntime.jsx(tt,{variant:"destructive",children:r??0})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Warnings"}),jsxRuntime.jsx(tt,{variant:"secondary",children:n??0})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Info"}),jsxRuntime.jsx(tt,{variant:"outline",children:o??0})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Debug"}),jsxRuntime.jsx(tt,{variant:"outline",children:a??0})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"File Size"}),jsxRuntime.jsx("div",{className:"text-xl font-semibold",children:String(i??"-")})]})]}),(s||l)&&jsxRuntime.jsxs("div",{className:"mt-3 text-xs text-muted-foreground",children:[s&&jsxRuntime.jsxs("span",{children:["Oldest: ",s," "]}),l&&jsxRuntime.jsxs("span",{children:["Newest: ",l]})]})]})}function mU({categories:e,onSave:t,onLoad:r,onValidate:n,onRestartRequired:o,title:a="Settings",description:i="Configure application preferences",showResetButton:s=true,showUndoButton:l=true,customFields:c={},renderCategory:d,renderSetting:u,autoSave:g=false,autoSaveDelay:p=3e3,confirmReset:m=true,persistState:f=true,className:b,containerClassName:h,categoryClassName:S,settingClassName:E}){let[N,R]=tr.useState({}),[x,D]=tr.useState({}),[F,A]=tr.useState({}),[v,H]=tr.useState(true),[_,P]=tr.useState(false),[L,M]=tr.useState(e?.[0]?.id||""),[$,j]=tr.useState({}),[re,Q]=tr.useState(false),[w,z]=tr.useState(false),[te,T]=tr.useState(null),ye=()=>{let C={};return e.forEach(V=>{V.settings.forEach(J=>{C[J.key]=J.defaultValue;});}),C};tr.useEffect(()=>{(async()=>{H(true);try{let V=r?await r():ye();if(R(V),D(V),f){let J=localStorage.getItem("settings-active-category");J&&e.find(pe=>pe.id===J)&&M(J);}}catch(V){console.error("Failed to load settings:",V),R(ye()),D(ye());}finally{H(false);}})();},[]),tr.useEffect(()=>{let C=JSON.stringify(N)!==JSON.stringify(x);z(C);},[N,x]),tr.useEffect(()=>{if(!g||!w)return;let C=setTimeout(()=>{_e();},p);return ()=>clearTimeout(C)},[N,g,p,w]),tr.useEffect(()=>{f&&localStorage.setItem("settings-active-category",L);},[L,f]);let Ce=(C,V)=>C.validation?C.validation(V):null,et=()=>{let C={},V=false;if(e.forEach(J=>{J.settings.forEach(pe=>{let Te=Ce(pe,N[pe.key]);Te&&(C[pe.key]=Te,V=true);});}),n){let J=n(N);J&&(Object.assign(C,J),V=true);}return A(C),!V},_e=async()=>{if(et()){P(true);try{let V=Object.keys(N).filter(J=>N[J]!==x[J]).filter(J=>e.flatMap(Te=>Te.settings).find(Te=>Te.key===J)?.requiresRestart);V.length>0&&(Q(!0),o?.(V)),await t(N),D(N);}catch(C){console.error("Failed to save settings:",C),T(C instanceof Error?C.message:"Failed to save settings. Please try again.");}finally{P(false);}}},Se=()=>{if(m&&!confirm("Reset all settings to defaults? This will override your current configuration."))return;let C=ye();R(C);},st=()=>{R(x);},ve=(C,V)=>{R(J=>({...J,[C]:V})),F[C]&&A(J=>{let pe={...J};return delete pe[C],pe}),te&&T(null);},Oe=C=>{if(C.hidden)return null;let V=N[C.key]??C.defaultValue,J=F[C.key],pe=$[C.key];if(C.showIf&&!C.showIf(N))return null;let Te=C.inputWidth==="small"?"max-w-[180px]":C.inputWidth==="medium"?"max-w-sm":C.inputWidth==="large"?"w-full":void 0;if(C.type==="custom"||C.customComponent){let ze=C.customComponent||c[C.type];if(ze)return jsxRuntime.jsx(ze,{value:V,onChange:Br=>ve(C.key,Br),error:J,disabled:_,setting:C})}let hr=c[C.type];if(hr)return jsxRuntime.jsx(hr,{value:V,onChange:ze=>ve(C.key,ze),error:J,disabled:_,setting:C});switch(C.type){case "string":case "text":case "password":return jsxRuntime.jsxs("div",{className:I("flex items-center gap-2",Te),children:[jsxRuntime.jsx(ht,{id:C.key,type:C.type==="password"&&!pe?"password":"text",value:V||"",onChange:ze=>ve(C.key,ze.target.value),className:I(J&&"border-red-500",Te),placeholder:C.placeholder||(C.type==="password"?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":void 0),disabled:_}),C.suffix&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:C.suffix})]});case "number":return jsxRuntime.jsxs("div",{className:I("flex items-center gap-2",Te),children:[jsxRuntime.jsx(ht,{id:C.key,type:"number",value:V??"",onChange:ze=>ve(C.key,parseFloat(ze.target.value)||0),className:I(J&&"border-red-500",Te),placeholder:C.placeholder,disabled:_,step:C.step,min:C.min,max:C.max}),C.suffix&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:C.suffix})]});case "boolean":return jsxRuntime.jsx(xr,{id:C.key,checked:V||false,onCheckedChange:ze=>ve(C.key,ze),disabled:_});case "select":return jsxRuntime.jsxs(yt,{value:String(V||C.defaultValue),onValueChange:ze=>ve(C.key,ze),disabled:_,children:[jsxRuntime.jsx(ct,{id:C.key,className:I(J&&"border-red-500"),children:jsxRuntime.jsx(St,{})}),jsxRuntime.jsx(ut,{children:C.options?.map(ze=>jsxRuntime.jsx(Be,{value:String(ze.value),children:ze.label},ze.value))})]});default:return null}},Ge=e.find(C=>C.id===L);return jsxRuntime.jsxs("div",{className:I("space-y-6",b),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-3xl font-bold",children:a}),jsxRuntime.jsx("p",{className:"text-muted-foreground",children:i})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[l&&w&&jsxRuntime.jsxs(W,{variant:"outline",onClick:st,disabled:_,children:[jsxRuntime.jsx(lucideReact.Undo,{className:"h-4 w-4 mr-2"}),"Undo"]}),s&&jsxRuntime.jsxs(W,{variant:"outline",onClick:Se,disabled:_,children:[jsxRuntime.jsx(lucideReact.RotateCcw,{className:"h-4 w-4 mr-2"}),"Defaults"]}),jsxRuntime.jsx(W,{onClick:_e,disabled:!w||_,className:I("transition-all",w&&"ring-2 ring-primary/20"),children:_?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-4 w-4 mr-2 animate-spin"}),"Saving..."]}):w?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Save,{className:"h-4 w-4 mr-2"}),"Save"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4 mr-2"}),"Saved"]})})]})]}),te&&jsxRuntime.jsxs(nt,{variant:"destructive",className:"mb-6",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-4 w-4"}),jsxRuntime.jsx(ot,{children:te})]}),jsxRuntime.jsxs("div",{className:I("flex gap-6",h),children:[jsxRuntime.jsx(Ie,{className:"w-64 h-fit",children:jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold mb-4",children:"Categories"}),jsxRuntime.jsx("div",{className:"space-y-1",children:e.map(C=>jsxRuntime.jsxs("button",{onClick:()=>M(C.id),className:I("w-full flex items-center gap-3 px-3 py-2 rounded-md text-sm transition-colors",L===C.id?"bg-primary text-primary-foreground":"hover:bg-muted",S),children:[typeof C.icon=="function"&&(()=>{let V=C.icon;return jsxRuntime.jsx(V,{className:"h-4 w-4"})})(),jsxRuntime.jsx("span",{className:"text-left",children:C.label})]},C.id))})]})}),jsxRuntime.jsx("div",{className:"flex-1",children:v?jsxRuntime.jsx(Ie,{className:"p-8",children:jsxRuntime.jsx("div",{className:"flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}):Ge?jsxRuntime.jsx(Ie,{className:"p-6",children:d?d(Ge,jsxRuntime.jsx("div",{className:"space-y-6",children:Ge.settings.map(C=>{let V=Oe(C);if(!V)return null;let J=jsxRuntime.jsxs("div",{className:I("space-y-2",E),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs(zt,{htmlFor:C.key,className:"text-sm font-medium",children:[C.label,C.requiresRestart&&jsxRuntime.jsx("span",{className:"ml-2 text-xs text-amber-600 dark:text-amber-400",children:"(Requires restart)"})]}),C.help&&jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors",title:C.help,children:jsxRuntime.jsx(lucideReact.Info,{className:"h-3 w-3"})})]}),C.type==="password"&&N[C.key]&&jsxRuntime.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>j(pe=>({...pe,[C.key]:!pe[C.key]})),children:$[C.key]?jsxRuntime.jsx(lucideReact.EyeOff,{className:"h-3 w-3"}):jsxRuntime.jsx(lucideReact.Eye,{className:"h-3 w-3"})})]}),C.description&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:C.description}),C.hint&&jsxRuntime.jsx("p",{className:"text-[11px] text-muted-foreground",children:C.hint}),V,F[C.key]&&jsxRuntime.jsx("p",{className:"text-xs text-red-500",children:F[C.key]})]},C.key);return u?u(C,J):J})})):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h2",{className:"text-xl font-semibold",children:Ge.label}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:Ge.description})]}),jsxRuntime.jsx("div",{className:"space-y-6",children:Ge.settings.map(C=>{let V=Oe(C);if(!V)return null;let J=jsxRuntime.jsxs("div",{className:I("space-y-2",E),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs(zt,{htmlFor:C.key,className:"text-sm font-medium",children:[C.label,C.requiresRestart&&jsxRuntime.jsx("span",{className:"ml-2 text-xs text-amber-600 dark:text-amber-400",children:"(Requires restart)"})]}),C.help&&jsxRuntime.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors",title:C.help,children:jsxRuntime.jsx(lucideReact.Info,{className:"h-3 w-3"})})]}),C.type==="password"&&N[C.key]&&jsxRuntime.jsx(W,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>j(pe=>({...pe,[C.key]:!pe[C.key]})),children:$[C.key]?jsxRuntime.jsx(lucideReact.EyeOff,{className:"h-3 w-3"}):jsxRuntime.jsx(lucideReact.Eye,{className:"h-3 w-3"})})]}),C.description&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:C.description}),V,F[C.key]&&jsxRuntime.jsx("p",{className:"text-xs text-red-500",children:F[C.key]})]},C.key);return u?u(C,J):J})})]})}):jsxRuntime.jsx(Ie,{className:"p-8",children:jsxRuntime.jsxs(nt,{children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-4 w-4"}),jsxRuntime.jsx(ot,{children:"No settings available for this category"})]})})})]}),re&&jsxRuntime.jsxs(nt,{className:"border-amber-500",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-4 w-4 text-amber-600"}),jsxRuntime.jsx(ot,{children:"Some settings require a restart to take effect."})]})]})}var ys={colors:{primary:{DEFAULT:"#3b82f6",hover:"#2563eb",light:"#60a5fa",dark:"#1d4ed8"},dark:{bg:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1a1a1a",elevated:"#242424"},border:{DEFAULT:"#2a2a2a",subtle:"#1f1f1f",strong:"#3a3a3a"}},light:{bg:{primary:"#ffffff",secondary:"#f8f9fa",tertiary:"#f3f4f6",elevated:"#ffffff"},border:{DEFAULT:"#e5e7eb",subtle:"#f3f4f6",strong:"#d1d5db"}},success:{DEFAULT:"#10b981",light:"#34d399",dark:"#059669"},warning:{DEFAULT:"#f59e0b",light:"#fbbf24",dark:"#d97706"},error:{DEFAULT:"#ef4444",light:"#f87171",dark:"#dc2626"},info:{DEFAULT:"#3b82f6",light:"#60a5fa",dark:"#2563eb"},intelligent:{DEFAULT:"#8b5cf6",light:"#a78bfa",dark:"#7c3aed"},activity:{read:"#10b981",write:"#3b82f6",inactive:"#6b7280"}},gradients:{subtle:"linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%)",card:"linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%)",glow:"radial-gradient(circle at 50% 0%, rgba(226,19,80,0.15) 0%, transparent 70%)",intelligent:"linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(139,92,246,0.05) 100%)"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",DEFAULT:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",glow:"0 0 20px rgba(226,19,80,0.3)","glow-intelligent":"0 0 20px rgba(139,92,246,0.3)"},radius:{sm:"0.25rem",DEFAULT:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem","2xl":"1.5rem",full:"9999px"},spacing:{xs:"0.5rem",sm:"0.75rem",DEFAULT:"1rem",md:"1.5rem",lg:"2rem",xl:"3rem","2xl":"4rem"},typography:{fonts:{sans:'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',mono:'"JetBrains Mono", "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},sizes:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},weights:{light:"300",normal:"400",medium:"500",semibold:"600",bold:"700"}},transitions:{fast:"150ms",DEFAULT:"200ms",slow:"300ms",timing:"cubic-bezier(0.4, 0, 0.2, 1)"},zIndex:{base:0,elevated:10,dropdown:20,sticky:30,fixed:40,modal:50,popover:60,tooltip:70},opacity:{hover:.8,disabled:.5,backdrop:.7,subtle:.1}},Cce=(e=false)=>{let t=e?ys.colors.dark:ys.colors.light;return {"--color-bg-primary":t.bg.primary,"--color-bg-secondary":t.bg.secondary,"--color-bg-tertiary":t.bg.tertiary,"--color-bg-elevated":t.bg.elevated,"--color-border":t.border.DEFAULT,"--color-border-subtle":t.border.subtle,"--color-border-strong":t.border.strong,"--color-text":e?"#ffffff":"#000000","--color-text-secondary":e?"#a1a1aa":"#6b7280","--color-text-tertiary":e?"#71717a":"#9ca3af"}};var J_=tr.createContext(void 0);function hU({children:e,defaultMode:t="system",theme:r=ys,customColors:n,persistPreference:o=true}){let[a,i]=tr.useState({mode:t,theme:r,customColors:n}),[s,l]=tr.useState(false);tr.useEffect(()=>{if(o){let g=localStorage.getItem("theme-mode");g&&i(p=>({...p,mode:g}));}},[o]),tr.useEffect(()=>{let g=document.documentElement;if(a.mode==="system"){let p=window.matchMedia("(prefers-color-scheme: dark)"),m=p.matches;l(m),g.classList.toggle("dark",m);let f=b=>{let h=b.matches;l(h),g.classList.toggle("dark",h);};return p.addEventListener("change",f),()=>{p.removeEventListener("change",f);}}else {let p=a.mode==="dark";l(p),g.classList.toggle("dark",p);return}},[a.mode]),tr.useEffect(()=>{if(n){let g=document.documentElement;if(n.primary){let p=Hf(n.primary);g.style.setProperty("--primary",p);}if(n.secondary){let p=Hf(n.secondary);g.style.setProperty("--secondary",p);}if(n.accent){let p=Hf(n.accent);g.style.setProperty("--accent",p);}}},[n]);let c=g=>{i(p=>({...p,mode:g})),o&&localStorage.setItem("theme-mode",g);},u={themeConfig:a,setThemeMode:c,toggleTheme:()=>{c(s?"light":"dark");},isDark:s};return jsxRuntime.jsx(J_.Provider,{value:u,children:e})}function Ss(){let e=tr.useContext(J_);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}function Hf(e){e=e.replace("#","");let t=parseInt(e.substr(0,2),16)/255,r=parseInt(e.substr(2,2),16)/255,n=parseInt(e.substr(4,2),16)/255,o=Math.max(t,r,n),a=Math.min(t,r,n),i=0,s=0,l=(o+a)/2;if(o!==a){let c=o-a;switch(s=l>.5?c/(2-o-a):c/(o+a),o){case t:i=((r-n)/c+(r<n?6:0))/6;break;case r:i=((n-t)/c+2)/6;break;case n:i=((t-r)/c+4)/6;break}}return `${Math.round(i*360)} ${Math.round(s*100)}% ${Math.round(l*100)}%`}function kU({className:e,showLabel:t=true,variant:r="select"}){let{themeConfig:n,setThemeMode:o,toggleTheme:a,isDark:i}=Ss();return r==="button"?jsxRuntime.jsxs("div",{className:I("flex items-center gap-2",e),children:[t&&jsxRuntime.jsx(zt,{children:"Theme"}),jsxRuntime.jsx(W,{variant:"outline",size:"icon",onClick:a,className:"w-10 h-10",children:i?jsxRuntime.jsx(lucideReact.Sun,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Moon,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:I("flex flex-col gap-2",e),children:[t&&jsxRuntime.jsx(zt,{htmlFor:"theme-select",children:"Theme"}),jsxRuntime.jsxs(yt,{value:n.mode,onValueChange:s=>o(s),children:[jsxRuntime.jsx(ct,{id:"theme-select",className:"w-[180px]",children:jsxRuntime.jsx(St,{placeholder:"Select theme"})}),jsxRuntime.jsxs(ut,{children:[jsxRuntime.jsx(Be,{value:"light",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Sun,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:"Light"})]})}),jsxRuntime.jsx(Be,{value:"dark",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Moon,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:"Dark"})]})}),jsxRuntime.jsx(Be,{value:"system",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Monitor,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:"System"})]})})]})]})]})}function EU({className:e}){let{toggleTheme:t,isDark:r}=Ss();return jsxRuntime.jsx(W,{variant:"ghost",size:"icon",onClick:t,className:I("w-8 h-8",e),title:`Switch to ${r?"light":"dark"} theme`,children:r?jsxRuntime.jsx(lucideReact.Sun,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Moon,{className:"h-4 w-4"})})}var CU=[{id:"general",label:"General",description:"Basic application settings",icon:jsxRuntime.jsx(lucideReact.Settings,{className:"h-4 w-4"}),settings:[]},{id:"network",label:"Network",description:"Network and connectivity",icon:jsxRuntime.jsx(lucideReact.Network,{className:"h-4 w-4"}),settings:[]},{id:"logging",label:"Logging",description:"Logging configuration",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"h-4 w-4"}),settings:[]},{id:"security",label:"Security",description:"Security settings",icon:jsxRuntime.jsx(lucideReact.Shield,{className:"h-4 w-4"}),settings:[]},{id:"notifications",label:"Notifications",description:"Email and alerts",icon:jsxRuntime.jsx(lucideReact.Mail,{className:"h-4 w-4"}),settings:[]},{id:"appearance",label:"Appearance",description:"UI preferences",icon:jsxRuntime.jsx(lucideReact.Palette,{className:"h-4 w-4"}),settings:[]},{id:"advanced",label:"Advanced",description:"Advanced settings",icon:jsxRuntime.jsx(lucideReact.Activity,{className:"h-4 w-4"}),settings:[]}];function NU(e,t,r,n){return {id:e,label:t,description:n,icon:RU[r]||jsxRuntime.jsx(lucideReact.Settings,{className:"h-4 w-4"})}}var RU={Server:jsxRuntime.jsx(lucideReact.Server,{className:"h-4 w-4"}),Network:jsxRuntime.jsx(lucideReact.Network,{className:"h-4 w-4"}),FileText:jsxRuntime.jsx(lucideReact.FileText,{className:"h-4 w-4"}),Shield:jsxRuntime.jsx(lucideReact.Shield,{className:"h-4 w-4"}),Mail:jsxRuntime.jsx(lucideReact.Mail,{className:"h-4 w-4"}),Settings:jsxRuntime.jsx(lucideReact.Settings,{className:"h-4 w-4"}),Database:jsxRuntime.jsx(lucideReact.Database,{className:"h-4 w-4"}),Bell:jsxRuntime.jsx(lucideReact.Bell,{className:"h-4 w-4"}),Users:jsxRuntime.jsx(lucideReact.Users,{className:"h-4 w-4"}),Palette:jsxRuntime.jsx(lucideReact.Palette,{className:"h-4 w-4"}),Globe:jsxRuntime.jsx(lucideReact.Globe,{className:"h-4 w-4"}),Activity:jsxRuntime.jsx(lucideReact.Activity,{className:"h-4 w-4"})};function LU({apiUrl:e="/api/updates",checkInterval:t=36e5,onDownload:r}){let[n,o]=tr.useState(null),[a,i]=tr.useState(false),[s,l]=tr.useState(false),[c,d]=tr.useState(false);tr.useEffect(()=>{u();let m=setInterval(u,t);return ()=>clearInterval(m)},[t]);let u=async(m=false)=>{i(true);try{let f=await fetch(`${e}/check${m?"?force=true":""}`);if(f.ok){let b=await f.json();o(b),b.updateAvailable&&s&&localStorage.getItem("dismissedUpdateVersion")!==b.latestRelease?.version&&l(!1);}}catch(f){console.error("Failed to check for updates:",f);}finally{i(false);}},g=()=>{l(true),n?.latestRelease&&localStorage.setItem("dismissedUpdateVersion",n.latestRelease.version);},p=async()=>{if(r&&n)r(n);else try{let m=await fetch(`${e}/download-url`);if(m.ok){let{url:f}=await m.json();window.open(f,"_blank");}}catch{n?.latestRelease?.url&&window.open(n.latestRelease.url,"_blank");}};return !n?.updateAvailable||s?null:jsxRuntime.jsx("div",{className:"fixed bottom-4 right-4 z-50 max-w-md animate-in slide-in-from-bottom-2",children:jsxRuntime.jsxs(nt,{className:"border-green-500 bg-green-50 dark:bg-green-950/20",children:[jsxRuntime.jsx(lucideReact.Download,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),jsxRuntime.jsxs(ot,{className:"pr-8",children:[jsxRuntime.jsxs("div",{className:"font-semibold text-green-800 dark:text-green-200 mb-1",children:["Update Available: v",n.latestRelease?.version]}),jsxRuntime.jsx("div",{className:"text-sm text-green-700 dark:text-green-300 mb-3",children:n.latestRelease?.name||"A new version is available"}),c&&n.latestRelease?.body&&jsxRuntime.jsx("div",{className:"mt-3 p-2 bg-white/50 dark:bg-black/20 rounded text-xs",children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:n.latestRelease.body})}),jsxRuntime.jsxs("div",{className:"flex gap-2 mt-3",children:[jsxRuntime.jsxs(W,{size:"sm",variant:"default",onClick:p,className:"bg-green-600 hover:bg-green-700",children:[jsxRuntime.jsx(lucideReact.Download,{className:"h-3 w-3 mr-1"}),"Download"]}),jsxRuntime.jsxs(W,{size:"sm",variant:"outline",onClick:()=>d(!c),children:[c?"Hide":"Show"," Changes"]}),jsxRuntime.jsx(W,{size:"sm",variant:"ghost",onClick:()=>window.open(n.latestRelease?.url,"_blank"),children:jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3 w-3"})})]})]}),jsxRuntime.jsx(W,{size:"sm",variant:"ghost",className:"absolute top-2 right-2 h-6 w-6 p-0",onClick:g,children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})})}function PU(e,t){let[r,n]=tr.useState(e);return tr.useEffect(()=>{let o=setTimeout(()=>{n(e);},t);return ()=>{clearTimeout(o);}},[e,t]),r}function FU(e){let[t,r]=to(e);return {connected:t.connected,connecting:t.connecting,transport:t.transport,error:t.error,retryCount:t.retryCount,reconnect:r.reconnect}}var Wf=class{constructor(t={}){this.config={loginEndpoint:t.loginEndpoint||"/api/login",logoutEndpoint:t.logoutEndpoint||"/api/logout",refreshEndpoint:t.refreshEndpoint||"/api/refresh",tokenKey:t.tokenKey||"auth_token",authKey:t.authKey||"authenticated",tokenExpiry:t.tokenExpiry||36e5};}async login(t,r){try{let n=await fetch(this.config.loginEndpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t,password:r})}),o=await n.json();return n.ok&&o.success?(localStorage.setItem(this.config.authKey,"true"),o.token&&(localStorage.setItem(this.config.tokenKey,o.token),this.scheduleTokenRefresh(o.expiresIn||this.config.tokenExpiry)),o.user&&localStorage.setItem("user",JSON.stringify(o.user)),{success:!0,token:o.token,user:o.user,expiresIn:o.expiresIn}):{success:!1,error:o.error||"Invalid credentials"}}catch(n){return console.error("Login error:",n),{success:false,error:"Login failed. Please try again."}}}async logout(){try{let t=this.getToken();t&&await fetch(this.config.logoutEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});}catch(t){console.error("Logout error:",t);}finally{localStorage.removeItem(this.config.authKey),localStorage.removeItem(this.config.tokenKey),localStorage.removeItem("user"),this.refreshTimer&&clearTimeout(this.refreshTimer);}}isAuthenticated(){return localStorage.getItem(this.config.authKey)==="true"}getToken(){return localStorage.getItem(this.config.tokenKey)}getUser(){let t=localStorage.getItem("user");if(t)try{return JSON.parse(t)}catch{return null}return null}async refreshToken(){try{let t=this.getToken();if(!t)return !1;let r=await fetch(this.config.refreshEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(r.ok){let n=await r.json();if(n.token)return localStorage.setItem(this.config.tokenKey,n.token),this.scheduleTokenRefresh(n.expiresIn||this.config.tokenExpiry),!0}return !1}catch(t){return console.error("Token refresh error:",t),false}}scheduleTokenRefresh(t){this.refreshTimer&&clearTimeout(this.refreshTimer);let r=Math.max(0,t-3e5);this.refreshTimer=setTimeout(()=>{this.refreshToken();},r);}async authenticatedFetch(t,r={}){let n=this.getToken(),o=new Headers(r.headers);n&&o.set("Authorization",`Bearer ${n}`);let a=await fetch(t,{...r,headers:o});if(a.status===401&&await this.refreshToken()){let s=this.getToken();return s&&o.set("Authorization",`Bearer ${s}`),fetch(t,{...r,headers:o})}return a}requireAuth(t="/login"){return this.isAuthenticated()?true:(window.location.href=t,false)}},BU=new Wf;var oue={base:"transition-all duration-200",interactive:"hover:shadow-md hover:border-gray-300 dark:hover:border-gray-700 cursor-pointer",elevation:"shadow-sm"},aue={primary:"gap-2",icon:"h-4 w-4"},iue={container:"flex flex-col items-center justify-center py-12 text-center",icon:"h-12 w-12 text-muted-foreground mb-4",title:"text-lg font-medium mb-2",description:"text-sm text-muted-foreground max-w-sm"},sue={led:"w-2 h-2 rounded-full transition-all duration-200",pulse:"animate-pulse",colors:{read:"bg-green-500",write:"bg-blue-500",inactive:"bg-gray-400",error:"bg-red-500"}},lue={badge:{success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",error:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",info:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",default:"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200"}};var UU=25,HU=[10,25,50,100];function Do({data:e,pageSize:t=UU,storageKey:r}){let[n,o]=tr.useState(()=>{if(r)try{let h=localStorage.getItem(`pagination-${r}`);if(h)return {page:1,pageSize:JSON.parse(h).pageSize||t}}catch{}return {page:1,pageSize:t}}),{page:a,pageSize:i}=n,s=tr.useMemo(()=>Math.max(1,Math.ceil(e.length/i)),[e.length,i]);tr.useEffect(()=>{a>s&&o(h=>({...h,page:Math.max(1,s)}));},[s,a]),tr.useEffect(()=>{if(r)try{localStorage.setItem(`pagination-${r}`,JSON.stringify({pageSize:i}));}catch{}},[i,r]);let l=(a-1)*i,c=Math.min(l+i,e.length),d=tr.useMemo(()=>e.slice(l,c),[e,l,c]),u=tr.useCallback(h=>{o(S=>({...S,page:Math.max(1,Math.min(h,s))}));},[s]),g=tr.useCallback(h=>{o({page:1,pageSize:h});},[]),p=tr.useCallback(()=>{u(a+1);},[a,u]),m=tr.useCallback(()=>{u(a-1);},[a,u]),f=tr.useCallback(()=>{u(1);},[u]),b=tr.useCallback(()=>{u(s);},[s,u]);return {paginatedData:d,page:a,pageSize:i,totalPages:s,totalItems:e.length,setPage:u,setPageSize:g,nextPage:p,prevPage:m,firstPage:f,lastPage:b,startIndex:l+1,endIndex:c,canGoNext:a<s,canGoPrev:a>1,pageSizeOptions:HU}}function Mo({columns:e,storageKey:t}){let r=`column-visibility-${t}`,[n,o]=tr.useState(()=>{let c={};if(e.forEach(d=>{c[d.id]=d.defaultVisible!==false;}),typeof window>"u")return c;try{let d=localStorage.getItem(r);if(d){let u=JSON.parse(d),g={};return e.forEach(p=>{p.locked?g[p.id]=!0:u[p.id]!==void 0?g[p.id]=u[p.id]:g[p.id]=p.defaultVisible!==!1;}),g}}catch(d){console.error("Error loading column visibility state:",d);}return c});tr.useEffect(()=>{if(!(typeof window>"u"))try{localStorage.setItem(r,JSON.stringify(n));}catch(c){console.error("Error saving column visibility state:",c);}},[n,r]);let a=tr.useCallback(c=>e.find(u=>u.id===c)?.locked?true:n[c]!==false,[n,e]),i=tr.useCallback(c=>{e.find(u=>u.id===c)?.locked||o(u=>({...u,[c]:!u[c]}));},[e]),s=tr.useCallback(()=>{let c={};e.forEach(d=>{c[d.id]=true;}),o(c);},[e]),l=tr.useCallback(()=>{let c={};e.forEach(d=>{c[d.id]=d.locked===true;}),o(c);},[e]);return {visibleColumns:n,isColumnVisible:a,toggleColumn:i,showAllColumns:s,hideAllColumns:l,columns:e}}var WU=50,xs=150,jU=3;function Po({tableId:e,columns:t,storageKey:r}){let n=r||`table-columns-${e}`,o=tr.useCallback(()=>t.reduce((R,x)=>(R[x.key]=x.defaultWidth||xs,R),{}),[t]),[a,i]=tr.useState(()=>{try{let R=localStorage.getItem(n);if(R){let x=JSON.parse(R);return {widths:{...o(),...x},isResizing:!1,resizingColumn:null}}}catch{}return {widths:o(),isResizing:false,resizingColumn:null}}),s=tr.useRef(0),l=tr.useRef(0),c=tr.useRef(null),d=tr.useRef(false),u=tr.useRef(t);tr.useEffect(()=>{u.current=t;},[t]);let g=tr.useCallback(R=>u.current.find(x=>x.key===R),[]);tr.useEffect(()=>{try{localStorage.setItem(n,JSON.stringify(a.widths));}catch{}},[a.widths,n]);let p=tr.useRef(null);p.current||(p.current={onPointerMove:R=>{if(!c.current)return;let x=R.clientX-s.current;if(!d.current){if(Math.abs(x)<jU)return;d.current=true,i(H=>({...H,isResizing:true,resizingColumn:c.current})),document.body.style.cursor="col-resize",document.body.style.userSelect="none";}let D=g(c.current),F=D?.minWidth||WU,A=D?.maxWidth,v=Math.max(F,l.current+x);A&&(v=Math.min(A,v)),i(H=>({...H,widths:{...H.widths,[c.current]:v}}));},onPointerUp:()=>{c.current=null,d.current=false,i(R=>({...R,isResizing:false,resizingColumn:null})),document.removeEventListener("pointermove",p.current.onPointerMove),document.removeEventListener("pointerup",p.current.onPointerUp),document.removeEventListener("pointercancel",p.current.onPointerUp),document.body.style.cursor="",document.body.style.userSelect="";}}),tr.useEffect(()=>()=>{p.current&&(document.removeEventListener("pointermove",p.current.onPointerMove),document.removeEventListener("pointerup",p.current.onPointerUp),document.removeEventListener("pointercancel",p.current.onPointerUp)),document.body.style.cursor="",document.body.style.userSelect="";},[]);let m=tr.useRef(a.widths);tr.useEffect(()=>{m.current=a.widths;},[a.widths]);let f=tr.useCallback((R,x)=>{s.current=x,l.current=m.current[R]||xs,c.current=R,d.current=false,document.addEventListener("pointermove",p.current.onPointerMove),document.addEventListener("pointerup",p.current.onPointerUp),document.addEventListener("pointercancel",p.current.onPointerUp);},[]),b=tr.useCallback(R=>({onPointerDown:x=>{x.preventDefault(),x.stopPropagation(),f(R,x.clientX);},onMouseDown:x=>{x.preventDefault(),x.stopPropagation();},draggable:false,onDragStart:x=>{x.preventDefault(),x.stopPropagation();},className:"resize-handle","data-resizing":a.resizingColumn===R}),[f,a.resizingColumn]),h=tr.useCallback(R=>{let x=a.widths[R]||xs;return {width:x,minWidth:x,position:"relative"}},[a.widths]),S=t.reduce((R,x)=>R+(a.widths[x.key]||x.defaultWidth||xs),0),E=tr.useCallback(()=>({minWidth:S}),[S]),N=tr.useCallback(()=>{i(R=>({...R,widths:o()}));},[o]);return {widths:a.widths,isResizing:a.isResizing,totalWidth:S,getResizeHandleProps:b,getColumnStyle:h,getTableStyle:E,resetToDefaults:N}}function Fo({storageKey:e,defaultOrder:t}){let[r,n]=tr.useState(()=>{try{let l=localStorage.getItem(e);if(l){let c=JSON.parse(l),d=new Set(c),u=new Set(t),g=c.filter(m=>u.has(m)),p=t.filter(m=>!d.has(m));if(p.length>0){let m=[...g];for(let f of p){let b=t.indexOf(f),h=m.length;for(let S=0;S<m.length;S++)if(t.indexOf(m[S])>b){h=S;break}m.splice(h,0,f);}return m}return g.length>0?g:t}}catch(l){console.warn("Failed to load column order from localStorage:",l);}return t});tr.useEffect(()=>{try{localStorage.setItem(e,JSON.stringify(r));}catch(l){console.warn("Failed to save column order to localStorage:",l);}},[e,r]);let o=tr.useCallback((l,c)=>{l!==c&&n(d=>{let u=[...d],[g]=u.splice(l,1);return g!==void 0&&u.splice(c,0,g),u});},[]),a=tr.useCallback((l,c)=>{n(d=>{let u=d.indexOf(l);if(u===-1)return d;let g=c==="left"?Math.max(0,u-1):Math.min(d.length-1,u+1);if(u===g)return d;let p=[...d],[m]=p.splice(u,1);return m!==void 0&&p.splice(g,0,m),p});},[]),i=tr.useCallback(()=>{n(t);},[t]),s=tr.useCallback(l=>{let c=new Map(l.map(d=>[d.id,d]));return r.map(d=>c.get(d)).filter(d=>d!==void 0)},[r]);return {columnOrder:r,moveColumn:o,moveColumnById:a,resetOrder:i,getOrderedColumns:s}}function Bo(e,t,r=[]){let[n,o]=tr.useState({isDragging:false,draggedId:null,dropIndex:null}),a=tr.useCallback(u=>{r.includes(u)||o({isDragging:true,draggedId:u,dropIndex:null});},[r]),i=tr.useCallback((u,g)=>{if(r.includes(u))return;let p=e.indexOf(u);if(p===-1)return;let m=g.currentTarget.getBoundingClientRect(),f=m.left+m.width/2,b=g.clientX<f?p:p+1;o(h=>({...h,dropIndex:b}));},[r,e]),s=tr.useCallback(()=>{if(!n.draggedId||n.dropIndex===null){o({isDragging:false,draggedId:null,dropIndex:null});return}let u=e.indexOf(n.draggedId),g=n.dropIndex;u<g&&(g=g-1),u!==-1&&g!==-1&&u!==g&&t(u,g),o({isDragging:false,draggedId:null,dropIndex:null});},[n.draggedId,n.dropIndex,e,t]),l=tr.useCallback(()=>{o({isDragging:false,draggedId:null,dropIndex:null});},[]),c=tr.useCallback(u=>({draggable:!r.includes(u),onDragStart:g=>{if(r.includes(u)){g.preventDefault();return}g.dataTransfer.effectAllowed="move",a(u);},onDragOver:g=>{g.preventDefault(),g.dataTransfer.dropEffect="move",i(u,g);},onDrop:g=>{g.preventDefault(),s();},onDragEnd:l}),[r,a,i,s,l]),d=tr.useCallback(u=>!n.isDragging||n.dropIndex===null?false:e.indexOf(u)===n.dropIndex,[n.isDragging,n.dropIndex,e]);return {dragState:n,getDragHandleProps:c,showDropIndicator:d}}function zo({page:e,pageSize:t,totalPages:r,totalItems:n,startIndex:o,endIndex:a,canGoNext:i,canGoPrev:s,pageSizeOptions:l,onPageChange:c,onPageSizeChange:d,onNextPage:u,onPrevPage:g,onFirstPage:p,onLastPage:m,className:f}){let b=()=>{let h=[],E=Math.floor(2.5),N=Math.max(1,e-E),R=Math.min(r,e+E);e<=E&&(R=Math.min(r,5)),e>r-E&&(N=Math.max(1,r-5+1)),N>1&&(h.push(1),N>2&&h.push("ellipsis"));for(let x=N;x<=R;x++)x!==1&&x!==r&&h.push(x);return R<r&&(R<r-1&&h.push("ellipsis"),h.push(r)),h};return n===0?null:jsxRuntime.jsxs("div",{className:I("flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-3",f),children:[jsxRuntime.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",o," to ",a," of ",n," items"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:"Per page:"}),jsxRuntime.jsxs(yt,{value:String(t),onValueChange:h=>d(Number(h)),children:[jsxRuntime.jsx(ct,{className:"w-20 h-8",children:jsxRuntime.jsx(St,{})}),jsxRuntime.jsx(ut,{children:l.map(h=>jsxRuntime.jsx(Be,{value:String(h),children:h},h))})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:p,disabled:!s,title:"First page",children:jsxRuntime.jsx(lucideReact.ChevronsLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:g,disabled:!s,title:"Previous page",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"flex items-center gap-1",children:b().map((h,S)=>h==="ellipsis"?jsxRuntime.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${S}`):jsxRuntime.jsx(W,{variant:e===h?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>c(h),children:h},h))}),jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:u,disabled:!i,title:"Next page",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})}),jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:m,disabled:!i,title:"Last page",children:jsxRuntime.jsx(lucideReact.ChevronsRight,{className:"h-4 w-4"})})]})]})]})}function jf({data:e,columns:t,storageKey:r,getRowId:n,selectable:o=false,selectedIds:a,onSelectionChange:i,onRowClick:s,onRowContextMenu:l,sortField:c,sortOrder:d,onSort:u,actionsColumn:g,actionsColumnWidth:p=80,pageSize:m=25,pagination:f,hidePagination:b=false,className:h,rowClassName:S,enableHeaderContextMenu:E=true,lockedColumns:N=[],defaultColumnOrder:R,loading:x=false,emptyState:D}){let F=tr.useMemo(()=>{let C=[];return o&&C.push({key:"select",defaultWidth:40,minWidth:40}),t.forEach(V=>{C.push({key:V.id,defaultWidth:V.width?.default??150,minWidth:V.width?.min??80,maxWidth:V.width?.max});}),g&&C.push({key:"actions",defaultWidth:p,minWidth:60}),C},[t,o,g,p]),A=tr.useMemo(()=>t.map(C=>({id:C.id,label:typeof C.header=="string"?C.header:C.id,defaultVisible:C.visibility?.default??true,locked:C.visibility?.locked})),[t]),v=tr.useMemo(()=>{if(R)return R;let C=[];return o&&C.push("select"),t.forEach(V=>C.push(V.id)),g&&C.push("actions"),C},[R,t,o,g]),{getResizeHandleProps:H,getColumnStyle:_,getTableStyle:P}=Po({tableId:r,columns:F}),L=Mo({columns:A,storageKey:r}),{columnOrder:M,moveColumn:$}=Fo({storageKey:`${r}-order`,defaultOrder:v}),{dragState:j,getDragHandleProps:re,showDropIndicator:Q}=Bo(M,$,[...N,"select","actions"]),w=Do({data:e,pageSize:m,storageKey:r}),z=f||w,[te,T]=tr.useState(null),ye=tr.useCallback(C=>{E&&(C.preventDefault(),T({x:C.clientX,y:C.clientY}));},[E]);tr.useEffect(()=>{if(!te)return;let C=()=>T(null);return window.addEventListener("click",C),()=>{window.removeEventListener("click",C);}},[te]);let Ce=tr.useMemo(()=>!o||!a||z.paginatedData.length===0?false:z.paginatedData.every(C=>a.has(n(C))),[o,a,z.paginatedData,n]),et=tr.useMemo(()=>{if(!o||!a)return false;let C=z.paginatedData.filter(V=>a.has(n(V)));return C.length>0&&C.length<z.paginatedData.length},[o,a,z.paginatedData,n]),_e=tr.useCallback(C=>{if(!i||!a)return;let V=new Set(a);V.has(C)?V.delete(C):V.add(C),i(V);},[a,i]),Se=tr.useCallback(()=>{if(!i)return;let C=new Set(z.paginatedData.map(n));i(C);},[z.paginatedData,n,i]),st=tr.useCallback(()=>{i&&i(new Set);},[i]),ve=tr.useCallback(C=>c!==C?jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?jsxRuntime.jsx(lucideReact.ChevronUp,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-3.5 w-3.5"}),[c,d]),Oe=tr.useCallback(C=>t.find(V=>V.id===C),[t]),Ge=tr.useCallback(C=>{let V={columnId:C.id,isSorted:c===C.sortKey,sortDirection:c===C.sortKey?d:void 0};return typeof C.header=="function"?C.header(V):C.sortKey&&u?jsxRuntime.jsxs("button",{onClick:()=>u(C.sortKey),className:I("flex items-center gap-1 hover:text-foreground transition-colors",c===C.sortKey&&"text-primary font-medium"),children:[C.header,ve(C.sortKey)]}):C.header},[c,d,u,ve]);return jsxRuntime.jsx(Yo,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"overflow-auto border rounded-lg max-h-[calc(100vh-16rem)]",children:jsxRuntime.jsxs(Kn,{style:P(),className:I("resizable-table sticky-actions-table",h),children:[jsxRuntime.jsx(Xn,{className:"sticky top-0 z-20 bg-muted",children:jsxRuntime.jsxs(sr,{onContextMenu:ye,className:"border-t-0",children:[M.map(C=>{if(C==="select"&&o)return jsxRuntime.jsx($r,{className:"sticky-select-header w-10 sticky left-0 z-20 bg-muted relative after:absolute after:right-0 after:top-0 after:bottom-0 after:w-px after:bg-border",children:jsxRuntime.jsx("input",{type:"checkbox",checked:Ce,ref:J=>{J&&(J.indeterminate=et);},onChange:J=>J.target.checked?Se():st(),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary cursor-pointer",title:Ce?"Deselect all":"Select all visible"})},"select");let V=Oe(C);return !V||!L.isColumnVisible(C)?null:jsxRuntime.jsxs($r,{style:_(C),...re(C),className:I("cursor-grab relative",j.draggedId===C&&"column-dragging opacity-50",Q(C)&&"drop-indicator"),children:[Ge(V),jsxRuntime.jsx("div",{...H(C)})]},C)}),g&&jsxRuntime.jsx($r,{className:"sticky right-0 z-20 bg-muted text-center relative before:absolute before:left-0 before:top-0 before:bottom-0 before:w-px before:bg-border",style:{width:p,minWidth:p,maxWidth:p},children:"Actions"})]})}),jsxRuntime.jsx(Zn,{children:x?jsxRuntime.jsx(sr,{children:jsxRuntime.jsx(lr,{colSpan:M.length+(g?1:0),className:"!p-0 h-32",children:jsxRuntime.jsx("div",{className:"sticky left-0 w-screen max-w-full h-full bg-background flex justify-center items-center",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-5 w-5 animate-spin"}),"Loading..."]})})})}):z.paginatedData.length===0?null:z.paginatedData.map(C=>{let V=n(C),J=a?.has(V)??false;return jsxRuntime.jsxs(sr,{className:I("group cursor-pointer bg-background hover:bg-muted transition-none",J&&"bg-primary/5",S?.(C)),onClick:()=>s?.(C),onContextMenu:pe=>{l&&(pe.preventDefault(),l(C,{x:pe.clientX,y:pe.clientY}));},children:[M.map(pe=>{if(pe==="select"&&o)return jsxRuntime.jsx(lr,{className:I("sticky-select-cell w-10 sticky left-0 z-10 relative after:absolute after:right-0 after:top-0 after:bottom-0 after:w-px after:bg-border","bg-background group-hover:bg-muted",J&&"bg-primary/5 group-hover:bg-primary/10"),onClick:ze=>ze.stopPropagation(),children:jsxRuntime.jsx("input",{type:"checkbox",checked:J,onChange:()=>_e(V),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary cursor-pointer"})},"select");let Te=Oe(pe);if(!Te||!L.isColumnVisible(pe))return null;let hr={columnId:pe,isDragging:j.draggedId===pe};return jsxRuntime.jsx(lr,{style:_(pe),className:I(Te.className,j.draggedId===pe&&"column-dragging"),children:Te.cell(C,hr)},pe)}),g&&jsxRuntime.jsx(lr,{className:I("sticky right-0 z-10 text-center relative before:absolute before:left-0 before:top-0 before:bottom-0 before:w-px before:bg-border","bg-background group-hover:bg-muted",J&&"bg-primary/5 group-hover:bg-primary/10"),style:{width:p,minWidth:p,maxWidth:p},onClick:pe=>pe.stopPropagation(),children:g(C)})]},V)})})]})}),!x&&z.paginatedData.length===0&&jsxRuntime.jsx("div",{className:"empty-state-container flex-1 flex items-center justify-center bg-background",children:D||jsxRuntime.jsx("span",{className:"block text-center text-muted-foreground py-8",children:"No data"})}),!b&&!x&&z.totalPages>1&&jsxRuntime.jsx(zo,{page:z.page,pageSize:z.pageSize,totalItems:z.totalItems,totalPages:z.totalPages,startIndex:z.startIndex,endIndex:z.endIndex,canGoPrev:z.canGoPrev,canGoNext:z.canGoNext,onPageChange:z.setPage,onPageSizeChange:z.setPageSize,onNextPage:z.nextPage,onPrevPage:z.prevPage,onFirstPage:"firstPage"in z?z.firstPage:()=>z.setPage(1),onLastPage:"lastPage"in z?z.lastPage:()=>z.setPage(z.totalPages),pageSizeOptions:z.pageSizeOptions}),te&&jsxRuntime.jsxs("div",{className:"fixed z-50 min-w-[200px] overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",style:{top:te.y,left:te.x,maxHeight:`calc(100vh - ${te.y}px - 20px)`},onClick:C=>C.stopPropagation(),children:[jsxRuntime.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Toggle columns"}),jsxRuntime.jsx("div",{className:"h-px bg-border my-1"}),L.columns.map(C=>{let V=L.isColumnVisible(C.id),J=C.locked===true;return jsxRuntime.jsxs("button",{onClick:()=>!J&&L.toggleColumn(C.id),disabled:J,className:I("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent",J&&"opacity-50 cursor-not-allowed"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:V&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5 text-primary"})}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:C.label}),J&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Required"})]},C.id)}),jsxRuntime.jsx("div",{className:"h-px bg-border my-1"}),jsxRuntime.jsxs("button",{onClick:()=>L.showAllColumns(),className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent",children:[jsxRuntime.jsx(lucideReact.Eye,{className:"h-4 w-4"}),"Show All"]}),jsxRuntime.jsxs("button",{onClick:()=>L.hideAllColumns(),className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent",children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"h-4 w-4"}),"Hide Optional"]})]})]})})}function Ho({page:e,pageSize:t,totalPages:r,totalItems:n,startIndex:o,endIndex:a,canGoNext:i,canGoPrev:s,pageSizeOptions:l,setPage:c,setPageSize:d,nextPage:u,prevPage:g,className:p}){return n===0?null:jsxRuntime.jsxs("div",{className:I("flex items-center gap-3 text-sm",p),children:[jsxRuntime.jsxs("div",{className:"hidden md:flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground hidden lg:inline",children:"Rows:"}),jsxRuntime.jsxs(yt,{value:String(t),onValueChange:m=>d(Number(m)),children:[jsxRuntime.jsx(ct,{className:"w-16 h-8 text-xs",children:jsxRuntime.jsx(St,{})}),jsxRuntime.jsx(ut,{children:l.map(m=>jsxRuntime.jsx(Be,{value:String(m),children:m},m))})]})]}),r>1&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:g,disabled:!s,title:"Previous page",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsxs("span",{className:"hidden sm:inline px-2 text-muted-foreground tabular-nums min-w-[60px] text-center",children:[e," / ",r]}),jsxRuntime.jsx(W,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:u,disabled:!i,title:"Next page",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})})]}),jsxRuntime.jsxs("span",{className:"text-muted-foreground whitespace-nowrap hidden lg:inline",children:["Showing ",o,"\u2013",a," of ",n]})]})}function Vf({title:e,description:t,search:r,onSearchChange:n,searchPlaceholder:o="Search...",filters:a,activeFilterCount:i=0,onClearFilters:s,pagination:l,actions:c,beforeTable:d,children:u,className:g,loading:p,loadingComponent:m}){let f=l&&l.totalItems>0;return jsxRuntime.jsxs("div",{className:I("flex flex-col h-full",g),children:[jsxRuntime.jsxs("div",{className:"data-table-page-header flex-shrink-0 space-y-4 pb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-3xl font-bold",children:e}),t&&jsxRuntime.jsx("p",{className:"text-muted-foreground",children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[n!==void 0&&jsxRuntime.jsxs("div",{className:"relative w-full sm:w-auto sm:min-w-[200px] sm:max-w-xs",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none z-10"}),jsxRuntime.jsx(ht,{placeholder:o,value:r||"",onChange:b=>n(b.target.value),className:"pl-9 h-9"}),r&&jsxRuntime.jsx("button",{type:"button",onClick:()=>n(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 p-1 rounded-sm hover:bg-muted",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3 text-muted-foreground"})})]}),a&&a.length>0&&jsxRuntime.jsxs(kr,{children:[jsxRuntime.jsx(Er,{asChild:true,children:jsxRuntime.jsxs(W,{variant:"outline",size:"sm",className:"gap-2 h-9",children:[jsxRuntime.jsx(lucideReact.Filter,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Filters"}),i>0&&jsxRuntime.jsx("span",{className:"rounded-full bg-primary text-primary-foreground px-2 py-0.5 text-xs font-medium",children:i})]})}),jsxRuntime.jsx(nr,{className:"w-80 overflow-y-auto",align:"start",collisionPadding:16,style:{maxHeight:"var(--radix-popover-content-available-height)"},children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:"Filters"}),i>0&&s&&jsxRuntime.jsx(W,{variant:"ghost",size:"sm",onClick:s,className:"h-auto p-0 text-xs text-destructive hover:text-destructive",children:"Clear all"})]}),jsxRuntime.jsx("div",{className:"space-y-3",children:a.map(b=>jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:b.label}),b.render()]},b.id))})]})})]}),i>0&&s&&jsxRuntime.jsxs(W,{variant:"ghost",size:"sm",onClick:s,className:"h-9 gap-1.5 text-muted-foreground hover:text-foreground",title:"Clear filters",children:[jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Clear"})]}),f&&jsxRuntime.jsx(Ho,{...l}),jsxRuntime.jsx("div",{className:"flex-1"}),c&&jsxRuntime.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:c})]})]}),d&&jsxRuntime.jsx("div",{className:"px-6 pb-2",children:d}),jsxRuntime.jsx("div",{className:"relative flex-1 min-h-0",children:jsxRuntime.jsx("div",{className:"data-table-scroll-container h-full",children:p?m||jsxRuntime.jsx("div",{className:"flex items-center justify-center h-full",children:jsxRuntime.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}):u})})]})}function Kf({selectedCount:e,onClear:t,children:r,itemLabel:n,className:o}){if(e===0)return null;let a=n??(e===1?"item":"items");return jsxRuntime.jsx(Ie,{className:I("p-3 bg-primary/5 border-primary/20",o),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"font-medium text-sm",role:"status","aria-live":"polite",children:[e," ",a," selected"]}),jsxRuntime.jsxs(W,{variant:"ghost",size:"sm",onClick:t,"aria-label":"Clear selection",children:[jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4 mr-1","aria-hidden":"true"}),"Clear"]})]}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",role:"group","aria-label":"Batch actions",children:r})]})})}function Xf({columns:e,isColumnVisible:t,toggleColumn:r,showAllColumns:n,hideAllColumns:o}){let a=e.filter(s=>t(s.id)).length,i=e.filter(s=>!s.locked);return jsxRuntime.jsxs(rb,{children:[jsxRuntime.jsx(nb,{asChild:true,children:jsxRuntime.jsxs(W,{variant:"outline",size:"sm",className:"gap-2",children:[jsxRuntime.jsx(lucideReact.Columns3,{className:"h-4 w-4"}),"Columns",jsxRuntime.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",a,"/",e.length,")"]})]})}),jsxRuntime.jsxs(Ls,{align:"end",className:"w-48",children:[jsxRuntime.jsx(Ds,{className:"font-normal text-xs text-muted-foreground",children:"Toggle columns"}),jsxRuntime.jsx(jo,{}),e.map(s=>{let l=t(s.id),c=s.locked===true;return jsxRuntime.jsxs(qn,{onClick:d=>{d.preventDefault(),c||r(s.id);},className:I("gap-2 cursor-pointer",c&&"opacity-50 cursor-not-allowed"),disabled:c,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:l?jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5 text-primary"}):jsxRuntime.jsx("div",{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("span",{className:"flex-1",children:s.label}),c&&jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Required"})]},s.id)}),i.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(jo,{}),jsxRuntime.jsxs(qn,{onClick:s=>{s.preventDefault(),n();},className:"gap-2 cursor-pointer",children:[jsxRuntime.jsx(lucideReact.Eye,{className:"h-4 w-4"}),"Show All"]}),jsxRuntime.jsxs(qn,{onClick:s=>{s.preventDefault(),o();},className:"gap-2 cursor-pointer",children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"h-4 w-4"}),"Hide Optional"]})]})]})]})}function Zf({search:e,onSearchChange:t,searchPlaceholder:r="Search...",filters:n,activeFilterCount:o=0,onClearFilters:a,className:i,children:s}){return jsxRuntime.jsxs("div",{className:I("flex items-center gap-3 flex-wrap",i),children:[t!==void 0&&jsxRuntime.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none z-10"}),jsxRuntime.jsx(ht,{placeholder:r,value:e||"",onChange:l=>t(l.target.value),className:"pl-9 h-9"}),e&&jsxRuntime.jsx("button",{type:"button",onClick:()=>t(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 p-1 rounded-sm hover:bg-muted",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3 text-muted-foreground"})})]}),n&&n.length>0&&jsxRuntime.jsxs(kr,{children:[jsxRuntime.jsx(Er,{asChild:true,children:jsxRuntime.jsxs(W,{variant:"outline",size:"sm",className:"gap-2 h-9",children:[jsxRuntime.jsx(lucideReact.Filter,{className:"h-4 w-4"}),"Filters",o>0&&jsxRuntime.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-2 py-0.5 text-xs font-medium",children:o})]})}),jsxRuntime.jsx(nr,{className:"w-80 overflow-y-auto",align:"start",collisionPadding:16,style:{maxHeight:"var(--radix-popover-content-available-height)"},children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:"Filters"}),o>0&&a&&jsxRuntime.jsx(W,{variant:"ghost",size:"sm",onClick:a,className:"h-auto p-0 text-xs text-destructive hover:text-destructive",children:"Clear all"})]}),jsxRuntime.jsx("div",{className:"space-y-3",children:n.map(l=>jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l.label}),l.render()]},l.id))})]})})]}),o>0&&a&&jsxRuntime.jsxs(W,{variant:"ghost",size:"sm",onClick:a,className:"h-9 gap-1.5 text-muted-foreground hover:text-foreground",children:[jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"}),"Clear"]}),jsxRuntime.jsx("div",{className:"flex-1"}),s]})}/*! Bundled license information:
55
55
 
56
56
  prismjs/components/prism-core.js:
57
57
  (**