@nice2dev/ui-core 1.0.30 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/dist/core/NiceThemeVariants.d.ts +2 -2
- package/dist/core/NiceThemeVariants.d.ts.map +1 -1
- package/dist/core/NiceUserPreferences.d.ts +2 -2
- package/dist/core/NiceUserPreferences.d.ts.map +1 -1
- package/dist/core/a11y-advanced.d.ts +1 -1
- package/dist/core/a11y.d.ts +1 -1
- package/dist/core/a11y.d.ts.map +1 -1
- package/dist/core/adapters.d.ts.map +1 -1
- package/dist/core/datasource-aggregation.d.ts.map +1 -1
- package/dist/core/touch.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +18 -10
- package/dist/index.mjs.map +1 -1
- package/dist/performance/images.d.ts +2 -2
- package/dist/performance/memory.d.ts +1 -1
- package/package.json +11 -10
package/dist/index.cjs
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
|
|
16
16
|
visibility: hidden;
|
|
17
17
|
pointer-events: none;
|
|
18
|
-
`,document.body.appendChild(a);const n=getComputedStyle(a);t({top:parseInt(n.paddingTop,10)||0,right:parseInt(n.paddingRight,10)||0,bottom:parseInt(n.paddingBottom,10)||0,left:parseInt(n.paddingLeft,10)||0}),document.body.removeChild(a)};return r(),window.addEventListener("resize",r),window.addEventListener("orientationchange",r),()=>{window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[]),e}function pr(e="normal"){return typeof e=="number"?e:e==="fast"?120:e==="slow"?300:200}const Ze={fade:"nice-anim-fade-enter",slideUp:"nice-anim-slide-up-enter",slideDown:"nice-anim-slide-down-enter",slideLeft:"nice-anim-slide-left-enter",slideRight:"nice-anim-slide-right-enter",scaleUp:"nice-anim-scale-up-enter",scaleDown:"nice-anim-scale-down-enter",zoom:"nice-anim-zoom-enter",flip:"nice-anim-flip-enter",none:""},gr={fade:"nice-anim-fade-exit",slideUp:"nice-anim-slide-up-exit",slideDown:"nice-anim-slide-down-exit",slideLeft:"nice-anim-slide-left-exit",slideRight:"nice-anim-slide-right-exit",scaleUp:"nice-anim-scale-up-exit",scaleDown:"nice-anim-scale-down-exit",zoom:"nice-anim-zoom-exit",flip:"nice-anim-flip-exit",none:""};function Mi(e){const{visible:t,animation:r="fade",duration:a="normal",onEntered:n,onExited:s}=e,[i,o]=c.useState(t?"entered":"exited"),[l,d]=c.useState(t),u=c.useRef(),f=pr(a),p=c.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[]),h=p||r==="none"?0:f;c.useEffect(()=>(u.current&&clearTimeout(u.current),t?(d(!0),o("entering"),u.current=setTimeout(()=>{o("entered"),n==null||n()},h)):(o("exiting"),u.current=setTimeout(()=>{o("exited"),d(!1),s==null||s()},h)),()=>{u.current&&clearTimeout(u.current)}),[t,h]);const m=c.useMemo(()=>r==="none"||p?"":i==="entering"?Ze[r]:i==="exiting"?gr[r]:i==="entered"?`${Ze[r]} nice-anim-active`:"",[r,i,p]),y=c.useMemo(()=>({animationDuration:`${h}ms`,transitionDuration:`${h}ms`}),[h]);return{state:i,shouldRender:l,className:m,style:y}}function Ci(e,t){const{expanded:r,duration:a="normal"}=t,[n,s]=c.useState(r?"auto":0),i=pr(a);return c.useEffect(()=>{const o=e.current;if(o)if(r){const l=o.scrollHeight;s(l);const d=setTimeout(()=>s("auto"),i);return()=>clearTimeout(d)}else{const l=o.scrollHeight;s(l),requestAnimationFrame(()=>{requestAnimationFrame(()=>s(0))})}},[r,i,e]),{overflow:"hidden",height:typeof n=="number"?`${n}px`:n,transition:`height ${i}ms ease`}}function Ai(e,t=50){return`${e*t}ms`}function Ei(e,t){return t==="enter"?Ze[e]:gr[e]}const yr=c.createContext({direction:"ltr",isRTL:!1,flip:e=>e,flipStyle:(e,t)=>({[e]:t})}),hr=({direction:e,children:t})=>{const r=c.useMemo(()=>e!=="auto"?e:typeof document<"u"&&document.documentElement.getAttribute("dir")==="rtl"?"rtl":"ltr",[e]),a=r==="rtl";c.useEffect(()=>(e!=="auto"&&(document.documentElement.setAttribute("dir",r),document.documentElement.style.direction=r),()=>{e!=="auto"&&(document.documentElement.removeAttribute("dir"),document.documentElement.style.direction="")}),[e,r]);const n=c.useCallback(o=>a?{left:"right",right:"left",start:"end",end:"start"}[o]??o:o,[a]),s=c.useCallback((o,l)=>a?{[{paddingLeft:"paddingRight",paddingRight:"paddingLeft",marginLeft:"marginRight",marginRight:"marginLeft"}[o]||o]:l}:{[o]:l},[a]),i=c.useMemo(()=>({direction:r,isRTL:a,flip:n,flipStyle:s}),[r,a,n,s]);return x.jsx(yr.Provider,{value:i,children:x.jsx("div",{dir:r,style:{direction:r,display:"contents"},children:t})})};hr.displayName="NiceRTLProvider";function Ni(){return c.useContext(yr)}const Li={marginStart:"marginInlineStart",marginEnd:"marginInlineEnd",paddingStart:"paddingInlineStart",paddingEnd:"paddingInlineEnd",borderStart:"borderInlineStart",borderEnd:"borderInlineEnd",insetStart:"insetInlineStart",insetEnd:"insetInlineEnd",start:"insetInlineStart",end:"insetInlineEnd",textAlign:{start:"start",end:"end"}},br=c.createContext({permissions:{},getAccessMode:()=>"full"}),vr=({permissions:e,children:t})=>{const r=c.useMemo(()=>({permissions:e,getAccessMode:(a,n)=>{var s,i;return n&&a&&((s=e.fields)!=null&&s[`${a}.${n}`])?e.fields[`${a}.${n}`]:a&&((i=e.components)!=null&&i[a])?e.components[a]:e.defaultMode??"full"}}),[e]);return x.jsx(br.Provider,{value:r,children:t})};vr.displayName="NiceAccessControl";function Ti(e,t,r){const a=c.useContext(br);return e||a.getAccessMode(t,r)}function Ri(e){switch(e){case"disabled":return{disabled:!0,"aria-disabled":!0,tabIndex:-1};case"readOnly":return{readOnly:!0};default:return{}}}function Ii(e={}){const{threshold:t=50,maxDuration:r=300,onSwipe:a,onSwipeLeft:n,onSwipeRight:s,onSwipeUp:i,onSwipeDown:o,enabled:l=!0}=e,d=c.useRef(null),[u,f]=c.useState(!1),[p,h]=c.useState(null),m=c.useRef(null);return c.useEffect(()=>{const y=d.current;if(!y||!l)return;const g=w=>{if(w.touches.length!==1)return;const A=w.touches[0];m.current={x:A.clientX,y:A.clientY,timestamp:Date.now()},f(!0),h(null)},v=w=>{if(!m.current||w.touches.length!==1)return;const A=w.touches[0],k=A.clientX-m.current.x,C=A.clientY-m.current.y;Math.abs(k)>Math.abs(C)?h(k>0?"right":"left"):h(C>0?"down":"up")},b=w=>{if(!m.current)return;const A=w.changedTouches[0],k={x:A.clientX,y:A.clientY,timestamp:Date.now()},C=k.x-m.current.x,M=k.y-m.current.y,N=k.timestamp-m.current.timestamp,L=Math.sqrt(C*C+M*M),E=L/N;if(f(!1),N<=r&&L>=t){let R;Math.abs(C)>Math.abs(M)?R=C>0?"right":"left":R=M>0?"down":"up";const T={direction:R,distance:L,velocity:E,duration:N};switch(a==null||a(T),R){case"left":n==null||n(T);break;case"right":s==null||s(T);break;case"up":i==null||i(T);break;case"down":o==null||o(T);break}}m.current=null,h(null)},S=()=>{m.current=null,f(!1),h(null)};return y.addEventListener("touchstart",g,{passive:!0}),y.addEventListener("touchmove",v,{passive:!0}),y.addEventListener("touchend",b,{passive:!0}),y.addEventListener("touchcancel",S,{passive:!0}),()=>{y.removeEventListener("touchstart",g),y.removeEventListener("touchmove",v),y.removeEventListener("touchend",b),y.removeEventListener("touchcancel",S)}},[l,t,r,a,n,s,i,o]),{ref:d,isSwiping:u,swipeDirection:p}}function zi(e={}){const{onPinch:t,onPinchStart:r,onPinchEnd:a,minScale:n=.5,maxScale:s=3,enabled:i=!0}=e,o=c.useRef(null),[l,d]=c.useState(1),[u,f]=c.useState(!1),p=c.useRef(null),h=c.useRef(1);return c.useEffect(()=>{const m=o.current;if(!m||!i)return;const y=(w,A)=>{const k=w.clientX-A.clientX,C=w.clientY-A.clientY;return Math.sqrt(k*k+C*C)},g=(w,A)=>({x:(w.clientX+A.clientX)/2,y:(w.clientY+A.clientY)/2}),v=w=>{w.touches.length===2&&(p.current=y(w.touches[0],w.touches[1]),h.current=l,f(!0),r==null||r())},b=w=>{if(w.touches.length!==2||!p.current)return;const A=y(w.touches[0],w.touches[1]),k=Math.min(s,Math.max(n,h.current*(A/p.current)));d(k),t==null||t({scale:k,center:g(w.touches[0],w.touches[1])})},S=()=>{u&&(f(!1),a==null||a(l),p.current=null)};return m.addEventListener("touchstart",v,{passive:!0}),m.addEventListener("touchmove",b,{passive:!0}),m.addEventListener("touchend",S,{passive:!0}),m.addEventListener("touchcancel",S,{passive:!0}),()=>{m.removeEventListener("touchstart",v),m.removeEventListener("touchmove",b),m.removeEventListener("touchend",S),m.removeEventListener("touchcancel",S)}},[i,l,u,n,s,t,r,a]),{ref:o,scale:l,isPinching:u}}function Di(e={}){const{onPan:t,onPanStart:r,onPanEnd:a,enabled:n=!0}=e,s=c.useRef(null),[i,o]=c.useState(!1),[l,d]=c.useState(0),[u,f]=c.useState(0),p=c.useRef(null),h=c.useRef(null);return c.useEffect(()=>{const m=s.current;if(!m||!n)return;const y=b=>{if(b.touches.length!==1)return;const S=b.touches[0],w={x:S.clientX,y:S.clientY,timestamp:Date.now()};p.current=w,h.current=w,o(!0),d(0),f(0),r==null||r()},g=b=>{if(!p.current||!h.current||b.touches.length!==1)return;const S=b.touches[0],w=Date.now(),A={x:S.clientX,y:S.clientY,timestamp:w},k=A.x-p.current.x,C=A.y-p.current.y,M=A.timestamp-h.current.timestamp||1,N=(A.x-h.current.x)/M,L=(A.y-h.current.y)/M;d(k),f(C),t==null||t({deltaX:k,deltaY:C,velocityX:N,velocityY:L}),h.current=A},v=()=>{if(!i||!p.current||!h.current)return;const b=l,S=u,w=h.current.timestamp-p.current.timestamp||1;a==null||a({deltaX:b,deltaY:S,velocityX:b/w,velocityY:S/w}),o(!1),p.current=null,h.current=null};return m.addEventListener("touchstart",y,{passive:!0}),m.addEventListener("touchmove",g,{passive:!0}),m.addEventListener("touchend",v,{passive:!0}),m.addEventListener("touchcancel",v,{passive:!0}),()=>{m.removeEventListener("touchstart",y),m.removeEventListener("touchmove",g),m.removeEventListener("touchend",v),m.removeEventListener("touchcancel",v)}},[n,i,l,u,t,r,a]),{ref:s,isPanning:i,deltaX:l,deltaY:u}}function Sr(e){const{onRefresh:t,threshold:r=80,maxPull:a=120,enabled:n=!0}=e,s=c.useRef(null),[i,o]=c.useState(!1),[l,d]=c.useState(!1),[u,f]=c.useState(0),p=c.useRef(null),h=Math.min(1,u/r);return c.useEffect(()=>{const m=s.current;if(!m||!n||l)return;const y=b=>{m.scrollTop>0||b.touches.length===1&&(p.current=b.touches[0].clientY)},g=b=>{if(p.current===null||b.touches.length!==1)return;const w=b.touches[0].clientY-p.current;if(w<=0){f(0),o(!1);return}const k=Math.min(a,w*.5);f(k),o(k>0),k>0&&b.preventDefault()},v=async()=>{if(u>=r&&!l){d(!0),f(r);try{await t()}finally{d(!1),f(0)}}else f(0);o(!1),p.current=null};return m.addEventListener("touchstart",y,{passive:!0}),m.addEventListener("touchmove",g,{passive:!1}),m.addEventListener("touchend",v,{passive:!0}),m.addEventListener("touchcancel",v,{passive:!0}),()=>{m.removeEventListener("touchstart",y),m.removeEventListener("touchmove",g),m.removeEventListener("touchend",v),m.removeEventListener("touchcancel",v)}},[n,l,u,r,a,t]),{ref:s,isPulling:i,isRefreshing:l,pullDistance:u,pullProgress:h}}const Pi=({children:e,leftActions:t=[],rightActions:r=[],actionWidth:a=80,maxSwipe:n=1.5,threshold:s=.5,className:i,style:o})=>{const l=c.useRef(null),d=c.useRef(null),[u,f]=c.useState(0),[p,h]=c.useState(!1),m=c.useRef(0),y=c.useRef(0),g=t.length*a,v=r.length*a,b=g*n,S=v*n,w=c.useCallback(N=>{h(!1),m.current=N.touches[0].clientX,y.current=u},[u]),A=c.useCallback(N=>{const L=N.touches[0].clientX-m.current;let E=y.current+L;E>b?E=b+(E-b)*.2:E<-S&&(E=-S+(E+S)*.2),!(E>0&&t.length===0)&&(E<0&&r.length===0||f(E))},[b,S,t.length,r.length]),k=c.useCallback(()=>{h(!0),u>g*s?f(g):u<-v*s?f(-v):f(0)},[u,g,v,s]),C=c.useCallback(N=>{h(!0),f(0),N.onAction()},[]),M=c.useCallback(()=>{h(!0),f(0)},[]);return x.jsxs("div",{ref:l,className:`nice-swipeable ${i||""}`,style:{...o,position:"relative",overflow:"hidden"},children:[x.jsx("div",{className:"nice-swipeable__actions nice-swipeable__actions--left",style:{position:"absolute",left:0,top:0,bottom:0,display:"flex",width:g},children:t.map(N=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:N.color,border:"none",color:"var(--bg-primary, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(N),children:N.content},N.key))}),x.jsx("div",{className:"nice-swipeable__actions nice-swipeable__actions--right",style:{position:"absolute",right:0,top:0,bottom:0,display:"flex",width:v},children:r.map(N=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:N.color,border:"none",color:"var(--bg-primary, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(N),children:N.content},N.key))}),x.jsx("div",{ref:d,className:"nice-swipeable__content",style:{transform:`translateX(${u}px)`,transition:p?"transform 0.3s ease-out":"none",background:"var(--bg-primary, #fff)",position:"relative",zIndex:1},onTouchStart:w,onTouchMove:A,onTouchEnd:k,onClick:u!==0?M:void 0,children:e})]})},Fi=({children:e,onRefresh:t,threshold:r=80,pullingContent:a,refreshingContent:n,enabled:s=!0,className:i,style:o})=>{const{ref:l,isPulling:d,isRefreshing:u,pullDistance:f,pullProgress:p}=Sr({onRefresh:t,threshold:r,enabled:s});return x.jsxs("div",{ref:l,className:`nice-pull-refresh ${i||""}`,style:{...o,position:"relative",overflow:"auto",overscrollBehavior:"contain"},children:[x.jsx("div",{className:"nice-pull-refresh__indicator",style:{position:"absolute",top:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center",height:f,overflow:"hidden",transition:d?"none":"height 0.2s ease-out"},children:u?n||x.jsx("div",{className:"nice-pull-refresh__spinner",children:x.jsx("div",{className:"nice-spinner nice-spinner--sm"})}):a||x.jsx("div",{className:"nice-pull-refresh__arrow",style:{transform:`rotate(${p>=1?180:0}deg)`,transition:"transform 0.2s ease",opacity:p},children:x.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})})})}),x.jsx("div",{className:"nice-pull-refresh__content",style:{transform:`translateY(${f}px)`,transition:d?"none":"transform 0.2s ease-out"},children:e})]})};function xr(e="light"){if(!("vibrate"in navigator))return;const t={light:10,medium:20,heavy:30,selection:5,success:[10,30,10],warning:[20,20,20],error:[30,30,30,30]};try{navigator.vibrate(t[e])}catch{}}function Hi(){return c.useCallback((e="light")=>{xr(e)},[])}const $i=({minSize:e=44,children:t,className:r,style:a,onClick:n})=>x.jsx("div",{className:`nice-touch-target ${r||""}`,style:{...a,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:e,minHeight:e,cursor:n?"pointer":void 0},onClick:n,children:t});function ji(){const[e,t]=c.useState(!1),[r,a]=c.useState(0),n=c.useRef(typeof window<"u"?window.innerHeight:0);return c.useEffect(()=>{if(typeof window>"u")return;if("visualViewport"in window&&window.visualViewport){const i=window.visualViewport,o=()=>{const l=n.current-i.height,d=150;t(l>d),a(l>d?l:0)};return i.addEventListener("resize",o),()=>i.removeEventListener("resize",o)}const s=()=>{const i=n.current-window.innerHeight,o=150;t(i>o),a(i>o?i:0)};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),{isKeyboardVisible:e,keyboardHeight:r}}const wr={announceChanges:!0,reduceMotion:"auto",highContrast:"auto",focusStyle:"auto",keyboardShortcuts:!0,minTouchTarget:44},kr=c.createContext(null),Mr=({config:e,children:t})=>{const r=c.useMemo(()=>({...wr,...e}),[e]),a=c.useRef(null),n=c.useRef(null),[s,i]=c.useState(!1);c.useEffect(()=>{const h=window.matchMedia("(prefers-reduced-motion: reduce)");i(h.matches);const m=y=>i(y.matches);return h.addEventListener("change",m),()=>h.removeEventListener("change",m)},[]);const[o,l]=c.useState(!1);c.useEffect(()=>{const h=window.matchMedia("(prefers-contrast: more)");l(h.matches);const m=y=>l(y.matches);return h.addEventListener("change",m),()=>h.removeEventListener("change",m)},[]);const d=r.reduceMotion==="always"?!0:r.reduceMotion==="never"?!1:s,u=r.highContrast==="always"?!0:r.highContrast==="never"?!1:o,f=c.useCallback((h,m="polite")=>{if(!r.announceChanges)return;const y=m==="assertive"?n.current:a.current;y&&(y.textContent="",requestAnimationFrame(()=>{y.textContent=h}))},[r.announceChanges]),p=c.useMemo(()=>({config:r,announce:f,prefersReducedMotion:d,prefersHighContrast:u}),[r,f,d,u]);return x.jsxs(kr.Provider,{value:p,children:[t,x.jsx("div",{ref:a,role:"status","aria-live":"polite","aria-atomic":"true",style:et}),x.jsx("div",{ref:n,role:"alert","aria-live":"assertive","aria-atomic":"true",style:et})]})};Mr.displayName="NiceA11yProvider";function Bi(){const e=c.useContext(kr);return e||{config:wr,announce:()=>{},prefersReducedMotion:!1,prefersHighContrast:!1}}const et={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function Cr(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function Oi(e){const t=e.error?`${e.id}-error`:void 0,r=e.helperText?`${e.id}-helper`:void 0;return{"aria-invalid":e.error?!0:void 0,"aria-required":e.required||void 0,"aria-disabled":e.disabled||void 0,"aria-readonly":e.readOnly||void 0,"aria-describedby":Cr(t,r),"aria-errormessage":t}}function _i(e,t){const{direction:r,wrap:a=!0,itemSelector:n='[role="option"], [role="tab"], [role="menuitem"], [role="radio"], button, a, [tabindex]'}=t;c.useEffect(()=>{const s=e.current;if(!s)return;const i=()=>Array.from(s.querySelectorAll(n)).filter(l=>!l.hasAttribute("disabled")&&l.getAttribute("aria-disabled")!=="true"),o=l=>{var y;const d=i();if(d.length===0)return;const u=document.activeElement,f=d.indexOf(u);if(f===-1)return;let p=-1;const h=r==="horizontal"||r==="both"||r==="grid",m=r==="vertical"||r==="both"||r==="grid";if(h&&l.key==="ArrowRight")p=f+1;else if(h&&l.key==="ArrowLeft")p=f-1;else if(m&&l.key==="ArrowDown")p=f+1;else if(m&&l.key==="ArrowUp")p=f-1;else if(l.key==="Home")p=0;else if(l.key==="End")p=d.length-1;else return;l.preventDefault(),a?p=(p%d.length+d.length)%d.length:p=Math.max(0,Math.min(d.length-1,p)),d.forEach((g,v)=>{g.tabIndex=v===p?0:-1}),(y=d[p])==null||y.focus()};return s.addEventListener("keydown",o),()=>s.removeEventListener("keydown",o)},[e,r,a,n])}function Wi(e){const t=c.useRef(null);c.useEffect(()=>(e&&(t.current=document.activeElement),()=>{e&&t.current&&typeof t.current.focus=="function"&&t.current.focus()}),[e])}const Ar=({children:e,as:t="span"})=>c.createElement(t,{style:et},e);Ar.displayName="NiceVisuallyHidden";const Er=({targetId:e,children:t="Skip to main content"})=>x.jsx("a",{href:`#${e}`,className:"nice-skip-link",onClick:r=>{r.preventDefault();const a=document.getElementById(e);a&&(a.tabIndex=-1,a.focus())},children:t});Er.displayName="NiceSkipLink";const Vi={submit:{key:"Enter",description:"Submit / Confirm",descriptionKey:"shortcuts.submit"},cancel:{key:"Escape",description:"Cancel / Close",descriptionKey:"shortcuts.cancel"},clear:{key:"Delete",description:"Clear value",descriptionKey:"shortcuts.clear",modifiers:["ctrl"]},moveUp:{key:"ArrowUp",description:"Move up",descriptionKey:"shortcuts.moveUp"},moveDown:{key:"ArrowDown",description:"Move down",descriptionKey:"shortcuts.moveDown"},moveLeft:{key:"ArrowLeft",description:"Move left",descriptionKey:"shortcuts.moveLeft"},moveRight:{key:"ArrowRight",description:"Move right",descriptionKey:"shortcuts.moveRight"},first:{key:"Home",description:"Go to first",descriptionKey:"shortcuts.first"},last:{key:"End",description:"Go to last",descriptionKey:"shortcuts.last"},pageUp:{key:"PageUp",description:"Page up",descriptionKey:"shortcuts.pageUp"},pageDown:{key:"PageDown",description:"Page down",descriptionKey:"shortcuts.pageDown"},selectAll:{key:"A",description:"Select all",descriptionKey:"shortcuts.selectAll",modifiers:["ctrl"]},toggleSelect:{key:"Space",description:"Toggle selection",descriptionKey:"shortcuts.toggleSelect"},undo:{key:"Z",description:"Undo",descriptionKey:"shortcuts.undo",modifiers:["ctrl"]},redo:{key:"Y",description:"Redo",descriptionKey:"shortcuts.redo",modifiers:["ctrl"]},copy:{key:"C",description:"Copy",descriptionKey:"shortcuts.copy",modifiers:["ctrl"]},paste:{key:"V",description:"Paste",descriptionKey:"shortcuts.paste",modifiers:["ctrl"]},cut:{key:"X",description:"Cut",descriptionKey:"shortcuts.cut",modifiers:["ctrl"]},edit:{key:"Enter",description:"Edit cell",descriptionKey:"shortcuts.edit"},tab:{key:"Tab",description:"Next cell",descriptionKey:"shortcuts.tab"},shiftTab:{key:"Tab",description:"Previous cell",descriptionKey:"shortcuts.shiftTab",modifiers:["shift"]},open:{key:"ArrowDown",description:"Open dropdown",descriptionKey:"shortcuts.open"},close:{key:"Escape",description:"Close popup",descriptionKey:"shortcuts.close"},increment:{key:"ArrowUp",description:"Increase value",descriptionKey:"shortcuts.increment"},decrement:{key:"ArrowDown",description:"Decrease value",descriptionKey:"shortcuts.decrement"},incrementBig:{key:"PageUp",description:"Increase by 10",descriptionKey:"shortcuts.incrementBig"},decrementBig:{key:"PageDown",description:"Decrease by 10",descriptionKey:"shortcuts.decrementBig"}};function Nr(e){var r,a,n,s;const t=[];return(r=e.modifiers)!=null&&r.includes("ctrl")&&t.push("Ctrl"),(a=e.modifiers)!=null&&a.includes("alt")&&t.push("Alt"),(n=e.modifiers)!=null&&n.includes("shift")&&t.push("Shift"),(s=e.modifiers)!=null&&s.includes("meta")&&t.push("⌘"),t.push(e.key),t.join("+")}function Xi(e,t){if(!(e.key===t.key||e.key.toLowerCase()===t.key.toLowerCase()))return!1;const a=t.modifiers??[];return!(a.includes("ctrl")!==(e.ctrlKey||e.metaKey)||a.includes("alt")!==e.altKey||a.includes("shift")!==e.shiftKey)}const Lr=({shortcuts:e,position:t="top",icon:r,size:a="sm",className:n})=>{const[s,i]=c.useState(!1),o=c.useRef(null),[l,d]=c.useState({top:0,left:0}),u=c.useCallback(()=>{if(!o.current)return;const h=o.current.getBoundingClientRect(),m=8;let y=0,g=0;switch(t){case"top":y=h.top-m,g=h.left+h.width/2;break;case"bottom":y=h.bottom+m,g=h.left+h.width/2;break;case"left":y=h.top+h.height/2,g=h.left-m;break;case"right":y=h.top+h.height/2,g=h.right+m;break}d({top:y,left:g})},[t]),f=c.useCallback(()=>{u(),i(!0)},[u]),p=c.useCallback(()=>{u(),i(!0)},[u]);return e.length===0?null:x.jsxs(x.Fragment,{children:[x.jsx("button",{ref:o,type:"button",className:`nice-keyboard-hint nice-keyboard-hint--${a} ${n||""}`,onMouseEnter:f,onMouseLeave:()=>i(!1),onFocus:p,onBlur:()=>i(!1),"aria-label":"Keyboard shortcuts",tabIndex:-1,children:r||"?"}),s&&x.jsxs("div",{className:`nice-keyboard-hint__tooltip nice-keyboard-hint__tooltip--${t}`,style:{position:"fixed",top:l.top,left:l.left,transform:t==="top"?"translate(-50%, -100%)":t==="bottom"?"translate(-50%, 0)":t==="left"?"translate(-100%, -50%)":"translate(0, -50%)"},role:"tooltip",children:[x.jsx("div",{className:"nice-keyboard-hint__title",children:"Keyboard Shortcuts"}),x.jsx("ul",{className:"nice-keyboard-hint__list",children:e.map((h,m)=>x.jsxs("li",{className:"nice-keyboard-hint__item",children:[x.jsx("kbd",{className:"nice-keyboard-hint__key",children:Nr(h)}),x.jsx("span",{className:"nice-keyboard-hint__desc",children:h.description})]},m))})]})]})};Lr.displayName="NiceKeyboardHint";function Ui(e={}){const{enabled:t=!1,onSubmit:r,preventDefault:a=!0,requireCtrl:n=!1,skipTextarea:s=!0}=e;return c.useCallback(i=>{!t||!r||i.key==="Enter"&&(n&&!i.ctrlKey&&!i.metaKey||s&&i.target.tagName==="TEXTAREA"||(a&&i.preventDefault(),r()))},[t,r,a,n,s])}function qi(e={}){const{onClick:t,disabled:r=!1,role:a,tabIndex:n,triggerOnSpace:s=!0,as:i,selected:o}=e,l=a??i??"button",d=c.useCallback(p=>{r||t==null||t(p)},[r,t]),u=c.useCallback(p=>{if(r)return;const h=s&&(p.key===" "||p.key==="Spacebar");(p.key==="Enter"||h)&&(p.preventDefault(),t==null||t(p))},[r,t,s]),f={role:l,tabIndex:n??(r?-1:0),onClick:d,onKeyDown:u};return r&&(f["aria-disabled"]=!0),o!==void 0&&(l==="option"||l==="tab"||l==="row")&&(f["aria-selected"]=o),f}function Gi(e={}){const[t,r]=c.useState(!1),[a,n]=c.useState(""),s=c.useRef(null),i=typeof window<"u"&&("SpeechRecognition"in window||"webkitSpeechRecognition"in window),o=c.useCallback(u=>{if(!e.commands)return;const f=u.toLowerCase().trim();for(const p of e.commands)if(typeof p.phrase=="string"){if(f===p.phrase.toLowerCase()){p.action([],u);return}}else{const h=u.match(p.phrase);if(h){p.action(Array.from(h),u);return}}},[e.commands]),l=c.useCallback(()=>{if(!i||t)return;const u=window.SpeechRecognition??window.webkitSpeechRecognition,f=new u;f.lang=e.language??"en-US",f.continuous=e.continuous??!0,f.interimResults=e.interimResults??!1,f.onresult=p=>{var g;const h=p.results[p.results.length-1],m=h[0].transcript,y=h.isFinal;n(m),(g=e.onTranscript)==null||g.call(e,m,y),y&&o(m)},f.onerror=p=>{var h;(h=e.onError)==null||h.call(e,p.error),p.error==="not-allowed"&&r(!1)},f.onend=()=>{if(t&&e.continuous)try{f.start()}catch{r(!1)}else r(!1)},s.current=f,f.start(),r(!0)},[i,t,e.language,e.continuous]),d=c.useCallback(()=>{var u;(u=s.current)==null||u.stop(),s.current=null,r(!1)},[]);return c.useEffect(()=>()=>d(),[]),{isListening:t,isSupported:i,start:l,stop:d,transcript:a}}function Tr(e={}){const[t,r]=c.useState(""),a=c.useRef(),n=c.useCallback(i=>{r(""),requestAnimationFrame(()=>{r(i),e.clearAfterMs&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>r(""),e.clearAfterMs))})},[e.clearAfterMs]);c.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const s={role:"status","aria-live":e.politeness??"polite","aria-atomic":e.atomic??!0,"aria-relevant":e.relevant??"additions text",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}};return{message:t,announce:n,regionProps:s}}function Ki(){const{announce:e,regionProps:t,message:r}=Tr({politeness:"assertive",clearAfterMs:3e3});return{announcePageChange:c.useCallback(n=>{e(`Nawigacja do: ${n}`),typeof document<"u"&&(document.title=n)},[e]),regionProps:t,message:r}}function Ji(){const e=c.useRef(null),t=c.useCallback(()=>{var s;const n=(s=e.current)==null?void 0:s.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');n==null||n.focus()},[]),r=c.useCallback(n=>{var s,i;(i=(s=e.current)==null?void 0:s.querySelector(n))==null||i.focus()},[]),a=c.useCallback(()=>e.current?Array.from(e.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')):[],[]);return{containerRef:e,focusFirst:t,focusElement:r,getFocusableElements:a}}const jt={simplifiedMode:!1,increasedSpacing:!1,readingGuide:!1,enhancedFocus:!1,reduceMotion:!1,iconLabels:!1,largeTargets:!1,dyslexiaFont:!1,lineSpacing:1.5,wordSpacing:1};function Yi(e=jt){const[t,r]=c.useState({...jt,...e}),a=c.useCallback((o,l)=>{r(d=>({...d,[o]:l}))},[]),n=Qi(t),s=[t.simplifiedMode&&"nice-a11y-simplified",t.increasedSpacing&&"nice-a11y-spacing",t.enhancedFocus&&"nice-a11y-enhanced-focus",t.reduceMotion&&"nice-a11y-reduce-motion",t.iconLabels&&"nice-a11y-icon-labels",t.largeTargets&&"nice-a11y-large-targets",t.dyslexiaFont&&"nice-a11y-dyslexia"].filter(Boolean).join(" "),i={};return t.lineSpacing&&t.lineSpacing!==1.5&&(i.lineHeight=String(t.lineSpacing)),t.wordSpacing&&t.wordSpacing!==1&&(i.wordSpacing=`${(t.wordSpacing-1)*.25}em`),{settings:t,updateSetting:a,css:n,rootClasses:s,rootStyle:i}}function Qi(e){const t=[];return e.simplifiedMode&&t.push(`
|
|
18
|
+
`,document.body.appendChild(a);const n=getComputedStyle(a);t({top:parseInt(n.paddingTop,10)||0,right:parseInt(n.paddingRight,10)||0,bottom:parseInt(n.paddingBottom,10)||0,left:parseInt(n.paddingLeft,10)||0}),document.body.removeChild(a)};return r(),window.addEventListener("resize",r),window.addEventListener("orientationchange",r),()=>{window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[]),e}function pr(e="normal"){return typeof e=="number"?e:e==="fast"?120:e==="slow"?300:200}const Ze={fade:"nice-anim-fade-enter",slideUp:"nice-anim-slide-up-enter",slideDown:"nice-anim-slide-down-enter",slideLeft:"nice-anim-slide-left-enter",slideRight:"nice-anim-slide-right-enter",scaleUp:"nice-anim-scale-up-enter",scaleDown:"nice-anim-scale-down-enter",zoom:"nice-anim-zoom-enter",flip:"nice-anim-flip-enter",none:""},gr={fade:"nice-anim-fade-exit",slideUp:"nice-anim-slide-up-exit",slideDown:"nice-anim-slide-down-exit",slideLeft:"nice-anim-slide-left-exit",slideRight:"nice-anim-slide-right-exit",scaleUp:"nice-anim-scale-up-exit",scaleDown:"nice-anim-scale-down-exit",zoom:"nice-anim-zoom-exit",flip:"nice-anim-flip-exit",none:""};function Mi(e){const{visible:t,animation:r="fade",duration:a="normal",onEntered:n,onExited:s}=e,[i,o]=c.useState(t?"entered":"exited"),[l,d]=c.useState(t),u=c.useRef(void 0),f=pr(a),p=c.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[]),h=p||r==="none"?0:f;c.useEffect(()=>(u.current&&clearTimeout(u.current),t?(d(!0),o("entering"),u.current=setTimeout(()=>{o("entered"),n==null||n()},h)):(o("exiting"),u.current=setTimeout(()=>{o("exited"),d(!1),s==null||s()},h)),()=>{u.current&&clearTimeout(u.current)}),[t,h]);const m=c.useMemo(()=>r==="none"||p?"":i==="entering"?Ze[r]:i==="exiting"?gr[r]:i==="entered"?`${Ze[r]} nice-anim-active`:"",[r,i,p]),y=c.useMemo(()=>({animationDuration:`${h}ms`,transitionDuration:`${h}ms`}),[h]);return{state:i,shouldRender:l,className:m,style:y}}function Ci(e,t){const{expanded:r,duration:a="normal"}=t,[n,s]=c.useState(r?"auto":0),i=pr(a);return c.useEffect(()=>{const o=e.current;if(o)if(r){const l=o.scrollHeight;s(l);const d=setTimeout(()=>s("auto"),i);return()=>clearTimeout(d)}else{const l=o.scrollHeight;s(l),requestAnimationFrame(()=>{requestAnimationFrame(()=>s(0))})}},[r,i,e]),{overflow:"hidden",height:typeof n=="number"?`${n}px`:n,transition:`height ${i}ms ease`}}function Ai(e,t=50){return`${e*t}ms`}function Ei(e,t){return t==="enter"?Ze[e]:gr[e]}const yr=c.createContext({direction:"ltr",isRTL:!1,flip:e=>e,flipStyle:(e,t)=>({[e]:t})}),hr=({direction:e,children:t})=>{const r=c.useMemo(()=>e!=="auto"?e:typeof document<"u"&&document.documentElement.getAttribute("dir")==="rtl"?"rtl":"ltr",[e]),a=r==="rtl";c.useEffect(()=>(e!=="auto"&&(document.documentElement.setAttribute("dir",r),document.documentElement.style.direction=r),()=>{e!=="auto"&&(document.documentElement.removeAttribute("dir"),document.documentElement.style.direction="")}),[e,r]);const n=c.useCallback(o=>a?{left:"right",right:"left",start:"end",end:"start"}[o]??o:o,[a]),s=c.useCallback((o,l)=>a?{[{paddingLeft:"paddingRight",paddingRight:"paddingLeft",marginLeft:"marginRight",marginRight:"marginLeft"}[o]||o]:l}:{[o]:l},[a]),i=c.useMemo(()=>({direction:r,isRTL:a,flip:n,flipStyle:s}),[r,a,n,s]);return x.jsx(yr.Provider,{value:i,children:x.jsx("div",{dir:r,style:{direction:r,display:"contents"},children:t})})};hr.displayName="NiceRTLProvider";function Ni(){return c.useContext(yr)}const Li={marginStart:"marginInlineStart",marginEnd:"marginInlineEnd",paddingStart:"paddingInlineStart",paddingEnd:"paddingInlineEnd",borderStart:"borderInlineStart",borderEnd:"borderInlineEnd",insetStart:"insetInlineStart",insetEnd:"insetInlineEnd",start:"insetInlineStart",end:"insetInlineEnd",textAlign:{start:"start",end:"end"}},br=c.createContext({permissions:{},getAccessMode:()=>"full"}),vr=({permissions:e,children:t})=>{const r=c.useMemo(()=>({permissions:e,getAccessMode:(a,n)=>{var s,i;return n&&a&&((s=e.fields)!=null&&s[`${a}.${n}`])?e.fields[`${a}.${n}`]:a&&((i=e.components)!=null&&i[a])?e.components[a]:e.defaultMode??"full"}}),[e]);return x.jsx(br.Provider,{value:r,children:t})};vr.displayName="NiceAccessControl";function Ti(e,t,r){const a=c.useContext(br);return e||a.getAccessMode(t,r)}function Ri(e){switch(e){case"disabled":return{disabled:!0,"aria-disabled":!0,tabIndex:-1};case"readOnly":return{readOnly:!0};default:return{}}}function Ii(e={}){const{threshold:t=50,maxDuration:r=300,onSwipe:a,onSwipeLeft:n,onSwipeRight:s,onSwipeUp:i,onSwipeDown:o,enabled:l=!0}=e,d=c.useRef(null),[u,f]=c.useState(!1),[p,h]=c.useState(null),m=c.useRef(null);return c.useEffect(()=>{const y=d.current;if(!y||!l)return;const g=w=>{if(w.touches.length!==1)return;const A=w.touches[0];m.current={x:A.clientX,y:A.clientY,timestamp:Date.now()},f(!0),h(null)},v=w=>{if(!m.current||w.touches.length!==1)return;const A=w.touches[0],k=A.clientX-m.current.x,C=A.clientY-m.current.y;Math.abs(k)>Math.abs(C)?h(k>0?"right":"left"):h(C>0?"down":"up")},b=w=>{if(!m.current)return;const A=w.changedTouches[0],k={x:A.clientX,y:A.clientY,timestamp:Date.now()},C=k.x-m.current.x,M=k.y-m.current.y,N=k.timestamp-m.current.timestamp,L=Math.sqrt(C*C+M*M),E=L/N;if(f(!1),N<=r&&L>=t){let R;Math.abs(C)>Math.abs(M)?R=C>0?"right":"left":R=M>0?"down":"up";const T={direction:R,distance:L,velocity:E,duration:N};switch(a==null||a(T),R){case"left":n==null||n(T);break;case"right":s==null||s(T);break;case"up":i==null||i(T);break;case"down":o==null||o(T);break}}m.current=null,h(null)},S=()=>{m.current=null,f(!1),h(null)};return y.addEventListener("touchstart",g,{passive:!0}),y.addEventListener("touchmove",v,{passive:!0}),y.addEventListener("touchend",b,{passive:!0}),y.addEventListener("touchcancel",S,{passive:!0}),()=>{y.removeEventListener("touchstart",g),y.removeEventListener("touchmove",v),y.removeEventListener("touchend",b),y.removeEventListener("touchcancel",S)}},[l,t,r,a,n,s,i,o]),{ref:d,isSwiping:u,swipeDirection:p}}function zi(e={}){const{onPinch:t,onPinchStart:r,onPinchEnd:a,minScale:n=.5,maxScale:s=3,enabled:i=!0}=e,o=c.useRef(null),[l,d]=c.useState(1),[u,f]=c.useState(!1),p=c.useRef(null),h=c.useRef(1);return c.useEffect(()=>{const m=o.current;if(!m||!i)return;const y=(w,A)=>{const k=w.clientX-A.clientX,C=w.clientY-A.clientY;return Math.sqrt(k*k+C*C)},g=(w,A)=>({x:(w.clientX+A.clientX)/2,y:(w.clientY+A.clientY)/2}),v=w=>{w.touches.length===2&&(p.current=y(w.touches[0],w.touches[1]),h.current=l,f(!0),r==null||r())},b=w=>{if(w.touches.length!==2||!p.current)return;const A=y(w.touches[0],w.touches[1]),k=Math.min(s,Math.max(n,h.current*(A/p.current)));d(k),t==null||t({scale:k,center:g(w.touches[0],w.touches[1])})},S=()=>{u&&(f(!1),a==null||a(l),p.current=null)};return m.addEventListener("touchstart",v,{passive:!0}),m.addEventListener("touchmove",b,{passive:!0}),m.addEventListener("touchend",S,{passive:!0}),m.addEventListener("touchcancel",S,{passive:!0}),()=>{m.removeEventListener("touchstart",v),m.removeEventListener("touchmove",b),m.removeEventListener("touchend",S),m.removeEventListener("touchcancel",S)}},[i,l,u,n,s,t,r,a]),{ref:o,scale:l,isPinching:u}}function Di(e={}){const{onPan:t,onPanStart:r,onPanEnd:a,enabled:n=!0}=e,s=c.useRef(null),[i,o]=c.useState(!1),[l,d]=c.useState(0),[u,f]=c.useState(0),p=c.useRef(null),h=c.useRef(null);return c.useEffect(()=>{const m=s.current;if(!m||!n)return;const y=b=>{if(b.touches.length!==1)return;const S=b.touches[0],w={x:S.clientX,y:S.clientY,timestamp:Date.now()};p.current=w,h.current=w,o(!0),d(0),f(0),r==null||r()},g=b=>{if(!p.current||!h.current||b.touches.length!==1)return;const S=b.touches[0],w=Date.now(),A={x:S.clientX,y:S.clientY,timestamp:w},k=A.x-p.current.x,C=A.y-p.current.y,M=A.timestamp-h.current.timestamp||1,N=(A.x-h.current.x)/M,L=(A.y-h.current.y)/M;d(k),f(C),t==null||t({deltaX:k,deltaY:C,velocityX:N,velocityY:L}),h.current=A},v=()=>{if(!i||!p.current||!h.current)return;const b=l,S=u,w=h.current.timestamp-p.current.timestamp||1;a==null||a({deltaX:b,deltaY:S,velocityX:b/w,velocityY:S/w}),o(!1),p.current=null,h.current=null};return m.addEventListener("touchstart",y,{passive:!0}),m.addEventListener("touchmove",g,{passive:!0}),m.addEventListener("touchend",v,{passive:!0}),m.addEventListener("touchcancel",v,{passive:!0}),()=>{m.removeEventListener("touchstart",y),m.removeEventListener("touchmove",g),m.removeEventListener("touchend",v),m.removeEventListener("touchcancel",v)}},[n,i,l,u,t,r,a]),{ref:s,isPanning:i,deltaX:l,deltaY:u}}function Sr(e){const{onRefresh:t,threshold:r=80,maxPull:a=120,enabled:n=!0}=e,s=c.useRef(null),[i,o]=c.useState(!1),[l,d]=c.useState(!1),[u,f]=c.useState(0),p=c.useRef(null),h=Math.min(1,u/r);return c.useEffect(()=>{const m=s.current;if(!m||!n||l)return;const y=b=>{m.scrollTop>0||b.touches.length===1&&(p.current=b.touches[0].clientY)},g=b=>{if(p.current===null||b.touches.length!==1)return;const w=b.touches[0].clientY-p.current;if(w<=0){f(0),o(!1);return}const k=Math.min(a,w*.5);f(k),o(k>0),k>0&&b.preventDefault()},v=async()=>{if(u>=r&&!l){d(!0),f(r);try{await t()}finally{d(!1),f(0)}}else f(0);o(!1),p.current=null};return m.addEventListener("touchstart",y,{passive:!0}),m.addEventListener("touchmove",g,{passive:!1}),m.addEventListener("touchend",v,{passive:!0}),m.addEventListener("touchcancel",v,{passive:!0}),()=>{m.removeEventListener("touchstart",y),m.removeEventListener("touchmove",g),m.removeEventListener("touchend",v),m.removeEventListener("touchcancel",v)}},[n,l,u,r,a,t]),{ref:s,isPulling:i,isRefreshing:l,pullDistance:u,pullProgress:h}}const Pi=({children:e,leftActions:t=[],rightActions:r=[],actionWidth:a=80,maxSwipe:n=1.5,threshold:s=.5,className:i,style:o})=>{const l=c.useRef(null),d=c.useRef(null),[u,f]=c.useState(0),[p,h]=c.useState(!1),m=c.useRef(0),y=c.useRef(0),g=t.length*a,v=r.length*a,b=g*n,S=v*n,w=c.useCallback(N=>{h(!1),m.current=N.touches[0].clientX,y.current=u},[u]),A=c.useCallback(N=>{const L=N.touches[0].clientX-m.current;let E=y.current+L;E>b?E=b+(E-b)*.2:E<-S&&(E=-S+(E+S)*.2),!(E>0&&t.length===0)&&(E<0&&r.length===0||f(E))},[b,S,t.length,r.length]),k=c.useCallback(()=>{h(!0),u>g*s?f(g):u<-v*s?f(-v):f(0)},[u,g,v,s]),C=c.useCallback(N=>{h(!0),f(0),N.onAction()},[]),M=c.useCallback(()=>{h(!0),f(0)},[]);return x.jsxs("div",{ref:l,className:`nice-swipeable ${i||""}`,style:{...o,position:"relative",overflow:"hidden"},children:[x.jsx("div",{className:"nice-swipeable__actions nice-swipeable__actions--left",style:{position:"absolute",left:0,top:0,bottom:0,display:"flex",width:g},children:t.map(N=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:N.color,border:"none",color:"var(--bg-primary, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(N),children:N.content},N.key))}),x.jsx("div",{className:"nice-swipeable__actions nice-swipeable__actions--right",style:{position:"absolute",right:0,top:0,bottom:0,display:"flex",width:v},children:r.map(N=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:N.color,border:"none",color:"var(--bg-primary, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(N),children:N.content},N.key))}),x.jsx("div",{ref:d,className:"nice-swipeable__content",style:{transform:`translateX(${u}px)`,transition:p?"transform 0.3s ease-out":"none",background:"var(--bg-primary, #fff)",position:"relative",zIndex:1},onTouchStart:w,onTouchMove:A,onTouchEnd:k,onClick:u!==0?M:void 0,children:e})]})},Fi=({children:e,onRefresh:t,threshold:r=80,pullingContent:a,refreshingContent:n,enabled:s=!0,className:i,style:o})=>{const{ref:l,isPulling:d,isRefreshing:u,pullDistance:f,pullProgress:p}=Sr({onRefresh:t,threshold:r,enabled:s});return x.jsxs("div",{ref:l,className:`nice-pull-refresh ${i||""}`,style:{...o,position:"relative",overflow:"auto",overscrollBehavior:"contain"},children:[x.jsx("div",{className:"nice-pull-refresh__indicator",style:{position:"absolute",top:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center",height:f,overflow:"hidden",transition:d?"none":"height 0.2s ease-out"},children:u?n||x.jsx("div",{className:"nice-pull-refresh__spinner",children:x.jsx("div",{className:"nice-spinner nice-spinner--sm"})}):a||x.jsx("div",{className:"nice-pull-refresh__arrow",style:{transform:`rotate(${p>=1?180:0}deg)`,transition:"transform 0.2s ease",opacity:p},children:x.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})})})}),x.jsx("div",{className:"nice-pull-refresh__content",style:{transform:`translateY(${f}px)`,transition:d?"none":"transform 0.2s ease-out"},children:e})]})};function xr(e="light"){if(!("vibrate"in navigator))return;const t={light:10,medium:20,heavy:30,selection:5,success:[10,30,10],warning:[20,20,20],error:[30,30,30,30]};try{navigator.vibrate(t[e])}catch{}}function Hi(){return c.useCallback((e="light")=>{xr(e)},[])}const $i=({minSize:e=44,children:t,className:r,style:a,onClick:n})=>x.jsx("div",{className:`nice-touch-target ${r||""}`,style:{...a,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:e,minHeight:e,cursor:n?"pointer":void 0},onClick:n,children:t});function ji(){const[e,t]=c.useState(!1),[r,a]=c.useState(0),n=c.useRef(typeof window<"u"?window.innerHeight:0);return c.useEffect(()=>{if(typeof window>"u")return;if("visualViewport"in window&&window.visualViewport){const i=window.visualViewport,o=()=>{const l=n.current-i.height,d=150;t(l>d),a(l>d?l:0)};return i.addEventListener("resize",o),()=>i.removeEventListener("resize",o)}const s=()=>{const i=n.current-window.innerHeight,o=150;t(i>o),a(i>o?i:0)};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),{isKeyboardVisible:e,keyboardHeight:r}}const wr={announceChanges:!0,reduceMotion:"auto",highContrast:"auto",focusStyle:"auto",keyboardShortcuts:!0,minTouchTarget:44},kr=c.createContext(null),Mr=({config:e,children:t})=>{const r=c.useMemo(()=>({...wr,...e}),[e]),a=c.useRef(null),n=c.useRef(null),[s,i]=c.useState(!1);c.useEffect(()=>{const h=window.matchMedia("(prefers-reduced-motion: reduce)");i(h.matches);const m=y=>i(y.matches);return h.addEventListener("change",m),()=>h.removeEventListener("change",m)},[]);const[o,l]=c.useState(!1);c.useEffect(()=>{const h=window.matchMedia("(prefers-contrast: more)");l(h.matches);const m=y=>l(y.matches);return h.addEventListener("change",m),()=>h.removeEventListener("change",m)},[]);const d=r.reduceMotion==="always"?!0:r.reduceMotion==="never"?!1:s,u=r.highContrast==="always"?!0:r.highContrast==="never"?!1:o,f=c.useCallback((h,m="polite")=>{if(!r.announceChanges)return;const y=m==="assertive"?n.current:a.current;y&&(y.textContent="",requestAnimationFrame(()=>{y.textContent=h}))},[r.announceChanges]),p=c.useMemo(()=>({config:r,announce:f,prefersReducedMotion:d,prefersHighContrast:u}),[r,f,d,u]);return x.jsxs(kr.Provider,{value:p,children:[t,x.jsx("div",{ref:a,role:"status","aria-live":"polite","aria-atomic":"true",style:et}),x.jsx("div",{ref:n,role:"alert","aria-live":"assertive","aria-atomic":"true",style:et})]})};Mr.displayName="NiceA11yProvider";function Bi(){const e=c.useContext(kr);return e||{config:wr,announce:()=>{},prefersReducedMotion:!1,prefersHighContrast:!1}}const et={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function Cr(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function Oi(e){const t=e.error?`${e.id}-error`:void 0,r=e.helperText?`${e.id}-helper`:void 0;return{"aria-invalid":e.error?!0:void 0,"aria-required":e.required||void 0,"aria-disabled":e.disabled||void 0,"aria-readonly":e.readOnly||void 0,"aria-describedby":Cr(t,r),"aria-errormessage":t}}function _i(e,t){const{direction:r,wrap:a=!0,itemSelector:n='[role="option"], [role="tab"], [role="menuitem"], [role="radio"], button, a, [tabindex]'}=t;c.useEffect(()=>{const s=e.current;if(!s)return;const i=()=>Array.from(s.querySelectorAll(n)).filter(l=>!l.hasAttribute("disabled")&&l.getAttribute("aria-disabled")!=="true"),o=l=>{var y;const d=i();if(d.length===0)return;const u=document.activeElement,f=d.indexOf(u);if(f===-1)return;let p=-1;const h=r==="horizontal"||r==="both"||r==="grid",m=r==="vertical"||r==="both"||r==="grid";if(h&&l.key==="ArrowRight")p=f+1;else if(h&&l.key==="ArrowLeft")p=f-1;else if(m&&l.key==="ArrowDown")p=f+1;else if(m&&l.key==="ArrowUp")p=f-1;else if(l.key==="Home")p=0;else if(l.key==="End")p=d.length-1;else return;l.preventDefault(),a?p=(p%d.length+d.length)%d.length:p=Math.max(0,Math.min(d.length-1,p)),d.forEach((g,v)=>{g.tabIndex=v===p?0:-1}),(y=d[p])==null||y.focus()};return s.addEventListener("keydown",o),()=>s.removeEventListener("keydown",o)},[e,r,a,n])}function Wi(e){const t=c.useRef(null);c.useEffect(()=>(e&&(t.current=document.activeElement),()=>{e&&t.current&&typeof t.current.focus=="function"&&t.current.focus()}),[e])}const Ar=({children:e,as:t="span"})=>c.createElement(t,{style:et},e);Ar.displayName="NiceVisuallyHidden";const Er=({targetId:e,children:t="Skip to main content"})=>x.jsx("a",{href:`#${e}`,className:"nice-skip-link",onClick:r=>{r.preventDefault();const a=document.getElementById(e);a&&(a.tabIndex=-1,a.focus())},children:t});Er.displayName="NiceSkipLink";const Vi={submit:{key:"Enter",description:"Submit / Confirm",descriptionKey:"shortcuts.submit"},cancel:{key:"Escape",description:"Cancel / Close",descriptionKey:"shortcuts.cancel"},clear:{key:"Delete",description:"Clear value",descriptionKey:"shortcuts.clear",modifiers:["ctrl"]},moveUp:{key:"ArrowUp",description:"Move up",descriptionKey:"shortcuts.moveUp"},moveDown:{key:"ArrowDown",description:"Move down",descriptionKey:"shortcuts.moveDown"},moveLeft:{key:"ArrowLeft",description:"Move left",descriptionKey:"shortcuts.moveLeft"},moveRight:{key:"ArrowRight",description:"Move right",descriptionKey:"shortcuts.moveRight"},first:{key:"Home",description:"Go to first",descriptionKey:"shortcuts.first"},last:{key:"End",description:"Go to last",descriptionKey:"shortcuts.last"},pageUp:{key:"PageUp",description:"Page up",descriptionKey:"shortcuts.pageUp"},pageDown:{key:"PageDown",description:"Page down",descriptionKey:"shortcuts.pageDown"},selectAll:{key:"A",description:"Select all",descriptionKey:"shortcuts.selectAll",modifiers:["ctrl"]},toggleSelect:{key:"Space",description:"Toggle selection",descriptionKey:"shortcuts.toggleSelect"},undo:{key:"Z",description:"Undo",descriptionKey:"shortcuts.undo",modifiers:["ctrl"]},redo:{key:"Y",description:"Redo",descriptionKey:"shortcuts.redo",modifiers:["ctrl"]},copy:{key:"C",description:"Copy",descriptionKey:"shortcuts.copy",modifiers:["ctrl"]},paste:{key:"V",description:"Paste",descriptionKey:"shortcuts.paste",modifiers:["ctrl"]},cut:{key:"X",description:"Cut",descriptionKey:"shortcuts.cut",modifiers:["ctrl"]},edit:{key:"Enter",description:"Edit cell",descriptionKey:"shortcuts.edit"},tab:{key:"Tab",description:"Next cell",descriptionKey:"shortcuts.tab"},shiftTab:{key:"Tab",description:"Previous cell",descriptionKey:"shortcuts.shiftTab",modifiers:["shift"]},open:{key:"ArrowDown",description:"Open dropdown",descriptionKey:"shortcuts.open"},close:{key:"Escape",description:"Close popup",descriptionKey:"shortcuts.close"},increment:{key:"ArrowUp",description:"Increase value",descriptionKey:"shortcuts.increment"},decrement:{key:"ArrowDown",description:"Decrease value",descriptionKey:"shortcuts.decrement"},incrementBig:{key:"PageUp",description:"Increase by 10",descriptionKey:"shortcuts.incrementBig"},decrementBig:{key:"PageDown",description:"Decrease by 10",descriptionKey:"shortcuts.decrementBig"}};function Nr(e){var r,a,n,s;const t=[];return(r=e.modifiers)!=null&&r.includes("ctrl")&&t.push("Ctrl"),(a=e.modifiers)!=null&&a.includes("alt")&&t.push("Alt"),(n=e.modifiers)!=null&&n.includes("shift")&&t.push("Shift"),(s=e.modifiers)!=null&&s.includes("meta")&&t.push("⌘"),t.push(e.key),t.join("+")}function Xi(e,t){if(!(e.key===t.key||e.key.toLowerCase()===t.key.toLowerCase()))return!1;const a=t.modifiers??[];return!(a.includes("ctrl")!==(e.ctrlKey||e.metaKey)||a.includes("alt")!==e.altKey||a.includes("shift")!==e.shiftKey)}const Lr=({shortcuts:e,position:t="top",icon:r,size:a="sm",className:n})=>{const[s,i]=c.useState(!1),o=c.useRef(null),[l,d]=c.useState({top:0,left:0}),u=c.useCallback(()=>{if(!o.current)return;const h=o.current.getBoundingClientRect(),m=8;let y=0,g=0;switch(t){case"top":y=h.top-m,g=h.left+h.width/2;break;case"bottom":y=h.bottom+m,g=h.left+h.width/2;break;case"left":y=h.top+h.height/2,g=h.left-m;break;case"right":y=h.top+h.height/2,g=h.right+m;break}d({top:y,left:g})},[t]),f=c.useCallback(()=>{u(),i(!0)},[u]),p=c.useCallback(()=>{u(),i(!0)},[u]);return e.length===0?null:x.jsxs(x.Fragment,{children:[x.jsx("button",{ref:o,type:"button",className:`nice-keyboard-hint nice-keyboard-hint--${a} ${n||""}`,onMouseEnter:f,onMouseLeave:()=>i(!1),onFocus:p,onBlur:()=>i(!1),"aria-label":"Keyboard shortcuts",tabIndex:-1,children:r||"?"}),s&&x.jsxs("div",{className:`nice-keyboard-hint__tooltip nice-keyboard-hint__tooltip--${t}`,style:{position:"fixed",top:l.top,left:l.left,transform:t==="top"?"translate(-50%, -100%)":t==="bottom"?"translate(-50%, 0)":t==="left"?"translate(-100%, -50%)":"translate(0, -50%)"},role:"tooltip",children:[x.jsx("div",{className:"nice-keyboard-hint__title",children:"Keyboard Shortcuts"}),x.jsx("ul",{className:"nice-keyboard-hint__list",children:e.map((h,m)=>x.jsxs("li",{className:"nice-keyboard-hint__item",children:[x.jsx("kbd",{className:"nice-keyboard-hint__key",children:Nr(h)}),x.jsx("span",{className:"nice-keyboard-hint__desc",children:h.description})]},m))})]})]})};Lr.displayName="NiceKeyboardHint";function Ui(e={}){const{enabled:t=!1,onSubmit:r,preventDefault:a=!0,requireCtrl:n=!1,skipTextarea:s=!0}=e;return c.useCallback(i=>{!t||!r||i.key==="Enter"&&(n&&!i.ctrlKey&&!i.metaKey||s&&i.target.tagName==="TEXTAREA"||(a&&i.preventDefault(),r()))},[t,r,a,n,s])}function qi(e={}){const{onClick:t,disabled:r=!1,role:a,tabIndex:n,triggerOnSpace:s=!0,as:i,selected:o}=e,l=a??i??"button",d=c.useCallback(p=>{r||t==null||t(p)},[r,t]),u=c.useCallback(p=>{if(r)return;const h=s&&(p.key===" "||p.key==="Spacebar");(p.key==="Enter"||h)&&(p.preventDefault(),t==null||t(p))},[r,t,s]),f={role:l,tabIndex:n??(r?-1:0),onClick:d,onKeyDown:u};return r&&(f["aria-disabled"]=!0),o!==void 0&&(l==="option"||l==="tab"||l==="row")&&(f["aria-selected"]=o),f}function Gi(e={}){const[t,r]=c.useState(!1),[a,n]=c.useState(""),s=c.useRef(null),i=typeof window<"u"&&("SpeechRecognition"in window||"webkitSpeechRecognition"in window),o=c.useCallback(u=>{if(!e.commands)return;const f=u.toLowerCase().trim();for(const p of e.commands)if(typeof p.phrase=="string"){if(f===p.phrase.toLowerCase()){p.action([],u);return}}else{const h=u.match(p.phrase);if(h){p.action(Array.from(h),u);return}}},[e.commands]),l=c.useCallback(()=>{if(!i||t)return;const u=window.SpeechRecognition??window.webkitSpeechRecognition,f=new u;f.lang=e.language??"en-US",f.continuous=e.continuous??!0,f.interimResults=e.interimResults??!1,f.onresult=p=>{var g;const h=p.results[p.results.length-1],m=h[0].transcript,y=h.isFinal;n(m),(g=e.onTranscript)==null||g.call(e,m,y),y&&o(m)},f.onerror=p=>{var h;(h=e.onError)==null||h.call(e,p.error),p.error==="not-allowed"&&r(!1)},f.onend=()=>{if(t&&e.continuous)try{f.start()}catch{r(!1)}else r(!1)},s.current=f,f.start(),r(!0)},[i,t,e.language,e.continuous]),d=c.useCallback(()=>{var u;(u=s.current)==null||u.stop(),s.current=null,r(!1)},[]);return c.useEffect(()=>()=>d(),[]),{isListening:t,isSupported:i,start:l,stop:d,transcript:a}}function Tr(e={}){const[t,r]=c.useState(""),a=c.useRef(void 0),n=c.useCallback(i=>{r(""),requestAnimationFrame(()=>{r(i),e.clearAfterMs&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>r(""),e.clearAfterMs))})},[e.clearAfterMs]);c.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const s={role:"status","aria-live":e.politeness??"polite","aria-atomic":e.atomic??!0,"aria-relevant":e.relevant??"additions text",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}};return{message:t,announce:n,regionProps:s}}function Ki(){const{announce:e,regionProps:t,message:r}=Tr({politeness:"assertive",clearAfterMs:3e3});return{announcePageChange:c.useCallback(n=>{e(`Nawigacja do: ${n}`),typeof document<"u"&&(document.title=n)},[e]),regionProps:t,message:r}}function Ji(){const e=c.useRef(null),t=c.useCallback(()=>{var s;const n=(s=e.current)==null?void 0:s.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');n==null||n.focus()},[]),r=c.useCallback(n=>{var s,i;(i=(s=e.current)==null?void 0:s.querySelector(n))==null||i.focus()},[]),a=c.useCallback(()=>e.current?Array.from(e.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')):[],[]);return{containerRef:e,focusFirst:t,focusElement:r,getFocusableElements:a}}const jt={simplifiedMode:!1,increasedSpacing:!1,readingGuide:!1,enhancedFocus:!1,reduceMotion:!1,iconLabels:!1,largeTargets:!1,dyslexiaFont:!1,lineSpacing:1.5,wordSpacing:1};function Yi(e=jt){const[t,r]=c.useState({...jt,...e}),a=c.useCallback((o,l)=>{r(d=>({...d,[o]:l}))},[]),n=Qi(t),s=[t.simplifiedMode&&"nice-a11y-simplified",t.increasedSpacing&&"nice-a11y-spacing",t.enhancedFocus&&"nice-a11y-enhanced-focus",t.reduceMotion&&"nice-a11y-reduce-motion",t.iconLabels&&"nice-a11y-icon-labels",t.largeTargets&&"nice-a11y-large-targets",t.dyslexiaFont&&"nice-a11y-dyslexia"].filter(Boolean).join(" "),i={};return t.lineSpacing&&t.lineSpacing!==1.5&&(i.lineHeight=String(t.lineSpacing)),t.wordSpacing&&t.wordSpacing!==1&&(i.wordSpacing=`${(t.wordSpacing-1)*.25}em`),{settings:t,updateSetting:a,css:n,rootClasses:s,rootStyle:i}}function Qi(e){const t=[];return e.simplifiedMode&&t.push(`
|
|
19
19
|
.nice-a11y-simplified .nice-secondary,
|
|
20
20
|
.nice-a11y-simplified .nice-decorative,
|
|
21
21
|
.nice-a11y-simplified [role="presentation"] { display: none !important; }
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
min-height: 56px !important; min-width: 56px !important; font-size: 18px !important;
|
|
36
36
|
}`),e.dyslexiaFont&&t.push(`
|
|
37
37
|
.nice-a11y-dyslexia { font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important; letter-spacing: 0.05em !important; }`),t.join(`
|
|
38
|
-
`)}function Zi(e,t,r=!1){const a=Ot(Bt(e)),n=Ot(Bt(t)),s=tc(a,n),i=r?4.5:7;return{rule:"1.4.6",level:"AAA",passed:s>=i,message:`Contrast ratio ${s.toFixed(2)}:1 (requires ${i}:1 for AAA${r?" large text":""})`}}function ec(){if(typeof document>"u")return[];const e=[];return document.querySelectorAll("a").forEach(r=>{var i;const a=((i=r.textContent)==null?void 0:i.trim())??"",n=!!r.getAttribute("aria-label");["click here","read more","learn more","here","link"].includes(a.toLowerCase())&&!n&&e.push({rule:"2.4.9",level:"AAA",passed:!1,message:`Link with generic text "${a}" lacks descriptive label`,element:r.outerHTML.slice(0,100)})}),document.querySelectorAll("h1, h2, h3, h4, h5, h6"),document.querySelectorAll("section, article, main, aside").forEach(r=>{r.querySelector("h1, h2, h3, h4, h5, h6")||e.push({rule:"2.4.10",level:"AAA",passed:!1,message:`<${r.tagName.toLowerCase()}> lacks a heading element`,element:r.tagName.toLowerCase()})}),document.querySelectorAll("p, li, td, span").forEach(r=>{const a=window.getComputedStyle(r),n=parseFloat(a.width),s=parseFloat(a.fontSize);s>0&&n/s>80&&e.push({rule:"1.4.8",level:"AAA",passed:!1,message:`Text block exceeds 80 character width (${Math.round(n/s)} chars)`,element:r.tagName.toLowerCase()})}),document.querySelectorAll('input[type="checkbox"], input[type="radio"], select').forEach(r=>{r.hasAttribute("onchange")&&e.push({rule:"3.2.5",level:"AAA",passed:!1,message:"Form control has inline onchange handler — may cause unexpected context change",element:r.tagName.toLowerCase()})}),document.querySelectorAll("video[autoplay], audio[autoplay]").forEach(r=>{e.push({rule:"2.2.3",level:"AAA",passed:!1,message:"Auto-playing media found — user should control timing",element:r.tagName.toLowerCase()})}),e}function Bt(e){if(e.startsWith("#")){const t=e.slice(1),r=parseInt(t.slice(0,2),16)/255,a=parseInt(t.slice(2,4),16)/255,n=parseInt(t.slice(4,6),16)/255;return[r,a,n]}return[0,0,0]}function Ot([e,t,r]){const a=n=>n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4);return .2126*a(e)+.7152*a(t)+.0722*a(r)}function tc(e,t){const r=Math.max(e,t),a=Math.min(e,t);return(r+.05)/(a+.05)}const rc=["none","protanopia","protanomaly","deuteranopia","deuteranomaly","tritanopia","tritanomaly","achromatopsia","achromatomaly"],_t="nice2dev-color-blind-filters",Wt="nice2dev-color-blind-styles",tt={protanopia:"0.567 0.433 0 0 0 0.558 0.442 0 0 0 0 0.242 0.758 0 0 0 0 0 1 0",protanomaly:"0.817 0.183 0 0 0 0.333 0.667 0 0 0 0 0.125 0.875 0 0 0 0 0 1 0",deuteranopia:"0.625 0.375 0 0 0 0.7 0.3 0 0 0 0 0.3 0.7 0 0 0 0 0 1 0",deuteranomaly:"0.8 0.2 0 0 0 0.258 0.742 0 0 0 0 0.142 0.858 0 0 0 0 0 1 0",tritanopia:"0.95 0.05 0 0 0 0 0.433 0.567 0 0 0 0.475 0.525 0 0 0 0 0 1 0",tritanomaly:"0.967 0.033 0 0 0 0 0.733 0.267 0 0 0 0.183 0.817 0 0 0 0 0 1 0",achromatopsia:"0.299 0.587 0.114 0 0 0.299 0.587 0.114 0 0 0.299 0.587 0.114 0 0 0 0 0 1 0",achromatomaly:"0.618 0.320 0.062 0 0 0.163 0.775 0.062 0 0 0.163 0.320 0.516 0 0 0 0 0 1 0"};function ac(){if(typeof document>"u"||document.getElementById(_t))return;const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.id=_t,t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.style.position="absolute",t.style.width="0",t.style.height="0",t.style.overflow="hidden";const r=document.createElementNS(e,"defs");for(const[a,n]of Object.entries(tt)){const s=document.createElementNS(e,"filter");s.id=`nice-cb-${a}`,s.setAttribute("color-interpolation-filters","sRGB");const i=document.createElementNS(e,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values",n),s.appendChild(i),r.appendChild(s)}if(t.appendChild(r),document.body.appendChild(t),!document.getElementById(Wt)){const a=document.createElement("style");a.id=Wt,a.textContent=Object.keys(tt).map(n=>`.nice-color-blind-${n}{filter:url(#nice-cb-${n})!important;}`).join(""),document.head.appendChild(a)}}function yt(e){for(const t of Object.keys(tt))e.classList.remove(`nice-color-blind-${t}`)}function ht(e,t=typeof document<"u"?document.documentElement:null){t&&(ac(),yt(t),e!=="none"&&t.classList.add(`nice-color-blind-${e}`))}function Rr(e,t={}){const{target:r}=t,a=c.useRef(null);c.useEffect(()=>{const n=r??(typeof document<"u"?document.documentElement:null);return a.current=n,ht(e,n),()=>{const s=a.current;s&&yt(s)}},[e,r])}function nc(e,t){if(typeof window>"u")return null;try{if(t==="cookie"){const a=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"=([^;]*)"));return a?decodeURIComponent(a[1]):null}const r=window[t].getItem(e);return r||null}catch{return null}}function sc(e,t,r,a){if(!(typeof window>"u"))try{if(r==="cookie"){document.cookie=`${e}=${encodeURIComponent(t)};path=/;max-age=${a};SameSite=Lax`;return}window[r].setItem(e,t)}catch{}}function oc(e={}){const{storageKey:t="nice2dev.a11y.cvd",storage:r="localStorage",defaultMode:a="none",target:n,cookieMaxAgeSeconds:s=3600*24*60}=e,i=c.useCallback(h=>{if(typeof window>"u"||r==="cookie")return()=>{};const m=y=>{y.key===t&&h()};return window.addEventListener("storage",m),()=>window.removeEventListener("storage",m)},[r,t]),o=c.useCallback(()=>nc(t,r)??a,[r,t,a]),l=c.useCallback(()=>a,[a]),d=c.useSyncExternalStore(i,o,l),[u,f]=c.useState(d);c.useEffect(()=>{d!==u&&f(d)},[d]),Rr(u,{target:n});const p=c.useCallback(h=>{f(h),sc(t,h,r,s)},[r,t,s]);return[u,p]}function ic(e=typeof document<"u"?document.documentElement:null){return{set:t=>ht(t,e),clear:()=>{e&&yt(e)}}}const cc=e=>[...e],lc=()=>{const e=new Map;return{getItem:t=>Promise.resolve(e.get(t)),setItem:(t,r)=>(e.set(t,r),Promise.resolve())}};function dc(e={}){var p,h;const t=e.permissionPolicy??cc,r=e.storage;let a;r&&typeof r.getItem=="function"&&typeof r.setItem=="function"?a={getItem:r.getItem,setItem:r.setItem}:a=lc();const n=(p=e.permissions)==null?void 0:p.canActivate,s={user:(h=e.permissions)==null?void 0:h.user},i=e.logger,o=new Map,l=new Map,d=new Map,u=(m,y)=>{const g=d.get(m);if(g)for(const v of g)try{v(y)}catch{}},f=(m,y,g)=>{const v=new Set(y);return{permissions:v,log:(b,...S)=>{i&&i(m.id,b,S)},on:(b,S)=>{let w=l.get(b);w||(w=new Set,l.set(b,w)),w.add(S);const A=()=>{w.delete(S)};return g.push(A),A},emit:(b,S)=>{if(!v.has("events:emit"))return;const w=l.get(b);if(w)for(const A of w)try{A(S)}catch{}},setItem:async(b,S)=>{v.has("storage:write")&&await a.setItem(`${m.id}:${b}`,S)},getItem:async b=>{if(v.has("storage:read"))return await a.getItem(`${m.id}:${b}`)}}};return{register(m){const y=m.manifest.id;if(o.has(y))throw new Error(`Plugin "${y}" already registered`);const g={manifest:m.manifest,status:"registered"};return o.set(y,{plugin:m,record:g,cleanups:[]}),u("register",g),g},unregister(m){return o.get(m)?(o.delete(m),!0):!1},async activate(m){const y=o.get(m);if(!y)throw new Error(`Unknown plugin "${m}"`);if(y.record.status==="active")return y.record;for(const g of y.plugin.manifest.dependsOn??[]){const v=o.get(g);if(!v)throw y.record.status="error",y.record.error=`Missing dependency: ${g}`,u("error",y.record),new Error(y.record.error);v.record.status!=="active"&&await this.activate(g)}y.record.status="activating";try{if(n&&!n(y.plugin.manifest,s))throw y.record.status="error",y.record.error="permission-denied",u("error",y.record),new Error(y.record.error);const g=t(y.plugin.manifest.permissions??[],y.plugin.manifest),v=f(y.plugin.manifest,g,y.cleanups);await y.plugin.activate(v),y.record.status="active",y.record.activatedAt=Date.now(),y.record.error=void 0,u("activate",y.record)}catch(g){throw y.record.status="error",y.record.error=g instanceof Error?g.message:String(g),u("error",y.record),g}return y.record},async deactivate(m){var g,v;const y=o.get(m);if(!y)throw new Error(`Unknown plugin "${m}"`);if(y.record.status!=="active")return y.record;y.record.status="deactivating";try{await((v=(g=y.plugin).deactivate)==null?void 0:v.call(g));for(const b of y.cleanups.splice(0))await b();y.record.status="inactive",u("deactivate",y.record)}catch(b){throw y.record.status="error",y.record.error=b instanceof Error?b.message:String(b),u("error",y.record),b}return y.record},list(){return[...o.values()].map(m=>({...m.record}))},get(m){const y=o.get(m);return y?{...y.record}:void 0},on(m,y){let g=d.get(m);return g||(g=new Set,d.set(m,g)),g.add(y),()=>{g.delete(y)}},events:{on(m,y){const v={"plugin:registered":"register","plugin:activated":"activate","plugin:deactivated":"deactivate","plugin:error":"error"}[m];let b=d.get(v);return b||(b=new Set,d.set(v,b)),b.add(y),()=>{b.delete(y)}},emit(m,y){const g=l.get(m);if(g)for(const v of g)try{v(y)}catch{}}}}}function uc(...e){return e.join("-")}const fc={button:e=>e?`nice-button-${e}`:"nice-button",textInput:e=>e?`nice-text-input-${e}`:"nice-text-input",numberInput:e=>e?`nice-number-input-${e}`:"nice-number-input",select:e=>e?`nice-select-${e}`:"nice-select",checkbox:e=>e?`nice-checkbox-${e}`:"nice-checkbox",toggle:e=>e?`nice-toggle-${e}`:"nice-toggle",datePicker:e=>e?`nice-date-picker-${e}`:"nice-date-picker",dataGrid:e=>e?`nice-datagrid-${e}`:"nice-datagrid",table:e=>e?`nice-table-${e}`:"nice-table",list:e=>e?`nice-list-${e}`:"nice-list",treeView:e=>e?`nice-tree-${e}`:"nice-tree",modal:e=>e?`nice-modal-${e}`:"nice-modal",drawer:e=>e?`nice-drawer-${e}`:"nice-drawer",form:e=>e?`nice-form-${e}`:"nice-form",tabs:e=>e?`nice-tabs-${e}`:"nice-tabs",menu:e=>e?`nice-menu-${e}`:"nice-menu",chart:e=>e?`nice-chart-${e}`:"nice-chart",scheduler:e=>e?`nice-scheduler-${e}`:"nice-scheduler"},Ir=({children:e,direction:t="ltr"})=>c.createElement("div",{dir:t,"data-testid":"nice-test-root",style:{direction:t}},e);Ir.displayName="NiceTestWrapper";function mc(e,t,r){const a=new KeyboardEvent("keydown",{key:t,bubbles:!0,cancelable:!0,...r});e.dispatchEvent(a)}function pc(e,t){var a,n;const r=((a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:a.set)||((n=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value"))==null?void 0:n.set);r&&r.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function gc(e){const{data:t,delay:r=0,keyField:a="id"}=e;let n=[...t];return{key:a,load:async()=>(r>0&&await new Promise(s=>setTimeout(s,r)),{data:[...n],totalCount:n.length}),insert:async s=>(n.push(s),s),update:async(s,i)=>{const o=n.findIndex(l=>l[a]===s);o>=0&&(n[o]={...n[o],...i})},remove:async s=>{n=n.filter(i=>i[a]!==s)},getData:()=>[...n],reset:()=>{n=[...t]}}}function yc(e){const t=[];return e.querySelectorAll('button, input, select, textarea, [role="button"], [role="link"], [role="checkbox"], [role="radio"]').forEach(s=>{var o;s.getAttribute("aria-label")||s.getAttribute("aria-labelledby")||((o=s.textContent)==null?void 0:o.trim())||s.getAttribute("title")||t.push(`${s.tagName.toLowerCase()}${s.id?"#"+s.id:""} missing accessible name`)}),e.querySelectorAll("img").forEach(s=>{!s.alt&&s.getAttribute("role")!=="presentation"&&t.push(`img${s.src?'[src="'+s.src.substring(0,40)+'..."]':""} missing alt text`)}),e.querySelectorAll('input:not([type="hidden"]), select, textarea').forEach(s=>{const i=s.id&&e.querySelector(`label[for="${s.id}"]`),o=s.getAttribute("aria-label")||s.getAttribute("aria-labelledby");!i&&!o&&t.push(`${s.tagName.toLowerCase()}${s.name?'[name="'+s.name+'"]':""} missing label`)}),t}const zr=process.env.NODE_ENV==="development";let $={enabled:zr,logToConsole:!1,slowRenderThreshold:16,samplingRate:1,enableUserTiming:!0,trackPropsChanges:!1};const je=[],J=new Map,Be=new Map;let hc=1;function Dr(e){$={...$,...e}}function Pr(){return new Map(J)}function Fr(e){return J.get(e)}function bc(e=100){return je.slice(-e)}function bt(){je.length=0,J.clear(),Be.clear()}function vt(e){const t=e??$.slowRenderThreshold??16;return je.filter(r=>r.actualDuration>t)}function vc(){return Math.random()<($.samplingRate??1)}function Sc(e){const t=J.get(e.componentName);t?(t.renderCount++,e.phase==="mount"?t.mountCount++:t.updateCount++,t.totalRenderTime+=e.actualDuration,t.avgRenderTime=t.totalRenderTime/t.renderCount,t.maxRenderTime=Math.max(t.maxRenderTime,e.actualDuration),t.minRenderTime=Math.min(t.minRenderTime,e.actualDuration),t.lastRenderAt=e.timestamp,e.actualDuration>($.slowRenderThreshold??16)&&t.slowRenderCount++):J.set(e.componentName,{componentName:e.componentName,renderCount:1,mountCount:e.phase==="mount"?1:0,updateCount:e.phase==="mount"?0:1,avgRenderTime:e.actualDuration,maxRenderTime:e.actualDuration,minRenderTime:e.actualDuration,totalRenderTime:e.actualDuration,lastRenderAt:e.timestamp,slowRenderCount:e.actualDuration>($.slowRenderThreshold??16)?1:0})}function G(e){return e<1?`${(e*1e3).toFixed(0)}μs`:e<1e3?`${e.toFixed(2)}ms`:`${(e/1e3).toFixed(2)}s`}const xc=({id:e,children:t,onRender:r,onSlowRender:a,slowThreshold:n,logToConsole:s})=>{const i=c.useCallback((o,l,d,u,f,p)=>{var g,v,b;if(!$.enabled||!vc()||(g=$.ignoreComponents)!=null&&g.includes(o))return;const h={componentName:o,renderId:`render-${hc++}`,phase:l,actualDuration:d,baseDuration:u,startTime:f,commitTime:p,interactions:new Set,timestamp:Date.now()};if(je.push(h),Sc(h),$.enableUserTiming)try{performance.measure(`Nice:${o}:${l}`,{start:f,duration:d})}catch{}if(s??$.logToConsole){const S=n??$.slowRenderThreshold??16,w=d>S;console.log(`%c[Profile] ${o} ${l}`,`color: ${w?"var(--color-error, #dc2626)":"var(--color-success, #22c55e)"}; font-weight: ${w?"bold":"normal"}`,{actual:G(d),base:G(u),savings:`${((1-d/u)*100).toFixed(1)}%`})}r==null||r(h),(v=$.onRender)==null||v.call($,h);const y=n??$.slowRenderThreshold??16;d>y&&(a==null||a(h),(b=$.onSlowRender)==null||b.call($,h))},[e,r,a,n,s]);return $.enabled?x.jsx(c.Profiler,{id:e,onRender:i,children:t}):x.jsx(x.Fragment,{children:t})};function Hr(e,t){const r=c.useRef(),a=c.useRef(0);c.useEffect(()=>{if(!$.enabled||!$.trackPropsChanges)return;if(a.current++,a.current===1){r.current=t;return}const n=r.current,s=[],i=new Set([...Object.keys(n||{}),...Object.keys(t)]);for(const o of i){const l=n==null?void 0:n[o],d=t[o];Object.is(l,d)||s.push({propName:o,oldValue:l,newValue:d,timestamp:Date.now()})}s.length>0&&$.logToConsole&&console.log(`%c[Why render?] ${e}`,"color: var(--nice-info, #6366f1); font-weight: bold",`Render #${a.current}`,s.map(o=>({prop:o.propName,from:o.oldValue,to:o.newValue,type:typeof o.newValue}))),r.current=t})}function wc(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>(Hr(r,n),x.jsx(e,{...n}));return a.displayName=`WhyDidYouRender(${r})`,a}function kc(e){const t=c.useRef(0);return t.current++,c.useEffect(()=>{$.enabled&&$.logToConsole&&e&&console.log(`%c[Render count] ${e}: ${t.current}`,`color: ${t.current>10?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"}`)}),t.current}function Oe(e,t){if(!$.enabled)return;const r={name:e,startTime:performance.now(),detail:t};if(Be.set(e,r),$.enableUserTiming)try{performance.mark(`Nice:${e}:start`,{detail:t})}catch{}}function _e(e){if(!$.enabled)return 0;const t=Be.get(e);if(!t)return console.warn(`[Profile] No mark found for: ${e}`),0;const r=performance.now()-t.startTime;if(t.duration=r,$.enableUserTiming)try{performance.mark(`Nice:${e}:end`),performance.measure(`Nice:${e}`,`Nice:${e}:start`,`Nice:${e}:end`)}catch{}return $.logToConsole&&console.log(`%c[Measure] ${e}: ${G(r)}`,`color: ${r>100?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"}`),r}async function Mc(e,t,r){Oe(e,r);try{return await t()}finally{_e(e)}}function Cc(e,t,r){Oe(e,r);try{return t()}finally{_e(e)}}function Ac(e,t,r){c.useEffect(()=>{Oe(e);const a=t();return _e(e),a},r)}function $r(){const e=Array.from(J.values()),t=vt(),r=e.reduce((s,i)=>s+i.renderCount,0),a=e.length>0?e.reduce((s,i)=>s+i.avgRenderTime,0)/e.length:0,n=Array.from(Be.values());return{stats:e,slowRenders:t,totalRenders:r,avgRenderTime:a,marks:n}}function St(){const e=$r();console.group("%c[Nice2Dev Performance Report]","color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"),console.log(`Total renders: ${e.totalRenders}`),console.log(`Average render time: ${G(e.avgRenderTime)}`),console.log(`Slow renders: ${e.slowRenders.length}`),console.group("Component Stats"),console.table(e.stats.sort((t,r)=>r.totalRenderTime-t.totalRenderTime).map(t=>({Name:t.componentName,Renders:t.renderCount,"Avg Time":G(t.avgRenderTime),"Max Time":G(t.maxRenderTime),"Total Time":G(t.totalRenderTime),"Slow Renders":t.slowRenderCount}))),console.groupEnd(),e.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(e.slowRenders.slice(-10).map(t=>({Component:t.componentName,Phase:t.phase,Duration:G(t.actualDuration),Time:new Date(t.timestamp).toLocaleTimeString()}))),console.groupEnd()),e.marks.length>0&&(console.group("Custom Marks"),console.table(e.marks.filter(t=>t.duration).map(t=>({Name:t.name,Duration:G(t.duration)}))),console.groupEnd()),console.groupEnd()}const jr=new Map;function Br(){for(const[e,t]of J)jr.set(e,{...t});console.log("[Profile] Baseline saved")}function Or(e=20){const t=[];for(const[r,a]of J){const n=jr.get(r);if(!n)continue;const s=(a.avgRenderTime-n.avgRenderTime)/n.avgRenderTime*100;s>e&&t.push({componentName:r,metric:"avgRenderTime",baseline:n.avgRenderTime,current:a.avgRenderTime,changePercent:s});const i=(a.maxRenderTime-n.maxRenderTime)/n.maxRenderTime*100;i>e&&t.push({componentName:r,metric:"maxRenderTime",baseline:n.maxRenderTime,current:a.maxRenderTime,changePercent:i})}return t.length>0&&$.logToConsole&&console.warn("%c[Regression] Performance regressions detected!","color: var(--nice-danger-dark, #dc2626); font-weight: bold",t),t}const _r=c.memo(({position:e="bottom-right",defaultCollapsed:t=!0})=>{const[r,a]=c.useState(t),[n,s]=c.useState([]),[i,o]=c.useState({used:0,total:0});if(c.useEffect(()=>{const d=()=>{const f=Array.from(J.values());s(f.sort((h,m)=>m.totalRenderTime-h.totalRenderTime).slice(0,10));const p=window.performance;p.memory&&o({used:p.memory.usedJSHeapSize/1024/1024,total:p.memory.totalJSHeapSize/1024/1024})};d();const u=setInterval(d,2e3);return()=>clearInterval(u)},[]),!$.enabled)return null;const l={position:"fixed",zIndex:99999,...e.includes("top")?{top:8}:{bottom:8},...e.includes("left")?{left:8}:{right:8}};return x.jsxs("div",{style:{...l,background:"var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",color:"var(--bg-primary, #fff)",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:r?"4px 8px":8,maxWidth:r?"auto":300,maxHeight:r?"auto":400,overflow:"auto"},children:[x.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>a(d=>!d),children:[x.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:"●"}),x.jsx("span",{children:"Profiler"}),i.used>0&&x.jsxs("span",{style:{color:i.used>100?"var(--color-warning, #f59e0b)":"var(--text-muted, #64748b)"},children:[i.used.toFixed(0),"MB"]}),x.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:r?"▼":"▲"})]}),!r&&x.jsxs("div",{style:{marginTop:8},children:[x.jsx("div",{style:{borderBottom:"1px solid var(--border-color, #333)",paddingBottom:4,marginBottom:8},children:x.jsx("strong",{children:"Top Components"})}),n.map(d=>x.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[x.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:d.componentName}),x.jsx("span",{style:{color:d.avgRenderTime>16?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"},children:G(d.avgRenderTime)}),x.jsxs("span",{style:{color:"var(--text-muted, #64748b)",minWidth:30,textAlign:"right"},children:["x",d.renderCount]})]},d.componentName)),x.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[x.jsx("button",{onClick:St,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Print Report"}),x.jsx("button",{onClick:bt,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});_r.displayName="ProfilerOverlay";function Ec(){zr&&(window.__NICE2DEV_PROFILER__={getStats:Pr,getComponentStats:Fr,getSlowRenders:vt,printReport:St,clear:bt,saveBaseline:Br,checkRegression:Or,configure:Dr},console.log("%c[Nice2Dev Profiler] DevTools integration ready. Use __NICE2DEV_PROFILER__ in console.","color: var(--nice-info, #6366f1)"))}const xt=process.env.NODE_ENV==="development";let j={enabled:xt,logToConsole:!0,samplingRate:1,trackDetachedNodes:!1,closureSizeThreshold:1024*1024};const We=[],ze=new Map,Ke=new Map,Vt=new WeakMap;let Nc=1;function Lc(){return Math.random()<(j.samplingRate??1)}function Ve(){var e;try{throw new Error}catch(t){return((e=t.stack)==null?void 0:e.split(`
|
|
38
|
+
`)}function Zi(e,t,r=!1){const a=Ot(Bt(e)),n=Ot(Bt(t)),s=tc(a,n),i=r?4.5:7;return{rule:"1.4.6",level:"AAA",passed:s>=i,message:`Contrast ratio ${s.toFixed(2)}:1 (requires ${i}:1 for AAA${r?" large text":""})`}}function ec(){if(typeof document>"u")return[];const e=[];return document.querySelectorAll("a").forEach(r=>{var i;const a=((i=r.textContent)==null?void 0:i.trim())??"",n=!!r.getAttribute("aria-label");["click here","read more","learn more","here","link"].includes(a.toLowerCase())&&!n&&e.push({rule:"2.4.9",level:"AAA",passed:!1,message:`Link with generic text "${a}" lacks descriptive label`,element:r.outerHTML.slice(0,100)})}),document.querySelectorAll("h1, h2, h3, h4, h5, h6"),document.querySelectorAll("section, article, main, aside").forEach(r=>{r.querySelector("h1, h2, h3, h4, h5, h6")||e.push({rule:"2.4.10",level:"AAA",passed:!1,message:`<${r.tagName.toLowerCase()}> lacks a heading element`,element:r.tagName.toLowerCase()})}),document.querySelectorAll("p, li, td, span").forEach(r=>{const a=window.getComputedStyle(r),n=parseFloat(a.width),s=parseFloat(a.fontSize);s>0&&n/s>80&&e.push({rule:"1.4.8",level:"AAA",passed:!1,message:`Text block exceeds 80 character width (${Math.round(n/s)} chars)`,element:r.tagName.toLowerCase()})}),document.querySelectorAll('input[type="checkbox"], input[type="radio"], select').forEach(r=>{r.hasAttribute("onchange")&&e.push({rule:"3.2.5",level:"AAA",passed:!1,message:"Form control has inline onchange handler — may cause unexpected context change",element:r.tagName.toLowerCase()})}),document.querySelectorAll("video[autoplay], audio[autoplay]").forEach(r=>{e.push({rule:"2.2.3",level:"AAA",passed:!1,message:"Auto-playing media found — user should control timing",element:r.tagName.toLowerCase()})}),e}function Bt(e){if(e.startsWith("#")){const t=e.slice(1),r=parseInt(t.slice(0,2),16)/255,a=parseInt(t.slice(2,4),16)/255,n=parseInt(t.slice(4,6),16)/255;return[r,a,n]}return[0,0,0]}function Ot([e,t,r]){const a=n=>n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4);return .2126*a(e)+.7152*a(t)+.0722*a(r)}function tc(e,t){const r=Math.max(e,t),a=Math.min(e,t);return(r+.05)/(a+.05)}const rc=["none","protanopia","protanomaly","deuteranopia","deuteranomaly","tritanopia","tritanomaly","achromatopsia","achromatomaly"],_t="nice2dev-color-blind-filters",Wt="nice2dev-color-blind-styles",tt={protanopia:"0.567 0.433 0 0 0 0.558 0.442 0 0 0 0 0.242 0.758 0 0 0 0 0 1 0",protanomaly:"0.817 0.183 0 0 0 0.333 0.667 0 0 0 0 0.125 0.875 0 0 0 0 0 1 0",deuteranopia:"0.625 0.375 0 0 0 0.7 0.3 0 0 0 0 0.3 0.7 0 0 0 0 0 1 0",deuteranomaly:"0.8 0.2 0 0 0 0.258 0.742 0 0 0 0 0.142 0.858 0 0 0 0 0 1 0",tritanopia:"0.95 0.05 0 0 0 0 0.433 0.567 0 0 0 0.475 0.525 0 0 0 0 0 1 0",tritanomaly:"0.967 0.033 0 0 0 0 0.733 0.267 0 0 0 0.183 0.817 0 0 0 0 0 1 0",achromatopsia:"0.299 0.587 0.114 0 0 0.299 0.587 0.114 0 0 0.299 0.587 0.114 0 0 0 0 0 1 0",achromatomaly:"0.618 0.320 0.062 0 0 0.163 0.775 0.062 0 0 0.163 0.320 0.516 0 0 0 0 0 1 0"};function ac(){if(typeof document>"u"||document.getElementById(_t))return;const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.id=_t,t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.style.position="absolute",t.style.width="0",t.style.height="0",t.style.overflow="hidden";const r=document.createElementNS(e,"defs");for(const[a,n]of Object.entries(tt)){const s=document.createElementNS(e,"filter");s.id=`nice-cb-${a}`,s.setAttribute("color-interpolation-filters","sRGB");const i=document.createElementNS(e,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values",n),s.appendChild(i),r.appendChild(s)}if(t.appendChild(r),document.body.appendChild(t),!document.getElementById(Wt)){const a=document.createElement("style");a.id=Wt,a.textContent=Object.keys(tt).map(n=>`.nice-color-blind-${n}{filter:url(#nice-cb-${n})!important;}`).join(""),document.head.appendChild(a)}}function yt(e){for(const t of Object.keys(tt))e.classList.remove(`nice-color-blind-${t}`)}function ht(e,t=typeof document<"u"?document.documentElement:null){t&&(ac(),yt(t),e!=="none"&&t.classList.add(`nice-color-blind-${e}`))}function Rr(e,t={}){const{target:r}=t,a=c.useRef(null);c.useEffect(()=>{const n=r??(typeof document<"u"?document.documentElement:null);return a.current=n,ht(e,n),()=>{const s=a.current;s&&yt(s)}},[e,r])}function nc(e,t){if(typeof window>"u")return null;try{if(t==="cookie"){const a=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"=([^;]*)"));return a?decodeURIComponent(a[1]):null}const r=window[t].getItem(e);return r||null}catch{return null}}function sc(e,t,r,a){if(!(typeof window>"u"))try{if(r==="cookie"){document.cookie=`${e}=${encodeURIComponent(t)};path=/;max-age=${a};SameSite=Lax`;return}window[r].setItem(e,t)}catch{}}function oc(e={}){const{storageKey:t="nice2dev.a11y.cvd",storage:r="localStorage",defaultMode:a="none",target:n,cookieMaxAgeSeconds:s=3600*24*60}=e,i=c.useCallback(h=>{if(typeof window>"u"||r==="cookie")return()=>{};const m=y=>{y.key===t&&h()};return window.addEventListener("storage",m),()=>window.removeEventListener("storage",m)},[r,t]),o=c.useCallback(()=>nc(t,r)??a,[r,t,a]),l=c.useCallback(()=>a,[a]),d=c.useSyncExternalStore(i,o,l),[u,f]=c.useState(d);c.useEffect(()=>{d!==u&&f(d)},[d]),Rr(u,{target:n});const p=c.useCallback(h=>{f(h),sc(t,h,r,s)},[r,t,s]);return[u,p]}function ic(e=typeof document<"u"?document.documentElement:null){return{set:t=>ht(t,e),clear:()=>{e&&yt(e)}}}const cc=e=>[...e],lc=()=>{const e=new Map;return{getItem:t=>Promise.resolve(e.get(t)),setItem:(t,r)=>(e.set(t,r),Promise.resolve())}};function dc(e={}){var p,h;const t=e.permissionPolicy??cc,r=e.storage;let a;r&&typeof r.getItem=="function"&&typeof r.setItem=="function"?a={getItem:r.getItem,setItem:r.setItem}:a=lc();const n=(p=e.permissions)==null?void 0:p.canActivate,s={user:(h=e.permissions)==null?void 0:h.user},i=e.logger,o=new Map,l=new Map,d=new Map,u=(m,y)=>{const g=d.get(m);if(g)for(const v of g)try{v(y)}catch{}},f=(m,y,g)=>{const v=new Set(y);return{permissions:v,log:(b,...S)=>{i&&i(m.id,b,S)},on:(b,S)=>{let w=l.get(b);w||(w=new Set,l.set(b,w)),w.add(S);const A=()=>{w.delete(S)};return g.push(A),A},emit:(b,S)=>{if(!v.has("events:emit"))return;const w=l.get(b);if(w)for(const A of w)try{A(S)}catch{}},setItem:async(b,S)=>{v.has("storage:write")&&await a.setItem(`${m.id}:${b}`,S)},getItem:async b=>{if(v.has("storage:read"))return await a.getItem(`${m.id}:${b}`)}}};return{register(m){const y=m.manifest.id;if(o.has(y))throw new Error(`Plugin "${y}" already registered`);const g={manifest:m.manifest,status:"registered"};return o.set(y,{plugin:m,record:g,cleanups:[]}),u("register",g),g},unregister(m){return o.get(m)?(o.delete(m),!0):!1},async activate(m){const y=o.get(m);if(!y)throw new Error(`Unknown plugin "${m}"`);if(y.record.status==="active")return y.record;for(const g of y.plugin.manifest.dependsOn??[]){const v=o.get(g);if(!v)throw y.record.status="error",y.record.error=`Missing dependency: ${g}`,u("error",y.record),new Error(y.record.error);v.record.status!=="active"&&await this.activate(g)}y.record.status="activating";try{if(n&&!n(y.plugin.manifest,s))throw y.record.status="error",y.record.error="permission-denied",u("error",y.record),new Error(y.record.error);const g=t(y.plugin.manifest.permissions??[],y.plugin.manifest),v=f(y.plugin.manifest,g,y.cleanups);await y.plugin.activate(v),y.record.status="active",y.record.activatedAt=Date.now(),y.record.error=void 0,u("activate",y.record)}catch(g){throw y.record.status="error",y.record.error=g instanceof Error?g.message:String(g),u("error",y.record),g}return y.record},async deactivate(m){var g,v;const y=o.get(m);if(!y)throw new Error(`Unknown plugin "${m}"`);if(y.record.status!=="active")return y.record;y.record.status="deactivating";try{await((v=(g=y.plugin).deactivate)==null?void 0:v.call(g));for(const b of y.cleanups.splice(0))await b();y.record.status="inactive",u("deactivate",y.record)}catch(b){throw y.record.status="error",y.record.error=b instanceof Error?b.message:String(b),u("error",y.record),b}return y.record},list(){return[...o.values()].map(m=>({...m.record}))},get(m){const y=o.get(m);return y?{...y.record}:void 0},on(m,y){let g=d.get(m);return g||(g=new Set,d.set(m,g)),g.add(y),()=>{g.delete(y)}},events:{on(m,y){const v={"plugin:registered":"register","plugin:activated":"activate","plugin:deactivated":"deactivate","plugin:error":"error"}[m];let b=d.get(v);return b||(b=new Set,d.set(v,b)),b.add(y),()=>{b.delete(y)}},emit(m,y){const g=l.get(m);if(g)for(const v of g)try{v(y)}catch{}}}}}function uc(...e){return e.join("-")}const fc={button:e=>e?`nice-button-${e}`:"nice-button",textInput:e=>e?`nice-text-input-${e}`:"nice-text-input",numberInput:e=>e?`nice-number-input-${e}`:"nice-number-input",select:e=>e?`nice-select-${e}`:"nice-select",checkbox:e=>e?`nice-checkbox-${e}`:"nice-checkbox",toggle:e=>e?`nice-toggle-${e}`:"nice-toggle",datePicker:e=>e?`nice-date-picker-${e}`:"nice-date-picker",dataGrid:e=>e?`nice-datagrid-${e}`:"nice-datagrid",table:e=>e?`nice-table-${e}`:"nice-table",list:e=>e?`nice-list-${e}`:"nice-list",treeView:e=>e?`nice-tree-${e}`:"nice-tree",modal:e=>e?`nice-modal-${e}`:"nice-modal",drawer:e=>e?`nice-drawer-${e}`:"nice-drawer",form:e=>e?`nice-form-${e}`:"nice-form",tabs:e=>e?`nice-tabs-${e}`:"nice-tabs",menu:e=>e?`nice-menu-${e}`:"nice-menu",chart:e=>e?`nice-chart-${e}`:"nice-chart",scheduler:e=>e?`nice-scheduler-${e}`:"nice-scheduler"},Ir=({children:e,direction:t="ltr"})=>c.createElement("div",{dir:t,"data-testid":"nice-test-root",style:{direction:t}},e);Ir.displayName="NiceTestWrapper";function mc(e,t,r){const a=new KeyboardEvent("keydown",{key:t,bubbles:!0,cancelable:!0,...r});e.dispatchEvent(a)}function pc(e,t){var a,n;const r=((a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:a.set)||((n=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value"))==null?void 0:n.set);r&&r.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function gc(e){const{data:t,delay:r=0,keyField:a="id"}=e;let n=[...t];return{key:a,load:async()=>(r>0&&await new Promise(s=>setTimeout(s,r)),{data:[...n],totalCount:n.length}),insert:async s=>(n.push(s),s),update:async(s,i)=>{const o=n.findIndex(l=>l[a]===s);o>=0&&(n[o]={...n[o],...i})},remove:async s=>{n=n.filter(i=>i[a]!==s)},getData:()=>[...n],reset:()=>{n=[...t]}}}function yc(e){const t=[];return e.querySelectorAll('button, input, select, textarea, [role="button"], [role="link"], [role="checkbox"], [role="radio"]').forEach(s=>{var o;s.getAttribute("aria-label")||s.getAttribute("aria-labelledby")||((o=s.textContent)==null?void 0:o.trim())||s.getAttribute("title")||t.push(`${s.tagName.toLowerCase()}${s.id?"#"+s.id:""} missing accessible name`)}),e.querySelectorAll("img").forEach(s=>{!s.alt&&s.getAttribute("role")!=="presentation"&&t.push(`img${s.src?'[src="'+s.src.substring(0,40)+'..."]':""} missing alt text`)}),e.querySelectorAll('input:not([type="hidden"]), select, textarea').forEach(s=>{const i=s.id&&e.querySelector(`label[for="${s.id}"]`),o=s.getAttribute("aria-label")||s.getAttribute("aria-labelledby");!i&&!o&&t.push(`${s.tagName.toLowerCase()}${s.name?'[name="'+s.name+'"]':""} missing label`)}),t}const zr=process.env.NODE_ENV==="development";let $={enabled:zr,logToConsole:!1,slowRenderThreshold:16,samplingRate:1,enableUserTiming:!0,trackPropsChanges:!1};const je=[],J=new Map,Be=new Map;let hc=1;function Dr(e){$={...$,...e}}function Pr(){return new Map(J)}function Fr(e){return J.get(e)}function bc(e=100){return je.slice(-e)}function bt(){je.length=0,J.clear(),Be.clear()}function vt(e){const t=e??$.slowRenderThreshold??16;return je.filter(r=>r.actualDuration>t)}function vc(){return Math.random()<($.samplingRate??1)}function Sc(e){const t=J.get(e.componentName);t?(t.renderCount++,e.phase==="mount"?t.mountCount++:t.updateCount++,t.totalRenderTime+=e.actualDuration,t.avgRenderTime=t.totalRenderTime/t.renderCount,t.maxRenderTime=Math.max(t.maxRenderTime,e.actualDuration),t.minRenderTime=Math.min(t.minRenderTime,e.actualDuration),t.lastRenderAt=e.timestamp,e.actualDuration>($.slowRenderThreshold??16)&&t.slowRenderCount++):J.set(e.componentName,{componentName:e.componentName,renderCount:1,mountCount:e.phase==="mount"?1:0,updateCount:e.phase==="mount"?0:1,avgRenderTime:e.actualDuration,maxRenderTime:e.actualDuration,minRenderTime:e.actualDuration,totalRenderTime:e.actualDuration,lastRenderAt:e.timestamp,slowRenderCount:e.actualDuration>($.slowRenderThreshold??16)?1:0})}function G(e){return e<1?`${(e*1e3).toFixed(0)}μs`:e<1e3?`${e.toFixed(2)}ms`:`${(e/1e3).toFixed(2)}s`}const xc=({id:e,children:t,onRender:r,onSlowRender:a,slowThreshold:n,logToConsole:s})=>{const i=c.useCallback((o,l,d,u,f,p)=>{var g,v,b;if(!$.enabled||!vc()||(g=$.ignoreComponents)!=null&&g.includes(o))return;const h={componentName:o,renderId:`render-${hc++}`,phase:l,actualDuration:d,baseDuration:u,startTime:f,commitTime:p,interactions:new Set,timestamp:Date.now()};if(je.push(h),Sc(h),$.enableUserTiming)try{performance.measure(`Nice:${o}:${l}`,{start:f,duration:d})}catch{}if(s??$.logToConsole){const S=n??$.slowRenderThreshold??16,w=d>S;console.log(`%c[Profile] ${o} ${l}`,`color: ${w?"var(--color-error, #dc2626)":"var(--color-success, #22c55e)"}; font-weight: ${w?"bold":"normal"}`,{actual:G(d),base:G(u),savings:`${((1-d/u)*100).toFixed(1)}%`})}r==null||r(h),(v=$.onRender)==null||v.call($,h);const y=n??$.slowRenderThreshold??16;d>y&&(a==null||a(h),(b=$.onSlowRender)==null||b.call($,h))},[e,r,a,n,s]);return $.enabled?x.jsx(c.Profiler,{id:e,onRender:i,children:t}):x.jsx(x.Fragment,{children:t})};function Hr(e,t){const r=c.useRef(void 0),a=c.useRef(0);c.useEffect(()=>{if(!$.enabled||!$.trackPropsChanges)return;if(a.current++,a.current===1){r.current=t;return}const n=r.current,s=[],i=new Set([...Object.keys(n||{}),...Object.keys(t)]);for(const o of i){const l=n==null?void 0:n[o],d=t[o];Object.is(l,d)||s.push({propName:o,oldValue:l,newValue:d,timestamp:Date.now()})}s.length>0&&$.logToConsole&&console.log(`%c[Why render?] ${e}`,"color: var(--nice-info, #6366f1); font-weight: bold",`Render #${a.current}`,s.map(o=>({prop:o.propName,from:o.oldValue,to:o.newValue,type:typeof o.newValue}))),r.current=t})}function wc(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>(Hr(r,n),x.jsx(e,{...n}));return a.displayName=`WhyDidYouRender(${r})`,a}function kc(e){const t=c.useRef(0);return t.current++,c.useEffect(()=>{$.enabled&&$.logToConsole&&e&&console.log(`%c[Render count] ${e}: ${t.current}`,`color: ${t.current>10?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"}`)}),t.current}function Oe(e,t){if(!$.enabled)return;const r={name:e,startTime:performance.now(),detail:t};if(Be.set(e,r),$.enableUserTiming)try{performance.mark(`Nice:${e}:start`,{detail:t})}catch{}}function _e(e){if(!$.enabled)return 0;const t=Be.get(e);if(!t)return console.warn(`[Profile] No mark found for: ${e}`),0;const r=performance.now()-t.startTime;if(t.duration=r,$.enableUserTiming)try{performance.mark(`Nice:${e}:end`),performance.measure(`Nice:${e}`,`Nice:${e}:start`,`Nice:${e}:end`)}catch{}return $.logToConsole&&console.log(`%c[Measure] ${e}: ${G(r)}`,`color: ${r>100?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"}`),r}async function Mc(e,t,r){Oe(e,r);try{return await t()}finally{_e(e)}}function Cc(e,t,r){Oe(e,r);try{return t()}finally{_e(e)}}function Ac(e,t,r){c.useEffect(()=>{Oe(e);const a=t();return _e(e),a},r)}function $r(){const e=Array.from(J.values()),t=vt(),r=e.reduce((s,i)=>s+i.renderCount,0),a=e.length>0?e.reduce((s,i)=>s+i.avgRenderTime,0)/e.length:0,n=Array.from(Be.values());return{stats:e,slowRenders:t,totalRenders:r,avgRenderTime:a,marks:n}}function St(){const e=$r();console.group("%c[Nice2Dev Performance Report]","color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"),console.log(`Total renders: ${e.totalRenders}`),console.log(`Average render time: ${G(e.avgRenderTime)}`),console.log(`Slow renders: ${e.slowRenders.length}`),console.group("Component Stats"),console.table(e.stats.sort((t,r)=>r.totalRenderTime-t.totalRenderTime).map(t=>({Name:t.componentName,Renders:t.renderCount,"Avg Time":G(t.avgRenderTime),"Max Time":G(t.maxRenderTime),"Total Time":G(t.totalRenderTime),"Slow Renders":t.slowRenderCount}))),console.groupEnd(),e.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(e.slowRenders.slice(-10).map(t=>({Component:t.componentName,Phase:t.phase,Duration:G(t.actualDuration),Time:new Date(t.timestamp).toLocaleTimeString()}))),console.groupEnd()),e.marks.length>0&&(console.group("Custom Marks"),console.table(e.marks.filter(t=>t.duration).map(t=>({Name:t.name,Duration:G(t.duration)}))),console.groupEnd()),console.groupEnd()}const jr=new Map;function Br(){for(const[e,t]of J)jr.set(e,{...t});console.log("[Profile] Baseline saved")}function Or(e=20){const t=[];for(const[r,a]of J){const n=jr.get(r);if(!n)continue;const s=(a.avgRenderTime-n.avgRenderTime)/n.avgRenderTime*100;s>e&&t.push({componentName:r,metric:"avgRenderTime",baseline:n.avgRenderTime,current:a.avgRenderTime,changePercent:s});const i=(a.maxRenderTime-n.maxRenderTime)/n.maxRenderTime*100;i>e&&t.push({componentName:r,metric:"maxRenderTime",baseline:n.maxRenderTime,current:a.maxRenderTime,changePercent:i})}return t.length>0&&$.logToConsole&&console.warn("%c[Regression] Performance regressions detected!","color: var(--nice-danger-dark, #dc2626); font-weight: bold",t),t}const _r=c.memo(({position:e="bottom-right",defaultCollapsed:t=!0})=>{const[r,a]=c.useState(t),[n,s]=c.useState([]),[i,o]=c.useState({used:0,total:0});if(c.useEffect(()=>{const d=()=>{const f=Array.from(J.values());s(f.sort((h,m)=>m.totalRenderTime-h.totalRenderTime).slice(0,10));const p=window.performance;p.memory&&o({used:p.memory.usedJSHeapSize/1024/1024,total:p.memory.totalJSHeapSize/1024/1024})};d();const u=setInterval(d,2e3);return()=>clearInterval(u)},[]),!$.enabled)return null;const l={position:"fixed",zIndex:99999,...e.includes("top")?{top:8}:{bottom:8},...e.includes("left")?{left:8}:{right:8}};return x.jsxs("div",{style:{...l,background:"var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",color:"var(--bg-primary, #fff)",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:r?"4px 8px":8,maxWidth:r?"auto":300,maxHeight:r?"auto":400,overflow:"auto"},children:[x.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>a(d=>!d),children:[x.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:"●"}),x.jsx("span",{children:"Profiler"}),i.used>0&&x.jsxs("span",{style:{color:i.used>100?"var(--color-warning, #f59e0b)":"var(--text-muted, #64748b)"},children:[i.used.toFixed(0),"MB"]}),x.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:r?"▼":"▲"})]}),!r&&x.jsxs("div",{style:{marginTop:8},children:[x.jsx("div",{style:{borderBottom:"1px solid var(--border-color, #333)",paddingBottom:4,marginBottom:8},children:x.jsx("strong",{children:"Top Components"})}),n.map(d=>x.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[x.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:d.componentName}),x.jsx("span",{style:{color:d.avgRenderTime>16?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"},children:G(d.avgRenderTime)}),x.jsxs("span",{style:{color:"var(--text-muted, #64748b)",minWidth:30,textAlign:"right"},children:["x",d.renderCount]})]},d.componentName)),x.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[x.jsx("button",{onClick:St,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Print Report"}),x.jsx("button",{onClick:bt,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});_r.displayName="ProfilerOverlay";function Ec(){zr&&(window.__NICE2DEV_PROFILER__={getStats:Pr,getComponentStats:Fr,getSlowRenders:vt,printReport:St,clear:bt,saveBaseline:Br,checkRegression:Or,configure:Dr},console.log("%c[Nice2Dev Profiler] DevTools integration ready. Use __NICE2DEV_PROFILER__ in console.","color: var(--nice-info, #6366f1)"))}const xt=process.env.NODE_ENV==="development";let j={enabled:xt,logToConsole:!0,samplingRate:1,trackDetachedNodes:!1,closureSizeThreshold:1024*1024};const We=[],ze=new Map,Ke=new Map,Vt=new WeakMap;let Nc=1;function Lc(){return Math.random()<(j.samplingRate??1)}function Ve(){var e;try{throw new Error}catch(t){return((e=t.stack)==null?void 0:e.split(`
|
|
39
39
|
`).slice(3).join(`
|
|
40
40
|
`))??""}}function Je(e,t,r){return`${e.__ntd_id??Math.random()}-${t}-${r.toString().slice(0,50)}`}function ae(e,t,r="warning",a,n){var i,o;if(!j.enabled||!Lc()||a&&((i=j.ignoreComponents)!=null&&i.includes(a)))return;const s={id:`leak-${Nc++}`,type:e,severity:r,componentName:a,message:t,stack:Ve(),timestamp:Date.now(),data:n};We.push(s),j.logToConsole&&console[r==="critical"?"error":r==="warning"?"warn":"info"](`%c[NTD Leak Detector] ${e}`,`color: ${r==="critical"?"var(--color-error, #dc2626)":r==="warning"?"var(--color-warning, #f59e0b)":"var(--color-primary, #3b82f6)"}; font-weight: bold`,t,a?`(${a})`:"",""),(o=j.onLeak)==null||o.call(j,s)}function Tc(e){j={...j,...e}}function Rc(){return[...We]}function Ic(){We.length=0}function Wr(){return We.reduce((e,t)=>(e[t.type]=(e[t.type]||0)+1,e),{})}function zc(e,t){const[r,a]=c.useState(e),n=c.useRef(!0),s=c.useRef(t);c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]);const i=c.useCallback(o=>{n.current?a(o):j.enabled&&ae("setState-after-unmount","setState called on unmounted component","warning",s.current)},[]);return[r,i]}function Dc(e){const t=c.useRef(null),r=c.useRef(e),a=c.useCallback(()=>{t.current&&(clearTimeout(t.current),j.enabled&&ze.delete(t.current),t.current=null)},[]),n=c.useCallback((s,i)=>{a(),t.current=setTimeout(s,i),j.enabled&&ze.set(t.current,{id:t.current,type:"timeout",componentName:r.current,stack:Ve(),createdAt:Date.now()})},[a]);return c.useEffect(()=>{const s=r.current;return()=>{t.current&&(j.enabled&&ae("timer-not-cleared","Timeout would have leaked without cleanup","info",s),a())}},[a]),[n,a]}function Pc(e){const t=c.useRef(null),r=c.useRef(e),a=c.useCallback(()=>{t.current&&(clearInterval(t.current),j.enabled&&ze.delete(t.current),t.current=null)},[]),n=c.useCallback((s,i)=>{a(),t.current=setInterval(s,i),j.enabled&&ze.set(t.current,{id:t.current,type:"interval",componentName:r.current,stack:Ve(),createdAt:Date.now()})},[a]);return c.useEffect(()=>{const s=r.current;return()=>{t.current&&(j.enabled&&ae("timer-not-cleared","Interval would have leaked without cleanup","warning",s),a())}},[a]),[n,a]}function Fc(e){const t=c.useRef([]),r=c.useRef(e);return c.useEffect(()=>{const a=t.current,n=r.current;return()=>{for(const{target:s,type:i,listener:o,options:l}of a)if(s.removeEventListener(i,o,l),j.enabled){const d=Je(s,i,o);Ke.delete(d)}a.length>0&&j.enabled&&ae("listener-not-removed",`${a.length} event listener(s) would have leaked without cleanup`,"info",n),t.current=[]}},[]),c.useCallback((a,n,s,i)=>{if(a.addEventListener(n,s,i),t.current.push({target:a,type:n,listener:s,options:i}),j.enabled){const o=Je(a,n,s);Ke.set(o,{target:a,type:n,listener:s,componentName:r.current,stack:Ve(),createdAt:Date.now()})}return()=>{if(a.removeEventListener(n,s,i),t.current=t.current.filter(o=>o.target!==a||o.type!==n||o.listener!==s),j.enabled){const o=Je(a,n,s);Ke.delete(o)}}},[])}function Vr(e){const t=c.useRef(null),r=c.useRef(e);return c.useEffect(()=>{const a=r.current;return()=>{t.current&&!t.current.signal.aborted&&(t.current.abort(),j.enabled&&ae("abort-controller-not-aborted","AbortController was auto-aborted on unmount (fetch may have leaked)","info",a))}},[]),c.useCallback(()=>(t.current&&t.current.abort(),t.current=new AbortController,t.current.signal),[])}function Hc(e){const t=Vr(e);return c.useCallback((r,a)=>{const n=t();return fetch(r,{...a,signal:n})},[t])}function $c(e){const t=c.useRef([]),r=c.useRef(e);return c.useEffect(()=>{const a=t.current,n=r.current;return()=>{for(const s of a)try{s()}catch(i){console.error("Error during subscription cleanup:",i)}a.length>0&&j.enabled&&ae("subscription-not-unsubscribed",`${a.length} subscription(s) would have leaked without cleanup`,"info",n),t.current=[]}},[]),c.useCallback(a=>{typeof a=="function"?t.current.push(a):a&&typeof a.unsubscribe=="function"&&t.current.push(()=>a.unsubscribe())},[])}function jc(e,t,r){const[a,n]=c.useState(null),[s,i]=c.useState(WebSocket.CLOSED),o=c.useRef(r);c.useEffect(()=>{if(!e)return;const u=new WebSocket(e,t);n(u);const f=o.current;return u.onopen=()=>i(u.readyState),u.onclose=()=>i(u.readyState),u.onerror=()=>i(u.readyState),()=>{(u.readyState===WebSocket.OPEN||u.readyState===WebSocket.CONNECTING)&&(u.close(),j.enabled&&ae("websocket-not-closed","WebSocket was auto-closed on unmount","info",f))}},[e,t]);const l=c.useCallback(u=>{(a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(u)},[a]),d=c.useCallback((u,f)=>{a==null||a.close(u,f)},[a]);return{socket:a,readyState:s,send:l,close:d}}function Bc(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>{const s=c.useRef({});return c.useEffect(()=>{if(!j.enabled)return;const i=s.current;return Vt.set(i,{name:r,mountedAt:Date.now()}),()=>{Vt.delete(i)}},[]),x.jsx(e,{...n})};return a.displayName=`LeakTracked(${r})`,a}function Oc(e){const t=c.useRef(Date.now());c.useEffect(()=>{j.enabled&&j.logToConsole&&console.log(`%c[NTD] ${e} mounted`,"color: var(--nice-success, #22c55e)");const r=t.current;return()=>{if(j.enabled&&j.logToConsole){const a=Date.now()-r;console.log(`%c[NTD] ${e} unmounted (lifetime: ${a}ms)`,"color: var(--nice-warning, #f59e0b)")}}},[e])}async function _c(e){if(!xt)return;const t=window.performance;if(t.memory){const r=t.memory;console.log(`%c[Memory Snapshot${e?`: ${e}`:""}]`,"color: var(--nice-info, #6366f1); font-weight: bold",{usedJSHeapSize:`${(r.usedJSHeapSize/1024/1024).toFixed(2)} MB`,totalJSHeapSize:`${(r.totalJSHeapSize/1024/1024).toFixed(2)} MB`,jsHeapSizeLimit:`${(r.jsHeapSizeLimit/1024/1024).toFixed(2)} MB`})}console.log("%cTip: Use Chrome DevTools Memory tab for detailed heap snapshots","color: var(--nice-text-secondary, #64748b); font-style: italic")}function Wc(){xt&&(window.gc?(window.gc(),console.log("%c[GC] Forced garbage collection","color: var(--nice-success, #22c55e)")):console.log("%c[GC] gc() not available. Run Chrome with --expose-gc flag","color: var(--nice-warning, #f59e0b)"))}function Vc(e=5e3,t=100){const[r,a]=c.useState({usedMB:0,totalMB:0,limitMB:0,isWarning:!1});return c.useEffect(()=>{const n=window.performance;if(!n.memory)return;const s=()=>{const o=n.memory;if(!o)return;const l=o.usedJSHeapSize/1024/1024,d=o.totalJSHeapSize/1024/1024,u=o.jsHeapSizeLimit/1024/1024,f=l>t;a({usedMB:l,totalMB:d,limitMB:u,isWarning:f}),f&&j.enabled&&ae("large-closure",`Memory usage exceeded ${t}MB (${l.toFixed(2)}MB)`,"warning")};s();const i=setInterval(s,e);return()=>clearInterval(i)},[e,t]),r}const Xr=()=>{const e=c.useMemo(()=>Wr(),[]),t=Object.values(e).reduce((r,a)=>r+a,0);return!j.enabled||t===0,null};Xr.displayName="NiceLeakDetectorStatus";function Xc(e){const t=()=>{var r;(r=e.queryClient)==null||r.invalidateQueries({queryKey:e.queryKey})};return{load:r=>e.queryFn(r),insert:e.mutationFn?async r=>{const a=await e.mutationFn(r);return t(),a}:void 0,update:e.updateMutationFn?async(r,a)=>{const n=await e.updateMutationFn({key:r,values:a});return t(),n}:void 0,remove:e.deleteMutationFn?async r=>{await e.deleteMutationFn(r),t()}:void 0}}function Uc(e,t){return{load:async()=>t.getData(e.getState()),insert:t.addItem?async r=>{const a=e.getState();return t.addItem(a)(r),r}:void 0,update:t.updateItem?async(r,a)=>{const n=e.getState();return t.updateItem(n)(r,a),{...a}}:void 0,remove:t.removeItem?async r=>{const a=e.getState();t.removeItem(a)(r)}:void 0}}function qc(e={}){const t=e.actionPrefix??"nice";return r=>a=>n=>{const s=a(n);if(n.type.startsWith(`${t}/grid/`)){const o=n.type.split("/")[2];o&&e.onGridStateChange&&e.onGridStateChange(o,n.payload)}if(n.type.startsWith(`${t}/form/`)){const o=n.type.split("/")[2];o&&e.onFormStateChange&&e.onFormStateChange(o,n.payload)}return s}}function Gc(e="nice"){return{setGridState:(t,r)=>({type:`${e}/grid/${t}/setState`,payload:r}),setGridFilter:(t,r)=>({type:`${e}/grid/${t}/setFilter`,payload:r}),setGridSort:(t,r)=>({type:`${e}/grid/${t}/setSort`,payload:r}),setFormValues:(t,r)=>({type:`${e}/form/${t}/setValues`,payload:r}),resetForm:t=>({type:`${e}/form/${t}/reset`})}}function Kc(e="nice"){return(t={},r)=>{if(!r.type.startsWith(`${e}/`))return t;const a=r.type.split("/"),[,n,s,i]=a;if(!n||!s)return t;const o=`${n}/${s}`;switch(i){case"setState":return{...t,[o]:{...t[o]??{},...r.payload}};case"setFilter":case"setSort":case"setValues":return{...t,[o]:{...t[o]??{},[i]:r.payload}};case"reset":return{...t,[o]:{}};default:return t}}}function Jc(e){let t=null,r=[];return{load:async()=>{if(r.length>0)return r;const s=await e.queryFn();return r=s,s},subscribe:()=>(t=new WebSocket(e.url,"graphql-ws"),t.onopen=()=>{t.send(JSON.stringify({type:"connection_init",payload:e.connectionParams??{}})),t.send(JSON.stringify({type:"start",id:"1",payload:{query:e.query,variables:e.variables}}))},t.onmessage=s=>{var i,o;try{const l=JSON.parse(s.data);l.type==="data"&&((i=l.payload)!=null&&i.data)&&(r=(e.extractData??(u=>{const f=u,p=Object.keys(f)[0];return p?f[p]:[]}))(l.payload.data),(o=e.onData)==null||o.call(e,r))}catch{}},()=>{t==null||t.close(),t=null}),unsubscribe:()=>{t==null||t.close(),t=null}}}async function Yc(e,t){var d;const r=await fetch(e);if(!r.ok)throw new Error(`OpenAPI fetch failed: ${r.status}`);const a=await r.json(),s=(((d=a.components)==null?void 0:d.schemas)??a.definitions??{})[t];if(!s)throw new Error(`Schema "${t}" not found in OpenAPI spec`);const i=new Set(s.required??[]),o=[],l=[];for(const[u,f]of Object.entries(s.properties??{})){const p=wt(f),h=f.title??kt(u);o.push({dataField:u,caption:h,dataType:p,allowEditing:!f.readOnly,visible:!u.toLowerCase().endsWith("id")||u==="id",...f.enum?{lookup:{dataSource:f.enum,valueExpr:"this",displayExpr:"this"}}:{}}),l.push({dataField:u,label:h,editorType:Ur(f,p),isRequired:i.has(u),editorOptions:qr(f),...i.has(u)?{validationRules:[{type:"required",message:`${h} jest wymagane`}]}:{}})}return{columns:o,formFields:l,schema:s}}function Qc(e){const t=[];for(const[r,a]of Object.entries(e.properties??{}))t.push({dataField:r,caption:a.title??kt(r),dataType:wt(a),allowEditing:!a.readOnly});return t}function Zc(e){const t=new Set(e.required??[]),r=[];for(const[a,n]of Object.entries(e.properties??{})){const s=wt(n);r.push({dataField:a,label:n.title??kt(a),editorType:Ur(n,s),isRequired:t.has(a),editorOptions:qr(n)})}return r}function wt(e){return e.type==="integer"||e.type==="number"?"number":e.type==="boolean"?"boolean":e.format==="date"?"date":e.format==="date-time"?"datetime":e.type==="object"||e.type==="array"?"object":"string"}function Ur(e,t){return e.enum?"NiceSelect":e.format==="email"||e.format==="uri"||e.format==="url"?"NiceTextInput":e.format==="password"?"NicePasswordInput":t==="number"?"NiceNumberInput":t==="boolean"?"NiceToggle":t==="date"||t==="datetime"?"NiceDateTimePicker":e.maxLength&&e.maxLength>200?"NiceTextArea":"NiceTextInput"}function qr(e){const t={};return e.minimum!==void 0&&(t.min=e.minimum),e.maximum!==void 0&&(t.max=e.maximum),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),e.pattern&&(t.pattern=e.pattern),e.enum&&(t.items=e.enum.map(r=>({label:r,value:r}))),e.description&&(t.hint=e.description),Object.keys(t).length>0?t:{}}function kt(e){return e.replace(/([A-Z])/g," $1").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}const Gr={enabled:!0,defaultExpanded:!1,showHelpIcon:!0,position:"tooltip",locale:"en"},el=async(e,t)=>{try{return null}catch{return null}},Kr=c.createContext(null),Jr=({children:e,config:t,helpContent:r})=>{const[a,n]=c.useState({...Gr,...t}),[s,i]=c.useState(new Set),[o,l]=c.useState(()=>new Map(Object.entries(r||{}))),d=c.useCallback(g=>{n(v=>({...v,...g}))},[]),u=c.useCallback(()=>{n(g=>({...g,enabled:!g.enabled}))},[]),f=c.useCallback(g=>{i(v=>new Set(v).add(g))},[]),p=c.useCallback(g=>{i(v=>{const b=new Set(v);return b.delete(g),b})},[]),h=c.useCallback(g=>a.enabled&&!s.has(g),[a.enabled,s]),m=c.useCallback(async g=>{if(o.has(g))return o.get(g)||null;const b=await(a.contentLoader||el)(g,a.locale);return b&&l(S=>new Map(S).set(g,b)),b},[o,a.contentLoader,a.locale]),y=c.useMemo(()=>({config:a,setConfig:d,toggleGlobalHelp:u,disabledComponents:s,disableComponentHelp:f,enableComponentHelp:p,isHelpEnabled:h,getHelpContent:m,helpCache:o}),[a,d,u,s,f,p,h,m,o]);return x.jsx(Kr.Provider,{value:y,children:e})};Jr.displayName="NiceHelpProvider";function Yr(){const e=c.useContext(Kr);return e||{config:Gr,setConfig:()=>{},toggleGlobalHelp:()=>{},disabledComponents:new Set,disableComponentHelp:()=>{},enableComponentHelp:()=>{},isHelpEnabled:()=>!0,getHelpContent:async()=>null,helpCache:new Map}}function Qr(e){const{isHelpEnabled:t,getHelpContent:r,helpCache:a,config:n}=Yr(),[s,i]=c.useState(a.get(e)||null),[o,l]=c.useState(!1),d=t(e),u=c.useCallback(async()=>{if(!d)return;l(!0);const f=await r(e);i(f),l(!1)},[d,e,r]);return{content:s,loading:o,enabled:d,loadContent:u,position:n.position,defaultExpanded:n.defaultExpanded,showHelpIcon:n.showHelpIcon}}const Zr=({props:e,compact:t})=>{const{t:r}=V.useNiceTranslation();return!e||e.length===0?null:t?x.jsxs("div",{className:"nice-help__props-compact",children:[e.slice(0,5).map(a=>x.jsxs("div",{className:"nice-help__prop-chip",children:[x.jsx("code",{children:a.name}),a.required&&x.jsx("span",{className:"nice-help__required",children:"*"})]},a.name)),e.length>5&&x.jsxs("span",{className:"nice-help__more",children:["+",e.length-5," ",r("help.moreProps","more")]})]}):x.jsxs("div",{className:"nice-help__props",children:[x.jsx("h4",{className:"nice-help__section-title",children:r("help.props","Properties")}),x.jsxs("table",{className:"nice-help__props-table",children:[x.jsx("thead",{children:x.jsxs("tr",{children:[x.jsx("th",{children:r("help.propName","Name")}),x.jsx("th",{children:r("help.propType","Type")}),x.jsx("th",{children:r("help.propDefault","Default")}),x.jsx("th",{children:r("help.propDescription","Description")})]})}),x.jsx("tbody",{children:e.map(a=>x.jsxs("tr",{children:[x.jsxs("td",{children:[x.jsx("code",{children:a.name}),a.required&&x.jsx("span",{className:"nice-help__required",title:r("help.required","Required"),children:"*"})]}),x.jsx("td",{children:x.jsx("code",{className:"nice-help__type",children:a.type})}),x.jsx("td",{children:a.default!==void 0?x.jsx("code",{children:String(a.default)}):"—"}),x.jsx("td",{children:a.description})]},a.name))})]})]})},rt=({tips:e})=>{const{t}=V.useNiceTranslation();return!e||e.length===0?null:x.jsxs("div",{className:"nice-help__tips",children:[x.jsx("h4",{className:"nice-help__section-title",children:t("help.tips","Tips")}),x.jsx("ul",{children:e.map((r,a)=>x.jsxs("li",{children:[x.jsx("span",{className:"nice-help__tip-icon",children:"💡"}),r]},a))})]})},tl=({examples:e})=>{var n,s;const{t}=V.useNiceTranslation(),[r,a]=c.useState(0);return!e||e.length===0?null:x.jsxs("div",{className:"nice-help__examples",children:[x.jsx("h4",{className:"nice-help__section-title",children:t("help.examples","Examples")}),e.length>1&&x.jsx("div",{className:"nice-help__example-tabs",children:e.map((i,o)=>x.jsx("button",{className:`nice-help__example-tab ${r===o?"nice-help__example-tab--active":""}`,onClick:()=>a(o),children:i.title},o))}),x.jsx("pre",{className:"nice-help__code",children:x.jsx("code",{className:`language-${((n=e[r])==null?void 0:n.language)||"tsx"}`,children:(s=e[r])==null?void 0:s.code})})]})},ea=({componentName:e,content:t,children:r,position:a,defaultExpanded:n,disabled:s=!1,className:i,icon:o,title:l,showProps:d=!0,showExamples:u=!1,showTips:f=!0,compact:p=!1})=>{const{t:h}=V.useNiceTranslation(),{content:m,loading:y,enabled:g,loadContent:v,position:b,defaultExpanded:S,showHelpIcon:w}=Qr(e),A=t||m,k=a||b,C=n??S,[M,N]=c.useState(C);return c.useEffect(()=>{g&&!t&&!m&&v()},[g,t,m,v]),s||!g?x.jsx(x.Fragment,{children:r}):k==="tooltip"?x.jsxs("div",{className:`nice-help-tooltip-wrapper ${i||""}`,children:[r,w&&A&&x.jsx("button",{className:"nice-help__trigger",onClick:()=>N(!M),"aria-label":h("help.toggle","Toggle help"),"aria-expanded":M,children:o||x.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",children:x.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})})}),M&&A&&x.jsx("div",{className:"nice-help__tooltip",children:x.jsxs("div",{className:"nice-help__tooltip-content",children:[x.jsx("h3",{className:"nice-help__title",children:l||A.name}),x.jsx("p",{className:"nice-help__description",children:A.description}),f&&A.tips&&x.jsx(rt,{tips:A.tips}),d&&A.props&&x.jsx(Zr,{props:A.props,compact:!0})]})})]}):x.jsxs("div",{className:`nice-help ${k==="bottom"?"nice-help--bottom":""} ${i||""}`,children:[k==="top"&&A&&x.jsx(Xt,{content:A,expanded:M,onToggle:()=>N(!M),loading:y,title:l,showProps:d,showExamples:u,showTips:f,compact:p}),r,k==="bottom"&&A&&x.jsx(Xt,{content:A,expanded:M,onToggle:()=>N(!M),loading:y,title:l,showProps:d,showExamples:u,showTips:f,compact:p}),k==="inline"&&A&&M&&x.jsxs("div",{className:"nice-help__inline",children:[x.jsx("p",{className:"nice-help__description",children:A.description}),f&&A.tips&&x.jsx(rt,{tips:A.tips})]})]})};ea.displayName="NiceInlineHelp";const Xt=({content:e,expanded:t,onToggle:r,loading:a,title:n,showProps:s,showExamples:i,showTips:o,compact:l})=>{const{t:d}=V.useNiceTranslation();return a?x.jsx("div",{className:"nice-help__panel nice-help__panel--loading",children:x.jsx("div",{className:"nice-spinner nice-spinner--sm"})}):x.jsxs("div",{className:`nice-help__panel ${t?"nice-help__panel--expanded":""}`,children:[x.jsxs("button",{className:"nice-help__panel-header",onClick:r,"aria-expanded":t,children:[x.jsx("span",{className:"nice-help__panel-icon",children:t?"▾":"▸"}),x.jsxs("span",{className:"nice-help__panel-title",children:[n||d("help.about","About")," ",e.name]}),e.status&&x.jsx("span",{className:`nice-help__status nice-help__status--${e.status}`,children:e.status})]}),t&&x.jsxs("div",{className:"nice-help__panel-content",children:[x.jsx("p",{className:"nice-help__description",children:e.description}),o&&e.tips&&x.jsx(rt,{tips:e.tips}),s&&e.props&&x.jsx(Zr,{props:e.props,compact:l}),i&&e.examples&&x.jsx(tl,{examples:e.examples}),e.seeAlso&&e.seeAlso.length>0&&x.jsxs("div",{className:"nice-help__see-also",children:[x.jsx("h4",{className:"nice-help__section-title",children:d("help.seeAlso","See Also")}),x.jsx("ul",{children:e.seeAlso.map((u,f)=>x.jsx("li",{children:x.jsx("code",{children:u})},f))})]})]})]})},ta=({text:e,position:t="top",className:r,children:a})=>{const[n,s]=c.useState(!1);return x.jsxs("span",{className:`nice-quick-help nice-quick-help--${t} ${r||""}`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onFocus:()=>s(!0),onBlur:()=>s(!1),children:[a,n&&x.jsx("span",{className:"nice-quick-help__popup",role:"tooltip",children:e})]})};ta.displayName="NiceQuickHelp";const ra=({content:e,size:t="sm",className:r,onOpen:a})=>{const{t:n}=V.useNiceTranslation(),[s,i]=c.useState(!1),o=c.useCallback(()=>{i(!s),!s&&a&&a()},[s,a]),l=typeof e=="string"?e:e.description,d=typeof e=="string"?void 0:e.name;return x.jsxs("span",{className:`nice-help-icon nice-help-icon--${t} ${r||""}`,children:[x.jsx("button",{className:"nice-help-icon__btn",onClick:o,"aria-label":n("help.showHelp","Show help"),"aria-expanded":s,children:x.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:x.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})})}),s&&x.jsxs("div",{className:"nice-help-icon__popup",children:[d&&x.jsx("strong",{children:d}),x.jsx("p",{children:l}),x.jsx("button",{className:"nice-help-icon__close",onClick:()=>i(!1),children:"×"})]})]})};ra.displayName="NiceHelpIcon";const Mt=c.createContext({enabled:!0,active:!1,run:()=>{}}),rl=({enabled:e=!0,active:t=!1,onRun:r,children:a})=>{const n=c.useMemo(()=>({enabled:e,active:t,run:r??(()=>{})}),[e,t,r]);return x.jsx(Mt.Provider,{value:n,children:a})};function aa(){return c.useContext(Mt)}function al(){return c.useContext(Mt).enabled}function nl(e,t){if(!e)return null;if(e===!0)return t&&t.length>0?t:null;if(Array.isArray(e))return e.length>0?e:null;const r=e.steps??t;return r&&r.length>0?r:null}function na(e,t){return e.map(r=>({target:r.target,title:r.titleKey?t(r.titleKey,r.title??""):r.title??"",content:r.contentKey?t(r.contentKey,r.content??""):r.content??"",placement:r.placement,highlightPadding:r.highlightPadding,showArrow:r.showArrow,scrollIntoView:r.scrollIntoView,disableInteraction:r.disableInteraction}))}const sl=({steps:e,autoStart:t,label:r,size:a="md",className:n,style:s,"data-testid":i})=>{const{enabled:o,run:l}=aa(),{t:d}=V.useNiceTranslation();if(!o||!e||e.length===0)return null;const u=r??d("tutorial.startAria","Start tutorial");return x.jsx("button",{type:"button",className:`nice-tutorial-button nice-tutorial-button--${a}`+(n?` ${n}`:""),style:s,"data-testid":i,"aria-label":u,title:u,onClick:()=>l(na(e,d),{autoStart:t}),children:"?"})},Ut="nice-tutorial-button-styles";if(typeof document<"u"&&!document.getElementById(Ut)){const e=document.createElement("style");e.id=Ut,e.textContent=`
|
|
41
41
|
.nice-tutorial-button {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
.nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
|
|
65
65
|
.nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
|
|
66
|
-
`,document.head.appendChild(e)}class sa{constructor(t="ntd-user-preferences"){this.key=t}async load(){try{const t=localStorage.getItem(this.key);return t?JSON.parse(t):null}catch{return null}}async save(t){localStorage.setItem(this.key,JSON.stringify(t))}async clear(){localStorage.removeItem(this.key)}}class ol{constructor(t="ntd-preferences",r="preferences"){this.db=null,this.dbName=t,this.storeName=r}async getDB(){return this.db?this.db:new Promise((t,r)=>{const a=indexedDB.open(this.dbName,1);a.onerror=()=>r(a.error),a.onsuccess=()=>{this.db=a.result,t(this.db)},a.onupgradeneeded=n=>{const s=n.target.result;s.objectStoreNames.contains(this.storeName)||s.createObjectStore(this.storeName,{keyPath:"id"})}})}async load(){const t=await this.getDB();return new Promise((r,a)=>{const i=t.transaction(this.storeName,"readonly").objectStore(this.storeName).get("user-preferences");i.onerror=()=>a(i.error),i.onsuccess=()=>{var o;return r(((o=i.result)==null?void 0:o.data)||null)}})}async save(t){const r=await this.getDB();return new Promise((a,n)=>{const o=r.transaction(this.storeName,"readwrite").objectStore(this.storeName).put({id:"user-preferences",data:t});o.onerror=()=>n(o.error),o.onsuccess=()=>a()})}async clear(){const t=await this.getDB();return new Promise((r,a)=>{const i=t.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete("user-preferences");i.onerror=()=>a(i.error),i.onsuccess=()=>r()})}}class il{constructor(t,r){this.baseUrl=t,this.getAuthHeaders=r}getHeaders(){var t;return{"Content-Type":"application/json",...((t=this.getAuthHeaders)==null?void 0:t.call(this))||{}}}async fetch(){const t=await fetch(`${this.baseUrl}/preferences`,{method:"GET",headers:this.getHeaders()});if(!t.ok){if(t.status===404)return null;throw new Error(`Failed to fetch preferences: ${t.statusText}`)}return t.json()}async push(t){const r=await fetch(`${this.baseUrl}/preferences`,{method:"PUT",headers:this.getHeaders(),body:JSON.stringify(t)});if(!r.ok)throw new Error(`Failed to save preferences: ${r.statusText}`)}async getServerTimestamp(){const t=await fetch(`${this.baseUrl}/preferences/timestamp`,{method:"GET",headers:this.getHeaders()});return t.ok&&(await t.json()).timestamp||0}}const oa=c.createContext(null);function Ct(){const e=c.useContext(oa);if(!e)throw new Error("useUserPreferences must be used within NiceUserPreferencesProvider");return e}function At(e,t){const{getControlPreferences:r,setControlPreferences:a,updateControlPreferences:n}=Ct(),s=r(e,t),i=c.useCallback(l=>a(e,t,l),[e,t,a]),o=c.useCallback(l=>n(e,t,l),[e,t,n]);return[s,i,o]}function cl(e){return At(e,"grid")}function ll(e){return At(e,"chart")}const qt={version:1,global:{},controls:{}};function dl({storage:e=new sa,syncAdapter:t,autoSyncInterval:r=0,saveDebounce:a=500,children:n}){const[s,i]=c.useState(qt),[o,l]=c.useState(!0),[d,u]=c.useState(!1),[f,p]=c.useState(null),h=c.useRef(),m=c.useRef();c.useEffect(()=>{let E=!0;return(async()=>{try{const T=await e.load();E&&T&&i(T)}catch(T){E&&p(T instanceof Error?T:new Error("Failed to load preferences"))}finally{E&&l(!1)}})(),()=>{E=!1}},[e]);const y=c.useCallback(E=>{h.current&&clearTimeout(h.current),h.current=setTimeout(async()=>{try{await e.save(E)}catch(R){p(R instanceof Error?R:new Error("Failed to save preferences"))}},a)},[e,a]);c.useEffect(()=>{o||y(s)},[s,o,y]),c.useEffect(()=>{if(t&&r>0)return m.current=setInterval(()=>{k()},r),()=>{m.current&&clearInterval(m.current)}},[t,r]),c.useEffect(()=>()=>{h.current&&clearTimeout(h.current),m.current&&clearInterval(m.current)},[]);const g=c.useCallback((E,R)=>{var T;return(T=s.controls[E])==null?void 0:T[R]},[s]),v=c.useCallback((E,R,T)=>{i(D=>({...D,controls:{...D.controls,[E]:{...D.controls[E],[R]:T,lastModified:Date.now()}}}))},[]),b=c.useCallback((E,R,T)=>{i(D=>{var H;const F=(H=D.controls[E])==null?void 0:H[R],z=typeof F=="object"&&F!==null?{...F,...T}:T;return{...D,controls:{...D.controls,[E]:{...D.controls[E],[R]:z,lastModified:Date.now()}}}})},[]),S=c.useCallback((E,R)=>{i(T=>{if(R){const{[R]:z,...H}=T.controls[E]||{};return{...T,controls:{...T.controls,[E]:H}}}const{[E]:D,...F}=T.controls;return{...T,controls:F}})},[]),w=c.useCallback(E=>s.global[E],[s]),A=c.useCallback((E,R)=>{i(T=>({...T,global:{...T.global,[E]:R}}))},[]),k=c.useCallback(async()=>{if(t){u(!0),p(null);try{const E=await t.getServerTimestamp(),R=s.lastSync||0;if(E>R){const T=await t.fetch();T&&(i({...T,lastSync:Date.now()}),await e.save(T))}else{const T={...s,lastSync:Date.now()};await t.push(T),i(T)}}catch(E){p(E instanceof Error?E:new Error("Sync failed"))}finally{u(!1)}}},[t,s,e]),C=c.useCallback(()=>JSON.stringify(s,null,2),[s]),M=c.useCallback(E=>{try{const R=JSON.parse(E);if(typeof R.version!="number"||!R.controls)throw new Error("Invalid preferences format");i(R)}catch(R){p(R instanceof Error?R:new Error("Import failed"))}},[]),N=c.useCallback(()=>{i(qt),e.clear()},[e]),L=c.useMemo(()=>({preferences:s,isLoading:o,isSyncing:d,error:f,getControlPreferences:g,setControlPreferences:v,updateControlPreferences:b,clearControlPreferences:S,getGlobalPreferences:w,setGlobalPreferences:A,sync:k,exportPreferences:C,importPreferences:M,resetAllPreferences:N}),[s,o,d,f,g,v,b,S,w,A,k,C,M,N]);return x.jsx(oa.Provider,{value:L,children:n})}function ul({showGlobal:e=!0,showControls:t=!0,showExportImport:r=!0,showSync:a=!0,className:n,style:s}){var w,A,k,C;const{preferences:i,isLoading:o,isSyncing:l,error:d,sync:u,exportPreferences:f,importPreferences:p,resetAllPreferences:h,setGlobalPreferences:m,clearControlPreferences:y}=Ct(),g=c.useRef(null),v=()=>{const M=f(),N=new Blob([M],{type:"application/json"}),L=URL.createObjectURL(N),E=document.createElement("a");E.href=L,E.download="nice2dev-preferences.json",E.click(),URL.revokeObjectURL(L)},b=M=>{var E;const N=(E=M.target.files)==null?void 0:E[0];if(!N)return;const L=new FileReader;L.onload=()=>{p(L.result)},L.readAsText(N)};if(o)return x.jsx("div",{className:n,style:s,children:"Loading preferences..."});const S=Object.keys(i.controls);return x.jsxs("div",{className:`ntd-preferences-panel ${n||""}`,style:{fontFamily:"system-ui, sans-serif",fontSize:"14px",padding:"16px",...s},children:[d&&x.jsx("div",{style:{padding:"12px",marginBottom:"16px",background:"var(--danger-bg, #fef2f2)",border:"1px solid var(--nice-danger-bg, #fecaca)",borderRadius:"6px",color:"var(--color-error, #dc2626)"},children:d.message}),x.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"20px",flexWrap:"wrap"},children:[a&&x.jsx("button",{onClick:u,disabled:l,style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:l?"wait":"pointer"},children:l?"Syncing...":"Sync"}),r&&x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:v,style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Export"}),x.jsx("button",{onClick:()=>{var M;return(M=g.current)==null?void 0:M.click()},style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Import"}),x.jsx("input",{ref:g,type:"file",accept:".json",onChange:b,style:{display:"none"}})]}),x.jsx("button",{onClick:h,style:{padding:"8px 16px",border:"1px solid var(--nice-danger-dark, #dc2626)",borderRadius:"6px",background:"var(--danger-bg, #fef2f2)",color:"var(--color-error, #dc2626)",cursor:"pointer",marginLeft:"auto"},children:"Reset All"})]}),e&&x.jsxs("div",{style:{marginBottom:"24px"},children:[x.jsx("h3",{style:{margin:"0 0 12px",fontSize:"16px",fontWeight:600},children:"Global Preferences"}),x.jsxs("div",{style:{display:"grid",gap:"12px"},children:[x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x.jsx("input",{type:"checkbox",checked:((w=i.global.display)==null?void 0:w.reducedMotion)||!1,onChange:M=>m("display",{...i.global.display,reducedMotion:M.target.checked})}),"Reduced motion"]}),x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x.jsx("input",{type:"checkbox",checked:((A=i.global.display)==null?void 0:A.highContrast)||!1,onChange:M=>m("display",{...i.global.display,highContrast:M.target.checked})}),"High contrast"]}),x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:["Font scale:",x.jsx("input",{type:"range",min:"0.8",max:"1.5",step:"0.1",value:((k=i.global.display)==null?void 0:k.fontScale)||1,onChange:M=>m("display",{...i.global.display,fontScale:parseFloat(M.target.value)}),style:{flex:1}}),x.jsxs("span",{children:[((((C=i.global.display)==null?void 0:C.fontScale)||1)*100).toFixed(0),"%"]})]})]})]}),t&&S.length>0&&x.jsxs("div",{children:[x.jsxs("h3",{style:{margin:"0 0 12px",fontSize:"16px",fontWeight:600},children:["Control Preferences (",S.length,")"]}),x.jsx("div",{style:{display:"grid",gap:"8px"},children:S.map(M=>{const N=i.controls[M],L=Object.keys(N).filter(E=>E!=="lastModified");return x.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",background:"var(--bg-secondary, #f9fafb)",borderRadius:"6px"},children:[x.jsxs("div",{children:[x.jsx("div",{style:{fontWeight:500},children:M}),x.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted, #6b7280)"},children:L.join(", ")})]}),x.jsx("button",{onClick:()=>y(M),style:{padding:"4px 8px",border:"none",borderRadius:"4px",background:"var(--border-color, #e5e7eb)",cursor:"pointer",fontSize:"12px"},children:"Clear"})]},M)})})]}),t&&S.length===0&&x.jsx("div",{style:{color:"var(--text-muted, #6b7280)",fontStyle:"italic"},children:"No control preferences saved yet."})]})}const fl={cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",source:"default",requiresConsentBanner:!1,resolvedAt:Date.now(),version:"1.0.0"},ia={traceless:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",requiresConsentBanner:!1},ephemeral:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"ephemeral",requiresConsentBanner:!1},private:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!0,strictAuthCookieOnly:!0,effectiveMode:"private",requiresConsentBanner:!1},balanced:{cookiesAllowed:!1,localStorageAllowed:!0,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"balanced",requiresConsentBanner:!0},full:{cookiesAllowed:!0,localStorageAllowed:!0,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"full",requiresConsentBanner:!0},custom:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"custom",requiresConsentBanner:!1}},fe=["traceless","ephemeral","private","balanced","full","custom"];function ml(e,t){const r=fe.indexOf(e),a=fe.indexOf(t);return r<=a?e:t}function Le(e,t){const r=fe.indexOf(e),a=fe.indexOf(t);return r<=a}function pl(e,t,r,a){let n=e.defaultMode,s="instance";t&&e.allowTenantOverride&&Le(t.mode,n)&&(n=t.mode,s="tenant"),r&&(t!=null&&t.allowGroupOverride)&&Le(r.mode,n)&&(n=r.mode,s="group"),a&&(t!=null&&t.allowUserOverride||r!=null&&r.allowUserLockdown)&&Le(a.preferredMode,n)&&(n=a.preferredMode,s="user");const i=ia[n],o={...i,cookiesAllowed:i.cookiesAllowed&&e.maxCookies,localStorageAllowed:i.localStorageAllowed&&e.maxLocalStorage,sessionStorageAllowed:i.sessionStorageAllowed&&e.maxSessionStorage,source:s,resolvedAt:Date.now(),version:"1.0.0"};return a&&(a.restrictCookies&&(o.cookiesAllowed=!1),a.restrictLocalStorage&&(o.localStorageAllowed=!1),a.restrictSessionStorage&&(o.sessionStorageAllowed=!1)),o.effectiveMode=Et(o),o.requiresConsentBanner=ca(o),o}function Et(e){const{cookiesAllowed:t,localStorageAllowed:r,sessionStorageAllowed:a,strictAuthCookieOnly:n}=e;return!t&&!r&&!a?"traceless":!t&&!r&&a&&!n?"ephemeral":!t&&!r&&a&&n?"private":!t&&r&&a?"balanced":t&&r&&a?"full":"custom"}function ca(e){return!e.cookiesAllowed&&!e.localStorageAllowed?!1:e.effectiveMode==="full"||e.effectiveMode==="balanced"}const la=new Map;class da{constructor(t,r="nice2dev",a="local"){this.policy=t,this.namespace=r,this.defaultBackend=a}getBackend(t){const r=t||this.defaultBackend;if(r==="local"&&this.policy.localStorageAllowed)try{if(typeof localStorage<"u")return localStorage}catch{}if((r==="session"||r==="local")&&this.policy.sessionStorageAllowed)try{if(typeof sessionStorage<"u")return sessionStorage}catch{}return la}getKey(t){return`${this.namespace}:${t}`}get(t,r){const a=this.getBackend(r),n=this.getKey(t);try{const s=a instanceof Map?a.get(n):a.getItem(n);if(s==null)return null;try{return JSON.parse(s)}catch{return s}}catch{return null}}set(t,r,a){const n=this.getBackend(a),s=this.getKey(t);try{const i=typeof r=="string"?r:JSON.stringify(r);return n instanceof Map?n.set(s,i):n.setItem(s,i),!0}catch{return!1}}remove(t,r){const a=this.getBackend(r),n=this.getKey(t);try{return a instanceof Map?a.delete(n):(a.removeItem(n),!0)}catch{return!1}}clear(t){const r=this.getBackend(t),a=`${this.namespace}:`;try{if(r instanceof Map)for(const n of r.keys())n.startsWith(a)&&r.delete(n);else{const n=[];for(let s=0;s<r.length;s++){const i=r.key(s);i&&i.startsWith(a)&&n.push(i)}n.forEach(s=>r.removeItem(s))}}catch{}}keys(t){const r=this.getBackend(t),a=`${this.namespace}:`,n=[];try{if(r instanceof Map)for(const s of r.keys())s.startsWith(a)&&n.push(s.slice(a.length));else for(let s=0;s<r.length;s++){const i=r.key(s);i&&i.startsWith(a)&&n.push(i.slice(a.length))}}catch{}return n}has(t,r){return this.get(t,r)!==null}getCapabilities(){return{canUseCookies:this.policy.cookiesAllowed,canUseLocalStorage:this.policy.localStorageAllowed,canUseSessionStorage:this.policy.sessionStorageAllowed,canPersist:this.policy.localStorageAllowed,effectiveMode:this.policy.effectiveMode,actualBackend:this.getActualBackendType()}}getActualBackendType(){const t=this.getBackend();return t instanceof Map?"memory":t===sessionStorage?"session":"local"}updatePolicy(t){this.policy=t}}function gl(e,t){const{cookies:r,localStorage:a,storageMode:n}=t,s={...e};if(n&&n!=="auto")switch(n){case"traceless":s.cookiesAllowed=!1,s.localStorageAllowed=!1,s.sessionStorageAllowed=!1;break;case"ephemeral":s.cookiesAllowed=!1,s.localStorageAllowed=!1;break}return r===!1&&(s.cookiesAllowed=!1),a===!1&&(s.localStorageAllowed=!1),s.effectiveMode=Et(s),s.source="control",s}function yl(e,t,r){return{generatedAt:new Date().toISOString(),instanceId:t,tenantId:r,effectiveMode:e.effectiveMode,cookies:{count:0,allowed:e.cookiesAllowed,strictAuthOnly:e.strictAuthCookieOnly,thirdParty:!1,tracking:!1},localStorage:{bytesUsed:0,allowed:e.localStorageAllowed,keysCount:0},sessionStorage:{bytesUsed:0,allowed:e.sessionStorageAllowed,keysCount:0},consentBanner:{required:e.requiresConsentBanner,shown:e.requiresConsentBanner},compliance:{ePrivacyCompliant:!e.cookiesAllowed||e.requiresConsentBanner,gdprCompliant:!0,pecrCompliant:!e.cookiesAllowed||e.requiresConsentBanner},statement:hl(e)}}function hl(e){return e.effectiveMode==="traceless"?"This OmniVerk instance operates in Traceless™ mode. No cookies are set (0), no data is saved to localStorage (0), and no sessionStorage is used (0). No cookie consent banner is required under ePrivacy Directive Art. 5(3) as no similar technologies are employed.":e.effectiveMode==="ephemeral"?"This OmniVerk instance operates in Ephemeral mode. No cookies are set, no localStorage is used. sessionStorage is used for session-only data that is automatically cleared when the browser tab is closed. No cookie consent banner is required.":e.effectiveMode==="private"?"This OmniVerk instance operates in Private mode. One strictly necessary httpOnly authentication cookie may be set. sessionStorage is used for session preferences. No consent banner is required as only strictly necessary technologies are used.":e.effectiveMode==="balanced"?"This OmniVerk instance operates in Balanced mode. localStorage is used for user preferences. sessionStorage is used for session data. No cookies are set. Depending on jurisdiction, a consent banner may be shown.":"This OmniVerk instance operates in Full mode. Cookies, localStorage, and sessionStorage are enabled. A consent banner is displayed to users before any non-essential storage is used."}function bl(e){const{effectiveMode:t}=e;switch(t){case"traceless":return{mode:"traceless",icon:"🟢",color:"var(--nice-success, #10b981)",label:"Traceless™",tooltip:"Your data is not stored on this device. Zero cookies, zero localStorage, zero traces.",cssClass:"nice-traceless-badge--traceless"};case"ephemeral":return{mode:"ephemeral",icon:"🔵",color:"var(--nice-primary, #3b82f6)",label:"Ephemeral",tooltip:"Session-only storage. Data is cleared when you close this tab.",cssClass:"nice-traceless-badge--ephemeral"};case"private":return{mode:"private",icon:"🟡",color:"var(--nice-warning, #eab308)",label:"Private",tooltip:"Minimal storage with one secure authentication cookie.",cssClass:"nice-traceless-badge--private"};case"balanced":return{mode:"balanced",icon:"🟠",color:"var(--nice-warning, #f97316)",label:"Balanced",tooltip:"Preferences are saved locally. No tracking cookies.",cssClass:"nice-traceless-badge--balanced"};case"full":return{mode:"full",icon:"🔴",color:"var(--nice-danger, #ef4444)",label:"Full",tooltip:"All storage enabled including analytics. You control what is stored via consent.",cssClass:"nice-traceless-badge--full"};case"custom":default:return{mode:"custom",icon:"⚪",color:"var(--nice-text-secondary, #6b7280)",label:"Custom",tooltip:"Custom storage configuration.",cssClass:"nice-traceless-badge--custom"}}}function vl(e,t){const r=e.localStorageAllowed,a=e.sessionStorageAllowed,s={preferences:{message:"Your preferences will reset when you close this tab.",key:"traceless.warning.preferences"},draft:{message:"Unsaved draft will be lost if you close or refresh this page.",key:"traceless.warning.draft"},history:{message:"Search history is not saved in this privacy mode.",key:"traceless.warning.history"},auth:{message:"You will need to log in again each time you visit.",key:"traceless.warning.auth"},"grid-state":{message:"Table settings (sorting, filtering, columns) will reset on page refresh.",key:"traceless.warning.gridState"}}[t];return!r&&!a?{canPersist:!1,canSession:!1,warningMessage:s.message,warningKey:s.key}:!r&&a?{canPersist:!1,canSession:!0,warningMessage:t!=="auth"?s.message:void 0,warningKey:t!=="auth"?s.key:void 0}:{canPersist:!0,canSession:!0}}const Sl="X-OmniVerk-Storage-Policy";function xl(e){const t=e.toLowerCase().trim();return fe.includes(t)?t:null}function wl(e){return e.effectiveMode}function kl(e,t){return new da(e,t)}function Ml(e){return{maxCookies:!1,maxLocalStorage:!1,maxSessionStorage:!0,defaultMode:"ephemeral",allowTenantOverride:!1,instanceId:e}}function Cl(e){return{maxCookies:!0,maxLocalStorage:!0,maxSessionStorage:!0,defaultMode:"balanced",allowTenantOverride:!0,instanceId:e}}function Al(){if(typeof document<"u"){const e=document.cookie.split(";");for(const t of e){const r=t.split("=")[0].trim();document.cookie=`${r}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`}}try{typeof localStorage<"u"&&localStorage.clear()}catch{}try{typeof sessionStorage<"u"&&sessionStorage.clear()}catch{}la.clear()}function El(e){const t=[];if(!e.cookiesAllowed&&typeof document<"u"){const r=document.cookie;r&&r.length>0&&t.push({type:"cookie",severity:"high",message:`Cookies found but not allowed: ${r.split(";").length} cookie(s)`,data:r})}if(!e.localStorageAllowed)try{typeof localStorage<"u"&&localStorage.length>0&&t.push({type:"localStorage",severity:"high",message:`localStorage has ${localStorage.length} item(s) but not allowed`})}catch{}if(!e.sessionStorageAllowed)try{typeof sessionStorage<"u"&&sessionStorage.length>0&&t.push({type:"sessionStorage",severity:"medium",message:`sessionStorage has ${sessionStorage.length} item(s) but not allowed`})}catch{}return{compliant:t.length===0,violations:t,auditedAt:Date.now(),policy:e.effectiveMode}}const ua=c.createContext(null),Nl=({config:e,children:t})=>{const[r,a]=c.useState(!1),[n,s]=c.useState(null),i=c.useRef(null);c.useEffect(()=>()=>{var m;(m=i.current)==null||m.abort()},[]);const o=c.useCallback(()=>{var m;(m=i.current)==null||m.abort(),i.current=null,a(!1)},[]),l=async(m,y,g)=>{var S,w,A,k,C,M;const v=new TextDecoder;let b="";for(;;){const{done:N,value:L}=await m.read();if(N)break;b+=v.decode(L,{stream:!0});const E=b.split(`
|
|
66
|
+
`,document.head.appendChild(e)}class sa{constructor(t="ntd-user-preferences"){this.key=t}async load(){try{const t=localStorage.getItem(this.key);return t?JSON.parse(t):null}catch{return null}}async save(t){localStorage.setItem(this.key,JSON.stringify(t))}async clear(){localStorage.removeItem(this.key)}}class ol{constructor(t="ntd-preferences",r="preferences"){this.db=null,this.dbName=t,this.storeName=r}async getDB(){return this.db?this.db:new Promise((t,r)=>{const a=indexedDB.open(this.dbName,1);a.onerror=()=>r(a.error),a.onsuccess=()=>{this.db=a.result,t(this.db)},a.onupgradeneeded=n=>{const s=n.target.result;s.objectStoreNames.contains(this.storeName)||s.createObjectStore(this.storeName,{keyPath:"id"})}})}async load(){const t=await this.getDB();return new Promise((r,a)=>{const i=t.transaction(this.storeName,"readonly").objectStore(this.storeName).get("user-preferences");i.onerror=()=>a(i.error),i.onsuccess=()=>{var o;return r(((o=i.result)==null?void 0:o.data)||null)}})}async save(t){const r=await this.getDB();return new Promise((a,n)=>{const o=r.transaction(this.storeName,"readwrite").objectStore(this.storeName).put({id:"user-preferences",data:t});o.onerror=()=>n(o.error),o.onsuccess=()=>a()})}async clear(){const t=await this.getDB();return new Promise((r,a)=>{const i=t.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete("user-preferences");i.onerror=()=>a(i.error),i.onsuccess=()=>r()})}}class il{constructor(t,r){this.baseUrl=t,this.getAuthHeaders=r}getHeaders(){var t;return{"Content-Type":"application/json",...((t=this.getAuthHeaders)==null?void 0:t.call(this))||{}}}async fetch(){const t=await fetch(`${this.baseUrl}/preferences`,{method:"GET",headers:this.getHeaders()});if(!t.ok){if(t.status===404)return null;throw new Error(`Failed to fetch preferences: ${t.statusText}`)}return t.json()}async push(t){const r=await fetch(`${this.baseUrl}/preferences`,{method:"PUT",headers:this.getHeaders(),body:JSON.stringify(t)});if(!r.ok)throw new Error(`Failed to save preferences: ${r.statusText}`)}async getServerTimestamp(){const t=await fetch(`${this.baseUrl}/preferences/timestamp`,{method:"GET",headers:this.getHeaders()});return t.ok&&(await t.json()).timestamp||0}}const oa=c.createContext(null);function Ct(){const e=c.useContext(oa);if(!e)throw new Error("useUserPreferences must be used within NiceUserPreferencesProvider");return e}function At(e,t){const{getControlPreferences:r,setControlPreferences:a,updateControlPreferences:n}=Ct(),s=r(e,t),i=c.useCallback(l=>a(e,t,l),[e,t,a]),o=c.useCallback(l=>n(e,t,l),[e,t,n]);return[s,i,o]}function cl(e){return At(e,"grid")}function ll(e){return At(e,"chart")}const qt={version:1,global:{},controls:{}};function dl({storage:e=new sa,syncAdapter:t,autoSyncInterval:r=0,saveDebounce:a=500,children:n}){const[s,i]=c.useState(qt),[o,l]=c.useState(!0),[d,u]=c.useState(!1),[f,p]=c.useState(null),h=c.useRef(void 0),m=c.useRef(void 0);c.useEffect(()=>{let E=!0;return(async()=>{try{const T=await e.load();E&&T&&i(T)}catch(T){E&&p(T instanceof Error?T:new Error("Failed to load preferences"))}finally{E&&l(!1)}})(),()=>{E=!1}},[e]);const y=c.useCallback(E=>{h.current&&clearTimeout(h.current),h.current=setTimeout(async()=>{try{await e.save(E)}catch(R){p(R instanceof Error?R:new Error("Failed to save preferences"))}},a)},[e,a]);c.useEffect(()=>{o||y(s)},[s,o,y]),c.useEffect(()=>{if(t&&r>0)return m.current=setInterval(()=>{k()},r),()=>{m.current&&clearInterval(m.current)}},[t,r]),c.useEffect(()=>()=>{h.current&&clearTimeout(h.current),m.current&&clearInterval(m.current)},[]);const g=c.useCallback((E,R)=>{var T;return(T=s.controls[E])==null?void 0:T[R]},[s]),v=c.useCallback((E,R,T)=>{i(D=>({...D,controls:{...D.controls,[E]:{...D.controls[E],[R]:T,lastModified:Date.now()}}}))},[]),b=c.useCallback((E,R,T)=>{i(D=>{var H;const F=(H=D.controls[E])==null?void 0:H[R],z=typeof F=="object"&&F!==null?{...F,...T}:T;return{...D,controls:{...D.controls,[E]:{...D.controls[E],[R]:z,lastModified:Date.now()}}}})},[]),S=c.useCallback((E,R)=>{i(T=>{if(R){const{[R]:z,...H}=T.controls[E]||{};return{...T,controls:{...T.controls,[E]:H}}}const{[E]:D,...F}=T.controls;return{...T,controls:F}})},[]),w=c.useCallback(E=>s.global[E],[s]),A=c.useCallback((E,R)=>{i(T=>({...T,global:{...T.global,[E]:R}}))},[]),k=c.useCallback(async()=>{if(t){u(!0),p(null);try{const E=await t.getServerTimestamp(),R=s.lastSync||0;if(E>R){const T=await t.fetch();T&&(i({...T,lastSync:Date.now()}),await e.save(T))}else{const T={...s,lastSync:Date.now()};await t.push(T),i(T)}}catch(E){p(E instanceof Error?E:new Error("Sync failed"))}finally{u(!1)}}},[t,s,e]),C=c.useCallback(()=>JSON.stringify(s,null,2),[s]),M=c.useCallback(E=>{try{const R=JSON.parse(E);if(typeof R.version!="number"||!R.controls)throw new Error("Invalid preferences format");i(R)}catch(R){p(R instanceof Error?R:new Error("Import failed"))}},[]),N=c.useCallback(()=>{i(qt),e.clear()},[e]),L=c.useMemo(()=>({preferences:s,isLoading:o,isSyncing:d,error:f,getControlPreferences:g,setControlPreferences:v,updateControlPreferences:b,clearControlPreferences:S,getGlobalPreferences:w,setGlobalPreferences:A,sync:k,exportPreferences:C,importPreferences:M,resetAllPreferences:N}),[s,o,d,f,g,v,b,S,w,A,k,C,M,N]);return x.jsx(oa.Provider,{value:L,children:n})}function ul({showGlobal:e=!0,showControls:t=!0,showExportImport:r=!0,showSync:a=!0,className:n,style:s}){var w,A,k,C;const{preferences:i,isLoading:o,isSyncing:l,error:d,sync:u,exportPreferences:f,importPreferences:p,resetAllPreferences:h,setGlobalPreferences:m,clearControlPreferences:y}=Ct(),g=c.useRef(null),v=()=>{const M=f(),N=new Blob([M],{type:"application/json"}),L=URL.createObjectURL(N),E=document.createElement("a");E.href=L,E.download="nice2dev-preferences.json",E.click(),URL.revokeObjectURL(L)},b=M=>{var E;const N=(E=M.target.files)==null?void 0:E[0];if(!N)return;const L=new FileReader;L.onload=()=>{p(L.result)},L.readAsText(N)};if(o)return x.jsx("div",{className:n,style:s,children:"Loading preferences..."});const S=Object.keys(i.controls);return x.jsxs("div",{className:`ntd-preferences-panel ${n||""}`,style:{fontFamily:"system-ui, sans-serif",fontSize:"14px",padding:"16px",...s},children:[d&&x.jsx("div",{style:{padding:"12px",marginBottom:"16px",background:"var(--danger-bg, #fef2f2)",border:"1px solid var(--nice-danger-bg, #fecaca)",borderRadius:"6px",color:"var(--color-error, #dc2626)"},children:d.message}),x.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"20px",flexWrap:"wrap"},children:[a&&x.jsx("button",{onClick:u,disabled:l,style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:l?"wait":"pointer"},children:l?"Syncing...":"Sync"}),r&&x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:v,style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Export"}),x.jsx("button",{onClick:()=>{var M;return(M=g.current)==null?void 0:M.click()},style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Import"}),x.jsx("input",{ref:g,type:"file",accept:".json",onChange:b,style:{display:"none"}})]}),x.jsx("button",{onClick:h,style:{padding:"8px 16px",border:"1px solid var(--nice-danger-dark, #dc2626)",borderRadius:"6px",background:"var(--danger-bg, #fef2f2)",color:"var(--color-error, #dc2626)",cursor:"pointer",marginLeft:"auto"},children:"Reset All"})]}),e&&x.jsxs("div",{style:{marginBottom:"24px"},children:[x.jsx("h3",{style:{margin:"0 0 12px",fontSize:"16px",fontWeight:600},children:"Global Preferences"}),x.jsxs("div",{style:{display:"grid",gap:"12px"},children:[x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x.jsx("input",{type:"checkbox",checked:((w=i.global.display)==null?void 0:w.reducedMotion)||!1,onChange:M=>m("display",{...i.global.display,reducedMotion:M.target.checked})}),"Reduced motion"]}),x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x.jsx("input",{type:"checkbox",checked:((A=i.global.display)==null?void 0:A.highContrast)||!1,onChange:M=>m("display",{...i.global.display,highContrast:M.target.checked})}),"High contrast"]}),x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:["Font scale:",x.jsx("input",{type:"range",min:"0.8",max:"1.5",step:"0.1",value:((k=i.global.display)==null?void 0:k.fontScale)||1,onChange:M=>m("display",{...i.global.display,fontScale:parseFloat(M.target.value)}),style:{flex:1}}),x.jsxs("span",{children:[((((C=i.global.display)==null?void 0:C.fontScale)||1)*100).toFixed(0),"%"]})]})]})]}),t&&S.length>0&&x.jsxs("div",{children:[x.jsxs("h3",{style:{margin:"0 0 12px",fontSize:"16px",fontWeight:600},children:["Control Preferences (",S.length,")"]}),x.jsx("div",{style:{display:"grid",gap:"8px"},children:S.map(M=>{const N=i.controls[M],L=Object.keys(N).filter(E=>E!=="lastModified");return x.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",background:"var(--bg-secondary, #f9fafb)",borderRadius:"6px"},children:[x.jsxs("div",{children:[x.jsx("div",{style:{fontWeight:500},children:M}),x.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted, #6b7280)"},children:L.join(", ")})]}),x.jsx("button",{onClick:()=>y(M),style:{padding:"4px 8px",border:"none",borderRadius:"4px",background:"var(--border-color, #e5e7eb)",cursor:"pointer",fontSize:"12px"},children:"Clear"})]},M)})})]}),t&&S.length===0&&x.jsx("div",{style:{color:"var(--text-muted, #6b7280)",fontStyle:"italic"},children:"No control preferences saved yet."})]})}const fl={cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",source:"default",requiresConsentBanner:!1,resolvedAt:Date.now(),version:"1.0.0"},ia={traceless:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",requiresConsentBanner:!1},ephemeral:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"ephemeral",requiresConsentBanner:!1},private:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!0,strictAuthCookieOnly:!0,effectiveMode:"private",requiresConsentBanner:!1},balanced:{cookiesAllowed:!1,localStorageAllowed:!0,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"balanced",requiresConsentBanner:!0},full:{cookiesAllowed:!0,localStorageAllowed:!0,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"full",requiresConsentBanner:!0},custom:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"custom",requiresConsentBanner:!1}},fe=["traceless","ephemeral","private","balanced","full","custom"];function ml(e,t){const r=fe.indexOf(e),a=fe.indexOf(t);return r<=a?e:t}function Le(e,t){const r=fe.indexOf(e),a=fe.indexOf(t);return r<=a}function pl(e,t,r,a){let n=e.defaultMode,s="instance";t&&e.allowTenantOverride&&Le(t.mode,n)&&(n=t.mode,s="tenant"),r&&(t!=null&&t.allowGroupOverride)&&Le(r.mode,n)&&(n=r.mode,s="group"),a&&(t!=null&&t.allowUserOverride||r!=null&&r.allowUserLockdown)&&Le(a.preferredMode,n)&&(n=a.preferredMode,s="user");const i=ia[n],o={...i,cookiesAllowed:i.cookiesAllowed&&e.maxCookies,localStorageAllowed:i.localStorageAllowed&&e.maxLocalStorage,sessionStorageAllowed:i.sessionStorageAllowed&&e.maxSessionStorage,source:s,resolvedAt:Date.now(),version:"1.0.0"};return a&&(a.restrictCookies&&(o.cookiesAllowed=!1),a.restrictLocalStorage&&(o.localStorageAllowed=!1),a.restrictSessionStorage&&(o.sessionStorageAllowed=!1)),o.effectiveMode=Et(o),o.requiresConsentBanner=ca(o),o}function Et(e){const{cookiesAllowed:t,localStorageAllowed:r,sessionStorageAllowed:a,strictAuthCookieOnly:n}=e;return!t&&!r&&!a?"traceless":!t&&!r&&a&&!n?"ephemeral":!t&&!r&&a&&n?"private":!t&&r&&a?"balanced":t&&r&&a?"full":"custom"}function ca(e){return!e.cookiesAllowed&&!e.localStorageAllowed?!1:e.effectiveMode==="full"||e.effectiveMode==="balanced"}const la=new Map;class da{constructor(t,r="nice2dev",a="local"){this.policy=t,this.namespace=r,this.defaultBackend=a}getBackend(t){const r=t||this.defaultBackend;if(r==="local"&&this.policy.localStorageAllowed)try{if(typeof localStorage<"u")return localStorage}catch{}if((r==="session"||r==="local")&&this.policy.sessionStorageAllowed)try{if(typeof sessionStorage<"u")return sessionStorage}catch{}return la}getKey(t){return`${this.namespace}:${t}`}get(t,r){const a=this.getBackend(r),n=this.getKey(t);try{const s=a instanceof Map?a.get(n):a.getItem(n);if(s==null)return null;try{return JSON.parse(s)}catch{return s}}catch{return null}}set(t,r,a){const n=this.getBackend(a),s=this.getKey(t);try{const i=typeof r=="string"?r:JSON.stringify(r);return n instanceof Map?n.set(s,i):n.setItem(s,i),!0}catch{return!1}}remove(t,r){const a=this.getBackend(r),n=this.getKey(t);try{return a instanceof Map?a.delete(n):(a.removeItem(n),!0)}catch{return!1}}clear(t){const r=this.getBackend(t),a=`${this.namespace}:`;try{if(r instanceof Map)for(const n of r.keys())n.startsWith(a)&&r.delete(n);else{const n=[];for(let s=0;s<r.length;s++){const i=r.key(s);i&&i.startsWith(a)&&n.push(i)}n.forEach(s=>r.removeItem(s))}}catch{}}keys(t){const r=this.getBackend(t),a=`${this.namespace}:`,n=[];try{if(r instanceof Map)for(const s of r.keys())s.startsWith(a)&&n.push(s.slice(a.length));else for(let s=0;s<r.length;s++){const i=r.key(s);i&&i.startsWith(a)&&n.push(i.slice(a.length))}}catch{}return n}has(t,r){return this.get(t,r)!==null}getCapabilities(){return{canUseCookies:this.policy.cookiesAllowed,canUseLocalStorage:this.policy.localStorageAllowed,canUseSessionStorage:this.policy.sessionStorageAllowed,canPersist:this.policy.localStorageAllowed,effectiveMode:this.policy.effectiveMode,actualBackend:this.getActualBackendType()}}getActualBackendType(){const t=this.getBackend();return t instanceof Map?"memory":t===sessionStorage?"session":"local"}updatePolicy(t){this.policy=t}}function gl(e,t){const{cookies:r,localStorage:a,storageMode:n}=t,s={...e};if(n&&n!=="auto")switch(n){case"traceless":s.cookiesAllowed=!1,s.localStorageAllowed=!1,s.sessionStorageAllowed=!1;break;case"ephemeral":s.cookiesAllowed=!1,s.localStorageAllowed=!1;break}return r===!1&&(s.cookiesAllowed=!1),a===!1&&(s.localStorageAllowed=!1),s.effectiveMode=Et(s),s.source="control",s}function yl(e,t,r){return{generatedAt:new Date().toISOString(),instanceId:t,tenantId:r,effectiveMode:e.effectiveMode,cookies:{count:0,allowed:e.cookiesAllowed,strictAuthOnly:e.strictAuthCookieOnly,thirdParty:!1,tracking:!1},localStorage:{bytesUsed:0,allowed:e.localStorageAllowed,keysCount:0},sessionStorage:{bytesUsed:0,allowed:e.sessionStorageAllowed,keysCount:0},consentBanner:{required:e.requiresConsentBanner,shown:e.requiresConsentBanner},compliance:{ePrivacyCompliant:!e.cookiesAllowed||e.requiresConsentBanner,gdprCompliant:!0,pecrCompliant:!e.cookiesAllowed||e.requiresConsentBanner},statement:hl(e)}}function hl(e){return e.effectiveMode==="traceless"?"This OmniVerk instance operates in Traceless™ mode. No cookies are set (0), no data is saved to localStorage (0), and no sessionStorage is used (0). No cookie consent banner is required under ePrivacy Directive Art. 5(3) as no similar technologies are employed.":e.effectiveMode==="ephemeral"?"This OmniVerk instance operates in Ephemeral mode. No cookies are set, no localStorage is used. sessionStorage is used for session-only data that is automatically cleared when the browser tab is closed. No cookie consent banner is required.":e.effectiveMode==="private"?"This OmniVerk instance operates in Private mode. One strictly necessary httpOnly authentication cookie may be set. sessionStorage is used for session preferences. No consent banner is required as only strictly necessary technologies are used.":e.effectiveMode==="balanced"?"This OmniVerk instance operates in Balanced mode. localStorage is used for user preferences. sessionStorage is used for session data. No cookies are set. Depending on jurisdiction, a consent banner may be shown.":"This OmniVerk instance operates in Full mode. Cookies, localStorage, and sessionStorage are enabled. A consent banner is displayed to users before any non-essential storage is used."}function bl(e){const{effectiveMode:t}=e;switch(t){case"traceless":return{mode:"traceless",icon:"🟢",color:"var(--nice-success, #10b981)",label:"Traceless™",tooltip:"Your data is not stored on this device. Zero cookies, zero localStorage, zero traces.",cssClass:"nice-traceless-badge--traceless"};case"ephemeral":return{mode:"ephemeral",icon:"🔵",color:"var(--nice-primary, #3b82f6)",label:"Ephemeral",tooltip:"Session-only storage. Data is cleared when you close this tab.",cssClass:"nice-traceless-badge--ephemeral"};case"private":return{mode:"private",icon:"🟡",color:"var(--nice-warning, #eab308)",label:"Private",tooltip:"Minimal storage with one secure authentication cookie.",cssClass:"nice-traceless-badge--private"};case"balanced":return{mode:"balanced",icon:"🟠",color:"var(--nice-warning, #f97316)",label:"Balanced",tooltip:"Preferences are saved locally. No tracking cookies.",cssClass:"nice-traceless-badge--balanced"};case"full":return{mode:"full",icon:"🔴",color:"var(--nice-danger, #ef4444)",label:"Full",tooltip:"All storage enabled including analytics. You control what is stored via consent.",cssClass:"nice-traceless-badge--full"};case"custom":default:return{mode:"custom",icon:"⚪",color:"var(--nice-text-secondary, #6b7280)",label:"Custom",tooltip:"Custom storage configuration.",cssClass:"nice-traceless-badge--custom"}}}function vl(e,t){const r=e.localStorageAllowed,a=e.sessionStorageAllowed,s={preferences:{message:"Your preferences will reset when you close this tab.",key:"traceless.warning.preferences"},draft:{message:"Unsaved draft will be lost if you close or refresh this page.",key:"traceless.warning.draft"},history:{message:"Search history is not saved in this privacy mode.",key:"traceless.warning.history"},auth:{message:"You will need to log in again each time you visit.",key:"traceless.warning.auth"},"grid-state":{message:"Table settings (sorting, filtering, columns) will reset on page refresh.",key:"traceless.warning.gridState"}}[t];return!r&&!a?{canPersist:!1,canSession:!1,warningMessage:s.message,warningKey:s.key}:!r&&a?{canPersist:!1,canSession:!0,warningMessage:t!=="auth"?s.message:void 0,warningKey:t!=="auth"?s.key:void 0}:{canPersist:!0,canSession:!0}}const Sl="X-OmniVerk-Storage-Policy";function xl(e){const t=e.toLowerCase().trim();return fe.includes(t)?t:null}function wl(e){return e.effectiveMode}function kl(e,t){return new da(e,t)}function Ml(e){return{maxCookies:!1,maxLocalStorage:!1,maxSessionStorage:!0,defaultMode:"ephemeral",allowTenantOverride:!1,instanceId:e}}function Cl(e){return{maxCookies:!0,maxLocalStorage:!0,maxSessionStorage:!0,defaultMode:"balanced",allowTenantOverride:!0,instanceId:e}}function Al(){if(typeof document<"u"){const e=document.cookie.split(";");for(const t of e){const r=t.split("=")[0].trim();document.cookie=`${r}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`}}try{typeof localStorage<"u"&&localStorage.clear()}catch{}try{typeof sessionStorage<"u"&&sessionStorage.clear()}catch{}la.clear()}function El(e){const t=[];if(!e.cookiesAllowed&&typeof document<"u"){const r=document.cookie;r&&r.length>0&&t.push({type:"cookie",severity:"high",message:`Cookies found but not allowed: ${r.split(";").length} cookie(s)`,data:r})}if(!e.localStorageAllowed)try{typeof localStorage<"u"&&localStorage.length>0&&t.push({type:"localStorage",severity:"high",message:`localStorage has ${localStorage.length} item(s) but not allowed`})}catch{}if(!e.sessionStorageAllowed)try{typeof sessionStorage<"u"&&sessionStorage.length>0&&t.push({type:"sessionStorage",severity:"medium",message:`sessionStorage has ${sessionStorage.length} item(s) but not allowed`})}catch{}return{compliant:t.length===0,violations:t,auditedAt:Date.now(),policy:e.effectiveMode}}const ua=c.createContext(null),Nl=({config:e,children:t})=>{const[r,a]=c.useState(!1),[n,s]=c.useState(null),i=c.useRef(null);c.useEffect(()=>()=>{var m;(m=i.current)==null||m.abort()},[]);const o=c.useCallback(()=>{var m;(m=i.current)==null||m.abort(),i.current=null,a(!1)},[]),l=async(m,y,g)=>{var S,w,A,k,C,M;const v=new TextDecoder;let b="";for(;;){const{done:N,value:L}=await m.read();if(N)break;b+=v.decode(L,{stream:!0});const E=b.split(`
|
|
67
67
|
`);b=E.pop()||"";for(const R of E)if(R.startsWith("data: ")){const T=R.slice(6).trim();if(T==="[DONE]"){y({content:"",done:!0});return}try{const D=JSON.parse(T);let F="",z=!1;g==="openai"||g==="azure-openai"?(F=((A=(w=(S=D.choices)==null?void 0:S[0])==null?void 0:w.delta)==null?void 0:A.content)||"",z=((C=(k=D.choices)==null?void 0:k[0])==null?void 0:C.finish_reason)==="stop"):g==="anthropic"&&(D.type==="content_block_delta"?F=((M=D.delta)==null?void 0:M.text)||"":D.type==="message_stop"&&(z=!0)),(F||z)&&y({content:F,done:z})}catch{}}}y({content:"",done:!0})},d=(m,y)=>{var g;return{model:y.model||e.defaultModel||"gpt-4",messages:y.systemPrompt?[{role:"system",content:y.systemPrompt},...m]:m,temperature:y.temperature??.7,max_tokens:y.maxTokens,stop:y.stop,stream:y.stream??!1,tools:(g=y.tools)==null?void 0:g.map(v=>({type:"function",function:{name:v.name,description:v.description,parameters:v.parameters}}))}},u=(m,y)=>{var b;const g=y.systemPrompt||((b=m.find(S=>S.role==="system"))==null?void 0:b.content),v=m.filter(S=>S.role!=="system");return{model:y.model||e.defaultModel||"claude-3-opus-20240229",max_tokens:y.maxTokens||4096,system:g,messages:v.map(S=>({role:S.role==="assistant"?"assistant":"user",content:S.content})),temperature:y.temperature??.7,stop_sequences:y.stop,stream:y.stream??!1}},f=c.useCallback(async(m,y={})=>{var g,v,b,S,w,A;if(e.provider==="custom"&&e.customHandler)return e.customHandler(m,y);a(!0),s(null),i.current=new AbortController;try{let k,C,M;if(e.provider==="openai")k=e.endpoint||"https://api.openai.com/v1/chat/completions",C={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`,...e.organizationId&&{"OpenAI-Organization":e.organizationId},...e.headers},M=d(m,{...y,stream:!1});else if(e.provider==="azure-openai")k=e.endpoint||"",C={"Content-Type":"application/json","api-key":e.apiKey||"",...e.headers},M=d(m,{...y,stream:!1});else if(e.provider==="anthropic")k=e.endpoint||"https://api.anthropic.com/v1/messages",C={"Content-Type":"application/json","x-api-key":e.apiKey||"","anthropic-version":"2023-06-01",...e.headers},M=u(m,{...y,stream:!1});else throw new Error(`Unsupported provider: ${e.provider}`);const N=await fetch(k,{method:"POST",headers:C,body:JSON.stringify(M),signal:i.current.signal});if(!N.ok){const R=await N.text();throw new Error(`AI request failed: ${N.status} ${R}`)}const L=await N.json();let E;if(e.provider==="openai"||e.provider==="azure-openai"){const R=(g=L.choices)==null?void 0:g[0];E={content:((v=R==null?void 0:R.message)==null?void 0:v.content)||"",finishReason:(R==null?void 0:R.finish_reason)||"stop",toolCalls:(S=(b=R==null?void 0:R.message)==null?void 0:b.tool_calls)==null?void 0:S.map(T=>({id:T.id,name:T.function.name,arguments:JSON.parse(T.function.arguments)})),usage:L.usage&&{promptTokens:L.usage.prompt_tokens,completionTokens:L.usage.completion_tokens,totalTokens:L.usage.total_tokens}}}else e.provider==="anthropic"?E={content:((A=(w=L.content)==null?void 0:w[0])==null?void 0:A.text)||"",finishReason:L.stop_reason||"stop",usage:L.usage&&{promptTokens:L.usage.input_tokens,completionTokens:L.usage.output_tokens,totalTokens:L.usage.input_tokens+L.usage.output_tokens}}:E={content:"",finishReason:"stop"};return E}catch(k){throw k.name==="AbortError"?new Error("Request cancelled"):(s(k),k)}finally{a(!1)}},[e]),p=c.useCallback(async(m,y,g={})=>{if(e.provider==="custom"&&e.customStreamHandler)return e.customStreamHandler(m,g,y);a(!0),s(null),i.current=new AbortController;try{let v,b,S;if(e.provider==="openai")v=e.endpoint||"https://api.openai.com/v1/chat/completions",b={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`,...e.organizationId&&{"OpenAI-Organization":e.organizationId},...e.headers},S=d(m,{...g,stream:!0});else if(e.provider==="azure-openai")v=e.endpoint||"",b={"Content-Type":"application/json","api-key":e.apiKey||"",...e.headers},S=d(m,{...g,stream:!0});else if(e.provider==="anthropic")v=e.endpoint||"https://api.anthropic.com/v1/messages",b={"Content-Type":"application/json","x-api-key":e.apiKey||"","anthropic-version":"2023-06-01",...e.headers},S=u(m,{...g,stream:!0});else throw new Error(`Unsupported provider: ${e.provider}`);const w=await fetch(v,{method:"POST",headers:b,body:JSON.stringify(S),signal:i.current.signal});if(!w.ok){const k=await w.text();throw new Error(`AI request failed: ${w.status} ${k}`)}if(!w.body)throw new Error("Response body is null");const A=w.body.getReader();await l(A,y,e.provider)}catch(v){if(v.name==="AbortError"){y({content:"",done:!0});return}throw s(v),v}finally{a(!1)}},[e]),h={isConfigured:!!e.apiKey||e.provider==="custom"||e.provider==="local",provider:e.provider,defaultModel:e.defaultModel||null,complete:f,stream:p,cancel:o,isLoading:r,error:n};return x.jsx(ua.Provider,{value:h,children:t})};function ce(){const e=c.useContext(ua);if(!e)throw new Error("useNiceAI must be used within a NiceAIProvider");return e}function Ll(e={}){const t=ce(),[r,a]=c.useState(""),[n,s]=c.useState([]),[i,o]=c.useState(!1),[l,d]=c.useState(null),u=c.useCallback(async y=>{o(!0),d(null),a("");const g=[...n,{role:"user",content:y}];try{const v=await t.complete(g,{systemPrompt:e.systemPrompt,model:e.model,temperature:e.temperature});return s([...g,{role:"assistant",content:v.content}]),a(v.content),v.content}catch(v){throw d(v),v}finally{o(!1)}},[t,n,e]),f=c.useCallback(async(y,g)=>{o(!0),d(null),a("");const v=[...n,{role:"user",content:y}];try{let b="";return await t.stream(v,S=>{S.done||(b+=S.content,a(b),g==null||g(S.content))},{systemPrompt:e.systemPrompt,model:e.model,temperature:e.temperature}),s([...v,{role:"assistant",content:b}]),b}catch(b){throw d(b),b}finally{o(!1)}},[t,n,e]),p=c.useCallback(()=>{a(""),d(null)},[]),h=c.useCallback(()=>{s([]),a(""),d(null)},[]),m=c.useCallback(()=>{t.cancel(),o(!1)},[t]);return{response:r,isLoading:i,error:l,send:u,sendStreaming:f,clear:p,cancel:m,history:n,clearHistory:h}}function Tl(e={}){const t=ce(),[r,a]=c.useState(""),[n,s]=c.useState(!1),i=c.useCallback(async(u,f="")=>{s(!0),a("");try{const h=(await t.complete([{role:"user",content:`Complete the following ${e.language||""} code. Return ONLY the completion text, no explanation.
|
|
68
68
|
|
|
69
69
|
Code before cursor:
|
|
@@ -119,7 +119,7 @@ Translation:`}],{temperature:.2})).content.trim()}finally{r(!1)}},[e]),s=c.useCa
|
|
|
119
119
|
|
|
120
120
|
Prompt: ${i}
|
|
121
121
|
|
|
122
|
-
HTML:`}],{temperature:.3}),l=o.content.match(/```html?\n?([\s\S]*?)```/);return l?l[1].trim():o.content.trim()}finally{r(!1)}},[e]);return{improveText:a,translate:n,generateHtml:s,isLoading:t}}class Xe{constructor(){this._listeners=new Map}on(t,r){return this._listeners.has(t)||this._listeners.set(t,new Set),this._listeners.get(t).add(r),()=>{var a;(a=this._listeners.get(t))==null||a.delete(r)}}emit(t,...r){var a;(a=this._listeners.get(t))==null||a.forEach(n=>{try{n(...r)}catch{}})}}function Pl(e,t){const r=e[t.field],a=t.value;switch(t.operator){case"=":return r==a;case"<>":return r!=a;case"<":return r<a;case"<=":return r<=a;case">":return r>a;case">=":return r>=a;case"contains":return String(r??"").toLowerCase().includes(String(a??"").toLowerCase());case"notcontains":return!String(r??"").toLowerCase().includes(String(a??"").toLowerCase());case"startswith":return String(r??"").toLowerCase().startsWith(String(a??"").toLowerCase());case"endswith":return String(r??"").toLowerCase().endsWith(String(a??"").toLowerCase());case"isblank":return r==null||r==="";case"isnotblank":return r!=null&&r!=="";default:return!0}}function fa(e,t){if(t.items.length===0)return!0;const r=a=>a.type==="condition"?Pl(e,a):fa(e,a);return t.logic==="and"?t.items.every(r):t.items.some(r)}function Fl(e,t){var n;let r=[...e];if(t.filter&&(r=r.filter(s=>fa(s,t.filter))),t.search){const s=t.search.toLowerCase(),i=t.searchFields;r=r.filter(o=>(i?i.map(d=>o[d]):Object.values(o)).some(d=>String(d??"").toLowerCase().includes(s)))}const a=r.length;if((n=t.sort)!=null&&n.length&&r.sort((s,i)=>{for(const o of t.sort){const l=s[o.field]??"",d=i[o.field]??"",u=typeof l=="number"&&typeof d=="number"?l-d:String(l).localeCompare(String(d));if(u!==0)return o.direction==="desc"?-u:u}return 0}),t.skip!=null||t.take!=null){const s=t.skip??0,i=t.take??r.length;r=r.slice(s,s+i)}return{data:r,totalCount:a}}function Hl(e){const t=e.keyField??"id";let r=[...e.data];const a=new Xe;return{keyField:t,writable:!0,async load(s={}){a.emit("loading",!0);try{const i=Fl(r,s);return a.emit("loaded",i),a.emit("loading",!1),i}catch(i){throw a.emit("error",i instanceof Error?i:new Error(String(i))),a.emit("loading",!1),i}},async byKey(s){return r.find(i=>i[t]===s)},async insert(s){const i={...s};return r=[...r,i],a.emit("changed"),i},async update(s,i){const o=r.findIndex(d=>d[t]===s);if(o===-1)throw new Error(`Record not found: ${s}`);const l={...r[o],...i};return r=r.map((d,u)=>u===o?l:d),a.emit("changed"),l},async remove(s){r=r.filter(i=>i[t]!==s),a.emit("changed")},on:a.on.bind(a)}}async function $l(e){const t={"Content-Type":"application/json"};if(!e.headers)return t;const r=typeof e.headers=="function"?await e.headers():e.headers;return{...t,...r}}function Ye(e,t,r){return typeof e=="function"?e(r):e||`${t}/${encodeURIComponent(String(r))}`}function jl(e){var r,a,n;const t={};return e.skip!=null&&(t.skip=String(e.skip)),e.take!=null&&(t.take=String(e.take)),e.search&&(t.search=e.search),(r=e.sort)!=null&&r.length&&(t.sort=e.sort.map(s=>`${s.field} ${s.direction}`).join(",")),e.filter&&(t.filter=JSON.stringify(e.filter)),(a=e.select)!=null&&a.length&&(t.select=e.select.join(",")),(n=e.expand)!=null&&n.length&&(t.expand=e.expand.join(",")),t}function Bl(e){if(Array.isArray(e))return{data:e,totalCount:e.length};const t=e,r=t.data??t.items??t.value??t.results??[],a=t.totalCount??t.total??t.count??t["@odata.count"]??r.length;return{data:r,totalCount:a}}function ma(e){const t=e.keyField??"id",r=new Xe;async function a(s,i){const o=await $l(e),l=await fetch(s,{...e.fetchOptions,...i,headers:{...o,...i==null?void 0:i.headers}});if(!l.ok){const u=await l.text().catch(()=>l.statusText);throw new Error(`HTTP ${l.status}: ${u}`)}return(l.headers.get("content-type")??"").includes("json")?l.json():l.text()}return{keyField:t,writable:!0,async load(s={}){var i;r.emit("loading",!0);try{const o=e.loadUrl??e.url,l=e.mapLoadParams?e.mapLoadParams(s):jl(s),d=new URLSearchParams(l).toString(),u=d?`${o}?${d}`:o,f=await a(u),p=e.extractLoadResult?e.extractLoadResult(f):Bl(f);return r.emit("loaded",p),r.emit("loading",!1),p}catch(o){const l=o instanceof Error?o:new Error(String(o));throw r.emit("error",l),r.emit("loading",!1),(i=e.onError)==null||i.call(e,l,"load"),l}},async byKey(s){const i=Ye(e.byKeyUrl,e.url,s),o=await a(i);return e.extractItem?e.extractItem(o):o},async insert(s){const i=e.insertUrl??e.url,o=e.prepareInsertBody?e.prepareInsertBody(s):s,l=await a(i,{method:"POST",body:JSON.stringify(o)}),d=e.extractItem?e.extractItem(l):l;return r.emit("changed"),d},async update(s,i){const o=Ye(e.updateUrl,e.url,s),l=e.prepareUpdateBody?e.prepareUpdateBody(s,i):i,d=await a(o,{method:e.updateMethod??"PUT",body:JSON.stringify(l)}),u=e.extractItem?e.extractItem(d):d;return r.emit("changed"),u},async remove(s){const i=Ye(e.deleteUrl,e.url,s);await a(i,{method:"DELETE"}),r.emit("changed")},on:r.on.bind(r)}}function Ol(e,t){const r=e.field,a=typeof e.value=="string"?`'${e.value.replace(/'/g,"''")}'`:String(e.value??"null");switch(e.operator){case"=":return`${r} eq ${a}`;case"<>":return`${r} ne ${a}`;case"<":return`${r} lt ${a}`;case"<=":return`${r} le ${a}`;case">":return`${r} gt ${a}`;case">=":return`${r} ge ${a}`;case"contains":return t>=4?`contains(${r},${a})`:`substringof(${a},${r})`;case"notcontains":return t>=4?`not contains(${r},${a})`:`not substringof(${a},${r})`;case"startswith":return`startswith(${r},${a})`;case"endswith":return`endswith(${r},${a})`;case"isblank":return`${r} eq null`;case"isnotblank":return`${r} ne null`;default:return"true"}}function pa(e,t){return e.items.length===0?"":e.items.map(a=>a.type==="condition"?Ol(a,t):`(${pa(a,t)})`).join(e.logic==="and"?" and ":" or ")}function _l(e){const t=e.version??4,r={url:e.url,keyField:e.keyField,headers:e.headers,fetchOptions:e.fetchOptions,onError:e.onError,updateMethod:"PATCH",mapLoadParams(a){var s,i,o;const n={};if(t>=4&&(n.$count="true"),a.skip!=null&&(n.$skip=String(a.skip)),a.take!=null&&(n.$top=String(a.take)),(s=a.sort)!=null&&s.length&&(n.$orderby=a.sort.map(l=>`${l.field} ${l.direction}`).join(",")),a.filter){const l=pa(a.filter,t);l&&(n.$filter=l)}return a.search&&(n.$search=`"${a.search}"`),(i=a.select)!=null&&i.length&&(n.$select=a.select.join(",")),(o=a.expand)!=null&&o.length&&(n.$expand=a.expand.join(",")),n},extractLoadResult(a){var o,l;const n=a,s=n.value??((o=n.d)==null?void 0:o.results)??[],i=n["@odata.count"]??((l=n.d)==null?void 0:l.__count)??s.length;return{data:s,totalCount:i}},byKeyUrl:a=>{const n=typeof a=="number"?a:`'${String(a).replace(/'/g,"''")}'`;return`${e.url}(${n})`}};return ma(r)}function Wl(e){const t=e.keyField??"id",r=new Xe;async function a(l,d){var m;const u={"Content-Type":"application/json"},f=e.headers?typeof e.headers=="function"?await e.headers():e.headers:{},p=await fetch(e.url,{method:"POST",headers:{...u,...f},body:JSON.stringify({query:l,variables:d})});if(!p.ok){const y=await p.text().catch(()=>p.statusText);throw new Error(`GraphQL HTTP ${p.status}: ${y}`)}const h=await p.json();if((m=h.errors)!=null&&m.length)throw new Error(h.errors.map(y=>y.message).join("; "));return h.data}function n(l){var u;const d={};return l.skip!=null&&(d.skip=l.skip),l.take!=null&&(d.take=l.take),l.search&&(d.search=l.search),(u=l.sort)!=null&&u.length&&(d.sort=l.sort),l.filter&&(d.filter=l.filter),d}function s(l){if(!l||typeof l!="object")return{data:[],totalCount:0};const d=Object.values(l)[0];if(!d)return{data:[],totalCount:0};if(Array.isArray(d))return{data:d,totalCount:d.length};const u=d.items??d.nodes??d.edges??d.data??[],f=d.totalCount??d.total??d.count??u.length;return{data:u,totalCount:f}}function i(l){return!l||typeof l!="object"?l:Object.values(l)[0]}return{keyField:t,writable:!!(e.queries.insert||e.queries.update||e.queries.remove),async load(l={}){var d;r.emit("loading",!0);try{const u=e.mapVariables?e.mapVariables(l):n(l),f=await a(e.queries.load,u),p=e.extractLoadResult?e.extractLoadResult(f):s(f);return r.emit("loaded",p),r.emit("loading",!1),p}catch(u){const f=u instanceof Error?u:new Error(String(u));throw r.emit("error",f),r.emit("loading",!1),(d=e.onError)==null||d.call(e,f,"load"),f}},async byKey(l){if(!e.queries.byKey)throw new Error("byKey query not configured");const d=await a(e.queries.byKey,{[t]:l});return e.extractItem?e.extractItem(d):i(d)},insert:e.queries.insert?async l=>{const d=await a(e.queries.insert,{input:l}),u=e.extractItem?e.extractItem(d):i(d);return r.emit("changed"),u}:void 0,update:e.queries.update?async(l,d)=>{const u=await a(e.queries.update,{[t]:l,input:d}),f=e.extractItem?e.extractItem(u):i(u);return r.emit("changed"),f}:void 0,remove:e.queries.remove?async l=>{await a(e.queries.remove,{[t]:l}),r.emit("changed")}:void 0,on:r.on.bind(r)}}function Vl(e){const t=e.keyField??"id",r=new Xe;return{keyField:t,writable:!!(e.insert||e.update||e.remove),async load(n={}){r.emit("loading",!0);try{const s=await e.load(n);return r.emit("loaded",s),r.emit("loading",!1),s}catch(s){const i=s instanceof Error?s:new Error(String(s));throw r.emit("error",i),r.emit("loading",!1),i}},async byKey(n){if(!e.byKey)throw new Error("byKey handler not configured");return e.byKey(n)},insert:e.insert?async n=>{const s=await e.insert(n);return r.emit("changed"),s}:void 0,update:e.update?async(n,s)=>{const i=await e.update(n,s);return r.emit("changed"),i}:void 0,remove:e.remove?async n=>{await e.remove(n),r.emit("changed")}:void 0,on:r.on.bind(r)}}function ga(e){return/^[A-Za-z_][A-Za-z0-9_.]*$/.test(e)?e:`"${e.replace(/"/g,'""')}"`}function Xl(e,t={}){const r=[],a=t.placeholder??(()=>"?"),n=t.quoteField??ga,s=l=>(r.push(l),a(r.length-1)),i=l=>{const d=n(l.field);switch(l.operator){case"=":case"<>":case"<":case"<=":case">":case">=":return`${d} ${l.operator} ${s(l.value)}`;case"contains":return`${d} LIKE ${s(`%${String(l.value)}%`)}`;case"notcontains":return`${d} NOT LIKE ${s(`%${String(l.value)}%`)}`;case"startswith":return`${d} LIKE ${s(`${String(l.value)}%`)}`;case"endswith":return`${d} LIKE ${s(`%${String(l.value)}`)}`;case"between":{const u=Array.isArray(l.value)?l.value:[l.value,l.value];return`${d} BETWEEN ${s(u[0])} AND ${s(u[1])}`}case"isblank":return`(${d} IS NULL OR ${d} = ${s("")})`;case"isnotblank":return`(${d} IS NOT NULL AND ${d} <> ${s("")})`;case"in":{const u=Array.isArray(l.value)?l.value:[l.value];return u.length?`${d} IN (${u.map(s).join(", ")})`:"1 = 0"}default:return`${d} = ${s(l.value)}`}},o=l=>{const d=[];for(const u of l.items)if(u.type==="group"){const f=o(u);f&&d.push(`(${f})`)}else d.push(i(u));return d.join(l.logic==="or"?" OR ":" AND ")};return{sql:o(e),params:r}}function Ul(e,t={}){const r=t.quoteField??ga;return e.filter(a=>a.field).map(a=>`${r(a.field)} ${a.direction==="desc"?"DESC":"ASC"}`).join(", ")}function ee(e){return String(e??"").toLowerCase()}function ya(e,t){const r=e[t.field],a=t.value;switch(t.operator){case"=":return r==a;case"<>":return r!=a;case"<":return r<a;case"<=":return r<=a;case">":return r>a;case">=":return r>=a;case"contains":return ee(r).includes(ee(a));case"notcontains":return!ee(r).includes(ee(a));case"startswith":return ee(r).startsWith(ee(a));case"endswith":return ee(r).endsWith(ee(a));case"between":{const n=Array.isArray(a)?a:[a,a];return r>=n[0]&&r<=n[1]}case"isblank":return r==null||r==="";case"isnotblank":return r!=null&&r!=="";case"in":return(Array.isArray(a)?a:[a]).some(s=>r==s);default:return!0}}function Nt(e,t){if(!t.items.length)return!0;const r=a=>a.type==="condition"?ya(e,a):Nt(e,a);return t.logic==="or"?t.items.some(r):t.items.every(r)}function Gt(e){return e==null||e===""}const ql=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Gl(e){const t=String(e);try{return new URL(t),!0}catch{return/^https?:\/\/[^\s]+$/.test(t)}}function W(e){return typeof e=="number"?e:parseFloat(String(e))}function ha(e){const t=e.field;switch(e.op){case"required":return`${t} is required`;case"minLength":return`${t} must be at least ${e.value} characters`;case"maxLength":return`${t} must be at most ${e.value} characters`;case"min":return`${t} must be ≥ ${e.value}`;case"max":return`${t} must be ≤ ${e.value}`;case"pattern":return`${t} has an invalid format`;case"email":return`${t} must be a valid email`;case"url":return`${t} must be a valid URL`;case"equals":return`${t} must equal ${e.value}`;case"notEquals":return`${t} must not equal ${e.value}`;case"greaterThan":return`${t} must be greater than ${e.value}`;case"lessThan":return`${t} must be less than ${e.value}`;case"matchesField":return`${t} must match ${e.compareField}`;case"greaterThanField":return`${t} must be greater than ${e.compareField}`;case"lessThanField":return`${t} must be less than ${e.compareField}`;default:return`${t} is invalid`}}function ba(e,t){const r=t[e.field];if(e.op==="required")return!Gt(r);if(Gt(r))return!0;const a=e.compareField!=null?t[e.compareField]:void 0;switch(e.op){case"minLength":return String(r).length>=W(e.value);case"maxLength":return String(r).length<=W(e.value);case"min":return W(r)>=W(e.value);case"max":return W(r)<=W(e.value);case"pattern":try{return new RegExp(String(e.value)).test(String(r))}catch{return!0}case"email":return ql.test(String(r));case"url":return Gl(r);case"equals":return r===e.value;case"notEquals":return r!==e.value;case"greaterThan":return W(r)>W(e.value);case"lessThan":return W(r)<W(e.value);case"matchesField":return r===a;case"greaterThanField":return W(r)>W(a);case"lessThanField":return W(r)<W(a);case"custom":return e.validate?e.validate(r,t):!0;default:return!0}}function va(e,t){const r=[];for(const a of e??[])a.when&&!Nt(t,a.when)||ba(a,t)||r.push({field:a.field,message:a.message??ha(a),severity:a.severity??"error",ruleId:a.id});return r}function Kl(e,t){return va(e,t).every(r=>r.severity!=="error")}class at{constructor(t={}){this.cache=new Map,this.ttl=t.ttl??6e4,this.maxSize=t.maxSize??100}get(t){const r=this.cache.get(t);if(r){if(Date.now()>r.expiresAt){this.cache.delete(t);return}return this.cache.delete(t),this.cache.set(t,r),r.data}}set(t,r,a){if(this.cache.size>=this.maxSize){const n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(t,{data:r,timestamp:Date.now(),expiresAt:Date.now()+(a??this.ttl)})}has(t){return this.get(t)!==void 0}invalidate(t){this.cache.delete(t)}invalidateAll(){this.cache.clear()}invalidateMatching(t){for(const r of this.cache.keys())t.test(r)&&this.cache.delete(r)}}class Sa{constructor(){this.pending=new Map}async dedupe(t,r){const a=this.pending.get(t);if(a)return a;const n=r().finally(()=>{this.pending.delete(t)});return this.pending.set(t,n),n}hasPending(t){return this.pending.has(t)}cancelAll(){this.pending.clear()}}function Jl(e,t={}){const r=new at(t),a=new at(t),n=new Sa,s=t.generateKey??(l=>JSON.stringify(l)),i=t.cacheLoads!==!1,o=t.cacheByKey!==!1;return{...e,cache:r,async load(l={}){const d=`load:${s(l)}`;if(i){const u=r.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.load(l);return i&&r.set(d,u),u})},async byKey(l){const d=`byKey:${String(l)}`;if(o){const u=a.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.byKey(l);return o&&u&&a.set(d,u),u})},async insert(l){const d=await e.insert(l);return r.invalidateAll(),d},async update(l,d){const u=await e.update(l,d);return r.invalidateAll(),a.invalidate(`byKey:${String(l)}`),u},async remove(l){await e.remove(l),r.invalidateAll(),a.invalidate(`byKey:${String(l)}`)},invalidateCache(){r.invalidateAll(),a.invalidateAll()}}}function Yl(e,t){const{cursorField:r,pageSize:a=20,direction:n="asc"}=t;return{async loadPage(s={}){var g;const i=s.pageSize??a,o=s.direction??"forward",l=s.cursor?{type:"condition",field:r,operator:o==="forward"?n==="asc"?">":"<":n==="asc"?"<":">",value:Ql(s.cursor)}:null,d=l?{type:"group",logic:"and",items:[...((g=s.filter)==null?void 0:g.items)??[],l]}:s.filter,u=[{field:r,direction:o==="forward"?n:n==="asc"?"desc":"asc"},...s.sort??[]],f=await e.load({...s,filter:d,sort:u,take:i+1}),p=f.data.length>i,h=p?f.data.slice(0,i):f.data;o==="backward"&&h.reverse();const m=h[h.length-1],y=h[0];return{data:h,nextCursor:p&&m?Qe(m[r]):null,prevCursor:y&&s.cursor?Qe(y[r]):null,hasMore:p}},async*loadAll(s={}){let i=null;do{const o=await e.load({...s,...i?{cursor:i}:{}});if(o.data.length===0)break;yield o.data;const l=o.data[o.data.length-1];i=l?Qe(l[r]):null}while(i)}}}function Qe(e){return btoa(JSON.stringify(e))}function Ql(e){try{return JSON.parse(atob(e))}catch{return e}}function Zl(e,t={}){const{pageSize:r=50,threshold:a=200,initialPage:n=0}=t;let s={items:[],isLoading:!1,hasMore:!0,error:null,page:n,totalCount:0};const i=new Set;function o(){i.forEach(h=>h(s))}function l(h){s={...s,...h},o()}let d={};async function u(){if(!(s.isLoading||!s.hasMore)){l({isLoading:!0,error:null});try{const h=await e.load({...d,skip:s.page*r,take:r}),m=[...s.items,...h.data],y=m.length<h.totalCount;l({items:m,page:s.page+1,totalCount:h.totalCount,hasMore:y,isLoading:!1})}catch(h){l({error:h instanceof Error?h:new Error(String(h)),isLoading:!1})}}}function f(h={}){d=h,s={items:[],isLoading:!1,hasMore:!0,error:null,page:0,totalCount:0},o()}function p(h){const m=h.target;if(!m)return;m.scrollHeight-m.scrollTop-m.clientHeight<a&&u()}return{get state(){return s},loadMore:u,reset:f,handleScroll:p,subscribe(h){return i.add(h),()=>i.delete(h)},setOptions(h){d=h}}}function ed(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:s=10,heartbeatInterval:i=3e4}=e;let o=null,l=0,d=null,u=[];const f=new Map;function p(k,...C){var M;(M=f.get(k))==null||M.forEach(N=>N(...C))}function h(k){if(e.parseMessage)return e.parseMessage(k);try{return JSON.parse(k.data)}catch{return null}}function m(k){return e.serializeMessage?e.serializeMessage(k):JSON.stringify(k)}function y(k){switch(k.type){case"insert":k.data&&(u=[...u,k.data],p("changed"));break;case"update":k.key&&k.changes&&(u=u.map(C=>C[a]===k.key?{...C,...k.changes}:C),p("changed"));break;case"remove":k.key&&(u=u.filter(C=>C[a]!==k.key),p("changed"));break;case"refresh":case"sync":A.load().catch(()=>{});break}}function g(){(o==null?void 0:o.readyState)!==WebSocket.OPEN&&(o=new WebSocket(t),o.onopen=()=>{l=0,p("connected"),b()},o.onmessage=k=>{const C=h(k);C&&(y(C),p("message",C))},o.onerror=k=>{p("error",new Error("WebSocket error"))},o.onclose=()=>{S(),p("disconnected"),l<s&&(l++,setTimeout(g,n*Math.min(l,5)))})}function v(){S(),o&&(o.close(),o=null)}function b(){S(),d=window.setInterval(()=>{(o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(JSON.stringify({type:"ping"}))},i)}function S(){d&&(clearInterval(d),d=null)}function w(k){(o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(m(k))}const A={keyField:a,writable:r.writable,async load(k={}){p("loading",!0);try{const C=await r.load(k);return u=C.data,p("loaded",C),p("loading",!1),C}catch(C){throw p("error",C),p("loading",!1),C}},async byKey(k){const C=u.find(M=>M[a]===k);return C||r.byKey(k)},async insert(k){const C=await r.insert(k);return w({type:"insert",data:C}),C},async update(k,C){const M=await r.update(k,C);return w({type:"update",key:k,changes:C}),M},async remove(k){await r.remove(k),w({type:"remove",key:k})},on(k,C){return f.has(k)||f.set(k,new Set),f.get(k).add(C),()=>{var M;return(M=f.get(k))==null?void 0:M.delete(C)}},connect:g,disconnect:v,isConnected:()=>(o==null?void 0:o.readyState)===WebSocket.OPEN,sendMessage:w};return A}function td(e){const{connection:t,baseSource:r}=e,a={onInsert:"OnInsert",onUpdate:"OnUpdate",onRemove:"OnRemove",onRefresh:"OnRefresh",insert:"Insert",update:"Update",remove:"Remove",...e.methods},n=r.keyField;let s=[];const i=new Map;function o(f,...p){var h;(h=i.get(f))==null||h.forEach(m=>m(...p))}const l=f=>{s=[...s,f],o("changed")},d=(f,p)=>{s=s.map(h=>h[n]===f?{...h,...p}:h),o("changed")},u=f=>{s=s.filter(p=>p[n]!==f),o("changed")};return{keyField:n,writable:r.writable,async load(f={}){o("loading",!0);try{const p=await r.load(f);return s=p.data,o("loaded",p),o("loading",!1),p}catch(p){throw o("error",p),o("loading",!1),p}},async byKey(f){const p=s.find(h=>h[n]===f);return p||r.byKey(f)},async insert(f){return await t.invoke(a.insert,f)},async update(f,p){return await t.invoke(a.update,f,p)},async remove(f){await t.invoke(a.remove,f)},on(f,p){return i.has(f)||i.set(f,new Set),i.get(f).add(p),()=>{var h;return(h=i.get(f))==null?void 0:h.delete(p)}},async connect(){t.on(a.onInsert,l),t.on(a.onUpdate,d),t.on(a.onRemove,u),t.on(a.onRefresh,()=>this.load()),await t.start()},async disconnect(){t.off(a.onInsert,l),t.off(a.onUpdate,d),t.off(a.onRemove,u),t.off(a.onRefresh,()=>{}),await t.stop()}}}function rd(e,t={}){const r=e.keyField;let a=[];const n=new Map;let s=0;const i=new Map;function o(d,...u){var f;(f=i.get(d))==null||f.forEach(p=>p(...u))}function l(){return`op_${++s}_${Date.now()}`}return{keyField:r,writable:!0,async load(d={}){const u=await e.load(d);return a=u.data,u},async byKey(d){return a.find(u=>u[r]===d)??e.byKey(d)},async insert(d){var p,h,m;const u=l(),f={...d};a=[...a,f],n.set(u,{id:u,action:"insert",item:f}),(p=t.onOptimisticApply)==null||p.call(t,f,"insert"),o("changed");try{const y=await e.insert(d);return a=a.map(g=>g===f?y:g),n.delete(u),(h=t.onConfirm)==null||h.call(t,y,"insert"),o("changed"),y}catch(y){throw a=a.filter(g=>g!==f),n.delete(u),(m=t.onRollback)==null||m.call(t,f,"insert",y instanceof Error?y:new Error(String(y))),o("changed"),y}},async update(d,u){var y,g,v;const f=l(),p=a.findIndex(b=>b[r]===d);if(p===-1)return e.update(d,u);const h=a[p],m={...h,...u};a=a.map((b,S)=>S===p?m:b),n.set(f,{id:f,action:"update",key:d,originalItem:h}),(y=t.onOptimisticApply)==null||y.call(t,m,"update"),o("changed");try{const b=await e.update(d,u);return a=a.map((S,w)=>w===p?b:S),n.delete(f),(g=t.onConfirm)==null||g.call(t,b,"update"),o("changed"),b}catch(b){throw a=a.map((S,w)=>w===p?h:S),n.delete(f),(v=t.onRollback)==null||v.call(t,h,"update",b instanceof Error?b:new Error(String(b))),o("changed"),b}},async remove(d){var p,h,m;const u=l(),f=a.find(y=>y[r]===d);if(!f)return e.remove(d);a=a.filter(y=>y!==f),n.set(u,{id:u,action:"remove",key:d,originalItem:f}),(p=t.onOptimisticApply)==null||p.call(t,f,"remove"),o("changed");try{await e.remove(d),n.delete(u),(h=t.onConfirm)==null||h.call(t,f,"remove")}catch(y){throw a=[...a,f],n.delete(u),(m=t.onRollback)==null||m.call(t,f,"remove",y instanceof Error?y:new Error(String(y))),o("changed"),y}},on(d,u){return i.has(d)||i.set(d,new Set),i.get(d).add(u),()=>{var f;return(f=i.get(d))==null?void 0:f.delete(u)}},hasPendingChanges:()=>n.size>0,getPendingCount:()=>n.size}}function xa(e,t,r){const a=new Map(e.map(d=>[d[r],d])),n=new Map(t.map(d=>[d[r],d])),s=[],i=[],o=[],l=[];for(const[d,u]of n){const f=a.get(d);if(!f)s.push(u);else if(wa(f,u))l.push(u);else{const p={};for(const h of Object.keys(u))f[h]!==u[h]&&(p[h]=u[h]);i.push({key:d,changes:p,oldItem:f,newItem:u})}}for(const[d,u]of a)n.has(d)||o.push(u);return{inserted:s,updated:i,removed:o,unchanged:l}}function wa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e===null||t===null||typeof e!="object")return e===t;const r=e,a=t,n=new Set([...Object.keys(r),...Object.keys(a)]);for(const s of n)if(!wa(r[s],a[s]))return!1;return!0}function ad(e,t={}){const{interval:r=5e3,autoStart:a=!1,pauseWhenHidden:n=!0,onDataChange:s}=t;let i=r,o=null,l=[],d={};const u=new Map;function f(g,...v){var b;(b=u.get(g))==null||b.forEach(S=>S(...v))}async function p(){if(!(n&&document.hidden))try{const g=await e.load(d),v=xa(l,g.data,e.keyField);(v.inserted.length||v.updated.length||v.removed.length)&&(l=g.data,f("changed"),s==null||s(v))}catch{}}function h(){o||(o=window.setInterval(p,i))}function m(){o&&(clearInterval(o),o=null)}n&&document.addEventListener("visibilitychange",()=>{document.hidden||o&&p()});const y={...e,async load(g={}){d=g;const v=await e.load(g);return l=v.data,v},on(g,v){u.has(g)||u.set(g,new Set),u.get(g).add(v);const b=e.on(g,v);return()=>{var S;(S=u.get(g))==null||S.delete(v),b()}},startPolling:h,stopPolling:m,isPolling:()=>o!==null,setInterval(g){i=g,o&&(m(),h())}};return a&&h(),y}function nd(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:s=10,withCredentials:i=!1}=e;let o=null,l=0,d=null,u=[];const f=new Map;function p(b,...S){var w;(w=f.get(b))==null||w.forEach(A=>A(...S))}function h(b){if(e.parseEvent)return e.parseEvent(b);try{return JSON.parse(b.data)}catch{return null}}function m(b){switch(b.type){case"insert":b.data&&(u=[...u,b.data],p("changed"));break;case"update":b.key&&b.changes&&(u=u.map(S=>S[a]===b.key?{...S,...b.changes}:S),p("changed"));break;case"remove":b.key&&(u=u.filter(S=>S[a]!==b.key),p("changed"));break;case"snapshot":Array.isArray(b.data)&&(u=b.data,p("changed"));break;case"refresh":v.load().catch(()=>{});break}}function y(){(o==null?void 0:o.readyState)!==EventSource.OPEN&&(g(),o=new EventSource(t,{withCredentials:i}),o.onopen=()=>{l=0,p("connected")},o.onmessage=b=>{const S=h(b);S&&(m(S),p("message",S))},o.onerror=()=>{if(p("error",new Error("SSE connection error")),(o==null?void 0:o.readyState)===EventSource.CLOSED&&(p("disconnected"),o=null,l<s)){l++;const b=n*Math.min(l,5);d=setTimeout(y,b)}})}function g(){d&&(clearTimeout(d),d=null),o&&(o.close(),o=null)}const v={keyField:a,writable:r.writable,async load(b={}){p("loading",!0);try{const S=await r.load(b);return u=S.data,p("loaded",S),p("loading",!1),S}catch(S){throw p("error",S),p("loading",!1),S}},async byKey(b){const S=u.find(w=>w[a]===b);return S||r.byKey(b)},async insert(b){return r.insert(b)},async update(b,S){return r.update(b,S)},async remove(b){return r.remove(b)},on(b,S){return f.has(b)||f.set(b,new Set),f.get(b).add(S),()=>{var w;return(w=f.get(b))==null?void 0:w.delete(S)}},connect:y,disconnect:g,isConnected:()=>(o==null?void 0:o.readyState)===EventSource.OPEN};return v}function re(e,t){const r={};for(const a of t){const n=e.map(i=>i[a.field]).filter(i=>i!=null),s=a.alias??`${a.fn}_${a.field}`;switch(a.fn){case"sum":r[s]=n.reduce((i,o)=>Number(i)+Number(o),0);break;case"avg":r[s]=n.length?n.reduce((i,o)=>Number(i)+Number(o),0)/n.length:0;break;case"min":r[s]=n.length?Math.min(...n.map(Number)):null;break;case"max":r[s]=n.length?Math.max(...n.map(Number)):null;break;case"count":r[s]=n.length;break;case"first":r[s]=n[0]??null;break;case"last":r[s]=n[n.length-1]??null;break;case"distinct":r[s]=[...new Set(n)];break}}return r}function Lt(e,t){const{groupBy:r,aggregates:a=[],includeItems:n=!1,sortGroups:s}=t;if(r.length===0)return[{key:{},count:e.length,aggregates:re(e,a),items:n?e:void 0}];const i=new Map;for(const l of e){const d={};for(const f of r)d[f]=l[f];const u=JSON.stringify(d);i.has(u)||i.set(u,{key:d,items:[]}),i.get(u).items.push(l)}const o=[];for(const[,l]of i)o.push({key:l.key,count:l.items.length,aggregates:re(l.items,a),items:n?l.items:void 0});return s!=null&&s.length&&o.sort((l,d)=>{for(const u of s){const f=l.key[u.field]??l.aggregates[u.field],p=d.key[u.field]??d.aggregates[u.field],h=typeof f=="number"&&typeof p=="number"?f-p:String(f??"").localeCompare(String(p??""));if(h!==0)return u.direction==="desc"?-h:h}return 0}),o}function ka(e,t,r=[]){if(t.length===0)return[{key:{},count:e.length,aggregates:re(e,r),items:e}];const[a,...n]=t,s=Lt(e,{groupBy:[a],aggregates:r,includeItems:!0});if(n.length>0)for(const i of s)i.groups=ka(i.items,n,r),delete i.items;return s}function sd(e,t){const{rows:r,columns:a,values:n,aggregateFunction:s="sum",rowTotals:i=!0,columnTotals:o=!0,grandTotal:l=!0}=t,d=[...new Set(e.map(m=>String(m[a])))].sort(),u=Lt(e,{groupBy:r,includeItems:!0}),f=[];for(const m of u){const y={rowKey:m.key,values:{}};for(const g of d){const v=m.items.filter(S=>String(S[a])===g),b=re(v,[{field:n,fn:s}]);y.values[g]=b[`${s}_${n}`]??null}if(i){const g=re(m.items,[{field:n,fn:s}]);y.rowTotal=g[`${s}_${n}`]}f.push(y)}let p;if(o){p={};for(const m of d){const y=e.filter(v=>String(v[a])===m),g=re(y,[{field:n,fn:s}]);p[m]=g[`${s}_${n}`]}}let h;return l&&(h=re(e,[{field:n,fn:s}])[`${s}_${n}`]),{columnHeaders:d,rows:f,columnTotals:p,grandTotal:h}}function od(e,t){return e.map((r,a)=>{const n={...r};for(const s of t)n[s.name]=s.formula(r,a,e);return n})}const id={runningSum:e=>(t,r,a)=>a.slice(0,r+1).reduce((n,s)=>n+Number(s[e]??0),0),runningAvg:e=>(t,r,a)=>{const n=a.slice(0,r+1);return n.reduce((s,i)=>s+Number(i[e]??0),0)/n.length},percentOfTotal:e=>(t,r,a)=>{const n=a.reduce((s,i)=>s+Number(i[e]??0),0);return n?Number(t[e]??0)/n*100:0},rank:(e,t="desc")=>(r,a,n)=>[...n].sort((i,o)=>{const l=Number(i[e]??0)-Number(o[e]??0);return t==="desc"?-l:l}).findIndex(i=>i===r)+1,diffFromPrevious:e=>(t,r,a)=>r===0?null:Number(t[e]??0)-Number(a[r-1][e]??0),percentChange:e=>(t,r,a)=>{if(r===0)return null;const n=Number(a[r-1][e]??0);return n===0?null:(Number(t[e]??0)-n)/n*100},movingAverage:(e,t)=>(r,a,n)=>{const s=Math.max(0,a-t+1),i=n.slice(s,a+1);return i.reduce((o,l)=>o+Number(l[e]??0),0)/i.length},conditional:(e,t,r)=>a=>e(a)?t:r,concat:(...e)=>t=>e.map(r=>t[r]??"").join(" "),formatDate:(e,t="medium")=>r=>{const a=r[e];return a?new Date(a).toLocaleDateString(void 0,{dateStyle:t}):""}};function cd(e,t){const r=[],a=new Map,n=new Map;for(let o=0;o<e.length;o++){const l=e[o];for(const d of t)if(!d.validate(l,o,e)){const u=typeof d.message=="function"?d.message(l):d.message,f={index:o,rule:d.name,message:u,severity:d.severity??"error",fields:d.fields??[],item:l};r.push(f),a.has(o)||a.set(o,[]),a.get(o).push(f);for(const p of f.fields)n.has(p)||n.set(p,[]),n.get(p).push(f)}}const s=r.filter(o=>o.severity==="error").length,i=r.filter(o=>o.severity==="warning").length;return{isValid:s===0,errorCount:s,warningCount:i,errors:r,byIndex:a,byField:n}}const ld={required:e=>({name:`required_${String(e)}`,validate:t=>t[e]!=null&&t[e]!=="",message:`${String(e)} is required`,fields:[String(e)]}),minLength:(e,t)=>({name:`minLength_${String(e)}`,validate:r=>String(r[e]??"").length>=t,message:`${String(e)} must be at least ${t} characters`,fields:[String(e)]}),maxLength:(e,t)=>({name:`maxLength_${String(e)}`,validate:r=>String(r[e]??"").length<=t,message:`${String(e)} must be at most ${t} characters`,fields:[String(e)]}),min:(e,t)=>({name:`min_${String(e)}`,validate:r=>Number(r[e])>=t,message:`${String(e)} must be at least ${t}`,fields:[String(e)]}),max:(e,t)=>({name:`max_${String(e)}`,validate:r=>Number(r[e])<=t,message:`${String(e)} must be at most ${t}`,fields:[String(e)]}),email:e=>({name:`email_${String(e)}`,validate:t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t[e]??"")),message:`${String(e)} must be a valid email`,fields:[String(e)]}),pattern:(e,t,r)=>({name:`pattern_${String(e)}`,validate:a=>t.test(String(a[e]??"")),message:r??`${String(e)} has invalid format`,fields:[String(e)]}),unique:e=>({name:`unique_${String(e)}`,validate:(t,r,a)=>{const n=t[e];return a.findIndex(s=>s[e]===n)===r},message:`${String(e)} must be unique`,fields:[String(e)]}),custom:(e,t,r,a)=>({name:e,validate:t,message:r,fields:a})},dd={async updateWhere(e,t,r){return e.map(a=>{if(!t(a))return a;const n=typeof r=="function"?r(a):r;return{...a,...n}})},async removeWhere(e,t){const r=[],a=[];for(const n of e)t(n)?a.push(n):r.push(n);return{remaining:r,removed:a}},async transform(e,t,r={}){const{parallel:a=!1,batchSize:n=10}=r,s=[],i=[];let o=0;if(a)for(let l=0;l<e.length;l+=n){const d=e.slice(l,l+n),u=await Promise.allSettled(d.map((f,p)=>t(f,l+p)));for(let f=0;f<u.length;f++){const p=u[f];p.status==="fulfilled"?(s.push(p.value),o++):i.push({index:l+f,item:d[f],error:p.reason})}}else for(let l=0;l<e.length;l++)try{const d=await t(e[l],l);s.push(d),o++}catch(d){i.push({index:l,item:e[l],error:d instanceof Error?d:new Error(String(d))})}return{succeeded:o,failed:i.length,errors:i,results:s}},deduplicate(e,t){const r=new Set;return e.filter(a=>{const n=a[t];return r.has(n)?!1:(r.add(n),!0)})},merge(e,t,r,a={}){const{updateExisting:n=!0,addNew:s=!0}=a,i=new Map(e.map(l=>[l[r],l])),o=[...e];for(const l of t){const d=l[r],u=i.get(d);if(u){if(n){const f=o.indexOf(u);o[f]={...u,...l}}}else s&&o.push(l)}return o}};function ud(e,t){const r=(t==null?void 0:t.autoLoad)??!0,a=(t==null?void 0:t.defaultPageSize)??20,[n,s]=c.useState([]),[i,o]=c.useState(0),[l,d]=c.useState(!1),[u,f]=c.useState(null),[p,h]=c.useState(1),[m,y]=c.useState(a),[g,v]=c.useState((t==null?void 0:t.defaultSort)??[]),[b,S]=c.useState(t==null?void 0:t.defaultFilter),[w,A]=c.useState((t==null?void 0:t.defaultSearch)??""),k=c.useRef(0),C=t==null?void 0:t.loadOptions,M=c.useCallback(async()=>{if(!e)return;const z=++k.current;d(!0),f(null);try{const H=await e.load({skip:(p-1)*m,take:m,sort:g.length?g:void 0,filter:b,search:w||void 0,...C});if(z!==k.current)return;s(H.data),o(H.totalCount)}catch(H){if(z!==k.current)return;f(H instanceof Error?H.message:String(H))}finally{z===k.current&&d(!1)}},[e,p,m,g,b,w,C]);c.useEffect(()=>{r&&M()},[M,r]),c.useEffect(()=>{if(e)return e.on("changed",()=>{M()})},[e,M]);const N=c.useCallback((z,H)=>{v([{field:z,direction:H}]),h(1)},[]),L=c.useCallback(z=>{S(z),h(1)},[]),E=c.useCallback(z=>{A(z),h(1)},[]),R=c.useCallback(z=>{y(z),h(1)},[]),T=c.useCallback(async z=>{if(!(e!=null&&e.insert))throw new Error("DataSource is not writable");await e.insert(z)},[e]),D=c.useCallback(async(z,H)=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");await e.update(z,H)},[e]),F=c.useCallback(async z=>{if(!(e!=null&&e.remove))throw new Error("DataSource is not writable");await e.remove(z)},[e]);return{data:n,totalCount:i,loading:l,error:u,page:p,pageSize:m,sort:g,filter:b,search:w,setPage:h,setPageSize:R,setSort:v,setSortField:N,setFilter:L,setSearch:E,reload:M,insert:T,update:D,remove:F}}function Ma(e,t){const[r,a]=c.useState(void 0),[n,s]=c.useState({}),[i,o]=c.useState(!1),[l,d]=c.useState(null),u=c.useRef(0),f=c.useCallback(async()=>{if(!e||t==null){a(void 0);return}const b=++u.current;o(!0),d(null);try{const S=await e.byKey(t);if(b!==u.current)return;a(S),s({})}catch(S){if(b!==u.current)return;d(S instanceof Error?S.message:String(S))}finally{b===u.current&&o(!1)}},[e,t]);c.useEffect(()=>{f()},[f]),c.useEffect(()=>{if(e)return e.on("changed",()=>{f()})},[e,f]);const p=c.useMemo(()=>({...r??{},...n}),[r,n]),h=Object.keys(n).length>0,m=c.useCallback((b,S)=>{s(w=>({...w,[b]:S}))},[]),y=c.useCallback(b=>{s(S=>({...S,...b}))},[]),g=c.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");h&&await e.update(t,n)},[e,t,n,h]),v=c.useCallback(()=>{s({})},[]);return{data:r,editData:p,loading:i,error:l,changes:n,isDirty:h,set:m,setMany:y,save:g,reload:f,reset:v}}function fd(e,t,r){const a=Ma(e,t),n=a.editData[r],s=c.useCallback(o=>{a.set(r,o)},[a,r]),i=c.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");const o={[r]:a.editData[r]};await e.update(t,o)},[e,t,r,a.editData]);return{value:n,setValue:s,loading:a.loading,error:a.error,isDirty:r in a.changes,save:i}}function md(e,t,r,a){const n=(a==null?void 0:a.autoLoad)??!0,s=(a==null?void 0:a.take)??200,[i,o]=c.useState([]),[l,d]=c.useState(!1),[u,f]=c.useState(null),p=c.useRef(0),h=c.useCallback(async g=>{if(!e)return;const v=++p.current;d(!0),f(null);try{const b=await e.load({take:s,search:g||void 0,searchFields:a==null?void 0:a.searchFields});if(v!==p.current)return;o(b.data)}catch(b){if(v!==p.current)return;f(b instanceof Error?b.message:String(b))}finally{v===p.current&&d(!1)}},[e,s,a==null?void 0:a.searchFields]);c.useEffect(()=>{n&&h()},[h,n]);const m=c.useMemo(()=>i.map(g=>{const v=g,b={value:String(v[t]??""),label:String(v[r]??"")};return a!=null&&a.iconField&&v[a.iconField]!=null&&(b.icon=v[a.iconField]),a!=null&&a.descriptionField&&v[a.descriptionField]!=null&&(b.description=String(v[a.descriptionField])),a!=null&&a.groupField&&v[a.groupField]!=null&&(b.group=String(v[a.groupField])),b}),[i,t,r,a==null?void 0:a.iconField,a==null?void 0:a.descriptionField,a==null?void 0:a.groupField]),y=c.useCallback(g=>{h(g)},[h]);return{options:m,loading:l,error:u,search:y,reload:()=>h()}}function nt(e){const{dbName:t,storeName:r,keyField:a="id",version:n=1,indexes:s=[]}=e;let i=null;const o=new Map;function l(m,...y){var g;(g=o.get(m))==null||g.forEach(v=>v(...y))}async function d(){return i||new Promise((m,y)=>{const g=indexedDB.open(t,n);g.onerror=()=>y(g.error),g.onsuccess=()=>{i=g.result,m(i)},g.onupgradeneeded=v=>{const b=v.target.result;if(!b.objectStoreNames.contains(r)){const S=b.createObjectStore(r,{keyPath:a});for(const w of s)S.createIndex(w.name,w.keyPath,{unique:w.unique??!1})}}})}async function u(m,y){const g=await d();return new Promise((v,b)=>{const w=g.transaction(r,m).objectStore(r),A=y(w);A.onsuccess=()=>v(A.result),A.onerror=()=>b(A.error)})}async function f(m,y,g){const v=await d();return new Promise((b,S)=>{var D;const A=v.transaction(r,m).objectStore(r),k=[];let C=A,M="next";if((D=y.sort)!=null&&D.length){const F=y.sort[0].field,z=y.sort[0].direction;A.indexNames.contains(F)&&(C=A.index(F)),M=z==="desc"?"prev":"next"}const N=C.openCursor(null,M);let L=0,E=0;const R=y.skip??0,T=y.take??1/0;N.onsuccess=()=>{const F=N.result;if(!F||E>=T){b(k);return}const z=F.value;if(y.filter&&!p(z,y.filter)){F.continue();return}if(y.search&&!h(z,y.search,y.searchFields)){F.continue();return}if(L<R){L++,F.continue();return}k.push(z),E++,F.continue()},N.onerror=()=>S(N.error)})}function p(m,y){if(!y.items.length)return!0;const g=v=>{if(v.type==="group")return p(m,v);const b=m[v.field],S=v.value;switch(v.operator){case"=":return b==S;case"<>":return b!=S;case"<":return b<S;case"<=":return b<=S;case">":return b>S;case">=":return b>=S;case"contains":return String(b??"").toLowerCase().includes(String(S??"").toLowerCase());case"notcontains":return!String(b??"").toLowerCase().includes(String(S??"").toLowerCase());case"startswith":return String(b??"").toLowerCase().startsWith(String(S??"").toLowerCase());case"endswith":return String(b??"").toLowerCase().endsWith(String(S??"").toLowerCase());case"isblank":return b==null||b==="";case"isnotblank":return b!=null&&b!=="";default:return!0}};return y.logic==="and"?y.items.every(g):y.items.some(g)}function h(m,y,g){const v=y.toLowerCase();return(g?g.map(S=>m[S]):Object.values(m)).some(S=>String(S??"").toLowerCase().includes(v))}return{keyField:a,writable:!0,async load(m={}){var y;l("loading",!0);try{const g=await f("readonly",m,()=>{});(y=m.sort)!=null&&y.length&&g.sort((S,w)=>{for(const A of m.sort){const k=S[A.field]??"",C=w[A.field]??"",M=typeof k=="number"&&typeof C=="number"?k-C:String(k).localeCompare(String(C));if(M!==0)return A.direction==="desc"?-M:M}return 0});const v=await this.count(),b={data:g,totalCount:v};return l("loaded",b),l("loading",!1),b}catch(g){throw l("error",g),l("loading",!1),g}},async byKey(m){return u("readonly",y=>y.get(m))},async insert(m){return await u("readwrite",y=>y.add(m)),l("changed"),m},async update(m,y){const g=await this.byKey(m);if(!g)throw new Error(`Record not found: ${m}`);const v={...g,...y};return await u("readwrite",b=>b.put(v)),l("changed"),v},async remove(m){await u("readwrite",y=>y.delete(m)),l("changed")},on(m,y){return o.has(m)||o.set(m,new Set),o.get(m).add(y),()=>{var g;return(g=o.get(m))==null?void 0:g.delete(y)}},async clear(){await u("readwrite",m=>m.clear()),l("changed")},async count(){return u("readonly",m=>m.count())},async getAll(){return u("readonly",m=>m.getAll())},async bulkInsert(m){const y=await d();return new Promise((g,v)=>{const b=y.transaction(r,"readwrite"),S=b.objectStore(r);for(const w of m)S.put(w);b.oncomplete=()=>{l("changed"),g()},b.onerror=()=>v(b.error)})},async bulkDelete(m){const y=await d();return new Promise((g,v)=>{const b=y.transaction(r,"readwrite"),S=b.objectStore(r);for(const w of m)S.delete(w);b.oncomplete=()=>{l("changed"),g()},b.onerror=()=>v(b.error)})},async exportData(){return this.getAll()},async importData(m){await this.clear(),await this.bulkInsert(m)}}}function pd(e){const{remoteSource:t,offlineConfig:r,syncStrategy:a="remote-first",onConflict:n,onSync:s,autoSyncInterval:i=0}=e,o=r.keyField??t.keyField,l=nt({...r,keyField:o}),d=nt({dbName:r.dbName,storeName:`${r.storeName}_pending`,keyField:"id"});let u=navigator.onLine,f=0;const p=new Map;function h(g,...v){var b;(b=p.get(g))==null||b.forEach(S=>S(...v))}window.addEventListener("online",()=>{u=!0,h("online"),y()}),window.addEventListener("offline",()=>{u=!1,h("offline")});async function m(g,v,b){const S={id:`pending_${++f}_${Date.now()}`,action:g,key:v,data:b,timestamp:Date.now(),retries:0};await d.insert(S)}async function y(){if(u){h("syncing",!0);try{let g=0,v=0,b=0;const S=await d.load();for(const w of S.data)try{switch(w.action){case"insert":await t.insert(w.data),g++;break;case"update":await t.update(w.key,w.data),v++;break;case"remove":await t.remove(w.key),b++;break}await d.remove(w.id)}catch{w.retries<3&&await d.update(w.id,{retries:w.retries+1})}if(a!=="local-first"){const w=await t.load();if(a==="remote-first")await l.importData(w.data);else if(a==="merge"&&n){const A=await l.load(),k=new Map(A.data.map(M=>[M[o],M])),C=[];for(const M of w.data){const N=k.get(M[o]);N?C.push(n(N,M)):C.push(M)}await l.importData(C)}}h("synced",{added:g,updated:v,removed:b}),s==null||s({added:g,updated:v,removed:b})}catch(g){h("syncError",g)}finally{h("syncing",!1)}}}return i>0&&window.setInterval(y,i),{keyField:o,writable:!0,async load(g={}){if(u&&a==="remote-first")try{const v=await t.load(g);return await l.bulkInsert(v.data),v}catch{}return l.load(g)},async byKey(g){if(u)try{const v=await t.byKey(g);return v&&await l.update(g,v).catch(()=>l.insert(v)),v}catch{}return l.byKey(g)},async insert(g){const v=await l.insert(g);if(u)try{return await t.insert(g)}catch{await m("insert",void 0,g)}else await m("insert",void 0,g);return h("changed"),v},async update(g,v){const b=await l.update(g,v);if(u)try{return await t.update(g,v)}catch{await m("update",g,v)}else await m("update",g,v);return h("changed"),b},async remove(g){if(await l.remove(g),u)try{await t.remove(g)}catch{await m("remove",g)}else await m("remove",g);h("changed")},on(g,v){return p.has(g)||p.set(g,new Set),p.get(g).add(v),()=>{var b;return(b=p.get(g))==null?void 0:b.delete(v)}},sync:y,isOnline:()=>u,async getPendingChanges(){return(await d.load()).data},async clearPendingChanges(){await d.clear()}}}function gd(e){const{channelName:t,source:r}=e,a=new BroadcastChannel(t),n=new Map;function s(o,...l){var d;(d=n.get(o))==null||d.forEach(u=>u(...l))}a.onmessage=o=>{const l=o.data;switch(l.type){case"insert":case"update":case"remove":s("changed"),s("crossTabChange",l);break;case"refresh":s("refresh");break;case"request-sync":r.load().then(d=>{a.postMessage({type:"sync-data",data:d.data})});break}};function i(o){a.postMessage(o)}return{...r,async insert(o){const l=await r.insert(o);return i({type:"insert",data:l}),l},async update(o,l){const d=await r.update(o,l);return i({type:"update",key:o,changes:l}),d},async remove(o){await r.remove(o),i({type:"remove",key:o})},on(o,l){n.has(o)||n.set(o,new Set),n.get(o).add(l);const d=r.on(o,l);return()=>{var u;(u=n.get(o))==null||u.delete(l),d()}},broadcast:i,requestSync(){i({type:"request-sync"})}}}function yd(e={}){const{prefix:t="",persist:r={filter:!0,sort:!0,page:!0,search:!0},useHash:a=!1}=e;function n(){return a?new URLSearchParams(window.location.hash.slice(1)):new URLSearchParams(window.location.search)}function s(o){if(a)window.location.hash=o.toString();else{const l=new URL(window.location.href);l.search=o.toString(),window.history.replaceState({},"",l.toString())}}function i(o){return t?`${t}_${o}`:o}return{read(){const o=n(),l={};if(r.filter){const d=o.get(i("filter"));if(d)try{l.filter=JSON.parse(d)}catch{}}if(r.sort){const d=o.get(i("sort"));if(d)try{l.sort=JSON.parse(d)}catch{}}if(r.page){const d=o.get(i("skip")),u=o.get(i("take"));d&&(l.skip=parseInt(d,10)),u&&(l.take=parseInt(u,10))}if(r.search){const d=o.get(i("search"));d&&(l.search=d)}return l},write(o){const l=n();r.filter&&(o.filter&&o.filter.items.length>0?l.set(i("filter"),JSON.stringify(o.filter)):l.delete(i("filter"))),r.sort&&(o.sort&&o.sort.length>0?l.set(i("sort"),JSON.stringify(o.sort)):l.delete(i("sort"))),r.page&&(o.skip?l.set(i("skip"),String(o.skip)):l.delete(i("skip")),o.take?l.set(i("take"),String(o.take)):l.delete(i("take"))),r.search&&(o.search?l.set(i("search"),o.search):l.delete(i("search"))),s(l)},clear(){const o=n();o.delete(i("filter")),o.delete(i("sort")),o.delete(i("skip")),o.delete(i("take")),o.delete(i("search")),s(o)},toLoadOptions(){const o=this.read();return{filter:o.filter,sort:o.sort,skip:o.skip,take:o.take,search:o.search}}}}const hd={async exportToJSON(e,t){const r=await e.load(),a={version:"1.0",timestamp:Date.now(),data:r.data,metadata:t};return JSON.stringify(a,null,2)},async importFromJSON(e,t,r={}){const n=JSON.parse(t).data;let s=0,i=0;r.replace&&"clear"in e&&await e.clear();for(const o of n){if(r.validate&&!r.validate(o)){i++;continue}try{await e.insert(o),s++}catch{i++}}return{imported:s,skipped:i}},async downloadAsJSON(e,t="export.json"){const r=await this.exportToJSON(e),a=new Blob([r],{type:"application/json"}),n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download=t,s.click(),URL.revokeObjectURL(n)},async importFromFile(e,t,r){const a=await t.text();return this.importFromJSON(e,a,r)}};function bd(e="nice_user_prefs"){let t=null;function r(){if(t)return t;try{const n=localStorage.getItem(e);t=n?JSON.parse(n):{}}catch{t={}}return t}function a(n){t=n,localStorage.setItem(e,JSON.stringify(n))}return{get(n,s){return r()[n]??s},set(n,s){const i=r();i[n]=s,a(i)},remove(n){const s=r();delete s[n],a(s)},getAll(){return{...r()}},setAll(n){a(n)},clear(){t={},localStorage.removeItem(e)},merge(n){a({...r(),...n})}}}const Ca={"colors.primary":"--color-primary","colors.primaryHover":"--color-primary-hover","colors.success":"--color-success","colors.warning":"--color-warning","colors.error":"--color-error","colors.info":"--color-info","colors.accent":"--color-accent","colors.accentHover":"--color-accent-hover","colors.link":"--color-link","colors.linkHover":"--color-link-hover","colors.focus":"--color-focus","colors.overlay":"--color-overlay","colors.surface":"--color-surface","colors.surfaceHover":"--color-surface-hover","colors.disabled":"--color-disabled","colors.disabledText":"--color-disabled-text","backgrounds.primary":"--bg-primary","backgrounds.secondary":"--bg-secondary","backgrounds.tertiary":"--bg-tertiary","backgrounds.hover":"--hover-bg","backgrounds.elevated":"--bg-elevated","backgrounds.inset":"--bg-inset","backgrounds.canvas":"--bg-canvas","text.primary":"--text-primary","text.secondary":"--text-secondary","text.muted":"--text-muted","text.inverse":"--text-inverse","text.onPrimary":"--text-on-primary","text.onAccent":"--text-on-accent","borders.color":"--border-color","borders.radiusSm":"--nice-radius-sm","borders.radiusMd":"--nice-radius-md","borders.radiusLg":"--nice-radius-lg","borders.radiusXl":"--nice-radius-xl","borders.radiusFull":"--nice-radius-full","borders.width":"--border-width","borders.focusColor":"--border-focus-color","borders.divider":"--border-divider","shadows.sm":"--shadow-sm","shadows.md":"--shadow-md","shadows.lg":"--shadow-lg","shadows.xl":"--shadow-xl","shadows.inner":"--shadow-inner","shadows.glow":"--shadow-glow","spacing.space1":"--nice-space-1","spacing.space2":"--nice-space-2","spacing.space3":"--nice-space-3","spacing.space4":"--nice-space-4","spacing.space5":"--nice-space-5","spacing.space6":"--nice-space-6","spacing.space8":"--nice-space-8","spacing.space10":"--nice-space-10","spacing.space12":"--nice-space-12","spacing.space16":"--nice-space-16","typography.fontFamily":"--nice-font-family","typography.fontSizeXs":"--nice-font-size-xs","typography.fontSizeSm":"--nice-font-size-sm","typography.fontSizeMd":"--nice-font-size-md","typography.fontSizeLg":"--nice-font-size-lg","typography.fontSizeXl":"--nice-font-size-xl","typography.fontSize2xl":"--nice-font-size-2xl","typography.fontSize3xl":"--nice-font-size-3xl","typography.fontWeightNormal":"--nice-font-weight-normal","typography.fontWeightMedium":"--nice-font-weight-medium","typography.fontWeightSemibold":"--nice-font-weight-semibold","typography.fontWeightBold":"--nice-font-weight-bold","typography.lineHeight":"--nice-line-height","typography.headingFontFamily":"--nice-heading-font-family","typography.monoFontFamily":"--nice-mono-font-family","typography.letterSpacing":"--nice-letter-spacing","typography.headingLetterSpacing":"--nice-heading-letter-spacing","transitions.fast":"--nice-transition-fast","transitions.normal":"--nice-transition","transitions.slow":"--nice-transition-slow"};function vd(e,t){return t.split(".").reduce((r,a)=>{if(r&&typeof r=="object")return r[a]},e)}function De(e){var r;const t={};for(const[a,n]of Object.entries(Ca)){const s=vd(e,a);s!==void 0&&(t[n]=String(s))}if(e.nesting)for(const a of["sidebar","menu","tree"]){const n=e.nesting[a];if(!n)continue;const s=e.backgrounds.secondary||e.backgrounds.primary||"#ffffff",i=((r=e.text)==null?void 0:r.primary)||"#111111";Object.assign(t,Rd(a,n,s,i))}return t}function Sd(e,t){const r=t??document.documentElement,a=De(e);for(const[n,s]of Object.entries(a))r.style.setProperty(n,s);wd(e.backgroundImage,r),e.darkMode&&(r.dataset.ntdColorScheme=e.darkMode)}const xd={dots:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="currentColor" opacity="0.15"/></svg>',grid:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M20 0H0v20" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',diagonal:'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0" stroke="currentColor" stroke-opacity="0.08"/></svg>',"cross-hatch":'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0M-1 1L1 -1M9 11L11 9" stroke="currentColor" stroke-opacity="0.06"/></svg>',waves:'<svg width="40" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6c5 0 5-6 10-6s5 6 10 6 5-6 10-6 5 6 10 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',hexagons:'<svg width="28" height="49" xmlns="http://www.w3.org/2000/svg"><path d="M14 0l14 8.5v16L14 33 0 24.5v-16z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',triangles:'<svg width="20" height="17" xmlns="http://www.w3.org/2000/svg"><path d="M0 17L10 0l10 17z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',circles:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="6" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',zigzag:'<svg width="20" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6l5-6 5 6 5-6 5 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',noise:'<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency=".9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#n)"/></svg>'};function wd(e,t){if(t.style.removeProperty("--ntd-bg-image"),t.style.removeProperty("--ntd-bg-image-size"),t.style.removeProperty("--ntd-bg-image-position"),t.style.removeProperty("--ntd-bg-image-attachment"),t.style.removeProperty("--ntd-bg-image-repeat"),t.style.removeProperty("--ntd-bg-image-opacity"),t.style.removeProperty("--ntd-bg-image-blend"),!(!e||e.type==="none")){if(e.type==="gradient"&&e.gradient)t.style.setProperty("--ntd-bg-image",e.gradient);else if(e.type==="image"&&e.imageUrl)t.style.setProperty("--ntd-bg-image",`url("${e.imageUrl}")`),e.imageSize&&t.style.setProperty("--ntd-bg-image-size",e.imageSize),e.imagePosition&&t.style.setProperty("--ntd-bg-image-position",e.imagePosition),e.imageAttachment&&t.style.setProperty("--ntd-bg-image-attachment",e.imageAttachment),e.imageRepeat&&t.style.setProperty("--ntd-bg-image-repeat",e.imageRepeat);else if(e.type==="pattern"&&e.pattern){const r=xd[e.pattern];if(r){const a=`url("data:image/svg+xml,${encodeURIComponent(r)}")`;t.style.setProperty("--ntd-bg-image",a),t.style.setProperty("--ntd-bg-image-repeat","repeat")}}e.opacity!==void 0&&t.style.setProperty("--ntd-bg-image-opacity",String(e.opacity)),e.blendMode&&t.style.setProperty("--ntd-bg-image-blend",e.blendMode)}}function Aa(e){const t=e??document.documentElement;for(const r of Object.values(Ca))t.style.removeProperty(r);for(const r of["--ntd-bg-image","--ntd-bg-image-size","--ntd-bg-image-position","--ntd-bg-image-attachment","--ntd-bg-image-repeat","--ntd-bg-image-opacity","--ntd-bg-image-blend"])t.style.removeProperty(r);delete t.dataset.ntdColorScheme,delete t.dataset.theme,t.classList.remove("nice-dark");for(const r of["sidebar","menu","tree"]){t.style.removeProperty(`--nice-${r}-levels`);for(let a=1;a<=10;a++)t.style.removeProperty(`--nice-${r}-level-${a}-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-text`),t.style.removeProperty(`--nice-${r}-level-${a}-hover-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-active-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-border`)}}function kd(e){const t=e??document.documentElement,r=getComputedStyle(t),a=i=>r.getPropertyValue(i).trim(),n=i=>parseFloat(r.getPropertyValue(i))||0,s=i=>a(i)||void 0;return{name:"Current",colors:{primary:a("--color-primary"),primaryHover:a("--color-primary-hover"),success:a("--color-success"),warning:a("--color-warning"),error:a("--color-error"),info:a("--color-info"),accent:s("--color-accent"),accentHover:s("--color-accent-hover"),link:s("--color-link"),linkHover:s("--color-link-hover"),focus:s("--color-focus"),overlay:s("--color-overlay"),surface:s("--color-surface"),surfaceHover:s("--color-surface-hover"),disabled:s("--color-disabled"),disabledText:s("--color-disabled-text")},backgrounds:{primary:a("--bg-primary"),secondary:a("--bg-secondary"),tertiary:a("--bg-tertiary"),hover:a("--hover-bg"),elevated:s("--bg-elevated"),inset:s("--bg-inset"),canvas:s("--bg-canvas")},text:{primary:a("--text-primary"),secondary:a("--text-secondary"),muted:a("--text-muted"),inverse:s("--text-inverse"),onPrimary:s("--text-on-primary"),onAccent:s("--text-on-accent")},borders:{color:a("--border-color"),radiusSm:a("--nice-radius-sm"),radiusMd:a("--nice-radius-md"),radiusLg:a("--nice-radius-lg"),radiusXl:a("--nice-radius-xl"),radiusFull:a("--nice-radius-full"),width:s("--border-width"),focusColor:s("--border-focus-color"),divider:s("--border-divider")},shadows:{sm:a("--shadow-sm"),md:a("--shadow-md"),lg:a("--shadow-lg"),xl:a("--shadow-xl"),inner:s("--shadow-inner"),glow:s("--shadow-glow")},spacing:{space1:a("--nice-space-1"),space2:a("--nice-space-2"),space3:a("--nice-space-3"),space4:a("--nice-space-4"),space5:a("--nice-space-5"),space6:a("--nice-space-6"),space8:a("--nice-space-8"),space10:s("--nice-space-10"),space12:s("--nice-space-12"),space16:s("--nice-space-16")},typography:{fontFamily:a("--nice-font-family"),fontSizeXs:a("--nice-font-size-xs"),fontSizeSm:a("--nice-font-size-sm"),fontSizeMd:a("--nice-font-size-md"),fontSizeLg:a("--nice-font-size-lg"),fontSizeXl:a("--nice-font-size-xl"),fontWeightNormal:n("--nice-font-weight-normal"),fontWeightMedium:n("--nice-font-weight-medium"),fontWeightSemibold:n("--nice-font-weight-semibold"),fontWeightBold:n("--nice-font-weight-bold"),lineHeight:n("--nice-line-height"),headingFontFamily:s("--nice-heading-font-family"),monoFontFamily:s("--nice-mono-font-family"),fontSize2xl:s("--nice-font-size-2xl"),fontSize3xl:s("--nice-font-size-3xl"),letterSpacing:s("--nice-letter-spacing"),headingLetterSpacing:s("--nice-heading-letter-spacing")},transitions:{fast:a("--nice-transition-fast"),normal:a("--nice-transition"),slow:a("--nice-transition-slow")},darkMode:t.dataset.ntdColorScheme??void 0}}function Md(e){return JSON.stringify(e,null,2)}function Cd(e){const t=JSON.parse(e);if(!t||typeof t!="object"||!t.name||!t.colors||!t.backgrounds)throw new Error("Invalid theme format: missing required fields (name, colors, backgrounds)");return t}const Ad=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,Ed=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;function st(e){if(!e)return null;const t=e.trim();let r=t.match(Ed);if(r)return{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)};if(r=t.match(Ad),r)return{r:parseInt(r[1]+r[1],16),g:parseInt(r[2]+r[2],16),b:parseInt(r[3]+r[3],16)};const a=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);return a?{r:+a[1],g:+a[2],b:+a[3]}:null}function Nd({r:e,g:t,b:r}){const a=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${a(e)}${a(t)}${a(r)}`}function Tt(e,t,r){const a=st(e),n=st(t);return!a||!n?e:Nd({r:a.r+(n.r-a.r)*r,g:a.g+(n.g-a.g)*r,b:a.b+(n.b-a.b)*r})}function ot(e,t){return Tt(e,"#ffffff",t)}function it(e,t){return Tt(e,"#000000",t)}function ct(e){const t=st(e);if(!t)return 1;const r=a=>{const n=a/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)};return .2126*r(t.r)+.7152*r(t.g)+.0722*r(t.b)}function Ld(e,t,r){return ct(e)>.5?r:t}function Td(e,t,r){const a=t.palette??[],n=t.bgStep??.06,s=a[0]??r;switch(t.bgDerivation??"tint"){case"palette":return a.length===0?r:a[(e-1)%a.length];case"shade":return it(s,Math.min(.9,n*(e-1)));case"mix-surface":return Tt(s,r,Math.min(1,n*(e-1)));case"tint":default:return ot(s,Math.min(.9,n*(e-1)))}}function Rd(e,t,r,a){var i;const n={},s=Math.max(1,Math.min(10,t.levels??5));for(let o=1;o<=s;o++){const l=(i=t.overrides)==null?void 0:i[o],d=(l==null?void 0:l.background)??Td(o,t,r),u=(l==null?void 0:l.text)??Ld(d,"#ffffff",a),f=(l==null?void 0:l.hoverBackground)??(ct(d)>.5?it(d,.06):ot(d,.08)),p=(l==null?void 0:l.activeBackground)??(ct(d)>.5?it(d,.12):ot(d,.16)),h=l==null?void 0:l.border;n[`--nice-${e}-level-${o}-bg`]=d,n[`--nice-${e}-level-${o}-text`]=u,n[`--nice-${e}-level-${o}-hover-bg`]=f,n[`--nice-${e}-level-${o}-active-bg`]=p,h&&(n[`--nice-${e}-level-${o}-border`]=h)}return n[`--nice-${e}-levels`]=String(s),n}const Rt=c.createContext(null);function Id(){const e=c.useContext(Rt);if(!e)throw new Error("useNiceTheme must be used within a NiceThemeProvider");return e}const we={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},ke={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Me={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},It=e=>({color:e,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),Ea={sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},zd={sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 4px 6px -1px rgba(0,0,0,0.4)",lg:"0 10px 15px -3px rgba(0,0,0,0.4)",xl:"0 20px 25px -5px rgba(0,0,0,0.4)"};function I(e,t,r,a,n){return{name:e,darkMode:"light",colors:{...t,surface:t.surface??r.primary,surfaceHover:t.surfaceHover??r.secondary},backgrounds:{...r,elevated:r.elevated??r.primary,inset:r.inset??r.tertiary,canvas:r.canvas??r.primary},text:{...a,inverse:a.inverse??"#ffffff"},borders:It(n),shadows:Ea,spacing:we,typography:ke,transitions:Me}}function O(e,t,r,a,n){return{name:e,darkMode:"dark",colors:{...t,surface:t.surface??r.secondary,surfaceHover:t.surfaceHover??r.tertiary},backgrounds:{...r,elevated:r.elevated??r.secondary,inset:r.inset??r.primary,canvas:r.canvas??r.primary},text:{...a,inverse:a.inverse??"#0f172a"},borders:It(n),shadows:zd,spacing:we,typography:ke,transitions:Me}}const Na=I("Slate",{primary:"#64748b",primaryHover:"#475569",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},"#cbd5e1"),La=I("Zinc",{primary:"#71717a",primaryHover:"#52525b",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fafafa",secondary:"#f4f4f5",tertiary:"#e4e4e7",hover:"#e4e4e7"},{primary:"#18181b",secondary:"#3f3f46",muted:"#a1a1aa"},"#d4d4d8"),Ta=I("Stone",{primary:"#78716c",primaryHover:"#57534e",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#1c1917",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),Ra=I("Cool Gray",{primary:"#6b7280",primaryHover:"#4b5563",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#d1d5db"),Ia=I("Warm Gray",{primary:"#7c7568",primaryHover:"#5c564c",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf9f7",secondary:"#f5f4f0",tertiary:"#e8e6e1",hover:"#e8e6e1"},{primary:"#1f1d19",secondary:"#4a463d",muted:"#a09888"},"#d4d0c8"),za=I("Silver",{primary:"#94a3b8",primaryHover:"#64748b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#38bdf8"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#334155",secondary:"#64748b",muted:"#94a3b8"},"#cbd5e1"),Da=I("Charcoal",{primary:"#374151",primaryHover:"#1f2937",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#6b7280"},"#d1d5db"),Pa=I("Ivory",{primary:"#92876d",primaryHover:"#7a6f55",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffef7",secondary:"#faf6eb",tertiary:"#f0ead6",hover:"#f0ead6"},{primary:"#2b2517",secondary:"#5c5340",muted:"#9c9280"},"#ddd8c4"),Fa=I("Rose",{primary:"#e11d48",primaryHover:"#be123c",success:"#16a34a",warning:"#ea580c",error:"#dc2626",info:"#0891b2"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f43f5e"},"#fda4af"),Ha=I("Emerald",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#34d399"},"#6ee7b7"),$a=I("Amber",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0284c7"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#f59e0b"},"#fcd34d"),ja=I("Violet",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#2e1065",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),Ba=I("Teal",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),Oa=I("Indigo",{primary:"#4f46e5",primaryHover:"#4338ca",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#eef2ff",secondary:"#e0e7ff",tertiary:"#c7d2fe",hover:"#e0e7ff"},{primary:"#1e1b4b",secondary:"#312e81",muted:"#818cf8"},"#a5b4fc"),_a=I("Cyan",{primary:"#0891b2",primaryHover:"#0e7490",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#0284c7"},{primary:"#ecfeff",secondary:"#cffafe",tertiary:"#a5f3fc",hover:"#cffafe"},{primary:"#164e63",secondary:"#155e75",muted:"#22d3ee"},"#67e8f9"),Wa=I("Lime",{primary:"#65a30d",primaryHover:"#4d7c0f",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f7fee7",secondary:"#ecfccb",tertiary:"#d9f99d",hover:"#ecfccb"},{primary:"#1a2e05",secondary:"#365314",muted:"#84cc16"},"#bef264"),Va=I("Pink",{primary:"#db2777",primaryHover:"#be185d",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#500724",secondary:"#831843",muted:"#f472b6"},"#f9a8d4"),Xa=I("Orange",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#7c2d12",muted:"#fb923c"},"#fdba74"),Ua=I("Fuchsia",{primary:"#c026d3",primaryHover:"#a21caf",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf4ff",secondary:"#fae8ff",tertiary:"#f5d0fe",hover:"#fae8ff"},{primary:"#4a044e",secondary:"#701a75",muted:"#d946ef"},"#e879f9"),qa=I("Sky",{primary:"#0284c7",primaryHover:"#0369a1",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#075985",muted:"#38bdf8"},"#7dd3fc"),Ga=I("Ruby",{primary:"#be123c",primaryHover:"#9f1239",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#fb7185"},"#fda4af"),Ka=I("Coral",{primary:"#f97316",primaryHover:"#ea580c",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#fb923c"},"#fdba74"),Ja=O("Midnight",{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#020617",secondary:"#0f172a",tertiary:"#1e293b",hover:"#1e293b"},{primary:"#f1f5f9",secondary:"#94a3b8",muted:"#475569"},"#1e293b"),Ya=O("Obsidian",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#38bdf8"},{primary:"#09090b",secondary:"#18181b",tertiary:"#27272a",hover:"#27272a"},{primary:"#fafafa",secondary:"#a1a1aa",muted:"#52525b"},"#3f3f46"),Qa=O("Eclipse",{primary:"#c084fc",primaryHover:"#a855f7",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#67e8f9"},{primary:"#0c0a1d",secondary:"#1a1533",tertiary:"#2a2248",hover:"#2a2248"},{primary:"#f5f3ff",secondary:"#a78bfa",muted:"#6d5eac"},"#3b3266"),Za=O("Onyx",{primary:"#60a5fa",primaryHover:"#3b82f6",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#000000",secondary:"#0a0a0a",tertiary:"#171717",hover:"#171717"},{primary:"#ffffff",secondary:"#a3a3a3",muted:"#525252"},"#262626"),en=O("Carbon",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#67e8f9"},{primary:"#161616",secondary:"#262626",tertiary:"#393939",hover:"#393939"},{primary:"#f4f4f4",secondary:"#c6c6c6",muted:"#6f6f6f"},"#525252"),tn=O("Cosmos",{primary:"#6366f1",primaryHover:"#4f46e5",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#030712",secondary:"#111827",tertiary:"#1f2937",hover:"#1f2937"},{primary:"#e5e7eb",secondary:"#9ca3af",muted:"#4b5563"},"#374151"),rn=O("Nebula",{primary:"#e879f9",primaryHover:"#d946ef",success:"#4ade80",warning:"#fbbf24",error:"#fb7185",info:"#67e8f9"},{primary:"#0d0117",secondary:"#1a0533",tertiary:"#2d0a52",hover:"#2d0a52"},{primary:"#fae8ff",secondary:"#d8b4fe",muted:"#7c3aed"},"#581c87"),an=O("Abyss",{primary:"#22d3ee",primaryHover:"#06b6d4",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#001219",secondary:"#002a3a",tertiary:"#003e54",hover:"#003e54"},{primary:"#e0f2fe",secondary:"#7dd3fc",muted:"#0369a1"},"#075985"),nn=O("Shadow",{primary:"#a3a3a3",primaryHover:"#737373",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#38bdf8"},{primary:"#171717",secondary:"#1f1f1f",tertiary:"#2a2a2a",hover:"#2a2a2a"},{primary:"#e5e5e5",secondary:"#a3a3a3",muted:"#525252"},"#404040"),sn=O("Emerald Dark",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#022c22",secondary:"#064e3b",tertiary:"#065f46",hover:"#065f46"},{primary:"#ecfdf5",secondary:"#6ee7b7",muted:"#047857"},"#047857"),on=I("Forest",{primary:"#166534",primaryHover:"#14532d",success:"#22c55e",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),cn=I("Ocean",{primary:"#0369a1",primaryHover:"#075985",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#38bdf8"},"#7dd3fc"),ln=I("Desert",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#422006",secondary:"#713f12",muted:"#ca8a04"},"#fde047"),dn=I("Sunset",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#f97316"},"#fdba74"),un=I("Aurora",{primary:"#0d9488",primaryHover:"#0f766e",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),fn=I("Lavender",{primary:"#7e22ce",primaryHover:"#6b21a8",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#3b0764",secondary:"#581c87",muted:"#a855f7"},"#d8b4fe"),mn=I("Autumn",{primary:"#c2410c",primaryHover:"#9a3412",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#7f1d1d",muted:"#f87171"},"#fca5a5"),pn=I("Spring",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#14532d",secondary:"#166534",muted:"#4ade80"},"#86efac"),gn=I("Arctic",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),yn=I("Tropical",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),hn=I("Pastel Rose",{primary:"#f472b6",primaryHover:"#ec4899",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#f9a8d4"),bn=I("Pastel Sky",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#075985",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),vn=I("Pastel Mint",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#065f46",secondary:"#047857",muted:"#6ee7b7"},"#a7f3d0"),Sn=I("Pastel Peach",{primary:"#fb923c",primaryHover:"#f97316",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#7c2d12",secondary:"#9a3412",muted:"#fdba74"},"#fed7aa"),xn=I("Pastel Lavender",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#4c1d95",secondary:"#5b21b6",muted:"#c4b5fd"},"#ddd6fe"),wn=I("Pastel Lemon",{primary:"#facc15",primaryHover:"#eab308",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#713f12",secondary:"#854d0e",muted:"#fde047"},"#fef08a"),kn=I("Pastel Sage",{primary:"#86efac",primaryHover:"#4ade80",success:"#22c55e",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#166534",secondary:"#15803d",muted:"#86efac"},"#bbf7d0"),Mn=I("Pastel Coral",{primary:"#fb7185",primaryHover:"#f43f5e",success:"#4ade80",warning:"#fcd34d",error:"#ef4444",info:"#67e8f9"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#881337",secondary:"#9f1239",muted:"#fda4af"},"#fecdd3"),Cn=I("Banking",{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#334155",muted:"#94a3b8"},"#cbd5e1"),An=I("Healthcare",{primary:"#0891b2",primaryHover:"#0e7490",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#e0f7fa",tertiary:"#b2ebf2",hover:"#e0f7fa"},{primary:"#134e4a",secondary:"#1a6b6a",muted:"#80cbc4"},"#b2dfdb"),En=I("Legal",{primary:"#1e293b",primaryHover:"#0f172a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#0f172a",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),Nn=I("Tech Startup",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#1e1b4b",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),Ln=I("Enterprise",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#60a5fa"},"#93c5fd"),Tn=I("Government",{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#1e293b",muted:"#64748b"},"#cbd5e1"),Rn=I("Education",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#0891b2"},{primary:"#f0fdf9",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),In=I("Real Estate",{primary:"#92400e",primaryHover:"#78350f",success:"#059669",warning:"#b45309",error:"#dc2626",info:"#0891b2"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#422006",secondary:"#713f12",muted:"#d97706"},"#fcd34d"),zn=I("Nord",{primary:"#5e81ac",primaryHover:"#4c6b90",success:"#a3be8c",warning:"#ebcb8b",error:"#bf616a",info:"#88c0d0"},{primary:"#eceff4",secondary:"#e5e9f0",tertiary:"#d8dee9",hover:"#d8dee9"},{primary:"#2e3440",secondary:"#3b4252",muted:"#4c566a"},"#d8dee9"),Dn=O("Dracula",{primary:"#bd93f9",primaryHover:"#9d79d9",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#8be9fd"},{primary:"#282a36",secondary:"#343746",tertiary:"#44475a",hover:"#44475a"},{primary:"#f8f8f2",secondary:"#c0c0c0",muted:"#6272a4"},"#44475a"),Pn=I("Solarized Light",{primary:"#268bd2",primaryHover:"#1a6da0",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#fdf6e3",secondary:"#eee8d5",tertiary:"#e0dbc7",hover:"#eee8d5"},{primary:"#073642",secondary:"#586e75",muted:"#93a1a1"},"#eee8d5"),Fn=O("Solarized Dark",{primary:"#268bd2",primaryHover:"#3d98db",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#002b36",secondary:"#073642",tertiary:"#0a4858",hover:"#073642"},{primary:"#eee8d5",secondary:"#93a1a1",muted:"#586e75"},"#073642"),Hn=O("Monokai",{primary:"#66d9ef",primaryHover:"#45c0d6",success:"#a6e22e",warning:"#e6db74",error:"#f92672",info:"#66d9ef"},{primary:"#272822",secondary:"#34352e",tertiary:"#3e3d32",hover:"#3e3d32"},{primary:"#f8f8f2",secondary:"#cfcfc2",muted:"#75715e"},"#3e3d32"),$n=O("One Dark",{primary:"#61afef",primaryHover:"#4b9ee0",success:"#98c379",warning:"#e5c07b",error:"#e06c75",info:"#56b6c2"},{primary:"#282c34",secondary:"#2c313a",tertiary:"#353b45",hover:"#353b45"},{primary:"#abb2bf",secondary:"#828997",muted:"#545862"},"#3e4452"),jn=O("Synthwave",{primary:"#ff7edb",primaryHover:"#e660c2",success:"#72f1b8",warning:"#fede5d",error:"#fe4450",info:"#36f9f6"},{primary:"#241b2f",secondary:"#2d2140",tertiary:"#362a50",hover:"#362a50"},{primary:"#f0e4fc",secondary:"#b4a0cc",muted:"#6c5c84"},"#4a3866"),Bn=I("Vaporwave",{primary:"#ff71ce",primaryHover:"#e655b5",success:"#78dcca",warning:"#ffb86c",error:"#ff5555",info:"#76e8fc"},{primary:"#fce4f7",secondary:"#e8d0f4",tertiary:"#d4bcf0",hover:"#e8d0f4"},{primary:"#4a1a4e",secondary:"#7b3f7d",muted:"#c080c0"},"#d8a8e8"),On=O("Terminal Green",{primary:"#00ff41",primaryHover:"#00cc34",success:"#00ff41",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0a0a0a",secondary:"#0d1a0d",tertiary:"#1a2e1a",hover:"#1a2e1a"},{primary:"#00ff41",secondary:"#00cc33",muted:"#008822"},"#003300"),_n=I("Sepia",{primary:"#8b6914",primaryHover:"#704f10",success:"#6b8e23",warning:"#cd853f",error:"#b22222",info:"#5f9ea0"},{primary:"#faf0e6",secondary:"#f5e6d3",tertiary:"#eddcc7",hover:"#f5e6d3"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#d7ccc8"),Wn=I("Vintage",{primary:"#8d6e63",primaryHover:"#6d4c41",success:"#66bb6a",warning:"#ffb300",error:"#e53935",info:"#29b6f6"},{primary:"#efebe9",secondary:"#d7ccc8",tertiary:"#bcaaa4",hover:"#d7ccc8"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#bcaaa4"),Vn=O("Cyberpunk",{primary:"#00f0ff",primaryHover:"#00c8d4",success:"#39ff14",warning:"#ffff00",error:"#ff003c",info:"#bf00ff"},{primary:"#0a0e17",secondary:"#131824",tertiary:"#1c2333",hover:"#1c2333"},{primary:"#e0fbfc",secondary:"#80d4dd",muted:"#3a6b72"},"#1c3a44"),Xn=O("Neon",{primary:"#ff00ff",primaryHover:"#cc00cc",success:"#00ff00",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0d0d0d",secondary:"#1a1a1a",tertiary:"#262626",hover:"#262626"},{primary:"#ffffff",secondary:"#cccccc",muted:"#666666"},"#333333"),Un=O("Retrowave",{primary:"#f77fbe",primaryHover:"#e462a3",success:"#72f1b8",warning:"#ffe261",error:"#ff4444",info:"#79e8fb"},{primary:"#1b0a2e",secondary:"#261440",tertiary:"#321e52",hover:"#321e52"},{primary:"#ffe6f7",secondary:"#c9a0c9",muted:"#6b4c7a"},"#4a2d66"),qn=I("Christmas",{primary:"#c41e3a",primaryHover:"#a01830",success:"#228b22",warning:"#ffd700",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),Gn=O("Halloween",{primary:"#ff6600",primaryHover:"#e05500",success:"#4ade80",warning:"#fbbf24",error:"#ff0000",info:"#9333ea"},{primary:"#1a0a00",secondary:"#2d1500",tertiary:"#402000",hover:"#402000"},{primary:"#ffedd5",secondary:"#fdba74",muted:"#9a5c28"},"#5c3400"),Kn=I("Valentine",{primary:"#e11d48",primaryHover:"#be123c",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#ec4899"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f9a8d4"},"#fda4af"),Jn=I("Easter",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fef9ff",secondary:"#f3e8ff",tertiary:"#e8d5ff",hover:"#f3e8ff"},{primary:"#581c87",secondary:"#6d28d9",muted:"#c4b5fd"},"#ddd6fe"),Yn=I("Summer Beach",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#fcd34d"),Qn=I("Winter Frost",{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#93c5fd"},"#bfdbfe"),Zn=I("Cherry Blossom",{primary:"#ec4899",primaryHover:"#db2777",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#fbcfe8"),es=I("Harvest",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#d97706"},"#fcd34d"),ts=I("Japanese Zen",{primary:"#6b7280",primaryHover:"#4b5563",success:"#6b8e23",warning:"#d4a017",error:"#c0392b",info:"#5f9ea0"},{primary:"#faf9f6",secondary:"#f0ece3",tertiary:"#e6e0d4",hover:"#f0ece3"},{primary:"#2c2c2c",secondary:"#5c5c5c",muted:"#a0998a"},"#d5cec0"),rs=I("Moroccan",{primary:"#c2410c",primaryHover:"#9a3412",success:"#15803d",warning:"#ca8a04",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbf0",secondary:"#fef3e0",tertiary:"#fde6c4",hover:"#fef3e0"},{primary:"#3a1a00",secondary:"#7c2d12",muted:"#d97706"},"#f5d0a0"),as=I("Scandinavian",{primary:"#4b5563",primaryHover:"#374151",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ffffff",secondary:"#f9fafb",tertiary:"#f3f4f6",hover:"#f3f4f6"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#e5e7eb"),ns=I("Mediterranean",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#2563eb",muted:"#93c5fd"},"#bfdbfe"),ss=I("Chinese New Year",{primary:"#dc2626",primaryHover:"#b91c1c",success:"#16a34a",warning:"#d4a017",error:"#ef4444",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#991b1b",muted:"#f87171"},"#fca5a5"),os=I("Indian Festive",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#7c3aed"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#92400e",muted:"#f59e0b"},"#fcd34d"),is=I("Brazilian Carnival",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#facc15",error:"#ef4444",info:"#0ea5e9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),cs=I("African Earth",{primary:"#92400e",primaryHover:"#78350f",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf5f0",secondary:"#f0e6d6",tertiary:"#e6d5bb",hover:"#f0e6d6"},{primary:"#2b1a0e",secondary:"#5c3d1e",muted:"#a08060"},"#d4b896"),ls=O("High Contrast Dark",{primary:"#ffff00",primaryHover:"#cccc00",success:"#00ff00",warning:"#ff8c00",error:"#ff0000",info:"#00ffff"},{primary:"#000000",secondary:"#1a1a1a",tertiary:"#333333",hover:"#333333"},{primary:"#ffffff",secondary:"#ffffff",muted:"#cccccc"},"#ffffff"),ds=I("Monochrome",{primary:"#404040",primaryHover:"#262626",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fafafa",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0"},{primary:"#1a1a1a",secondary:"#404040",muted:"#808080"},"#c0c0c0"),us=I("Enhanced Contrast",{primary:"#0050b3",primaryHover:"#003d8c",success:"#006400",warning:"#cc7000",error:"#cc0000",info:"#006680"},{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#ebebeb"},{primary:"#000000",secondary:"#1a1a1a",muted:"#595959"},"#8c8c8c"),fs={name:"Large Text",darkMode:"light",colors:{primary:"#2563eb",primaryHover:"#1d4ed8",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#ffffff"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:It("#e2e8f0"),shadows:Ea,spacing:{space1:"6px",space2:"12px",space3:"16px",space4:"20px",space5:"24px",space6:"32px",space8:"40px"},typography:{fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.875rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6},transitions:Me},ms={name:"Glassmorphism",darkMode:"light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"rgba(255,255,255,0.7)",surfaceHover:"rgba(255,255,255,0.5)"},backgrounds:{primary:"rgba(255,255,255,0.7)",secondary:"rgba(255,255,255,0.5)",tertiary:"rgba(255,255,255,0.3)",hover:"rgba(255,255,255,0.5)",elevated:"rgba(255,255,255,0.8)",inset:"rgba(255,255,255,0.3)",canvas:"rgba(255,255,255,0.7)"},text:{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:{color:"rgba(255,255,255,0.3)",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,0,0,0.04)",md:"0 4px 16px rgba(0,0,0,0.08)",lg:"0 8px 32px rgba(0,0,0,0.12)",xl:"0 16px 48px rgba(0,0,0,0.16)"},spacing:we,typography:ke,transitions:{fast:"150ms ease",normal:"250ms ease",slow:"350ms ease"}},ps={name:"Neumorphism Light",darkMode:"light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#e0e5ec",surfaceHover:"#d5dae2"},backgrounds:{primary:"#e0e5ec",secondary:"#d5dae2",tertiary:"#ccd1d9",hover:"#d5dae2",elevated:"#e0e5ec",inset:"#ccd1d9",canvas:"#e0e5ec"},text:{primary:"#2d3748",secondary:"#4a5568",muted:"#718096",inverse:"#ffffff"},borders:{color:"#d0d5dd",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #b8bec7, -3px -3px 6px #ffffff",md:"5px 5px 10px #b8bec7, -5px -5px 10px #ffffff",lg:"8px 8px 16px #b8bec7, -8px -8px 16px #ffffff",xl:"12px 12px 24px #b8bec7, -12px -12px 24px #ffffff"},spacing:we,typography:ke,transitions:Me},gs={name:"Neumorphism Dark",darkMode:"dark",colors:{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee",surface:"#283141",surfaceHover:"#232b3a"},backgrounds:{primary:"#2d3748",secondary:"#283141",tertiary:"#232b3a",hover:"#283141",elevated:"#283141",inset:"#2d3748",canvas:"#2d3748"},text:{primary:"#e2e8f0",secondary:"#a0aec0",muted:"#718096",inverse:"#0f172a"},borders:{color:"#3a4556",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #1a202c, -3px -3px 6px #404d64",md:"5px 5px 10px #1a202c, -5px -5px 10px #404d64",lg:"8px 8px 16px #1a202c, -8px -8px 16px #404d64",xl:"12px 12px 24px #1a202c, -12px -12px 24px #404d64"},spacing:we,typography:ke,transitions:Me},ys=I("Minimalist",{primary:"#18181b",primaryHover:"#27272a",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"},{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f5f5f5"},{primary:"#0a0a0a",secondary:"#404040",muted:"#a3a3a3"},"#e5e5e5"),hs=O("Warm Dark",{primary:"#f59e0b",primaryHover:"#d97706",success:"#10b981",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#1c1917",secondary:"#292524",tertiary:"#44403c",hover:"#44403c"},{primary:"#fafaf9",secondary:"#d6d3d1",muted:"#78716c"},"#57534e"),bs=O("Soft Dark",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#34d399",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#1e1e2e",secondary:"#262637",tertiary:"#313147",hover:"#313147"},{primary:"#e8e8f0",secondary:"#a0a0b8",muted:"#5c5c74"},"#3e3e58"),vs=I("Coffee",{primary:"#6f4e37",primaryHover:"#5c3d28",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf6f1",secondary:"#f0e8dc",tertiary:"#e6d8c6",hover:"#f0e8dc"},{primary:"#2c1a0e",secondary:"#5c3d28",muted:"#a08868"},"#d4c4a8"),Ss=I("Wine",{primary:"#7f1d1d",primaryHover:"#641717",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),xs=[Na,La,Ta,Ra,Ia,za,Da,Pa,Fa,Ha,$a,ja,Ba,Oa,_a,Wa,Va,Xa,Ua,qa,Ga,Ka,Ja,Ya,Qa,Za,en,tn,rn,an,nn,sn,on,cn,ln,dn,un,fn,mn,pn,gn,yn,hn,bn,vn,Sn,xn,wn,kn,Mn,Cn,An,En,Nn,Ln,Tn,Rn,In,zn,Dn,Pn,Fn,Hn,$n,jn,Bn,On,_n,Wn,Vn,Xn,Un,qn,Gn,Kn,Jn,Yn,Qn,Zn,es,ts,rs,as,ns,ss,os,is,cs,ls,ds,us,fs,ms,ps,gs,ys,hs,bs,vs,Ss],le={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Ue={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Ce={color:"#e2e8f0",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},Ae={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},zt={name:"Light",darkMode:"light",colors:{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#f8fafc"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:Ce,shadows:{sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},spacing:le,typography:Ue,transitions:Ae},ws={name:"Dark",darkMode:"dark",colors:{primary:"#3b82f6",primaryHover:"#60a5fa",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4",surface:"#141414",surfaceHover:"#1e1e1e"},backgrounds:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1e1e1e",hover:"#1a1a1a",elevated:"#141414",inset:"#0a0a0a",canvas:"#0a0a0a"},text:{primary:"#ffffff",secondary:"#a1a1a1",muted:"#6b6b6b",inverse:"#0f172a"},borders:{...Ce,color:"#2a2a2a"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 6px -1px rgba(0,0,0,0.6)",lg:"0 10px 15px -3px rgba(0,0,0,0.6)",xl:"0 20px 25px -5px rgba(0,0,0,0.6)"},spacing:le,typography:Ue,transitions:Ae},ks={name:"Blue",colors:{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#eff6ff",surfaceHover:"#dbeafe"},backgrounds:{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe",elevated:"#ffffff",inset:"#dbeafe",canvas:"#eff6ff"},text:{primary:"#1e3a5f",secondary:"#3b628a",muted:"#7da0c4",inverse:"#ffffff"},borders:{...Ce,color:"#93c5fd"},shadows:{sm:"0 1px 2px rgba(29,78,216,0.08)",md:"0 4px 6px -1px rgba(29,78,216,0.12)",lg:"0 10px 15px -3px rgba(29,78,216,0.15)",xl:"0 20px 25px -5px rgba(29,78,216,0.18)"},spacing:le,typography:Ue,transitions:Ae},Ms={name:"High Contrast",colors:{primary:"#0000ff",primaryHover:"#0000cc",success:"#008000",warning:"#ff8c00",error:"#ff0000",info:"#008b8b",surface:"#ffffff",surfaceHover:"#f0f0f0"},backgrounds:{primary:"#ffffff",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0",elevated:"#ffffff",inset:"#e0e0e0",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#4d4d4d",inverse:"#ffffff"},borders:{...Ce,color:"#000000"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.15)",md:"0 4px 6px rgba(0,0,0,0.2)",lg:"0 10px 15px rgba(0,0,0,0.25)",xl:"0 20px 25px rgba(0,0,0,0.3)"},spacing:le,typography:Ue,transitions:Ae},Cs={name:"Material",colors:{primary:"#6750a4",primaryHover:"#4f378b",success:"#386a20",warning:"#7c5800",error:"#ba1a1a",info:"#00629e",surface:"#fffbfe",surfaceHover:"#f6edff"},backgrounds:{primary:"#fffbfe",secondary:"#f6edff",tertiary:"#ece6f0",hover:"#eaddff",elevated:"#ffffff",inset:"#ece6f0",canvas:"#fffbfe"},text:{primary:"#1c1b1f",secondary:"#49454f",muted:"#79747e",inverse:"#ffffff"},borders:{...Ce,color:"#cac4d0",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"28px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15)",md:"0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15)",lg:"0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3)",xl:"0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3)"},spacing:le,typography:{fontFamily:"'Roboto', 'Noto Sans', system-ui, sans-serif",fontSizeXs:"0.6875rem",fontSizeSm:"0.75rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:{fast:"100ms cubic-bezier(0.2,0,0,1)",normal:"200ms cubic-bezier(0.2,0,0,1)",slow:"300ms cubic-bezier(0.2,0,0,1)"}},As={name:"Bootstrap",colors:{primary:"#0d6efd",primaryHover:"#0b5ed7",success:"#198754",warning:"#ffc107",error:"#dc3545",info:"#0dcaf0",surface:"#ffffff",surfaceHover:"#f8f9fa"},backgrounds:{primary:"#ffffff",secondary:"#f8f9fa",tertiary:"#e9ecef",hover:"#e9ecef",elevated:"#ffffff",inset:"#e9ecef",canvas:"#f8f9fa"},text:{primary:"#212529",secondary:"#6c757d",muted:"#adb5bd",inverse:"#ffffff"},borders:{color:"#dee2e6",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"16px",radiusFull:"50rem"},shadows:{sm:"0 0.125rem 0.25rem rgba(0,0,0,0.075)",md:"0 0.5rem 1rem rgba(0,0,0,0.15)",lg:"0 1rem 3rem rgba(0,0,0,0.175)",xl:"0 1rem 3rem rgba(0,0,0,0.25)"},spacing:le,typography:{fontFamily:"system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:Ae},Es={name:"Fluent",colors:{primary:"#0078d4",primaryHover:"#106ebe",success:"#107c10",warning:"#fce100",error:"#d13438",info:"#00b7c3",surface:"#ffffff",surfaceHover:"#faf9f8"},backgrounds:{primary:"#ffffff",secondary:"#faf9f8",tertiary:"#f3f2f1",hover:"#edebe9",elevated:"#ffffff",inset:"#f3f2f1",canvas:"#faf9f8"},text:{primary:"#323130",secondary:"#605e5c",muted:"#a19f9d",inverse:"#ffffff"},borders:{color:"#e1dfdd",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108)",md:"0 3.2px 7.2px 0 rgba(0,0,0,0.132), 0 0.6px 1.8px 0 rgba(0,0,0,0.108)",lg:"0 6.4px 14.4px 0 rgba(0,0,0,0.132), 0 1.2px 3.6px 0 rgba(0,0,0,0.108)",xl:"0 25.6px 57.6px 0 rgba(0,0,0,0.22), 0 4.8px 14.4px 0 rgba(0,0,0,0.18)"},spacing:le,typography:{fontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",fontSizeXs:"10px",fontSizeSm:"12px",fontSizeMd:"14px",fontSizeLg:"16px",fontSizeXl:"20px",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.42857},transitions:{fast:"100ms cubic-bezier(0.1,0.9,0.2,1)",normal:"200ms cubic-bezier(0.1,0.9,0.2,1)",slow:"300ms cubic-bezier(0.1,0.9,0.2,1)"}},lt=[zt,ws,ks,Ms,Cs,As,Es,...xs],Dd=["https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap","https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Archivo+Black&family=Archivo:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Work+Sans:wght@400;500;600&display=swap","https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&display=swap","https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;600&display=swap","https://fonts.googleapis.com/css2?family=Libre+Caslon+Text:wght@400;700&family=DM+Sans:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap"],Pd={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},ne={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Dt={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},Ns={meta:{id:"obsidianEditorial",name:"Obsidian Editorial",tagline:"Dark-mode magazine — serif display, razor borders, grain.",tags:["dark","editorial","serif"]},theme:{name:"Obsidian Editorial",darkMode:"dark",colors:{primary:"#e8dcc4",primaryHover:"#d4c29c",success:"#7fb069",warning:"#e6aa68",error:"#d65a5a",info:"#88aabb",accent:"#c98a5b",focus:"#e8dcc4",surface:"#1a1715",surfaceHover:"#221e1b"},backgrounds:{primary:"#0e0c0b",secondary:"#1a1715",tertiary:"#221e1b",hover:"#2a2522",elevated:"#1a1715",inset:"#0b0908",canvas:"#0e0c0b"},text:{primary:"#ede4d1",secondary:"#a39787",muted:"#6b6055",inverse:"#0e0c0b"},borders:{color:"#332d28",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px",width:"1px",divider:"#28231f"},shadows:{sm:"none",md:"0 1px 0 0 rgba(232,220,196,0.04)",lg:"0 2px 0 0 rgba(232,220,196,0.06)",xl:"0 4px 0 0 rgba(232,220,196,0.08)"},spacing:Dt,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Fraunces', 'Playfair Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', ui-monospace, monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.005em",headingLetterSpacing:"-0.02em"},transitions:{fast:"80ms cubic-bezier(0.4,0,0.2,1)",normal:"140ms cubic-bezier(0.4,0,0.2,1)",slow:"220ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.35,blendMode:"overlay"}},displayStyle:"editorial",variantConfig:{density:"comfortable",animation:"subtle"}},Ls={meta:{id:"neonArcade",name:"Neon Arcade",tagline:"Phosphor-green terminal glow on absolute black.",tags:["dark","retro","mono","terminal"]},theme:{name:"Neon Arcade",darkMode:"dark",colors:{primary:"#39ff14",primaryHover:"#50ff35",success:"#39ff14",warning:"#ffcc00",error:"#ff3355",info:"#00e5ff",accent:"#ff00aa",focus:"#39ff14",surface:"#060a06",surfaceHover:"#0b140b"},backgrounds:{primary:"#000000",secondary:"#060a06",tertiary:"#0b140b",hover:"#12241a",elevated:"#060a06",inset:"#000000",canvas:"#000000"},text:{primary:"#c8ffb8",secondary:"#7be368",muted:"#3e7a39",inverse:"#000000"},borders:{color:"#1d3a1d",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0",width:"1px",divider:"#143014",focusColor:"#39ff14"},shadows:{sm:"0 0 4px rgba(57,255,20,0.3)",md:"0 0 10px rgba(57,255,20,0.35), 0 0 2px rgba(57,255,20,0.6)",lg:"0 0 22px rgba(57,255,20,0.4), 0 0 4px rgba(57,255,20,0.7)",xl:"0 0 40px rgba(57,255,20,0.5), 0 0 8px rgba(57,255,20,0.8)",glow:"0 0 30px #39ff14, 0 0 60px rgba(57,255,20,0.4)"},spacing:ne,typography:{fontFamily:"'JetBrains Mono', 'Fira Code', ui-monospace, monospace",headingFontFamily:"'JetBrains Mono', monospace",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.08em"},transitions:{fast:"60ms steps(4, end)",normal:"120ms steps(6, end)",slow:"200ms steps(8, end)"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.25}},displayStyle:"terminal",variantConfig:{radius:"none",shadow:"glow",density:"compact",animation:"subtle"}},Ts={meta:{id:"hyggeScandinavian",name:"Hygge Scandinavian",tagline:"Warm cream, generous breathing room, soft serif display.",tags:["light","warm","serif","spacious"]},theme:{name:"Hygge Scandinavian",darkMode:"light",colors:{primary:"#8b6f47",primaryHover:"#6f5738",success:"#6b8e4e",warning:"#d49a3e",error:"#b84c4c",info:"#6a8aad",accent:"#c98754",focus:"#8b6f47",surface:"#fbf6ed",surfaceHover:"#f3ecdf"},backgrounds:{primary:"#fdf9f1",secondary:"#f5eee0",tertiary:"#ede3d0",hover:"#e8ddc8",elevated:"#ffffff",inset:"#f0e7d4",canvas:"#fdf9f1"},text:{primary:"#3a2f22",secondary:"#6a5845",muted:"#9c8c76",inverse:"#fdf9f1"},borders:{color:"#d9cbb0",radiusSm:"8px",radiusMd:"14px",radiusLg:"22px",radiusXl:"32px",radiusFull:"9999px",width:"1px",divider:"#e8ddc8"},shadows:{sm:"0 1px 2px rgba(122,92,58,0.05)",md:"0 6px 16px -4px rgba(122,92,58,0.08)",lg:"0 16px 32px -10px rgba(122,92,58,0.10)",xl:"0 28px 56px -18px rgba(122,92,58,0.14)"},spacing:Dt,typography:{fontFamily:"'Work Sans', -apple-system, sans-serif",headingFontFamily:"'Cormorant Garamond', Georgia, serif",monoFontFamily:"ui-monospace, 'SF Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.7,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"160ms cubic-bezier(0.16,1,0.3,1)",normal:"260ms cubic-bezier(0.16,1,0.3,1)",slow:"400ms cubic-bezier(0.16,1,0.3,1)"}},displayStyle:"scandinavian",variantConfig:{density:"spacious",animation:"normal"}},Rs={meta:{id:"brutalistRaw",name:"Brutalist Raw",tagline:"Paper + ink + hard shadows — zero blur, zero mercy.",tags:["light","brutalist","experimental"]},theme:{name:"Brutalist Raw",darkMode:"light",colors:{primary:"#ff3b30",primaryHover:"#000000",success:"#00aa55",warning:"#ffcc00",error:"#ff0000",info:"#0066ff",accent:"#ffcc00",focus:"#ff3b30",surface:"#ffffff",surfaceHover:"#f5f3ee"},backgrounds:{primary:"#f5f3ee",secondary:"#ffffff",tertiary:"#e8e4d8",hover:"#e0dcd0",elevated:"#ffffff",inset:"#e8e4d8",canvas:"#f5f3ee"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#555555",inverse:"#ffffff"},borders:{color:"#000000",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0",width:"2px",divider:"#000000"},shadows:{sm:"3px 3px 0 0 #000000",md:"6px 6px 0 0 #000000",lg:"10px 10px 0 0 #000000",xl:"14px 14px 0 0 #000000"},spacing:ne,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Archivo Black', 'Archivo', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:500,fontWeightMedium:700,fontWeightSemibold:700,fontWeightBold:900,lineHeight:1.4,letterSpacing:"-0.01em",headingLetterSpacing:"-0.04em"},transitions:{fast:"0ms linear",normal:"80ms cubic-bezier(0.2,0,0,1)",slow:"140ms cubic-bezier(0.2,0,0,1)"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"subtle"}},Is={meta:{id:"glassAurora",name:"Glass Aurora",tagline:"Frosted translucency floating over aurora light.",tags:["light","glass","modern","gradient"]},theme:{name:"Glass Aurora",darkMode:"light",colors:{primary:"#5b5bff",primaryHover:"#4343e8",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",accent:"#ec4899",focus:"#5b5bff",surface:"rgba(255,255,255,0.55)",surfaceHover:"rgba(255,255,255,0.75)"},backgrounds:{primary:"rgba(255,255,255,0.55)",secondary:"rgba(255,255,255,0.35)",tertiary:"rgba(255,255,255,0.22)",hover:"rgba(255,255,255,0.7)",elevated:"rgba(255,255,255,0.8)",inset:"rgba(255,255,255,0.3)",canvas:"#e8d6ff"},text:{primary:"#1a1440",secondary:"#443c78",muted:"#8b83b8",inverse:"#ffffff"},borders:{color:"rgba(255,255,255,0.6)",radiusSm:"10px",radiusMd:"16px",radiusLg:"24px",radiusXl:"36px",radiusFull:"9999px",width:"1px",divider:"rgba(255,255,255,0.4)"},shadows:{sm:"0 2px 12px rgba(91,91,255,0.08)",md:"0 8px 32px rgba(91,91,255,0.12)",lg:"0 18px 56px rgba(236,72,153,0.18)",xl:"0 32px 80px rgba(91,91,255,0.22)"},spacing:ne,typography:{fontFamily:"'Outfit', -apple-system, sans-serif",headingFontFamily:"'Outfit', sans-serif",monoFontFamily:"ui-monospace, monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"-0.005em",headingLetterSpacing:"-0.025em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"400ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 12% 18%, #ffd6e8 0%, transparent 48%), radial-gradient(at 88% 22%, #c8d8ff 0%, transparent 52%), radial-gradient(at 42% 86%, #d8ffe8 0%, transparent 50%), linear-gradient(180deg, #eee4ff 0%, #ffe8f2 100%)"}},displayStyle:"glass",variantConfig:{density:"normal",animation:"normal"}},zs={meta:{id:"candyPop",name:"Candy Pop",tagline:"Bubblegum pastels, pill shapes, bouncy easing.",tags:["light","playful","pastel","pill"]},theme:{name:"Candy Pop",darkMode:"light",colors:{primary:"#ff4fa3",primaryHover:"#ff2d8e",success:"#3dd68c",warning:"#ffd63d",error:"#ff5577",info:"#4ec8ff",accent:"#b85bff",focus:"#ff4fa3",surface:"#ffffff",surfaceHover:"#fff5fa"},backgrounds:{primary:"#fff5fa",secondary:"#ffeaf3",tertiary:"#ffd8e9",hover:"#ffc4dc",elevated:"#ffffff",inset:"#ffeaf3",canvas:"#fff8f5"},text:{primary:"#531645",secondary:"#8b3a70",muted:"#c678a8",inverse:"#ffffff"},borders:{color:"#ffc4dc",radiusSm:"9999px",radiusMd:"9999px",radiusLg:"9999px",radiusXl:"9999px",radiusFull:"9999px",width:"2px",divider:"#ffd8e9"},shadows:{sm:"0 2px 0 0 #ffc4dc",md:"0 4px 0 0 #ffa3c7",lg:"0 6px 16px rgba(255,79,163,0.2), 0 3px 0 0 #ff4fa3",xl:"0 12px 28px rgba(255,79,163,0.25)"},spacing:ne,typography:{fontFamily:"'Quicksand', -apple-system, sans-serif",headingFontFamily:"'Nunito', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"140ms cubic-bezier(0.34,1.56,0.64,1)",normal:"240ms cubic-bezier(0.34,1.56,0.64,1)",slow:"380ms cubic-bezier(0.34,1.56,0.64,1)"}},displayStyle:"pill",variantConfig:{radius:"full",density:"comfortable",animation:"playful"}},Ds={meta:{id:"newspaperBroadsheet",name:"Newspaper Broadsheet",tagline:"Ivory paper, hairline rules, serif gravity.",tags:["light","editorial","serif","print"]},theme:{name:"Newspaper Broadsheet",darkMode:"light",colors:{primary:"#1a1a1a",primaryHover:"#000000",success:"#2d5016",warning:"#8b6914",error:"#8b0000",info:"#1d3a5f",accent:"#8b0000",focus:"#1a1a1a",surface:"#fbf7ee",surfaceHover:"#f3ecdd"},backgrounds:{primary:"#fbf7ee",secondary:"#f5eedb",tertiary:"#ede4cc",hover:"#e8ddbe",elevated:"#fbf7ee",inset:"#f0e7d0",canvas:"#fbf7ee"},text:{primary:"#14110c",secondary:"#3d362a",muted:"#7a6f58",inverse:"#fbf7ee"},borders:{color:"#14110c",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px",width:"1px",divider:"#14110c"},shadows:{sm:"none",md:"none",lg:"none",xl:"none"},spacing:ne,typography:{fontFamily:"'Fraunces', 'Source Serif Pro', Georgia, serif",headingFontFamily:"'Fraunces', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.01em",headingLetterSpacing:"-0.025em"},transitions:{fast:"0ms",normal:"100ms linear",slow:"180ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.18,blendMode:"multiply"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"none",density:"normal"}},Ps={meta:{id:"synthwave84",name:"Synthwave 84",tagline:"Magenta & cyan pulse over deep navy — 1984 forever.",tags:["dark","retro","neon","80s"]},theme:{name:"Synthwave 84",darkMode:"dark",colors:{primary:"#ff3ca8",primaryHover:"#ff6bc1",success:"#72f1b8",warning:"#ffcc33",error:"#fe4450",info:"#36f9f6",accent:"#36f9f6",focus:"#ff3ca8",surface:"#2a1a4f",surfaceHover:"#332260"},backgrounds:{primary:"#1a0933",secondary:"#241443",tertiary:"#2d1a52",hover:"#382266",elevated:"#2a1a4f",inset:"#120626",canvas:"#0e0524"},text:{primary:"#f5e8ff",secondary:"#c9a7ff",muted:"#8063b0",inverse:"#0e0524"},borders:{color:"#553388",radiusSm:"2px",radiusMd:"4px",radiusLg:"6px",radiusXl:"8px",radiusFull:"9999px",width:"1px",divider:"#3d2270",focusColor:"#36f9f6"},shadows:{sm:"0 0 8px rgba(255,60,168,0.4)",md:"0 0 18px rgba(255,60,168,0.45), 0 2px 0 0 #36f9f6",lg:"0 0 36px rgba(255,60,168,0.55), 0 4px 0 0 #36f9f6",xl:"0 0 60px rgba(255,60,168,0.6), 0 6px 0 0 #36f9f6",glow:"0 0 28px #ff3ca8, 0 0 56px rgba(255,60,168,0.5)"},spacing:ne,typography:{fontFamily:"'Rajdhani', -apple-system, sans-serif",headingFontFamily:"'Orbitron', 'Rajdhani', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:900,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.08em"},transitions:{fast:"120ms cubic-bezier(0.23,1,0.32,1)",normal:"200ms cubic-bezier(0.23,1,0.32,1)",slow:"360ms cubic-bezier(0.23,1,0.32,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #0e0524 0%, #1a0933 55%, #2d1a52 100%), repeating-linear-gradient(0deg, rgba(54,249,246,0.04) 0 1px, transparent 1px 3px)"}},displayStyle:"synthwave",variantConfig:{shadow:"glow",animation:"dramatic",density:"normal"}},Fs={meta:{id:"zenMinimal",name:"Zen Minimal",tagline:"Whisper-light type, hairlines, oceans of whitespace.",tags:["light","minimal","airy"]},theme:{name:"Zen Minimal",darkMode:"light",colors:{primary:"#0a0a0a",primaryHover:"#262626",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#2563eb",accent:"#737373",focus:"#0a0a0a",surface:"#ffffff",surfaceHover:"#fafafa"},backgrounds:{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f0f0f0",elevated:"#ffffff",inset:"#fafafa",canvas:"#ffffff"},text:{primary:"#171717",secondary:"#525252",muted:"#a3a3a3",inverse:"#ffffff"},borders:{color:"#ededed",radiusSm:"2px",radiusMd:"3px",radiusLg:"4px",radiusXl:"6px",radiusFull:"9999px",width:"1px",divider:"#f0f0f0"},shadows:{sm:"none",md:"0 0 0 1px rgba(0,0,0,0.04)",lg:"0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.05)",xl:"0 4px 8px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.06)"},spacing:Dt,typography:{fontFamily:"'Manrope', -apple-system, sans-serif",headingFontFamily:"'Manrope', sans-serif",monoFontFamily:"ui-monospace, monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.6,letterSpacing:"-0.005em",headingLetterSpacing:"-0.03em"},transitions:{fast:"100ms ease",normal:"180ms ease",slow:"280ms ease"}},displayStyle:"minimal",variantConfig:{density:"spacious",animation:"subtle"}},Hs={meta:{id:"claymorphism",name:"Claymorphism",tagline:"Soft-clay 3D surfaces — pressable, friendly, tactile.",tags:["light","playful","neumorphic","3d"]},theme:{name:"Claymorphism",darkMode:"light",colors:{primary:"#8b7ef5",primaryHover:"#7469ec",success:"#6ed6a5",warning:"#ffc771",error:"#ff8b8b",info:"#7ec4f5",accent:"#ffb3d9",focus:"#8b7ef5",surface:"#f3efff",surfaceHover:"#ebe4ff"},backgrounds:{primary:"#f6f0ff",secondary:"#ede4ff",tertiary:"#dfd3fc",hover:"#d3c5fa",elevated:"#ffffff",inset:"#e5daff",canvas:"#f6f0ff"},text:{primary:"#2a1f5e",secondary:"#584a8e",muted:"#9388bd",inverse:"#ffffff"},borders:{color:"rgba(139,126,245,0.15)",radiusSm:"14px",radiusMd:"22px",radiusLg:"32px",radiusXl:"48px",radiusFull:"9999px",width:"0px",divider:"rgba(139,126,245,0.12)"},shadows:{sm:"-3px -3px 6px rgba(255,255,255,0.8), 3px 3px 8px rgba(139,126,245,0.18), inset 0 0 0 rgba(255,255,255,0)",md:"-5px -5px 12px rgba(255,255,255,0.9), 6px 6px 18px rgba(139,126,245,0.22), inset 1px 1px 1px rgba(255,255,255,0.6)",lg:"-8px -8px 20px rgba(255,255,255,0.95), 10px 10px 32px rgba(139,126,245,0.28), inset 2px 2px 2px rgba(255,255,255,0.7)",xl:"-14px -14px 32px rgba(255,255,255,1), 16px 16px 48px rgba(139,126,245,0.34), inset 3px 3px 4px rgba(255,255,255,0.8)",inner:"inset 4px 4px 10px rgba(139,126,245,0.2), inset -4px -4px 10px rgba(255,255,255,0.9)"},spacing:ne,typography:{fontFamily:"'Nunito', -apple-system, sans-serif",headingFontFamily:"'Nunito', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.015em"},transitions:{fast:"160ms cubic-bezier(0.4,0,0.2,1.4)",normal:"260ms cubic-bezier(0.4,0,0.2,1.4)",slow:"400ms cubic-bezier(0.4,0,0.2,1.4)"}},displayStyle:"neumorphic",variantConfig:{radius:"2xl",density:"comfortable",animation:"normal"}},$s={meta:{id:"bauhaus",name:"Bauhaus",tagline:"Primary palette, geometric rigour, grid as foundation.",tags:["light","geometric","primary","design"]},theme:{name:"Bauhaus",darkMode:"light",colors:{primary:"#d62828",primaryHover:"#a81e1e",success:"#2a9d8f",warning:"#fcbf49",error:"#d62828",info:"#1d4e89",accent:"#fcbf49",focus:"#1d4e89",surface:"#faf5e8",surfaceHover:"#f2ead3"},backgrounds:{primary:"#faf5e8",secondary:"#f5ecd3",tertiary:"#ede0be",hover:"#e5d5a8",elevated:"#ffffff",inset:"#f0e3c0",canvas:"#faf5e8"},text:{primary:"#1a1a1a",secondary:"#3d3d3d",muted:"#7a7a7a",inverse:"#faf5e8"},borders:{color:"#1a1a1a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px",width:"3px",divider:"#1a1a1a"},shadows:{sm:"0 2px 0 0 #1a1a1a",md:"4px 4px 0 0 #1a1a1a",lg:"6px 6px 0 0 #1d4e89",xl:"8px 8px 0 0 #d62828"},spacing:ne,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Archivo Black', 'Archivo', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:500,fontWeightMedium:700,fontWeightSemibold:800,fontWeightBold:900,lineHeight:1.4,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"60ms linear",normal:"120ms linear",slow:"200ms linear"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.35}},displayStyle:"bauhaus",variantConfig:{radius:"none",shadow:"md",density:"normal",animation:"subtle"}},js={meta:{id:"bankVault",name:"Bank Vault",tagline:"Navy, gilt accents, serif gravitas — trusted by institutions.",tags:["light","corporate","serif","conservative"]},theme:{name:"Bank Vault",darkMode:"light",colors:{primary:"#0b2545",primaryHover:"#163969",success:"#2d6a4f",warning:"#b08d2e",error:"#8b1a1a",info:"#1d4e89",accent:"#b08d2e",focus:"#0b2545",surface:"#ffffff",surfaceHover:"#f7f4ec"},backgrounds:{primary:"#fbfaf6",secondary:"#f4f0e4",tertiary:"#ebe5d2",hover:"#e3dcc4",elevated:"#ffffff",inset:"#efeadb",canvas:"#fbfaf6"},text:{primary:"#0b2545",secondary:"#3a4b65",muted:"#7a8399",inverse:"#fbfaf6"},borders:{color:"#c9bfa3",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px",width:"1px",divider:"#d4c9a8"},shadows:{sm:"0 1px 0 0 rgba(11,37,69,0.08)",md:"0 1px 3px rgba(11,37,69,0.08), 0 0 0 1px rgba(176,141,46,0.12)",lg:"0 4px 10px rgba(11,37,69,0.1)",xl:"0 12px 24px rgba(11,37,69,0.12)"},spacing:Pd,typography:{fontFamily:"'DM Sans', -apple-system, sans-serif",headingFontFamily:"'Libre Caslon Text', 'DM Serif Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0.005em",headingLetterSpacing:"-0.01em"},transitions:{fast:"90ms cubic-bezier(0.4,0,0.2,1)",normal:"160ms cubic-bezier(0.4,0,0.2,1)",slow:"260ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"bank",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"none"}},Pt={obsidianEditorial:Ns,neonArcade:Ls,hyggeScandinavian:Ts,brutalistRaw:Rs,glassAurora:Is,candyPop:zs,newspaperBroadsheet:Ds,synthwave84:Ps,zenMinimal:Fs,claymorphism:Hs,bauhaus:$s,bankVault:js},Bs=Object.values(Pt);function Fd(e){return Pt[e]}function Hd(e){return Bs.filter(t=>t.meta.tags.includes(e))}const $d=["https://fonts.googleapis.com/css2?family=Spectral:wght@300;400;500;600;700&family=Lora:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;500;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Poiret+One&family=Cormorant+Garamond:wght@300;400;500;600&display=swap","https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Roboto+Condensed:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Space+Mono:wght@400;700&display=swap","https://fonts.googleapis.com/css2?family=VT323&display=swap","https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Special+Elite&display=swap","https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&display=swap","https://fonts.googleapis.com/css2?family=Bangers&display=swap","https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap","https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Rubik+Mono+One&family=Rubik:wght@400;500;700;800&display=swap"],Os={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},X={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Ee={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},qe={space1:"8px",space2:"16px",space3:"24px",space4:"32px",space5:"44px",space6:"56px",space8:"80px"},_s={meta:{id:"forestCanopy",name:"Forest Canopy",tagline:"Moss on bark, dappled light — organic radii, earth serif.",tags:["light","nature","serif","organic"]},theme:{name:"Forest Canopy",darkMode:"light",recommendedDisplayStyle:"scandinavian",colors:{primary:"#3d5a40",primaryHover:"#2d4430",success:"#4a7c3a",warning:"#c88d3e",error:"#a63c3c",info:"#5a7c8a",accent:"#8ba878",focus:"#3d5a40",surface:"#f4f1e8",surfaceHover:"#ebe7d5"},backgrounds:{primary:"#f7f4e9",secondary:"#ede8d4",tertiary:"#dfd8be",hover:"#d5cdae",elevated:"#fcfaf1",inset:"#e5ddc5",canvas:"#f0ece0"},text:{primary:"#1e2a1c",secondary:"#3d4a36",muted:"#7a8570",inverse:"#f7f4e9"},borders:{color:"#c4bda0",width:"1px",divider:"#d8d0b5",radiusSm:"3px",radiusMd:"7px",radiusLg:"14px",radiusXl:"22px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(61,90,64,0.06)",md:"0 4px 12px -2px rgba(61,90,64,0.12), 0 2px 4px rgba(61,90,64,0.05)",lg:"0 10px 24px -6px rgba(61,90,64,0.16)",xl:"0 20px 40px -12px rgba(61,90,64,0.22)"},spacing:Ee,typography:{fontFamily:"'Lora', Georgia, serif",headingFontFamily:"'Spectral', 'Lora', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.7,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"180ms cubic-bezier(0.16,1,0.3,1)",normal:"280ms cubic-bezier(0.16,1,0.3,1)",slow:"420ms cubic-bezier(0.16,1,0.3,1)"},backgroundImage:{type:"pattern",pattern:"dots",opacity:.25}},displayStyle:"scandinavian",variantConfig:{density:"spacious",animation:"normal"}},Ws={meta:{id:"desertDune",name:"Desert Dune",tagline:"Ochre horizons, warm grain, serif that suns itself.",tags:["light","nature","serif","warm"]},theme:{name:"Desert Dune",darkMode:"light",recommendedDisplayStyle:"softCloud",colors:{primary:"#c8732f",primaryHover:"#a65a1c",success:"#7a8c3a",warning:"#e0a83a",error:"#b34747",info:"#7a8fa6",accent:"#e8a863",focus:"#c8732f",surface:"#fbf3e5",surfaceHover:"#f4e8d0"},backgrounds:{primary:"#fdf7ea",secondary:"#f6ebd3",tertiary:"#eeddb6",hover:"#e5cfa0",elevated:"#ffffff",inset:"#f0dfb8",canvas:"#fdf5e6"},text:{primary:"#3a2413",secondary:"#6b4823",muted:"#a88860",inverse:"#fdf7ea"},borders:{color:"#dcc08c",width:"1px",divider:"#e8d0a5",radiusSm:"12px",radiusMd:"18px",radiusLg:"28px",radiusXl:"40px",radiusFull:"9999px"},shadows:{sm:"0 2px 6px -2px rgba(200,115,47,0.1)",md:"0 8px 20px -6px rgba(200,115,47,0.15)",lg:"0 18px 36px -10px rgba(200,115,47,0.2)",xl:"0 32px 56px -18px rgba(200,115,47,0.28)"},spacing:Ee,typography:{fontFamily:"'DM Sans', -apple-system, sans-serif",headingFontFamily:"'DM Serif Display', Georgia, serif",monoFontFamily:"'Space Mono', ui-monospace, monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0",headingLetterSpacing:"-0.025em"},transitions:{fast:"160ms ease-out",normal:"280ms cubic-bezier(0.22,1,0.36,1)",slow:"460ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(175deg, #fbecc5 0%, #f6ddaf 40%, #eec28a 100%), radial-gradient(ellipse at 80% 10%, #fff4d9 0%, transparent 60%)"}},displayStyle:"softCloud",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},Vs={meta:{id:"arcticCrystal",name:"Arctic Crystal",tagline:"Facets of ice, lean typography, surgical whitespace.",tags:["light","nature","minimal","cold"]},theme:{name:"Arctic Crystal",darkMode:"light",recommendedDisplayStyle:"minimal",colors:{primary:"#2a6a8c",primaryHover:"#1e5374",success:"#4a8a6a",warning:"#d0a040",error:"#c24848",info:"#5a9fc0",accent:"#a8d4e8",focus:"#2a6a8c",surface:"#ffffff",surfaceHover:"#f0f6fa"},backgrounds:{primary:"#f5fafd",secondary:"#eaf2f7",tertiary:"#d8e5ed",hover:"#cfdce6",elevated:"#ffffff",inset:"#e3eef5",canvas:"#f0f7fb"},text:{primary:"#0a2030",secondary:"#3a5468",muted:"#7a95a8",inverse:"#ffffff"},borders:{color:"#cfdde8",width:"1px",divider:"#e0ebf3",radiusSm:"2px",radiusMd:"3px",radiusLg:"4px",radiusXl:"6px",radiusFull:"9999px"},shadows:{sm:"1px 1px 0 rgba(42,106,140,0.06), -1px 0 0 rgba(42,106,140,0.04)",md:"2px 2px 0 rgba(42,106,140,0.08), -2px 0 0 rgba(42,106,140,0.04), 0 4px 8px -2px rgba(42,106,140,0.1)",lg:"4px 4px 0 rgba(42,106,140,0.1), 0 10px 16px -4px rgba(42,106,140,0.14)",xl:"0 24px 40px -12px rgba(42,106,140,0.2)"},spacing:qe,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Inter', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:200,fontWeightMedium:300,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.6,letterSpacing:"0.01em",headingLetterSpacing:"-0.02em"},transitions:{fast:"90ms ease",normal:"160ms ease",slow:"260ms ease"}},displayStyle:"minimal",variantConfig:{radius:"sm",shadow:"subtle",density:"spacious",animation:"subtle"}},Xs={meta:{id:"autumnFoliage",name:"Autumn Foliage",tagline:"Ember glow, Fraunces serif, woodsmoke warmth.",tags:["light","nature","serif","warm"]},theme:{name:"Autumn Foliage",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#a83828",primaryHover:"#842818",success:"#6b7c2c",warning:"#c48020",error:"#8a2020",info:"#7a5a3a",accent:"#d89040",focus:"#a83828",surface:"#fbf1e3",surfaceHover:"#f2e4ce"},backgrounds:{primary:"#fdf5e8",secondary:"#f4e5cc",tertiary:"#e8d2aa",hover:"#dec295",elevated:"#fff9ee",inset:"#eedab5",canvas:"#faeed6"},text:{primary:"#2a140a",secondary:"#5a3020",muted:"#997860",inverse:"#fdf5e8"},borders:{color:"#d4b890",width:"1px",divider:"#e0c8a0",radiusSm:"4px",radiusMd:"8px",radiusLg:"14px",radiusXl:"22px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(168,56,40,0.08)",md:"0 4px 10px -2px rgba(168,56,40,0.12), 0 2px 4px rgba(168,56,40,0.08)",lg:"0 12px 24px -6px rgba(168,56,40,0.18)",xl:"0 24px 48px -16px rgba(168,56,40,0.24)"},spacing:X,typography:{fontFamily:"'Work Sans', sans-serif",headingFontFamily:"'Fraunces', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.005em",headingLetterSpacing:"-0.02em"},transitions:{fast:"140ms ease",normal:"220ms ease",slow:"360ms ease"}},displayStyle:"editorial",variantConfig:{density:"comfortable",animation:"normal"}},Us={meta:{id:"japaneseWashi",name:"Japanese Washi",tagline:"Sumi ink on cream — quiet serif, paper grain, zero excess.",tags:["light","cultural","serif","minimal"]},theme:{name:"Japanese Washi",darkMode:"light",recommendedDisplayStyle:"zen",colors:{primary:"#1d3557",primaryHover:"#0d2545",success:"#4a7042",warning:"#a8803e",error:"#8b2a2a",info:"#3a5a78",accent:"#c83a3a",focus:"#1d3557",surface:"#faf6ea",surfaceHover:"#f2ebd7"},backgrounds:{primary:"#fdf9ee",secondary:"#f5ecd5",tertiary:"#ecdfbd",hover:"#e4d5aa",elevated:"#ffffff",inset:"#f0e5c8",canvas:"#fbf6e7"},text:{primary:"#1a1610",secondary:"#3d352a",muted:"#8a7f64",inverse:"#fdf9ee"},borders:{color:"#1a1610",width:"1px",divider:"#d4c89e",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px"},shadows:{sm:"none",md:"0 1px 0 0 rgba(26,22,16,0.08)",lg:"0 2px 0 0 rgba(26,22,16,0.1)",xl:"0 4px 12px rgba(26,22,16,0.08)"},spacing:qe,typography:{fontFamily:"'Noto Sans JP', 'Inter', sans-serif",headingFontFamily:"'Noto Serif JP', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:700,lineHeight:1.75,letterSpacing:"0.02em",headingLetterSpacing:"0.01em"},transitions:{fast:"120ms ease",normal:"220ms ease",slow:"340ms ease"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.22,blendMode:"multiply"}},displayStyle:"zen",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},qs={meta:{id:"moroccanMosaic",name:"Moroccan Mosaic",tagline:"Zellige geometry — terracotta, teal, saffron in tiled rhythm.",tags:["light","cultural","geometric","warm"]},theme:{name:"Moroccan Mosaic",darkMode:"light",recommendedDisplayStyle:"bauhaus",colors:{primary:"#0f6b5c",primaryHover:"#0a5246",success:"#5a8a3a",warning:"#e0a03a",error:"#c2522a",info:"#3a7090",accent:"#e8a840",focus:"#0f6b5c",surface:"#f9f1dc",surfaceHover:"#f0e5c2"},backgrounds:{primary:"#fbf3e0",secondary:"#f2e4c2",tertiary:"#e6d2a0",hover:"#dac38a",elevated:"#fdf7e8",inset:"#ecd8b2",canvas:"#f8edd3"},text:{primary:"#2a1608",secondary:"#5a3a20",muted:"#a08860",inverse:"#fbf3e0"},borders:{color:"#2a1608",width:"2px",divider:"#b89868",radiusSm:"3px",radiusMd:"6px",radiusLg:"10px",radiusXl:"14px",radiusFull:"9999px"},shadows:{sm:"2px 2px 0 rgba(42,22,8,0.12)",md:"3px 3px 0 #0f6b5c, 6px 6px 0 rgba(42,22,8,0.08)",lg:"4px 4px 0 #0f6b5c, 8px 8px 0 #e8a840",xl:"6px 6px 0 #c2522a, 12px 12px 0 rgba(42,22,8,0.1)"},spacing:X,typography:{fontFamily:"'Cairo', 'Inter', sans-serif",headingFontFamily:"'Amiri', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"120ms linear",normal:"200ms linear",slow:"320ms linear"},backgroundImage:{type:"pattern",pattern:"hexagons",opacity:.2}},displayStyle:"bauhaus",variantConfig:{radius:"sm",shadow:"md",density:"normal",animation:"subtle"}},Gs={meta:{id:"artDecoGatsby",name:"Art Deco Gatsby",tagline:"Gold, emerald, onyx — geometric glamour, thin gilt lines.",tags:["dark","cultural","luxury","geometric"]},theme:{name:"Art Deco Gatsby",darkMode:"dark",recommendedDisplayStyle:"luxe",colors:{primary:"#d4af37",primaryHover:"#e8c850",success:"#4a9c7a",warning:"#e8c850",error:"#c24040",info:"#70a8c0",accent:"#1e5c4a",focus:"#d4af37",surface:"#0f1a16",surfaceHover:"#16251e"},backgrounds:{primary:"#0a0f0c",secondary:"#0f1a16",tertiary:"#16251e",hover:"#1c3028",elevated:"#0f1a16",inset:"#050908",canvas:"#080c0a"},text:{primary:"#f0e4c2",secondary:"#c0b080",muted:"#706448",inverse:"#0a0f0c"},borders:{color:"#6b5828",width:"1px",divider:"#4a3c18",focusColor:"#d4af37",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(212,175,55,0.15)",md:"0 2px 8px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,175,55,0.2)",lg:"0 8px 24px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,175,55,0.3), inset 0 1px 0 rgba(212,175,55,0.1)",xl:"0 20px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,175,55,0.4)",glow:"0 0 16px rgba(212,175,55,0.3)"},spacing:Ee,typography:{fontFamily:"'Cormorant Garamond', Georgia, serif",headingFontFamily:"'Poiret One', 'Cormorant Garamond', serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0.04em",headingLetterSpacing:"0.12em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"380ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"luxe",variantConfig:{radius:"none",shadow:"lg",density:"comfortable",animation:"subtle"}},Ks={meta:{id:"sovietConstructivist",name:"Soviet Constructivist",tagline:"Rodchenko red — slab type, hard angles, propaganda poise.",tags:["light","cultural","brutalist","geometric"]},theme:{name:"Soviet Constructivist",darkMode:"light",recommendedDisplayStyle:"brutalist",colors:{primary:"#c41e1e",primaryHover:"#8a1414",success:"#3a6a3a",warning:"#d08028",error:"#8a1414",info:"#2a4060",accent:"#1a1a1a",focus:"#c41e1e",surface:"#f0ead8",surfaceHover:"#e5dcc0"},backgrounds:{primary:"#f4efde",secondary:"#e8dec4",tertiary:"#d8c9a4",hover:"#ccbb90",elevated:"#faf5e5",inset:"#dccda8",canvas:"#f0ead5"},text:{primary:"#1a1a1a",secondary:"#3d3d3d",muted:"#706d5a",inverse:"#f4efde"},borders:{color:"#1a1a1a",width:"3px",divider:"#1a1a1a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"4px 0 0 0 #c41e1e",md:"6px 6px 0 0 #1a1a1a, 8px 8px 0 0 #c41e1e",lg:"10px 10px 0 0 #c41e1e",xl:"12px -4px 0 0 #1a1a1a, 16px 0 0 0 #c41e1e"},spacing:X,typography:{fontFamily:"'Roboto Condensed', 'Archivo', sans-serif",headingFontFamily:"'Alfa Slab One', 'Archivo Black', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.35,letterSpacing:"0.02em",headingLetterSpacing:"-0.005em"},transitions:{fast:"0ms linear",normal:"80ms linear",slow:"160ms linear"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"subtle"}},Js={meta:{id:"blueprint",name:"Blueprint",tagline:"Cyanotype drafting — white lines, grid paper, technical mono.",tags:["dark","tech","technical","mono"]},theme:{name:"Blueprint",darkMode:"dark",recommendedDisplayStyle:"dashboard",colors:{primary:"#f0f4f8",primaryHover:"#ffffff",success:"#88e0b8",warning:"#ffcc66",error:"#ff8888",info:"#88c8ff",accent:"#6eb0e0",focus:"#ffffff",surface:"#18456a",surfaceHover:"#1f527e"},backgrounds:{primary:"#0e3356",secondary:"#124066",tertiary:"#184d79",hover:"#1e5a8c",elevated:"#18456a",inset:"#082540",canvas:"#0a2d4a"},text:{primary:"#f0f4f8",secondary:"#b5c8da",muted:"#6e8aa4",inverse:"#0e3356"},borders:{color:"#3870a0",width:"1px",divider:"#2a5680",focusColor:"#ffffff",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(240,244,248,0.05)",md:"0 1px 0 0 rgba(240,244,248,0.1), 0 4px 8px rgba(0,0,0,0.3)",lg:"0 1px 0 0 rgba(240,244,248,0.14), 0 10px 20px rgba(0,0,0,0.4)",xl:"0 20px 40px rgba(0,0,0,0.5)"},spacing:X,typography:{fontFamily:"'IBM Plex Mono', ui-monospace, monospace",headingFontFamily:"'Space Grotesk', 'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"-0.01em"},transitions:{fast:"80ms linear",normal:"140ms linear",slow:"220ms linear"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.4}},displayStyle:"dashboard",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"subtle"}},Ys={meta:{id:"hologramUI",name:"Hologram UI",tagline:"Iridescent light-leaks, translucent layers, futurist geometry.",tags:["dark","tech","glass","neon"]},theme:{name:"Hologram UI",darkMode:"dark",recommendedDisplayStyle:"cosmic",colors:{primary:"#8be9fd",primaryHover:"#a8f0ff",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#bd93f9",accent:"#ff79c6",focus:"#8be9fd",surface:"rgba(40,30,70,0.5)",surfaceHover:"rgba(50,40,85,0.6)"},backgrounds:{primary:"rgba(30,20,55,0.6)",secondary:"rgba(40,30,70,0.5)",tertiary:"rgba(55,40,90,0.4)",hover:"rgba(65,50,105,0.55)",elevated:"rgba(50,38,82,0.7)",inset:"rgba(25,18,45,0.6)",canvas:"#0a0618"},text:{primary:"#f0e8ff",secondary:"#b0a0e0",muted:"#6a5a94",inverse:"#0a0618"},borders:{color:"rgba(139,233,253,0.25)",width:"1px",divider:"rgba(139,233,253,0.15)",focusColor:"#8be9fd",radiusSm:"4px",radiusMd:"8px",radiusLg:"14px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"0 0 12px rgba(139,233,253,0.2)",md:"0 4px 20px rgba(189,147,249,0.3), 0 0 1px rgba(139,233,253,0.4)",lg:"0 8px 40px rgba(255,121,198,0.35), 0 0 2px rgba(139,233,253,0.5), inset 0 1px 0 rgba(255,255,255,0.08)",xl:"0 20px 60px rgba(139,233,253,0.4), inset 0 1px 0 rgba(255,255,255,0.1)",glow:"0 0 32px rgba(139,233,253,0.6), 0 0 64px rgba(255,121,198,0.3)"},spacing:X,typography:{fontFamily:"'Rajdhani', -apple-system, sans-serif",headingFontFamily:"'Orbitron', 'Rajdhani', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.06em"},transitions:{fast:"160ms cubic-bezier(0.4,0,0.2,1)",normal:"280ms cubic-bezier(0.4,0,0.2,1)",slow:"440ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 15% 20%, rgba(139,233,253,0.25) 0%, transparent 50%), radial-gradient(at 85% 25%, rgba(255,121,198,0.25) 0%, transparent 50%), radial-gradient(at 50% 90%, rgba(189,147,249,0.3) 0%, transparent 55%), linear-gradient(135deg, #0a0618 0%, #1a0e38 100%)"}},displayStyle:"cosmic",variantConfig:{shadow:"glow",density:"normal",animation:"normal"}},Qs={meta:{id:"deepSea",name:"Deep Sea",tagline:"Midnight blue abyss, bioluminescent accents in the dark.",tags:["dark","tech","organic"]},theme:{name:"Deep Sea",darkMode:"dark",recommendedDisplayStyle:"modern3d",colors:{primary:"#00d9c4",primaryHover:"#2feedc",success:"#5af0b0",warning:"#f0c858",error:"#ff6a82",info:"#60c0ff",accent:"#a878f0",focus:"#00d9c4",surface:"#0a1524",surfaceHover:"#0e1c30"},backgrounds:{primary:"#05101c",secondary:"#0a1524",tertiary:"#0f1f34",hover:"#163044",elevated:"#0e1c30",inset:"#030810",canvas:"#030810"},text:{primary:"#d8f0f5",secondary:"#88b8c8",muted:"#4a7080",inverse:"#030810"},borders:{color:"#183548",width:"1px",divider:"#0f2638",focusColor:"#00d9c4",radiusSm:"8px",radiusMd:"14px",radiusLg:"22px",radiusXl:"32px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,217,196,0.08)",md:"0 6px 20px rgba(0,217,196,0.12), 0 2px 4px rgba(0,0,0,0.5)",lg:"0 14px 40px rgba(0,217,196,0.18), 0 4px 8px rgba(0,0,0,0.6)",xl:"0 28px 64px rgba(0,217,196,0.22), 0 8px 16px rgba(0,0,0,0.7)",glow:"0 0 24px rgba(0,217,196,0.5)"},spacing:X,typography:{fontFamily:"'IBM Plex Sans', -apple-system, sans-serif",headingFontFamily:"'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"160ms cubic-bezier(0.22,1,0.36,1)",normal:"280ms cubic-bezier(0.22,1,0.36,1)",slow:"440ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 20% 30%, rgba(0,217,196,0.08) 0%, transparent 60%), radial-gradient(at 80% 80%, rgba(168,120,240,0.06) 0%, transparent 55%), linear-gradient(180deg, #030810 0%, #05101c 100%)"}},displayStyle:"modern3d",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},Zs={meta:{id:"analog70s",name:"Analog 70s",tagline:"Mustard, rust, walnut — chunky, warm, turntable energy.",tags:["light","retro","warm","serif"]},theme:{name:"Analog 70s",darkMode:"light",recommendedDisplayStyle:"rounded",colors:{primary:"#c8621e",primaryHover:"#a04d14",success:"#7a8a2a",warning:"#d8a030",error:"#a03030",info:"#6a7a8a",accent:"#d8a830",focus:"#c8621e",surface:"#f5ead2",surfaceHover:"#ecdfc0"},backgrounds:{primary:"#f7ecd6",secondary:"#eeddb8",tertiary:"#e2c998",hover:"#d8bc80",elevated:"#fbf2de",inset:"#e8cfa5",canvas:"#f2e4c8"},text:{primary:"#2a1608",secondary:"#5a2e14",muted:"#a07852",inverse:"#f7ecd6"},borders:{color:"#b89868",width:"2px",divider:"#ccb285",radiusSm:"10px",radiusMd:"16px",radiusLg:"24px",radiusXl:"34px",radiusFull:"9999px"},shadows:{sm:"0 2px 0 0 rgba(42,22,8,0.12)",md:"0 4px 0 0 rgba(42,22,8,0.15), 0 6px 10px rgba(200,98,30,0.12)",lg:"0 6px 0 0 rgba(42,22,8,0.18), 0 10px 20px rgba(200,98,30,0.2)",xl:"0 8px 0 0 rgba(42,22,8,0.22), 0 20px 40px rgba(200,98,30,0.28)"},spacing:X,typography:{fontFamily:"'Work Sans', sans-serif",headingFontFamily:"'Abril Fatface', Georgia, serif",monoFontFamily:"'Space Mono', ui-monospace, monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"180ms cubic-bezier(0.34,1.56,0.64,1)",normal:"280ms cubic-bezier(0.34,1.56,0.64,1)",slow:"440ms cubic-bezier(0.34,1.56,0.64,1)"}},displayStyle:"rounded",variantConfig:{radius:"xl",shadow:"md",density:"comfortable",animation:"playful"}},eo={meta:{id:"vhsTracking",name:"VHS Tracking",tagline:"Chromatic smear, scan-line haze, pixel type from another decade.",tags:["dark","retro","pixel","experimental"]},theme:{name:"VHS Tracking",darkMode:"dark",recommendedDisplayStyle:"retro8bit",colors:{primary:"#ff3eb5",primaryHover:"#ff5fc5",success:"#3eff90",warning:"#ffe83e",error:"#ff3e3e",info:"#3ee0ff",accent:"#3eff90",focus:"#ff3eb5",surface:"#120818",surfaceHover:"#1a0c24"},backgrounds:{primary:"#0a0412",secondary:"#120818",tertiary:"#1a0c24",hover:"#241230",elevated:"#120818",inset:"#050208",canvas:"#0a0412"},text:{primary:"#f8e8ff",secondary:"#c888d8",muted:"#605070",inverse:"#0a0412"},borders:{color:"#4a2864",width:"1px",divider:"#2a1840",focusColor:"#ff3eb5",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0"},shadows:{sm:"-2px 0 0 rgba(255,62,181,0.5), 2px 0 0 rgba(62,224,255,0.5)",md:"-3px 0 0 rgba(255,62,181,0.6), 3px 0 0 rgba(62,224,255,0.6), 0 4px 12px rgba(0,0,0,0.6)",lg:"-4px 0 0 rgba(255,62,181,0.7), 4px 0 0 rgba(62,224,255,0.7), 0 8px 24px rgba(0,0,0,0.7)",xl:"-6px 0 0 rgba(255,62,181,0.8), 6px 0 0 rgba(62,224,255,0.8)",glow:"0 0 20px rgba(255,62,181,0.6)"},spacing:X,typography:{fontFamily:"'VT323', 'JetBrains Mono', monospace",headingFontFamily:"'VT323', monospace",monoFontFamily:"'VT323', monospace",fontSizeXs:"0.9375rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.375rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:400,fontWeightBold:400,lineHeight:1.35,letterSpacing:"0.01em",headingLetterSpacing:"0.04em"},transitions:{fast:"40ms steps(3)",normal:"100ms steps(5)",slow:"180ms steps(8)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #0a0412 0%, #120818 100%), repeating-linear-gradient(0deg, rgba(255,62,181,0.03) 0 2px, transparent 2px 4px)"}},displayStyle:"retro8bit",variantConfig:{radius:"none",shadow:"md",density:"normal",animation:"subtle"}},to={meta:{id:"typewriterPress",name:"Typewriter Press",tagline:"Ribbon red on cream — Courier bones, stamped display.",tags:["light","retro","mono","editorial"]},theme:{name:"Typewriter Press",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#b02020",primaryHover:"#8a1818",success:"#4a7038",warning:"#b08018",error:"#8a1818",info:"#3a5068",accent:"#1a1a1a",focus:"#b02020",surface:"#faf3df",surfaceHover:"#f0e7c6"},backgrounds:{primary:"#fbf5e3",secondary:"#f3e9c8",tertiary:"#ebdcab",hover:"#e2cf8f",elevated:"#fffae7",inset:"#efe0b0",canvas:"#fbf5e3"},text:{primary:"#1a1a1a",secondary:"#3d3428",muted:"#7a6f4a",inverse:"#fbf5e3"},borders:{color:"#1a1a1a",width:"1px",divider:"#c8b880",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"0 0 0 rgba(26,26,26,0), 1px 1px 0 rgba(26,26,26,0.12)",md:"1px 1px 0 rgba(26,26,26,0.15), 2px 2px 0 rgba(176,32,32,0.1)",lg:"2px 2px 0 rgba(26,26,26,0.2), 4px 4px 0 rgba(176,32,32,0.12)",xl:"3px 3px 0 rgba(26,26,26,0.25)"},spacing:X,typography:{fontFamily:"'Courier Prime', 'Courier New', monospace",headingFontFamily:"'Special Elite', 'Courier Prime', monospace",monoFontFamily:"'Courier Prime', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0.01em",headingLetterSpacing:"0.04em"},transitions:{fast:"40ms linear",normal:"80ms linear",slow:"140ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.2,blendMode:"multiply"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"subtle",density:"normal",animation:"none"}},ro={meta:{id:"y2kAqua",name:"Y2K Aqua",tagline:"Chrome and aqua — iMac blue, optimistic futurism, 2001 energy.",tags:["light","retro","glass"]},theme:{name:"Y2K Aqua",darkMode:"light",recommendedDisplayStyle:"modern3d",colors:{primary:"#0a84ff",primaryHover:"#0066cc",success:"#34c759",warning:"#ff9500",error:"#ff3b30",info:"#5ac8fa",accent:"#5ac8fa",focus:"#0a84ff",surface:"#f0f5fc",surfaceHover:"#e0ecfa"},backgrounds:{primary:"#e8f2fc",secondary:"#d8e8f8",tertiary:"#c0d8f0",hover:"#a8c8e8",elevated:"#ffffff",inset:"#c8dcf4",canvas:"#dce8f4"},text:{primary:"#0a1a30",secondary:"#304868",muted:"#6a88a8",inverse:"#ffffff"},borders:{color:"#a0c0e0",width:"1px",divider:"#c0d8f0",radiusSm:"6px",radiusMd:"10px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(10,132,255,0.15)",md:"inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -1px 2px rgba(10,132,255,0.2), 0 2px 6px rgba(10,132,255,0.25), 0 4px 12px rgba(10,132,255,0.15)",lg:"inset 0 1px 0 rgba(255,255,255,0.95), 0 4px 12px rgba(10,132,255,0.3), 0 10px 24px rgba(90,200,250,0.25)",xl:"inset 0 2px 0 rgba(255,255,255,1), 0 8px 24px rgba(10,132,255,0.35), 0 20px 48px rgba(90,200,250,0.3)"},spacing:X,typography:{fontFamily:"'Chakra Petch', -apple-system, sans-serif",headingFontFamily:"'Chakra Petch', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.01em",headingLetterSpacing:"-0.005em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"380ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #f0f7ff 0%, #d8e8f8 60%, #bcd6f0 100%)"}},displayStyle:"modern3d",variantConfig:{radius:"lg",shadow:"lg",density:"normal",animation:"normal"}},ao={meta:{id:"vogueDidone",name:"Vogue Didone",tagline:"Didone serif, arctic whitespace, one red heartbeat.",tags:["light","editorial","serif","luxury"]},theme:{name:"Vogue Didone",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#000000",primaryHover:"#1a1a1a",success:"#1f6a3a",warning:"#8a6a1a",error:"#c40018",info:"#2a4068",accent:"#c40018",focus:"#c40018",surface:"#ffffff",surfaceHover:"#f7f7f7"},backgrounds:{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f2f2f2",hover:"#ededed",elevated:"#ffffff",inset:"#f5f5f5",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#2a2a2a",muted:"#808080",inverse:"#ffffff"},borders:{color:"#000000",width:"1px",divider:"#dcdcdc",radiusSm:"0",radiusMd:"0",radiusLg:"1px",radiusXl:"2px",radiusFull:"9999px"},shadows:{sm:"none",md:"none",lg:"0 1px 0 0 #000000",xl:"0 2px 0 0 #000000"},spacing:qe,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Playfair Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:900,lineHeight:1.7,letterSpacing:"0.02em",headingLetterSpacing:"-0.03em"},transitions:{fast:"120ms ease",normal:"220ms ease",slow:"360ms ease"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},no={meta:{id:"comicHalftone",name:"Comic Halftone",tagline:"CMYK pop — halftone dots, action type, offset ink shadows.",tags:["light","editorial","playful"]},theme:{name:"Comic Halftone",darkMode:"light",recommendedDisplayStyle:"playful",colors:{primary:"#e8182c",primaryHover:"#c01020",success:"#1ea862",warning:"#f0c820",error:"#e8182c",info:"#1878c8",accent:"#1878c8",focus:"#e8182c",surface:"#fffdf4",surfaceHover:"#fff8d8"},backgrounds:{primary:"#fffef0",secondary:"#fff6b8",tertiary:"#ffe870",hover:"#ffd838",elevated:"#ffffff",inset:"#fff090",canvas:"#fffdec"},text:{primary:"#0a0a0a",secondary:"#2a2a2a",muted:"#707070",inverse:"#fffef0"},borders:{color:"#0a0a0a",width:"3px",divider:"#0a0a0a",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"3px 3px 0 0 #0a0a0a",md:"5px 5px 0 0 #0a0a0a",lg:"6px 6px 0 0 #e8182c, 10px 10px 0 0 #0a0a0a",xl:"8px 8px 0 0 #1878c8, 12px 12px 0 0 #0a0a0a"},spacing:X,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Bangers', 'Archivo Black', cursive",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2.125rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.45,letterSpacing:"0",headingLetterSpacing:"0.03em"},transitions:{fast:"100ms cubic-bezier(0.34,1.56,0.64,1)",normal:"200ms cubic-bezier(0.34,1.56,0.64,1)",slow:"320ms cubic-bezier(0.34,1.56,0.64,1)"},backgroundImage:{type:"pattern",pattern:"dots",opacity:.5}},displayStyle:"playful",variantConfig:{radius:"sm",shadow:"lg",density:"normal",animation:"playful"}},so={meta:{id:"zinePunk",name:"Zine Punk",tagline:"Photocopier grain, marker headlines, cut-and-paste attitude.",tags:["light","editorial","experimental","brutalist"]},theme:{name:"Zine Punk",darkMode:"light",recommendedDisplayStyle:"brutalist",colors:{primary:"#0a0a0a",primaryHover:"#000000",success:"#1a1a1a",warning:"#2a2a2a",error:"#0a0a0a",info:"#1a1a1a",accent:"#0a0a0a",focus:"#0a0a0a",surface:"#f5f3ee",surfaceHover:"#e8e4d8"},backgrounds:{primary:"#efece0",secondary:"#e3dfd0",tertiary:"#d4d0c0",hover:"#c8c4b4",elevated:"#f5f3ee",inset:"#e0dcc8",canvas:"#ede8d8"},text:{primary:"#0a0a0a",secondary:"#1a1a1a",muted:"#505050",inverse:"#efece0"},borders:{color:"#0a0a0a",width:"2px",divider:"#0a0a0a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"2px 3px 0 rgba(10,10,10,0.9)",md:"4px 6px 0 rgba(10,10,10,0.9), -2px 2px 0 rgba(10,10,10,0.3)",lg:"6px 10px 0 rgba(10,10,10,1), -4px 2px 0 rgba(10,10,10,0.4)",xl:"10px 14px 0 rgba(10,10,10,1)"},spacing:X,typography:{fontFamily:"'Special Elite', 'Courier Prime', monospace",headingFontFamily:"'Permanent Marker', 'Special Elite', cursive",monoFontFamily:"'Courier Prime', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:400,fontWeightBold:400,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.01em"},transitions:{fast:"20ms linear",normal:"60ms linear",slow:"120ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.3,blendMode:"multiply"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"none"}},oo={meta:{id:"watercolorWash",name:"Watercolor Wash",tagline:"Soft pastel bleeds, handwritten headings, paper gentleness.",tags:["light","artistic","pastel","organic"]},theme:{name:"Watercolor Wash",darkMode:"light",recommendedDisplayStyle:"softCloud",colors:{primary:"#9d7bc4",primaryHover:"#8262ab",success:"#7bb88a",warning:"#e0a868",error:"#d47878",info:"#7ba8c4",accent:"#e0a0c0",focus:"#9d7bc4",surface:"rgba(255,250,245,0.8)",surfaceHover:"rgba(250,240,238,0.9)"},backgrounds:{primary:"#fdf8f4",secondary:"#f8eee6",tertiary:"#f0e0d4",hover:"#e8d2c0",elevated:"#ffffff",inset:"#f4e4d8",canvas:"#fdf8f4"},text:{primary:"#3a2845",secondary:"#6a5868",muted:"#a89ca4",inverse:"#fdf8f4"},borders:{color:"#e8d4c8",width:"1px",divider:"#f0e0d4",radiusSm:"10px",radiusMd:"18px",radiusLg:"30px",radiusXl:"44px",radiusFull:"9999px"},shadows:{sm:"0 2px 10px rgba(157,123,196,0.08)",md:"0 6px 24px rgba(157,123,196,0.12), 0 2px 4px rgba(224,160,192,0.06)",lg:"0 16px 40px rgba(157,123,196,0.18), 0 6px 12px rgba(224,160,192,0.1)",xl:"0 30px 64px rgba(157,123,196,0.22)"},spacing:Ee,typography:{fontFamily:"'Quicksand', -apple-system, sans-serif",headingFontFamily:"'Caveat', 'Quicksand', cursive",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0",headingLetterSpacing:"-0.005em"},transitions:{fast:"220ms cubic-bezier(0.22,1,0.36,1)",normal:"380ms cubic-bezier(0.22,1,0.36,1)",slow:"600ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 18% 22%, rgba(232,208,220,0.5) 0%, transparent 40%), radial-gradient(at 82% 28%, rgba(200,220,240,0.45) 0%, transparent 45%), radial-gradient(at 35% 80%, rgba(232,228,200,0.4) 0%, transparent 50%), linear-gradient(180deg, #fdf8f4 0%, #f8eee6 100%)"}},displayStyle:"softCloud",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},io={meta:{id:"memphis80s",name:"Memphis 80s",tagline:"Squiggle chaos — cyan, pink, yellow, serious typography, no.",tags:["light","artistic","playful"]},theme:{name:"Memphis 80s",darkMode:"light",recommendedDisplayStyle:"playful",colors:{primary:"#f02080",primaryHover:"#c81868",success:"#28c868",warning:"#f8d820",error:"#f02040",info:"#20b8e8",accent:"#f8d820",focus:"#20b8e8",surface:"#fffffa",surfaceHover:"#fff7d0"},backgrounds:{primary:"#fffceb",secondary:"#fff2d0",tertiary:"#ffe8b4",hover:"#ffdd98",elevated:"#ffffff",inset:"#fff0c0",canvas:"#fffbe0"},text:{primary:"#0a0a1a",secondary:"#2a2a3a",muted:"#6a6a7a",inverse:"#fffceb"},borders:{color:"#0a0a1a",width:"2px",divider:"#0a0a1a",radiusSm:"4px",radiusMd:"6px",radiusLg:"10px",radiusXl:"14px",radiusFull:"9999px"},shadows:{sm:"3px 3px 0 0 #20b8e8",md:"4px 4px 0 0 #f02080, 8px 8px 0 0 #f8d820",lg:"5px 5px 0 0 #28c868, 10px 10px 0 0 #20b8e8, 15px 15px 0 0 #f02080",xl:"6px 6px 0 0 #f8d820, 12px 12px 0 0 #f02080, 18px 18px 0 0 #20b8e8"},spacing:X,typography:{fontFamily:"'Rubik', -apple-system, sans-serif",headingFontFamily:"'Rubik Mono One', 'Rubik', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.4,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"120ms cubic-bezier(0.68,-0.55,0.27,1.55)",normal:"220ms cubic-bezier(0.68,-0.55,0.27,1.55)",slow:"360ms cubic-bezier(0.68,-0.55,0.27,1.55)"},backgroundImage:{type:"pattern",pattern:"zigzag",opacity:.3}},displayStyle:"playful",variantConfig:{radius:"sm",shadow:"lg",density:"normal",animation:"playful"}},co={meta:{id:"inkSumie",name:"Ink Sumi-e",tagline:"Charcoal brush on rice paper — vast silence, one red seal.",tags:["light","artistic","serif","minimal"]},theme:{name:"Ink Sumi-e",darkMode:"light",recommendedDisplayStyle:"zen",colors:{primary:"#1a1a1a",primaryHover:"#000000",success:"#2a4a2a",warning:"#705820",error:"#b82020",info:"#2a4060",accent:"#b82020",focus:"#1a1a1a",surface:"#ffffff",surfaceHover:"#f8f7f3"},backgrounds:{primary:"#fdfcf7",secondary:"#f5f3eb",tertiary:"#ebe8dc",hover:"#dfdbcc",elevated:"#ffffff",inset:"#f0edde",canvas:"#fdfcf7"},text:{primary:"#1a1a1a",secondary:"#3a3a3a",muted:"#888482",inverse:"#fdfcf7"},borders:{color:"#1a1a1a",width:"1px",divider:"#d8d4c4",radiusSm:"0",radiusMd:"0",radiusLg:"1px",radiusXl:"2px",radiusFull:"9999px"},shadows:{sm:"none",md:"none",lg:"none",xl:"0 0 0 1px #1a1a1a"},spacing:qe,typography:{fontFamily:"'Noto Sans JP', -apple-system, sans-serif",headingFontFamily:"'Noto Serif JP', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.625rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:700,lineHeight:1.85,letterSpacing:"0.04em",headingLetterSpacing:"0"},transitions:{fast:"200ms ease",normal:"340ms ease",slow:"520ms ease"}},displayStyle:"zen",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},lo={meta:{id:"dieterRams",name:"Dieter Rams",tagline:"Less-but-better — warm gray, single yellow dot, measured everything.",tags:["light","minimal","industrial"]},theme:{name:"Dieter Rams",darkMode:"light",recommendedDisplayStyle:"swiss",colors:{primary:"#1a1a1a",primaryHover:"#0a0a0a",success:"#3a7840",warning:"#e8c020",error:"#c83028",info:"#3868a0",accent:"#e8c020",focus:"#1a1a1a",surface:"#ffffff",surfaceHover:"#f8f8f8"},backgrounds:{primary:"#fbfbf9",secondary:"#f2f2ee",tertiary:"#e8e8e2",hover:"#dedeD6",elevated:"#ffffff",inset:"#ededE7",canvas:"#f5f5f1"},text:{primary:"#0a0a0a",secondary:"#3a3a38",muted:"#888880",inverse:"#fbfbf9"},borders:{color:"#d4d4ce",width:"1px",divider:"#e0e0da",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 1px 0 0 rgba(0,0,0,0.04)",md:"0 1px 0 0 rgba(0,0,0,0.06), 0 4px 8px -2px rgba(0,0,0,0.06)",lg:"0 2px 0 0 rgba(0,0,0,0.08), 0 10px 20px -6px rgba(0,0,0,0.1)",xl:"0 20px 40px -12px rgba(0,0,0,0.14)"},spacing:Os,typography:{fontFamily:"'IBM Plex Sans', -apple-system, sans-serif",headingFontFamily:"'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.015em"},transitions:{fast:"100ms cubic-bezier(0.4,0,0.2,1)",normal:"180ms cubic-bezier(0.4,0,0.2,1)",slow:"280ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"swiss",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"subtle"}},uo={meta:{id:"blackTieGala",name:"Black Tie Gala",tagline:"Absolute black, hand-gilded detail, whispered serif elegance.",tags:["dark","luxury","serif"]},theme:{name:"Black Tie Gala",darkMode:"dark",recommendedDisplayStyle:"luxe",colors:{primary:"#c89848",primaryHover:"#e0b868",success:"#68a878",warning:"#e0b050",error:"#c85858",info:"#8aa8d0",accent:"#e8d0a0",focus:"#c89848",surface:"#0e0e0e",surfaceHover:"#161616"},backgrounds:{primary:"#050505",secondary:"#0e0e0e",tertiary:"#161616",hover:"#1e1e1e",elevated:"#0e0e0e",inset:"#020202",canvas:"#030303"},text:{primary:"#f0ead8",secondary:"#a89870",muted:"#605848",inverse:"#050505"},borders:{color:"#3a2e18",width:"1px",divider:"#241a0c",focusColor:"#c89848",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(200,152,72,0.1)",md:"0 4px 16px rgba(0,0,0,0.8), 0 0 0 1px rgba(200,152,72,0.15)",lg:"0 10px 32px rgba(0,0,0,0.9), 0 0 0 1px rgba(200,152,72,0.25), inset 0 1px 0 rgba(232,208,160,0.08)",xl:"0 24px 56px rgba(0,0,0,1), 0 0 0 1px rgba(200,152,72,0.35)",glow:"0 0 24px rgba(200,152,72,0.25)"},spacing:Ee,typography:{fontFamily:"'Cormorant Garamond', Georgia, serif",headingFontFamily:"'Cormorant Garamond', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.65,letterSpacing:"0.05em",headingLetterSpacing:"0.08em"},transitions:{fast:"180ms cubic-bezier(0.4,0,0.2,1)",normal:"320ms cubic-bezier(0.4,0,0.2,1)",slow:"500ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"luxe",variantConfig:{radius:"sm",shadow:"lg",density:"spacious",animation:"subtle"}},fo={meta:{id:"swissGrid",name:"Swiss Grid",tagline:"Akzidenz rigor — white, black, one red, grid discipline.",tags:["light","minimal","editorial"]},theme:{name:"Swiss Grid",darkMode:"light",recommendedDisplayStyle:"swiss",colors:{primary:"#e30613",primaryHover:"#b8040f",success:"#00683d",warning:"#b8700a",error:"#e30613",info:"#004c98",accent:"#e30613",focus:"#e30613",surface:"#ffffff",surfaceHover:"#f5f5f5"},backgrounds:{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#e0e0e0",elevated:"#ffffff",inset:"#f0f0f0",canvas:"#ffffff"},text:{primary:"#0a0a0a",secondary:"#2a2a2a",muted:"#707070",inverse:"#ffffff"},borders:{color:"#0a0a0a",width:"1px",divider:"#d0d0d0",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"none",md:"0 1px 0 0 rgba(10,10,10,0.1)",lg:"0 2px 0 0 rgba(10,10,10,0.12)",xl:"0 4px 0 0 rgba(10,10,10,0.15)"},spacing:Os,typography:{fontFamily:"'Inter', 'Helvetica Neue', sans-serif",headingFontFamily:"'Inter', 'Helvetica Neue', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.45,letterSpacing:"0",headingLetterSpacing:"-0.03em"},transitions:{fast:"60ms linear",normal:"120ms linear",slow:"200ms linear"}},displayStyle:"swiss",variantConfig:{radius:"none",shadow:"none",density:"compact",animation:"subtle"}},Ft={forestCanopy:_s,desertDune:Ws,arcticCrystal:Vs,autumnFoliage:Xs,japaneseWashi:Us,moroccanMosaic:qs,artDecoGatsby:Gs,sovietConstructivist:Ks,blueprint:Js,hologramUI:Ys,deepSea:Qs,analog70s:Zs,vhsTracking:eo,typewriterPress:to,y2kAqua:ro,vogueDidone:ao,comicHalftone:no,zinePunk:so,watercolorWash:oo,memphis80s:io,inkSumie:co,dieterRams:lo,blackTieGala:uo,swissGrid:fo},mo=Object.values(Ft);function jd(e){return Ft[e]}function Bd(e){return mo.filter(t=>t.meta.tags.includes(e))}function Od(e,t){return e??t.recommendedDisplayStyle??"default"}function Kt(e){return e.toLowerCase().replace(/[\s_-]+/g,"")}function Jt(e){if(e&&typeof e=="object")return e;if(typeof e=="string"){const t=Kt(e),r=lt.find(a=>Kt(a.name)===t);if(r)return r;process.env.NODE_ENV!=="production"&&console.warn(`[@nice2dev/ui] <NiceThemeProvider theme="${e}"> — unknown preset name. Falling back to 'Light'. Available: ${lt.map(a=>a.name).join(", ")}.`)}return zt}const po=({theme:e,darkTheme:t,variantConfig:r,darkMode:a,displayStyle:n,animateTransitions:s=!0,children:i})=>{const o=c.useMemo(()=>Jt(e),[e]),l=c.useMemo(()=>t===void 0?void 0:Jt(t),[t]),d=c.useId(),u=c.useMemo(()=>`p${d.replace(/:/g,"")}`,[d]),f=c.useRef(null),p=c.useRef(null),[h,m]=c.useState(null),[y,g]=c.useState(o),[v,b]=c.useState(!1),[S,w]=c.useState(()=>Od(n,o));c.useEffect(()=>{n!==void 0?w(n):o.recommendedDisplayStyle&&w(o.recommendedDisplayStyle)},[n,o.recommendedDisplayStyle]),c.useEffect(()=>{const E=window.matchMedia("(prefers-color-scheme: dark)");b(E.matches);const R=T=>b(T.matches);return E.addEventListener("change",R),()=>E.removeEventListener("change",R)},[]);const A=a??o.darkMode??"light",k=A==="dark"||A==="auto"&&v;c.useEffect(()=>{g(k&&l?l:o)},[o,l,k]),c.useEffect(()=>{if(typeof document>"u")return;const E=document.createElement("div");return E.className="nice-theme-scope nice-theme-portal-host",E.dataset.ntdProvider=u,E.style.display="contents",document.body.appendChild(E),p.current=E,m(E),()=>{E.parentNode&&E.parentNode.removeChild(E),p.current=null,m(null)}},[u]),c.useEffect(()=>{const E=f.current;if(!E)return;s&&(E.style.transition="background-color 300ms ease, color 300ms ease");const R=De(y);for(const[F,z]of Object.entries(R))E.style.setProperty(F,z);const T=p.current;if(T)for(const[F,z]of Object.entries(R))T.style.setProperty(F,z);E.style.colorScheme=k?"dark":"light",E.dataset.ntdColorScheme=k?"dark":"light",E.dataset.theme=k?"dark":"light",k?E.classList.add("nice-dark"):E.classList.remove("nice-dark"),T&&(T.style.colorScheme=k?"dark":"light",T.dataset.ntdColorScheme=k?"dark":"light",T.dataset.theme=k?"dark":"light",k?T.classList.add("nice-dark"):T.classList.remove("nice-dark"));const D=y.backgroundImage;return D&&D.type!=="none"&&D.type==="gradient"&&D.gradient&&E.style.setProperty("--ntd-bg-image",D.gradient),()=>{E&&Aa(E)}},[y,k,s,h]);const C=c.useRef(new Set);c.useEffect(()=>{if(process.env.NODE_ENV==="production"||typeof window>"u"||typeof document>"u")return;const E=window.setTimeout(()=>{const R=De(y),T=["--color-primary","--nice-primary","--bg-primary","--text-primary"].find(H=>R[H])??Object.keys(R)[0];if(!T)return;const D=String(R[T]??"").trim();if(!D)return;const F=getComputedStyle(document.documentElement).getPropertyValue(T).trim();if(!F||F===D)return;const z=`${u}::${y.name??"unnamed"}::${T}`;C.current.has(z)||(C.current.add(z),console.warn(`[NiceThemeProvider] CSS var "${T}" on documentElement (${F}) does not match the active provider pack "${y.name??"unnamed"}" (${D}). An external applyTheme(...) call (or other code) is overriding the provider — portaled overlays and components reading from :root will look inconsistent. Either remove the external applyTheme call or wrap your app entirely in a single NiceThemeProvider.`))},0);return()=>window.clearTimeout(E)},[y,u]),c.useEffect(()=>{const E=f.current;if(!E)return;const R=r?{...K,...r}:be(S);pt(R,E,u);const T=dr(S);for(const[D,F]of Object.entries(T))E.setAttribute(D,F);return()=>{cr(u,E)}},[r,S,u]);const M=c.useCallback(E=>{g(E)},[]),N=c.useMemo(()=>({theme:y,setTheme:M,portalTarget:h}),[y,M,h]),L=c.useMemo(()=>({displayStyle:S,variantConfig:be(S),setDisplayStyle:w}),[S]);return x.jsx(Rt.Provider,{value:N,children:x.jsx($e.Provider,{value:L,children:x.jsx("div",{ref:f,className:"nice-theme-scope","data-ntd-provider":u,style:{display:"contents"},children:i})})})};po.displayName="NiceThemeProvider";const go=c.createContext(null);function yo(){const e=c.useContext(go);if(!e)throw new Error("useThemeVariants must be used within NiceThemeVariantProvider");return e}function _d({initialConfig:e,storageKey:t="ntd-variant-config",autoApply:r=!0,children:a}){const[n,s]=c.useState(()=>{if(typeof window<"u"&&t){const d=localStorage.getItem(t);if(d)try{return{...K,...JSON.parse(d)}}catch{}}return{...K,...e}});c.useEffect(()=>{r&&typeof window<"u"&&pt(n)},[n,r]),c.useEffect(()=>{typeof window<"u"&&t&&localStorage.setItem(t,JSON.stringify(n))},[n,t]);const i=c.useCallback(d=>{s(u=>({...u,...d}))},[]),o=c.useCallback(d=>{const u=He[d];u&&s(u)},[]),l=c.useCallback(()=>{s(K)},[]);return x.jsx(go.Provider,{value:{config:n,setConfig:i,applyPreset:o,reset:l},children:a})}function Wd({showPresets:e=!0,showPreview:t=!0,showCSS:r=!1,collapsible:a=!0,className:n,style:s}){const{config:i,setConfig:o,applyPreset:l,reset:d}=yo(),[u,f]=c.useState(new Set(["presets","radius","shadow"])),p=m=>{a&&f(y=>{const g=new Set(y);return g.has(m)?g.delete(m):g.add(m),g})},h=m=>!a||u.has(m);return x.jsxs("div",{className:`ntd-theme-variant-configurator ${n||""}`,style:{fontFamily:"system-ui, sans-serif",fontSize:"14px",...s},children:[e&&x.jsx(q,{title:"Presets",expanded:h("presets"),onToggle:()=>p("presets"),children:x.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[Object.keys(He).map(m=>x.jsx("button",{onClick:()=>l(m),style:{padding:"6px 12px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-secondary, #f9fafb)",cursor:"pointer",textTransform:"capitalize"},children:m},m)),x.jsx("button",{onClick:d,style:{padding:"6px 12px",border:"1px solid var(--nice-danger-dark, #dc2626)",borderRadius:"6px",background:"var(--danger-bg, #fef2f2)",color:"var(--color-error, #dc2626)",cursor:"pointer"},children:"Reset"})]})}),x.jsx(q,{title:"Border Radius",expanded:h("radius"),onToggle:()=>p("radius"),children:x.jsx(oe,{options:Object.keys(he),value:i.radius,onChange:m=>o({radius:m}),renderPreview:m=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--color-accent, #6366f1)",borderRadius:he[m].md}})})}),x.jsx(q,{title:"Shadows",expanded:h("shadow"),onToggle:()=>p("shadow"),children:x.jsx(oe,{options:Object.keys(Re),value:i.shadow,onChange:m=>o({shadow:m}),renderPreview:m=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--bg-primary, #fff)",borderRadius:"4px",boxShadow:Re[m]}})})}),x.jsx(q,{title:"Button Style",expanded:h("button"),onToggle:()=>p("button"),children:x.jsx(oe,{options:["flat","raised","outlined","ghost","soft","gradient","3d","neumorphic"],value:i.buttonStyle,onChange:m=>o({buttonStyle:m})})}),x.jsx(q,{title:"Input Style",expanded:h("input"),onToggle:()=>p("input"),children:x.jsx(oe,{options:["bordered","filled","underlined","floating","soft","neumorphic"],value:i.inputStyle,onChange:m=>o({inputStyle:m})})}),x.jsx(q,{title:"Card Style",expanded:h("card"),onToggle:()=>p("card"),children:x.jsx(oe,{options:["flat","elevated","bordered","glass","gradient","neumorphic"],value:i.cardStyle,onChange:m=>o({cardStyle:m})})}),x.jsx(q,{title:"Animation",expanded:h("animation"),onToggle:()=>p("animation"),children:x.jsx(oe,{options:Object.keys(Fe),value:i.animation,onChange:m=>o({animation:m})})}),x.jsx(q,{title:"Density",expanded:h("density"),onToggle:()=>p("density"),children:x.jsx(oe,{options:Object.keys(ve),value:i.density,onChange:m=>o({density:m})})}),t&&x.jsx(q,{title:"Preview",expanded:h("preview"),onToggle:()=>p("preview"),children:x.jsx(Vd,{config:i})}),r&&x.jsx(q,{title:"Generated CSS",expanded:h("css"),onToggle:()=>p("css"),children:x.jsx("pre",{style:{background:"var(--text-primary, #1f2937)",color:"var(--border-color, #e5e7eb)",padding:"12px",borderRadius:"6px",fontSize:"12px",overflow:"auto",maxHeight:"200px"},children:mt(i)})})]})}function q({title:e,expanded:t,onToggle:r,children:a}){return x.jsxs("div",{style:{marginBottom:"16px"},children:[x.jsxs("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"8px 0",border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:"var(--text-secondary, #374151)",textAlign:"left"},children:[x.jsx("span",{style:{transform:t?"rotate(90deg)":"none",transition:"transform 150ms"},children:"▶"}),e]}),t&&x.jsx("div",{style:{paddingLeft:"20px",paddingTop:"8px"},children:a})]})}function oe({options:e,value:t,onChange:r,renderPreview:a}){return x.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:e.map(n=>x.jsxs("button",{onClick:()=>r(n),style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 12px",border:t===n?"2px solid var(--nice-info, #6366f1)":"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:t===n?"var(--nice-primary-bg, #eef2ff)":"var(--bg-primary, #fff)",cursor:"pointer",textTransform:"capitalize",fontSize:"13px"},children:[a&&a(n),n]},n))})}function Vd({config:e}){const t=dt(e.buttonStyle,"var(--color-accent, #6366f1)"),r=ut(e.inputStyle),a=ft(e.cardStyle),n=he[e.radius],s=ve[e.density];return x.jsxs("div",{style:{padding:"20px",background:"var(--bg-secondary, #f9fafb)",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"16px"},children:[x.jsxs("div",{style:{padding:s.paddingX,borderRadius:n.lg,...a},children:[x.jsx("h4",{style:{margin:"0 0 12px",fontSize:s.fontSize},children:"Card Preview"}),x.jsxs("div",{style:{display:"flex",gap:s.gap,marginBottom:"12px"},children:[x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:n.md,color:"var(--bg-primary, #fff)",fontSize:s.fontSize,cursor:"pointer",...t},children:"Primary"}),x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:n.md,background:"var(--border-color, #e5e7eb)",border:"none",fontSize:s.fontSize,cursor:"pointer"},children:"Secondary"})]}),x.jsx("input",{type:"text",placeholder:"Input preview...",style:{width:"100%",height:s.inputHeight,padding:`0 ${s.paddingX}`,fontSize:s.fontSize,outline:"none",boxSizing:"border-box",...r}})]}),x.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:["Info","Success","Warning","Error"].map(i=>x.jsx("span",{style:{padding:"4px 10px",borderRadius:n.full,background:"var(--border-color, #e5e7eb)",fontSize:"12px"},children:i},i))})]})}function Xd(e){const[t,r]=c.useState(()=>typeof window>"u"?!1:Yt());return c.useEffect(()=>{var d,u,f;if(typeof window>"u")return;const a=()=>(e==null?void 0:e.current)??document.documentElement,n=()=>r(Yt(a()));n();const s=new MutationObserver(n),i={attributes:!0,attributeFilter:["data-theme","class","style"]};s.observe(document.documentElement,i);const o=(u=(d=e==null?void 0:e.current)==null?void 0:d.closest)==null?void 0:u.call(d,"[data-theme], .nice-dark, .nice-light, .dark");o&&o!==document.documentElement&&s.observe(o,i);const l=window.matchMedia("(prefers-color-scheme: dark)");return(f=l.addEventListener)==null||f.call(l,"change",n),()=>{var p;s.disconnect(),(p=l.removeEventListener)==null||p.call(l,"change",n)}},[e]),t}function Yt(e=document.documentElement){var t,r;try{const a=((t=e.closest)==null?void 0:t.call(e,"[data-theme], .nice-dark, .nice-light, .dark"))??document.documentElement,n=a.getAttribute("data-theme");if(n==="dark")return!0;if(n==="light")return!1;if(a.classList.contains("nice-dark")||a.classList.contains("dark"))return!0;if(a.classList.contains("nice-light"))return!1;const s=getComputedStyle(e),i=s.getPropertyValue("--text-primary").trim()||s.color;if(i){const o=i.match(/rgba?\(([^)]+)\)/);if(o){const[l,d,u]=o[1].split(",").map(f=>parseFloat(f.trim()));return(.299*l+.587*d+.114*u)/255>.5}if(/^#([0-9a-f]{3,8})$/i.test(i)){const l=i.replace("#",""),d=l.length===3?l.split("").map(h=>h+h).join(""):l.slice(0,6),u=parseInt(d.slice(0,2),16),f=parseInt(d.slice(2,4),16),p=parseInt(d.slice(4,6),16);return(.299*u+.587*f+.114*p)/255>.5}}return((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)??!1}catch{return!1}}const Ud=["NiceTextInput","NiceTextArea","NiceNumberInput","NiceDateTimePicker","NiceSelect","NiceCheckbox","NiceToggle","NiceRadioGroup","NiceSlider","NiceColorPicker","NiceAutocomplete","NiceLookup","NiceCalendar","NiceDateRangeBox","NiceTagBox","NiceRangeSlider","NiceDropDownBox","NiceHtmlEditor","NiceForm","NiceRating","NiceOtpInput","NiceMentionInput","NiceTreeSelect","NiceMaskedInput","NiceKnob","NicePickList","NiceInlineEdit","NiceButton","NiceButtonGroup","NiceDropDownButton","NiceSpeedDialAction","NiceTable","NiceDataGrid","NiceList","NiceTreeView","NiceTreeList","NiceTileView","NicePivotGrid","NiceKanbanBoard","NiceSpreadsheet","NiceBadge","NiceTag","NiceAvatar","NiceAvatarGroup","NiceProgress","NiceDivider","NiceTooltip","NiceSkeleton","NiceSpinner","NiceEmpty","NiceTimeline","NiceCarousel","NiceVirtualScroller","NiceAlert","NiceModal","NiceDrawer","NiceToastContainer","NiceConfirmDialog","NiceCookieConsent","NiceTabs","NiceAccordion","NiceBreadcrumb","NicePagination","NiceCard","NiceMenu","NiceContextMenu","NiceSplitter","NiceAppLayout","NiceDashboardLayout","NiceDesktop","NiceConsole","NiceChart","NicePieChart","NicePolarChart","NiceCircularGauge","NiceLinearGauge","NiceBarGauge","NiceSparkline","NiceBullet","NiceFunnel","NiceSankey","NiceRangeSelector","NiceVectorMap","NiceHeatMap","NiceTreeMap","NiceStockChart","NiceOrganizationChart","NiceActionSheet","NicePopover","NiceLoadPanel","NiceWindow","NiceBlockUI","NiceScheduler","NiceGantt","NiceDiagram","NiceStepper","NiceBox","NiceResponsiveBox","NiceResizable","NiceScrollView","NiceChat","NiceUpload","NiceFileManager","NiceFilterBuilder","NiceGallery","NiceMap","div","span","row","column","stack","container"];function qd(e){const t=[];ho(e.root,t,"root");const r=new Set((e.dataSources??[]).map(a=>a.id));return bo(e.root,r,t),t}function ho(e,t,r){if((!e.type||e.type.trim()==="")&&t.push(`${r}: type is empty`),e.children)for(let a=0;a<e.children.length;a++)ho(e.children[a],t,`${r}.children[${a}]`)}function bo(e,t,r){if(e.bindings)for(const[a,n]of Object.entries(e.bindings)){const s=n.split(".")[0];!t.has(s)&&s!=="form"&&s!=="route"&&r.push(`Binding "${a}" references unknown data source "${s}"`)}if(e.children)for(const a of e.children)bo(a,t,r)}function Gd(e,t){const r=Kd(t,e.field);switch(e.operator){case"eq":return r===e.value;case"neq":return r!==e.value;case"gt":return r>e.value;case"gte":return r>=e.value;case"lt":return r<e.value;case"lte":return r<=e.value;case"contains":return String(r).includes(String(e.value));case"empty":return r==null||String(r)==="";case"notEmpty":return r!=null&&String(r)!=="";default:return!0}}function Kd(e,t){const r=t.split(".");let a=e;for(const n of r)if(a&&typeof a=="object"&&n in a)a=a[n];else return;return a}function vo(e){const{itemCount:t,itemHeight:r,containerHeight:a,overscan:n=3,initialScrollTop:s=0}=e,[i,o]=c.useState(s),[l,d]=c.useState(!1),u=c.useRef(),f=c.useMemo(()=>{if(typeof r=="number")return null;const k=new Array(t+1);k[0]=0;for(let C=0;C<t;C++)k[C+1]=k[C]+r(C);return k},[t,r]),p=c.useMemo(()=>typeof r=="number"?t*r:f?f[t]:0,[t,r,f]),h=c.useCallback(k=>typeof r=="number"?r:r(k),[r]),m=c.useCallback(k=>typeof r=="number"?k*r:f?f[k]:0,[r,f]),y=c.useCallback(k=>{if(typeof r=="number")return Math.floor(k/r);if(!f)return 0;let C=0,M=t-1;for(;C<=M;){const N=Math.floor((C+M)/2),L=f[N];if(L===k)return N;L<k?C=N+1:M=N-1}return Math.max(0,C-1)},[t,r,f]),{startIndex:g,endIndex:v,visibleItems:b}=c.useMemo(()=>{const k=Math.max(0,y(i)-n);let C=k,M=m(k);for(;C<t&&M<i+a;)M+=h(C),C++;C=Math.min(t,C+n);const N=[];for(let L=k;L<C;L++)N.push({index:L,offset:m(L),height:h(L),key:L});return{startIndex:k,endIndex:C,visibleItems:N}},[i,a,t,n,y,m,h]),S=c.useCallback(k=>{const C=k.currentTarget;o(C.scrollTop),d(!0),u.current&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{d(!1)},150)},[]),w=c.useCallback((k,C="start")=>{const M=m(k),N=h(k);let L;switch(C){case"center":L=M-a/2+N/2;break;case"end":L=M-a+N;break;default:L=M}o(Math.max(0,Math.min(L,p-a)))},[m,h,a,p]),A=c.useCallback(k=>{o(Math.max(0,Math.min(k,p-a)))},[p,a]);return c.useEffect(()=>()=>{u.current&&window.clearTimeout(u.current)},[]),{visibleItems:b,totalHeight:p,scrollTop:i,scrollToIndex:w,scrollTo:A,onScroll:S,startIndex:g,endIndex:v,isScrolling:l}}function Jd(e){const{rowCount:t,columnCount:r,rowHeight:a,columnWidth:n,containerHeight:s,containerWidth:i,overscan:o=2}=e,[l,d]=c.useState(0),[u,f]=c.useState(0),[p,h]=c.useState(!1),m=c.useRef(),y=c.useMemo(()=>{if(typeof a=="number")return t*a;let S=0;for(let w=0;w<t;w++)S+=a(w);return S},[t,a]),g=c.useMemo(()=>{if(typeof n=="number")return r*n;let S=0;for(let w=0;w<r;w++)S+=n(w);return S},[r,n]),v=c.useMemo(()=>{const S=[];let w=0,A=0;if(typeof a=="number")w=Math.floor(l/a),A=w*a;else for(;w<t&&A+a(w)<l;)A+=a(w),w++;w=Math.max(0,w-o);let k=w,C=typeof a=="number"?w*a:A;for(;k<t&&C<l+s;)C+=typeof a=="number"?a:a(k),k++;k=Math.min(t,k+o);let M=0,N=0;if(typeof n=="number")M=Math.floor(u/n),N=M*n;else for(;M<r&&N+n(M)<u;)N+=n(M),M++;M=Math.max(0,M-o);let L=M,E=typeof n=="number"?M*n:N;for(;L<r&&E<u+i;)E+=typeof n=="number"?n:n(L),L++;L=Math.min(r,L+o);let R=typeof a=="number"?w*a:(()=>{let T=0;for(let D=0;D<w;D++)T+=a(D);return T})();for(let T=w;T<k;T++){const D=typeof a=="number"?a:a(T);let F=typeof n=="number"?M*n:(()=>{let z=0;for(let H=0;H<M;H++)z+=n(H);return z})();for(let z=M;z<L;z++){const H=typeof n=="number"?n:n(z);S.push({rowIndex:T,columnIndex:z,top:R,left:F,width:H,height:D,key:`${T}:${z}`}),F+=H}R+=D}return S},[l,u,t,r,a,n,s,i,o]),b=c.useCallback(S=>{const w=S.currentTarget;d(w.scrollTop),f(w.scrollLeft),h(!0),m.current&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>{h(!1)},150)},[]);return c.useEffect(()=>()=>{m.current&&window.clearTimeout(m.current)},[]),{visibleCells:v,totalWidth:g,totalHeight:y,onScroll:b,scrollTop:l,scrollLeft:u,isScrolling:p}}function Yd(e,t,r,a=3){const n=vo({itemCount:e.length,itemHeight:r,containerHeight:t,overscan:a}),s=c.useCallback(i=>e[i.index],[e]);return{...n,getItemData:s,containerStyle:{height:t,overflow:"auto"},innerStyle:{height:n.totalHeight,position:"relative"},getItemStyle:i=>({position:"absolute",top:i.offset,left:0,right:0,height:i.height})}}function Qd(e){const{items:t,searchFn:r,debounce:a=0,minLength:n=0}=e,[s,i]=c.useState(""),o=c.useDeferredValue(s),[l,d]=c.useState(""),u=c.useRef();c.useEffect(()=>{if(a>0)return u.current=window.setTimeout(()=>{d(s)},a),()=>{u.current&&window.clearTimeout(u.current)};d(s)},[s,a]);const f=c.useDeferredValue(l),p=c.useMemo(()=>f.length<n?t:t.filter(m=>r(m,f)),[t,f,r,n]);return{query:s,setQuery:i,results:p,isStale:f!==o,deferredQuery:f}}function Zd(e){const[t,r]=c.useState(e),[a,n]=c.useState(e),[s,i]=c.useTransition(),o=c.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),i(()=>{r(u)})},[t]),l=c.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),r(u)},[t]);return{value:t,pendingValue:a,isPending:s,setValue:o,setValueImmediate:l}}function eu(e){const{data:t,processFn:r,chunkSize:a=1e3,priority:n="user-visible"}=e,[s,i]=c.useState(null),[o,l]=c.useState(0),[d,u]=c.useState(!1),f=c.useRef(!1),p=c.useCallback(async()=>{if(t.length===0){i([]);return}u(!0),l(0),f.current=!1;const m=[],y=t.length;for(let g=0;g<y&&!f.current;g+=a){const v=t.slice(g,g+a),b=v.map((w,A)=>r(w,g+A));m.push(...b);const S=Math.min(100,(g+v.length)/y*100);n==="background"?await new Promise(w=>{"requestIdleCallback"in window?window.requestIdleCallback(w):setTimeout(w,0)}):n==="user-visible"&&await new Promise(w=>requestAnimationFrame(w)),c.startTransition(()=>{l(S)})}i(m),u(!1),l(100)},[t,r,a,n]),h=c.useCallback(()=>{f.current=!0},[]);return c.useEffect(()=>(p(),()=>{f.current=!0}),[p]),{result:s,progress:o,isProcessing:d,process:p,cancel:h}}function tu(e,t={}){const{initialCount:r=20,batchSize:a=50,batchDelay:n=16}=t,[s,i]=c.useState(Math.min(r,e.length)),[o,l]=c.useState(e.length<=r);return c.useEffect(()=>{if(s>=e.length){l(!0);return}const u=setTimeout(()=>{c.startTransition(()=>{i(f=>Math.min(f+a,e.length))})},n);return()=>clearTimeout(u)},[s,e.length,a,n]),c.useEffect(()=>{i(Math.min(r,e.length)),l(e.length<=r)},[e,r]),{visibleItems:c.useMemo(()=>e.slice(0,s),[e,s]),visibleCount:s,totalCount:e.length,isComplete:o,progress:s/e.length*100}}function ru(e){const{initial:t,mutate:r,rollbackOnError:a=!0}=e,[n,s]=c.useState(t),[i,o]=c.useState(!1),[l,d]=c.useState(null),u=c.useRef(t),f=c.useCallback(async h=>{u.current=n,d(null),s(h),o(!0);try{const m=await r(h);s(m)}catch(m){d(m instanceof Error?m:new Error(String(m))),a&&s(u.current)}finally{o(!1)}},[n,r,a]),p=c.useCallback(()=>{s(t),d(null),o(!1)},[t]);return{value:n,update:f,isPending:i,error:l,reset:p}}function au(e){const{workerScript:t,idleTimeout:r=3e4}=e,[a,n]=c.useState(null),[s,i]=c.useState(!1),[o,l]=c.useState(null),d=c.useRef(null),u=c.useRef(0),f=c.useRef(null),p=c.useRef(),h=c.useCallback(()=>{if(!d.current){if(typeof t=="function"){const b=new Blob([`(${t.toString()})()`],{type:"application/javascript"});d.current=new Worker(URL.createObjectURL(b))}else d.current=new Worker(t,{type:"module"});d.current.onmessage=b=>{const S=b.data;S.id===f.current&&(S.type==="result"?(n(S.result??null),i(!1),f.current=null,m()):S.type==="error"&&(l(new Error(S.error)),i(!1),f.current=null,m()))},d.current.onerror=b=>{l(new Error(b.message)),i(!1),f.current=null}}return d.current},[t]),m=c.useCallback(()=>{p.current&&window.clearTimeout(p.current),r>0&&(p.current=window.setTimeout(()=>{d.current&&!f.current&&(d.current.terminate(),d.current=null)},r))},[r]),y=c.useCallback(b=>new Promise((S,w)=>{const A=h(),k=`task-${++u.current}`;f.current=k,i(!0),l(null);const C=A.onmessage;A.onmessage=M=>{C==null||C.call(A,M),M.data.id===k&&(M.data.type==="result"?S(M.data.result):M.data.type==="error"&&w(new Error(M.data.error)))},A.postMessage({type:"task",id:k,data:b})}),[h]),g=c.useCallback(()=>{d.current&&f.current&&(d.current.postMessage({type:"cancel",id:f.current}),f.current=null,i(!1))},[]),v=c.useCallback(()=>{d.current&&(d.current.terminate(),d.current=null),p.current&&window.clearTimeout(p.current),f.current=null,i(!1)},[]);return c.useEffect(()=>()=>{v()},[v]),{result:a,isProcessing:s,error:o,execute:y,cancel:g,terminate:v}}function nu(e){const{workerScript:t,poolSize:r=navigator.hardwareConcurrency||4,idleTimeout:a=6e4}=e,n=c.useRef([]),s=c.useRef([]),i=c.useRef(0),o=c.useRef(),l=c.useCallback(()=>{if(typeof t=="function"){const g=new Blob([`(${t.toString()})()`],{type:"application/javascript"});return new Worker(URL.createObjectURL(g))}return new Worker(t,{type:"module"})},[t]),d=c.useCallback(()=>{const g=n.current.find(v=>!v.busy);if(g)return g;if(n.current.length<r){const b={worker:l(),busy:!1,taskId:null};return n.current.push(b),b}return null},[l,r]),u=c.useCallback(()=>{for(;s.current.length>0;){const g=d();if(!g)break;const v=s.current.shift();g.busy=!0,g.taskId=v.id,g.worker.onmessage=b=>{const S=b.data;S.id===v.id&&(g.busy=!1,g.taskId=null,S.type==="result"?v.resolve(S.result):S.type==="error"&&v.reject(new Error(S.error)),u(),f())},g.worker.onerror=b=>{g.busy=!1,g.taskId=null,v.reject(new Error(b.message)),u()},g.worker.postMessage({type:"task",id:v.id,data:v.data})}},[d]),f=c.useCallback(()=>{o.current&&window.clearTimeout(o.current),a>0&&(o.current=window.setTimeout(()=>{n.current.filter(v=>!v.busy).forEach(v=>{v.worker.terminate(),n.current=n.current.filter(b=>b!==v)})},a))},[a]),p=c.useCallback(g=>new Promise((v,b)=>{const S=`pool-task-${++i.current}`;s.current.push({id:S,data:g,resolve:v,reject:b}),u()}),[u]),h=c.useCallback(g=>Promise.all(g.map(v=>p(v))),[p]),m=c.useCallback(()=>{n.current.forEach(g=>g.worker.terminate()),n.current=[],s.current=[],o.current&&window.clearTimeout(o.current)},[]),y=c.useCallback(()=>({total:n.current.length,busy:n.current.filter(g=>g.busy).length,idle:n.current.filter(g=>!g.busy).length,queued:s.current.length}),[]);return c.useEffect(()=>()=>{m()},[m]),{execute:p,executeAll:h,terminateAll:m,getStats:y}}function su(e){const t=`
|
|
122
|
+
HTML:`}],{temperature:.3}),l=o.content.match(/```html?\n?([\s\S]*?)```/);return l?l[1].trim():o.content.trim()}finally{r(!1)}},[e]);return{improveText:a,translate:n,generateHtml:s,isLoading:t}}class Xe{constructor(){this._listeners=new Map}on(t,r){return this._listeners.has(t)||this._listeners.set(t,new Set),this._listeners.get(t).add(r),()=>{var a;(a=this._listeners.get(t))==null||a.delete(r)}}emit(t,...r){var a;(a=this._listeners.get(t))==null||a.forEach(n=>{try{n(...r)}catch{}})}}function Pl(e,t){const r=e[t.field],a=t.value;switch(t.operator){case"=":return r==a;case"<>":return r!=a;case"<":return r<a;case"<=":return r<=a;case">":return r>a;case">=":return r>=a;case"contains":return String(r??"").toLowerCase().includes(String(a??"").toLowerCase());case"notcontains":return!String(r??"").toLowerCase().includes(String(a??"").toLowerCase());case"startswith":return String(r??"").toLowerCase().startsWith(String(a??"").toLowerCase());case"endswith":return String(r??"").toLowerCase().endsWith(String(a??"").toLowerCase());case"isblank":return r==null||r==="";case"isnotblank":return r!=null&&r!=="";default:return!0}}function fa(e,t){if(t.items.length===0)return!0;const r=a=>a.type==="condition"?Pl(e,a):fa(e,a);return t.logic==="and"?t.items.every(r):t.items.some(r)}function Fl(e,t){var n;let r=[...e];if(t.filter&&(r=r.filter(s=>fa(s,t.filter))),t.search){const s=t.search.toLowerCase(),i=t.searchFields;r=r.filter(o=>(i?i.map(d=>o[d]):Object.values(o)).some(d=>String(d??"").toLowerCase().includes(s)))}const a=r.length;if((n=t.sort)!=null&&n.length&&r.sort((s,i)=>{for(const o of t.sort){const l=s[o.field]??"",d=i[o.field]??"",u=typeof l=="number"&&typeof d=="number"?l-d:String(l).localeCompare(String(d));if(u!==0)return o.direction==="desc"?-u:u}return 0}),t.skip!=null||t.take!=null){const s=t.skip??0,i=t.take??r.length;r=r.slice(s,s+i)}return{data:r,totalCount:a}}function Hl(e){const t=e.keyField??"id";let r=[...e.data];const a=new Xe;return{keyField:t,writable:!0,async load(s={}){a.emit("loading",!0);try{const i=Fl(r,s);return a.emit("loaded",i),a.emit("loading",!1),i}catch(i){throw a.emit("error",i instanceof Error?i:new Error(String(i))),a.emit("loading",!1),i}},async byKey(s){return r.find(i=>i[t]===s)},async insert(s){const i={...s};return r=[...r,i],a.emit("changed"),i},async update(s,i){const o=r.findIndex(d=>d[t]===s);if(o===-1)throw new Error(`Record not found: ${s}`);const l={...r[o],...i};return r=r.map((d,u)=>u===o?l:d),a.emit("changed"),l},async remove(s){r=r.filter(i=>i[t]!==s),a.emit("changed")},on:a.on.bind(a)}}async function $l(e){const t={"Content-Type":"application/json"};if(!e.headers)return t;const r=typeof e.headers=="function"?await e.headers():e.headers;return{...t,...r}}function Ye(e,t,r){return typeof e=="function"?e(r):e||`${t}/${encodeURIComponent(String(r))}`}function jl(e){var r,a,n;const t={};return e.skip!=null&&(t.skip=String(e.skip)),e.take!=null&&(t.take=String(e.take)),e.search&&(t.search=e.search),(r=e.sort)!=null&&r.length&&(t.sort=e.sort.map(s=>`${s.field} ${s.direction}`).join(",")),e.filter&&(t.filter=JSON.stringify(e.filter)),(a=e.select)!=null&&a.length&&(t.select=e.select.join(",")),(n=e.expand)!=null&&n.length&&(t.expand=e.expand.join(",")),t}function Bl(e){if(Array.isArray(e))return{data:e,totalCount:e.length};const t=e,r=t.data??t.items??t.value??t.results??[],a=t.totalCount??t.total??t.count??t["@odata.count"]??r.length;return{data:r,totalCount:a}}function ma(e){const t=e.keyField??"id",r=new Xe;async function a(s,i){const o=await $l(e),l=await fetch(s,{...e.fetchOptions,...i,headers:{...o,...i==null?void 0:i.headers}});if(!l.ok){const u=await l.text().catch(()=>l.statusText);throw new Error(`HTTP ${l.status}: ${u}`)}return(l.headers.get("content-type")??"").includes("json")?l.json():l.text()}return{keyField:t,writable:!0,async load(s={}){var i;r.emit("loading",!0);try{const o=e.loadUrl??e.url,l=e.mapLoadParams?e.mapLoadParams(s):jl(s),d=new URLSearchParams(l).toString(),u=d?`${o}?${d}`:o,f=await a(u),p=e.extractLoadResult?e.extractLoadResult(f):Bl(f);return r.emit("loaded",p),r.emit("loading",!1),p}catch(o){const l=o instanceof Error?o:new Error(String(o));throw r.emit("error",l),r.emit("loading",!1),(i=e.onError)==null||i.call(e,l,"load"),l}},async byKey(s){const i=Ye(e.byKeyUrl,e.url,s),o=await a(i);return e.extractItem?e.extractItem(o):o},async insert(s){const i=e.insertUrl??e.url,o=e.prepareInsertBody?e.prepareInsertBody(s):s,l=await a(i,{method:"POST",body:JSON.stringify(o)}),d=e.extractItem?e.extractItem(l):l;return r.emit("changed"),d},async update(s,i){const o=Ye(e.updateUrl,e.url,s),l=e.prepareUpdateBody?e.prepareUpdateBody(s,i):i,d=await a(o,{method:e.updateMethod??"PUT",body:JSON.stringify(l)}),u=e.extractItem?e.extractItem(d):d;return r.emit("changed"),u},async remove(s){const i=Ye(e.deleteUrl,e.url,s);await a(i,{method:"DELETE"}),r.emit("changed")},on:r.on.bind(r)}}function Ol(e,t){const r=e.field,a=typeof e.value=="string"?`'${e.value.replace(/'/g,"''")}'`:String(e.value??"null");switch(e.operator){case"=":return`${r} eq ${a}`;case"<>":return`${r} ne ${a}`;case"<":return`${r} lt ${a}`;case"<=":return`${r} le ${a}`;case">":return`${r} gt ${a}`;case">=":return`${r} ge ${a}`;case"contains":return t>=4?`contains(${r},${a})`:`substringof(${a},${r})`;case"notcontains":return t>=4?`not contains(${r},${a})`:`not substringof(${a},${r})`;case"startswith":return`startswith(${r},${a})`;case"endswith":return`endswith(${r},${a})`;case"isblank":return`${r} eq null`;case"isnotblank":return`${r} ne null`;default:return"true"}}function pa(e,t){return e.items.length===0?"":e.items.map(a=>a.type==="condition"?Ol(a,t):`(${pa(a,t)})`).join(e.logic==="and"?" and ":" or ")}function _l(e){const t=e.version??4,r={url:e.url,keyField:e.keyField,headers:e.headers,fetchOptions:e.fetchOptions,onError:e.onError,updateMethod:"PATCH",mapLoadParams(a){var s,i,o;const n={};if(t>=4&&(n.$count="true"),a.skip!=null&&(n.$skip=String(a.skip)),a.take!=null&&(n.$top=String(a.take)),(s=a.sort)!=null&&s.length&&(n.$orderby=a.sort.map(l=>`${l.field} ${l.direction}`).join(",")),a.filter){const l=pa(a.filter,t);l&&(n.$filter=l)}return a.search&&(n.$search=`"${a.search}"`),(i=a.select)!=null&&i.length&&(n.$select=a.select.join(",")),(o=a.expand)!=null&&o.length&&(n.$expand=a.expand.join(",")),n},extractLoadResult(a){var o,l;const n=a,s=n.value??((o=n.d)==null?void 0:o.results)??[],i=n["@odata.count"]??((l=n.d)==null?void 0:l.__count)??s.length;return{data:s,totalCount:i}},byKeyUrl:a=>{const n=typeof a=="number"?a:`'${String(a).replace(/'/g,"''")}'`;return`${e.url}(${n})`}};return ma(r)}function Wl(e){const t=e.keyField??"id",r=new Xe;async function a(l,d){var m;const u={"Content-Type":"application/json"},f=e.headers?typeof e.headers=="function"?await e.headers():e.headers:{},p=await fetch(e.url,{method:"POST",headers:{...u,...f},body:JSON.stringify({query:l,variables:d})});if(!p.ok){const y=await p.text().catch(()=>p.statusText);throw new Error(`GraphQL HTTP ${p.status}: ${y}`)}const h=await p.json();if((m=h.errors)!=null&&m.length)throw new Error(h.errors.map(y=>y.message).join("; "));return h.data}function n(l){var u;const d={};return l.skip!=null&&(d.skip=l.skip),l.take!=null&&(d.take=l.take),l.search&&(d.search=l.search),(u=l.sort)!=null&&u.length&&(d.sort=l.sort),l.filter&&(d.filter=l.filter),d}function s(l){if(!l||typeof l!="object")return{data:[],totalCount:0};const d=Object.values(l)[0];if(!d)return{data:[],totalCount:0};if(Array.isArray(d))return{data:d,totalCount:d.length};const u=d.items??d.nodes??d.edges??d.data??[],f=d.totalCount??d.total??d.count??u.length;return{data:u,totalCount:f}}function i(l){return!l||typeof l!="object"?l:Object.values(l)[0]}return{keyField:t,writable:!!(e.queries.insert||e.queries.update||e.queries.remove),async load(l={}){var d;r.emit("loading",!0);try{const u=e.mapVariables?e.mapVariables(l):n(l),f=await a(e.queries.load,u),p=e.extractLoadResult?e.extractLoadResult(f):s(f);return r.emit("loaded",p),r.emit("loading",!1),p}catch(u){const f=u instanceof Error?u:new Error(String(u));throw r.emit("error",f),r.emit("loading",!1),(d=e.onError)==null||d.call(e,f,"load"),f}},async byKey(l){if(!e.queries.byKey)throw new Error("byKey query not configured");const d=await a(e.queries.byKey,{[t]:l});return e.extractItem?e.extractItem(d):i(d)},insert:e.queries.insert?async l=>{const d=await a(e.queries.insert,{input:l}),u=e.extractItem?e.extractItem(d):i(d);return r.emit("changed"),u}:void 0,update:e.queries.update?async(l,d)=>{const u=await a(e.queries.update,{[t]:l,input:d}),f=e.extractItem?e.extractItem(u):i(u);return r.emit("changed"),f}:void 0,remove:e.queries.remove?async l=>{await a(e.queries.remove,{[t]:l}),r.emit("changed")}:void 0,on:r.on.bind(r)}}function Vl(e){const t=e.keyField??"id",r=new Xe;return{keyField:t,writable:!!(e.insert||e.update||e.remove),async load(n={}){r.emit("loading",!0);try{const s=await e.load(n);return r.emit("loaded",s),r.emit("loading",!1),s}catch(s){const i=s instanceof Error?s:new Error(String(s));throw r.emit("error",i),r.emit("loading",!1),i}},async byKey(n){if(!e.byKey)throw new Error("byKey handler not configured");return e.byKey(n)},insert:e.insert?async n=>{const s=await e.insert(n);return r.emit("changed"),s}:void 0,update:e.update?async(n,s)=>{const i=await e.update(n,s);return r.emit("changed"),i}:void 0,remove:e.remove?async n=>{await e.remove(n),r.emit("changed")}:void 0,on:r.on.bind(r)}}function ga(e){return/^[A-Za-z_][A-Za-z0-9_.]*$/.test(e)?e:`"${e.replace(/"/g,'""')}"`}function Xl(e,t={}){const r=[],a=t.placeholder??(()=>"?"),n=t.quoteField??ga,s=l=>(r.push(l),a(r.length-1)),i=l=>{const d=n(l.field);switch(l.operator){case"=":case"<>":case"<":case"<=":case">":case">=":return`${d} ${l.operator} ${s(l.value)}`;case"contains":return`${d} LIKE ${s(`%${String(l.value)}%`)}`;case"notcontains":return`${d} NOT LIKE ${s(`%${String(l.value)}%`)}`;case"startswith":return`${d} LIKE ${s(`${String(l.value)}%`)}`;case"endswith":return`${d} LIKE ${s(`%${String(l.value)}`)}`;case"between":{const u=Array.isArray(l.value)?l.value:[l.value,l.value];return`${d} BETWEEN ${s(u[0])} AND ${s(u[1])}`}case"isblank":return`(${d} IS NULL OR ${d} = ${s("")})`;case"isnotblank":return`(${d} IS NOT NULL AND ${d} <> ${s("")})`;case"in":{const u=Array.isArray(l.value)?l.value:[l.value];return u.length?`${d} IN (${u.map(s).join(", ")})`:"1 = 0"}default:return`${d} = ${s(l.value)}`}},o=l=>{const d=[];for(const u of l.items)if(u.type==="group"){const f=o(u);f&&d.push(`(${f})`)}else d.push(i(u));return d.join(l.logic==="or"?" OR ":" AND ")};return{sql:o(e),params:r}}function Ul(e,t={}){const r=t.quoteField??ga;return e.filter(a=>a.field).map(a=>`${r(a.field)} ${a.direction==="desc"?"DESC":"ASC"}`).join(", ")}function ee(e){return String(e??"").toLowerCase()}function ya(e,t){const r=e[t.field],a=t.value;switch(t.operator){case"=":return r==a;case"<>":return r!=a;case"<":return r<a;case"<=":return r<=a;case">":return r>a;case">=":return r>=a;case"contains":return ee(r).includes(ee(a));case"notcontains":return!ee(r).includes(ee(a));case"startswith":return ee(r).startsWith(ee(a));case"endswith":return ee(r).endsWith(ee(a));case"between":{const n=Array.isArray(a)?a:[a,a];return r>=n[0]&&r<=n[1]}case"isblank":return r==null||r==="";case"isnotblank":return r!=null&&r!=="";case"in":return(Array.isArray(a)?a:[a]).some(s=>r==s);default:return!0}}function Nt(e,t){if(!t.items.length)return!0;const r=a=>a.type==="condition"?ya(e,a):Nt(e,a);return t.logic==="or"?t.items.some(r):t.items.every(r)}function Gt(e){return e==null||e===""}const ql=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Gl(e){const t=String(e);try{return new URL(t),!0}catch{return/^https?:\/\/[^\s]+$/.test(t)}}function W(e){return typeof e=="number"?e:parseFloat(String(e))}function ha(e){const t=e.field;switch(e.op){case"required":return`${t} is required`;case"minLength":return`${t} must be at least ${e.value} characters`;case"maxLength":return`${t} must be at most ${e.value} characters`;case"min":return`${t} must be ≥ ${e.value}`;case"max":return`${t} must be ≤ ${e.value}`;case"pattern":return`${t} has an invalid format`;case"email":return`${t} must be a valid email`;case"url":return`${t} must be a valid URL`;case"equals":return`${t} must equal ${e.value}`;case"notEquals":return`${t} must not equal ${e.value}`;case"greaterThan":return`${t} must be greater than ${e.value}`;case"lessThan":return`${t} must be less than ${e.value}`;case"matchesField":return`${t} must match ${e.compareField}`;case"greaterThanField":return`${t} must be greater than ${e.compareField}`;case"lessThanField":return`${t} must be less than ${e.compareField}`;default:return`${t} is invalid`}}function ba(e,t){const r=t[e.field];if(e.op==="required")return!Gt(r);if(Gt(r))return!0;const a=e.compareField!=null?t[e.compareField]:void 0;switch(e.op){case"minLength":return String(r).length>=W(e.value);case"maxLength":return String(r).length<=W(e.value);case"min":return W(r)>=W(e.value);case"max":return W(r)<=W(e.value);case"pattern":try{return new RegExp(String(e.value)).test(String(r))}catch{return!0}case"email":return ql.test(String(r));case"url":return Gl(r);case"equals":return r===e.value;case"notEquals":return r!==e.value;case"greaterThan":return W(r)>W(e.value);case"lessThan":return W(r)<W(e.value);case"matchesField":return r===a;case"greaterThanField":return W(r)>W(a);case"lessThanField":return W(r)<W(a);case"custom":return e.validate?e.validate(r,t):!0;default:return!0}}function va(e,t){const r=[];for(const a of e??[])a.when&&!Nt(t,a.when)||ba(a,t)||r.push({field:a.field,message:a.message??ha(a),severity:a.severity??"error",ruleId:a.id});return r}function Kl(e,t){return va(e,t).every(r=>r.severity!=="error")}class at{constructor(t={}){this.cache=new Map,this.ttl=t.ttl??6e4,this.maxSize=t.maxSize??100}get(t){const r=this.cache.get(t);if(r){if(Date.now()>r.expiresAt){this.cache.delete(t);return}return this.cache.delete(t),this.cache.set(t,r),r.data}}set(t,r,a){if(this.cache.size>=this.maxSize){const n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(t,{data:r,timestamp:Date.now(),expiresAt:Date.now()+(a??this.ttl)})}has(t){return this.get(t)!==void 0}invalidate(t){this.cache.delete(t)}invalidateAll(){this.cache.clear()}invalidateMatching(t){for(const r of this.cache.keys())t.test(r)&&this.cache.delete(r)}}class Sa{constructor(){this.pending=new Map}async dedupe(t,r){const a=this.pending.get(t);if(a)return a;const n=r().finally(()=>{this.pending.delete(t)});return this.pending.set(t,n),n}hasPending(t){return this.pending.has(t)}cancelAll(){this.pending.clear()}}function Jl(e,t={}){const r=new at(t),a=new at(t),n=new Sa,s=t.generateKey??(l=>JSON.stringify(l)),i=t.cacheLoads!==!1,o=t.cacheByKey!==!1;return{...e,cache:r,async load(l={}){const d=`load:${s(l)}`;if(i){const u=r.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.load(l);return i&&r.set(d,u),u})},async byKey(l){const d=`byKey:${String(l)}`;if(o){const u=a.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.byKey(l);return o&&u&&a.set(d,u),u})},async insert(l){const d=await e.insert(l);return r.invalidateAll(),d},async update(l,d){const u=await e.update(l,d);return r.invalidateAll(),a.invalidate(`byKey:${String(l)}`),u},async remove(l){await e.remove(l),r.invalidateAll(),a.invalidate(`byKey:${String(l)}`)},invalidateCache(){r.invalidateAll(),a.invalidateAll()}}}function Yl(e,t){const{cursorField:r,pageSize:a=20,direction:n="asc"}=t;return{async loadPage(s={}){var g;const i=s.pageSize??a,o=s.direction??"forward",l=s.cursor?{type:"condition",field:r,operator:o==="forward"?n==="asc"?">":"<":n==="asc"?"<":">",value:Ql(s.cursor)}:null,d=l?{type:"group",logic:"and",items:[...((g=s.filter)==null?void 0:g.items)??[],l]}:s.filter,u=[{field:r,direction:o==="forward"?n:n==="asc"?"desc":"asc"},...s.sort??[]],f=await e.load({...s,filter:d,sort:u,take:i+1}),p=f.data.length>i,h=p?f.data.slice(0,i):f.data;o==="backward"&&h.reverse();const m=h[h.length-1],y=h[0];return{data:h,nextCursor:p&&m?Qe(m[r]):null,prevCursor:y&&s.cursor?Qe(y[r]):null,hasMore:p}},async*loadAll(s={}){let i=null;do{const o=await e.load({...s,...i?{cursor:i}:{}});if(o.data.length===0)break;yield o.data;const l=o.data[o.data.length-1];i=l?Qe(l[r]):null}while(i)}}}function Qe(e){return btoa(JSON.stringify(e))}function Ql(e){try{return JSON.parse(atob(e))}catch{return e}}function Zl(e,t={}){const{pageSize:r=50,threshold:a=200,initialPage:n=0}=t;let s={items:[],isLoading:!1,hasMore:!0,error:null,page:n,totalCount:0};const i=new Set;function o(){i.forEach(h=>h(s))}function l(h){s={...s,...h},o()}let d={};async function u(){if(!(s.isLoading||!s.hasMore)){l({isLoading:!0,error:null});try{const h=await e.load({...d,skip:s.page*r,take:r}),m=[...s.items,...h.data],y=m.length<h.totalCount;l({items:m,page:s.page+1,totalCount:h.totalCount,hasMore:y,isLoading:!1})}catch(h){l({error:h instanceof Error?h:new Error(String(h)),isLoading:!1})}}}function f(h={}){d=h,s={items:[],isLoading:!1,hasMore:!0,error:null,page:0,totalCount:0},o()}function p(h){const m=h.target;if(!m)return;m.scrollHeight-m.scrollTop-m.clientHeight<a&&u()}return{get state(){return s},loadMore:u,reset:f,handleScroll:p,subscribe(h){return i.add(h),()=>i.delete(h)},setOptions(h){d=h}}}function ed(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:s=10,heartbeatInterval:i=3e4}=e;let o=null,l=0,d=null,u=[];const f=new Map;function p(k,...C){var M;(M=f.get(k))==null||M.forEach(N=>N(...C))}function h(k){if(e.parseMessage)return e.parseMessage(k);try{return JSON.parse(k.data)}catch{return null}}function m(k){return e.serializeMessage?e.serializeMessage(k):JSON.stringify(k)}function y(k){switch(k.type){case"insert":k.data&&(u=[...u,k.data],p("changed"));break;case"update":k.key&&k.changes&&(u=u.map(C=>C[a]===k.key?{...C,...k.changes}:C),p("changed"));break;case"remove":k.key&&(u=u.filter(C=>C[a]!==k.key),p("changed"));break;case"refresh":case"sync":A.load().catch(()=>{});break}}function g(){(o==null?void 0:o.readyState)!==WebSocket.OPEN&&(o=new WebSocket(t),o.onopen=()=>{l=0,p("connected"),b()},o.onmessage=k=>{const C=h(k);C&&(y(C),p("message",C))},o.onerror=k=>{p("error",new Error("WebSocket error"))},o.onclose=()=>{S(),p("disconnected"),l<s&&(l++,setTimeout(g,n*Math.min(l,5)))})}function v(){S(),o&&(o.close(),o=null)}function b(){S(),d=window.setInterval(()=>{(o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(JSON.stringify({type:"ping"}))},i)}function S(){d&&(clearInterval(d),d=null)}function w(k){(o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(m(k))}const A={keyField:a,writable:r.writable,async load(k={}){p("loading",!0);try{const C=await r.load(k);return u=C.data,p("loaded",C),p("loading",!1),C}catch(C){throw p("error",C),p("loading",!1),C}},async byKey(k){const C=u.find(M=>M[a]===k);return C||r.byKey(k)},async insert(k){const C=await r.insert(k);return w({type:"insert",data:C}),C},async update(k,C){const M=await r.update(k,C);return w({type:"update",key:k,changes:C}),M},async remove(k){await r.remove(k),w({type:"remove",key:k})},on(k,C){return f.has(k)||f.set(k,new Set),f.get(k).add(C),()=>{var M;return(M=f.get(k))==null?void 0:M.delete(C)}},connect:g,disconnect:v,isConnected:()=>(o==null?void 0:o.readyState)===WebSocket.OPEN,sendMessage:w};return A}function td(e){const{connection:t,baseSource:r}=e,a={onInsert:"OnInsert",onUpdate:"OnUpdate",onRemove:"OnRemove",onRefresh:"OnRefresh",insert:"Insert",update:"Update",remove:"Remove",...e.methods},n=r.keyField;let s=[];const i=new Map;function o(f,...p){var h;(h=i.get(f))==null||h.forEach(m=>m(...p))}const l=f=>{s=[...s,f],o("changed")},d=(f,p)=>{s=s.map(h=>h[n]===f?{...h,...p}:h),o("changed")},u=f=>{s=s.filter(p=>p[n]!==f),o("changed")};return{keyField:n,writable:r.writable,async load(f={}){o("loading",!0);try{const p=await r.load(f);return s=p.data,o("loaded",p),o("loading",!1),p}catch(p){throw o("error",p),o("loading",!1),p}},async byKey(f){const p=s.find(h=>h[n]===f);return p||r.byKey(f)},async insert(f){return await t.invoke(a.insert,f)},async update(f,p){return await t.invoke(a.update,f,p)},async remove(f){await t.invoke(a.remove,f)},on(f,p){return i.has(f)||i.set(f,new Set),i.get(f).add(p),()=>{var h;return(h=i.get(f))==null?void 0:h.delete(p)}},async connect(){t.on(a.onInsert,l),t.on(a.onUpdate,d),t.on(a.onRemove,u),t.on(a.onRefresh,()=>this.load()),await t.start()},async disconnect(){t.off(a.onInsert,l),t.off(a.onUpdate,d),t.off(a.onRemove,u),t.off(a.onRefresh,()=>{}),await t.stop()}}}function rd(e,t={}){const r=e.keyField;let a=[];const n=new Map;let s=0;const i=new Map;function o(d,...u){var f;(f=i.get(d))==null||f.forEach(p=>p(...u))}function l(){return`op_${++s}_${Date.now()}`}return{keyField:r,writable:!0,async load(d={}){const u=await e.load(d);return a=u.data,u},async byKey(d){return a.find(u=>u[r]===d)??e.byKey(d)},async insert(d){var p,h,m;const u=l(),f={...d};a=[...a,f],n.set(u,{id:u,action:"insert",item:f}),(p=t.onOptimisticApply)==null||p.call(t,f,"insert"),o("changed");try{const y=await e.insert(d);return a=a.map(g=>g===f?y:g),n.delete(u),(h=t.onConfirm)==null||h.call(t,y,"insert"),o("changed"),y}catch(y){throw a=a.filter(g=>g!==f),n.delete(u),(m=t.onRollback)==null||m.call(t,f,"insert",y instanceof Error?y:new Error(String(y))),o("changed"),y}},async update(d,u){var y,g,v;const f=l(),p=a.findIndex(b=>b[r]===d);if(p===-1)return e.update(d,u);const h=a[p],m={...h,...u};a=a.map((b,S)=>S===p?m:b),n.set(f,{id:f,action:"update",key:d,originalItem:h}),(y=t.onOptimisticApply)==null||y.call(t,m,"update"),o("changed");try{const b=await e.update(d,u);return a=a.map((S,w)=>w===p?b:S),n.delete(f),(g=t.onConfirm)==null||g.call(t,b,"update"),o("changed"),b}catch(b){throw a=a.map((S,w)=>w===p?h:S),n.delete(f),(v=t.onRollback)==null||v.call(t,h,"update",b instanceof Error?b:new Error(String(b))),o("changed"),b}},async remove(d){var p,h,m;const u=l(),f=a.find(y=>y[r]===d);if(!f)return e.remove(d);a=a.filter(y=>y!==f),n.set(u,{id:u,action:"remove",key:d,originalItem:f}),(p=t.onOptimisticApply)==null||p.call(t,f,"remove"),o("changed");try{await e.remove(d),n.delete(u),(h=t.onConfirm)==null||h.call(t,f,"remove")}catch(y){throw a=[...a,f],n.delete(u),(m=t.onRollback)==null||m.call(t,f,"remove",y instanceof Error?y:new Error(String(y))),o("changed"),y}},on(d,u){return i.has(d)||i.set(d,new Set),i.get(d).add(u),()=>{var f;return(f=i.get(d))==null?void 0:f.delete(u)}},hasPendingChanges:()=>n.size>0,getPendingCount:()=>n.size}}function xa(e,t,r){const a=new Map(e.map(d=>[d[r],d])),n=new Map(t.map(d=>[d[r],d])),s=[],i=[],o=[],l=[];for(const[d,u]of n){const f=a.get(d);if(!f)s.push(u);else if(wa(f,u))l.push(u);else{const p={};for(const h of Object.keys(u))f[h]!==u[h]&&(p[h]=u[h]);i.push({key:d,changes:p,oldItem:f,newItem:u})}}for(const[d,u]of a)n.has(d)||o.push(u);return{inserted:s,updated:i,removed:o,unchanged:l}}function wa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e===null||t===null||typeof e!="object")return e===t;const r=e,a=t,n=new Set([...Object.keys(r),...Object.keys(a)]);for(const s of n)if(!wa(r[s],a[s]))return!1;return!0}function ad(e,t={}){const{interval:r=5e3,autoStart:a=!1,pauseWhenHidden:n=!0,onDataChange:s}=t;let i=r,o=null,l=[],d={};const u=new Map;function f(g,...v){var b;(b=u.get(g))==null||b.forEach(S=>S(...v))}async function p(){if(!(n&&document.hidden))try{const g=await e.load(d),v=xa(l,g.data,e.keyField);(v.inserted.length||v.updated.length||v.removed.length)&&(l=g.data,f("changed"),s==null||s(v))}catch{}}function h(){o||(o=window.setInterval(p,i))}function m(){o&&(clearInterval(o),o=null)}n&&document.addEventListener("visibilitychange",()=>{document.hidden||o&&p()});const y={...e,async load(g={}){d=g;const v=await e.load(g);return l=v.data,v},on(g,v){u.has(g)||u.set(g,new Set),u.get(g).add(v);const b=e.on(g,v);return()=>{var S;(S=u.get(g))==null||S.delete(v),b()}},startPolling:h,stopPolling:m,isPolling:()=>o!==null,setInterval(g){i=g,o&&(m(),h())}};return a&&h(),y}function nd(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:s=10,withCredentials:i=!1}=e;let o=null,l=0,d=null,u=[];const f=new Map;function p(b,...S){var w;(w=f.get(b))==null||w.forEach(A=>A(...S))}function h(b){if(e.parseEvent)return e.parseEvent(b);try{return JSON.parse(b.data)}catch{return null}}function m(b){switch(b.type){case"insert":b.data&&(u=[...u,b.data],p("changed"));break;case"update":b.key&&b.changes&&(u=u.map(S=>S[a]===b.key?{...S,...b.changes}:S),p("changed"));break;case"remove":b.key&&(u=u.filter(S=>S[a]!==b.key),p("changed"));break;case"snapshot":Array.isArray(b.data)&&(u=b.data,p("changed"));break;case"refresh":v.load().catch(()=>{});break}}function y(){(o==null?void 0:o.readyState)!==EventSource.OPEN&&(g(),o=new EventSource(t,{withCredentials:i}),o.onopen=()=>{l=0,p("connected")},o.onmessage=b=>{const S=h(b);S&&(m(S),p("message",S))},o.onerror=()=>{if(p("error",new Error("SSE connection error")),(o==null?void 0:o.readyState)===EventSource.CLOSED&&(p("disconnected"),o=null,l<s)){l++;const b=n*Math.min(l,5);d=setTimeout(y,b)}})}function g(){d&&(clearTimeout(d),d=null),o&&(o.close(),o=null)}const v={keyField:a,writable:r.writable,async load(b={}){p("loading",!0);try{const S=await r.load(b);return u=S.data,p("loaded",S),p("loading",!1),S}catch(S){throw p("error",S),p("loading",!1),S}},async byKey(b){const S=u.find(w=>w[a]===b);return S||r.byKey(b)},async insert(b){return r.insert(b)},async update(b,S){return r.update(b,S)},async remove(b){return r.remove(b)},on(b,S){return f.has(b)||f.set(b,new Set),f.get(b).add(S),()=>{var w;return(w=f.get(b))==null?void 0:w.delete(S)}},connect:y,disconnect:g,isConnected:()=>(o==null?void 0:o.readyState)===EventSource.OPEN};return v}function re(e,t){const r={};for(const a of t){const n=e.map(i=>i[a.field]).filter(i=>i!=null),s=a.alias??`${a.fn}_${a.field}`;switch(a.fn){case"sum":r[s]=n.reduce((i,o)=>Number(i)+Number(o),0);break;case"avg":r[s]=n.length?n.reduce((i,o)=>Number(i)+Number(o),0)/n.length:0;break;case"min":r[s]=n.length?Math.min(...n.map(Number)):null;break;case"max":r[s]=n.length?Math.max(...n.map(Number)):null;break;case"count":r[s]=n.length;break;case"first":r[s]=n[0]??null;break;case"last":r[s]=n[n.length-1]??null;break;case"distinct":r[s]=[...new Set(n)];break}}return r}function Lt(e,t){const{groupBy:r,aggregates:a=[],includeItems:n=!1,sortGroups:s}=t;if(r.length===0)return[{key:{},count:e.length,aggregates:re(e,a),items:n?e:void 0}];const i=new Map;for(const l of e){const d={};for(const f of r)d[f]=l[f];const u=JSON.stringify(d);i.has(u)||i.set(u,{key:d,items:[]}),i.get(u).items.push(l)}const o=[];for(const[,l]of i)o.push({key:l.key,count:l.items.length,aggregates:re(l.items,a),items:n?l.items:void 0});return s!=null&&s.length&&o.sort((l,d)=>{for(const u of s){const f=l.key[u.field]??l.aggregates[u.field],p=d.key[u.field]??d.aggregates[u.field],h=typeof f=="number"&&typeof p=="number"?f-p:String(f??"").localeCompare(String(p??""));if(h!==0)return u.direction==="desc"?-h:h}return 0}),o}function ka(e,t,r=[]){if(t.length===0)return[{key:{},count:e.length,aggregates:re(e,r),items:e}];const[a,...n]=t,s=Lt(e,{groupBy:[a],aggregates:r,includeItems:!0});if(n.length>0)for(const i of s)i.groups=ka(i.items,n,r),delete i.items;return s}function sd(e,t){const{rows:r,columns:a,values:n,aggregateFunction:s="sum",rowTotals:i=!0,columnTotals:o=!0,grandTotal:l=!0}=t,d=[...new Set(e.map(m=>String(m[a])))].sort(),u=Lt(e,{groupBy:r,includeItems:!0}),f=[];for(const m of u){const y={rowKey:m.key,values:{}};for(const g of d){const v=m.items.filter(S=>String(S[a])===g),b=re(v,[{field:n,fn:s}]);y.values[g]=b[`${s}_${n}`]??null}if(i){const g=re(m.items,[{field:n,fn:s}]);y.rowTotal=g[`${s}_${n}`]}f.push(y)}let p;if(o){p={};for(const m of d){const y=e.filter(v=>String(v[a])===m),g=re(y,[{field:n,fn:s}]);p[m]=g[`${s}_${n}`]}}let h;return l&&(h=re(e,[{field:n,fn:s}])[`${s}_${n}`]),{columnHeaders:d,rows:f,columnTotals:p,grandTotal:h}}function od(e,t){return e.map((r,a)=>{const n={...r};for(const s of t)n[s.name]=s.formula(r,a,e);return n})}const id={runningSum:e=>(t,r,a)=>a.slice(0,r+1).reduce((n,s)=>n+Number(s[e]??0),0),runningAvg:e=>(t,r,a)=>{const n=a.slice(0,r+1);return n.reduce((s,i)=>s+Number(i[e]??0),0)/n.length},percentOfTotal:e=>(t,r,a)=>{const n=a.reduce((s,i)=>s+Number(i[e]??0),0);return n?Number(t[e]??0)/n*100:0},rank:(e,t="desc")=>(r,a,n)=>[...n].sort((i,o)=>{const l=Number(i[e]??0)-Number(o[e]??0);return t==="desc"?-l:l}).findIndex(i=>i===r)+1,diffFromPrevious:e=>(t,r,a)=>r===0?null:Number(t[e]??0)-Number(a[r-1][e]??0),percentChange:e=>(t,r,a)=>{if(r===0)return null;const n=Number(a[r-1][e]??0);return n===0?null:(Number(t[e]??0)-n)/n*100},movingAverage:(e,t)=>(r,a,n)=>{const s=Math.max(0,a-t+1),i=n.slice(s,a+1);return i.reduce((o,l)=>o+Number(l[e]??0),0)/i.length},conditional:(e,t,r)=>a=>e(a)?t:r,concat:(...e)=>t=>e.map(r=>t[r]??"").join(" "),formatDate:(e,t="medium")=>r=>{const a=r[e];return a?new Date(a).toLocaleDateString(void 0,{dateStyle:t}):""}};function cd(e,t){const r=[],a=new Map,n=new Map;for(let o=0;o<e.length;o++){const l=e[o];for(const d of t)if(!d.validate(l,o,e)){const u=typeof d.message=="function"?d.message(l):d.message,f={index:o,rule:d.name,message:u,severity:d.severity??"error",fields:d.fields??[],item:l};r.push(f),a.has(o)||a.set(o,[]),a.get(o).push(f);for(const p of f.fields)n.has(p)||n.set(p,[]),n.get(p).push(f)}}const s=r.filter(o=>o.severity==="error").length,i=r.filter(o=>o.severity==="warning").length;return{isValid:s===0,errorCount:s,warningCount:i,errors:r,byIndex:a,byField:n}}const ld={required:e=>({name:`required_${String(e)}`,validate:t=>t[e]!=null&&t[e]!=="",message:`${String(e)} is required`,fields:[String(e)]}),minLength:(e,t)=>({name:`minLength_${String(e)}`,validate:r=>String(r[e]??"").length>=t,message:`${String(e)} must be at least ${t} characters`,fields:[String(e)]}),maxLength:(e,t)=>({name:`maxLength_${String(e)}`,validate:r=>String(r[e]??"").length<=t,message:`${String(e)} must be at most ${t} characters`,fields:[String(e)]}),min:(e,t)=>({name:`min_${String(e)}`,validate:r=>Number(r[e])>=t,message:`${String(e)} must be at least ${t}`,fields:[String(e)]}),max:(e,t)=>({name:`max_${String(e)}`,validate:r=>Number(r[e])<=t,message:`${String(e)} must be at most ${t}`,fields:[String(e)]}),email:e=>({name:`email_${String(e)}`,validate:t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t[e]??"")),message:`${String(e)} must be a valid email`,fields:[String(e)]}),pattern:(e,t,r)=>({name:`pattern_${String(e)}`,validate:a=>t.test(String(a[e]??"")),message:r??`${String(e)} has invalid format`,fields:[String(e)]}),unique:e=>({name:`unique_${String(e)}`,validate:(t,r,a)=>{const n=t[e];return a.findIndex(s=>s[e]===n)===r},message:`${String(e)} must be unique`,fields:[String(e)]}),custom:(e,t,r,a)=>({name:e,validate:t,message:r,fields:a})},dd={async updateWhere(e,t,r){return e.map(a=>{if(!t(a))return a;const n=typeof r=="function"?r(a):r;return{...a,...n}})},async removeWhere(e,t){const r=[],a=[];for(const n of e)t(n)?a.push(n):r.push(n);return{remaining:r,removed:a}},async transform(e,t,r={}){const{parallel:a=!1,batchSize:n=10}=r,s=[],i=[];let o=0;if(a)for(let l=0;l<e.length;l+=n){const d=e.slice(l,l+n),u=await Promise.allSettled(d.map((f,p)=>t(f,l+p)));for(let f=0;f<u.length;f++){const p=u[f];p.status==="fulfilled"?(s.push(p.value),o++):i.push({index:l+f,item:d[f],error:p.reason})}}else for(let l=0;l<e.length;l++)try{const d=await t(e[l],l);s.push(d),o++}catch(d){i.push({index:l,item:e[l],error:d instanceof Error?d:new Error(String(d))})}return{succeeded:o,failed:i.length,errors:i,results:s}},deduplicate(e,t){const r=new Set;return e.filter(a=>{const n=a[t];return r.has(n)?!1:(r.add(n),!0)})},merge(e,t,r,a={}){const{updateExisting:n=!0,addNew:s=!0}=a,i=new Map(e.map(l=>[l[r],l])),o=[...e];for(const l of t){const d=l[r],u=i.get(d);if(u){if(n){const f=o.indexOf(u);o[f]={...u,...l}}}else s&&o.push(l)}return o}};function ud(e,t){const r=(t==null?void 0:t.autoLoad)??!0,a=(t==null?void 0:t.defaultPageSize)??20,[n,s]=c.useState([]),[i,o]=c.useState(0),[l,d]=c.useState(!1),[u,f]=c.useState(null),[p,h]=c.useState(1),[m,y]=c.useState(a),[g,v]=c.useState((t==null?void 0:t.defaultSort)??[]),[b,S]=c.useState(t==null?void 0:t.defaultFilter),[w,A]=c.useState((t==null?void 0:t.defaultSearch)??""),k=c.useRef(0),C=t==null?void 0:t.loadOptions,M=c.useCallback(async()=>{if(!e)return;const z=++k.current;d(!0),f(null);try{const H=await e.load({skip:(p-1)*m,take:m,sort:g.length?g:void 0,filter:b,search:w||void 0,...C});if(z!==k.current)return;s(H.data),o(H.totalCount)}catch(H){if(z!==k.current)return;f(H instanceof Error?H.message:String(H))}finally{z===k.current&&d(!1)}},[e,p,m,g,b,w,C]);c.useEffect(()=>{r&&M()},[M,r]),c.useEffect(()=>{if(e)return e.on("changed",()=>{M()})},[e,M]);const N=c.useCallback((z,H)=>{v([{field:z,direction:H}]),h(1)},[]),L=c.useCallback(z=>{S(z),h(1)},[]),E=c.useCallback(z=>{A(z),h(1)},[]),R=c.useCallback(z=>{y(z),h(1)},[]),T=c.useCallback(async z=>{if(!(e!=null&&e.insert))throw new Error("DataSource is not writable");await e.insert(z)},[e]),D=c.useCallback(async(z,H)=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");await e.update(z,H)},[e]),F=c.useCallback(async z=>{if(!(e!=null&&e.remove))throw new Error("DataSource is not writable");await e.remove(z)},[e]);return{data:n,totalCount:i,loading:l,error:u,page:p,pageSize:m,sort:g,filter:b,search:w,setPage:h,setPageSize:R,setSort:v,setSortField:N,setFilter:L,setSearch:E,reload:M,insert:T,update:D,remove:F}}function Ma(e,t){const[r,a]=c.useState(void 0),[n,s]=c.useState({}),[i,o]=c.useState(!1),[l,d]=c.useState(null),u=c.useRef(0),f=c.useCallback(async()=>{if(!e||t==null){a(void 0);return}const b=++u.current;o(!0),d(null);try{const S=await e.byKey(t);if(b!==u.current)return;a(S),s({})}catch(S){if(b!==u.current)return;d(S instanceof Error?S.message:String(S))}finally{b===u.current&&o(!1)}},[e,t]);c.useEffect(()=>{f()},[f]),c.useEffect(()=>{if(e)return e.on("changed",()=>{f()})},[e,f]);const p=c.useMemo(()=>({...r??{},...n}),[r,n]),h=Object.keys(n).length>0,m=c.useCallback((b,S)=>{s(w=>({...w,[b]:S}))},[]),y=c.useCallback(b=>{s(S=>({...S,...b}))},[]),g=c.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");h&&await e.update(t,n)},[e,t,n,h]),v=c.useCallback(()=>{s({})},[]);return{data:r,editData:p,loading:i,error:l,changes:n,isDirty:h,set:m,setMany:y,save:g,reload:f,reset:v}}function fd(e,t,r){const a=Ma(e,t),n=a.editData[r],s=c.useCallback(o=>{a.set(r,o)},[a,r]),i=c.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");const o={[r]:a.editData[r]};await e.update(t,o)},[e,t,r,a.editData]);return{value:n,setValue:s,loading:a.loading,error:a.error,isDirty:r in a.changes,save:i}}function md(e,t,r,a){const n=(a==null?void 0:a.autoLoad)??!0,s=(a==null?void 0:a.take)??200,[i,o]=c.useState([]),[l,d]=c.useState(!1),[u,f]=c.useState(null),p=c.useRef(0),h=c.useCallback(async g=>{if(!e)return;const v=++p.current;d(!0),f(null);try{const b=await e.load({take:s,search:g||void 0,searchFields:a==null?void 0:a.searchFields});if(v!==p.current)return;o(b.data)}catch(b){if(v!==p.current)return;f(b instanceof Error?b.message:String(b))}finally{v===p.current&&d(!1)}},[e,s,a==null?void 0:a.searchFields]);c.useEffect(()=>{n&&h()},[h,n]);const m=c.useMemo(()=>i.map(g=>{const v=g,b={value:String(v[t]??""),label:String(v[r]??"")};return a!=null&&a.iconField&&v[a.iconField]!=null&&(b.icon=v[a.iconField]),a!=null&&a.descriptionField&&v[a.descriptionField]!=null&&(b.description=String(v[a.descriptionField])),a!=null&&a.groupField&&v[a.groupField]!=null&&(b.group=String(v[a.groupField])),b}),[i,t,r,a==null?void 0:a.iconField,a==null?void 0:a.descriptionField,a==null?void 0:a.groupField]),y=c.useCallback(g=>{h(g)},[h]);return{options:m,loading:l,error:u,search:y,reload:()=>h()}}function nt(e){const{dbName:t,storeName:r,keyField:a="id",version:n=1,indexes:s=[]}=e;let i=null;const o=new Map;function l(m,...y){var g;(g=o.get(m))==null||g.forEach(v=>v(...y))}async function d(){return i||new Promise((m,y)=>{const g=indexedDB.open(t,n);g.onerror=()=>y(g.error),g.onsuccess=()=>{i=g.result,m(i)},g.onupgradeneeded=v=>{const b=v.target.result;if(!b.objectStoreNames.contains(r)){const S=b.createObjectStore(r,{keyPath:a});for(const w of s)S.createIndex(w.name,w.keyPath,{unique:w.unique??!1})}}})}async function u(m,y){const g=await d();return new Promise((v,b)=>{const w=g.transaction(r,m).objectStore(r),A=y(w);A.onsuccess=()=>v(A.result),A.onerror=()=>b(A.error)})}async function f(m,y,g){const v=await d();return new Promise((b,S)=>{var D;const A=v.transaction(r,m).objectStore(r),k=[];let C=A,M="next";if((D=y.sort)!=null&&D.length){const F=y.sort[0].field,z=y.sort[0].direction;A.indexNames.contains(F)&&(C=A.index(F)),M=z==="desc"?"prev":"next"}const N=C.openCursor(null,M);let L=0,E=0;const R=y.skip??0,T=y.take??1/0;N.onsuccess=()=>{const F=N.result;if(!F||E>=T){b(k);return}const z=F.value;if(y.filter&&!p(z,y.filter)){F.continue();return}if(y.search&&!h(z,y.search,y.searchFields)){F.continue();return}if(L<R){L++,F.continue();return}k.push(z),E++,F.continue()},N.onerror=()=>S(N.error)})}function p(m,y){if(!y.items.length)return!0;const g=v=>{if(v.type==="group")return p(m,v);const b=m[v.field],S=v.value;switch(v.operator){case"=":return b==S;case"<>":return b!=S;case"<":return b<S;case"<=":return b<=S;case">":return b>S;case">=":return b>=S;case"contains":return String(b??"").toLowerCase().includes(String(S??"").toLowerCase());case"notcontains":return!String(b??"").toLowerCase().includes(String(S??"").toLowerCase());case"startswith":return String(b??"").toLowerCase().startsWith(String(S??"").toLowerCase());case"endswith":return String(b??"").toLowerCase().endsWith(String(S??"").toLowerCase());case"isblank":return b==null||b==="";case"isnotblank":return b!=null&&b!=="";default:return!0}};return y.logic==="and"?y.items.every(g):y.items.some(g)}function h(m,y,g){const v=y.toLowerCase();return(g?g.map(S=>m[S]):Object.values(m)).some(S=>String(S??"").toLowerCase().includes(v))}return{keyField:a,writable:!0,async load(m={}){var y;l("loading",!0);try{const g=await f("readonly",m,()=>{});(y=m.sort)!=null&&y.length&&g.sort((S,w)=>{for(const A of m.sort){const k=S[A.field]??"",C=w[A.field]??"",M=typeof k=="number"&&typeof C=="number"?k-C:String(k).localeCompare(String(C));if(M!==0)return A.direction==="desc"?-M:M}return 0});const v=await this.count(),b={data:g,totalCount:v};return l("loaded",b),l("loading",!1),b}catch(g){throw l("error",g),l("loading",!1),g}},async byKey(m){return u("readonly",y=>y.get(m))},async insert(m){return await u("readwrite",y=>y.add(m)),l("changed"),m},async update(m,y){const g=await this.byKey(m);if(!g)throw new Error(`Record not found: ${m}`);const v={...g,...y};return await u("readwrite",b=>b.put(v)),l("changed"),v},async remove(m){await u("readwrite",y=>y.delete(m)),l("changed")},on(m,y){return o.has(m)||o.set(m,new Set),o.get(m).add(y),()=>{var g;return(g=o.get(m))==null?void 0:g.delete(y)}},async clear(){await u("readwrite",m=>m.clear()),l("changed")},async count(){return u("readonly",m=>m.count())},async getAll(){return u("readonly",m=>m.getAll())},async bulkInsert(m){const y=await d();return new Promise((g,v)=>{const b=y.transaction(r,"readwrite"),S=b.objectStore(r);for(const w of m)S.put(w);b.oncomplete=()=>{l("changed"),g()},b.onerror=()=>v(b.error)})},async bulkDelete(m){const y=await d();return new Promise((g,v)=>{const b=y.transaction(r,"readwrite"),S=b.objectStore(r);for(const w of m)S.delete(w);b.oncomplete=()=>{l("changed"),g()},b.onerror=()=>v(b.error)})},async exportData(){return this.getAll()},async importData(m){await this.clear(),await this.bulkInsert(m)}}}function pd(e){const{remoteSource:t,offlineConfig:r,syncStrategy:a="remote-first",onConflict:n,onSync:s,autoSyncInterval:i=0}=e,o=r.keyField??t.keyField,l=nt({...r,keyField:o}),d=nt({dbName:r.dbName,storeName:`${r.storeName}_pending`,keyField:"id"});let u=navigator.onLine,f=0;const p=new Map;function h(g,...v){var b;(b=p.get(g))==null||b.forEach(S=>S(...v))}window.addEventListener("online",()=>{u=!0,h("online"),y()}),window.addEventListener("offline",()=>{u=!1,h("offline")});async function m(g,v,b){const S={id:`pending_${++f}_${Date.now()}`,action:g,key:v,data:b,timestamp:Date.now(),retries:0};await d.insert(S)}async function y(){if(u){h("syncing",!0);try{let g=0,v=0,b=0;const S=await d.load();for(const w of S.data)try{switch(w.action){case"insert":await t.insert(w.data),g++;break;case"update":await t.update(w.key,w.data),v++;break;case"remove":await t.remove(w.key),b++;break}await d.remove(w.id)}catch{w.retries<3&&await d.update(w.id,{retries:w.retries+1})}if(a!=="local-first"){const w=await t.load();if(a==="remote-first")await l.importData(w.data);else if(a==="merge"&&n){const A=await l.load(),k=new Map(A.data.map(M=>[M[o],M])),C=[];for(const M of w.data){const N=k.get(M[o]);N?C.push(n(N,M)):C.push(M)}await l.importData(C)}}h("synced",{added:g,updated:v,removed:b}),s==null||s({added:g,updated:v,removed:b})}catch(g){h("syncError",g)}finally{h("syncing",!1)}}}return i>0&&window.setInterval(y,i),{keyField:o,writable:!0,async load(g={}){if(u&&a==="remote-first")try{const v=await t.load(g);return await l.bulkInsert(v.data),v}catch{}return l.load(g)},async byKey(g){if(u)try{const v=await t.byKey(g);return v&&await l.update(g,v).catch(()=>l.insert(v)),v}catch{}return l.byKey(g)},async insert(g){const v=await l.insert(g);if(u)try{return await t.insert(g)}catch{await m("insert",void 0,g)}else await m("insert",void 0,g);return h("changed"),v},async update(g,v){const b=await l.update(g,v);if(u)try{return await t.update(g,v)}catch{await m("update",g,v)}else await m("update",g,v);return h("changed"),b},async remove(g){if(await l.remove(g),u)try{await t.remove(g)}catch{await m("remove",g)}else await m("remove",g);h("changed")},on(g,v){return p.has(g)||p.set(g,new Set),p.get(g).add(v),()=>{var b;return(b=p.get(g))==null?void 0:b.delete(v)}},sync:y,isOnline:()=>u,async getPendingChanges(){return(await d.load()).data},async clearPendingChanges(){await d.clear()}}}function gd(e){const{channelName:t,source:r}=e,a=new BroadcastChannel(t),n=new Map;function s(o,...l){var d;(d=n.get(o))==null||d.forEach(u=>u(...l))}a.onmessage=o=>{const l=o.data;switch(l.type){case"insert":case"update":case"remove":s("changed"),s("crossTabChange",l);break;case"refresh":s("refresh");break;case"request-sync":r.load().then(d=>{a.postMessage({type:"sync-data",data:d.data})});break}};function i(o){a.postMessage(o)}return{...r,async insert(o){const l=await r.insert(o);return i({type:"insert",data:l}),l},async update(o,l){const d=await r.update(o,l);return i({type:"update",key:o,changes:l}),d},async remove(o){await r.remove(o),i({type:"remove",key:o})},on(o,l){n.has(o)||n.set(o,new Set),n.get(o).add(l);const d=r.on(o,l);return()=>{var u;(u=n.get(o))==null||u.delete(l),d()}},broadcast:i,requestSync(){i({type:"request-sync"})}}}function yd(e={}){const{prefix:t="",persist:r={filter:!0,sort:!0,page:!0,search:!0},useHash:a=!1}=e;function n(){return a?new URLSearchParams(window.location.hash.slice(1)):new URLSearchParams(window.location.search)}function s(o){if(a)window.location.hash=o.toString();else{const l=new URL(window.location.href);l.search=o.toString(),window.history.replaceState({},"",l.toString())}}function i(o){return t?`${t}_${o}`:o}return{read(){const o=n(),l={};if(r.filter){const d=o.get(i("filter"));if(d)try{l.filter=JSON.parse(d)}catch{}}if(r.sort){const d=o.get(i("sort"));if(d)try{l.sort=JSON.parse(d)}catch{}}if(r.page){const d=o.get(i("skip")),u=o.get(i("take"));d&&(l.skip=parseInt(d,10)),u&&(l.take=parseInt(u,10))}if(r.search){const d=o.get(i("search"));d&&(l.search=d)}return l},write(o){const l=n();r.filter&&(o.filter&&o.filter.items.length>0?l.set(i("filter"),JSON.stringify(o.filter)):l.delete(i("filter"))),r.sort&&(o.sort&&o.sort.length>0?l.set(i("sort"),JSON.stringify(o.sort)):l.delete(i("sort"))),r.page&&(o.skip?l.set(i("skip"),String(o.skip)):l.delete(i("skip")),o.take?l.set(i("take"),String(o.take)):l.delete(i("take"))),r.search&&(o.search?l.set(i("search"),o.search):l.delete(i("search"))),s(l)},clear(){const o=n();o.delete(i("filter")),o.delete(i("sort")),o.delete(i("skip")),o.delete(i("take")),o.delete(i("search")),s(o)},toLoadOptions(){const o=this.read();return{filter:o.filter,sort:o.sort,skip:o.skip,take:o.take,search:o.search}}}}const hd={async exportToJSON(e,t){const r=await e.load(),a={version:"1.0",timestamp:Date.now(),data:r.data,metadata:t};return JSON.stringify(a,null,2)},async importFromJSON(e,t,r={}){const n=JSON.parse(t).data;let s=0,i=0;r.replace&&"clear"in e&&await e.clear();for(const o of n){if(r.validate&&!r.validate(o)){i++;continue}try{await e.insert(o),s++}catch{i++}}return{imported:s,skipped:i}},async downloadAsJSON(e,t="export.json"){const r=await this.exportToJSON(e),a=new Blob([r],{type:"application/json"}),n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download=t,s.click(),URL.revokeObjectURL(n)},async importFromFile(e,t,r){const a=await t.text();return this.importFromJSON(e,a,r)}};function bd(e="nice_user_prefs"){let t=null;function r(){if(t)return t;try{const n=localStorage.getItem(e);t=n?JSON.parse(n):{}}catch{t={}}return t}function a(n){t=n,localStorage.setItem(e,JSON.stringify(n))}return{get(n,s){return r()[n]??s},set(n,s){const i=r();i[n]=s,a(i)},remove(n){const s=r();delete s[n],a(s)},getAll(){return{...r()}},setAll(n){a(n)},clear(){t={},localStorage.removeItem(e)},merge(n){a({...r(),...n})}}}const Ca={"colors.primary":"--color-primary","colors.primaryHover":"--color-primary-hover","colors.success":"--color-success","colors.warning":"--color-warning","colors.error":"--color-error","colors.info":"--color-info","colors.accent":"--color-accent","colors.accentHover":"--color-accent-hover","colors.link":"--color-link","colors.linkHover":"--color-link-hover","colors.focus":"--color-focus","colors.overlay":"--color-overlay","colors.surface":"--color-surface","colors.surfaceHover":"--color-surface-hover","colors.disabled":"--color-disabled","colors.disabledText":"--color-disabled-text","backgrounds.primary":"--bg-primary","backgrounds.secondary":"--bg-secondary","backgrounds.tertiary":"--bg-tertiary","backgrounds.hover":"--hover-bg","backgrounds.elevated":"--bg-elevated","backgrounds.inset":"--bg-inset","backgrounds.canvas":"--bg-canvas","text.primary":"--text-primary","text.secondary":"--text-secondary","text.muted":"--text-muted","text.inverse":"--text-inverse","text.onPrimary":"--text-on-primary","text.onAccent":"--text-on-accent","borders.color":"--border-color","borders.radiusSm":"--nice-radius-sm","borders.radiusMd":"--nice-radius-md","borders.radiusLg":"--nice-radius-lg","borders.radiusXl":"--nice-radius-xl","borders.radiusFull":"--nice-radius-full","borders.width":"--border-width","borders.focusColor":"--border-focus-color","borders.divider":"--border-divider","shadows.sm":"--shadow-sm","shadows.md":"--shadow-md","shadows.lg":"--shadow-lg","shadows.xl":"--shadow-xl","shadows.inner":"--shadow-inner","shadows.glow":"--shadow-glow","spacing.space1":"--nice-space-1","spacing.space2":"--nice-space-2","spacing.space3":"--nice-space-3","spacing.space4":"--nice-space-4","spacing.space5":"--nice-space-5","spacing.space6":"--nice-space-6","spacing.space8":"--nice-space-8","spacing.space10":"--nice-space-10","spacing.space12":"--nice-space-12","spacing.space16":"--nice-space-16","typography.fontFamily":"--nice-font-family","typography.fontSizeXs":"--nice-font-size-xs","typography.fontSizeSm":"--nice-font-size-sm","typography.fontSizeMd":"--nice-font-size-md","typography.fontSizeLg":"--nice-font-size-lg","typography.fontSizeXl":"--nice-font-size-xl","typography.fontSize2xl":"--nice-font-size-2xl","typography.fontSize3xl":"--nice-font-size-3xl","typography.fontWeightNormal":"--nice-font-weight-normal","typography.fontWeightMedium":"--nice-font-weight-medium","typography.fontWeightSemibold":"--nice-font-weight-semibold","typography.fontWeightBold":"--nice-font-weight-bold","typography.lineHeight":"--nice-line-height","typography.headingFontFamily":"--nice-heading-font-family","typography.monoFontFamily":"--nice-mono-font-family","typography.letterSpacing":"--nice-letter-spacing","typography.headingLetterSpacing":"--nice-heading-letter-spacing","transitions.fast":"--nice-transition-fast","transitions.normal":"--nice-transition","transitions.slow":"--nice-transition-slow"};function vd(e,t){return t.split(".").reduce((r,a)=>{if(r&&typeof r=="object")return r[a]},e)}function De(e){var r;const t={};for(const[a,n]of Object.entries(Ca)){const s=vd(e,a);s!==void 0&&(t[n]=String(s))}if(e.nesting)for(const a of["sidebar","menu","tree"]){const n=e.nesting[a];if(!n)continue;const s=e.backgrounds.secondary||e.backgrounds.primary||"#ffffff",i=((r=e.text)==null?void 0:r.primary)||"#111111";Object.assign(t,Rd(a,n,s,i))}return t}function Sd(e,t){const r=t??document.documentElement,a=De(e);for(const[n,s]of Object.entries(a))r.style.setProperty(n,s);wd(e.backgroundImage,r),e.darkMode&&(r.dataset.ntdColorScheme=e.darkMode)}const xd={dots:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="currentColor" opacity="0.15"/></svg>',grid:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M20 0H0v20" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',diagonal:'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0" stroke="currentColor" stroke-opacity="0.08"/></svg>',"cross-hatch":'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0M-1 1L1 -1M9 11L11 9" stroke="currentColor" stroke-opacity="0.06"/></svg>',waves:'<svg width="40" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6c5 0 5-6 10-6s5 6 10 6 5-6 10-6 5 6 10 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',hexagons:'<svg width="28" height="49" xmlns="http://www.w3.org/2000/svg"><path d="M14 0l14 8.5v16L14 33 0 24.5v-16z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',triangles:'<svg width="20" height="17" xmlns="http://www.w3.org/2000/svg"><path d="M0 17L10 0l10 17z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',circles:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="6" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',zigzag:'<svg width="20" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6l5-6 5 6 5-6 5 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',noise:'<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency=".9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#n)"/></svg>'};function wd(e,t){if(t.style.removeProperty("--ntd-bg-image"),t.style.removeProperty("--ntd-bg-image-size"),t.style.removeProperty("--ntd-bg-image-position"),t.style.removeProperty("--ntd-bg-image-attachment"),t.style.removeProperty("--ntd-bg-image-repeat"),t.style.removeProperty("--ntd-bg-image-opacity"),t.style.removeProperty("--ntd-bg-image-blend"),!(!e||e.type==="none")){if(e.type==="gradient"&&e.gradient)t.style.setProperty("--ntd-bg-image",e.gradient);else if(e.type==="image"&&e.imageUrl)t.style.setProperty("--ntd-bg-image",`url("${e.imageUrl}")`),e.imageSize&&t.style.setProperty("--ntd-bg-image-size",e.imageSize),e.imagePosition&&t.style.setProperty("--ntd-bg-image-position",e.imagePosition),e.imageAttachment&&t.style.setProperty("--ntd-bg-image-attachment",e.imageAttachment),e.imageRepeat&&t.style.setProperty("--ntd-bg-image-repeat",e.imageRepeat);else if(e.type==="pattern"&&e.pattern){const r=xd[e.pattern];if(r){const a=`url("data:image/svg+xml,${encodeURIComponent(r)}")`;t.style.setProperty("--ntd-bg-image",a),t.style.setProperty("--ntd-bg-image-repeat","repeat")}}e.opacity!==void 0&&t.style.setProperty("--ntd-bg-image-opacity",String(e.opacity)),e.blendMode&&t.style.setProperty("--ntd-bg-image-blend",e.blendMode)}}function Aa(e){const t=e??document.documentElement;for(const r of Object.values(Ca))t.style.removeProperty(r);for(const r of["--ntd-bg-image","--ntd-bg-image-size","--ntd-bg-image-position","--ntd-bg-image-attachment","--ntd-bg-image-repeat","--ntd-bg-image-opacity","--ntd-bg-image-blend"])t.style.removeProperty(r);delete t.dataset.ntdColorScheme,delete t.dataset.theme,t.classList.remove("nice-dark");for(const r of["sidebar","menu","tree"]){t.style.removeProperty(`--nice-${r}-levels`);for(let a=1;a<=10;a++)t.style.removeProperty(`--nice-${r}-level-${a}-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-text`),t.style.removeProperty(`--nice-${r}-level-${a}-hover-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-active-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-border`)}}function kd(e){const t=e??document.documentElement,r=getComputedStyle(t),a=i=>r.getPropertyValue(i).trim(),n=i=>parseFloat(r.getPropertyValue(i))||0,s=i=>a(i)||void 0;return{name:"Current",colors:{primary:a("--color-primary"),primaryHover:a("--color-primary-hover"),success:a("--color-success"),warning:a("--color-warning"),error:a("--color-error"),info:a("--color-info"),accent:s("--color-accent"),accentHover:s("--color-accent-hover"),link:s("--color-link"),linkHover:s("--color-link-hover"),focus:s("--color-focus"),overlay:s("--color-overlay"),surface:s("--color-surface"),surfaceHover:s("--color-surface-hover"),disabled:s("--color-disabled"),disabledText:s("--color-disabled-text")},backgrounds:{primary:a("--bg-primary"),secondary:a("--bg-secondary"),tertiary:a("--bg-tertiary"),hover:a("--hover-bg"),elevated:s("--bg-elevated"),inset:s("--bg-inset"),canvas:s("--bg-canvas")},text:{primary:a("--text-primary"),secondary:a("--text-secondary"),muted:a("--text-muted"),inverse:s("--text-inverse"),onPrimary:s("--text-on-primary"),onAccent:s("--text-on-accent")},borders:{color:a("--border-color"),radiusSm:a("--nice-radius-sm"),radiusMd:a("--nice-radius-md"),radiusLg:a("--nice-radius-lg"),radiusXl:a("--nice-radius-xl"),radiusFull:a("--nice-radius-full"),width:s("--border-width"),focusColor:s("--border-focus-color"),divider:s("--border-divider")},shadows:{sm:a("--shadow-sm"),md:a("--shadow-md"),lg:a("--shadow-lg"),xl:a("--shadow-xl"),inner:s("--shadow-inner"),glow:s("--shadow-glow")},spacing:{space1:a("--nice-space-1"),space2:a("--nice-space-2"),space3:a("--nice-space-3"),space4:a("--nice-space-4"),space5:a("--nice-space-5"),space6:a("--nice-space-6"),space8:a("--nice-space-8"),space10:s("--nice-space-10"),space12:s("--nice-space-12"),space16:s("--nice-space-16")},typography:{fontFamily:a("--nice-font-family"),fontSizeXs:a("--nice-font-size-xs"),fontSizeSm:a("--nice-font-size-sm"),fontSizeMd:a("--nice-font-size-md"),fontSizeLg:a("--nice-font-size-lg"),fontSizeXl:a("--nice-font-size-xl"),fontWeightNormal:n("--nice-font-weight-normal"),fontWeightMedium:n("--nice-font-weight-medium"),fontWeightSemibold:n("--nice-font-weight-semibold"),fontWeightBold:n("--nice-font-weight-bold"),lineHeight:n("--nice-line-height"),headingFontFamily:s("--nice-heading-font-family"),monoFontFamily:s("--nice-mono-font-family"),fontSize2xl:s("--nice-font-size-2xl"),fontSize3xl:s("--nice-font-size-3xl"),letterSpacing:s("--nice-letter-spacing"),headingLetterSpacing:s("--nice-heading-letter-spacing")},transitions:{fast:a("--nice-transition-fast"),normal:a("--nice-transition"),slow:a("--nice-transition-slow")},darkMode:t.dataset.ntdColorScheme??void 0}}function Md(e){return JSON.stringify(e,null,2)}function Cd(e){const t=JSON.parse(e);if(!t||typeof t!="object"||!t.name||!t.colors||!t.backgrounds)throw new Error("Invalid theme format: missing required fields (name, colors, backgrounds)");return t}const Ad=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,Ed=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;function st(e){if(!e)return null;const t=e.trim();let r=t.match(Ed);if(r)return{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)};if(r=t.match(Ad),r)return{r:parseInt(r[1]+r[1],16),g:parseInt(r[2]+r[2],16),b:parseInt(r[3]+r[3],16)};const a=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);return a?{r:+a[1],g:+a[2],b:+a[3]}:null}function Nd({r:e,g:t,b:r}){const a=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${a(e)}${a(t)}${a(r)}`}function Tt(e,t,r){const a=st(e),n=st(t);return!a||!n?e:Nd({r:a.r+(n.r-a.r)*r,g:a.g+(n.g-a.g)*r,b:a.b+(n.b-a.b)*r})}function ot(e,t){return Tt(e,"#ffffff",t)}function it(e,t){return Tt(e,"#000000",t)}function ct(e){const t=st(e);if(!t)return 1;const r=a=>{const n=a/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)};return .2126*r(t.r)+.7152*r(t.g)+.0722*r(t.b)}function Ld(e,t,r){return ct(e)>.5?r:t}function Td(e,t,r){const a=t.palette??[],n=t.bgStep??.06,s=a[0]??r;switch(t.bgDerivation??"tint"){case"palette":return a.length===0?r:a[(e-1)%a.length];case"shade":return it(s,Math.min(.9,n*(e-1)));case"mix-surface":return Tt(s,r,Math.min(1,n*(e-1)));case"tint":default:return ot(s,Math.min(.9,n*(e-1)))}}function Rd(e,t,r,a){var i;const n={},s=Math.max(1,Math.min(10,t.levels??5));for(let o=1;o<=s;o++){const l=(i=t.overrides)==null?void 0:i[o],d=(l==null?void 0:l.background)??Td(o,t,r),u=(l==null?void 0:l.text)??Ld(d,"#ffffff",a),f=(l==null?void 0:l.hoverBackground)??(ct(d)>.5?it(d,.06):ot(d,.08)),p=(l==null?void 0:l.activeBackground)??(ct(d)>.5?it(d,.12):ot(d,.16)),h=l==null?void 0:l.border;n[`--nice-${e}-level-${o}-bg`]=d,n[`--nice-${e}-level-${o}-text`]=u,n[`--nice-${e}-level-${o}-hover-bg`]=f,n[`--nice-${e}-level-${o}-active-bg`]=p,h&&(n[`--nice-${e}-level-${o}-border`]=h)}return n[`--nice-${e}-levels`]=String(s),n}const Rt=c.createContext(null);function Id(){const e=c.useContext(Rt);if(!e)throw new Error("useNiceTheme must be used within a NiceThemeProvider");return e}const we={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},ke={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Me={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},It=e=>({color:e,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),Ea={sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},zd={sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 4px 6px -1px rgba(0,0,0,0.4)",lg:"0 10px 15px -3px rgba(0,0,0,0.4)",xl:"0 20px 25px -5px rgba(0,0,0,0.4)"};function I(e,t,r,a,n){return{name:e,darkMode:"light",colors:{...t,surface:t.surface??r.primary,surfaceHover:t.surfaceHover??r.secondary},backgrounds:{...r,elevated:r.elevated??r.primary,inset:r.inset??r.tertiary,canvas:r.canvas??r.primary},text:{...a,inverse:a.inverse??"#ffffff"},borders:It(n),shadows:Ea,spacing:we,typography:ke,transitions:Me}}function O(e,t,r,a,n){return{name:e,darkMode:"dark",colors:{...t,surface:t.surface??r.secondary,surfaceHover:t.surfaceHover??r.tertiary},backgrounds:{...r,elevated:r.elevated??r.secondary,inset:r.inset??r.primary,canvas:r.canvas??r.primary},text:{...a,inverse:a.inverse??"#0f172a"},borders:It(n),shadows:zd,spacing:we,typography:ke,transitions:Me}}const Na=I("Slate",{primary:"#64748b",primaryHover:"#475569",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},"#cbd5e1"),La=I("Zinc",{primary:"#71717a",primaryHover:"#52525b",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fafafa",secondary:"#f4f4f5",tertiary:"#e4e4e7",hover:"#e4e4e7"},{primary:"#18181b",secondary:"#3f3f46",muted:"#a1a1aa"},"#d4d4d8"),Ta=I("Stone",{primary:"#78716c",primaryHover:"#57534e",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#1c1917",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),Ra=I("Cool Gray",{primary:"#6b7280",primaryHover:"#4b5563",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#d1d5db"),Ia=I("Warm Gray",{primary:"#7c7568",primaryHover:"#5c564c",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf9f7",secondary:"#f5f4f0",tertiary:"#e8e6e1",hover:"#e8e6e1"},{primary:"#1f1d19",secondary:"#4a463d",muted:"#a09888"},"#d4d0c8"),za=I("Silver",{primary:"#94a3b8",primaryHover:"#64748b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#38bdf8"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#334155",secondary:"#64748b",muted:"#94a3b8"},"#cbd5e1"),Da=I("Charcoal",{primary:"#374151",primaryHover:"#1f2937",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#6b7280"},"#d1d5db"),Pa=I("Ivory",{primary:"#92876d",primaryHover:"#7a6f55",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffef7",secondary:"#faf6eb",tertiary:"#f0ead6",hover:"#f0ead6"},{primary:"#2b2517",secondary:"#5c5340",muted:"#9c9280"},"#ddd8c4"),Fa=I("Rose",{primary:"#e11d48",primaryHover:"#be123c",success:"#16a34a",warning:"#ea580c",error:"#dc2626",info:"#0891b2"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f43f5e"},"#fda4af"),Ha=I("Emerald",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#34d399"},"#6ee7b7"),$a=I("Amber",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0284c7"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#f59e0b"},"#fcd34d"),ja=I("Violet",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#2e1065",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),Ba=I("Teal",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),Oa=I("Indigo",{primary:"#4f46e5",primaryHover:"#4338ca",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#eef2ff",secondary:"#e0e7ff",tertiary:"#c7d2fe",hover:"#e0e7ff"},{primary:"#1e1b4b",secondary:"#312e81",muted:"#818cf8"},"#a5b4fc"),_a=I("Cyan",{primary:"#0891b2",primaryHover:"#0e7490",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#0284c7"},{primary:"#ecfeff",secondary:"#cffafe",tertiary:"#a5f3fc",hover:"#cffafe"},{primary:"#164e63",secondary:"#155e75",muted:"#22d3ee"},"#67e8f9"),Wa=I("Lime",{primary:"#65a30d",primaryHover:"#4d7c0f",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f7fee7",secondary:"#ecfccb",tertiary:"#d9f99d",hover:"#ecfccb"},{primary:"#1a2e05",secondary:"#365314",muted:"#84cc16"},"#bef264"),Va=I("Pink",{primary:"#db2777",primaryHover:"#be185d",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#500724",secondary:"#831843",muted:"#f472b6"},"#f9a8d4"),Xa=I("Orange",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#7c2d12",muted:"#fb923c"},"#fdba74"),Ua=I("Fuchsia",{primary:"#c026d3",primaryHover:"#a21caf",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf4ff",secondary:"#fae8ff",tertiary:"#f5d0fe",hover:"#fae8ff"},{primary:"#4a044e",secondary:"#701a75",muted:"#d946ef"},"#e879f9"),qa=I("Sky",{primary:"#0284c7",primaryHover:"#0369a1",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#075985",muted:"#38bdf8"},"#7dd3fc"),Ga=I("Ruby",{primary:"#be123c",primaryHover:"#9f1239",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#fb7185"},"#fda4af"),Ka=I("Coral",{primary:"#f97316",primaryHover:"#ea580c",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#fb923c"},"#fdba74"),Ja=O("Midnight",{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#020617",secondary:"#0f172a",tertiary:"#1e293b",hover:"#1e293b"},{primary:"#f1f5f9",secondary:"#94a3b8",muted:"#475569"},"#1e293b"),Ya=O("Obsidian",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#38bdf8"},{primary:"#09090b",secondary:"#18181b",tertiary:"#27272a",hover:"#27272a"},{primary:"#fafafa",secondary:"#a1a1aa",muted:"#52525b"},"#3f3f46"),Qa=O("Eclipse",{primary:"#c084fc",primaryHover:"#a855f7",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#67e8f9"},{primary:"#0c0a1d",secondary:"#1a1533",tertiary:"#2a2248",hover:"#2a2248"},{primary:"#f5f3ff",secondary:"#a78bfa",muted:"#6d5eac"},"#3b3266"),Za=O("Onyx",{primary:"#60a5fa",primaryHover:"#3b82f6",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#000000",secondary:"#0a0a0a",tertiary:"#171717",hover:"#171717"},{primary:"#ffffff",secondary:"#a3a3a3",muted:"#525252"},"#262626"),en=O("Carbon",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#67e8f9"},{primary:"#161616",secondary:"#262626",tertiary:"#393939",hover:"#393939"},{primary:"#f4f4f4",secondary:"#c6c6c6",muted:"#6f6f6f"},"#525252"),tn=O("Cosmos",{primary:"#6366f1",primaryHover:"#4f46e5",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#030712",secondary:"#111827",tertiary:"#1f2937",hover:"#1f2937"},{primary:"#e5e7eb",secondary:"#9ca3af",muted:"#4b5563"},"#374151"),rn=O("Nebula",{primary:"#e879f9",primaryHover:"#d946ef",success:"#4ade80",warning:"#fbbf24",error:"#fb7185",info:"#67e8f9"},{primary:"#0d0117",secondary:"#1a0533",tertiary:"#2d0a52",hover:"#2d0a52"},{primary:"#fae8ff",secondary:"#d8b4fe",muted:"#7c3aed"},"#581c87"),an=O("Abyss",{primary:"#22d3ee",primaryHover:"#06b6d4",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#001219",secondary:"#002a3a",tertiary:"#003e54",hover:"#003e54"},{primary:"#e0f2fe",secondary:"#7dd3fc",muted:"#0369a1"},"#075985"),nn=O("Shadow",{primary:"#a3a3a3",primaryHover:"#737373",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#38bdf8"},{primary:"#171717",secondary:"#1f1f1f",tertiary:"#2a2a2a",hover:"#2a2a2a"},{primary:"#e5e5e5",secondary:"#a3a3a3",muted:"#525252"},"#404040"),sn=O("Emerald Dark",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#022c22",secondary:"#064e3b",tertiary:"#065f46",hover:"#065f46"},{primary:"#ecfdf5",secondary:"#6ee7b7",muted:"#047857"},"#047857"),on=I("Forest",{primary:"#166534",primaryHover:"#14532d",success:"#22c55e",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),cn=I("Ocean",{primary:"#0369a1",primaryHover:"#075985",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#38bdf8"},"#7dd3fc"),ln=I("Desert",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#422006",secondary:"#713f12",muted:"#ca8a04"},"#fde047"),dn=I("Sunset",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#f97316"},"#fdba74"),un=I("Aurora",{primary:"#0d9488",primaryHover:"#0f766e",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),fn=I("Lavender",{primary:"#7e22ce",primaryHover:"#6b21a8",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#3b0764",secondary:"#581c87",muted:"#a855f7"},"#d8b4fe"),mn=I("Autumn",{primary:"#c2410c",primaryHover:"#9a3412",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#7f1d1d",muted:"#f87171"},"#fca5a5"),pn=I("Spring",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#14532d",secondary:"#166534",muted:"#4ade80"},"#86efac"),gn=I("Arctic",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),yn=I("Tropical",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),hn=I("Pastel Rose",{primary:"#f472b6",primaryHover:"#ec4899",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#f9a8d4"),bn=I("Pastel Sky",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#075985",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),vn=I("Pastel Mint",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#065f46",secondary:"#047857",muted:"#6ee7b7"},"#a7f3d0"),Sn=I("Pastel Peach",{primary:"#fb923c",primaryHover:"#f97316",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#7c2d12",secondary:"#9a3412",muted:"#fdba74"},"#fed7aa"),xn=I("Pastel Lavender",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#4c1d95",secondary:"#5b21b6",muted:"#c4b5fd"},"#ddd6fe"),wn=I("Pastel Lemon",{primary:"#facc15",primaryHover:"#eab308",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#713f12",secondary:"#854d0e",muted:"#fde047"},"#fef08a"),kn=I("Pastel Sage",{primary:"#86efac",primaryHover:"#4ade80",success:"#22c55e",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#166534",secondary:"#15803d",muted:"#86efac"},"#bbf7d0"),Mn=I("Pastel Coral",{primary:"#fb7185",primaryHover:"#f43f5e",success:"#4ade80",warning:"#fcd34d",error:"#ef4444",info:"#67e8f9"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#881337",secondary:"#9f1239",muted:"#fda4af"},"#fecdd3"),Cn=I("Banking",{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#334155",muted:"#94a3b8"},"#cbd5e1"),An=I("Healthcare",{primary:"#0891b2",primaryHover:"#0e7490",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#e0f7fa",tertiary:"#b2ebf2",hover:"#e0f7fa"},{primary:"#134e4a",secondary:"#1a6b6a",muted:"#80cbc4"},"#b2dfdb"),En=I("Legal",{primary:"#1e293b",primaryHover:"#0f172a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#0f172a",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),Nn=I("Tech Startup",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#1e1b4b",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),Ln=I("Enterprise",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#60a5fa"},"#93c5fd"),Tn=I("Government",{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#1e293b",muted:"#64748b"},"#cbd5e1"),Rn=I("Education",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#0891b2"},{primary:"#f0fdf9",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),In=I("Real Estate",{primary:"#92400e",primaryHover:"#78350f",success:"#059669",warning:"#b45309",error:"#dc2626",info:"#0891b2"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#422006",secondary:"#713f12",muted:"#d97706"},"#fcd34d"),zn=I("Nord",{primary:"#5e81ac",primaryHover:"#4c6b90",success:"#a3be8c",warning:"#ebcb8b",error:"#bf616a",info:"#88c0d0"},{primary:"#eceff4",secondary:"#e5e9f0",tertiary:"#d8dee9",hover:"#d8dee9"},{primary:"#2e3440",secondary:"#3b4252",muted:"#4c566a"},"#d8dee9"),Dn=O("Dracula",{primary:"#bd93f9",primaryHover:"#9d79d9",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#8be9fd"},{primary:"#282a36",secondary:"#343746",tertiary:"#44475a",hover:"#44475a"},{primary:"#f8f8f2",secondary:"#c0c0c0",muted:"#6272a4"},"#44475a"),Pn=I("Solarized Light",{primary:"#268bd2",primaryHover:"#1a6da0",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#fdf6e3",secondary:"#eee8d5",tertiary:"#e0dbc7",hover:"#eee8d5"},{primary:"#073642",secondary:"#586e75",muted:"#93a1a1"},"#eee8d5"),Fn=O("Solarized Dark",{primary:"#268bd2",primaryHover:"#3d98db",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#002b36",secondary:"#073642",tertiary:"#0a4858",hover:"#073642"},{primary:"#eee8d5",secondary:"#93a1a1",muted:"#586e75"},"#073642"),Hn=O("Monokai",{primary:"#66d9ef",primaryHover:"#45c0d6",success:"#a6e22e",warning:"#e6db74",error:"#f92672",info:"#66d9ef"},{primary:"#272822",secondary:"#34352e",tertiary:"#3e3d32",hover:"#3e3d32"},{primary:"#f8f8f2",secondary:"#cfcfc2",muted:"#75715e"},"#3e3d32"),$n=O("One Dark",{primary:"#61afef",primaryHover:"#4b9ee0",success:"#98c379",warning:"#e5c07b",error:"#e06c75",info:"#56b6c2"},{primary:"#282c34",secondary:"#2c313a",tertiary:"#353b45",hover:"#353b45"},{primary:"#abb2bf",secondary:"#828997",muted:"#545862"},"#3e4452"),jn=O("Synthwave",{primary:"#ff7edb",primaryHover:"#e660c2",success:"#72f1b8",warning:"#fede5d",error:"#fe4450",info:"#36f9f6"},{primary:"#241b2f",secondary:"#2d2140",tertiary:"#362a50",hover:"#362a50"},{primary:"#f0e4fc",secondary:"#b4a0cc",muted:"#6c5c84"},"#4a3866"),Bn=I("Vaporwave",{primary:"#ff71ce",primaryHover:"#e655b5",success:"#78dcca",warning:"#ffb86c",error:"#ff5555",info:"#76e8fc"},{primary:"#fce4f7",secondary:"#e8d0f4",tertiary:"#d4bcf0",hover:"#e8d0f4"},{primary:"#4a1a4e",secondary:"#7b3f7d",muted:"#c080c0"},"#d8a8e8"),On=O("Terminal Green",{primary:"#00ff41",primaryHover:"#00cc34",success:"#00ff41",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0a0a0a",secondary:"#0d1a0d",tertiary:"#1a2e1a",hover:"#1a2e1a"},{primary:"#00ff41",secondary:"#00cc33",muted:"#008822"},"#003300"),_n=I("Sepia",{primary:"#8b6914",primaryHover:"#704f10",success:"#6b8e23",warning:"#cd853f",error:"#b22222",info:"#5f9ea0"},{primary:"#faf0e6",secondary:"#f5e6d3",tertiary:"#eddcc7",hover:"#f5e6d3"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#d7ccc8"),Wn=I("Vintage",{primary:"#8d6e63",primaryHover:"#6d4c41",success:"#66bb6a",warning:"#ffb300",error:"#e53935",info:"#29b6f6"},{primary:"#efebe9",secondary:"#d7ccc8",tertiary:"#bcaaa4",hover:"#d7ccc8"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#bcaaa4"),Vn=O("Cyberpunk",{primary:"#00f0ff",primaryHover:"#00c8d4",success:"#39ff14",warning:"#ffff00",error:"#ff003c",info:"#bf00ff"},{primary:"#0a0e17",secondary:"#131824",tertiary:"#1c2333",hover:"#1c2333"},{primary:"#e0fbfc",secondary:"#80d4dd",muted:"#3a6b72"},"#1c3a44"),Xn=O("Neon",{primary:"#ff00ff",primaryHover:"#cc00cc",success:"#00ff00",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0d0d0d",secondary:"#1a1a1a",tertiary:"#262626",hover:"#262626"},{primary:"#ffffff",secondary:"#cccccc",muted:"#666666"},"#333333"),Un=O("Retrowave",{primary:"#f77fbe",primaryHover:"#e462a3",success:"#72f1b8",warning:"#ffe261",error:"#ff4444",info:"#79e8fb"},{primary:"#1b0a2e",secondary:"#261440",tertiary:"#321e52",hover:"#321e52"},{primary:"#ffe6f7",secondary:"#c9a0c9",muted:"#6b4c7a"},"#4a2d66"),qn=I("Christmas",{primary:"#c41e3a",primaryHover:"#a01830",success:"#228b22",warning:"#ffd700",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),Gn=O("Halloween",{primary:"#ff6600",primaryHover:"#e05500",success:"#4ade80",warning:"#fbbf24",error:"#ff0000",info:"#9333ea"},{primary:"#1a0a00",secondary:"#2d1500",tertiary:"#402000",hover:"#402000"},{primary:"#ffedd5",secondary:"#fdba74",muted:"#9a5c28"},"#5c3400"),Kn=I("Valentine",{primary:"#e11d48",primaryHover:"#be123c",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#ec4899"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f9a8d4"},"#fda4af"),Jn=I("Easter",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fef9ff",secondary:"#f3e8ff",tertiary:"#e8d5ff",hover:"#f3e8ff"},{primary:"#581c87",secondary:"#6d28d9",muted:"#c4b5fd"},"#ddd6fe"),Yn=I("Summer Beach",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#fcd34d"),Qn=I("Winter Frost",{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#93c5fd"},"#bfdbfe"),Zn=I("Cherry Blossom",{primary:"#ec4899",primaryHover:"#db2777",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#fbcfe8"),es=I("Harvest",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#d97706"},"#fcd34d"),ts=I("Japanese Zen",{primary:"#6b7280",primaryHover:"#4b5563",success:"#6b8e23",warning:"#d4a017",error:"#c0392b",info:"#5f9ea0"},{primary:"#faf9f6",secondary:"#f0ece3",tertiary:"#e6e0d4",hover:"#f0ece3"},{primary:"#2c2c2c",secondary:"#5c5c5c",muted:"#a0998a"},"#d5cec0"),rs=I("Moroccan",{primary:"#c2410c",primaryHover:"#9a3412",success:"#15803d",warning:"#ca8a04",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbf0",secondary:"#fef3e0",tertiary:"#fde6c4",hover:"#fef3e0"},{primary:"#3a1a00",secondary:"#7c2d12",muted:"#d97706"},"#f5d0a0"),as=I("Scandinavian",{primary:"#4b5563",primaryHover:"#374151",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ffffff",secondary:"#f9fafb",tertiary:"#f3f4f6",hover:"#f3f4f6"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#e5e7eb"),ns=I("Mediterranean",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#2563eb",muted:"#93c5fd"},"#bfdbfe"),ss=I("Chinese New Year",{primary:"#dc2626",primaryHover:"#b91c1c",success:"#16a34a",warning:"#d4a017",error:"#ef4444",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#991b1b",muted:"#f87171"},"#fca5a5"),os=I("Indian Festive",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#7c3aed"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#92400e",muted:"#f59e0b"},"#fcd34d"),is=I("Brazilian Carnival",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#facc15",error:"#ef4444",info:"#0ea5e9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),cs=I("African Earth",{primary:"#92400e",primaryHover:"#78350f",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf5f0",secondary:"#f0e6d6",tertiary:"#e6d5bb",hover:"#f0e6d6"},{primary:"#2b1a0e",secondary:"#5c3d1e",muted:"#a08060"},"#d4b896"),ls=O("High Contrast Dark",{primary:"#ffff00",primaryHover:"#cccc00",success:"#00ff00",warning:"#ff8c00",error:"#ff0000",info:"#00ffff"},{primary:"#000000",secondary:"#1a1a1a",tertiary:"#333333",hover:"#333333"},{primary:"#ffffff",secondary:"#ffffff",muted:"#cccccc"},"#ffffff"),ds=I("Monochrome",{primary:"#404040",primaryHover:"#262626",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fafafa",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0"},{primary:"#1a1a1a",secondary:"#404040",muted:"#808080"},"#c0c0c0"),us=I("Enhanced Contrast",{primary:"#0050b3",primaryHover:"#003d8c",success:"#006400",warning:"#cc7000",error:"#cc0000",info:"#006680"},{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#ebebeb"},{primary:"#000000",secondary:"#1a1a1a",muted:"#595959"},"#8c8c8c"),fs={name:"Large Text",darkMode:"light",colors:{primary:"#2563eb",primaryHover:"#1d4ed8",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#ffffff"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:It("#e2e8f0"),shadows:Ea,spacing:{space1:"6px",space2:"12px",space3:"16px",space4:"20px",space5:"24px",space6:"32px",space8:"40px"},typography:{fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.875rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6},transitions:Me},ms={name:"Glassmorphism",darkMode:"light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"rgba(255,255,255,0.7)",surfaceHover:"rgba(255,255,255,0.5)"},backgrounds:{primary:"rgba(255,255,255,0.7)",secondary:"rgba(255,255,255,0.5)",tertiary:"rgba(255,255,255,0.3)",hover:"rgba(255,255,255,0.5)",elevated:"rgba(255,255,255,0.8)",inset:"rgba(255,255,255,0.3)",canvas:"rgba(255,255,255,0.7)"},text:{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:{color:"rgba(255,255,255,0.3)",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,0,0,0.04)",md:"0 4px 16px rgba(0,0,0,0.08)",lg:"0 8px 32px rgba(0,0,0,0.12)",xl:"0 16px 48px rgba(0,0,0,0.16)"},spacing:we,typography:ke,transitions:{fast:"150ms ease",normal:"250ms ease",slow:"350ms ease"}},ps={name:"Neumorphism Light",darkMode:"light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#e0e5ec",surfaceHover:"#d5dae2"},backgrounds:{primary:"#e0e5ec",secondary:"#d5dae2",tertiary:"#ccd1d9",hover:"#d5dae2",elevated:"#e0e5ec",inset:"#ccd1d9",canvas:"#e0e5ec"},text:{primary:"#2d3748",secondary:"#4a5568",muted:"#718096",inverse:"#ffffff"},borders:{color:"#d0d5dd",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #b8bec7, -3px -3px 6px #ffffff",md:"5px 5px 10px #b8bec7, -5px -5px 10px #ffffff",lg:"8px 8px 16px #b8bec7, -8px -8px 16px #ffffff",xl:"12px 12px 24px #b8bec7, -12px -12px 24px #ffffff"},spacing:we,typography:ke,transitions:Me},gs={name:"Neumorphism Dark",darkMode:"dark",colors:{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee",surface:"#283141",surfaceHover:"#232b3a"},backgrounds:{primary:"#2d3748",secondary:"#283141",tertiary:"#232b3a",hover:"#283141",elevated:"#283141",inset:"#2d3748",canvas:"#2d3748"},text:{primary:"#e2e8f0",secondary:"#a0aec0",muted:"#718096",inverse:"#0f172a"},borders:{color:"#3a4556",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #1a202c, -3px -3px 6px #404d64",md:"5px 5px 10px #1a202c, -5px -5px 10px #404d64",lg:"8px 8px 16px #1a202c, -8px -8px 16px #404d64",xl:"12px 12px 24px #1a202c, -12px -12px 24px #404d64"},spacing:we,typography:ke,transitions:Me},ys=I("Minimalist",{primary:"#18181b",primaryHover:"#27272a",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"},{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f5f5f5"},{primary:"#0a0a0a",secondary:"#404040",muted:"#a3a3a3"},"#e5e5e5"),hs=O("Warm Dark",{primary:"#f59e0b",primaryHover:"#d97706",success:"#10b981",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#1c1917",secondary:"#292524",tertiary:"#44403c",hover:"#44403c"},{primary:"#fafaf9",secondary:"#d6d3d1",muted:"#78716c"},"#57534e"),bs=O("Soft Dark",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#34d399",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#1e1e2e",secondary:"#262637",tertiary:"#313147",hover:"#313147"},{primary:"#e8e8f0",secondary:"#a0a0b8",muted:"#5c5c74"},"#3e3e58"),vs=I("Coffee",{primary:"#6f4e37",primaryHover:"#5c3d28",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf6f1",secondary:"#f0e8dc",tertiary:"#e6d8c6",hover:"#f0e8dc"},{primary:"#2c1a0e",secondary:"#5c3d28",muted:"#a08868"},"#d4c4a8"),Ss=I("Wine",{primary:"#7f1d1d",primaryHover:"#641717",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),xs=[Na,La,Ta,Ra,Ia,za,Da,Pa,Fa,Ha,$a,ja,Ba,Oa,_a,Wa,Va,Xa,Ua,qa,Ga,Ka,Ja,Ya,Qa,Za,en,tn,rn,an,nn,sn,on,cn,ln,dn,un,fn,mn,pn,gn,yn,hn,bn,vn,Sn,xn,wn,kn,Mn,Cn,An,En,Nn,Ln,Tn,Rn,In,zn,Dn,Pn,Fn,Hn,$n,jn,Bn,On,_n,Wn,Vn,Xn,Un,qn,Gn,Kn,Jn,Yn,Qn,Zn,es,ts,rs,as,ns,ss,os,is,cs,ls,ds,us,fs,ms,ps,gs,ys,hs,bs,vs,Ss],le={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Ue={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Ce={color:"#e2e8f0",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},Ae={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},zt={name:"Light",darkMode:"light",colors:{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#f8fafc"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:Ce,shadows:{sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},spacing:le,typography:Ue,transitions:Ae},ws={name:"Dark",darkMode:"dark",colors:{primary:"#3b82f6",primaryHover:"#60a5fa",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4",surface:"#141414",surfaceHover:"#1e1e1e"},backgrounds:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1e1e1e",hover:"#1a1a1a",elevated:"#141414",inset:"#0a0a0a",canvas:"#0a0a0a"},text:{primary:"#ffffff",secondary:"#a1a1a1",muted:"#6b6b6b",inverse:"#0f172a"},borders:{...Ce,color:"#2a2a2a"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 6px -1px rgba(0,0,0,0.6)",lg:"0 10px 15px -3px rgba(0,0,0,0.6)",xl:"0 20px 25px -5px rgba(0,0,0,0.6)"},spacing:le,typography:Ue,transitions:Ae},ks={name:"Blue",colors:{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#eff6ff",surfaceHover:"#dbeafe"},backgrounds:{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe",elevated:"#ffffff",inset:"#dbeafe",canvas:"#eff6ff"},text:{primary:"#1e3a5f",secondary:"#3b628a",muted:"#7da0c4",inverse:"#ffffff"},borders:{...Ce,color:"#93c5fd"},shadows:{sm:"0 1px 2px rgba(29,78,216,0.08)",md:"0 4px 6px -1px rgba(29,78,216,0.12)",lg:"0 10px 15px -3px rgba(29,78,216,0.15)",xl:"0 20px 25px -5px rgba(29,78,216,0.18)"},spacing:le,typography:Ue,transitions:Ae},Ms={name:"High Contrast",colors:{primary:"#0000ff",primaryHover:"#0000cc",success:"#008000",warning:"#ff8c00",error:"#ff0000",info:"#008b8b",surface:"#ffffff",surfaceHover:"#f0f0f0"},backgrounds:{primary:"#ffffff",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0",elevated:"#ffffff",inset:"#e0e0e0",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#4d4d4d",inverse:"#ffffff"},borders:{...Ce,color:"#000000"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.15)",md:"0 4px 6px rgba(0,0,0,0.2)",lg:"0 10px 15px rgba(0,0,0,0.25)",xl:"0 20px 25px rgba(0,0,0,0.3)"},spacing:le,typography:Ue,transitions:Ae},Cs={name:"Material",colors:{primary:"#6750a4",primaryHover:"#4f378b",success:"#386a20",warning:"#7c5800",error:"#ba1a1a",info:"#00629e",surface:"#fffbfe",surfaceHover:"#f6edff"},backgrounds:{primary:"#fffbfe",secondary:"#f6edff",tertiary:"#ece6f0",hover:"#eaddff",elevated:"#ffffff",inset:"#ece6f0",canvas:"#fffbfe"},text:{primary:"#1c1b1f",secondary:"#49454f",muted:"#79747e",inverse:"#ffffff"},borders:{...Ce,color:"#cac4d0",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"28px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15)",md:"0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15)",lg:"0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3)",xl:"0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3)"},spacing:le,typography:{fontFamily:"'Roboto', 'Noto Sans', system-ui, sans-serif",fontSizeXs:"0.6875rem",fontSizeSm:"0.75rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:{fast:"100ms cubic-bezier(0.2,0,0,1)",normal:"200ms cubic-bezier(0.2,0,0,1)",slow:"300ms cubic-bezier(0.2,0,0,1)"}},As={name:"Bootstrap",colors:{primary:"#0d6efd",primaryHover:"#0b5ed7",success:"#198754",warning:"#ffc107",error:"#dc3545",info:"#0dcaf0",surface:"#ffffff",surfaceHover:"#f8f9fa"},backgrounds:{primary:"#ffffff",secondary:"#f8f9fa",tertiary:"#e9ecef",hover:"#e9ecef",elevated:"#ffffff",inset:"#e9ecef",canvas:"#f8f9fa"},text:{primary:"#212529",secondary:"#6c757d",muted:"#adb5bd",inverse:"#ffffff"},borders:{color:"#dee2e6",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"16px",radiusFull:"50rem"},shadows:{sm:"0 0.125rem 0.25rem rgba(0,0,0,0.075)",md:"0 0.5rem 1rem rgba(0,0,0,0.15)",lg:"0 1rem 3rem rgba(0,0,0,0.175)",xl:"0 1rem 3rem rgba(0,0,0,0.25)"},spacing:le,typography:{fontFamily:"system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:Ae},Es={name:"Fluent",colors:{primary:"#0078d4",primaryHover:"#106ebe",success:"#107c10",warning:"#fce100",error:"#d13438",info:"#00b7c3",surface:"#ffffff",surfaceHover:"#faf9f8"},backgrounds:{primary:"#ffffff",secondary:"#faf9f8",tertiary:"#f3f2f1",hover:"#edebe9",elevated:"#ffffff",inset:"#f3f2f1",canvas:"#faf9f8"},text:{primary:"#323130",secondary:"#605e5c",muted:"#a19f9d",inverse:"#ffffff"},borders:{color:"#e1dfdd",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108)",md:"0 3.2px 7.2px 0 rgba(0,0,0,0.132), 0 0.6px 1.8px 0 rgba(0,0,0,0.108)",lg:"0 6.4px 14.4px 0 rgba(0,0,0,0.132), 0 1.2px 3.6px 0 rgba(0,0,0,0.108)",xl:"0 25.6px 57.6px 0 rgba(0,0,0,0.22), 0 4.8px 14.4px 0 rgba(0,0,0,0.18)"},spacing:le,typography:{fontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",fontSizeXs:"10px",fontSizeSm:"12px",fontSizeMd:"14px",fontSizeLg:"16px",fontSizeXl:"20px",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.42857},transitions:{fast:"100ms cubic-bezier(0.1,0.9,0.2,1)",normal:"200ms cubic-bezier(0.1,0.9,0.2,1)",slow:"300ms cubic-bezier(0.1,0.9,0.2,1)"}},lt=[zt,ws,ks,Ms,Cs,As,Es,...xs],Dd=["https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap","https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Archivo+Black&family=Archivo:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Work+Sans:wght@400;500;600&display=swap","https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&display=swap","https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;600&display=swap","https://fonts.googleapis.com/css2?family=Libre+Caslon+Text:wght@400;700&family=DM+Sans:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap"],Pd={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},ne={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Dt={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},Ns={meta:{id:"obsidianEditorial",name:"Obsidian Editorial",tagline:"Dark-mode magazine — serif display, razor borders, grain.",tags:["dark","editorial","serif"]},theme:{name:"Obsidian Editorial",darkMode:"dark",colors:{primary:"#e8dcc4",primaryHover:"#d4c29c",success:"#7fb069",warning:"#e6aa68",error:"#d65a5a",info:"#88aabb",accent:"#c98a5b",focus:"#e8dcc4",surface:"#1a1715",surfaceHover:"#221e1b"},backgrounds:{primary:"#0e0c0b",secondary:"#1a1715",tertiary:"#221e1b",hover:"#2a2522",elevated:"#1a1715",inset:"#0b0908",canvas:"#0e0c0b"},text:{primary:"#ede4d1",secondary:"#a39787",muted:"#6b6055",inverse:"#0e0c0b"},borders:{color:"#332d28",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px",width:"1px",divider:"#28231f"},shadows:{sm:"none",md:"0 1px 0 0 rgba(232,220,196,0.04)",lg:"0 2px 0 0 rgba(232,220,196,0.06)",xl:"0 4px 0 0 rgba(232,220,196,0.08)"},spacing:Dt,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Fraunces', 'Playfair Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', ui-monospace, monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.005em",headingLetterSpacing:"-0.02em"},transitions:{fast:"80ms cubic-bezier(0.4,0,0.2,1)",normal:"140ms cubic-bezier(0.4,0,0.2,1)",slow:"220ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.35,blendMode:"overlay"}},displayStyle:"editorial",variantConfig:{density:"comfortable",animation:"subtle"}},Ls={meta:{id:"neonArcade",name:"Neon Arcade",tagline:"Phosphor-green terminal glow on absolute black.",tags:["dark","retro","mono","terminal"]},theme:{name:"Neon Arcade",darkMode:"dark",colors:{primary:"#39ff14",primaryHover:"#50ff35",success:"#39ff14",warning:"#ffcc00",error:"#ff3355",info:"#00e5ff",accent:"#ff00aa",focus:"#39ff14",surface:"#060a06",surfaceHover:"#0b140b"},backgrounds:{primary:"#000000",secondary:"#060a06",tertiary:"#0b140b",hover:"#12241a",elevated:"#060a06",inset:"#000000",canvas:"#000000"},text:{primary:"#c8ffb8",secondary:"#7be368",muted:"#3e7a39",inverse:"#000000"},borders:{color:"#1d3a1d",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0",width:"1px",divider:"#143014",focusColor:"#39ff14"},shadows:{sm:"0 0 4px rgba(57,255,20,0.3)",md:"0 0 10px rgba(57,255,20,0.35), 0 0 2px rgba(57,255,20,0.6)",lg:"0 0 22px rgba(57,255,20,0.4), 0 0 4px rgba(57,255,20,0.7)",xl:"0 0 40px rgba(57,255,20,0.5), 0 0 8px rgba(57,255,20,0.8)",glow:"0 0 30px #39ff14, 0 0 60px rgba(57,255,20,0.4)"},spacing:ne,typography:{fontFamily:"'JetBrains Mono', 'Fira Code', ui-monospace, monospace",headingFontFamily:"'JetBrains Mono', monospace",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.08em"},transitions:{fast:"60ms steps(4, end)",normal:"120ms steps(6, end)",slow:"200ms steps(8, end)"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.25}},displayStyle:"terminal",variantConfig:{radius:"none",shadow:"glow",density:"compact",animation:"subtle"}},Ts={meta:{id:"hyggeScandinavian",name:"Hygge Scandinavian",tagline:"Warm cream, generous breathing room, soft serif display.",tags:["light","warm","serif","spacious"]},theme:{name:"Hygge Scandinavian",darkMode:"light",colors:{primary:"#8b6f47",primaryHover:"#6f5738",success:"#6b8e4e",warning:"#d49a3e",error:"#b84c4c",info:"#6a8aad",accent:"#c98754",focus:"#8b6f47",surface:"#fbf6ed",surfaceHover:"#f3ecdf"},backgrounds:{primary:"#fdf9f1",secondary:"#f5eee0",tertiary:"#ede3d0",hover:"#e8ddc8",elevated:"#ffffff",inset:"#f0e7d4",canvas:"#fdf9f1"},text:{primary:"#3a2f22",secondary:"#6a5845",muted:"#9c8c76",inverse:"#fdf9f1"},borders:{color:"#d9cbb0",radiusSm:"8px",radiusMd:"14px",radiusLg:"22px",radiusXl:"32px",radiusFull:"9999px",width:"1px",divider:"#e8ddc8"},shadows:{sm:"0 1px 2px rgba(122,92,58,0.05)",md:"0 6px 16px -4px rgba(122,92,58,0.08)",lg:"0 16px 32px -10px rgba(122,92,58,0.10)",xl:"0 28px 56px -18px rgba(122,92,58,0.14)"},spacing:Dt,typography:{fontFamily:"'Work Sans', -apple-system, sans-serif",headingFontFamily:"'Cormorant Garamond', Georgia, serif",monoFontFamily:"ui-monospace, 'SF Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.7,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"160ms cubic-bezier(0.16,1,0.3,1)",normal:"260ms cubic-bezier(0.16,1,0.3,1)",slow:"400ms cubic-bezier(0.16,1,0.3,1)"}},displayStyle:"scandinavian",variantConfig:{density:"spacious",animation:"normal"}},Rs={meta:{id:"brutalistRaw",name:"Brutalist Raw",tagline:"Paper + ink + hard shadows — zero blur, zero mercy.",tags:["light","brutalist","experimental"]},theme:{name:"Brutalist Raw",darkMode:"light",colors:{primary:"#ff3b30",primaryHover:"#000000",success:"#00aa55",warning:"#ffcc00",error:"#ff0000",info:"#0066ff",accent:"#ffcc00",focus:"#ff3b30",surface:"#ffffff",surfaceHover:"#f5f3ee"},backgrounds:{primary:"#f5f3ee",secondary:"#ffffff",tertiary:"#e8e4d8",hover:"#e0dcd0",elevated:"#ffffff",inset:"#e8e4d8",canvas:"#f5f3ee"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#555555",inverse:"#ffffff"},borders:{color:"#000000",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0",width:"2px",divider:"#000000"},shadows:{sm:"3px 3px 0 0 #000000",md:"6px 6px 0 0 #000000",lg:"10px 10px 0 0 #000000",xl:"14px 14px 0 0 #000000"},spacing:ne,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Archivo Black', 'Archivo', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:500,fontWeightMedium:700,fontWeightSemibold:700,fontWeightBold:900,lineHeight:1.4,letterSpacing:"-0.01em",headingLetterSpacing:"-0.04em"},transitions:{fast:"0ms linear",normal:"80ms cubic-bezier(0.2,0,0,1)",slow:"140ms cubic-bezier(0.2,0,0,1)"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"subtle"}},Is={meta:{id:"glassAurora",name:"Glass Aurora",tagline:"Frosted translucency floating over aurora light.",tags:["light","glass","modern","gradient"]},theme:{name:"Glass Aurora",darkMode:"light",colors:{primary:"#5b5bff",primaryHover:"#4343e8",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",accent:"#ec4899",focus:"#5b5bff",surface:"rgba(255,255,255,0.55)",surfaceHover:"rgba(255,255,255,0.75)"},backgrounds:{primary:"rgba(255,255,255,0.55)",secondary:"rgba(255,255,255,0.35)",tertiary:"rgba(255,255,255,0.22)",hover:"rgba(255,255,255,0.7)",elevated:"rgba(255,255,255,0.8)",inset:"rgba(255,255,255,0.3)",canvas:"#e8d6ff"},text:{primary:"#1a1440",secondary:"#443c78",muted:"#8b83b8",inverse:"#ffffff"},borders:{color:"rgba(255,255,255,0.6)",radiusSm:"10px",radiusMd:"16px",radiusLg:"24px",radiusXl:"36px",radiusFull:"9999px",width:"1px",divider:"rgba(255,255,255,0.4)"},shadows:{sm:"0 2px 12px rgba(91,91,255,0.08)",md:"0 8px 32px rgba(91,91,255,0.12)",lg:"0 18px 56px rgba(236,72,153,0.18)",xl:"0 32px 80px rgba(91,91,255,0.22)"},spacing:ne,typography:{fontFamily:"'Outfit', -apple-system, sans-serif",headingFontFamily:"'Outfit', sans-serif",monoFontFamily:"ui-monospace, monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"-0.005em",headingLetterSpacing:"-0.025em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"400ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 12% 18%, #ffd6e8 0%, transparent 48%), radial-gradient(at 88% 22%, #c8d8ff 0%, transparent 52%), radial-gradient(at 42% 86%, #d8ffe8 0%, transparent 50%), linear-gradient(180deg, #eee4ff 0%, #ffe8f2 100%)"}},displayStyle:"glass",variantConfig:{density:"normal",animation:"normal"}},zs={meta:{id:"candyPop",name:"Candy Pop",tagline:"Bubblegum pastels, pill shapes, bouncy easing.",tags:["light","playful","pastel","pill"]},theme:{name:"Candy Pop",darkMode:"light",colors:{primary:"#ff4fa3",primaryHover:"#ff2d8e",success:"#3dd68c",warning:"#ffd63d",error:"#ff5577",info:"#4ec8ff",accent:"#b85bff",focus:"#ff4fa3",surface:"#ffffff",surfaceHover:"#fff5fa"},backgrounds:{primary:"#fff5fa",secondary:"#ffeaf3",tertiary:"#ffd8e9",hover:"#ffc4dc",elevated:"#ffffff",inset:"#ffeaf3",canvas:"#fff8f5"},text:{primary:"#531645",secondary:"#8b3a70",muted:"#c678a8",inverse:"#ffffff"},borders:{color:"#ffc4dc",radiusSm:"9999px",radiusMd:"9999px",radiusLg:"9999px",radiusXl:"9999px",radiusFull:"9999px",width:"2px",divider:"#ffd8e9"},shadows:{sm:"0 2px 0 0 #ffc4dc",md:"0 4px 0 0 #ffa3c7",lg:"0 6px 16px rgba(255,79,163,0.2), 0 3px 0 0 #ff4fa3",xl:"0 12px 28px rgba(255,79,163,0.25)"},spacing:ne,typography:{fontFamily:"'Quicksand', -apple-system, sans-serif",headingFontFamily:"'Nunito', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"140ms cubic-bezier(0.34,1.56,0.64,1)",normal:"240ms cubic-bezier(0.34,1.56,0.64,1)",slow:"380ms cubic-bezier(0.34,1.56,0.64,1)"}},displayStyle:"pill",variantConfig:{radius:"full",density:"comfortable",animation:"playful"}},Ds={meta:{id:"newspaperBroadsheet",name:"Newspaper Broadsheet",tagline:"Ivory paper, hairline rules, serif gravity.",tags:["light","editorial","serif","print"]},theme:{name:"Newspaper Broadsheet",darkMode:"light",colors:{primary:"#1a1a1a",primaryHover:"#000000",success:"#2d5016",warning:"#8b6914",error:"#8b0000",info:"#1d3a5f",accent:"#8b0000",focus:"#1a1a1a",surface:"#fbf7ee",surfaceHover:"#f3ecdd"},backgrounds:{primary:"#fbf7ee",secondary:"#f5eedb",tertiary:"#ede4cc",hover:"#e8ddbe",elevated:"#fbf7ee",inset:"#f0e7d0",canvas:"#fbf7ee"},text:{primary:"#14110c",secondary:"#3d362a",muted:"#7a6f58",inverse:"#fbf7ee"},borders:{color:"#14110c",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px",width:"1px",divider:"#14110c"},shadows:{sm:"none",md:"none",lg:"none",xl:"none"},spacing:ne,typography:{fontFamily:"'Fraunces', 'Source Serif Pro', Georgia, serif",headingFontFamily:"'Fraunces', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.01em",headingLetterSpacing:"-0.025em"},transitions:{fast:"0ms",normal:"100ms linear",slow:"180ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.18,blendMode:"multiply"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"none",density:"normal"}},Ps={meta:{id:"synthwave84",name:"Synthwave 84",tagline:"Magenta & cyan pulse over deep navy — 1984 forever.",tags:["dark","retro","neon","80s"]},theme:{name:"Synthwave 84",darkMode:"dark",colors:{primary:"#ff3ca8",primaryHover:"#ff6bc1",success:"#72f1b8",warning:"#ffcc33",error:"#fe4450",info:"#36f9f6",accent:"#36f9f6",focus:"#ff3ca8",surface:"#2a1a4f",surfaceHover:"#332260"},backgrounds:{primary:"#1a0933",secondary:"#241443",tertiary:"#2d1a52",hover:"#382266",elevated:"#2a1a4f",inset:"#120626",canvas:"#0e0524"},text:{primary:"#f5e8ff",secondary:"#c9a7ff",muted:"#8063b0",inverse:"#0e0524"},borders:{color:"#553388",radiusSm:"2px",radiusMd:"4px",radiusLg:"6px",radiusXl:"8px",radiusFull:"9999px",width:"1px",divider:"#3d2270",focusColor:"#36f9f6"},shadows:{sm:"0 0 8px rgba(255,60,168,0.4)",md:"0 0 18px rgba(255,60,168,0.45), 0 2px 0 0 #36f9f6",lg:"0 0 36px rgba(255,60,168,0.55), 0 4px 0 0 #36f9f6",xl:"0 0 60px rgba(255,60,168,0.6), 0 6px 0 0 #36f9f6",glow:"0 0 28px #ff3ca8, 0 0 56px rgba(255,60,168,0.5)"},spacing:ne,typography:{fontFamily:"'Rajdhani', -apple-system, sans-serif",headingFontFamily:"'Orbitron', 'Rajdhani', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:900,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.08em"},transitions:{fast:"120ms cubic-bezier(0.23,1,0.32,1)",normal:"200ms cubic-bezier(0.23,1,0.32,1)",slow:"360ms cubic-bezier(0.23,1,0.32,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #0e0524 0%, #1a0933 55%, #2d1a52 100%), repeating-linear-gradient(0deg, rgba(54,249,246,0.04) 0 1px, transparent 1px 3px)"}},displayStyle:"synthwave",variantConfig:{shadow:"glow",animation:"dramatic",density:"normal"}},Fs={meta:{id:"zenMinimal",name:"Zen Minimal",tagline:"Whisper-light type, hairlines, oceans of whitespace.",tags:["light","minimal","airy"]},theme:{name:"Zen Minimal",darkMode:"light",colors:{primary:"#0a0a0a",primaryHover:"#262626",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#2563eb",accent:"#737373",focus:"#0a0a0a",surface:"#ffffff",surfaceHover:"#fafafa"},backgrounds:{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f0f0f0",elevated:"#ffffff",inset:"#fafafa",canvas:"#ffffff"},text:{primary:"#171717",secondary:"#525252",muted:"#a3a3a3",inverse:"#ffffff"},borders:{color:"#ededed",radiusSm:"2px",radiusMd:"3px",radiusLg:"4px",radiusXl:"6px",radiusFull:"9999px",width:"1px",divider:"#f0f0f0"},shadows:{sm:"none",md:"0 0 0 1px rgba(0,0,0,0.04)",lg:"0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.05)",xl:"0 4px 8px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.06)"},spacing:Dt,typography:{fontFamily:"'Manrope', -apple-system, sans-serif",headingFontFamily:"'Manrope', sans-serif",monoFontFamily:"ui-monospace, monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.6,letterSpacing:"-0.005em",headingLetterSpacing:"-0.03em"},transitions:{fast:"100ms ease",normal:"180ms ease",slow:"280ms ease"}},displayStyle:"minimal",variantConfig:{density:"spacious",animation:"subtle"}},Hs={meta:{id:"claymorphism",name:"Claymorphism",tagline:"Soft-clay 3D surfaces — pressable, friendly, tactile.",tags:["light","playful","neumorphic","3d"]},theme:{name:"Claymorphism",darkMode:"light",colors:{primary:"#8b7ef5",primaryHover:"#7469ec",success:"#6ed6a5",warning:"#ffc771",error:"#ff8b8b",info:"#7ec4f5",accent:"#ffb3d9",focus:"#8b7ef5",surface:"#f3efff",surfaceHover:"#ebe4ff"},backgrounds:{primary:"#f6f0ff",secondary:"#ede4ff",tertiary:"#dfd3fc",hover:"#d3c5fa",elevated:"#ffffff",inset:"#e5daff",canvas:"#f6f0ff"},text:{primary:"#2a1f5e",secondary:"#584a8e",muted:"#9388bd",inverse:"#ffffff"},borders:{color:"rgba(139,126,245,0.15)",radiusSm:"14px",radiusMd:"22px",radiusLg:"32px",radiusXl:"48px",radiusFull:"9999px",width:"0px",divider:"rgba(139,126,245,0.12)"},shadows:{sm:"-3px -3px 6px rgba(255,255,255,0.8), 3px 3px 8px rgba(139,126,245,0.18), inset 0 0 0 rgba(255,255,255,0)",md:"-5px -5px 12px rgba(255,255,255,0.9), 6px 6px 18px rgba(139,126,245,0.22), inset 1px 1px 1px rgba(255,255,255,0.6)",lg:"-8px -8px 20px rgba(255,255,255,0.95), 10px 10px 32px rgba(139,126,245,0.28), inset 2px 2px 2px rgba(255,255,255,0.7)",xl:"-14px -14px 32px rgba(255,255,255,1), 16px 16px 48px rgba(139,126,245,0.34), inset 3px 3px 4px rgba(255,255,255,0.8)",inner:"inset 4px 4px 10px rgba(139,126,245,0.2), inset -4px -4px 10px rgba(255,255,255,0.9)"},spacing:ne,typography:{fontFamily:"'Nunito', -apple-system, sans-serif",headingFontFamily:"'Nunito', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.015em"},transitions:{fast:"160ms cubic-bezier(0.4,0,0.2,1.4)",normal:"260ms cubic-bezier(0.4,0,0.2,1.4)",slow:"400ms cubic-bezier(0.4,0,0.2,1.4)"}},displayStyle:"neumorphic",variantConfig:{radius:"2xl",density:"comfortable",animation:"normal"}},$s={meta:{id:"bauhaus",name:"Bauhaus",tagline:"Primary palette, geometric rigour, grid as foundation.",tags:["light","geometric","primary","design"]},theme:{name:"Bauhaus",darkMode:"light",colors:{primary:"#d62828",primaryHover:"#a81e1e",success:"#2a9d8f",warning:"#fcbf49",error:"#d62828",info:"#1d4e89",accent:"#fcbf49",focus:"#1d4e89",surface:"#faf5e8",surfaceHover:"#f2ead3"},backgrounds:{primary:"#faf5e8",secondary:"#f5ecd3",tertiary:"#ede0be",hover:"#e5d5a8",elevated:"#ffffff",inset:"#f0e3c0",canvas:"#faf5e8"},text:{primary:"#1a1a1a",secondary:"#3d3d3d",muted:"#7a7a7a",inverse:"#faf5e8"},borders:{color:"#1a1a1a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px",width:"3px",divider:"#1a1a1a"},shadows:{sm:"0 2px 0 0 #1a1a1a",md:"4px 4px 0 0 #1a1a1a",lg:"6px 6px 0 0 #1d4e89",xl:"8px 8px 0 0 #d62828"},spacing:ne,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Archivo Black', 'Archivo', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:500,fontWeightMedium:700,fontWeightSemibold:800,fontWeightBold:900,lineHeight:1.4,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"60ms linear",normal:"120ms linear",slow:"200ms linear"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.35}},displayStyle:"bauhaus",variantConfig:{radius:"none",shadow:"md",density:"normal",animation:"subtle"}},js={meta:{id:"bankVault",name:"Bank Vault",tagline:"Navy, gilt accents, serif gravitas — trusted by institutions.",tags:["light","corporate","serif","conservative"]},theme:{name:"Bank Vault",darkMode:"light",colors:{primary:"#0b2545",primaryHover:"#163969",success:"#2d6a4f",warning:"#b08d2e",error:"#8b1a1a",info:"#1d4e89",accent:"#b08d2e",focus:"#0b2545",surface:"#ffffff",surfaceHover:"#f7f4ec"},backgrounds:{primary:"#fbfaf6",secondary:"#f4f0e4",tertiary:"#ebe5d2",hover:"#e3dcc4",elevated:"#ffffff",inset:"#efeadb",canvas:"#fbfaf6"},text:{primary:"#0b2545",secondary:"#3a4b65",muted:"#7a8399",inverse:"#fbfaf6"},borders:{color:"#c9bfa3",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px",width:"1px",divider:"#d4c9a8"},shadows:{sm:"0 1px 0 0 rgba(11,37,69,0.08)",md:"0 1px 3px rgba(11,37,69,0.08), 0 0 0 1px rgba(176,141,46,0.12)",lg:"0 4px 10px rgba(11,37,69,0.1)",xl:"0 12px 24px rgba(11,37,69,0.12)"},spacing:Pd,typography:{fontFamily:"'DM Sans', -apple-system, sans-serif",headingFontFamily:"'Libre Caslon Text', 'DM Serif Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0.005em",headingLetterSpacing:"-0.01em"},transitions:{fast:"90ms cubic-bezier(0.4,0,0.2,1)",normal:"160ms cubic-bezier(0.4,0,0.2,1)",slow:"260ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"bank",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"none"}},Pt={obsidianEditorial:Ns,neonArcade:Ls,hyggeScandinavian:Ts,brutalistRaw:Rs,glassAurora:Is,candyPop:zs,newspaperBroadsheet:Ds,synthwave84:Ps,zenMinimal:Fs,claymorphism:Hs,bauhaus:$s,bankVault:js},Bs=Object.values(Pt);function Fd(e){return Pt[e]}function Hd(e){return Bs.filter(t=>t.meta.tags.includes(e))}const $d=["https://fonts.googleapis.com/css2?family=Spectral:wght@300;400;500;600;700&family=Lora:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;500;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Poiret+One&family=Cormorant+Garamond:wght@300;400;500;600&display=swap","https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Roboto+Condensed:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Space+Mono:wght@400;700&display=swap","https://fonts.googleapis.com/css2?family=VT323&display=swap","https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Special+Elite&display=swap","https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&display=swap","https://fonts.googleapis.com/css2?family=Bangers&display=swap","https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap","https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Rubik+Mono+One&family=Rubik:wght@400;500;700;800&display=swap"],Os={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},X={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Ee={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},qe={space1:"8px",space2:"16px",space3:"24px",space4:"32px",space5:"44px",space6:"56px",space8:"80px"},_s={meta:{id:"forestCanopy",name:"Forest Canopy",tagline:"Moss on bark, dappled light — organic radii, earth serif.",tags:["light","nature","serif","organic"]},theme:{name:"Forest Canopy",darkMode:"light",recommendedDisplayStyle:"scandinavian",colors:{primary:"#3d5a40",primaryHover:"#2d4430",success:"#4a7c3a",warning:"#c88d3e",error:"#a63c3c",info:"#5a7c8a",accent:"#8ba878",focus:"#3d5a40",surface:"#f4f1e8",surfaceHover:"#ebe7d5"},backgrounds:{primary:"#f7f4e9",secondary:"#ede8d4",tertiary:"#dfd8be",hover:"#d5cdae",elevated:"#fcfaf1",inset:"#e5ddc5",canvas:"#f0ece0"},text:{primary:"#1e2a1c",secondary:"#3d4a36",muted:"#7a8570",inverse:"#f7f4e9"},borders:{color:"#c4bda0",width:"1px",divider:"#d8d0b5",radiusSm:"3px",radiusMd:"7px",radiusLg:"14px",radiusXl:"22px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(61,90,64,0.06)",md:"0 4px 12px -2px rgba(61,90,64,0.12), 0 2px 4px rgba(61,90,64,0.05)",lg:"0 10px 24px -6px rgba(61,90,64,0.16)",xl:"0 20px 40px -12px rgba(61,90,64,0.22)"},spacing:Ee,typography:{fontFamily:"'Lora', Georgia, serif",headingFontFamily:"'Spectral', 'Lora', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.7,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"180ms cubic-bezier(0.16,1,0.3,1)",normal:"280ms cubic-bezier(0.16,1,0.3,1)",slow:"420ms cubic-bezier(0.16,1,0.3,1)"},backgroundImage:{type:"pattern",pattern:"dots",opacity:.25}},displayStyle:"scandinavian",variantConfig:{density:"spacious",animation:"normal"}},Ws={meta:{id:"desertDune",name:"Desert Dune",tagline:"Ochre horizons, warm grain, serif that suns itself.",tags:["light","nature","serif","warm"]},theme:{name:"Desert Dune",darkMode:"light",recommendedDisplayStyle:"softCloud",colors:{primary:"#c8732f",primaryHover:"#a65a1c",success:"#7a8c3a",warning:"#e0a83a",error:"#b34747",info:"#7a8fa6",accent:"#e8a863",focus:"#c8732f",surface:"#fbf3e5",surfaceHover:"#f4e8d0"},backgrounds:{primary:"#fdf7ea",secondary:"#f6ebd3",tertiary:"#eeddb6",hover:"#e5cfa0",elevated:"#ffffff",inset:"#f0dfb8",canvas:"#fdf5e6"},text:{primary:"#3a2413",secondary:"#6b4823",muted:"#a88860",inverse:"#fdf7ea"},borders:{color:"#dcc08c",width:"1px",divider:"#e8d0a5",radiusSm:"12px",radiusMd:"18px",radiusLg:"28px",radiusXl:"40px",radiusFull:"9999px"},shadows:{sm:"0 2px 6px -2px rgba(200,115,47,0.1)",md:"0 8px 20px -6px rgba(200,115,47,0.15)",lg:"0 18px 36px -10px rgba(200,115,47,0.2)",xl:"0 32px 56px -18px rgba(200,115,47,0.28)"},spacing:Ee,typography:{fontFamily:"'DM Sans', -apple-system, sans-serif",headingFontFamily:"'DM Serif Display', Georgia, serif",monoFontFamily:"'Space Mono', ui-monospace, monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0",headingLetterSpacing:"-0.025em"},transitions:{fast:"160ms ease-out",normal:"280ms cubic-bezier(0.22,1,0.36,1)",slow:"460ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(175deg, #fbecc5 0%, #f6ddaf 40%, #eec28a 100%), radial-gradient(ellipse at 80% 10%, #fff4d9 0%, transparent 60%)"}},displayStyle:"softCloud",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},Vs={meta:{id:"arcticCrystal",name:"Arctic Crystal",tagline:"Facets of ice, lean typography, surgical whitespace.",tags:["light","nature","minimal","cold"]},theme:{name:"Arctic Crystal",darkMode:"light",recommendedDisplayStyle:"minimal",colors:{primary:"#2a6a8c",primaryHover:"#1e5374",success:"#4a8a6a",warning:"#d0a040",error:"#c24848",info:"#5a9fc0",accent:"#a8d4e8",focus:"#2a6a8c",surface:"#ffffff",surfaceHover:"#f0f6fa"},backgrounds:{primary:"#f5fafd",secondary:"#eaf2f7",tertiary:"#d8e5ed",hover:"#cfdce6",elevated:"#ffffff",inset:"#e3eef5",canvas:"#f0f7fb"},text:{primary:"#0a2030",secondary:"#3a5468",muted:"#7a95a8",inverse:"#ffffff"},borders:{color:"#cfdde8",width:"1px",divider:"#e0ebf3",radiusSm:"2px",radiusMd:"3px",radiusLg:"4px",radiusXl:"6px",radiusFull:"9999px"},shadows:{sm:"1px 1px 0 rgba(42,106,140,0.06), -1px 0 0 rgba(42,106,140,0.04)",md:"2px 2px 0 rgba(42,106,140,0.08), -2px 0 0 rgba(42,106,140,0.04), 0 4px 8px -2px rgba(42,106,140,0.1)",lg:"4px 4px 0 rgba(42,106,140,0.1), 0 10px 16px -4px rgba(42,106,140,0.14)",xl:"0 24px 40px -12px rgba(42,106,140,0.2)"},spacing:qe,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Inter', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:200,fontWeightMedium:300,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.6,letterSpacing:"0.01em",headingLetterSpacing:"-0.02em"},transitions:{fast:"90ms ease",normal:"160ms ease",slow:"260ms ease"}},displayStyle:"minimal",variantConfig:{radius:"sm",shadow:"subtle",density:"spacious",animation:"subtle"}},Xs={meta:{id:"autumnFoliage",name:"Autumn Foliage",tagline:"Ember glow, Fraunces serif, woodsmoke warmth.",tags:["light","nature","serif","warm"]},theme:{name:"Autumn Foliage",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#a83828",primaryHover:"#842818",success:"#6b7c2c",warning:"#c48020",error:"#8a2020",info:"#7a5a3a",accent:"#d89040",focus:"#a83828",surface:"#fbf1e3",surfaceHover:"#f2e4ce"},backgrounds:{primary:"#fdf5e8",secondary:"#f4e5cc",tertiary:"#e8d2aa",hover:"#dec295",elevated:"#fff9ee",inset:"#eedab5",canvas:"#faeed6"},text:{primary:"#2a140a",secondary:"#5a3020",muted:"#997860",inverse:"#fdf5e8"},borders:{color:"#d4b890",width:"1px",divider:"#e0c8a0",radiusSm:"4px",radiusMd:"8px",radiusLg:"14px",radiusXl:"22px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(168,56,40,0.08)",md:"0 4px 10px -2px rgba(168,56,40,0.12), 0 2px 4px rgba(168,56,40,0.08)",lg:"0 12px 24px -6px rgba(168,56,40,0.18)",xl:"0 24px 48px -16px rgba(168,56,40,0.24)"},spacing:X,typography:{fontFamily:"'Work Sans', sans-serif",headingFontFamily:"'Fraunces', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.005em",headingLetterSpacing:"-0.02em"},transitions:{fast:"140ms ease",normal:"220ms ease",slow:"360ms ease"}},displayStyle:"editorial",variantConfig:{density:"comfortable",animation:"normal"}},Us={meta:{id:"japaneseWashi",name:"Japanese Washi",tagline:"Sumi ink on cream — quiet serif, paper grain, zero excess.",tags:["light","cultural","serif","minimal"]},theme:{name:"Japanese Washi",darkMode:"light",recommendedDisplayStyle:"zen",colors:{primary:"#1d3557",primaryHover:"#0d2545",success:"#4a7042",warning:"#a8803e",error:"#8b2a2a",info:"#3a5a78",accent:"#c83a3a",focus:"#1d3557",surface:"#faf6ea",surfaceHover:"#f2ebd7"},backgrounds:{primary:"#fdf9ee",secondary:"#f5ecd5",tertiary:"#ecdfbd",hover:"#e4d5aa",elevated:"#ffffff",inset:"#f0e5c8",canvas:"#fbf6e7"},text:{primary:"#1a1610",secondary:"#3d352a",muted:"#8a7f64",inverse:"#fdf9ee"},borders:{color:"#1a1610",width:"1px",divider:"#d4c89e",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px"},shadows:{sm:"none",md:"0 1px 0 0 rgba(26,22,16,0.08)",lg:"0 2px 0 0 rgba(26,22,16,0.1)",xl:"0 4px 12px rgba(26,22,16,0.08)"},spacing:qe,typography:{fontFamily:"'Noto Sans JP', 'Inter', sans-serif",headingFontFamily:"'Noto Serif JP', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:700,lineHeight:1.75,letterSpacing:"0.02em",headingLetterSpacing:"0.01em"},transitions:{fast:"120ms ease",normal:"220ms ease",slow:"340ms ease"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.22,blendMode:"multiply"}},displayStyle:"zen",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},qs={meta:{id:"moroccanMosaic",name:"Moroccan Mosaic",tagline:"Zellige geometry — terracotta, teal, saffron in tiled rhythm.",tags:["light","cultural","geometric","warm"]},theme:{name:"Moroccan Mosaic",darkMode:"light",recommendedDisplayStyle:"bauhaus",colors:{primary:"#0f6b5c",primaryHover:"#0a5246",success:"#5a8a3a",warning:"#e0a03a",error:"#c2522a",info:"#3a7090",accent:"#e8a840",focus:"#0f6b5c",surface:"#f9f1dc",surfaceHover:"#f0e5c2"},backgrounds:{primary:"#fbf3e0",secondary:"#f2e4c2",tertiary:"#e6d2a0",hover:"#dac38a",elevated:"#fdf7e8",inset:"#ecd8b2",canvas:"#f8edd3"},text:{primary:"#2a1608",secondary:"#5a3a20",muted:"#a08860",inverse:"#fbf3e0"},borders:{color:"#2a1608",width:"2px",divider:"#b89868",radiusSm:"3px",radiusMd:"6px",radiusLg:"10px",radiusXl:"14px",radiusFull:"9999px"},shadows:{sm:"2px 2px 0 rgba(42,22,8,0.12)",md:"3px 3px 0 #0f6b5c, 6px 6px 0 rgba(42,22,8,0.08)",lg:"4px 4px 0 #0f6b5c, 8px 8px 0 #e8a840",xl:"6px 6px 0 #c2522a, 12px 12px 0 rgba(42,22,8,0.1)"},spacing:X,typography:{fontFamily:"'Cairo', 'Inter', sans-serif",headingFontFamily:"'Amiri', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"120ms linear",normal:"200ms linear",slow:"320ms linear"},backgroundImage:{type:"pattern",pattern:"hexagons",opacity:.2}},displayStyle:"bauhaus",variantConfig:{radius:"sm",shadow:"md",density:"normal",animation:"subtle"}},Gs={meta:{id:"artDecoGatsby",name:"Art Deco Gatsby",tagline:"Gold, emerald, onyx — geometric glamour, thin gilt lines.",tags:["dark","cultural","luxury","geometric"]},theme:{name:"Art Deco Gatsby",darkMode:"dark",recommendedDisplayStyle:"luxe",colors:{primary:"#d4af37",primaryHover:"#e8c850",success:"#4a9c7a",warning:"#e8c850",error:"#c24040",info:"#70a8c0",accent:"#1e5c4a",focus:"#d4af37",surface:"#0f1a16",surfaceHover:"#16251e"},backgrounds:{primary:"#0a0f0c",secondary:"#0f1a16",tertiary:"#16251e",hover:"#1c3028",elevated:"#0f1a16",inset:"#050908",canvas:"#080c0a"},text:{primary:"#f0e4c2",secondary:"#c0b080",muted:"#706448",inverse:"#0a0f0c"},borders:{color:"#6b5828",width:"1px",divider:"#4a3c18",focusColor:"#d4af37",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(212,175,55,0.15)",md:"0 2px 8px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,175,55,0.2)",lg:"0 8px 24px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,175,55,0.3), inset 0 1px 0 rgba(212,175,55,0.1)",xl:"0 20px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,175,55,0.4)",glow:"0 0 16px rgba(212,175,55,0.3)"},spacing:Ee,typography:{fontFamily:"'Cormorant Garamond', Georgia, serif",headingFontFamily:"'Poiret One', 'Cormorant Garamond', serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0.04em",headingLetterSpacing:"0.12em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"380ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"luxe",variantConfig:{radius:"none",shadow:"lg",density:"comfortable",animation:"subtle"}},Ks={meta:{id:"sovietConstructivist",name:"Soviet Constructivist",tagline:"Rodchenko red — slab type, hard angles, propaganda poise.",tags:["light","cultural","brutalist","geometric"]},theme:{name:"Soviet Constructivist",darkMode:"light",recommendedDisplayStyle:"brutalist",colors:{primary:"#c41e1e",primaryHover:"#8a1414",success:"#3a6a3a",warning:"#d08028",error:"#8a1414",info:"#2a4060",accent:"#1a1a1a",focus:"#c41e1e",surface:"#f0ead8",surfaceHover:"#e5dcc0"},backgrounds:{primary:"#f4efde",secondary:"#e8dec4",tertiary:"#d8c9a4",hover:"#ccbb90",elevated:"#faf5e5",inset:"#dccda8",canvas:"#f0ead5"},text:{primary:"#1a1a1a",secondary:"#3d3d3d",muted:"#706d5a",inverse:"#f4efde"},borders:{color:"#1a1a1a",width:"3px",divider:"#1a1a1a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"4px 0 0 0 #c41e1e",md:"6px 6px 0 0 #1a1a1a, 8px 8px 0 0 #c41e1e",lg:"10px 10px 0 0 #c41e1e",xl:"12px -4px 0 0 #1a1a1a, 16px 0 0 0 #c41e1e"},spacing:X,typography:{fontFamily:"'Roboto Condensed', 'Archivo', sans-serif",headingFontFamily:"'Alfa Slab One', 'Archivo Black', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.35,letterSpacing:"0.02em",headingLetterSpacing:"-0.005em"},transitions:{fast:"0ms linear",normal:"80ms linear",slow:"160ms linear"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"subtle"}},Js={meta:{id:"blueprint",name:"Blueprint",tagline:"Cyanotype drafting — white lines, grid paper, technical mono.",tags:["dark","tech","technical","mono"]},theme:{name:"Blueprint",darkMode:"dark",recommendedDisplayStyle:"dashboard",colors:{primary:"#f0f4f8",primaryHover:"#ffffff",success:"#88e0b8",warning:"#ffcc66",error:"#ff8888",info:"#88c8ff",accent:"#6eb0e0",focus:"#ffffff",surface:"#18456a",surfaceHover:"#1f527e"},backgrounds:{primary:"#0e3356",secondary:"#124066",tertiary:"#184d79",hover:"#1e5a8c",elevated:"#18456a",inset:"#082540",canvas:"#0a2d4a"},text:{primary:"#f0f4f8",secondary:"#b5c8da",muted:"#6e8aa4",inverse:"#0e3356"},borders:{color:"#3870a0",width:"1px",divider:"#2a5680",focusColor:"#ffffff",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(240,244,248,0.05)",md:"0 1px 0 0 rgba(240,244,248,0.1), 0 4px 8px rgba(0,0,0,0.3)",lg:"0 1px 0 0 rgba(240,244,248,0.14), 0 10px 20px rgba(0,0,0,0.4)",xl:"0 20px 40px rgba(0,0,0,0.5)"},spacing:X,typography:{fontFamily:"'IBM Plex Mono', ui-monospace, monospace",headingFontFamily:"'Space Grotesk', 'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"-0.01em"},transitions:{fast:"80ms linear",normal:"140ms linear",slow:"220ms linear"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.4}},displayStyle:"dashboard",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"subtle"}},Ys={meta:{id:"hologramUI",name:"Hologram UI",tagline:"Iridescent light-leaks, translucent layers, futurist geometry.",tags:["dark","tech","glass","neon"]},theme:{name:"Hologram UI",darkMode:"dark",recommendedDisplayStyle:"cosmic",colors:{primary:"#8be9fd",primaryHover:"#a8f0ff",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#bd93f9",accent:"#ff79c6",focus:"#8be9fd",surface:"rgba(40,30,70,0.5)",surfaceHover:"rgba(50,40,85,0.6)"},backgrounds:{primary:"rgba(30,20,55,0.6)",secondary:"rgba(40,30,70,0.5)",tertiary:"rgba(55,40,90,0.4)",hover:"rgba(65,50,105,0.55)",elevated:"rgba(50,38,82,0.7)",inset:"rgba(25,18,45,0.6)",canvas:"#0a0618"},text:{primary:"#f0e8ff",secondary:"#b0a0e0",muted:"#6a5a94",inverse:"#0a0618"},borders:{color:"rgba(139,233,253,0.25)",width:"1px",divider:"rgba(139,233,253,0.15)",focusColor:"#8be9fd",radiusSm:"4px",radiusMd:"8px",radiusLg:"14px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"0 0 12px rgba(139,233,253,0.2)",md:"0 4px 20px rgba(189,147,249,0.3), 0 0 1px rgba(139,233,253,0.4)",lg:"0 8px 40px rgba(255,121,198,0.35), 0 0 2px rgba(139,233,253,0.5), inset 0 1px 0 rgba(255,255,255,0.08)",xl:"0 20px 60px rgba(139,233,253,0.4), inset 0 1px 0 rgba(255,255,255,0.1)",glow:"0 0 32px rgba(139,233,253,0.6), 0 0 64px rgba(255,121,198,0.3)"},spacing:X,typography:{fontFamily:"'Rajdhani', -apple-system, sans-serif",headingFontFamily:"'Orbitron', 'Rajdhani', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.06em"},transitions:{fast:"160ms cubic-bezier(0.4,0,0.2,1)",normal:"280ms cubic-bezier(0.4,0,0.2,1)",slow:"440ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 15% 20%, rgba(139,233,253,0.25) 0%, transparent 50%), radial-gradient(at 85% 25%, rgba(255,121,198,0.25) 0%, transparent 50%), radial-gradient(at 50% 90%, rgba(189,147,249,0.3) 0%, transparent 55%), linear-gradient(135deg, #0a0618 0%, #1a0e38 100%)"}},displayStyle:"cosmic",variantConfig:{shadow:"glow",density:"normal",animation:"normal"}},Qs={meta:{id:"deepSea",name:"Deep Sea",tagline:"Midnight blue abyss, bioluminescent accents in the dark.",tags:["dark","tech","organic"]},theme:{name:"Deep Sea",darkMode:"dark",recommendedDisplayStyle:"modern3d",colors:{primary:"#00d9c4",primaryHover:"#2feedc",success:"#5af0b0",warning:"#f0c858",error:"#ff6a82",info:"#60c0ff",accent:"#a878f0",focus:"#00d9c4",surface:"#0a1524",surfaceHover:"#0e1c30"},backgrounds:{primary:"#05101c",secondary:"#0a1524",tertiary:"#0f1f34",hover:"#163044",elevated:"#0e1c30",inset:"#030810",canvas:"#030810"},text:{primary:"#d8f0f5",secondary:"#88b8c8",muted:"#4a7080",inverse:"#030810"},borders:{color:"#183548",width:"1px",divider:"#0f2638",focusColor:"#00d9c4",radiusSm:"8px",radiusMd:"14px",radiusLg:"22px",radiusXl:"32px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,217,196,0.08)",md:"0 6px 20px rgba(0,217,196,0.12), 0 2px 4px rgba(0,0,0,0.5)",lg:"0 14px 40px rgba(0,217,196,0.18), 0 4px 8px rgba(0,0,0,0.6)",xl:"0 28px 64px rgba(0,217,196,0.22), 0 8px 16px rgba(0,0,0,0.7)",glow:"0 0 24px rgba(0,217,196,0.5)"},spacing:X,typography:{fontFamily:"'IBM Plex Sans', -apple-system, sans-serif",headingFontFamily:"'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"160ms cubic-bezier(0.22,1,0.36,1)",normal:"280ms cubic-bezier(0.22,1,0.36,1)",slow:"440ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 20% 30%, rgba(0,217,196,0.08) 0%, transparent 60%), radial-gradient(at 80% 80%, rgba(168,120,240,0.06) 0%, transparent 55%), linear-gradient(180deg, #030810 0%, #05101c 100%)"}},displayStyle:"modern3d",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},Zs={meta:{id:"analog70s",name:"Analog 70s",tagline:"Mustard, rust, walnut — chunky, warm, turntable energy.",tags:["light","retro","warm","serif"]},theme:{name:"Analog 70s",darkMode:"light",recommendedDisplayStyle:"rounded",colors:{primary:"#c8621e",primaryHover:"#a04d14",success:"#7a8a2a",warning:"#d8a030",error:"#a03030",info:"#6a7a8a",accent:"#d8a830",focus:"#c8621e",surface:"#f5ead2",surfaceHover:"#ecdfc0"},backgrounds:{primary:"#f7ecd6",secondary:"#eeddb8",tertiary:"#e2c998",hover:"#d8bc80",elevated:"#fbf2de",inset:"#e8cfa5",canvas:"#f2e4c8"},text:{primary:"#2a1608",secondary:"#5a2e14",muted:"#a07852",inverse:"#f7ecd6"},borders:{color:"#b89868",width:"2px",divider:"#ccb285",radiusSm:"10px",radiusMd:"16px",radiusLg:"24px",radiusXl:"34px",radiusFull:"9999px"},shadows:{sm:"0 2px 0 0 rgba(42,22,8,0.12)",md:"0 4px 0 0 rgba(42,22,8,0.15), 0 6px 10px rgba(200,98,30,0.12)",lg:"0 6px 0 0 rgba(42,22,8,0.18), 0 10px 20px rgba(200,98,30,0.2)",xl:"0 8px 0 0 rgba(42,22,8,0.22), 0 20px 40px rgba(200,98,30,0.28)"},spacing:X,typography:{fontFamily:"'Work Sans', sans-serif",headingFontFamily:"'Abril Fatface', Georgia, serif",monoFontFamily:"'Space Mono', ui-monospace, monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"180ms cubic-bezier(0.34,1.56,0.64,1)",normal:"280ms cubic-bezier(0.34,1.56,0.64,1)",slow:"440ms cubic-bezier(0.34,1.56,0.64,1)"}},displayStyle:"rounded",variantConfig:{radius:"xl",shadow:"md",density:"comfortable",animation:"playful"}},eo={meta:{id:"vhsTracking",name:"VHS Tracking",tagline:"Chromatic smear, scan-line haze, pixel type from another decade.",tags:["dark","retro","pixel","experimental"]},theme:{name:"VHS Tracking",darkMode:"dark",recommendedDisplayStyle:"retro8bit",colors:{primary:"#ff3eb5",primaryHover:"#ff5fc5",success:"#3eff90",warning:"#ffe83e",error:"#ff3e3e",info:"#3ee0ff",accent:"#3eff90",focus:"#ff3eb5",surface:"#120818",surfaceHover:"#1a0c24"},backgrounds:{primary:"#0a0412",secondary:"#120818",tertiary:"#1a0c24",hover:"#241230",elevated:"#120818",inset:"#050208",canvas:"#0a0412"},text:{primary:"#f8e8ff",secondary:"#c888d8",muted:"#605070",inverse:"#0a0412"},borders:{color:"#4a2864",width:"1px",divider:"#2a1840",focusColor:"#ff3eb5",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0"},shadows:{sm:"-2px 0 0 rgba(255,62,181,0.5), 2px 0 0 rgba(62,224,255,0.5)",md:"-3px 0 0 rgba(255,62,181,0.6), 3px 0 0 rgba(62,224,255,0.6), 0 4px 12px rgba(0,0,0,0.6)",lg:"-4px 0 0 rgba(255,62,181,0.7), 4px 0 0 rgba(62,224,255,0.7), 0 8px 24px rgba(0,0,0,0.7)",xl:"-6px 0 0 rgba(255,62,181,0.8), 6px 0 0 rgba(62,224,255,0.8)",glow:"0 0 20px rgba(255,62,181,0.6)"},spacing:X,typography:{fontFamily:"'VT323', 'JetBrains Mono', monospace",headingFontFamily:"'VT323', monospace",monoFontFamily:"'VT323', monospace",fontSizeXs:"0.9375rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.375rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:400,fontWeightBold:400,lineHeight:1.35,letterSpacing:"0.01em",headingLetterSpacing:"0.04em"},transitions:{fast:"40ms steps(3)",normal:"100ms steps(5)",slow:"180ms steps(8)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #0a0412 0%, #120818 100%), repeating-linear-gradient(0deg, rgba(255,62,181,0.03) 0 2px, transparent 2px 4px)"}},displayStyle:"retro8bit",variantConfig:{radius:"none",shadow:"md",density:"normal",animation:"subtle"}},to={meta:{id:"typewriterPress",name:"Typewriter Press",tagline:"Ribbon red on cream — Courier bones, stamped display.",tags:["light","retro","mono","editorial"]},theme:{name:"Typewriter Press",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#b02020",primaryHover:"#8a1818",success:"#4a7038",warning:"#b08018",error:"#8a1818",info:"#3a5068",accent:"#1a1a1a",focus:"#b02020",surface:"#faf3df",surfaceHover:"#f0e7c6"},backgrounds:{primary:"#fbf5e3",secondary:"#f3e9c8",tertiary:"#ebdcab",hover:"#e2cf8f",elevated:"#fffae7",inset:"#efe0b0",canvas:"#fbf5e3"},text:{primary:"#1a1a1a",secondary:"#3d3428",muted:"#7a6f4a",inverse:"#fbf5e3"},borders:{color:"#1a1a1a",width:"1px",divider:"#c8b880",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"0 0 0 rgba(26,26,26,0), 1px 1px 0 rgba(26,26,26,0.12)",md:"1px 1px 0 rgba(26,26,26,0.15), 2px 2px 0 rgba(176,32,32,0.1)",lg:"2px 2px 0 rgba(26,26,26,0.2), 4px 4px 0 rgba(176,32,32,0.12)",xl:"3px 3px 0 rgba(26,26,26,0.25)"},spacing:X,typography:{fontFamily:"'Courier Prime', 'Courier New', monospace",headingFontFamily:"'Special Elite', 'Courier Prime', monospace",monoFontFamily:"'Courier Prime', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0.01em",headingLetterSpacing:"0.04em"},transitions:{fast:"40ms linear",normal:"80ms linear",slow:"140ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.2,blendMode:"multiply"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"subtle",density:"normal",animation:"none"}},ro={meta:{id:"y2kAqua",name:"Y2K Aqua",tagline:"Chrome and aqua — iMac blue, optimistic futurism, 2001 energy.",tags:["light","retro","glass"]},theme:{name:"Y2K Aqua",darkMode:"light",recommendedDisplayStyle:"modern3d",colors:{primary:"#0a84ff",primaryHover:"#0066cc",success:"#34c759",warning:"#ff9500",error:"#ff3b30",info:"#5ac8fa",accent:"#5ac8fa",focus:"#0a84ff",surface:"#f0f5fc",surfaceHover:"#e0ecfa"},backgrounds:{primary:"#e8f2fc",secondary:"#d8e8f8",tertiary:"#c0d8f0",hover:"#a8c8e8",elevated:"#ffffff",inset:"#c8dcf4",canvas:"#dce8f4"},text:{primary:"#0a1a30",secondary:"#304868",muted:"#6a88a8",inverse:"#ffffff"},borders:{color:"#a0c0e0",width:"1px",divider:"#c0d8f0",radiusSm:"6px",radiusMd:"10px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(10,132,255,0.15)",md:"inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -1px 2px rgba(10,132,255,0.2), 0 2px 6px rgba(10,132,255,0.25), 0 4px 12px rgba(10,132,255,0.15)",lg:"inset 0 1px 0 rgba(255,255,255,0.95), 0 4px 12px rgba(10,132,255,0.3), 0 10px 24px rgba(90,200,250,0.25)",xl:"inset 0 2px 0 rgba(255,255,255,1), 0 8px 24px rgba(10,132,255,0.35), 0 20px 48px rgba(90,200,250,0.3)"},spacing:X,typography:{fontFamily:"'Chakra Petch', -apple-system, sans-serif",headingFontFamily:"'Chakra Petch', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.01em",headingLetterSpacing:"-0.005em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"380ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #f0f7ff 0%, #d8e8f8 60%, #bcd6f0 100%)"}},displayStyle:"modern3d",variantConfig:{radius:"lg",shadow:"lg",density:"normal",animation:"normal"}},ao={meta:{id:"vogueDidone",name:"Vogue Didone",tagline:"Didone serif, arctic whitespace, one red heartbeat.",tags:["light","editorial","serif","luxury"]},theme:{name:"Vogue Didone",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#000000",primaryHover:"#1a1a1a",success:"#1f6a3a",warning:"#8a6a1a",error:"#c40018",info:"#2a4068",accent:"#c40018",focus:"#c40018",surface:"#ffffff",surfaceHover:"#f7f7f7"},backgrounds:{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f2f2f2",hover:"#ededed",elevated:"#ffffff",inset:"#f5f5f5",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#2a2a2a",muted:"#808080",inverse:"#ffffff"},borders:{color:"#000000",width:"1px",divider:"#dcdcdc",radiusSm:"0",radiusMd:"0",radiusLg:"1px",radiusXl:"2px",radiusFull:"9999px"},shadows:{sm:"none",md:"none",lg:"0 1px 0 0 #000000",xl:"0 2px 0 0 #000000"},spacing:qe,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Playfair Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:900,lineHeight:1.7,letterSpacing:"0.02em",headingLetterSpacing:"-0.03em"},transitions:{fast:"120ms ease",normal:"220ms ease",slow:"360ms ease"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},no={meta:{id:"comicHalftone",name:"Comic Halftone",tagline:"CMYK pop — halftone dots, action type, offset ink shadows.",tags:["light","editorial","playful"]},theme:{name:"Comic Halftone",darkMode:"light",recommendedDisplayStyle:"playful",colors:{primary:"#e8182c",primaryHover:"#c01020",success:"#1ea862",warning:"#f0c820",error:"#e8182c",info:"#1878c8",accent:"#1878c8",focus:"#e8182c",surface:"#fffdf4",surfaceHover:"#fff8d8"},backgrounds:{primary:"#fffef0",secondary:"#fff6b8",tertiary:"#ffe870",hover:"#ffd838",elevated:"#ffffff",inset:"#fff090",canvas:"#fffdec"},text:{primary:"#0a0a0a",secondary:"#2a2a2a",muted:"#707070",inverse:"#fffef0"},borders:{color:"#0a0a0a",width:"3px",divider:"#0a0a0a",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"3px 3px 0 0 #0a0a0a",md:"5px 5px 0 0 #0a0a0a",lg:"6px 6px 0 0 #e8182c, 10px 10px 0 0 #0a0a0a",xl:"8px 8px 0 0 #1878c8, 12px 12px 0 0 #0a0a0a"},spacing:X,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Bangers', 'Archivo Black', cursive",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2.125rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.45,letterSpacing:"0",headingLetterSpacing:"0.03em"},transitions:{fast:"100ms cubic-bezier(0.34,1.56,0.64,1)",normal:"200ms cubic-bezier(0.34,1.56,0.64,1)",slow:"320ms cubic-bezier(0.34,1.56,0.64,1)"},backgroundImage:{type:"pattern",pattern:"dots",opacity:.5}},displayStyle:"playful",variantConfig:{radius:"sm",shadow:"lg",density:"normal",animation:"playful"}},so={meta:{id:"zinePunk",name:"Zine Punk",tagline:"Photocopier grain, marker headlines, cut-and-paste attitude.",tags:["light","editorial","experimental","brutalist"]},theme:{name:"Zine Punk",darkMode:"light",recommendedDisplayStyle:"brutalist",colors:{primary:"#0a0a0a",primaryHover:"#000000",success:"#1a1a1a",warning:"#2a2a2a",error:"#0a0a0a",info:"#1a1a1a",accent:"#0a0a0a",focus:"#0a0a0a",surface:"#f5f3ee",surfaceHover:"#e8e4d8"},backgrounds:{primary:"#efece0",secondary:"#e3dfd0",tertiary:"#d4d0c0",hover:"#c8c4b4",elevated:"#f5f3ee",inset:"#e0dcc8",canvas:"#ede8d8"},text:{primary:"#0a0a0a",secondary:"#1a1a1a",muted:"#505050",inverse:"#efece0"},borders:{color:"#0a0a0a",width:"2px",divider:"#0a0a0a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"2px 3px 0 rgba(10,10,10,0.9)",md:"4px 6px 0 rgba(10,10,10,0.9), -2px 2px 0 rgba(10,10,10,0.3)",lg:"6px 10px 0 rgba(10,10,10,1), -4px 2px 0 rgba(10,10,10,0.4)",xl:"10px 14px 0 rgba(10,10,10,1)"},spacing:X,typography:{fontFamily:"'Special Elite', 'Courier Prime', monospace",headingFontFamily:"'Permanent Marker', 'Special Elite', cursive",monoFontFamily:"'Courier Prime', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:400,fontWeightBold:400,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.01em"},transitions:{fast:"20ms linear",normal:"60ms linear",slow:"120ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.3,blendMode:"multiply"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"none"}},oo={meta:{id:"watercolorWash",name:"Watercolor Wash",tagline:"Soft pastel bleeds, handwritten headings, paper gentleness.",tags:["light","artistic","pastel","organic"]},theme:{name:"Watercolor Wash",darkMode:"light",recommendedDisplayStyle:"softCloud",colors:{primary:"#9d7bc4",primaryHover:"#8262ab",success:"#7bb88a",warning:"#e0a868",error:"#d47878",info:"#7ba8c4",accent:"#e0a0c0",focus:"#9d7bc4",surface:"rgba(255,250,245,0.8)",surfaceHover:"rgba(250,240,238,0.9)"},backgrounds:{primary:"#fdf8f4",secondary:"#f8eee6",tertiary:"#f0e0d4",hover:"#e8d2c0",elevated:"#ffffff",inset:"#f4e4d8",canvas:"#fdf8f4"},text:{primary:"#3a2845",secondary:"#6a5868",muted:"#a89ca4",inverse:"#fdf8f4"},borders:{color:"#e8d4c8",width:"1px",divider:"#f0e0d4",radiusSm:"10px",radiusMd:"18px",radiusLg:"30px",radiusXl:"44px",radiusFull:"9999px"},shadows:{sm:"0 2px 10px rgba(157,123,196,0.08)",md:"0 6px 24px rgba(157,123,196,0.12), 0 2px 4px rgba(224,160,192,0.06)",lg:"0 16px 40px rgba(157,123,196,0.18), 0 6px 12px rgba(224,160,192,0.1)",xl:"0 30px 64px rgba(157,123,196,0.22)"},spacing:Ee,typography:{fontFamily:"'Quicksand', -apple-system, sans-serif",headingFontFamily:"'Caveat', 'Quicksand', cursive",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0",headingLetterSpacing:"-0.005em"},transitions:{fast:"220ms cubic-bezier(0.22,1,0.36,1)",normal:"380ms cubic-bezier(0.22,1,0.36,1)",slow:"600ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 18% 22%, rgba(232,208,220,0.5) 0%, transparent 40%), radial-gradient(at 82% 28%, rgba(200,220,240,0.45) 0%, transparent 45%), radial-gradient(at 35% 80%, rgba(232,228,200,0.4) 0%, transparent 50%), linear-gradient(180deg, #fdf8f4 0%, #f8eee6 100%)"}},displayStyle:"softCloud",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},io={meta:{id:"memphis80s",name:"Memphis 80s",tagline:"Squiggle chaos — cyan, pink, yellow, serious typography, no.",tags:["light","artistic","playful"]},theme:{name:"Memphis 80s",darkMode:"light",recommendedDisplayStyle:"playful",colors:{primary:"#f02080",primaryHover:"#c81868",success:"#28c868",warning:"#f8d820",error:"#f02040",info:"#20b8e8",accent:"#f8d820",focus:"#20b8e8",surface:"#fffffa",surfaceHover:"#fff7d0"},backgrounds:{primary:"#fffceb",secondary:"#fff2d0",tertiary:"#ffe8b4",hover:"#ffdd98",elevated:"#ffffff",inset:"#fff0c0",canvas:"#fffbe0"},text:{primary:"#0a0a1a",secondary:"#2a2a3a",muted:"#6a6a7a",inverse:"#fffceb"},borders:{color:"#0a0a1a",width:"2px",divider:"#0a0a1a",radiusSm:"4px",radiusMd:"6px",radiusLg:"10px",radiusXl:"14px",radiusFull:"9999px"},shadows:{sm:"3px 3px 0 0 #20b8e8",md:"4px 4px 0 0 #f02080, 8px 8px 0 0 #f8d820",lg:"5px 5px 0 0 #28c868, 10px 10px 0 0 #20b8e8, 15px 15px 0 0 #f02080",xl:"6px 6px 0 0 #f8d820, 12px 12px 0 0 #f02080, 18px 18px 0 0 #20b8e8"},spacing:X,typography:{fontFamily:"'Rubik', -apple-system, sans-serif",headingFontFamily:"'Rubik Mono One', 'Rubik', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.4,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"120ms cubic-bezier(0.68,-0.55,0.27,1.55)",normal:"220ms cubic-bezier(0.68,-0.55,0.27,1.55)",slow:"360ms cubic-bezier(0.68,-0.55,0.27,1.55)"},backgroundImage:{type:"pattern",pattern:"zigzag",opacity:.3}},displayStyle:"playful",variantConfig:{radius:"sm",shadow:"lg",density:"normal",animation:"playful"}},co={meta:{id:"inkSumie",name:"Ink Sumi-e",tagline:"Charcoal brush on rice paper — vast silence, one red seal.",tags:["light","artistic","serif","minimal"]},theme:{name:"Ink Sumi-e",darkMode:"light",recommendedDisplayStyle:"zen",colors:{primary:"#1a1a1a",primaryHover:"#000000",success:"#2a4a2a",warning:"#705820",error:"#b82020",info:"#2a4060",accent:"#b82020",focus:"#1a1a1a",surface:"#ffffff",surfaceHover:"#f8f7f3"},backgrounds:{primary:"#fdfcf7",secondary:"#f5f3eb",tertiary:"#ebe8dc",hover:"#dfdbcc",elevated:"#ffffff",inset:"#f0edde",canvas:"#fdfcf7"},text:{primary:"#1a1a1a",secondary:"#3a3a3a",muted:"#888482",inverse:"#fdfcf7"},borders:{color:"#1a1a1a",width:"1px",divider:"#d8d4c4",radiusSm:"0",radiusMd:"0",radiusLg:"1px",radiusXl:"2px",radiusFull:"9999px"},shadows:{sm:"none",md:"none",lg:"none",xl:"0 0 0 1px #1a1a1a"},spacing:qe,typography:{fontFamily:"'Noto Sans JP', -apple-system, sans-serif",headingFontFamily:"'Noto Serif JP', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.625rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:700,lineHeight:1.85,letterSpacing:"0.04em",headingLetterSpacing:"0"},transitions:{fast:"200ms ease",normal:"340ms ease",slow:"520ms ease"}},displayStyle:"zen",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},lo={meta:{id:"dieterRams",name:"Dieter Rams",tagline:"Less-but-better — warm gray, single yellow dot, measured everything.",tags:["light","minimal","industrial"]},theme:{name:"Dieter Rams",darkMode:"light",recommendedDisplayStyle:"swiss",colors:{primary:"#1a1a1a",primaryHover:"#0a0a0a",success:"#3a7840",warning:"#e8c020",error:"#c83028",info:"#3868a0",accent:"#e8c020",focus:"#1a1a1a",surface:"#ffffff",surfaceHover:"#f8f8f8"},backgrounds:{primary:"#fbfbf9",secondary:"#f2f2ee",tertiary:"#e8e8e2",hover:"#dedeD6",elevated:"#ffffff",inset:"#ededE7",canvas:"#f5f5f1"},text:{primary:"#0a0a0a",secondary:"#3a3a38",muted:"#888880",inverse:"#fbfbf9"},borders:{color:"#d4d4ce",width:"1px",divider:"#e0e0da",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 1px 0 0 rgba(0,0,0,0.04)",md:"0 1px 0 0 rgba(0,0,0,0.06), 0 4px 8px -2px rgba(0,0,0,0.06)",lg:"0 2px 0 0 rgba(0,0,0,0.08), 0 10px 20px -6px rgba(0,0,0,0.1)",xl:"0 20px 40px -12px rgba(0,0,0,0.14)"},spacing:Os,typography:{fontFamily:"'IBM Plex Sans', -apple-system, sans-serif",headingFontFamily:"'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.015em"},transitions:{fast:"100ms cubic-bezier(0.4,0,0.2,1)",normal:"180ms cubic-bezier(0.4,0,0.2,1)",slow:"280ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"swiss",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"subtle"}},uo={meta:{id:"blackTieGala",name:"Black Tie Gala",tagline:"Absolute black, hand-gilded detail, whispered serif elegance.",tags:["dark","luxury","serif"]},theme:{name:"Black Tie Gala",darkMode:"dark",recommendedDisplayStyle:"luxe",colors:{primary:"#c89848",primaryHover:"#e0b868",success:"#68a878",warning:"#e0b050",error:"#c85858",info:"#8aa8d0",accent:"#e8d0a0",focus:"#c89848",surface:"#0e0e0e",surfaceHover:"#161616"},backgrounds:{primary:"#050505",secondary:"#0e0e0e",tertiary:"#161616",hover:"#1e1e1e",elevated:"#0e0e0e",inset:"#020202",canvas:"#030303"},text:{primary:"#f0ead8",secondary:"#a89870",muted:"#605848",inverse:"#050505"},borders:{color:"#3a2e18",width:"1px",divider:"#241a0c",focusColor:"#c89848",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(200,152,72,0.1)",md:"0 4px 16px rgba(0,0,0,0.8), 0 0 0 1px rgba(200,152,72,0.15)",lg:"0 10px 32px rgba(0,0,0,0.9), 0 0 0 1px rgba(200,152,72,0.25), inset 0 1px 0 rgba(232,208,160,0.08)",xl:"0 24px 56px rgba(0,0,0,1), 0 0 0 1px rgba(200,152,72,0.35)",glow:"0 0 24px rgba(200,152,72,0.25)"},spacing:Ee,typography:{fontFamily:"'Cormorant Garamond', Georgia, serif",headingFontFamily:"'Cormorant Garamond', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.65,letterSpacing:"0.05em",headingLetterSpacing:"0.08em"},transitions:{fast:"180ms cubic-bezier(0.4,0,0.2,1)",normal:"320ms cubic-bezier(0.4,0,0.2,1)",slow:"500ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"luxe",variantConfig:{radius:"sm",shadow:"lg",density:"spacious",animation:"subtle"}},fo={meta:{id:"swissGrid",name:"Swiss Grid",tagline:"Akzidenz rigor — white, black, one red, grid discipline.",tags:["light","minimal","editorial"]},theme:{name:"Swiss Grid",darkMode:"light",recommendedDisplayStyle:"swiss",colors:{primary:"#e30613",primaryHover:"#b8040f",success:"#00683d",warning:"#b8700a",error:"#e30613",info:"#004c98",accent:"#e30613",focus:"#e30613",surface:"#ffffff",surfaceHover:"#f5f5f5"},backgrounds:{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#e0e0e0",elevated:"#ffffff",inset:"#f0f0f0",canvas:"#ffffff"},text:{primary:"#0a0a0a",secondary:"#2a2a2a",muted:"#707070",inverse:"#ffffff"},borders:{color:"#0a0a0a",width:"1px",divider:"#d0d0d0",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"none",md:"0 1px 0 0 rgba(10,10,10,0.1)",lg:"0 2px 0 0 rgba(10,10,10,0.12)",xl:"0 4px 0 0 rgba(10,10,10,0.15)"},spacing:Os,typography:{fontFamily:"'Inter', 'Helvetica Neue', sans-serif",headingFontFamily:"'Inter', 'Helvetica Neue', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.45,letterSpacing:"0",headingLetterSpacing:"-0.03em"},transitions:{fast:"60ms linear",normal:"120ms linear",slow:"200ms linear"}},displayStyle:"swiss",variantConfig:{radius:"none",shadow:"none",density:"compact",animation:"subtle"}},Ft={forestCanopy:_s,desertDune:Ws,arcticCrystal:Vs,autumnFoliage:Xs,japaneseWashi:Us,moroccanMosaic:qs,artDecoGatsby:Gs,sovietConstructivist:Ks,blueprint:Js,hologramUI:Ys,deepSea:Qs,analog70s:Zs,vhsTracking:eo,typewriterPress:to,y2kAqua:ro,vogueDidone:ao,comicHalftone:no,zinePunk:so,watercolorWash:oo,memphis80s:io,inkSumie:co,dieterRams:lo,blackTieGala:uo,swissGrid:fo},mo=Object.values(Ft);function jd(e){return Ft[e]}function Bd(e){return mo.filter(t=>t.meta.tags.includes(e))}function Od(e,t){return e??t.recommendedDisplayStyle??"default"}function Kt(e){return e.toLowerCase().replace(/[\s_-]+/g,"")}function Jt(e){if(e&&typeof e=="object")return e;if(typeof e=="string"){const t=Kt(e),r=lt.find(a=>Kt(a.name)===t);if(r)return r;process.env.NODE_ENV!=="production"&&console.warn(`[@nice2dev/ui] <NiceThemeProvider theme="${e}"> — unknown preset name. Falling back to 'Light'. Available: ${lt.map(a=>a.name).join(", ")}.`)}return zt}const po=({theme:e,darkTheme:t,variantConfig:r,darkMode:a,displayStyle:n,animateTransitions:s=!0,children:i})=>{const o=c.useMemo(()=>Jt(e),[e]),l=c.useMemo(()=>t===void 0?void 0:Jt(t),[t]),d=c.useId(),u=c.useMemo(()=>`p${d.replace(/:/g,"")}`,[d]),f=c.useRef(null),p=c.useRef(null),[h,m]=c.useState(null),[y,g]=c.useState(o),[v,b]=c.useState(!1),[S,w]=c.useState(()=>Od(n,o));c.useEffect(()=>{n!==void 0?w(n):o.recommendedDisplayStyle&&w(o.recommendedDisplayStyle)},[n,o.recommendedDisplayStyle]),c.useEffect(()=>{const E=window.matchMedia("(prefers-color-scheme: dark)");b(E.matches);const R=T=>b(T.matches);return E.addEventListener("change",R),()=>E.removeEventListener("change",R)},[]);const A=a??o.darkMode??"light",k=A==="dark"||A==="auto"&&v;c.useEffect(()=>{g(k&&l?l:o)},[o,l,k]),c.useEffect(()=>{if(typeof document>"u")return;const E=document.createElement("div");return E.className="nice-theme-scope nice-theme-portal-host",E.dataset.ntdProvider=u,E.style.display="contents",document.body.appendChild(E),p.current=E,m(E),()=>{E.parentNode&&E.parentNode.removeChild(E),p.current=null,m(null)}},[u]),c.useEffect(()=>{const E=f.current;if(!E)return;s&&(E.style.transition="background-color 300ms ease, color 300ms ease");const R=De(y);for(const[F,z]of Object.entries(R))E.style.setProperty(F,z);const T=p.current;if(T)for(const[F,z]of Object.entries(R))T.style.setProperty(F,z);E.style.colorScheme=k?"dark":"light",E.dataset.ntdColorScheme=k?"dark":"light",E.dataset.theme=k?"dark":"light",k?E.classList.add("nice-dark"):E.classList.remove("nice-dark"),T&&(T.style.colorScheme=k?"dark":"light",T.dataset.ntdColorScheme=k?"dark":"light",T.dataset.theme=k?"dark":"light",k?T.classList.add("nice-dark"):T.classList.remove("nice-dark"));const D=y.backgroundImage;return D&&D.type!=="none"&&D.type==="gradient"&&D.gradient&&E.style.setProperty("--ntd-bg-image",D.gradient),()=>{E&&Aa(E)}},[y,k,s,h]);const C=c.useRef(new Set);c.useEffect(()=>{if(process.env.NODE_ENV==="production"||typeof window>"u"||typeof document>"u")return;const E=window.setTimeout(()=>{const R=De(y),T=["--color-primary","--nice-primary","--bg-primary","--text-primary"].find(H=>R[H])??Object.keys(R)[0];if(!T)return;const D=String(R[T]??"").trim();if(!D)return;const F=getComputedStyle(document.documentElement).getPropertyValue(T).trim();if(!F||F===D)return;const z=`${u}::${y.name??"unnamed"}::${T}`;C.current.has(z)||(C.current.add(z),console.warn(`[NiceThemeProvider] CSS var "${T}" on documentElement (${F}) does not match the active provider pack "${y.name??"unnamed"}" (${D}). An external applyTheme(...) call (or other code) is overriding the provider — portaled overlays and components reading from :root will look inconsistent. Either remove the external applyTheme call or wrap your app entirely in a single NiceThemeProvider.`))},0);return()=>window.clearTimeout(E)},[y,u]),c.useEffect(()=>{const E=f.current;if(!E)return;const R=r?{...K,...r}:be(S);pt(R,E,u);const T=dr(S);for(const[D,F]of Object.entries(T))E.setAttribute(D,F);return()=>{cr(u,E)}},[r,S,u]);const M=c.useCallback(E=>{g(E)},[]),N=c.useMemo(()=>({theme:y,setTheme:M,portalTarget:h}),[y,M,h]),L=c.useMemo(()=>({displayStyle:S,variantConfig:be(S),setDisplayStyle:w}),[S]);return x.jsx(Rt.Provider,{value:N,children:x.jsx($e.Provider,{value:L,children:x.jsx("div",{ref:f,className:"nice-theme-scope","data-ntd-provider":u,style:{display:"contents"},children:i})})})};po.displayName="NiceThemeProvider";const go=c.createContext(null);function yo(){const e=c.useContext(go);if(!e)throw new Error("useThemeVariants must be used within NiceThemeVariantProvider");return e}function _d({initialConfig:e,storageKey:t="ntd-variant-config",autoApply:r=!0,children:a}){const[n,s]=c.useState(()=>{if(typeof window<"u"&&t){const d=localStorage.getItem(t);if(d)try{return{...K,...JSON.parse(d)}}catch{}}return{...K,...e}});c.useEffect(()=>{r&&typeof window<"u"&&pt(n)},[n,r]),c.useEffect(()=>{typeof window<"u"&&t&&localStorage.setItem(t,JSON.stringify(n))},[n,t]);const i=c.useCallback(d=>{s(u=>({...u,...d}))},[]),o=c.useCallback(d=>{const u=He[d];u&&s(u)},[]),l=c.useCallback(()=>{s(K)},[]);return x.jsx(go.Provider,{value:{config:n,setConfig:i,applyPreset:o,reset:l},children:a})}function Wd({showPresets:e=!0,showPreview:t=!0,showCSS:r=!1,collapsible:a=!0,className:n,style:s}){const{config:i,setConfig:o,applyPreset:l,reset:d}=yo(),[u,f]=c.useState(new Set(["presets","radius","shadow"])),p=m=>{a&&f(y=>{const g=new Set(y);return g.has(m)?g.delete(m):g.add(m),g})},h=m=>!a||u.has(m);return x.jsxs("div",{className:`ntd-theme-variant-configurator ${n||""}`,style:{fontFamily:"system-ui, sans-serif",fontSize:"14px",...s},children:[e&&x.jsx(q,{title:"Presets",expanded:h("presets"),onToggle:()=>p("presets"),children:x.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[Object.keys(He).map(m=>x.jsx("button",{onClick:()=>l(m),style:{padding:"6px 12px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-secondary, #f9fafb)",cursor:"pointer",textTransform:"capitalize"},children:m},m)),x.jsx("button",{onClick:d,style:{padding:"6px 12px",border:"1px solid var(--nice-danger-dark, #dc2626)",borderRadius:"6px",background:"var(--danger-bg, #fef2f2)",color:"var(--color-error, #dc2626)",cursor:"pointer"},children:"Reset"})]})}),x.jsx(q,{title:"Border Radius",expanded:h("radius"),onToggle:()=>p("radius"),children:x.jsx(oe,{options:Object.keys(he),value:i.radius,onChange:m=>o({radius:m}),renderPreview:m=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--color-accent, #6366f1)",borderRadius:he[m].md}})})}),x.jsx(q,{title:"Shadows",expanded:h("shadow"),onToggle:()=>p("shadow"),children:x.jsx(oe,{options:Object.keys(Re),value:i.shadow,onChange:m=>o({shadow:m}),renderPreview:m=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--bg-primary, #fff)",borderRadius:"4px",boxShadow:Re[m]}})})}),x.jsx(q,{title:"Button Style",expanded:h("button"),onToggle:()=>p("button"),children:x.jsx(oe,{options:["flat","raised","outlined","ghost","soft","gradient","3d","neumorphic"],value:i.buttonStyle,onChange:m=>o({buttonStyle:m})})}),x.jsx(q,{title:"Input Style",expanded:h("input"),onToggle:()=>p("input"),children:x.jsx(oe,{options:["bordered","filled","underlined","floating","soft","neumorphic"],value:i.inputStyle,onChange:m=>o({inputStyle:m})})}),x.jsx(q,{title:"Card Style",expanded:h("card"),onToggle:()=>p("card"),children:x.jsx(oe,{options:["flat","elevated","bordered","glass","gradient","neumorphic"],value:i.cardStyle,onChange:m=>o({cardStyle:m})})}),x.jsx(q,{title:"Animation",expanded:h("animation"),onToggle:()=>p("animation"),children:x.jsx(oe,{options:Object.keys(Fe),value:i.animation,onChange:m=>o({animation:m})})}),x.jsx(q,{title:"Density",expanded:h("density"),onToggle:()=>p("density"),children:x.jsx(oe,{options:Object.keys(ve),value:i.density,onChange:m=>o({density:m})})}),t&&x.jsx(q,{title:"Preview",expanded:h("preview"),onToggle:()=>p("preview"),children:x.jsx(Vd,{config:i})}),r&&x.jsx(q,{title:"Generated CSS",expanded:h("css"),onToggle:()=>p("css"),children:x.jsx("pre",{style:{background:"var(--text-primary, #1f2937)",color:"var(--border-color, #e5e7eb)",padding:"12px",borderRadius:"6px",fontSize:"12px",overflow:"auto",maxHeight:"200px"},children:mt(i)})})]})}function q({title:e,expanded:t,onToggle:r,children:a}){return x.jsxs("div",{style:{marginBottom:"16px"},children:[x.jsxs("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"8px 0",border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:"var(--text-secondary, #374151)",textAlign:"left"},children:[x.jsx("span",{style:{transform:t?"rotate(90deg)":"none",transition:"transform 150ms"},children:"▶"}),e]}),t&&x.jsx("div",{style:{paddingLeft:"20px",paddingTop:"8px"},children:a})]})}function oe({options:e,value:t,onChange:r,renderPreview:a}){return x.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:e.map(n=>x.jsxs("button",{onClick:()=>r(n),style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 12px",border:t===n?"2px solid var(--nice-info, #6366f1)":"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:t===n?"var(--nice-primary-bg, #eef2ff)":"var(--bg-primary, #fff)",cursor:"pointer",textTransform:"capitalize",fontSize:"13px"},children:[a&&a(n),n]},n))})}function Vd({config:e}){const t=dt(e.buttonStyle,"var(--color-accent, #6366f1)"),r=ut(e.inputStyle),a=ft(e.cardStyle),n=he[e.radius],s=ve[e.density];return x.jsxs("div",{style:{padding:"20px",background:"var(--bg-secondary, #f9fafb)",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"16px"},children:[x.jsxs("div",{style:{padding:s.paddingX,borderRadius:n.lg,...a},children:[x.jsx("h4",{style:{margin:"0 0 12px",fontSize:s.fontSize},children:"Card Preview"}),x.jsxs("div",{style:{display:"flex",gap:s.gap,marginBottom:"12px"},children:[x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:n.md,color:"var(--bg-primary, #fff)",fontSize:s.fontSize,cursor:"pointer",...t},children:"Primary"}),x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:n.md,background:"var(--border-color, #e5e7eb)",border:"none",fontSize:s.fontSize,cursor:"pointer"},children:"Secondary"})]}),x.jsx("input",{type:"text",placeholder:"Input preview...",style:{width:"100%",height:s.inputHeight,padding:`0 ${s.paddingX}`,fontSize:s.fontSize,outline:"none",boxSizing:"border-box",...r}})]}),x.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:["Info","Success","Warning","Error"].map(i=>x.jsx("span",{style:{padding:"4px 10px",borderRadius:n.full,background:"var(--border-color, #e5e7eb)",fontSize:"12px"},children:i},i))})]})}function Xd(e){const[t,r]=c.useState(()=>typeof window>"u"?!1:Yt());return c.useEffect(()=>{var d,u,f;if(typeof window>"u")return;const a=()=>(e==null?void 0:e.current)??document.documentElement,n=()=>r(Yt(a()));n();const s=new MutationObserver(n),i={attributes:!0,attributeFilter:["data-theme","class","style"]};s.observe(document.documentElement,i);const o=(u=(d=e==null?void 0:e.current)==null?void 0:d.closest)==null?void 0:u.call(d,"[data-theme], .nice-dark, .nice-light, .dark");o&&o!==document.documentElement&&s.observe(o,i);const l=window.matchMedia("(prefers-color-scheme: dark)");return(f=l.addEventListener)==null||f.call(l,"change",n),()=>{var p;s.disconnect(),(p=l.removeEventListener)==null||p.call(l,"change",n)}},[e]),t}function Yt(e=document.documentElement){var t,r;try{const a=((t=e.closest)==null?void 0:t.call(e,"[data-theme], .nice-dark, .nice-light, .dark"))??document.documentElement,n=a.getAttribute("data-theme");if(n==="dark")return!0;if(n==="light")return!1;if(a.classList.contains("nice-dark")||a.classList.contains("dark"))return!0;if(a.classList.contains("nice-light"))return!1;const s=getComputedStyle(e),i=s.getPropertyValue("--text-primary").trim()||s.color;if(i){const o=i.match(/rgba?\(([^)]+)\)/);if(o){const[l,d,u]=o[1].split(",").map(f=>parseFloat(f.trim()));return(.299*l+.587*d+.114*u)/255>.5}if(/^#([0-9a-f]{3,8})$/i.test(i)){const l=i.replace("#",""),d=l.length===3?l.split("").map(h=>h+h).join(""):l.slice(0,6),u=parseInt(d.slice(0,2),16),f=parseInt(d.slice(2,4),16),p=parseInt(d.slice(4,6),16);return(.299*u+.587*f+.114*p)/255>.5}}return((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)??!1}catch{return!1}}const Ud=["NiceTextInput","NiceTextArea","NiceNumberInput","NiceDateTimePicker","NiceSelect","NiceCheckbox","NiceToggle","NiceRadioGroup","NiceSlider","NiceColorPicker","NiceAutocomplete","NiceLookup","NiceCalendar","NiceDateRangeBox","NiceTagBox","NiceRangeSlider","NiceDropDownBox","NiceHtmlEditor","NiceForm","NiceRating","NiceOtpInput","NiceMentionInput","NiceTreeSelect","NiceMaskedInput","NiceKnob","NicePickList","NiceInlineEdit","NiceButton","NiceButtonGroup","NiceDropDownButton","NiceSpeedDialAction","NiceTable","NiceDataGrid","NiceList","NiceTreeView","NiceTreeList","NiceTileView","NicePivotGrid","NiceKanbanBoard","NiceSpreadsheet","NiceBadge","NiceTag","NiceAvatar","NiceAvatarGroup","NiceProgress","NiceDivider","NiceTooltip","NiceSkeleton","NiceSpinner","NiceEmpty","NiceTimeline","NiceCarousel","NiceVirtualScroller","NiceAlert","NiceModal","NiceDrawer","NiceToastContainer","NiceConfirmDialog","NiceCookieConsent","NiceTabs","NiceAccordion","NiceBreadcrumb","NicePagination","NiceCard","NiceMenu","NiceContextMenu","NiceSplitter","NiceAppLayout","NiceDashboardLayout","NiceDesktop","NiceConsole","NiceChart","NicePieChart","NicePolarChart","NiceCircularGauge","NiceLinearGauge","NiceBarGauge","NiceSparkline","NiceBullet","NiceFunnel","NiceSankey","NiceRangeSelector","NiceVectorMap","NiceHeatMap","NiceTreeMap","NiceStockChart","NiceOrganizationChart","NiceActionSheet","NicePopover","NiceLoadPanel","NiceWindow","NiceBlockUI","NiceScheduler","NiceGantt","NiceDiagram","NiceStepper","NiceBox","NiceResponsiveBox","NiceResizable","NiceScrollView","NiceChat","NiceUpload","NiceFileManager","NiceFilterBuilder","NiceGallery","NiceMap","div","span","row","column","stack","container"];function qd(e){const t=[];ho(e.root,t,"root");const r=new Set((e.dataSources??[]).map(a=>a.id));return bo(e.root,r,t),t}function ho(e,t,r){if((!e.type||e.type.trim()==="")&&t.push(`${r}: type is empty`),e.children)for(let a=0;a<e.children.length;a++)ho(e.children[a],t,`${r}.children[${a}]`)}function bo(e,t,r){if(e.bindings)for(const[a,n]of Object.entries(e.bindings)){const s=n.split(".")[0];!t.has(s)&&s!=="form"&&s!=="route"&&r.push(`Binding "${a}" references unknown data source "${s}"`)}if(e.children)for(const a of e.children)bo(a,t,r)}function Gd(e,t){const r=Kd(t,e.field);switch(e.operator){case"eq":return r===e.value;case"neq":return r!==e.value;case"gt":return r>e.value;case"gte":return r>=e.value;case"lt":return r<e.value;case"lte":return r<=e.value;case"contains":return String(r).includes(String(e.value));case"empty":return r==null||String(r)==="";case"notEmpty":return r!=null&&String(r)!=="";default:return!0}}function Kd(e,t){const r=t.split(".");let a=e;for(const n of r)if(a&&typeof a=="object"&&n in a)a=a[n];else return;return a}function vo(e){const{itemCount:t,itemHeight:r,containerHeight:a,overscan:n=3,initialScrollTop:s=0}=e,[i,o]=c.useState(s),[l,d]=c.useState(!1),u=c.useRef(void 0),f=c.useMemo(()=>{if(typeof r=="number")return null;const k=new Array(t+1);k[0]=0;for(let C=0;C<t;C++)k[C+1]=k[C]+r(C);return k},[t,r]),p=c.useMemo(()=>typeof r=="number"?t*r:f?f[t]:0,[t,r,f]),h=c.useCallback(k=>typeof r=="number"?r:r(k),[r]),m=c.useCallback(k=>typeof r=="number"?k*r:f?f[k]:0,[r,f]),y=c.useCallback(k=>{if(typeof r=="number")return Math.floor(k/r);if(!f)return 0;let C=0,M=t-1;for(;C<=M;){const N=Math.floor((C+M)/2),L=f[N];if(L===k)return N;L<k?C=N+1:M=N-1}return Math.max(0,C-1)},[t,r,f]),{startIndex:g,endIndex:v,visibleItems:b}=c.useMemo(()=>{const k=Math.max(0,y(i)-n);let C=k,M=m(k);for(;C<t&&M<i+a;)M+=h(C),C++;C=Math.min(t,C+n);const N=[];for(let L=k;L<C;L++)N.push({index:L,offset:m(L),height:h(L),key:L});return{startIndex:k,endIndex:C,visibleItems:N}},[i,a,t,n,y,m,h]),S=c.useCallback(k=>{const C=k.currentTarget;o(C.scrollTop),d(!0),u.current&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{d(!1)},150)},[]),w=c.useCallback((k,C="start")=>{const M=m(k),N=h(k);let L;switch(C){case"center":L=M-a/2+N/2;break;case"end":L=M-a+N;break;default:L=M}o(Math.max(0,Math.min(L,p-a)))},[m,h,a,p]),A=c.useCallback(k=>{o(Math.max(0,Math.min(k,p-a)))},[p,a]);return c.useEffect(()=>()=>{u.current&&window.clearTimeout(u.current)},[]),{visibleItems:b,totalHeight:p,scrollTop:i,scrollToIndex:w,scrollTo:A,onScroll:S,startIndex:g,endIndex:v,isScrolling:l}}function Jd(e){const{rowCount:t,columnCount:r,rowHeight:a,columnWidth:n,containerHeight:s,containerWidth:i,overscan:o=2}=e,[l,d]=c.useState(0),[u,f]=c.useState(0),[p,h]=c.useState(!1),m=c.useRef(void 0),y=c.useMemo(()=>{if(typeof a=="number")return t*a;let S=0;for(let w=0;w<t;w++)S+=a(w);return S},[t,a]),g=c.useMemo(()=>{if(typeof n=="number")return r*n;let S=0;for(let w=0;w<r;w++)S+=n(w);return S},[r,n]),v=c.useMemo(()=>{const S=[];let w=0,A=0;if(typeof a=="number")w=Math.floor(l/a),A=w*a;else for(;w<t&&A+a(w)<l;)A+=a(w),w++;w=Math.max(0,w-o);let k=w,C=typeof a=="number"?w*a:A;for(;k<t&&C<l+s;)C+=typeof a=="number"?a:a(k),k++;k=Math.min(t,k+o);let M=0,N=0;if(typeof n=="number")M=Math.floor(u/n),N=M*n;else for(;M<r&&N+n(M)<u;)N+=n(M),M++;M=Math.max(0,M-o);let L=M,E=typeof n=="number"?M*n:N;for(;L<r&&E<u+i;)E+=typeof n=="number"?n:n(L),L++;L=Math.min(r,L+o);let R=typeof a=="number"?w*a:(()=>{let T=0;for(let D=0;D<w;D++)T+=a(D);return T})();for(let T=w;T<k;T++){const D=typeof a=="number"?a:a(T);let F=typeof n=="number"?M*n:(()=>{let z=0;for(let H=0;H<M;H++)z+=n(H);return z})();for(let z=M;z<L;z++){const H=typeof n=="number"?n:n(z);S.push({rowIndex:T,columnIndex:z,top:R,left:F,width:H,height:D,key:`${T}:${z}`}),F+=H}R+=D}return S},[l,u,t,r,a,n,s,i,o]),b=c.useCallback(S=>{const w=S.currentTarget;d(w.scrollTop),f(w.scrollLeft),h(!0),m.current&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>{h(!1)},150)},[]);return c.useEffect(()=>()=>{m.current&&window.clearTimeout(m.current)},[]),{visibleCells:v,totalWidth:g,totalHeight:y,onScroll:b,scrollTop:l,scrollLeft:u,isScrolling:p}}function Yd(e,t,r,a=3){const n=vo({itemCount:e.length,itemHeight:r,containerHeight:t,overscan:a}),s=c.useCallback(i=>e[i.index],[e]);return{...n,getItemData:s,containerStyle:{height:t,overflow:"auto"},innerStyle:{height:n.totalHeight,position:"relative"},getItemStyle:i=>({position:"absolute",top:i.offset,left:0,right:0,height:i.height})}}function Qd(e){const{items:t,searchFn:r,debounce:a=0,minLength:n=0}=e,[s,i]=c.useState(""),o=c.useDeferredValue(s),[l,d]=c.useState(""),u=c.useRef(void 0);c.useEffect(()=>{if(a>0)return u.current=window.setTimeout(()=>{d(s)},a),()=>{u.current&&window.clearTimeout(u.current)};d(s)},[s,a]);const f=c.useDeferredValue(l),p=c.useMemo(()=>f.length<n?t:t.filter(m=>r(m,f)),[t,f,r,n]);return{query:s,setQuery:i,results:p,isStale:f!==o,deferredQuery:f}}function Zd(e){const[t,r]=c.useState(e),[a,n]=c.useState(e),[s,i]=c.useTransition(),o=c.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),i(()=>{r(u)})},[t]),l=c.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),r(u)},[t]);return{value:t,pendingValue:a,isPending:s,setValue:o,setValueImmediate:l}}function eu(e){const{data:t,processFn:r,chunkSize:a=1e3,priority:n="user-visible"}=e,[s,i]=c.useState(null),[o,l]=c.useState(0),[d,u]=c.useState(!1),f=c.useRef(!1),p=c.useCallback(async()=>{if(t.length===0){i([]);return}u(!0),l(0),f.current=!1;const m=[],y=t.length;for(let g=0;g<y&&!f.current;g+=a){const v=t.slice(g,g+a),b=v.map((w,A)=>r(w,g+A));m.push(...b);const S=Math.min(100,(g+v.length)/y*100);n==="background"?await new Promise(w=>{"requestIdleCallback"in window?window.requestIdleCallback(w):setTimeout(w,0)}):n==="user-visible"&&await new Promise(w=>requestAnimationFrame(w)),c.startTransition(()=>{l(S)})}i(m),u(!1),l(100)},[t,r,a,n]),h=c.useCallback(()=>{f.current=!0},[]);return c.useEffect(()=>(p(),()=>{f.current=!0}),[p]),{result:s,progress:o,isProcessing:d,process:p,cancel:h}}function tu(e,t={}){const{initialCount:r=20,batchSize:a=50,batchDelay:n=16}=t,[s,i]=c.useState(Math.min(r,e.length)),[o,l]=c.useState(e.length<=r);return c.useEffect(()=>{if(s>=e.length){l(!0);return}const u=setTimeout(()=>{c.startTransition(()=>{i(f=>Math.min(f+a,e.length))})},n);return()=>clearTimeout(u)},[s,e.length,a,n]),c.useEffect(()=>{i(Math.min(r,e.length)),l(e.length<=r)},[e,r]),{visibleItems:c.useMemo(()=>e.slice(0,s),[e,s]),visibleCount:s,totalCount:e.length,isComplete:o,progress:s/e.length*100}}function ru(e){const{initial:t,mutate:r,rollbackOnError:a=!0}=e,[n,s]=c.useState(t),[i,o]=c.useState(!1),[l,d]=c.useState(null),u=c.useRef(t),f=c.useCallback(async h=>{u.current=n,d(null),s(h),o(!0);try{const m=await r(h);s(m)}catch(m){d(m instanceof Error?m:new Error(String(m))),a&&s(u.current)}finally{o(!1)}},[n,r,a]),p=c.useCallback(()=>{s(t),d(null),o(!1)},[t]);return{value:n,update:f,isPending:i,error:l,reset:p}}function au(e){const{workerScript:t,idleTimeout:r=3e4}=e,[a,n]=c.useState(null),[s,i]=c.useState(!1),[o,l]=c.useState(null),d=c.useRef(null),u=c.useRef(0),f=c.useRef(null),p=c.useRef(void 0),h=c.useCallback(()=>{if(!d.current){if(typeof t=="function"){const b=new Blob([`(${t.toString()})()`],{type:"application/javascript"});d.current=new Worker(URL.createObjectURL(b))}else d.current=new Worker(t,{type:"module"});d.current.onmessage=b=>{const S=b.data;S.id===f.current&&(S.type==="result"?(n(S.result??null),i(!1),f.current=null,m()):S.type==="error"&&(l(new Error(S.error)),i(!1),f.current=null,m()))},d.current.onerror=b=>{l(new Error(b.message)),i(!1),f.current=null}}return d.current},[t]),m=c.useCallback(()=>{p.current&&window.clearTimeout(p.current),r>0&&(p.current=window.setTimeout(()=>{d.current&&!f.current&&(d.current.terminate(),d.current=null)},r))},[r]),y=c.useCallback(b=>new Promise((S,w)=>{const A=h(),k=`task-${++u.current}`;f.current=k,i(!0),l(null);const C=A.onmessage;A.onmessage=M=>{C==null||C.call(A,M),M.data.id===k&&(M.data.type==="result"?S(M.data.result):M.data.type==="error"&&w(new Error(M.data.error)))},A.postMessage({type:"task",id:k,data:b})}),[h]),g=c.useCallback(()=>{d.current&&f.current&&(d.current.postMessage({type:"cancel",id:f.current}),f.current=null,i(!1))},[]),v=c.useCallback(()=>{d.current&&(d.current.terminate(),d.current=null),p.current&&window.clearTimeout(p.current),f.current=null,i(!1)},[]);return c.useEffect(()=>()=>{v()},[v]),{result:a,isProcessing:s,error:o,execute:y,cancel:g,terminate:v}}function nu(e){const{workerScript:t,poolSize:r=navigator.hardwareConcurrency||4,idleTimeout:a=6e4}=e,n=c.useRef([]),s=c.useRef([]),i=c.useRef(0),o=c.useRef(void 0),l=c.useCallback(()=>{if(typeof t=="function"){const g=new Blob([`(${t.toString()})()`],{type:"application/javascript"});return new Worker(URL.createObjectURL(g))}return new Worker(t,{type:"module"})},[t]),d=c.useCallback(()=>{const g=n.current.find(v=>!v.busy);if(g)return g;if(n.current.length<r){const b={worker:l(),busy:!1,taskId:null};return n.current.push(b),b}return null},[l,r]),u=c.useCallback(()=>{for(;s.current.length>0;){const g=d();if(!g)break;const v=s.current.shift();g.busy=!0,g.taskId=v.id,g.worker.onmessage=b=>{const S=b.data;S.id===v.id&&(g.busy=!1,g.taskId=null,S.type==="result"?v.resolve(S.result):S.type==="error"&&v.reject(new Error(S.error)),u(),f())},g.worker.onerror=b=>{g.busy=!1,g.taskId=null,v.reject(new Error(b.message)),u()},g.worker.postMessage({type:"task",id:v.id,data:v.data})}},[d]),f=c.useCallback(()=>{o.current&&window.clearTimeout(o.current),a>0&&(o.current=window.setTimeout(()=>{n.current.filter(v=>!v.busy).forEach(v=>{v.worker.terminate(),n.current=n.current.filter(b=>b!==v)})},a))},[a]),p=c.useCallback(g=>new Promise((v,b)=>{const S=`pool-task-${++i.current}`;s.current.push({id:S,data:g,resolve:v,reject:b}),u()}),[u]),h=c.useCallback(g=>Promise.all(g.map(v=>p(v))),[p]),m=c.useCallback(()=>{n.current.forEach(g=>g.worker.terminate()),n.current=[],s.current=[],o.current&&window.clearTimeout(o.current)},[]),y=c.useCallback(()=>({total:n.current.length,busy:n.current.filter(g=>g.busy).length,idle:n.current.filter(g=>!g.busy).length,queued:s.current.length}),[]);return c.useEffect(()=>()=>{m()},[m]),{execute:p,executeAll:h,terminateAll:m,getStats:y}}function su(e){const t=`
|
|
123
123
|
self.onmessage = function(e) {
|
|
124
124
|
const msg = e.data;
|
|
125
125
|
|