@sudobility/components 4.0.133 → 4.0.139

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -52,23 +52,23 @@ Nonce: ${g}`}function a(c,h=24){const g=new Date(c.getTime()+h*60*60*1e3);return
52
52
  .animate-bounce-slow {
53
53
  animation: bounce-slow 4s ease-in-out infinite;
54
54
  }
55
- `,di(b))}}},[e]),t.jsx("div",{ref:g,className:`${y()} ${s}`,children:o})},ui=({children:e,delay:r=0,className:a=""})=>t.jsx(dr,{animation:"fade-in-up",delay:r,className:a,children:e}),gi=({children:e,delay:r=0,className:a=""})=>t.jsx(dr,{animation:"fade-in-scale",delay:r,className:a,children:e}),hi=({children:e,className:r=""})=>t.jsx(dr,{animation:"float",className:r,children:e}),fi=({isOpen:e,onClick:r,opacity:a="medium",blur:n=!1,zIndex:o=50,className:s,children:l})=>{const i={light:"bg-black/20 dark:bg-black/30",medium:"bg-black/50 dark:bg-black/60",dark:"bg-black/75 dark:bg-black/80"};return e?t.jsx("div",{onClick:r,className:f("fixed inset-0","transition-all duration-200",i[a],n&&"backdrop-blur-sm",s),style:{zIndex:o},role:"presentation","aria-hidden":"true",children:l}):null},bi={[ge.InfoType.INFO]:{icon:M.InformationCircleIcon,container:"bg-blue-50 dark:bg-blue-950 border-blue-200 dark:border-blue-800",iconColor:"text-blue-600 dark:text-blue-400",titleColor:"text-blue-900 dark:text-blue-100",descriptionColor:"text-blue-700 dark:text-blue-300"},[ge.InfoType.SUCCESS]:{icon:M.CheckCircleIcon,container:"bg-green-50 dark:bg-green-950 border-green-200 dark:border-green-800",iconColor:"text-green-600 dark:text-green-400",titleColor:"text-green-900 dark:text-green-100",descriptionColor:"text-green-700 dark:text-green-300"},[ge.InfoType.WARNING]:{icon:M.ExclamationTriangleIcon,container:"bg-yellow-50 dark:bg-amber-950 border-yellow-200 dark:border-amber-800",iconColor:"text-yellow-600 dark:text-amber-400",titleColor:"text-yellow-900 dark:text-amber-100",descriptionColor:"text-yellow-700 dark:text-amber-300"},[ge.InfoType.ERROR]:{icon:M.XCircleIcon,container:"bg-red-50 dark:bg-red-950 border-red-200 dark:border-red-800",iconColor:"text-red-600 dark:text-red-400",titleColor:"text-red-900 dark:text-red-100",descriptionColor:"text-red-700 dark:text-red-300"}},mi=({isVisible:e,onDismiss:r,title:a,description:n,variant:o=ge.InfoType.INFO,duration:s=5e3,icon:l,className:i,closeAriaLabel:d="Dismiss banner"})=>{const[c,h]=p.useState("hidden"),g=p.useRef(null),y=p.useRef(null),m=bi[o],b=m.icon,v=p.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null),y.current&&(clearTimeout(y.current),y.current=null)},[]),w=p.useCallback(()=>{v(),h("exiting"),y.current=setTimeout(()=>{h("hidden"),r()},300)},[v,r]);if(p.useEffect(()=>{e?(h("entering"),y.current=setTimeout(()=>{h("visible")},10)):(c==="visible"||c==="entering")&&w()},[e]),p.useEffect(()=>(c==="visible"&&s>0&&(g.current=setTimeout(()=>{w()},s)),()=>{g.current&&clearTimeout(g.current)}),[c,s,w]),p.useEffect(()=>()=>v(),[v]),c==="hidden")return null;const S=t.jsx("div",{role:"alert","aria-live":"polite","data-testid":"banner",className:f("fixed inset-x-0 top-0 z-[100] w-full","transition-all duration-300 ease-out",c==="entering"||c==="exiting"?"-translate-y-full opacity-0":"translate-y-0 opacity-100"),children:t.jsxs("div",{className:f("flex items-start gap-3 p-4 border-b shadow-lg","backdrop-blur-sm",m.container,i),children:[t.jsx("div",{className:f("flex-shrink-0 mt-0.5",m.iconColor),children:l||t.jsx(b,{className:"h-5 w-5"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:f("font-semibold",m.titleColor),children:a}),n&&t.jsx("p",{className:f("text-sm mt-1",m.descriptionColor),children:n})]}),t.jsx("button",{type:"button",onClick:w,className:f("flex-shrink-0 p-1 rounded-md transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus:ring-2 focus:ring-offset-2","focus:ring-current"),"aria-label":d,children:t.jsx(M.XMarkIcon,{className:f("h-5 w-5",m.iconColor)})})]})});return wr.createPortal(S,document.body)},yi=(e={})=>{const{defaultDuration:r=5e3}=e,[a,n]=p.useState(!1),[o,s]=p.useState(null),l=p.useCallback(({title:d,description:c,variant:h=ge.InfoType.INFO,duration:g=r})=>{s({title:d,description:c,variant:h,duration:g}),n(!0)},[r]),i=p.useCallback(()=>{n(!1)},[]);return{isVisible:a,bannerProps:o,showBanner:l,hideBanner:i}},ja=({isOpen:e,onClose:r,children:a,size:n="md",showCloseButton:o=!0,closeOnOutsideClick:s=!0,closeOnEscape:l=!0,className:i})=>{if(p.useEffect(()=>{if(!l||!e||!r)return;const h=g=>{g.key==="Escape"&&r()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,r,l]),!e)return null;const d={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-full mx-4"},c=()=>{s&&r&&r()};return t.jsxs(me,{children:[t.jsx(ar,{isOpen:e,onClose:c,opacity:"dark",blur:!0}),t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:f("relative w-full",d[n],"bg-white dark:bg-gray-900","rounded-lg shadow-xl","animate-in fade-in zoom-in-95 duration-200",i),onClick:h=>h.stopPropagation(),children:[o&&r&&t.jsx("button",{onClick:r,className:"absolute top-4 right-4 z-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors","aria-label":"Close dialog",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),a]})})]})},pi=({isOpen:e,onClose:r,items:a,placeholder:n="Type a command or search...",emptyMessage:o="No results found.",className:s})=>{const[l,i]=p.useState(""),[d,c]=p.useState(0),h=p.useRef(null),g=a.filter(v=>{const w=l.toLowerCase();return v.label.toLowerCase().includes(w)||v.keywords?.some(S=>S.toLowerCase().includes(w))||v.group?.toLowerCase().includes(w)}),y=g.reduce((v,w)=>{const S=w.group||"Commands";return v[S]||(v[S]=[]),v[S].push(w),v},{});p.useEffect(()=>{e||(i(""),c(0))},[e]),p.useEffect(()=>{e&&h.current&&h.current.focus()},[e]),p.useEffect(()=>{c(0)},[l]);const m=v=>{switch(v.key){case"ArrowDown":v.preventDefault(),c(w=>w<g.length-1?w+1:w);break;case"ArrowUp":v.preventDefault(),c(w=>w>0?w-1:w);break;case"Enter":v.preventDefault(),g[d]&&(g[d].onSelect(),r());break;case"Escape":v.preventDefault(),r();break}},b=v=>{v.onSelect(),r()};return t.jsxs(ja,{isOpen:e,onClose:r,size:"lg",showCloseButton:!1,className:f("overflow-hidden p-0",s),children:[t.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700 p-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{ref:h,type:"text",value:l,onChange:v=>i(v.target.value),onKeyDown:m,placeholder:n,className:"flex-1 bg-transparent border-none outline-none text-gray-900 dark:text-white placeholder-gray-500"})]})}),t.jsx("div",{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(y).length===0?t.jsx("div",{className:"px-4 py-8 text-sm text-gray-500 dark:text-gray-400 text-center",children:o}):Object.entries(y).map(([v,w])=>t.jsxs("div",{className:"mb-4 last:mb-0",children:[t.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:v}),t.jsx("div",{className:"space-y-1",children:w.map(S=>{const x=g.indexOf(S)===d;return t.jsxs("button",{onClick:()=>b(S),className:f("w-full flex items-center gap-3 px-3 py-2 rounded-md","text-sm text-left transition-colors",x?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-white"),children:[S.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:S.icon}),t.jsx("span",{className:"flex-1 truncate",children:S.label}),S.shortcut&&t.jsx("span",{className:"flex-shrink-0 text-xs text-gray-500 dark:text-gray-400 font-mono",children:S.shortcut})]},S.id)})})]},v))}),t.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 px-4 py-2 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↑"}),t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↓"}),"to navigate"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↵"}),"to select"]})]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"esc"}),"to close"]})]})]})},vi=Z.cva("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 transition-all duration-200",{variants:{variant:{default:"border-gray-200 dark:border-gray-700 border hover:shadow-lg",elevated:"shadow-lg hover:shadow-xl",minimal:"bg-transparent shadow-none border-none p-4"},trend:{none:"",up:"border-l-4 border-green-500",down:"border-l-4 border-red-500",neutral:"border-l-4 border-gray-400"}},defaultVariants:{variant:"default",trend:"none"}}),wi=({label:e,value:r,change:a,trend:n="none",icon:o,variant:s="default",className:l})=>{const i={up:"text-green-600 dark:text-green-400",down:"text-red-600 dark:text-red-400",neutral:"text-gray-600 dark:text-gray-400",none:"text-gray-600 dark:text-gray-400"},d={up:"↗",down:"↘",neutral:"→",none:""};return t.jsx("div",{className:f(vi({variant:s,trend:n}),l),children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:e}),t.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:r}),a&&t.jsxs("p",{className:f("text-sm font-medium flex items-center gap-1 mt-1",i[n||"none"]),children:[t.jsx("span",{children:d[n||"none"]}),a]})]}),o&&t.jsx("div",{className:"text-3xl opacity-80",children:o})]})})},ki=Z.cva("space-y-6",{variants:{variant:{default:"",card:"bg-white dark:bg-gray-800 rounded-lg border-gray-200 dark:border-gray-700 border p-6",minimal:"space-y-4"},spacing:{tight:"space-y-3",normal:"space-y-4",relaxed:"space-y-6",loose:"space-y-8"}},defaultVariants:{variant:"default",spacing:"normal"}}),xi=({title:e,description:r,children:a,variant:n="default",spacing:o="normal",className:s})=>t.jsxs("div",{className:f(ki({variant:n,spacing:o}),s),children:[(e||r)&&t.jsxs("div",{className:"space-y-1",children:[e&&t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:r})]}),a]}),Ni=Z.cva("flex flex-col items-center text-center space-y-4",{variants:{layout:{vertical:"flex-col items-center text-center",horizontal:"flex-row items-start text-left space-y-0 space-x-4",minimal:"flex-col space-y-2"},spacing:{tight:"space-y-2",normal:"space-y-4",relaxed:"space-y-6"},interactive:{true:"transition-all duration-200 hover:transform hover:scale-105 cursor-pointer",false:""}},defaultVariants:{layout:"vertical",spacing:"normal",interactive:!1}}),Ci=({icon:e,title:r,description:a,layout:n="vertical",spacing:o="normal",interactive:s=!1,className:l,onClick:i})=>t.jsxs("div",{className:f(Ni({layout:n,spacing:o,interactive:s}),l),onClick:i,children:[t.jsx("div",{className:"text-4xl mb-4 flex-shrink-0",children:e}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r}),t.jsx("div",{className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:a})]})]}),Si=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UfocusUindicator",children:r||"UfocusUindicator Component"}),Ei=({icon:e,size:r="md",shape:a="rounded",variant:n="blue-purple",gradientClasses:o,className:s,iconClassName:l})=>{const i={sm:{container:"w-10 h-10",icon:"h-5 w-5"},md:{container:"w-12 h-12",icon:"h-6 w-6"},lg:{container:"w-16 h-16",icon:"h-8 w-8"},xl:{container:"w-20 h-20",icon:"h-10 w-10"}},d={square:"rounded-lg",rounded:"rounded-xl",circle:"rounded-full"},c={"blue-purple":"bg-gradient-to-r from-blue-600 to-purple-600","green-blue":"bg-gradient-to-r from-green-600 to-blue-600","orange-red":"bg-gradient-to-r from-orange-600 to-red-600",gray:"bg-gradient-to-r from-gray-600 to-gray-800 dark:from-gray-700 dark:to-gray-900",custom:o||"bg-gradient-to-r from-blue-600 to-purple-600"},h=i[r];return t.jsx("div",{className:f("flex items-center justify-center flex-shrink-0",h.container,d[a],c[n],s),children:t.jsx(e,{className:f("text-white",h.icon,l)})})},Ti={sm:"w-12 h-12",md:"w-16 h-16",lg:"w-20 h-20",xl:"w-24 h-24"},Ai={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},Ii={primary:"bg-gradient-to-br from-blue-100 to-blue-200 text-blue-600 shadow-lg hover:shadow-blue-200",secondary:"bg-gradient-to-br from-purple-100 to-purple-200 text-purple-600 shadow-lg hover:shadow-purple-200",success:"bg-gradient-to-br from-green-100 to-green-200 text-green-600 shadow-lg hover:shadow-green-200",warning:"bg-gradient-to-br from-yellow-100 to-yellow-200 text-yellow-600 shadow-lg hover:shadow-yellow-200",error:"bg-gradient-to-br from-red-100 to-red-200 text-red-600 shadow-lg hover:shadow-red-200",neutral:"bg-gradient-to-br from-gray-100 to-gray-200 text-gray-600 shadow-lg hover:shadow-gray-200"},Li={square:"rounded-none",rounded:"rounded-2xl",circle:"rounded-full"},Mi={none:"",float:"animate-float",pulse:"animate-pulse",bounce:"animate-bounce-slow"},Pi=({children:e,size:r="lg",variant:a="primary",shape:n="rounded",animation:o="float",className:s})=>t.jsx("div",{className:f("flex items-center justify-center mx-auto mb-6 transition-all duration-300 group-hover:scale-105",Ti[r],Ii[a],Li[n],Mi[o],s),children:t.jsx("div",{className:f(Ai[r]),children:e})}),Oi=({icon:e,children:r,iconPosition:a="left",gap:n="md",iconSize:o="md",align:s="left",variant:l="default",className:i,iconClassName:d,textClassName:c})=>{const h={xs:"gap-1",sm:"gap-2",md:"gap-3",lg:"gap-4"},g={xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-8 w-8"},y={left:"text-left",center:"text-center items-center",right:"text-right items-end"},m={default:"text-gray-700 dark:text-gray-300",primary:"text-blue-600 dark:text-blue-400",success:"text-green-600 dark:text-green-400",warning:"text-yellow-600 dark:text-yellow-400",danger:"text-red-600 dark:text-red-400",muted:"text-gray-500 dark:text-gray-400"},b={left:"flex items-center",right:"flex flex-row-reverse items-center",top:"flex flex-col"};return t.jsxs("div",{className:f(b[a],h[n],a==="top"&&y[s],m[l],i),children:[t.jsx(e,{className:f(g[o],"flex-shrink-0",d)}),t.jsx("span",{className:f(c),children:r})]})};function Ui({title:e,subtitle:r,items:a,renderItem:n,keyExtractor:o,actions:s,emptyMessage:l="No items",emptyIcon:i,emptyAction:d,loading:c=!1,className:h,headerClassName:g,listClassName:y,spacing:m="none",showDividers:b=!1}){const v={none:"",sm:"space-y-1",md:"space-y-2",lg:"space-y-4"},w=(S="secondary")=>{const k="inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";switch(S){case"primary":return f(k,"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600");case"ghost":return f(k,"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800");case"secondary":default:return f(k,"bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700")}};return t.jsxs("div",{className:f("",h),children:[t.jsxs("div",{className:f("flex items-center justify-between gap-4 pb-4",g),children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),r&&t.jsx("p",{className:"mt-0.5 text-sm text-gray-500 dark:text-gray-400",children:r})]}),s&&s.length>0&&t.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:s.map(S=>t.jsxs("button",{onClick:S.onClick,disabled:S.disabled,className:w(S.variant),children:[S.icon,S.label]},S.id))})]}),c&&t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}),!c&&a.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[i&&t.jsx("div",{className:"mb-4 text-gray-400 dark:text-gray-500",children:i}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:l}),d&&t.jsx("button",{onClick:d.onClick,className:"mt-4 text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:d.label})]}),!c&&a.length>0&&t.jsx("div",{className:f(v[m],b&&"divide-y divide-gray-200 dark:divide-gray-700",y),children:a.map((S,k)=>t.jsx("div",{children:n(S,k)},o(S,k)))})]})}const Di=({children:e,title:r,variant:a="info",size:n="md",icon:o,bordered:s=!0,className:l})=>{const i={info:{bg:"bg-blue-50 dark:bg-blue-900/20",border:"border-blue-200 dark:border-blue-800",title:"text-blue-900 dark:text-blue-300",text:"text-blue-800 dark:text-blue-400",icon:"text-blue-600 dark:text-blue-400"},success:{bg:"bg-green-50 dark:bg-green-900/20",border:"border-green-200 dark:border-green-800",title:"text-green-900 dark:text-green-300",text:"text-green-800 dark:text-green-400",icon:"text-green-600 dark:text-green-400"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20",border:"border-yellow-200 dark:border-yellow-800",title:"text-yellow-900 dark:text-yellow-300",text:"text-yellow-800 dark:text-yellow-400",icon:"text-yellow-600 dark:text-yellow-400"},danger:{bg:"bg-red-50 dark:bg-red-900/20",border:"border-red-200 dark:border-red-800",title:"text-red-900 dark:text-red-300",text:"text-red-800 dark:text-red-400",icon:"text-red-600 dark:text-red-400"},neutral:{bg:"bg-gray-50 dark:bg-gray-800",border:"border-gray-200 dark:border-gray-700",title:"text-gray-900 dark:text-gray-100",text:"text-gray-700 dark:text-gray-300",icon:"text-gray-600 dark:text-gray-400"}},d={sm:"p-3",md:"p-4",lg:"p-6"},c=i[a];return t.jsxs("div",{className:f("rounded-lg",c.bg,s&&`border ${c.border}`,d[n],l),children:[(r||o)&&t.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[o&&t.jsx(o,{className:f("h-5 w-5 flex-shrink-0 mt-0.5",c.icon)}),r&&t.jsx("h3",{className:f(O.body.strong.md(),c.title),children:r})]}),t.jsx("div",{className:f(!r&&!o&&c.text),children:e})]})},ji=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UkeyboardUshortcut",children:r||"UkeyboardUshortcut Component"}),_i=({size:e="md",className:r="",showText:a=!0,onClick:n,logoSrc:o="/logo.png",logoAlt:s="Logo",logoText:l,fontFamily:i="Dancing Script, cursive"})=>{const c=(()=>{switch(e){case"sm":return{container:"space-x-2",image:"h-6 w-6",text:"text-lg"};case"md":return{container:"space-x-2",image:"h-8 w-8",text:"text-2xl"};case"lg":return{container:"space-x-3",image:"h-10 w-10",text:"text-3xl"};case"xl":return{container:"space-x-4",image:"h-12 w-12",text:"text-4xl"};default:return{container:"space-x-2",image:"h-8 w-8",text:"text-2xl"}}})(),h=t.jsxs(t.Fragment,{children:[t.jsx("img",{src:o,alt:s,className:c.image}),a&&t.jsx("div",{className:`${c.text} font-bold text-gray-900 dark:text-gray-100`,style:{fontFamily:i,fontWeight:"700"},children:l})]});return n?t.jsx("button",{onClick:n,className:`flex items-center ${c.container} ${r} hover:opacity-80 transition-opacity`,children:h}):t.jsx("div",{className:`flex items-center ${c.container} ${r}`,children:h})},zi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmorphUtransition",children:r||"UmorphUtransition Component"}),Bi=({title:e,description:r,count:a,countLabel:n,action:o,loading:s=!1,loadingText:l="Loading...",size:i="md",className:d})=>{const h={sm:{title:O.heading.h4(),description:O.body.sm(),count:O.caption.default()},md:{title:O.heading.h3(),description:O.body.md(),count:O.body.sm()},lg:{title:O.heading.h2(),description:O.body.lg(),count:O.body.md()}}[i];return t.jsxs("div",{className:f("flex items-start justify-between gap-4",d),children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx("h2",{className:f(h.title,"text-gray-900 dark:text-gray-100"),children:e}),a!==void 0&&t.jsxs("span",{className:f(h.count,"text-gray-500 dark:text-gray-400"),children:["(",a,n&&` ${n}`,")"]}),s&&t.jsxs("span",{className:f(h.count,"text-gray-500 dark:text-gray-400 flex items-center gap-2"),children:[t.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),l]})]}),r&&t.jsx("p",{className:f(h.description,"mt-1 text-gray-600 dark:text-gray-400"),children:r})]}),o&&t.jsx("div",{className:"flex-shrink-0",children:o})]})},Fi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UparallaxUscroll",children:r||"UparallaxUscroll Component"}),Wi=({actions:e,orientation:r="horizontal",columns:a=3,className:n})=>{const o={default:"bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800 text-gray-900 dark:text-white border-gray-200 dark:border-gray-700",primary:"bg-blue-500 hover:bg-blue-600 text-white border-blue-500",success:"bg-green-500 hover:bg-green-600 text-white border-green-500",warning:"bg-yellow-500 hover:bg-yellow-600 text-white border-yellow-500",danger:"bg-red-500 hover:bg-red-600 text-white border-red-500"},s={horizontal:"flex flex-wrap gap-2",vertical:"flex flex-col gap-2",grid:"grid gap-2"};return t.jsx("div",{className:f(s[r],r==="grid"&&`grid-cols-${a}`,n),style:r==="grid"?{gridTemplateColumns:`repeat(${a}, 1fr)`}:void 0,children:e.map(l=>t.jsxs("button",{onClick:l.onClick,disabled:l.disabled,className:f("flex items-center justify-center gap-2 px-4 py-3 rounded-lg border transition-colors font-medium",o[l.variant||"default"],l.disabled&&"opacity-50 cursor-not-allowed"),children:[l.icon&&t.jsx("span",{className:"w-5 h-5",children:l.icon}),t.jsx("span",{children:l.label})]},l.id))})},$i=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UrevealUonUscroll",children:r||"UrevealUonUscroll Component"}),Vi={sm:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"},md:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"},lg:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"}},Hi=({icon:e,text:r,variant:a="default",size:n="md",className:o})=>{const{container:s,icon:l}=ko(a),i=Vi[n];return t.jsxs("div",{className:f("inline-flex items-center rounded-full mb-6",s,i.container,o),children:[t.jsx("div",{className:f("animate-float-icon",l,i.icon),children:e}),t.jsx("span",{className:i.text,children:r})]})},qi=({title:e,onAdd:r,addButtonTooltip:a,loading:n,className:o=""})=>t.jsx("div",{className:`p-4 border-b border-gray-200 dark:border-gray-700 ${o}`,children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t.jsxs("div",{className:"flex items-center space-x-2",children:[n&&t.jsx("div",{className:"w-5 h-5 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"}),r&&t.jsx("button",{onClick:r,className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:a,"aria-label":a||"Add",children:t.jsx("svg",{className:"w-5 h-5 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]})]})}),Gi=e=>{switch(e){case"cog":return M.Cog6ToothIcon;case"arrow-right":return M.ArrowRightIcon;case"shield":return M.ShieldCheckIcon;case"reply":case"chat":return M.ChatBubbleLeftRightIcon;case"filter":return M.FunnelIcon;case"plug":return M.LinkIcon;case"adjustments":return M.AdjustmentsHorizontalIcon;case"currency-dollar":return M.CurrencyDollarIcon;default:return M.Cog6ToothIcon}},Yi=({settings:e,selectedSetting:r,onSettingSelect:a,className:n=""})=>t.jsx("nav",{className:f("space-y-1",n),"aria-label":"Settings navigation",children:t.jsx("ul",{className:"space-y-1",role:"list",children:e.map(o=>{const s=Gi(o.icon),l=r===o.id;return t.jsx("li",{children:t.jsx("button",{onClick:()=>a(o.id),className:f("w-full flex items-center text-left px-3 py-2 rounded-lg transition-colors h-[44px]",O.body.sm(),l?"bg-orange-100 dark:bg-orange-900/30 text-orange-700 dark:text-orange-300":"hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300"),"aria-current":l?"page":void 0,title:o.description,children:t.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[t.jsx(s,{className:"h-5 w-5 mr-3 flex-shrink-0","aria-hidden":"true"}),t.jsx("span",{className:"truncate",children:o.title})]})})},o.id)})})}),Ki=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UskipUnavigation",children:r||"UskipUnavigation Component"}),Zi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsortUdropdown",children:r||"UsortUdropdown Component"}),Xi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UversionUbadge",children:r||"UversionUbadge Component"}),Qi=({children:e,as:r="span"})=>t.jsx(r,{className:"sr-only",children:e}),Ji=({time:e,isActive:r=!0,size:a="sm",showIcon:n=!0,className:o})=>{const s={sm:"gap-1.5",md:"gap-2",lg:"gap-2.5"},l={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},i={sm:"sm",md:"base",lg:"lg"};return t.jsxs("div",{className:f("flex items-center",s[a],o),role:"timer","aria-label":`Timer: ${e}`,children:[n&&t.jsx("svg",{className:f(l[a],r?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),t.jsx(It,{as:"span",size:i[a],weight:"medium",color:r?"default":"muted",className:"font-mono tabular-nums",children:e})]})},Ri=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],ec=({show:e,onComplete:r,particleCount:a=50,duration:n=3e3,colors:o=Ri,className:s})=>{const[l,i]=p.useState([]),[d,c]=p.useState(!1);p.useEffect(()=>{if(e&&!d){c(!0);const g=[];for(let m=0;m<a;m++){const b=Math.PI*2*m/a+Math.random()*.5,v=2+Math.random()*4;g.push({id:m,x:50,y:50,vx:Math.cos(b)*v,vy:Math.sin(b)*v-2,color:o[Math.floor(Math.random()*o.length)],size:8+Math.random()*8,rotation:Math.random()*360,rotationSpeed:(Math.random()-.5)*20,isCircle:Math.random()>.5})}i(g);const y=setTimeout(()=>{c(!1),i([]),r?.()},n);return()=>clearTimeout(y)}},[e,d,r,a,n,o]);const h=p.useCallback(()=>{i(g=>g.map(y=>({...y,x:y.x+y.vx*.5,y:y.y+y.vy*.5,vy:y.vy+.15,rotation:y.rotation+y.rotationSpeed})))},[]);return p.useEffect(()=>{if(!d||l.length===0)return;const g=setInterval(h,16);return()=>clearInterval(g)},[d,l.length,h]),!d||l.length===0?null:t.jsx("div",{className:f("fixed inset-0 pointer-events-none z-50 overflow-hidden",s),"aria-hidden":"true",children:l.map(g=>t.jsx("div",{className:"absolute",style:{left:`${g.x}%`,top:`${g.y}%`,width:g.size,height:g.size,backgroundColor:g.color,transform:`rotate(${g.rotation}deg)`,borderRadius:g.isCircle?"50%":"2px",opacity:Math.max(0,1-g.y/150)}},g.id))})},ur=Z.cva("transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-sm",{variants:{variant:{subtle:O.link.subtle(),default:O.link.default(),muted:O.link.muted(),external:O.link.external(),inherit:"text-inherit hover:text-blue-600 dark:hover:text-blue-400 underline-offset-2 hover:underline transition-colors duration-200"},size:{sm:"text-sm",default:"text-base",lg:"text-lg"}},defaultVariants:{variant:"subtle",size:"default"}}),Xr=G.forwardRef(({className:e,variant:r,size:a,to:n,href:o,external:s,children:l,onTrack:i,trackingLabel:d,componentName:c,onClick:h,...g},y)=>{const m=n||o,b=s||m&&(m.startsWith("http")||m.startsWith("mailto:")),v=w=>{i&&i({action:"click",trackingLabel:d,componentName:c}),h?.(w)};return m?b?t.jsx("a",{className:f(ur({variant:r==="subtle"?"external":r,size:a,className:e})),href:m,target:"_blank",rel:"noopener noreferrer",ref:y,onClick:v,...g,children:l}):t.jsx(X.Link,{className:f(ur({variant:r,size:a,className:e})),to:m,ref:y,onClick:v,...g,children:l}):t.jsx("span",{className:f(ur({variant:r,size:a,className:e})),onClick:v,...g,children:l})});Xr.displayName="SmartLink";const rc=(e,r)=>G.useMemo(()=>{let a=e;return Object.entries(r).forEach(([n,o])=>{const s=new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"gi");a=a.replace(s,l=>`<SmartLink to="${o}" variant="subtle">${l}</SmartLink>`)}),a},[e,r]),tc={documentation:"/document",settings:"/settings",about:"/about",contact:"/contact","privacy policy":"/privacy",privacy:"/privacy","terms of service":"/terms",terms:"/terms","cookie policy":"/cookies",cookies:"/cookies",points:"/points","earn points":"/how-to-earn-points","how to earn points":"/how-to-earn-points","connect wallet":"/connect","connect your wallet":"/connect","wallet connection":"/connect",wallet:"/connect",compose:"/compose","compose email":"/compose","send email":"/compose",mail:"/mail",email:"/mail",inbox:"/mail",dashboard:"/mail",delegate:"/delegate",delegation:"/delegate",manage:"/manage","manage preferences":"/preferences",profile:"/settings",account:"/settings",preferences:"/preferences",token:"/token","web3 users":"/web3-users","web3 projects":"/web3-projects","get started":"/connect","start here":"/connect","learn more":"/document","read more":"/document","our features":"/document",support:"/contact",help:"/document","contact us":"/contact"},ac=({children:e,mappings:r=tc,className:a,variant:n="subtle"})=>{const o=G.useMemo(()=>{if(!e||typeof e!="string")return e||"";let l=e;return Object.entries(r).sort(([d],[c])=>c.length-d.length).forEach(([d,c])=>{if(d&&c){const h=new RegExp(`\\b${d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"gi");l=l.replace(h,g=>`__LINK_START__${c}__LINK_MID__${g}__LINK_END__`)}}),l},[e,r]);if(!o||typeof o!="string")return t.jsx("span",{className:a,children:e});const s=o.split(/(__LINK_START__.*?__LINK_END__)/);return t.jsx("span",{className:a,children:s.map((l,i)=>{const d=l.match(/__LINK_START__(.*?)__LINK_MID__(.*?)__LINK_END__/);if(d){const[,c,h]=d;return t.jsx(Xr,{to:c,variant:n,children:h},i)}return l})})},nc=({href:e,children:r,variant:a="default",external:n=!1,showExternalIcon:o=!1,disabled:s=!1,className:l,onTrack:i,trackingLabel:d,componentName:c,onClick:h,...g})=>{const y=n||e.startsWith("http://")||e.startsWith("https://"),m={default:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300",primary:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",secondary:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100",muted:"text-gray-500 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",underline:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 underline"},b=y?{target:"_blank",rel:"noopener noreferrer"}:{},v=w=>{i&&i({action:"click",trackingLabel:d,componentName:c}),h?.(w)};return s?t.jsxs("span",{className:f("cursor-not-allowed opacity-50",m[a],l),children:[r,o&&y&&t.jsx(M.ArrowTopRightOnSquareIcon,{className:"inline-block h-4 w-4 ml-1"})]}):t.jsxs("a",{href:e,className:f("inline-flex items-center transition-colors",m[a],l),onClick:v,...b,...g,children:[r,o&&y&&t.jsx(M.ArrowTopRightOnSquareIcon,{className:"inline-block h-4 w-4 ml-1 flex-shrink-0"})]})},oc=({href:e,children:r,showIcon:a=!0,iconPosition:n="right",size:o="md",variant:s="default",className:l,onClick:i})=>{const d={sm:{text:O.body.sm(),icon:"h-3 w-3",gap:"gap-1"},md:{text:O.body.md(),icon:"h-4 w-4",gap:"gap-1.5"},lg:{text:O.body.lg(),icon:"h-5 w-5",gap:"gap-2"}},c={default:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300",primary:"text-blue-700 dark:text-blue-300 hover:text-blue-800 dark:hover:text-blue-200 font-semibold",muted:"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"},h=d[o];return t.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:i,className:f("inline-flex items-center",h.gap,h.text,c[s],"underline decoration-1 underline-offset-2","hover:decoration-2","transition-all duration-200",l),children:[a&&n==="left"&&t.jsx(M.ArrowTopRightOnSquareIcon,{className:f(h.icon,"flex-shrink-0")}),t.jsx("span",{children:r}),a&&n==="right"&&t.jsx(M.ArrowTopRightOnSquareIcon,{className:f(h.icon,"flex-shrink-0")})]})},gr=new Set,sc=()=>{gr.clear()},lc=e=>gr.has(e);function ic(e,r,a,n){let o=e;if(a.length>0){const s=new RegExp(`^/(${a.join("|")})/`);o=o.replace(s,"/")}for(const{pattern:s,replacement:l}of n)o=o.replace(s,l);if(r[o])return r[o];for(const[s,l]of Object.entries(r))if(o.endsWith(s))return l}const cc=({preload:e,preloadDelay:r=50,routeModules:a={},languagePrefixes:n=[],pathNormalizations:o=[],to:s,children:l,onMouseEnter:i,onMouseLeave:d,onFocus:c,...h})=>{const g=p.useRef(null),y=p.useCallback(()=>{const S=typeof s=="string"?s:s.pathname||"";if(gr.has(S))return;const k=e||ic(S,a,n,o);k&&(g.current=setTimeout(()=>{k().then(()=>{gr.add(S)}).catch(()=>{})},r))},[e,r,s,a,n,o]),m=p.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null)},[]),b=p.useCallback(S=>{y(),i?.(S)},[y,i]),v=p.useCallback(S=>{m(),d?.(S)},[m,d]),w=p.useCallback(S=>{y(),c?.(S)},[y,c]);return t.jsx(X.Link,{to:s,onMouseEnter:b,onMouseLeave:v,onFocus:w,...h,children:l})},dc=({items:e,separator:r="/",className:a})=>t.jsx("nav",{className:f("flex items-center gap-2 text-sm",a),children:e.map((n,o)=>t.jsxs(p.Fragment,{children:[o>0&&t.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:r}),o===e.length-1?t.jsx("span",{className:"text-gray-900 dark:text-white font-medium",children:n.label}):t.jsx("button",{onClick:n.onClick,className:"text-blue-600 dark:text-blue-400 hover:underline",children:n.label})]},o))}),_a=G.forwardRef(({onTrack:e,trackingLabel:r,componentName:a,onValueChange:n,children:o,...s},l)=>{const i=d=>{e&&e({action:"change",trackingLabel:r,componentName:a}),n?.(d)};return t.jsx(be.Root,{ref:l,onValueChange:i,...s,children:o})});_a.displayName="Tabs";const za=G.forwardRef(({className:e,...r},a)=>t.jsx(be.List,{ref:a,className:f(z.navigation.tabs.list(),e),...r}));za.displayName=be.List.displayName;const Ba=G.forwardRef(({className:e,...r},a)=>t.jsx(be.Trigger,{ref:a,className:f(z.navigation.tabs.trigger(),e),...r}));Ba.displayName=be.Trigger.displayName;const Fa=G.forwardRef(({className:e,...r},a)=>t.jsx(be.Content,{ref:a,className:f(z.navigation.tabs.content(),e),...r}));Fa.displayName=be.Content.displayName;const uc=({items:e,orientation:r="horizontal",className:a})=>{const[n,o]=p.useState(new Set),s=i=>{o(d=>{const c=new Set(d);return c.has(i)?c.delete(i):c.add(i),c})},l=(i,d)=>{const c=i.children&&i.children.length>0,h=n.has(d),g=t.jsxs(t.Fragment,{children:[i.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:i.icon}),t.jsx("span",{className:"flex-1",children:i.label}),c&&t.jsx("svg",{className:f("w-4 h-4 transition-transform",r==="horizontal"&&!h&&"-rotate-90",h&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y=f("flex items-center gap-2 px-4 py-2 text-sm font-medium","transition-colors",i.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800");return t.jsxs("div",{children:[c?t.jsx("button",{onClick:()=>s(d),className:f(y,"w-full"),children:g}):i.href?t.jsx("a",{href:i.href,className:y,onClick:i.onClick,children:g}):t.jsx("button",{onClick:i.onClick,className:f(y,"w-full"),children:g}),c&&h&&t.jsx("div",{className:f("bg-gray-50 dark:bg-gray-800/50",r==="horizontal"?"pl-4":"border-l-2 border-gray-200 dark:border-gray-700 ml-4"),children:i.children.map((m,b)=>t.jsx("div",{children:m.href?t.jsxs("a",{href:m.href,onClick:m.onClick,className:f("flex items-center gap-2 px-4 py-2 text-sm","transition-colors",m.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"),children:[m.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:m.icon}),m.label]}):t.jsxs("button",{onClick:m.onClick,className:f("w-full flex items-center gap-2 px-4 py-2 text-sm","transition-colors",m.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"),children:[m.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:m.icon}),m.label]})},b))})]},d)};return t.jsx("nav",{className:f("bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg",r==="horizontal"?"flex flex-wrap":"flex flex-col",a),children:e.map((i,d)=>l(i,d))})},gc=({items:e,selectedPath:r,onSelect:a,variant:n="default",className:o})=>{const s=n==="compact"?"space-y-1":"space-y-0";return t.jsx("div",{className:f(s,o),children:e.map(l=>{const i=l.icon,d=r===l.path,c=l.disabled,h=f("flex items-start cursor-pointer transition-colors",n==="compact"?"p-3 rounded-lg":"p-4 border-b border-gray-200 dark:border-gray-700 last:border-b-0",c&&"opacity-50 cursor-not-allowed"),g=d?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300";return t.jsxs("div",{onClick:()=>!c&&a(l.path),className:f(h,!c&&g),role:"button",tabIndex:c?-1:0,"aria-current":d?"page":void 0,"aria-disabled":c,onKeyDown:y=>{!c&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),a(l.path))},children:[t.jsx(i,{className:"h-5 w-5 mt-0.5 mr-3 flex-shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:f("font-medium",O.body.md()),children:[l.label,l.badge!==void 0&&l.badge>0&&t.jsx("span",{className:"ml-2 inline-flex items-center justify-center px-2 py-0.5 text-xs font-medium bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-full",children:l.badge})]}),l.description&&t.jsx("div",{className:f("text-xs text-gray-500 dark:text-gray-400 mt-0.5"),children:l.description})]})]},l.id)})})},hc=({items:e,className:r})=>t.jsx("nav",{className:f("flex flex-col gap-1",r),children:e.map(a=>t.jsxs("button",{onClick:a.onClick,className:f("flex items-center gap-3 px-4 py-3 rounded-lg transition-colors",a.active?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"),children:[a.icon&&t.jsx("span",{className:"w-5 h-5",children:a.icon}),t.jsx("span",{className:"flex-1 text-left font-medium",children:a.label}),a.badge&&t.jsx("span",{className:"px-2 py-0.5 bg-gray-200 dark:bg-gray-700 rounded text-xs",children:a.badge})]},a.id))}),fc=({currentPage:e,totalPages:r,onPageChange:a,siblingCount:n=1,showFirstLast:o=!1,size:s="md",className:l})=>{const d={sm:{button:"h-8 w-8 text-xs",icon:"h-3 w-3",text:O.body.sm()},md:{button:"h-10 w-10 text-sm",icon:"h-4 w-4",text:O.body.md()},lg:{button:"h-12 w-12 text-base",icon:"h-5 w-5",text:O.body.lg()}}[s],h=(()=>{const k=[];k.push(1);const x=Math.max(e-n,2),N=Math.min(e+n,r-1);x>2&&k.push("ellipsis");for(let E=x;E<=N;E++)k.push(E);return N<r-1&&k.push("ellipsis"),r>1&&k.push(r),k})(),g=()=>{e>1&&a(e-1)},y=()=>{e<r&&a(e+1)},m=()=>{a(1)},b=()=>{a(r)},v=f("inline-flex items-center justify-center","rounded-md border border-gray-300 dark:border-gray-600","transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500","disabled:opacity-50 disabled:cursor-not-allowed"),w=k=>f(v,d.button,d.text,k?"bg-blue-600 text-white border-blue-600 dark:bg-blue-500 dark:border-blue-500":"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"),S=f(v,d.button,"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700");return t.jsxs("nav",{className:f("flex items-center gap-1",l),"aria-label":"Pagination",children:[o&&t.jsx("button",{onClick:m,disabled:e===1,className:S,"aria-label":"Go to first page",children:t.jsx("span",{className:d.text,children:"First"})}),t.jsx("button",{onClick:g,disabled:e===1,className:S,"aria-label":"Go to previous page",children:t.jsx(M.ChevronLeftIcon,{className:d.icon})}),h.map((k,x)=>k==="ellipsis"?t.jsx("span",{className:f("inline-flex items-center justify-center",d.button,"text-gray-400 dark:text-gray-500"),children:"..."},`ellipsis-${x}`):t.jsx("button",{onClick:()=>a(k),className:w(k===e),"aria-label":`Go to page ${k}`,"aria-current":k===e?"page":void 0,children:k},k)),t.jsx("button",{onClick:y,disabled:e===r,className:S,"aria-label":"Go to next page",children:t.jsx(M.ChevronRightIcon,{className:d.icon})}),o&&t.jsx("button",{onClick:b,disabled:e===r,className:S,"aria-label":"Go to last page",children:t.jsx("span",{className:d.text,children:"Last"})})]})},bc=({currentPage:e,totalPages:r,onPageChange:a,maxVisible:n=7,className:o})=>{const s=[];if(r<=n)for(let l=1;l<=r;l++)s.push(l);else{s.push(1),e>3&&s.push("...");const l=Math.max(2,e-1),i=Math.min(r-1,e+1);for(let d=l;d<=i;d++)s.push(d);e<r-2&&s.push("..."),s.push(r)}return t.jsxs("nav",{className:f("flex items-center gap-1",o),children:[t.jsx("button",{onClick:()=>a(e-1),disabled:e===1,className:"px-3 py-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),s.map((l,i)=>l==="..."?t.jsx("span",{className:"px-3 py-2",children:"..."},`ellipsis-${i}`):t.jsx("button",{onClick:()=>a(l),className:f("px-3 py-2 rounded",l===e?"bg-blue-500 text-white":"hover:bg-gray-100 dark:hover:bg-gray-800"),children:l},l)),t.jsx("button",{onClick:()=>a(e+1),disabled:e===r,className:"px-3 py-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})},mc=({steps:e,currentStep:r,orientation:a="horizontal",clickable:n=!1,onStepClick:o,className:s})=>{const l=d=>{n&&o&&o(d)},i=d=>d<r?"completed":d===r?"active":"upcoming";return a==="horizontal"?t.jsx("div",{className:f("w-full",s),children:t.jsx("div",{className:"flex items-center justify-between",children:e.map((d,c)=>{const h=i(c),g=c===e.length-1;return t.jsxs(p.Fragment,{children:[t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx("button",{onClick:()=>l(c),disabled:!n,className:f("flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all","disabled:cursor-default",n&&"hover:scale-110",h==="completed"&&"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500",h==="active"&&"bg-white dark:bg-gray-900 border-blue-600 dark:border-blue-500",h==="upcoming"&&"bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-700"),children:h==="completed"?t.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):d.icon?t.jsx("span",{className:f("w-5 h-5",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:d.icon}):t.jsx("span",{className:f("text-sm font-semibold",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:c+1})}),t.jsxs("div",{className:"mt-2 text-center",children:[t.jsx("p",{className:f("text-sm font-medium",h==="active"?"text-blue-600 dark:text-blue-500":h==="completed"?"text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:d.label}),d.description&&t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:d.description})]})]}),!g&&t.jsx("div",{className:"flex-1 h-0.5 mx-2 bg-gray-300 dark:bg-gray-700 relative",children:t.jsx("div",{className:f("absolute left-0 top-0 h-full bg-blue-600 dark:bg-blue-500 transition-all duration-300",c<r?"w-full":"w-0")})})]},d.id)})})}):t.jsx("div",{className:f("w-full",s),children:t.jsx("div",{className:"space-y-4",children:e.map((d,c)=>{const h=i(c),g=c===e.length-1;return t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx("button",{onClick:()=>l(c),disabled:!n,className:f("flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all","disabled:cursor-default flex-shrink-0",n&&"hover:scale-110",h==="completed"&&"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500",h==="active"&&"bg-white dark:bg-gray-900 border-blue-600 dark:border-blue-500",h==="upcoming"&&"bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-700"),children:h==="completed"?t.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):d.icon?t.jsx("span",{className:f("w-5 h-5",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:d.icon}):t.jsx("span",{className:f("text-sm font-semibold",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:c+1})}),!g&&t.jsx("div",{className:"w-0.5 flex-1 min-h-[32px] bg-gray-300 dark:bg-gray-700 relative mt-2",children:t.jsx("div",{className:f("absolute top-0 left-0 w-full bg-blue-600 dark:bg-blue-500 transition-all duration-300",c<r?"h-full":"h-0")})})]}),t.jsxs("div",{className:"flex-1 pb-4",children:[t.jsx("p",{className:f("text-sm font-medium",h==="active"?"text-blue-600 dark:text-blue-500":h==="completed"?"text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:d.label}),d.description&&t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:d.description})]})]},d.id)})})})},yc=({steps:e,currentStep:r,onStepClick:a,orientation:n="horizontal",className:o})=>t.jsx("nav",{className:f(n==="horizontal"?"flex items-center":"flex flex-col",o),children:e.map((s,l)=>t.jsxs("div",{className:f("flex items-center",n==="vertical"&&"flex-col items-start"),children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:()=>a?.(l),disabled:l>r,className:f("w-10 h-10 rounded-full flex items-center justify-center font-semibold transition-colors",l<r&&"bg-green-500 text-white",l===r&&"bg-blue-500 text-white",l>r&&"bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400"),children:l<r?"✓":l+1}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:s.label}),s.description&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:s.description})]})]}),l<e.length-1&&t.jsx("div",{className:f(n==="horizontal"?"w-full h-0.5 mx-4":"h-8 w-0.5 ml-5 my-2","bg-gray-300 dark:bg-gray-700")})]},s.id))}),pc=({subsections:e,isExpanded:r,selectedSubsection:a,parentSectionId:n,onSubsectionSelect:o})=>{const s=p.useRef(null),[l,i]=p.useState(void 0);return p.useEffect(()=>{if(s.current){const d=s.current.scrollHeight;i(r?d+8:0)}},[r,e]),t.jsx("div",{className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:l!==void 0?`${l}px`:"auto"},children:t.jsx("div",{ref:s,className:"ml-6 mt-2 space-y-1",children:e.map(d=>t.jsx("button",{onClick:()=>o?.(d.id,n),className:`block w-full text-left px-3 py-2 rounded-md text-sm transition-all duration-200 hover:scale-[1.02] ${a===d.id?"bg-blue-100 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 shadow-sm":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-800 dark:hover:text-gray-200"}`,children:d.title},d.id))})})},vc=({sections:e,selectedSection:r,selectedSubsection:a,expandedSections:n,onSectionSelect:o,onSubsectionSelect:s,onToggleSection:l,className:i=""})=>t.jsx("nav",{className:`space-y-2 ${i}`,children:e.map(d=>t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("button",{onClick:()=>o(d.id),className:`flex-1 text-left px-3 py-2 rounded-md text-sm font-medium transition-all duration-200 hover:scale-[1.02] ${r===d.id&&!a?"bg-blue-100 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 shadow-sm":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-gray-100"}`,children:d.title}),d.subsections&&d.subsections.length>0&&t.jsx("button",{onClick:()=>l(d.id),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 hover:scale-110 transition-all duration-200",children:t.jsx(M.ChevronRightIcon,{className:`h-4 w-4 text-gray-500 transition-transform duration-300 ease-in-out ${n.includes(d.id)?"rotate-90":"rotate-0"}`})})]}),d.subsections&&t.jsx(pc,{subsections:d.subsections,isExpanded:n.includes(d.id),selectedSubsection:a,parentSectionId:d.id,onSubsectionSelect:s})]},d.id))});function wc({columns:e,data:r,keyExtractor:a,sort:n,onSort:o,onRowClick:s,striped:l=!1,hoverable:i=!1,compact:d=!1,bordered:c=!1,emptyMessage:h="No data available",className:g}){const y=b=>{b.sortable&&o&&o(b.key)},m={left:"text-left",center:"text-center",right:"text-right"};return t.jsx("div",{className:f("w-full overflow-x-auto",g),children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:t.jsx("tr",{children:e.map(b=>t.jsx("th",{className:f(d?"px-3 py-2":"px-6 py-3","text-xs font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wider",m[b.align||"left"],b.sortable&&"cursor-pointer select-none hover:bg-gray-100 dark:hover:bg-gray-700",c&&"border-r border-gray-200 dark:border-gray-700 last:border-r-0"),style:{width:b.width},onClick:()=>b.sortable&&y(b),children:t.jsxs("div",{className:"flex items-center gap-2",children:[b.label,b.sortable&&t.jsx("span",{className:"flex flex-col",children:n?.column===b.key?n.direction==="asc"?t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M5 10l5-5 5 5H5z"})}):t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M15 10l-5 5-5-5h10z"})}):t.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M5 10l5-5 5 5H5z"})})})]})},b.key))})}),t.jsx("tbody",{className:"bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700",children:r.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:"px-6 py-8 text-center text-sm text-gray-500 dark:text-gray-400",children:h})}):r.map((b,v)=>t.jsx("tr",{className:f(l&&v%2===1&&"bg-gray-50 dark:bg-gray-800/50",i&&"hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",s&&"cursor-pointer"),onClick:()=>s?.(b,v),children:e.map(w=>t.jsx("td",{className:f(d?"px-3 py-2":"px-6 py-4","text-sm text-gray-900 dark:text-white",m[w.align||"left"],c&&"border-r border-gray-200 dark:border-gray-700 last:border-r-0"),children:w.render?w.render(b,v):b[w.key]},w.key))},a(b,v)))})]})})}const kc=({data:e,columns:r,hasActions:a=!1,renderCell:n,renderAction:o,emptyMessage:s="No data available",getRowKey:l=(d,c)=>String(c),className:i=""})=>!e||e.length===0?t.jsx("div",{className:`text-center py-8 bg-gray-50 dark:bg-gray-800 rounded-lg ${i}`,children:t.jsx("p",{className:`${O.body.sm()} text-gray-500 dark:text-gray-400`,children:s})}):t.jsx("div",{className:`relative ${i}`,children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full border-collapse",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700",children:[r.map((d,c)=>t.jsx("th",{className:`${O.label.default()} text-left py-3 px-4 whitespace-nowrap`,children:d},c)),a&&t.jsx("th",{className:`${O.label.default()} text-right py-3 px-4 sticky right-0 bg-white dark:bg-gray-900 whitespace-nowrap`})]})}),t.jsx("tbody",{children:e.map((d,c)=>t.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[r.map((h,g)=>{const y=n(d,g);return t.jsx("td",{className:"py-3 px-4",children:typeof y=="string"?t.jsx("span",{className:O.body.sm(),children:y}):y},g)}),a&&t.jsx("td",{className:"py-3 px-4 text-right sticky right-0 bg-white dark:bg-gray-900",children:o?.(d)})]},l(d,c)))})]})})}),xc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdataUgrid",children:r||"UdataUgrid Component"}),Nc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UpivotUtable",children:r||"UpivotUtable Component"}),Cc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UspreadsheetUgrid",children:r||"UspreadsheetUgrid Component"}),Sc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UcolumnUresize",children:r||"UcolumnUresize Component"}),Ec=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UcellUeditor",children:r||"UcellUeditor Component"}),Tc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UtableUreservation",children:r||"UtableUreservation Component"}),Ac=({children:e,type:r="unordered",spacing:a="sm",marker:n,size:o="md",className:s})=>{const l=r==="ordered"?"ol":"ul",i={none:"space-y-0",sm:"space-y-1",md:"space-y-2",lg:"space-y-4"},d={sm:"text-sm",md:"text-base",lg:"text-lg"},c=()=>n==="none"?"list-none":r==="unordered"?{disc:"list-disc",circle:"list-circle",square:"list-square",decimal:"list-disc",alpha:"list-disc",roman:"list-disc",none:"list-none"}[n||"disc"]:{decimal:"list-decimal",alpha:"list-alpha",roman:"list-roman",disc:"list-decimal",circle:"list-decimal",square:"list-decimal",none:"list-none"}[n||"decimal"];return t.jsx(l,{className:f("ml-6",c(),i[a],d[o],"text-gray-900 dark:text-gray-100",s),children:e})},Ic=({children:e,className:r})=>t.jsx("li",{className:f("leading-relaxed",r),children:e}),Lc=({children:e,onAction:r,actionText:a="Remove",actionIcon:n=M.TrashIcon,destructive:o=!0,isProcessing:s=!1,variant:l="default",className:i})=>{const d="flex items-center justify-between p-4 rounded-lg transition-colors",c={default:"bg-gray-50 dark:bg-gray-700",compact:"bg-gray-50 dark:bg-gray-700 py-2 px-3",elevated:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 shadow-sm hover:shadow-md"};return t.jsxs("div",{className:f(d,c[l],i),children:[t.jsx("div",{className:"flex-1 text-sm text-gray-900 dark:text-white",children:e}),t.jsxs(ne,{variant:o?"ghost":"outline",size:"sm",onClick:r,disabled:s,className:f("ml-4",o&&"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-900/20"),children:[t.jsx(n,{className:"h-4 w-4 mr-1"}),a]})]})},Mc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UuserUtable",children:r||"UuserUtable Component"}),Pc=({source:e,target:r,onChange:a,sourceTitle:n="Available",targetTitle:o="Selected",searchable:s=!0,sourceSearchPlaceholder:l="Search available...",targetSearchPlaceholder:i="Search selected...",height:d=300,disabled:c=!1,className:h})=>{const[g,y]=p.useState(""),[m,b]=p.useState(""),[v,w]=p.useState(new Set),[S,k]=p.useState(new Set),x=s?e.filter(j=>j.label.toLowerCase().includes(g.toLowerCase())):e,N=s?r.filter(j=>j.label.toLowerCase().includes(m.toLowerCase())):r,E=j=>{const B=new Set(v);B.has(j)?B.delete(j):B.add(j),w(B)},A=j=>{const B=new Set(S);B.has(j)?B.delete(j):B.add(j),k(B)},C=()=>{const j=e.filter(F=>v.has(F.id)),B=e.filter(F=>!v.has(F.id)),D=[...r,...j];a(B,D),w(new Set)},I=()=>{const j=r.filter(F=>S.has(F.id)),B=r.filter(F=>!S.has(F.id)),D=[...e,...j];a(D,B),k(new Set)},L=()=>{const j=[...r,...e];a([],j),w(new Set)},P=()=>{const j=[...e,...r];a(j,[]),k(new Set)},U=(j,B,D,F,$,R,ob)=>t.jsxs("div",{className:"flex flex-col flex-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-900",children:[t.jsxs("div",{className:"px-3 py-2 border-b border-gray-300 dark:border-gray-700 bg-gray-50 dark:bg-gray-800",children:[t.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:B}),t.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[j.length," item",j.length!==1?"s":""]})]}),s&&t.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:t.jsx("input",{type:"text",value:$,onChange:le=>R(le.target.value),placeholder:ob,className:"w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"})}),t.jsx("div",{className:"overflow-y-auto p-2 space-y-1",style:{height:s?d-120:d-60},children:j.length===0?t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-gray-500 dark:text-gray-400",children:"No items"}):j.map(le=>{const Ct=D.has(le.id);return t.jsx("button",{onClick:()=>!le.disabled&&F(le.id),disabled:le.disabled||c,className:f("w-full px-3 py-2 text-left rounded-md transition-colors","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",Ct&&"bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700"),children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("div",{className:f("w-4 h-4 border-2 rounded flex items-center justify-center flex-shrink-0 mt-0.5",Ct?"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500":"border-gray-300 dark:border-gray-600"),children:Ct&&t.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:le.label}),le.description&&t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 truncate",children:le.description})]})]})},le.id)})})]});return t.jsxs("div",{className:f("flex gap-4",h),children:[U(x,n,v,E,g,y,l),t.jsxs("div",{className:"flex flex-col justify-center gap-2",children:[t.jsx("button",{onClick:L,disabled:c||e.length===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move all to selected",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})}),t.jsx("button",{onClick:C,disabled:c||v.size===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move selected to target",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsx("button",{onClick:I,disabled:c||S.size===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move selected to source",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),t.jsx("button",{onClick:P,disabled:c||r.length===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move all to available",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 19l-7-7 7-7M19 19l-7-7 7-7"})})})]}),U(N,o,S,A,m,b,i)]})};function Oc({items:e,itemHeight:r,height:a,renderItem:n,keyExtractor:o,overscan:s=3,className:l}){const[i,d]=p.useState(0),c=p.useRef(null),h=v=>{d(v.currentTarget.scrollTop)},g=e.length*r,y=Math.max(0,Math.floor(i/r)-s),m=Math.min(e.length-1,Math.ceil((i+a)/r)+s),b=e.slice(y,m+1);return t.jsx("div",{ref:c,className:f("overflow-auto",l),style:{height:a},onScroll:h,children:t.jsx("div",{style:{height:g,position:"relative"},children:b.map((v,w)=>{const S=y+w;return t.jsx("div",{style:{position:"absolute",top:S*r,height:r,width:"100%"},children:n(v,S)},o(v,S))})})})}const Uc=({data:e,selectedId:r,onSelect:a,expandedIds:n,onExpand:o,defaultExpanded:s=!1,showLines:l=!1,className:i})=>{const[d,c]=p.useState(new Set(s?e.map(b=>b.id):[])),h=n!==void 0?new Set(n):d,g=b=>{n!==void 0&&o?o(b):c(v=>{const w=new Set(v);return w.has(b)?w.delete(b):w.add(b),w})},y=b=>{!b.disabled&&a&&a(b)},m=(b,v=0)=>{const w=b.children&&b.children.length>0,S=h.has(b.id),k=r===b.id;return t.jsxs("div",{children:[t.jsxs("div",{className:f("flex items-center gap-2 px-2 py-1.5 rounded-md transition-colors",!b.disabled&&"hover:bg-gray-100 dark:hover:bg-gray-800",k&&"bg-blue-50 dark:bg-blue-900/30",b.disabled&&"opacity-50 cursor-not-allowed",!b.disabled&&"cursor-pointer"),style:{paddingLeft:`${v*1.5+.5}rem`},onClick:()=>y(b),children:[w?t.jsx("button",{onClick:x=>{x.stopPropagation(),g(b.id)},className:"flex-shrink-0 w-4 h-4 flex items-center justify-center hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",children:t.jsx("svg",{className:f("w-3 h-3 transition-transform",S&&"rotate-90"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):t.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),b.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4 text-gray-600 dark:text-gray-400",children:b.icon}),t.jsx("span",{className:f("flex-1 text-sm",k?"text-blue-700 dark:text-blue-300 font-medium":"text-gray-900 dark:text-white"),children:b.label})]}),w&&S&&t.jsx("div",{className:f(l&&"border-l-2 border-gray-200 dark:border-gray-700 ml-2"),children:b.children.map(x=>m(x,v+1))})]},b.id)};return t.jsx("div",{className:f("w-full",i),children:e.map(b=>m(b,0))})},Dc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UlistingUform",children:r||"UlistingUform Component"}),jc="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border border-blue-200 dark:border-blue-800",_c={none:"",sm:"p-3",md:"p-6",lg:"p-8"},Qr=({variant:e="elevated",padding:r="md",icon:a,onClose:n,className:o,children:s,...l})=>{const d=["info","success","warning","error"].includes(e)&&(a||n),c=e==="callout"?jc:vo(e);return t.jsx("div",{className:f("rounded-lg",c,_c[r],o),...l,children:d?t.jsxs("div",{className:"flex items-start gap-3",children:[a&&t.jsx("div",{className:"flex-shrink-0 text-lg",children:a}),t.jsx("div",{className:"flex-1 min-w-0",children:s}),n&&t.jsx("button",{onClick:n,className:"flex-shrink-0 text-current hover:opacity-70 transition-opacity","aria-label":"Close",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):s})},zc=({title:e,description:r,className:a,children:n,...o})=>t.jsxs("div",{className:f("space-y-1.5",a),...o,children:[e&&t.jsx("h3",{className:O.heading.h4(),children:e}),r&&t.jsx("p",{className:O.body.sm(),children:r}),n]}),Bc=({className:e,children:r,...a})=>t.jsx("div",{className:f("",e),...a,children:r}),Fc=({className:e,children:r,...a})=>t.jsx("div",{className:f("flex items-center pt-4",e),...a,children:r}),Wc=({title:e,children:r,variant:a="info",size:n="default",className:o})=>{const s={sm:"sm",default:"md",lg:"lg"},l=a==="neutral"?"bordered":a;return t.jsxs(Qr,{variant:l,padding:s[n],className:o,children:[e&&t.jsx("h3",{className:f("font-semibold mb-2",n==="sm"?"text-base":n==="lg"?"text-xl":"text-lg"),children:e}),r]})},$c=({title:e,icon:r,children:a,variant:n="gradient",size:o="default",centered:s=!1,className:l})=>{const i={sm:"sm",default:"md",lg:"lg"},d=n==="gradient"||n==="neutral"?"callout":n;return t.jsx(Qr,{variant:d,padding:i[o],className:l,children:t.jsxs("div",{className:f("space-y-4",s&&"text-center"),children:[r&&t.jsx("div",{className:f("font-bold",o==="sm"?"text-2xl":o==="lg"?"text-5xl":"text-4xl",s?"text-center":"text-left"),children:r}),e&&t.jsx("h3",{className:f("font-bold mb-4",o==="sm"?"text-lg":o==="lg"?"text-3xl":"text-2xl"),children:e}),t.jsx("div",{className:f("text-gray-600 dark:text-gray-400",o==="sm"?"text-sm":o==="lg"?"text-lg":"text-base"),children:a})]})})},Vc=({title:e,value:r,change:a,changePeriod:n="vs last period",icon:o,variant:s="default",className:l})=>{const i={default:"bg-white dark:bg-gray-900",primary:"bg-blue-50 dark:bg-blue-900/20",success:"bg-green-50 dark:bg-green-900/20",warning:"bg-yellow-50 dark:bg-yellow-900/20",danger:"bg-red-50 dark:bg-red-900/20"};return t.jsxs("div",{className:f("rounded-lg border border-gray-200 dark:border-gray-700 p-6",i[s],l),children:[t.jsxs("div",{className:"flex items-start justify-between mb-2",children:[t.jsx("h3",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:e}),o&&t.jsx("div",{className:"text-gray-400 dark:text-gray-600",children:o})]}),t.jsx("div",{className:"flex items-end justify-between",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:r}),a!==void 0&&t.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[t.jsxs("span",{className:f("text-sm font-medium",a>=0?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:[a>=0?"↑":"↓"," ",Math.abs(a),"%"]}),t.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:n})]})]})})]})},Hc=({src:e,alt:r="Avatar",fallback:a,name:n,size:o="md",status:s,className:l,onClick:i})=>{const[d,c]=p.useState(!1),h={sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-base"},g={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},y={online:"bg-green-500",offline:"bg-gray-400",away:"bg-yellow-500",busy:"bg-red-500"},b=a||(n?(S=>{const k=S.trim().split(/\s+/);return k.length===1?k[0].charAt(0).toUpperCase():k[0].charAt(0).toUpperCase()+k[k.length-1].charAt(0).toUpperCase()})(n):""),v=e&&!d,w=()=>{c(!0)};return t.jsxs("div",{className:"relative inline-block flex-shrink-0",children:[t.jsx("div",{className:f("flex items-center justify-center overflow-hidden rounded-full",h[o],!v&&"bg-gray-300 dark:bg-gray-600 text-gray-700 dark:text-gray-200",i&&"cursor-pointer hover:opacity-80 transition-opacity",l),onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,children:v?t.jsx("img",{src:e,alt:r,className:"w-full h-full object-cover",onError:w}):t.jsx("span",{className:"font-semibold",children:b})}),s&&t.jsx("span",{className:f("absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-gray-800",y[s],g[o]),"aria-label":s})]})},qc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UavatarUgroup",children:r||"UavatarUgroup Component"}),Gc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UprofileUheader",children:r||"UprofileUheader Component"}),Yc=({label:e,value:r,orientation:a="vertical",align:n="start",labelWidth:o="auto",size:s="md",separator:l=!1,labelVariant:i="muted",valueVariant:d="default",className:c,labelClassName:h,valueClassName:g})=>{const y={sm:{label:O.body.sm(),value:O.body.sm(),gap:"gap-1"},md:{label:O.body.md(),value:O.body.md(),gap:"gap-2"},lg:{label:O.body.lg(),value:O.body.lg(),gap:"gap-3"}},m={auto:"",sm:"w-24",md:"w-32",lg:"w-40"},b={start:"justify-start",center:"justify-center",between:"justify-between"},v={default:"text-gray-700 dark:text-gray-300",muted:"text-gray-600 dark:text-gray-400",strong:"text-gray-900 dark:text-gray-100 font-semibold"},w={default:"text-gray-900 dark:text-gray-100",muted:"text-gray-600 dark:text-gray-400",strong:"text-gray-900 dark:text-gray-100 font-semibold",primary:"text-blue-600 dark:text-blue-400"},S=y[s];return t.jsxs("div",{className:f(a==="horizontal"?"flex items-center":"flex flex-col",a==="horizontal"&&b[n],S.gap,l&&"pb-3 mb-3 border-b border-gray-200 dark:border-gray-700",c),children:[t.jsx("dt",{className:f(S.label,v[i],a==="horizontal"&&m[o],a==="horizontal"&&"flex-shrink-0",h),children:e}),t.jsx("dd",{className:f(S.value,w[d],a==="horizontal"&&"flex-1",g),children:r})]})},Kc=({value:e,label:r,variant:a="neutral",size:n="md",align:o="center",icon:s,iconPosition:l="top",className:i,valueClassName:d,labelClassName:c})=>{const h={primary:{value:"text-blue-600 dark:text-blue-400",label:"text-blue-600/70 dark:text-blue-400/70",icon:"text-blue-600 dark:text-blue-400"},success:{value:"text-green-600 dark:text-green-400",label:"text-green-600/70 dark:text-green-400/70",icon:"text-green-600 dark:text-green-400"},warning:{value:"text-yellow-600 dark:text-yellow-400",label:"text-yellow-600/70 dark:text-yellow-400/70",icon:"text-yellow-600 dark:text-yellow-400"},danger:{value:"text-red-600 dark:text-red-400",label:"text-red-600/70 dark:text-red-400/70",icon:"text-red-600 dark:text-red-400"},neutral:{value:"text-gray-900 dark:text-gray-100",label:"text-gray-600 dark:text-gray-400",icon:"text-gray-600 dark:text-gray-400"},white:{value:"text-white",label:"text-white/70",icon:"text-white"}},g={sm:{value:O.heading.h5(),label:O.caption.default(),icon:"h-4 w-4"},md:{value:O.heading.h4(),label:O.body.sm(),icon:"h-5 w-5"},lg:{value:O.heading.h3(),label:O.body.md(),icon:"h-6 w-6"},xl:{value:O.heading.h2(),label:O.body.lg(),icon:"h-8 w-8"}},y={left:"text-left",center:"text-center",right:"text-right"},m=h[a],b=g[n];return t.jsxs("div",{className:f(y[o],i),children:[s&&l==="top"&&t.jsx(s,{className:f(b.icon,m.icon,"mb-2",o==="center"&&"mx-auto")}),t.jsxs("div",{className:f(l==="left"&&s&&"flex items-center gap-3",o==="center"&&l==="left"&&"justify-center"),children:[s&&l==="left"&&t.jsx(s,{className:f(b.icon,m.icon)}),t.jsxs("div",{children:[t.jsx("div",{className:f("font-bold",b.value,m.value,d),children:e}),t.jsx("div",{className:f(b.label,m.label,c),children:r})]})]})]})},Wa=({icon:e,title:r="No data",description:a,action:n,className:o})=>t.jsxs("div",{className:f("flex flex-col items-center justify-center py-12 px-4 text-center",o),children:[e&&t.jsx("div",{className:"mb-4 text-gray-400 dark:text-gray-600",children:e}),t.jsx("h3",{className:f(O.heading.h3(),"mb-2"),children:r}),a&&t.jsx("p",{className:f(O.body.sm(),"text-gray-600 dark:text-gray-400 max-w-sm mb-6"),children:a}),n&&t.jsx("div",{className:"mt-4",children:n})]}),Zc=({title:e,subtext:r,className:a})=>t.jsx(Wa,{title:e,description:r,className:a}),Xc=({data:e,orientation:r="vertical",showValues:a=!1,showGrid:n=!0,barWidth:o=40,height:s=300,className:l})=>{const i=Math.max(...e.map(c=>c.value)),d="#3b82f6";return t.jsx("div",{className:f("w-full",l),children:t.jsxs("div",{className:"relative bg-white dark:bg-gray-900 rounded-lg p-6",style:{height:`${s}px`},children:[n&&t.jsx("div",{className:"absolute inset-6 flex flex-col justify-between",children:[...Array(5)].map((c,h)=>t.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700"},h))}),r==="vertical"?t.jsx("div",{className:"relative h-full flex items-end justify-around gap-2",children:e.map((c,h)=>{const g=c.value/i*100;return t.jsxs("div",{className:"flex flex-col items-center gap-2",style:{width:`${o}px`},children:[a&&t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.value}),t.jsx("div",{className:"w-full rounded-t transition-all hover:opacity-80",style:{height:`${g}%`,backgroundColor:c.color||d}}),t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.label})]},h)})}):t.jsx("div",{className:"relative h-full flex flex-col justify-around gap-2",children:e.map((c,h)=>{const g=c.value/i*100;return t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 w-16 text-right",children:c.label}),t.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[t.jsx("div",{className:"h-8 rounded transition-all hover:opacity-80",style:{width:`${g}%`,backgroundColor:c.color||d}}),a&&t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.value})]})]},h)})})]})})},Qc=({series:e,showLegend:r=!0,showGrid:a=!0,showPoints:n=!0,height:o=300,xLabels:s,className:l})=>{const i=e.flatMap(m=>m.data),d=Math.max(...i.map(m=>m.y)),c=Math.min(...i.map(m=>m.y)),h=Math.max(...i.map(m=>m.x)),g=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],y=m=>m.length===0?"":`M ${m.map(v=>{const w=v.x/h*100,S=100-(v.y-c)/(d-c)*100;return`${w},${S}`}).join(" L ")}`;return t.jsxs("div",{className:f("w-full",l),children:[r&&t.jsx("div",{className:"flex flex-wrap gap-4 mb-4",children:e.map((m,b)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:m.color||g[b%g.length]}}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:m.name})]},b))}),t.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6",children:[t.jsxs("div",{className:"relative",style:{height:`${o}px`},children:[a&&t.jsx("div",{className:"absolute inset-0",children:[...Array(5)].map((m,b)=>t.jsx("div",{className:"absolute w-full border-t border-gray-200 dark:border-gray-700",style:{top:`${b*25}%`}},b))}),t.jsx("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:e.map((m,b)=>{const v=m.color||g[b%g.length];return t.jsxs("g",{children:[t.jsx("path",{d:y(m.data),fill:"none",stroke:v,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}),n&&m.data.map((w,S)=>{const k=w.x/h*100,x=100-(w.y-c)/(d-c)*100;return t.jsx("circle",{cx:k,cy:x,r:"1",fill:v,vectorEffect:"non-scaling-stroke"},S)})]},b)})})]}),s&&t.jsx("div",{className:"flex justify-between mt-2",children:s.map((m,b)=>t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:m},b))})]})]})},Jc=({data:e,variant:r="pie",showLegend:a=!0,showPercentages:n=!1,size:o=200,donutHoleSize:s=40,className:l})=>{const i=e.reduce((b,v)=>b+v.value,0),d=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],c=e.reduce((b,v,w)=>{const S=v.value/i*100,k=S/100*360,x=b.length>0?b[b.length-1].endAngle:-90,N=x+k;return b.push({...v,percentage:S,startAngle:x,endAngle:N,color:v.color||d[w%d.length]}),b},[]),h=(b,v,w,S)=>{const k=(S-90)*Math.PI/180;return{x:b+w*Math.cos(k),y:v+w*Math.sin(k)}},g=(b,v,w,S,k)=>{const x=h(b,v,w,k),N=h(b,v,w,S),E=k-S<=180?"0":"1";if(r==="donut"){const A=w*s/100,C=h(b,v,A,k),I=h(b,v,A,S);return["M",x.x,x.y,"A",w,w,0,E,0,N.x,N.y,"L",I.x,I.y,"A",A,A,0,E,1,C.x,C.y,"Z"].join(" ")}return["M",b,v,"L",x.x,x.y,"A",w,w,0,E,0,N.x,N.y,"Z"].join(" ")},y=o/2,m=o/2-10;return t.jsxs("div",{className:f("flex flex-col items-center gap-4",l),children:[t.jsx("svg",{width:o,height:o,className:"transform rotate-0",children:c.map((b,v)=>t.jsx("path",{d:g(y,y,m,b.startAngle,b.endAngle),fill:b.color,className:"transition-opacity hover:opacity-80"},v))}),a&&t.jsx("div",{className:"flex flex-col gap-2",children:c.map((b,v)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:b.color}}),t.jsxs("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:[b.label,n&&t.jsxs("span",{className:"text-gray-500 dark:text-gray-400 ml-1",children:["(",Math.round(b.percentage),"%)"]})]})]},v))})]})},Rc=({series:e,showLegend:r=!0,showGrid:a=!0,fillOpacity:n=.2,height:o=300,xLabels:s,className:l})=>{const i=e.flatMap(b=>b.data),d=Math.max(...i.map(b=>b.y)),c=Math.min(...i.map(b=>b.y)),h=Math.max(...i.map(b=>b.x)),g=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],y=b=>{if(b.length===0)return"";const v=b.map(k=>{const x=k.x/h*100,N=100-(k.y-c)/(d-c)*100;return`${x},${N}`}),w=b[0].x/h*100,S=b[b.length-1].x/h*100;return`M ${w},100 L ${v.join(" L ")} L ${S},100 Z`},m=b=>b.length===0?"":`M ${b.map(w=>{const S=w.x/h*100,k=100-(w.y-c)/(d-c)*100;return`${S},${k}`}).join(" L ")}`;return t.jsxs("div",{className:f("w-full",l),children:[r&&t.jsx("div",{className:"flex flex-wrap gap-4 mb-4",children:e.map((b,v)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:b.color||g[v%g.length]}}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:b.name})]},v))}),t.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6",children:[t.jsxs("div",{className:"relative",style:{height:`${o}px`},children:[a&&t.jsx("div",{className:"absolute inset-0",children:[...Array(5)].map((b,v)=>t.jsx("div",{className:"absolute w-full border-t border-gray-200 dark:border-gray-700",style:{top:`${v*25}%`}},v))}),t.jsx("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:e.map((b,v)=>{const w=b.color||g[v%g.length];return t.jsxs("g",{children:[t.jsx("path",{d:y(b.data),fill:w,fillOpacity:n}),t.jsx("path",{d:m(b.data),fill:"none",stroke:w,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"})]},v)})})]}),s&&t.jsx("div",{className:"flex justify-between mt-2",children:s.map((b,v)=>t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:b},v))})]})]})},ed=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UradarUchart",children:r||"UradarUchart Component"}),rd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UbubbleUchart",children:r||"UbubbleUchart Component"}),td=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UscatterUplot",children:r||"UscatterUplot Component"}),ad=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UtreeUmap",children:r||"UtreeUmap Component"}),nd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsankeyUdiagram",children:r||"UsankeyUdiagram Component"}),od=({data:e,width:r=100,height:a=30,color:n="#3b82f6",fill:o=!1,className:s})=>{if(e.length===0)return null;const l=Math.max(...e),i=Math.min(...e),d=l-i||1,c=e.map((h,g)=>{const y=g/(e.length-1)*r,m=a-(h-i)/d*a;return`${y},${m}`}).join(" ");return t.jsxs("svg",{width:r,height:a,className:f("inline-block",s),children:[o&&t.jsx("polygon",{points:`0,${a} ${c} ${r},${a}`,fill:n,opacity:"0.2"}),t.jsx("polyline",{points:c,fill:"none",stroke:n,strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round"})]})},sd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"Uheatmap",children:r||"Uheatmap Component"}),ld=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UfunnelUchart",children:r||"UfunnelUchart Component"}),id=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"BurndownChart",children:r||"BurndownChart Component"}),cd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UperformanceUchart",children:r||"UperformanceUchart Component"}),dd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmetricUcomparison",children:r||"UmetricUcomparison Component"}),ud=({value:e,min:r=0,max:a=100,size:n=120,strokeWidth:o=10,showValue:s=!0,label:l,variant:i="primary",className:d})=>{const c=Math.min(a,Math.max(r,e)),h=(c-r)/(a-r)*100,g=n/2,y=(n-o)/2,m=Math.PI*y,b=m-h/100*m,v={primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-600 dark:stroke-yellow-500",danger:"stroke-red-600 dark:stroke-red-500"};return t.jsxs("div",{className:f("inline-flex flex-col items-center gap-2",d),children:[t.jsxs("svg",{width:n,height:n*.65,className:"transform rotate-180",children:[t.jsx("path",{d:`M ${o/2} ${g} A ${y} ${y} 0 0 1 ${n-o/2} ${g}`,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:o,strokeLinecap:"round"}),t.jsx("path",{d:`M ${o/2} ${g} A ${y} ${y} 0 0 1 ${n-o/2} ${g}`,fill:"none",className:f(v[i],"transition-all duration-500"),strokeWidth:o,strokeDasharray:m,strokeDashoffset:b,strokeLinecap:"round"})]}),s&&t.jsxs("div",{className:"text-center -mt-8",children:[t.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:Math.round(c)}),l&&t.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400",children:l})]})]})},gd=({value:e=0,max:r=100,variant:a="default",size:n="md",showLabel:o=!1,label:s,indeterminate:l=!1,striped:i=!1,animated:d=!1,className:c})=>{const h=Math.min(Math.max(e/r*100,0),100),g={default:"bg-blue-600 dark:bg-blue-500",success:"bg-green-600 dark:bg-green-500",warning:"bg-yellow-600 dark:bg-yellow-500",danger:"bg-red-600 dark:bg-red-500"},y={sm:"h-1",md:"h-2",lg:"h-4"};return t.jsxs("div",{className:f("w-full",c),children:[t.jsx("div",{className:f("w-full bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",y[n]),role:"progressbar","aria-valuenow":l?void 0:h,"aria-valuemin":0,"aria-valuemax":100,children:l?t.jsx("div",{className:f("h-full rounded-full animate-pulse",g[a]),style:{width:"100%"}}):t.jsx("div",{className:f("h-full rounded-full transition-all duration-300",g[a],i&&"bg-stripe",i&&d&&"animate-stripe"),style:{width:`${h}%`}})}),(o||s)&&t.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400 text-right",children:s||`${Math.round(h)}%`})]})},hd=({value:e,size:r=100,strokeWidth:a=8,showValue:n=!0,label:o,variant:s="primary",color:l,trackColor:i,className:d})=>{const c=Math.min(100,Math.max(0,e)),h=r/2,g=(r-a)/2,y=2*Math.PI*g,m=y-c/100*y,b={primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-600 dark:stroke-yellow-500",danger:"stroke-red-600 dark:stroke-red-500"},v=i||"stroke-gray-200 dark:stroke-gray-700";return t.jsx("div",{className:f("inline-flex items-center justify-center",d),children:t.jsxs("div",{className:"relative",style:{width:r,height:r},children:[t.jsxs("svg",{width:r,height:r,className:"transform -rotate-90",children:[t.jsx("circle",{cx:h,cy:h,r:g,className:v,strokeWidth:a,fill:"none"}),t.jsx("circle",{cx:h,cy:h,r:g,className:f(l?"":b[s],"transition-all duration-300 ease-in-out"),stroke:l,strokeWidth:a,strokeDasharray:y,strokeDashoffset:m,strokeLinecap:"round",fill:"none"})]}),(n||o)&&t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[n&&!o&&t.jsxs("span",{className:"text-gray-900 dark:text-white font-bold",style:{fontSize:r*.2},children:[Math.round(c),"%"]}),o&&t.jsx("span",{className:"text-gray-900 dark:text-white font-medium text-center px-2",style:{fontSize:r*.15},children:o})]})]})})},fd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UprogressUtracker",children:r||"UprogressUtracker Component"}),bd=({src:e,alt:r,fallback:a,width:n,height:o,objectFit:s="cover",loading:l="lazy",showLoader:i=!0,rounded:d="none",border:c=!1,className:h,onLoad:g,onError:y})=>{const[m,b]=p.useState(!0),[v,w]=p.useState(!1),[S,k]=p.useState(e);p.useEffect(()=>{b(!0),w(!1),k(e)},[e]);const x=()=>{b(!1),g?.()},N=()=>{b(!1),w(!0),a&&S!==a&&(k(a),w(!1),b(!0)),y?.()},E={none:"",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},A={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},C={width:typeof n=="number"?`${n}px`:n,height:typeof o=="number"?`${o}px`:o};return t.jsxs("div",{className:f("relative inline-block overflow-hidden bg-gray-100 dark:bg-gray-800",E[d],c&&"border border-gray-200 dark:border-gray-700",h),style:C,children:[i&&m&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx("div",{className:"animate-pulse",children:t.jsx(M.PhotoIcon,{className:"h-8 w-8 text-gray-400"})})}),v&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx(M.PhotoIcon,{className:"h-8 w-8 text-gray-400"})}),!v&&t.jsx("img",{src:S,alt:r,loading:l,onLoad:x,onError:N,className:f("w-full h-full",A[s],m&&i&&"opacity-0")})]})},md=({images:e,columns:r=3,gap:a=16,lightbox:n=!0,className:o})=>{const[s,l]=p.useState(null),i=g=>{n&&l(g)},d=()=>{l(null)},c=()=>{if(!s)return;const g=e.findIndex(m=>m.id===s.id),y=g>0?g-1:e.length-1;l(e[y])},h=()=>{if(!s)return;const g=e.findIndex(m=>m.id===s.id),y=g<e.length-1?g+1:0;l(e[y])};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:f("grid",o),style:{gridTemplateColumns:`repeat(${r}, 1fr)`,gap:`${a}px`},children:e.map(g=>t.jsxs("div",{className:f("relative aspect-square overflow-hidden rounded-lg bg-gray-200 dark:bg-gray-700",n&&"cursor-pointer hover:opacity-90 transition-opacity"),onClick:()=>i(g),children:[t.jsx("img",{src:g.thumbnail||g.src,alt:g.alt||"",className:"w-full h-full object-cover"}),g.caption&&t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/50 text-white text-sm p-2",children:g.caption})]},g.id))}),n&&s&&t.jsxs("div",{className:"fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",onClick:d,children:[t.jsx("button",{onClick:d,className:"absolute top-4 right-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),t.jsx("button",{onClick:g=>{g.stopPropagation(),c()},className:"absolute left-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),t.jsx("button",{onClick:g=>{g.stopPropagation(),h()},className:"absolute right-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsxs("div",{className:"max-w-4xl max-h-full",onClick:g=>g.stopPropagation(),children:[t.jsx("img",{src:s.src,alt:s.alt||"",className:"max-w-full max-h-[80vh] object-contain"}),s.caption&&t.jsx("p",{className:"text-white text-center mt-4",children:s.caption})]})]})]})},yd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UimageUcomparison",children:r||"UimageUcomparison Component"}),pd=({src:e,onCropComplete:r,initialCrop:a,className:n})=>{const[o,s]=p.useState(a||{x:50,y:50,width:200,height:200}),l=p.useRef(null),i=async()=>{if(!l.current||!r)return;const d=document.createElement("canvas"),c=d.getContext("2d");if(!c)return;const h=l.current,g=h.naturalWidth/h.width,y=h.naturalHeight/h.height;d.width=o.width*g,d.height=o.height*y,c.drawImage(h,o.x*g,o.y*y,o.width*g,o.height*y,0,0,d.width,d.height);const m=d.toDataURL("image/png");r(m,o)};return t.jsxs("div",{className:f("inline-flex flex-col gap-4",n),children:[t.jsxs("div",{className:"relative inline-block",children:[t.jsx("img",{ref:l,src:e,alt:"Crop preview",className:"max-w-full h-auto",crossOrigin:"anonymous"}),t.jsxs("div",{className:"absolute border-2 border-blue-500 bg-blue-500/20",style:{left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`,cursor:"move"},children:[t.jsx("div",{className:"absolute -top-1 -left-1 w-3 h-3 bg-blue-500 rounded-full cursor-nw-resize"}),t.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 rounded-full cursor-ne-resize"}),t.jsx("div",{className:"absolute -bottom-1 -left-1 w-3 h-3 bg-blue-500 rounded-full cursor-sw-resize"}),t.jsx("div",{className:"absolute -bottom-1 -right-1 w-3 h-3 bg-blue-500 rounded-full cursor-se-resize"})]})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:i,className:f("px-4 py-2 text-sm font-medium","bg-blue-600 dark:bg-blue-500 text-white","rounded-md","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors"),children:"Crop Image"}),t.jsx("button",{onClick:()=>s(a||{x:50,y:50,width:200,height:200}),className:f("px-4 py-2 text-sm font-medium","bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-white","rounded-md","hover:bg-gray-300 dark:hover:bg-gray-600","transition-colors"),children:"Reset"})]}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:'Drag to adjust crop area. Click "Crop Image" to export.'})]})},vd=({images:e,index:r,isOpen:a,onClose:n,onIndexChange:o,showThumbnails:s=!1,showDownload:l=!1,showZoom:i=!0,className:d})=>{const[c,h]=p.useState(1),g=e[r],y=r>0,m=r<e.length-1,b=p.useCallback(()=>{if(y){const N=r-1;o?.(N),h(1)}},[y,r,o]),v=p.useCallback(()=>{if(m){const N=r+1;o?.(N),h(1)}},[m,r,o]),w=()=>{h(N=>Math.min(N+.5,3))},S=()=>{h(N=>Math.max(N-.5,.5))},k=()=>{h(1)},x=()=>{const N=document.createElement("a");N.href=g.src,N.download=g.alt||"image",N.click()};return p.useEffect(()=>{if(!a)return;const N=E=>{switch(E.key){case"Escape":n();break;case"ArrowLeft":b();break;case"ArrowRight":v();break;case"+":case"=":w();break;case"-":case"_":S();break;case"0":k();break}};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[a,r,e.length,n,b,v]),p.useEffect(()=>(a?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[a]),p.useEffect(()=>{h(1)},[r]),!a||!g?null:t.jsx(me,{children:t.jsxs("div",{className:f("fixed inset-0 z-50 flex items-center justify-center","bg-black/95",d),children:[t.jsx("div",{className:"absolute inset-0",onClick:n,"aria-label":"Close lightbox"}),t.jsx("button",{onClick:n,className:"absolute top-4 right-4 z-10 p-2 text-white hover:text-gray-300 transition-colors","aria-label":"Close",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),y&&t.jsx("button",{onClick:b,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-3 text-white hover:text-gray-300 bg-black/50 hover:bg-black/70 rounded-full transition-all","aria-label":"Previous image",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),m&&t.jsx("button",{onClick:v,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-3 text-white hover:text-gray-300 bg-black/50 hover:bg-black/70 rounded-full transition-all","aria-label":"Next image",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsxs("div",{className:"absolute top-4 left-4 z-10 flex gap-2",children:[t.jsxs("div",{className:"px-3 py-1.5 bg-black/50 text-white text-sm rounded-md",children:[r+1," / ",e.length]}),i&&t.jsxs("div",{className:"flex gap-1 bg-black/50 rounded-md p-1",children:[t.jsx("button",{onClick:S,className:"p-1.5 text-white hover:text-gray-300 transition-colors","aria-label":"Zoom out",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7"})})}),t.jsxs("button",{onClick:k,className:"px-2 text-white text-sm hover:text-gray-300 transition-colors","aria-label":"Reset zoom",children:[Math.round(c*100),"%"]}),t.jsx("button",{onClick:w,className:"p-1.5 text-white hover:text-gray-300 transition-colors","aria-label":"Zoom in",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7"})})})]}),l&&t.jsx("button",{onClick:x,className:"p-1.5 bg-black/50 text-white hover:text-gray-300 rounded-md transition-colors","aria-label":"Download image",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})})]}),t.jsx("div",{className:"relative z-0 flex items-center justify-center max-w-7xl max-h-screen p-20",children:t.jsx("img",{src:g.src,alt:g.alt||"",className:"max-w-full max-h-full object-contain transition-transform",style:{transform:`scale(${c})`}})}),g.caption&&t.jsx("div",{className:"absolute bottom-20 left-0 right-0 z-10 text-center",children:t.jsx("p",{className:"px-4 py-2 bg-black/50 text-white text-sm inline-block rounded-md max-w-2xl",children:g.caption})}),s&&e.length>1&&t.jsx("div",{className:"absolute bottom-4 left-0 right-0 z-10 flex justify-center gap-2 px-4 overflow-x-auto",children:e.map((N,E)=>t.jsx("button",{onClick:()=>{o?.(E),h(1)},className:f("flex-shrink-0 w-16 h-16 rounded-md overflow-hidden","border-2 transition-all",E===r?"border-white scale-110":"border-transparent opacity-60 hover:opacity-100 hover:border-gray-400"),children:t.jsx("img",{src:N.thumbnail||N.src,alt:N.alt||"",className:"w-full h-full object-cover"})},E))})]})})},wd=({src:e,poster:r,autoPlay:a=!1,loop:n=!1,muted:o=!1,controls:s=!0,className:l})=>{const i=p.useRef(null),[d,c]=p.useState(a),[h,g]=p.useState(1),[y,m]=p.useState(0),[b,v]=p.useState(0);p.useEffect(()=>{const E=i.current;if(!E)return;const A=()=>m(E.currentTime),C=()=>v(E.duration),I=()=>c(!0),L=()=>c(!1);return E.addEventListener("timeupdate",A),E.addEventListener("loadedmetadata",C),E.addEventListener("play",I),E.addEventListener("pause",L),()=>{E.removeEventListener("timeupdate",A),E.removeEventListener("loadedmetadata",C),E.removeEventListener("play",I),E.removeEventListener("pause",L)}},[]);const w=()=>{i.current&&(d?i.current.pause():i.current.play())},S=E=>{const A=parseFloat(E.target.value);g(A),i.current&&(i.current.volume=A)},k=E=>{const A=parseFloat(E.target.value);m(A),i.current&&(i.current.currentTime=A)},x=()=>{i.current&&(document.fullscreenElement?document.exitFullscreen():i.current.requestFullscreen())},N=E=>{const A=Math.floor(E/60),C=Math.floor(E%60);return`${A}:${C.toString().padStart(2,"0")}`};return t.jsxs("div",{className:f("relative group",l),children:[t.jsx("video",{ref:i,src:e,poster:r,autoPlay:a,loop:n,muted:o,className:"w-full rounded-lg",onClick:w}),s&&t.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-4 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx("input",{type:"range",min:"0",max:b||0,value:y,onChange:k,className:"w-full mb-2 accent-white"}),t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:w,className:"text-white hover:text-gray-300 transition-colors",children:d?t.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):t.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M8 5v14l11-7z"})})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"})}),t.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:h,onChange:S,className:"w-20 accent-white"})]}),t.jsxs("span",{className:"text-white text-sm",children:[N(y)," / ",N(b)]})]}),t.jsx("button",{onClick:x,className:"text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})]})]})]})},kd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvideoUthumbnail",children:r||"UvideoUthumbnail Component"}),xd=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"VideoEditor",children:r||"VideoEditor Component"}),Nd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvideoUcall",children:r||"UvideoUcall Component"}),Cd=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"LiveStream",children:r||"LiveStream Component"}),Sd=({src:e,title:r,artist:a,artwork:n,autoPlay:o=!1,loop:s=!1,className:l})=>{const i=p.useRef(null),[d,c]=p.useState(o),[h,g]=p.useState(0),[y,m]=p.useState(0),[b,v]=p.useState(1);p.useEffect(()=>{const E=i.current;if(!E)return;const A=()=>g(E.currentTime),C=()=>m(E.duration),I=()=>c(!0),L=()=>c(!1),P=()=>c(!1);return E.addEventListener("timeupdate",A),E.addEventListener("loadedmetadata",C),E.addEventListener("play",I),E.addEventListener("pause",L),E.addEventListener("ended",P),()=>{E.removeEventListener("timeupdate",A),E.removeEventListener("loadedmetadata",C),E.removeEventListener("play",I),E.removeEventListener("pause",L),E.removeEventListener("ended",P)}},[]);const w=()=>{i.current&&(d?i.current.pause():i.current.play())},S=E=>{const A=parseFloat(E.target.value);g(A),i.current&&(i.current.currentTime=A)},k=E=>{const A=parseFloat(E.target.value);v(A),i.current&&(i.current.volume=A)},x=E=>{const A=Math.floor(E/60),C=Math.floor(E%60);return`${A}:${C.toString().padStart(2,"0")}`},N=y>0?h/y*100:0;return t.jsxs("div",{className:f("bg-white dark:bg-gray-900 rounded-lg p-6 shadow-lg",l),children:[t.jsx("audio",{ref:i,src:e,autoPlay:o,loop:s}),t.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[n&&t.jsx("div",{className:"w-16 h-16 rounded-lg overflow-hidden flex-shrink-0 bg-gray-200 dark:bg-gray-700",children:t.jsx("img",{src:n,alt:r||"Album artwork",className:"w-full h-full object-cover"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[r&&t.jsx("h4",{className:"font-semibold text-gray-900 dark:text-white truncate",children:r}),a&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:a})]})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("input",{type:"range",min:"0",max:y||0,value:h,onChange:S,className:"w-full accent-blue-500"}),t.jsxs("div",{className:"flex justify-between text-xs text-gray-600 dark:text-gray-400 mt-1",children:[t.jsx("span",{children:x(h)}),t.jsx("span",{children:x(y)})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("button",{onClick:w,className:"w-10 h-10 rounded-full bg-blue-500 text-white flex items-center justify-center hover:bg-blue-600 transition-colors",children:d?t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):t.jsx("svg",{className:"w-5 h-5 ml-0.5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M8 5v14l11-7z"})})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4 text-gray-600 dark:text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"})}),t.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:b,onChange:k,className:"w-24 accent-blue-500"})]})]}),t.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[N.toFixed(0),"%"]})]})]})},Ed=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UaudioUwaveform",children:r||"UaudioUwaveform Component"}),Td=({data:e,width:r=200,height:a=40,color:n="#3b82f6",gap:o=2,className:s})=>{if(e.length===0)return null;const l=(r-(e.length-1)*o)/e.length;return t.jsx("svg",{width:r,height:a,className:f("inline-block",s),children:e.map((i,d)=>{const c=Math.max(2,i*a),h=d*(l+o),g=(a-c)/2;return t.jsx("rect",{x:h,y:g,width:l,height:c,fill:n,rx:l/2},d)})})},Ad=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvoiceUrecorder",children:r||"UvoiceUrecorder Component"}),Id=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"PodcastPlayer",children:r||"PodcastPlayer Component"}),Ld=({accept:e=["image/*","video/*","audio/*"],maxSize:r=50*1024*1024,maxFiles:a=10,multiple:n=!0,onUpload:o,onRemove:s,className:l})=>{const[i,d]=p.useState([]),[c,h]=p.useState(!1),g=p.useRef(null),y=x=>{x.preventDefault(),h(!0)},m=x=>{x.preventDefault(),h(!1)},b=x=>{x.preventDefault(),h(!1);const N=Array.from(x.dataTransfer.files);w(N)},v=x=>{if(x.target.files){const N=Array.from(x.target.files);w(N)}},w=x=>{const N=x.filter(I=>{const L=e.some(U=>{if(U.endsWith("/*")){const j=U.split("/")[0];return I.type.startsWith(j)}return I.type===U}),P=I.size<=r;return L&&P}),E=a-i.length,A=N.slice(0,E),C=A.map(I=>({id:`${Date.now()}-${Math.random()}`,file:I,preview:I.type.startsWith("image/")?URL.createObjectURL(I):void 0,status:"pending"}));d(I=>[...I,...C]),o&&o(A)},S=x=>{d(N=>N.filter(E=>E.id!==x)),s&&s(x)},k=x=>x<1024?`${x} B`:x<1024*1024?`${(x/1024).toFixed(1)} KB`:`${(x/(1024*1024)).toFixed(1)} MB`;return t.jsxs("div",{className:f("space-y-4",l),children:[t.jsxs("div",{onDragEnter:y,onDragOver:x=>x.preventDefault(),onDragLeave:m,onDrop:b,onClick:()=>g.current?.click(),className:f("border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors",c?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-700 hover:border-gray-400 dark:hover:border-gray-600"),children:[t.jsx("svg",{className:"w-12 h-12 mx-auto mb-4 text-gray-400 dark:text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),t.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-2",children:"Drag and drop files here, or click to browse"}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Max ",a," files, ",k(r)," each"]}),t.jsx("input",{ref:g,type:"file",multiple:n,accept:e.join(","),onChange:v,className:"hidden"})]}),i.length>0&&t.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:i.map(x=>t.jsxs("div",{className:"relative aspect-square rounded-lg overflow-hidden bg-gray-100 dark:bg-gray-800",children:[x.preview?t.jsx("img",{src:x.preview,alt:x.file.name,className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsx("svg",{className:"w-12 h-12 text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm4 18H6V4h7v5h5v11z"})})}),t.jsx("button",{onClick:()=>S(x.id),className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-red-500 text-white flex items-center justify-center hover:bg-red-600 transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),t.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-2",children:[t.jsx("p",{className:"truncate",children:x.file.name}),t.jsx("p",{className:"text-gray-300",children:k(x.file.size)})]})]},x.id))})]})},Md=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmediaUplaylist",children:r||"UmediaUplaylist Component"}),Pd=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"PlaylistManager",children:r||"PlaylistManager Component"}),Od=({value:e,size:r=200,fgColor:a="#000000",bgColor:n="#ffffff",showDownload:o=!1,className:s})=>{const l=p.useRef(null);p.useEffect(()=>{const d=l.current;if(!d)return;const c=d.getContext("2d");if(!c)return;c.fillStyle=n,c.fillRect(0,0,r,r),c.fillStyle=a;const h=8,g=r/h,y=e.split("").reduce((b,v)=>b+v.charCodeAt(0),0);for(let b=0;b<h;b++)for(let v=0;v<h;v++)(y+b*h+v)%3!==0&&c.fillRect(v*g,b*g,g,g);const m=g*3;[[0,0],[r-m,0],[0,r-m]].forEach(([b,v])=>{c.strokeStyle=a,c.lineWidth=g,c.strokeRect(b+g/2,v+g/2,m-g,m-g)})},[e,r,a,n]);const i=()=>{const d=l.current;if(!d)return;const c=d.toDataURL("image/png"),h=document.createElement("a");h.download="qrcode.png",h.href=c,h.click()};return t.jsxs("div",{className:f("inline-flex flex-col items-center gap-3",s),children:[t.jsx("canvas",{ref:l,width:r,height:r,className:"border-2 border-gray-200 dark:border-gray-700 rounded-lg"}),o&&t.jsx("button",{onClick:i,className:f("px-4 py-2 text-sm font-medium","bg-blue-600 dark:bg-blue-500 text-white","rounded-md","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors"),children:"Download QR Code"}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 max-w-[200px] text-center break-all",children:e})]})},Jr=({isOpen:e,onClose:r,title:a,size:n="medium",variant:o="default",overlay:s="default",showCloseButton:l=!0,closeOnOverlayClick:i=!0,closeOnEscape:d=!0,children:c,className:h,"aria-labelledby":g,"aria-describedby":y,closeAriaLabel:m="Close modal"})=>{const b=p.useRef(null),v=p.useRef(null);if(p.useEffect(()=>{if(!e||!d)return;const x=N=>{N.key==="Escape"&&r()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,d,r]),p.useEffect(()=>{if(e)return v.current=document.activeElement,b.current&&b.current.focus(),document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset",v.current&&v.current.focus()}},[e]),!e)return null;const w=()=>{const x=z.overlays.modal.content(),N=z.overlays.modal[n]();return f(x,N)},S=x=>{i&&x.target===x.currentTarget&&r()},k=t.jsxs(t.Fragment,{children:[t.jsx("div",{className:z.overlays.modal.backdrop(),onClick:S}),t.jsx("div",{className:z.overlays.modal.container(),role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":y,children:t.jsxs("div",{ref:b,"data-testid":"modal-content",className:f(w(),h),tabIndex:-1,onClick:x=>x.stopPropagation(),children:[a&&t.jsxs("div",{className:z.overlays.modal.header(),children:[t.jsx("h2",{id:g,className:z.overlays.modal.title(),children:a}),l&&t.jsx("button",{onClick:r,className:z.overlays.modal.closeButton(),"aria-label":m,children:t.jsx(M.XMarkIcon,{className:z.icon.variant.muted.md()})})]}),c]})})]});return wr.createPortal(k,document.body)},Ud=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-header",className:f(z.overlays.modal.header(),a),children:e}),Rr=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-body",className:f(z.overlays.modal.body(),a),children:e}),et=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-footer",className:f(z.overlays.modal.footer(),a),children:e}),Dd=({isOpen:e,onClose:r,children:a,side:n="right",size:o="md",showCloseButton:s=!0,title:l,footer:i,className:d})=>{if(p.useEffect(()=>{const y=m=>{m.key==="Escape"&&e&&r()};if(e)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,r]),!e)return null;const c={left:{sm:"w-64",md:"w-80",lg:"w-96",full:"w-full"},right:{sm:"w-64",md:"w-80",lg:"w-96",full:"w-full"},top:{sm:"h-64",md:"h-80",lg:"h-96",full:"h-full"},bottom:{sm:"h-64",md:"h-80",lg:"h-96",full:"h-full"}},h={left:"left-0 top-0 h-full",right:"right-0 top-0 h-full",top:"top-0 left-0 w-full",bottom:"bottom-0 left-0 w-full"},g={left:e?"translate-x-0":"-translate-x-full",right:e?"translate-x-0":"translate-x-full",top:e?"translate-y-0":"-translate-y-full",bottom:e?"translate-y-0":"translate-y-full"};return t.jsxs(me,{children:[t.jsx(ar,{isOpen:e,onClose:r,opacity:"medium"}),t.jsxs("div",{className:f("fixed z-50","bg-white dark:bg-gray-900","shadow-xl","transition-transform duration-300 ease-in-out",h[n],c[n][o],g[n],d),children:[(l||s)&&t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[l&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:l}),s&&t.jsx("button",{onClick:r,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors","aria-label":"Close drawer",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:a}),i&&t.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:i})]})]})},jd=({children:e,active:r=!0,initialFocus:a,returnFocus:n=!0,className:o})=>{const s=p.useRef(null),l=p.useRef(null);return p.useEffect(()=>{if(!r)return;n&&(l.current=document.activeElement);const i=()=>{if(!s.current)return[];const g=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(s.current.querySelectorAll(g))},d=()=>{if(a){const y=s.current?.querySelector(a);if(y){y.focus();return}}const g=i();g.length>0&&g[0].focus()},c=g=>{if(g.key!=="Tab")return;const y=i();if(y.length===0){g.preventDefault();return}const m=y[0],b=y[y.length-1];g.shiftKey?document.activeElement===m&&(g.preventDefault(),b.focus()):document.activeElement===b&&(g.preventDefault(),m.focus())},h=setTimeout(d,0);return document.addEventListener("keydown",c),()=>{clearTimeout(h),document.removeEventListener("keydown",c),n&&l.current&&l.current.focus()}},[r,a,n]),r?t.jsx("div",{ref:s,className:f(o),children:e}):t.jsx(t.Fragment,{children:e})},_d=({children:e,onLoadMore:r,loading:a=!1,hasMore:n=!0,threshold:o=100,loader:s,endMessage:l,height:i,scrollDirection:d="vertical",reverse:c=!1,className:h})=>{const g=p.useRef(null),[y,m]=p.useState(!1);p.useEffect(()=>{const S=g.current;if(!S||a||!n)return;const k=()=>{const{scrollTop:x,scrollHeight:N,clientHeight:E,scrollLeft:A,scrollWidth:C,clientWidth:I}=S;d==="vertical"&&m(x>300);let L;d==="vertical"?c?L=x:L=N-x-E:c?L=A:L=C-A-I,L<o&&r()};return S.addEventListener("scroll",k),()=>S.removeEventListener("scroll",k)},[a,n,o,r,d,c]);const b=()=>{g.current?.scrollTo({top:0,behavior:"smooth"})},v=t.jsxs("div",{className:"flex justify-center items-center py-4",children:[t.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 dark:border-blue-400 border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"Loading..."})]}),w=t.jsx("div",{className:"flex justify-center items-center py-4",children:t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"No more items to load"})});return t.jsxs("div",{className:f("relative",h),children:[t.jsxs("div",{ref:g,className:f(d==="vertical"?"overflow-y-auto":"overflow-x-auto","overflow-auto"),style:{height:d==="vertical"?i:void 0,width:d==="horizontal"?"100%":void 0,display:d==="horizontal"?"flex":void 0,flexDirection:c&&d==="vertical"?"column-reverse":void 0},children:[c&&a&&(s||v),c&&!a&&!n&&l,t.jsx("div",{className:f(d==="horizontal"&&"flex",d==="horizontal"&&c&&"flex-row-reverse"),children:e}),!c&&a&&(s||v),!c&&!a&&!n&&(l||w)]}),d==="vertical"&&!c&&y&&t.jsx("button",{onClick:b,className:f("absolute bottom-4 right-4","p-3 rounded-full","bg-blue-600 dark:bg-blue-500","text-white","shadow-lg","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"),"aria-label":"Scroll to top",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})})})]})},zd=({trigger:e,children:r,placement:a="bottom",isOpen:n,onOpenChange:o,trigger_action:s="click",showArrow:l=!0,className:i})=>{const[d,c]=p.useState(!1),h=n!==void 0?n:d,g=p.useCallback(E=>{n===void 0&&c(E),o?.(E)},[n,o]),y=p.useRef(null),m=p.useRef(null),[b,v]=p.useState({top:0,left:0});p.useEffect(()=>{if(!h||!y.current)return;const E=()=>{const A=y.current.getBoundingClientRect(),C=8;let I=0,L=0;switch(a){case"top":I=A.top-C,L=A.left+A.width/2;break;case"top-start":I=A.top-C,L=A.left;break;case"top-end":I=A.top-C,L=A.right;break;case"bottom":I=A.bottom+C,L=A.left+A.width/2;break;case"bottom-start":I=A.bottom+C,L=A.left;break;case"bottom-end":I=A.bottom+C,L=A.right;break;case"left":I=A.top+A.height/2,L=A.left-C;break;case"right":I=A.top+A.height/2,L=A.right+C;break}v({top:I,left:L})};return E(),window.addEventListener("scroll",E),window.addEventListener("resize",E),()=>{window.removeEventListener("scroll",E),window.removeEventListener("resize",E)}},[h,a]),p.useEffect(()=>{if(!h)return;const E=A=>{y.current&&!y.current.contains(A.target)&&m.current&&!m.current.contains(A.target)&&g(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[h,g]),p.useEffect(()=>{if(!h)return;const E=A=>{A.key==="Escape"&&g(!1)};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[h,g]);const w=()=>{s==="click"&&g(!h)},S=()=>{s==="hover"&&g(!0)},k=()=>{s==="hover"&&g(!1)},x={top:"origin-bottom","top-start":"origin-bottom-left","top-end":"origin-bottom-right",bottom:"origin-top","bottom-start":"origin-top-left","bottom-end":"origin-top-right",left:"origin-right",right:"origin-left"},N={top:"-translate-x-1/2 -translate-y-full","top-start":"-translate-y-full","top-end":"-translate-x-full -translate-y-full",bottom:"-translate-x-1/2","bottom-start":"","bottom-end":"-translate-x-full",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"};return t.jsxs("div",{className:f("relative inline-block",i),children:[t.jsx("div",{ref:y,onClick:w,onMouseEnter:S,onMouseLeave:k,className:"inline-block",children:e}),h&&t.jsxs("div",{ref:m,className:f("fixed z-50","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","rounded-lg shadow-lg","transition-all duration-200","animate-in fade-in zoom-in-95",x[a],N[a]),style:{position:"fixed",top:b.top+"px",left:b.left+"px"},onMouseEnter:s==="hover"?()=>g(!0):void 0,onMouseLeave:s==="hover"?()=>g(!1):void 0,children:[r,l&&t.jsx("div",{className:f("arrow absolute w-2 h-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 transform rotate-45",a.startsWith("top")&&"bottom-[-5px] border-t-0 border-l-0",a.startsWith("bottom")&&"top-[-5px] border-b-0 border-r-0",a==="left"&&"right-[-5px] border-l-0 border-b-0",a==="right"&&"left-[-5px] border-r-0 border-t-0",(a==="top"||a==="bottom")&&"left-1/2 -translate-x-1/2",(a==="left"||a==="right")&&"top-1/2 -translate-y-1/2")})]})]})},Bd=({sections:e,activeId:r,onActiveChange:a,offset:n=80,container:o,smoothScroll:s=!0,showSubsections:l=!0,className:i})=>{const[d,c]=p.useState(""),h=p.useRef(null),g=r!==void 0?r:d;p.useEffect(()=>{const b=o?document.querySelector(o):window;if(!b)return;const v=k=>k.flatMap(x=>[x.id,...x.subsections?v(x.subsections):[]]),S=v(e).map(k=>document.getElementById(k)).filter(Boolean);if(S.length!==0)return h.current=new IntersectionObserver(k=>{k.forEach(x=>{if(x.isIntersecting){const N=x.target.id;r!==void 0&&a?a(N):c(N)}})},{root:o?b:null,rootMargin:`-${n}px 0px -50% 0px`,threshold:0}),S.forEach(k=>{h.current?.observe(k)}),()=>{h.current?.disconnect()}},[e,o,n,r,a]);const y=b=>{const v=document.getElementById(b);if(!v)return;const w=o?document.querySelector(o):window;if(!w)return;const k=v.offsetTop-n;s?w===window?window.scrollTo({top:k,behavior:"smooth"}):w.scrollTo({top:k,behavior:"smooth"}):w===window?window.scrollTo(0,k):w.scrollTop=k},m=(b,v=0)=>{const w=g===b.id,S=b.subsections?.some(k=>g===k.id)||!1;return t.jsxs("div",{children:[t.jsx("button",{onClick:()=>y(b.id),className:f("w-full text-left px-3 py-1.5 text-sm rounded-md transition-colors",v===0?"font-medium":"pl-6 text-sm",w?"text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/30":S?"text-gray-700 dark:text-gray-300":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800"),style:{paddingLeft:`${v*.75+.75}rem`},children:b.label}),l&&b.subsections&&b.subsections.length>0&&t.jsx("div",{className:"ml-2 border-l-2 border-gray-200 dark:border-gray-700",children:b.subsections.map(k=>m(k,v+1))})]},b.id)};return t.jsx("nav",{className:f("space-y-1",i),children:e.map(b=>m(b,0))})},Fd=({isOpen:e,onClose:r,children:a,title:n,description:o,footer:s,side:l="bottom",size:i="md",showHandle:d=!0,showCloseButton:c=!0,className:h})=>{if(p.useEffect(()=>{if(!e)return;const b=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,r]),!e)return null;const g={bottom:{sm:"h-1/3",md:"h-1/2",lg:"h-2/3",full:"h-full"},top:{sm:"h-1/3",md:"h-1/2",lg:"h-2/3",full:"h-full"},left:{sm:"w-80",md:"w-96",lg:"w-[32rem]",full:"w-full"},right:{sm:"w-80",md:"w-96",lg:"w-[32rem]",full:"w-full"}},y={bottom:"bottom-0 left-0 right-0 rounded-t-2xl",top:"top-0 left-0 right-0 rounded-b-2xl",left:"left-0 top-0 bottom-0 rounded-r-2xl",right:"right-0 top-0 bottom-0 rounded-l-2xl"},m={bottom:"animate-in slide-in-from-bottom duration-300",top:"animate-in slide-in-from-top duration-300",left:"animate-in slide-in-from-left duration-300",right:"animate-in slide-in-from-right duration-300"};return t.jsxs(me,{children:[t.jsx(ar,{isOpen:e,onClose:r,opacity:"dark"}),t.jsxs("div",{className:f("fixed z-50","bg-white dark:bg-gray-900","shadow-xl","flex flex-col",y[l],g[l][i],m[l],h),children:[d&&(l==="bottom"||l==="top")&&t.jsx("div",{className:f("flex items-center justify-center",l==="bottom"?"pt-3 pb-2":"pb-3 pt-2"),children:t.jsx("div",{className:"w-12 h-1.5 bg-gray-300 dark:bg-gray-700 rounded-full"})}),(n||o||c)&&t.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex-1",children:[n&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:n}),o&&t.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:o})]}),c&&t.jsx("button",{onClick:r,className:"ml-4 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors","aria-label":"Close sheet",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:a}),s&&t.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:s})]})]})},Wd=({isOpen:e,onClose:r,onSubmit:a,title:n,description:o,placeholder:s="",initialValue:l="",cancelText:i="Cancel",confirmText:d="Confirm",isLoading:c=!1,loadingText:h="Processing...",maxLength:g,required:y=!0,validate:m})=>{const[b,v]=p.useState(l),[w,S]=p.useState(null);p.useEffect(()=>{e&&(v(l),S(null))},[e,l]);const k=async E=>{if(E.preventDefault(),S(null),y&&!b.trim()){S("This field is required");return}if(m){const A=m(b);if(A){S(A);return}}try{await a(b.trim())}catch(A){S(A instanceof Error?A.message:"An error occurred")}},x=()=>{v(l),S(null),r()},N=y?b.trim().length>0:!0;return t.jsx(Jr,{isOpen:e,onClose:x,size:"small","aria-labelledby":"text-input-modal-title","aria-describedby":"text-input-modal-description",closeOnEscape:!c,closeOnOverlayClick:!c,children:t.jsxs("form",{onSubmit:k,children:[t.jsxs(Rr,{variant:"padded",children:[t.jsx("h3",{id:"text-input-modal-title",className:O.heading.h4(),children:n}),t.jsx("p",{id:"text-input-modal-description",className:`${O.body.md()} mt-2 mb-4`,children:o}),t.jsx(nr,{type:"text",value:b,onChange:E=>v(E.target.value),placeholder:s,maxLength:g,disabled:c,autoFocus:!0,"aria-invalid":!!w,"aria-describedby":w?"text-input-error":void 0}),w&&t.jsx("p",{id:"text-input-error",className:`${O.body.sm()} text-red-600 dark:text-red-400 mt-2`,role:"alert",children:w})]}),t.jsxs(et,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:x,disabled:c,children:i}),t.jsx(ne,{type:"submit",variant:"default",disabled:!N||c,children:c?h:d})]})]})})},$a=({content:e,children:r,placement:a="top",delayShow:n=0,delayHide:o=0,className:s,disabled:l=!1,showArrow:i=!0,variant:d="default",trigger:c="hover",isOpen:h,onVisibilityChange:g})=>{const[y,m]=p.useState(!1),b=p.useRef(void 0),v=p.useRef(void 0),w=p.useRef(null),S=p.useRef(null),k=h!==void 0,x=k?h:y,N=p.useCallback(()=>{l||k||(v.current&&(clearTimeout(v.current),v.current=void 0),n>0?b.current=setTimeout(()=>{m(!0),g?.(!0)},n):(m(!0),g?.(!0)))},[l,k,n,g]),E=p.useCallback(()=>{k||(b.current&&(clearTimeout(b.current),b.current=void 0),o>0?v.current=setTimeout(()=>{m(!1),g?.(!1)},o):(m(!1),g?.(!1)))},[k,o,g]);p.useEffect(()=>()=>{b.current&&clearTimeout(b.current),v.current&&clearTimeout(v.current)},[]),p.useEffect(()=>{if(c!=="click"||!x)return;const F=$=>{w.current&&!w.current.contains($.target)&&S.current&&!S.current.contains($.target)&&E()};return document.addEventListener("mousedown",F),()=>{document.removeEventListener("mousedown",F)}},[c,x,E]);const A=()=>{c==="hover"&&N()},C=()=>{c==="hover"&&E()},I=()=>{c==="hover"&&N()},L=()=>{c==="hover"&&E()},P=()=>{c==="click"&&!k&&(x?(m(!1),g?.(!1)):(m(!0),g?.(!0)))},U={top:"bottom-full left-1/2 -translate-x-1/2 -translate-y-2",bottom:"top-full left-1/2 -translate-x-1/2 translate-y-2",left:"right-full top-1/2 -translate-x-2 -translate-y-1/2",right:"left-full top-1/2 translate-x-2 -translate-y-1/2"},j={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"},B={default:"bg-gray-900 dark:bg-gray-700 text-white",info:"bg-blue-600 dark:bg-blue-500 text-white",success:"bg-green-600 dark:bg-green-500 text-white",warning:"bg-yellow-600 dark:bg-yellow-500 text-white",error:"bg-red-600 dark:bg-red-500 text-white"},D={default:{top:"border-t-gray-900 dark:border-t-gray-700",bottom:"border-b-gray-900 dark:border-b-gray-700",left:"border-l-gray-900 dark:border-l-gray-700",right:"border-r-gray-900 dark:border-r-gray-700"},info:{top:"border-t-blue-600 dark:border-t-blue-500",bottom:"border-b-blue-600 dark:border-b-blue-500",left:"border-l-blue-600 dark:border-l-blue-500",right:"border-r-blue-600 dark:border-r-blue-500"},success:{top:"border-t-green-600 dark:border-t-green-500",bottom:"border-b-green-600 dark:border-b-green-500",left:"border-l-green-600 dark:border-l-green-500",right:"border-r-green-600 dark:border-r-green-500"},warning:{top:"border-t-yellow-600 dark:border-t-yellow-500",bottom:"border-b-yellow-600 dark:border-b-yellow-500",left:"border-l-yellow-600 dark:border-l-yellow-500",right:"border-r-yellow-600 dark:border-r-yellow-500"},error:{top:"border-t-red-600 dark:border-t-red-500",bottom:"border-b-red-600 dark:border-b-red-500",left:"border-l-red-600 dark:border-l-red-500",right:"border-r-red-600 dark:border-r-red-500"}};return t.jsxs("div",{ref:S,className:"relative inline-block",onMouseEnter:A,onMouseLeave:C,onFocus:I,onBlur:L,onClick:P,children:[r,x&&!l&&t.jsxs("div",{ref:w,className:f("absolute z-50 px-2 py-1 text-xs font-medium rounded shadow-lg whitespace-nowrap pointer-events-none",U[a],B[d],s),role:"tooltip",children:[e,i&&t.jsx("div",{className:f("absolute w-0 h-0 border-4 arrow",j[a],D[d][a])})]})]})},$d={default:M.InformationCircleIcon,warning:M.ExclamationTriangleIcon,danger:M.XCircleIcon,success:M.CheckCircleIcon,info:M.InformationCircleIcon},Vd={default:()=>z.icon.variant.default.lg(),warning:()=>z.icon.variant.warning.lg(),danger:()=>z.icon.variant.error.lg(),success:()=>z.icon.variant.success.lg(),info:()=>z.icon.variant.default.lg()},Hd={default:"default",warning:"default",danger:"destructive",success:"default",info:"default"},qd=({isOpen:e,onClose:r,onConfirm:a,title:n,message:o,confirmText:s="Confirm",cancelText:l="Cancel",loadingText:i="Processing...",variant:d="default",isLoading:c=!1})=>{const h=$d[d],g=Vd[d],y=Hd[d];return t.jsxs(Jr,{isOpen:e,onClose:r,size:"small",variant:"web3confirmation","aria-labelledby":"confirmation-dialog-title","aria-describedby":"confirmation-dialog-description",children:[t.jsxs(Rr,{variant:"padded",children:[t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsx(h,{className:g()}),t.jsx("h3",{id:"confirmation-dialog-title",className:O.heading.h4(),children:n})]}),t.jsx("p",{id:"confirmation-dialog-description",className:O.body.md(),children:o})]}),t.jsxs(et,{children:[t.jsx(ne,{variant:"outline",onClick:r,disabled:c,children:l}),t.jsx(ne,{variant:y,onClick:a,disabled:c,children:c?i:s})]})]})},Gd=({trigger:e,children:r,placement:a="bottom",openDelay:n=200,closeDelay:o=300,className:s})=>{const[l,i]=p.useState(!1),[d,c]=p.useState({top:0,left:0}),h=p.useRef(null),g=p.useRef(null),y=p.useRef(void 0),m=p.useRef(void 0);p.useEffect(()=>{if(!l||!h.current)return;const k=()=>{const x=h.current.getBoundingClientRect(),N=8;let E=0,A=0;switch(a){case"top":E=x.top-N,A=x.left+x.width/2;break;case"bottom":E=x.bottom+N,A=x.left+x.width/2;break;case"left":E=x.top+x.height/2,A=x.left-N;break;case"right":E=x.top+x.height/2,A=x.right+N;break}c({top:E,left:A})};return k(),window.addEventListener("scroll",k),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k),window.removeEventListener("resize",k)}},[l,a]);const b=()=>{m.current&&clearTimeout(m.current),y.current=setTimeout(()=>{i(!0)},n)},v=()=>{y.current&&clearTimeout(y.current),m.current=setTimeout(()=>{i(!1)},o)},w={top:"origin-bottom",bottom:"origin-top",left:"origin-right",right:"origin-left"},S={top:"-translate-x-1/2 -translate-y-full",bottom:"-translate-x-1/2",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"};return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:h,onMouseEnter:b,onMouseLeave:v,className:"inline-block",children:e}),l&&t.jsx(me,{children:t.jsx("div",{ref:g,className:f("fixed z-50","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","rounded-lg shadow-lg","transition-all duration-200","animate-in fade-in zoom-in-95",w[a],S[a],s),style:{top:d.top+"px",left:d.left+"px"},onMouseEnter:()=>{m.current&&clearTimeout(m.current)},onMouseLeave:v,children:r})})]})},Yd=({children:e,onDrop:r,onDragOver:a,accept:n,showIndicator:o=!0,indicator:s,disabled:l=!1,className:i})=>{const[d,c]=p.useState(!1),[h,g]=p.useState(0),y=S=>{S.preventDefault(),S.stopPropagation(),!l&&(g(k=>k+1),S.dataTransfer.items&&S.dataTransfer.items.length>0&&c(!0))},m=S=>{S.preventDefault(),S.stopPropagation(),!l&&g(k=>{const x=k-1;return x===0&&c(!1),x})},b=S=>{S.preventDefault(),S.stopPropagation(),!l&&a&&a(S)},v=S=>{if(S.preventDefault(),S.stopPropagation(),l)return;if(c(!1),g(0),S.dataTransfer.files&&S.dataTransfer.files.length>0){const x=Array.from(S.dataTransfer.files);let N=x;n&&n.length>0&&(N=x.filter(E=>n.some(A=>{if(A.endsWith("/*")){const C=A.split("/")[0];return E.type.startsWith(C)}return E.type===A}))),r(N);return}const k=S.dataTransfer.getData("text/plain");if(k)try{const x=JSON.parse(k);r(x)}catch{r(k)}},w=t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-blue-50 dark:bg-blue-900/30 border-2 border-dashed border-blue-500 dark:border-blue-400 rounded-lg z-10",children:[t.jsx("svg",{className:"w-12 h-12 text-blue-600 dark:text-blue-400 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),t.jsx("p",{className:"text-blue-700 dark:text-blue-300 font-medium",children:"Drop here"})]});return t.jsxs("div",{onDragEnter:y,onDragLeave:m,onDragOver:b,onDrop:v,className:f("relative",l&&"opacity-50 cursor-not-allowed",i),children:[e,o&&d&&!l&&(s||w)]})},Kd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdragUdropUlist",children:r||"UdragUdropUlist Component"}),Zd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsortableUgrid",children:r||"UsortableUgrid Component"}),Xd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UnestedUdrag",children:r||"UnestedUdrag Component"}),Qd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UgestureUdetector",children:r||"UgestureUdetector Component"}),Jd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UswipeUactions",children:r||"UswipeUactions Component"}),Rd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UpinchUzoom",children:r||"UpinchUzoom Component"}),e0=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdoubleUtap",children:r||"UdoubleUtap Component"}),r0=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UlongUpress",children:r||"UlongUpress Component"}),t0=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UradialUmenu",children:r||"UradialUmenu Component"}),a0=({children:e,onRefresh:r,disabled:a=!1,refreshingText:n="Refreshing...",pullDownText:o="Pull down to refresh",releaseText:s="Release to refresh",threshold:l=80,maxPullDistance:i=120,className:d=""})=>{const[c,h]=p.useState(0),[g,y]=p.useState(!1),[m,b]=p.useState(!1),v=p.useRef(0),w=p.useRef(null);p.useEffect(()=>{const E=w.current;if(!E)return;const A=L=>{if(a||g)return;E.scrollTop<=0&&(v.current=L.touches[0].clientY,b(!0))},C=L=>{if(!m)return;const U=L.touches[0].clientY-v.current;if(U>0&&E.scrollTop<=0){const j=Math.min(U/i,1),B=Math.min(U*(1-j*.5),i);h(B),U>10&&L.preventDefault()}},I=async()=>{if(m)if(b(!1),c>=l&&!g){y(!0);try{await r()}catch{}finally{y(!1),h(0)}}else h(0)};return E.addEventListener("touchstart",A,{passive:!0}),E.addEventListener("touchmove",C,{passive:!1}),E.addEventListener("touchend",I),()=>{E.removeEventListener("touchstart",A),E.removeEventListener("touchmove",C),E.removeEventListener("touchend",I)}},[a,g,m,c,l,i,r]);const S=Math.min(c/l,1),k=m||g,x=m?c:g?l:0,N=()=>g?n:c>=l?s:o;return t.jsxs("div",{ref:w,className:`relative ${d}`,style:{height:"100%",overflowY:"auto",WebkitOverflowScrolling:"touch"},children:[t.jsx("div",{className:"sticky top-0 left-0 right-0 flex items-center justify-center bg-gradient-to-b from-blue-50/90 to-transparent dark:from-blue-900/20 dark:to-transparent backdrop-blur-sm z-10 transition-all duration-300 ease-out",style:{height:`${x}px`,marginTop:m?0:`-${x}px`,opacity:k?1:0,pointerEvents:"none"},children:t.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[t.jsx(M.ArrowPathIcon,{className:`w-6 h-6 text-blue-600 dark:text-blue-400 transition-transform duration-200 ${g?"animate-spin":""}`,style:{transform:`rotate(${S*360}deg)`}}),c>20&&t.jsx("span",{className:"text-xs font-medium text-blue-600 dark:text-blue-400",children:N()})]})}),t.jsx("div",{style:{paddingTop:m?`${c}px`:0,transition:m?"none":"padding-top 200ms ease-out"},children:e})]})},ce={twitter:(e,r,a)=>{const n=a.length>0?`&hashtags=${a.join(",")}`:"";return`https://twitter.com/intent/tweet?url=${encodeURIComponent(e)}&text=${encodeURIComponent(r)}${n}`},facebook:e=>`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(e)}`,linkedin:(e,r,a)=>`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(e)}`,reddit:(e,r)=>`https://reddit.com/submit?url=${encodeURIComponent(e)}&title=${encodeURIComponent(r)}`,telegram:(e,r)=>`https://t.me/share/url?url=${encodeURIComponent(e)}&text=${encodeURIComponent(r)}`,whatsapp:(e,r)=>`https://wa.me/?text=${encodeURIComponent(r+" "+e)}`,email:(e,r,a)=>`mailto:?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(a+`
55
+ `,di(b))}}},[e]),t.jsx("div",{ref:g,className:`${y()} ${s}`,children:o})},ui=({children:e,delay:r=0,className:a=""})=>t.jsx(dr,{animation:"fade-in-up",delay:r,className:a,children:e}),gi=({children:e,delay:r=0,className:a=""})=>t.jsx(dr,{animation:"fade-in-scale",delay:r,className:a,children:e}),hi=({children:e,className:r=""})=>t.jsx(dr,{animation:"float",className:r,children:e}),fi=({isOpen:e,onClick:r,opacity:a="medium",blur:n=!1,zIndex:o=50,className:s,children:l})=>{const i={light:"bg-black/20 dark:bg-black/30",medium:"bg-black/50 dark:bg-black/60",dark:"bg-black/75 dark:bg-black/80"};return e?t.jsx("div",{onClick:r,className:f("fixed inset-0","transition-all duration-200",i[a],n&&"backdrop-blur-sm",s),style:{zIndex:o},role:"presentation","aria-hidden":"true",children:l}):null},bi={[ge.InfoType.INFO]:{icon:M.InformationCircleIcon,container:"bg-blue-50 dark:bg-blue-950 border-blue-200 dark:border-blue-800",iconColor:"text-blue-600 dark:text-blue-400",titleColor:"text-blue-900 dark:text-blue-100",descriptionColor:"text-blue-700 dark:text-blue-300"},[ge.InfoType.SUCCESS]:{icon:M.CheckCircleIcon,container:"bg-green-50 dark:bg-green-950 border-green-200 dark:border-green-800",iconColor:"text-green-600 dark:text-green-400",titleColor:"text-green-900 dark:text-green-100",descriptionColor:"text-green-700 dark:text-green-300"},[ge.InfoType.WARNING]:{icon:M.ExclamationTriangleIcon,container:"bg-yellow-50 dark:bg-amber-950 border-yellow-200 dark:border-amber-800",iconColor:"text-yellow-600 dark:text-amber-400",titleColor:"text-yellow-900 dark:text-amber-100",descriptionColor:"text-yellow-700 dark:text-amber-300"},[ge.InfoType.ERROR]:{icon:M.XCircleIcon,container:"bg-red-50 dark:bg-red-950 border-red-200 dark:border-red-800",iconColor:"text-red-600 dark:text-red-400",titleColor:"text-red-900 dark:text-red-100",descriptionColor:"text-red-700 dark:text-red-300"}},mi=({isVisible:e,onDismiss:r,title:a,description:n,variant:o=ge.InfoType.INFO,duration:s=5e3,icon:l,className:i,closeAriaLabel:d="Dismiss banner"})=>{const[c,h]=p.useState("hidden"),g=p.useRef(null),y=p.useRef(null),m=bi[o],b=m.icon,v=p.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null),y.current&&(clearTimeout(y.current),y.current=null)},[]),w=p.useCallback(()=>{v(),h("exiting"),y.current=setTimeout(()=>{h("hidden"),r()},300)},[v,r]);if(p.useEffect(()=>{e?(h("entering"),y.current=setTimeout(()=>{h("visible")},10)):(c==="visible"||c==="entering")&&w()},[e]),p.useEffect(()=>(c==="visible"&&s>0&&(g.current=setTimeout(()=>{w()},s)),()=>{g.current&&clearTimeout(g.current)}),[c,s,w]),p.useEffect(()=>()=>v(),[v]),c==="hidden")return null;const S=t.jsx("div",{role:"alert","aria-live":"polite","data-testid":"banner",className:f("fixed inset-x-0 top-0 z-[100] w-full","transition-all duration-300 ease-out",c==="entering"||c==="exiting"?"-translate-y-full opacity-0":"translate-y-0 opacity-100"),children:t.jsxs("div",{className:f("flex items-start gap-3 p-4 border-b shadow-lg","backdrop-blur-sm",m.container,i),children:[t.jsx("div",{className:f("flex-shrink-0 mt-0.5",m.iconColor),children:l||t.jsx(b,{className:"h-5 w-5"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:f("font-semibold",m.titleColor),children:a}),n&&t.jsx("p",{className:f("text-sm mt-1",m.descriptionColor),children:n})]}),t.jsx("button",{type:"button",onClick:w,className:f("flex-shrink-0 p-1 rounded-md transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus:ring-2 focus:ring-offset-2","focus:ring-current"),"aria-label":d,children:t.jsx(M.XMarkIcon,{className:f("h-5 w-5",m.iconColor)})})]})});return wr.createPortal(S,document.body)},yi=(e={})=>{const{defaultDuration:r=5e3}=e,[a,n]=p.useState(!1),[o,s]=p.useState(null),l=p.useCallback(({title:d,description:c,variant:h=ge.InfoType.INFO,duration:g=r})=>{s({title:d,description:c,variant:h,duration:g}),n(!0)},[r]),i=p.useCallback(()=>{n(!1)},[]);return{isVisible:a,bannerProps:o,showBanner:l,hideBanner:i}},ja=({isOpen:e,onClose:r,children:a,size:n="md",showCloseButton:o=!0,closeOnOutsideClick:s=!0,closeOnEscape:l=!0,className:i})=>{if(p.useEffect(()=>{if(!l||!e||!r)return;const h=g=>{g.key==="Escape"&&r()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,r,l]),!e)return null;const d={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-full mx-4"},c=()=>{s&&r&&r()};return t.jsxs(me,{children:[t.jsx(ar,{isOpen:e,onClose:c,opacity:"dark",blur:!0}),t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:f("relative w-full",d[n],"bg-white dark:bg-gray-900","rounded-lg shadow-xl","animate-in fade-in zoom-in-95 duration-200",i),onClick:h=>h.stopPropagation(),children:[o&&r&&t.jsx("button",{onClick:r,className:"absolute top-4 right-4 z-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors","aria-label":"Close dialog",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),a]})})]})},pi=({isOpen:e,onClose:r,items:a,placeholder:n="Type a command or search...",emptyMessage:o="No results found.",className:s})=>{const[l,i]=p.useState(""),[d,c]=p.useState(0),h=p.useRef(null),g=a.filter(v=>{const w=l.toLowerCase();return v.label.toLowerCase().includes(w)||v.keywords?.some(S=>S.toLowerCase().includes(w))||v.group?.toLowerCase().includes(w)}),y=g.reduce((v,w)=>{const S=w.group||"Commands";return v[S]||(v[S]=[]),v[S].push(w),v},{});p.useEffect(()=>{e||(i(""),c(0))},[e]),p.useEffect(()=>{e&&h.current&&h.current.focus()},[e]),p.useEffect(()=>{c(0)},[l]);const m=v=>{switch(v.key){case"ArrowDown":v.preventDefault(),c(w=>w<g.length-1?w+1:w);break;case"ArrowUp":v.preventDefault(),c(w=>w>0?w-1:w);break;case"Enter":v.preventDefault(),g[d]&&(g[d].onSelect(),r());break;case"Escape":v.preventDefault(),r();break}},b=v=>{v.onSelect(),r()};return t.jsxs(ja,{isOpen:e,onClose:r,size:"lg",showCloseButton:!1,className:f("overflow-hidden p-0",s),children:[t.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700 p-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{ref:h,type:"text",value:l,onChange:v=>i(v.target.value),onKeyDown:m,placeholder:n,className:"flex-1 bg-transparent border-none outline-none text-gray-900 dark:text-white placeholder-gray-500"})]})}),t.jsx("div",{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(y).length===0?t.jsx("div",{className:"px-4 py-8 text-sm text-gray-500 dark:text-gray-400 text-center",children:o}):Object.entries(y).map(([v,w])=>t.jsxs("div",{className:"mb-4 last:mb-0",children:[t.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:v}),t.jsx("div",{className:"space-y-1",children:w.map(S=>{const x=g.indexOf(S)===d;return t.jsxs("button",{onClick:()=>b(S),className:f("w-full flex items-center gap-3 px-3 py-2 rounded-md","text-sm text-left transition-colors",x?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-white"),children:[S.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:S.icon}),t.jsx("span",{className:"flex-1 truncate",children:S.label}),S.shortcut&&t.jsx("span",{className:"flex-shrink-0 text-xs text-gray-500 dark:text-gray-400 font-mono",children:S.shortcut})]},S.id)})})]},v))}),t.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 px-4 py-2 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↑"}),t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↓"}),"to navigate"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↵"}),"to select"]})]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"esc"}),"to close"]})]})]})},vi=Z.cva("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 transition-all duration-200",{variants:{variant:{default:"border-gray-200 dark:border-gray-700 border hover:shadow-lg",elevated:"shadow-lg hover:shadow-xl",minimal:"bg-transparent shadow-none border-none p-4"},trend:{none:"",up:"border-l-4 border-green-500",down:"border-l-4 border-red-500",neutral:"border-l-4 border-gray-400"}},defaultVariants:{variant:"default",trend:"none"}}),wi=({label:e,value:r,change:a,trend:n="none",icon:o,variant:s="default",className:l})=>{const i={up:"text-green-600 dark:text-green-400",down:"text-red-600 dark:text-red-400",neutral:"text-gray-600 dark:text-gray-400",none:"text-gray-600 dark:text-gray-400"},d={up:"↗",down:"↘",neutral:"→",none:""};return t.jsx("div",{className:f(vi({variant:s,trend:n}),l),children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:e}),t.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:r}),a&&t.jsxs("p",{className:f("text-sm font-medium flex items-center gap-1 mt-1",i[n||"none"]),children:[t.jsx("span",{children:d[n||"none"]}),a]})]}),o&&t.jsx("div",{className:"text-3xl opacity-80",children:o})]})})},ki=Z.cva("space-y-6",{variants:{variant:{default:"",card:"bg-white dark:bg-gray-800 rounded-lg border-gray-200 dark:border-gray-700 border p-6",minimal:"space-y-4"},spacing:{tight:"space-y-3",normal:"space-y-4",relaxed:"space-y-6",loose:"space-y-8"}},defaultVariants:{variant:"default",spacing:"normal"}}),xi=({title:e,description:r,children:a,variant:n="default",spacing:o="normal",className:s})=>t.jsxs("div",{className:f(ki({variant:n,spacing:o}),s),children:[(e||r)&&t.jsxs("div",{className:"space-y-1",children:[e&&t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:r})]}),a]}),Ni=Z.cva("flex flex-col items-center text-center space-y-4",{variants:{layout:{vertical:"flex-col items-center text-center",horizontal:"flex-row items-start text-left space-y-0 space-x-4",minimal:"flex-col space-y-2"},spacing:{tight:"space-y-2",normal:"space-y-4",relaxed:"space-y-6"},interactive:{true:"transition-all duration-200 hover:transform hover:scale-105 cursor-pointer",false:""}},defaultVariants:{layout:"vertical",spacing:"normal",interactive:!1}}),Ci=({icon:e,title:r,description:a,layout:n="vertical",spacing:o="normal",interactive:s=!1,className:l,onClick:i})=>t.jsxs("div",{className:f(Ni({layout:n,spacing:o,interactive:s}),l),onClick:i,children:[t.jsx("div",{className:"text-4xl mb-4 flex-shrink-0",children:e}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r}),t.jsx("div",{className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:a})]})]}),Si=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UfocusUindicator",children:r||"UfocusUindicator Component"}),Ei=({icon:e,size:r="md",shape:a="rounded",variant:n="blue-purple",gradientClasses:o,className:s,iconClassName:l})=>{const i={sm:{container:"w-10 h-10",icon:"h-5 w-5"},md:{container:"w-12 h-12",icon:"h-6 w-6"},lg:{container:"w-16 h-16",icon:"h-8 w-8"},xl:{container:"w-20 h-20",icon:"h-10 w-10"}},d={square:"rounded-lg",rounded:"rounded-xl",circle:"rounded-full"},c={"blue-purple":"bg-gradient-to-r from-blue-600 to-purple-600","green-blue":"bg-gradient-to-r from-green-600 to-blue-600","orange-red":"bg-gradient-to-r from-orange-600 to-red-600",gray:"bg-gradient-to-r from-gray-600 to-gray-800 dark:from-gray-700 dark:to-gray-900",custom:o||"bg-gradient-to-r from-blue-600 to-purple-600"},h=i[r];return t.jsx("div",{className:f("flex items-center justify-center flex-shrink-0",h.container,d[a],c[n],s),children:t.jsx(e,{className:f("text-white",h.icon,l)})})},Ti={sm:"w-12 h-12",md:"w-16 h-16",lg:"w-20 h-20",xl:"w-24 h-24"},Ai={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},Ii={primary:"bg-gradient-to-br from-blue-100 to-blue-200 text-blue-600 shadow-lg hover:shadow-blue-200",secondary:"bg-gradient-to-br from-purple-100 to-purple-200 text-purple-600 shadow-lg hover:shadow-purple-200",success:"bg-gradient-to-br from-green-100 to-green-200 text-green-600 shadow-lg hover:shadow-green-200",warning:"bg-gradient-to-br from-yellow-100 to-yellow-200 text-yellow-600 shadow-lg hover:shadow-yellow-200",error:"bg-gradient-to-br from-red-100 to-red-200 text-red-600 shadow-lg hover:shadow-red-200",neutral:"bg-gradient-to-br from-gray-100 to-gray-200 text-gray-600 shadow-lg hover:shadow-gray-200"},Li={square:"rounded-none",rounded:"rounded-2xl",circle:"rounded-full"},Mi={none:"",float:"animate-float",pulse:"animate-pulse",bounce:"animate-bounce-slow"},Pi=({children:e,size:r="lg",variant:a="primary",shape:n="rounded",animation:o="float",className:s})=>t.jsx("div",{className:f("flex items-center justify-center mx-auto mb-6 transition-all duration-300 group-hover:scale-105",Ti[r],Ii[a],Li[n],Mi[o],s),children:t.jsx("div",{className:f(Ai[r]),children:e})}),Oi=({icon:e,children:r,iconPosition:a="left",gap:n="md",iconSize:o="md",align:s="left",variant:l="default",className:i,iconClassName:d,textClassName:c})=>{const h={xs:"gap-1",sm:"gap-2",md:"gap-3",lg:"gap-4"},g={xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-8 w-8"},y={left:"text-left",center:"text-center items-center",right:"text-right items-end"},m={default:"text-gray-700 dark:text-gray-300",primary:"text-blue-600 dark:text-blue-400",success:"text-green-600 dark:text-green-400",warning:"text-yellow-600 dark:text-yellow-400",danger:"text-red-600 dark:text-red-400",muted:"text-gray-500 dark:text-gray-400"},b={left:"flex items-center",right:"flex flex-row-reverse items-center",top:"flex flex-col"};return t.jsxs("div",{className:f(b[a],h[n],a==="top"&&y[s],m[l],i),children:[t.jsx(e,{className:f(g[o],"flex-shrink-0",d)}),t.jsx("span",{className:f(c),children:r})]})};function Ui({title:e,subtitle:r,items:a,renderItem:n,keyExtractor:o,actions:s,emptyMessage:l="No items",emptyIcon:i,emptyAction:d,loading:c=!1,className:h,headerClassName:g,listClassName:y,spacing:m="none",showDividers:b=!1}){const v={none:"",sm:"space-y-1",md:"space-y-2",lg:"space-y-4"},w=(S="secondary")=>{const k="inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";switch(S){case"primary":return f(k,"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600");case"ghost":return f(k,"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800");case"secondary":default:return f(k,"bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700")}};return t.jsxs("div",{className:f("",h),children:[t.jsxs("div",{className:f("flex items-center justify-between gap-4 pb-4",g),children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),r&&t.jsx("p",{className:"mt-0.5 text-sm text-gray-500 dark:text-gray-400",children:r})]}),s&&s.length>0&&t.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:s.map(S=>t.jsxs("button",{onClick:S.onClick,disabled:S.disabled,className:w(S.variant),children:[S.icon,S.label]},S.id))})]}),c&&t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}),!c&&a.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[i&&t.jsx("div",{className:"mb-4 text-gray-400 dark:text-gray-500",children:i}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:l}),d&&t.jsx("button",{onClick:d.onClick,className:"mt-4 text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:d.label})]}),!c&&a.length>0&&t.jsx("div",{className:f(v[m],b&&"divide-y divide-gray-200 dark:divide-gray-700",y),children:a.map((S,k)=>t.jsx("div",{children:n(S,k)},o(S,k)))})]})}const Di=({children:e,title:r,variant:a="info",size:n="md",icon:o,bordered:s=!0,className:l})=>{const i={info:{bg:"bg-blue-50 dark:bg-blue-900/20",border:"border-blue-200 dark:border-blue-800",title:"text-blue-900 dark:text-blue-300",text:"text-blue-800 dark:text-blue-400",icon:"text-blue-600 dark:text-blue-400"},success:{bg:"bg-green-50 dark:bg-green-900/20",border:"border-green-200 dark:border-green-800",title:"text-green-900 dark:text-green-300",text:"text-green-800 dark:text-green-400",icon:"text-green-600 dark:text-green-400"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20",border:"border-yellow-200 dark:border-yellow-800",title:"text-yellow-900 dark:text-yellow-300",text:"text-yellow-800 dark:text-yellow-400",icon:"text-yellow-600 dark:text-yellow-400"},danger:{bg:"bg-red-50 dark:bg-red-900/20",border:"border-red-200 dark:border-red-800",title:"text-red-900 dark:text-red-300",text:"text-red-800 dark:text-red-400",icon:"text-red-600 dark:text-red-400"},neutral:{bg:"bg-gray-50 dark:bg-gray-800",border:"border-gray-200 dark:border-gray-700",title:"text-gray-900 dark:text-gray-100",text:"text-gray-700 dark:text-gray-300",icon:"text-gray-600 dark:text-gray-400"}},d={sm:"p-3",md:"p-4",lg:"p-6"},c=i[a];return t.jsxs("div",{className:f("rounded-lg",c.bg,s&&`border ${c.border}`,d[n],l),children:[(r||o)&&t.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[o&&t.jsx(o,{className:f("h-5 w-5 flex-shrink-0 mt-0.5",c.icon)}),r&&t.jsx("h3",{className:f(O.body.strong.md(),c.title),children:r})]}),t.jsx("div",{className:f(!r&&!o&&c.text),children:e})]})},ji=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UkeyboardUshortcut",children:r||"UkeyboardUshortcut Component"}),_i=({size:e="md",className:r="",showText:a=!0,onClick:n,logoSrc:o="/logo.png",logoAlt:s="Logo",logoText:l,fontFamily:i="Dancing Script, cursive"})=>{const c=(()=>{switch(e){case"sm":return{container:"space-x-2",image:"h-6 w-6",text:"text-lg"};case"md":return{container:"space-x-2",image:"h-8 w-8",text:"text-2xl"};case"lg":return{container:"space-x-3",image:"h-10 w-10",text:"text-3xl"};case"xl":return{container:"space-x-4",image:"h-12 w-12",text:"text-4xl"};default:return{container:"space-x-2",image:"h-8 w-8",text:"text-2xl"}}})(),h=t.jsxs(t.Fragment,{children:[t.jsx("img",{src:o,alt:s,className:c.image}),a&&t.jsx("div",{className:`${c.text} font-bold text-gray-900 dark:text-gray-100`,style:{fontFamily:i,fontWeight:"700"},children:l})]});return n?t.jsx("button",{onClick:n,className:`flex items-center ${c.container} ${r} hover:opacity-80 transition-opacity`,children:h}):t.jsx("div",{className:`flex items-center ${c.container} ${r}`,children:h})},zi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmorphUtransition",children:r||"UmorphUtransition Component"}),Bi=({title:e,description:r,count:a,countLabel:n,action:o,loading:s=!1,loadingText:l="Loading...",size:i="md",className:d})=>{const h={sm:{title:O.heading.h4(),description:O.body.sm(),count:O.caption.default()},md:{title:O.heading.h3(),description:O.body.md(),count:O.body.sm()},lg:{title:O.heading.h2(),description:O.body.lg(),count:O.body.md()}}[i];return t.jsxs("div",{className:f("flex items-start justify-between gap-4",d),children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx("h2",{className:f(h.title,"text-gray-900 dark:text-gray-100"),children:e}),a!==void 0&&t.jsxs("span",{className:f(h.count,"text-gray-500 dark:text-gray-400"),children:["(",a,n&&` ${n}`,")"]}),s&&t.jsxs("span",{className:f(h.count,"text-gray-500 dark:text-gray-400 flex items-center gap-2"),children:[t.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),l]})]}),r&&t.jsx("p",{className:f(h.description,"mt-1 text-gray-600 dark:text-gray-400"),children:r})]}),o&&t.jsx("div",{className:"flex-shrink-0",children:o})]})},Fi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UparallaxUscroll",children:r||"UparallaxUscroll Component"}),Wi=({actions:e,orientation:r="horizontal",columns:a=3,className:n})=>{const o={default:"bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800 text-gray-900 dark:text-white border-gray-200 dark:border-gray-700",primary:"bg-blue-500 hover:bg-blue-600 text-white border-blue-500",success:"bg-green-500 hover:bg-green-600 text-white border-green-500",warning:"bg-yellow-500 hover:bg-yellow-600 text-white border-yellow-500",danger:"bg-red-500 hover:bg-red-600 text-white border-red-500"},s={horizontal:"flex flex-wrap gap-2",vertical:"flex flex-col gap-2",grid:"grid gap-2"};return t.jsx("div",{className:f(s[r],r==="grid"&&`grid-cols-${a}`,n),style:r==="grid"?{gridTemplateColumns:`repeat(${a}, 1fr)`}:void 0,children:e.map(l=>t.jsxs("button",{onClick:l.onClick,disabled:l.disabled,className:f("flex items-center justify-center gap-2 px-4 py-3 rounded-lg border transition-colors font-medium",o[l.variant||"default"],l.disabled&&"opacity-50 cursor-not-allowed"),children:[l.icon&&t.jsx("span",{className:"w-5 h-5",children:l.icon}),t.jsx("span",{children:l.label})]},l.id))})},$i=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UrevealUonUscroll",children:r||"UrevealUonUscroll Component"}),Vi={sm:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"},md:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"},lg:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"}},Hi=({icon:e,text:r,variant:a="default",size:n="md",className:o})=>{const{container:s,icon:l}=ko(a),i=Vi[n];return t.jsxs("div",{className:f("inline-flex items-center rounded-full mb-6",s,i.container,o),children:[t.jsx("div",{className:f("animate-float-icon",l,i.icon),children:e}),t.jsx("span",{className:i.text,children:r})]})},qi=({title:e,onAdd:r,addButtonTooltip:a,loading:n,className:o=""})=>t.jsx("div",{className:`p-4 border-b border-gray-200 dark:border-gray-700 ${o}`,children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t.jsxs("div",{className:"flex items-center space-x-2",children:[n&&t.jsx("div",{className:"w-5 h-5 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"}),r&&t.jsx("button",{onClick:r,className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:a,"aria-label":a||"Add",children:t.jsx("svg",{className:"w-5 h-5 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]})]})}),Gi=e=>{switch(e){case"cog":return M.Cog6ToothIcon;case"arrow-right":return M.ArrowRightIcon;case"shield":return M.ShieldCheckIcon;case"reply":case"chat":return M.ChatBubbleLeftRightIcon;case"filter":return M.FunnelIcon;case"plug":return M.LinkIcon;case"adjustments":return M.AdjustmentsHorizontalIcon;case"currency-dollar":return M.CurrencyDollarIcon;default:return M.Cog6ToothIcon}},Yi=({settings:e,selectedSetting:r,onSettingSelect:a,className:n=""})=>t.jsx("nav",{className:f("space-y-1",n),"aria-label":"Settings navigation",children:t.jsx("ul",{className:"space-y-1",role:"list",children:e.map(o=>{const s=Gi(o.icon),l=r===o.id;return t.jsx("li",{children:t.jsx("button",{onClick:()=>a(o.id),className:f("w-full flex items-center text-left px-3 py-2 rounded-lg transition-colors h-[44px]",O.body.sm(),l?"bg-orange-100 dark:bg-orange-900/30 text-orange-700 dark:text-orange-300":"hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300"),"aria-current":l?"page":void 0,title:o.description,children:t.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[t.jsx(s,{className:"h-5 w-5 mr-3 flex-shrink-0","aria-hidden":"true"}),t.jsx("span",{className:"truncate",children:o.title})]})})},o.id)})})}),Ki=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UskipUnavigation",children:r||"UskipUnavigation Component"}),Zi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsortUdropdown",children:r||"UsortUdropdown Component"}),Xi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UversionUbadge",children:r||"UversionUbadge Component"}),Qi=({children:e,as:r="span"})=>t.jsx(r,{className:"sr-only",children:e}),Ji=({time:e,isActive:r=!0,size:a="sm",showIcon:n=!0,className:o})=>{const s={sm:"gap-1.5",md:"gap-2",lg:"gap-2.5"},l={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},i={sm:"sm",md:"base",lg:"lg"};return t.jsxs("div",{className:f("flex items-center",s[a],o),role:"timer","aria-label":`Timer: ${e}`,children:[n&&t.jsx("svg",{className:f(l[a],r?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),t.jsx(It,{as:"span",size:i[a],weight:"medium",color:r?"default":"muted",className:"font-mono tabular-nums",children:e})]})},Ri=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],ec=({show:e,onComplete:r,particleCount:a=50,duration:n=3e3,colors:o=Ri,className:s})=>{const[l,i]=p.useState([]),[d,c]=p.useState(!1);p.useEffect(()=>{if(e&&!d){c(!0);const g=[];for(let m=0;m<a;m++){const b=Math.PI*2*m/a+Math.random()*.5,v=2+Math.random()*4;g.push({id:m,x:50,y:50,vx:Math.cos(b)*v,vy:Math.sin(b)*v-2,color:o[Math.floor(Math.random()*o.length)],size:8+Math.random()*8,rotation:Math.random()*360,rotationSpeed:(Math.random()-.5)*20,isCircle:Math.random()>.5})}i(g);const y=setTimeout(()=>{c(!1),i([]),r?.()},n);return()=>clearTimeout(y)}},[e,d,r,a,n,o]);const h=p.useCallback(()=>{i(g=>g.map(y=>({...y,x:y.x+y.vx*.5,y:y.y+y.vy*.5,vy:y.vy+.15,rotation:y.rotation+y.rotationSpeed})))},[]);return p.useEffect(()=>{if(!d||l.length===0)return;const g=setInterval(h,16);return()=>clearInterval(g)},[d,l.length,h]),!d||l.length===0?null:t.jsx("div",{className:f("fixed inset-0 pointer-events-none z-50 overflow-hidden",s),"aria-hidden":"true",children:l.map(g=>t.jsx("div",{className:"absolute",style:{left:`${g.x}%`,top:`${g.y}%`,width:g.size,height:g.size,backgroundColor:g.color,transform:`rotate(${g.rotation}deg)`,borderRadius:g.isCircle?"50%":"2px",opacity:Math.max(0,1-g.y/150)}},g.id))})},ur=Z.cva("transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-sm",{variants:{variant:{subtle:O.link.subtle(),default:O.link.default(),muted:O.link.muted(),external:O.link.external(),inherit:"text-inherit hover:text-blue-600 dark:hover:text-blue-400 underline-offset-2 hover:underline transition-colors duration-200"},size:{sm:"text-sm",default:"text-base",lg:"text-lg"}},defaultVariants:{variant:"subtle",size:"default"}}),Xr=G.forwardRef(({className:e,variant:r,size:a,to:n,href:o,external:s,children:l,onTrack:i,trackingLabel:d,componentName:c,onClick:h,...g},y)=>{const m=n||o,b=s||m&&(m.startsWith("http")||m.startsWith("mailto:")),v=w=>{i&&i({action:"click",trackingLabel:d,componentName:c}),h?.(w)};return m?b?t.jsx("a",{className:f(ur({variant:r==="subtle"?"external":r,size:a,className:e})),href:m,target:"_blank",rel:"noopener noreferrer",ref:y,onClick:v,...g,children:l}):t.jsx(X.Link,{className:f(ur({variant:r,size:a,className:e})),to:m,ref:y,onClick:v,...g,children:l}):t.jsx("span",{className:f(ur({variant:r,size:a,className:e})),onClick:v,...g,children:l})});Xr.displayName="SmartLink";const rc=(e,r)=>G.useMemo(()=>{let a=e;return Object.entries(r).forEach(([n,o])=>{const s=new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"gi");a=a.replace(s,l=>`<SmartLink to="${o}" variant="subtle">${l}</SmartLink>`)}),a},[e,r]),tc={documentation:"/document",settings:"/settings",about:"/about",contact:"/contact","privacy policy":"/privacy",privacy:"/privacy","terms of service":"/terms",terms:"/terms","cookie policy":"/cookies",cookies:"/cookies",points:"/points","earn points":"/how-to-earn-points","how to earn points":"/how-to-earn-points","connect wallet":"/connect","connect your wallet":"/connect","wallet connection":"/connect",wallet:"/connect",compose:"/compose","compose email":"/compose","send email":"/compose",mail:"/mail",email:"/mail",inbox:"/mail",dashboard:"/mail",delegate:"/delegate",delegation:"/delegate",manage:"/manage","manage preferences":"/preferences",profile:"/settings",account:"/settings",preferences:"/preferences",token:"/token","web3 users":"/web3-users","web3 projects":"/web3-projects","get started":"/connect","start here":"/connect","learn more":"/document","read more":"/document","our features":"/document",support:"/contact",help:"/document","contact us":"/contact"},ac=({children:e,mappings:r=tc,className:a,variant:n="subtle"})=>{const o=G.useMemo(()=>{if(!e||typeof e!="string")return e||"";let l=e;return Object.entries(r).sort(([d],[c])=>c.length-d.length).forEach(([d,c])=>{if(d&&c){const h=new RegExp(`\\b${d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"gi");l=l.replace(h,g=>`__LINK_START__${c}__LINK_MID__${g}__LINK_END__`)}}),l},[e,r]);if(!o||typeof o!="string")return t.jsx("span",{className:a,children:e});const s=o.split(/(__LINK_START__.*?__LINK_END__)/);return t.jsx("span",{className:a,children:s.map((l,i)=>{const d=l.match(/__LINK_START__(.*?)__LINK_MID__(.*?)__LINK_END__/);if(d){const[,c,h]=d;return t.jsx(Xr,{to:c,variant:n,children:h},i)}return l})})},nc=({href:e,children:r,variant:a="default",external:n=!1,showExternalIcon:o=!1,disabled:s=!1,className:l,onTrack:i,trackingLabel:d,componentName:c,onClick:h,...g})=>{const y=n||e.startsWith("http://")||e.startsWith("https://"),m={default:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300",primary:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",secondary:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100",muted:"text-gray-500 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",underline:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 underline"},b=y?{target:"_blank",rel:"noopener noreferrer"}:{},v=w=>{i&&i({action:"click",trackingLabel:d,componentName:c}),h?.(w)};return s?t.jsxs("span",{className:f("cursor-not-allowed opacity-50",m[a],l),children:[r,o&&y&&t.jsx(M.ArrowTopRightOnSquareIcon,{className:"inline-block h-4 w-4 ml-1"})]}):t.jsxs("a",{href:e,className:f("inline-flex items-center transition-colors",m[a],l),onClick:v,...b,...g,children:[r,o&&y&&t.jsx(M.ArrowTopRightOnSquareIcon,{className:"inline-block h-4 w-4 ml-1 flex-shrink-0"})]})},oc=({href:e,children:r,showIcon:a=!0,iconPosition:n="right",size:o="md",variant:s="default",className:l,onClick:i})=>{const d={sm:{text:O.body.sm(),icon:"h-3 w-3",gap:"gap-1"},md:{text:O.body.md(),icon:"h-4 w-4",gap:"gap-1.5"},lg:{text:O.body.lg(),icon:"h-5 w-5",gap:"gap-2"}},c={default:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300",primary:"text-blue-700 dark:text-blue-300 hover:text-blue-800 dark:hover:text-blue-200 font-semibold",muted:"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"},h=d[o];return t.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:i,className:f("inline-flex items-center",h.gap,h.text,c[s],"underline decoration-1 underline-offset-2","hover:decoration-2","transition-all duration-200",l),children:[a&&n==="left"&&t.jsx(M.ArrowTopRightOnSquareIcon,{className:f(h.icon,"flex-shrink-0")}),t.jsx("span",{children:r}),a&&n==="right"&&t.jsx(M.ArrowTopRightOnSquareIcon,{className:f(h.icon,"flex-shrink-0")})]})},gr=new Set,sc=()=>{gr.clear()},lc=e=>gr.has(e);function ic(e,r,a,n){let o=e;if(a.length>0){const s=new RegExp(`^/(${a.join("|")})/`);o=o.replace(s,"/")}for(const{pattern:s,replacement:l}of n)o=o.replace(s,l);if(r[o])return r[o];for(const[s,l]of Object.entries(r))if(o.endsWith(s))return l}const cc=({preload:e,preloadDelay:r=50,routeModules:a={},languagePrefixes:n=[],pathNormalizations:o=[],to:s,children:l,onMouseEnter:i,onMouseLeave:d,onFocus:c,...h})=>{const g=p.useRef(null),y=p.useCallback(()=>{const S=typeof s=="string"?s:s.pathname||"";if(gr.has(S))return;const k=e||ic(S,a,n,o);k&&(g.current=setTimeout(()=>{k().then(()=>{gr.add(S)}).catch(()=>{})},r))},[e,r,s,a,n,o]),m=p.useCallback(()=>{g.current&&(clearTimeout(g.current),g.current=null)},[]),b=p.useCallback(S=>{y(),i?.(S)},[y,i]),v=p.useCallback(S=>{m(),d?.(S)},[m,d]),w=p.useCallback(S=>{y(),c?.(S)},[y,c]);return t.jsx(X.Link,{to:s,onMouseEnter:b,onMouseLeave:v,onFocus:w,...h,children:l})},dc=({items:e,separator:r="/",className:a})=>t.jsx("nav",{className:f("flex items-center gap-2 text-sm",a),children:e.map((n,o)=>t.jsxs(p.Fragment,{children:[o>0&&t.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:r}),o===e.length-1?t.jsx("span",{className:"text-gray-900 dark:text-white font-medium",children:n.label}):t.jsx("button",{onClick:n.onClick,className:"text-blue-600 dark:text-blue-400 hover:underline",children:n.label})]},o))}),_a=G.forwardRef(({onTrack:e,trackingLabel:r,componentName:a,onValueChange:n,children:o,...s},l)=>{const i=d=>{e&&e({action:"change",trackingLabel:r,componentName:a}),n?.(d)};return t.jsx(be.Root,{ref:l,onValueChange:i,...s,children:o})});_a.displayName="Tabs";const za=G.forwardRef(({className:e,...r},a)=>t.jsx(be.List,{ref:a,className:f(z.navigation.tabs.list(),e),...r}));za.displayName=be.List.displayName;const Ba=G.forwardRef(({className:e,...r},a)=>t.jsx(be.Trigger,{ref:a,className:f(z.navigation.tabs.trigger(),e),...r}));Ba.displayName=be.Trigger.displayName;const Fa=G.forwardRef(({className:e,...r},a)=>t.jsx(be.Content,{ref:a,className:f(z.navigation.tabs.content(),e),...r}));Fa.displayName=be.Content.displayName;const uc=({items:e,orientation:r="horizontal",className:a})=>{const[n,o]=p.useState(new Set),s=i=>{o(d=>{const c=new Set(d);return c.has(i)?c.delete(i):c.add(i),c})},l=(i,d)=>{const c=i.children&&i.children.length>0,h=n.has(d),g=t.jsxs(t.Fragment,{children:[i.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:i.icon}),t.jsx("span",{className:"flex-1",children:i.label}),c&&t.jsx("svg",{className:f("w-4 h-4 transition-transform",r==="horizontal"&&!h&&"-rotate-90",h&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y=f("flex items-center gap-2 px-4 py-2 text-sm font-medium","transition-colors",i.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800");return t.jsxs("div",{children:[c?t.jsx("button",{onClick:()=>s(d),className:f(y,"w-full"),children:g}):i.href?t.jsx("a",{href:i.href,className:y,onClick:i.onClick,children:g}):t.jsx("button",{onClick:i.onClick,className:f(y,"w-full"),children:g}),c&&h&&t.jsx("div",{className:f("bg-gray-50 dark:bg-gray-800/50",r==="horizontal"?"pl-4":"border-l-2 border-gray-200 dark:border-gray-700 ml-4"),children:i.children.map((m,b)=>t.jsx("div",{children:m.href?t.jsxs("a",{href:m.href,onClick:m.onClick,className:f("flex items-center gap-2 px-4 py-2 text-sm","transition-colors",m.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"),children:[m.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:m.icon}),m.label]}):t.jsxs("button",{onClick:m.onClick,className:f("w-full flex items-center gap-2 px-4 py-2 text-sm","transition-colors",m.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"),children:[m.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:m.icon}),m.label]})},b))})]},d)};return t.jsx("nav",{className:f("bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg",r==="horizontal"?"flex flex-wrap":"flex flex-col",a),children:e.map((i,d)=>l(i,d))})},gc=({items:e,selectedPath:r,onSelect:a,variant:n="default",className:o})=>{const s=n==="compact"?"space-y-1":"space-y-0";return t.jsx("div",{className:f(s,o),children:e.map(l=>{const i=l.icon,d=r===l.path,c=l.disabled,h=f("flex items-start cursor-pointer transition-colors",n==="compact"?"p-3 rounded-lg":"p-4 border-b border-gray-200 dark:border-gray-700 last:border-b-0",c&&"opacity-50 cursor-not-allowed"),g=d?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300";return t.jsxs("div",{onClick:()=>!c&&a(l.path),className:f(h,!c&&g),role:"button",tabIndex:c?-1:0,"aria-current":d?"page":void 0,"aria-disabled":c,onKeyDown:y=>{!c&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),a(l.path))},children:[t.jsx(i,{className:"h-5 w-5 mt-0.5 mr-3 flex-shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:f("font-medium",O.body.md()),children:[l.label,l.badge!==void 0&&l.badge>0&&t.jsx("span",{className:"ml-2 inline-flex items-center justify-center px-2 py-0.5 text-xs font-medium bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-full",children:l.badge})]}),l.description&&t.jsx("div",{className:f("text-xs text-gray-500 dark:text-gray-400 mt-0.5"),children:l.description})]})]},l.id)})})},hc=({items:e,className:r})=>t.jsx("nav",{className:f("flex flex-col gap-1",r),children:e.map(a=>t.jsxs("button",{onClick:a.onClick,className:f("flex items-center gap-3 px-4 py-3 rounded-lg transition-colors",a.active?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"),children:[a.icon&&t.jsx("span",{className:"w-5 h-5",children:a.icon}),t.jsx("span",{className:"flex-1 text-left font-medium",children:a.label}),a.badge&&t.jsx("span",{className:"px-2 py-0.5 bg-gray-200 dark:bg-gray-700 rounded text-xs",children:a.badge})]},a.id))}),fc=({currentPage:e,totalPages:r,onPageChange:a,siblingCount:n=1,showFirstLast:o=!1,size:s="md",className:l})=>{const d={sm:{button:"h-8 w-8 text-xs",icon:"h-3 w-3",text:O.body.sm()},md:{button:"h-10 w-10 text-sm",icon:"h-4 w-4",text:O.body.md()},lg:{button:"h-12 w-12 text-base",icon:"h-5 w-5",text:O.body.lg()}}[s],h=(()=>{const k=[];k.push(1);const x=Math.max(e-n,2),N=Math.min(e+n,r-1);x>2&&k.push("ellipsis");for(let E=x;E<=N;E++)k.push(E);return N<r-1&&k.push("ellipsis"),r>1&&k.push(r),k})(),g=()=>{e>1&&a(e-1)},y=()=>{e<r&&a(e+1)},m=()=>{a(1)},b=()=>{a(r)},v=f("inline-flex items-center justify-center","rounded-md border border-gray-300 dark:border-gray-600","transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500","disabled:opacity-50 disabled:cursor-not-allowed"),w=k=>f(v,d.button,d.text,k?"bg-blue-600 text-white border-blue-600 dark:bg-blue-500 dark:border-blue-500":"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"),S=f(v,d.button,"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700");return t.jsxs("nav",{className:f("flex items-center gap-1",l),"aria-label":"Pagination",children:[o&&t.jsx("button",{onClick:m,disabled:e===1,className:S,"aria-label":"Go to first page",children:t.jsx("span",{className:d.text,children:"First"})}),t.jsx("button",{onClick:g,disabled:e===1,className:S,"aria-label":"Go to previous page",children:t.jsx(M.ChevronLeftIcon,{className:d.icon})}),h.map((k,x)=>k==="ellipsis"?t.jsx("span",{className:f("inline-flex items-center justify-center",d.button,"text-gray-400 dark:text-gray-500"),children:"..."},`ellipsis-${x}`):t.jsx("button",{onClick:()=>a(k),className:w(k===e),"aria-label":`Go to page ${k}`,"aria-current":k===e?"page":void 0,children:k},k)),t.jsx("button",{onClick:y,disabled:e===r,className:S,"aria-label":"Go to next page",children:t.jsx(M.ChevronRightIcon,{className:d.icon})}),o&&t.jsx("button",{onClick:b,disabled:e===r,className:S,"aria-label":"Go to last page",children:t.jsx("span",{className:d.text,children:"Last"})})]})},bc=({currentPage:e,totalPages:r,onPageChange:a,maxVisible:n=7,className:o})=>{const s=[];if(r<=n)for(let l=1;l<=r;l++)s.push(l);else{s.push(1),e>3&&s.push("...");const l=Math.max(2,e-1),i=Math.min(r-1,e+1);for(let d=l;d<=i;d++)s.push(d);e<r-2&&s.push("..."),s.push(r)}return t.jsxs("nav",{className:f("flex items-center gap-1",o),children:[t.jsx("button",{onClick:()=>a(e-1),disabled:e===1,className:"px-3 py-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),s.map((l,i)=>l==="..."?t.jsx("span",{className:"px-3 py-2",children:"..."},`ellipsis-${i}`):t.jsx("button",{onClick:()=>a(l),className:f("px-3 py-2 rounded",l===e?"bg-blue-500 text-white":"hover:bg-gray-100 dark:hover:bg-gray-800"),children:l},l)),t.jsx("button",{onClick:()=>a(e+1),disabled:e===r,className:"px-3 py-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})},mc=({steps:e,currentStep:r,orientation:a="horizontal",clickable:n=!1,onStepClick:o,className:s})=>{const l=d=>{n&&o&&o(d)},i=d=>d<r?"completed":d===r?"active":"upcoming";return a==="horizontal"?t.jsx("div",{className:f("w-full",s),children:t.jsx("div",{className:"flex items-center justify-between",children:e.map((d,c)=>{const h=i(c),g=c===e.length-1;return t.jsxs(p.Fragment,{children:[t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx("button",{onClick:()=>l(c),disabled:!n,className:f("flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all","disabled:cursor-default",n&&"hover:scale-110",h==="completed"&&"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500",h==="active"&&"bg-white dark:bg-gray-900 border-blue-600 dark:border-blue-500",h==="upcoming"&&"bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-700"),children:h==="completed"?t.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):d.icon?t.jsx("span",{className:f("w-5 h-5",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:d.icon}):t.jsx("span",{className:f("text-sm font-semibold",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:c+1})}),t.jsxs("div",{className:"mt-2 text-center",children:[t.jsx("p",{className:f("text-sm font-medium",h==="active"?"text-blue-600 dark:text-blue-500":h==="completed"?"text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:d.label}),d.description&&t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:d.description})]})]}),!g&&t.jsx("div",{className:"flex-1 h-0.5 mx-2 bg-gray-300 dark:bg-gray-700 relative",children:t.jsx("div",{className:f("absolute left-0 top-0 h-full bg-blue-600 dark:bg-blue-500 transition-all duration-300",c<r?"w-full":"w-0")})})]},d.id)})})}):t.jsx("div",{className:f("w-full",s),children:t.jsx("div",{className:"space-y-4",children:e.map((d,c)=>{const h=i(c),g=c===e.length-1;return t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx("button",{onClick:()=>l(c),disabled:!n,className:f("flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all","disabled:cursor-default flex-shrink-0",n&&"hover:scale-110",h==="completed"&&"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500",h==="active"&&"bg-white dark:bg-gray-900 border-blue-600 dark:border-blue-500",h==="upcoming"&&"bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-700"),children:h==="completed"?t.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):d.icon?t.jsx("span",{className:f("w-5 h-5",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:d.icon}):t.jsx("span",{className:f("text-sm font-semibold",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:c+1})}),!g&&t.jsx("div",{className:"w-0.5 flex-1 min-h-[32px] bg-gray-300 dark:bg-gray-700 relative mt-2",children:t.jsx("div",{className:f("absolute top-0 left-0 w-full bg-blue-600 dark:bg-blue-500 transition-all duration-300",c<r?"h-full":"h-0")})})]}),t.jsxs("div",{className:"flex-1 pb-4",children:[t.jsx("p",{className:f("text-sm font-medium",h==="active"?"text-blue-600 dark:text-blue-500":h==="completed"?"text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:d.label}),d.description&&t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:d.description})]})]},d.id)})})})},yc=({steps:e,currentStep:r,onStepClick:a,orientation:n="horizontal",className:o})=>t.jsx("nav",{className:f(n==="horizontal"?"flex items-center":"flex flex-col",o),children:e.map((s,l)=>t.jsxs("div",{className:f("flex items-center",n==="vertical"&&"flex-col items-start"),children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:()=>a?.(l),disabled:l>r,className:f("w-10 h-10 rounded-full flex items-center justify-center font-semibold transition-colors",l<r&&"bg-green-500 text-white",l===r&&"bg-blue-500 text-white",l>r&&"bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400"),children:l<r?"✓":l+1}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:s.label}),s.description&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:s.description})]})]}),l<e.length-1&&t.jsx("div",{className:f(n==="horizontal"?"w-full h-0.5 mx-4":"h-8 w-0.5 ml-5 my-2","bg-gray-300 dark:bg-gray-700")})]},s.id))}),pc=({subsections:e,isExpanded:r,selectedSubsection:a,parentSectionId:n,onSubsectionSelect:o})=>{const s=p.useRef(null),[l,i]=p.useState(void 0);return p.useEffect(()=>{if(s.current){const d=s.current.scrollHeight;i(r?d+8:0)}},[r,e]),t.jsx("div",{className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:l!==void 0?`${l}px`:"auto"},children:t.jsx("div",{ref:s,className:"ml-6 mt-2 space-y-1",children:e.map(d=>t.jsx("button",{onClick:()=>o?.(d.id,n),className:`block w-full text-left px-3 py-2 rounded-md text-sm transition-all duration-200 hover:scale-[1.02] ${a===d.id?"bg-blue-100 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 shadow-sm":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-800 dark:hover:text-gray-200"}`,children:d.title},d.id))})})},vc=({sections:e,selectedSection:r,selectedSubsection:a,expandedSections:n,onSectionSelect:o,onSubsectionSelect:s,onToggleSection:l,className:i=""})=>t.jsx("nav",{className:`space-y-2 ${i}`,children:e.map(d=>t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("button",{onClick:()=>o(d.id),className:`flex-1 text-left px-3 py-2 rounded-md text-sm font-medium transition-all duration-200 hover:scale-[1.02] ${r===d.id&&!a?"bg-blue-100 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 shadow-sm":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-gray-100"}`,children:d.title}),d.subsections&&d.subsections.length>0&&t.jsx("button",{onClick:()=>l(d.id),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 hover:scale-110 transition-all duration-200",children:t.jsx(M.ChevronRightIcon,{className:`h-4 w-4 text-gray-500 transition-transform duration-300 ease-in-out ${n.includes(d.id)?"rotate-90":"rotate-0"}`})})]}),d.subsections&&t.jsx(pc,{subsections:d.subsections,isExpanded:n.includes(d.id),selectedSubsection:a,parentSectionId:d.id,onSubsectionSelect:s})]},d.id))});function wc({columns:e,data:r,keyExtractor:a,sort:n,onSort:o,onRowClick:s,striped:l=!1,hoverable:i=!1,compact:d=!1,bordered:c=!1,emptyMessage:h="No data available",className:g}){const y=b=>{b.sortable&&o&&o(b.key)},m={left:"text-left",center:"text-center",right:"text-right"};return t.jsx("div",{className:f("w-full overflow-x-auto",g),children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:t.jsx("tr",{children:e.map(b=>t.jsx("th",{className:f(d?"px-3 py-2":"px-6 py-3","text-xs font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wider",m[b.align||"left"],b.sortable&&"cursor-pointer select-none hover:bg-gray-100 dark:hover:bg-gray-700",c&&"border-r border-gray-200 dark:border-gray-700 last:border-r-0"),style:{width:b.width},onClick:()=>b.sortable&&y(b),children:t.jsxs("div",{className:"flex items-center gap-2",children:[b.label,b.sortable&&t.jsx("span",{className:"flex flex-col",children:n?.column===b.key?n.direction==="asc"?t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M5 10l5-5 5 5H5z"})}):t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M15 10l-5 5-5-5h10z"})}):t.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M5 10l5-5 5 5H5z"})})})]})},b.key))})}),t.jsx("tbody",{className:"bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700",children:r.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:"px-6 py-8 text-center text-sm text-gray-500 dark:text-gray-400",children:h})}):r.map((b,v)=>t.jsx("tr",{className:f(l&&v%2===1&&"bg-gray-50 dark:bg-gray-800/50",i&&"hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",s&&"cursor-pointer"),onClick:()=>s?.(b,v),children:e.map(w=>t.jsx("td",{className:f(d?"px-3 py-2":"px-6 py-4","text-sm text-gray-900 dark:text-white",m[w.align||"left"],c&&"border-r border-gray-200 dark:border-gray-700 last:border-r-0"),children:w.render?w.render(b,v):b[w.key]},w.key))},a(b,v)))})]})})}const kc=({data:e,columns:r,hasActions:a=!1,renderCell:n,renderAction:o,emptyMessage:s="No data available",getRowKey:l=(d,c)=>String(c),className:i=""})=>!e||e.length===0?t.jsx("div",{className:`text-center py-8 bg-gray-50 dark:bg-gray-800 rounded-lg ${i}`,children:t.jsx("p",{className:`${O.body.sm()} text-gray-500 dark:text-gray-400`,children:s})}):t.jsx("div",{className:`relative ${i}`,children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full border-collapse",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700",children:[r.map((d,c)=>t.jsx("th",{className:`${O.label.default()} text-left py-3 px-4 whitespace-nowrap`,children:d},c)),a&&t.jsx("th",{className:`${O.label.default()} text-right py-3 px-4 sticky right-0 bg-white dark:bg-gray-900 whitespace-nowrap`})]})}),t.jsx("tbody",{children:e.map((d,c)=>t.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[r.map((h,g)=>{const y=n(d,g);return t.jsx("td",{className:"py-3 px-4",children:typeof y=="string"?t.jsx("span",{className:O.body.sm(),children:y}):y},g)}),a&&t.jsx("td",{className:"py-3 px-4 text-right sticky right-0 bg-white dark:bg-gray-900",children:o?.(d)})]},l(d,c)))})]})})}),xc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdataUgrid",children:r||"UdataUgrid Component"}),Nc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UpivotUtable",children:r||"UpivotUtable Component"}),Cc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UspreadsheetUgrid",children:r||"UspreadsheetUgrid Component"}),Sc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UcolumnUresize",children:r||"UcolumnUresize Component"}),Ec=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UcellUeditor",children:r||"UcellUeditor Component"}),Tc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UtableUreservation",children:r||"UtableUreservation Component"}),Ac=({children:e,type:r="unordered",spacing:a="sm",marker:n,size:o="md",className:s})=>{const l=r==="ordered"?"ol":"ul",i={none:"space-y-0",sm:"space-y-1",md:"space-y-2",lg:"space-y-4"},d={sm:"text-sm",md:"text-base",lg:"text-lg"},c=()=>n==="none"?"list-none":r==="unordered"?{disc:"list-disc",circle:"list-circle",square:"list-square",decimal:"list-disc",alpha:"list-disc",roman:"list-disc",none:"list-none"}[n||"disc"]:{decimal:"list-decimal",alpha:"list-alpha",roman:"list-roman",disc:"list-decimal",circle:"list-decimal",square:"list-decimal",none:"list-none"}[n||"decimal"];return t.jsx(l,{className:f("ml-6",c(),i[a],d[o],"text-gray-900 dark:text-gray-100",s),children:e})},Ic=({children:e,className:r})=>t.jsx("li",{className:f("leading-relaxed",r),children:e}),Lc=({children:e,onAction:r,actionText:a="Remove",actionIcon:n=M.TrashIcon,destructive:o=!0,isProcessing:s=!1,variant:l="default",className:i})=>{const d="flex items-center justify-between p-4 rounded-lg transition-colors",c={default:"bg-gray-50 dark:bg-gray-700",compact:"bg-gray-50 dark:bg-gray-700 py-2 px-3",elevated:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 shadow-sm hover:shadow-md"};return t.jsxs("div",{className:f(d,c[l],i),children:[t.jsx("div",{className:"flex-1 text-sm text-gray-900 dark:text-white",children:e}),t.jsxs(ne,{variant:o?"ghost":"outline",size:"sm",onClick:r,disabled:s,className:f("ml-4",o&&"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-900/20"),children:[t.jsx(n,{className:"h-4 w-4 mr-1"}),a]})]})},Mc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UuserUtable",children:r||"UuserUtable Component"}),Pc=({source:e,target:r,onChange:a,sourceTitle:n="Available",targetTitle:o="Selected",searchable:s=!0,sourceSearchPlaceholder:l="Search available...",targetSearchPlaceholder:i="Search selected...",height:d=300,disabled:c=!1,className:h})=>{const[g,y]=p.useState(""),[m,b]=p.useState(""),[v,w]=p.useState(new Set),[S,k]=p.useState(new Set),x=s?e.filter(j=>j.label.toLowerCase().includes(g.toLowerCase())):e,N=s?r.filter(j=>j.label.toLowerCase().includes(m.toLowerCase())):r,E=j=>{const B=new Set(v);B.has(j)?B.delete(j):B.add(j),w(B)},A=j=>{const B=new Set(S);B.has(j)?B.delete(j):B.add(j),k(B)},C=()=>{const j=e.filter(F=>v.has(F.id)),B=e.filter(F=>!v.has(F.id)),D=[...r,...j];a(B,D),w(new Set)},I=()=>{const j=r.filter(F=>S.has(F.id)),B=r.filter(F=>!S.has(F.id)),D=[...e,...j];a(D,B),k(new Set)},L=()=>{const j=[...r,...e];a([],j),w(new Set)},P=()=>{const j=[...e,...r];a(j,[]),k(new Set)},U=(j,B,D,F,$,R,sb)=>t.jsxs("div",{className:"flex flex-col flex-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-900",children:[t.jsxs("div",{className:"px-3 py-2 border-b border-gray-300 dark:border-gray-700 bg-gray-50 dark:bg-gray-800",children:[t.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:B}),t.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[j.length," item",j.length!==1?"s":""]})]}),s&&t.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:t.jsx("input",{type:"text",value:$,onChange:le=>R(le.target.value),placeholder:sb,className:"w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"})}),t.jsx("div",{className:"overflow-y-auto p-2 space-y-1",style:{height:s?d-120:d-60},children:j.length===0?t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-gray-500 dark:text-gray-400",children:"No items"}):j.map(le=>{const Ct=D.has(le.id);return t.jsx("button",{onClick:()=>!le.disabled&&F(le.id),disabled:le.disabled||c,className:f("w-full px-3 py-2 text-left rounded-md transition-colors","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",Ct&&"bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700"),children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("div",{className:f("w-4 h-4 border-2 rounded flex items-center justify-center flex-shrink-0 mt-0.5",Ct?"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500":"border-gray-300 dark:border-gray-600"),children:Ct&&t.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:le.label}),le.description&&t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 truncate",children:le.description})]})]})},le.id)})})]});return t.jsxs("div",{className:f("flex gap-4",h),children:[U(x,n,v,E,g,y,l),t.jsxs("div",{className:"flex flex-col justify-center gap-2",children:[t.jsx("button",{onClick:L,disabled:c||e.length===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move all to selected",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})}),t.jsx("button",{onClick:C,disabled:c||v.size===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move selected to target",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsx("button",{onClick:I,disabled:c||S.size===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move selected to source",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),t.jsx("button",{onClick:P,disabled:c||r.length===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move all to available",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 19l-7-7 7-7M19 19l-7-7 7-7"})})})]}),U(N,o,S,A,m,b,i)]})};function Oc({items:e,itemHeight:r,height:a,renderItem:n,keyExtractor:o,overscan:s=3,className:l}){const[i,d]=p.useState(0),c=p.useRef(null),h=v=>{d(v.currentTarget.scrollTop)},g=e.length*r,y=Math.max(0,Math.floor(i/r)-s),m=Math.min(e.length-1,Math.ceil((i+a)/r)+s),b=e.slice(y,m+1);return t.jsx("div",{ref:c,className:f("overflow-auto",l),style:{height:a},onScroll:h,children:t.jsx("div",{style:{height:g,position:"relative"},children:b.map((v,w)=>{const S=y+w;return t.jsx("div",{style:{position:"absolute",top:S*r,height:r,width:"100%"},children:n(v,S)},o(v,S))})})})}const Uc=({data:e,selectedId:r,onSelect:a,expandedIds:n,onExpand:o,defaultExpanded:s=!1,showLines:l=!1,className:i})=>{const[d,c]=p.useState(new Set(s?e.map(b=>b.id):[])),h=n!==void 0?new Set(n):d,g=b=>{n!==void 0&&o?o(b):c(v=>{const w=new Set(v);return w.has(b)?w.delete(b):w.add(b),w})},y=b=>{!b.disabled&&a&&a(b)},m=(b,v=0)=>{const w=b.children&&b.children.length>0,S=h.has(b.id),k=r===b.id;return t.jsxs("div",{children:[t.jsxs("div",{className:f("flex items-center gap-2 px-2 py-1.5 rounded-md transition-colors",!b.disabled&&"hover:bg-gray-100 dark:hover:bg-gray-800",k&&"bg-blue-50 dark:bg-blue-900/30",b.disabled&&"opacity-50 cursor-not-allowed",!b.disabled&&"cursor-pointer"),style:{paddingLeft:`${v*1.5+.5}rem`},onClick:()=>y(b),children:[w?t.jsx("button",{onClick:x=>{x.stopPropagation(),g(b.id)},className:"flex-shrink-0 w-4 h-4 flex items-center justify-center hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",children:t.jsx("svg",{className:f("w-3 h-3 transition-transform",S&&"rotate-90"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):t.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),b.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4 text-gray-600 dark:text-gray-400",children:b.icon}),t.jsx("span",{className:f("flex-1 text-sm",k?"text-blue-700 dark:text-blue-300 font-medium":"text-gray-900 dark:text-white"),children:b.label})]}),w&&S&&t.jsx("div",{className:f(l&&"border-l-2 border-gray-200 dark:border-gray-700 ml-2"),children:b.children.map(x=>m(x,v+1))})]},b.id)};return t.jsx("div",{className:f("w-full",i),children:e.map(b=>m(b,0))})},Dc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UlistingUform",children:r||"UlistingUform Component"}),jc="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border border-blue-200 dark:border-blue-800",_c={none:"",sm:"p-3",md:"p-6",lg:"p-8"},Qr=({variant:e="elevated",padding:r="md",icon:a,onClose:n,className:o,children:s,...l})=>{const d=["info","success","warning","error"].includes(e)&&(a||n),c=e==="callout"?jc:vo(e);return t.jsx("div",{className:f("rounded-lg",c,_c[r],o),...l,children:d?t.jsxs("div",{className:"flex items-start gap-3",children:[a&&t.jsx("div",{className:"flex-shrink-0 text-lg",children:a}),t.jsx("div",{className:"flex-1 min-w-0",children:s}),n&&t.jsx("button",{onClick:n,className:"flex-shrink-0 text-current hover:opacity-70 transition-opacity","aria-label":"Close",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):s})},zc=({title:e,description:r,className:a,children:n,...o})=>t.jsxs("div",{className:f("space-y-1.5",a),...o,children:[e&&t.jsx("h3",{className:O.heading.h4(),children:e}),r&&t.jsx("p",{className:O.body.sm(),children:r}),n]}),Bc=({className:e,children:r,...a})=>t.jsx("div",{className:f("",e),...a,children:r}),Fc=({className:e,children:r,...a})=>t.jsx("div",{className:f("flex items-center pt-4",e),...a,children:r}),Wc=({title:e,children:r,variant:a="info",size:n="default",className:o})=>{const s={sm:"sm",default:"md",lg:"lg"},l=a==="neutral"?"bordered":a;return t.jsxs(Qr,{variant:l,padding:s[n],className:o,children:[e&&t.jsx("h3",{className:f("font-semibold mb-2",n==="sm"?"text-base":n==="lg"?"text-xl":"text-lg"),children:e}),r]})},$c=({title:e,icon:r,children:a,variant:n="gradient",size:o="default",centered:s=!1,className:l})=>{const i={sm:"sm",default:"md",lg:"lg"},d=n==="gradient"||n==="neutral"?"callout":n;return t.jsx(Qr,{variant:d,padding:i[o],className:l,children:t.jsxs("div",{className:f("space-y-4",s&&"text-center"),children:[r&&t.jsx("div",{className:f("font-bold",o==="sm"?"text-2xl":o==="lg"?"text-5xl":"text-4xl",s?"text-center":"text-left"),children:r}),e&&t.jsx("h3",{className:f("font-bold mb-4",o==="sm"?"text-lg":o==="lg"?"text-3xl":"text-2xl"),children:e}),t.jsx("div",{className:f("text-gray-600 dark:text-gray-400",o==="sm"?"text-sm":o==="lg"?"text-lg":"text-base"),children:a})]})})},Vc=({title:e,value:r,change:a,changePeriod:n="vs last period",icon:o,variant:s="default",className:l})=>{const i={default:"bg-white dark:bg-gray-900",primary:"bg-blue-50 dark:bg-blue-900/20",success:"bg-green-50 dark:bg-green-900/20",warning:"bg-yellow-50 dark:bg-yellow-900/20",danger:"bg-red-50 dark:bg-red-900/20"};return t.jsxs("div",{className:f("rounded-lg border border-gray-200 dark:border-gray-700 p-6",i[s],l),children:[t.jsxs("div",{className:"flex items-start justify-between mb-2",children:[t.jsx("h3",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:e}),o&&t.jsx("div",{className:"text-gray-400 dark:text-gray-600",children:o})]}),t.jsx("div",{className:"flex items-end justify-between",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:r}),a!==void 0&&t.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[t.jsxs("span",{className:f("text-sm font-medium",a>=0?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:[a>=0?"↑":"↓"," ",Math.abs(a),"%"]}),t.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:n})]})]})})]})},Hc=({src:e,alt:r="Avatar",fallback:a,name:n,size:o="md",status:s,className:l,onClick:i})=>{const[d,c]=p.useState(!1),h={sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-base"},g={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},y={online:"bg-green-500",offline:"bg-gray-400",away:"bg-yellow-500",busy:"bg-red-500"},b=a||(n?(S=>{const k=S.trim().split(/\s+/);return k.length===1?k[0].charAt(0).toUpperCase():k[0].charAt(0).toUpperCase()+k[k.length-1].charAt(0).toUpperCase()})(n):""),v=e&&!d,w=()=>{c(!0)};return t.jsxs("div",{className:"relative inline-block flex-shrink-0",children:[t.jsx("div",{className:f("flex items-center justify-center overflow-hidden rounded-full",h[o],!v&&"bg-gray-300 dark:bg-gray-600 text-gray-700 dark:text-gray-200",i&&"cursor-pointer hover:opacity-80 transition-opacity",l),onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,children:v?t.jsx("img",{src:e,alt:r,className:"w-full h-full object-cover",onError:w}):t.jsx("span",{className:"font-semibold",children:b})}),s&&t.jsx("span",{className:f("absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-gray-800",y[s],g[o]),"aria-label":s})]})},qc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UavatarUgroup",children:r||"UavatarUgroup Component"}),Gc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UprofileUheader",children:r||"UprofileUheader Component"}),Yc=({label:e,value:r,orientation:a="vertical",align:n="start",labelWidth:o="auto",size:s="md",separator:l=!1,labelVariant:i="muted",valueVariant:d="default",className:c,labelClassName:h,valueClassName:g})=>{const y={sm:{label:O.body.sm(),value:O.body.sm(),gap:"gap-1"},md:{label:O.body.md(),value:O.body.md(),gap:"gap-2"},lg:{label:O.body.lg(),value:O.body.lg(),gap:"gap-3"}},m={auto:"",sm:"w-24",md:"w-32",lg:"w-40"},b={start:"justify-start",center:"justify-center",between:"justify-between"},v={default:"text-gray-700 dark:text-gray-300",muted:"text-gray-600 dark:text-gray-400",strong:"text-gray-900 dark:text-gray-100 font-semibold"},w={default:"text-gray-900 dark:text-gray-100",muted:"text-gray-600 dark:text-gray-400",strong:"text-gray-900 dark:text-gray-100 font-semibold",primary:"text-blue-600 dark:text-blue-400"},S=y[s];return t.jsxs("div",{className:f(a==="horizontal"?"flex items-center":"flex flex-col",a==="horizontal"&&b[n],S.gap,l&&"pb-3 mb-3 border-b border-gray-200 dark:border-gray-700",c),children:[t.jsx("dt",{className:f(S.label,v[i],a==="horizontal"&&m[o],a==="horizontal"&&"flex-shrink-0",h),children:e}),t.jsx("dd",{className:f(S.value,w[d],a==="horizontal"&&"flex-1",g),children:r})]})},Kc=({value:e,label:r,variant:a="neutral",size:n="md",align:o="center",icon:s,iconPosition:l="top",className:i,valueClassName:d,labelClassName:c})=>{const h={primary:{value:"text-blue-600 dark:text-blue-400",label:"text-blue-600/70 dark:text-blue-400/70",icon:"text-blue-600 dark:text-blue-400"},success:{value:"text-green-600 dark:text-green-400",label:"text-green-600/70 dark:text-green-400/70",icon:"text-green-600 dark:text-green-400"},warning:{value:"text-yellow-600 dark:text-yellow-400",label:"text-yellow-600/70 dark:text-yellow-400/70",icon:"text-yellow-600 dark:text-yellow-400"},danger:{value:"text-red-600 dark:text-red-400",label:"text-red-600/70 dark:text-red-400/70",icon:"text-red-600 dark:text-red-400"},neutral:{value:"text-gray-900 dark:text-gray-100",label:"text-gray-600 dark:text-gray-400",icon:"text-gray-600 dark:text-gray-400"},white:{value:"text-white",label:"text-white/70",icon:"text-white"}},g={sm:{value:O.heading.h5(),label:O.caption.default(),icon:"h-4 w-4"},md:{value:O.heading.h4(),label:O.body.sm(),icon:"h-5 w-5"},lg:{value:O.heading.h3(),label:O.body.md(),icon:"h-6 w-6"},xl:{value:O.heading.h2(),label:O.body.lg(),icon:"h-8 w-8"}},y={left:"text-left",center:"text-center",right:"text-right"},m=h[a],b=g[n];return t.jsxs("div",{className:f(y[o],i),children:[s&&l==="top"&&t.jsx(s,{className:f(b.icon,m.icon,"mb-2",o==="center"&&"mx-auto")}),t.jsxs("div",{className:f(l==="left"&&s&&"flex items-center gap-3",o==="center"&&l==="left"&&"justify-center"),children:[s&&l==="left"&&t.jsx(s,{className:f(b.icon,m.icon)}),t.jsxs("div",{children:[t.jsx("div",{className:f("font-bold",b.value,m.value,d),children:e}),t.jsx("div",{className:f(b.label,m.label,c),children:r})]})]})]})},Wa=({icon:e,title:r="No data",description:a,action:n,className:o})=>t.jsxs("div",{className:f("flex flex-col items-center justify-center py-12 px-4 text-center",o),children:[e&&t.jsx("div",{className:"mb-4 text-gray-400 dark:text-gray-600",children:e}),t.jsx("h3",{className:f(O.heading.h3(),"mb-2"),children:r}),a&&t.jsx("p",{className:f(O.body.sm(),"text-gray-600 dark:text-gray-400 max-w-sm mb-6"),children:a}),n&&t.jsx("div",{className:"mt-4",children:n})]}),Zc=({title:e,subtext:r,className:a})=>t.jsx(Wa,{title:e,description:r,className:a}),Xc=({data:e,orientation:r="vertical",showValues:a=!1,showGrid:n=!0,barWidth:o=40,height:s=300,className:l})=>{const i=Math.max(...e.map(c=>c.value)),d="#3b82f6";return t.jsx("div",{className:f("w-full",l),children:t.jsxs("div",{className:"relative bg-white dark:bg-gray-900 rounded-lg p-6",style:{height:`${s}px`},children:[n&&t.jsx("div",{className:"absolute inset-6 flex flex-col justify-between",children:[...Array(5)].map((c,h)=>t.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700"},h))}),r==="vertical"?t.jsx("div",{className:"relative h-full flex items-end justify-around gap-2",children:e.map((c,h)=>{const g=c.value/i*100;return t.jsxs("div",{className:"flex flex-col items-center gap-2",style:{width:`${o}px`},children:[a&&t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.value}),t.jsx("div",{className:"w-full rounded-t transition-all hover:opacity-80",style:{height:`${g}%`,backgroundColor:c.color||d}}),t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.label})]},h)})}):t.jsx("div",{className:"relative h-full flex flex-col justify-around gap-2",children:e.map((c,h)=>{const g=c.value/i*100;return t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 w-16 text-right",children:c.label}),t.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[t.jsx("div",{className:"h-8 rounded transition-all hover:opacity-80",style:{width:`${g}%`,backgroundColor:c.color||d}}),a&&t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.value})]})]},h)})})]})})},Qc=({series:e,showLegend:r=!0,showGrid:a=!0,showPoints:n=!0,height:o=300,xLabels:s,className:l})=>{const i=e.flatMap(m=>m.data),d=Math.max(...i.map(m=>m.y)),c=Math.min(...i.map(m=>m.y)),h=Math.max(...i.map(m=>m.x)),g=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],y=m=>m.length===0?"":`M ${m.map(v=>{const w=v.x/h*100,S=100-(v.y-c)/(d-c)*100;return`${w},${S}`}).join(" L ")}`;return t.jsxs("div",{className:f("w-full",l),children:[r&&t.jsx("div",{className:"flex flex-wrap gap-4 mb-4",children:e.map((m,b)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:m.color||g[b%g.length]}}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:m.name})]},b))}),t.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6",children:[t.jsxs("div",{className:"relative",style:{height:`${o}px`},children:[a&&t.jsx("div",{className:"absolute inset-0",children:[...Array(5)].map((m,b)=>t.jsx("div",{className:"absolute w-full border-t border-gray-200 dark:border-gray-700",style:{top:`${b*25}%`}},b))}),t.jsx("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:e.map((m,b)=>{const v=m.color||g[b%g.length];return t.jsxs("g",{children:[t.jsx("path",{d:y(m.data),fill:"none",stroke:v,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}),n&&m.data.map((w,S)=>{const k=w.x/h*100,x=100-(w.y-c)/(d-c)*100;return t.jsx("circle",{cx:k,cy:x,r:"1",fill:v,vectorEffect:"non-scaling-stroke"},S)})]},b)})})]}),s&&t.jsx("div",{className:"flex justify-between mt-2",children:s.map((m,b)=>t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:m},b))})]})]})},Jc=({data:e,variant:r="pie",showLegend:a=!0,showPercentages:n=!1,size:o=200,donutHoleSize:s=40,className:l})=>{const i=e.reduce((b,v)=>b+v.value,0),d=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],c=e.reduce((b,v,w)=>{const S=v.value/i*100,k=S/100*360,x=b.length>0?b[b.length-1].endAngle:-90,N=x+k;return b.push({...v,percentage:S,startAngle:x,endAngle:N,color:v.color||d[w%d.length]}),b},[]),h=(b,v,w,S)=>{const k=(S-90)*Math.PI/180;return{x:b+w*Math.cos(k),y:v+w*Math.sin(k)}},g=(b,v,w,S,k)=>{const x=h(b,v,w,k),N=h(b,v,w,S),E=k-S<=180?"0":"1";if(r==="donut"){const A=w*s/100,C=h(b,v,A,k),I=h(b,v,A,S);return["M",x.x,x.y,"A",w,w,0,E,0,N.x,N.y,"L",I.x,I.y,"A",A,A,0,E,1,C.x,C.y,"Z"].join(" ")}return["M",b,v,"L",x.x,x.y,"A",w,w,0,E,0,N.x,N.y,"Z"].join(" ")},y=o/2,m=o/2-10;return t.jsxs("div",{className:f("flex flex-col items-center gap-4",l),children:[t.jsx("svg",{width:o,height:o,className:"transform rotate-0",children:c.map((b,v)=>t.jsx("path",{d:g(y,y,m,b.startAngle,b.endAngle),fill:b.color,className:"transition-opacity hover:opacity-80"},v))}),a&&t.jsx("div",{className:"flex flex-col gap-2",children:c.map((b,v)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:b.color}}),t.jsxs("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:[b.label,n&&t.jsxs("span",{className:"text-gray-500 dark:text-gray-400 ml-1",children:["(",Math.round(b.percentage),"%)"]})]})]},v))})]})},Rc=({series:e,showLegend:r=!0,showGrid:a=!0,fillOpacity:n=.2,height:o=300,xLabels:s,className:l})=>{const i=e.flatMap(b=>b.data),d=Math.max(...i.map(b=>b.y)),c=Math.min(...i.map(b=>b.y)),h=Math.max(...i.map(b=>b.x)),g=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],y=b=>{if(b.length===0)return"";const v=b.map(k=>{const x=k.x/h*100,N=100-(k.y-c)/(d-c)*100;return`${x},${N}`}),w=b[0].x/h*100,S=b[b.length-1].x/h*100;return`M ${w},100 L ${v.join(" L ")} L ${S},100 Z`},m=b=>b.length===0?"":`M ${b.map(w=>{const S=w.x/h*100,k=100-(w.y-c)/(d-c)*100;return`${S},${k}`}).join(" L ")}`;return t.jsxs("div",{className:f("w-full",l),children:[r&&t.jsx("div",{className:"flex flex-wrap gap-4 mb-4",children:e.map((b,v)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:b.color||g[v%g.length]}}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:b.name})]},v))}),t.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6",children:[t.jsxs("div",{className:"relative",style:{height:`${o}px`},children:[a&&t.jsx("div",{className:"absolute inset-0",children:[...Array(5)].map((b,v)=>t.jsx("div",{className:"absolute w-full border-t border-gray-200 dark:border-gray-700",style:{top:`${v*25}%`}},v))}),t.jsx("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:e.map((b,v)=>{const w=b.color||g[v%g.length];return t.jsxs("g",{children:[t.jsx("path",{d:y(b.data),fill:w,fillOpacity:n}),t.jsx("path",{d:m(b.data),fill:"none",stroke:w,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"})]},v)})})]}),s&&t.jsx("div",{className:"flex justify-between mt-2",children:s.map((b,v)=>t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:b},v))})]})]})},ed=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UradarUchart",children:r||"UradarUchart Component"}),rd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UbubbleUchart",children:r||"UbubbleUchart Component"}),td=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UscatterUplot",children:r||"UscatterUplot Component"}),ad=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UtreeUmap",children:r||"UtreeUmap Component"}),nd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsankeyUdiagram",children:r||"UsankeyUdiagram Component"}),od=({data:e,width:r=100,height:a=30,color:n="#3b82f6",fill:o=!1,className:s})=>{if(e.length===0)return null;const l=Math.max(...e),i=Math.min(...e),d=l-i||1,c=e.map((h,g)=>{const y=g/(e.length-1)*r,m=a-(h-i)/d*a;return`${y},${m}`}).join(" ");return t.jsxs("svg",{width:r,height:a,className:f("inline-block",s),children:[o&&t.jsx("polygon",{points:`0,${a} ${c} ${r},${a}`,fill:n,opacity:"0.2"}),t.jsx("polyline",{points:c,fill:"none",stroke:n,strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round"})]})},sd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"Uheatmap",children:r||"Uheatmap Component"}),ld=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UfunnelUchart",children:r||"UfunnelUchart Component"}),id=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"BurndownChart",children:r||"BurndownChart Component"}),cd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UperformanceUchart",children:r||"UperformanceUchart Component"}),dd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmetricUcomparison",children:r||"UmetricUcomparison Component"}),ud=({value:e,min:r=0,max:a=100,size:n=120,strokeWidth:o=10,showValue:s=!0,label:l,variant:i="primary",className:d})=>{const c=Math.min(a,Math.max(r,e)),h=(c-r)/(a-r)*100,g=n/2,y=(n-o)/2,m=Math.PI*y,b=m-h/100*m,v={primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-600 dark:stroke-yellow-500",danger:"stroke-red-600 dark:stroke-red-500"};return t.jsxs("div",{className:f("inline-flex flex-col items-center gap-2",d),children:[t.jsxs("svg",{width:n,height:n*.65,className:"transform rotate-180",children:[t.jsx("path",{d:`M ${o/2} ${g} A ${y} ${y} 0 0 1 ${n-o/2} ${g}`,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:o,strokeLinecap:"round"}),t.jsx("path",{d:`M ${o/2} ${g} A ${y} ${y} 0 0 1 ${n-o/2} ${g}`,fill:"none",className:f(v[i],"transition-all duration-500"),strokeWidth:o,strokeDasharray:m,strokeDashoffset:b,strokeLinecap:"round"})]}),s&&t.jsxs("div",{className:"text-center -mt-8",children:[t.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:Math.round(c)}),l&&t.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400",children:l})]})]})},gd=({value:e=0,max:r=100,variant:a="default",size:n="md",showLabel:o=!1,label:s,indeterminate:l=!1,striped:i=!1,animated:d=!1,className:c})=>{const h=Math.min(Math.max(e/r*100,0),100),g={default:"bg-blue-600 dark:bg-blue-500",success:"bg-green-600 dark:bg-green-500",warning:"bg-yellow-600 dark:bg-yellow-500",danger:"bg-red-600 dark:bg-red-500"},y={sm:"h-1",md:"h-2",lg:"h-4"};return t.jsxs("div",{className:f("w-full",c),children:[t.jsx("div",{className:f("w-full bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",y[n]),role:"progressbar","aria-valuenow":l?void 0:h,"aria-valuemin":0,"aria-valuemax":100,children:l?t.jsx("div",{className:f("h-full rounded-full animate-pulse",g[a]),style:{width:"100%"}}):t.jsx("div",{className:f("h-full rounded-full transition-all duration-300",g[a],i&&"bg-stripe",i&&d&&"animate-stripe"),style:{width:`${h}%`}})}),(o||s)&&t.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400 text-right",children:s||`${Math.round(h)}%`})]})},hd=({value:e,size:r=100,strokeWidth:a=8,showValue:n=!0,label:o,variant:s="primary",color:l,trackColor:i,className:d})=>{const c=Math.min(100,Math.max(0,e)),h=r/2,g=(r-a)/2,y=2*Math.PI*g,m=y-c/100*y,b={primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-600 dark:stroke-yellow-500",danger:"stroke-red-600 dark:stroke-red-500"},v=i||"stroke-gray-200 dark:stroke-gray-700";return t.jsx("div",{className:f("inline-flex items-center justify-center",d),children:t.jsxs("div",{className:"relative",style:{width:r,height:r},children:[t.jsxs("svg",{width:r,height:r,className:"transform -rotate-90",children:[t.jsx("circle",{cx:h,cy:h,r:g,className:v,strokeWidth:a,fill:"none"}),t.jsx("circle",{cx:h,cy:h,r:g,className:f(l?"":b[s],"transition-all duration-300 ease-in-out"),stroke:l,strokeWidth:a,strokeDasharray:y,strokeDashoffset:m,strokeLinecap:"round",fill:"none"})]}),(n||o)&&t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[n&&!o&&t.jsxs("span",{className:"text-gray-900 dark:text-white font-bold",style:{fontSize:r*.2},children:[Math.round(c),"%"]}),o&&t.jsx("span",{className:"text-gray-900 dark:text-white font-medium text-center px-2",style:{fontSize:r*.15},children:o})]})]})})},fd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UprogressUtracker",children:r||"UprogressUtracker Component"}),bd=({src:e,alt:r,fallback:a,width:n,height:o,objectFit:s="cover",loading:l="lazy",showLoader:i=!0,rounded:d="none",border:c=!1,className:h,onLoad:g,onError:y})=>{const[m,b]=p.useState(!0),[v,w]=p.useState(!1),[S,k]=p.useState(e);p.useEffect(()=>{b(!0),w(!1),k(e)},[e]);const x=()=>{b(!1),g?.()},N=()=>{b(!1),w(!0),a&&S!==a&&(k(a),w(!1),b(!0)),y?.()},E={none:"",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},A={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},C={width:typeof n=="number"?`${n}px`:n,height:typeof o=="number"?`${o}px`:o};return t.jsxs("div",{className:f("relative inline-block overflow-hidden bg-gray-100 dark:bg-gray-800",E[d],c&&"border border-gray-200 dark:border-gray-700",h),style:C,children:[i&&m&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx("div",{className:"animate-pulse",children:t.jsx(M.PhotoIcon,{className:"h-8 w-8 text-gray-400"})})}),v&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx(M.PhotoIcon,{className:"h-8 w-8 text-gray-400"})}),!v&&t.jsx("img",{src:S,alt:r,loading:l,onLoad:x,onError:N,className:f("w-full h-full",A[s],m&&i&&"opacity-0")})]})},md=({images:e,columns:r=3,gap:a=16,lightbox:n=!0,className:o})=>{const[s,l]=p.useState(null),i=g=>{n&&l(g)},d=()=>{l(null)},c=()=>{if(!s)return;const g=e.findIndex(m=>m.id===s.id),y=g>0?g-1:e.length-1;l(e[y])},h=()=>{if(!s)return;const g=e.findIndex(m=>m.id===s.id),y=g<e.length-1?g+1:0;l(e[y])};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:f("grid",o),style:{gridTemplateColumns:`repeat(${r}, 1fr)`,gap:`${a}px`},children:e.map(g=>t.jsxs("div",{className:f("relative aspect-square overflow-hidden rounded-lg bg-gray-200 dark:bg-gray-700",n&&"cursor-pointer hover:opacity-90 transition-opacity"),onClick:()=>i(g),children:[t.jsx("img",{src:g.thumbnail||g.src,alt:g.alt||"",className:"w-full h-full object-cover"}),g.caption&&t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/50 text-white text-sm p-2",children:g.caption})]},g.id))}),n&&s&&t.jsxs("div",{className:"fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",onClick:d,children:[t.jsx("button",{onClick:d,className:"absolute top-4 right-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),t.jsx("button",{onClick:g=>{g.stopPropagation(),c()},className:"absolute left-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),t.jsx("button",{onClick:g=>{g.stopPropagation(),h()},className:"absolute right-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsxs("div",{className:"max-w-4xl max-h-full",onClick:g=>g.stopPropagation(),children:[t.jsx("img",{src:s.src,alt:s.alt||"",className:"max-w-full max-h-[80vh] object-contain"}),s.caption&&t.jsx("p",{className:"text-white text-center mt-4",children:s.caption})]})]})]})},yd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UimageUcomparison",children:r||"UimageUcomparison Component"}),pd=({src:e,onCropComplete:r,initialCrop:a,className:n})=>{const[o,s]=p.useState(a||{x:50,y:50,width:200,height:200}),l=p.useRef(null),i=async()=>{if(!l.current||!r)return;const d=document.createElement("canvas"),c=d.getContext("2d");if(!c)return;const h=l.current,g=h.naturalWidth/h.width,y=h.naturalHeight/h.height;d.width=o.width*g,d.height=o.height*y,c.drawImage(h,o.x*g,o.y*y,o.width*g,o.height*y,0,0,d.width,d.height);const m=d.toDataURL("image/png");r(m,o)};return t.jsxs("div",{className:f("inline-flex flex-col gap-4",n),children:[t.jsxs("div",{className:"relative inline-block",children:[t.jsx("img",{ref:l,src:e,alt:"Crop preview",className:"max-w-full h-auto",crossOrigin:"anonymous"}),t.jsxs("div",{className:"absolute border-2 border-blue-500 bg-blue-500/20",style:{left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`,cursor:"move"},children:[t.jsx("div",{className:"absolute -top-1 -left-1 w-3 h-3 bg-blue-500 rounded-full cursor-nw-resize"}),t.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 rounded-full cursor-ne-resize"}),t.jsx("div",{className:"absolute -bottom-1 -left-1 w-3 h-3 bg-blue-500 rounded-full cursor-sw-resize"}),t.jsx("div",{className:"absolute -bottom-1 -right-1 w-3 h-3 bg-blue-500 rounded-full cursor-se-resize"})]})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:i,className:f("px-4 py-2 text-sm font-medium","bg-blue-600 dark:bg-blue-500 text-white","rounded-md","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors"),children:"Crop Image"}),t.jsx("button",{onClick:()=>s(a||{x:50,y:50,width:200,height:200}),className:f("px-4 py-2 text-sm font-medium","bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-white","rounded-md","hover:bg-gray-300 dark:hover:bg-gray-600","transition-colors"),children:"Reset"})]}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:'Drag to adjust crop area. Click "Crop Image" to export.'})]})},vd=({images:e,index:r,isOpen:a,onClose:n,onIndexChange:o,showThumbnails:s=!1,showDownload:l=!1,showZoom:i=!0,className:d})=>{const[c,h]=p.useState(1),g=e[r],y=r>0,m=r<e.length-1,b=p.useCallback(()=>{if(y){const N=r-1;o?.(N),h(1)}},[y,r,o]),v=p.useCallback(()=>{if(m){const N=r+1;o?.(N),h(1)}},[m,r,o]),w=()=>{h(N=>Math.min(N+.5,3))},S=()=>{h(N=>Math.max(N-.5,.5))},k=()=>{h(1)},x=()=>{const N=document.createElement("a");N.href=g.src,N.download=g.alt||"image",N.click()};return p.useEffect(()=>{if(!a)return;const N=E=>{switch(E.key){case"Escape":n();break;case"ArrowLeft":b();break;case"ArrowRight":v();break;case"+":case"=":w();break;case"-":case"_":S();break;case"0":k();break}};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[a,r,e.length,n,b,v]),p.useEffect(()=>(a?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[a]),p.useEffect(()=>{h(1)},[r]),!a||!g?null:t.jsx(me,{children:t.jsxs("div",{className:f("fixed inset-0 z-50 flex items-center justify-center","bg-black/95",d),children:[t.jsx("div",{className:"absolute inset-0",onClick:n,"aria-label":"Close lightbox"}),t.jsx("button",{onClick:n,className:"absolute top-4 right-4 z-10 p-2 text-white hover:text-gray-300 transition-colors","aria-label":"Close",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),y&&t.jsx("button",{onClick:b,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-3 text-white hover:text-gray-300 bg-black/50 hover:bg-black/70 rounded-full transition-all","aria-label":"Previous image",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),m&&t.jsx("button",{onClick:v,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-3 text-white hover:text-gray-300 bg-black/50 hover:bg-black/70 rounded-full transition-all","aria-label":"Next image",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsxs("div",{className:"absolute top-4 left-4 z-10 flex gap-2",children:[t.jsxs("div",{className:"px-3 py-1.5 bg-black/50 text-white text-sm rounded-md",children:[r+1," / ",e.length]}),i&&t.jsxs("div",{className:"flex gap-1 bg-black/50 rounded-md p-1",children:[t.jsx("button",{onClick:S,className:"p-1.5 text-white hover:text-gray-300 transition-colors","aria-label":"Zoom out",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7"})})}),t.jsxs("button",{onClick:k,className:"px-2 text-white text-sm hover:text-gray-300 transition-colors","aria-label":"Reset zoom",children:[Math.round(c*100),"%"]}),t.jsx("button",{onClick:w,className:"p-1.5 text-white hover:text-gray-300 transition-colors","aria-label":"Zoom in",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7"})})})]}),l&&t.jsx("button",{onClick:x,className:"p-1.5 bg-black/50 text-white hover:text-gray-300 rounded-md transition-colors","aria-label":"Download image",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})})]}),t.jsx("div",{className:"relative z-0 flex items-center justify-center max-w-7xl max-h-screen p-20",children:t.jsx("img",{src:g.src,alt:g.alt||"",className:"max-w-full max-h-full object-contain transition-transform",style:{transform:`scale(${c})`}})}),g.caption&&t.jsx("div",{className:"absolute bottom-20 left-0 right-0 z-10 text-center",children:t.jsx("p",{className:"px-4 py-2 bg-black/50 text-white text-sm inline-block rounded-md max-w-2xl",children:g.caption})}),s&&e.length>1&&t.jsx("div",{className:"absolute bottom-4 left-0 right-0 z-10 flex justify-center gap-2 px-4 overflow-x-auto",children:e.map((N,E)=>t.jsx("button",{onClick:()=>{o?.(E),h(1)},className:f("flex-shrink-0 w-16 h-16 rounded-md overflow-hidden","border-2 transition-all",E===r?"border-white scale-110":"border-transparent opacity-60 hover:opacity-100 hover:border-gray-400"),children:t.jsx("img",{src:N.thumbnail||N.src,alt:N.alt||"",className:"w-full h-full object-cover"})},E))})]})})},wd=({src:e,alt:r,scale:a=2,className:n,containerClassName:o,onLoad:s,onError:l})=>{const[i,d]=p.useState(null),c=g=>{const y=g.currentTarget;d({width:Math.round(y.naturalWidth/a),height:Math.round(y.naturalHeight/a)}),s?.()},h=g=>{l?.()};return t.jsx("img",{src:e,alt:r,className:f("max-w-full h-auto",n),onLoad:c,onError:h,width:i?.width,height:i?.height,style:i?void 0:{visibility:"hidden"}})},kd=({src:e,poster:r,autoPlay:a=!1,loop:n=!1,muted:o=!1,controls:s=!0,className:l})=>{const i=p.useRef(null),[d,c]=p.useState(a),[h,g]=p.useState(1),[y,m]=p.useState(0),[b,v]=p.useState(0);p.useEffect(()=>{const E=i.current;if(!E)return;const A=()=>m(E.currentTime),C=()=>v(E.duration),I=()=>c(!0),L=()=>c(!1);return E.addEventListener("timeupdate",A),E.addEventListener("loadedmetadata",C),E.addEventListener("play",I),E.addEventListener("pause",L),()=>{E.removeEventListener("timeupdate",A),E.removeEventListener("loadedmetadata",C),E.removeEventListener("play",I),E.removeEventListener("pause",L)}},[]);const w=()=>{i.current&&(d?i.current.pause():i.current.play())},S=E=>{const A=parseFloat(E.target.value);g(A),i.current&&(i.current.volume=A)},k=E=>{const A=parseFloat(E.target.value);m(A),i.current&&(i.current.currentTime=A)},x=()=>{i.current&&(document.fullscreenElement?document.exitFullscreen():i.current.requestFullscreen())},N=E=>{const A=Math.floor(E/60),C=Math.floor(E%60);return`${A}:${C.toString().padStart(2,"0")}`};return t.jsxs("div",{className:f("relative group",l),children:[t.jsx("video",{ref:i,src:e,poster:r,autoPlay:a,loop:n,muted:o,className:"w-full rounded-lg",onClick:w}),s&&t.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-4 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx("input",{type:"range",min:"0",max:b||0,value:y,onChange:k,className:"w-full mb-2 accent-white"}),t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:w,className:"text-white hover:text-gray-300 transition-colors",children:d?t.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):t.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M8 5v14l11-7z"})})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"})}),t.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:h,onChange:S,className:"w-20 accent-white"})]}),t.jsxs("span",{className:"text-white text-sm",children:[N(y)," / ",N(b)]})]}),t.jsx("button",{onClick:x,className:"text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})]})]})]})},xd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvideoUthumbnail",children:r||"UvideoUthumbnail Component"}),Nd=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"VideoEditor",children:r||"VideoEditor Component"}),Cd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvideoUcall",children:r||"UvideoUcall Component"}),Sd=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"LiveStream",children:r||"LiveStream Component"}),Ed=({src:e,title:r,artist:a,artwork:n,autoPlay:o=!1,loop:s=!1,className:l})=>{const i=p.useRef(null),[d,c]=p.useState(o),[h,g]=p.useState(0),[y,m]=p.useState(0),[b,v]=p.useState(1);p.useEffect(()=>{const E=i.current;if(!E)return;const A=()=>g(E.currentTime),C=()=>m(E.duration),I=()=>c(!0),L=()=>c(!1),P=()=>c(!1);return E.addEventListener("timeupdate",A),E.addEventListener("loadedmetadata",C),E.addEventListener("play",I),E.addEventListener("pause",L),E.addEventListener("ended",P),()=>{E.removeEventListener("timeupdate",A),E.removeEventListener("loadedmetadata",C),E.removeEventListener("play",I),E.removeEventListener("pause",L),E.removeEventListener("ended",P)}},[]);const w=()=>{i.current&&(d?i.current.pause():i.current.play())},S=E=>{const A=parseFloat(E.target.value);g(A),i.current&&(i.current.currentTime=A)},k=E=>{const A=parseFloat(E.target.value);v(A),i.current&&(i.current.volume=A)},x=E=>{const A=Math.floor(E/60),C=Math.floor(E%60);return`${A}:${C.toString().padStart(2,"0")}`},N=y>0?h/y*100:0;return t.jsxs("div",{className:f("bg-white dark:bg-gray-900 rounded-lg p-6 shadow-lg",l),children:[t.jsx("audio",{ref:i,src:e,autoPlay:o,loop:s}),t.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[n&&t.jsx("div",{className:"w-16 h-16 rounded-lg overflow-hidden flex-shrink-0 bg-gray-200 dark:bg-gray-700",children:t.jsx("img",{src:n,alt:r||"Album artwork",className:"w-full h-full object-cover"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[r&&t.jsx("h4",{className:"font-semibold text-gray-900 dark:text-white truncate",children:r}),a&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:a})]})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("input",{type:"range",min:"0",max:y||0,value:h,onChange:S,className:"w-full accent-blue-500"}),t.jsxs("div",{className:"flex justify-between text-xs text-gray-600 dark:text-gray-400 mt-1",children:[t.jsx("span",{children:x(h)}),t.jsx("span",{children:x(y)})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("button",{onClick:w,className:"w-10 h-10 rounded-full bg-blue-500 text-white flex items-center justify-center hover:bg-blue-600 transition-colors",children:d?t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):t.jsx("svg",{className:"w-5 h-5 ml-0.5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M8 5v14l11-7z"})})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4 text-gray-600 dark:text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"})}),t.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:b,onChange:k,className:"w-24 accent-blue-500"})]})]}),t.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[N.toFixed(0),"%"]})]})]})},Td=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UaudioUwaveform",children:r||"UaudioUwaveform Component"}),Ad=({data:e,width:r=200,height:a=40,color:n="#3b82f6",gap:o=2,className:s})=>{if(e.length===0)return null;const l=(r-(e.length-1)*o)/e.length;return t.jsx("svg",{width:r,height:a,className:f("inline-block",s),children:e.map((i,d)=>{const c=Math.max(2,i*a),h=d*(l+o),g=(a-c)/2;return t.jsx("rect",{x:h,y:g,width:l,height:c,fill:n,rx:l/2},d)})})},Id=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvoiceUrecorder",children:r||"UvoiceUrecorder Component"}),Ld=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"PodcastPlayer",children:r||"PodcastPlayer Component"}),Md=({accept:e=["image/*","video/*","audio/*"],maxSize:r=50*1024*1024,maxFiles:a=10,multiple:n=!0,onUpload:o,onRemove:s,className:l})=>{const[i,d]=p.useState([]),[c,h]=p.useState(!1),g=p.useRef(null),y=x=>{x.preventDefault(),h(!0)},m=x=>{x.preventDefault(),h(!1)},b=x=>{x.preventDefault(),h(!1);const N=Array.from(x.dataTransfer.files);w(N)},v=x=>{if(x.target.files){const N=Array.from(x.target.files);w(N)}},w=x=>{const N=x.filter(I=>{const L=e.some(U=>{if(U.endsWith("/*")){const j=U.split("/")[0];return I.type.startsWith(j)}return I.type===U}),P=I.size<=r;return L&&P}),E=a-i.length,A=N.slice(0,E),C=A.map(I=>({id:`${Date.now()}-${Math.random()}`,file:I,preview:I.type.startsWith("image/")?URL.createObjectURL(I):void 0,status:"pending"}));d(I=>[...I,...C]),o&&o(A)},S=x=>{d(N=>N.filter(E=>E.id!==x)),s&&s(x)},k=x=>x<1024?`${x} B`:x<1024*1024?`${(x/1024).toFixed(1)} KB`:`${(x/(1024*1024)).toFixed(1)} MB`;return t.jsxs("div",{className:f("space-y-4",l),children:[t.jsxs("div",{onDragEnter:y,onDragOver:x=>x.preventDefault(),onDragLeave:m,onDrop:b,onClick:()=>g.current?.click(),className:f("border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors",c?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-700 hover:border-gray-400 dark:hover:border-gray-600"),children:[t.jsx("svg",{className:"w-12 h-12 mx-auto mb-4 text-gray-400 dark:text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),t.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-2",children:"Drag and drop files here, or click to browse"}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Max ",a," files, ",k(r)," each"]}),t.jsx("input",{ref:g,type:"file",multiple:n,accept:e.join(","),onChange:v,className:"hidden"})]}),i.length>0&&t.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:i.map(x=>t.jsxs("div",{className:"relative aspect-square rounded-lg overflow-hidden bg-gray-100 dark:bg-gray-800",children:[x.preview?t.jsx("img",{src:x.preview,alt:x.file.name,className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsx("svg",{className:"w-12 h-12 text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm4 18H6V4h7v5h5v11z"})})}),t.jsx("button",{onClick:()=>S(x.id),className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-red-500 text-white flex items-center justify-center hover:bg-red-600 transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),t.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-2",children:[t.jsx("p",{className:"truncate",children:x.file.name}),t.jsx("p",{className:"text-gray-300",children:k(x.file.size)})]})]},x.id))})]})},Pd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmediaUplaylist",children:r||"UmediaUplaylist Component"}),Od=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"PlaylistManager",children:r||"PlaylistManager Component"}),Ud=({value:e,size:r=200,fgColor:a="#000000",bgColor:n="#ffffff",showDownload:o=!1,className:s})=>{const l=p.useRef(null);p.useEffect(()=>{const d=l.current;if(!d)return;const c=d.getContext("2d");if(!c)return;c.fillStyle=n,c.fillRect(0,0,r,r),c.fillStyle=a;const h=8,g=r/h,y=e.split("").reduce((b,v)=>b+v.charCodeAt(0),0);for(let b=0;b<h;b++)for(let v=0;v<h;v++)(y+b*h+v)%3!==0&&c.fillRect(v*g,b*g,g,g);const m=g*3;[[0,0],[r-m,0],[0,r-m]].forEach(([b,v])=>{c.strokeStyle=a,c.lineWidth=g,c.strokeRect(b+g/2,v+g/2,m-g,m-g)})},[e,r,a,n]);const i=()=>{const d=l.current;if(!d)return;const c=d.toDataURL("image/png"),h=document.createElement("a");h.download="qrcode.png",h.href=c,h.click()};return t.jsxs("div",{className:f("inline-flex flex-col items-center gap-3",s),children:[t.jsx("canvas",{ref:l,width:r,height:r,className:"border-2 border-gray-200 dark:border-gray-700 rounded-lg"}),o&&t.jsx("button",{onClick:i,className:f("px-4 py-2 text-sm font-medium","bg-blue-600 dark:bg-blue-500 text-white","rounded-md","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors"),children:"Download QR Code"}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 max-w-[200px] text-center break-all",children:e})]})},Jr=({isOpen:e,onClose:r,title:a,size:n="medium",variant:o="default",overlay:s="default",showCloseButton:l=!0,closeOnOverlayClick:i=!0,closeOnEscape:d=!0,children:c,className:h,"aria-labelledby":g,"aria-describedby":y,closeAriaLabel:m="Close modal"})=>{const b=p.useRef(null),v=p.useRef(null);if(p.useEffect(()=>{if(!e||!d)return;const x=N=>{N.key==="Escape"&&r()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,d,r]),p.useEffect(()=>{if(e)return v.current=document.activeElement,b.current&&b.current.focus(),document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset",v.current&&v.current.focus()}},[e]),!e)return null;const w=()=>{const x=z.overlays.modal.content(),N=z.overlays.modal[n]();return f(x,N)},S=x=>{i&&x.target===x.currentTarget&&r()},k=t.jsxs(t.Fragment,{children:[t.jsx("div",{className:z.overlays.modal.backdrop(),onClick:S}),t.jsx("div",{className:z.overlays.modal.container(),role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":y,children:t.jsxs("div",{ref:b,"data-testid":"modal-content",className:f(w(),h),tabIndex:-1,onClick:x=>x.stopPropagation(),children:[a&&t.jsxs("div",{className:z.overlays.modal.header(),children:[t.jsx("h2",{id:g,className:z.overlays.modal.title(),children:a}),l&&t.jsx("button",{onClick:r,className:z.overlays.modal.closeButton(),"aria-label":m,children:t.jsx(M.XMarkIcon,{className:z.icon.variant.muted.md()})})]}),c]})})]});return wr.createPortal(k,document.body)},Dd=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-header",className:f(z.overlays.modal.header(),a),children:e}),Rr=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-body",className:f(z.overlays.modal.body(),a),children:e}),et=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-footer",className:f(z.overlays.modal.footer(),a),children:e}),jd=({isOpen:e,onClose:r,children:a,side:n="right",size:o="md",showCloseButton:s=!0,title:l,footer:i,className:d})=>{if(p.useEffect(()=>{const y=m=>{m.key==="Escape"&&e&&r()};if(e)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,r]),!e)return null;const c={left:{sm:"w-64",md:"w-80",lg:"w-96",full:"w-full"},right:{sm:"w-64",md:"w-80",lg:"w-96",full:"w-full"},top:{sm:"h-64",md:"h-80",lg:"h-96",full:"h-full"},bottom:{sm:"h-64",md:"h-80",lg:"h-96",full:"h-full"}},h={left:"left-0 top-0 h-full",right:"right-0 top-0 h-full",top:"top-0 left-0 w-full",bottom:"bottom-0 left-0 w-full"},g={left:e?"translate-x-0":"-translate-x-full",right:e?"translate-x-0":"translate-x-full",top:e?"translate-y-0":"-translate-y-full",bottom:e?"translate-y-0":"translate-y-full"};return t.jsxs(me,{children:[t.jsx(ar,{isOpen:e,onClose:r,opacity:"medium"}),t.jsxs("div",{className:f("fixed z-50","bg-white dark:bg-gray-900","shadow-xl","transition-transform duration-300 ease-in-out",h[n],c[n][o],g[n],d),children:[(l||s)&&t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[l&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:l}),s&&t.jsx("button",{onClick:r,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors","aria-label":"Close drawer",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:a}),i&&t.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:i})]})]})},_d=({children:e,active:r=!0,initialFocus:a,returnFocus:n=!0,className:o})=>{const s=p.useRef(null),l=p.useRef(null);return p.useEffect(()=>{if(!r)return;n&&(l.current=document.activeElement);const i=()=>{if(!s.current)return[];const g=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(s.current.querySelectorAll(g))},d=()=>{if(a){const y=s.current?.querySelector(a);if(y){y.focus();return}}const g=i();g.length>0&&g[0].focus()},c=g=>{if(g.key!=="Tab")return;const y=i();if(y.length===0){g.preventDefault();return}const m=y[0],b=y[y.length-1];g.shiftKey?document.activeElement===m&&(g.preventDefault(),b.focus()):document.activeElement===b&&(g.preventDefault(),m.focus())},h=setTimeout(d,0);return document.addEventListener("keydown",c),()=>{clearTimeout(h),document.removeEventListener("keydown",c),n&&l.current&&l.current.focus()}},[r,a,n]),r?t.jsx("div",{ref:s,className:f(o),children:e}):t.jsx(t.Fragment,{children:e})},zd=({children:e,onLoadMore:r,loading:a=!1,hasMore:n=!0,threshold:o=100,loader:s,endMessage:l,height:i,scrollDirection:d="vertical",reverse:c=!1,className:h})=>{const g=p.useRef(null),[y,m]=p.useState(!1);p.useEffect(()=>{const S=g.current;if(!S||a||!n)return;const k=()=>{const{scrollTop:x,scrollHeight:N,clientHeight:E,scrollLeft:A,scrollWidth:C,clientWidth:I}=S;d==="vertical"&&m(x>300);let L;d==="vertical"?c?L=x:L=N-x-E:c?L=A:L=C-A-I,L<o&&r()};return S.addEventListener("scroll",k),()=>S.removeEventListener("scroll",k)},[a,n,o,r,d,c]);const b=()=>{g.current?.scrollTo({top:0,behavior:"smooth"})},v=t.jsxs("div",{className:"flex justify-center items-center py-4",children:[t.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 dark:border-blue-400 border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"Loading..."})]}),w=t.jsx("div",{className:"flex justify-center items-center py-4",children:t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"No more items to load"})});return t.jsxs("div",{className:f("relative",h),children:[t.jsxs("div",{ref:g,className:f(d==="vertical"?"overflow-y-auto":"overflow-x-auto","overflow-auto"),style:{height:d==="vertical"?i:void 0,width:d==="horizontal"?"100%":void 0,display:d==="horizontal"?"flex":void 0,flexDirection:c&&d==="vertical"?"column-reverse":void 0},children:[c&&a&&(s||v),c&&!a&&!n&&l,t.jsx("div",{className:f(d==="horizontal"&&"flex",d==="horizontal"&&c&&"flex-row-reverse"),children:e}),!c&&a&&(s||v),!c&&!a&&!n&&(l||w)]}),d==="vertical"&&!c&&y&&t.jsx("button",{onClick:b,className:f("absolute bottom-4 right-4","p-3 rounded-full","bg-blue-600 dark:bg-blue-500","text-white","shadow-lg","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"),"aria-label":"Scroll to top",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})})})]})},Bd=({trigger:e,children:r,placement:a="bottom",isOpen:n,onOpenChange:o,trigger_action:s="click",showArrow:l=!0,className:i})=>{const[d,c]=p.useState(!1),h=n!==void 0?n:d,g=p.useCallback(E=>{n===void 0&&c(E),o?.(E)},[n,o]),y=p.useRef(null),m=p.useRef(null),[b,v]=p.useState({top:0,left:0});p.useEffect(()=>{if(!h||!y.current)return;const E=()=>{const A=y.current.getBoundingClientRect(),C=8;let I=0,L=0;switch(a){case"top":I=A.top-C,L=A.left+A.width/2;break;case"top-start":I=A.top-C,L=A.left;break;case"top-end":I=A.top-C,L=A.right;break;case"bottom":I=A.bottom+C,L=A.left+A.width/2;break;case"bottom-start":I=A.bottom+C,L=A.left;break;case"bottom-end":I=A.bottom+C,L=A.right;break;case"left":I=A.top+A.height/2,L=A.left-C;break;case"right":I=A.top+A.height/2,L=A.right+C;break}v({top:I,left:L})};return E(),window.addEventListener("scroll",E),window.addEventListener("resize",E),()=>{window.removeEventListener("scroll",E),window.removeEventListener("resize",E)}},[h,a]),p.useEffect(()=>{if(!h)return;const E=A=>{y.current&&!y.current.contains(A.target)&&m.current&&!m.current.contains(A.target)&&g(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[h,g]),p.useEffect(()=>{if(!h)return;const E=A=>{A.key==="Escape"&&g(!1)};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[h,g]);const w=()=>{s==="click"&&g(!h)},S=()=>{s==="hover"&&g(!0)},k=()=>{s==="hover"&&g(!1)},x={top:"origin-bottom","top-start":"origin-bottom-left","top-end":"origin-bottom-right",bottom:"origin-top","bottom-start":"origin-top-left","bottom-end":"origin-top-right",left:"origin-right",right:"origin-left"},N={top:"-translate-x-1/2 -translate-y-full","top-start":"-translate-y-full","top-end":"-translate-x-full -translate-y-full",bottom:"-translate-x-1/2","bottom-start":"","bottom-end":"-translate-x-full",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"};return t.jsxs("div",{className:f("relative inline-block",i),children:[t.jsx("div",{ref:y,onClick:w,onMouseEnter:S,onMouseLeave:k,className:"inline-block",children:e}),h&&t.jsxs("div",{ref:m,className:f("fixed z-50","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","rounded-lg shadow-lg","transition-all duration-200","animate-in fade-in zoom-in-95",x[a],N[a]),style:{position:"fixed",top:b.top+"px",left:b.left+"px"},onMouseEnter:s==="hover"?()=>g(!0):void 0,onMouseLeave:s==="hover"?()=>g(!1):void 0,children:[r,l&&t.jsx("div",{className:f("arrow absolute w-2 h-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 transform rotate-45",a.startsWith("top")&&"bottom-[-5px] border-t-0 border-l-0",a.startsWith("bottom")&&"top-[-5px] border-b-0 border-r-0",a==="left"&&"right-[-5px] border-l-0 border-b-0",a==="right"&&"left-[-5px] border-r-0 border-t-0",(a==="top"||a==="bottom")&&"left-1/2 -translate-x-1/2",(a==="left"||a==="right")&&"top-1/2 -translate-y-1/2")})]})]})},Fd=({sections:e,activeId:r,onActiveChange:a,offset:n=80,container:o,smoothScroll:s=!0,showSubsections:l=!0,className:i})=>{const[d,c]=p.useState(""),h=p.useRef(null),g=r!==void 0?r:d;p.useEffect(()=>{const b=o?document.querySelector(o):window;if(!b)return;const v=k=>k.flatMap(x=>[x.id,...x.subsections?v(x.subsections):[]]),S=v(e).map(k=>document.getElementById(k)).filter(Boolean);if(S.length!==0)return h.current=new IntersectionObserver(k=>{k.forEach(x=>{if(x.isIntersecting){const N=x.target.id;r!==void 0&&a?a(N):c(N)}})},{root:o?b:null,rootMargin:`-${n}px 0px -50% 0px`,threshold:0}),S.forEach(k=>{h.current?.observe(k)}),()=>{h.current?.disconnect()}},[e,o,n,r,a]);const y=b=>{const v=document.getElementById(b);if(!v)return;const w=o?document.querySelector(o):window;if(!w)return;const k=v.offsetTop-n;s?w===window?window.scrollTo({top:k,behavior:"smooth"}):w.scrollTo({top:k,behavior:"smooth"}):w===window?window.scrollTo(0,k):w.scrollTop=k},m=(b,v=0)=>{const w=g===b.id,S=b.subsections?.some(k=>g===k.id)||!1;return t.jsxs("div",{children:[t.jsx("button",{onClick:()=>y(b.id),className:f("w-full text-left px-3 py-1.5 text-sm rounded-md transition-colors",v===0?"font-medium":"pl-6 text-sm",w?"text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/30":S?"text-gray-700 dark:text-gray-300":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800"),style:{paddingLeft:`${v*.75+.75}rem`},children:b.label}),l&&b.subsections&&b.subsections.length>0&&t.jsx("div",{className:"ml-2 border-l-2 border-gray-200 dark:border-gray-700",children:b.subsections.map(k=>m(k,v+1))})]},b.id)};return t.jsx("nav",{className:f("space-y-1",i),children:e.map(b=>m(b,0))})},Wd=({isOpen:e,onClose:r,children:a,title:n,description:o,footer:s,side:l="bottom",size:i="md",showHandle:d=!0,showCloseButton:c=!0,className:h})=>{if(p.useEffect(()=>{if(!e)return;const b=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,r]),!e)return null;const g={bottom:{sm:"h-1/3",md:"h-1/2",lg:"h-2/3",full:"h-full"},top:{sm:"h-1/3",md:"h-1/2",lg:"h-2/3",full:"h-full"},left:{sm:"w-80",md:"w-96",lg:"w-[32rem]",full:"w-full"},right:{sm:"w-80",md:"w-96",lg:"w-[32rem]",full:"w-full"}},y={bottom:"bottom-0 left-0 right-0 rounded-t-2xl",top:"top-0 left-0 right-0 rounded-b-2xl",left:"left-0 top-0 bottom-0 rounded-r-2xl",right:"right-0 top-0 bottom-0 rounded-l-2xl"},m={bottom:"animate-in slide-in-from-bottom duration-300",top:"animate-in slide-in-from-top duration-300",left:"animate-in slide-in-from-left duration-300",right:"animate-in slide-in-from-right duration-300"};return t.jsxs(me,{children:[t.jsx(ar,{isOpen:e,onClose:r,opacity:"dark"}),t.jsxs("div",{className:f("fixed z-50","bg-white dark:bg-gray-900","shadow-xl","flex flex-col",y[l],g[l][i],m[l],h),children:[d&&(l==="bottom"||l==="top")&&t.jsx("div",{className:f("flex items-center justify-center",l==="bottom"?"pt-3 pb-2":"pb-3 pt-2"),children:t.jsx("div",{className:"w-12 h-1.5 bg-gray-300 dark:bg-gray-700 rounded-full"})}),(n||o||c)&&t.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex-1",children:[n&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:n}),o&&t.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:o})]}),c&&t.jsx("button",{onClick:r,className:"ml-4 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors","aria-label":"Close sheet",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:a}),s&&t.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:s})]})]})},$d=({isOpen:e,onClose:r,onSubmit:a,title:n,description:o,placeholder:s="",initialValue:l="",cancelText:i="Cancel",confirmText:d="Confirm",isLoading:c=!1,loadingText:h="Processing...",maxLength:g,required:y=!0,validate:m})=>{const[b,v]=p.useState(l),[w,S]=p.useState(null);p.useEffect(()=>{e&&(v(l),S(null))},[e,l]);const k=async E=>{if(E.preventDefault(),S(null),y&&!b.trim()){S("This field is required");return}if(m){const A=m(b);if(A){S(A);return}}try{await a(b.trim())}catch(A){S(A instanceof Error?A.message:"An error occurred")}},x=()=>{v(l),S(null),r()},N=y?b.trim().length>0:!0;return t.jsx(Jr,{isOpen:e,onClose:x,size:"small","aria-labelledby":"text-input-modal-title","aria-describedby":"text-input-modal-description",closeOnEscape:!c,closeOnOverlayClick:!c,children:t.jsxs("form",{onSubmit:k,children:[t.jsxs(Rr,{variant:"padded",children:[t.jsx("h3",{id:"text-input-modal-title",className:O.heading.h4(),children:n}),t.jsx("p",{id:"text-input-modal-description",className:`${O.body.md()} mt-2 mb-4`,children:o}),t.jsx(nr,{type:"text",value:b,onChange:E=>v(E.target.value),placeholder:s,maxLength:g,disabled:c,autoFocus:!0,"aria-invalid":!!w,"aria-describedby":w?"text-input-error":void 0}),w&&t.jsx("p",{id:"text-input-error",className:`${O.body.sm()} text-red-600 dark:text-red-400 mt-2`,role:"alert",children:w})]}),t.jsxs(et,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:x,disabled:c,children:i}),t.jsx(ne,{type:"submit",variant:"default",disabled:!N||c,children:c?h:d})]})]})})},$a=({content:e,children:r,placement:a="top",delayShow:n=0,delayHide:o=0,className:s,disabled:l=!1,showArrow:i=!0,variant:d="default",trigger:c="hover",isOpen:h,onVisibilityChange:g})=>{const[y,m]=p.useState(!1),b=p.useRef(void 0),v=p.useRef(void 0),w=p.useRef(null),S=p.useRef(null),k=h!==void 0,x=k?h:y,N=p.useCallback(()=>{l||k||(v.current&&(clearTimeout(v.current),v.current=void 0),n>0?b.current=setTimeout(()=>{m(!0),g?.(!0)},n):(m(!0),g?.(!0)))},[l,k,n,g]),E=p.useCallback(()=>{k||(b.current&&(clearTimeout(b.current),b.current=void 0),o>0?v.current=setTimeout(()=>{m(!1),g?.(!1)},o):(m(!1),g?.(!1)))},[k,o,g]);p.useEffect(()=>()=>{b.current&&clearTimeout(b.current),v.current&&clearTimeout(v.current)},[]),p.useEffect(()=>{if(c!=="click"||!x)return;const F=$=>{w.current&&!w.current.contains($.target)&&S.current&&!S.current.contains($.target)&&E()};return document.addEventListener("mousedown",F),()=>{document.removeEventListener("mousedown",F)}},[c,x,E]);const A=()=>{c==="hover"&&N()},C=()=>{c==="hover"&&E()},I=()=>{c==="hover"&&N()},L=()=>{c==="hover"&&E()},P=()=>{c==="click"&&!k&&(x?(m(!1),g?.(!1)):(m(!0),g?.(!0)))},U={top:"bottom-full left-1/2 -translate-x-1/2 -translate-y-2",bottom:"top-full left-1/2 -translate-x-1/2 translate-y-2",left:"right-full top-1/2 -translate-x-2 -translate-y-1/2",right:"left-full top-1/2 translate-x-2 -translate-y-1/2"},j={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"},B={default:"bg-gray-900 dark:bg-gray-700 text-white",info:"bg-blue-600 dark:bg-blue-500 text-white",success:"bg-green-600 dark:bg-green-500 text-white",warning:"bg-yellow-600 dark:bg-yellow-500 text-white",error:"bg-red-600 dark:bg-red-500 text-white"},D={default:{top:"border-t-gray-900 dark:border-t-gray-700",bottom:"border-b-gray-900 dark:border-b-gray-700",left:"border-l-gray-900 dark:border-l-gray-700",right:"border-r-gray-900 dark:border-r-gray-700"},info:{top:"border-t-blue-600 dark:border-t-blue-500",bottom:"border-b-blue-600 dark:border-b-blue-500",left:"border-l-blue-600 dark:border-l-blue-500",right:"border-r-blue-600 dark:border-r-blue-500"},success:{top:"border-t-green-600 dark:border-t-green-500",bottom:"border-b-green-600 dark:border-b-green-500",left:"border-l-green-600 dark:border-l-green-500",right:"border-r-green-600 dark:border-r-green-500"},warning:{top:"border-t-yellow-600 dark:border-t-yellow-500",bottom:"border-b-yellow-600 dark:border-b-yellow-500",left:"border-l-yellow-600 dark:border-l-yellow-500",right:"border-r-yellow-600 dark:border-r-yellow-500"},error:{top:"border-t-red-600 dark:border-t-red-500",bottom:"border-b-red-600 dark:border-b-red-500",left:"border-l-red-600 dark:border-l-red-500",right:"border-r-red-600 dark:border-r-red-500"}};return t.jsxs("div",{ref:S,className:"relative inline-block",onMouseEnter:A,onMouseLeave:C,onFocus:I,onBlur:L,onClick:P,children:[r,x&&!l&&t.jsxs("div",{ref:w,className:f("absolute z-50 px-2 py-1 text-xs font-medium rounded shadow-lg whitespace-nowrap pointer-events-none",U[a],B[d],s),role:"tooltip",children:[e,i&&t.jsx("div",{className:f("absolute w-0 h-0 border-4 arrow",j[a],D[d][a])})]})]})},Vd={default:M.InformationCircleIcon,warning:M.ExclamationTriangleIcon,danger:M.XCircleIcon,success:M.CheckCircleIcon,info:M.InformationCircleIcon},Hd={default:()=>z.icon.variant.default.lg(),warning:()=>z.icon.variant.warning.lg(),danger:()=>z.icon.variant.error.lg(),success:()=>z.icon.variant.success.lg(),info:()=>z.icon.variant.default.lg()},qd={default:"default",warning:"default",danger:"destructive",success:"default",info:"default"},Gd=({isOpen:e,onClose:r,onConfirm:a,title:n,message:o,confirmText:s="Confirm",cancelText:l="Cancel",loadingText:i="Processing...",variant:d="default",isLoading:c=!1})=>{const h=Vd[d],g=Hd[d],y=qd[d];return t.jsxs(Jr,{isOpen:e,onClose:r,size:"small",variant:"web3confirmation","aria-labelledby":"confirmation-dialog-title","aria-describedby":"confirmation-dialog-description",children:[t.jsxs(Rr,{variant:"padded",children:[t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsx(h,{className:g()}),t.jsx("h3",{id:"confirmation-dialog-title",className:O.heading.h4(),children:n})]}),t.jsx("p",{id:"confirmation-dialog-description",className:O.body.md(),children:o})]}),t.jsxs(et,{children:[t.jsx(ne,{variant:"outline",onClick:r,disabled:c,children:l}),t.jsx(ne,{variant:y,onClick:a,disabled:c,children:c?i:s})]})]})},Yd=({trigger:e,children:r,placement:a="bottom",openDelay:n=200,closeDelay:o=300,className:s})=>{const[l,i]=p.useState(!1),[d,c]=p.useState({top:0,left:0}),h=p.useRef(null),g=p.useRef(null),y=p.useRef(void 0),m=p.useRef(void 0);p.useEffect(()=>{if(!l||!h.current)return;const k=()=>{const x=h.current.getBoundingClientRect(),N=8;let E=0,A=0;switch(a){case"top":E=x.top-N,A=x.left+x.width/2;break;case"bottom":E=x.bottom+N,A=x.left+x.width/2;break;case"left":E=x.top+x.height/2,A=x.left-N;break;case"right":E=x.top+x.height/2,A=x.right+N;break}c({top:E,left:A})};return k(),window.addEventListener("scroll",k),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k),window.removeEventListener("resize",k)}},[l,a]);const b=()=>{m.current&&clearTimeout(m.current),y.current=setTimeout(()=>{i(!0)},n)},v=()=>{y.current&&clearTimeout(y.current),m.current=setTimeout(()=>{i(!1)},o)},w={top:"origin-bottom",bottom:"origin-top",left:"origin-right",right:"origin-left"},S={top:"-translate-x-1/2 -translate-y-full",bottom:"-translate-x-1/2",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"};return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:h,onMouseEnter:b,onMouseLeave:v,className:"inline-block",children:e}),l&&t.jsx(me,{children:t.jsx("div",{ref:g,className:f("fixed z-50","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","rounded-lg shadow-lg","transition-all duration-200","animate-in fade-in zoom-in-95",w[a],S[a],s),style:{top:d.top+"px",left:d.left+"px"},onMouseEnter:()=>{m.current&&clearTimeout(m.current)},onMouseLeave:v,children:r})})]})},Kd=({children:e,onDrop:r,onDragOver:a,accept:n,showIndicator:o=!0,indicator:s,disabled:l=!1,className:i})=>{const[d,c]=p.useState(!1),[h,g]=p.useState(0),y=S=>{S.preventDefault(),S.stopPropagation(),!l&&(g(k=>k+1),S.dataTransfer.items&&S.dataTransfer.items.length>0&&c(!0))},m=S=>{S.preventDefault(),S.stopPropagation(),!l&&g(k=>{const x=k-1;return x===0&&c(!1),x})},b=S=>{S.preventDefault(),S.stopPropagation(),!l&&a&&a(S)},v=S=>{if(S.preventDefault(),S.stopPropagation(),l)return;if(c(!1),g(0),S.dataTransfer.files&&S.dataTransfer.files.length>0){const x=Array.from(S.dataTransfer.files);let N=x;n&&n.length>0&&(N=x.filter(E=>n.some(A=>{if(A.endsWith("/*")){const C=A.split("/")[0];return E.type.startsWith(C)}return E.type===A}))),r(N);return}const k=S.dataTransfer.getData("text/plain");if(k)try{const x=JSON.parse(k);r(x)}catch{r(k)}},w=t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-blue-50 dark:bg-blue-900/30 border-2 border-dashed border-blue-500 dark:border-blue-400 rounded-lg z-10",children:[t.jsx("svg",{className:"w-12 h-12 text-blue-600 dark:text-blue-400 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),t.jsx("p",{className:"text-blue-700 dark:text-blue-300 font-medium",children:"Drop here"})]});return t.jsxs("div",{onDragEnter:y,onDragLeave:m,onDragOver:b,onDrop:v,className:f("relative",l&&"opacity-50 cursor-not-allowed",i),children:[e,o&&d&&!l&&(s||w)]})},Zd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdragUdropUlist",children:r||"UdragUdropUlist Component"}),Xd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsortableUgrid",children:r||"UsortableUgrid Component"}),Qd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UnestedUdrag",children:r||"UnestedUdrag Component"}),Jd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UgestureUdetector",children:r||"UgestureUdetector Component"}),Rd=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UswipeUactions",children:r||"UswipeUactions Component"}),e0=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UpinchUzoom",children:r||"UpinchUzoom Component"}),r0=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdoubleUtap",children:r||"UdoubleUtap Component"}),t0=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UlongUpress",children:r||"UlongUpress Component"}),a0=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UradialUmenu",children:r||"UradialUmenu Component"}),n0=({children:e,onRefresh:r,disabled:a=!1,refreshingText:n="Refreshing...",pullDownText:o="Pull down to refresh",releaseText:s="Release to refresh",threshold:l=80,maxPullDistance:i=120,className:d=""})=>{const[c,h]=p.useState(0),[g,y]=p.useState(!1),[m,b]=p.useState(!1),v=p.useRef(0),w=p.useRef(null);p.useEffect(()=>{const E=w.current;if(!E)return;const A=L=>{if(a||g)return;E.scrollTop<=0&&(v.current=L.touches[0].clientY,b(!0))},C=L=>{if(!m)return;const U=L.touches[0].clientY-v.current;if(U>0&&E.scrollTop<=0){const j=Math.min(U/i,1),B=Math.min(U*(1-j*.5),i);h(B),U>10&&L.preventDefault()}},I=async()=>{if(m)if(b(!1),c>=l&&!g){y(!0);try{await r()}catch{}finally{y(!1),h(0)}}else h(0)};return E.addEventListener("touchstart",A,{passive:!0}),E.addEventListener("touchmove",C,{passive:!1}),E.addEventListener("touchend",I),()=>{E.removeEventListener("touchstart",A),E.removeEventListener("touchmove",C),E.removeEventListener("touchend",I)}},[a,g,m,c,l,i,r]);const S=Math.min(c/l,1),k=m||g,x=m?c:g?l:0,N=()=>g?n:c>=l?s:o;return t.jsxs("div",{ref:w,className:`relative ${d}`,style:{height:"100%",overflowY:"auto",WebkitOverflowScrolling:"touch"},children:[t.jsx("div",{className:"sticky top-0 left-0 right-0 flex items-center justify-center bg-gradient-to-b from-blue-50/90 to-transparent dark:from-blue-900/20 dark:to-transparent backdrop-blur-sm z-10 transition-all duration-300 ease-out",style:{height:`${x}px`,marginTop:m?0:`-${x}px`,opacity:k?1:0,pointerEvents:"none"},children:t.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[t.jsx(M.ArrowPathIcon,{className:`w-6 h-6 text-blue-600 dark:text-blue-400 transition-transform duration-200 ${g?"animate-spin":""}`,style:{transform:`rotate(${S*360}deg)`}}),c>20&&t.jsx("span",{className:"text-xs font-medium text-blue-600 dark:text-blue-400",children:N()})]})}),t.jsx("div",{style:{paddingTop:m?`${c}px`:0,transition:m?"none":"padding-top 200ms ease-out"},children:e})]})},ce={twitter:(e,r,a)=>{const n=a.length>0?`&hashtags=${a.join(",")}`:"";return`https://twitter.com/intent/tweet?url=${encodeURIComponent(e)}&text=${encodeURIComponent(r)}${n}`},facebook:e=>`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(e)}`,linkedin:(e,r,a)=>`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(e)}`,reddit:(e,r)=>`https://reddit.com/submit?url=${encodeURIComponent(e)}&title=${encodeURIComponent(r)}`,telegram:(e,r)=>`https://t.me/share/url?url=${encodeURIComponent(e)}&text=${encodeURIComponent(r)}`,whatsapp:(e,r)=>`https://wa.me/?text=${encodeURIComponent(r+" "+e)}`,email:(e,r,a)=>`mailto:?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(a+`
56
56
 
57
57
  `+e)}`,discord:(e,r)=>`https://discord.com/channels/@me?message=${encodeURIComponent(r+`
58
- `+e)}`,messages:(e,r)=>`sms:?&body=${encodeURIComponent(r+" "+e)}`},n0=({shareConfig:e})=>{const[r,a]=p.useState(!1),[n,o]=p.useState(""),[s,l]=p.useState(!1),[i,d]=p.useState(!1),[c,h]=p.useState(!1);p.useEffect(()=>{const k=e.onBeforeShare;k&&!n&&(async()=>{l(!0);try{const N=typeof window<"u"?window.location.href:"",E=await k(N);o(E)}catch{const N=typeof window<"u"?window.location.href:"";o(N)}finally{l(!1)}})()},[e,n]);const g=n||(typeof window<"u"?window.location.href:""),y=typeof navigator<"u"&&navigator.share!==void 0,m=async()=>{if(!(!y||c)){h(!0);try{await navigator.share({title:e.title,text:e.description,url:g}),a(!1)}catch(k){k instanceof Error&&k.name!=="AbortError"&&(console.error("Share failed:",k),k.name!=="InvalidStateError"&&a(!0))}finally{h(!1)}}},b=async()=>{try{await navigator.clipboard.writeText(g),d(!0),setTimeout(()=>{d(!1),a(!1)},1500)}catch{}},v=()=>{a(!r)},w=k=>{window.open(k,"_blank","noopener,noreferrer,width=600,height=400"),a(!1)},S=[{name:"Twitter",url:ce.twitter(g,e.title,e.hashtags),color:"text-blue-400",svg:t.jsx("path",{d:"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84"})},{name:"Facebook",url:ce.facebook(g),color:"text-blue-600",svg:t.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})},{name:"LinkedIn",url:ce.linkedin(g,e.title,e.description),color:"text-blue-700",svg:t.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})},{name:"Reddit",url:ce.reddit(g,e.title),color:"text-orange-600",svg:t.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})},{name:"Telegram",url:ce.telegram(g,e.title),color:"text-blue-500",svg:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})},{name:"WhatsApp",url:ce.whatsapp(g,e.title),color:"text-green-600",svg:t.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"})},{name:"Discord",url:ce.discord(g,e.title),color:"text-indigo-500",svg:t.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})},{name:"Messages",url:ce.messages(g,e.title),color:"text-green-500",svg:t.jsx("path",{d:"M.05 3.555A3 3 0 013 0h18a3 3 0 012.95 3.555L22 11v8a3 3 0 01-3 3H5a3 3 0 01-3-3v-8l-1.95-7.445zM2 10.938V19a1 1 0 001 1h18a1 1 0 001-1v-8.062L20 19H4l-2-8.062zM3.38 2L5 8h14l1.62-6H3.38z"})},{name:"Email",url:ce.email(g,e.title,e.description),color:"text-gray-600",svg:t.jsx("path",{d:"M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"})}];return t.jsxs("div",{className:"relative",children:[t.jsx("button",{onClick:v,disabled:s||c,className:"flex items-center justify-center w-8 h-8 bg-blue-50 hover:bg-blue-100 dark:bg-blue-900/30 dark:hover:bg-blue-900/50 text-blue-600 dark:text-blue-400 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Share this page",children:s||c?t.jsx("div",{className:"w-4 h-4 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"}):t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.367 2.684 3 3 0 00-5.367-2.684z"})})}),r&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"fixed inset-0 z-[999998]",onClick:()=>a(!1)}),t.jsxs("div",{className:"absolute right-0 top-10 z-[999999] w-40 bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 py-1",children:[S.map(k=>t.jsxs("button",{onClick:()=>w(k.url),className:"w-full flex items-center px-3 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors",children:[t.jsx("svg",{className:`w-4 h-4 mr-2 ${k.color}`,fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:k.svg}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:k.name})]},k.name)),t.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),y&&t.jsxs("button",{onClick:()=>{a(!1),m()},disabled:c,className:"w-full flex items-center px-3 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50",children:[t.jsx("svg",{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.367 2.684 3 3 0 00-5.367-2.684z"})}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"More..."})]}),t.jsxs("button",{onClick:b,className:"w-full flex items-center px-3 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors",children:[t.jsx("svg",{className:"w-4 h-4 mr-2 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:i?"Copied!":"Copy Link"})]})]})]})]})},Va=({items:e,shareConfig:r,className:a,showHome:n})=>t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("nav",{"aria-label":"Breadcrumb",children:t.jsx("ol",{className:"flex items-center text-sm space-x-2",children:e.map((o,s)=>t.jsxs(p.Fragment,{children:[t.jsx("li",{children:o.current?t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:o.label}):t.jsx(X.Link,{to:o.href||"#",className:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 transition-colors",children:o.label})}),s<e.length-1&&t.jsx("li",{children:t.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"/"})})]},s))})}),r&&t.jsx(n0,{shareConfig:r})]}),Ha={standard:"max-w-7xl mx-auto px-4",wide:"max-w-[1920px] mx-auto px-4",full:"w-full px-4"},qa={standard:"max-w-7xl mx-auto",wide:"max-w-[1920px] mx-auto",full:"w-full"},Ga="px-4",rt=p.createContext(void 0),o0=({mode:e="standard",children:r})=>{const a={mode:e,containerClass:Ha[e],maxWidthClass:qa[e],paddingClass:Ga};return t.jsx(rt.Provider,{value:a,children:r})},he=()=>{const e=p.useContext(rt);return e||{mode:"standard",containerClass:Ha.standard,maxWidthClass:qa.standard,paddingClass:Ga}},s0=({items:e,shareConfig:r})=>{const{containerClass:a}=he();return t.jsx("div",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 relative z-50",children:t.jsx("div",{className:`${a} py-3 relative`,children:t.jsx(Va,{items:e,shareConfig:r})})})},Ya=e=>{const[r,a]=p.useState(""),[n,o]=p.useState(!0),[s,l]=p.useState(null);return p.useEffect(()=>{e&&(async()=>{try{o(!0),l(null);const d=await fetch(`/code/${e}`);if(!d.ok)throw new Error(`Failed to load code file: ${e}`);const c=await d.text();a(c)}catch(d){l(d instanceof Error?d.message:"Unknown error"),a("// Error loading code file")}finally{o(!1)}})()},[e]),{code:r,loading:n,error:s}},l0=({filename:e,code:r,language:a,title:n,className:o="",showCopy:s=!0,showHeader:l=!0})=>{const{t:i}=tr.useTranslation("codeBlock"),{code:d,loading:c,error:h}=Ya(e||""),[g,y]=p.useState(!1),m=r||d,v=a||(e?(S=>{switch(S.split(".").pop()?.toLowerCase()){case"sol":return"solidity";case"js":case"mjs":return"javascript";case"ts":return"typescript";case"sh":return"bash";case"graphql":return"graphql";case"json":return"json";case"css":return"css";case"html":return"html";case"jsx":return"jsx";case"tsx":return"tsx";case"py":return"python";case"java":return"java";case"cpp":case"c":return"cpp";case"go":return"go";case"rs":return"rust";case"php":return"php";case"rb":return"ruby";default:return"text"}})(e):"text"),w=async()=>{if(m)try{await navigator.clipboard.writeText(m),y(!0),setTimeout(()=>y(!1),2e3)}catch{}};return e&&c?t.jsx("div",{className:`bg-gray-900 text-green-400 rounded-lg p-4 font-mono text-sm ${o}`,children:t.jsx("div",{className:"animate-pulse text-gray-500",children:i("loadingCode","Loading code...")})}):e&&h?t.jsxs("div",{className:`bg-gray-900 text-red-400 rounded-lg p-4 font-mono text-sm ${o}`,children:[i("error","Error"),": ",h]}):m?t.jsxs("div",{className:`bg-gray-900 rounded-lg border border-green-500/20 shadow-lg shadow-green-500/10 ${o}`,children:[l&&t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-green-500/20 bg-gray-800/50",children:[t.jsx("span",{className:"text-sm text-green-400 font-mono",children:n||e||`${v} code`}),s&&t.jsx("button",{onClick:w,className:"p-2 text-gray-400 hover:text-green-400 hover:bg-gray-800 rounded-lg transition-all duration-200 group",title:i("copyCode","Copy code"),children:g?t.jsx(M.CheckIcon,{className:"h-4 w-4 text-green-400"}):t.jsx(M.ClipboardDocumentIcon,{className:"h-4 w-4 group-hover:scale-110 transition-transform"})})]}),t.jsx("div",{className:"p-4 overflow-x-auto text-left",children:t.jsx("pre",{className:`text-sm language-${v}`,children:t.jsx("code",{className:"text-gray-100",children:m})})})]}):t.jsx("div",{className:`bg-gray-900 text-gray-400 rounded-lg p-4 font-mono text-sm ${o}`,children:i("noCode","No code to display")})},i0=({subsections:e,isExpanded:r,selectedSubsection:a,parentSectionId:n,onSubsectionSelect:o})=>{const s=p.useRef(null),[l,i]=p.useState(void 0);return p.useLayoutEffect(()=>{if(s.current){const d=s.current.scrollHeight;i(r?d+16:0)}},[r,e]),t.jsx("div",{className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:l!==void 0?`${l}px`:"auto"},children:t.jsx("div",{ref:s,className:"ml-6 mt-1 mb-1 space-y-1",children:e.map(d=>t.jsxs("div",{className:"relative group",children:[a===d.id&&t.jsx("div",{className:"absolute top-0.5 bottom-0.5 left-1 right-12 bg-blue-500/20 dark:bg-blue-400/20 rounded-lg pointer-events-none"}),a!==d.id&&t.jsx("div",{className:"absolute top-0.5 bottom-0.5 left-1 right-12 bg-blue-500/0 group-hover:bg-blue-500/10 dark:group-hover:bg-blue-400/10 rounded-lg pointer-events-none transition-colors duration-200"}),t.jsx("button",{onClick:()=>o?.(d.id,n),className:`relative z-10 block w-full text-left pl-4 pr-3 py-2 rounded-md text-sm transition-all duration-200 ${a===d.id?"text-blue-700 dark:text-blue-300":"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"}`,children:d.title})]},d.id))})})},c0=({id:e,title:r,content:a,subsections:n,isSelected:o=!1,selectedSubsection:s=null,onSectionSelect:l,onSubsectionSelect:i,className:d=""})=>{const[c,h]=p.useState(!1),g=()=>{h(!c)},y=()=>{l?.(e)},m=n&&n.length>0;return t.jsxs("div",{className:d,children:[t.jsxs("div",{className:"relative flex items-center group",children:[o&&!s&&t.jsx("div",{className:"absolute top-2 bottom-2 left-2 right-12 bg-blue-500/20 dark:bg-blue-400/20 rounded-lg pointer-events-none"}),!(o&&!s)&&t.jsx("div",{className:"absolute top-2 bottom-2 left-2 right-12 bg-blue-500/0 group-hover:bg-blue-500/10 dark:group-hover:bg-blue-400/10 rounded-lg pointer-events-none transition-colors duration-200"}),t.jsx("button",{onClick:y,className:`relative z-10 flex-1 text-left pl-5 pr-3 py-4 text-base font-medium transition-all duration-200 ${o&&!s?"text-blue-700 dark:text-blue-300":"text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100"}`,children:r}),m&&t.jsx("button",{onClick:g,className:"p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 hover:scale-110 transition-all duration-200","aria-label":c?"Collapse section":"Expand section",children:t.jsx(M.ChevronRightIcon,{className:`h-5 w-5 text-gray-500 transition-transform duration-300 ease-in-out ${c?"rotate-90":"rotate-0"}`})})]}),m&&t.jsx(i0,{subsections:n,isExpanded:c,selectedSubsection:s,parentSectionId:e,onSubsectionSelect:i})]})},d0=({title:e,subtitle:r,buttonText:a,buttonIcon:n="envelope",variant:o="default",badgeText:s="FREE",prominentBadgeText:l="100% Free",onButtonClick:i,className:d=""})=>{const c=()=>n==="envelope"||n==="both"?t.jsx(M.EnvelopeIcon,{className:o==="prominent"?"h-5 w-5 mr-2":"h-4 w-4 mr-1"}):n==="none"?null:t.jsx("svg",{className:o==="prominent"?"h-5 w-5 mr-2":"h-4 w-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"})}),h=()=>n==="arrow"||n==="both"?t.jsx(M.ArrowRightIcon,{className:"h-4 w-4 ml-2"}):null,g=()=>o==="prominent"?"border-b-2 border-green-200 dark:border-green-700":"border-b border-green-200 dark:border-green-700",y=()=>{const w="bg-gradient-to-r from-green-600 to-blue-600 hover:from-green-700 hover:to-blue-700 text-white rounded-lg font-bold transition-all duration-300 transform hover:scale-105 shadow-lg hover:shadow-green-500/25 inline-flex items-center whitespace-nowrap cursor-pointer";return o==="prominent"?`${w} px-8 py-3 text-base`:`${w} px-6 py-2 text-sm`},m=()=>o==="prominent"?"text-green-800 dark:text-green-200 font-semibold text-lg":"text-green-800 dark:text-green-200 font-semibold",b=o==="prominent"?l:s,{containerClass:v}=he();return t.jsx("div",{className:`bg-gradient-to-r from-green-100 to-blue-100 dark:from-green-900/20 dark:to-blue-900/20 ${g()} ${d}`,children:t.jsx("div",{className:`${v} py-4`,children:t.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[t.jsxs("div",{className:`flex items-center ${o==="prominent"?"text-center sm:text-left":""}`,children:[t.jsx("div",{className:"bg-green-500 text-white text-xs font-bold px-3 py-1 rounded-full mr-3 animate-pulse",children:b}),t.jsxs("div",{children:[t.jsx("span",{className:m(),children:e}),r&&t.jsx("span",{className:"text-green-700 dark:text-green-300 text-sm block",children:r})]})]}),t.jsxs("button",{onClick:i,className:y(),children:[c(),a,h()]})]})})})},u0=({children:e,onClick:r,variant:a,size:n,disabled:o,className:s,type:l,trackingLabel:i,actionType:d,componentName:c,onTrack:h,trackingParams:g={},...y})=>{const m=b=>{if(h){const v=i||(typeof e=="string"?e:"")||"Unknown Button",S=a&&["default","primary","secondary","outline","ghost","destructive","link"].includes(a)?a:"default";h({button_text:v,button_type:S,component_name:c,action_type:d,...g})}r&&r(b)};return t.jsx(ne,{...y,variant:a,size:n,disabled:o,className:s,type:l,onClick:m,children:e})},g0=({children:e,onClick:r,to:a,href:n,trackingLabel:o,componentName:s,onTrack:l,trackingParams:i={},LinkComponent:d,linkProps:c={},...h})=>{const g=m=>{if(l){const b=o||(typeof e=="string"?e:"")||"Unknown Link",v=a?typeof a=="string"?a:a.pathname||"":n||"";l({link_text:b,link_url:v,to_page:v,navigation_type:d?"router_link":"anchor_link",component_name:s,...i})}r&&r(m)};if(d&&a!==void 0)return t.jsx(d,{...c,to:a,onClick:g,...h,children:e});const y=a?typeof a=="string"?a:a.pathname||"#":n;return t.jsx("a",{...h,href:y,onClick:g,children:e})},Ka={en:{name:"English",flag:"🇺🇸"},ar:{name:"العربية",flag:"🇸🇦"},de:{name:"Deutsch",flag:"🇩🇪"},es:{name:"Español",flag:"🇪🇸"},fr:{name:"Français",flag:"🇫🇷"},it:{name:"Italiano",flag:"🇮🇹"},ja:{name:"日本語",flag:"🇯🇵"},ko:{name:"한국어",flag:"🇰🇷"},pt:{name:"Português",flag:"🇵🇹"},ru:{name:"Русский",flag:"🇷🇺"},sv:{name:"Svenska",flag:"🇸🇪"},th:{name:"ไทย",flag:"🇹🇭"},uk:{name:"Українська",flag:"🇺🇦"},vi:{name:"Tiếng Việt",flag:"🇻🇳"},zh:{name:"简体中文",flag:"🇨🇳"}},h0=({variant:e="compact",className:r=""})=>{const{i18n:a,t:n}=tr.useTranslation("languageSelector"),[o,s]=p.useState(a.language),l=p.useMemo(()=>a.options.supportedLngs?a.options.supportedLngs.filter(c=>c!=="cimode").map(c=>({code:c,name:Ka[c]?.name||c.toUpperCase(),flag:Ka[c]?.flag||"🌐"})).sort((c,h)=>c.name.localeCompare(h.name)):[],[a.options.supportedLngs]),i=l.find(c=>c.code===o||c.code.toLowerCase()===o.toLowerCase());p.useEffect(()=>{s(a.language)},[a.language]);const d=c=>{localStorage.setItem("language",c),a.changeLanguage(c).then(()=>{s(a.language),setTimeout(()=>{window.dispatchEvent(new Event("languagechange"))},100)}).catch(()=>{})};return e==="compact"?t.jsx("div",{className:`relative ${r}`,children:t.jsxs(qr,{value:o,onValueChange:d,children:[t.jsx(or,{className:"h-10 w-auto px-3 border-0 bg-transparent hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-0 focus:ring-offset-0",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-lg leading-none",children:i?.flag}),t.jsx("span",{className:"hidden sm:block text-sm font-medium text-gray-700 dark:text-gray-300",children:i?.name})]})}),t.jsx(sr,{children:l.map(c=>t.jsx(lr,{value:c.code,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-lg leading-none",children:c.flag}),t.jsx("span",{className:"text-sm",children:c.name})]})},c.code))})]})}):t.jsxs("div",{className:`space-y-2 ${r}`,children:[t.jsxs("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 flex items-center space-x-2",children:[t.jsx(M.LanguageIcon,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"}),t.jsx("span",{children:n("language","Language")})]}),t.jsxs(qr,{value:o,onValueChange:d,children:[t.jsx(or,{children:t.jsx(Aa,{placeholder:n("selectLanguage","Select language")})}),t.jsx(sr,{children:l.map(c=>t.jsx(lr,{value:c.code,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-lg leading-none",children:c.flag}),t.jsx("span",{children:c.name})]})},c.code))})]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:n("selectPreferredLanguage","Select your preferred language")})]})},f0=({items:e,type:r="ordered",variant:a="default",className:n,itemClassName:o})=>{const s=()=>{const c="space-y-2",h={ordered:r==="ordered"?"list-decimal":"",unordered:r==="unordered"?"list-disc":""},g={default:"list-inside",enhanced:"list-inside space-y-3",minimal:"list-none space-y-1"};return f(c,h[r],g[a])},l=c=>{const h="text-gray-600 dark:text-gray-400";return a==="enhanced"?f(h,"relative pl-8 pb-2 border-l-2 border-gray-200 dark:border-gray-700",c===e.length-1&&"border-l-transparent"):a==="minimal"?f(h,"flex items-start"):h},i=c=>a==="enhanced"&&r==="ordered"?t.jsx("div",{className:"absolute -left-4 -top-1 w-6 h-6 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-medium",children:c+1}):null,d=(c,h)=>{const g=typeof c=="object",y=g?c.content:c,m=g?c.subItems:void 0;return t.jsxs("li",{className:f(l(h),o),children:[i(h),a==="minimal"&&r==="ordered"&&t.jsx("span",{className:"inline-block w-6 h-6 bg-blue-100 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 rounded-full text-sm font-medium text-center leading-6 mr-3 flex-shrink-0",children:h+1}),a==="minimal"&&r==="unordered"&&t.jsx("span",{className:"inline-block w-2 h-2 bg-blue-600 rounded-full mt-2 mr-3 flex-shrink-0"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{children:y}),m&&m.length>0&&t.jsx("ul",{className:"mt-2 ml-4 space-y-1 list-disc list-inside text-sm text-gray-500 dark:text-gray-500",children:m.map((b,v)=>t.jsx("li",{children:b},v))})]})]},h)};return t.jsx("ul",{className:f(s(),n),children:e.map(d)})};class b0 extends p.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,a){console.error("ErrorBoundary caught an error:",r,a),this.props.onError?.(r,a)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsxs("div",{style:{padding:"20px",border:"1px solid red",margin:"10px"},children:[t.jsx("h2",{children:"Something went wrong"}),t.jsxs("p",{children:["Error: ",this.state.error?.message||"Unknown error"]}),t.jsx("button",{onClick:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}}class hr extends p.Component{constructor(r){super(r),this.retryTimer=null,this.sendErrorToMonitoring=(a,n)=>{try{typeof window<"u"&&window.Sentry&&window.Sentry?.captureException(a,{contexts:{react:{componentStack:n.componentStack}},tags:{errorBoundary:!0,componentName:this.props.componentName||"unknown",lazyLoading:!0}}),typeof window<"u"&&window.gtag&&window.gtag?.("event","exception",{description:a.message,fatal:!1,custom_map:{component:this.props.componentName||"unknown"}})}catch{}},this.handleRetry=()=>{const{maxRetries:a=3,retryDelay:n=1e3}=this.props,{retryCount:o}=this.state;if(o>=a)return;this.setState({isRetrying:!0}),this.retryTimer&&clearTimeout(this.retryTimer);const s=n*Math.pow(2,o);this.retryTimer=setTimeout(()=>{this.setState({hasError:!1,error:null,errorInfo:null,retryCount:o+1,isRetrying:!1})},s)},this.handleReload=()=>{window.location.reload()},this.state={hasError:!1,error:null,errorInfo:null,retryCount:0,isRetrying:!1,lastErrorTime:0}}static getDerivedStateFromError(r){return{hasError:!0,error:r,lastErrorTime:Date.now()}}componentDidCatch(r,a){const{onError:n,componentName:o}=this.props;this.setState({error:r,errorInfo:a}),console.error(`LazyErrorBoundary caught an error in ${o||"Unknown Component"}:`,r,a),n?.(r,a),this.sendErrorToMonitoring(r,a)}componentWillUnmount(){this.retryTimer&&clearTimeout(this.retryTimer)}render(){const{children:r,fallback:a,componentName:n,showRetryButton:o=!0,maxRetries:s=3}=this.props,{hasError:l,error:i,isRetrying:d,retryCount:c}=this.state;return l&&i?a||t.jsx("div",{className:"lazy-error-boundary error-boundary-container",children:t.jsxs("div",{className:"error-content",children:[t.jsx("div",{className:"error-icon",children:"⚠️"}),t.jsxs("h3",{className:"error-title",children:["Something went wrong loading ",n||"this component"]}),t.jsxs("div",{className:"error-details",children:[t.jsx("p",{className:"error-message",children:i.message}),process.env.NODE_ENV==="development"&&t.jsxs("details",{className:"error-stack",children:[t.jsx("summary",{children:"Error Details (Development)"}),t.jsx("pre",{children:i.stack})]})]}),t.jsxs("div",{className:"error-actions",children:[o&&c<s&&t.jsx("button",{onClick:this.handleRetry,disabled:d,className:"retry-button",children:d?"Retrying...":`Retry (${c}/${s})`}),c>=s&&t.jsx("button",{onClick:this.handleReload,className:"reload-button",children:"Reload Page"})]}),t.jsxs("div",{className:"error-help",children:[t.jsx("p",{children:"This might be a temporary issue. Try refreshing the page."}),navigator.onLine===!1&&t.jsx("p",{className:"offline-notice",children:"You appear to be offline. Check your connection and try again."})]})]})}):r}}function m0(e,r){const a=n=>t.jsx(hr,{...r,children:t.jsx(e,{...n})});return a.displayName=`withLazyErrorBoundary(${e.displayName||e.name})`,a}class y0 extends hr{static getDerivedStateFromError(r){return r.message.includes("Loading chunk")||r.message.includes("Loading CSS chunk")||r.message.includes("ChunkLoadError")||r.name==="ChunkLoadError"?{hasError:!0,error:new Error("Network error while loading component. Please check your connection and try again."),lastErrorTime:Date.now()}:super.getDerivedStateFromError(r)}}function p0(){const[e,r]=p.useState(0),a=p.useCallback(()=>{r(n=>n+1)},[]);return{errorRecoveryCount:e,triggerErrorRecovery:a}}function v0({children:e}){const r=(a,n)=>{console.error("Global lazy loading error:",a,n),typeof window<"u"&&window.Sentry&&window.Sentry?.captureException(a,{level:"error",tags:{globalErrorBoundary:!0,lazyLoading:!0}})};return t.jsx(hr,{onError:r,componentName:"Application",maxRetries:1,showRetryButton:!0,fallback:t.jsxs("div",{className:"global-error-fallback",children:[t.jsx("h1",{children:"Application Error"}),t.jsx("p",{children:"Something went wrong with the application. Please refresh the page."}),t.jsx("button",{onClick:()=>window.location.reload(),children:"Refresh Page"})]}),children:e})}const w0=({children:e})=>t.jsx(t.Fragment,{children:e}),k0=({children:e})=>t.jsx(t.Fragment,{children:e}),x0=(e,r,a)=>{const n=p.memo(e,r);return a&&(n.displayName=`Memo(${a})`),process.env.NODE_ENV==="development"?o=>(p.useMemo(()=>{let l=0;return()=>++l},[])(),t.jsx(n,{...o})):n},N0=(e,r)=>p.memo(e,(a,n)=>r.every(o=>a[o]===n[o])),C0=p.memo(({children:e,compute:r,deps:a})=>{const n=p.useRef(a),o=p.useRef(r),s=p.useRef(void 0),l=p.useMemo(()=>{const i=a.length!==n.current.length||a.some((c,h)=>c!==n.current[h]),d=r!==o.current;if(i||d||s.current===void 0){let c;return process.env.NODE_ENV==="development"?(performance.now(),c=r(),performance.now()):c=r(),n.current=a,o.current=r,s.current=c,c}return s.current},[r,a]);return t.jsx(t.Fragment,{children:e(l)})}),S0=p.memo(({item:e,index:r,style:a,renderItem:n})=>t.jsx("div",{style:a,children:n(e,r)}),(e,r)=>e.index===r.index&&e.item===r.item&&e.style.height===r.style.height&&e.style.top===r.style.top),E0=p.memo(({condition:e,children:r,fallback:a=null})=>e?t.jsx(t.Fragment,{children:r}):t.jsx(t.Fragment,{children:a})),T0=({children:e,threshold:r=.1,rootMargin:a="50px",fallback:n=null})=>{const[o,s]=p.useState(!1),l=p.useRef(null);return p.useEffect(()=>{const i=new IntersectionObserver(([d])=>{d.isIntersecting&&(s(!0),i.disconnect())},{threshold:r,rootMargin:a});return l.current&&i.observe(l.current),()=>i.disconnect()},[r,a]),t.jsx("div",{ref:l,children:o?e:n})},A0=({children:e,maxRenderTime:r=16,onSlowRender:a})=>{const n=p.useRef(0);return p.useLayoutEffect(()=>{n.current=performance.now()}),p.useEffect(()=>{const o=performance.now()-n.current;o>r&&a?.(o)}),t.jsx(t.Fragment,{children:e})},I0=({children:e,batchSize:r=5,delay:a=0})=>{const[n,o]=p.useState(r);return p.useEffect(()=>{if(n<e.length){const s=setTimeout(()=>{o(l=>Math.min(l+r,e.length))},a);return()=>clearTimeout(s)}},[n,e.length,r,a]),t.jsx(t.Fragment,{children:e.slice(0,n)})},L0=({src:e,alt:r,placeholder:a,lowQualitySrc:n,aspectRatio:o="16/9",eager:s=!1,className:l="",...i})=>{const[d,c]=p.useState(!1),[h,g]=p.useState(s),[y,m]=p.useState(!1),b=p.useRef(null),v=p.useRef(null);p.useEffect(()=>{if(s){g(!0);return}return v.current=new IntersectionObserver(k=>{k.forEach(x=>{x.isIntersecting&&(g(!0),v.current&&b.current&&v.current.unobserve(b.current))})},{rootMargin:"50px",threshold:.01}),b.current&&v.current.observe(b.current),()=>{v.current&&v.current.disconnect()}},[s]);const w=()=>{c(!0)},S=()=>{m(!0)};return t.jsxs("div",{className:`relative overflow-hidden ${l}`,style:{aspectRatio:o},children:[n&&!d&&t.jsx("img",{src:n,alt:"",className:"absolute inset-0 w-full h-full object-cover blur-sm","aria-hidden":"true"}),!n&&!d&&t.jsx("div",{className:"absolute inset-0 bg-gray-200 dark:bg-gray-700 animate-pulse","aria-hidden":"true"}),h&&!y&&t.jsx("img",{ref:b,src:e,alt:r,onLoad:w,onError:S,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-500 ${d?"opacity-100":"opacity-0"}`,loading:s?"eager":"lazy",...i}),y&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100 dark:bg-gray-800",children:t.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[t.jsx("svg",{className:"mx-auto h-12 w-12 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),t.jsx("p",{className:"text-sm",children:"Failed to load image"})]})})]})},M0=e=>/^[a-z]{2}(-[a-z]+)?$/.test(e);function P0({to:e,language:r,children:a,isLanguageSupported:n=M0,defaultLanguage:o="en",...s}){const{lang:l}=X.useParams(),i=l&&n(l)?l:o,d=r||i,c=e.startsWith(`/${d}`)?e:`/${d}${e.startsWith("/")?e:`/${e}`}`;return t.jsx(X.Link,{to:c,...s,children:a})}function O0({isLanguageSupported:e,defaultLanguage:r="en",storageKey:a="language",fallback:n=null}){const{lang:o}=X.useParams(),s=X.useNavigate(),{i18n:l}=tr.useTranslation();return p.useEffect(()=>{if(!o||!e(o)){s(`/${r}`,{replace:!0});return}l.language!==o&&l.changeLanguage(o);try{localStorage.setItem(a,o)}catch{}},[o,l,s,e,r,a]),!o||!e(o)?t.jsx(t.Fragment,{children:n}):t.jsx(X.Outlet,{})}function tt(e,r){const a=at(e);return`/${r}${a.startsWith("/")?a:`/${a}`}`}function at(e,r){const a=e.split("/").filter(Boolean);if(a.length>0){const n=a[0];if(/^[a-z]{2}(-[a-z]+)?$/.test(n)&&(!r||r(n)))return"/"+a.slice(1).join("/")}return e}function U0(e={}){const{isLanguageSupported:r=h=>/^[a-z]{2}(-[a-z]+)?$/.test(h),defaultLanguage:a="en",storageKey:n="language"}=e,o=X.useNavigate(),{lang:s}=X.useParams(),{i18n:l}=tr.useTranslation(),i=s&&r(s)?s:l.language||a,d=p.useCallback((h,g)=>{if(typeof h=="number"){o(h);return}const y=tt(h,i);o(y,g)},[o,i]),c=p.useCallback((h,g)=>{l.changeLanguage(h);const y=at(g||(typeof window<"u"?window.location.pathname:"/"),r),m=tt(y,h);o(m,{replace:!0});try{localStorage.setItem(n,h)}catch{}},[o,l,r,n]);return{navigate:d,switchLanguage:c,currentLanguage:i}}function D0(){return t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-theme-bg-primary",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})}function j0({children:e,isAuthenticated:r,isLoading:a=!1,redirectPath:n,loadingComponent:o,fallback:s=null}){const l=X.useNavigate(),{lang:i}=X.useParams();return p.useEffect(()=>{if(!a&&!r){const d=n?n.replace(":lang",i||"en"):`/${i||"en"}`;l(d,{replace:!0})}},[r,a,l,i,n]),a?t.jsx(t.Fragment,{children:o??t.jsx(D0,{})}):r?t.jsx(t.Fragment,{children:e}):t.jsx(t.Fragment,{children:s})}function _0(){return t.jsx("svg",{className:"w-8 h-8 text-red-600 dark:text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}function z0({spinning:e=!1}){return t.jsx("svg",{className:`w-4 h-4 ${e?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}function B0({title:e="Something went wrong",message:r="An unexpected error occurred. Please try again.",onRetry:a,isRetrying:n=!1,retryText:o="Retry",loadingText:s="Loading...",icon:l,className:i=""}){return t.jsx("div",{className:`flex flex-col items-center justify-center py-12 px-4 ${i}`,children:t.jsxs("div",{className:"flex flex-col items-center max-w-md text-center",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center mb-4",children:l??t.jsx(_0,{})}),t.jsx("h3",{className:"text-lg font-semibold text-theme-text-primary mb-2",children:e}),t.jsx("p",{className:"text-sm text-theme-text-secondary mb-6",children:r}),a&&t.jsxs("button",{onClick:a,disabled:n,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50",children:[t.jsx(z0,{spinning:n}),n?s:o]})]})})}var re=(e=>(e.LIGHT="light",e.DARK="dark",e.SYSTEM="system",e))(re||{}),nt=(e=>(e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e))(nt||{});const fr={getItem:e=>{try{return localStorage.getItem(e)}catch{return null}},setItem:(e,r)=>{try{localStorage.setItem(e,r)}catch{}}},ot=p.createContext(void 0);function F0(){const e=p.useContext(ot);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function W0({children:e,themeStorageKey:r="theme",fontSizeStorageKey:a="font-size",defaultTheme:n=re.LIGHT,defaultFontSize:o=nt.MEDIUM}){const[s,l]=p.useState(()=>fr.getItem(r)||n),[i,d]=p.useState(()=>fr.getItem(a)||o),[c,h]=p.useState(()=>s===re.SYSTEM?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?re.DARK:re.LIGHT:s),g=p.useCallback(b=>{l(b),fr.setItem(r,b)},[r]),y=p.useCallback(b=>{d(b),fr.setItem(a,b)},[a]);p.useEffect(()=>{const b=document.documentElement;let v=s;s===re.SYSTEM&&(v=window.matchMedia("(prefers-color-scheme: dark)").matches?re.DARK:re.LIGHT),h(v),b.classList.remove("light","dark"),b.classList.add(v),b.classList.remove("font-small","font-medium","font-large"),b.classList.add(`font-${i}`)},[s,i]),p.useEffect(()=>{if(s===re.SYSTEM){const b=window.matchMedia("(prefers-color-scheme: dark)"),v=w=>{const S=document.documentElement,k=w.matches?re.DARK:re.LIGHT;h(k),S.classList.remove("light","dark"),S.classList.add(k)};return b.addEventListener("change",v),()=>{b.removeEventListener("change",v)}}},[s]);const m=p.useMemo(()=>({theme:s,fontSize:i,setTheme:g,setFontSize:y,resolvedTheme:c}),[s,i,g,y,c]);return t.jsx(ot.Provider,{value:m,children:e})}const $0=({icon:e,title:r,description:a,benefits:n,metrics:o,color:s="blue",isHighlight:l=!1,learnMoreUrl:i,cta:d,onClick:c,interactive:h=!1,borderColor:g=!1,className:y})=>{const m={blue:"text-blue-600 dark:text-blue-400",green:"text-green-600 dark:text-green-400",purple:"text-purple-600 dark:text-purple-400",orange:"text-orange-600 dark:text-orange-400",pink:"text-pink-600 dark:text-pink-400",gray:"text-gray-600 dark:text-gray-400",red:"text-red-600 dark:text-red-400",indigo:"text-indigo-600 dark:text-indigo-400",cyan:"text-cyan-600 dark:text-cyan-400",emerald:"text-emerald-600 dark:text-emerald-400"},b={green:"border-l-4 border-green-500",blue:"border-l-4 border-blue-500",purple:"border-l-4 border-purple-500",orange:"border-l-4 border-orange-500",red:"border-l-4 border-red-500",indigo:"border-l-4 border-indigo-500",cyan:"border-l-4 border-cyan-500",emerald:"border-l-4 border-emerald-500",pink:"border-l-4 border-pink-500",gray:"border-l-4 border-gray-500"},v={green:"bg-green-100 dark:bg-green-900/20",blue:"bg-blue-100 dark:bg-blue-900/20",purple:"bg-purple-100 dark:bg-purple-900/20",orange:"bg-orange-100 dark:bg-orange-900/20",red:"bg-red-100 dark:bg-red-900/20",indigo:"bg-indigo-100 dark:bg-indigo-900/20",cyan:"bg-cyan-100 dark:bg-cyan-900/20",emerald:"bg-emerald-100 dark:bg-emerald-900/20",pink:"bg-pink-100 dark:bg-pink-900/20",gray:"bg-gray-100 dark:bg-gray-900/20"},w=m[s],S=typeof e=="string",k=()=>t.jsxs(t.Fragment,{children:[S?t.jsx("div",{className:"text-4xl mb-4",children:e}):g?t.jsx("div",{className:f("w-12 h-12","rounded-lg","flex items-center justify-center","mb-4",v[s],w),children:e}):t.jsx("div",{className:f("flex-shrink-0 mb-4",w),children:e}),t.jsxs("div",{className:"flex-1",children:[t.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:r}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:a}),d&&t.jsx("div",{className:"mt-3 mb-4",children:d}),n&&n.length>0&&t.jsx("ul",{className:"space-y-2 mb-4",children:n.map((E,A)=>t.jsxs("li",{className:"flex items-start",children:[t.jsx("div",{className:f("w-2 h-2 rounded-full mt-2 mr-3 flex-shrink-0",`bg-${s}-500`)}),t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:E})]},A))}),o&&Object.keys(o).length>0&&t.jsx("div",{className:"grid grid-cols-2 gap-4 mt-4",children:Object.entries(o).map(([E,A],C)=>t.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[t.jsx("div",{className:f("text-lg font-bold",w),children:A}),t.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:E})]},C))})]})]}),x=f("p-6 rounded-xl shadow-lg hover:shadow-xl transition-all duration-200",g&&b[s],(h||c)&&"cursor-pointer hover:scale-[1.02]",l?"bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border-blue-200 dark:border-blue-800 border":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 border",y),N=E=>{c&&("key"in E?(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),c()):c())};return i?t.jsx("a",{href:i,className:f(x,"block group"),onClick:c?E=>{E.preventDefault(),N(E)}:void 0,children:t.jsx(k,{})}):c?t.jsx("div",{className:x,onClick:N,onKeyDown:N,role:"button",tabIndex:0,"aria-label":r,children:t.jsx(k,{})}):t.jsx("div",{className:x,children:t.jsx(k,{})})},V0=Z.cva("grid gap-8",{variants:{columns:{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"},spacing:{sm:"gap-4",md:"gap-8",lg:"gap-12"}},defaultVariants:{columns:3,spacing:"md"}}),H0=Z.cva("group transition-all duration-300",{variants:{variant:{default:"text-center",left:"text-left",hoverable:"text-center hover:transform hover:scale-105 cursor-pointer",card:"bg-white dark:bg-gray-800 rounded-2xl p-8 shadow-lg hover:shadow-xl text-center",minimal:"text-center space-y-4"},animation:{none:"",hover:"hover:transform hover:scale-105",float:"hover:-translate-y-2"}},defaultVariants:{variant:"default",animation:"hover"}}),q0=Z.cva("flex items-center justify-center rounded-2xl mb-6 transition-all duration-300",{variants:{size:{sm:"w-16 h-16",md:"w-20 h-20",lg:"w-24 h-24"},style:{gradient:"bg-gradient-to-br from-blue-100 to-blue-200 dark:from-blue-900/30 dark:to-blue-800/30 group-hover:from-blue-200 group-hover:to-blue-300 dark:group-hover:from-blue-800/40 dark:group-hover:to-blue-700/40",solid:"bg-blue-100 dark:bg-blue-900/30 group-hover:bg-blue-200 dark:group-hover:bg-blue-800/40",outline:"border-2 border-blue-200 dark:border-blue-800 group-hover:border-blue-300 dark:group-hover:border-blue-700",colorful:"group-hover:scale-110"},position:{center:"mx-auto",left:"",right:"ml-auto"}},defaultVariants:{size:"md",style:"gradient",position:"center"}}),G0={success:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",info:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",warning:"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",default:"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300"},Y0=({className:e,features:r,columns:a=3,spacing:n="md",cardVariant:o="default",cardAnimation:s="hover",iconSize:l="md",iconStyle:i="gradient",iconPosition:d="center",titleClass:c,descriptionClass:h,animate:g=!0,animationDelay:y=0,staggerDelay:m=100,onFeatureClick:b,defaultLinkText:v="Learn more"})=>{const w=(k,x)=>{if(i==="colorful"&&k.gradient)return{background:`linear-gradient(135deg, ${k.gradient.from}, ${k.gradient.to})`};if(i==="colorful"){const N=[{from:"#3B82F6",to:"#1D4ED8"},{from:"#10B981",to:"#059669"},{from:"#8B5CF6",to:"#7C3AED"},{from:"#F59E0B",to:"#D97706"},{from:"#EF4444",to:"#DC2626"},{from:"#06B6D4",to:"#0891B2"}],E=N[x%N.length];return{background:`linear-gradient(135deg, ${E.from}, ${E.to})`}}},S=(k,x)=>{const N=t.jsxs("div",{className:f(H0({variant:o,animation:s})),onClick:()=>b?.(k),role:b?"button":void 0,tabIndex:b?0:void 0,children:[k.badge&&t.jsx("div",{className:"mb-4",children:t.jsx("span",{className:f("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",G0[k.badge.variant||"default"]),children:k.badge.text})}),t.jsx("div",{className:f(q0({size:l,style:i,position:d})),style:w(k,x),children:t.jsx("div",{className:f("flex items-center justify-center",i==="colorful"?"text-white":"text-blue-600 dark:text-blue-400"),children:k.icon})}),t.jsx("h3",{className:f("text-xl font-bold text-gray-900 dark:text-white mb-4",c),children:k.title}),t.jsx("div",{className:f("text-gray-600 dark:text-gray-300 leading-relaxed",h),children:k.description}),k.link&&t.jsx("div",{className:"mt-6",children:t.jsxs("a",{href:k.link.href,className:"inline-flex items-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium transition-colors duration-200",children:[k.link.text||v,t.jsx("svg",{className:"w-4 h-4 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]});return t.jsx("div",{children:N},k.id||x)};return t.jsx("div",{className:f(V0({columns:a,spacing:n}),e),children:r.map(S)})},st=(e,r,a,n)=>({icon:e,title:r,description:a,...n}),K0=e=>[st(t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),e?.passwordlessTitle||"Passwordless Security",e?.passwordlessDescription||"Authenticate using your Web3 wallet - no passwords to remember or lose."),st(t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.40A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),e?.encryptionTitle||"End-to-End Encryption",e?.encryptionDescription||"Your emails are encrypted and only you can read them.")],Z0=({title:e,description:r,primaryButton:a,secondaryButton:n,gradient:o={from:"blue-600",to:"purple-600"},textColor:s="light",className:l="",size:i="lg"})=>{const{paddingClass:d}=he(),h=(()=>{const w=o.via?`${o.from}-${o.via}-${o.to}`:`${o.from}-${o.to}`;return{"blue-600-purple-600":"bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-700 dark:to-purple-700","orange-900-red-900":"bg-gradient-to-r from-orange-600 to-red-600 dark:from-orange-700 dark:to-red-700","green-600-blue-600":"bg-gradient-to-r from-green-600 to-blue-600 dark:from-green-700 dark:to-blue-700","purple-600-pink-600":"bg-gradient-to-r from-purple-600 to-pink-600 dark:from-purple-700 dark:to-pink-700"}[w]||"bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-700 dark:to-purple-700"})(),g=s==="light"?"text-white":"text-gray-900 dark:text-gray-100",y={sm:"py-12",md:"py-16",lg:"py-20"},m={sm:"text-2xl md:text-3xl",md:"text-3xl md:text-4xl",lg:"text-4xl md:text-5xl"},b={sm:"text-base md:text-lg",md:"text-lg md:text-xl",lg:"text-xl md:text-2xl"},v=(w,S=!1)=>{const k=()=>w.variant==="primary"||S?"gradient":(w.variant==="secondary","outline"),x=t.jsx(ne,{variant:k(),size:"lg",className:S?"":"bg-white/10 hover:bg-white/20 backdrop-blur-sm border-white/30",children:w.label});return w.external?t.jsx("a",{href:w.href,target:"_blank",rel:"noopener noreferrer",children:x}):t.jsx(X.Link,{to:w.href,children:x})};return t.jsxs("section",{className:`${h} ${y[i]} relative overflow-hidden ${l}`,children:[t.jsx("div",{className:"absolute inset-0 bg-black/20"}),t.jsxs("div",{className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-full h-full",children:[t.jsx("div",{className:"absolute top-10 left-10 w-72 h-72 bg-white/10 rounded-full blur-3xl"}),t.jsx("div",{className:"absolute bottom-10 right-10 w-72 h-72 bg-white/10 rounded-full blur-3xl"})]}),t.jsxs("div",{className:`relative z-10 max-w-4xl mx-auto ${d} text-center`,children:[t.jsx("h2",{className:`${m[i]} font-bold ${g} mb-6`,children:e}),t.jsx("p",{className:`${b[i]} ${g}/90 mb-8 max-w-2xl mx-auto`,children:r}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[v(a,!0),n&&v(n,!1)]})]})]})},X0={pending:{label:"Pending",color:"bg-gray-500",textColor:"text-white"},in_progress:{label:"In Progress",color:"bg-blue-500",textColor:"text-white"},verified:{label:"Verified",color:"bg-green-500",textColor:"text-white"},rejected:{label:"Rejected",color:"bg-red-500",textColor:"text-white"}},Q0={basic:"Basic KYC",enhanced:"Enhanced KYC",accredited:"Accredited Investor"},J0=({status:e,level:r,className:a=""})=>{const n=X0[e],o=Q0[r];return t.jsx("div",{className:`inline-flex items-center gap-2 ${a}`,children:t.jsxs("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${n.color} ${n.textColor}`,children:[o,": ",n.label]})})},R0=({accessToken:e,onComplete:r,onError:a,className:n=""})=>{const o=p.useRef(null),s=p.useRef(null);return p.useEffect(()=>{if(!e)return;const l=document.createElement("script");return l.src="https://static.sumsub.com/idensic/static/sns-websdk-builder.js",l.async=!0,l.onload=()=>{if(o.current&&window.snsWebSdk)try{const i=window.snsWebSdk.init(e,()=>e).withConf({lang:"en"}).withOptions({addViewportTag:!1,adaptIframeHeight:!0}).on("idCheck.onStepCompleted",d=>{}).on("idCheck.onApplicantSubmitted",d=>{r?.()}).on("idCheck.onError",d=>{console.error("SumsubWebSDK: Error",d),a?.(d)}).build();s.current=i,i.launch("#sumsub-websdk-container")}catch(i){console.error("Failed to initialize Sumsub SDK:",i),a?.(i)}else console.error("SumsubWebSDK: Missing requirements - containerRef:",!!o.current,"snsWebSdk:",!!window.snsWebSdk)},l.onerror=()=>{const i=new Error("Failed to load Sumsub Web SDK script");console.error(i),a?.(i)},document.body.appendChild(l),()=>{document.body.contains(l)&&document.body.removeChild(l),s.current&&typeof s.current.destroy=="function"&&s.current.destroy()}},[e,r,a]),t.jsx("div",{className:`sumsub-sdk-container ${n}`,children:t.jsx("div",{ref:o,id:"sumsub-websdk-container"})})},eu={basic:{title:"Basic KYC",description:"Age & Identity Verification",color:"border-blue-200",activeColor:"border-blue-500 bg-blue-50"},enhanced:{title:"Enhanced KYC",description:"Basic + Country & Compliance",color:"border-purple-200",activeColor:"border-purple-500 bg-purple-50"},accredited:{title:"Accredited Investor",description:"Enhanced + Financial Verification",color:"border-gold-200",activeColor:"border-gold-500 bg-gold-50"}},ru=({level:e,price:r,features:a,isActive:n=!1,isVerified:o=!1,onSelect:s,className:l=""})=>{const i=eu[e];return t.jsxs("div",{className:`
58
+ `+e)}`,messages:(e,r)=>`sms:?&body=${encodeURIComponent(r+" "+e)}`},o0=({shareConfig:e})=>{const[r,a]=p.useState(!1),[n,o]=p.useState(""),[s,l]=p.useState(!1),[i,d]=p.useState(!1),[c,h]=p.useState(!1);p.useEffect(()=>{const k=e.onBeforeShare;k&&!n&&(async()=>{l(!0);try{const N=typeof window<"u"?window.location.href:"",E=await k(N);o(E)}catch{const N=typeof window<"u"?window.location.href:"";o(N)}finally{l(!1)}})()},[e,n]);const g=n||(typeof window<"u"?window.location.href:""),y=typeof navigator<"u"&&navigator.share!==void 0,m=async()=>{if(!(!y||c)){h(!0);try{await navigator.share({title:e.title,text:e.description,url:g}),a(!1)}catch(k){k instanceof Error&&k.name!=="AbortError"&&(console.error("Share failed:",k),k.name!=="InvalidStateError"&&a(!0))}finally{h(!1)}}},b=async()=>{try{await navigator.clipboard.writeText(g),d(!0),setTimeout(()=>{d(!1),a(!1)},1500)}catch{}},v=()=>{a(!r)},w=k=>{window.open(k,"_blank","noopener,noreferrer,width=600,height=400"),a(!1)},S=[{name:"Twitter",url:ce.twitter(g,e.title,e.hashtags),color:"text-blue-400",svg:t.jsx("path",{d:"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84"})},{name:"Facebook",url:ce.facebook(g),color:"text-blue-600",svg:t.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})},{name:"LinkedIn",url:ce.linkedin(g,e.title,e.description),color:"text-blue-700",svg:t.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})},{name:"Reddit",url:ce.reddit(g,e.title),color:"text-orange-600",svg:t.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})},{name:"Telegram",url:ce.telegram(g,e.title),color:"text-blue-500",svg:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})},{name:"WhatsApp",url:ce.whatsapp(g,e.title),color:"text-green-600",svg:t.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"})},{name:"Discord",url:ce.discord(g,e.title),color:"text-indigo-500",svg:t.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})},{name:"Messages",url:ce.messages(g,e.title),color:"text-green-500",svg:t.jsx("path",{d:"M.05 3.555A3 3 0 013 0h18a3 3 0 012.95 3.555L22 11v8a3 3 0 01-3 3H5a3 3 0 01-3-3v-8l-1.95-7.445zM2 10.938V19a1 1 0 001 1h18a1 1 0 001-1v-8.062L20 19H4l-2-8.062zM3.38 2L5 8h14l1.62-6H3.38z"})},{name:"Email",url:ce.email(g,e.title,e.description),color:"text-gray-600",svg:t.jsx("path",{d:"M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"})}];return t.jsxs("div",{className:"relative",children:[t.jsx("button",{onClick:v,disabled:s||c,className:"flex items-center justify-center w-8 h-8 bg-blue-50 hover:bg-blue-100 dark:bg-blue-900/30 dark:hover:bg-blue-900/50 text-blue-600 dark:text-blue-400 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Share this page",children:s||c?t.jsx("div",{className:"w-4 h-4 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"}):t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.367 2.684 3 3 0 00-5.367-2.684z"})})}),r&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"fixed inset-0 z-[999998]",onClick:()=>a(!1)}),t.jsxs("div",{className:"absolute right-0 top-10 z-[999999] w-40 bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 py-1",children:[S.map(k=>t.jsxs("button",{onClick:()=>w(k.url),className:"w-full flex items-center px-3 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors",children:[t.jsx("svg",{className:`w-4 h-4 mr-2 ${k.color}`,fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:k.svg}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:k.name})]},k.name)),t.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),y&&t.jsxs("button",{onClick:()=>{a(!1),m()},disabled:c,className:"w-full flex items-center px-3 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50",children:[t.jsx("svg",{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.367 2.684 3 3 0 00-5.367-2.684z"})}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"More..."})]}),t.jsxs("button",{onClick:b,className:"w-full flex items-center px-3 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors",children:[t.jsx("svg",{className:"w-4 h-4 mr-2 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:i?"Copied!":"Copy Link"})]})]})]})]})},Va=({items:e,shareConfig:r,className:a,showHome:n})=>t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("nav",{"aria-label":"Breadcrumb",children:t.jsx("ol",{className:"flex items-center text-sm space-x-2",children:e.map((o,s)=>t.jsxs(p.Fragment,{children:[t.jsx("li",{children:o.current?t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:o.label}):t.jsx(X.Link,{to:o.href||"#",className:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 transition-colors",children:o.label})}),s<e.length-1&&t.jsx("li",{children:t.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"/"})})]},s))})}),r&&t.jsx(o0,{shareConfig:r})]}),Ha={standard:"max-w-7xl mx-auto px-4",wide:"max-w-[1920px] mx-auto px-4",full:"w-full px-4"},qa={standard:"max-w-7xl mx-auto",wide:"max-w-[1920px] mx-auto",full:"w-full"},Ga="px-4",rt=p.createContext(void 0),s0=({mode:e="standard",children:r})=>{const a={mode:e,containerClass:Ha[e],maxWidthClass:qa[e],paddingClass:Ga};return t.jsx(rt.Provider,{value:a,children:r})},he=()=>{const e=p.useContext(rt);return e||{mode:"standard",containerClass:Ha.standard,maxWidthClass:qa.standard,paddingClass:Ga}},l0=({items:e,shareConfig:r})=>{const{containerClass:a}=he();return t.jsx("div",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 relative z-50",children:t.jsx("div",{className:`${a} py-3 relative`,children:t.jsx(Va,{items:e,shareConfig:r})})})},Ya=e=>{const[r,a]=p.useState(""),[n,o]=p.useState(!0),[s,l]=p.useState(null);return p.useEffect(()=>{e&&(async()=>{try{o(!0),l(null);const d=await fetch(`/code/${e}`);if(!d.ok)throw new Error(`Failed to load code file: ${e}`);const c=await d.text();a(c)}catch(d){l(d instanceof Error?d.message:"Unknown error"),a("// Error loading code file")}finally{o(!1)}})()},[e]),{code:r,loading:n,error:s}},i0=({filename:e,code:r,language:a,title:n,className:o="",showCopy:s=!0,showHeader:l=!0})=>{const{t:i}=tr.useTranslation("codeBlock"),{code:d,loading:c,error:h}=Ya(e||""),[g,y]=p.useState(!1),m=r||d,v=a||(e?(S=>{switch(S.split(".").pop()?.toLowerCase()){case"sol":return"solidity";case"js":case"mjs":return"javascript";case"ts":return"typescript";case"sh":return"bash";case"graphql":return"graphql";case"json":return"json";case"css":return"css";case"html":return"html";case"jsx":return"jsx";case"tsx":return"tsx";case"py":return"python";case"java":return"java";case"cpp":case"c":return"cpp";case"go":return"go";case"rs":return"rust";case"php":return"php";case"rb":return"ruby";default:return"text"}})(e):"text"),w=async()=>{if(m)try{await navigator.clipboard.writeText(m),y(!0),setTimeout(()=>y(!1),2e3)}catch{}};return e&&c?t.jsx("div",{className:`bg-gray-900 text-green-400 rounded-lg p-4 font-mono text-sm ${o}`,children:t.jsx("div",{className:"animate-pulse text-gray-500",children:i("loadingCode","Loading code...")})}):e&&h?t.jsxs("div",{className:`bg-gray-900 text-red-400 rounded-lg p-4 font-mono text-sm ${o}`,children:[i("error","Error"),": ",h]}):m?t.jsxs("div",{className:`bg-gray-900 rounded-lg border border-green-500/20 shadow-lg shadow-green-500/10 ${o}`,children:[l&&t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-green-500/20 bg-gray-800/50",children:[t.jsx("span",{className:"text-sm text-green-400 font-mono",children:n||e||`${v} code`}),s&&t.jsx("button",{onClick:w,className:"p-2 text-gray-400 hover:text-green-400 hover:bg-gray-800 rounded-lg transition-all duration-200 group",title:i("copyCode","Copy code"),children:g?t.jsx(M.CheckIcon,{className:"h-4 w-4 text-green-400"}):t.jsx(M.ClipboardDocumentIcon,{className:"h-4 w-4 group-hover:scale-110 transition-transform"})})]}),t.jsx("div",{className:"p-4 overflow-x-auto text-left",children:t.jsx("pre",{className:`text-sm language-${v}`,children:t.jsx("code",{className:"text-gray-100",children:m})})})]}):t.jsx("div",{className:`bg-gray-900 text-gray-400 rounded-lg p-4 font-mono text-sm ${o}`,children:i("noCode","No code to display")})},c0=({subsections:e,isExpanded:r,selectedSubsection:a,parentSectionId:n,onSubsectionSelect:o})=>{const s=p.useRef(null),[l,i]=p.useState(void 0);return p.useLayoutEffect(()=>{if(s.current){const d=s.current.scrollHeight;i(r?d+16:0)}},[r,e]),t.jsx("div",{className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:l!==void 0?`${l}px`:"auto"},children:t.jsx("div",{ref:s,className:"ml-6 mt-1 mb-1 space-y-1",children:e.map(d=>t.jsxs("div",{className:"relative group",children:[a===d.id&&t.jsx("div",{className:"absolute top-0.5 bottom-0.5 left-1 right-12 bg-blue-500/20 dark:bg-blue-400/20 rounded-lg pointer-events-none"}),a!==d.id&&t.jsx("div",{className:"absolute top-0.5 bottom-0.5 left-1 right-12 bg-blue-500/0 group-hover:bg-blue-500/10 dark:group-hover:bg-blue-400/10 rounded-lg pointer-events-none transition-colors duration-200"}),t.jsx("button",{onClick:()=>o?.(d.id,n),className:`relative z-10 block w-full text-left pl-4 pr-3 py-2 rounded-md text-sm transition-all duration-200 ${a===d.id?"text-blue-700 dark:text-blue-300":"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"}`,children:d.title})]},d.id))})})},d0=({id:e,title:r,content:a,subsections:n,isSelected:o=!1,selectedSubsection:s=null,onSectionSelect:l,onSubsectionSelect:i,className:d=""})=>{const[c,h]=p.useState(!1),g=()=>{h(!c)},y=()=>{l?.(e)},m=n&&n.length>0;return t.jsxs("div",{className:d,children:[t.jsxs("div",{className:"relative flex items-center group",children:[o&&!s&&t.jsx("div",{className:"absolute top-2 bottom-2 left-2 right-12 bg-blue-500/20 dark:bg-blue-400/20 rounded-lg pointer-events-none"}),!(o&&!s)&&t.jsx("div",{className:"absolute top-2 bottom-2 left-2 right-12 bg-blue-500/0 group-hover:bg-blue-500/10 dark:group-hover:bg-blue-400/10 rounded-lg pointer-events-none transition-colors duration-200"}),t.jsx("button",{onClick:y,className:`relative z-10 flex-1 text-left pl-5 pr-3 py-4 text-base font-medium transition-all duration-200 ${o&&!s?"text-blue-700 dark:text-blue-300":"text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100"}`,children:r}),m&&t.jsx("button",{onClick:g,className:"p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 hover:scale-110 transition-all duration-200","aria-label":c?"Collapse section":"Expand section",children:t.jsx(M.ChevronRightIcon,{className:`h-5 w-5 text-gray-500 transition-transform duration-300 ease-in-out ${c?"rotate-90":"rotate-0"}`})})]}),m&&t.jsx(c0,{subsections:n,isExpanded:c,selectedSubsection:s,parentSectionId:e,onSubsectionSelect:i})]})},u0=({title:e,subtitle:r,buttonText:a,buttonIcon:n="envelope",variant:o="default",badgeText:s="FREE",prominentBadgeText:l="100% Free",onButtonClick:i,className:d=""})=>{const c=()=>n==="envelope"||n==="both"?t.jsx(M.EnvelopeIcon,{className:o==="prominent"?"h-5 w-5 mr-2":"h-4 w-4 mr-1"}):n==="none"?null:t.jsx("svg",{className:o==="prominent"?"h-5 w-5 mr-2":"h-4 w-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"})}),h=()=>n==="arrow"||n==="both"?t.jsx(M.ArrowRightIcon,{className:"h-4 w-4 ml-2"}):null,g=()=>o==="prominent"?"border-b-2 border-green-200 dark:border-green-700":"border-b border-green-200 dark:border-green-700",y=()=>{const w="bg-gradient-to-r from-green-600 to-blue-600 hover:from-green-700 hover:to-blue-700 text-white rounded-lg font-bold transition-all duration-300 transform hover:scale-105 shadow-lg hover:shadow-green-500/25 inline-flex items-center whitespace-nowrap cursor-pointer";return o==="prominent"?`${w} px-8 py-3 text-base`:`${w} px-6 py-2 text-sm`},m=()=>o==="prominent"?"text-green-800 dark:text-green-200 font-semibold text-lg":"text-green-800 dark:text-green-200 font-semibold",b=o==="prominent"?l:s,{containerClass:v}=he();return t.jsx("div",{className:`bg-gradient-to-r from-green-100 to-blue-100 dark:from-green-900/20 dark:to-blue-900/20 ${g()} ${d}`,children:t.jsx("div",{className:`${v} py-4`,children:t.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[t.jsxs("div",{className:`flex items-center ${o==="prominent"?"text-center sm:text-left":""}`,children:[t.jsx("div",{className:"bg-green-500 text-white text-xs font-bold px-3 py-1 rounded-full mr-3 animate-pulse",children:b}),t.jsxs("div",{children:[t.jsx("span",{className:m(),children:e}),r&&t.jsx("span",{className:"text-green-700 dark:text-green-300 text-sm block",children:r})]})]}),t.jsxs("button",{onClick:i,className:y(),children:[c(),a,h()]})]})})})},g0=({children:e,onClick:r,variant:a,size:n,disabled:o,className:s,type:l,trackingLabel:i,actionType:d,componentName:c,onTrack:h,trackingParams:g={},...y})=>{const m=b=>{if(h){const v=i||(typeof e=="string"?e:"")||"Unknown Button",S=a&&["default","primary","secondary","outline","ghost","destructive","link"].includes(a)?a:"default";h({button_text:v,button_type:S,component_name:c,action_type:d,...g})}r&&r(b)};return t.jsx(ne,{...y,variant:a,size:n,disabled:o,className:s,type:l,onClick:m,children:e})},h0=({children:e,onClick:r,to:a,href:n,trackingLabel:o,componentName:s,onTrack:l,trackingParams:i={},LinkComponent:d,linkProps:c={},...h})=>{const g=m=>{if(l){const b=o||(typeof e=="string"?e:"")||"Unknown Link",v=a?typeof a=="string"?a:a.pathname||"":n||"";l({link_text:b,link_url:v,to_page:v,navigation_type:d?"router_link":"anchor_link",component_name:s,...i})}r&&r(m)};if(d&&a!==void 0)return t.jsx(d,{...c,to:a,onClick:g,...h,children:e});const y=a?typeof a=="string"?a:a.pathname||"#":n;return t.jsx("a",{...h,href:y,onClick:g,children:e})},Ka={en:{name:"English",flag:"🇺🇸"},ar:{name:"العربية",flag:"🇸🇦"},de:{name:"Deutsch",flag:"🇩🇪"},es:{name:"Español",flag:"🇪🇸"},fr:{name:"Français",flag:"🇫🇷"},it:{name:"Italiano",flag:"🇮🇹"},ja:{name:"日本語",flag:"🇯🇵"},ko:{name:"한국어",flag:"🇰🇷"},pt:{name:"Português",flag:"🇵🇹"},ru:{name:"Русский",flag:"🇷🇺"},sv:{name:"Svenska",flag:"🇸🇪"},th:{name:"ไทย",flag:"🇹🇭"},uk:{name:"Українська",flag:"🇺🇦"},vi:{name:"Tiếng Việt",flag:"🇻🇳"},zh:{name:"简体中文",flag:"🇨🇳"}},f0=({variant:e="compact",className:r=""})=>{const{i18n:a,t:n}=tr.useTranslation("languageSelector"),[o,s]=p.useState(a.language),l=p.useMemo(()=>a.options.supportedLngs?a.options.supportedLngs.filter(c=>c!=="cimode").map(c=>({code:c,name:Ka[c]?.name||c.toUpperCase(),flag:Ka[c]?.flag||"🌐"})).sort((c,h)=>c.name.localeCompare(h.name)):[],[a.options.supportedLngs]),i=l.find(c=>c.code===o||c.code.toLowerCase()===o.toLowerCase());p.useEffect(()=>{s(a.language)},[a.language]);const d=c=>{localStorage.setItem("language",c),a.changeLanguage(c).then(()=>{s(a.language),setTimeout(()=>{window.dispatchEvent(new Event("languagechange"))},100)}).catch(()=>{})};return e==="compact"?t.jsx("div",{className:`relative ${r}`,children:t.jsxs(qr,{value:o,onValueChange:d,children:[t.jsx(or,{className:"h-10 w-auto px-3 border-0 bg-transparent hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-0 focus:ring-offset-0",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-lg leading-none",children:i?.flag}),t.jsx("span",{className:"hidden sm:block text-sm font-medium text-gray-700 dark:text-gray-300",children:i?.name})]})}),t.jsx(sr,{children:l.map(c=>t.jsx(lr,{value:c.code,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-lg leading-none",children:c.flag}),t.jsx("span",{className:"text-sm",children:c.name})]})},c.code))})]})}):t.jsxs("div",{className:`space-y-2 ${r}`,children:[t.jsxs("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 flex items-center space-x-2",children:[t.jsx(M.LanguageIcon,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"}),t.jsx("span",{children:n("language","Language")})]}),t.jsxs(qr,{value:o,onValueChange:d,children:[t.jsx(or,{children:t.jsx(Aa,{placeholder:n("selectLanguage","Select language")})}),t.jsx(sr,{children:l.map(c=>t.jsx(lr,{value:c.code,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-lg leading-none",children:c.flag}),t.jsx("span",{children:c.name})]})},c.code))})]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:n("selectPreferredLanguage","Select your preferred language")})]})},b0=({items:e,type:r="ordered",variant:a="default",className:n,itemClassName:o})=>{const s=()=>{const c="space-y-2",h={ordered:r==="ordered"?"list-decimal":"",unordered:r==="unordered"?"list-disc":""},g={default:"list-inside",enhanced:"list-inside space-y-3",minimal:"list-none space-y-1"};return f(c,h[r],g[a])},l=c=>{const h="text-gray-600 dark:text-gray-400";return a==="enhanced"?f(h,"relative pl-8 pb-2 border-l-2 border-gray-200 dark:border-gray-700",c===e.length-1&&"border-l-transparent"):a==="minimal"?f(h,"flex items-start"):h},i=c=>a==="enhanced"&&r==="ordered"?t.jsx("div",{className:"absolute -left-4 -top-1 w-6 h-6 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-medium",children:c+1}):null,d=(c,h)=>{const g=typeof c=="object",y=g?c.content:c,m=g?c.subItems:void 0;return t.jsxs("li",{className:f(l(h),o),children:[i(h),a==="minimal"&&r==="ordered"&&t.jsx("span",{className:"inline-block w-6 h-6 bg-blue-100 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 rounded-full text-sm font-medium text-center leading-6 mr-3 flex-shrink-0",children:h+1}),a==="minimal"&&r==="unordered"&&t.jsx("span",{className:"inline-block w-2 h-2 bg-blue-600 rounded-full mt-2 mr-3 flex-shrink-0"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{children:y}),m&&m.length>0&&t.jsx("ul",{className:"mt-2 ml-4 space-y-1 list-disc list-inside text-sm text-gray-500 dark:text-gray-500",children:m.map((b,v)=>t.jsx("li",{children:b},v))})]})]},h)};return t.jsx("ul",{className:f(s(),n),children:e.map(d)})};class m0 extends p.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,a){console.error("ErrorBoundary caught an error:",r,a),this.props.onError?.(r,a)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsxs("div",{style:{padding:"20px",border:"1px solid red",margin:"10px"},children:[t.jsx("h2",{children:"Something went wrong"}),t.jsxs("p",{children:["Error: ",this.state.error?.message||"Unknown error"]}),t.jsx("button",{onClick:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}}class hr extends p.Component{constructor(r){super(r),this.retryTimer=null,this.sendErrorToMonitoring=(a,n)=>{try{typeof window<"u"&&window.Sentry&&window.Sentry?.captureException(a,{contexts:{react:{componentStack:n.componentStack}},tags:{errorBoundary:!0,componentName:this.props.componentName||"unknown",lazyLoading:!0}}),typeof window<"u"&&window.gtag&&window.gtag?.("event","exception",{description:a.message,fatal:!1,custom_map:{component:this.props.componentName||"unknown"}})}catch{}},this.handleRetry=()=>{const{maxRetries:a=3,retryDelay:n=1e3}=this.props,{retryCount:o}=this.state;if(o>=a)return;this.setState({isRetrying:!0}),this.retryTimer&&clearTimeout(this.retryTimer);const s=n*Math.pow(2,o);this.retryTimer=setTimeout(()=>{this.setState({hasError:!1,error:null,errorInfo:null,retryCount:o+1,isRetrying:!1})},s)},this.handleReload=()=>{window.location.reload()},this.state={hasError:!1,error:null,errorInfo:null,retryCount:0,isRetrying:!1,lastErrorTime:0}}static getDerivedStateFromError(r){return{hasError:!0,error:r,lastErrorTime:Date.now()}}componentDidCatch(r,a){const{onError:n,componentName:o}=this.props;this.setState({error:r,errorInfo:a}),console.error(`LazyErrorBoundary caught an error in ${o||"Unknown Component"}:`,r,a),n?.(r,a),this.sendErrorToMonitoring(r,a)}componentWillUnmount(){this.retryTimer&&clearTimeout(this.retryTimer)}render(){const{children:r,fallback:a,componentName:n,showRetryButton:o=!0,maxRetries:s=3}=this.props,{hasError:l,error:i,isRetrying:d,retryCount:c}=this.state;return l&&i?a||t.jsx("div",{className:"lazy-error-boundary error-boundary-container",children:t.jsxs("div",{className:"error-content",children:[t.jsx("div",{className:"error-icon",children:"⚠️"}),t.jsxs("h3",{className:"error-title",children:["Something went wrong loading ",n||"this component"]}),t.jsxs("div",{className:"error-details",children:[t.jsx("p",{className:"error-message",children:i.message}),process.env.NODE_ENV==="development"&&t.jsxs("details",{className:"error-stack",children:[t.jsx("summary",{children:"Error Details (Development)"}),t.jsx("pre",{children:i.stack})]})]}),t.jsxs("div",{className:"error-actions",children:[o&&c<s&&t.jsx("button",{onClick:this.handleRetry,disabled:d,className:"retry-button",children:d?"Retrying...":`Retry (${c}/${s})`}),c>=s&&t.jsx("button",{onClick:this.handleReload,className:"reload-button",children:"Reload Page"})]}),t.jsxs("div",{className:"error-help",children:[t.jsx("p",{children:"This might be a temporary issue. Try refreshing the page."}),navigator.onLine===!1&&t.jsx("p",{className:"offline-notice",children:"You appear to be offline. Check your connection and try again."})]})]})}):r}}function y0(e,r){const a=n=>t.jsx(hr,{...r,children:t.jsx(e,{...n})});return a.displayName=`withLazyErrorBoundary(${e.displayName||e.name})`,a}class p0 extends hr{static getDerivedStateFromError(r){return r.message.includes("Loading chunk")||r.message.includes("Loading CSS chunk")||r.message.includes("ChunkLoadError")||r.name==="ChunkLoadError"?{hasError:!0,error:new Error("Network error while loading component. Please check your connection and try again."),lastErrorTime:Date.now()}:super.getDerivedStateFromError(r)}}function v0(){const[e,r]=p.useState(0),a=p.useCallback(()=>{r(n=>n+1)},[]);return{errorRecoveryCount:e,triggerErrorRecovery:a}}function w0({children:e}){const r=(a,n)=>{console.error("Global lazy loading error:",a,n),typeof window<"u"&&window.Sentry&&window.Sentry?.captureException(a,{level:"error",tags:{globalErrorBoundary:!0,lazyLoading:!0}})};return t.jsx(hr,{onError:r,componentName:"Application",maxRetries:1,showRetryButton:!0,fallback:t.jsxs("div",{className:"global-error-fallback",children:[t.jsx("h1",{children:"Application Error"}),t.jsx("p",{children:"Something went wrong with the application. Please refresh the page."}),t.jsx("button",{onClick:()=>window.location.reload(),children:"Refresh Page"})]}),children:e})}const k0=({children:e})=>t.jsx(t.Fragment,{children:e}),x0=({children:e})=>t.jsx(t.Fragment,{children:e}),N0=(e,r,a)=>{const n=p.memo(e,r);return a&&(n.displayName=`Memo(${a})`),process.env.NODE_ENV==="development"?o=>(p.useMemo(()=>{let l=0;return()=>++l},[])(),t.jsx(n,{...o})):n},C0=(e,r)=>p.memo(e,(a,n)=>r.every(o=>a[o]===n[o])),S0=p.memo(({children:e,compute:r,deps:a})=>{const n=p.useRef(a),o=p.useRef(r),s=p.useRef(void 0),l=p.useMemo(()=>{const i=a.length!==n.current.length||a.some((c,h)=>c!==n.current[h]),d=r!==o.current;if(i||d||s.current===void 0){let c;return process.env.NODE_ENV==="development"?(performance.now(),c=r(),performance.now()):c=r(),n.current=a,o.current=r,s.current=c,c}return s.current},[r,a]);return t.jsx(t.Fragment,{children:e(l)})}),E0=p.memo(({item:e,index:r,style:a,renderItem:n})=>t.jsx("div",{style:a,children:n(e,r)}),(e,r)=>e.index===r.index&&e.item===r.item&&e.style.height===r.style.height&&e.style.top===r.style.top),T0=p.memo(({condition:e,children:r,fallback:a=null})=>e?t.jsx(t.Fragment,{children:r}):t.jsx(t.Fragment,{children:a})),A0=({children:e,threshold:r=.1,rootMargin:a="50px",fallback:n=null})=>{const[o,s]=p.useState(!1),l=p.useRef(null);return p.useEffect(()=>{const i=new IntersectionObserver(([d])=>{d.isIntersecting&&(s(!0),i.disconnect())},{threshold:r,rootMargin:a});return l.current&&i.observe(l.current),()=>i.disconnect()},[r,a]),t.jsx("div",{ref:l,children:o?e:n})},I0=({children:e,maxRenderTime:r=16,onSlowRender:a})=>{const n=p.useRef(0);return p.useLayoutEffect(()=>{n.current=performance.now()}),p.useEffect(()=>{const o=performance.now()-n.current;o>r&&a?.(o)}),t.jsx(t.Fragment,{children:e})},L0=({children:e,batchSize:r=5,delay:a=0})=>{const[n,o]=p.useState(r);return p.useEffect(()=>{if(n<e.length){const s=setTimeout(()=>{o(l=>Math.min(l+r,e.length))},a);return()=>clearTimeout(s)}},[n,e.length,r,a]),t.jsx(t.Fragment,{children:e.slice(0,n)})},M0=({src:e,alt:r,placeholder:a,lowQualitySrc:n,aspectRatio:o="16/9",eager:s=!1,className:l="",...i})=>{const[d,c]=p.useState(!1),[h,g]=p.useState(s),[y,m]=p.useState(!1),b=p.useRef(null),v=p.useRef(null);p.useEffect(()=>{if(s){g(!0);return}return v.current=new IntersectionObserver(k=>{k.forEach(x=>{x.isIntersecting&&(g(!0),v.current&&b.current&&v.current.unobserve(b.current))})},{rootMargin:"50px",threshold:.01}),b.current&&v.current.observe(b.current),()=>{v.current&&v.current.disconnect()}},[s]);const w=()=>{c(!0)},S=()=>{m(!0)};return t.jsxs("div",{className:`relative overflow-hidden ${l}`,style:{aspectRatio:o},children:[n&&!d&&t.jsx("img",{src:n,alt:"",className:"absolute inset-0 w-full h-full object-cover blur-sm","aria-hidden":"true"}),!n&&!d&&t.jsx("div",{className:"absolute inset-0 bg-gray-200 dark:bg-gray-700 animate-pulse","aria-hidden":"true"}),h&&!y&&t.jsx("img",{ref:b,src:e,alt:r,onLoad:w,onError:S,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-500 ${d?"opacity-100":"opacity-0"}`,loading:s?"eager":"lazy",...i}),y&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100 dark:bg-gray-800",children:t.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[t.jsx("svg",{className:"mx-auto h-12 w-12 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),t.jsx("p",{className:"text-sm",children:"Failed to load image"})]})})]})},P0=e=>/^[a-z]{2}(-[a-z]+)?$/.test(e);function O0({to:e,language:r,children:a,isLanguageSupported:n=P0,defaultLanguage:o="en",...s}){const{lang:l}=X.useParams(),i=l&&n(l)?l:o,d=r||i,c=e.startsWith(`/${d}`)?e:`/${d}${e.startsWith("/")?e:`/${e}`}`;return t.jsx(X.Link,{to:c,...s,children:a})}function U0({isLanguageSupported:e,defaultLanguage:r="en",storageKey:a="language",fallback:n=null}){const{lang:o}=X.useParams(),s=X.useNavigate(),{i18n:l}=tr.useTranslation();return p.useEffect(()=>{if(!o||!e(o)){s(`/${r}`,{replace:!0});return}l.language!==o&&l.changeLanguage(o);try{localStorage.setItem(a,o)}catch{}},[o,l,s,e,r,a]),!o||!e(o)?t.jsx(t.Fragment,{children:n}):t.jsx(X.Outlet,{})}function tt(e,r){const a=at(e);return`/${r}${a.startsWith("/")?a:`/${a}`}`}function at(e,r){const a=e.split("/").filter(Boolean);if(a.length>0){const n=a[0];if(/^[a-z]{2}(-[a-z]+)?$/.test(n)&&(!r||r(n)))return"/"+a.slice(1).join("/")}return e}function D0(e={}){const{isLanguageSupported:r=h=>/^[a-z]{2}(-[a-z]+)?$/.test(h),defaultLanguage:a="en",storageKey:n="language"}=e,o=X.useNavigate(),{lang:s}=X.useParams(),{i18n:l}=tr.useTranslation(),i=s&&r(s)?s:l.language||a,d=p.useCallback((h,g)=>{if(typeof h=="number"){o(h);return}const y=tt(h,i);o(y,g)},[o,i]),c=p.useCallback((h,g)=>{l.changeLanguage(h);const y=at(g||(typeof window<"u"?window.location.pathname:"/"),r),m=tt(y,h);o(m,{replace:!0});try{localStorage.setItem(n,h)}catch{}},[o,l,r,n]);return{navigate:d,switchLanguage:c,currentLanguage:i}}function j0(){return t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-theme-bg-primary",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})}function _0({children:e,isAuthenticated:r,isLoading:a=!1,redirectPath:n,loadingComponent:o,fallback:s=null}){const l=X.useNavigate(),{lang:i}=X.useParams();return p.useEffect(()=>{if(!a&&!r){const d=n?n.replace(":lang",i||"en"):`/${i||"en"}`;l(d,{replace:!0})}},[r,a,l,i,n]),a?t.jsx(t.Fragment,{children:o??t.jsx(j0,{})}):r?t.jsx(t.Fragment,{children:e}):t.jsx(t.Fragment,{children:s})}function z0(){return t.jsx("svg",{className:"w-8 h-8 text-red-600 dark:text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}function B0({spinning:e=!1}){return t.jsx("svg",{className:`w-4 h-4 ${e?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}function F0({title:e="Something went wrong",message:r="An unexpected error occurred. Please try again.",onRetry:a,isRetrying:n=!1,retryText:o="Retry",loadingText:s="Loading...",icon:l,className:i=""}){return t.jsx("div",{className:`flex flex-col items-center justify-center py-12 px-4 ${i}`,children:t.jsxs("div",{className:"flex flex-col items-center max-w-md text-center",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center mb-4",children:l??t.jsx(z0,{})}),t.jsx("h3",{className:"text-lg font-semibold text-theme-text-primary mb-2",children:e}),t.jsx("p",{className:"text-sm text-theme-text-secondary mb-6",children:r}),a&&t.jsxs("button",{onClick:a,disabled:n,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50",children:[t.jsx(B0,{spinning:n}),n?s:o]})]})})}var re=(e=>(e.LIGHT="light",e.DARK="dark",e.SYSTEM="system",e))(re||{}),nt=(e=>(e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e))(nt||{});const fr={getItem:e=>{try{return localStorage.getItem(e)}catch{return null}},setItem:(e,r)=>{try{localStorage.setItem(e,r)}catch{}}},ot=p.createContext(void 0);function W0(){const e=p.useContext(ot);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function $0({children:e,themeStorageKey:r="theme",fontSizeStorageKey:a="font-size",defaultTheme:n=re.LIGHT,defaultFontSize:o=nt.MEDIUM}){const[s,l]=p.useState(()=>fr.getItem(r)||n),[i,d]=p.useState(()=>fr.getItem(a)||o),[c,h]=p.useState(()=>s===re.SYSTEM?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?re.DARK:re.LIGHT:s),g=p.useCallback(b=>{l(b),fr.setItem(r,b)},[r]),y=p.useCallback(b=>{d(b),fr.setItem(a,b)},[a]);p.useEffect(()=>{const b=document.documentElement;let v=s;s===re.SYSTEM&&(v=window.matchMedia("(prefers-color-scheme: dark)").matches?re.DARK:re.LIGHT),h(v),b.classList.remove("light","dark"),b.classList.add(v),b.classList.remove("font-small","font-medium","font-large"),b.classList.add(`font-${i}`)},[s,i]),p.useEffect(()=>{if(s===re.SYSTEM){const b=window.matchMedia("(prefers-color-scheme: dark)"),v=w=>{const S=document.documentElement,k=w.matches?re.DARK:re.LIGHT;h(k),S.classList.remove("light","dark"),S.classList.add(k)};return b.addEventListener("change",v),()=>{b.removeEventListener("change",v)}}},[s]);const m=p.useMemo(()=>({theme:s,fontSize:i,setTheme:g,setFontSize:y,resolvedTheme:c}),[s,i,g,y,c]);return t.jsx(ot.Provider,{value:m,children:e})}const V0=({icon:e,title:r,description:a,benefits:n,metrics:o,color:s="blue",isHighlight:l=!1,learnMoreUrl:i,cta:d,onClick:c,interactive:h=!1,borderColor:g=!1,className:y})=>{const m={blue:"text-blue-600 dark:text-blue-400",green:"text-green-600 dark:text-green-400",purple:"text-purple-600 dark:text-purple-400",orange:"text-orange-600 dark:text-orange-400",pink:"text-pink-600 dark:text-pink-400",gray:"text-gray-600 dark:text-gray-400",red:"text-red-600 dark:text-red-400",indigo:"text-indigo-600 dark:text-indigo-400",cyan:"text-cyan-600 dark:text-cyan-400",emerald:"text-emerald-600 dark:text-emerald-400"},b={green:"border-l-4 border-green-500",blue:"border-l-4 border-blue-500",purple:"border-l-4 border-purple-500",orange:"border-l-4 border-orange-500",red:"border-l-4 border-red-500",indigo:"border-l-4 border-indigo-500",cyan:"border-l-4 border-cyan-500",emerald:"border-l-4 border-emerald-500",pink:"border-l-4 border-pink-500",gray:"border-l-4 border-gray-500"},v={green:"bg-green-100 dark:bg-green-900/20",blue:"bg-blue-100 dark:bg-blue-900/20",purple:"bg-purple-100 dark:bg-purple-900/20",orange:"bg-orange-100 dark:bg-orange-900/20",red:"bg-red-100 dark:bg-red-900/20",indigo:"bg-indigo-100 dark:bg-indigo-900/20",cyan:"bg-cyan-100 dark:bg-cyan-900/20",emerald:"bg-emerald-100 dark:bg-emerald-900/20",pink:"bg-pink-100 dark:bg-pink-900/20",gray:"bg-gray-100 dark:bg-gray-900/20"},w=m[s],S=typeof e=="string",k=()=>t.jsxs(t.Fragment,{children:[S?t.jsx("div",{className:"text-4xl mb-4",children:e}):g?t.jsx("div",{className:f("w-12 h-12","rounded-lg","flex items-center justify-center","mb-4",v[s],w),children:e}):t.jsx("div",{className:f("flex-shrink-0 mb-4",w),children:e}),t.jsxs("div",{className:"flex-1",children:[t.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:r}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:a}),d&&t.jsx("div",{className:"mt-3 mb-4",children:d}),n&&n.length>0&&t.jsx("ul",{className:"space-y-2 mb-4",children:n.map((E,A)=>t.jsxs("li",{className:"flex items-start",children:[t.jsx("div",{className:f("w-2 h-2 rounded-full mt-2 mr-3 flex-shrink-0",`bg-${s}-500`)}),t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:E})]},A))}),o&&Object.keys(o).length>0&&t.jsx("div",{className:"grid grid-cols-2 gap-4 mt-4",children:Object.entries(o).map(([E,A],C)=>t.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[t.jsx("div",{className:f("text-lg font-bold",w),children:A}),t.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:E})]},C))})]})]}),x=f("p-6 rounded-xl shadow-lg hover:shadow-xl transition-all duration-200",g&&b[s],(h||c)&&"cursor-pointer hover:scale-[1.02]",l?"bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border-blue-200 dark:border-blue-800 border":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 border",y),N=E=>{c&&("key"in E?(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),c()):c())};return i?t.jsx("a",{href:i,className:f(x,"block group"),onClick:c?E=>{E.preventDefault(),N(E)}:void 0,children:t.jsx(k,{})}):c?t.jsx("div",{className:x,onClick:N,onKeyDown:N,role:"button",tabIndex:0,"aria-label":r,children:t.jsx(k,{})}):t.jsx("div",{className:x,children:t.jsx(k,{})})},H0=Z.cva("grid gap-8",{variants:{columns:{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"},spacing:{sm:"gap-4",md:"gap-8",lg:"gap-12"}},defaultVariants:{columns:3,spacing:"md"}}),q0=Z.cva("group transition-all duration-300",{variants:{variant:{default:"text-center",left:"text-left",hoverable:"text-center hover:transform hover:scale-105 cursor-pointer",card:"bg-white dark:bg-gray-800 rounded-2xl p-8 shadow-lg hover:shadow-xl text-center",minimal:"text-center space-y-4"},animation:{none:"",hover:"hover:transform hover:scale-105",float:"hover:-translate-y-2"}},defaultVariants:{variant:"default",animation:"hover"}}),G0=Z.cva("flex items-center justify-center rounded-2xl mb-6 transition-all duration-300",{variants:{size:{sm:"w-16 h-16",md:"w-20 h-20",lg:"w-24 h-24"},style:{gradient:"bg-gradient-to-br from-blue-100 to-blue-200 dark:from-blue-900/30 dark:to-blue-800/30 group-hover:from-blue-200 group-hover:to-blue-300 dark:group-hover:from-blue-800/40 dark:group-hover:to-blue-700/40",solid:"bg-blue-100 dark:bg-blue-900/30 group-hover:bg-blue-200 dark:group-hover:bg-blue-800/40",outline:"border-2 border-blue-200 dark:border-blue-800 group-hover:border-blue-300 dark:group-hover:border-blue-700",colorful:"group-hover:scale-110"},position:{center:"mx-auto",left:"",right:"ml-auto"}},defaultVariants:{size:"md",style:"gradient",position:"center"}}),Y0={success:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",info:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",warning:"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",default:"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300"},K0=({className:e,features:r,columns:a=3,spacing:n="md",cardVariant:o="default",cardAnimation:s="hover",iconSize:l="md",iconStyle:i="gradient",iconPosition:d="center",titleClass:c,descriptionClass:h,animate:g=!0,animationDelay:y=0,staggerDelay:m=100,onFeatureClick:b,defaultLinkText:v="Learn more"})=>{const w=(k,x)=>{if(i==="colorful"&&k.gradient)return{background:`linear-gradient(135deg, ${k.gradient.from}, ${k.gradient.to})`};if(i==="colorful"){const N=[{from:"#3B82F6",to:"#1D4ED8"},{from:"#10B981",to:"#059669"},{from:"#8B5CF6",to:"#7C3AED"},{from:"#F59E0B",to:"#D97706"},{from:"#EF4444",to:"#DC2626"},{from:"#06B6D4",to:"#0891B2"}],E=N[x%N.length];return{background:`linear-gradient(135deg, ${E.from}, ${E.to})`}}},S=(k,x)=>{const N=t.jsxs("div",{className:f(q0({variant:o,animation:s})),onClick:()=>b?.(k),role:b?"button":void 0,tabIndex:b?0:void 0,children:[k.badge&&t.jsx("div",{className:"mb-4",children:t.jsx("span",{className:f("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",Y0[k.badge.variant||"default"]),children:k.badge.text})}),t.jsx("div",{className:f(G0({size:l,style:i,position:d})),style:w(k,x),children:t.jsx("div",{className:f("flex items-center justify-center",i==="colorful"?"text-white":"text-blue-600 dark:text-blue-400"),children:k.icon})}),t.jsx("h3",{className:f("text-xl font-bold text-gray-900 dark:text-white mb-4",c),children:k.title}),t.jsx("div",{className:f("text-gray-600 dark:text-gray-300 leading-relaxed",h),children:k.description}),k.link&&t.jsx("div",{className:"mt-6",children:t.jsxs("a",{href:k.link.href,className:"inline-flex items-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium transition-colors duration-200",children:[k.link.text||v,t.jsx("svg",{className:"w-4 h-4 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]});return t.jsx("div",{children:N},k.id||x)};return t.jsx("div",{className:f(H0({columns:a,spacing:n}),e),children:r.map(S)})},st=(e,r,a,n)=>({icon:e,title:r,description:a,...n}),Z0=e=>[st(t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),e?.passwordlessTitle||"Passwordless Security",e?.passwordlessDescription||"Authenticate using your Web3 wallet - no passwords to remember or lose."),st(t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.40A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),e?.encryptionTitle||"End-to-End Encryption",e?.encryptionDescription||"Your emails are encrypted and only you can read them.")],X0=({title:e,description:r,primaryButton:a,secondaryButton:n,gradient:o={from:"blue-600",to:"purple-600"},textColor:s="light",className:l="",size:i="lg"})=>{const{paddingClass:d}=he(),h=(()=>{const w=o.via?`${o.from}-${o.via}-${o.to}`:`${o.from}-${o.to}`;return{"blue-600-purple-600":"bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-700 dark:to-purple-700","orange-900-red-900":"bg-gradient-to-r from-orange-600 to-red-600 dark:from-orange-700 dark:to-red-700","green-600-blue-600":"bg-gradient-to-r from-green-600 to-blue-600 dark:from-green-700 dark:to-blue-700","purple-600-pink-600":"bg-gradient-to-r from-purple-600 to-pink-600 dark:from-purple-700 dark:to-pink-700"}[w]||"bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-700 dark:to-purple-700"})(),g=s==="light"?"text-white":"text-gray-900 dark:text-gray-100",y={sm:"py-12",md:"py-16",lg:"py-20"},m={sm:"text-2xl md:text-3xl",md:"text-3xl md:text-4xl",lg:"text-4xl md:text-5xl"},b={sm:"text-base md:text-lg",md:"text-lg md:text-xl",lg:"text-xl md:text-2xl"},v=(w,S=!1)=>{const k=()=>w.variant==="primary"||S?"gradient":(w.variant==="secondary","outline"),x=t.jsx(ne,{variant:k(),size:"lg",className:S?"":"bg-white/10 hover:bg-white/20 backdrop-blur-sm border-white/30",children:w.label});return w.external?t.jsx("a",{href:w.href,target:"_blank",rel:"noopener noreferrer",children:x}):t.jsx(X.Link,{to:w.href,children:x})};return t.jsxs("section",{className:`${h} ${y[i]} relative overflow-hidden ${l}`,children:[t.jsx("div",{className:"absolute inset-0 bg-black/20"}),t.jsxs("div",{className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-full h-full",children:[t.jsx("div",{className:"absolute top-10 left-10 w-72 h-72 bg-white/10 rounded-full blur-3xl"}),t.jsx("div",{className:"absolute bottom-10 right-10 w-72 h-72 bg-white/10 rounded-full blur-3xl"})]}),t.jsxs("div",{className:`relative z-10 max-w-4xl mx-auto ${d} text-center`,children:[t.jsx("h2",{className:`${m[i]} font-bold ${g} mb-6`,children:e}),t.jsx("p",{className:`${b[i]} ${g}/90 mb-8 max-w-2xl mx-auto`,children:r}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[v(a,!0),n&&v(n,!1)]})]})]})},Q0={pending:{label:"Pending",color:"bg-gray-500",textColor:"text-white"},in_progress:{label:"In Progress",color:"bg-blue-500",textColor:"text-white"},verified:{label:"Verified",color:"bg-green-500",textColor:"text-white"},rejected:{label:"Rejected",color:"bg-red-500",textColor:"text-white"}},J0={basic:"Basic KYC",enhanced:"Enhanced KYC",accredited:"Accredited Investor"},R0=({status:e,level:r,className:a=""})=>{const n=Q0[e],o=J0[r];return t.jsx("div",{className:`inline-flex items-center gap-2 ${a}`,children:t.jsxs("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${n.color} ${n.textColor}`,children:[o,": ",n.label]})})},eu=({accessToken:e,onComplete:r,onError:a,className:n=""})=>{const o=p.useRef(null),s=p.useRef(null);return p.useEffect(()=>{if(!e)return;const l=document.createElement("script");return l.src="https://static.sumsub.com/idensic/static/sns-websdk-builder.js",l.async=!0,l.onload=()=>{if(o.current&&window.snsWebSdk)try{const i=window.snsWebSdk.init(e,()=>e).withConf({lang:"en"}).withOptions({addViewportTag:!1,adaptIframeHeight:!0}).on("idCheck.onStepCompleted",d=>{}).on("idCheck.onApplicantSubmitted",d=>{r?.()}).on("idCheck.onError",d=>{console.error("SumsubWebSDK: Error",d),a?.(d)}).build();s.current=i,i.launch("#sumsub-websdk-container")}catch(i){console.error("Failed to initialize Sumsub SDK:",i),a?.(i)}else console.error("SumsubWebSDK: Missing requirements - containerRef:",!!o.current,"snsWebSdk:",!!window.snsWebSdk)},l.onerror=()=>{const i=new Error("Failed to load Sumsub Web SDK script");console.error(i),a?.(i)},document.body.appendChild(l),()=>{document.body.contains(l)&&document.body.removeChild(l),s.current&&typeof s.current.destroy=="function"&&s.current.destroy()}},[e,r,a]),t.jsx("div",{className:`sumsub-sdk-container ${n}`,children:t.jsx("div",{ref:o,id:"sumsub-websdk-container"})})},ru={basic:{title:"Basic KYC",description:"Age & Identity Verification",color:"border-blue-200",activeColor:"border-blue-500 bg-blue-50"},enhanced:{title:"Enhanced KYC",description:"Basic + Country & Compliance",color:"border-purple-200",activeColor:"border-purple-500 bg-purple-50"},accredited:{title:"Accredited Investor",description:"Enhanced + Financial Verification",color:"border-gold-200",activeColor:"border-gold-500 bg-gold-50"}},tu=({level:e,price:r,features:a,isActive:n=!1,isVerified:o=!1,onSelect:s,className:l=""})=>{const i=ru[e];return t.jsxs("div",{className:`
59
59
  relative border-2 rounded-lg p-6 transition-all
60
60
  ${n?i.activeColor:`${i.color} hover:border-gray-400`}
61
61
  ${l}
62
62
  `,children:[o&&t.jsx("div",{className:"absolute top-4 right-4",children:t.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"✓ Verified"})}),t.jsx("h3",{className:"text-xl font-bold mb-2",children:i.title}),t.jsx("p",{className:"text-gray-600 mb-4",children:i.description}),t.jsxs("p",{className:"text-3xl font-bold mb-4",children:[r,t.jsx("span",{className:"text-sm font-normal text-gray-600",children:"/year"})]}),t.jsx("ul",{className:"space-y-2 mb-6",children:a.map((d,c)=>t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("span",{className:"text-green-500 mt-0.5",children:"✓"}),t.jsx("span",{className:"text-sm",children:d})]},c))}),s&&t.jsx("button",{onClick:s,disabled:o,className:`
63
63
  w-full py-2 px-4 rounded font-medium transition-colors
64
64
  ${o?"bg-gray-200 text-gray-500 cursor-not-allowed":n?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-200 text-gray-700 hover:bg-gray-300"}
65
- `,children:o?"Verified":n?"Current Plan":"Select Plan"})]})},tu=({children:e,backgroundClassName:r="",contentClassName:a=""})=>t.jsx("div",{className:r,children:t.jsx("div",{className:a,children:e})}),au=({title:e,description:r})=>t.jsxs("div",{className:"mb-8",children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:e}),r&&t.jsx("p",{className:"mt-2 text-gray-600 dark:text-gray-400",children:r})]}),nu=({children:e,mode:r,className:a,as:n="div",withPadding:o=!0})=>{const s=he(),l=r?ou(r,o):o?s.containerClass:s.maxWidthClass;return t.jsx(n,{className:f(l,a),children:e})};function ou(e,r){const a={standard:"max-w-7xl mx-auto",wide:"max-w-[1920px] mx-auto",full:"w-full"};return r?`${a[e]} px-4`:a[e]}const su=({variant:e="full",sticky:r=!1,className:a,children:n})=>{const{containerClass:o}=he(),s=e==="compact";return t.jsx("footer",{className:f("bg-gray-900 text-white transition-all duration-300 ease-in-out",s?"py-4":"py-12",r?"sticky bottom-0 z-50 border-t border-gray-700":"relative z-10","pointer-events-auto",a),children:t.jsx("div",{className:o,children:n})})},lu=({children:e,className:r})=>t.jsx("div",{className:f("grid md:grid-cols-5 gap-8",r),children:e}),iu=({children:e,description:r,className:a})=>t.jsxs("div",{className:a,children:[t.jsx("div",{className:"mb-4",children:e}),r&&t.jsx("p",{className:O.body.sm(),children:r})]}),cu=({title:e,children:r,className:a})=>t.jsxs("div",{className:a,children:[t.jsx("h3",{className:f(O.heading.h5(),"mb-4 text-white"),children:e}),t.jsx("ul",{className:f("space-y-2",O.body.sm()),children:r})]}),du=({children:e,className:r})=>t.jsx("li",{className:f("hover:text-white transition-colors",r),children:e}),uu=({children:e,className:r})=>t.jsx("div",{className:f("border-t mt-8 pt-8 text-center space-y-4",xo.border.default,r),children:e}),gu=({children:e,className:r})=>p.Children.toArray(e).filter(Boolean).length===0?null:t.jsx("div",{className:f("flex items-center justify-center gap-3 text-gray-400 text-sm",r),children:e}),hu=({children:e,className:r})=>t.jsx("div",{className:f("flex flex-col sm:flex-row justify-between items-center space-y-2 sm:space-y-0",r),children:e}),fu=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-3 text-gray-400 text-sm",r),children:e}),bu=({children:e,className:r})=>t.jsx("div",{className:f("flex space-x-6 text-sm",r),children:e}),mu=({version:e,className:r})=>t.jsxs("span",{className:f("text-gray-500",r),children:["v",e]}),yu=({year:e,companyName:r,rightsText:a,companyLink:n,className:o})=>t.jsxs("span",{className:o,children:["© ",e," ",n||t.jsx("span",{className:"text-blue-400",children:r}),a&&`. ${a}`]}),Se=({href:e,label:r,children:a})=>t.jsx($a,{content:r,children:t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":r,children:a})}),pu=({twitterUrl:e,redditUrl:r,discordUrl:a,linkedinUrl:n,farcasterUrl:o,telegramUrl:s,githubUrl:l,className:i})=>e||r||a||n||o||s||l?t.jsxs("div",{className:f("flex items-center gap-4",i),children:[e&&t.jsx(Se,{href:e,label:"Twitter / X",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),r&&t.jsx(Se,{href:r,label:"Reddit",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})})}),a&&t.jsx(Se,{href:a,label:"Discord",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}),n&&t.jsx(Se,{href:n,label:"LinkedIn",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})}),o&&t.jsx(Se,{href:o,label:"Farcaster",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M18.24 2.4H5.76a3.36 3.36 0 0 0-3.36 3.36v12.48a3.36 3.36 0 0 0 3.36 3.36h12.48a3.36 3.36 0 0 0 3.36-3.36V5.76a3.36 3.36 0 0 0-3.36-3.36zm-2.16 13.2h-1.2v-4.8h-5.76v4.8H7.92V8.4h1.2v3.6h5.76V8.4h1.2v7.2z"})})}),s&&t.jsx(Se,{href:s,label:"Telegram",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})}),l&&t.jsx(Se,{href:l,label:"GitHub",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})})]}):null,vu=({isSelected:e,onClick:r,icon:a,label:n,description:o,className:s=""})=>t.jsxs("div",{onClick:r,className:`relative flex items-start p-4 cursor-pointer transition-all border-b border-gray-200 dark:border-gray-700 last:border-b-0 group ${s}`,children:[e&&t.jsx("div",{className:"absolute inset-1 bg-blue-500/10 dark:bg-blue-400/10 rounded-lg pointer-events-none"}),t.jsxs("div",{className:"relative z-10 flex items-start w-full",children:[a&&t.jsx(a,{className:`h-5 w-5 mt-0.5 mr-3 flex-shrink-0 transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:`font-medium transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-gray-100 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`,children:n}),o&&t.jsx("div",{className:`text-xs mt-0.5 transition-colors ${e?"text-blue-500 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}`,children:o})]})]})]}),wu=({masterTitle:e,masterSubtitle:r,backButtonText:a,masterContent:n,detailContent:o,detailTitle:s,mobileView:l="navigation",onBackToNavigation:i,masterClassName:d="",detailClassName:c="",detailTitleClassName:h="",masterWidth:g=320,stickyMaster:y=!0,stickyTopOffset:m=96,desktopGap:b=32,showMasterBackground:v=!0,enableAnimations:w=!0,animationDuration:S=300,animationRef:k})=>{const{containerClass:x}=he(),N=`gap-${Math.round(b/4)}`||"gap-8",E=$=>$?$.split("-")[0].trim():"Back",A=a?E(a):e?E(e):"Back",[C,I]=p.useState(!1),[L,P]=p.useState("auto"),U=p.useRef(null),j=p.useRef(null);p.useEffect(()=>(k&&(k.current={triggerTransition:$=>{if(!w){$();return}if(U.current){const R=U.current.scrollHeight;P(R)}I(!0),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{$(),setTimeout(()=>{if(U.current){const R=U.current.scrollHeight;P(R),setTimeout(()=>{P("auto"),I(!1)},S)}},50)},S/2)}}),()=>{j.current&&clearTimeout(j.current)}),[w,S,k]);const B=w?{height:L==="auto"?"auto":`${L}px`,transition:`height ${S}ms cubic-bezier(0.4, 0, 0.2, 1)`,width:"100%",maxWidth:"100%"}:{width:"100%",maxWidth:"100%"},D=w?`${C?"opacity-0 transform translate-y-2":"opacity-100 transform translate-y-0"}`:"",F=w?{transition:`opacity ${S}ms ease-in-out, transform ${S}ms ease-in-out`}:{};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`md:hidden ${l==="navigation"?"block":"hidden"} flex-1`,children:t.jsxs("div",{className:v?"bg-white dark:bg-gray-800 p-6":"p-6",children:[e&&t.jsxs("div",{className:x,children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r})]}),t.jsx("div",{className:d,children:n})]})}),t.jsxs("div",{className:`${x} py-8`,children:[t.jsxs("div",{className:`md:hidden ${l==="content"?"block":"hidden"}`,children:[l==="content"&&i&&t.jsxs("button",{onClick:i,className:"mb-4 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:["← ",A]}),t.jsx("div",{ref:U,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${c}`,style:B,children:t.jsxs("div",{className:D,style:F,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${h}`,children:s}),o]})})]}),t.jsxs("div",{className:`hidden md:flex min-h-full ${N}`,style:{width:"100%"},children:[t.jsx("aside",{className:"flex-shrink-0",style:{width:`${g}px`,minWidth:`${g}px`},children:t.jsxs("div",{className:y?"sticky":"",style:y?{top:`${m}px`}:void 0,children:[e&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r}),t.jsx("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${y?"max-h-[calc(100vh-200px)] overflow-y-auto":""} ${d}`,children:n})]})}),t.jsx("div",{className:"flex-1 min-w-0",style:{width:`calc(100% - ${g+b}px)`},children:t.jsx("div",{ref:U,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${c}`,style:B,children:t.jsxs("div",{className:D,style:F,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${h}`,children:s}),o]})})})]})]})]})},lt=p.createContext(null),Za=({children:e,variant:r="default",sticky:a=!0})=>{const[n,o]=p.useState(!1),s=p.useCallback(()=>{o(l=>!l)},[]);return t.jsx(lt.Provider,{value:{variant:r,sticky:a,mobileMenuOpen:n,setMobileMenuOpen:o,toggleMobileMenu:s},children:e})},it=()=>{const e=p.useContext(lt);if(!e)throw new Error("useTopbar must be used within a TopbarProvider");return e},Xa={sm:"min-h-12",md:"min-h-14",lg:"min-h-16"},ku={default:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",app:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 shadow-sm",minimal:"bg-transparent",transparent:"bg-white/80 dark:bg-gray-900/80 border-b border-gray-200/50 dark:border-gray-700/50"},xu={default:"z-40",high:"z-50",highest:"z-[60]"},Nu=({children:e,variant:r="default",sticky:a=!0,className:n,height:o="md",blur:s=!1,zIndex:l="high","aria-label":i="Main navigation"})=>{const{containerClass:d}=he();return t.jsx(Za,{variant:r,sticky:a,children:t.jsxs("header",{role:"banner","aria-label":i,className:f("w-full",Xa[o],ku[r],xu[l],a&&"sticky top-0",s&&"backdrop-blur-md","transition-colors duration-200",n),children:[t.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 bg-blue-600 text-white px-4 py-2 rounded-md z-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Skip to main content"}),t.jsx("div",{className:f(d,Xa[o],"flex flex-wrap items-center justify-between"),children:e})]})})},Cu=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),Su=({children:e,className:r})=>t.jsx("div",{className:f("flex-1 flex items-center justify-center px-4",r),children:e}),Eu=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),Tu=({children:e,className:r})=>t.jsx("div",{className:f("md:hidden w-full basis-full pt-2 pb-3",r),children:e}),Au=({className:e})=>t.jsx("div",{className:f("hidden md:block h-6 w-px bg-gray-200 dark:bg-gray-700 mx-2",e),role:"separator","aria-orientation":"vertical"}),Iu={sm:"h-6",md:"h-8",lg:"h-10"},Lu=({children:e,src:r,alt:a="Logo",onClick:n,href:o,className:s,size:l="md"})=>{const i=e||r&&t.jsx("img",{src:r,alt:a,className:f(Iu[l],"w-auto object-contain")}),d=f("flex items-center","hover:opacity-80 transition-opacity duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-md",s);return o?t.jsx("a",{href:o,className:d,title:a,children:i}):n?t.jsx("button",{type:"button",onClick:n,className:d,title:a,"aria-label":`Go to ${a||"home"}`,children:i}):t.jsx("div",{className:d,children:i})},Mu={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},Pu=({className:e,isOpen:r})=>t.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:r?t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),Qa=({icon:e,"aria-label":r="Toggle navigation menu",className:a,onClick:n,hideAbove:o="lg",menuItems:s,LinkComponent:l})=>{const{mobileMenuOpen:i,toggleMobileMenu:d,setMobileMenuOpen:c}=it(),[h,g]=p.useState(!1),y=p.useRef(null);ir(y,()=>{g(!1)});const m=s?h:i,b=()=>{n?n():s?g(!h):d()},v=()=>{g(!1),c(!1)};return t.jsxs("div",{className:f("relative",Mu[o]),ref:y,children:[t.jsx("button",{type:"button",onClick:b,className:f("p-2 rounded-lg","text-gray-600 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",a),"aria-label":r,"aria-expanded":m,"aria-haspopup":s?"menu":void 0,"aria-controls":s?"topbar-dropdown-menu":"mobile-menu",children:e?t.jsx(e,{className:"h-6 w-6"}):t.jsx(Pu,{className:"h-6 w-6",isOpen:m})}),s&&h&&t.jsx("div",{id:"topbar-dropdown-menu",role:"menu",className:f("absolute left-0 top-full mt-2","min-w-[200px] py-2 rounded-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","shadow-lg","z-50"),children:s.map(w=>{const S=w.icon,k=t.jsxs(t.Fragment,{children:[S&&t.jsx(S,{className:"h-5 w-5 mr-3 flex-shrink-0"}),t.jsx("span",{children:w.label})]}),x=f("flex items-center w-full px-4 py-2.5 text-sm font-medium","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","transition-colors duration-150",w.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400",w.disabled&&"opacity-50 cursor-not-allowed");return w.href&&l?t.jsx(l,{href:w.href,className:x,children:t.jsx("div",{className:"flex items-center",onClick:v,children:k})},w.id):w.href?t.jsx("a",{href:w.href,role:"menuitem",className:x,onClick:v,children:k},w.id):t.jsx("button",{type:"button",role:"menuitem",className:x,onClick:()=>{v(),w.onClick?.()},disabled:w.disabled,children:k},w.id)})})]})},Ou={sm:{show:"hidden sm:flex",hide:"sm:hidden"},md:{show:"hidden md:flex",hide:"md:hidden"},lg:{show:"hidden lg:flex",hide:"lg:hidden"},xl:{show:"hidden xl:flex",hide:"xl:hidden"}},Uu={left:"justify-start",center:"justify-center",right:"justify-end"},Ja=({items:e,className:r,collapseBelow:a="lg",LinkComponent:n,align:o="center"})=>{const[s,l]=p.useState(null),i=p.useRef(null);ir(i,()=>l(null));const d=(c,h=!1)=>{const g=c.children&&c.children.length>0,y=s===c.id,m=f("px-3 py-2 rounded-md text-sm font-medium","transition-colors duration-200",c.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700",c.disabled&&"opacity-50 cursor-not-allowed pointer-events-none",h&&"w-full text-left");return g?t.jsxs("div",{className:"relative",ref:i,children:[t.jsxs("button",{type:"button",onClick:()=>l(y?null:c.id),className:f(m,"flex items-center gap-1"),"aria-expanded":y,"aria-haspopup":"true",disabled:c.disabled,children:[c.icon&&t.jsx(c.icon,{className:"h-4 w-4 mr-1"}),c.label,t.jsx("svg",{className:f("h-4 w-4 transition-transform duration-200",y&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y&&t.jsx("div",{className:f("absolute top-full left-0 mt-1 py-1","min-w-[200px] rounded-md shadow-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","z-50"),children:c.children?.map(b=>t.jsx(ct,{item:b,LinkComponent:n,className:f("block px-4 py-2 text-sm","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700",b.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400"),onClick:()=>l(null)},b.id))})]},c.id):t.jsx(ct,{item:c,LinkComponent:n,className:m},c.id)};return t.jsx("nav",{className:f("flex items-center gap-1",Ou[a].show,Uu[o],r),"aria-label":"Main navigation",children:e.map(c=>d(c))})},ct=({item:e,LinkComponent:r,className:a,onClick:n})=>{const o=()=>{n?.(),e.onClick?.()},s=t.jsxs(t.Fragment,{children:[e.icon&&t.jsx(e.icon,{className:"h-4 w-4 mr-2"}),e.label]});return e.href&&r?t.jsx(r,{href:e.href,className:f(a,"flex items-center"),children:s}):e.href?t.jsx("a",{href:e.href,className:f(a,"flex items-center"),onClick:o,children:s}):t.jsx("button",{type:"button",onClick:o,className:f(a,"flex items-center"),disabled:e.disabled,children:s})},Du=({items:e,isOpen:r,className:a,LinkComponent:n})=>{const{mobileMenuOpen:o,setMobileMenuOpen:s}=it();return r??o?t.jsx("div",{id:"mobile-menu",className:f("lg:hidden","border-t border-gray-200 dark:border-gray-700","bg-white dark:bg-gray-900","shadow-lg",a),children:t.jsx("nav",{className:"px-4 py-2 space-y-1","aria-label":"Mobile navigation",children:e.map(i=>t.jsx(ct,{item:i,LinkComponent:n,className:f("flex items-center w-full px-3 py-2 rounded-md text-base font-medium","transition-colors duration-200",i.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700"),onClick:()=>s(!1)},i.id))})}):null},ju=({items:e,LinkComponent:r,collapseBelow:a="lg",align:n="center",className:o,mobileMenuLabel:s="Toggle navigation menu",children:l})=>t.jsxs(t.Fragment,{children:[t.jsx(Qa,{hideAbove:a,menuItems:e,LinkComponent:r,"aria-label":s,className:o}),l,t.jsx(Ja,{items:e,collapseBelow:a,LinkComponent:r,align:n,className:o})]}),_u={sm:"gap-1",md:"gap-2",lg:"gap-3"},zu={left:"justify-start",center:"justify-center",right:"justify-end"},Bu=({children:e,className:r,gap:a="md",align:n="right"})=>t.jsx("div",{className:f("flex items-center",_u[a],zu[n],r),children:e}),Fu={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},Wu={sm:"p-1.5",md:"p-2",lg:"p-2.5"},$u=({icon:e,onClick:r,"aria-label":a,className:n,disabled:o=!1,badge:s,size:l="md"})=>t.jsxs("button",{type:"button",onClick:r,className:f("relative rounded-lg",Wu[l],"text-gray-500 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-700 dark:hover:text-gray-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",o&&"opacity-50 cursor-not-allowed",n),"aria-label":a,disabled:o,children:[t.jsx(e,{className:Fu[l]}),s!==void 0&&s>0&&t.jsx("span",{className:f("absolute -top-1 -right-1","min-w-[18px] h-[18px] px-1","flex items-center justify-center","text-xs font-medium","bg-red-500 text-white rounded-full","ring-2 ring-white dark:ring-gray-900"),"aria-label":`${s} notifications`,children:s>99?"99+":s})]}),Vu={sm:"w-48",md:"w-64",lg:"w-96",full:"w-full"},Hu=({placeholder:e="Search...",value:r,onChange:a,onSubmit:n,className:o,width:s="md",showOnMobile:l=!1})=>{const[i,d]=p.useState(r||""),c=g=>{const y=g.target.value;d(y),a?.(y)},h=g=>{g.preventDefault(),n?.(i)};return t.jsx("form",{onSubmit:h,className:f(!l&&"hidden md:block",o),role:"search",children:t.jsxs("div",{className:"relative",children:[t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{type:"search",value:i,onChange:c,placeholder:e,"aria-label":e,className:f(Vu[s],"pl-10 pr-4 py-2","text-sm","bg-gray-100 dark:bg-gray-800","border border-transparent","rounded-lg","text-gray-900 dark:text-gray-100","placeholder:text-gray-500 dark:placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white dark:focus:bg-gray-700 focus:border-transparent","transition-colors duration-200")})]})})},qu=({title:e,description:r,keywords:a,canonical:n,ogType:o="website",ogImage:s,noIndex:l=!1,structuredData:i,twitterCard:d="summary_large_image",twitterSite:c,config:h,meta:g=[],links:y=[]})=>{const{appName:m,baseUrl:b,defaultDescription:v,defaultOgImage:w,defaultTwitterSite:S}=h,k=e?`${e} | ${m}`:m,x=r||v,N=s||w||`${b}/og-image.png`,E=c||S,A=n?`${b}${n}`:void 0,C=Array.isArray(a)?a.join(", "):a,I=i?Array.isArray(i)?i:[i]:[];return t.jsxs(Et.Helmet,{children:[t.jsx("title",{children:k}),t.jsx("meta",{name:"title",content:k}),x&&t.jsx("meta",{name:"description",content:x}),C&&t.jsx("meta",{name:"keywords",content:C}),l&&t.jsx("meta",{name:"robots",content:"noindex, nofollow"}),A&&t.jsx("link",{rel:"canonical",href:A}),t.jsx("meta",{property:"og:type",content:o}),A&&t.jsx("meta",{property:"og:url",content:A}),t.jsx("meta",{property:"og:title",content:k}),x&&t.jsx("meta",{property:"og:description",content:x}),t.jsx("meta",{property:"og:image",content:N}),t.jsx("meta",{property:"og:site_name",content:m}),t.jsx("meta",{name:"twitter:card",content:d}),E&&t.jsx("meta",{name:"twitter:site",content:E}),A&&t.jsx("meta",{name:"twitter:url",content:A}),t.jsx("meta",{name:"twitter:title",content:k}),x&&t.jsx("meta",{name:"twitter:description",content:x}),t.jsx("meta",{name:"twitter:image",content:N}),g.map((L,P)=>t.jsx("meta",{...L},P)),y.map((L,P)=>t.jsx("link",{...L},P)),I.map((L,P)=>t.jsx("script",{type:"application/ld+json",children:JSON.stringify(L)},P))]})},Gu=({contentType:e,aiSummary:r,technicalComplexity:a="intermediate"})=>t.jsxs(Et.Helmet,{children:[t.jsx("meta",{name:"ai:content-type",content:e}),t.jsx("meta",{name:"ai:summary",content:r}),t.jsx("meta",{name:"ai:complexity",content:a})]}),Yu=({children:e,className:r,...a})=>t.jsx("main",{className:r,...a,role:"main",children:e}),Ku=({children:e})=>t.jsx(t.Fragment,{children:e}),Oe=e=>Array.isArray(e)?e:typeof e=="string"?e.split(",").map(r=>r.trim()).filter(Boolean):[],Ee=e=>({appName:e.appName,baseUrl:e.baseUrl,twitterHandle:e.twitterHandle||"",emailDomain:e.emailDomain||"example.com"}),dt=e=>{const r=Oe(e.audience),a=Ee(e.branding);return{"@context":"https://schema.org","@type":"SoftwareApplication",name:a.appName,applicationCategory:"CommunicationApplication",operatingSystem:"Web Browser",description:e.description,url:a.baseUrl,downloadUrl:`${a.baseUrl}/connect`,installUrl:`${a.baseUrl}/connect`,screenshot:`${a.baseUrl}/screenshots/app-preview.jpg`,aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",reviewCount:"2500",bestRating:"5",worstRating:"1"},offers:[{"@type":"Offer",name:"Free Web3 Email",description:"Basic wallet-based email with unlimited sending",price:"0",priceCurrency:"USD",availability:"https://schema.org/InStock"},{"@type":"Offer",name:"Premium Web3 Email",description:"Advanced features with ENS/SNS domains and priority support",price:"2.00",priceCurrency:"USD",billingIncrement:"month",availability:"https://schema.org/InStock"}],featureList:["Passwordless wallet authentication","ENS domain email support (.eth)","Solana Name Service support (.sol)","Smart contract email integration","Multi-chain wallet compatibility","Cross-chain email addresses","DAO email delegation","Encrypted communication","Web2/Web3 bridge functionality","Point-based reward system"],applicationSubCategory:"Web3 Email Platform",audience:{"@type":"Audience",audienceType:r.join(", "),geographicArea:"Worldwide"},creator:{"@type":"Organization",name:a.appName,url:a.baseUrl},datePublished:"2024-01-01",dateModified:e.lastUpdated?.toISOString()||new Date().toISOString(),version:"1.0",softwareRequirements:"Web3 Wallet (MetaMask, Phantom, etc.)",storageRequirements:"5MB",memoryRequirements:"512MB RAM",supportingData:{blockchainNetworks:["Ethereum","Solana","Polygon","Arbitrum","Optimism"],supportedWallets:["MetaMask","Phantom","WalletConnect","Coinbase Wallet"],smartContractSupport:!0,ensCompatible:!0,snsCompatible:!0}}},ut=e=>{const r=Oe(e.keywords),a=Oe(e.audience),n=Ee(e.branding);return{"@context":"https://schema.org","@type":"TechnicalArticle",headline:e.title,description:e.description,author:{"@type":"Organization",name:n.appName,url:n.baseUrl,logo:{"@type":"ImageObject",url:`${n.baseUrl}/logo.png`}},publisher:{"@type":"Organization",name:n.appName,logo:{"@type":"ImageObject",url:`${n.baseUrl}/logo.png`,width:600,height:600}},datePublished:"2024-01-01T00:00:00Z",dateModified:e.lastUpdated?.toISOString()||new Date().toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":`${n.baseUrl}${location.pathname}`},image:{"@type":"ImageObject",url:`${n.baseUrl}/og-images/technical-guide.jpg`,width:1200,height:630},keywords:r.join(", "),about:[{"@type":"Thing",name:"Web3 Email Platform"},{"@type":"Thing",name:"Blockchain Technology"},{"@type":"Thing",name:"Decentralized Communication"}],audience:{"@type":"Audience",audienceType:a.join(", "),educationalLevel:e.complexity},educationalLevel:e.complexity,proficiencyLevel:e.complexity,learningResourceType:e.contentType,timeRequired:e.readingTime?`PT${e.readingTime}M`:"PT5M",inLanguage:"en",isAccessibleForFree:!0,license:"https://creativecommons.org/licenses/by/4.0/",teaches:e.relatedTopics||["Web3 email setup","Wallet connection process","Blockchain authentication","Smart contract integration"]}},Zu=(e,r)=>{const a=Ee(r);return{"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(n=>({"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:n.answer,dateCreated:new Date().toISOString(),upvoteCount:Math.floor(Math.random()*50)+10,author:{"@type":"Organization",name:a.appName}},answerCount:1,upvoteCount:Math.floor(Math.random()*100)+20,dateCreated:"2024-01-01T00:00:00Z",category:n.category||"General"}))}},gt=e=>{const r=Ee(e.branding);return{"@context":"https://schema.org","@type":"WebPage",name:e.title,description:e.description,url:`${r.baseUrl}${location.pathname}`,primaryImageOfPage:{"@type":"ImageObject",url:`${r.baseUrl}/og-images/ai-optimized.jpg`},significantLink:[`${r.baseUrl}/document`,`${r.baseUrl}/web3-users`,`${r.baseUrl}/web3-projects`,`${r.baseUrl}/connect`],relatedLink:e.relatedTopics?.map(a=>`${r.baseUrl}/search?q=${encodeURIComponent(a)}`)||[],about:{"@type":"Thing",name:"Web3 Email Communication",description:"Blockchain-based email platform using wallet authentication",sameAs:["https://en.wikipedia.org/wiki/Web3","https://en.wikipedia.org/wiki/Blockchain","https://en.wikipedia.org/wiki/Cryptocurrency_wallet"]},mentions:[{"@type":"SoftwareApplication",name:"MetaMask"},{"@type":"SoftwareApplication",name:"Phantom Wallet"},{"@type":"Thing",name:"Ethereum Name Service"},{"@type":"Thing",name:"Solana Name Service"}],isPartOf:{"@type":"WebSite","@id":r.baseUrl,name:r.appName},potentialAction:{"@type":"InteractAction",target:{"@type":"EntryPoint",urlTemplate:`${r.baseUrl}/connect`,actionPlatform:["https://schema.org/DesktopWebPlatform","https://schema.org/MobileWebPlatform"]},name:"Connect Web3 Wallet"}}},Ra=e=>{const r=Oe(e.keywords),a=Ee(e.branding);return{"og:title":e.title,"og:description":e.description,"og:type":"website","og:url":`${a.baseUrl}${location.pathname}`,"og:image":`${a.baseUrl}/og-images/${e.category}.jpg`,"og:image:width":"1200","og:image:height":"630","og:image:alt":`${e.title} - ${a.appName}`,"og:site_name":a.appName,"og:locale":"en_US","article:author":`${a.baseUrl}/about`,"article:section":e.category,"article:tag":r.join(","),"article:published_time":"2024-01-01T00:00:00Z","article:modified_time":e.lastUpdated?.toISOString()||new Date().toISOString()}},en=e=>{const r=Ee(e.branding);return{"twitter:card":"summary_large_image","twitter:site":r.twitterHandle||"","twitter:creator":r.twitterHandle||"","twitter:title":e.title,"twitter:description":e.description,"twitter:image":`${r.baseUrl}/twitter-cards/${e.category}.jpg`,"twitter:image:alt":`${e.title} - ${r.appName}`,"twitter:label1":"Category","twitter:data1":e.category,"twitter:label2":"Reading Time","twitter:data2":e.readingTime?`${e.readingTime} min`:"5 min"}},rn=e=>{const r=Oe(e.keywords),a=Oe(e.audience),n=Ee(e.branding);return{"ai:content-type":e.contentType,"ai:complexity":e.complexity,"ai:category":e.category,"ai:audience":a.join(","),"ai:keywords":r.join(","),"ai:reading-time":e.readingTime?.toString()||"5","web3:platform":"Email","web3:networks":"ethereum,solana,polygon","web3:wallets":"metamask,phantom,walletconnect","web3:features":"ens,sns,smart-contracts,multi-chain","llm:context":"Web3 email platform documentation and user guides","llm:domain":"blockchain,cryptocurrency,decentralized-communication","llm:use-case":"email,authentication,wallet-integration,smart-contracts","semantic:topic":e.category,"semantic:intent":"inform,guide,educate","semantic:entities":`${n.appName},Web3,blockchain,email,wallet`,"content:freshness":e.lastUpdated?.toISOString()||new Date().toISOString(),"content:authority":"high","content:expertise":"technical","content:trustworthiness":"verified"}},Xu=e=>({structuredData:{product:dt(e),article:ut(e),aiOptimized:gt(e)},openGraph:Ra(e),twitterCard:en(e),aiMetaTags:rn(e),jsonLD:[dt(e),ut(e),gt(e)]}),Qu={homepage:{title:"Revolutionary Web3 Email Platform | Wallet-Based Authentication",description:"Transform your email experience - the first Web3 email platform using wallet authentication. No passwords, enhanced security, ENS/SNS domain support, and smart contract integration.",keywords:["Web3 email","blockchain email","wallet authentication","ENS email","SNS email","decentralized email","smart contract integration"],category:"Web3 Platform",audience:["Crypto Users","Web3 Developers","DeFi Users","DAO Members"],complexity:"beginner",contentType:"overview",readingTime:3,relatedTopics:["Web3 authentication","Blockchain communication","Decentralized identity"]},documentation:{title:"Documentation - Complete Web3 Email Setup Guide",description:"Comprehensive documentation for Web3 email platform. Learn wallet connection, ENS/SNS setup, smart contract integration, and advanced features.",keywords:["Web3 email guide","wallet connection","ENS setup","SNS configuration","smart contract email","blockchain documentation"],category:"Technical Documentation",audience:["Developers","Technical Users","Web3 Enthusiasts"],complexity:"intermediate",contentType:"guide",readingTime:15,relatedTopics:["Wallet integration","Blockchain protocols","Email security"]},earnPoints:{title:"How to Earn Points - Web3 Email Rewards Guide",description:"Master the points system. Earn rewards through email activities, referrals, smart contract interactions, and prepare for future token distribution.",keywords:["Web3 rewards","email points","blockchain rewards","referral program","token preparation","crypto incentives"],category:"Rewards Guide",audience:["Token Farmers","Crypto Users","Web3 Users"],complexity:"beginner",contentType:"tutorial",readingTime:8,relatedTopics:["Token economics","Reward systems","Referral marketing"]}},Ju=e=>{const{level:r,text:a,className:n="",id:o,semanticContext:s="section"}=e,l=`h${r}`,i={1:"text-4xl md:text-5xl lg:text-6xl font-bold leading-tight",2:"text-3xl md:text-4xl font-bold leading-tight",3:"text-2xl md:text-3xl font-bold leading-tight",4:"text-xl md:text-2xl font-semibold leading-tight",5:"text-lg md:text-xl font-semibold leading-tight",6:"text-base md:text-lg font-medium leading-tight"},d={"page-title":"text-gray-900 dark:text-white mb-6",section:"text-gray-900 dark:text-white mb-4",subsection:"text-gray-900 dark:text-white mb-3",feature:"text-gray-900 dark:text-white mb-2",benefit:"text-blue-600 dark:text-blue-400 mb-2",step:"text-green-600 dark:text-green-400 mb-2"},c=[i[r],d[s],n].filter(Boolean).join(" "),h=o||a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");return p.createElement(l,{id:h,className:c,"aria-level":r},a)},oe={pageTitle:(e,r)=>({level:1,text:e,className:r,semanticContext:"page-title"}),majorSection:(e,r)=>({level:2,text:e,className:r,semanticContext:"section"}),feature:(e,r)=>({level:3,text:e,className:r,semanticContext:"feature"}),benefit:(e,r)=>({level:3,text:e,className:r,semanticContext:"benefit"}),step:(e,r,a)=>({level:3,text:r?`Step ${r}: ${e}`:e,className:a,semanticContext:"step"}),subFeature:(e,r)=>({level:4,text:e,className:r,semanticContext:"feature"})},Ru=e=>{const r=[],a=[],n=e.filter(o=>o.level===1).length;n===0?r.push("Missing H1 tag - every page should have exactly one H1"):n>1&&r.push(`Multiple H1 tags found (${n}) - use only one H1 per page`);for(let o=1;o<e.length;o++){const s=e[o],l=e[o-1];s.level>l.level+1&&r.push(`Heading level jump from H${l.level} to H${s.level} - avoid skipping levels`)}return e.forEach((o,s)=>{o.text.length<3&&r.push(`Heading ${s+1} is too short - use descriptive text`),o.text.length>70&&a.push(`Heading "${o.text.substring(0,30)}..." is long - consider shortening for better SEO`)}),{isValid:r.length===0,errors:r,suggestions:a}},eg={walletConnection:oe.pageTitle("Connect Your Web3 Wallet"),emailBenefits:oe.majorSection("Why Choose Web3 Email?"),securityFeature:oe.feature("Secure & Private"),ensIntegration:oe.feature("ENS Domain Support"),multiChain:oe.feature("Multi-Chain Compatibility"),passwordless:oe.benefit("No Passwords Required"),setupStep1:oe.step("Connect Your Wallet",1),setupStep2:oe.step("Verify Your Identity",2),setupStep3:oe.step("Access Your Emails",3)},rg=[{term:"Web3 Email",definition:"Email system that uses blockchain wallet addresses as authentication instead of traditional passwords",category:"Web3 Communication",synonyms:["blockchain email","decentralized email","crypto email"],relatedTerms:["wallet authentication","ENS email","SNS email"],examples:["vitalik.eth@example.com","alice.sol@example.com"],context:"Web3 email revolutionizes digital communication by eliminating passwords and using cryptographic signatures for authentication"},{term:"Wallet Authentication",definition:"Authentication method using cryptographic signatures from blockchain wallets instead of passwords",category:"Security",synonyms:["wallet-based auth","signature authentication","passwordless authentication"],relatedTerms:["EIP-712","SIWE","message signing"],examples:["MetaMask signature","Phantom wallet auth","WalletConnect login"],context:"Wallet authentication provides superior security through cryptographic proofs that cannot be phished or stolen like passwords"},{term:"ENS Email",definition:"Email addresses using Ethereum Name Service domains (.eth) as identifiers",category:"Naming Systems",synonyms:["Ethereum name email",".eth email"],relatedTerms:["ENS","Ethereum domains","blockchain domains"],examples:["vitalik.eth","ethereum.eth"],context:"ENS emails provide human-readable addresses that resolve to Ethereum wallet addresses"},{term:"SNS Email",definition:"Email addresses using Solana Name Service domains (.sol) as identifiers",category:"Naming Systems",synonyms:["Solana name email",".sol email"],relatedTerms:["SNS","Solana domains","SPL domains"],examples:["anatoly.sol","solana.sol"],context:"SNS emails provide human-readable addresses for Solana ecosystem users"},{term:"Smart Contract Integration",definition:"Ability to send and receive emails triggered by blockchain smart contract events",category:"Blockchain Integration",synonyms:["contract notifications","on-chain email triggers"],relatedTerms:["event listeners","webhooks","contract automation"],examples:["DAO proposal notifications","DeFi alert emails","NFT sale confirmations"],context:"Smart contract integration enables automated communication based on blockchain events"},{term:"Multi-Chain Support",definition:"Compatibility with multiple blockchain networks for wallet authentication and email services",category:"Interoperability",synonyms:["cross-chain support","blockchain agnostic"],relatedTerms:["EVM chains","Solana","Layer 2"],examples:["Ethereum, Polygon, Arbitrum, Solana support"],context:"Multi-chain support ensures users from any blockchain ecosystem can use the email service"},{term:"DAO Email Delegation",definition:"System allowing DAOs to manage email communications through delegated authorities",category:"Governance",synonyms:["governance email","multi-sig email"],relatedTerms:["DAO governance","multi-signature","delegation"],examples:["Treasury notifications","Proposal alerts","Voting reminders"],context:"DAO email delegation enables decentralized organizations to manage communications efficiently"},{term:"Web2/Web3 Bridge",definition:"Technology enabling communication between traditional email systems and blockchain-based email",category:"Interoperability",synonyms:["email bridge","legacy integration"],relatedTerms:["SMTP gateway","email forwarding","protocol bridge"],examples:["Gmail to Web3 email","Outlook integration"],context:"Web2/Web3 bridge ensures compatibility with existing email infrastructure"}],tg=e=>({"@context":"https://schema.org","@type":"LearningResource",educationalLevel:e.difficulty,learningResourceType:"Technical Documentation",timeRequired:e.estimatedTime?`PT${e.estimatedTime}M`:void 0,teaches:e.learningObjectives,requires:e.prerequisites,about:{"@type":"Thing",name:e.domain,category:e.category,subcategory:e.subcategory},keywords:e.concepts,applicationExample:e.practicalApplications,isRelatedTo:e.relatedConcepts}),ag=e=>{const r={nodes:e.map(a=>({id:a.term,label:a.term,category:a.category,definition:a.definition})),edges:[]};return e.forEach(a=>{a.relatedTerms?.forEach(n=>{e.find(s=>s.term===n)&&r.edges.push({source:a.term,target:n,relationship:"related_to"})}),a.synonyms?.forEach(n=>{r.edges.push({source:a.term,target:n,relationship:"synonym_of"})})}),r},ng=e=>{const r=[];return e.examples?.forEach(a=>{r.push({text:a,label:e.term,type:"positive",confidence:1})}),e.context&&r.push({text:e.context,label:e.term,type:"contextual",confidence:.8}),r.push({text:`${e.term} is ${e.definition}`,label:e.term,type:"definition",confidence:1}),r},og=e=>{const r=[];return e.forEach(a=>{r.push({question:`What is ${a.term}?`,answer:a.definition,category:a.category,difficulty:"basic"}),a.context&&r.push({question:`How does ${a.term} work?`,answer:a.context,category:a.category,difficulty:"intermediate"}),a.examples&&a.examples.length>0&&r.push({question:`What are examples of ${a.term}?`,answer:a.examples.join(", "),category:a.category,difficulty:"basic"}),a.relatedTerms&&a.relatedTerms.length>0&&r.push({question:`What is ${a.term} related to?`,answer:`${a.term} is related to ${a.relatedTerms.join(", ")}`,category:a.category,difficulty:"intermediate"})}),r},sg={homepage:{domain:"Web3 Email Platform",category:"Web3 Communication",concepts:["Web3 email","wallet authentication","passwordless login","blockchain messaging"],prerequisites:["Basic blockchain knowledge","Understanding of crypto wallets"],learningObjectives:["Understand Web3 email concepts","Learn wallet authentication","Explore blockchain communication"],difficulty:"beginner",estimatedTime:5,practicalApplications:["Secure email communication","DAO governance","DeFi notifications"]},documentation:{domain:"Web3 Email Technical Documentation",category:"Technical Guide",concepts:["API integration","smart contracts","wallet connection","email protocols"],prerequisites:["JavaScript/TypeScript","Web3 development basics","REST APIs"],learningObjectives:["Implement Web3 email","Integrate wallet authentication","Build on email API"],difficulty:"intermediate",estimatedTime:30,practicalApplications:["dApp integration","Email automation","Smart contract notifications"]},governance:{domain:"DAO Governance Communication",category:"Governance Tools",concepts:["DAO email","voting notifications","proposal tracking","multi-sig coordination"],prerequisites:["DAO basics","Governance understanding","Multi-signature wallets"],learningObjectives:["Setup DAO email","Configure voting alerts","Manage team communication"],difficulty:"advanced",estimatedTime:20,practicalApplications:["DAO operations","Treasury management","Governance participation"]}},lg=({children:e,appName:r,appUrl:a,apiUrl:n})=>(p.useEffect(()=>{const o=()=>{[].forEach(b=>{const v=document.createElement("link");v.rel="preload",v.href=b.href,v.as=b.as,b.type&&(v.type=b.type),b.crossorigin&&(v.crossOrigin=""),document.head.appendChild(v)})},s=()=>{document.querySelectorAll('img[data-priority="high"]').forEach(v=>{v.fetchPriority="high"});const b=document.querySelector("[data-hero]");if(b){const v=b.getAttribute("data-bg-image");if(v){const w=document.createElement("link");w.rel="preload",w.href=v,w.as="image",document.head.appendChild(w)}}},l=()=>{document.querySelectorAll("img:not([width]):not([height])").forEach(v=>{const w=v;w.naturalWidth&&w.naturalHeight&&(w.width=w.naturalWidth,w.height=w.naturalHeight)}),document.querySelectorAll("[data-dynamic]").forEach(v=>{v.getAttribute("style")?.includes("min-height")||(v.style.minHeight="200px")})},i=()=>{const m=()=>{document.querySelectorAll("script[data-defer]").forEach(w=>{w.setAttribute("defer","")})};"requestIdleCallback"in window?requestIdleCallback(()=>{m()}):setTimeout(m,1),(()=>{["scroll","touchstart","touchmove","wheel"].forEach(w=>{document.addEventListener(w,()=>{},{passive:!0})})})()},d=()=>{},c=()=>{[{rel:"dns-prefetch",href:"//fonts.googleapis.com"},...n?[{rel:"dns-prefetch",href:`//${n.replace(/^https?:\/\//,"")}`}]:[],{rel:"preconnect",href:"https://fonts.gstatic.com",crossorigin:!0},...n?[{rel:"preconnect",href:n}]:[]].forEach(b=>{const v=document.createElement("link");v.rel=b.rel,v.href=b.href,b.crossorigin&&(v.crossOrigin=""),document.head.appendChild(v)})},h=()=>{if(document.querySelectorAll("img[data-lazy]").forEach(b=>{b.loading="lazy"}),"IntersectionObserver"in window){const b=new IntersectionObserver(w=>{w.forEach(S=>{if(S.isIntersecting){const k=S.target;k.dataset.src&&(k.src=k.dataset.src,k.removeAttribute("data-src")),b.unobserve(k)}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(w=>b.observe(w))}},g=()=>{[{name:"ai-content-type",content:"web3-email-platform"},{name:"ai-primary-function",content:"wallet-based-email"},{name:"ai-supported-chains",content:"ethereum,solana,polygon,arbitrum,optimism"},{name:"ai-complexity-level",content:"beginner-to-advanced"},{name:"ai-target-users",content:"web3-users,crypto-enthusiasts,developers"},{name:"machine-readable",content:"true"},{name:"structured-data",content:"json-ld"},{name:"content-category",content:"technology,blockchain,communication"},{name:"interaction-model",content:"wallet-authentication"}].forEach(({name:w,content:S})=>{if(!document.querySelector(`meta[name="${w}"]`)){const k=document.createElement("meta");k.name=w,k.content=S,document.head.appendChild(k)}});const b={"@context":"https://schema.org","@type":"WebApplication",name:r,description:"Web3 email platform using blockchain wallet authentication",url:a,applicationCategory:"CommunicationApplication",operatingSystem:"Web Browser",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},featureList:["Wallet-based authentication","ENS domain email support","SNS domain email support","Multi-chain compatibility","Smart contract integration","Web2/Web3 bridge"],audience:{"@type":"Audience",audienceType:"Web3 Users"}},v=document.createElement("script");v.type="application/ld+json",v.textContent=JSON.stringify(b),document.head.appendChild(v)},y=()=>{document.querySelectorAll('link[rel="stylesheet"][data-non-critical]').forEach(b=>{const v=b.cloneNode(!0);v.rel="preload",v.as="style",v.onload=()=>{v.onload=null,v.rel="stylesheet"},document.head.appendChild(v),b.remove()})};return o(),s(),l(),i(),c(),h(),g(),y(),setTimeout(d,2e3),()=>{}},[n,r,a]),t.jsx(t.Fragment,{children:e})),ig=()=>(p.useEffect(()=>{if(typeof window>"u"||typeof document>"u"||!document.documentElement)return;const e=()=>{if("IntersectionObserver"in window){const i=new IntersectionObserver(d=>{d.forEach(c=>{if(c.isIntersecting){const h=c.target;h.dataset.src&&(h.src=h.dataset.src,h.removeAttribute("data-src"),i.unobserve(h))}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(d=>{i.observe(d)})}const o=()=>{["/connect","/mail","/settings"].forEach(d=>{const c=document.createElement("link");c.rel="prefetch",c.href=d,document.head.appendChild(c)})},s=()=>{if(!document.querySelector("script[data-wallet-detection]")){const i=document.createElement("script");i.dataset.walletDetection="true",i.innerHTML='(function() { window.walletPreload = { hasMetaMask: typeof window.ethereum !== "undefined", hasPhantom: typeof window.solana !== "undefined", hasWalletConnect: true }; })();',document.head.appendChild(i)}},l=()=>{document.querySelectorAll("img[data-hero]").forEach(i=>{const d=i;d.loading="eager","fetchPriority"in d&&(d.fetchPriority="high")}),document.querySelectorAll('img[data-priority="low"]').forEach(i=>{const d=i;d.loading="lazy","fetchPriority"in d&&(d.fetchPriority="low")})};requestIdleCallback(()=>{o(),s(),l()},{timeout:2e3})},r=()=>{if("PerformanceObserver"in window){const o=new PerformanceObserver(l=>{const i=l.getEntries(),d=i[i.length-1];d&&d.startTime>2500&&(document.documentElement.style.setProperty("--animation-duration","0s"),localStorage.setItem("reduce-image-quality","true"))});try{o.observe({entryTypes:["largest-contentful-paint"]})}catch{}const s=new PerformanceObserver(l=>{let i=0;for(const d of l.getEntries())d.hadRecentInput||(i+=d.value);i>.1&&document.querySelectorAll("img:not([width]):not([height])").forEach(d=>{const c=d;c.style.aspectRatio="16/9"})});try{s.observe({entryTypes:["layout-shift"]})}catch{}}},a=()=>{if("connection"in navigator&&typeof document<"u"&&document.documentElement){const o=navigator.connection;if(o){const s=o.effectiveType;s==="slow-2g"||s==="2g"?(document.documentElement.classList.add("slow-connection"),document.querySelectorAll('link[rel="prefetch"]').forEach(l=>{l.getAttribute("data-critical")||l.remove()}),localStorage.setItem("use-low-quality-images","true")):s==="3g"?document.documentElement.classList.add("moderate-connection"):document.documentElement.classList.add("fast-connection")}}};return(()=>{e(),r(),a()})(),()=>{if("PerformanceObserver"in window)try{PerformanceObserver.supportedEntryTypes.forEach(()=>{})}catch{}}},[]),null),cg=({children:e})=>t.jsx(t.Fragment,{children:e}),tn={user:{duration:300*1e3,maxSize:100,staleWhileRevalidate:!0},mailboxes:{duration:120*1e3,maxSize:50,staleWhileRevalidate:!0},addresses:{duration:600*1e3,maxSize:50,staleWhileRevalidate:!0},messages:{duration:30*1e3,maxSize:200,staleWhileRevalidate:!0},messageDetails:{duration:120*1e3,maxSize:100,staleWhileRevalidate:!1},messageCount:{duration:10*1e3,maxSize:20,staleWhileRevalidate:!0}};class dg{constructor(){this.cache=new Map}set(r,a,n){if(this.cache.size>=n.maxSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}this.cache.set(r,{data:a,timestamp:Date.now(),isStale:!1})}get(r,a){const n=this.cache.get(r);if(!n)return null;const s=Date.now()-n.timestamp>a.duration;return s&&!a.staleWhileRevalidate?(this.cache.delete(r),null):{data:n.data,isStale:s}}invalidate(r){for(const a of this.cache.keys())a.includes(r)&&this.cache.delete(a)}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,keys:Array.from(this.cache.keys()),memory:this.estimateMemoryUsage()}}estimateMemoryUsage(){return Array.from(this.cache.values()).reduce((r,a)=>r+JSON.stringify(a).length*2,0)}}const Ue=new dg,Te=new Map,an=async(e,r,a="messages")=>{const n=tn[a],o=Ue.get(e,n);if(o&&!o.isStale)return o.data;const s=Te.get(e);if(s)return s;if(o&&o.isStale&&n.staleWhileRevalidate){const i=r().then(d=>(Ue.set(e,d,n),Te.delete(e),d)).catch(d=>{throw Te.delete(e),d});return Te.set(e,i),o.data}const l=r().then(i=>(Ue.set(e,i,n),Te.delete(e),i)).catch(i=>{throw Te.delete(e),i});return Te.set(e,l),l};class ug{constructor(){this.queue=[],this.timer=null,this.batchDelay=10}add(r,a){return new Promise((n,o)=>{this.queue.push({key:r,fetcher:a,resolve:n,reject:o}),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.processBatch()},this.batchDelay)})}async processBatch(){const r=[...this.queue];this.queue.length=0,this.timer=null;const a=this.groupRequests(r);for(const n of a)await Promise.allSettled(n.map(async o=>{try{const s=await o.fetcher();o.resolve(s)}catch(s){o.reject(s)}}))}groupRequests(r){const a=[];for(let o=0;o<r.length;o+=5)a.push(r.slice(o,o+5));return a}}const gg=new ug;class hg{constructor(r,a={}){this.requestInterceptors=[],this.responseInterceptors=[],this.baseURL=r,this.defaultHeaders=a}addRequestInterceptor(r){this.requestInterceptors.push(r)}addResponseInterceptor(r){this.responseInterceptors.push(r)}async request(r,a={},n,o="messages"){const s=`${this.baseURL}${r}`,l=n||`${a.method||"GET"}:${s}`,i=async()=>{let d={...a,headers:{...this.defaultHeaders,...a.headers}};for(const h of this.requestInterceptors)d=h(d);let c=await fetch(s,d);for(const h of this.responseInterceptors)c=await h(c);if(!c.ok)throw new Error(`API Error: ${c.status} ${c.statusText}`);return c.json()};return a.method==="GET"&&this.shouldBatch(r)?gg.add(l,i):an(l,i,o)}shouldBatch(r){return r.includes("/messages/")&&!r.includes("/messages?")}async get(r,a){return this.request(r,{method:"GET"},void 0,a)}async post(r,a){return this.request(r,{method:"POST",body:JSON.stringify(a)})}async put(r,a){return this.request(r,{method:"PUT",body:JSON.stringify(a)})}async delete(r){return this.request(r,{method:"DELETE"})}}const fg=async(e,r=3,a=1e3)=>{let n;for(let o=0;o<=r;o++)try{return await e()}catch(s){if(n=s,o===r)throw n;const l=a*Math.pow(2,o)+Math.random()*1e3;await new Promise(i=>setTimeout(i,l))}throw n};class bg{constructor(){this.abortController=new AbortController}async request(r,a={}){const n=await fetch(r,{...a,signal:this.abortController.signal});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);return n.json()}cancel(){this.abortController.abort()}}const mg={invalidate:e=>Ue.invalidate(e),clear:()=>Ue.clear(),getStats:()=>Ue.getStats(),warmUp:async e=>{await Promise.allSettled(e.map(r=>r()))},prefetch:async e=>{"requestIdleCallback"in window?window.requestIdleCallback(async()=>{await Promise.allSettled(e.map(r=>r()))}):setTimeout(async()=>{await Promise.allSettled(e.map(r=>r()))},100)}};function nn(){if(typeof window>"u")return!1;const e=window.navigator.userAgent.toLowerCase();return["metamask","trustwallet","coinbase","rainbow","phantom","solflare","exodus","ledger","binance","okx"].some(a=>e.includes(a))}function on(){return typeof window>"u"?!1:window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"}function sn(){if(typeof window>"u")return!1;const e=window.location.hostname;return/^\d+\.\d+\.\d+\.\d+$/.test(e)}function ln(){return on()?"localhost":nn()?"wallet-browser":sn()?"network":"production"}function yg(){const e=ln();return e==="localhost"||e==="wallet-browser"}function pg(e){}function cn(){return typeof window<"u"}function vg(){return typeof window<"u"}function wg(e,r){if(cn())e();else return r}const ht=e=>({"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'","'unsafe-eval'","https://fonts.googleapis.com","https://www.googletagmanager.com","https://www.google-analytics.com"],"style-src":["'self'","'unsafe-inline'","https://fonts.googleapis.com","https://fonts.gstatic.com"],"font-src":["'self'","https://fonts.gstatic.com","data:"],"img-src":["'self'","data:","https:","blob:"],"connect-src":["'self'",...e?.apiUrls||[],...e?.appUrls||[],"https://*.walletconnect.com","https://*.walletconnect.org","https://registry.walletconnect.com","https://relay.walletconnect.com","wss://*.walletconnect.com","wss://*.walletconnect.org","https://keys.coinbase.com","https://api.coinbase.com","https://www.walletlink.org","https://mainnet.infura.io","https://polygon-rpc.com","https://rpc.ankr.com","https://cloudflare-eth.com","https://eth-mainnet.alchemyapi.io","https://api.phantom.app","https://solana-api.projectserum.com","https://api.mainnet-beta.solana.com","https://api.devnet.solana.com","wss://api.phantom.app","wss://api.devnet.solana.com","wss://api.mainnet-beta.solana.com","https://bridge.arbitrum.io","https://polygon-mainnet.infura.io","https://optimism-mainnet.infura.io"],"frame-src":["'self'","https://verify.walletconnect.com","https://verify.walletconnect.org"],"worker-src":["'self'","blob:"],"child-src":["'self'","https://verify.walletconnect.com"],"object-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"]}),kg=ht(),dn=e=>{const r=ht(e);return Object.entries(r).map(([a,n])=>`${a} ${n.join(" ")}`).join("; ")},un=e=>({"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin","Permissions-Policy":"camera=(), microphone=(), geolocation=(), interest-cohort=()","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","Cross-Origin-Embedder-Policy":"credentialless","Cross-Origin-Opener-Policy":"same-origin-allow-popups","Cross-Origin-Resource-Policy":"cross-origin","Content-Security-Policy":dn(e)}),xg=un(),Ng={fonts:"public, max-age=31536000, immutable",images:"public, max-age=31536000, immutable",js:"public, max-age=31536000, immutable",css:"public, max-age=31536000, immutable",serviceWorker:"public, max-age=0, must-revalidate",manifest:"public, max-age=86400",api:"no-cache, no-store, must-revalidate"},Cg=()=>{typeof window<"u"&&document.addEventListener("securitypolicyviolation",()=>{})},Sg={walletConnections:"Always verify wallet signatures and never trust client-side data",rpcEndpoints:"Use reputable RPC providers and consider rate limiting",contractInteractions:"Validate all smart contract interactions on the backend",userInput:"Sanitize all user inputs, especially wallet addresses and transaction data",privateKeys:"Never log, store, or transmit private keys - they should remain in wallets only",phishing:"Implement strict CSP to prevent injection of malicious scripts that could steal wallet access"},de=new Map,Ge=new Map,br=new Set;let Ye="medium",ft=!1;function Eg(){if("connection"in navigator){const a=navigator.connection;a&&(Ye=a.effectiveType==="4g"?"fast":a.effectiveType==="3g"?"medium":"slow")}const e=navigator.deviceMemory,r=navigator.hardwareConcurrency;ft=e&&e<4||r&&r<4}Eg();function Tg(e,r,a={}){const{retries:n=3,timeout:o=1e4,fallback:s,preloadCondition:l,cacheStrategy:i="memory",priority:d="medium",onLoad:c,onError:h}=a;if(de.has(r))return de.get(r).component;const g=p.lazy(async()=>{const m=performance.now();if(Ge.has(r))return Ge.get(r).then(v=>({default:v}));const b=Ag(e,n,o);Ge.set(r,b.then(v=>v.default));try{const v=await b,w=performance.now()-m;if(i!=="none"){const S={component:v.default,timestamp:Date.now(),loadTime:w};if(de.set(r,S),i==="session")try{sessionStorage.setItem(`lazy_${r}`,JSON.stringify({timestamp:S.timestamp,loadTime:w}))}catch{}}return Ge.delete(r),c?.(v.default),v}catch(v){throw Ge.delete(r),h?.(v),v}}),y=m=>{const[b,v]=p.useState(!0);p.useEffect(()=>{if(l&&!de.has(r)&&l()&&!br.has(r)){br.add(r);const k=Ig(d,Ye);setTimeout(()=>{e().catch(()=>{})},k)}},[]);const w=s||t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsxs("span",{className:"ml-2 text-sm text-gray-600",children:["Loading ",r.replace(/([A-Z])/g," $1").trim(),"..."]})]});return!b&&ft&&Ye==="slow"?t.jsx("div",{className:"lazy-placeholder",children:t.jsxs("button",{onClick:()=>v(!0),className:"load-component-btn",children:["Load ",r]})}):t.jsx(p.Suspense,{fallback:w,children:t.jsx(g,{...m})})};return y.displayName=`AdvancedLazy(${r})`,y}async function Ag(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((i,d)=>{setTimeout(()=>d(new Error("Load timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const l=Math.pow(2,o)*1e3,i=Math.random()*1e3;await new Promise(d=>setTimeout(d,l+i))}}throw n}function Ig(e,r){const a={critical:0,high:500,medium:2e3,low:5e3},n={fast:.5,medium:1,slow:2},o=a[e]||2e3,s=n[r]||1;return o*s}const Re=class Re{static registerRoute(r,a){this.routeMap.set(r,a),this.routeUsageStats.set(r,0)}static setCurrentRoute(r){this.currentRoute=r;const a=this.routeUsageStats.get(r)||0;this.routeUsageStats.set(r,a+1),this.preloadLikelyRoutes(r)}static preloadLikelyRoutes(r){this.getRouteTransitionProbability(r).forEach(({route:n,probability:o})=>{o>.3&&!de.has(n)&&setTimeout(()=>{this.routeMap.get(n)},Ye==="fast"?1e3:3e3)})}static getRouteTransitionProbability(r){const a=[];switch(r){case"/":a.push({route:"/connect",probability:.7},{route:"/about",probability:.2},{route:"/document",probability:.1});break;case"/connect":a.push({route:"/mail",probability:.8},{route:"/settings",probability:.1});break;case"/mail":a.push({route:"/compose",probability:.4},{route:"/settings",probability:.2});break;default:a.push({route:"/",probability:.1})}return a}static getStats(){return{routeCount:this.routeMap.size,cacheSize:de.size,currentRoute:this.currentRoute,usageStats:Object.fromEntries(this.routeUsageStats)}}};Re.routeMap=new Map,Re.routeUsageStats=new Map,Re.currentRoute="";let bt=Re;const Lg=({src:e,alt:r,className:a,placeholder:n,priority:o="medium"})=>{const[s,l]=p.useState(!1),[i,d]=p.useState(!1),c=p.useRef(null);p.useEffect(()=>{if(!c.current)return;if(o==="high"){d(!0);return}const g=new IntersectionObserver(([y])=>{y.isIntersecting&&(d(!0),g.unobserve(y.target))},{rootMargin:o==="low"?"100px":"200px",threshold:.1});return g.observe(c.current),()=>g.disconnect()},[o]);const h=()=>{l(!0)};return t.jsxs("div",{className:`lazy-image-container ${a}`,children:[t.jsx("img",{ref:c,src:i?e:n||"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB2aWV3Qm94PSIwIDAgMSAxIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNGM0Y0RjYiLz48L3N2Zz4=",alt:r,className:`transition-opacity duration-300 ${s?"opacity-100":"opacity-0"}`,onLoad:h,loading:o==="high"?"eager":"lazy",fetchPriority:o==="high"?"high":"low"}),!s&&i&&t.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse rounded"})]})};function Mg(){de.clear(),br.clear()}function Pg(){return{cachedComponents:de.size,preloadQueue:br.size,networkSpeed:Ye,isLowEndDevice:ft,cacheEntries:Array.from(de.entries()).map(([e,r])=>({name:e,loadTime:r.loadTime,age:Date.now()-r.timestamp}))}}const Og=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),Ug=e=>{if(typeof e=="function"||typeof e=="object")return e;switch(e){case"minimal":return()=>t.jsx("div",{className:"flex justify-center items-center p-4",children:"Loading..."});case"skeleton":return()=>t.jsxs("div",{className:"animate-pulse",children:[t.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),t.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]});case"default":default:return()=>t.jsx(Og,{message:"Loading component..."})}},gn=(e,r="default",a=3)=>{const n=p.lazy(async()=>{let s=null;for(let l=0;l<a;l++)try{return await e()}catch(i){s=i,l<a-1&&await new Promise(d=>setTimeout(d,Math.pow(2,l)*1e3))}throw s}),o=Ug(r);return s=>t.jsx(p.Suspense,{fallback:t.jsx(o,{}),children:t.jsx(n,{...s})})},Dg=async e=>{try{await e()}catch{}},jg=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=gn(n,"skeleton")}),r},_g=e=>e,hn={critical:["/","/connect","/mail"],secondary:["/settings","/compose","/points"],optional:["/document","/about","/terms","/privacy"]},er=class er{static add(r,a){this.preloadedComponents.has(r)||(this.preloadQueue.push({name:r,loader:a}),this.processQueue())}static async processQueue(){this.isPreloading||this.preloadQueue.length===0||(this.isPreloading=!0,"requestIdleCallback"in window?window.requestIdleCallback(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()}):setTimeout(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()},100))}static isPreloaded(r){return this.preloadedComponents.has(r)}static clear(){this.preloadedComponents.clear(),this.preloadQueue=[],this.isPreloading=!1}};er.preloadedComponents=new Set,er.preloadQueue=[],er.isPreloading=!1;let mt=er;const zg=()=>{"requestIdleCallback"in window&&window.requestIdleCallback(()=>{hn.secondary.forEach(e=>{})})},fn=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),Ke=new Map;function Bg(e,r){const{condition:a,fallback:n,retries:o=3,timeout:s=1e4,priority:l="medium",cacheKey:i=`conditional-${Math.random()}`}=r,d=c=>{const[h,g]=p.useState(!1),[y,m]=p.useState(null);return p.useEffect(()=>{const w=setTimeout(async()=>{const S=Ke.get(i);if(S&&S.isValid&&Date.now()-S.lastCheck<3e5)try{if(await S.condition()){m(()=>S.component),g(!0);return}}catch{}try{if(await a()){const x=await $g(e,o,s);Ke.set(i,{component:x.default,condition:a,lastCheck:Date.now(),isValid:!0}),m(()=>x.default),g(!0)}}catch{}},l==="high"?0:l==="medium"?100:500);return()=>clearTimeout(w)},[]),h?y?t.jsx(p.Suspense,{fallback:n||t.jsx(fn,{message:"Loading component..."}),children:t.jsx(y,{...c})}):null:n||t.jsx(fn,{message:"Checking conditions..."})};return d.displayName=`ConditionalLazy(${i})`,d}const Fg={},Wg={};async function $g(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((l,i)=>{setTimeout(()=>i(new Error("Import timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const l=Math.pow(2,o)*1e3;await new Promise(i=>setTimeout(i,l))}}throw n}function Vg(){Ke.clear()}function Hg(){return{cachedComponents:Ke.size,cacheEntries:Array.from(Ke.entries()).map(([e,r])=>({key:e,lastCheck:r.lastCheck,isValid:r.isValid,age:Date.now()-r.lastCheck}))}}const bn=[{name:"react-router",path:"/assets/react-router-*.js",size:12,config:{priority:"critical",condition:()=>!0}},{name:"app-core",path:"/assets/app-core-*.js",size:25,config:{priority:"high",condition:()=>window.location.pathname==="/",delay:1e3,onIdle:!0}},{name:"wagmi",path:"/assets/wagmi-*.js",size:15,config:{priority:"high",condition:()=>!!(window.ethereum||localStorage.getItem("walletconnect")),onIdle:!0}},{name:"wc-ethereum",path:"/assets/wc-ethereum-*.js",size:273,config:{priority:"medium",condition:()=>!!window.ethereum,delay:2e3,onHover:!0}},{name:"solana-core",path:"/assets/solana-core-*.js",size:29,config:{priority:"medium",condition:()=>!!(window.solana||window.phantom),delay:1500}},{name:"mail-features",path:"/assets/mail-features-*.js",size:10,config:{priority:"medium",condition:()=>window.location.pathname.includes("/connect")||localStorage.getItem("wallet-connected")==="true",onScroll:20}},{name:"coinbase",path:"/assets/coinbase-*.js",size:75,config:{priority:"low",condition:()=>!!window.ethereum,delay:5e3,onIdle:!0}},{name:"design-system",path:"/assets/design-system-*.js",size:112,config:{priority:"low",condition:()=>window.location.pathname.includes("/internal"),delay:3e3}}];class qg{constructor(){this.preloaded=new Set,this.networkSpeedEstimate="medium",this.isLowEndDevice=!1,this.userActivityScore=0,this.detectNetworkSpeed(),this.detectDeviceCapability(),this.startUserActivityTracking()}detectNetworkSpeed(){if("connection"in navigator){const a=navigator.connection;if(a){const n=a.effectiveType;n==="4g"?this.networkSpeedEstimate="fast":n==="3g"?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}}const r=performance.now();fetch("/favicon.ico",{method:"HEAD"}).then(()=>{const a=performance.now()-r;a<100?this.networkSpeedEstimate="fast":a<300?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}).catch(()=>{this.networkSpeedEstimate="slow"})}detectDeviceCapability(){const r=navigator.deviceMemory,a=navigator.hardwareConcurrency;r&&r<4&&(this.isLowEndDevice=!0),a&&a<4&&(this.isLowEndDevice=!0),"getBattery"in navigator&&navigator.getBattery?.().then(n=>{n.level&&n.level<.2&&(this.isLowEndDevice=!0)})}startUserActivityTracking(){let r;const a=()=>{this.userActivityScore=Math.min(this.userActivityScore+1,100),clearTimeout(r),r=setTimeout(()=>{this.userActivityScore=Math.max(this.userActivityScore-1,0)},5e3)};["click","scroll","keydown","mousemove"].forEach(n=>{document.addEventListener(n,a,{passive:!0})})}shouldPreload(r){return this.networkSpeedEstimate==="slow"&&r.size>50||this.isLowEndDevice&&r.size>30?!1:r.config.condition()}async preloadChunk(r){if(!this.preloaded.has(r.name))try{if(document.querySelectorAll('script[src*="'+r.name+'"]').length===0&&document.querySelectorAll('link[href*="'+r.name+'"]').length>0)return;const n=document.createElement("link");n.rel="modulepreload",n.href=r.path.replace("*",this.getChunkHash(r.name)),n.crossOrigin="","fetchPriority"in n&&(n.fetchPriority=r.config.priority==="critical"?"high":"low"),document.head.appendChild(n),this.preloaded.add(r.name)}catch{}}getChunkHash(r){const a=Array.from(document.querySelectorAll("script[src]"));for(const n of a){const o=n.src;if(o.includes(r)){const s=o.match(new RegExp(`${r}-([A-Za-z0-9_-]+)\\.js`));if(s)return s[1]}}return"unknown"}async schedulePreload(r){const a=r.config;return a.delay&&await new Promise(n=>setTimeout(n,a.delay)),a.onIdle&&"requestIdleCallback"in window?new Promise(n=>{window.requestIdleCallback(()=>{this.preloadChunk(r).then(n)})}):this.preloadChunk(r)}initializePreloading(){bn.sort((a,n)=>{const o={critical:0,high:1,medium:2,low:3};return o[a.config.priority]-o[n.config.priority]}).forEach(a=>{this.shouldPreload(a)&&(a.config.priority==="critical"?this.preloadChunk(a):this.schedulePreload(a),a.config.onHover&&this.setupHoverPreloading(a),a.config.onScroll&&this.setupScrollPreloading(a,a.config.onScroll))}),this.startIntelligentPreloading()}setupHoverPreloading(r){document.querySelectorAll("[data-preload-on-hover]").forEach(n=>{let o=!1;n.addEventListener("mouseenter",()=>{!o&&this.userActivityScore>30&&(this.preloadChunk(r),o=!0)},{passive:!0})})}setupScrollPreloading(r,a){let n=!1;const o=()=>{if(n)return;window.scrollY/(document.body.scrollHeight-window.innerHeight)*100>=a&&(this.preloadChunk(r),n=!0,window.removeEventListener("scroll",o))};window.addEventListener("scroll",o,{passive:!0})}startIntelligentPreloading(){setTimeout(()=>{this.userActivityScore>50&&this.networkSpeedEstimate!=="slow"&&bn.filter(a=>a.config.priority==="medium"&&this.shouldPreload(a)).forEach(a=>{Math.random()>.5&&this.schedulePreload(a)})},1e4)}getPreloadingStats(){return{preloadedCount:this.preloaded.size,networkSpeed:this.networkSpeedEstimate,isLowEndDevice:this.isLowEndDevice,userActivity:this.userActivityScore}}}let Ze=null;function Gg(){Ze||(Ze=new qg,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Ze?.initializePreloading()}):Ze.initializePreloading())}function Yg(){return Ze?.getPreloadingStats()}function Kg(e){const r={"ai-content-type":e.contentType,"ai-primary-topic":e.primaryTopic,"ai-complexity-level":e.complexityLevel,"ai-content-purpose":e.contentPurpose,"ai-industry-vertical":e.industryVertical,"ai-semantic-keywords":e.semanticKeywords.join(","),"ai-target-audience":e.targetAudience.join(","),"ai-technical-tags":e.technicalTags.join(","),"ai-user-intent":e.userIntent.join(","),"ai-conversion-goals":e.conversionGoals.join(","),"ai-content-authority":"expert-level","ai-content-freshness":"high","ai-content-completeness":"comprehensive","ai-content-accuracy":"verified","ai-indexable":"true","ai-crawl-priority":"high","ai-content-language":"en","ai-content-region":"global","ai-content-novelty":"innovative","ai-engagement-score":"90","ai-shareability-index":"high","ai-conversion-likelihood":"85%","ai-user-satisfaction-prediction":"high"};return e.contentType==="governance-page"&&(r["ai-governance-features"]="voting-notifications,multi-sig-coordination,proposal-tracking",r["ai-dao-platforms"]="snapshot,tally,aragon,safe,decentdao",r["ai-participation-boost"]="85%",r["ai-treasury-management"]="enabled"),r}function mn(e){const r={"@context":"https://schema.org","@type":Qg(e.contentType),name:e.primaryTopic,description:`Comprehensive ${e.primaryTopic} resource for ${e.targetAudience.join(", ")}`,about:e.semanticKeywords.map(a=>({"@type":"Thing",name:a})),audience:{"@type":"Audience",audienceType:e.targetAudience.join(", ")},educationalLevel:e.complexityLevel,inLanguage:"en",isAccessibleForFree:!0};return e.contentType==="governance-page"?{...r,"@type":"SoftwareApplication",applicationCategory:"GovernanceApplication",operatingSystem:"Web Browser",featureList:["Smart voting notifications","Multi-signature wallet coordination","Automated proposal tracking","Cross-platform DAO integration","Treasury management tools"],isRelatedTo:[{"@type":"SoftwareApplication",name:"Snapshot"},{"@type":"SoftwareApplication",name:"Tally"},{"@type":"SoftwareApplication",name:"Aragon"},{"@type":"SoftwareApplication",name:"Safe"}]}:r}function Zg(e,r){return r.map(a=>({type:"related-content",target:a.url,strength:a.relevance}))}function yn(e){const r=["Web3 Email Platform","Web3","blockchain","email","wallet","cryptocurrency"],a=["DAO","governance","voting","multi-sig","Snapshot","Tally","Aragon","Safe","proposal","community"];return e.contentType==="governance-page"?[...r,...a]:r}function pn(e){const r=["web3-infrastructure","email-technology","blockchain-applications"],a=["dao-governance-tools","voting-notification-systems","community-management-platforms","multi-signature-coordination","treasury-management-solutions"];return e.contentType==="governance-page"?[...r,...a]:r}function Xg(e,r){return{contentClassification:{type:e.contentType,topic:e.primaryTopic,audience:e.targetAudience.join(","),complexity:e.complexityLevel,purpose:e.contentPurpose,vertical:e.industryVertical},semanticMarkup:mn(e),entityRecognition:yn(e),topicClustering:pn(e),contentRelationships:r?.contentRelationships||[],...r}}function Qg(e){return{article:"Article","landing-page":"WebPage","product-page":"Product","governance-page":"SoftwareApplication",documentation:"TechArticle"}[e]||"WebPage"}function Jg(e){return{"@context":"https://schema.org","@type":"MonitorAction",name:`AI Performance Tracking - ${e}`,instrument:{"@type":"SoftwareApplication",name:"AI Analytics Platform"},measurementTechnique:["User Engagement Metrics","AI Content Understanding Score","Semantic Relevance Analysis","Conversion Optimization Tracking"],result:{"@type":"Dataset",name:`${e} Performance Data`,description:"AI-optimized performance metrics and user interaction data"}}}const Rg={governancePage:{contentType:"governance-page",primaryTopic:"DAO Governance Communication Platform",semanticKeywords:["DAO governance","voting notifications","multi-sig coordination","proposal tracking","community engagement","treasury management"],targetAudience:["DAO members","governance participants","multi-sig signers","protocol teams","community managers"],complexityLevel:"intermediate",contentPurpose:"commercial",industryVertical:"blockchain-governance",technicalTags:["snapshot","tally","aragon","safe","multi-sig","voting","proposals","treasury"],userIntent:["improve-governance","increase-participation","coordinate-multi-sig","track-proposals","engage-community"],conversionGoals:["dao-integration","governance-setup","multi-sig-connection","notification-activation"]},landingPage:{contentType:"landing-page",primaryTopic:"Web3 Email Platform",semanticKeywords:["Web3 email","wallet authentication","ENS email","SNS email","blockchain email","decentralized communication"],targetAudience:["Web3 users","crypto enthusiasts","blockchain developers","DeFi users"],complexityLevel:"beginner",contentPurpose:"commercial",industryVertical:"web3-communication",technicalTags:["ethereum","solana","ens","sns","wallet-connect","metamask","phantom"],userIntent:["create-web3-email","connect-wallet","secure-communication","eliminate-passwords"],conversionGoals:["wallet-connection","email-creation","first-email-sent","premium-upgrade"]}},eh=({message:e,className:r})=>t.jsxs("div",{className:`flex items-center justify-center p-4 ${r||""}`,children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),yt=new Map,Xe=new Set;function pt(){const e=[];return!!window.ethereum?.isMetaMask&&(Xe.add("metamask"),e.push({name:"MetaMask",detected:!0,priority:1})),!!window.ethereum?.isCoinbaseWallet&&(Xe.add("coinbase"),e.push({name:"Coinbase Wallet",detected:!0,priority:2})),!!window.solana?.isPhantom&&(Xe.add("phantom"),e.push({name:"Phantom",detected:!0,priority:3})),e.push({name:"WalletConnect",detected:!0,priority:4}),e.sort((o,s)=>o.priority-s.priority)}function vt(e){const r=`wallet-${e.toLowerCase()}`;if(yt.has(r))return yt.get(r);const a=()=>Promise.resolve({default:()=>p.createElement("div",{},`${e} Provider Placeholder`)}),n=p.lazy(a),o=s=>t.jsx(p.Suspense,{fallback:t.jsx(eh,{message:`Loading ${e} wallet...`,className:"wallet-loading"}),children:t.jsx(n,{...s})});return o.displayName=`Lazy${e}Provider`,yt.set(r,o),o}function rh({children:e}){const r=pt();return r.filter(a=>a.priority<=2&&a.detected).forEach(a=>{setTimeout(()=>{},1e3)}),t.jsxs(t.Fragment,{children:[r.map(a=>{const n=vt(a.name);return t.jsx(n,{},a.name)}),e]})}const Nt=class Nt{static preloadWallet(r){const a=r.toLowerCase();this.preloadedWallets.has(a)||(this.preloadedWallets.add(a),setTimeout(()=>{vt(r)},500))}static preloadCommonWallets(){["metamask","walletconnect","coinbase"].forEach((a,n)=>{setTimeout(()=>{this.preloadWallet(a)},n*1e3)})}static getPreloadedWallets(){return Array.from(this.preloadedWallets)}};Nt.preloadedWallets=new Set;let Qe=Nt;function th(){return{availableWallets:pt(),preloadWallet:n=>{Qe.preloadWallet(n)},getDetectedWallets:()=>Array.from(Xe),hasWallet:n=>Xe.has(n.toLowerCase())}}function ah({walletName:e,onConnect:r,disabled:a=!1}){const n=()=>{Qe.preloadWallet(e),setTimeout(r,100)};return t.jsxs("button",{onClick:n,disabled:a,className:"wallet-connect-btn","data-wallet":e.toLowerCase(),children:["Connect ",e]})}class nh{constructor(){this.criticalResources=[],this.observedMetrics={fcp:0,lcp:0,fid:0,cls:0,ttfb:0},this.defineCriticalResources(),this.startPerformanceObservation()}defineCriticalResources(){this.criticalResources=[{url:"/assets/index-*.css",type:"style",priority:"critical",preload:!0},{url:"/assets/index-*.js",type:"script",priority:"critical"},{url:"/assets/react-core-*.js",type:"script",priority:"high",preload:!0},{url:"https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2",type:"font",priority:"critical",preload:!0},{url:"/logo.png",type:"image",priority:"high",preload:!0}]}startPerformanceObservation(){if("PerformanceObserver"in window)try{new PerformanceObserver(s=>{for(const l of s.getEntries())l.name==="first-contentful-paint"&&(this.observedMetrics.fcp=l.startTime,this.optimizeBasedOnFCP(l.startTime))}).observe({entryTypes:["paint"]}),new PerformanceObserver(s=>{for(const l of s.getEntries())this.observedMetrics.lcp=l.startTime,this.optimizeBasedOnLCP(l.startTime)}).observe({entryTypes:["largest-contentful-paint"]});let n=0;new PerformanceObserver(s=>{for(const l of s.getEntries())l.hadRecentInput||(n+=l.value);this.observedMetrics.cls=n}).observe({entryTypes:["layout-shift"]})}catch{}window.addEventListener("load",()=>{setTimeout(()=>{const r=performance.getEntriesByType("navigation")[0];r&&(this.observedMetrics.ttfb=r.responseStart-r.requestStart,this.optimizeBasedOnTTFB(this.observedMetrics.ttfb))},0)})}optimizeBasedOnFCP(r){r>2e3?this.applyEmergencyOptimizations():r>1500&&this.applyMediumOptimizations()}optimizeBasedOnLCP(r){r>2500&&this.optimizeLCPElements()}optimizeBasedOnTTFB(r){r>600&&this.enableAggressiveCaching()}applyEmergencyOptimizations(){document.querySelectorAll('img[data-priority="low"]').forEach(n=>{n.loading="lazy",n.style.display="none",setTimeout(()=>{n.style.display=""},3e3)}),document.querySelectorAll('script[data-priority="low"]').forEach(n=>{n.setAttribute("defer","")})}applyMediumOptimizations(){["/assets/app-core-*.js","/assets/react-router-*.js"].forEach(a=>{this.preloadResource(a,"script")})}optimizeLCPElements(){document.querySelectorAll("img[data-hero], [data-lcp-element]").forEach(n=>{n instanceof HTMLImageElement&&(n.fetchPriority="high",n.loading="eager")});const a=document.querySelector("img[data-hero]")?.getAttribute("src");a&&this.preloadResource(a,"image")}enableAggressiveCaching(){const r=document.createElement("meta");r.httpEquiv="Cache-Control",r.content="public, max-age=31536000, immutable",document.head.appendChild(r)}preloadResource(r,a){if(document.querySelector(`link[href*="${r}"]`))return;const o=document.createElement("link");switch(o.rel="preload",o.href=r,a){case"script":o.as="script";break;case"style":o.as="style";break;case"font":o.as="font",o.type="font/woff2",o.crossOrigin="";break;case"image":o.as="image";break}document.head.appendChild(o)}optimizeCriticalPath(){this.criticalResources.filter(r=>r.priority==="critical"&&r.preload).forEach(r=>{this.preloadResource(r.url,r.type)}),this.inlineCriticalCSS(),this.optimizeFontLoading(),this.removeRenderBlocking(),this.setupProgressiveLoading()}inlineCriticalCSS(){const r=document.querySelector('link[rel="stylesheet"][data-critical]');r&&this.isSmallResource(r.getAttribute("href")||"")&&fetch(r.getAttribute("href")||"").then(a=>a.text()).then(a=>{if(a.length<1e4){const n=document.createElement("style");n.textContent=a,document.head.appendChild(n),r.remove()}}).catch(()=>{})}optimizeFontLoading(){document.querySelectorAll('link[href*="fonts.googleapis.com"]').forEach(a=>{const n=a.getAttribute("href")||"";if(!n.includes("display=swap")){const o=n.includes("?")?"&":"?";a.setAttribute("href",`${n}${o}display=swap`)}})}removeRenderBlocking(){document.querySelectorAll('link[rel="stylesheet"]:not([data-critical])').forEach(a=>{const n=a.cloneNode(!0);n.rel="preload",n.as="style",n.onload=()=>{n.onload=null,n.rel="stylesheet"};const o=document.createElement("noscript"),s=a.cloneNode(!0);o.appendChild(s),document.head.appendChild(n),document.head.appendChild(o),a.remove()})}setupProgressiveLoading(){const r=document.querySelectorAll("img[data-src]");if("IntersectionObserver"in window){const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.src=s.dataset.src||"",s.removeAttribute("data-src"),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});r.forEach(n=>a.observe(n))}else r.forEach(a=>{const n=a;n.src=n.dataset.src||""})}isSmallResource(r){return r.includes("critical")||r.includes("inline")}getPerformanceMetrics(){return{...this.observedMetrics,score:this.calculatePerformanceScore()}}calculatePerformanceScore(){let r=100;return this.observedMetrics.fcp>2e3?r-=20:this.observedMetrics.fcp>1500&&(r-=10),this.observedMetrics.lcp>2500?r-=25:this.observedMetrics.lcp>2e3&&(r-=15),this.observedMetrics.cls>.1?r-=15:this.observedMetrics.cls>.05&&(r-=8),this.observedMetrics.ttfb>600?r-=10:this.observedMetrics.ttfb>400&&(r-=5),Math.max(r,0)}}const mr={mark:e=>{typeof performance<"u"&&performance.mark&&performance.mark(e)},measure:(e,r,a)=>{if(typeof performance<"u"&&performance.measure)try{performance.measure(e,r,a);const n=performance.getEntriesByName(e);return n[n.length-1]?.duration||0}catch{return 0}return 0},getEntries:e=>typeof performance<"u"&&performance.getEntriesByName?e?performance.getEntriesByName(e):performance.getEntries():[],clearEntries:e=>{typeof performance<"u"&&(e?(performance.clearMeasures?.(e),performance.clearMarks?.(e)):(performance.clearMeasures?.(),performance.clearMarks?.()))}},oh=(e,r=[])=>{p.useEffect(()=>(mr.mark(`${e}-start`),()=>{mr.mark(`${e}-end`),mr.measure(e,`${e}-start`,`${e}-end`)}),[e,r])},sh=e=>{const r=p.useRef(e);return r.current=e,p.useCallback((...a)=>r.current(...a),[])},lh=(e,r,a)=>{const n=p.useRef(r),o=p.useRef(void 0);return p.useMemo(()=>(a&&process.env.NODE_ENV==="development"&&r.some((s,l)=>s!==n.current[l]),n.current=r,o.current=e(),o.current),[e,a,r])},yr=new Map,ih=e=>{const r=yr.get(e)||0;yr.set(e,r+1),p.useEffect(()=>{process.env.NODE_ENV})},ch=()=>Object.fromEntries(yr),dh=()=>yr.clear(),uh=e=>p.lazy(e),gh=(e=.1)=>{const[r,a]=p.useState(new Set),n=p.useRef(null);p.useEffect(()=>(n.current=new IntersectionObserver(s=>{s.forEach(l=>{if(l.isIntersecting){const i=l.target,d=i.dataset.src;d&&(i.src=d,i.onload=()=>{a(c=>new Set(c).add(d))},n.current?.unobserve(i))}})},{threshold:e}),()=>n.current?.disconnect()),[e]);const o=p.useCallback(s=>{s&&n.current&&n.current.observe(s)},[]);return{loadedImages:r,observeImage:o}},hh=e=>{typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(()=>{e().catch(()=>{})}):setTimeout(()=>{e().catch(()=>{})},100)},vn={},fh=e=>{vn[e.name]=e.value,process.env.NODE_ENV},bh=()=>vn,mh=(e,r="script")=>{if(typeof document<"u"){const a=document.createElement("link");a.rel="prefetch",a.href=e,a.as=r,document.head.appendChild(a)}},yh=(e,r="script",a)=>{if(typeof document<"u"){const n=document.createElement("link");n.rel="preload",n.href=e,n.as=r,a&&(n.crossOrigin="anonymous"),document.head.appendChild(n)}},ph=e=>{const r=p.useRef(new Set),a=p.useRef(new Set),n=p.useCallback((s,l)=>{const i=setTimeout(()=>{r.current.delete(i),s()},l);return r.current.add(i),i},[]),o=p.useCallback((s,l)=>{const i=setInterval(s,l);return a.current.add(i),i},[]);return p.useEffect(()=>{const s=r.current,l=a.current;return()=>{s.forEach(i=>clearTimeout(i)),l.forEach(i=>clearInterval(i)),process.env.NODE_ENV}},[e]),{createTimer:n,createInterval:o}},ue={maxBundleSize:500,maxChunkSize:200,maxImageSize:100,maxFCP:1800,maxLCP:2500,maxFID:100,maxCLS:.1,check:e=>{const r=[];return e.FCP&&e.FCP>ue.maxFCP&&r.push(`FCP (${e.FCP}ms) exceeds budget (${ue.maxFCP}ms)`),e.LCP&&e.LCP>ue.maxLCP&&r.push(`LCP (${e.LCP}ms) exceeds budget (${ue.maxLCP}ms)`),e.FID&&e.FID>ue.maxFID&&r.push(`FID (${e.FID}ms) exceeds budget (${ue.maxFID}ms)`),e.CLS&&e.CLS>ue.maxCLS&&r.push(`CLS (${e.CLS}) exceeds budget (${ue.maxCLS})`),r}};class vh{constructor(r){this.metrics={timestamp:Date.now()},this.observers=[],this.performanceMarks=new Map,this.reportCallback=r,this.initializeWebVitals(),this.initializeCustomObservers(),this.collectDeviceInfo()}initializeWebVitals(){Be.onCLS(r=>{this.metrics.CLS=r.value,this.reportMetric("CLS",r.value)}),Be.onINP(r=>{this.metrics.INP=r.value,this.reportMetric("INP",r.value)}),Be.onFCP(r=>{this.metrics.FCP=r.value,this.reportMetric("FCP",r.value)}),Be.onLCP(r=>{this.metrics.LCP=r.value,this.reportMetric("LCP",r.value)}),Be.onTTFB(r=>{this.metrics.TTFB=r.value,this.reportMetric("TTFB",r.value)})}initializeCustomObservers(){if("PerformanceObserver"in window){const r=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{if(s.entryType==="navigation"){const l=s;this.metrics.bundleLoadTime=l.loadEventEnd-l.fetchStart}})});try{r.observe({entryTypes:["navigation"]}),this.observers.push(r)}catch{}const a=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{(s.name.includes(".js")||s.name.includes(".css"))&&this.trackResourceLoad(s.name,s.duration)})});try{a.observe({entryTypes:["resource"]}),this.observers.push(a)}catch{}}}collectDeviceInfo(){if(typeof window<"u"){const r=navigator;r.connection&&(this.metrics.connection=r.connection.effectiveType||r.connection.type),r.deviceMemory&&(this.metrics.deviceMemory=r.deviceMemory),r.hardwareConcurrency&&(this.metrics.hardwareConcurrency=r.hardwareConcurrency),this.metrics.viewport={width:window.innerWidth,height:window.innerHeight}}}reportMetric(r,a){this.reportCallback&&this.reportCallback({...this.metrics,timestamp:Date.now()}),process.env.NODE_ENV}trackResourceLoad(r,a){const n=r.includes(".js"),o=r.includes(".css");if(n||o){const s=n?"JavaScript":"CSS";this.reportMetric(`${s} Load`,a)}}measureComponentRender(r,a){this.metrics.componentRenderTime=a,this.reportMetric(`Component Render (${r})`,a)}measureAPICall(r,a){this.metrics.apiResponseTime=a,this.reportMetric(`API Call (${r})`,a)}measureRouteChange(r,a){this.metrics.routeChangeTime=a,this.reportMetric(`Route Change (${r})`,a)}markStart(r){this.performanceMarks.set(r,performance.now())}markEnd(r){const a=this.performanceMarks.get(r);if(a){const n=performance.now()-a;this.reportMetric(`Mark (${r})`,n),this.performanceMarks.delete(r)}}trackRouteChange(r,a,n){typeof a=="string"?this.measureRouteChange(a,n||performance.now()):this.measureRouteChange(r,a)}getSummary(){return{coreWebVitals:{score:this.calculateScore(),LCP:this.metrics.LCP,INP:this.metrics.INP,CLS:this.metrics.CLS},loadingPerformance:{FCP:this.metrics.FCP,TTFB:this.metrics.TTFB,bundleLoadTime:this.metrics.bundleLoadTime},runtime:{routeChangeTime:this.metrics.routeChangeTime,apiResponseTime:this.metrics.apiResponseTime,componentRenderTime:this.metrics.componentRenderTime},device:{connection:this.metrics.connection,deviceMemory:this.metrics.deviceMemory,hardwareConcurrency:this.metrics.hardwareConcurrency}}}calculateScore(){let r=100;return this.metrics.LCP&&this.metrics.LCP>2500?r-=25:this.metrics.LCP&&this.metrics.LCP>2e3&&(r-=15),this.metrics.INP&&this.metrics.INP>200?r-=20:this.metrics.INP&&this.metrics.INP>100&&(r-=10),this.metrics.CLS&&this.metrics.CLS>.1?r-=15:this.metrics.CLS&&this.metrics.CLS>.05&&(r-=8),Math.max(r,0)}getMetrics(){return{...this.metrics}}cleanup(){this.observers.forEach(r=>r.disconnect()),this.observers=[]}}let pr=null;const wh=e=>(pr||(pr=new vh(e)),pr),vr=()=>pr,wn=e=>{const r=p.useRef(performance.now());p.useEffect(()=>{const a=performance.now()-r.current,n=vr();n&&n.measureComponentRender(e,a)},[e])},kh=(e,r)=>p.forwardRef((a,n)=>(wn(r),p.createElement(e,{...a,ref:n}))),xh=async(e,r)=>{const a=performance.now(),n=await e(),o=performance.now()-a,s=vr();return s&&s.measureAPICall(r,o),n},kn={LCP:2500,INP:200,CLS:.1,FCP:1800,TTFB:800,bundleSize:17e4},Nh=(e,r=kn)=>{const a=[];return r.LCP&&e.LCP&&e.LCP>r.LCP&&a.push(`LCP: ${e.LCP.toFixed(0)}ms (budget: ${r.LCP}ms)`),r.INP&&e.INP&&e.INP>r.INP&&a.push(`INP: ${e.INP.toFixed(0)}ms (budget: ${r.INP}ms)`),r.CLS&&e.CLS&&e.CLS>r.CLS&&a.push(`CLS: ${e.CLS.toFixed(3)} (budget: ${r.CLS})`),r.FCP&&e.FCP&&e.FCP>r.FCP&&a.push(`FCP: ${e.FCP.toFixed(0)}ms (budget: ${r.FCP}ms)`),r.TTFB&&e.TTFB&&e.TTFB>r.TTFB&&a.push(`TTFB: ${e.TTFB.toFixed(0)}ms (budget: ${r.TTFB}ms)`),{passed:a.length===0,violations:a}},Ch=e=>{const r=e||vr()?.getMetrics()||{timestamp:Date.now()},a={timestamp:new Date().toISOString(),metrics:r,environment:{userAgent:typeof window<"u"?window.navigator.userAgent:"unknown",url:typeof window<"u"?window.location.href:"unknown",referrer:typeof document<"u"?document.referrer:"unknown",viewport:r.viewport,connection:r.connection,deviceMemory:r.deviceMemory,hardwareConcurrency:r.hardwareConcurrency}};return JSON.stringify(a,null,2)},Sh={CLS:[.1,.25],FCP:[1800,3e3],FID:[100,300],LCP:[2500,4e3],TTFB:[800,1800],INP:[200,500]};function De(e,r){const[a,n]=Sh[e];return r<=a?"good":r<=n?"needs-improvement":"poor"}function Je(e,r){try{if(PerformanceObserver.supportedEntryTypes?.includes(e)){const a=new PerformanceObserver(n=>{r(n.getEntries())});return a.observe({type:e,buffered:!0}),a}}catch{}}function xn(e){let r=0;Je("layout-shift",a=>{for(const n of a){const o=n;o.hadRecentInput||(r+=o.value)}}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e({name:"CLS",value:r,rating:De("CLS",r)})})}function Nn(e){Je("paint",r=>{for(const a of r)a.name==="first-contentful-paint"&&e({name:"FCP",value:a.startTime,rating:De("FCP",a.startTime)})})}function Cn(e){let r=0;Je("largest-contentful-paint",n=>{const o=n[n.length-1];o&&(r=o.startTime)});const a=()=>{r>0&&e({name:"LCP",value:r,rating:De("LCP",r)})};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&a()}),["keydown","click"].forEach(n=>{document.addEventListener(n,a,{once:!0,capture:!0})})}function Sn(e){Je("first-input",r=>{const a=r[0];if(a){const n=a.processingStart-a.startTime;e({name:"FID",value:n,rating:De("FID",n)})}})}function En(e){const r=performance.getEntriesByType("navigation")[0];if(r){const a=r.responseStart-r.requestStart;e({name:"TTFB",value:a,rating:De("TTFB",a)})}}function Tn(e){const r=[];Je("event",a=>{for(const n of a){const o=n;if(o.interactionId){const s=o.processingEnd-o.processingStart;r.push(s)}}}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&r.length>0){r.sort((o,s)=>o-s);const a=Math.min(r.length-1,Math.ceil(r.length*.98)-1),n=r[a];e({name:"INP",value:n,rating:De("INP",n)})}})}function Eh(e){const r=e||(a=>{if(typeof window<"u"&&window.__DEV__){const n=a.rating==="good"?"\x1B[32m":a.rating==="needs-improvement"?"\x1B[33m":"\x1B[31m";console.log(`${n}[WebVitals] ${a.name}: ${a.value.toFixed(2)} (${a.rating})\x1B[0m`)}});xn(r),Nn(r),Cn(r),Sn(r),En(r),Tn(r)}function An(e,r,a){if(typeof window<"u"&&window.__DEV__){const n=a<100?"good":a<300?"needs-improvement":"poor";console.log(`${n==="good"?"\x1B[32m":n==="needs-improvement"?"\x1B[33m":"\x1B[31m"}[RouteChange] ${e} -> ${r}: ${a}ms (${n})\x1B[0m`)}}function Th(e,r,a){typeof window<"u"&&window.__DEV__&&console.log(`[CustomMetric] ${e}: ${r}`,a||"")}function Ah(e,r,a,n="GET"){if(typeof window<"u"&&window.__DEV__){const o=r<200?"good":r<500?"needs-improvement":"poor";console.log(`${o==="good"?"\x1B[32m":o==="needs-improvement"?"\x1B[33m":"\x1B[31m"}[API] ${n} ${e}: ${r}ms (${a})\x1B[0m`)}}const Ih=({direction:e,className:r})=>t.jsx("svg",{className:f("w-4 h-4",r),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e==="up"?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"})}),Lh=({className:e})=>t.jsx("svg",{className:f("w-4 h-4",e),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),In=({title:e="Performance Monitor",isCollapsed:r,onToggleCollapse:a,onClose:n,onMouseDown:o,isDragging:s,className:l})=>t.jsxs("div",{className:f("bg-gray-900 text-white rounded-t-lg px-3 py-2","flex items-center justify-between","shadow-lg border border-gray-700","select-none",o&&"cursor-grab",s&&"cursor-grabbing",l),onMouseDown:o,children:[t.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[t.jsx("span",{children:"🚀"}),e]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx("button",{onClick:a,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":r?"Expand":"Collapse",type:"button",children:t.jsx(Ih,{direction:r?"up":"down"})}),n&&t.jsx("button",{onClick:n,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":"Close",type:"button",children:t.jsx(Lh,{})})]})]}),Mh={sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"},Ph={good:"bg-green-500","needs-improvement":"bg-yellow-500",poor:"bg-red-500",unknown:"bg-gray-400",neutral:"bg-gray-500"},Oh={good:"Good","needs-improvement":"Needs Improvement",poor:"Poor",unknown:"Unknown",neutral:"Neutral"},Uh=({rating:e,size:r="sm",showLabel:a=!1,className:n})=>t.jsxs("div",{className:f("flex items-center gap-1",n),children:[t.jsx("span",{className:f("rounded-full",Mh[r],Ph[e])}),a&&t.jsx("span",{className:"text-xs text-gray-400",children:Oh[e]})]}),Ln=({className:e})=>t.jsxs("div",{className:f("flex gap-3 text-[10px] text-gray-400",e),children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),"Good"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500"}),"Needs Improvement"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),"Poor"]})]}),Dh={good:"text-green-500","needs-improvement":"text-yellow-500",poor:"text-red-500",unknown:"text-gray-400",neutral:"text-gray-300"},H=({label:e,value:r,unit:a="",rating:n="neutral",description:o,className:s})=>{const l=typeof r=="number"?Number.isInteger(r)?r.toString():r.toFixed(r<1?3:0):r;return t.jsxs("div",{className:f("flex justify-between items-center",s),children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-gray-300",children:e}),o&&t.jsx("span",{className:"text-[10px] text-gray-500",children:o})]}),t.jsxs("span",{className:f("font-medium",Dh[n]),children:[l,a]})]})},jh=(e,r="ms",a=0)=>e===void 0?"N/A":`${e.toFixed(a)}${r}`,Mn=(e={})=>{const{enabled:r=!0,onUpdate:a}=e,[n,o]=p.useState({}),[s,l]=p.useState(!0),i=p.useRef(a);p.useEffect(()=>{i.current=a},[a]);const d=p.useCallback(c=>{o(h=>{const g={...h,...c};return i.current?.(g),g})},[]);return p.useEffect(()=>{if(!r)return;if(typeof PerformanceObserver>"u"){l(!1);return}const c=[];try{const h=new PerformanceObserver(g=>{const y=g.getEntries(),m=y[y.length-1];d({lcp:m.renderTime||m.loadTime})});h.observe({type:"largest-contentful-paint",buffered:!0}),c.push(h)}catch{}try{const h=new PerformanceObserver(g=>{g.getEntries().forEach(m=>{m.processingStart&&d({fid:m.processingStart-m.startTime})})});h.observe({type:"first-input",buffered:!0}),c.push(h)}catch{}try{let h=0;const g=new PerformanceObserver(y=>{for(const m of y.getEntries())!m.hadRecentInput&&m.value&&(h+=m.value,d({cls:h}))});g.observe({type:"layout-shift",buffered:!0}),c.push(g)}catch{}try{const h=new PerformanceObserver(g=>{g.getEntries().forEach(m=>{m.name==="first-contentful-paint"&&d({fcp:m.startTime})})});h.observe({type:"paint",buffered:!0}),c.push(h)}catch{}try{const h=new PerformanceObserver(g=>{g.getEntries().forEach(m=>{m.duration&&d({inp:m.duration})})});h.observe({type:"event",buffered:!0}),c.push(h)}catch{}try{const h=performance.getEntriesByType("navigation")[0];h&&d({ttfb:h.responseStart-h.requestStart})}catch{}return()=>{c.forEach(h=>h.disconnect())}},[r,d]),{metrics:n,isSupported:s}},Ae=(e,r)=>{if(r===void 0)return"unknown";const n={lcp:{good:2500,poor:4e3},fid:{good:100,poor:300},cls:{good:.1,poor:.25},fcp:{good:1800,poor:3e3},ttfb:{good:800,poor:1800},inp:{good:200,poor:500}}[e];return n?r<=n.good?"good":r<=n.poor?"needs-improvement":"poor":"unknown"},Pn=({metrics:e,className:r})=>{const a=(n,o=0)=>n===void 0?"N/A":n.toFixed(o);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-yellow-400 mb-2 text-xs",children:"Web Vitals"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"LCP",value:a(e.lcp),unit:"ms",rating:Ae("lcp",e.lcp),description:"Largest Contentful Paint"}),t.jsx(H,{label:"FID",value:a(e.fid),unit:"ms",rating:Ae("fid",e.fid),description:"First Input Delay"}),t.jsx(H,{label:"CLS",value:a(e.cls,3),rating:Ae("cls",e.cls),description:"Cumulative Layout Shift"}),t.jsx(H,{label:"FCP",value:a(e.fcp),unit:"ms",rating:Ae("fcp",e.fcp),description:"First Contentful Paint"}),t.jsx(H,{label:"TTFB",value:a(e.ttfb),unit:"ms",rating:Ae("ttfb",e.ttfb),description:"Time to First Byte"}),e.inp!==void 0&&t.jsx(H,{label:"INP",value:a(e.inp),unit:"ms",rating:Ae("inp",e.inp),description:"Interaction to Next Paint"})]})]})},On=(e={})=>{const{enabled:r=!0,refreshInterval:a=5e3,onUpdate:n}=e,[o,s]=p.useState({}),l=p.useRef(n);p.useEffect(()=>{l.current=n},[n]);const i=p.useCallback(()=>{if(!(typeof performance>"u"))try{const c=performance.getEntriesByType("resource"),h=c.filter(w=>w.name.endsWith(".js")||w.initiatorType==="script"),g=h.reduce((w,S)=>w+S.duration,0),y=c.filter(w=>w.name.endsWith(".css")||w.initiatorType==="link"),m=y.reduce((w,S)=>w+S.duration,0),b=c.reduce((w,S)=>w+(S.transferSize||0),0),v={jsLoadTime:g,cssLoadTime:m,jsCount:h.length,cssCount:y.length,totalTransferSize:b};s(v),l.current?.(v)}catch{}},[]),d=p.useCallback(()=>{i()},[i]);return p.useEffect(()=>{if(!r)return;i();const c=setInterval(i,a);return()=>clearInterval(c)},[r,a,i]),{metrics:o,refresh:d}},Un=e=>e===void 0?"N/A":e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`,Dn=({metrics:e,className:r})=>{const a=n=>n===void 0?"N/A":n.toFixed(0);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-blue-400 mb-2 text-xs",children:"Bundle Performance"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"JS Load",value:a(e.jsLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"CSS Load",value:a(e.cssLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"JS Files",value:e.jsCount??"N/A",rating:"neutral"}),t.jsx(H,{label:"Transfer Size",value:Un(e.totalTransferSize),rating:"neutral"})]})]})},_h=e=>e===void 0?"unknown":e<=200?"good":e<=500?"needs-improvement":"poor",jn=({metrics:e,className:r})=>{const a=n=>n===void 0||isNaN(n)?"N/A":n.toFixed(0);return e.callCount===0?null:t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-purple-400 mb-2 text-xs",children:"API Calls"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Count",value:e.callCount,rating:"neutral"}),t.jsx(H,{label:"Total Time",value:a(e.totalTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"Avg Time",value:a(e.averageTime),unit:"ms",rating:_h(e.averageTime)}),e.slowestCall!==void 0&&t.jsx(H,{label:"Slowest",value:a(e.slowestCall),unit:"ms",rating:e.slowestCall>1e3?"poor":"neutral"}),e.failedCalls>0&&t.jsx(H,{label:"Failed",value:e.failedCalls,rating:"poor"})]})]})},_n=e=>e===void 0?"N/A":(e/(1024*1024)).toFixed(1),zn=(e,r)=>{if(e===void 0||r===void 0)return"unknown";const a=e/r;return a<=.5?"good":a<=.75?"needs-improvement":"poor"},Bn=({refreshInterval:e=2e3,className:r})=>{const[a,n]=p.useState({}),[o,s]=p.useState(!0);if(p.useEffect(()=>{const i=performance;if(!i.memory){s(!1);return}const d=()=>{i.memory&&n({usedJSHeapSize:i.memory.usedJSHeapSize,totalJSHeapSize:i.memory.totalJSHeapSize,jsHeapSizeLimit:i.memory.jsHeapSizeLimit})};d();const c=setInterval(d,e);return()=>clearInterval(c)},[e]),!o)return null;const l=a.usedJSHeapSize&&a.jsHeapSizeLimit?(a.usedJSHeapSize/a.jsHeapSizeLimit*100).toFixed(0):"N/A";return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-cyan-400 mb-2 text-xs",children:"Memory"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Used Heap",value:_n(a.usedJSHeapSize),unit:"MB",rating:zn(a.usedJSHeapSize,a.jsHeapSizeLimit)}),t.jsx(H,{label:"Total Heap",value:_n(a.totalJSHeapSize),unit:"MB",rating:"neutral"}),t.jsx(H,{label:"Usage",value:l,unit:"%",rating:zn(a.usedJSHeapSize,a.jsHeapSizeLimit)})]})]})},zh=e=>{if(e.rating)return e.rating;if(typeof e.value=="number"&&e.thresholds){const{good:r,poor:a}=e.thresholds;return e.value<=r?"good":e.value<=a?"needs-improvement":"poor"}return"neutral"},Fn=({title:e="Custom Metrics",titleColor:r="text-orange-400",metrics:a,className:n})=>a.length===0?null:t.jsxs("div",{className:f("space-y-1",n),children:[t.jsx("h3",{className:f("font-semibold mb-2 text-xs",r),children:e}),t.jsx("div",{className:"space-y-1.5",children:a.map(o=>t.jsx(H,{label:o.label,value:o.value,unit:o.unit,rating:zh(o),description:o.description},o.id))})]}),Bh=["/api/","graphql",".json"],Wn=(e={})=>{const{enabled:r=!0,patterns:a=Bh,refreshInterval:n=5e3,onUpdate:o}=e,[s,l]=p.useState({callCount:0,totalTime:0,averageTime:0,failedCalls:0}),i=p.useRef(a),d=p.useRef(o);p.useEffect(()=>{i.current=a},[a]),p.useEffect(()=>{d.current=o},[o]);const c=p.useCallback(()=>{if(!(typeof performance>"u"))try{const g=performance.getEntriesByType("resource"),y=i.current,m=g.filter(k=>y.some(x=>k.name.includes(x)));if(m.length===0)return;const b=m.reduce((k,x)=>k+x.duration,0),v=Math.max(...m.map(k=>k.duration)),w=m.filter(k=>{const x=k.responseStatus;return x!==void 0&&x>=400}).length,S={callCount:m.length,totalTime:b,averageTime:b/m.length,slowestCall:v,failedCalls:w};l(S),d.current?.(S)}catch{}},[]),h=p.useCallback(()=>{c()},[c]);return p.useEffect(()=>{if(!r)return;c();const g=setInterval(c,n);return()=>clearInterval(g)},[r,n,c]),{metrics:s,refresh:h}},$n=(e={})=>{const{enabled:r=!0,constrainToViewport:a=!0,horizontalOnly:n=!1,verticalOnly:o=!1,initialPosition:s}=e,l=p.useRef(null),[i,d]=p.useState({x:s?.x??null,y:s?.y??null}),[c,h]=p.useState(!1),[g,y]=p.useState({x:0,y:0}),m=p.useCallback(v=>{if(!r||!l.current)return;const w=l.current.getBoundingClientRect();h(!0),y({x:v.clientX-w.left,y:v.clientY-w.top}),(i.x===null||i.y===null)&&d({x:n?w.left:i.x??w.left,y:o?w.top:i.y??w.top}),v.preventDefault()},[r,i,n,o]),b=p.useCallback(()=>{d({x:s?.x??null,y:s?.y??null})},[s]);return p.useEffect(()=>{if(!c)return;const v=S=>{if(!l.current)return;let k=S.clientX-g.x,x=S.clientY-g.y;if(a){const N=window.innerWidth-l.current.offsetWidth,E=window.innerHeight-l.current.offsetHeight;k=Math.max(0,Math.min(k,N)),x=Math.max(0,Math.min(x,E))}d({x:n?k:o?i.x:k,y:o?x:n?i.y:x})},w=()=>{h(!1)};return document.addEventListener("mousemove",v),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",w)}},[c,g,a,n,o,i.x,i.y]),{position:i,isDragging:c,handleMouseDown:m,resetPosition:b,ref:l}},Vn={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},Fh=["webVitals","bundle","api","memory"],Wh=({enabled:e,defaultCollapsed:r=!0,defaultVisible:a=!0,position:n="bottom-right",draggable:o=!0,sections:s=Fh,customMetrics:l=[],customSectionTitle:i="Custom Metrics",apiPatterns:d,onMetricsUpdate:c,className:h})=>{const g=e??(typeof process<"u"&&process.env?.NODE_ENV!=="production"),[y,m]=p.useState(r),[b,v]=p.useState(a),w=p.useMemo(()=>d,[JSON.stringify(d)]),S=p.useRef(c);p.useEffect(()=>{S.current=c},[c]);const{metrics:k}=Mn({enabled:g&&s.includes("webVitals")}),{metrics:x}=On({enabled:g&&s.includes("bundle")}),{metrics:N}=Wn({enabled:g&&s.includes("api"),patterns:w});p.useEffect(()=>{S.current&&S.current({webVitals:k,bundle:x,api:N})},[k,x,N]);const{position:E,isDragging:A,handleMouseDown:C,ref:I}=$n({enabled:o,horizontalOnly:n.includes("bottom")||n.includes("top")}),L=p.useCallback(()=>{m(D=>!D)},[]),P=p.useCallback(()=>{v(!1)},[]),U=p.useCallback(()=>{v(!0)},[]);if(!g)return null;if(!b)return t.jsx("button",{onClick:U,className:f("fixed z-[9999]",Vn[n],"bg-gray-900 text-white px-3 py-2 rounded-lg","shadow-lg border border-gray-700","hover:bg-gray-800 transition-colors","text-xs font-mono"),type:"button",children:"🚀 Performance"});const j=E.x!==null?{left:`${E.x}px`,bottom:n.includes("bottom")?"1rem":void 0,top:n.includes("top")?"1rem":void 0,position:"fixed",transition:A?"none":"height 0.2s ease-in-out"}:{transition:"height 0.2s ease-in-out"},B=l.length>0||s.includes("custom");return t.jsxs("div",{ref:I,className:f(E.x!==null?"":`fixed ${Vn[n]}`,"z-[9999] font-mono text-xs",A&&"cursor-grabbing",h),style:{maxWidth:"320px",...j},children:[t.jsx(In,{isCollapsed:y,onToggleCollapse:L,onClose:P,onMouseDown:o?C:void 0,isDragging:A}),t.jsx("div",{className:f("bg-gray-800 text-gray-100 rounded-b-lg","shadow-lg border-x border-b border-gray-700","overflow-hidden transition-all duration-300 ease-in-out",y?"max-h-0 opacity-0":"max-h-[70vh] opacity-100 py-2 px-3"),children:t.jsxs("div",{className:"overflow-y-auto max-h-full space-y-3",children:[s.includes("webVitals")&&t.jsx(Pn,{metrics:k}),s.includes("bundle")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Dn,{metrics:x})}),s.includes("api")&&N.callCount>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(jn,{metrics:N})}),s.includes("memory")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Bn,{})}),B&&l.length>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Fn,{title:i,metrics:l})}),t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ln,{})})]})})]})},$h=(e={})=>{const{successMessage:r="",successDuration:a=3e3,errorPrefix:n="",onSuccess:o,onError:s}=e,[l,i]=p.useState(!1),[d,c]=p.useState(""),[h,g]=p.useState(""),y=p.useCallback(()=>{c(""),g("")},[]),m=p.useCallback(()=>{c("")},[]),b=p.useCallback(()=>{g("")},[]),v=p.useCallback(async w=>{i(!0),y();try{await w(),r&&(c(r),a>0&&setTimeout(()=>{c("")},a)),o&&o()}catch(S){const k=S instanceof Error?S.message:"An error occurred";throw g(n?`${n}: ${k}`:k),s&&S instanceof Error&&s(S),S}finally{i(!1)}},[r,a,n,o,s,y]);return{isSubmitting:l,successMessage:d,errorMessage:h,submit:v,clearMessages:y,clearSuccess:m,clearError:b}},Vh=(e=!1)=>{const[r,a]=p.useState(e),n=p.useCallback(()=>a(!0),[]),o=p.useCallback(()=>a(!1),[]),s=p.useCallback(()=>a(l=>!l),[]);return{value:r,setTrue:n,setFalse:o,toggle:s,setValue:a}},Hh=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState(null),l=p.useCallback(async c=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(c);else{const h=document.createElement("textarea");h.value=c,h.style.position="fixed",h.style.left="-999999px",h.style.top="-999999px",document.body.appendChild(h),h.focus(),h.select();const g=document.execCommand("copy");if(document.body.removeChild(h),!g)throw new Error("Copy command was unsuccessful")}return s(c),a?.(c),setTimeout(()=>{s(null)},r),!0}catch(h){const g=h instanceof Error?h:new Error("Copy failed");return n?.(g),!1}},[r,a,n]),i=p.useCallback(c=>o===c,[o]),d=p.useCallback(()=>{s(null)},[]);return{copiedValue:o,copyToClipboard:l,isCopied:i,resetCopiedState:d}},qh=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState({}),l=p.useCallback(async(c,h)=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(c);else{const g=document.createElement("textarea");g.value=c,g.style.position="fixed",g.style.left="-999999px",g.style.top="-999999px",document.body.appendChild(g),g.focus(),g.select();const y=document.execCommand("copy");if(document.body.removeChild(g),!y)throw new Error("Copy command was unsuccessful")}return s(g=>({...g,[h]:!0})),a?.(c),setTimeout(()=>{s(g=>({...g,[h]:!1}))},r),!0}catch(g){const y=g instanceof Error?g:new Error("Copy failed");return n?.(y),!1}},[r,a,n]),i=p.useCallback(c=>o[c]||!1,[o]),d=p.useCallback(c=>{s(c?h=>({...h,[c]:!1}):{})},[]);return{copiedStates:o,copyToClipboard:l,isCopied:i,resetCopiedState:d}};function Gh(){const e=X.useLocation(),r=p.useRef(null),a=p.useRef(0);p.useEffect(()=>{const n=e.pathname;if(!r.current){r.current=n,a.current=Date.now();return}const o=Date.now()-a.current;r.current!==n&&(An(r.current,n,o),r.current=n,a.current=Date.now())},[e])}function Yh({fields:e,validateOnChange:r=!1,validateOnBlur:a=!0}){const n=p.useMemo(()=>{const C={};for(const I in e)C[I]=e[I].initialValue;return C},[e]),[o,s]=p.useState(n),[l,i]=p.useState({}),[d,c]=p.useState({}),[h,g]=p.useState({}),y=p.useCallback(C=>{const I=e[C],L=o[C];if(I.required&&(L===""||L===null||L===void 0||Array.isArray(L)&&L.length===0))return I.requiredMessage||"This field is required";if(I.validate)for(const P of I.validate){const U=P(L);if(U)return U}},[e,o]),m=p.useCallback((C,I)=>{if(s(L=>({...L,[C]:I})),g(L=>({...L,[C]:!0})),r&&d[C]){const L=y(C);i(P=>({...P,[C]:L}))}},[r,d,y]),b=p.useCallback(C=>{s(L=>({...L,...C}));const I={};for(const L in C)I[L]=!0;g(L=>({...L,...I}))},[]),v=p.useCallback(C=>{if(c(I=>({...I,[C]:!0})),a){const I=y(C);i(L=>({...L,[C]:I}))}},[a,y]),w=p.useCallback(()=>{const C={},I={};let L=!0;for(const P in e){I[P]=!0;const U=y(P);U&&(C[P]=U,L=!1)}return c(I),i(C),L},[e,y]),S=p.useCallback(()=>{s(n),i({}),c({}),g({})},[n]),k=p.useCallback(C=>{s(I=>({...I,[C]:e[C].initialValue})),i(I=>{const L={...I};return delete L[C],L}),c(I=>{const L={...I};return delete L[C],L}),g(I=>{const L={...I};return delete L[C],L})},[e]),x=p.useCallback(C=>({value:o[C],onChange:I=>{m(C,I.target.value)},onBlur:()=>v(C),name:String(C),"aria-invalid":!!(d[C]&&l[C])}),[o,m,v,d,l]),N=p.useCallback(C=>d[C]?l[C]:void 0,[d,l]),E=p.useMemo(()=>{for(const C in e)if(y(C))return!1;return!0},[e,y]),A=p.useMemo(()=>Object.values(h).some(Boolean),[h]);return{values:o,errors:l,touched:d,dirty:h,isValid:E,isDirty:A,setValue:m,setValues:b,setTouched:v,validateField:y,validateAll:w,reset:S,resetField:k,getFieldProps:x,getFieldError:N}}const Kh=e=>{if(e===0)return"0 Bytes";const r=1024,a=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(r)),o=Math.min(n,a.length-1);return parseFloat((e/Math.pow(r,o)).toFixed(2))+" "+a[o]},Zh=(e,r,a)=>{const n={bytes:0,kb:1,mb:2,gb:3,tb:4},o=1024,l=e*Math.pow(o,n[r])/Math.pow(o,n[a]);return Math.round(l*100)/100},Xh=e=>{const r=e.match(/^(\d+(?:\.\d+)?)\s*(bytes?|kb|mb|gb|tb)$/i);if(!r)return null;const a=parseFloat(r[1]),n=r[2].toLowerCase(),s={bytes:1,byte:1,kb:1024,mb:1024*1024,gb:1024*1024*1024,tb:1024*1024*1024*1024}[n];return s?Math.round(a*s):null},Qh=e=>e,Jh=e=>{if(typeof document>"u")return;const r=document.createElement("style");r.textContent=e,r.setAttribute("data-critical","true"),document.head.appendChild(r)},Rh=e=>{if(typeof document>"u")return;const r=document.createElement("link");r.rel="preload",r.as="style",r.href=e,r.onload=()=>{r.rel="stylesheet"},document.head.appendChild(r);const a=document.createElement("noscript");a.innerHTML=`<link rel="stylesheet" href="${e}">`,document.head.appendChild(a)},ef=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[`--${a}`]=typeof n=="number"?`${n}px`:n}),r},rf={xs:475,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},tf=(e,r=rf)=>{const[a,n]=p.useState("base");return p.useEffect(()=>{const o=()=>{const s=window.innerWidth;s>=r["2xl"]?n("2xl"):s>=r.xl?n("xl"):s>=r.lg?n("lg"):s>=r.md?n("md"):s>=r.sm?n("sm"):s>=r.xs?n("xs"):n("base")};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[r]),e[a]||e.base||{}},Hn=()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,af=()=>{const[e,r]=p.useState(Hn);return p.useEffect(()=>{const a=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>{r(a.matches)};return a.addEventListener?a.addEventListener("change",n):a.addListener(n),()=>{a.removeEventListener?a.removeEventListener("change",n):a.removeListener(n)}},[]),e},nf=(e,r=["layout","paint"])=>{e&&(e.style.contain=r.join(" "))},of=(e,r)=>e?(e.style.willChange=r.join(", "),()=>{e.style.willChange="auto"}):void 0,sf=e=>{typeof window>"u"||requestAnimationFrame(()=>{e.forEach(r=>r())})},lf=(...e)=>e.filter(Boolean).join(" "),cf=e=>{const r={},a=["display","position","width","height","margin","padding","fontSize","fontFamily","color","backgroundColor"];return Object.entries(e).forEach(([n,o])=>{a.includes(n)&&(r[n]=o)}),r},df=(e,r=[])=>{const[a,n]=p.useState(null),[o,s]=p.useState(!0);return p.useEffect(()=>{let l=!0;return e().then(i=>{l&&(n(i.default),s(!1))}),()=>{l=!1}},[e,...r]),{styles:a,loading:o}},uf=(e,r="1rem")=>({display:"grid",gridTemplateColumns:`repeat(${e}, minmax(0, 1fr))`,gap:r,contain:"layout",willChange:"transform"}),gf=(e="row",r="center",a="flex-start")=>({display:"flex",flexDirection:e,alignItems:r,justifyContent:a,contain:"layout"}),hf=e=>{const[r,a]=p.useState(!1);return p.useEffect(()=>{const n=window.matchMedia(e);a(n.matches);const o=()=>a(n.matches);return n.addEventListener?n.addEventListener("change",o):n.addListener(o),()=>{n.removeEventListener?n.removeEventListener("change",o):n.removeListener(o)}},[e]),r},ff=(e,r)=>{const[a,n]=p.useState("light");return p.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)");n(o.matches?"dark":"light");const s=()=>{n(o.matches?"dark":"light")};return o.addEventListener?o.addEventListener("change",s):o.addListener(s),()=>{o.removeEventListener?o.removeEventListener("change",s):o.removeListener(s)}},[]),a==="dark"?r:e},bf=e=>{const r={src:e.src,alt:e.alt,loading:e.loading||"lazy"};return e.title&&(r.title=e.title),e.width&&(r.width=e.width),e.height&&(r.height=e.height),e.sizes&&(r.sizes=e.sizes),e.srcSet&&(r.srcSet=e.srcSet),r.itemProp="image",r},mf=(e,r=[320,640,768,1024,1280,1920])=>r.map(a=>`${e.replace(/\{width\}/g,a.toString())} ${a}w`).join(", "),yf=e=>e.map(r=>r.maxWidth?`(max-width: ${r.maxWidth}px) ${r.size}`:r.size).join(", "),pf=(e,r="openGraph")=>{const a={};return r==="openGraph"?(a["og:image"]=e.url,e.width&&(a["og:image:width"]=e.width.toString()),e.height&&(a["og:image:height"]=e.height.toString()),e.alt&&(a["og:image:alt"]=e.alt),e.type&&(a["og:image:type"]=e.type)):(a["twitter:image"]=e.url,e.alt&&(a["twitter:image:alt"]=e.alt)),a},vf=(e='img[loading="lazy"]')=>{if(typeof window>"u"||!("IntersectionObserver"in window))return;const r=document.querySelectorAll(e);if("loading"in HTMLImageElement.prototype){r.forEach(n=>{n.dataset.src&&(n.src=n.dataset.src)});return}const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.dataset.src&&(s.src=s.dataset.src,s.removeAttribute("data-src")),s.dataset.srcset&&(s.srcset=s.dataset.srcset,s.removeAttribute("data-srcset")),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});return r.forEach(n=>a.observe(n)),()=>{r.forEach(n=>a.unobserve(n))}},qn=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=r.onerror=function(){e(r.height===2)},r.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA"}),Gn=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=()=>e(!0),r.onerror=()=>e(!1),r.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="}),wf=async(e="jpg")=>{const[r,a]=await Promise.all([qn(),Gn()]);return a?"avif":r?"webp":e},kf=(e,r,a,n)=>`
65
+ `,children:o?"Verified":n?"Current Plan":"Select Plan"})]})},au=({children:e,backgroundClassName:r="",contentClassName:a=""})=>t.jsx("div",{className:r,children:t.jsx("div",{className:a,children:e})}),nu=({title:e,description:r})=>t.jsxs("div",{className:"mb-8",children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:e}),r&&t.jsx("p",{className:"mt-2 text-gray-600 dark:text-gray-400",children:r})]}),ou=({children:e,mode:r,className:a,as:n="div",withPadding:o=!0})=>{const s=he(),l=r?su(r,o):o?s.containerClass:s.maxWidthClass;return t.jsx(n,{className:f(l,a),children:e})};function su(e,r){const a={standard:"max-w-7xl mx-auto",wide:"max-w-[1920px] mx-auto",full:"w-full"};return r?`${a[e]} px-4`:a[e]}const lu=({variant:e="full",sticky:r=!1,className:a,children:n})=>{const{containerClass:o}=he(),s=e==="compact";return t.jsx("footer",{className:f("bg-gray-900 text-white transition-all duration-300 ease-in-out",s?"py-4":"py-12",r?"sticky bottom-0 z-50 border-t border-gray-700":"relative z-10","pointer-events-auto",a),children:t.jsx("div",{className:o,children:n})})},iu=({children:e,className:r})=>t.jsx("div",{className:f("grid md:grid-cols-5 gap-8",r),children:e}),cu=({children:e,description:r,className:a})=>t.jsxs("div",{className:a,children:[t.jsx("div",{className:"mb-4",children:e}),r&&t.jsx("p",{className:O.body.sm(),children:r})]}),du=({title:e,children:r,className:a})=>t.jsxs("div",{className:a,children:[t.jsx("h3",{className:f(O.heading.h5(),"mb-4 text-white"),children:e}),t.jsx("ul",{className:f("space-y-2",O.body.sm()),children:r})]}),uu=({children:e,className:r})=>t.jsx("li",{className:f("hover:text-white transition-colors",r),children:e}),gu=({children:e,className:r})=>t.jsx("div",{className:f("border-t mt-8 pt-8 text-center space-y-4",xo.border.default,r),children:e}),hu=({children:e,className:r})=>p.Children.toArray(e).filter(Boolean).length===0?null:t.jsx("div",{className:f("flex items-center justify-center gap-3 text-gray-400 text-sm",r),children:e}),fu=({children:e,className:r})=>t.jsx("div",{className:f("flex flex-col sm:flex-row justify-between items-center space-y-2 sm:space-y-0",r),children:e}),bu=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-3 text-gray-400 text-sm",r),children:e}),mu=({children:e,className:r})=>t.jsx("div",{className:f("flex space-x-6 text-sm",r),children:e}),yu=({version:e,className:r})=>t.jsxs("span",{className:f("text-gray-500",r),children:["v",e]}),pu=({year:e,companyName:r,rightsText:a,companyLink:n,className:o})=>t.jsxs("span",{className:o,children:["© ",e," ",n||t.jsx("span",{className:"text-blue-400",children:r}),a&&`. ${a}`]}),Se=({href:e,label:r,children:a})=>t.jsx($a,{content:r,children:t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":r,children:a})}),vu=({twitterUrl:e,redditUrl:r,discordUrl:a,linkedinUrl:n,farcasterUrl:o,telegramUrl:s,githubUrl:l,className:i})=>e||r||a||n||o||s||l?t.jsxs("div",{className:f("flex items-center gap-4",i),children:[e&&t.jsx(Se,{href:e,label:"Twitter / X",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),r&&t.jsx(Se,{href:r,label:"Reddit",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})})}),a&&t.jsx(Se,{href:a,label:"Discord",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}),n&&t.jsx(Se,{href:n,label:"LinkedIn",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})}),o&&t.jsx(Se,{href:o,label:"Farcaster",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M18.24 2.4H5.76a3.36 3.36 0 0 0-3.36 3.36v12.48a3.36 3.36 0 0 0 3.36 3.36h12.48a3.36 3.36 0 0 0 3.36-3.36V5.76a3.36 3.36 0 0 0-3.36-3.36zm-2.16 13.2h-1.2v-4.8h-5.76v4.8H7.92V8.4h1.2v3.6h5.76V8.4h1.2v7.2z"})})}),s&&t.jsx(Se,{href:s,label:"Telegram",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})}),l&&t.jsx(Se,{href:l,label:"GitHub",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})})]}):null,wu=({isSelected:e,onClick:r,icon:a,label:n,description:o,className:s=""})=>t.jsxs("div",{onClick:r,className:`relative flex items-start p-4 cursor-pointer transition-all border-b border-gray-200 dark:border-gray-700 last:border-b-0 group ${s}`,children:[e&&t.jsx("div",{className:"absolute inset-1 bg-blue-500/10 dark:bg-blue-400/10 rounded-lg pointer-events-none"}),t.jsxs("div",{className:"relative z-10 flex items-start w-full",children:[a&&t.jsx(a,{className:`h-5 w-5 mt-0.5 mr-3 flex-shrink-0 transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:`font-medium transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-gray-100 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`,children:n}),o&&t.jsx("div",{className:`text-xs mt-0.5 transition-colors ${e?"text-blue-500 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}`,children:o})]})]})]}),ku=({masterTitle:e,masterSubtitle:r,backButtonText:a,masterContent:n,detailContent:o,detailTitle:s,mobileView:l="navigation",onBackToNavigation:i,masterClassName:d="",detailClassName:c="",detailTitleClassName:h="",masterWidth:g=320,stickyMaster:y=!0,stickyTopOffset:m=96,desktopGap:b=32,showMasterBackground:v=!0,enableAnimations:w=!0,animationDuration:S=300,animationRef:k})=>{const{containerClass:x}=he(),N=`gap-${Math.round(b/4)}`||"gap-8",E=$=>$?$.split("-")[0].trim():"Back",A=a?E(a):e?E(e):"Back",[C,I]=p.useState(!1),[L,P]=p.useState("auto"),U=p.useRef(null),j=p.useRef(null);p.useEffect(()=>(k&&(k.current={triggerTransition:$=>{if(!w){$();return}if(U.current){const R=U.current.scrollHeight;P(R)}I(!0),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{$(),setTimeout(()=>{if(U.current){const R=U.current.scrollHeight;P(R),setTimeout(()=>{P("auto"),I(!1)},S)}},50)},S/2)}}),()=>{j.current&&clearTimeout(j.current)}),[w,S,k]);const B=w?{height:L==="auto"?"auto":`${L}px`,transition:`height ${S}ms cubic-bezier(0.4, 0, 0.2, 1)`,width:"100%",maxWidth:"100%"}:{width:"100%",maxWidth:"100%"},D=w?`${C?"opacity-0 transform translate-y-2":"opacity-100 transform translate-y-0"}`:"",F=w?{transition:`opacity ${S}ms ease-in-out, transform ${S}ms ease-in-out`}:{};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`md:hidden ${l==="navigation"?"block":"hidden"} flex-1`,children:t.jsxs("div",{className:v?"bg-white dark:bg-gray-800 p-6":"p-6",children:[e&&t.jsxs("div",{className:x,children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r})]}),t.jsx("div",{className:d,children:n})]})}),t.jsxs("div",{className:`${x} py-8`,children:[t.jsxs("div",{className:`md:hidden ${l==="content"?"block":"hidden"}`,children:[l==="content"&&i&&t.jsxs("button",{onClick:i,className:"mb-4 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:["← ",A]}),t.jsx("div",{ref:U,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${c}`,style:B,children:t.jsxs("div",{className:D,style:F,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${h}`,children:s}),o]})})]}),t.jsxs("div",{className:`hidden md:flex min-h-full ${N}`,style:{width:"100%"},children:[t.jsx("aside",{className:"flex-shrink-0",style:{width:`${g}px`,minWidth:`${g}px`},children:t.jsxs("div",{className:y?"sticky":"",style:y?{top:`${m}px`}:void 0,children:[e&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r}),t.jsx("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${y?"max-h-[calc(100vh-200px)] overflow-y-auto":""} ${d}`,children:n})]})}),t.jsx("div",{className:"flex-1 min-w-0",style:{width:`calc(100% - ${g+b}px)`},children:t.jsx("div",{ref:U,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${c}`,style:B,children:t.jsxs("div",{className:D,style:F,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${h}`,children:s}),o]})})})]})]})]})},lt=p.createContext(null),Za=({children:e,variant:r="default",sticky:a=!0})=>{const[n,o]=p.useState(!1),s=p.useCallback(()=>{o(l=>!l)},[]);return t.jsx(lt.Provider,{value:{variant:r,sticky:a,mobileMenuOpen:n,setMobileMenuOpen:o,toggleMobileMenu:s},children:e})},it=()=>{const e=p.useContext(lt);if(!e)throw new Error("useTopbar must be used within a TopbarProvider");return e},Xa={sm:"min-h-12",md:"min-h-14",lg:"min-h-16"},xu={default:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",app:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 shadow-sm",minimal:"bg-transparent",transparent:"bg-white/80 dark:bg-gray-900/80 border-b border-gray-200/50 dark:border-gray-700/50"},Nu={default:"z-40",high:"z-50",highest:"z-[60]"},Cu=({children:e,variant:r="default",sticky:a=!0,className:n,height:o="md",blur:s=!1,zIndex:l="high","aria-label":i="Main navigation"})=>{const{containerClass:d}=he();return t.jsx(Za,{variant:r,sticky:a,children:t.jsxs("header",{role:"banner","aria-label":i,className:f("w-full",Xa[o],xu[r],Nu[l],a&&"sticky top-0",s&&"backdrop-blur-md","transition-colors duration-200",n),children:[t.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 bg-blue-600 text-white px-4 py-2 rounded-md z-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Skip to main content"}),t.jsx("div",{className:f(d,Xa[o],"flex flex-wrap items-center justify-between"),children:e})]})})},Su=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),Eu=({children:e,className:r})=>t.jsx("div",{className:f("flex-1 flex items-center justify-center px-4",r),children:e}),Tu=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),Au=({children:e,className:r})=>t.jsx("div",{className:f("md:hidden w-full basis-full pt-2 pb-3",r),children:e}),Iu=({className:e})=>t.jsx("div",{className:f("hidden md:block h-6 w-px bg-gray-200 dark:bg-gray-700 mx-2",e),role:"separator","aria-orientation":"vertical"}),Lu={sm:"h-6",md:"h-8",lg:"h-10"},Mu=({children:e,src:r,alt:a="Logo",onClick:n,href:o,className:s,size:l="md"})=>{const i=e||r&&t.jsx("img",{src:r,alt:a,className:f(Lu[l],"w-auto object-contain")}),d=f("flex items-center","hover:opacity-80 transition-opacity duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-md",s);return o?t.jsx("a",{href:o,className:d,title:a,children:i}):n?t.jsx("button",{type:"button",onClick:n,className:d,title:a,"aria-label":`Go to ${a||"home"}`,children:i}):t.jsx("div",{className:d,children:i})},Pu={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},Ou=({className:e,isOpen:r})=>t.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:r?t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),Qa=({icon:e,"aria-label":r="Toggle navigation menu",className:a,onClick:n,hideAbove:o="lg",menuItems:s,LinkComponent:l})=>{const{mobileMenuOpen:i,toggleMobileMenu:d,setMobileMenuOpen:c}=it(),[h,g]=p.useState(!1),y=p.useRef(null);ir(y,()=>{g(!1)});const m=s?h:i,b=()=>{n?n():s?g(!h):d()},v=()=>{g(!1),c(!1)};return t.jsxs("div",{className:f("relative",Pu[o]),ref:y,children:[t.jsx("button",{type:"button",onClick:b,className:f("p-2 rounded-lg","text-gray-600 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",a),"aria-label":r,"aria-expanded":m,"aria-haspopup":s?"menu":void 0,"aria-controls":s?"topbar-dropdown-menu":"mobile-menu",children:e?t.jsx(e,{className:"h-6 w-6"}):t.jsx(Ou,{className:"h-6 w-6",isOpen:m})}),s&&h&&t.jsx("div",{id:"topbar-dropdown-menu",role:"menu",className:f("absolute left-0 top-full mt-2","min-w-[200px] py-2 rounded-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","shadow-lg","z-50"),children:s.map(w=>{const S=w.icon,k=t.jsxs(t.Fragment,{children:[S&&t.jsx(S,{className:"h-5 w-5 mr-3 flex-shrink-0"}),t.jsx("span",{children:w.label})]}),x=f("flex items-center w-full px-4 py-2.5 text-sm font-medium","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","transition-colors duration-150",w.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400",w.disabled&&"opacity-50 cursor-not-allowed");return w.href&&l?t.jsx(l,{href:w.href,className:x,children:t.jsx("div",{className:"flex items-center",onClick:v,children:k})},w.id):w.href?t.jsx("a",{href:w.href,role:"menuitem",className:x,onClick:v,children:k},w.id):t.jsx("button",{type:"button",role:"menuitem",className:x,onClick:()=>{v(),w.onClick?.()},disabled:w.disabled,children:k},w.id)})})]})},Uu={sm:{show:"hidden sm:flex",hide:"sm:hidden"},md:{show:"hidden md:flex",hide:"md:hidden"},lg:{show:"hidden lg:flex",hide:"lg:hidden"},xl:{show:"hidden xl:flex",hide:"xl:hidden"}},Du={left:"justify-start",center:"justify-center",right:"justify-end"},Ja=({items:e,className:r,collapseBelow:a="lg",LinkComponent:n,align:o="center"})=>{const[s,l]=p.useState(null),i=p.useRef(null);ir(i,()=>l(null));const d=(c,h=!1)=>{const g=c.children&&c.children.length>0,y=s===c.id,m=f("px-3 py-2 rounded-md text-sm font-medium","transition-colors duration-200",c.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700",c.disabled&&"opacity-50 cursor-not-allowed pointer-events-none",h&&"w-full text-left");return g?t.jsxs("div",{className:"relative",ref:i,children:[t.jsxs("button",{type:"button",onClick:()=>l(y?null:c.id),className:f(m,"flex items-center gap-1"),"aria-expanded":y,"aria-haspopup":"true",disabled:c.disabled,children:[c.icon&&t.jsx(c.icon,{className:"h-4 w-4 mr-1"}),c.label,t.jsx("svg",{className:f("h-4 w-4 transition-transform duration-200",y&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y&&t.jsx("div",{className:f("absolute top-full left-0 mt-1 py-1","min-w-[200px] rounded-md shadow-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","z-50"),children:c.children?.map(b=>t.jsx(ct,{item:b,LinkComponent:n,className:f("block px-4 py-2 text-sm","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700",b.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400"),onClick:()=>l(null)},b.id))})]},c.id):t.jsx(ct,{item:c,LinkComponent:n,className:m},c.id)};return t.jsx("nav",{className:f("flex items-center gap-1",Uu[a].show,Du[o],r),"aria-label":"Main navigation",children:e.map(c=>d(c))})},ct=({item:e,LinkComponent:r,className:a,onClick:n})=>{const o=()=>{n?.(),e.onClick?.()},s=t.jsxs(t.Fragment,{children:[e.icon&&t.jsx(e.icon,{className:"h-4 w-4 mr-2"}),e.label]});return e.href&&r?t.jsx(r,{href:e.href,className:f(a,"flex items-center"),children:s}):e.href?t.jsx("a",{href:e.href,className:f(a,"flex items-center"),onClick:o,children:s}):t.jsx("button",{type:"button",onClick:o,className:f(a,"flex items-center"),disabled:e.disabled,children:s})},ju=({items:e,isOpen:r,className:a,LinkComponent:n})=>{const{mobileMenuOpen:o,setMobileMenuOpen:s}=it();return r??o?t.jsx("div",{id:"mobile-menu",className:f("lg:hidden","border-t border-gray-200 dark:border-gray-700","bg-white dark:bg-gray-900","shadow-lg",a),children:t.jsx("nav",{className:"px-4 py-2 space-y-1","aria-label":"Mobile navigation",children:e.map(i=>t.jsx(ct,{item:i,LinkComponent:n,className:f("flex items-center w-full px-3 py-2 rounded-md text-base font-medium","transition-colors duration-200",i.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700"),onClick:()=>s(!1)},i.id))})}):null},_u=({items:e,LinkComponent:r,collapseBelow:a="lg",align:n="center",className:o,mobileMenuLabel:s="Toggle navigation menu",children:l})=>t.jsxs(t.Fragment,{children:[t.jsx(Qa,{hideAbove:a,menuItems:e,LinkComponent:r,"aria-label":s,className:o}),l,t.jsx(Ja,{items:e,collapseBelow:a,LinkComponent:r,align:n,className:o})]}),zu={sm:"gap-1",md:"gap-2",lg:"gap-3"},Bu={left:"justify-start",center:"justify-center",right:"justify-end"},Fu=({children:e,className:r,gap:a="md",align:n="right"})=>t.jsx("div",{className:f("flex items-center",zu[a],Bu[n],r),children:e}),Wu={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},$u={sm:"p-1.5",md:"p-2",lg:"p-2.5"},Vu=({icon:e,onClick:r,"aria-label":a,className:n,disabled:o=!1,badge:s,size:l="md"})=>t.jsxs("button",{type:"button",onClick:r,className:f("relative rounded-lg",$u[l],"text-gray-500 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-700 dark:hover:text-gray-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",o&&"opacity-50 cursor-not-allowed",n),"aria-label":a,disabled:o,children:[t.jsx(e,{className:Wu[l]}),s!==void 0&&s>0&&t.jsx("span",{className:f("absolute -top-1 -right-1","min-w-[18px] h-[18px] px-1","flex items-center justify-center","text-xs font-medium","bg-red-500 text-white rounded-full","ring-2 ring-white dark:ring-gray-900"),"aria-label":`${s} notifications`,children:s>99?"99+":s})]}),Hu={sm:"w-48",md:"w-64",lg:"w-96",full:"w-full"},qu=({placeholder:e="Search...",value:r,onChange:a,onSubmit:n,className:o,width:s="md",showOnMobile:l=!1})=>{const[i,d]=p.useState(r||""),c=g=>{const y=g.target.value;d(y),a?.(y)},h=g=>{g.preventDefault(),n?.(i)};return t.jsx("form",{onSubmit:h,className:f(!l&&"hidden md:block",o),role:"search",children:t.jsxs("div",{className:"relative",children:[t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{type:"search",value:i,onChange:c,placeholder:e,"aria-label":e,className:f(Hu[s],"pl-10 pr-4 py-2","text-sm","bg-gray-100 dark:bg-gray-800","border border-transparent","rounded-lg","text-gray-900 dark:text-gray-100","placeholder:text-gray-500 dark:placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white dark:focus:bg-gray-700 focus:border-transparent","transition-colors duration-200")})]})})},Gu=({title:e,description:r,keywords:a,canonical:n,ogType:o="website",ogImage:s,noIndex:l=!1,structuredData:i,twitterCard:d="summary_large_image",twitterSite:c,config:h,meta:g=[],links:y=[]})=>{const{appName:m,baseUrl:b,defaultDescription:v,defaultOgImage:w,defaultTwitterSite:S}=h,k=e?`${e} | ${m}`:m,x=r||v,N=s||w||`${b}/og-image.png`,E=c||S,A=n?`${b}${n}`:void 0,C=Array.isArray(a)?a.join(", "):a,I=i?Array.isArray(i)?i:[i]:[];return t.jsxs(Et.Helmet,{children:[t.jsx("title",{children:k}),t.jsx("meta",{name:"title",content:k}),x&&t.jsx("meta",{name:"description",content:x}),C&&t.jsx("meta",{name:"keywords",content:C}),l&&t.jsx("meta",{name:"robots",content:"noindex, nofollow"}),A&&t.jsx("link",{rel:"canonical",href:A}),t.jsx("meta",{property:"og:type",content:o}),A&&t.jsx("meta",{property:"og:url",content:A}),t.jsx("meta",{property:"og:title",content:k}),x&&t.jsx("meta",{property:"og:description",content:x}),t.jsx("meta",{property:"og:image",content:N}),t.jsx("meta",{property:"og:site_name",content:m}),t.jsx("meta",{name:"twitter:card",content:d}),E&&t.jsx("meta",{name:"twitter:site",content:E}),A&&t.jsx("meta",{name:"twitter:url",content:A}),t.jsx("meta",{name:"twitter:title",content:k}),x&&t.jsx("meta",{name:"twitter:description",content:x}),t.jsx("meta",{name:"twitter:image",content:N}),g.map((L,P)=>t.jsx("meta",{...L},P)),y.map((L,P)=>t.jsx("link",{...L},P)),I.map((L,P)=>t.jsx("script",{type:"application/ld+json",children:JSON.stringify(L)},P))]})},Yu=({contentType:e,aiSummary:r,technicalComplexity:a="intermediate"})=>t.jsxs(Et.Helmet,{children:[t.jsx("meta",{name:"ai:content-type",content:e}),t.jsx("meta",{name:"ai:summary",content:r}),t.jsx("meta",{name:"ai:complexity",content:a})]}),Ku=({children:e,className:r,...a})=>t.jsx("main",{className:r,...a,role:"main",children:e}),Zu=({children:e})=>t.jsx(t.Fragment,{children:e}),Oe=e=>Array.isArray(e)?e:typeof e=="string"?e.split(",").map(r=>r.trim()).filter(Boolean):[],Ee=e=>({appName:e.appName,baseUrl:e.baseUrl,twitterHandle:e.twitterHandle||"",emailDomain:e.emailDomain||"example.com"}),dt=e=>{const r=Oe(e.audience),a=Ee(e.branding);return{"@context":"https://schema.org","@type":"SoftwareApplication",name:a.appName,applicationCategory:"CommunicationApplication",operatingSystem:"Web Browser",description:e.description,url:a.baseUrl,downloadUrl:`${a.baseUrl}/connect`,installUrl:`${a.baseUrl}/connect`,screenshot:`${a.baseUrl}/screenshots/app-preview.jpg`,aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",reviewCount:"2500",bestRating:"5",worstRating:"1"},offers:[{"@type":"Offer",name:"Free Web3 Email",description:"Basic wallet-based email with unlimited sending",price:"0",priceCurrency:"USD",availability:"https://schema.org/InStock"},{"@type":"Offer",name:"Premium Web3 Email",description:"Advanced features with ENS/SNS domains and priority support",price:"2.00",priceCurrency:"USD",billingIncrement:"month",availability:"https://schema.org/InStock"}],featureList:["Passwordless wallet authentication","ENS domain email support (.eth)","Solana Name Service support (.sol)","Smart contract email integration","Multi-chain wallet compatibility","Cross-chain email addresses","DAO email delegation","Encrypted communication","Web2/Web3 bridge functionality","Point-based reward system"],applicationSubCategory:"Web3 Email Platform",audience:{"@type":"Audience",audienceType:r.join(", "),geographicArea:"Worldwide"},creator:{"@type":"Organization",name:a.appName,url:a.baseUrl},datePublished:"2024-01-01",dateModified:e.lastUpdated?.toISOString()||new Date().toISOString(),version:"1.0",softwareRequirements:"Web3 Wallet (MetaMask, Phantom, etc.)",storageRequirements:"5MB",memoryRequirements:"512MB RAM",supportingData:{blockchainNetworks:["Ethereum","Solana","Polygon","Arbitrum","Optimism"],supportedWallets:["MetaMask","Phantom","WalletConnect","Coinbase Wallet"],smartContractSupport:!0,ensCompatible:!0,snsCompatible:!0}}},ut=e=>{const r=Oe(e.keywords),a=Oe(e.audience),n=Ee(e.branding);return{"@context":"https://schema.org","@type":"TechnicalArticle",headline:e.title,description:e.description,author:{"@type":"Organization",name:n.appName,url:n.baseUrl,logo:{"@type":"ImageObject",url:`${n.baseUrl}/logo.png`}},publisher:{"@type":"Organization",name:n.appName,logo:{"@type":"ImageObject",url:`${n.baseUrl}/logo.png`,width:600,height:600}},datePublished:"2024-01-01T00:00:00Z",dateModified:e.lastUpdated?.toISOString()||new Date().toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":`${n.baseUrl}${location.pathname}`},image:{"@type":"ImageObject",url:`${n.baseUrl}/og-images/technical-guide.jpg`,width:1200,height:630},keywords:r.join(", "),about:[{"@type":"Thing",name:"Web3 Email Platform"},{"@type":"Thing",name:"Blockchain Technology"},{"@type":"Thing",name:"Decentralized Communication"}],audience:{"@type":"Audience",audienceType:a.join(", "),educationalLevel:e.complexity},educationalLevel:e.complexity,proficiencyLevel:e.complexity,learningResourceType:e.contentType,timeRequired:e.readingTime?`PT${e.readingTime}M`:"PT5M",inLanguage:"en",isAccessibleForFree:!0,license:"https://creativecommons.org/licenses/by/4.0/",teaches:e.relatedTopics||["Web3 email setup","Wallet connection process","Blockchain authentication","Smart contract integration"]}},Xu=(e,r)=>{const a=Ee(r);return{"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(n=>({"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:n.answer,dateCreated:new Date().toISOString(),upvoteCount:Math.floor(Math.random()*50)+10,author:{"@type":"Organization",name:a.appName}},answerCount:1,upvoteCount:Math.floor(Math.random()*100)+20,dateCreated:"2024-01-01T00:00:00Z",category:n.category||"General"}))}},gt=e=>{const r=Ee(e.branding);return{"@context":"https://schema.org","@type":"WebPage",name:e.title,description:e.description,url:`${r.baseUrl}${location.pathname}`,primaryImageOfPage:{"@type":"ImageObject",url:`${r.baseUrl}/og-images/ai-optimized.jpg`},significantLink:[`${r.baseUrl}/document`,`${r.baseUrl}/web3-users`,`${r.baseUrl}/web3-projects`,`${r.baseUrl}/connect`],relatedLink:e.relatedTopics?.map(a=>`${r.baseUrl}/search?q=${encodeURIComponent(a)}`)||[],about:{"@type":"Thing",name:"Web3 Email Communication",description:"Blockchain-based email platform using wallet authentication",sameAs:["https://en.wikipedia.org/wiki/Web3","https://en.wikipedia.org/wiki/Blockchain","https://en.wikipedia.org/wiki/Cryptocurrency_wallet"]},mentions:[{"@type":"SoftwareApplication",name:"MetaMask"},{"@type":"SoftwareApplication",name:"Phantom Wallet"},{"@type":"Thing",name:"Ethereum Name Service"},{"@type":"Thing",name:"Solana Name Service"}],isPartOf:{"@type":"WebSite","@id":r.baseUrl,name:r.appName},potentialAction:{"@type":"InteractAction",target:{"@type":"EntryPoint",urlTemplate:`${r.baseUrl}/connect`,actionPlatform:["https://schema.org/DesktopWebPlatform","https://schema.org/MobileWebPlatform"]},name:"Connect Web3 Wallet"}}},Ra=e=>{const r=Oe(e.keywords),a=Ee(e.branding);return{"og:title":e.title,"og:description":e.description,"og:type":"website","og:url":`${a.baseUrl}${location.pathname}`,"og:image":`${a.baseUrl}/og-images/${e.category}.jpg`,"og:image:width":"1200","og:image:height":"630","og:image:alt":`${e.title} - ${a.appName}`,"og:site_name":a.appName,"og:locale":"en_US","article:author":`${a.baseUrl}/about`,"article:section":e.category,"article:tag":r.join(","),"article:published_time":"2024-01-01T00:00:00Z","article:modified_time":e.lastUpdated?.toISOString()||new Date().toISOString()}},en=e=>{const r=Ee(e.branding);return{"twitter:card":"summary_large_image","twitter:site":r.twitterHandle||"","twitter:creator":r.twitterHandle||"","twitter:title":e.title,"twitter:description":e.description,"twitter:image":`${r.baseUrl}/twitter-cards/${e.category}.jpg`,"twitter:image:alt":`${e.title} - ${r.appName}`,"twitter:label1":"Category","twitter:data1":e.category,"twitter:label2":"Reading Time","twitter:data2":e.readingTime?`${e.readingTime} min`:"5 min"}},rn=e=>{const r=Oe(e.keywords),a=Oe(e.audience),n=Ee(e.branding);return{"ai:content-type":e.contentType,"ai:complexity":e.complexity,"ai:category":e.category,"ai:audience":a.join(","),"ai:keywords":r.join(","),"ai:reading-time":e.readingTime?.toString()||"5","web3:platform":"Email","web3:networks":"ethereum,solana,polygon","web3:wallets":"metamask,phantom,walletconnect","web3:features":"ens,sns,smart-contracts,multi-chain","llm:context":"Web3 email platform documentation and user guides","llm:domain":"blockchain,cryptocurrency,decentralized-communication","llm:use-case":"email,authentication,wallet-integration,smart-contracts","semantic:topic":e.category,"semantic:intent":"inform,guide,educate","semantic:entities":`${n.appName},Web3,blockchain,email,wallet`,"content:freshness":e.lastUpdated?.toISOString()||new Date().toISOString(),"content:authority":"high","content:expertise":"technical","content:trustworthiness":"verified"}},Qu=e=>({structuredData:{product:dt(e),article:ut(e),aiOptimized:gt(e)},openGraph:Ra(e),twitterCard:en(e),aiMetaTags:rn(e),jsonLD:[dt(e),ut(e),gt(e)]}),Ju={homepage:{title:"Revolutionary Web3 Email Platform | Wallet-Based Authentication",description:"Transform your email experience - the first Web3 email platform using wallet authentication. No passwords, enhanced security, ENS/SNS domain support, and smart contract integration.",keywords:["Web3 email","blockchain email","wallet authentication","ENS email","SNS email","decentralized email","smart contract integration"],category:"Web3 Platform",audience:["Crypto Users","Web3 Developers","DeFi Users","DAO Members"],complexity:"beginner",contentType:"overview",readingTime:3,relatedTopics:["Web3 authentication","Blockchain communication","Decentralized identity"]},documentation:{title:"Documentation - Complete Web3 Email Setup Guide",description:"Comprehensive documentation for Web3 email platform. Learn wallet connection, ENS/SNS setup, smart contract integration, and advanced features.",keywords:["Web3 email guide","wallet connection","ENS setup","SNS configuration","smart contract email","blockchain documentation"],category:"Technical Documentation",audience:["Developers","Technical Users","Web3 Enthusiasts"],complexity:"intermediate",contentType:"guide",readingTime:15,relatedTopics:["Wallet integration","Blockchain protocols","Email security"]},earnPoints:{title:"How to Earn Points - Web3 Email Rewards Guide",description:"Master the points system. Earn rewards through email activities, referrals, smart contract interactions, and prepare for future token distribution.",keywords:["Web3 rewards","email points","blockchain rewards","referral program","token preparation","crypto incentives"],category:"Rewards Guide",audience:["Token Farmers","Crypto Users","Web3 Users"],complexity:"beginner",contentType:"tutorial",readingTime:8,relatedTopics:["Token economics","Reward systems","Referral marketing"]}},Ru=e=>{const{level:r,text:a,className:n="",id:o,semanticContext:s="section"}=e,l=`h${r}`,i={1:"text-4xl md:text-5xl lg:text-6xl font-bold leading-tight",2:"text-3xl md:text-4xl font-bold leading-tight",3:"text-2xl md:text-3xl font-bold leading-tight",4:"text-xl md:text-2xl font-semibold leading-tight",5:"text-lg md:text-xl font-semibold leading-tight",6:"text-base md:text-lg font-medium leading-tight"},d={"page-title":"text-gray-900 dark:text-white mb-6",section:"text-gray-900 dark:text-white mb-4",subsection:"text-gray-900 dark:text-white mb-3",feature:"text-gray-900 dark:text-white mb-2",benefit:"text-blue-600 dark:text-blue-400 mb-2",step:"text-green-600 dark:text-green-400 mb-2"},c=[i[r],d[s],n].filter(Boolean).join(" "),h=o||a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");return p.createElement(l,{id:h,className:c,"aria-level":r},a)},oe={pageTitle:(e,r)=>({level:1,text:e,className:r,semanticContext:"page-title"}),majorSection:(e,r)=>({level:2,text:e,className:r,semanticContext:"section"}),feature:(e,r)=>({level:3,text:e,className:r,semanticContext:"feature"}),benefit:(e,r)=>({level:3,text:e,className:r,semanticContext:"benefit"}),step:(e,r,a)=>({level:3,text:r?`Step ${r}: ${e}`:e,className:a,semanticContext:"step"}),subFeature:(e,r)=>({level:4,text:e,className:r,semanticContext:"feature"})},eg=e=>{const r=[],a=[],n=e.filter(o=>o.level===1).length;n===0?r.push("Missing H1 tag - every page should have exactly one H1"):n>1&&r.push(`Multiple H1 tags found (${n}) - use only one H1 per page`);for(let o=1;o<e.length;o++){const s=e[o],l=e[o-1];s.level>l.level+1&&r.push(`Heading level jump from H${l.level} to H${s.level} - avoid skipping levels`)}return e.forEach((o,s)=>{o.text.length<3&&r.push(`Heading ${s+1} is too short - use descriptive text`),o.text.length>70&&a.push(`Heading "${o.text.substring(0,30)}..." is long - consider shortening for better SEO`)}),{isValid:r.length===0,errors:r,suggestions:a}},rg={walletConnection:oe.pageTitle("Connect Your Web3 Wallet"),emailBenefits:oe.majorSection("Why Choose Web3 Email?"),securityFeature:oe.feature("Secure & Private"),ensIntegration:oe.feature("ENS Domain Support"),multiChain:oe.feature("Multi-Chain Compatibility"),passwordless:oe.benefit("No Passwords Required"),setupStep1:oe.step("Connect Your Wallet",1),setupStep2:oe.step("Verify Your Identity",2),setupStep3:oe.step("Access Your Emails",3)},tg=[{term:"Web3 Email",definition:"Email system that uses blockchain wallet addresses as authentication instead of traditional passwords",category:"Web3 Communication",synonyms:["blockchain email","decentralized email","crypto email"],relatedTerms:["wallet authentication","ENS email","SNS email"],examples:["vitalik.eth@example.com","alice.sol@example.com"],context:"Web3 email revolutionizes digital communication by eliminating passwords and using cryptographic signatures for authentication"},{term:"Wallet Authentication",definition:"Authentication method using cryptographic signatures from blockchain wallets instead of passwords",category:"Security",synonyms:["wallet-based auth","signature authentication","passwordless authentication"],relatedTerms:["EIP-712","SIWE","message signing"],examples:["MetaMask signature","Phantom wallet auth","WalletConnect login"],context:"Wallet authentication provides superior security through cryptographic proofs that cannot be phished or stolen like passwords"},{term:"ENS Email",definition:"Email addresses using Ethereum Name Service domains (.eth) as identifiers",category:"Naming Systems",synonyms:["Ethereum name email",".eth email"],relatedTerms:["ENS","Ethereum domains","blockchain domains"],examples:["vitalik.eth","ethereum.eth"],context:"ENS emails provide human-readable addresses that resolve to Ethereum wallet addresses"},{term:"SNS Email",definition:"Email addresses using Solana Name Service domains (.sol) as identifiers",category:"Naming Systems",synonyms:["Solana name email",".sol email"],relatedTerms:["SNS","Solana domains","SPL domains"],examples:["anatoly.sol","solana.sol"],context:"SNS emails provide human-readable addresses for Solana ecosystem users"},{term:"Smart Contract Integration",definition:"Ability to send and receive emails triggered by blockchain smart contract events",category:"Blockchain Integration",synonyms:["contract notifications","on-chain email triggers"],relatedTerms:["event listeners","webhooks","contract automation"],examples:["DAO proposal notifications","DeFi alert emails","NFT sale confirmations"],context:"Smart contract integration enables automated communication based on blockchain events"},{term:"Multi-Chain Support",definition:"Compatibility with multiple blockchain networks for wallet authentication and email services",category:"Interoperability",synonyms:["cross-chain support","blockchain agnostic"],relatedTerms:["EVM chains","Solana","Layer 2"],examples:["Ethereum, Polygon, Arbitrum, Solana support"],context:"Multi-chain support ensures users from any blockchain ecosystem can use the email service"},{term:"DAO Email Delegation",definition:"System allowing DAOs to manage email communications through delegated authorities",category:"Governance",synonyms:["governance email","multi-sig email"],relatedTerms:["DAO governance","multi-signature","delegation"],examples:["Treasury notifications","Proposal alerts","Voting reminders"],context:"DAO email delegation enables decentralized organizations to manage communications efficiently"},{term:"Web2/Web3 Bridge",definition:"Technology enabling communication between traditional email systems and blockchain-based email",category:"Interoperability",synonyms:["email bridge","legacy integration"],relatedTerms:["SMTP gateway","email forwarding","protocol bridge"],examples:["Gmail to Web3 email","Outlook integration"],context:"Web2/Web3 bridge ensures compatibility with existing email infrastructure"}],ag=e=>({"@context":"https://schema.org","@type":"LearningResource",educationalLevel:e.difficulty,learningResourceType:"Technical Documentation",timeRequired:e.estimatedTime?`PT${e.estimatedTime}M`:void 0,teaches:e.learningObjectives,requires:e.prerequisites,about:{"@type":"Thing",name:e.domain,category:e.category,subcategory:e.subcategory},keywords:e.concepts,applicationExample:e.practicalApplications,isRelatedTo:e.relatedConcepts}),ng=e=>{const r={nodes:e.map(a=>({id:a.term,label:a.term,category:a.category,definition:a.definition})),edges:[]};return e.forEach(a=>{a.relatedTerms?.forEach(n=>{e.find(s=>s.term===n)&&r.edges.push({source:a.term,target:n,relationship:"related_to"})}),a.synonyms?.forEach(n=>{r.edges.push({source:a.term,target:n,relationship:"synonym_of"})})}),r},og=e=>{const r=[];return e.examples?.forEach(a=>{r.push({text:a,label:e.term,type:"positive",confidence:1})}),e.context&&r.push({text:e.context,label:e.term,type:"contextual",confidence:.8}),r.push({text:`${e.term} is ${e.definition}`,label:e.term,type:"definition",confidence:1}),r},sg=e=>{const r=[];return e.forEach(a=>{r.push({question:`What is ${a.term}?`,answer:a.definition,category:a.category,difficulty:"basic"}),a.context&&r.push({question:`How does ${a.term} work?`,answer:a.context,category:a.category,difficulty:"intermediate"}),a.examples&&a.examples.length>0&&r.push({question:`What are examples of ${a.term}?`,answer:a.examples.join(", "),category:a.category,difficulty:"basic"}),a.relatedTerms&&a.relatedTerms.length>0&&r.push({question:`What is ${a.term} related to?`,answer:`${a.term} is related to ${a.relatedTerms.join(", ")}`,category:a.category,difficulty:"intermediate"})}),r},lg={homepage:{domain:"Web3 Email Platform",category:"Web3 Communication",concepts:["Web3 email","wallet authentication","passwordless login","blockchain messaging"],prerequisites:["Basic blockchain knowledge","Understanding of crypto wallets"],learningObjectives:["Understand Web3 email concepts","Learn wallet authentication","Explore blockchain communication"],difficulty:"beginner",estimatedTime:5,practicalApplications:["Secure email communication","DAO governance","DeFi notifications"]},documentation:{domain:"Web3 Email Technical Documentation",category:"Technical Guide",concepts:["API integration","smart contracts","wallet connection","email protocols"],prerequisites:["JavaScript/TypeScript","Web3 development basics","REST APIs"],learningObjectives:["Implement Web3 email","Integrate wallet authentication","Build on email API"],difficulty:"intermediate",estimatedTime:30,practicalApplications:["dApp integration","Email automation","Smart contract notifications"]},governance:{domain:"DAO Governance Communication",category:"Governance Tools",concepts:["DAO email","voting notifications","proposal tracking","multi-sig coordination"],prerequisites:["DAO basics","Governance understanding","Multi-signature wallets"],learningObjectives:["Setup DAO email","Configure voting alerts","Manage team communication"],difficulty:"advanced",estimatedTime:20,practicalApplications:["DAO operations","Treasury management","Governance participation"]}},ig=({children:e,appName:r,appUrl:a,apiUrl:n})=>(p.useEffect(()=>{const o=()=>{[].forEach(b=>{const v=document.createElement("link");v.rel="preload",v.href=b.href,v.as=b.as,b.type&&(v.type=b.type),b.crossorigin&&(v.crossOrigin=""),document.head.appendChild(v)})},s=()=>{document.querySelectorAll('img[data-priority="high"]').forEach(v=>{v.fetchPriority="high"});const b=document.querySelector("[data-hero]");if(b){const v=b.getAttribute("data-bg-image");if(v){const w=document.createElement("link");w.rel="preload",w.href=v,w.as="image",document.head.appendChild(w)}}},l=()=>{document.querySelectorAll("img:not([width]):not([height])").forEach(v=>{const w=v;w.naturalWidth&&w.naturalHeight&&(w.width=w.naturalWidth,w.height=w.naturalHeight)}),document.querySelectorAll("[data-dynamic]").forEach(v=>{v.getAttribute("style")?.includes("min-height")||(v.style.minHeight="200px")})},i=()=>{const m=()=>{document.querySelectorAll("script[data-defer]").forEach(w=>{w.setAttribute("defer","")})};"requestIdleCallback"in window?requestIdleCallback(()=>{m()}):setTimeout(m,1),(()=>{["scroll","touchstart","touchmove","wheel"].forEach(w=>{document.addEventListener(w,()=>{},{passive:!0})})})()},d=()=>{},c=()=>{[{rel:"dns-prefetch",href:"//fonts.googleapis.com"},...n?[{rel:"dns-prefetch",href:`//${n.replace(/^https?:\/\//,"")}`}]:[],{rel:"preconnect",href:"https://fonts.gstatic.com",crossorigin:!0},...n?[{rel:"preconnect",href:n}]:[]].forEach(b=>{const v=document.createElement("link");v.rel=b.rel,v.href=b.href,b.crossorigin&&(v.crossOrigin=""),document.head.appendChild(v)})},h=()=>{if(document.querySelectorAll("img[data-lazy]").forEach(b=>{b.loading="lazy"}),"IntersectionObserver"in window){const b=new IntersectionObserver(w=>{w.forEach(S=>{if(S.isIntersecting){const k=S.target;k.dataset.src&&(k.src=k.dataset.src,k.removeAttribute("data-src")),b.unobserve(k)}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(w=>b.observe(w))}},g=()=>{[{name:"ai-content-type",content:"web3-email-platform"},{name:"ai-primary-function",content:"wallet-based-email"},{name:"ai-supported-chains",content:"ethereum,solana,polygon,arbitrum,optimism"},{name:"ai-complexity-level",content:"beginner-to-advanced"},{name:"ai-target-users",content:"web3-users,crypto-enthusiasts,developers"},{name:"machine-readable",content:"true"},{name:"structured-data",content:"json-ld"},{name:"content-category",content:"technology,blockchain,communication"},{name:"interaction-model",content:"wallet-authentication"}].forEach(({name:w,content:S})=>{if(!document.querySelector(`meta[name="${w}"]`)){const k=document.createElement("meta");k.name=w,k.content=S,document.head.appendChild(k)}});const b={"@context":"https://schema.org","@type":"WebApplication",name:r,description:"Web3 email platform using blockchain wallet authentication",url:a,applicationCategory:"CommunicationApplication",operatingSystem:"Web Browser",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},featureList:["Wallet-based authentication","ENS domain email support","SNS domain email support","Multi-chain compatibility","Smart contract integration","Web2/Web3 bridge"],audience:{"@type":"Audience",audienceType:"Web3 Users"}},v=document.createElement("script");v.type="application/ld+json",v.textContent=JSON.stringify(b),document.head.appendChild(v)},y=()=>{document.querySelectorAll('link[rel="stylesheet"][data-non-critical]').forEach(b=>{const v=b.cloneNode(!0);v.rel="preload",v.as="style",v.onload=()=>{v.onload=null,v.rel="stylesheet"},document.head.appendChild(v),b.remove()})};return o(),s(),l(),i(),c(),h(),g(),y(),setTimeout(d,2e3),()=>{}},[n,r,a]),t.jsx(t.Fragment,{children:e})),cg=()=>(p.useEffect(()=>{if(typeof window>"u"||typeof document>"u"||!document.documentElement)return;const e=()=>{if("IntersectionObserver"in window){const i=new IntersectionObserver(d=>{d.forEach(c=>{if(c.isIntersecting){const h=c.target;h.dataset.src&&(h.src=h.dataset.src,h.removeAttribute("data-src"),i.unobserve(h))}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(d=>{i.observe(d)})}const o=()=>{["/connect","/mail","/settings"].forEach(d=>{const c=document.createElement("link");c.rel="prefetch",c.href=d,document.head.appendChild(c)})},s=()=>{if(!document.querySelector("script[data-wallet-detection]")){const i=document.createElement("script");i.dataset.walletDetection="true",i.innerHTML='(function() { window.walletPreload = { hasMetaMask: typeof window.ethereum !== "undefined", hasPhantom: typeof window.solana !== "undefined", hasWalletConnect: true }; })();',document.head.appendChild(i)}},l=()=>{document.querySelectorAll("img[data-hero]").forEach(i=>{const d=i;d.loading="eager","fetchPriority"in d&&(d.fetchPriority="high")}),document.querySelectorAll('img[data-priority="low"]').forEach(i=>{const d=i;d.loading="lazy","fetchPriority"in d&&(d.fetchPriority="low")})};requestIdleCallback(()=>{o(),s(),l()},{timeout:2e3})},r=()=>{if("PerformanceObserver"in window){const o=new PerformanceObserver(l=>{const i=l.getEntries(),d=i[i.length-1];d&&d.startTime>2500&&(document.documentElement.style.setProperty("--animation-duration","0s"),localStorage.setItem("reduce-image-quality","true"))});try{o.observe({entryTypes:["largest-contentful-paint"]})}catch{}const s=new PerformanceObserver(l=>{let i=0;for(const d of l.getEntries())d.hadRecentInput||(i+=d.value);i>.1&&document.querySelectorAll("img:not([width]):not([height])").forEach(d=>{const c=d;c.style.aspectRatio="16/9"})});try{s.observe({entryTypes:["layout-shift"]})}catch{}}},a=()=>{if("connection"in navigator&&typeof document<"u"&&document.documentElement){const o=navigator.connection;if(o){const s=o.effectiveType;s==="slow-2g"||s==="2g"?(document.documentElement.classList.add("slow-connection"),document.querySelectorAll('link[rel="prefetch"]').forEach(l=>{l.getAttribute("data-critical")||l.remove()}),localStorage.setItem("use-low-quality-images","true")):s==="3g"?document.documentElement.classList.add("moderate-connection"):document.documentElement.classList.add("fast-connection")}}};return(()=>{e(),r(),a()})(),()=>{if("PerformanceObserver"in window)try{PerformanceObserver.supportedEntryTypes.forEach(()=>{})}catch{}}},[]),null),dg=({children:e})=>t.jsx(t.Fragment,{children:e}),tn={user:{duration:300*1e3,maxSize:100,staleWhileRevalidate:!0},mailboxes:{duration:120*1e3,maxSize:50,staleWhileRevalidate:!0},addresses:{duration:600*1e3,maxSize:50,staleWhileRevalidate:!0},messages:{duration:30*1e3,maxSize:200,staleWhileRevalidate:!0},messageDetails:{duration:120*1e3,maxSize:100,staleWhileRevalidate:!1},messageCount:{duration:10*1e3,maxSize:20,staleWhileRevalidate:!0}};class ug{constructor(){this.cache=new Map}set(r,a,n){if(this.cache.size>=n.maxSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}this.cache.set(r,{data:a,timestamp:Date.now(),isStale:!1})}get(r,a){const n=this.cache.get(r);if(!n)return null;const s=Date.now()-n.timestamp>a.duration;return s&&!a.staleWhileRevalidate?(this.cache.delete(r),null):{data:n.data,isStale:s}}invalidate(r){for(const a of this.cache.keys())a.includes(r)&&this.cache.delete(a)}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,keys:Array.from(this.cache.keys()),memory:this.estimateMemoryUsage()}}estimateMemoryUsage(){return Array.from(this.cache.values()).reduce((r,a)=>r+JSON.stringify(a).length*2,0)}}const Ue=new ug,Te=new Map,an=async(e,r,a="messages")=>{const n=tn[a],o=Ue.get(e,n);if(o&&!o.isStale)return o.data;const s=Te.get(e);if(s)return s;if(o&&o.isStale&&n.staleWhileRevalidate){const i=r().then(d=>(Ue.set(e,d,n),Te.delete(e),d)).catch(d=>{throw Te.delete(e),d});return Te.set(e,i),o.data}const l=r().then(i=>(Ue.set(e,i,n),Te.delete(e),i)).catch(i=>{throw Te.delete(e),i});return Te.set(e,l),l};class gg{constructor(){this.queue=[],this.timer=null,this.batchDelay=10}add(r,a){return new Promise((n,o)=>{this.queue.push({key:r,fetcher:a,resolve:n,reject:o}),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.processBatch()},this.batchDelay)})}async processBatch(){const r=[...this.queue];this.queue.length=0,this.timer=null;const a=this.groupRequests(r);for(const n of a)await Promise.allSettled(n.map(async o=>{try{const s=await o.fetcher();o.resolve(s)}catch(s){o.reject(s)}}))}groupRequests(r){const a=[];for(let o=0;o<r.length;o+=5)a.push(r.slice(o,o+5));return a}}const hg=new gg;class fg{constructor(r,a={}){this.requestInterceptors=[],this.responseInterceptors=[],this.baseURL=r,this.defaultHeaders=a}addRequestInterceptor(r){this.requestInterceptors.push(r)}addResponseInterceptor(r){this.responseInterceptors.push(r)}async request(r,a={},n,o="messages"){const s=`${this.baseURL}${r}`,l=n||`${a.method||"GET"}:${s}`,i=async()=>{let d={...a,headers:{...this.defaultHeaders,...a.headers}};for(const h of this.requestInterceptors)d=h(d);let c=await fetch(s,d);for(const h of this.responseInterceptors)c=await h(c);if(!c.ok)throw new Error(`API Error: ${c.status} ${c.statusText}`);return c.json()};return a.method==="GET"&&this.shouldBatch(r)?hg.add(l,i):an(l,i,o)}shouldBatch(r){return r.includes("/messages/")&&!r.includes("/messages?")}async get(r,a){return this.request(r,{method:"GET"},void 0,a)}async post(r,a){return this.request(r,{method:"POST",body:JSON.stringify(a)})}async put(r,a){return this.request(r,{method:"PUT",body:JSON.stringify(a)})}async delete(r){return this.request(r,{method:"DELETE"})}}const bg=async(e,r=3,a=1e3)=>{let n;for(let o=0;o<=r;o++)try{return await e()}catch(s){if(n=s,o===r)throw n;const l=a*Math.pow(2,o)+Math.random()*1e3;await new Promise(i=>setTimeout(i,l))}throw n};class mg{constructor(){this.abortController=new AbortController}async request(r,a={}){const n=await fetch(r,{...a,signal:this.abortController.signal});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);return n.json()}cancel(){this.abortController.abort()}}const yg={invalidate:e=>Ue.invalidate(e),clear:()=>Ue.clear(),getStats:()=>Ue.getStats(),warmUp:async e=>{await Promise.allSettled(e.map(r=>r()))},prefetch:async e=>{"requestIdleCallback"in window?window.requestIdleCallback(async()=>{await Promise.allSettled(e.map(r=>r()))}):setTimeout(async()=>{await Promise.allSettled(e.map(r=>r()))},100)}};function nn(){if(typeof window>"u")return!1;const e=window.navigator.userAgent.toLowerCase();return["metamask","trustwallet","coinbase","rainbow","phantom","solflare","exodus","ledger","binance","okx"].some(a=>e.includes(a))}function on(){return typeof window>"u"?!1:window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"}function sn(){if(typeof window>"u")return!1;const e=window.location.hostname;return/^\d+\.\d+\.\d+\.\d+$/.test(e)}function ln(){return on()?"localhost":nn()?"wallet-browser":sn()?"network":"production"}function pg(){const e=ln();return e==="localhost"||e==="wallet-browser"}function vg(e){}function cn(){return typeof window<"u"}function wg(){return typeof window<"u"}function kg(e,r){if(cn())e();else return r}const ht=e=>({"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'","'unsafe-eval'","https://fonts.googleapis.com","https://www.googletagmanager.com","https://www.google-analytics.com"],"style-src":["'self'","'unsafe-inline'","https://fonts.googleapis.com","https://fonts.gstatic.com"],"font-src":["'self'","https://fonts.gstatic.com","data:"],"img-src":["'self'","data:","https:","blob:"],"connect-src":["'self'",...e?.apiUrls||[],...e?.appUrls||[],"https://*.walletconnect.com","https://*.walletconnect.org","https://registry.walletconnect.com","https://relay.walletconnect.com","wss://*.walletconnect.com","wss://*.walletconnect.org","https://keys.coinbase.com","https://api.coinbase.com","https://www.walletlink.org","https://mainnet.infura.io","https://polygon-rpc.com","https://rpc.ankr.com","https://cloudflare-eth.com","https://eth-mainnet.alchemyapi.io","https://api.phantom.app","https://solana-api.projectserum.com","https://api.mainnet-beta.solana.com","https://api.devnet.solana.com","wss://api.phantom.app","wss://api.devnet.solana.com","wss://api.mainnet-beta.solana.com","https://bridge.arbitrum.io","https://polygon-mainnet.infura.io","https://optimism-mainnet.infura.io"],"frame-src":["'self'","https://verify.walletconnect.com","https://verify.walletconnect.org"],"worker-src":["'self'","blob:"],"child-src":["'self'","https://verify.walletconnect.com"],"object-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"]}),xg=ht(),dn=e=>{const r=ht(e);return Object.entries(r).map(([a,n])=>`${a} ${n.join(" ")}`).join("; ")},un=e=>({"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin","Permissions-Policy":"camera=(), microphone=(), geolocation=(), interest-cohort=()","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","Cross-Origin-Embedder-Policy":"credentialless","Cross-Origin-Opener-Policy":"same-origin-allow-popups","Cross-Origin-Resource-Policy":"cross-origin","Content-Security-Policy":dn(e)}),Ng=un(),Cg={fonts:"public, max-age=31536000, immutable",images:"public, max-age=31536000, immutable",js:"public, max-age=31536000, immutable",css:"public, max-age=31536000, immutable",serviceWorker:"public, max-age=0, must-revalidate",manifest:"public, max-age=86400",api:"no-cache, no-store, must-revalidate"},Sg=()=>{typeof window<"u"&&document.addEventListener("securitypolicyviolation",()=>{})},Eg={walletConnections:"Always verify wallet signatures and never trust client-side data",rpcEndpoints:"Use reputable RPC providers and consider rate limiting",contractInteractions:"Validate all smart contract interactions on the backend",userInput:"Sanitize all user inputs, especially wallet addresses and transaction data",privateKeys:"Never log, store, or transmit private keys - they should remain in wallets only",phishing:"Implement strict CSP to prevent injection of malicious scripts that could steal wallet access"},de=new Map,Ge=new Map,br=new Set;let Ye="medium",ft=!1;function Tg(){if("connection"in navigator){const a=navigator.connection;a&&(Ye=a.effectiveType==="4g"?"fast":a.effectiveType==="3g"?"medium":"slow")}const e=navigator.deviceMemory,r=navigator.hardwareConcurrency;ft=e&&e<4||r&&r<4}Tg();function Ag(e,r,a={}){const{retries:n=3,timeout:o=1e4,fallback:s,preloadCondition:l,cacheStrategy:i="memory",priority:d="medium",onLoad:c,onError:h}=a;if(de.has(r))return de.get(r).component;const g=p.lazy(async()=>{const m=performance.now();if(Ge.has(r))return Ge.get(r).then(v=>({default:v}));const b=Ig(e,n,o);Ge.set(r,b.then(v=>v.default));try{const v=await b,w=performance.now()-m;if(i!=="none"){const S={component:v.default,timestamp:Date.now(),loadTime:w};if(de.set(r,S),i==="session")try{sessionStorage.setItem(`lazy_${r}`,JSON.stringify({timestamp:S.timestamp,loadTime:w}))}catch{}}return Ge.delete(r),c?.(v.default),v}catch(v){throw Ge.delete(r),h?.(v),v}}),y=m=>{const[b,v]=p.useState(!0);p.useEffect(()=>{if(l&&!de.has(r)&&l()&&!br.has(r)){br.add(r);const k=Lg(d,Ye);setTimeout(()=>{e().catch(()=>{})},k)}},[]);const w=s||t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsxs("span",{className:"ml-2 text-sm text-gray-600",children:["Loading ",r.replace(/([A-Z])/g," $1").trim(),"..."]})]});return!b&&ft&&Ye==="slow"?t.jsx("div",{className:"lazy-placeholder",children:t.jsxs("button",{onClick:()=>v(!0),className:"load-component-btn",children:["Load ",r]})}):t.jsx(p.Suspense,{fallback:w,children:t.jsx(g,{...m})})};return y.displayName=`AdvancedLazy(${r})`,y}async function Ig(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((i,d)=>{setTimeout(()=>d(new Error("Load timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const l=Math.pow(2,o)*1e3,i=Math.random()*1e3;await new Promise(d=>setTimeout(d,l+i))}}throw n}function Lg(e,r){const a={critical:0,high:500,medium:2e3,low:5e3},n={fast:.5,medium:1,slow:2},o=a[e]||2e3,s=n[r]||1;return o*s}const Re=class Re{static registerRoute(r,a){this.routeMap.set(r,a),this.routeUsageStats.set(r,0)}static setCurrentRoute(r){this.currentRoute=r;const a=this.routeUsageStats.get(r)||0;this.routeUsageStats.set(r,a+1),this.preloadLikelyRoutes(r)}static preloadLikelyRoutes(r){this.getRouteTransitionProbability(r).forEach(({route:n,probability:o})=>{o>.3&&!de.has(n)&&setTimeout(()=>{this.routeMap.get(n)},Ye==="fast"?1e3:3e3)})}static getRouteTransitionProbability(r){const a=[];switch(r){case"/":a.push({route:"/connect",probability:.7},{route:"/about",probability:.2},{route:"/document",probability:.1});break;case"/connect":a.push({route:"/mail",probability:.8},{route:"/settings",probability:.1});break;case"/mail":a.push({route:"/compose",probability:.4},{route:"/settings",probability:.2});break;default:a.push({route:"/",probability:.1})}return a}static getStats(){return{routeCount:this.routeMap.size,cacheSize:de.size,currentRoute:this.currentRoute,usageStats:Object.fromEntries(this.routeUsageStats)}}};Re.routeMap=new Map,Re.routeUsageStats=new Map,Re.currentRoute="";let bt=Re;const Mg=({src:e,alt:r,className:a,placeholder:n,priority:o="medium"})=>{const[s,l]=p.useState(!1),[i,d]=p.useState(!1),c=p.useRef(null);p.useEffect(()=>{if(!c.current)return;if(o==="high"){d(!0);return}const g=new IntersectionObserver(([y])=>{y.isIntersecting&&(d(!0),g.unobserve(y.target))},{rootMargin:o==="low"?"100px":"200px",threshold:.1});return g.observe(c.current),()=>g.disconnect()},[o]);const h=()=>{l(!0)};return t.jsxs("div",{className:`lazy-image-container ${a}`,children:[t.jsx("img",{ref:c,src:i?e:n||"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB2aWV3Qm94PSIwIDAgMSAxIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNGM0Y0RjYiLz48L3N2Zz4=",alt:r,className:`transition-opacity duration-300 ${s?"opacity-100":"opacity-0"}`,onLoad:h,loading:o==="high"?"eager":"lazy",fetchPriority:o==="high"?"high":"low"}),!s&&i&&t.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse rounded"})]})};function Pg(){de.clear(),br.clear()}function Og(){return{cachedComponents:de.size,preloadQueue:br.size,networkSpeed:Ye,isLowEndDevice:ft,cacheEntries:Array.from(de.entries()).map(([e,r])=>({name:e,loadTime:r.loadTime,age:Date.now()-r.timestamp}))}}const Ug=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),Dg=e=>{if(typeof e=="function"||typeof e=="object")return e;switch(e){case"minimal":return()=>t.jsx("div",{className:"flex justify-center items-center p-4",children:"Loading..."});case"skeleton":return()=>t.jsxs("div",{className:"animate-pulse",children:[t.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),t.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]});case"default":default:return()=>t.jsx(Ug,{message:"Loading component..."})}},gn=(e,r="default",a=3)=>{const n=p.lazy(async()=>{let s=null;for(let l=0;l<a;l++)try{return await e()}catch(i){s=i,l<a-1&&await new Promise(d=>setTimeout(d,Math.pow(2,l)*1e3))}throw s}),o=Dg(r);return s=>t.jsx(p.Suspense,{fallback:t.jsx(o,{}),children:t.jsx(n,{...s})})},jg=async e=>{try{await e()}catch{}},_g=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=gn(n,"skeleton")}),r},zg=e=>e,hn={critical:["/","/connect","/mail"],secondary:["/settings","/compose","/points"],optional:["/document","/about","/terms","/privacy"]},er=class er{static add(r,a){this.preloadedComponents.has(r)||(this.preloadQueue.push({name:r,loader:a}),this.processQueue())}static async processQueue(){this.isPreloading||this.preloadQueue.length===0||(this.isPreloading=!0,"requestIdleCallback"in window?window.requestIdleCallback(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()}):setTimeout(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()},100))}static isPreloaded(r){return this.preloadedComponents.has(r)}static clear(){this.preloadedComponents.clear(),this.preloadQueue=[],this.isPreloading=!1}};er.preloadedComponents=new Set,er.preloadQueue=[],er.isPreloading=!1;let mt=er;const Bg=()=>{"requestIdleCallback"in window&&window.requestIdleCallback(()=>{hn.secondary.forEach(e=>{})})},fn=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),Ke=new Map;function Fg(e,r){const{condition:a,fallback:n,retries:o=3,timeout:s=1e4,priority:l="medium",cacheKey:i=`conditional-${Math.random()}`}=r,d=c=>{const[h,g]=p.useState(!1),[y,m]=p.useState(null);return p.useEffect(()=>{const w=setTimeout(async()=>{const S=Ke.get(i);if(S&&S.isValid&&Date.now()-S.lastCheck<3e5)try{if(await S.condition()){m(()=>S.component),g(!0);return}}catch{}try{if(await a()){const x=await Vg(e,o,s);Ke.set(i,{component:x.default,condition:a,lastCheck:Date.now(),isValid:!0}),m(()=>x.default),g(!0)}}catch{}},l==="high"?0:l==="medium"?100:500);return()=>clearTimeout(w)},[]),h?y?t.jsx(p.Suspense,{fallback:n||t.jsx(fn,{message:"Loading component..."}),children:t.jsx(y,{...c})}):null:n||t.jsx(fn,{message:"Checking conditions..."})};return d.displayName=`ConditionalLazy(${i})`,d}const Wg={},$g={};async function Vg(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((l,i)=>{setTimeout(()=>i(new Error("Import timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const l=Math.pow(2,o)*1e3;await new Promise(i=>setTimeout(i,l))}}throw n}function Hg(){Ke.clear()}function qg(){return{cachedComponents:Ke.size,cacheEntries:Array.from(Ke.entries()).map(([e,r])=>({key:e,lastCheck:r.lastCheck,isValid:r.isValid,age:Date.now()-r.lastCheck}))}}const bn=[{name:"react-router",path:"/assets/react-router-*.js",size:12,config:{priority:"critical",condition:()=>!0}},{name:"app-core",path:"/assets/app-core-*.js",size:25,config:{priority:"high",condition:()=>window.location.pathname==="/",delay:1e3,onIdle:!0}},{name:"wagmi",path:"/assets/wagmi-*.js",size:15,config:{priority:"high",condition:()=>!!(window.ethereum||localStorage.getItem("walletconnect")),onIdle:!0}},{name:"wc-ethereum",path:"/assets/wc-ethereum-*.js",size:273,config:{priority:"medium",condition:()=>!!window.ethereum,delay:2e3,onHover:!0}},{name:"solana-core",path:"/assets/solana-core-*.js",size:29,config:{priority:"medium",condition:()=>!!(window.solana||window.phantom),delay:1500}},{name:"mail-features",path:"/assets/mail-features-*.js",size:10,config:{priority:"medium",condition:()=>window.location.pathname.includes("/connect")||localStorage.getItem("wallet-connected")==="true",onScroll:20}},{name:"coinbase",path:"/assets/coinbase-*.js",size:75,config:{priority:"low",condition:()=>!!window.ethereum,delay:5e3,onIdle:!0}},{name:"design-system",path:"/assets/design-system-*.js",size:112,config:{priority:"low",condition:()=>window.location.pathname.includes("/internal"),delay:3e3}}];class Gg{constructor(){this.preloaded=new Set,this.networkSpeedEstimate="medium",this.isLowEndDevice=!1,this.userActivityScore=0,this.detectNetworkSpeed(),this.detectDeviceCapability(),this.startUserActivityTracking()}detectNetworkSpeed(){if("connection"in navigator){const a=navigator.connection;if(a){const n=a.effectiveType;n==="4g"?this.networkSpeedEstimate="fast":n==="3g"?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}}const r=performance.now();fetch("/favicon.ico",{method:"HEAD"}).then(()=>{const a=performance.now()-r;a<100?this.networkSpeedEstimate="fast":a<300?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}).catch(()=>{this.networkSpeedEstimate="slow"})}detectDeviceCapability(){const r=navigator.deviceMemory,a=navigator.hardwareConcurrency;r&&r<4&&(this.isLowEndDevice=!0),a&&a<4&&(this.isLowEndDevice=!0),"getBattery"in navigator&&navigator.getBattery?.().then(n=>{n.level&&n.level<.2&&(this.isLowEndDevice=!0)})}startUserActivityTracking(){let r;const a=()=>{this.userActivityScore=Math.min(this.userActivityScore+1,100),clearTimeout(r),r=setTimeout(()=>{this.userActivityScore=Math.max(this.userActivityScore-1,0)},5e3)};["click","scroll","keydown","mousemove"].forEach(n=>{document.addEventListener(n,a,{passive:!0})})}shouldPreload(r){return this.networkSpeedEstimate==="slow"&&r.size>50||this.isLowEndDevice&&r.size>30?!1:r.config.condition()}async preloadChunk(r){if(!this.preloaded.has(r.name))try{if(document.querySelectorAll('script[src*="'+r.name+'"]').length===0&&document.querySelectorAll('link[href*="'+r.name+'"]').length>0)return;const n=document.createElement("link");n.rel="modulepreload",n.href=r.path.replace("*",this.getChunkHash(r.name)),n.crossOrigin="","fetchPriority"in n&&(n.fetchPriority=r.config.priority==="critical"?"high":"low"),document.head.appendChild(n),this.preloaded.add(r.name)}catch{}}getChunkHash(r){const a=Array.from(document.querySelectorAll("script[src]"));for(const n of a){const o=n.src;if(o.includes(r)){const s=o.match(new RegExp(`${r}-([A-Za-z0-9_-]+)\\.js`));if(s)return s[1]}}return"unknown"}async schedulePreload(r){const a=r.config;return a.delay&&await new Promise(n=>setTimeout(n,a.delay)),a.onIdle&&"requestIdleCallback"in window?new Promise(n=>{window.requestIdleCallback(()=>{this.preloadChunk(r).then(n)})}):this.preloadChunk(r)}initializePreloading(){bn.sort((a,n)=>{const o={critical:0,high:1,medium:2,low:3};return o[a.config.priority]-o[n.config.priority]}).forEach(a=>{this.shouldPreload(a)&&(a.config.priority==="critical"?this.preloadChunk(a):this.schedulePreload(a),a.config.onHover&&this.setupHoverPreloading(a),a.config.onScroll&&this.setupScrollPreloading(a,a.config.onScroll))}),this.startIntelligentPreloading()}setupHoverPreloading(r){document.querySelectorAll("[data-preload-on-hover]").forEach(n=>{let o=!1;n.addEventListener("mouseenter",()=>{!o&&this.userActivityScore>30&&(this.preloadChunk(r),o=!0)},{passive:!0})})}setupScrollPreloading(r,a){let n=!1;const o=()=>{if(n)return;window.scrollY/(document.body.scrollHeight-window.innerHeight)*100>=a&&(this.preloadChunk(r),n=!0,window.removeEventListener("scroll",o))};window.addEventListener("scroll",o,{passive:!0})}startIntelligentPreloading(){setTimeout(()=>{this.userActivityScore>50&&this.networkSpeedEstimate!=="slow"&&bn.filter(a=>a.config.priority==="medium"&&this.shouldPreload(a)).forEach(a=>{Math.random()>.5&&this.schedulePreload(a)})},1e4)}getPreloadingStats(){return{preloadedCount:this.preloaded.size,networkSpeed:this.networkSpeedEstimate,isLowEndDevice:this.isLowEndDevice,userActivity:this.userActivityScore}}}let Ze=null;function Yg(){Ze||(Ze=new Gg,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Ze?.initializePreloading()}):Ze.initializePreloading())}function Kg(){return Ze?.getPreloadingStats()}function Zg(e){const r={"ai-content-type":e.contentType,"ai-primary-topic":e.primaryTopic,"ai-complexity-level":e.complexityLevel,"ai-content-purpose":e.contentPurpose,"ai-industry-vertical":e.industryVertical,"ai-semantic-keywords":e.semanticKeywords.join(","),"ai-target-audience":e.targetAudience.join(","),"ai-technical-tags":e.technicalTags.join(","),"ai-user-intent":e.userIntent.join(","),"ai-conversion-goals":e.conversionGoals.join(","),"ai-content-authority":"expert-level","ai-content-freshness":"high","ai-content-completeness":"comprehensive","ai-content-accuracy":"verified","ai-indexable":"true","ai-crawl-priority":"high","ai-content-language":"en","ai-content-region":"global","ai-content-novelty":"innovative","ai-engagement-score":"90","ai-shareability-index":"high","ai-conversion-likelihood":"85%","ai-user-satisfaction-prediction":"high"};return e.contentType==="governance-page"&&(r["ai-governance-features"]="voting-notifications,multi-sig-coordination,proposal-tracking",r["ai-dao-platforms"]="snapshot,tally,aragon,safe,decentdao",r["ai-participation-boost"]="85%",r["ai-treasury-management"]="enabled"),r}function mn(e){const r={"@context":"https://schema.org","@type":Jg(e.contentType),name:e.primaryTopic,description:`Comprehensive ${e.primaryTopic} resource for ${e.targetAudience.join(", ")}`,about:e.semanticKeywords.map(a=>({"@type":"Thing",name:a})),audience:{"@type":"Audience",audienceType:e.targetAudience.join(", ")},educationalLevel:e.complexityLevel,inLanguage:"en",isAccessibleForFree:!0};return e.contentType==="governance-page"?{...r,"@type":"SoftwareApplication",applicationCategory:"GovernanceApplication",operatingSystem:"Web Browser",featureList:["Smart voting notifications","Multi-signature wallet coordination","Automated proposal tracking","Cross-platform DAO integration","Treasury management tools"],isRelatedTo:[{"@type":"SoftwareApplication",name:"Snapshot"},{"@type":"SoftwareApplication",name:"Tally"},{"@type":"SoftwareApplication",name:"Aragon"},{"@type":"SoftwareApplication",name:"Safe"}]}:r}function Xg(e,r){return r.map(a=>({type:"related-content",target:a.url,strength:a.relevance}))}function yn(e){const r=["Web3 Email Platform","Web3","blockchain","email","wallet","cryptocurrency"],a=["DAO","governance","voting","multi-sig","Snapshot","Tally","Aragon","Safe","proposal","community"];return e.contentType==="governance-page"?[...r,...a]:r}function pn(e){const r=["web3-infrastructure","email-technology","blockchain-applications"],a=["dao-governance-tools","voting-notification-systems","community-management-platforms","multi-signature-coordination","treasury-management-solutions"];return e.contentType==="governance-page"?[...r,...a]:r}function Qg(e,r){return{contentClassification:{type:e.contentType,topic:e.primaryTopic,audience:e.targetAudience.join(","),complexity:e.complexityLevel,purpose:e.contentPurpose,vertical:e.industryVertical},semanticMarkup:mn(e),entityRecognition:yn(e),topicClustering:pn(e),contentRelationships:r?.contentRelationships||[],...r}}function Jg(e){return{article:"Article","landing-page":"WebPage","product-page":"Product","governance-page":"SoftwareApplication",documentation:"TechArticle"}[e]||"WebPage"}function Rg(e){return{"@context":"https://schema.org","@type":"MonitorAction",name:`AI Performance Tracking - ${e}`,instrument:{"@type":"SoftwareApplication",name:"AI Analytics Platform"},measurementTechnique:["User Engagement Metrics","AI Content Understanding Score","Semantic Relevance Analysis","Conversion Optimization Tracking"],result:{"@type":"Dataset",name:`${e} Performance Data`,description:"AI-optimized performance metrics and user interaction data"}}}const eh={governancePage:{contentType:"governance-page",primaryTopic:"DAO Governance Communication Platform",semanticKeywords:["DAO governance","voting notifications","multi-sig coordination","proposal tracking","community engagement","treasury management"],targetAudience:["DAO members","governance participants","multi-sig signers","protocol teams","community managers"],complexityLevel:"intermediate",contentPurpose:"commercial",industryVertical:"blockchain-governance",technicalTags:["snapshot","tally","aragon","safe","multi-sig","voting","proposals","treasury"],userIntent:["improve-governance","increase-participation","coordinate-multi-sig","track-proposals","engage-community"],conversionGoals:["dao-integration","governance-setup","multi-sig-connection","notification-activation"]},landingPage:{contentType:"landing-page",primaryTopic:"Web3 Email Platform",semanticKeywords:["Web3 email","wallet authentication","ENS email","SNS email","blockchain email","decentralized communication"],targetAudience:["Web3 users","crypto enthusiasts","blockchain developers","DeFi users"],complexityLevel:"beginner",contentPurpose:"commercial",industryVertical:"web3-communication",technicalTags:["ethereum","solana","ens","sns","wallet-connect","metamask","phantom"],userIntent:["create-web3-email","connect-wallet","secure-communication","eliminate-passwords"],conversionGoals:["wallet-connection","email-creation","first-email-sent","premium-upgrade"]}},rh=({message:e,className:r})=>t.jsxs("div",{className:`flex items-center justify-center p-4 ${r||""}`,children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),yt=new Map,Xe=new Set;function pt(){const e=[];return!!window.ethereum?.isMetaMask&&(Xe.add("metamask"),e.push({name:"MetaMask",detected:!0,priority:1})),!!window.ethereum?.isCoinbaseWallet&&(Xe.add("coinbase"),e.push({name:"Coinbase Wallet",detected:!0,priority:2})),!!window.solana?.isPhantom&&(Xe.add("phantom"),e.push({name:"Phantom",detected:!0,priority:3})),e.push({name:"WalletConnect",detected:!0,priority:4}),e.sort((o,s)=>o.priority-s.priority)}function vt(e){const r=`wallet-${e.toLowerCase()}`;if(yt.has(r))return yt.get(r);const a=()=>Promise.resolve({default:()=>p.createElement("div",{},`${e} Provider Placeholder`)}),n=p.lazy(a),o=s=>t.jsx(p.Suspense,{fallback:t.jsx(rh,{message:`Loading ${e} wallet...`,className:"wallet-loading"}),children:t.jsx(n,{...s})});return o.displayName=`Lazy${e}Provider`,yt.set(r,o),o}function th({children:e}){const r=pt();return r.filter(a=>a.priority<=2&&a.detected).forEach(a=>{setTimeout(()=>{},1e3)}),t.jsxs(t.Fragment,{children:[r.map(a=>{const n=vt(a.name);return t.jsx(n,{},a.name)}),e]})}const Nt=class Nt{static preloadWallet(r){const a=r.toLowerCase();this.preloadedWallets.has(a)||(this.preloadedWallets.add(a),setTimeout(()=>{vt(r)},500))}static preloadCommonWallets(){["metamask","walletconnect","coinbase"].forEach((a,n)=>{setTimeout(()=>{this.preloadWallet(a)},n*1e3)})}static getPreloadedWallets(){return Array.from(this.preloadedWallets)}};Nt.preloadedWallets=new Set;let Qe=Nt;function ah(){return{availableWallets:pt(),preloadWallet:n=>{Qe.preloadWallet(n)},getDetectedWallets:()=>Array.from(Xe),hasWallet:n=>Xe.has(n.toLowerCase())}}function nh({walletName:e,onConnect:r,disabled:a=!1}){const n=()=>{Qe.preloadWallet(e),setTimeout(r,100)};return t.jsxs("button",{onClick:n,disabled:a,className:"wallet-connect-btn","data-wallet":e.toLowerCase(),children:["Connect ",e]})}class oh{constructor(){this.criticalResources=[],this.observedMetrics={fcp:0,lcp:0,fid:0,cls:0,ttfb:0},this.defineCriticalResources(),this.startPerformanceObservation()}defineCriticalResources(){this.criticalResources=[{url:"/assets/index-*.css",type:"style",priority:"critical",preload:!0},{url:"/assets/index-*.js",type:"script",priority:"critical"},{url:"/assets/react-core-*.js",type:"script",priority:"high",preload:!0},{url:"https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2",type:"font",priority:"critical",preload:!0},{url:"/logo.png",type:"image",priority:"high",preload:!0}]}startPerformanceObservation(){if("PerformanceObserver"in window)try{new PerformanceObserver(s=>{for(const l of s.getEntries())l.name==="first-contentful-paint"&&(this.observedMetrics.fcp=l.startTime,this.optimizeBasedOnFCP(l.startTime))}).observe({entryTypes:["paint"]}),new PerformanceObserver(s=>{for(const l of s.getEntries())this.observedMetrics.lcp=l.startTime,this.optimizeBasedOnLCP(l.startTime)}).observe({entryTypes:["largest-contentful-paint"]});let n=0;new PerformanceObserver(s=>{for(const l of s.getEntries())l.hadRecentInput||(n+=l.value);this.observedMetrics.cls=n}).observe({entryTypes:["layout-shift"]})}catch{}window.addEventListener("load",()=>{setTimeout(()=>{const r=performance.getEntriesByType("navigation")[0];r&&(this.observedMetrics.ttfb=r.responseStart-r.requestStart,this.optimizeBasedOnTTFB(this.observedMetrics.ttfb))},0)})}optimizeBasedOnFCP(r){r>2e3?this.applyEmergencyOptimizations():r>1500&&this.applyMediumOptimizations()}optimizeBasedOnLCP(r){r>2500&&this.optimizeLCPElements()}optimizeBasedOnTTFB(r){r>600&&this.enableAggressiveCaching()}applyEmergencyOptimizations(){document.querySelectorAll('img[data-priority="low"]').forEach(n=>{n.loading="lazy",n.style.display="none",setTimeout(()=>{n.style.display=""},3e3)}),document.querySelectorAll('script[data-priority="low"]').forEach(n=>{n.setAttribute("defer","")})}applyMediumOptimizations(){["/assets/app-core-*.js","/assets/react-router-*.js"].forEach(a=>{this.preloadResource(a,"script")})}optimizeLCPElements(){document.querySelectorAll("img[data-hero], [data-lcp-element]").forEach(n=>{n instanceof HTMLImageElement&&(n.fetchPriority="high",n.loading="eager")});const a=document.querySelector("img[data-hero]")?.getAttribute("src");a&&this.preloadResource(a,"image")}enableAggressiveCaching(){const r=document.createElement("meta");r.httpEquiv="Cache-Control",r.content="public, max-age=31536000, immutable",document.head.appendChild(r)}preloadResource(r,a){if(document.querySelector(`link[href*="${r}"]`))return;const o=document.createElement("link");switch(o.rel="preload",o.href=r,a){case"script":o.as="script";break;case"style":o.as="style";break;case"font":o.as="font",o.type="font/woff2",o.crossOrigin="";break;case"image":o.as="image";break}document.head.appendChild(o)}optimizeCriticalPath(){this.criticalResources.filter(r=>r.priority==="critical"&&r.preload).forEach(r=>{this.preloadResource(r.url,r.type)}),this.inlineCriticalCSS(),this.optimizeFontLoading(),this.removeRenderBlocking(),this.setupProgressiveLoading()}inlineCriticalCSS(){const r=document.querySelector('link[rel="stylesheet"][data-critical]');r&&this.isSmallResource(r.getAttribute("href")||"")&&fetch(r.getAttribute("href")||"").then(a=>a.text()).then(a=>{if(a.length<1e4){const n=document.createElement("style");n.textContent=a,document.head.appendChild(n),r.remove()}}).catch(()=>{})}optimizeFontLoading(){document.querySelectorAll('link[href*="fonts.googleapis.com"]').forEach(a=>{const n=a.getAttribute("href")||"";if(!n.includes("display=swap")){const o=n.includes("?")?"&":"?";a.setAttribute("href",`${n}${o}display=swap`)}})}removeRenderBlocking(){document.querySelectorAll('link[rel="stylesheet"]:not([data-critical])').forEach(a=>{const n=a.cloneNode(!0);n.rel="preload",n.as="style",n.onload=()=>{n.onload=null,n.rel="stylesheet"};const o=document.createElement("noscript"),s=a.cloneNode(!0);o.appendChild(s),document.head.appendChild(n),document.head.appendChild(o),a.remove()})}setupProgressiveLoading(){const r=document.querySelectorAll("img[data-src]");if("IntersectionObserver"in window){const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.src=s.dataset.src||"",s.removeAttribute("data-src"),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});r.forEach(n=>a.observe(n))}else r.forEach(a=>{const n=a;n.src=n.dataset.src||""})}isSmallResource(r){return r.includes("critical")||r.includes("inline")}getPerformanceMetrics(){return{...this.observedMetrics,score:this.calculatePerformanceScore()}}calculatePerformanceScore(){let r=100;return this.observedMetrics.fcp>2e3?r-=20:this.observedMetrics.fcp>1500&&(r-=10),this.observedMetrics.lcp>2500?r-=25:this.observedMetrics.lcp>2e3&&(r-=15),this.observedMetrics.cls>.1?r-=15:this.observedMetrics.cls>.05&&(r-=8),this.observedMetrics.ttfb>600?r-=10:this.observedMetrics.ttfb>400&&(r-=5),Math.max(r,0)}}const mr={mark:e=>{typeof performance<"u"&&performance.mark&&performance.mark(e)},measure:(e,r,a)=>{if(typeof performance<"u"&&performance.measure)try{performance.measure(e,r,a);const n=performance.getEntriesByName(e);return n[n.length-1]?.duration||0}catch{return 0}return 0},getEntries:e=>typeof performance<"u"&&performance.getEntriesByName?e?performance.getEntriesByName(e):performance.getEntries():[],clearEntries:e=>{typeof performance<"u"&&(e?(performance.clearMeasures?.(e),performance.clearMarks?.(e)):(performance.clearMeasures?.(),performance.clearMarks?.()))}},sh=(e,r=[])=>{p.useEffect(()=>(mr.mark(`${e}-start`),()=>{mr.mark(`${e}-end`),mr.measure(e,`${e}-start`,`${e}-end`)}),[e,r])},lh=e=>{const r=p.useRef(e);return r.current=e,p.useCallback((...a)=>r.current(...a),[])},ih=(e,r,a)=>{const n=p.useRef(r),o=p.useRef(void 0);return p.useMemo(()=>(a&&process.env.NODE_ENV==="development"&&r.some((s,l)=>s!==n.current[l]),n.current=r,o.current=e(),o.current),[e,a,r])},yr=new Map,ch=e=>{const r=yr.get(e)||0;yr.set(e,r+1),p.useEffect(()=>{process.env.NODE_ENV})},dh=()=>Object.fromEntries(yr),uh=()=>yr.clear(),gh=e=>p.lazy(e),hh=(e=.1)=>{const[r,a]=p.useState(new Set),n=p.useRef(null);p.useEffect(()=>(n.current=new IntersectionObserver(s=>{s.forEach(l=>{if(l.isIntersecting){const i=l.target,d=i.dataset.src;d&&(i.src=d,i.onload=()=>{a(c=>new Set(c).add(d))},n.current?.unobserve(i))}})},{threshold:e}),()=>n.current?.disconnect()),[e]);const o=p.useCallback(s=>{s&&n.current&&n.current.observe(s)},[]);return{loadedImages:r,observeImage:o}},fh=e=>{typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(()=>{e().catch(()=>{})}):setTimeout(()=>{e().catch(()=>{})},100)},vn={},bh=e=>{vn[e.name]=e.value,process.env.NODE_ENV},mh=()=>vn,yh=(e,r="script")=>{if(typeof document<"u"){const a=document.createElement("link");a.rel="prefetch",a.href=e,a.as=r,document.head.appendChild(a)}},ph=(e,r="script",a)=>{if(typeof document<"u"){const n=document.createElement("link");n.rel="preload",n.href=e,n.as=r,a&&(n.crossOrigin="anonymous"),document.head.appendChild(n)}},vh=e=>{const r=p.useRef(new Set),a=p.useRef(new Set),n=p.useCallback((s,l)=>{const i=setTimeout(()=>{r.current.delete(i),s()},l);return r.current.add(i),i},[]),o=p.useCallback((s,l)=>{const i=setInterval(s,l);return a.current.add(i),i},[]);return p.useEffect(()=>{const s=r.current,l=a.current;return()=>{s.forEach(i=>clearTimeout(i)),l.forEach(i=>clearInterval(i)),process.env.NODE_ENV}},[e]),{createTimer:n,createInterval:o}},ue={maxBundleSize:500,maxChunkSize:200,maxImageSize:100,maxFCP:1800,maxLCP:2500,maxFID:100,maxCLS:.1,check:e=>{const r=[];return e.FCP&&e.FCP>ue.maxFCP&&r.push(`FCP (${e.FCP}ms) exceeds budget (${ue.maxFCP}ms)`),e.LCP&&e.LCP>ue.maxLCP&&r.push(`LCP (${e.LCP}ms) exceeds budget (${ue.maxLCP}ms)`),e.FID&&e.FID>ue.maxFID&&r.push(`FID (${e.FID}ms) exceeds budget (${ue.maxFID}ms)`),e.CLS&&e.CLS>ue.maxCLS&&r.push(`CLS (${e.CLS}) exceeds budget (${ue.maxCLS})`),r}};class wh{constructor(r){this.metrics={timestamp:Date.now()},this.observers=[],this.performanceMarks=new Map,this.reportCallback=r,this.initializeWebVitals(),this.initializeCustomObservers(),this.collectDeviceInfo()}initializeWebVitals(){Be.onCLS(r=>{this.metrics.CLS=r.value,this.reportMetric("CLS",r.value)}),Be.onINP(r=>{this.metrics.INP=r.value,this.reportMetric("INP",r.value)}),Be.onFCP(r=>{this.metrics.FCP=r.value,this.reportMetric("FCP",r.value)}),Be.onLCP(r=>{this.metrics.LCP=r.value,this.reportMetric("LCP",r.value)}),Be.onTTFB(r=>{this.metrics.TTFB=r.value,this.reportMetric("TTFB",r.value)})}initializeCustomObservers(){if("PerformanceObserver"in window){const r=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{if(s.entryType==="navigation"){const l=s;this.metrics.bundleLoadTime=l.loadEventEnd-l.fetchStart}})});try{r.observe({entryTypes:["navigation"]}),this.observers.push(r)}catch{}const a=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{(s.name.includes(".js")||s.name.includes(".css"))&&this.trackResourceLoad(s.name,s.duration)})});try{a.observe({entryTypes:["resource"]}),this.observers.push(a)}catch{}}}collectDeviceInfo(){if(typeof window<"u"){const r=navigator;r.connection&&(this.metrics.connection=r.connection.effectiveType||r.connection.type),r.deviceMemory&&(this.metrics.deviceMemory=r.deviceMemory),r.hardwareConcurrency&&(this.metrics.hardwareConcurrency=r.hardwareConcurrency),this.metrics.viewport={width:window.innerWidth,height:window.innerHeight}}}reportMetric(r,a){this.reportCallback&&this.reportCallback({...this.metrics,timestamp:Date.now()}),process.env.NODE_ENV}trackResourceLoad(r,a){const n=r.includes(".js"),o=r.includes(".css");if(n||o){const s=n?"JavaScript":"CSS";this.reportMetric(`${s} Load`,a)}}measureComponentRender(r,a){this.metrics.componentRenderTime=a,this.reportMetric(`Component Render (${r})`,a)}measureAPICall(r,a){this.metrics.apiResponseTime=a,this.reportMetric(`API Call (${r})`,a)}measureRouteChange(r,a){this.metrics.routeChangeTime=a,this.reportMetric(`Route Change (${r})`,a)}markStart(r){this.performanceMarks.set(r,performance.now())}markEnd(r){const a=this.performanceMarks.get(r);if(a){const n=performance.now()-a;this.reportMetric(`Mark (${r})`,n),this.performanceMarks.delete(r)}}trackRouteChange(r,a,n){typeof a=="string"?this.measureRouteChange(a,n||performance.now()):this.measureRouteChange(r,a)}getSummary(){return{coreWebVitals:{score:this.calculateScore(),LCP:this.metrics.LCP,INP:this.metrics.INP,CLS:this.metrics.CLS},loadingPerformance:{FCP:this.metrics.FCP,TTFB:this.metrics.TTFB,bundleLoadTime:this.metrics.bundleLoadTime},runtime:{routeChangeTime:this.metrics.routeChangeTime,apiResponseTime:this.metrics.apiResponseTime,componentRenderTime:this.metrics.componentRenderTime},device:{connection:this.metrics.connection,deviceMemory:this.metrics.deviceMemory,hardwareConcurrency:this.metrics.hardwareConcurrency}}}calculateScore(){let r=100;return this.metrics.LCP&&this.metrics.LCP>2500?r-=25:this.metrics.LCP&&this.metrics.LCP>2e3&&(r-=15),this.metrics.INP&&this.metrics.INP>200?r-=20:this.metrics.INP&&this.metrics.INP>100&&(r-=10),this.metrics.CLS&&this.metrics.CLS>.1?r-=15:this.metrics.CLS&&this.metrics.CLS>.05&&(r-=8),Math.max(r,0)}getMetrics(){return{...this.metrics}}cleanup(){this.observers.forEach(r=>r.disconnect()),this.observers=[]}}let pr=null;const kh=e=>(pr||(pr=new wh(e)),pr),vr=()=>pr,wn=e=>{const r=p.useRef(performance.now());p.useEffect(()=>{const a=performance.now()-r.current,n=vr();n&&n.measureComponentRender(e,a)},[e])},xh=(e,r)=>p.forwardRef((a,n)=>(wn(r),p.createElement(e,{...a,ref:n}))),Nh=async(e,r)=>{const a=performance.now(),n=await e(),o=performance.now()-a,s=vr();return s&&s.measureAPICall(r,o),n},kn={LCP:2500,INP:200,CLS:.1,FCP:1800,TTFB:800,bundleSize:17e4},Ch=(e,r=kn)=>{const a=[];return r.LCP&&e.LCP&&e.LCP>r.LCP&&a.push(`LCP: ${e.LCP.toFixed(0)}ms (budget: ${r.LCP}ms)`),r.INP&&e.INP&&e.INP>r.INP&&a.push(`INP: ${e.INP.toFixed(0)}ms (budget: ${r.INP}ms)`),r.CLS&&e.CLS&&e.CLS>r.CLS&&a.push(`CLS: ${e.CLS.toFixed(3)} (budget: ${r.CLS})`),r.FCP&&e.FCP&&e.FCP>r.FCP&&a.push(`FCP: ${e.FCP.toFixed(0)}ms (budget: ${r.FCP}ms)`),r.TTFB&&e.TTFB&&e.TTFB>r.TTFB&&a.push(`TTFB: ${e.TTFB.toFixed(0)}ms (budget: ${r.TTFB}ms)`),{passed:a.length===0,violations:a}},Sh=e=>{const r=e||vr()?.getMetrics()||{timestamp:Date.now()},a={timestamp:new Date().toISOString(),metrics:r,environment:{userAgent:typeof window<"u"?window.navigator.userAgent:"unknown",url:typeof window<"u"?window.location.href:"unknown",referrer:typeof document<"u"?document.referrer:"unknown",viewport:r.viewport,connection:r.connection,deviceMemory:r.deviceMemory,hardwareConcurrency:r.hardwareConcurrency}};return JSON.stringify(a,null,2)},Eh={CLS:[.1,.25],FCP:[1800,3e3],FID:[100,300],LCP:[2500,4e3],TTFB:[800,1800],INP:[200,500]};function De(e,r){const[a,n]=Eh[e];return r<=a?"good":r<=n?"needs-improvement":"poor"}function Je(e,r){try{if(PerformanceObserver.supportedEntryTypes?.includes(e)){const a=new PerformanceObserver(n=>{r(n.getEntries())});return a.observe({type:e,buffered:!0}),a}}catch{}}function xn(e){let r=0;Je("layout-shift",a=>{for(const n of a){const o=n;o.hadRecentInput||(r+=o.value)}}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e({name:"CLS",value:r,rating:De("CLS",r)})})}function Nn(e){Je("paint",r=>{for(const a of r)a.name==="first-contentful-paint"&&e({name:"FCP",value:a.startTime,rating:De("FCP",a.startTime)})})}function Cn(e){let r=0;Je("largest-contentful-paint",n=>{const o=n[n.length-1];o&&(r=o.startTime)});const a=()=>{r>0&&e({name:"LCP",value:r,rating:De("LCP",r)})};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&a()}),["keydown","click"].forEach(n=>{document.addEventListener(n,a,{once:!0,capture:!0})})}function Sn(e){Je("first-input",r=>{const a=r[0];if(a){const n=a.processingStart-a.startTime;e({name:"FID",value:n,rating:De("FID",n)})}})}function En(e){const r=performance.getEntriesByType("navigation")[0];if(r){const a=r.responseStart-r.requestStart;e({name:"TTFB",value:a,rating:De("TTFB",a)})}}function Tn(e){const r=[];Je("event",a=>{for(const n of a){const o=n;if(o.interactionId){const s=o.processingEnd-o.processingStart;r.push(s)}}}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&r.length>0){r.sort((o,s)=>o-s);const a=Math.min(r.length-1,Math.ceil(r.length*.98)-1),n=r[a];e({name:"INP",value:n,rating:De("INP",n)})}})}function Th(e){const r=e||(a=>{if(typeof window<"u"&&window.__DEV__){const n=a.rating==="good"?"\x1B[32m":a.rating==="needs-improvement"?"\x1B[33m":"\x1B[31m";console.log(`${n}[WebVitals] ${a.name}: ${a.value.toFixed(2)} (${a.rating})\x1B[0m`)}});xn(r),Nn(r),Cn(r),Sn(r),En(r),Tn(r)}function An(e,r,a){if(typeof window<"u"&&window.__DEV__){const n=a<100?"good":a<300?"needs-improvement":"poor";console.log(`${n==="good"?"\x1B[32m":n==="needs-improvement"?"\x1B[33m":"\x1B[31m"}[RouteChange] ${e} -> ${r}: ${a}ms (${n})\x1B[0m`)}}function Ah(e,r,a){typeof window<"u"&&window.__DEV__&&console.log(`[CustomMetric] ${e}: ${r}`,a||"")}function Ih(e,r,a,n="GET"){if(typeof window<"u"&&window.__DEV__){const o=r<200?"good":r<500?"needs-improvement":"poor";console.log(`${o==="good"?"\x1B[32m":o==="needs-improvement"?"\x1B[33m":"\x1B[31m"}[API] ${n} ${e}: ${r}ms (${a})\x1B[0m`)}}const Lh=({direction:e,className:r})=>t.jsx("svg",{className:f("w-4 h-4",r),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e==="up"?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"})}),Mh=({className:e})=>t.jsx("svg",{className:f("w-4 h-4",e),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),In=({title:e="Performance Monitor",isCollapsed:r,onToggleCollapse:a,onClose:n,onMouseDown:o,isDragging:s,className:l})=>t.jsxs("div",{className:f("bg-gray-900 text-white rounded-t-lg px-3 py-2","flex items-center justify-between","shadow-lg border border-gray-700","select-none",o&&"cursor-grab",s&&"cursor-grabbing",l),onMouseDown:o,children:[t.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[t.jsx("span",{children:"🚀"}),e]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx("button",{onClick:a,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":r?"Expand":"Collapse",type:"button",children:t.jsx(Lh,{direction:r?"up":"down"})}),n&&t.jsx("button",{onClick:n,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":"Close",type:"button",children:t.jsx(Mh,{})})]})]}),Ph={sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"},Oh={good:"bg-green-500","needs-improvement":"bg-yellow-500",poor:"bg-red-500",unknown:"bg-gray-400",neutral:"bg-gray-500"},Uh={good:"Good","needs-improvement":"Needs Improvement",poor:"Poor",unknown:"Unknown",neutral:"Neutral"},Dh=({rating:e,size:r="sm",showLabel:a=!1,className:n})=>t.jsxs("div",{className:f("flex items-center gap-1",n),children:[t.jsx("span",{className:f("rounded-full",Ph[r],Oh[e])}),a&&t.jsx("span",{className:"text-xs text-gray-400",children:Uh[e]})]}),Ln=({className:e})=>t.jsxs("div",{className:f("flex gap-3 text-[10px] text-gray-400",e),children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),"Good"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500"}),"Needs Improvement"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),"Poor"]})]}),jh={good:"text-green-500","needs-improvement":"text-yellow-500",poor:"text-red-500",unknown:"text-gray-400",neutral:"text-gray-300"},H=({label:e,value:r,unit:a="",rating:n="neutral",description:o,className:s})=>{const l=typeof r=="number"?Number.isInteger(r)?r.toString():r.toFixed(r<1?3:0):r;return t.jsxs("div",{className:f("flex justify-between items-center",s),children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-gray-300",children:e}),o&&t.jsx("span",{className:"text-[10px] text-gray-500",children:o})]}),t.jsxs("span",{className:f("font-medium",jh[n]),children:[l,a]})]})},_h=(e,r="ms",a=0)=>e===void 0?"N/A":`${e.toFixed(a)}${r}`,Mn=(e={})=>{const{enabled:r=!0,onUpdate:a}=e,[n,o]=p.useState({}),[s,l]=p.useState(!0),i=p.useRef(a);p.useEffect(()=>{i.current=a},[a]);const d=p.useCallback(c=>{o(h=>{const g={...h,...c};return i.current?.(g),g})},[]);return p.useEffect(()=>{if(!r)return;if(typeof PerformanceObserver>"u"){l(!1);return}const c=[];try{const h=new PerformanceObserver(g=>{const y=g.getEntries(),m=y[y.length-1];d({lcp:m.renderTime||m.loadTime})});h.observe({type:"largest-contentful-paint",buffered:!0}),c.push(h)}catch{}try{const h=new PerformanceObserver(g=>{g.getEntries().forEach(m=>{m.processingStart&&d({fid:m.processingStart-m.startTime})})});h.observe({type:"first-input",buffered:!0}),c.push(h)}catch{}try{let h=0;const g=new PerformanceObserver(y=>{for(const m of y.getEntries())!m.hadRecentInput&&m.value&&(h+=m.value,d({cls:h}))});g.observe({type:"layout-shift",buffered:!0}),c.push(g)}catch{}try{const h=new PerformanceObserver(g=>{g.getEntries().forEach(m=>{m.name==="first-contentful-paint"&&d({fcp:m.startTime})})});h.observe({type:"paint",buffered:!0}),c.push(h)}catch{}try{const h=new PerformanceObserver(g=>{g.getEntries().forEach(m=>{m.duration&&d({inp:m.duration})})});h.observe({type:"event",buffered:!0}),c.push(h)}catch{}try{const h=performance.getEntriesByType("navigation")[0];h&&d({ttfb:h.responseStart-h.requestStart})}catch{}return()=>{c.forEach(h=>h.disconnect())}},[r,d]),{metrics:n,isSupported:s}},Ae=(e,r)=>{if(r===void 0)return"unknown";const n={lcp:{good:2500,poor:4e3},fid:{good:100,poor:300},cls:{good:.1,poor:.25},fcp:{good:1800,poor:3e3},ttfb:{good:800,poor:1800},inp:{good:200,poor:500}}[e];return n?r<=n.good?"good":r<=n.poor?"needs-improvement":"poor":"unknown"},Pn=({metrics:e,className:r})=>{const a=(n,o=0)=>n===void 0?"N/A":n.toFixed(o);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-yellow-400 mb-2 text-xs",children:"Web Vitals"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"LCP",value:a(e.lcp),unit:"ms",rating:Ae("lcp",e.lcp),description:"Largest Contentful Paint"}),t.jsx(H,{label:"FID",value:a(e.fid),unit:"ms",rating:Ae("fid",e.fid),description:"First Input Delay"}),t.jsx(H,{label:"CLS",value:a(e.cls,3),rating:Ae("cls",e.cls),description:"Cumulative Layout Shift"}),t.jsx(H,{label:"FCP",value:a(e.fcp),unit:"ms",rating:Ae("fcp",e.fcp),description:"First Contentful Paint"}),t.jsx(H,{label:"TTFB",value:a(e.ttfb),unit:"ms",rating:Ae("ttfb",e.ttfb),description:"Time to First Byte"}),e.inp!==void 0&&t.jsx(H,{label:"INP",value:a(e.inp),unit:"ms",rating:Ae("inp",e.inp),description:"Interaction to Next Paint"})]})]})},On=(e={})=>{const{enabled:r=!0,refreshInterval:a=5e3,onUpdate:n}=e,[o,s]=p.useState({}),l=p.useRef(n);p.useEffect(()=>{l.current=n},[n]);const i=p.useCallback(()=>{if(!(typeof performance>"u"))try{const c=performance.getEntriesByType("resource"),h=c.filter(w=>w.name.endsWith(".js")||w.initiatorType==="script"),g=h.reduce((w,S)=>w+S.duration,0),y=c.filter(w=>w.name.endsWith(".css")||w.initiatorType==="link"),m=y.reduce((w,S)=>w+S.duration,0),b=c.reduce((w,S)=>w+(S.transferSize||0),0),v={jsLoadTime:g,cssLoadTime:m,jsCount:h.length,cssCount:y.length,totalTransferSize:b};s(v),l.current?.(v)}catch{}},[]),d=p.useCallback(()=>{i()},[i]);return p.useEffect(()=>{if(!r)return;i();const c=setInterval(i,a);return()=>clearInterval(c)},[r,a,i]),{metrics:o,refresh:d}},Un=e=>e===void 0?"N/A":e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`,Dn=({metrics:e,className:r})=>{const a=n=>n===void 0?"N/A":n.toFixed(0);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-blue-400 mb-2 text-xs",children:"Bundle Performance"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"JS Load",value:a(e.jsLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"CSS Load",value:a(e.cssLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"JS Files",value:e.jsCount??"N/A",rating:"neutral"}),t.jsx(H,{label:"Transfer Size",value:Un(e.totalTransferSize),rating:"neutral"})]})]})},zh=e=>e===void 0?"unknown":e<=200?"good":e<=500?"needs-improvement":"poor",jn=({metrics:e,className:r})=>{const a=n=>n===void 0||isNaN(n)?"N/A":n.toFixed(0);return e.callCount===0?null:t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-purple-400 mb-2 text-xs",children:"API Calls"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Count",value:e.callCount,rating:"neutral"}),t.jsx(H,{label:"Total Time",value:a(e.totalTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"Avg Time",value:a(e.averageTime),unit:"ms",rating:zh(e.averageTime)}),e.slowestCall!==void 0&&t.jsx(H,{label:"Slowest",value:a(e.slowestCall),unit:"ms",rating:e.slowestCall>1e3?"poor":"neutral"}),e.failedCalls>0&&t.jsx(H,{label:"Failed",value:e.failedCalls,rating:"poor"})]})]})},_n=e=>e===void 0?"N/A":(e/(1024*1024)).toFixed(1),zn=(e,r)=>{if(e===void 0||r===void 0)return"unknown";const a=e/r;return a<=.5?"good":a<=.75?"needs-improvement":"poor"},Bn=({refreshInterval:e=2e3,className:r})=>{const[a,n]=p.useState({}),[o,s]=p.useState(!0);if(p.useEffect(()=>{const i=performance;if(!i.memory){s(!1);return}const d=()=>{i.memory&&n({usedJSHeapSize:i.memory.usedJSHeapSize,totalJSHeapSize:i.memory.totalJSHeapSize,jsHeapSizeLimit:i.memory.jsHeapSizeLimit})};d();const c=setInterval(d,e);return()=>clearInterval(c)},[e]),!o)return null;const l=a.usedJSHeapSize&&a.jsHeapSizeLimit?(a.usedJSHeapSize/a.jsHeapSizeLimit*100).toFixed(0):"N/A";return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-cyan-400 mb-2 text-xs",children:"Memory"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Used Heap",value:_n(a.usedJSHeapSize),unit:"MB",rating:zn(a.usedJSHeapSize,a.jsHeapSizeLimit)}),t.jsx(H,{label:"Total Heap",value:_n(a.totalJSHeapSize),unit:"MB",rating:"neutral"}),t.jsx(H,{label:"Usage",value:l,unit:"%",rating:zn(a.usedJSHeapSize,a.jsHeapSizeLimit)})]})]})},Bh=e=>{if(e.rating)return e.rating;if(typeof e.value=="number"&&e.thresholds){const{good:r,poor:a}=e.thresholds;return e.value<=r?"good":e.value<=a?"needs-improvement":"poor"}return"neutral"},Fn=({title:e="Custom Metrics",titleColor:r="text-orange-400",metrics:a,className:n})=>a.length===0?null:t.jsxs("div",{className:f("space-y-1",n),children:[t.jsx("h3",{className:f("font-semibold mb-2 text-xs",r),children:e}),t.jsx("div",{className:"space-y-1.5",children:a.map(o=>t.jsx(H,{label:o.label,value:o.value,unit:o.unit,rating:Bh(o),description:o.description},o.id))})]}),Fh=["/api/","graphql",".json"],Wn=(e={})=>{const{enabled:r=!0,patterns:a=Fh,refreshInterval:n=5e3,onUpdate:o}=e,[s,l]=p.useState({callCount:0,totalTime:0,averageTime:0,failedCalls:0}),i=p.useRef(a),d=p.useRef(o);p.useEffect(()=>{i.current=a},[a]),p.useEffect(()=>{d.current=o},[o]);const c=p.useCallback(()=>{if(!(typeof performance>"u"))try{const g=performance.getEntriesByType("resource"),y=i.current,m=g.filter(k=>y.some(x=>k.name.includes(x)));if(m.length===0)return;const b=m.reduce((k,x)=>k+x.duration,0),v=Math.max(...m.map(k=>k.duration)),w=m.filter(k=>{const x=k.responseStatus;return x!==void 0&&x>=400}).length,S={callCount:m.length,totalTime:b,averageTime:b/m.length,slowestCall:v,failedCalls:w};l(S),d.current?.(S)}catch{}},[]),h=p.useCallback(()=>{c()},[c]);return p.useEffect(()=>{if(!r)return;c();const g=setInterval(c,n);return()=>clearInterval(g)},[r,n,c]),{metrics:s,refresh:h}},$n=(e={})=>{const{enabled:r=!0,constrainToViewport:a=!0,horizontalOnly:n=!1,verticalOnly:o=!1,initialPosition:s}=e,l=p.useRef(null),[i,d]=p.useState({x:s?.x??null,y:s?.y??null}),[c,h]=p.useState(!1),[g,y]=p.useState({x:0,y:0}),m=p.useCallback(v=>{if(!r||!l.current)return;const w=l.current.getBoundingClientRect();h(!0),y({x:v.clientX-w.left,y:v.clientY-w.top}),(i.x===null||i.y===null)&&d({x:n?w.left:i.x??w.left,y:o?w.top:i.y??w.top}),v.preventDefault()},[r,i,n,o]),b=p.useCallback(()=>{d({x:s?.x??null,y:s?.y??null})},[s]);return p.useEffect(()=>{if(!c)return;const v=S=>{if(!l.current)return;let k=S.clientX-g.x,x=S.clientY-g.y;if(a){const N=window.innerWidth-l.current.offsetWidth,E=window.innerHeight-l.current.offsetHeight;k=Math.max(0,Math.min(k,N)),x=Math.max(0,Math.min(x,E))}d({x:n?k:o?i.x:k,y:o?x:n?i.y:x})},w=()=>{h(!1)};return document.addEventListener("mousemove",v),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",w)}},[c,g,a,n,o,i.x,i.y]),{position:i,isDragging:c,handleMouseDown:m,resetPosition:b,ref:l}},Vn={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},Wh=["webVitals","bundle","api","memory"],$h=({enabled:e,defaultCollapsed:r=!0,defaultVisible:a=!0,position:n="bottom-right",draggable:o=!0,sections:s=Wh,customMetrics:l=[],customSectionTitle:i="Custom Metrics",apiPatterns:d,onMetricsUpdate:c,className:h})=>{const g=e??(typeof process<"u"&&process.env?.NODE_ENV!=="production"),[y,m]=p.useState(r),[b,v]=p.useState(a),w=p.useMemo(()=>d,[JSON.stringify(d)]),S=p.useRef(c);p.useEffect(()=>{S.current=c},[c]);const{metrics:k}=Mn({enabled:g&&s.includes("webVitals")}),{metrics:x}=On({enabled:g&&s.includes("bundle")}),{metrics:N}=Wn({enabled:g&&s.includes("api"),patterns:w});p.useEffect(()=>{S.current&&S.current({webVitals:k,bundle:x,api:N})},[k,x,N]);const{position:E,isDragging:A,handleMouseDown:C,ref:I}=$n({enabled:o,horizontalOnly:n.includes("bottom")||n.includes("top")}),L=p.useCallback(()=>{m(D=>!D)},[]),P=p.useCallback(()=>{v(!1)},[]),U=p.useCallback(()=>{v(!0)},[]);if(!g)return null;if(!b)return t.jsx("button",{onClick:U,className:f("fixed z-[9999]",Vn[n],"bg-gray-900 text-white px-3 py-2 rounded-lg","shadow-lg border border-gray-700","hover:bg-gray-800 transition-colors","text-xs font-mono"),type:"button",children:"🚀 Performance"});const j=E.x!==null?{left:`${E.x}px`,bottom:n.includes("bottom")?"1rem":void 0,top:n.includes("top")?"1rem":void 0,position:"fixed",transition:A?"none":"height 0.2s ease-in-out"}:{transition:"height 0.2s ease-in-out"},B=l.length>0||s.includes("custom");return t.jsxs("div",{ref:I,className:f(E.x!==null?"":`fixed ${Vn[n]}`,"z-[9999] font-mono text-xs",A&&"cursor-grabbing",h),style:{maxWidth:"320px",...j},children:[t.jsx(In,{isCollapsed:y,onToggleCollapse:L,onClose:P,onMouseDown:o?C:void 0,isDragging:A}),t.jsx("div",{className:f("bg-gray-800 text-gray-100 rounded-b-lg","shadow-lg border-x border-b border-gray-700","overflow-hidden transition-all duration-300 ease-in-out",y?"max-h-0 opacity-0":"max-h-[70vh] opacity-100 py-2 px-3"),children:t.jsxs("div",{className:"overflow-y-auto max-h-full space-y-3",children:[s.includes("webVitals")&&t.jsx(Pn,{metrics:k}),s.includes("bundle")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Dn,{metrics:x})}),s.includes("api")&&N.callCount>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(jn,{metrics:N})}),s.includes("memory")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Bn,{})}),B&&l.length>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Fn,{title:i,metrics:l})}),t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ln,{})})]})})]})},Vh=(e={})=>{const{successMessage:r="",successDuration:a=3e3,errorPrefix:n="",onSuccess:o,onError:s}=e,[l,i]=p.useState(!1),[d,c]=p.useState(""),[h,g]=p.useState(""),y=p.useCallback(()=>{c(""),g("")},[]),m=p.useCallback(()=>{c("")},[]),b=p.useCallback(()=>{g("")},[]),v=p.useCallback(async w=>{i(!0),y();try{await w(),r&&(c(r),a>0&&setTimeout(()=>{c("")},a)),o&&o()}catch(S){const k=S instanceof Error?S.message:"An error occurred";throw g(n?`${n}: ${k}`:k),s&&S instanceof Error&&s(S),S}finally{i(!1)}},[r,a,n,o,s,y]);return{isSubmitting:l,successMessage:d,errorMessage:h,submit:v,clearMessages:y,clearSuccess:m,clearError:b}},Hh=(e=!1)=>{const[r,a]=p.useState(e),n=p.useCallback(()=>a(!0),[]),o=p.useCallback(()=>a(!1),[]),s=p.useCallback(()=>a(l=>!l),[]);return{value:r,setTrue:n,setFalse:o,toggle:s,setValue:a}},qh=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState(null),l=p.useCallback(async c=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(c);else{const h=document.createElement("textarea");h.value=c,h.style.position="fixed",h.style.left="-999999px",h.style.top="-999999px",document.body.appendChild(h),h.focus(),h.select();const g=document.execCommand("copy");if(document.body.removeChild(h),!g)throw new Error("Copy command was unsuccessful")}return s(c),a?.(c),setTimeout(()=>{s(null)},r),!0}catch(h){const g=h instanceof Error?h:new Error("Copy failed");return n?.(g),!1}},[r,a,n]),i=p.useCallback(c=>o===c,[o]),d=p.useCallback(()=>{s(null)},[]);return{copiedValue:o,copyToClipboard:l,isCopied:i,resetCopiedState:d}},Gh=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState({}),l=p.useCallback(async(c,h)=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(c);else{const g=document.createElement("textarea");g.value=c,g.style.position="fixed",g.style.left="-999999px",g.style.top="-999999px",document.body.appendChild(g),g.focus(),g.select();const y=document.execCommand("copy");if(document.body.removeChild(g),!y)throw new Error("Copy command was unsuccessful")}return s(g=>({...g,[h]:!0})),a?.(c),setTimeout(()=>{s(g=>({...g,[h]:!1}))},r),!0}catch(g){const y=g instanceof Error?g:new Error("Copy failed");return n?.(y),!1}},[r,a,n]),i=p.useCallback(c=>o[c]||!1,[o]),d=p.useCallback(c=>{s(c?h=>({...h,[c]:!1}):{})},[]);return{copiedStates:o,copyToClipboard:l,isCopied:i,resetCopiedState:d}};function Yh(){const e=X.useLocation(),r=p.useRef(null),a=p.useRef(0);p.useEffect(()=>{const n=e.pathname;if(!r.current){r.current=n,a.current=Date.now();return}const o=Date.now()-a.current;r.current!==n&&(An(r.current,n,o),r.current=n,a.current=Date.now())},[e])}function Kh({fields:e,validateOnChange:r=!1,validateOnBlur:a=!0}){const n=p.useMemo(()=>{const C={};for(const I in e)C[I]=e[I].initialValue;return C},[e]),[o,s]=p.useState(n),[l,i]=p.useState({}),[d,c]=p.useState({}),[h,g]=p.useState({}),y=p.useCallback(C=>{const I=e[C],L=o[C];if(I.required&&(L===""||L===null||L===void 0||Array.isArray(L)&&L.length===0))return I.requiredMessage||"This field is required";if(I.validate)for(const P of I.validate){const U=P(L);if(U)return U}},[e,o]),m=p.useCallback((C,I)=>{if(s(L=>({...L,[C]:I})),g(L=>({...L,[C]:!0})),r&&d[C]){const L=y(C);i(P=>({...P,[C]:L}))}},[r,d,y]),b=p.useCallback(C=>{s(L=>({...L,...C}));const I={};for(const L in C)I[L]=!0;g(L=>({...L,...I}))},[]),v=p.useCallback(C=>{if(c(I=>({...I,[C]:!0})),a){const I=y(C);i(L=>({...L,[C]:I}))}},[a,y]),w=p.useCallback(()=>{const C={},I={};let L=!0;for(const P in e){I[P]=!0;const U=y(P);U&&(C[P]=U,L=!1)}return c(I),i(C),L},[e,y]),S=p.useCallback(()=>{s(n),i({}),c({}),g({})},[n]),k=p.useCallback(C=>{s(I=>({...I,[C]:e[C].initialValue})),i(I=>{const L={...I};return delete L[C],L}),c(I=>{const L={...I};return delete L[C],L}),g(I=>{const L={...I};return delete L[C],L})},[e]),x=p.useCallback(C=>({value:o[C],onChange:I=>{m(C,I.target.value)},onBlur:()=>v(C),name:String(C),"aria-invalid":!!(d[C]&&l[C])}),[o,m,v,d,l]),N=p.useCallback(C=>d[C]?l[C]:void 0,[d,l]),E=p.useMemo(()=>{for(const C in e)if(y(C))return!1;return!0},[e,y]),A=p.useMemo(()=>Object.values(h).some(Boolean),[h]);return{values:o,errors:l,touched:d,dirty:h,isValid:E,isDirty:A,setValue:m,setValues:b,setTouched:v,validateField:y,validateAll:w,reset:S,resetField:k,getFieldProps:x,getFieldError:N}}const Zh=e=>{if(e===0)return"0 Bytes";const r=1024,a=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(r)),o=Math.min(n,a.length-1);return parseFloat((e/Math.pow(r,o)).toFixed(2))+" "+a[o]},Xh=(e,r,a)=>{const n={bytes:0,kb:1,mb:2,gb:3,tb:4},o=1024,l=e*Math.pow(o,n[r])/Math.pow(o,n[a]);return Math.round(l*100)/100},Qh=e=>{const r=e.match(/^(\d+(?:\.\d+)?)\s*(bytes?|kb|mb|gb|tb)$/i);if(!r)return null;const a=parseFloat(r[1]),n=r[2].toLowerCase(),s={bytes:1,byte:1,kb:1024,mb:1024*1024,gb:1024*1024*1024,tb:1024*1024*1024*1024}[n];return s?Math.round(a*s):null},Jh=e=>e,Rh=e=>{if(typeof document>"u")return;const r=document.createElement("style");r.textContent=e,r.setAttribute("data-critical","true"),document.head.appendChild(r)},ef=e=>{if(typeof document>"u")return;const r=document.createElement("link");r.rel="preload",r.as="style",r.href=e,r.onload=()=>{r.rel="stylesheet"},document.head.appendChild(r);const a=document.createElement("noscript");a.innerHTML=`<link rel="stylesheet" href="${e}">`,document.head.appendChild(a)},rf=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[`--${a}`]=typeof n=="number"?`${n}px`:n}),r},tf={xs:475,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},af=(e,r=tf)=>{const[a,n]=p.useState("base");return p.useEffect(()=>{const o=()=>{const s=window.innerWidth;s>=r["2xl"]?n("2xl"):s>=r.xl?n("xl"):s>=r.lg?n("lg"):s>=r.md?n("md"):s>=r.sm?n("sm"):s>=r.xs?n("xs"):n("base")};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[r]),e[a]||e.base||{}},Hn=()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,nf=()=>{const[e,r]=p.useState(Hn);return p.useEffect(()=>{const a=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>{r(a.matches)};return a.addEventListener?a.addEventListener("change",n):a.addListener(n),()=>{a.removeEventListener?a.removeEventListener("change",n):a.removeListener(n)}},[]),e},of=(e,r=["layout","paint"])=>{e&&(e.style.contain=r.join(" "))},sf=(e,r)=>e?(e.style.willChange=r.join(", "),()=>{e.style.willChange="auto"}):void 0,lf=e=>{typeof window>"u"||requestAnimationFrame(()=>{e.forEach(r=>r())})},cf=(...e)=>e.filter(Boolean).join(" "),df=e=>{const r={},a=["display","position","width","height","margin","padding","fontSize","fontFamily","color","backgroundColor"];return Object.entries(e).forEach(([n,o])=>{a.includes(n)&&(r[n]=o)}),r},uf=(e,r=[])=>{const[a,n]=p.useState(null),[o,s]=p.useState(!0);return p.useEffect(()=>{let l=!0;return e().then(i=>{l&&(n(i.default),s(!1))}),()=>{l=!1}},[e,...r]),{styles:a,loading:o}},gf=(e,r="1rem")=>({display:"grid",gridTemplateColumns:`repeat(${e}, minmax(0, 1fr))`,gap:r,contain:"layout",willChange:"transform"}),hf=(e="row",r="center",a="flex-start")=>({display:"flex",flexDirection:e,alignItems:r,justifyContent:a,contain:"layout"}),ff=e=>{const[r,a]=p.useState(!1);return p.useEffect(()=>{const n=window.matchMedia(e);a(n.matches);const o=()=>a(n.matches);return n.addEventListener?n.addEventListener("change",o):n.addListener(o),()=>{n.removeEventListener?n.removeEventListener("change",o):n.removeListener(o)}},[e]),r},bf=(e,r)=>{const[a,n]=p.useState("light");return p.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)");n(o.matches?"dark":"light");const s=()=>{n(o.matches?"dark":"light")};return o.addEventListener?o.addEventListener("change",s):o.addListener(s),()=>{o.removeEventListener?o.removeEventListener("change",s):o.removeListener(s)}},[]),a==="dark"?r:e},mf=e=>{const r={src:e.src,alt:e.alt,loading:e.loading||"lazy"};return e.title&&(r.title=e.title),e.width&&(r.width=e.width),e.height&&(r.height=e.height),e.sizes&&(r.sizes=e.sizes),e.srcSet&&(r.srcSet=e.srcSet),r.itemProp="image",r},yf=(e,r=[320,640,768,1024,1280,1920])=>r.map(a=>`${e.replace(/\{width\}/g,a.toString())} ${a}w`).join(", "),pf=e=>e.map(r=>r.maxWidth?`(max-width: ${r.maxWidth}px) ${r.size}`:r.size).join(", "),vf=(e,r="openGraph")=>{const a={};return r==="openGraph"?(a["og:image"]=e.url,e.width&&(a["og:image:width"]=e.width.toString()),e.height&&(a["og:image:height"]=e.height.toString()),e.alt&&(a["og:image:alt"]=e.alt),e.type&&(a["og:image:type"]=e.type)):(a["twitter:image"]=e.url,e.alt&&(a["twitter:image:alt"]=e.alt)),a},wf=(e='img[loading="lazy"]')=>{if(typeof window>"u"||!("IntersectionObserver"in window))return;const r=document.querySelectorAll(e);if("loading"in HTMLImageElement.prototype){r.forEach(n=>{n.dataset.src&&(n.src=n.dataset.src)});return}const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.dataset.src&&(s.src=s.dataset.src,s.removeAttribute("data-src")),s.dataset.srcset&&(s.srcset=s.dataset.srcset,s.removeAttribute("data-srcset")),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});return r.forEach(n=>a.observe(n)),()=>{r.forEach(n=>a.unobserve(n))}},qn=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=r.onerror=function(){e(r.height===2)},r.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA"}),Gn=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=()=>e(!0),r.onerror=()=>e(!1),r.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="}),kf=async(e="jpg")=>{const[r,a]=await Promise.all([qn(),Gn()]);return a?"avif":r?"webp":e},xf=(e,r,a,n)=>`
66
66
  <picture>
67
67
  ${e.map(s=>{const l=[`srcset="${s.srcSet}"`];return s.type&&l.push(`type="${s.type}"`),s.media&&l.push(`media="${s.media}"`),s.sizes&&l.push(`sizes="${s.sizes}"`),`<source ${l.join(" ")}>`}).join(`
68
68
  `)}
69
69
  <img src="${r}" alt="${a}"${n?` class="${n}"`:""} loading="lazy">
70
- </picture>`.trim(),xf=(e,r="image")=>{if(typeof document>"u")return;const a=document.createElement("link");a.rel="preload",a.as=r,a.href=e,e.includes(".webp")?a.type="image/webp":e.includes(".avif")&&(a.type="image/avif"),document.head.appendChild(a)},Nf=(e,r,a)=>{if(typeof window>"u")return;const n=new Image;n.src=e,n.classList.add("progressive-image-placeholder"),a.appendChild(n);const o=new Image;o.src=r,o.classList.add("progressive-image-main"),o.style.opacity="0",o.onload=()=>{a.appendChild(o),requestAnimationFrame(()=>{o.style.transition="opacity 0.3s",o.style.opacity="1",setTimeout(()=>{n.remove()},300)})}},Cf=e=>new Promise(r=>{const a=performance.now();e.complete?r({loadTime:0,size:0,format:e.src.split(".").pop()||"unknown",dimensions:{width:e.naturalWidth,height:e.naturalHeight},isLazyLoaded:e.loading==="lazy",isOptimized:e.srcset!==""||e.sizes!==""}):e.addEventListener("load",()=>{const n=performance.now()-a;r({loadTime:n,size:0,format:e.src.split(".").pop()||"unknown",dimensions:{width:e.naturalWidth,height:e.naturalHeight},isLazyLoaded:e.loading==="lazy",isOptimized:e.srcset!==""||e.sizes!==""})})}),Sf=(e,r,a="#e0e0e0")=>{const n=`
70
+ </picture>`.trim(),Nf=(e,r="image")=>{if(typeof document>"u")return;const a=document.createElement("link");a.rel="preload",a.as=r,a.href=e,e.includes(".webp")?a.type="image/webp":e.includes(".avif")&&(a.type="image/avif"),document.head.appendChild(a)},Cf=(e,r,a)=>{if(typeof window>"u")return;const n=new Image;n.src=e,n.classList.add("progressive-image-placeholder"),a.appendChild(n);const o=new Image;o.src=r,o.classList.add("progressive-image-main"),o.style.opacity="0",o.onload=()=>{a.appendChild(o),requestAnimationFrame(()=>{o.style.transition="opacity 0.3s",o.style.opacity="1",setTimeout(()=>{n.remove()},300)})}},Sf=e=>new Promise(r=>{const a=performance.now();e.complete?r({loadTime:0,size:0,format:e.src.split(".").pop()||"unknown",dimensions:{width:e.naturalWidth,height:e.naturalHeight},isLazyLoaded:e.loading==="lazy",isOptimized:e.srcset!==""||e.sizes!==""}):e.addEventListener("load",()=>{const n=performance.now()-a;r({loadTime:n,size:0,format:e.src.split(".").pop()||"unknown",dimensions:{width:e.naturalWidth,height:e.naturalHeight},isLazyLoaded:e.loading==="lazy",isOptimized:e.srcset!==""||e.sizes!==""})})}),Ef=(e,r,a="#e0e0e0")=>{const n=`
71
71
  <svg width="${e}" height="${r}" xmlns="http://www.w3.org/2000/svg">
72
72
  <rect width="100%" height="100%" fill="${a}"/>
73
73
  </svg>
74
- `;return`data:image/svg+xml;base64,${btoa(n)}`},Ef=(e,r)=>{const a=1/r*100;e.style.position="relative",e.style.paddingTop=`${a}%`;const n=e.querySelector("img");n&&(n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.objectFit="cover")},je={createPureFunction:e=>e,isDevelopment:process.env.NODE_ENV==="development",isProduction:process.env.NODE_ENV==="production",isTest:process.env.NODE_ENV==="test",createFeatureFlags:(e={})=>({enableAnalytics:process.env.VITE_ENABLE_ANALYTICS==="true",enableDebugTools:process.env.NODE_ENV==="development",enablePerformanceMonitoring:process.env.VITE_ENABLE_PERF_MONITORING!=="false",...e})},Tf=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=()=>{try{return n()}catch{return Promise.resolve({default:null})}}}),r},Yn={createDebounce:e=>r=>{let a;return((...n)=>{clearTimeout(a),a=setTimeout(()=>r(...n),e)})},memoize:e=>{const r=new Map;return((...a)=>{const n=JSON.stringify(a);if(r.has(n))return r.get(n);const o=e(...a);return r.set(n,o),o})},isDeepEqual:(e,r)=>{if(e===r)return!0;if(e==null||r==null||typeof e!="object"||typeof r!="object")return!1;const a=Object.keys(e),n=Object.keys(r);if(a.length!==n.length)return!1;for(const o of a)if(!n.includes(o)||!Yn.isDeepEqual(e[o],r[o]))return!1;return!0},createThrottle:e=>r=>{let a=0;return((...n)=>{const o=Date.now();if(o-a>=e)return a=o,r(...n)})}},Af=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]={},Object.entries(n).forEach(([o,s])=>{r[a][o]=()=>import(s).then(l=>({[o]:l[o]}))})}),r},_e={getModuleSize:e=>new Promise(r=>{if(typeof window<"u"&&"performance"in window){const n=performance.getEntriesByType("resource").find(o=>o.name.includes(e));r(n?.transferSize||0)}else r(0)}),usageTracker:new Set,trackUsage:e=>{je.isDevelopment&&_e.usageTracker.add(e)},getUsageReport:()=>je.isDevelopment?Array.from(_e.usageTracker).sort():[],estimateImpact:e=>{const r=e.map(a=>_e.getModuleSize(a).then(n=>[a,n]));return Promise.all(r).then(a=>{const n={};let o=0;return a.forEach(([s,l])=>{n[s]=l,o+=l}),{total:o,modules:n}})}},Kn={inlineCriticalCSS:e=>{if(typeof document<"u"){const r=document.createElement("style");r.textContent=e,document.head.appendChild(r)}},loadAsyncCSS:e=>{if(typeof document<"u"){const r=document.createElement("link");r.rel="stylesheet",r.href=e,r.media="print",r.onload=()=>{r.media="all"},document.head.appendChild(r)}},removeUnusedCSS:e=>{if(typeof document>"u")return;const r=new Set;return e.forEach(a=>{try{document.querySelector(a)&&r.add(a)}catch{}}),{used:Array.from(r),unused:e.filter(a=>!r.has(a))}}},If=(e={})=>{const{features:r={},criticalCSS:a="",enableUsageTracking:n=je.isDevelopment}=e;return{features:je.createFeatureFlags(r),initialize:()=>{a&&typeof document<"u"&&Kn.inlineCriticalCSS(a)},cleanup:()=>{_e.usageTracker.clear()},getReport:()=>({usage:_e.getUsageReport(),features:je.createFeatureFlags(r)})}};let wt;function Lf(e){throw typeof window<"u"?new Error("Web navigation service not implemented in shared library"):new Error("React Native navigation service not implemented in shared library")}function se(e){return wt||(wt=Lf()),wt}function Mf(){const e=se(),r=e.getCurrentState();return{navigate:(a,n)=>{e.navigate(a,n)},goBack:a=>{e.goBack(a)},replace:(a,n)=>{e.replace(a,n)},currentPath:r.currentPath,searchParams:r.searchParams,params:r.params,canGoBack:e.canGoBack(),isSupported:e.isSupported()}}function Pf(){const r=se().getCurrentState(),a=Object.keys(r.searchParams).length>0?"?"+new URLSearchParams(r.searchParams).toString():"";return{pathname:r.currentPath,search:a,searchParams:r.searchParams,hash:"",state:{},key:r.currentPath}}function Of(){const e=se(),r=e.getCurrentState();return[new URLSearchParams(r.searchParams),o=>{const s=o instanceof URLSearchParams?Object.fromEntries(o.entries()):o,l=new URLSearchParams(s).toString(),i=r.currentPath+(l?`?${l}`:"");e.replace(i)}]}const Ie={navigate:(e,r)=>{se().navigate(e,r)},goBack:e=>{se().goBack(e)},replace:(e,r)=>{se().replace(e,r)},getCurrentPath:()=>se().getCurrentPath(),getSearchParams:()=>se().getSearchParams(),goToMail:()=>{Ie.navigate("/mail")},goToPreferences:()=>{Ie.navigate("/preferences")},goToCompose:(e,r)=>{const a=new URLSearchParams;e&&a.set("type",e),r&&Object.entries(r).forEach(([o,s])=>{a.set(o,s)});const n=a.toString();Ie.navigate(`/mail/compose${n?`?${n}`:""}`)},goToConnect:()=>{Ie.navigate("/connect")},goToDelegate:()=>{Ie.navigate("/admin/delegate")},goToHome:()=>{Ie.navigate("/")},canGoBack:()=>se().canGoBack()};function Uf(e,r=3,a=1e3){return p.lazy(()=>new Promise((n,o)=>{const s=l=>{e().then(n).catch(i=>{l>0?setTimeout(()=>{s(l-1)},a):o(i)})};s(r)}))}function Df(e){let r=null;const a=()=>(r||(r=e()),r.then(()=>{}));return{Component:p.lazy(()=>r||e()),preload:a}}function jf(e,r={}){const{fallback:a=t.jsx("div",{children:"Loading..."}),errorFallback:n=t.jsx("div",{children:"Failed to load component"}),loadingDelay:o=200,minimumLoadingTime:s=500}=r,l=p.lazy(async()=>{const d=Date.now();try{const c=await e(),h=Date.now()-d;return h<s&&await new Promise(g=>setTimeout(g,s-h)),c}catch{return{default:(()=>n)}}}),i=()=>{const[d,c]=p.useState(!1);return p.useEffect(()=>{const h=setTimeout(()=>{c(!0)},o);return()=>clearTimeout(h)},[]),d?t.jsx(t.Fragment,{children:a}):null};return p.forwardRef((d,c)=>t.jsx(p.Suspense,{fallback:t.jsx(i,{}),children:t.jsx(l,{...d,ref:c})}))}function Zn(e,r={}){const[a,n]=p.useState(!1),[o,s]=p.useState(!1);return p.useEffect(()=>{const l=e.current;if(!l||o)return;const i=new IntersectionObserver(([d])=>{d.isIntersecting&&(n(!0),s(!0),i.disconnect())},{rootMargin:"50px",threshold:.01,...r});return i.observe(l),()=>{i.disconnect()}},[e,r,o]),a}const _f=({children:e,fallback:r=t.jsx("div",{children:"Loading..."}),threshold:a=.01,rootMargin:n="50px",placeholder:o})=>{const s=p.useRef(null),l=Zn(s,{threshold:a,rootMargin:n});return t.jsx("div",{ref:s,children:l?e:o||r})};function zf(e){const{importFn:r,preloadOnHover:a=!0,preloadOnFocus:n=!0,prefetchDelay:o=50}=e;let s=null,l=null;const i=()=>(l||(l=r()),l),d=()=>{s&&clearTimeout(s),s=setTimeout(()=>{i()},o)};return{Component:p.lazy(()=>l||r()),preload:i,linkProps:{...a&&{onMouseEnter:d,onMouseLeave:()=>{s&&clearTimeout(s)}},...n&&{onFocus:d}}}}function Bf(e,r=[]){const[a,n]=p.useState(null),[o,s]=p.useState(!0),[l,i]=p.useState(null);return p.useEffect(()=>{let d=!0;return s(!0),i(null),e().then(c=>{d&&(n(c),s(!1))}).catch(c=>{d&&(i(c),s(!1))}),()=>{d=!1}},[e,...r]),{module:a,loading:o,error:l}}class Xn{constructor(r=3,a=100){this.queue=new Set,this.isProcessing=!1,this.batchSize=r,this.delay=a}add(r){this.queue.add(r),this.process()}async process(){if(this.isProcessing||this.queue.size===0)return;this.isProcessing=!0;const r=Array.from(this.queue).slice(0,this.batchSize);r.forEach(a=>this.queue.delete(a)),await Promise.all(r.map(a=>a().catch(()=>{}))),this.queue.size>0&&await new Promise(a=>setTimeout(a,this.delay)),this.isProcessing=!1,this.queue.size>0&&this.process()}}function Ff(e,r,a){if(typeof document>"u")return;const n=document.createElement("link");n.rel=r,n.href=e,a&&(r==="preload"||r==="prefetch")&&(n.as=a),document.head.appendChild(n)}var kt=(e=>(e[e.HIGH=0]="HIGH",e[e.MEDIUM=1]="MEDIUM",e[e.LOW=2]="LOW",e[e.IDLE=3]="IDLE",e))(kt||{});class Qn{constructor(){this.queues=new Map,this.isProcessing=!1,Object.values(kt).filter(r=>typeof r=="number").forEach(r=>{this.queues.set(r,[])})}load(r,a=1){const n=this.queues.get(a);n&&n.push(r),this.process()}async process(){if(!this.isProcessing){this.isProcessing=!0;for(const[r,a]of this.queues)for(;a.length>0;){const n=a.shift();if(n)try{await n()}catch{}r>=2&&await new Promise(o=>setTimeout(o,50))}this.isProcessing=!1}}}const Wf=new Xn,$f=new Qn;class xt{constructor(r={}){this.prefix=r.prefix||"mailbox",this.defaultTTL=r.ttl,this.platformStorage=r.platformStorage||this.createFallbackStorage()}createFallbackStorage(){const r=new Map;return{getItem:a=>r.get(a)||null,setItem:(a,n)=>{r.set(a,n)},removeItem:a=>{r.delete(a)},clear:()=>{r.clear()},getAllKeys:()=>Array.from(r.keys())}}getKey(r){return`${this.prefix}-${r}`}isExpired(r){return r.ttl?Date.now()-r.timestamp>r.ttl:!1}set(r,a,n){try{const o={value:a,timestamp:Date.now(),ttl:n||this.defaultTTL};this.platformStorage.setItem(this.getKey(r),JSON.stringify(o))}catch{}}get(r,a){try{const n=this.platformStorage.getItem(this.getKey(r));if(!n)return a;const o=JSON.parse(n);return this.isExpired(o)?(this.remove(r),a):o.value}catch{return a}}remove(r){try{this.platformStorage.removeItem(this.getKey(r))}catch{}}clear(r){try{if(this.platformStorage.getAllKeys){const a=this.platformStorage.getAllKeys(),n=this.getKey(r||""),o=a.filter(s=>s.startsWith(n));for(const s of o)this.platformStorage.removeItem(s)}else this.platformStorage.clear?.()}catch(a){console.error("Failed to clear storage:",a)}}has(r){try{return this.platformStorage.getItem(this.getKey(r))!==null}catch(a){return console.error(`Failed to check item ${r}:`,a),!1}}getAllKeys(){try{if(this.platformStorage.getAllKeys){const r=this.platformStorage.getAllKeys(),a=`${this.prefix}-`;return r.filter(n=>n.startsWith(a)).map(n=>n.substring(a.length))}return[]}catch(r){return console.error("Failed to get all keys:",r),[]}}}const Vf=new xt,Hf=new xt({prefix:"mailbox-theme"}),qf=new xt({prefix:"walletUser",ttl:10080*60*1e3}),Gf=e=>{if(!e)throw new Error("PlatformStorage must be provided to createSimpleStorage");return{setItem:(r,a)=>{try{e.setItem(r,a)}catch{}},getItem:r=>{try{return e.getItem(r)}catch{return null}},removeItem:r=>{try{e.removeItem(r)}catch{}}}};function Jn(){const e={isWalletBrowser:!1,walletType:"unknown",hasEthereum:!1,hasSolana:!1,provider:null};if(typeof window>"u")return e;try{const r=navigator.userAgent.toLowerCase();let a="unknown",n=!1;r.includes("metamask")?(a="metamask",n=!0):r.includes("trustwallet")?(a="trustwallet",n=!0):r.includes("coinbase")?(a="coinbase",n=!0):r.includes("rainbow")?(a="rainbow",n=!0):r.includes("phantom")?(a="phantom",n=!0):r.includes("solflare")?(a="solflare",n=!0):r.includes("exodus")&&(a="exodus",n=!0);const o=!!window.ethereum,s=!!window.solana||!!window.phantom?.solana;(o||s)&&!n&&(n=!0,window.ethereum?.isMetaMask?a="metamask":window.ethereum?.isCoinbaseWallet?a="coinbase":window.ethereum?.isRainbow?a="rainbow":window.phantom?a="phantom":window.solflare&&(a="solflare"));const l=o?window.ethereum:s?window.solana||window.phantom?.solana:null;return{isWalletBrowser:n,walletType:a,hasEthereum:o,hasSolana:s,provider:l}}catch{return e}}async function Yf(){const e=Jn();if(!e.isWalletBrowser)return{success:!1,error:"Not running in a wallet browser"};try{if(e.hasEthereum&&e.provider)try{const r=await e.provider.request({method:"eth_requestAccounts"});if(r&&r.length>0)return{success:!0,address:r[0]}}catch{}if(e.hasSolana&&e.provider)try{const r=await e.provider.connect();if(r.publicKey)return{success:!0,address:r.publicKey.toString()}}catch{}return{success:!1,error:"Failed to connect to wallet provider"}}catch(r){return{success:!1,error:r instanceof Error?r.message:"Unknown connection error"}}}function Kf(e){if(!e)return!1;if(e instanceof Error){const r=e.message.toLowerCase();if(r.includes("network")||r.includes("fetch")||r.includes("failed to fetch")||r.includes("connection")||r.includes("timeout")||r.includes("net::err"))return!0}if(typeof e=="string"){const r=e.toLowerCase();if(r.includes("network")||r.includes("fetch")||r.includes("failed to fetch")||r.includes("connection")||r.includes("timeout")||r.includes("server error")||r.includes("500")||r.includes("502")||r.includes("503")||r.includes("504"))return!0}if(typeof e=="object"&&e!==null&&"status"in e){const r=e.status;if(typeof r=="number"&&r>=500&&r<600)return!0}return!1}function Zf(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("429")||r.includes("rate limit")||r.includes("too many requests")||r.includes("rate_limit")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("429")||r.includes("rate limit")||r.includes("too many requests")||r.includes("rate_limit")}return typeof e=="object"&&e!==null&&"status"in e?e.status===429:!1}function Xf(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("401")||r.includes("unauthorized")||r.includes("unauthenticated")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("401")||r.includes("unauthorized")||r.includes("unauthenticated")}return typeof e=="object"&&e!==null&&"status"in e?e.status===401:!1}function Qf(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("403")||r.includes("forbidden")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("403")||r.includes("forbidden")}return typeof e=="object"&&e!==null&&"status"in e?e.status===403:!1}function Jf(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("404")||r.includes("not found")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("404")||r.includes("not found")}return typeof e=="object"&&e!==null&&"status"in e?e.status===404:!1}function Rf(e,r="An unexpected error occurred"){return e?typeof e=="string"?e:e instanceof Error||typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:r:r}async function Rn(e){const a=new TextEncoder().encode(e.toLowerCase()),n=await crypto.subtle.digest("SHA-256",a);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")}const eb=Rn;function eo(e){return e.replace(/^\/[a-z]{2}(-[a-z]+)?(?=\/|$)/,"")}function rb(e,r){const a=eo(e);return r?.[a]?r[a]:a.replace(/\//g,"_").replace(/^_/,"")||"home"}const tb={USER_LOGIN:"login",USER_LOGOUT:"logout",USER_SIGNUP:"sign_up",PAGE_VIEW:"page_view",BUTTON_CLICK:"button_click",LINK_CLICK:"link_click",ERROR_OCCURRED:"error_occurred",ERROR_API_CALL:"error_api_call",SCROLL_DEPTH:"scroll_depth",TIME_ON_PAGE:"time_on_page",FORM_SUBMIT:"form_submit",SEARCH:"search"};function ab(e,r){return{event:e,parameters:{...r,timestamp:r?.timestamp??Date.now()}}}const nb={utils:{cn:f}};Object.defineProperty(u,"ArrowLeftIcon",{enumerable:!0,get:()=>M.ArrowLeftIcon}),Object.defineProperty(u,"ArrowRightIcon",{enumerable:!0,get:()=>M.ArrowRightIcon}),Object.defineProperty(u,"Bars3Icon",{enumerable:!0,get:()=>M.Bars3Icon}),Object.defineProperty(u,"BellIcon",{enumerable:!0,get:()=>M.BellIcon}),Object.defineProperty(u,"BellSlashIcon",{enumerable:!0,get:()=>M.BellSlashIcon}),Object.defineProperty(u,"ChartBarIcon",{enumerable:!0,get:()=>M.ChartBarIcon}),Object.defineProperty(u,"CheckCircleIcon",{enumerable:!0,get:()=>M.CheckCircleIcon}),Object.defineProperty(u,"CheckIcon",{enumerable:!0,get:()=>M.CheckIcon}),Object.defineProperty(u,"ChevronDownIcon",{enumerable:!0,get:()=>M.ChevronDownIcon}),Object.defineProperty(u,"ChevronLeftIcon",{enumerable:!0,get:()=>M.ChevronLeftIcon}),Object.defineProperty(u,"ChevronRightIcon",{enumerable:!0,get:()=>M.ChevronRightIcon}),Object.defineProperty(u,"ChevronUpIcon",{enumerable:!0,get:()=>M.ChevronUpIcon}),Object.defineProperty(u,"ClockIcon",{enumerable:!0,get:()=>M.ClockIcon}),Object.defineProperty(u,"CodeBracketIcon",{enumerable:!0,get:()=>M.CodeBracketIcon}),Object.defineProperty(u,"Cog6ToothIcon",{enumerable:!0,get:()=>M.Cog6ToothIcon}),Object.defineProperty(u,"CreditCardIcon",{enumerable:!0,get:()=>M.CreditCardIcon}),Object.defineProperty(u,"DocumentTextIcon",{enumerable:!0,get:()=>M.DocumentTextIcon}),Object.defineProperty(u,"EnvelopeIcon",{enumerable:!0,get:()=>M.EnvelopeIcon}),Object.defineProperty(u,"ExclamationTriangleIcon",{enumerable:!0,get:()=>M.ExclamationTriangleIcon}),Object.defineProperty(u,"EyeSlashIcon",{enumerable:!0,get:()=>M.EyeSlashIcon}),Object.defineProperty(u,"GlobeAltIcon",{enumerable:!0,get:()=>M.GlobeAltIcon}),Object.defineProperty(u,"HomeIcon",{enumerable:!0,get:()=>M.HomeIcon}),Object.defineProperty(u,"InboxIcon",{enumerable:!0,get:()=>M.InboxIcon}),Object.defineProperty(u,"InformationCircleIcon",{enumerable:!0,get:()=>M.InformationCircleIcon}),Object.defineProperty(u,"KeyIcon",{enumerable:!0,get:()=>M.KeyIcon}),Object.defineProperty(u,"MegaphoneIcon",{enumerable:!0,get:()=>M.MegaphoneIcon}),Object.defineProperty(u,"MinusIcon",{enumerable:!0,get:()=>M.MinusIcon}),Object.defineProperty(u,"PaperAirplaneIcon",{enumerable:!0,get:()=>M.PaperAirplaneIcon}),Object.defineProperty(u,"PaperClipIcon",{enumerable:!0,get:()=>M.PaperClipIcon}),Object.defineProperty(u,"PlusIcon",{enumerable:!0,get:()=>M.PlusIcon}),Object.defineProperty(u,"RocketLaunchIcon",{enumerable:!0,get:()=>M.RocketLaunchIcon}),Object.defineProperty(u,"ShieldCheckIcon",{enumerable:!0,get:()=>M.ShieldCheckIcon}),Object.defineProperty(u,"SparklesIcon",{enumerable:!0,get:()=>M.SparklesIcon}),Object.defineProperty(u,"StarIcon",{enumerable:!0,get:()=>M.StarIcon}),Object.defineProperty(u,"TrashIcon",{enumerable:!0,get:()=>M.TrashIcon}),Object.defineProperty(u,"UserGroupIcon",{enumerable:!0,get:()=>M.UserGroupIcon}),Object.defineProperty(u,"XMarkIcon",{enumerable:!0,get:()=>M.XMarkIcon}),Object.defineProperty(u,"CheckCircleIconSolid",{enumerable:!0,get:()=>fe.CheckCircleIcon}),Object.defineProperty(u,"CheckIconSolid",{enumerable:!0,get:()=>fe.CheckIcon}),Object.defineProperty(u,"ExclamationTriangleIconSolid",{enumerable:!0,get:()=>fe.ExclamationTriangleIcon}),Object.defineProperty(u,"StarIconSolid",{enumerable:!0,get:()=>fe.StarIcon}),u.AIMeta=Gu,u.AITrainingEnhancer=Ku,u.AI_TRAINING_CONFIGS=sg,u.ActionBanner=os,u.ActionButton=jl,u.AddressLink=li,u.Alert=Nr,u.AlertBanner=as,u.AlertDescription=ts,u.AlertTitle=rs,u.AnimatedSection=dr,u.ApiSection=jn,u.AreaChart=Rc,u.AspectRatio=mo,u.AudioPlayer=Sd,u.Avatar=Hc,u.Backdrop=fi,u.Badge=ps,u.Banner=mi,u.BarChart=Xc,u.BatchRender=I0,u.Blockquote=Ho,u.BodyText=zo,u.BorderAccent=So,u.Box=At,u.Breadcrumb=Va,u.BreadcrumbNav=dc,u.BreadcrumbSection=s0,u.BundleSection=Dn,u.BurndownChart=id,u.Button=ne,u.CACHE_CONFIGS=tn,u.CTASection=Z0,u.Calendar=Oa,u.CalloutBox=$c,u.CancellableRequest=bg,u.Card=Qr,u.CardContent=Bc,u.CardFooter=Fc,u.CardHeader=zc,u.Center=co,u.ChainBadge=sl,u.Checkbox=yl,u.Code=Wo,u.CodeBlock=l0,u.CodeDisplay=$o,u.CollapsibleDocumentationTopic=c0,u.ColorPicker=Fl,u.ColorPickerAdvanced=Wl,u.ColorSwatch=$l,u.Combobox=kl,u.Command=pi,u.CommonAnalyticsEvents=tb,u.ComponentPreloader=mt,u.ConditionalRender=E0,u.Confetti=ec,u.ConfirmationDialog=qd,u.Container=oo,u.ContentContainer=nu,u.CreditCardInput=Kl,u.CriticalPathOptimizer=nh,u.CurrencyInput=Zl,u.CustomSection=Fn,u.DashboardStatCard=Vc,u.DataSkeleton=ls,u.DataTable=kc,u.DateInput=hl,u.DateRangePicker=zl,u.DateTimePicker=_l,u.DetailErrorState=B0,u.Dialog=ja,u.Divider=No,u.DragDrop=Yd,u.Drawer=Dd,u.Dropdown=xl,u.EmptyState=Wa,u.ErrorBoundary=b0,u.ExpensiveComponent=C0,u.ExternalLink=oc,u.FadeInScale=gi,u.FadeInUp=ui,u.FeatureBlock=Ci,u.FeatureCard=$0,u.FeatureGrid=Y0,u.FileInput=El,u.Flex=no,u.FloatingElement=hi,u.FloatingPanel=Eo,u.FocusTrap=jd,u.FontSize=nt,u.Footer=su,u.FooterBottom=uu,u.FooterBottomRow=gu,u.FooterBrand=iu,u.FooterCompact=hu,u.FooterCompactLeft=fu,u.FooterCompactRight=bu,u.FooterCopyright=yu,u.FooterGrid=lu,u.FooterLink=du,u.FooterLinkSection=cu,u.FooterSocialLinks=pu,u.FooterVersion=mu,u.FormAlerts=Ul,u.FormField=Ll,u.FormFieldGroup=cr,u.FormSection=xi,u.FormattedNumber=Ko,u.FullPageSpinner=ss,u.Gauge=ud,u.GlobalLazyErrorBoundary=v0,u.GradientIconContainer=Ei,u.Grid=so,u.HStack=io,u.Heading=Po,u.HelperText=qo,u.HoverCard=Gd,u.IconContainer=Pi,u.IconText=Oi,u.Image=bd,u.ImageCropper=pd,u.ImageGallery=md,u.InfiniteScroll=_d,u.InfoBox=Di,u.InfoCard=Wc,u.Input=nr,u.ItemList=Ui,u.KYCLevelCard=ru,u.KYCStatusBadge=J0,u.Kbd=Vo,u.KeyValuePair=Yc,u.Label=Zr,u.LanguageSelector=h0,u.LanguageValidator=O0,u.LayoutContext=rt,u.LayoutProvider=o0,u.LazyComponent=T0,u.LazyErrorBoundary=hr,u.LazyImage=Lg,u.LazyLoadQueue=Xn,u.LazyWalletButton=ah,u.LazyWrapper=_f,u.Lightbox=vd,u.LineChart=Qc,u.Link=nc,u.List=Ac,u.ListItem=Ic,u.ListItemWithAction=Lc,u.LiveStream=Cd,u.LoadPriority=kt,u.LoadingDots=Qo,u.LoadingOptimizer=ig,u.LoadingOverlay=Xo,u.LoadingState=Jo,u.LocalizedLink=P0,u.Logo=_i,u.Main=Yu,u.Masonry=Mo,u.MasterDetailLayout=wu,u.MasterListItem=vu,u.MediaUploader=Ld,u.MemorySection=Bn,u.MentionInput=Al,u.MetricRow=H,u.Modal=Jr,u.ModalContent=Rr,u.ModalFooter=et,u.ModalHeader=Ud,u.MultiSelect=wl,u.NavigationList=gc,u.NavigationMenu=uc,u.NetworkErrorBoundary=y0,u.NoContent=Zc,u.NotificationBadge=ms,u.NotificationPanel=ys,u.NumberInput=ul,u.OptimizedAPIClient=hg,u.OptimizedImage=L0,u.OptimizedRoutePreloader=cg,u.Overlay=ar,u.PageContainer=bo,u.PageHeader=au,u.PageSectionHeader=Bi,u.PageTitle=Uo,u.Pagination=fc,u.PaginationNav=bc,u.PanelHeader=In,u.PerformanceBoundary=A0,u.PerformanceOptimizer=lg,u.PerformancePanel=Wh,u.PhoneDirectory=Dl,u.PhoneInput=ml,u.PieChart=Jc,u.PlatformSpecificComponents=Wg,u.PlaylistManager=Pd,u.PodcastPlayer=Id,u.Popover=zd,u.Portal=me,u.PreloadLink=cc,u.PriorityLoader=Qn,u.Progress=gd,u.ProgressCircle=hd,u.PromotionalBanner=d0,u.ProtectedRoute=j0,u.PullToRefresh=a0,u.QRCodeDisplay=Od,u.QuickActions=Wi,u.QuizBuilder=ni,u.RadioGroup=pl,u.RelativeTime=Zo,u.Resizable=Ao,u.RouteBasedLazyLoader=bt,u.SEO=qu,u.SafeAppWrapper=w0,u.ScoreIndicator=Uh,u.ScoreLegend=Ln,u.ScrollArea=Lo,u.ScrollSpy=Bd,u.SearchInput=gl,u.Section=ho,u.SectionBadge=Hi,u.SectionHeader=qi,u.SectionTitle=jo,u.SecurityProvider=k0,u.Select=qr,u.SelectContent=sr,u.SelectField=Ol,u.SelectGroup=vl,u.SelectItem=lr,u.SelectLabel=Ia,u.SelectScrollDownButton=Yr,u.SelectScrollUpButton=Gr,u.SelectSeparator=La,u.SelectTrigger=or,u.SelectValue=Aa,u.Separator=Co,u.SettingsList=Yi,u.Sheet=Fd,u.SideNav=hc,u.SignaturePad=Vl,u.SignatureRequest=Hl,u.SkeletonLoader=Ro,u.Slider=Cl,u.SliderInput=Sl,u.SmartContent=ac,u.SmartLink=Xr,u.SmartWalletProviders=rh,u.Spacer=uo,u.Sparkline=od,u.Spinner=Me,u.SplitPane=To,u.Stack=xr,u.StandardPageLayout=tu,u.StatCard=wi,u.StatDisplay=Kc,u.StatusBadge=ol,u.StatusIndicator=il,u.StepList=f0,u.Stepper=mc,u.StepperNav=yc,u.SubscriptionGatedComponents=Fg,u.SumsubWebSDK=R0,u.Switch=Ta,u.Table=wc,u.TableOfContents=vc,u.Tabs=_a,u.TabsContent=Fa,u.TabsList=za,u.TabsTrigger=Ba,u.TagInput=Tl,u.Text=It,u.TextArea=dl,u.TextAreaField=Pl,u.TextField=Ml,u.TextInputModal=Wd,u.TextLink=Fo,u.Theme=re,u.ThemeContext=ot,u.ThemeProvider=W0,u.TimePicker=Ea,u.TimerDisplay=Ji,u.Toast=Lt,u.ToastContainer=hs,u.ToastContext=Cr,u.ToastNotification=bs,u.ToastProvider=cs,u.ToggleGroup=Nl,u.Tooltip=$a,u.Topbar=Nu,u.TopbarActions=Bu,u.TopbarCenter=Su,u.TopbarContext=lt,u.TopbarDivider=Au,u.TopbarIconButton=$u,u.TopbarLeft=Cu,u.TopbarLogo=Lu,u.TopbarMenuToggle=Qa,u.TopbarMobileContent=Tu,u.TopbarMobileNav=Du,u.TopbarNav=Ja,u.TopbarNavigation=ju,u.TopbarProvider=Za,u.TopbarRight=Eu,u.TopbarSearch=Hu,u.TrackedButton=u0,u.TrackedLink=g0,u.TransferList=Pc,u.TreeView=Uc,u.TruncatedText=Yo,u.UaudioUwaveform=Ed,u.UavatarUgroup=qc,u.UbadgeUdesigner=vs,u.UbubbleUchart=rd,u.UcellUeditor=Ec,u.UcodeUhighlighter=Yl,u.UcolumnUresize=Sc,u.UcurrencyUconverter=Xl,u.UcurrencyUrates=Ql,u.UdataUgrid=xc,u.UdoubleUtap=e0,u.UdragUdropUlist=Kd,u.UfieldUmapper=ti,u.UfocusUindicator=Si,u.UformUbuilder=Jl,u.UformUtemplate=ei,u.UformUvalidator=Rl,u.UfunnelUchart=ld,u.UgestureUdetector=Qd,u.Uheatmap=sd,u.UimageUcomparison=yd,u.UkeyboardUshortcut=ji,u.UlistingUform=Dc,u.UlongUpress=r0,u.UmarkdownUrenderer=Gl,u.UmediaUplaylist=Md,u.UmetricUcomparison=dd,u.UmorphUtransition=zi,u.UnestedUdrag=Xd,u.UparallaxUscroll=Fi,u.UperformanceUchart=cd,u.UpinchUzoom=Rd,u.UpivotUtable=Nc,u.UprofileUheader=Gc,u.UprogressUtracker=fd,u.UradarUchart=ed,u.UradialUmenu=t0,u.UresizableUpanels=Io,u.UrevealUonUscroll=$i,u.UsankeyUdiagram=nd,u.UscatterUplot=td,u.UschemaUvalidator=ri,u.UscreenUreaderUtext=Go,u.UskipUnavigation=Ki,u.UsortUdropdown=Zi,u.UsortableUgrid=Zd,u.UspreadsheetUgrid=Cc,u.UstatusUpipeline=cl,u.UsurveyUbuilder=ai,u.UswipeUactions=Jd,u.UtableUreservation=Tc,u.UtimeUslotUpicker=Bl,u.UtreeUmap=ad,u.UuserUtable=Mc,u.UversionUbadge=Xi,u.UvideoUcall=Nd,u.UvideoUthumbnail=kd,u.UvoiceUrecorder=Ad,u.VStack=lo,u.VideoEditor=xd,u.VideoPlayer=wd,u.VirtualList=Oc,u.VirtualListItem=S0,u.VisuallyHidden=Qi,u.WEB3_CONCEPTS=rg,u.WEB3_EMAIL_HEADINGS=eg,u.WEB3_HEADING_PATTERNS=oe,u.WalletPreloader=Qe,u.WaveForm=Td,u.WebVitalsSection=Pn,u.WysiwygEditor=ql,u.addLanguageToPath=tt,u.addResourceHint=Ff,u.aiOptimizationPresets=Rg,u.appStorage=Vf,u.autoConnectWalletBrowser=Yf,u.batchDOMUpdates=sf,u.bundleAnalysis=_e,u.buttonVariants=Pa,u.cacheHeaders=Ng,u.cacheUtils=mg,u.checkPerformanceBudget=Nh,u.clearComponentCache=Mg,u.clearConditionalCache=Vg,u.clearPreloadCache=sc,u.clearRenderCounts=dh,u.cn=f,u.conditionalCSS=wg,u.convertFileSize=Zh,u.createAIMetaTags=rn,u.createAIOptimizedSchema=gt,u.createAdvancedLazyComponent=Tg,u.createAnalyticsEvent=ab,u.createCSSVariables=ef,u.createConditionalImports=Tf,u.createConditionalLazyComponent=Bg,u.createEnhancedFAQSchema=Zu,u.createEnhancedOpenGraph=Ra,u.createEnhancedTwitterCard=en,u.createFeature=st,u.createLazyComponent=gn,u.createLazyComponentFactory=uh,u.createLazyRoute=zf,u.createLazyWalletProvider=vt,u.createLibraryImports=_g,u.createMemoComponent=x0,u.createOptimizedStyles=Qh,u.createProgressiveComponent=jf,u.createSecurityFeatures=K0,u.createSelectiveExports=Af,u.createSelectiveMemoComponent=N0,u.createSemanticHeading=Ju,u.createSimpleStorage=Gf,u.createTechnicalArticleSchema=ut,u.createTreeShakingConfig=If,u.createUIComponents=jg,u.createWeb3ProductSchema=dt,u.cspDirectives=kg,u.cssOptimization=Kn,u.deadCodeElimination=je,u.default=nb,u.defaultPerformanceBudget=kn,u.detectAvailableWallets=pt,u.detectWalletBrowser=Jn,u.exportPerformanceData=Ch,u.formatBytes=Un,u.formatFileSize=Kh,u.formatMetricValue=jh,u.generateAIMetaTags=Kg,u.generateAIMetadata=tg,u.generateAIStructuredData=Xg,u.generateAdvancedSEO=Xu,u.generateCSP=dn,u.generateCSPDirectives=ht,u.generateConceptGraph=ag,u.generateContentRelationships=Zg,u.generateEntityRecognition=yn,u.generateImageSEO=bf,u.generatePerformanceTrackingSchema=Jg,u.generatePictureElement=kf,u.generatePlaceholder=Sf,u.generateQAPairs=og,u.generateSemanticMarkup=mn,u.generateSizes=yf,u.generateSocialImageMeta=pf,u.generateSrcSet=mf,u.generateTopicClustering=pn,u.generateTrainingExamples=ng,u.getConditionalStats=Hg,u.getEnvironmentType=ln,u.getErrorMessage=Rf,u.getLazyLoadingStats=Pg,u.getOptimalImageFormat=wf,u.getPageName=rb,u.getPerformanceMonitor=vr,u.getPreloadingStats=Yg,u.getRenderCounts=ch,u.getSecurityHeaders=un,u.getUINavigationService=se,u.getWebVitalRating=Ae,u.getWebVitals=bh,u.hashString=Rn,u.hashUserId=eb,u.initWebVitals=Eh,u.initializeAdvancedPreloading=Gg,u.initializePerformanceMonitoring=wh,u.initializePreloading=zg,u.inlineCriticalStyles=cf,u.isAuthError=Xf,u.isForbiddenError=Qf,u.isLocalhost=on,u.isNetworkAccess=sn,u.isNotFoundError=Jf,u.isPreloaded=lc,u.isRateLimitError=Zf,u.isServerError=Kf,u.isWalletBrowser=nn,u.isWebEnvironment=cn,u.lazyLoadQueue=Wf,u.lazyWithPreload=Df,u.lazyWithRetry=Uf,u.loadCSS=pg,u.loadCriticalCSS=Jh,u.loadNonCriticalCSS=Rh,u.measureAsyncOperation=xh,u.measureCLS=xn,u.measureFCP=Nn,u.measureFID=Sn,u.measureINP=Tn,u.measureImagePerformance=Cf,u.measureLCP=Cn,u.measureTTFB=En,u.navigationHelper=Ie,u.optimizeClassNames=lf,u.optimizeContainment=nf,u.optimizeFlex=gf,u.optimizeGrid=uf,u.optimizeWillChange=of,u.optimizedFetch=an,u.pageSEOConfigs=Qu,u.parseFileSize=Xh,u.performanceBudget=ue,u.performanceUtils=mr,u.prefersReducedMotion=Hn,u.prefetchResource=mh,u.preloadComponent=Dg,u.preloadImage=xf,u.preloadResource=yh,u.preloadRoute=hh,u.preserveAspectRatio=Ef,u.priorityLoader=$f,u.removeLanguageFromPath=at,u.reportApiCall=Ah,u.reportCustomMetric=Th,u.reportRouteChange=An,u.reportWebVitals=fh,u.routeConfig=hn,u.securityHeaders=xg,u.setupCSPReporting=Cg,u.setupLazyLoading=vf,u.setupProgressiveLoading=Nf,u.shouldEnableWallet=yg,u.smartLinkVariants=ur,u.stripLanguagePrefix=eo,u.supportsAVIF=Gn,u.supportsCSSImports=vg,u.supportsWebP=qn,u.themeStorage=Hf,u.useApiMetrics=Wn,u.useBanner=yi,u.useBundleMetrics=On,u.useClickOutside=ir,u.useCodeLoader=Ya,u.useComponentPerformance=wn,u.useCopyToClipboard=Hh,u.useDebugMemo=lh,u.useDraggable=$n,u.useDynamicImport=Bf,u.useErrorRecovery=p0,u.useFormSubmission=$h,u.useFormValidation=Yh,u.useImageLazyLoading=gh,u.useLayout=he,u.useLazyLoad=Zn,u.useLazyStyles=df,u.useLocalizedNavigate=U0,u.useLocation=Pf,u.useMediaQuery=hf,u.useMemoryLeakDetection=ph,u.useMultipleCopyToClipboard=qh,u.useNavigation=Mf,u.useOptimizedTheme=ff,u.useOptimizedWallets=th,u.usePerformanceMark=oh,u.useReducedMotion=af,u.useRenderCount=ih,u.useResponsiveStyles=tf,u.useRoutePerformance=Gh,u.useSearchParams=Of,u.useSmartLinks=rc,u.useStableCallback=sh,u.useTheme=F0,u.useToast=fs,u.useToggle=Vh,u.useTopbar=it,u.useWebVitals=Mn,u.utils=Yn,u.validateHeadingStructure=Ru,u.walletStorage=qf,u.web3SecurityNotes=Sg,u.withLazyErrorBoundary=m0,u.withPerformanceTracking=kh,u.withRetry=fg,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
74
+ `;return`data:image/svg+xml;base64,${btoa(n)}`},Tf=(e,r)=>{const a=1/r*100;e.style.position="relative",e.style.paddingTop=`${a}%`;const n=e.querySelector("img");n&&(n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.objectFit="cover")},je={createPureFunction:e=>e,isDevelopment:process.env.NODE_ENV==="development",isProduction:process.env.NODE_ENV==="production",isTest:process.env.NODE_ENV==="test",createFeatureFlags:(e={})=>({enableAnalytics:process.env.VITE_ENABLE_ANALYTICS==="true",enableDebugTools:process.env.NODE_ENV==="development",enablePerformanceMonitoring:process.env.VITE_ENABLE_PERF_MONITORING!=="false",...e})},Af=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=()=>{try{return n()}catch{return Promise.resolve({default:null})}}}),r},Yn={createDebounce:e=>r=>{let a;return((...n)=>{clearTimeout(a),a=setTimeout(()=>r(...n),e)})},memoize:e=>{const r=new Map;return((...a)=>{const n=JSON.stringify(a);if(r.has(n))return r.get(n);const o=e(...a);return r.set(n,o),o})},isDeepEqual:(e,r)=>{if(e===r)return!0;if(e==null||r==null||typeof e!="object"||typeof r!="object")return!1;const a=Object.keys(e),n=Object.keys(r);if(a.length!==n.length)return!1;for(const o of a)if(!n.includes(o)||!Yn.isDeepEqual(e[o],r[o]))return!1;return!0},createThrottle:e=>r=>{let a=0;return((...n)=>{const o=Date.now();if(o-a>=e)return a=o,r(...n)})}},If=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]={},Object.entries(n).forEach(([o,s])=>{r[a][o]=()=>import(s).then(l=>({[o]:l[o]}))})}),r},_e={getModuleSize:e=>new Promise(r=>{if(typeof window<"u"&&"performance"in window){const n=performance.getEntriesByType("resource").find(o=>o.name.includes(e));r(n?.transferSize||0)}else r(0)}),usageTracker:new Set,trackUsage:e=>{je.isDevelopment&&_e.usageTracker.add(e)},getUsageReport:()=>je.isDevelopment?Array.from(_e.usageTracker).sort():[],estimateImpact:e=>{const r=e.map(a=>_e.getModuleSize(a).then(n=>[a,n]));return Promise.all(r).then(a=>{const n={};let o=0;return a.forEach(([s,l])=>{n[s]=l,o+=l}),{total:o,modules:n}})}},Kn={inlineCriticalCSS:e=>{if(typeof document<"u"){const r=document.createElement("style");r.textContent=e,document.head.appendChild(r)}},loadAsyncCSS:e=>{if(typeof document<"u"){const r=document.createElement("link");r.rel="stylesheet",r.href=e,r.media="print",r.onload=()=>{r.media="all"},document.head.appendChild(r)}},removeUnusedCSS:e=>{if(typeof document>"u")return;const r=new Set;return e.forEach(a=>{try{document.querySelector(a)&&r.add(a)}catch{}}),{used:Array.from(r),unused:e.filter(a=>!r.has(a))}}},Lf=(e={})=>{const{features:r={},criticalCSS:a="",enableUsageTracking:n=je.isDevelopment}=e;return{features:je.createFeatureFlags(r),initialize:()=>{a&&typeof document<"u"&&Kn.inlineCriticalCSS(a)},cleanup:()=>{_e.usageTracker.clear()},getReport:()=>({usage:_e.getUsageReport(),features:je.createFeatureFlags(r)})}};let wt;function Mf(e){throw typeof window<"u"?new Error("Web navigation service not implemented in shared library"):new Error("React Native navigation service not implemented in shared library")}function se(e){return wt||(wt=Mf()),wt}function Pf(){const e=se(),r=e.getCurrentState();return{navigate:(a,n)=>{e.navigate(a,n)},goBack:a=>{e.goBack(a)},replace:(a,n)=>{e.replace(a,n)},currentPath:r.currentPath,searchParams:r.searchParams,params:r.params,canGoBack:e.canGoBack(),isSupported:e.isSupported()}}function Of(){const r=se().getCurrentState(),a=Object.keys(r.searchParams).length>0?"?"+new URLSearchParams(r.searchParams).toString():"";return{pathname:r.currentPath,search:a,searchParams:r.searchParams,hash:"",state:{},key:r.currentPath}}function Uf(){const e=se(),r=e.getCurrentState();return[new URLSearchParams(r.searchParams),o=>{const s=o instanceof URLSearchParams?Object.fromEntries(o.entries()):o,l=new URLSearchParams(s).toString(),i=r.currentPath+(l?`?${l}`:"");e.replace(i)}]}const Ie={navigate:(e,r)=>{se().navigate(e,r)},goBack:e=>{se().goBack(e)},replace:(e,r)=>{se().replace(e,r)},getCurrentPath:()=>se().getCurrentPath(),getSearchParams:()=>se().getSearchParams(),goToMail:()=>{Ie.navigate("/mail")},goToPreferences:()=>{Ie.navigate("/preferences")},goToCompose:(e,r)=>{const a=new URLSearchParams;e&&a.set("type",e),r&&Object.entries(r).forEach(([o,s])=>{a.set(o,s)});const n=a.toString();Ie.navigate(`/mail/compose${n?`?${n}`:""}`)},goToConnect:()=>{Ie.navigate("/connect")},goToDelegate:()=>{Ie.navigate("/admin/delegate")},goToHome:()=>{Ie.navigate("/")},canGoBack:()=>se().canGoBack()};function Df(e,r=3,a=1e3){return p.lazy(()=>new Promise((n,o)=>{const s=l=>{e().then(n).catch(i=>{l>0?setTimeout(()=>{s(l-1)},a):o(i)})};s(r)}))}function jf(e){let r=null;const a=()=>(r||(r=e()),r.then(()=>{}));return{Component:p.lazy(()=>r||e()),preload:a}}function _f(e,r={}){const{fallback:a=t.jsx("div",{children:"Loading..."}),errorFallback:n=t.jsx("div",{children:"Failed to load component"}),loadingDelay:o=200,minimumLoadingTime:s=500}=r,l=p.lazy(async()=>{const d=Date.now();try{const c=await e(),h=Date.now()-d;return h<s&&await new Promise(g=>setTimeout(g,s-h)),c}catch{return{default:(()=>n)}}}),i=()=>{const[d,c]=p.useState(!1);return p.useEffect(()=>{const h=setTimeout(()=>{c(!0)},o);return()=>clearTimeout(h)},[]),d?t.jsx(t.Fragment,{children:a}):null};return p.forwardRef((d,c)=>t.jsx(p.Suspense,{fallback:t.jsx(i,{}),children:t.jsx(l,{...d,ref:c})}))}function Zn(e,r={}){const[a,n]=p.useState(!1),[o,s]=p.useState(!1);return p.useEffect(()=>{const l=e.current;if(!l||o)return;const i=new IntersectionObserver(([d])=>{d.isIntersecting&&(n(!0),s(!0),i.disconnect())},{rootMargin:"50px",threshold:.01,...r});return i.observe(l),()=>{i.disconnect()}},[e,r,o]),a}const zf=({children:e,fallback:r=t.jsx("div",{children:"Loading..."}),threshold:a=.01,rootMargin:n="50px",placeholder:o})=>{const s=p.useRef(null),l=Zn(s,{threshold:a,rootMargin:n});return t.jsx("div",{ref:s,children:l?e:o||r})};function Bf(e){const{importFn:r,preloadOnHover:a=!0,preloadOnFocus:n=!0,prefetchDelay:o=50}=e;let s=null,l=null;const i=()=>(l||(l=r()),l),d=()=>{s&&clearTimeout(s),s=setTimeout(()=>{i()},o)};return{Component:p.lazy(()=>l||r()),preload:i,linkProps:{...a&&{onMouseEnter:d,onMouseLeave:()=>{s&&clearTimeout(s)}},...n&&{onFocus:d}}}}function Ff(e,r=[]){const[a,n]=p.useState(null),[o,s]=p.useState(!0),[l,i]=p.useState(null);return p.useEffect(()=>{let d=!0;return s(!0),i(null),e().then(c=>{d&&(n(c),s(!1))}).catch(c=>{d&&(i(c),s(!1))}),()=>{d=!1}},[e,...r]),{module:a,loading:o,error:l}}class Xn{constructor(r=3,a=100){this.queue=new Set,this.isProcessing=!1,this.batchSize=r,this.delay=a}add(r){this.queue.add(r),this.process()}async process(){if(this.isProcessing||this.queue.size===0)return;this.isProcessing=!0;const r=Array.from(this.queue).slice(0,this.batchSize);r.forEach(a=>this.queue.delete(a)),await Promise.all(r.map(a=>a().catch(()=>{}))),this.queue.size>0&&await new Promise(a=>setTimeout(a,this.delay)),this.isProcessing=!1,this.queue.size>0&&this.process()}}function Wf(e,r,a){if(typeof document>"u")return;const n=document.createElement("link");n.rel=r,n.href=e,a&&(r==="preload"||r==="prefetch")&&(n.as=a),document.head.appendChild(n)}var kt=(e=>(e[e.HIGH=0]="HIGH",e[e.MEDIUM=1]="MEDIUM",e[e.LOW=2]="LOW",e[e.IDLE=3]="IDLE",e))(kt||{});class Qn{constructor(){this.queues=new Map,this.isProcessing=!1,Object.values(kt).filter(r=>typeof r=="number").forEach(r=>{this.queues.set(r,[])})}load(r,a=1){const n=this.queues.get(a);n&&n.push(r),this.process()}async process(){if(!this.isProcessing){this.isProcessing=!0;for(const[r,a]of this.queues)for(;a.length>0;){const n=a.shift();if(n)try{await n()}catch{}r>=2&&await new Promise(o=>setTimeout(o,50))}this.isProcessing=!1}}}const $f=new Xn,Vf=new Qn;class xt{constructor(r={}){this.prefix=r.prefix||"mailbox",this.defaultTTL=r.ttl,this.platformStorage=r.platformStorage||this.createFallbackStorage()}createFallbackStorage(){const r=new Map;return{getItem:a=>r.get(a)||null,setItem:(a,n)=>{r.set(a,n)},removeItem:a=>{r.delete(a)},clear:()=>{r.clear()},getAllKeys:()=>Array.from(r.keys())}}getKey(r){return`${this.prefix}-${r}`}isExpired(r){return r.ttl?Date.now()-r.timestamp>r.ttl:!1}set(r,a,n){try{const o={value:a,timestamp:Date.now(),ttl:n||this.defaultTTL};this.platformStorage.setItem(this.getKey(r),JSON.stringify(o))}catch{}}get(r,a){try{const n=this.platformStorage.getItem(this.getKey(r));if(!n)return a;const o=JSON.parse(n);return this.isExpired(o)?(this.remove(r),a):o.value}catch{return a}}remove(r){try{this.platformStorage.removeItem(this.getKey(r))}catch{}}clear(r){try{if(this.platformStorage.getAllKeys){const a=this.platformStorage.getAllKeys(),n=this.getKey(r||""),o=a.filter(s=>s.startsWith(n));for(const s of o)this.platformStorage.removeItem(s)}else this.platformStorage.clear?.()}catch(a){console.error("Failed to clear storage:",a)}}has(r){try{return this.platformStorage.getItem(this.getKey(r))!==null}catch(a){return console.error(`Failed to check item ${r}:`,a),!1}}getAllKeys(){try{if(this.platformStorage.getAllKeys){const r=this.platformStorage.getAllKeys(),a=`${this.prefix}-`;return r.filter(n=>n.startsWith(a)).map(n=>n.substring(a.length))}return[]}catch(r){return console.error("Failed to get all keys:",r),[]}}}const Hf=new xt,qf=new xt({prefix:"mailbox-theme"}),Gf=new xt({prefix:"walletUser",ttl:10080*60*1e3}),Yf=e=>{if(!e)throw new Error("PlatformStorage must be provided to createSimpleStorage");return{setItem:(r,a)=>{try{e.setItem(r,a)}catch{}},getItem:r=>{try{return e.getItem(r)}catch{return null}},removeItem:r=>{try{e.removeItem(r)}catch{}}}};function Jn(){const e={isWalletBrowser:!1,walletType:"unknown",hasEthereum:!1,hasSolana:!1,provider:null};if(typeof window>"u")return e;try{const r=navigator.userAgent.toLowerCase();let a="unknown",n=!1;r.includes("metamask")?(a="metamask",n=!0):r.includes("trustwallet")?(a="trustwallet",n=!0):r.includes("coinbase")?(a="coinbase",n=!0):r.includes("rainbow")?(a="rainbow",n=!0):r.includes("phantom")?(a="phantom",n=!0):r.includes("solflare")?(a="solflare",n=!0):r.includes("exodus")&&(a="exodus",n=!0);const o=!!window.ethereum,s=!!window.solana||!!window.phantom?.solana;(o||s)&&!n&&(n=!0,window.ethereum?.isMetaMask?a="metamask":window.ethereum?.isCoinbaseWallet?a="coinbase":window.ethereum?.isRainbow?a="rainbow":window.phantom?a="phantom":window.solflare&&(a="solflare"));const l=o?window.ethereum:s?window.solana||window.phantom?.solana:null;return{isWalletBrowser:n,walletType:a,hasEthereum:o,hasSolana:s,provider:l}}catch{return e}}async function Kf(){const e=Jn();if(!e.isWalletBrowser)return{success:!1,error:"Not running in a wallet browser"};try{if(e.hasEthereum&&e.provider)try{const r=await e.provider.request({method:"eth_requestAccounts"});if(r&&r.length>0)return{success:!0,address:r[0]}}catch{}if(e.hasSolana&&e.provider)try{const r=await e.provider.connect();if(r.publicKey)return{success:!0,address:r.publicKey.toString()}}catch{}return{success:!1,error:"Failed to connect to wallet provider"}}catch(r){return{success:!1,error:r instanceof Error?r.message:"Unknown connection error"}}}function Zf(e){if(!e)return!1;if(e instanceof Error){const r=e.message.toLowerCase();if(r.includes("network")||r.includes("fetch")||r.includes("failed to fetch")||r.includes("connection")||r.includes("timeout")||r.includes("net::err"))return!0}if(typeof e=="string"){const r=e.toLowerCase();if(r.includes("network")||r.includes("fetch")||r.includes("failed to fetch")||r.includes("connection")||r.includes("timeout")||r.includes("server error")||r.includes("500")||r.includes("502")||r.includes("503")||r.includes("504"))return!0}if(typeof e=="object"&&e!==null&&"status"in e){const r=e.status;if(typeof r=="number"&&r>=500&&r<600)return!0}return!1}function Xf(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("429")||r.includes("rate limit")||r.includes("too many requests")||r.includes("rate_limit")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("429")||r.includes("rate limit")||r.includes("too many requests")||r.includes("rate_limit")}return typeof e=="object"&&e!==null&&"status"in e?e.status===429:!1}function Qf(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("401")||r.includes("unauthorized")||r.includes("unauthenticated")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("401")||r.includes("unauthorized")||r.includes("unauthenticated")}return typeof e=="object"&&e!==null&&"status"in e?e.status===401:!1}function Jf(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("403")||r.includes("forbidden")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("403")||r.includes("forbidden")}return typeof e=="object"&&e!==null&&"status"in e?e.status===403:!1}function Rf(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("404")||r.includes("not found")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("404")||r.includes("not found")}return typeof e=="object"&&e!==null&&"status"in e?e.status===404:!1}function eb(e,r="An unexpected error occurred"){return e?typeof e=="string"?e:e instanceof Error||typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:r:r}async function Rn(e){const a=new TextEncoder().encode(e.toLowerCase()),n=await crypto.subtle.digest("SHA-256",a);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")}const rb=Rn;function eo(e){return e.replace(/^\/[a-z]{2}(-[a-z]+)?(?=\/|$)/,"")}function tb(e,r){const a=eo(e);return r?.[a]?r[a]:a.replace(/\//g,"_").replace(/^_/,"")||"home"}const ab={USER_LOGIN:"login",USER_LOGOUT:"logout",USER_SIGNUP:"sign_up",PAGE_VIEW:"page_view",BUTTON_CLICK:"button_click",LINK_CLICK:"link_click",ERROR_OCCURRED:"error_occurred",ERROR_API_CALL:"error_api_call",SCROLL_DEPTH:"scroll_depth",TIME_ON_PAGE:"time_on_page",FORM_SUBMIT:"form_submit",SEARCH:"search"};function nb(e,r){return{event:e,parameters:{...r,timestamp:r?.timestamp??Date.now()}}}const ob={utils:{cn:f}};Object.defineProperty(u,"ArrowLeftIcon",{enumerable:!0,get:()=>M.ArrowLeftIcon}),Object.defineProperty(u,"ArrowRightIcon",{enumerable:!0,get:()=>M.ArrowRightIcon}),Object.defineProperty(u,"Bars3Icon",{enumerable:!0,get:()=>M.Bars3Icon}),Object.defineProperty(u,"BellIcon",{enumerable:!0,get:()=>M.BellIcon}),Object.defineProperty(u,"BellSlashIcon",{enumerable:!0,get:()=>M.BellSlashIcon}),Object.defineProperty(u,"ChartBarIcon",{enumerable:!0,get:()=>M.ChartBarIcon}),Object.defineProperty(u,"CheckCircleIcon",{enumerable:!0,get:()=>M.CheckCircleIcon}),Object.defineProperty(u,"CheckIcon",{enumerable:!0,get:()=>M.CheckIcon}),Object.defineProperty(u,"ChevronDownIcon",{enumerable:!0,get:()=>M.ChevronDownIcon}),Object.defineProperty(u,"ChevronLeftIcon",{enumerable:!0,get:()=>M.ChevronLeftIcon}),Object.defineProperty(u,"ChevronRightIcon",{enumerable:!0,get:()=>M.ChevronRightIcon}),Object.defineProperty(u,"ChevronUpIcon",{enumerable:!0,get:()=>M.ChevronUpIcon}),Object.defineProperty(u,"ClockIcon",{enumerable:!0,get:()=>M.ClockIcon}),Object.defineProperty(u,"CodeBracketIcon",{enumerable:!0,get:()=>M.CodeBracketIcon}),Object.defineProperty(u,"Cog6ToothIcon",{enumerable:!0,get:()=>M.Cog6ToothIcon}),Object.defineProperty(u,"CreditCardIcon",{enumerable:!0,get:()=>M.CreditCardIcon}),Object.defineProperty(u,"DocumentTextIcon",{enumerable:!0,get:()=>M.DocumentTextIcon}),Object.defineProperty(u,"EnvelopeIcon",{enumerable:!0,get:()=>M.EnvelopeIcon}),Object.defineProperty(u,"ExclamationTriangleIcon",{enumerable:!0,get:()=>M.ExclamationTriangleIcon}),Object.defineProperty(u,"EyeSlashIcon",{enumerable:!0,get:()=>M.EyeSlashIcon}),Object.defineProperty(u,"GlobeAltIcon",{enumerable:!0,get:()=>M.GlobeAltIcon}),Object.defineProperty(u,"HomeIcon",{enumerable:!0,get:()=>M.HomeIcon}),Object.defineProperty(u,"InboxIcon",{enumerable:!0,get:()=>M.InboxIcon}),Object.defineProperty(u,"InformationCircleIcon",{enumerable:!0,get:()=>M.InformationCircleIcon}),Object.defineProperty(u,"KeyIcon",{enumerable:!0,get:()=>M.KeyIcon}),Object.defineProperty(u,"MegaphoneIcon",{enumerable:!0,get:()=>M.MegaphoneIcon}),Object.defineProperty(u,"MinusIcon",{enumerable:!0,get:()=>M.MinusIcon}),Object.defineProperty(u,"PaperAirplaneIcon",{enumerable:!0,get:()=>M.PaperAirplaneIcon}),Object.defineProperty(u,"PaperClipIcon",{enumerable:!0,get:()=>M.PaperClipIcon}),Object.defineProperty(u,"PlusIcon",{enumerable:!0,get:()=>M.PlusIcon}),Object.defineProperty(u,"RocketLaunchIcon",{enumerable:!0,get:()=>M.RocketLaunchIcon}),Object.defineProperty(u,"ShieldCheckIcon",{enumerable:!0,get:()=>M.ShieldCheckIcon}),Object.defineProperty(u,"SparklesIcon",{enumerable:!0,get:()=>M.SparklesIcon}),Object.defineProperty(u,"StarIcon",{enumerable:!0,get:()=>M.StarIcon}),Object.defineProperty(u,"TrashIcon",{enumerable:!0,get:()=>M.TrashIcon}),Object.defineProperty(u,"UserGroupIcon",{enumerable:!0,get:()=>M.UserGroupIcon}),Object.defineProperty(u,"XMarkIcon",{enumerable:!0,get:()=>M.XMarkIcon}),Object.defineProperty(u,"CheckCircleIconSolid",{enumerable:!0,get:()=>fe.CheckCircleIcon}),Object.defineProperty(u,"CheckIconSolid",{enumerable:!0,get:()=>fe.CheckIcon}),Object.defineProperty(u,"ExclamationTriangleIconSolid",{enumerable:!0,get:()=>fe.ExclamationTriangleIcon}),Object.defineProperty(u,"StarIconSolid",{enumerable:!0,get:()=>fe.StarIcon}),u.AIMeta=Yu,u.AITrainingEnhancer=Zu,u.AI_TRAINING_CONFIGS=lg,u.ActionBanner=os,u.ActionButton=jl,u.AddressLink=li,u.Alert=Nr,u.AlertBanner=as,u.AlertDescription=ts,u.AlertTitle=rs,u.AnimatedSection=dr,u.ApiSection=jn,u.AreaChart=Rc,u.AspectRatio=mo,u.AudioPlayer=Ed,u.Avatar=Hc,u.Backdrop=fi,u.Badge=ps,u.Banner=mi,u.BarChart=Xc,u.BatchRender=L0,u.Blockquote=Ho,u.BodyText=zo,u.BorderAccent=So,u.Box=At,u.Breadcrumb=Va,u.BreadcrumbNav=dc,u.BreadcrumbSection=l0,u.BundleSection=Dn,u.BurndownChart=id,u.Button=ne,u.CACHE_CONFIGS=tn,u.CTASection=X0,u.Calendar=Oa,u.CalloutBox=$c,u.CancellableRequest=mg,u.Card=Qr,u.CardContent=Bc,u.CardFooter=Fc,u.CardHeader=zc,u.Center=co,u.ChainBadge=sl,u.Checkbox=yl,u.Code=Wo,u.CodeBlock=i0,u.CodeDisplay=$o,u.CollapsibleDocumentationTopic=d0,u.ColorPicker=Fl,u.ColorPickerAdvanced=Wl,u.ColorSwatch=$l,u.Combobox=kl,u.Command=pi,u.CommonAnalyticsEvents=ab,u.ComponentPreloader=mt,u.ConditionalRender=T0,u.Confetti=ec,u.ConfirmationDialog=Gd,u.Container=oo,u.ContentContainer=ou,u.CreditCardInput=Kl,u.CriticalPathOptimizer=oh,u.CurrencyInput=Zl,u.CustomSection=Fn,u.DashboardStatCard=Vc,u.DataSkeleton=ls,u.DataTable=kc,u.DateInput=hl,u.DateRangePicker=zl,u.DateTimePicker=_l,u.DetailErrorState=F0,u.Dialog=ja,u.Divider=No,u.DragDrop=Kd,u.Drawer=jd,u.Dropdown=xl,u.EmptyState=Wa,u.ErrorBoundary=m0,u.ExpensiveComponent=S0,u.ExternalLink=oc,u.FadeInScale=gi,u.FadeInUp=ui,u.FeatureBlock=Ci,u.FeatureCard=V0,u.FeatureGrid=K0,u.FileInput=El,u.Flex=no,u.FloatingElement=hi,u.FloatingPanel=Eo,u.FocusTrap=_d,u.FontSize=nt,u.Footer=lu,u.FooterBottom=gu,u.FooterBottomRow=hu,u.FooterBrand=cu,u.FooterCompact=fu,u.FooterCompactLeft=bu,u.FooterCompactRight=mu,u.FooterCopyright=pu,u.FooterGrid=iu,u.FooterLink=uu,u.FooterLinkSection=du,u.FooterSocialLinks=vu,u.FooterVersion=yu,u.FormAlerts=Ul,u.FormField=Ll,u.FormFieldGroup=cr,u.FormSection=xi,u.FormattedNumber=Ko,u.FullPageSpinner=ss,u.Gauge=ud,u.GlobalLazyErrorBoundary=w0,u.GradientIconContainer=Ei,u.Grid=so,u.HStack=io,u.Heading=Po,u.HelperText=qo,u.HoverCard=Yd,u.IconContainer=Pi,u.IconText=Oi,u.Image=bd,u.ImageCropper=pd,u.ImageGallery=md,u.InfiniteScroll=zd,u.InfoBox=Di,u.InfoCard=Wc,u.Input=nr,u.ItemList=Ui,u.KYCLevelCard=tu,u.KYCStatusBadge=R0,u.Kbd=Vo,u.KeyValuePair=Yc,u.Label=Zr,u.LanguageSelector=f0,u.LanguageValidator=U0,u.LayoutContext=rt,u.LayoutProvider=s0,u.LazyComponent=A0,u.LazyErrorBoundary=hr,u.LazyImage=Mg,u.LazyLoadQueue=Xn,u.LazyWalletButton=nh,u.LazyWrapper=zf,u.Lightbox=vd,u.LineChart=Qc,u.Link=nc,u.List=Ac,u.ListItem=Ic,u.ListItemWithAction=Lc,u.LiveStream=Sd,u.LoadPriority=kt,u.LoadingDots=Qo,u.LoadingOptimizer=cg,u.LoadingOverlay=Xo,u.LoadingState=Jo,u.LocalizedLink=O0,u.Logo=_i,u.Main=Ku,u.Masonry=Mo,u.MasterDetailLayout=ku,u.MasterListItem=wu,u.MediaUploader=Md,u.MemorySection=Bn,u.MentionInput=Al,u.MetricRow=H,u.Modal=Jr,u.ModalContent=Rr,u.ModalFooter=et,u.ModalHeader=Dd,u.MultiSelect=wl,u.NavigationList=gc,u.NavigationMenu=uc,u.NetworkErrorBoundary=p0,u.NoContent=Zc,u.NotificationBadge=ms,u.NotificationPanel=ys,u.NumberInput=ul,u.OptimizedAPIClient=fg,u.OptimizedImage=M0,u.OptimizedRoutePreloader=dg,u.Overlay=ar,u.PageContainer=bo,u.PageHeader=nu,u.PageSectionHeader=Bi,u.PageTitle=Uo,u.Pagination=fc,u.PaginationNav=bc,u.PanelHeader=In,u.PerformanceBoundary=I0,u.PerformanceOptimizer=ig,u.PerformancePanel=$h,u.PhoneDirectory=Dl,u.PhoneInput=ml,u.PieChart=Jc,u.PlatformSpecificComponents=$g,u.PlaylistManager=Od,u.PodcastPlayer=Ld,u.Popover=Bd,u.Portal=me,u.PreloadLink=cc,u.PriorityLoader=Qn,u.Progress=gd,u.ProgressCircle=hd,u.PromotionalBanner=u0,u.ProtectedRoute=_0,u.PullToRefresh=n0,u.QRCodeDisplay=Ud,u.QuickActions=Wi,u.QuizBuilder=ni,u.RadioGroup=pl,u.RelativeTime=Zo,u.Resizable=Ao,u.RetinaImage=wd,u.RouteBasedLazyLoader=bt,u.SEO=Gu,u.SafeAppWrapper=k0,u.ScoreIndicator=Dh,u.ScoreLegend=Ln,u.ScrollArea=Lo,u.ScrollSpy=Fd,u.SearchInput=gl,u.Section=ho,u.SectionBadge=Hi,u.SectionHeader=qi,u.SectionTitle=jo,u.SecurityProvider=x0,u.Select=qr,u.SelectContent=sr,u.SelectField=Ol,u.SelectGroup=vl,u.SelectItem=lr,u.SelectLabel=Ia,u.SelectScrollDownButton=Yr,u.SelectScrollUpButton=Gr,u.SelectSeparator=La,u.SelectTrigger=or,u.SelectValue=Aa,u.Separator=Co,u.SettingsList=Yi,u.Sheet=Wd,u.SideNav=hc,u.SignaturePad=Vl,u.SignatureRequest=Hl,u.SkeletonLoader=Ro,u.Slider=Cl,u.SliderInput=Sl,u.SmartContent=ac,u.SmartLink=Xr,u.SmartWalletProviders=th,u.Spacer=uo,u.Sparkline=od,u.Spinner=Me,u.SplitPane=To,u.Stack=xr,u.StandardPageLayout=au,u.StatCard=wi,u.StatDisplay=Kc,u.StatusBadge=ol,u.StatusIndicator=il,u.StepList=b0,u.Stepper=mc,u.StepperNav=yc,u.SubscriptionGatedComponents=Wg,u.SumsubWebSDK=eu,u.Switch=Ta,u.Table=wc,u.TableOfContents=vc,u.Tabs=_a,u.TabsContent=Fa,u.TabsList=za,u.TabsTrigger=Ba,u.TagInput=Tl,u.Text=It,u.TextArea=dl,u.TextAreaField=Pl,u.TextField=Ml,u.TextInputModal=$d,u.TextLink=Fo,u.Theme=re,u.ThemeContext=ot,u.ThemeProvider=$0,u.TimePicker=Ea,u.TimerDisplay=Ji,u.Toast=Lt,u.ToastContainer=hs,u.ToastContext=Cr,u.ToastNotification=bs,u.ToastProvider=cs,u.ToggleGroup=Nl,u.Tooltip=$a,u.Topbar=Cu,u.TopbarActions=Fu,u.TopbarCenter=Eu,u.TopbarContext=lt,u.TopbarDivider=Iu,u.TopbarIconButton=Vu,u.TopbarLeft=Su,u.TopbarLogo=Mu,u.TopbarMenuToggle=Qa,u.TopbarMobileContent=Au,u.TopbarMobileNav=ju,u.TopbarNav=Ja,u.TopbarNavigation=_u,u.TopbarProvider=Za,u.TopbarRight=Tu,u.TopbarSearch=qu,u.TrackedButton=g0,u.TrackedLink=h0,u.TransferList=Pc,u.TreeView=Uc,u.TruncatedText=Yo,u.UaudioUwaveform=Td,u.UavatarUgroup=qc,u.UbadgeUdesigner=vs,u.UbubbleUchart=rd,u.UcellUeditor=Ec,u.UcodeUhighlighter=Yl,u.UcolumnUresize=Sc,u.UcurrencyUconverter=Xl,u.UcurrencyUrates=Ql,u.UdataUgrid=xc,u.UdoubleUtap=r0,u.UdragUdropUlist=Zd,u.UfieldUmapper=ti,u.UfocusUindicator=Si,u.UformUbuilder=Jl,u.UformUtemplate=ei,u.UformUvalidator=Rl,u.UfunnelUchart=ld,u.UgestureUdetector=Jd,u.Uheatmap=sd,u.UimageUcomparison=yd,u.UkeyboardUshortcut=ji,u.UlistingUform=Dc,u.UlongUpress=t0,u.UmarkdownUrenderer=Gl,u.UmediaUplaylist=Pd,u.UmetricUcomparison=dd,u.UmorphUtransition=zi,u.UnestedUdrag=Qd,u.UparallaxUscroll=Fi,u.UperformanceUchart=cd,u.UpinchUzoom=e0,u.UpivotUtable=Nc,u.UprofileUheader=Gc,u.UprogressUtracker=fd,u.UradarUchart=ed,u.UradialUmenu=a0,u.UresizableUpanels=Io,u.UrevealUonUscroll=$i,u.UsankeyUdiagram=nd,u.UscatterUplot=td,u.UschemaUvalidator=ri,u.UscreenUreaderUtext=Go,u.UskipUnavigation=Ki,u.UsortUdropdown=Zi,u.UsortableUgrid=Xd,u.UspreadsheetUgrid=Cc,u.UstatusUpipeline=cl,u.UsurveyUbuilder=ai,u.UswipeUactions=Rd,u.UtableUreservation=Tc,u.UtimeUslotUpicker=Bl,u.UtreeUmap=ad,u.UuserUtable=Mc,u.UversionUbadge=Xi,u.UvideoUcall=Cd,u.UvideoUthumbnail=xd,u.UvoiceUrecorder=Id,u.VStack=lo,u.VideoEditor=Nd,u.VideoPlayer=kd,u.VirtualList=Oc,u.VirtualListItem=E0,u.VisuallyHidden=Qi,u.WEB3_CONCEPTS=tg,u.WEB3_EMAIL_HEADINGS=rg,u.WEB3_HEADING_PATTERNS=oe,u.WalletPreloader=Qe,u.WaveForm=Ad,u.WebVitalsSection=Pn,u.WysiwygEditor=ql,u.addLanguageToPath=tt,u.addResourceHint=Wf,u.aiOptimizationPresets=eh,u.appStorage=Hf,u.autoConnectWalletBrowser=Kf,u.batchDOMUpdates=lf,u.bundleAnalysis=_e,u.buttonVariants=Pa,u.cacheHeaders=Cg,u.cacheUtils=yg,u.checkPerformanceBudget=Ch,u.clearComponentCache=Pg,u.clearConditionalCache=Hg,u.clearPreloadCache=sc,u.clearRenderCounts=uh,u.cn=f,u.conditionalCSS=kg,u.convertFileSize=Xh,u.createAIMetaTags=rn,u.createAIOptimizedSchema=gt,u.createAdvancedLazyComponent=Ag,u.createAnalyticsEvent=nb,u.createCSSVariables=rf,u.createConditionalImports=Af,u.createConditionalLazyComponent=Fg,u.createEnhancedFAQSchema=Xu,u.createEnhancedOpenGraph=Ra,u.createEnhancedTwitterCard=en,u.createFeature=st,u.createLazyComponent=gn,u.createLazyComponentFactory=gh,u.createLazyRoute=Bf,u.createLazyWalletProvider=vt,u.createLibraryImports=zg,u.createMemoComponent=N0,u.createOptimizedStyles=Jh,u.createProgressiveComponent=_f,u.createSecurityFeatures=Z0,u.createSelectiveExports=If,u.createSelectiveMemoComponent=C0,u.createSemanticHeading=Ru,u.createSimpleStorage=Yf,u.createTechnicalArticleSchema=ut,u.createTreeShakingConfig=Lf,u.createUIComponents=_g,u.createWeb3ProductSchema=dt,u.cspDirectives=xg,u.cssOptimization=Kn,u.deadCodeElimination=je,u.default=ob,u.defaultPerformanceBudget=kn,u.detectAvailableWallets=pt,u.detectWalletBrowser=Jn,u.exportPerformanceData=Sh,u.formatBytes=Un,u.formatFileSize=Zh,u.formatMetricValue=_h,u.generateAIMetaTags=Zg,u.generateAIMetadata=ag,u.generateAIStructuredData=Qg,u.generateAdvancedSEO=Qu,u.generateCSP=dn,u.generateCSPDirectives=ht,u.generateConceptGraph=ng,u.generateContentRelationships=Xg,u.generateEntityRecognition=yn,u.generateImageSEO=mf,u.generatePerformanceTrackingSchema=Rg,u.generatePictureElement=xf,u.generatePlaceholder=Ef,u.generateQAPairs=sg,u.generateSemanticMarkup=mn,u.generateSizes=pf,u.generateSocialImageMeta=vf,u.generateSrcSet=yf,u.generateTopicClustering=pn,u.generateTrainingExamples=og,u.getConditionalStats=qg,u.getEnvironmentType=ln,u.getErrorMessage=eb,u.getLazyLoadingStats=Og,u.getOptimalImageFormat=kf,u.getPageName=tb,u.getPerformanceMonitor=vr,u.getPreloadingStats=Kg,u.getRenderCounts=dh,u.getSecurityHeaders=un,u.getUINavigationService=se,u.getWebVitalRating=Ae,u.getWebVitals=mh,u.hashString=Rn,u.hashUserId=rb,u.initWebVitals=Th,u.initializeAdvancedPreloading=Yg,u.initializePerformanceMonitoring=kh,u.initializePreloading=Bg,u.inlineCriticalStyles=df,u.isAuthError=Qf,u.isForbiddenError=Jf,u.isLocalhost=on,u.isNetworkAccess=sn,u.isNotFoundError=Rf,u.isPreloaded=lc,u.isRateLimitError=Xf,u.isServerError=Zf,u.isWalletBrowser=nn,u.isWebEnvironment=cn,u.lazyLoadQueue=$f,u.lazyWithPreload=jf,u.lazyWithRetry=Df,u.loadCSS=vg,u.loadCriticalCSS=Rh,u.loadNonCriticalCSS=ef,u.measureAsyncOperation=Nh,u.measureCLS=xn,u.measureFCP=Nn,u.measureFID=Sn,u.measureINP=Tn,u.measureImagePerformance=Sf,u.measureLCP=Cn,u.measureTTFB=En,u.navigationHelper=Ie,u.optimizeClassNames=cf,u.optimizeContainment=of,u.optimizeFlex=hf,u.optimizeGrid=gf,u.optimizeWillChange=sf,u.optimizedFetch=an,u.pageSEOConfigs=Ju,u.parseFileSize=Qh,u.performanceBudget=ue,u.performanceUtils=mr,u.prefersReducedMotion=Hn,u.prefetchResource=yh,u.preloadComponent=jg,u.preloadImage=Nf,u.preloadResource=ph,u.preloadRoute=fh,u.preserveAspectRatio=Tf,u.priorityLoader=Vf,u.removeLanguageFromPath=at,u.reportApiCall=Ih,u.reportCustomMetric=Ah,u.reportRouteChange=An,u.reportWebVitals=bh,u.routeConfig=hn,u.securityHeaders=Ng,u.setupCSPReporting=Sg,u.setupLazyLoading=wf,u.setupProgressiveLoading=Cf,u.shouldEnableWallet=pg,u.smartLinkVariants=ur,u.stripLanguagePrefix=eo,u.supportsAVIF=Gn,u.supportsCSSImports=wg,u.supportsWebP=qn,u.themeStorage=qf,u.useApiMetrics=Wn,u.useBanner=yi,u.useBundleMetrics=On,u.useClickOutside=ir,u.useCodeLoader=Ya,u.useComponentPerformance=wn,u.useCopyToClipboard=qh,u.useDebugMemo=ih,u.useDraggable=$n,u.useDynamicImport=Ff,u.useErrorRecovery=v0,u.useFormSubmission=Vh,u.useFormValidation=Kh,u.useImageLazyLoading=hh,u.useLayout=he,u.useLazyLoad=Zn,u.useLazyStyles=uf,u.useLocalizedNavigate=D0,u.useLocation=Of,u.useMediaQuery=ff,u.useMemoryLeakDetection=vh,u.useMultipleCopyToClipboard=Gh,u.useNavigation=Pf,u.useOptimizedTheme=bf,u.useOptimizedWallets=ah,u.usePerformanceMark=sh,u.useReducedMotion=nf,u.useRenderCount=ch,u.useResponsiveStyles=af,u.useRoutePerformance=Yh,u.useSearchParams=Uf,u.useSmartLinks=rc,u.useStableCallback=lh,u.useTheme=W0,u.useToast=fs,u.useToggle=Hh,u.useTopbar=it,u.useWebVitals=Mn,u.utils=Yn,u.validateHeadingStructure=eg,u.walletStorage=Gf,u.web3SecurityNotes=Eg,u.withLazyErrorBoundary=y0,u.withPerformanceTracking=xh,u.withRetry=bg,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));