@nice2dev/ui-core 1.4.26 → 1.4.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),x=require("react/jsx-runtime"),A=require("./input-layer-C7WPpx2F.cjs"),W=require("@nice2dev/i18n"),zi={small:"sm",medium:"md",large:"lg"};function _i(e,t){return e?zi[e]??e:"md"}function Oi(e){return e==="danger"?"error":e}/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),x=require("react/jsx-runtime"),A=require("./input-layer-C7WPpx2F.cjs"),W=require("@nice2dev/i18n"),Hi={small:"sm",medium:"md",large:"lg"};function _i(e,t){return e?Hi[e]??e:"md"}function Bi(e){return e==="danger"?"error":e}/**
2
2
  * @file themeVariants.ts
3
3
  * @description Extended theme variants - radius, shadows, fills, gradients, effects
4
4
  *
@@ -7,15 +7,15 @@
7
7
  * @version 1.0.0
8
8
  * @since 2026-03
9
9
  * @license MIT
10
- */const Me={none:{xs:"0",sm:"0",md:"0",lg:"0",xl:"0",full:"0"},sm:{xs:"2px",sm:"3px",md:"4px",lg:"6px",xl:"8px",full:"9999px"},md:{xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px",full:"9999px"},lg:{xs:"6px",sm:"10px",md:"14px",lg:"20px",xl:"28px",full:"9999px"},xl:{xs:"10px",sm:"16px",md:"24px",lg:"32px",xl:"48px",full:"9999px"},"2xl":{xs:"16px",sm:"24px",md:"32px",lg:"48px",xl:"64px",full:"9999px"},full:{xs:"9999px",sm:"9999px",md:"9999px",lg:"9999px",xl:"9999px",full:"9999px"}},Ge={none:"none",subtle:"0 1px 2px 0 var(--nice-overlay-5, rgba(0, 0, 0, 0.05))",md:"0 4px 6px -1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 2px 4px -2px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",lg:"0 10px 15px -3px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 4px 6px -4px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",xl:"0 20px 25px -5px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 8px 10px -6px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",inner:"inset 0 2px 4px 0 var(--nice-overlay-5, rgba(0, 0, 0, 0.05))",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.4))",glow:"0 0 20px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))"},qr={none:"none",subtle:"0 1px 2px 0 var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",md:"0 4px 6px -1px var(--nice-overlay-30, rgba(0, 0, 0, 0.3)), 0 2px 4px -2px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",lg:"0 10px 15px -3px var(--nice-overlay-40, rgba(0, 0, 0, 0.4)), 0 4px 6px -4px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",xl:"0 20px 25px -5px var(--nice-overlay-50, rgba(0, 0, 0, 0.5)), 0 8px 10px -6px var(--nice-overlay-40, rgba(0, 0, 0, 0.4))",inner:"inset 0 2px 4px 0 var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))",glow:"0 0 30px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.6))"},Le={compact:{paddingX:"8px",paddingY:"4px",gap:"4px",fontSize:"13px",lineHeight:"1.3",inputHeight:"28px",buttonHeight:"28px"},normal:{paddingX:"12px",paddingY:"8px",gap:"8px",fontSize:"14px",lineHeight:"1.5",inputHeight:"36px",buttonHeight:"36px"},comfortable:{paddingX:"16px",paddingY:"12px",gap:"12px",fontSize:"15px",lineHeight:"1.6",inputHeight:"44px",buttonHeight:"44px"},spacious:{paddingX:"24px",paddingY:"16px",gap:"16px",fontSize:"16px",lineHeight:"1.7",inputHeight:"52px",buttonHeight:"52px"}},Ze={none:{duration:"0ms",easing:"linear",hoverScale:"1",clickScale:"1",enterAnimation:"none",exitAnimation:"none"},subtle:{duration:"150ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.01",clickScale:"0.99",enterAnimation:"ntd-fade-in 150ms ease-out",exitAnimation:"ntd-fade-out 100ms ease-in"},normal:{duration:"200ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.02",clickScale:"0.98",enterAnimation:"ntd-slide-up 200ms ease-out",exitAnimation:"ntd-slide-down 150ms ease-in"},playful:{duration:"300ms",easing:"cubic-bezier(0.34, 1.56, 0.64, 1)",hoverScale:"1.05",clickScale:"0.95",enterAnimation:"ntd-bounce-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",exitAnimation:"ntd-bounce-out 200ms ease-in"},dramatic:{duration:"400ms",easing:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",hoverScale:"1.08",clickScale:"0.92",enterAnimation:"ntd-zoom-in 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55)",exitAnimation:"ntd-zoom-out 250ms ease-in"}};function Bi(e,t,r){switch(e){case"solid":return{background:t};case"gradient-linear":return{background:`linear-gradient(135deg, ${t} 0%, ${r||oe(t,-20)} 100%)`};case"gradient-radial":return{background:`radial-gradient(circle at top left, ${t} 0%, ${r||oe(t,-30)} 100%)`};case"glass":return{background:"var(--nice-overlay-light-10, rgba(255, 255, 255, 0.1))",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2))"};case"frosted":return{background:"var(--nice-overlay-light-70, rgba(255, 255, 255, 0.7))",backdropFilter:"blur(20px) saturate(180%)",WebkitBackdropFilter:"blur(20px) saturate(180%)",border:"1px solid var(--nice-overlay-light-30, rgba(255, 255, 255, 0.3))"};case"pattern":return{backgroundImage:`url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='${encodeURIComponent(t)}' fill-opacity='0.05'%3E%3Cpath d='M0 0h20L10 10z'/%3E%3C/g%3E%3C/svg%3E")`,backgroundColor:"var(--ntd-bg-surface)"};case"texture":return{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`,backgroundBlendMode:"overlay",backgroundColor:t};case"gradient-conic":return{background:`conic-gradient(from 180deg, ${t}, ${r||oe(t,-20)}, ${t})`};case"mesh":return{background:`radial-gradient(at 40% 20%, ${t} 0%, transparent 50%), radial-gradient(at 80% 0%, ${r||oe(t,30)} 0%, transparent 50%), radial-gradient(at 0% 50%, ${oe(t,-20)} 0%, transparent 50%)`,backgroundColor:"var(--ntd-bg-surface, #fff)"};default:return{background:t}}}function $t(e,t){const r={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...r,background:t,boxShadow:"none",border:"none"};case"raised":return{...r,background:t,boxShadow:"0 2px 4px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",border:"none"};case"outlined":return{...r,background:"transparent",border:`2px solid ${t}`,color:t};case"ghost":return{...r,background:"transparent",border:"none",color:t};case"soft":return{...r,background:`${t}20`,border:"none",color:t};case"gradient":return{...r,background:`linear-gradient(135deg, ${t} 0%, ${oe(t,-20)} 100%)`,border:"none",boxShadow:`0 4px 14px ${t}40`};case"3d":return{...r,background:t,border:"none",boxShadow:`0 4px 0 ${oe(t,-30)}, 0 6px 10px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))`,transform:"translateY(-2px)"};case"neumorphic":return{...r,background:"var(--ntd-bg-surface)",border:"none",boxShadow:"5px 5px 10px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), -5px -5px 10px var(--nice-overlay-light-80, rgba(255, 255, 255, 0.8))",color:t};case"pill":return{...r,background:t,border:"none",borderRadius:"9999px",paddingLeft:"24px",paddingRight:"24px"};case"link":return{...r,background:"transparent",border:"none",color:t,textDecoration:"underline",padding:"0"};case"brutal":return{...r,background:t,border:"3px solid var(--nice-border-color, #000)",boxShadow:"4px 4px 0 var(--nice-text, #000)",borderRadius:"0"};default:return r}}function Ht(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"bordered":return{...t,background:"var(--ntd-bg-input, var(--nice-bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",borderRadius:"var(--ntd-radius-md, 8px)"};case"filled":return{...t,background:"var(--ntd-bg-input-filled, var(--nice-bg-secondary, rgba(255,255,255,0.06)))",border:"2px solid transparent",borderRadius:"var(--ntd-radius-md, 8px)"};case"underlined":return{...t,background:"transparent",border:"none",borderBottom:"2px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",borderRadius:"0",paddingLeft:"0",paddingRight:"0"};case"floating":return{...t,background:"var(--ntd-bg-input, var(--nice-bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",borderRadius:"var(--ntd-radius-md, 8px)",paddingTop:"20px"};case"soft":return{...t,background:"var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.1))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-primary, transparent))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)",boxShadow:"inset 3px 3px 6px var(--nice-overlay-20, rgba(0, 0, 0, 0.2)), inset -3px -3px 6px var(--nice-overlay-light-5, rgba(255, 255, 255, 0.05))"};case"pill":return{...t,background:"var(--ntd-bg-input, var(--nice-bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",borderRadius:"9999px",paddingLeft:"20px",paddingRight:"20px"};case"flush":return{...t,background:"transparent",border:"none",borderRadius:"0",padding:"0",outline:"none"};default:return t}}function zt(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-secondary, transparent))",border:"none",boxShadow:"none"};case"elevated":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-secondary, transparent))",border:"none",boxShadow:"var(--ntd-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1))"};case"bordered":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-secondary, transparent))",border:"1px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",boxShadow:"none"};case"glass":return{...t,background:"var(--nice-overlay-light-10, rgba(255, 255, 255, 0.1))",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2))",boxShadow:"0 8px 32px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))"};case"gradient":return{...t,background:"linear-gradient(135deg, var(--ntd-bg-surface) 0%, var(--ntd-bg-elevated) 100%)",border:"none",boxShadow:"var(--ntd-shadow-md)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-secondary, transparent))",border:"none",boxShadow:"8px 8px 16px var(--nice-overlay-20, rgba(0, 0, 0, 0.2)), -8px -8px 16px var(--nice-overlay-light-5, rgba(255, 255, 255, 0.05))"};case"outlined":return{...t,background:"transparent",border:"2px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",boxShadow:"none"};case"paper":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-secondary, transparent))",border:"none",boxShadow:"2px 3px 8px var(--nice-overlay-6, rgba(0, 0, 0, 0.06))",borderRadius:"2px"};default:return t}}function Yr(e,t){const r={display:"inline-flex",alignItems:"center",fontSize:"0.75rem",fontWeight:"600",lineHeight:"1"};switch(e){case"solid":return{...r,background:t,color:"var(--nice-color-white, #fff)",padding:"2px 8px",borderRadius:"4px"};case"soft":return{...r,background:`${t}20`,color:t,padding:"2px 8px",borderRadius:"4px"};case"outlined":return{...r,background:"transparent",border:`1px solid ${t}`,color:t,padding:"2px 8px",borderRadius:"4px"};case"dot":return{...r,background:t,width:"8px",height:"8px",borderRadius:"50%",padding:"0"};case"pill":return{...r,background:t,color:"var(--nice-color-white, #fff)",padding:"2px 12px",borderRadius:"9999px"};case"gradient":return{...r,background:`linear-gradient(135deg, ${t}, ${oe(t,-20)})`,color:"var(--nice-text-primary, #fff)",padding:"2px 8px",borderRadius:"4px"};default:return r}}function Jr(e,t){switch(e){case"underline":return{borderBottom:`2px solid ${t}`,background:"transparent",color:t};case"pills":return{background:t,color:"var(--nice-color-white, #fff)",borderRadius:"9999px",padding:"6px 16px"};case"enclosed":return{background:"var(--ntd-bg-surface,#fff)",border:"1px solid var(--ntd-border-color,#e5e7eb)",borderBottom:"none",borderRadius:"8px 8px 0 0"};case"soft":return{background:`${t}15`,color:t,borderRadius:"6px",padding:"6px 16px"};case"lifted":return{background:"var(--ntd-bg-surface,#fff)",boxShadow:"0 -2px 8px var(--nice-overlay-6, rgba(0, 0, 0, 0.06))",borderRadius:"8px 8px 0 0",transform:"translateY(-2px)"};case"bordered":return{border:`2px solid ${t}`,borderBottom:"none",background:"transparent",borderRadius:"8px 8px 0 0"};default:return{}}}function Qr(e){switch(e){case"default":return{borderRadius:"12px",width:"44px",height:"24px"};case"ios":return{borderRadius:"16px",width:"51px",height:"31px",boxShadow:"inset 0 0 0 1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))"};case"flat":return{borderRadius:"4px",width:"40px",height:"22px"};case"pill":return{borderRadius:"9999px",width:"48px",height:"24px"};case"square":return{borderRadius:"0",width:"40px",height:"22px"};default:return{}}}function Zr(e){switch(e){case"dark":return{background:"var(--nice-bg-secondary, #1f2937)",color:"var(--nice-text-primary, #f9fafb)",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))"};case"light":return{background:"var(--nice-bg, #fff)",color:"var(--nice-text, #374151)",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",border:"1px solid var(--nice-border, #e5e7eb)"};case"primary":return{background:"var(--nice-color-primary,#6366f1)",color:"var(--nice-text-on-primary, #fff)",borderRadius:"6px",padding:"6px 12px"};case"glass":return{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",backdropFilter:"blur(12px)",color:"var(--nice-color-white, #fff)",borderRadius:"8px",padding:"8px 14px"};case"bordered":return{background:"var(--nice-bg, #fff)",color:"var(--nice-text, #374151)",borderRadius:"6px",padding:"6px 12px",border:"2px solid var(--nice-color-primary,#6366f1)"};default:return{}}}function ea(e){switch(e){case"default":return{borderCollapse:"collapse"};case"striped":return{borderCollapse:"collapse"};case"bordered":return{border:"1px solid var(--ntd-border-color,#e5e7eb)",borderCollapse:"collapse"};case"compact":return{borderCollapse:"collapse",fontSize:"0.8125rem"};case"hoverable":return{borderCollapse:"collapse"};case"minimal":return{borderCollapse:"collapse",borderBottom:"1px solid var(--ntd-border-color,#e5e7eb)"};default:return{}}}const te={radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",modalStyle:"default",tableStyle:"default",menuStyle:"default",animation:"normal",density:"normal"},et={minimal:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},rounded:{radius:"xl",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"comfortable"},sharp:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"subtle",density:"compact"},glass:{radius:"lg",shadow:"none",fill:"glass",buttonStyle:"ghost",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"normal"},neumorphic:{radius:"lg",shadow:"none",fill:"solid",buttonStyle:"neumorphic",inputStyle:"neumorphic",cardStyle:"neumorphic",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"default",animation:"subtle",density:"comfortable"},playful:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},enterprise:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},modern3d:{radius:"lg",shadow:"xl",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},brutalist:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},luxe:{radius:"sm",shadow:"lg",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"floating",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"underline",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"normal",density:"comfortable"},pill:{radius:"full",shadow:"md",fill:"solid",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},flat:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},editorial:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},dashboard:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},softCloud:{radius:"xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"normal",density:"comfortable"},cosmic:{radius:"lg",shadow:"glow",fill:"mesh",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},corporate:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"compact"},bank:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},government:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"flat",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"normal"},military:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},legal:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"none",density:"comfortable"},medical:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"striped",animation:"subtle",density:"normal"},swiss:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},scandinavian:{radius:"lg",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},bauhaus:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},notebook:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},terminal:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},hacker:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"compact"},retro8bit:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},vapor:{radius:"lg",shadow:"glow",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"playful",density:"comfortable"},synthwave:{radius:"md",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"normal"},cyberpunk:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"compact"},steampunk:{radius:"sm",shadow:"inner",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"normal"},origami:{radius:"none",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"default",animation:"normal",density:"normal"},watercolor:{radius:"2xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},neon:{radius:"md",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},candy:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},bubblegum:{radius:"full",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},cartoon:{radius:"xl",shadow:"colored",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"pill",tooltipStyle:"bordered",tableStyle:"bordered",animation:"playful",density:"comfortable"},kawaii:{radius:"full",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"dramatic",density:"spacious"},circus:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"},paper:{radius:"sm",shadow:"md",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},zen:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},monochrome:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},windows95:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},material:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},fluent:{radius:"md",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"subtle",density:"normal"},cupertino:{radius:"xl",shadow:"md",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},ant:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"subtle",density:"normal"},bootstrap:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"normal"},chakra:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},notion:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"flush",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},linear:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"subtle",density:"compact"},vercel:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"minimal",animation:"subtle",density:"normal"},gaming:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"gradient",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},kiddo:{radius:"2xl",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},disco:{radius:"full",shadow:"glow",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},clown:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"brutal",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"}};function _t(e,t=":root"){const r=Me[e.radius],a=e.shadow,n=Le[e.density],o=Ze[e.animation],s=[`${t} {`];for(const[i,c]of Object.entries(r))s.push(` --ntd-radius-${i}: ${c};`);s.push(` --ntd-shadow: ${Ge[a]};`),s.push(` --ntd-shadow-dark: ${qr[a]};`);for(const[i,c]of Object.entries(n)){const d=i.replace(/([A-Z])/g,"-$1").toLowerCase();s.push(` --ntd-${d}: ${c};`)}for(const[i,c]of Object.entries(o)){const d=i.replace(/([A-Z])/g,"-$1").toLowerCase();s.push(` --ntd-animation-${d}: ${c};`)}return e.backgroundImage&&s.push(` --ntd-bg-image: url('${e.backgroundImage}');`),e.backgroundOverlay&&s.push(` --ntd-bg-overlay: ${e.backgroundOverlay};`),s.push("}"),s.join(`
11
- `)}function Ot(e,t=document.documentElement,r){const a=r?`[data-ntd-provider="${r}"]`:":root",n=r?`ntd-variant-styles-${r}`:"ntd-variant-styles",o=_t(e,a);let s=document.getElementById(n);s||(s=document.createElement("style"),s.id=n,document.head.appendChild(s)),s.textContent=o,r&&t.setAttribute("data-ntd-provider",r),t.dataset.ntdRadius=e.radius,t.dataset.ntdShadow=e.shadow,t.dataset.ntdFill=e.fill,t.dataset.ntdButton=e.buttonStyle,t.dataset.ntdInput=e.inputStyle,t.dataset.ntdCard=e.cardStyle,t.dataset.ntdAnimation=e.animation,t.dataset.ntdDensity=e.density,e.badgeStyle&&(t.dataset.ntdBadge=e.badgeStyle),e.tabStyle&&(t.dataset.ntdTab=e.tabStyle),e.toggleStyle&&(t.dataset.ntdToggle=e.toggleStyle),e.tooltipStyle&&(t.dataset.ntdTooltip=e.tooltipStyle),e.modalStyle&&(t.dataset.ntdModal=e.modalStyle),e.tableStyle&&(t.dataset.ntdTable=e.tableStyle),e.menuStyle&&(t.dataset.ntdMenu=e.menuStyle)}function ta(e,t){const r=document.getElementById(`ntd-variant-styles-${e}`);r&&r.remove(),t&&t.removeAttribute("data-ntd-provider")}function oe(e,t){if(e.startsWith("#")){const r=e.slice(1),a=parseInt(r,16),n=Math.max(0,Math.min(255,(a>>16&255)+t)),o=Math.max(0,Math.min(255,(a>>8&255)+t)),s=Math.max(0,Math.min(255,(a&255)+t));return`#${(n<<16|o<<8|s).toString(16).padStart(6,"0")}`}return e}function ji(e,t){const r={...te,...t};return{...e,variantConfig:r}}const Wi=["default","minimal","rounded","sharp","glass","neumorphic","playful","enterprise","modern3d","brutalist","luxe","pill","flat","editorial","dashboard","softCloud","cosmic","corporate","bank","government","military","legal","medical","swiss","scandinavian","bauhaus","notebook","origami","watercolor","monochrome","paper","zen","terminal","hacker","retro8bit","synthwave","cyberpunk","steampunk","vapor","neon","windows95","material","fluent","cupertino","ant","bootstrap","chakra","notion","linear","vercel","candy","bubblegum","cartoon","kawaii","circus","gaming","kiddo","disco","clown"];function Te(e){return e==="default"?te:et[e]??te}const tt=l.createContext({displayStyle:"default",variantConfig:te,setDisplayStyle:()=>{}});function Vi(){return l.useContext(tt)}function Fe(e){const t=l.useContext(tt),r=e??t.displayStyle??"default",a=Te(r);return{style:r,config:a}}function Ui(e,t,r="var(--nice-color-primary, #6366f1)"){const{config:a}=Fe(t);return ra(e,a,r)}function Ki(e,t){const{config:r}=Fe(t);switch(e){case"button":return r.buttonStyle;case"input":return r.inputStyle;case"card":return r.cardStyle;case"badge":return r.badgeStyle??"solid";case"tab":return r.tabStyle??"underline";case"toggle":return r.toggleStyle??"default";case"tooltip":return r.tooltipStyle??"dark";case"modal":return r.modalStyle??"default";case"table":return r.tableStyle??"default";case"menu":return r.menuStyle??"default";default:return"default"}}function Gi(e){const{config:t}=Fe(e),r=Le[t.density];return{"--ntd-padding-x":r.paddingX,"--ntd-padding-y":r.paddingY,"--ntd-gap":r.gap,"--ntd-font-size":r.fontSize,"--ntd-line-height":r.lineHeight,"--ntd-input-height":r.inputHeight,"--ntd-button-height":r.buttonHeight}}function Xi(e){const{config:t}=Fe(e),r=Ze[t.animation];return{"--ntd-anim-duration":r.duration,"--ntd-anim-easing":r.easing,"--ntd-hover-scale":r.hoverScale,"--ntd-click-scale":r.clickScale}}function ra(e,t,r="var(--nice-info, #6366f1)"){switch(e){case"button":return $t(t.buttonStyle,r);case"input":return Ht(t.inputStyle);case"card":return zt(t.cardStyle);case"badge":return Yr(t.badgeStyle??"solid",r);case"tab":return Jr(t.tabStyle??"underline",r);case"toggle":return Qr(t.toggleStyle??"default");case"tooltip":return Zr(t.tooltipStyle??"dark");case"table":return ea(t.tableStyle??"default");case"menu":return{};case"modal":return{};default:return{}}}function aa(e){const t=Te(e);return{"data-ntd-display-style":e,"data-ntd-density":t.density,"data-ntd-animation":t.animation,"data-ntd-radius":t.radius,"data-ntd-button":t.buttonStyle,"data-ntd-input":t.inputStyle,"data-ntd-card":t.cardStyle}}const qi=[{name:"default",label:"Default",description:"Standard balanced look",density:"normal",animation:"normal"},{name:"minimal",label:"Minimal",description:"Subtle shadows, underlined inputs",density:"normal",animation:"subtle"},{name:"rounded",label:"Rounded",description:"Large radii, pill tabs, filled inputs",density:"comfortable",animation:"normal"},{name:"sharp",label:"Sharp",description:"Zero radius, bordered cards, compact",density:"compact",animation:"subtle"},{name:"glass",label:"Glass",description:"Glassmorphism with frosted backdrops",density:"normal",animation:"normal"},{name:"neumorphic",label:"Neumorphic",description:"Soft raised and sunken surfaces",density:"comfortable",animation:"subtle"},{name:"playful",label:"Playful",description:"Gradients, bouncy animations, colorful",density:"comfortable",animation:"playful"},{name:"enterprise",label:"Enterprise",description:"Conservative, outlined, striped tables",density:"compact",animation:"subtle"},{name:"modern3d",label:"Modern 3D",description:"Deep shadows, 3D buttons, elevated",density:"normal",animation:"normal"},{name:"brutalist",label:"Brutalist",description:"Raw bold borders, no radius, no shadow",density:"normal",animation:"none"},{name:"luxe",label:"Luxe",description:"Premium feel with gradients and depth",density:"comfortable",animation:"normal"},{name:"pill",label:"Pill",description:"Full-radius pill shapes everywhere",density:"normal",animation:"normal"},{name:"flat",label:"Flat",description:"No shadows, filled inputs, soft badges",density:"normal",animation:"subtle"},{name:"editorial",label:"Editorial",description:"Clean typographic, paper cards",density:"comfortable",animation:"subtle"},{name:"dashboard",label:"Dashboard",description:"Data-dense, enclosed tabs, striped",density:"compact",animation:"subtle"},{name:"softCloud",label:"Soft Cloud",description:"Frosted glass, soft iOS-style toggles",density:"comfortable",animation:"normal"},{name:"cosmic",label:"Cosmic",description:"Mesh backgrounds, glowing shadows",density:"comfortable",animation:"dramatic"},{name:"corporate",label:"Corporate",description:"Safe, grey, no flair — boardroom ready",density:"compact",animation:"none"},{name:"bank",label:"Bank",description:"Ultra-conservative, heavy borders",density:"compact",animation:"none"},{name:"government",label:"Government",description:"Accessible, high-contrast, minimal",density:"normal",animation:"none"},{name:"military",label:"Military",description:"Dark, angular, no-nonsense tactical",density:"compact",animation:"none"},{name:"legal",label:"Legal",description:"Typographic, paper-like, document feel",density:"comfortable",animation:"none"},{name:"medical",label:"Medical",description:"Clean clinical, professional blue-toned",density:"normal",animation:"subtle"},{name:"swiss",label:"Swiss",description:"Grid-based, Helvetica spirit, precision",density:"normal",animation:"subtle"},{name:"scandinavian",label:"Scandinavian",description:"Warm, spacious, hygge-inspired calm",density:"spacious",animation:"subtle"},{name:"bauhaus",label:"Bauhaus",description:"Geometric, primary colours, strong lines",density:"normal",animation:"none"},{name:"notebook",label:"Notebook",description:"Handwritten feel, paper textures, ruled",density:"comfortable",animation:"subtle"},{name:"origami",label:"Origami",description:"Folded paper, subtle shadows, layered",density:"normal",animation:"normal"},{name:"watercolor",label:"Watercolor",description:"Soft bleeding edges, artistic, dreamy",density:"comfortable",animation:"normal"},{name:"monochrome",label:"Monochrome",description:"Pure black & white, typography focus",density:"normal",animation:"none"},{name:"paper",label:"Paper",description:"Minimal white, subtle shadows, like stationery",density:"comfortable",animation:"subtle"},{name:"zen",label:"Zen",description:"Ultra-minimal, whitespace, meditative calm",density:"spacious",animation:"subtle"},{name:"terminal",label:"Terminal",description:"Monospace, dark, retro-computing green",density:"compact",animation:"none"},{name:"hacker",label:"Hacker",description:"Matrix-style, neon green on black",density:"compact",animation:"subtle"},{name:"retro8bit",label:"8-bit Retro",description:"Pixel art, chunky borders, game boy era",density:"normal",animation:"none"},{name:"synthwave",label:"Synthwave",description:"80s synth, neon grids, chrome gradients",density:"normal",animation:"dramatic"},{name:"cyberpunk",label:"Cyberpunk",description:"Angular, neon, glitch aesthetics, dark",density:"compact",animation:"dramatic"},{name:"steampunk",label:"Steampunk",description:"Brass, gears, Victorian-era technology",density:"normal",animation:"subtle"},{name:"vapor",label:"Vaporwave",description:"80s/90s aesthetics, pink/teal gradients",density:"comfortable",animation:"playful"},{name:"neon",label:"Neon",description:"Bright glowing outlines on dark surfaces",density:"normal",animation:"dramatic"},{name:"windows95",label:"Windows 95",description:"Chunky beveled 3D, classic OS nostalgia",density:"compact",animation:"none"},{name:"material",label:"Material",description:"Google Material Design — depth & motion",density:"normal",animation:"normal"},{name:"fluent",label:"Fluent",description:"Microsoft Fluent — acrylic, reveal, depth",density:"normal",animation:"subtle"},{name:"cupertino",label:"Cupertino",description:"Apple iOS/macOS style — frosted, rounded",density:"comfortable",animation:"normal"},{name:"ant",label:"Ant Design",description:"Ant Design — clean, reliable, professional",density:"normal",animation:"subtle"},{name:"bootstrap",label:"Bootstrap",description:"Bootstrap-like — rounded, striped tables",density:"normal",animation:"subtle"},{name:"chakra",label:"Chakra",description:"Chakra UI — accessible, clean, modern",density:"normal",animation:"normal"},{name:"notion",label:"Notion",description:"Notion-like — text-focused, minimal chrome",density:"normal",animation:"subtle"},{name:"linear",label:"Linear",description:"Linear app — sleek, dark, polished",density:"compact",animation:"subtle"},{name:"vercel",label:"Vercel",description:"Vercel/Next.js — black/white, sharp, modern",density:"normal",animation:"subtle"},{name:"candy",label:"Candy",description:"Sweet pastels, rounded, sugar rush!",density:"comfortable",animation:"playful"},{name:"bubblegum",label:"Bubblegum",description:"Pink puffy bubbles, extremely round",density:"spacious",animation:"playful"},{name:"cartoon",label:"Cartoon",description:"Thick outlines, bold colours, exaggerated",density:"comfortable",animation:"playful"},{name:"kawaii",label:"Kawaii",description:"Cute, pastel, sparkly, UwU aesthetic",density:"spacious",animation:"dramatic"},{name:"circus",label:"Circus",description:"Bold stripes, loud, step right up!",density:"spacious",animation:"dramatic"},{name:"gaming",label:"Gaming",description:"Dark, neon accents, angular, RGB everything",density:"normal",animation:"dramatic"},{name:"kiddo",label:"Kiddo",description:"Colourful, puffy, child-friendly, big touch",density:"spacious",animation:"playful"},{name:"disco",label:"Disco",description:"Flashing, spinning, Saturday night fever",density:"comfortable",animation:"dramatic"},{name:"clown",label:"Clown",description:"Maximum chaos, honk honk, pure madness",density:"spacious",animation:"dramatic"}];function Yi({enabled:e,readOnly:t,disabled:r}){const[a,n]=l.useState(!1),o=l.useRef(!1),s=l.useCallback(()=>{t||r||!e||(o.current=!0,n(!0))},[t,r,e]),i=l.useCallback(()=>{n(!1)},[]),c=l.useCallback(d=>{d&&o.current&&(o.current=!1,requestAnimationFrame(()=>{if(d.focus(),d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)try{d.select()}catch{}}))},[]);return l.useEffect(()=>{(t||r)&&a&&n(!1)},[t,r,a]),{isDisplay:!!e&&!a,enterEdit:s,exitEdit:i,autoFocusRef:c}}const Ji=({value:e,placeholder:t,disabled:r,readOnly:a,onActivate:n,className:o,ariaLabel:s})=>{const i=e==null||e==="",c=d=>{r||a||(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n())};return x.jsx("span",{role:"button",tabIndex:r?-1:0,className:`nice-display-value ${i?"nice-display-value--empty":""} ${r?"nice-display-value--disabled":""} ${a?"nice-display-value--readonly":""} ${o||""}`.trim(),onClick:()=>{!r&&!a&&n()},onKeyDown:c,"aria-label":s,"aria-disabled":r||void 0,children:i?t??"—":e})};function Qi(e){if(!e)return"";let t=e;return t=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),t=t.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""),t=t.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi,'$1=""'),t=t.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi,'$1=""'),t=t.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi,""),t}function Zi(e){const t=e.trim().toLowerCase();return!!(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("blob:")||t.startsWith("data:image/")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../"))}const ec=({style:e})=>x.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:"0.3em",height:"0.6em",margin:"0 0.35em 0.15em 0.1em",borderRight:"0.12em solid currentColor",borderBottom:"0.12em solid currentColor",transform:"rotate(45deg)",...e}}),tc=({style:e})=>x.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:"0.85em",height:"0.85em",borderRadius:"50%",border:"0.12em solid currentColor",borderTopColor:"transparent",transform:"rotate(-45deg)",...e}}),Cr={down:{transform:"rotate(45deg)",margin:"0 0 0.2em"},up:{transform:"rotate(-135deg)",margin:"0.2em 0 0"},left:{transform:"rotate(135deg)",margin:"0 0 0 0.2em"},right:{transform:"rotate(-45deg)",margin:"0 0.2em 0 0"}},rc=({direction:e,style:t})=>x.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:"0.45em",height:"0.45em",margin:Cr[e].margin,borderRight:"0.12em solid currentColor",borderBottom:"0.12em solid currentColor",transform:Cr[e].transform,...t}}),ac=({style:e})=>x.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:"0.5em",height:"0.5em",borderRadius:"50%",background:"currentColor",...e}}),nc=({style:e})=>x.jsxs("span",{"aria-hidden":"true",style:{display:"inline-block",position:"relative",width:"0.7em",height:"0.7em",...e},children:[x.jsx("span",{style:{position:"absolute",top:"50%",left:0,width:"100%",height:"0.12em",background:"currentColor",transform:"translateY(-50%) rotate(45deg)"}}),x.jsx("span",{style:{position:"absolute",top:"50%",left:0,width:"100%",height:"0.12em",background:"currentColor",transform:"translateY(-50%) rotate(-45deg)"}})]});function oc(){const[e,t]=l.useState(()=>typeof window<"u"?window.matchMedia("(pointer: coarse)").matches:!1);return l.useEffect(()=>{const r=window.matchMedia("(pointer: coarse)");t(r.matches);const a=n=>t(n.matches);return r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[]),e}function sc(){const[e,t]=l.useState(()=>typeof window<"u"&&window.matchMedia("(pointer: coarse)").matches?"touch":"mouse");return l.useEffect(()=>{const r=()=>t("touch"),a=n=>{n.pointerType==="mouse"&&t("mouse")};return window.addEventListener("touchstart",r,{passive:!0,capture:!0}),window.addEventListener("pointerdown",a,{capture:!0}),()=>{window.removeEventListener("touchstart",r,{capture:!0}),window.removeEventListener("pointerdown",a,{capture:!0})}},[]),e}function ic(e,t=500){const r=l.useRef(null),a=l.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]);return{onPointerDown:l.useCallback(o=>{o.pointerType==="touch"&&(a(),r.current=setTimeout(e,t))},[e,t,a]),onPointerUp:a,onPointerCancel:a}}function cc(){const e=l.useRef(null),t=l.useCallback(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),r=l.useCallback(a=>{t();let n=300;const o=()=>{a(),n=Math.max(30,n*.82),e.current=setTimeout(o,n)};e.current=setTimeout(o,400)},[t]);return l.useEffect(()=>t,[t]),{start:r,stop:t}}function lc(e){const t=l.useId();return e||t}function dc(e,t){const[r,a]=l.useState(e);return l.useEffect(()=>{const n=setTimeout(()=>a(e),t);return()=>clearTimeout(n)},[e,t]),r}function uc(e,t){l.useEffect(()=>{const r=a=>{!e.current||e.current.contains(a.target)||t()};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function fc(e,t){A.useOverlayFocus(e,{open:t,modal:!0})}function mc(e={}){const{defaultMode:t="system",storageKey:r="nice-color-mode",darkClass:a="nice-dark",lightClass:n="nice-light"}=e,[o,s]=l.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),[i,c]=l.useState(()=>{if(typeof window>"u")return t;const g=localStorage.getItem(r);return g==="light"||g==="dark"||g==="system"?g:t});l.useEffect(()=>{const g=window.matchMedia("(prefers-color-scheme: dark)"),p=m=>s(m.matches?"dark":"light");return g.addEventListener("change",p),()=>g.removeEventListener("change",p)},[]);const d=i==="system"?o==="dark":i==="dark";l.useEffect(()=>{const g=document.documentElement;return d?(g.classList.add(a),g.classList.remove(n)):(g.classList.add(n),g.classList.remove(a)),()=>{g.classList.remove(a,n)}},[d,a,n]),l.useEffect(()=>{localStorage.setItem(r,i)},[i,r]);const u=l.useCallback(()=>c("light"),[]),f=l.useCallback(()=>c("dark"),[]),b=l.useCallback(()=>c("system"),[]),h=l.useCallback(()=>c(g=>g==="system"?o==="dark"?"light":"dark":g==="dark"?"light":"dark"),[o]);return{isDark:d,mode:i,systemPreference:o,setLight:u,setDark:f,setSystem:b,toggle:h}}function pc(e,t={}){const{t:r}=W.useNiceTranslation(),{colorCount:a=5,quality:n=5}=t,[o,s]=l.useState(null),[i,c]=l.useState(!1),[d,u]=l.useState(null);return l.useEffect(()=>{if(!e){s(null);return}(async()=>{c(!0),u(null);try{let b;typeof e=="string"?(b=new Image,b.crossOrigin="anonymous",await new Promise((M,T)=>{b.onload=()=>M(),b.onerror=()=>T(new Error("Failed to load image")),b.src=e})):b=e;const h=document.createElement("canvas"),g=100,p=Math.min(g/b.width,g/b.height,1);h.width=b.width*p,h.height=b.height*p;const m=h.getContext("2d");if(!m)throw new Error("Canvas context unavailable");m.drawImage(b,0,0,h.width,h.height);const v=m.getImageData(0,0,h.width,h.height),y=[],S=Math.max(1,Math.floor(11-n));for(let M=0;M<v.data.length;M+=4*S){const T=v.data[M],P=v.data[M+1],$=v.data[M+2];if(v.data[M+3]>200){const _=(T+P+$)/3;_>20&&_<235&&y.push([T,P,$])}}if(y.length===0)throw new Error("No valid colors found in image");const E=gc(y,a).sort((M,T)=>{const P=Math.max(...M)-Math.min(...M);return Math.max(...T)-Math.min(...T)-P}),k=M=>"#"+M.map(T=>Math.round(T).toString(16).padStart(2,"0")).join(""),C=M=>(.299*M[0]+.587*M[1]+.114*M[2])/255>.5?"#000000":"#ffffff",N=E.slice();s({primary:k(N[0]||[100,100,100]),secondary:k(N[1]||N[0]||[150,150,150]),accent:k(E[0]||[100,100,100]),palette:N.map(k),primaryText:C(N[0]||[100,100,100]),secondaryText:C(N[1]||N[0]||[150,150,150])})}catch(b){u(b instanceof Error?b.message:r("brandColors.unknownError","Unknown error")),s(null)}finally{c(!1)}})()},[e,a,n,r]),{colors:o,loading:i,error:d}}function gc(e,t,r=20){if(e.length<=t)return e;const a=[],n=new Set;for(;a.length<t;){const o=Math.floor(Math.random()*e.length);n.has(o)||(n.add(o),a.push([...e[o]]))}for(let o=0;o<r;o++){const s=Array.from({length:t},()=>[]);for(const c of e){let d=1/0,u=0;for(let f=0;f<t;f++){const b=Math.sqrt((c[0]-a[f][0])**2+(c[1]-a[f][1])**2+(c[2]-a[f][2])**2);b<d&&(d=b,u=f)}s[u].push(c)}let i=!1;for(let c=0;c<t;c++){if(s[c].length===0)continue;const d=[0,0,0];for(const u of s[c])d[0]+=u[0],d[1]+=u[1],d[2]+=u[2];d[0]/=s[c].length,d[1]/=s[c].length,d[2]/=s[c].length,(Math.abs(d[0]-a[c][0])>1||Math.abs(d[1]-a[c][1])>1||Math.abs(d[2]-a[c][2])>1)&&(i=!0),a[c]=d}if(!i)break}return a}function yc(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),n=parseInt(t.slice(4,6),16),o=Math.max(r,a,n)/255,s=Math.min(r,a,n)/255;let i=0,c=0;const d=(o+s)/2;if(o!==s){const f=o-s;switch(c=d>.5?f/(2-o-s):f/(o+s),o){case r/255:i=((a/255-n/255)/f+(a<n?6:0))/6;break;case a/255:i=((n/255-r/255)/f+2)/6;break;case n/255:i=((r/255-a/255)/f+4)/6;break}}const u=(f,b,h)=>{const g=(w,E,k)=>(k<0&&(k+=1),k>1&&(k-=1),k<.16666666666666666?w+(E-w)*6*k:k<.5?E:k<.6666666666666666?w+(E-w)*(.6666666666666666-k)*6:w),p=h<.5?h*(1+b):h+b-h*b,m=2*h-p,v=Math.round(g(m,p,f+1/3)*255),y=Math.round(g(m,p,f)*255),S=Math.round(g(m,p,f-1/3)*255);return"#"+[v,y,S].map(w=>w.toString(16).padStart(2,"0")).join("")};return{lightest:u(i,Math.min(c*.3,1),.97),lighter:u(i,Math.min(c*.5,1),.9),light:u(i,Math.min(c*.7,1),.8),base:e,dark:u(i,Math.min(c*1.1,1),Math.max(d-.15,.1)),darker:u(i,Math.min(c*1.2,1),Math.max(d-.25,.05)),darkest:u(i,Math.min(c*1.3,1),Math.max(d-.35,.02)),text:d>.5?"#000000":"#ffffff",textInverse:d>.5?"#ffffff":"#000000"}}const be={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},fe=["xs","sm","md","lg","xl","xxl"];function De(e=be){const[t,r]=l.useState(()=>typeof window<"u"?window.innerWidth:e.lg);l.useEffect(()=>{let i;const c=()=>{i&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>r(window.innerWidth))};return window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c),i&&cancelAnimationFrame(i)}},[]);const a=l.useMemo(()=>{for(let i=fe.length-1;i>=0;i--)if(t>=e[fe[i]])return fe[i];return"xs"},[t,e]),n=l.useCallback(i=>t>=e[i],[t,e]),o=l.useCallback(i=>t<e[i],[t,e]),s=l.useCallback((i,c)=>t>=e[i]&&t<e[c],[t,e]);return{current:a,width:t,isAbove:n,isBelow:o,isBetween:s,isMobile:t<e.md,isTablet:t>=e.md&&t<e.lg,isDesktop:t>=e.lg}}function Xe(e){const[t,r]=l.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(e).matches);return l.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const a=window.matchMedia(e);r(a.matches);const n=o=>r(o.matches);return a.addEventListener("change",n),()=>a.removeEventListener("change",n)},[e]),t}function hc(e,t=be){const{current:r}=De(t);return l.useMemo(()=>{if(e==null||typeof e!="object"||Array.isArray(e))return e;const a=e,n=fe.indexOf(r);for(let o=n;o>=0;o--){const s=a[fe[o]];if(s!==void 0)return s}for(let o=n+1;o<fe.length;o++){const s=a[fe[o]];if(s!==void 0)return s}},[e,r])}function bc(e){const[t,r]=l.useState({width:0,height:0});return l.useEffect(()=>{const a=e.current;if(!a)return;const n=new ResizeObserver(([o])=>{const{width:s,height:i}=o.contentRect;r({width:s,height:i})});return n.observe(a),()=>n.disconnect()},[e]),t}function na(){const{width:e,isMobile:t}=De(),r=l.useMemo(()=>typeof window>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0,[]),a=Xe("(prefers-reduced-motion: reduce)"),n=Xe("(orientation: portrait)"),o=l.useMemo(()=>typeof window>"u"?1:window.devicePixelRatio||1,[]),s=t&&r,i=!t&&e<be.lg&&r,c=!r||e>=be.lg;return{isMobile:s||i,isTouch:r,isPhone:s,isTablet:i,isDesktop:c,prefersReducedMotion:a,isPortrait:n,pixelRatio:o}}function vc(e={}){const{forceVariant:t,breakpoints:r=be}=e,{isMobile:a,isTablet:n,isDesktop:o}=De(r),s=na();return t||(s.isPhone?"mobile":s.isTablet?"tablet":s.isDesktop?"desktop":a?"mobile":n?"tablet":"desktop")}function Sc(e={}){const{showAt:t,hideAt:r,mobileOnly:a,desktopOnly:n,tabletOnly:o}=e,{current:s,isMobile:i,isTablet:c,isDesktop:d}=De();return a?i:n?d:o?c:r&&r.includes(s)?!1:t?t.includes(s):!0}function xc(){return Xe("(orientation: portrait)")?"portrait":"landscape"}function wc(){const[e,t]=l.useState({top:0,right:0,bottom:0,left:0});return l.useEffect(()=>{if(typeof window>"u"||!CSS.supports("padding-top","env(safe-area-inset-top)"))return;const r=()=>{getComputedStyle(document.documentElement);const a=document.createElement("div");a.style.cssText=`
10
+ */const Me={none:{xs:"0",sm:"0",md:"0",lg:"0",xl:"0",full:"0"},sm:{xs:"2px",sm:"3px",md:"4px",lg:"6px",xl:"8px",full:"9999px"},md:{xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px",full:"9999px"},lg:{xs:"6px",sm:"10px",md:"14px",lg:"20px",xl:"28px",full:"9999px"},xl:{xs:"10px",sm:"16px",md:"24px",lg:"32px",xl:"48px",full:"9999px"},"2xl":{xs:"16px",sm:"24px",md:"32px",lg:"48px",xl:"64px",full:"9999px"},full:{xs:"9999px",sm:"9999px",md:"9999px",lg:"9999px",xl:"9999px",full:"9999px"}},Xe={none:"none",subtle:"0 1px 2px 0 var(--nice-overlay-5, rgba(0, 0, 0, 0.05))",md:"0 4px 6px -1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 2px 4px -2px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",lg:"0 10px 15px -3px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 4px 6px -4px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",xl:"0 20px 25px -5px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 8px 10px -6px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",inner:"inset 0 2px 4px 0 var(--nice-overlay-5, rgba(0, 0, 0, 0.05))",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.4))",glow:"0 0 20px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))"},qr={none:"none",subtle:"0 1px 2px 0 var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",md:"0 4px 6px -1px var(--nice-overlay-30, rgba(0, 0, 0, 0.3)), 0 2px 4px -2px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",lg:"0 10px 15px -3px var(--nice-overlay-40, rgba(0, 0, 0, 0.4)), 0 4px 6px -4px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",xl:"0 20px 25px -5px var(--nice-overlay-50, rgba(0, 0, 0, 0.5)), 0 8px 10px -6px var(--nice-overlay-40, rgba(0, 0, 0, 0.4))",inner:"inset 0 2px 4px 0 var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))",glow:"0 0 30px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.6))"},Fe={compact:{paddingX:"8px",paddingY:"4px",gap:"4px",fontSize:"13px",lineHeight:"1.3",inputHeight:"28px",buttonHeight:"28px"},normal:{paddingX:"12px",paddingY:"8px",gap:"8px",fontSize:"14px",lineHeight:"1.5",inputHeight:"36px",buttonHeight:"36px"},comfortable:{paddingX:"16px",paddingY:"12px",gap:"12px",fontSize:"15px",lineHeight:"1.6",inputHeight:"44px",buttonHeight:"44px"},spacious:{paddingX:"24px",paddingY:"16px",gap:"16px",fontSize:"16px",lineHeight:"1.7",inputHeight:"52px",buttonHeight:"52px"}},et={none:{duration:"0ms",easing:"linear",hoverScale:"1",clickScale:"1",enterAnimation:"none",exitAnimation:"none"},subtle:{duration:"150ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.01",clickScale:"0.99",enterAnimation:"ntd-fade-in 150ms ease-out",exitAnimation:"ntd-fade-out 100ms ease-in"},normal:{duration:"200ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.02",clickScale:"0.98",enterAnimation:"ntd-slide-up 200ms ease-out",exitAnimation:"ntd-slide-down 150ms ease-in"},playful:{duration:"300ms",easing:"cubic-bezier(0.34, 1.56, 0.64, 1)",hoverScale:"1.05",clickScale:"0.95",enterAnimation:"ntd-bounce-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",exitAnimation:"ntd-bounce-out 200ms ease-in"},dramatic:{duration:"400ms",easing:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",hoverScale:"1.08",clickScale:"0.92",enterAnimation:"ntd-zoom-in 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55)",exitAnimation:"ntd-zoom-out 250ms ease-in"}};function Oi(e,t,r){switch(e){case"solid":return{background:t};case"gradient-linear":return{background:`linear-gradient(135deg, ${t} 0%, ${r||oe(t,-20)} 100%)`};case"gradient-radial":return{background:`radial-gradient(circle at top left, ${t} 0%, ${r||oe(t,-30)} 100%)`};case"glass":return{background:"var(--nice-overlay-light-10, rgba(255, 255, 255, 0.1))",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2))"};case"frosted":return{background:"var(--nice-overlay-light-70, rgba(255, 255, 255, 0.7))",backdropFilter:"blur(20px) saturate(180%)",WebkitBackdropFilter:"blur(20px) saturate(180%)",border:"1px solid var(--nice-overlay-light-30, rgba(255, 255, 255, 0.3))"};case"pattern":return{backgroundImage:`url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='${encodeURIComponent(t)}' fill-opacity='0.05'%3E%3Cpath d='M0 0h20L10 10z'/%3E%3C/g%3E%3C/svg%3E")`,backgroundColor:"var(--ntd-bg-surface)"};case"texture":return{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`,backgroundBlendMode:"overlay",backgroundColor:t};case"gradient-conic":return{background:`conic-gradient(from 180deg, ${t}, ${r||oe(t,-20)}, ${t})`};case"mesh":return{background:`radial-gradient(at 40% 20%, ${t} 0%, transparent 50%), radial-gradient(at 80% 0%, ${r||oe(t,30)} 0%, transparent 50%), radial-gradient(at 0% 50%, ${oe(t,-20)} 0%, transparent 50%)`,backgroundColor:"var(--ntd-bg-surface, #fff)"};default:return{background:t}}}function zt(e,t){const r={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...r,background:t,boxShadow:"none",border:"none"};case"raised":return{...r,background:t,boxShadow:"0 2px 4px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",border:"none"};case"outlined":return{...r,background:"transparent",border:`2px solid ${t}`,color:t};case"ghost":return{...r,background:"transparent",border:"none",color:t};case"soft":return{...r,background:`${t}20`,border:"none",color:t};case"gradient":return{...r,background:`linear-gradient(135deg, ${t} 0%, ${oe(t,-20)} 100%)`,border:"none",boxShadow:`0 4px 14px ${t}40`};case"3d":return{...r,background:t,border:"none",boxShadow:`0 4px 0 ${oe(t,-30)}, 0 6px 10px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))`,transform:"translateY(-2px)"};case"neumorphic":return{...r,background:"var(--ntd-bg-surface)",border:"none",boxShadow:"5px 5px 10px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), -5px -5px 10px var(--nice-overlay-light-80, rgba(255, 255, 255, 0.8))",color:t};case"pill":return{...r,background:t,border:"none",borderRadius:"9999px",paddingLeft:"24px",paddingRight:"24px"};case"link":return{...r,background:"transparent",border:"none",color:t,textDecoration:"underline",padding:"0"};case"brutal":return{...r,background:t,border:"3px solid var(--nice-border-color, #000)",boxShadow:"4px 4px 0 var(--nice-text, #000)",borderRadius:"0"};default:return r}}function Ht(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"bordered":return{...t,background:"var(--ntd-bg-input, var(--nice-bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",borderRadius:"var(--ntd-radius-md, 8px)"};case"filled":return{...t,background:"var(--ntd-bg-input-filled, var(--nice-bg-secondary, rgba(255,255,255,0.06)))",border:"2px solid transparent",borderRadius:"var(--ntd-radius-md, 8px)"};case"underlined":return{...t,background:"transparent",border:"none",borderBottom:"2px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",borderRadius:"0",paddingLeft:"0",paddingRight:"0"};case"floating":return{...t,background:"var(--ntd-bg-input, var(--nice-bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",borderRadius:"var(--ntd-radius-md, 8px)",paddingTop:"20px"};case"soft":return{...t,background:"var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.1))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-primary, transparent))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)",boxShadow:"inset 3px 3px 6px var(--nice-overlay-20, rgba(0, 0, 0, 0.2)), inset -3px -3px 6px var(--nice-overlay-light-5, rgba(255, 255, 255, 0.05))"};case"pill":return{...t,background:"var(--ntd-bg-input, var(--nice-bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",borderRadius:"9999px",paddingLeft:"20px",paddingRight:"20px"};case"flush":return{...t,background:"transparent",border:"none",borderRadius:"0",padding:"0",outline:"none"};default:return t}}function _t(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-secondary, transparent))",border:"none",boxShadow:"none"};case"elevated":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-secondary, transparent))",border:"none",boxShadow:"var(--ntd-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1))"};case"bordered":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-secondary, transparent))",border:"1px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",boxShadow:"none"};case"glass":return{...t,background:"var(--nice-overlay-light-10, rgba(255, 255, 255, 0.1))",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2))",boxShadow:"0 8px 32px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))"};case"gradient":return{...t,background:"linear-gradient(135deg, var(--ntd-bg-surface) 0%, var(--ntd-bg-elevated) 100%)",border:"none",boxShadow:"var(--ntd-shadow-md)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-secondary, transparent))",border:"none",boxShadow:"8px 8px 16px var(--nice-overlay-20, rgba(0, 0, 0, 0.2)), -8px -8px 16px var(--nice-overlay-light-5, rgba(255, 255, 255, 0.05))"};case"outlined":return{...t,background:"transparent",border:"2px solid var(--ntd-border-color, var(--nice-border-color, #3a3a3a))",boxShadow:"none"};case"paper":return{...t,background:"var(--ntd-bg-surface, var(--nice-bg-secondary, transparent))",border:"none",boxShadow:"2px 3px 8px var(--nice-overlay-6, rgba(0, 0, 0, 0.06))",borderRadius:"2px"};default:return t}}function Yr(e,t){const r={display:"inline-flex",alignItems:"center",fontSize:"0.75rem",fontWeight:"600",lineHeight:"1"};switch(e){case"solid":return{...r,background:t,color:"var(--nice-color-white, #fff)",padding:"2px 8px",borderRadius:"4px"};case"soft":return{...r,background:`${t}20`,color:t,padding:"2px 8px",borderRadius:"4px"};case"outlined":return{...r,background:"transparent",border:`1px solid ${t}`,color:t,padding:"2px 8px",borderRadius:"4px"};case"dot":return{...r,background:t,width:"8px",height:"8px",borderRadius:"50%",padding:"0"};case"pill":return{...r,background:t,color:"var(--nice-color-white, #fff)",padding:"2px 12px",borderRadius:"9999px"};case"gradient":return{...r,background:`linear-gradient(135deg, ${t}, ${oe(t,-20)})`,color:"var(--nice-text-primary, #fff)",padding:"2px 8px",borderRadius:"4px"};default:return r}}function Jr(e,t){switch(e){case"underline":return{borderBottom:`2px solid ${t}`,background:"transparent",color:t};case"pills":return{background:t,color:"var(--nice-color-white, #fff)",borderRadius:"9999px",padding:"6px 16px"};case"enclosed":return{background:"var(--ntd-bg-surface,#fff)",border:"1px solid var(--ntd-border-color,#e5e7eb)",borderBottom:"none",borderRadius:"8px 8px 0 0"};case"soft":return{background:`${t}15`,color:t,borderRadius:"6px",padding:"6px 16px"};case"lifted":return{background:"var(--ntd-bg-surface,#fff)",boxShadow:"0 -2px 8px var(--nice-overlay-6, rgba(0, 0, 0, 0.06))",borderRadius:"8px 8px 0 0",transform:"translateY(-2px)"};case"bordered":return{border:`2px solid ${t}`,borderBottom:"none",background:"transparent",borderRadius:"8px 8px 0 0"};default:return{}}}function Qr(e){switch(e){case"default":return{borderRadius:"12px",width:"44px",height:"24px"};case"ios":return{borderRadius:"16px",width:"51px",height:"31px",boxShadow:"inset 0 0 0 1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))"};case"flat":return{borderRadius:"4px",width:"40px",height:"22px"};case"pill":return{borderRadius:"9999px",width:"48px",height:"24px"};case"square":return{borderRadius:"0",width:"40px",height:"22px"};default:return{}}}function Zr(e){switch(e){case"dark":return{background:"var(--nice-bg-secondary, #1f2937)",color:"var(--nice-text-primary, #f9fafb)",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))"};case"light":return{background:"var(--nice-bg, #fff)",color:"var(--nice-text, #374151)",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",border:"1px solid var(--nice-border, #e5e7eb)"};case"primary":return{background:"var(--nice-color-primary,#6366f1)",color:"var(--nice-text-on-primary, #fff)",borderRadius:"6px",padding:"6px 12px"};case"glass":return{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",backdropFilter:"blur(12px)",color:"var(--nice-color-white, #fff)",borderRadius:"8px",padding:"8px 14px"};case"bordered":return{background:"var(--nice-bg, #fff)",color:"var(--nice-text, #374151)",borderRadius:"6px",padding:"6px 12px",border:"2px solid var(--nice-color-primary,#6366f1)"};default:return{}}}function ea(e){switch(e){case"default":return{borderCollapse:"collapse"};case"striped":return{borderCollapse:"collapse"};case"bordered":return{border:"1px solid var(--ntd-border-color,#e5e7eb)",borderCollapse:"collapse"};case"compact":return{borderCollapse:"collapse",fontSize:"0.8125rem"};case"hoverable":return{borderCollapse:"collapse"};case"minimal":return{borderCollapse:"collapse",borderBottom:"1px solid var(--ntd-border-color,#e5e7eb)"};default:return{}}}const te={radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",modalStyle:"default",tableStyle:"default",menuStyle:"default",animation:"normal",density:"normal"},tt={minimal:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},rounded:{radius:"xl",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"comfortable"},sharp:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"subtle",density:"compact"},glass:{radius:"lg",shadow:"none",fill:"glass",buttonStyle:"ghost",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"normal"},neumorphic:{radius:"lg",shadow:"none",fill:"solid",buttonStyle:"neumorphic",inputStyle:"neumorphic",cardStyle:"neumorphic",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"default",animation:"subtle",density:"comfortable"},playful:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},enterprise:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},modern3d:{radius:"lg",shadow:"xl",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},brutalist:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},luxe:{radius:"sm",shadow:"lg",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"floating",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"underline",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"normal",density:"comfortable"},pill:{radius:"full",shadow:"md",fill:"solid",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},flat:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},editorial:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},dashboard:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},softCloud:{radius:"xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"normal",density:"comfortable"},cosmic:{radius:"lg",shadow:"glow",fill:"mesh",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},corporate:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"compact"},bank:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},government:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"flat",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"normal"},military:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},legal:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"none",density:"comfortable"},medical:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"striped",animation:"subtle",density:"normal"},swiss:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},scandinavian:{radius:"lg",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},bauhaus:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},notebook:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},terminal:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},hacker:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"compact"},retro8bit:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},vapor:{radius:"lg",shadow:"glow",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"playful",density:"comfortable"},synthwave:{radius:"md",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"normal"},cyberpunk:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"compact"},steampunk:{radius:"sm",shadow:"inner",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"normal"},origami:{radius:"none",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"default",animation:"normal",density:"normal"},watercolor:{radius:"2xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},neon:{radius:"md",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},candy:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},bubblegum:{radius:"full",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},cartoon:{radius:"xl",shadow:"colored",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"pill",tooltipStyle:"bordered",tableStyle:"bordered",animation:"playful",density:"comfortable"},kawaii:{radius:"full",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"dramatic",density:"spacious"},circus:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"},paper:{radius:"sm",shadow:"md",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},zen:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},monochrome:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},windows95:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},material:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},fluent:{radius:"md",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"subtle",density:"normal"},cupertino:{radius:"xl",shadow:"md",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},ant:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"subtle",density:"normal"},bootstrap:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"normal"},chakra:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},notion:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"flush",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},linear:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"subtle",density:"compact"},vercel:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"minimal",animation:"subtle",density:"normal"},gaming:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"gradient",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},kiddo:{radius:"2xl",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},disco:{radius:"full",shadow:"glow",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},clown:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"brutal",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"}};function Bt(e,t=":root"){const r=Me[e.radius],a=e.shadow,n=Fe[e.density],o=et[e.animation],s=[`${t} {`];for(const[i,c]of Object.entries(r))s.push(` --ntd-radius-${i}: ${c};`);s.push(` --ntd-shadow: ${Xe[a]};`),s.push(` --ntd-shadow-dark: ${qr[a]};`);for(const[i,c]of Object.entries(n)){const d=i.replace(/([A-Z])/g,"-$1").toLowerCase();s.push(` --ntd-${d}: ${c};`)}for(const[i,c]of Object.entries(o)){const d=i.replace(/([A-Z])/g,"-$1").toLowerCase();s.push(` --ntd-animation-${d}: ${c};`)}return e.backgroundImage&&s.push(` --ntd-bg-image: url('${e.backgroundImage}');`),e.backgroundOverlay&&s.push(` --ntd-bg-overlay: ${e.backgroundOverlay};`),s.push("}"),s.join(`
11
+ `)}function Ot(e,t=document.documentElement,r){const a=r?`[data-ntd-provider="${r}"]`:":root",n=r?`ntd-variant-styles-${r}`:"ntd-variant-styles",o=Bt(e,a);let s=document.getElementById(n);s||(s=document.createElement("style"),s.id=n,document.head.appendChild(s)),s.textContent=o,r&&t.setAttribute("data-ntd-provider",r),t.dataset.ntdRadius=e.radius,t.dataset.ntdShadow=e.shadow,t.dataset.ntdFill=e.fill,t.dataset.ntdButton=e.buttonStyle,t.dataset.ntdInput=e.inputStyle,t.dataset.ntdCard=e.cardStyle,t.dataset.ntdAnimation=e.animation,t.dataset.ntdDensity=e.density,e.badgeStyle&&(t.dataset.ntdBadge=e.badgeStyle),e.tabStyle&&(t.dataset.ntdTab=e.tabStyle),e.toggleStyle&&(t.dataset.ntdToggle=e.toggleStyle),e.tooltipStyle&&(t.dataset.ntdTooltip=e.tooltipStyle),e.modalStyle&&(t.dataset.ntdModal=e.modalStyle),e.tableStyle&&(t.dataset.ntdTable=e.tableStyle),e.menuStyle&&(t.dataset.ntdMenu=e.menuStyle)}function ta(e,t){const r=document.getElementById(`ntd-variant-styles-${e}`);r&&r.remove(),t&&t.removeAttribute("data-ntd-provider")}function oe(e,t){if(e.startsWith("#")){const r=e.slice(1),a=parseInt(r,16),n=Math.max(0,Math.min(255,(a>>16&255)+t)),o=Math.max(0,Math.min(255,(a>>8&255)+t)),s=Math.max(0,Math.min(255,(a&255)+t));return`#${(n<<16|o<<8|s).toString(16).padStart(6,"0")}`}return e}function ji(e,t){const r={...te,...t};return{...e,variantConfig:r}}const Wi=["default","minimal","rounded","sharp","glass","neumorphic","playful","enterprise","modern3d","brutalist","luxe","pill","flat","editorial","dashboard","softCloud","cosmic","corporate","bank","government","military","legal","medical","swiss","scandinavian","bauhaus","notebook","origami","watercolor","monochrome","paper","zen","terminal","hacker","retro8bit","synthwave","cyberpunk","steampunk","vapor","neon","windows95","material","fluent","cupertino","ant","bootstrap","chakra","notion","linear","vercel","candy","bubblegum","cartoon","kawaii","circus","gaming","kiddo","disco","clown"];function Te(e){return e==="default"?te:tt[e]??te}const rt=l.createContext({displayStyle:"default",variantConfig:te,setDisplayStyle:()=>{}});function Vi(){return l.useContext(rt)}function De(e){const t=l.useContext(rt),r=e??t.displayStyle??"default",a=Te(r);return{style:r,config:a}}function Ui(e,t,r="var(--nice-color-primary, #6366f1)"){const{config:a}=De(t);return ra(e,a,r)}function Ki(e,t){const{config:r}=De(t);switch(e){case"button":return r.buttonStyle;case"input":return r.inputStyle;case"card":return r.cardStyle;case"badge":return r.badgeStyle??"solid";case"tab":return r.tabStyle??"underline";case"toggle":return r.toggleStyle??"default";case"tooltip":return r.tooltipStyle??"dark";case"modal":return r.modalStyle??"default";case"table":return r.tableStyle??"default";case"menu":return r.menuStyle??"default";default:return"default"}}function Gi(e){const{config:t}=De(e),r=Fe[t.density];return{"--ntd-padding-x":r.paddingX,"--ntd-padding-y":r.paddingY,"--ntd-gap":r.gap,"--ntd-font-size":r.fontSize,"--ntd-line-height":r.lineHeight,"--ntd-input-height":r.inputHeight,"--ntd-button-height":r.buttonHeight}}function Xi(e){const{config:t}=De(e),r=et[t.animation];return{"--ntd-anim-duration":r.duration,"--ntd-anim-easing":r.easing,"--ntd-hover-scale":r.hoverScale,"--ntd-click-scale":r.clickScale}}function ra(e,t,r="var(--nice-info, #6366f1)"){switch(e){case"button":return zt(t.buttonStyle,r);case"input":return Ht(t.inputStyle);case"card":return _t(t.cardStyle);case"badge":return Yr(t.badgeStyle??"solid",r);case"tab":return Jr(t.tabStyle??"underline",r);case"toggle":return Qr(t.toggleStyle??"default");case"tooltip":return Zr(t.tooltipStyle??"dark");case"table":return ea(t.tableStyle??"default");case"menu":return{};case"modal":return{};default:return{}}}function aa(e){const t=Te(e);return{"data-ntd-display-style":e,"data-ntd-density":t.density,"data-ntd-animation":t.animation,"data-ntd-radius":t.radius,"data-ntd-button":t.buttonStyle,"data-ntd-input":t.inputStyle,"data-ntd-card":t.cardStyle}}const qi=[{name:"default",label:"Default",description:"Standard balanced look",density:"normal",animation:"normal"},{name:"minimal",label:"Minimal",description:"Subtle shadows, underlined inputs",density:"normal",animation:"subtle"},{name:"rounded",label:"Rounded",description:"Large radii, pill tabs, filled inputs",density:"comfortable",animation:"normal"},{name:"sharp",label:"Sharp",description:"Zero radius, bordered cards, compact",density:"compact",animation:"subtle"},{name:"glass",label:"Glass",description:"Glassmorphism with frosted backdrops",density:"normal",animation:"normal"},{name:"neumorphic",label:"Neumorphic",description:"Soft raised and sunken surfaces",density:"comfortable",animation:"subtle"},{name:"playful",label:"Playful",description:"Gradients, bouncy animations, colorful",density:"comfortable",animation:"playful"},{name:"enterprise",label:"Enterprise",description:"Conservative, outlined, striped tables",density:"compact",animation:"subtle"},{name:"modern3d",label:"Modern 3D",description:"Deep shadows, 3D buttons, elevated",density:"normal",animation:"normal"},{name:"brutalist",label:"Brutalist",description:"Raw bold borders, no radius, no shadow",density:"normal",animation:"none"},{name:"luxe",label:"Luxe",description:"Premium feel with gradients and depth",density:"comfortable",animation:"normal"},{name:"pill",label:"Pill",description:"Full-radius pill shapes everywhere",density:"normal",animation:"normal"},{name:"flat",label:"Flat",description:"No shadows, filled inputs, soft badges",density:"normal",animation:"subtle"},{name:"editorial",label:"Editorial",description:"Clean typographic, paper cards",density:"comfortable",animation:"subtle"},{name:"dashboard",label:"Dashboard",description:"Data-dense, enclosed tabs, striped",density:"compact",animation:"subtle"},{name:"softCloud",label:"Soft Cloud",description:"Frosted glass, soft iOS-style toggles",density:"comfortable",animation:"normal"},{name:"cosmic",label:"Cosmic",description:"Mesh backgrounds, glowing shadows",density:"comfortable",animation:"dramatic"},{name:"corporate",label:"Corporate",description:"Safe, grey, no flair — boardroom ready",density:"compact",animation:"none"},{name:"bank",label:"Bank",description:"Ultra-conservative, heavy borders",density:"compact",animation:"none"},{name:"government",label:"Government",description:"Accessible, high-contrast, minimal",density:"normal",animation:"none"},{name:"military",label:"Military",description:"Dark, angular, no-nonsense tactical",density:"compact",animation:"none"},{name:"legal",label:"Legal",description:"Typographic, paper-like, document feel",density:"comfortable",animation:"none"},{name:"medical",label:"Medical",description:"Clean clinical, professional blue-toned",density:"normal",animation:"subtle"},{name:"swiss",label:"Swiss",description:"Grid-based, Helvetica spirit, precision",density:"normal",animation:"subtle"},{name:"scandinavian",label:"Scandinavian",description:"Warm, spacious, hygge-inspired calm",density:"spacious",animation:"subtle"},{name:"bauhaus",label:"Bauhaus",description:"Geometric, primary colours, strong lines",density:"normal",animation:"none"},{name:"notebook",label:"Notebook",description:"Handwritten feel, paper textures, ruled",density:"comfortable",animation:"subtle"},{name:"origami",label:"Origami",description:"Folded paper, subtle shadows, layered",density:"normal",animation:"normal"},{name:"watercolor",label:"Watercolor",description:"Soft bleeding edges, artistic, dreamy",density:"comfortable",animation:"normal"},{name:"monochrome",label:"Monochrome",description:"Pure black & white, typography focus",density:"normal",animation:"none"},{name:"paper",label:"Paper",description:"Minimal white, subtle shadows, like stationery",density:"comfortable",animation:"subtle"},{name:"zen",label:"Zen",description:"Ultra-minimal, whitespace, meditative calm",density:"spacious",animation:"subtle"},{name:"terminal",label:"Terminal",description:"Monospace, dark, retro-computing green",density:"compact",animation:"none"},{name:"hacker",label:"Hacker",description:"Matrix-style, neon green on black",density:"compact",animation:"subtle"},{name:"retro8bit",label:"8-bit Retro",description:"Pixel art, chunky borders, game boy era",density:"normal",animation:"none"},{name:"synthwave",label:"Synthwave",description:"80s synth, neon grids, chrome gradients",density:"normal",animation:"dramatic"},{name:"cyberpunk",label:"Cyberpunk",description:"Angular, neon, glitch aesthetics, dark",density:"compact",animation:"dramatic"},{name:"steampunk",label:"Steampunk",description:"Brass, gears, Victorian-era technology",density:"normal",animation:"subtle"},{name:"vapor",label:"Vaporwave",description:"80s/90s aesthetics, pink/teal gradients",density:"comfortable",animation:"playful"},{name:"neon",label:"Neon",description:"Bright glowing outlines on dark surfaces",density:"normal",animation:"dramatic"},{name:"windows95",label:"Windows 95",description:"Chunky beveled 3D, classic OS nostalgia",density:"compact",animation:"none"},{name:"material",label:"Material",description:"Google Material Design — depth & motion",density:"normal",animation:"normal"},{name:"fluent",label:"Fluent",description:"Microsoft Fluent — acrylic, reveal, depth",density:"normal",animation:"subtle"},{name:"cupertino",label:"Cupertino",description:"Apple iOS/macOS style — frosted, rounded",density:"comfortable",animation:"normal"},{name:"ant",label:"Ant Design",description:"Ant Design — clean, reliable, professional",density:"normal",animation:"subtle"},{name:"bootstrap",label:"Bootstrap",description:"Bootstrap-like — rounded, striped tables",density:"normal",animation:"subtle"},{name:"chakra",label:"Chakra",description:"Chakra UI — accessible, clean, modern",density:"normal",animation:"normal"},{name:"notion",label:"Notion",description:"Notion-like — text-focused, minimal chrome",density:"normal",animation:"subtle"},{name:"linear",label:"Linear",description:"Linear app — sleek, dark, polished",density:"compact",animation:"subtle"},{name:"vercel",label:"Vercel",description:"Vercel/Next.js — black/white, sharp, modern",density:"normal",animation:"subtle"},{name:"candy",label:"Candy",description:"Sweet pastels, rounded, sugar rush!",density:"comfortable",animation:"playful"},{name:"bubblegum",label:"Bubblegum",description:"Pink puffy bubbles, extremely round",density:"spacious",animation:"playful"},{name:"cartoon",label:"Cartoon",description:"Thick outlines, bold colours, exaggerated",density:"comfortable",animation:"playful"},{name:"kawaii",label:"Kawaii",description:"Cute, pastel, sparkly, UwU aesthetic",density:"spacious",animation:"dramatic"},{name:"circus",label:"Circus",description:"Bold stripes, loud, step right up!",density:"spacious",animation:"dramatic"},{name:"gaming",label:"Gaming",description:"Dark, neon accents, angular, RGB everything",density:"normal",animation:"dramatic"},{name:"kiddo",label:"Kiddo",description:"Colourful, puffy, child-friendly, big touch",density:"spacious",animation:"playful"},{name:"disco",label:"Disco",description:"Flashing, spinning, Saturday night fever",density:"comfortable",animation:"dramatic"},{name:"clown",label:"Clown",description:"Maximum chaos, honk honk, pure madness",density:"spacious",animation:"dramatic"}];function Yi({enabled:e,readOnly:t,disabled:r}){const[a,n]=l.useState(!1),o=l.useRef(!1),s=l.useCallback(()=>{t||r||!e||(o.current=!0,n(!0))},[t,r,e]),i=l.useCallback(()=>{n(!1)},[]),c=l.useCallback(d=>{d&&o.current&&(o.current=!1,requestAnimationFrame(()=>{if(d.focus(),d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)try{d.select()}catch{}}))},[]);return l.useEffect(()=>{(t||r)&&a&&n(!1)},[t,r,a]),{isDisplay:!!e&&!a,enterEdit:s,exitEdit:i,autoFocusRef:c}}const Ji=({value:e,placeholder:t,disabled:r,readOnly:a,onActivate:n,className:o,ariaLabel:s})=>{const i=e==null||e==="",c=d=>{r||a||(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n())};return x.jsx("span",{role:"button",tabIndex:r?-1:0,className:`nice-display-value ${i?"nice-display-value--empty":""} ${r?"nice-display-value--disabled":""} ${a?"nice-display-value--readonly":""} ${o||""}`.trim(),onClick:()=>{!r&&!a&&n()},onKeyDown:c,"aria-label":s,"aria-disabled":r||void 0,children:i?t??"—":e})};function Qi(e){if(!e)return"";let t=e;return t=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),t=t.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""),t=t.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi,'$1=""'),t=t.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi,'$1=""'),t=t.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi,""),t}function Zi(e){const t=e.trim().toLowerCase();return!!(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("blob:")||t.startsWith("data:image/")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../"))}const ec=({style:e})=>x.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:"0.3em",height:"0.6em",margin:"0 0.35em 0.15em 0.1em",borderRight:"0.12em solid currentColor",borderBottom:"0.12em solid currentColor",transform:"rotate(45deg)",...e}}),tc=({style:e})=>x.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:"0.85em",height:"0.85em",borderRadius:"50%",border:"0.12em solid currentColor",borderTopColor:"transparent",transform:"rotate(-45deg)",...e}}),Cr={down:{transform:"rotate(45deg)",margin:"0 0 0.2em"},up:{transform:"rotate(-135deg)",margin:"0.2em 0 0"},left:{transform:"rotate(135deg)",margin:"0 0 0 0.2em"},right:{transform:"rotate(-45deg)",margin:"0 0.2em 0 0"}},rc=({direction:e,style:t})=>x.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:"0.45em",height:"0.45em",margin:Cr[e].margin,borderRight:"0.12em solid currentColor",borderBottom:"0.12em solid currentColor",transform:Cr[e].transform,...t}}),ac=({style:e})=>x.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:"0.5em",height:"0.5em",borderRadius:"50%",background:"currentColor",...e}}),nc=({style:e})=>x.jsxs("span",{"aria-hidden":"true",style:{display:"inline-block",position:"relative",width:"0.7em",height:"0.7em",...e},children:[x.jsx("span",{style:{position:"absolute",top:"50%",left:0,width:"100%",height:"0.12em",background:"currentColor",transform:"translateY(-50%) rotate(45deg)"}}),x.jsx("span",{style:{position:"absolute",top:"50%",left:0,width:"100%",height:"0.12em",background:"currentColor",transform:"translateY(-50%) rotate(-45deg)"}})]});function oc(){const[e,t]=l.useState(()=>typeof window<"u"?window.matchMedia("(pointer: coarse)").matches:!1);return l.useEffect(()=>{const r=window.matchMedia("(pointer: coarse)");t(r.matches);const a=n=>t(n.matches);return r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[]),e}function sc(){const[e,t]=l.useState(()=>typeof window<"u"&&window.matchMedia("(pointer: coarse)").matches?"touch":"mouse");return l.useEffect(()=>{const r=()=>t("touch"),a=n=>{n.pointerType==="mouse"&&t("mouse")};return window.addEventListener("touchstart",r,{passive:!0,capture:!0}),window.addEventListener("pointerdown",a,{capture:!0}),()=>{window.removeEventListener("touchstart",r,{capture:!0}),window.removeEventListener("pointerdown",a,{capture:!0})}},[]),e}function ic(e,t=500){const r=l.useRef(null),a=l.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]);return{onPointerDown:l.useCallback(o=>{o.pointerType==="touch"&&(a(),r.current=setTimeout(e,t))},[e,t,a]),onPointerUp:a,onPointerCancel:a}}function cc(){const e=l.useRef(null),t=l.useCallback(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),r=l.useCallback(a=>{t();let n=300;const o=()=>{a(),n=Math.max(30,n*.82),e.current=setTimeout(o,n)};e.current=setTimeout(o,400)},[t]);return l.useEffect(()=>t,[t]),{start:r,stop:t}}function lc(e){const t=l.useId();return e||t}function dc(e,t){const[r,a]=l.useState(e);return l.useEffect(()=>{const n=setTimeout(()=>a(e),t);return()=>clearTimeout(n)},[e,t]),r}function uc(e,t){l.useEffect(()=>{const r=a=>{!e.current||e.current.contains(a.target)||t()};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function fc(e,t){A.useOverlayFocus(e,{open:t,modal:!0})}function mc(e={}){const{defaultMode:t="system",storageKey:r="nice-color-mode",darkClass:a="nice-dark",lightClass:n="nice-light"}=e,[o,s]=l.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),[i,c]=l.useState(()=>{if(typeof window>"u")return t;const g=localStorage.getItem(r);return g==="light"||g==="dark"||g==="system"?g:t});l.useEffect(()=>{const g=window.matchMedia("(prefers-color-scheme: dark)"),p=m=>s(m.matches?"dark":"light");return g.addEventListener("change",p),()=>g.removeEventListener("change",p)},[]);const d=i==="system"?o==="dark":i==="dark";l.useEffect(()=>{const g=document.documentElement;return d?(g.classList.add(a),g.classList.remove(n)):(g.classList.add(n),g.classList.remove(a)),()=>{g.classList.remove(a,n)}},[d,a,n]),l.useEffect(()=>{localStorage.setItem(r,i)},[i,r]);const u=l.useCallback(()=>c("light"),[]),f=l.useCallback(()=>c("dark"),[]),b=l.useCallback(()=>c("system"),[]),h=l.useCallback(()=>c(g=>g==="system"?o==="dark"?"light":"dark":g==="dark"?"light":"dark"),[o]);return{isDark:d,mode:i,systemPreference:o,setLight:u,setDark:f,setSystem:b,toggle:h}}function pc(e,t={}){const{t:r}=W.useNiceTranslation(),{colorCount:a=5,quality:n=5}=t,[o,s]=l.useState(null),[i,c]=l.useState(!1),[d,u]=l.useState(null);return l.useEffect(()=>{if(!e){s(null);return}(async()=>{c(!0),u(null);try{let b;typeof e=="string"?(b=new Image,b.crossOrigin="anonymous",await new Promise((M,T)=>{b.onload=()=>M(),b.onerror=()=>T(new Error("Failed to load image")),b.src=e})):b=e;const h=document.createElement("canvas"),g=100,p=Math.min(g/b.width,g/b.height,1);h.width=b.width*p,h.height=b.height*p;const m=h.getContext("2d");if(!m)throw new Error("Canvas context unavailable");m.drawImage(b,0,0,h.width,h.height);const v=m.getImageData(0,0,h.width,h.height),y=[],S=Math.max(1,Math.floor(11-n));for(let M=0;M<v.data.length;M+=4*S){const T=v.data[M],P=v.data[M+1],$=v.data[M+2];if(v.data[M+3]>200){const _=(T+P+$)/3;_>20&&_<235&&y.push([T,P,$])}}if(y.length===0)throw new Error("No valid colors found in image");const E=gc(y,a).sort((M,T)=>{const P=Math.max(...M)-Math.min(...M);return Math.max(...T)-Math.min(...T)-P}),k=M=>"#"+M.map(T=>Math.round(T).toString(16).padStart(2,"0")).join(""),C=M=>(.299*M[0]+.587*M[1]+.114*M[2])/255>.5?"#000000":"#ffffff",N=E.slice();s({primary:k(N[0]||[100,100,100]),secondary:k(N[1]||N[0]||[150,150,150]),accent:k(E[0]||[100,100,100]),palette:N.map(k),primaryText:C(N[0]||[100,100,100]),secondaryText:C(N[1]||N[0]||[150,150,150])})}catch(b){u(b instanceof Error?b.message:r("brandColors.unknownError","Unknown error")),s(null)}finally{c(!1)}})()},[e,a,n,r]),{colors:o,loading:i,error:d}}function gc(e,t,r=20){if(e.length<=t)return e;const a=[],n=new Set;for(;a.length<t;){const o=Math.floor(Math.random()*e.length);n.has(o)||(n.add(o),a.push([...e[o]]))}for(let o=0;o<r;o++){const s=Array.from({length:t},()=>[]);for(const c of e){let d=1/0,u=0;for(let f=0;f<t;f++){const b=Math.sqrt((c[0]-a[f][0])**2+(c[1]-a[f][1])**2+(c[2]-a[f][2])**2);b<d&&(d=b,u=f)}s[u].push(c)}let i=!1;for(let c=0;c<t;c++){if(s[c].length===0)continue;const d=[0,0,0];for(const u of s[c])d[0]+=u[0],d[1]+=u[1],d[2]+=u[2];d[0]/=s[c].length,d[1]/=s[c].length,d[2]/=s[c].length,(Math.abs(d[0]-a[c][0])>1||Math.abs(d[1]-a[c][1])>1||Math.abs(d[2]-a[c][2])>1)&&(i=!0),a[c]=d}if(!i)break}return a}function yc(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),n=parseInt(t.slice(4,6),16),o=Math.max(r,a,n)/255,s=Math.min(r,a,n)/255;let i=0,c=0;const d=(o+s)/2;if(o!==s){const f=o-s;switch(c=d>.5?f/(2-o-s):f/(o+s),o){case r/255:i=((a/255-n/255)/f+(a<n?6:0))/6;break;case a/255:i=((n/255-r/255)/f+2)/6;break;case n/255:i=((r/255-a/255)/f+4)/6;break}}const u=(f,b,h)=>{const g=(w,E,k)=>(k<0&&(k+=1),k>1&&(k-=1),k<.16666666666666666?w+(E-w)*6*k:k<.5?E:k<.6666666666666666?w+(E-w)*(.6666666666666666-k)*6:w),p=h<.5?h*(1+b):h+b-h*b,m=2*h-p,v=Math.round(g(m,p,f+1/3)*255),y=Math.round(g(m,p,f)*255),S=Math.round(g(m,p,f-1/3)*255);return"#"+[v,y,S].map(w=>w.toString(16).padStart(2,"0")).join("")};return{lightest:u(i,Math.min(c*.3,1),.97),lighter:u(i,Math.min(c*.5,1),.9),light:u(i,Math.min(c*.7,1),.8),base:e,dark:u(i,Math.min(c*1.1,1),Math.max(d-.15,.1)),darker:u(i,Math.min(c*1.2,1),Math.max(d-.25,.05)),darkest:u(i,Math.min(c*1.3,1),Math.max(d-.35,.02)),text:d>.5?"#000000":"#ffffff",textInverse:d>.5?"#ffffff":"#000000"}}const be="#ffffff",na="#000000",hc=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,bc=/^rgba?\(\s*([\d.]+%?)\s*[,\s]\s*([\d.]+%?)\s*[,\s]\s*([\d.]+%?)\s*(?:[,/]\s*([\d.]+%?)\s*)?\)$/i,vc=/^hsla?\(\s*([\d.]+)(?:deg)?\s*[,\s]\s*([\d.]+)%\s*[,\s]\s*([\d.]+)%\s*(?:[,/]\s*([\d.]+%?)\s*)?\)$/i,ht=e=>e.endsWith("%")?parseFloat(e)/100*255:parseFloat(e),Er=e=>e===void 0?void 0:e.endsWith("%")?parseFloat(e)/100:parseFloat(e);function Sc(e,t,r){const a=s=>(s+e/30)%12,n=t*Math.min(r,1-r),o=s=>r-n*Math.max(-1,Math.min(a(s)-3,Math.min(9-a(s),1)));return{r:o(0)*255,g:o(8)*255,b:o(4)*255}}function G(e){if(!e)return null;const t=e.trim(),r=t.match(hc);if(r){let o=r[1];o.length<=4&&(o=o.split("").map(i=>i+i).join(""));const s=i=>parseInt(o.slice(i,i+2),16);return{r:s(0),g:s(2),b:s(4),...o.length===8?{a:s(6)/255}:{}}}const a=t.match(bc);if(a){const o=Er(a[4]);return{r:ht(a[1]),g:ht(a[2]),b:ht(a[3]),...o!==void 0?{a:o}:{}}}const n=t.match(vc);if(n){const o=Er(n[4]);return{...Sc(parseFloat(n[1])%360,parseFloat(n[2])/100,parseFloat(n[3])/100),...o!==void 0?{a:o}:{}}}return null}function jt({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 Pe(e,t,r){const a=G(e),n=G(t);return!a||!n?e:jt({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 ee(e,t,r){if(G(e)&&G(t))return Pe(e,t,r);const a=Math.round(Math.max(0,Math.min(1,r))*1e3)/10;return`color-mix(in srgb, ${t} ${a}%, ${e})`}const Wt=(e,t)=>Pe(e,be,t),Vt=(e,t)=>Pe(e,na,t);function ie(e){const t=G(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 qe(e,t){return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function kt(e,t){return!G(e)||!G(t)?1:qe(ie(e),ie(t))}function oa(e,t,r){if(!G(e))return r;const a=ie(e),n=G(t)?ie(t):1,o=G(r)?ie(r):0;return qe(a,n)>=qe(a,o)?t:r}function Ct(e){var a;const t=((a=e.match(/#[0-9a-f]{3,8}\b|rgba?\([^)]*\)|hsla?\([^)]*\)/gi))==null?void 0:a.filter(n=>G(n)))??[];if(t.length===0)return null;const r=t.map(n=>G(n)).reduce((n,o)=>({r:n.r+o.r,g:n.g+o.g,b:n.b+o.b}),{r:0,g:0,b:0});return jt({r:r.r/t.length,g:r.g/t.length,b:r.b/t.length})}const ve=e=>!!e&&/gradient\(/i.test(e),sa=[1,.4,.28,.18,.11,.06],ia=[.14,.22,.3,.38,.46,.54],xc=6,Ut={"colors.accent":"{colors.primary}","colors.secondary":"{colors.accent}","colors.link":"{colors.primary}","colors.focus":"{colors.primary}","backgrounds.elevated":"{backgrounds.primary}","backgrounds.canvas":"{backgrounds.secondary}","text.onPrimary":be,"text.onAccent":"{text.onPrimary}","text.inverse":"{backgrounds.primary}","borders.divider":"{borders.color}","borders.focusColor":"{colors.focus}","layout.body.background":"{backgrounds.secondary}","layout.body.text":"{text.primary}","layout.panel.background":"{backgrounds.primary}","layout.panel.text":"{text.primary}","layout.panel.border":"{borders.color}","layout.topNav.background":"{backgrounds.elevated}","layout.topNav.text":"{text.primary}","layout.topNav.border":"{borders.color}","layout.sideNav.background":"{backgrounds.primary}","layout.sideNav.text":"{text.primary}","layout.sideNav.border":"{borders.color}","layout.sideNav.headers.base":"{colors.primary}","layout.sideNav.items.text":"{layout.sideNav.text}","layout.sideNav.highlight.base":"{colors.primary}","layout.sideNav.highlight.text":"{text.onPrimary}","scrollbar.track":"transparent","scrollbar.thumb":"{borders.color}","scrollbar.thumbHover":"{colors.primary}"},ca=["layout.body.background","layout.panel.background","layout.topNav.background","layout.sideNav.background","scrollbar.thumb"],wc=/^\{\s*([\w.-]+)\s*\}$/,la=/\{\s*([\w.-]+)\s*\}/g;function da(e){var t;return typeof e=="string"?((t=e.match(wc))==null?void 0:t[1])??null:null}function at(e){return[...(typeof e=="string"?e:e&&typeof e=="object"&&"css"in e?`${e.css} ${e.base??""}`:"").matchAll(la)].map(r=>r[1])}function nt(e,t){return t.split(".").reduce((r,a)=>{if(r&&typeof r=="object")return r[a]},e)}function Kt(e,t,r){if(typeof e=="string")r.push({path:t,value:e});else if(e&&typeof e=="object"){if(!Array.isArray(e)&&"css"in e&&t.startsWith("gradients."))return r.push({path:t,value:e}),r;for(const[a,n]of Object.entries(e))Kt(n,t?`${t}.${a}`:a,r)}return r}function kc(e,t){return Kt(e,"",[]).filter(r=>at(r.value).includes(t)).map(r=>r.path)}function Cc(e,t,r){const a=new Set,n=[r];for(;n.length>0;){const o=n.pop();if(o===t)return!0;if(a.has(o))continue;a.add(o);const s=nt(e,o)??Ut[o];n.push(...at(s))}return!1}function Ec(e,t,r){const a=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`\\{\\s*${a}\\s*\\}`,"g"),o=s=>typeof s=="string"?s.replace(n,`{${r}}`):Array.isArray(s)?s.map(o):s&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,c])=>[i,o(c)])):s;return o(e)}class Ie{constructor(t){this.theme=t,this.cache=new Map,this.cyclic=new Set,this.diagnostics=[]}diag(t){this.diagnostics.some(r=>r.path===t.path&&r.kind===t.kind&&r.ref===t.ref)||this.diagnostics.push(t)}resolve(t,r=[]){if(this.cache.has(t))return this.cache.get(t)??null;if(r.includes(t))return this.cyclic.add(t),this.diag({path:r[r.length-1]??t,kind:"cycle",ref:t,message:`Link loop: ${[...r.slice(r.indexOf(t)),t].join(" → ")}`}),null;const a=[...r,t],n=nt(this.theme,t);let o=n!==void 0?this.resolveRaw(t,n,a):null;const s=Ut[t];return!o&&s!==void 0&&s!==n&&(o=this.resolveRaw(t,s,a)),this.cache.set(t,o),o}resolveRaw(t,r,a){var o;if(r&&typeof r=="object"&&"css"in r){const s=r,i=this.substitute(t,s.css,a),c=s.base?(o=this.resolveRaw(t,s.base,a))==null?void 0:o.color:void 0;return{css:i,color:c??Ct(i)??"transparent"}}if(typeof r!="string")return null;const n=da(r);if(n){const s=this.resolve(n,a);return!s&&!this.cyclic.has(n)&&this.diag({path:t,kind:"missing",ref:n,message:`Link to a missing value: {${n}}`}),s}if(ve(r)){const s=this.substitute(t,r,a);return{css:s,color:Ct(s)??"transparent"}}return{css:r,color:r}}substitute(t,r,a){return r.replace(la,(n,o)=>{const s=this.resolve(o,a);return s?s.color:(this.diag({path:t,kind:"missing",ref:o,message:`Link to a missing value: {${o}}`}),"transparent")})}color(t){const r=this.resolve(t);return r?(ve(r.css)&&this.diag({path:t,kind:"gradient-in-color",message:`${t} takes a colour; the gradient's base colour is used`}),r.color):null}inlineColor(t,r){var a;return r===void 0?null:((a=this.resolveRaw(t,r,[t]))==null?void 0:a.color)??null}}function ua(e,t,r){return G(e)?kt(e,t)>=kt(e,r)?t:r:t}function Nr(e,t,r){return G(e)?ie(e)>.5?Vt(e,r):Wt(e,r*1.3):ee(e,t,r)}function fa(e,t){var d,u,f;const r=Math.max(1,Math.min(10,Math.round(e.count??xc))),a=(d=e.curve)!=null&&d.length?e.curve:t.curve,n=e.mode??"shade",o=t.color(e.base,`${t.path}.base`)??t.base,s=n==="palette"?((u=e.swatches)!=null&&u.length?e.swatches:Object.keys(t.palette)).map(b=>t.palette[b]).filter(b=>!!b):[],i=n==="list"||e.sync===!1,c=[];for(let b=0;b<r;b++){const h=i?(f=e.levels)==null?void 0:f[b]:void 0,g=`${t.path}.levels.${b}`,p=s.length>0?s[b%s.length]:ee(t.over,o,a[Math.min(b,a.length-1)]),m=t.color(h==null?void 0:h.background,`${g}.background`)??p,v=t.color(h==null?void 0:h.text,`${g}.text`)??ua(m,t.text,t.onBase);c.push({bg:m,text:v,hoverBg:t.color(h==null?void 0:h.hoverBackground,`${g}.hoverBackground`)??Nr(m,v,.06),activeBg:t.color(h==null?void 0:h.activeBackground,`${g}.activeBackground`)??Nr(m,v,.12)})}return c}function Nc(e,t){return new Ie(e).resolve(t)}function Ac(e,t){const r=Re(e);if(t==="headers")return(r.headerLevels??ot(e,new Ie(e))).map(o=>({background:o.bg,text:o.text}));const a=new Ie(e);return ma(e,a).map(n=>({background:n.bg,text:n.text}))}function Mc(e,t,r,a){const n={};for(const o of Object.keys(e.palette??{})){const s=t.color(`palette.${o}`);s&&(n[o]=s)}return{over:t.color("layout.sideNav.background")??"transparent",base:t.color(`${r}.base`)??"transparent",text:t.color("layout.sideNav.text")??be,onBase:t.color("text.onPrimary")??be,palette:n,curve:a,color:(o,s)=>t.inlineColor(s,o),path:r}}function ot(e,t){var a,n;const r=((n=(a=e.layout)==null?void 0:a.sideNav)==null?void 0:n.headers)??{};return fa(r,Mc(e,t,"layout.sideNav.headers",sa))}function ma(e,t){var c,d,u;const r=((d=(c=e.layout)==null?void 0:c.sideNav)==null?void 0:d.highlight)??{},a=ot(e,t),n=t.color("layout.sideNav.highlight.base")??"transparent",o=t.color("layout.sideNav.highlight.text")??be,s=(u=r.curve)!=null&&u.length?r.curve:ia,i=r.mode==="list"||r.sync===!1;return a.map((f,b)=>{var m;const h=i?(m=r.levels)==null?void 0:m[b]:void 0,g=`layout.sideNav.highlight.levels.${b}`,p=t.inlineColor(`${g}.background`,h==null?void 0:h.background)??ee(f.bg,n,s[Math.min(b,s.length-1)]);return{bg:p,text:t.inlineColor(`${g}.text`,h==null?void 0:h.text)??ua(p,f.text,o)}})}const Ar=new WeakMap;function Tc(e){const t=Ar.get(e);if(t)return t;const r=new Ie(e),a=u=>{const f=r.resolve(u);return{color:(f==null?void 0:f.color)??"transparent",image:f&&ve(f.css)?f.css:void 0}},n=a("layout.topNav.background"),o=a("layout.sideNav.background"),s=a("layout.body.background"),i=a("layout.panel.background"),c=ot(e,r).slice(0,3),d={topNav:n.color,topNavImage:n.image,topNavText:r.color("layout.topNav.text")??"currentColor",sideNav:o.color,sideNavImage:o.image,sideNavText:r.color("layout.sideNav.text")??"currentColor",headers:c.map(u=>u.bg),headerTexts:c.map(u=>u.text),highlight:r.color("layout.sideNav.highlight.base")??"transparent",body:s.color,bodyImage:s.image,panel:i.color,panelImage:i.image,panelBorder:r.color("layout.panel.border")??"transparent",text:r.color("text.primary")??"currentColor",primary:r.color("colors.primary")??"currentColor",accent:r.color("colors.accent")??"currentColor"};return Ar.set(e,d),d}const Ic=[["layout.body","body"],["layout.panel","panel"],["layout.topNav","topnav"],["layout.sideNav","sidenav"]],Mr=e=>`${Math.round(Math.max(0,Math.min(1,e))*1e3)/10}%`,Tr=new WeakMap;function Re(e){var h,g,p;const t=Tr.get(e);if(t)return t;const r=new Ie(e),a=m=>nt(e,m)!==void 0,n=new Set(ca),o=m=>n.has(m)||m.startsWith("gradients."),s=Kt(e,"",[]).filter(m=>at(m.value).length>0);let i=e;if(s.length>0){i=JSON.parse(JSON.stringify(e));for(const{path:m}of s){const v=r.resolve(m),y=v?o(m)?v.css:v.color:void 0,S=m.split(".");let w=i;for(const E of S.slice(0,-1))w=w[E];y===void 0?delete w[S[S.length-1]]:w[S[S.length-1]]=y}}const c={};for(const[m,v]of Ic){if(a(`${m}.background`)){const y=r.resolve(`${m}.background`);y&&(c[`--nice-bg-${v}`]=y.color,c[`--nice-bg-${v}-image`]=ve(y.css)?y.css:"none")}if(a(`${m}.text`)){const y=r.color(`${m}.text`);y&&(c[`--nice-text-${v}`]=y)}if(v!=="body"&&a(`${m}.border`)){const y=r.color(`${m}.border`);y&&(c[`--nice-border-${v}`]=y)}if((v==="topnav"||v==="sidenav")&&(a(`${m}.background`)||a(`${m}.text`))){const y=((h=r.resolve(`${m}.background`))==null?void 0:h.color)??null,S=r.color(`${m}.text`);y&&S&&(c[`--nice-bg-${v}-2`]=ee(y,S,.05),c[`--nice-bg-${v}-3`]=ee(y,S,.09),c[`--nice-text-${v}-2`]=ee(S,y,.25),c[`--nice-text-${v}-3`]=ee(S,y,.42),c[`--nice-hover-bg-${v}`]=ee(y,S,.08))}}const d=(g=e.layout)==null?void 0:g.sideNav;if(d!=null&&d.items){const m={"--nice-bg-sidenav-item":d.items.background!==void 0?r.color("layout.sideNav.items.background"):null,"--nice-text-sidenav-item":d.items.text!==void 0?r.color("layout.sideNav.items.text"):null};for(const[v,y]of Object.entries(m))y&&(c[v]=y);typeof d.items.tint=="number"&&(c["--nice-sidenav-item-tint"]=Mr(d.items.tint))}let u;if(d!=null&&d.headers){u=ot(e,r),u.forEach((v,y)=>{const S=y+1;c[`--nice-sidebar-level-${S}-bg`]=v.bg,c[`--nice-sidebar-level-${S}-text`]=v.text,c[`--nice-sidebar-level-${S}-hover-bg`]=v.hoverBg,c[`--nice-sidebar-level-${S}-active-bg`]=v.activeBg}),c["--nice-sidebar-levels"]=String(u.length);const m=r.color("layout.sideNav.headers.base");m&&(c["--nice-sidenav-header-base"]=m),c["--nice-text-sidenav-header"]=u[0].text}if(d!=null&&d.highlight){const m=r.color("layout.sideNav.highlight.base");m&&(c["--nice-sidenav-highlight"]=m);const v=r.color("layout.sideNav.highlight.text");v&&(c["--nice-text-sidenav-highlight"]=v),(p=d.highlight.curve)==null||p.forEach((y,S)=>{S<6&&(c[`--nice-sidenav-highlight-step-${S+1}`]=Mr(y))}),(d.highlight.mode==="list"||d.highlight.sync===!1)&&ma(e,r).forEach((y,S)=>{c[`--nice-sidenav-path-${S+1}-bg`]=y.bg,c[`--nice-sidenav-path-${S+1}-text`]=y.text})}const f=e.scrollbar;if(f){if(f.track!==void 0){const m=r.color("scrollbar.track");m&&(c["--nice-scrollbar-track"]=m)}if(f.thumb!==void 0){const m=r.resolve("scrollbar.thumb");m&&(c["--nice-scrollbar-thumb"]=m.color,c["--nice-scrollbar-thumb-image"]=ve(m.css)?m.css:"none")}if(f.thumbHover!==void 0){const m=r.color("scrollbar.thumbHover");m&&(c["--nice-scrollbar-thumb-hover"]=m)}f.width&&(c["--nice-scrollbar-size"]=f.width),f.thumbWidth&&(c["--nice-scrollbar-thumb-size"]=f.thumbWidth),f.radius&&(c["--nice-scrollbar-radius"]=f.radius==="full"?"var(--nice-radius-full)":f.radius)}const b={theme:i,vars:c,headerLevels:u,diagnostics:r.diagnostics};return Tr.set(e,b),b}const pa={"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","text.onSuccess":"--text-on-success","text.onError":"--text-on-error","text.onInfo":"--text-on-info","text.onWarning":"--text-on-warning","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 Rc(e,t){return t.split(".").reduce((r,a)=>{if(r&&typeof r=="object")return r[a]},e)}function ga(e){return e.startsWith("--nice-")?null:`--nice-${e.slice(2)}`}function Ye(e){var n,o,s;const t=Re(e),r=t.theme,a={};for(const[i,c]of Object.entries(pa)){const d=Rc(r,i);if(d!==void 0){a[c]=String(d);const u=ga(c);u&&(a[u]=String(d))}}if(r.nesting)for(const i of["sidebar","menu","tree"]){const c=r.nesting[i];if(!c||i==="sidebar"&&((o=(n=r.layout)==null?void 0:n.sideNav)!=null&&o.headers))continue;const d=r.backgrounds.secondary||r.backgrounds.primary||"#ffffff",u=((s=r.text)==null?void 0:s.primary)||"#111111";Object.assign(a,Vc(i,c,d,u))}return Object.assign(a,t.vars),a}const Lc=()=>[...["body","panel","topnav","sidenav"].flatMap(e=>[`--nice-bg-${e}`,`--nice-bg-${e}-image`,`--nice-text-${e}`,`--nice-border-${e}`]),...["topnav","sidenav"].flatMap(e=>[`--nice-bg-${e}-2`,`--nice-bg-${e}-3`,`--nice-text-${e}-2`,`--nice-text-${e}-3`,`--nice-hover-bg-${e}`]),"--nice-bg-sidenav-item","--nice-text-sidenav-item","--nice-sidenav-item-tint","--nice-sidenav-header-base","--nice-text-sidenav-header","--nice-sidenav-highlight","--nice-text-sidenav-highlight",...[1,2,3,4,5,6].map(e=>`--nice-sidenav-highlight-step-${e}`),...[1,2,3,4,5,6,7,8,9,10].flatMap(e=>[`--nice-sidenav-path-${e}-bg`,`--nice-sidenav-path-${e}-text`]),"--nice-scrollbar-track","--nice-scrollbar-thumb","--nice-scrollbar-thumb-image","--nice-scrollbar-thumb-hover","--nice-scrollbar-size","--nice-scrollbar-thumb-size","--nice-scrollbar-radius"];function Fc(e,t){const r=t??document.documentElement,a=Ye(e);for(const[n,o]of Object.entries(a))r.style.setProperty(n,o);Pc(e.backgroundImage,r),e.darkMode&&(r.dataset.ntdColorScheme=e.darkMode)}const Dc={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 Pc(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=Dc[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 Et(e){const t=e??document.documentElement;for(const r of Object.values(pa)){t.style.removeProperty(r);const a=ga(r);a&&t.style.removeProperty(a)}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);for(const r of Lc())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 $c(e){const t=e??document.documentElement,r=getComputedStyle(t),a=s=>r.getPropertyValue(s).trim(),n=s=>parseFloat(r.getPropertyValue(s))||0,o=s=>a(s)||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:o("--color-accent"),accentHover:o("--color-accent-hover"),link:o("--color-link"),linkHover:o("--color-link-hover"),focus:o("--color-focus"),overlay:o("--color-overlay"),surface:o("--color-surface"),surfaceHover:o("--color-surface-hover"),disabled:o("--color-disabled"),disabledText:o("--color-disabled-text")},backgrounds:{primary:a("--bg-primary"),secondary:a("--bg-secondary"),tertiary:a("--bg-tertiary"),hover:a("--hover-bg"),elevated:o("--bg-elevated"),inset:o("--bg-inset"),canvas:o("--bg-canvas")},text:{primary:a("--text-primary"),secondary:a("--text-secondary"),muted:a("--text-muted"),inverse:o("--text-inverse"),onPrimary:o("--text-on-primary"),onAccent:o("--text-on-accent"),onSuccess:o("--text-on-success"),onError:o("--text-on-error"),onInfo:o("--text-on-info"),onWarning:o("--text-on-warning")},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:o("--border-width"),focusColor:o("--border-focus-color"),divider:o("--border-divider")},shadows:{sm:a("--shadow-sm"),md:a("--shadow-md"),lg:a("--shadow-lg"),xl:a("--shadow-xl"),inner:o("--shadow-inner"),glow:o("--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:o("--nice-space-10"),space12:o("--nice-space-12"),space16:o("--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:o("--nice-heading-font-family"),monoFontFamily:o("--nice-mono-font-family"),fontSize2xl:o("--nice-font-size-2xl"),fontSize3xl:o("--nice-font-size-3xl"),letterSpacing:o("--nice-letter-spacing"),headingLetterSpacing:o("--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 zc(e){return JSON.stringify(e,null,2)}function Hc(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 _c=G,Bc=Pe,Nt=Wt,At=Vt,Ir=ie,Oc=oa;function jc(e,t,r){const a=t.palette??[],n=t.bgStep??.06,o=a[0]??r;switch(t.bgDerivation??"tint"){case"palette":return a.length===0?r:a[(e-1)%a.length];case"shade":return At(o,Math.min(.9,n*(e-1)));case"mix-surface":return Bc(o,r,Math.min(1,n*(e-1)));case"tint":default:return Nt(o,Math.min(.9,n*(e-1)))}}function Wc(e){return _c(e)!=null}function ya(e,t,r,a){var o;const n=[];for(let s=1;s<=e;s++){const i=(o=t.overrides)==null?void 0:o[s],c=(i==null?void 0:i.background)??jc(s,t,r);n.push({bg:c,text:(i==null?void 0:i.text)??Oc(c,"#ffffff",a),hoverBg:(i==null?void 0:i.hoverBackground)??(Ir(c)>.5?At(c,.06):Nt(c,.08)),activeBg:(i==null?void 0:i.activeBackground)??(Ir(c)>.5?At(c,.12):Nt(c,.16)),border:i==null?void 0:i.border})}return n}function Vc(e,t,r,a){const n={},o=Math.max(1,Math.min(10,t.levels??5));return ya(o,t,r,a).forEach((s,i)=>{const c=i+1;n[`--nice-${e}-level-${c}-bg`]=s.bg,n[`--nice-${e}-level-${c}-text`]=s.text,n[`--nice-${e}-level-${c}-hover-bg`]=s.hoverBg,n[`--nice-${e}-level-${c}-active-bg`]=s.activeBg,s.border&&(n[`--nice-${e}-level-${c}-border`]=s.border)}),n[`--nice-${e}-levels`]=String(o),n}const Le=l.createContext(null);function Uc(){const e=l.useContext(Le);if(!e)throw new Error("useNiceTheme must be used within a NiceThemeProvider");return e}const Kc={position:"fixed",inset:0,zIndex:1e4,width:"auto",height:"auto",margin:0,borderRadius:0};function Gc(e){const[t,r]=l.useState(!1),[a,n]=l.useState(!1);l.useEffect(()=>{if(typeof document>"u")return;const d=()=>r(!!e.current&&document.fullscreenElement===e.current);return document.addEventListener("fullscreenchange",d),()=>document.removeEventListener("fullscreenchange",d)},[e]),l.useEffect(()=>{const d=e.current;if(!a||!d)return;const u=f=>{f.key==="Escape"&&!f.defaultPrevented&&n(!1)};return d.addEventListener("keydown",u),()=>d.removeEventListener("keydown",u)},[a,e]);const o=l.useCallback(async()=>{const d=e.current;if(d)try{if(typeof d.requestFullscreen!="function")throw new Error("no Fullscreen API");await d.requestFullscreen()}catch{n(!0)}},[e]),s=l.useCallback(async()=>{n(!1),typeof document<"u"&&document.fullscreenElement===e.current&&await document.exitFullscreen().catch(()=>{})},[e]),i=t||a,c=l.useCallback(()=>i?s():o(),[i,o,s]);return{isFullscreen:i,isFallback:a,enter:o,exit:s,toggle:c,fallbackStyle:a?Kc:void 0,portalTarget:t?e.current:null}}function Xc({target:e,children:t}){const r=l.useContext(Le),a=l.useMemo(()=>r&&e?{...r,portalTarget:e}:r,[r,e]);return a?x.jsx(Le.Provider,{value:a,children:t}):x.jsx(x.Fragment,{children:t})}const Se={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},fe=["xs","sm","md","lg","xl","xxl"];function $e(e=Se){const[t,r]=l.useState(()=>typeof window<"u"?window.innerWidth:e.lg);l.useEffect(()=>{let i;const c=()=>{i&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>r(window.innerWidth))};return window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c),i&&cancelAnimationFrame(i)}},[]);const a=l.useMemo(()=>{for(let i=fe.length-1;i>=0;i--)if(t>=e[fe[i]])return fe[i];return"xs"},[t,e]),n=l.useCallback(i=>t>=e[i],[t,e]),o=l.useCallback(i=>t<e[i],[t,e]),s=l.useCallback((i,c)=>t>=e[i]&&t<e[c],[t,e]);return{current:a,width:t,isAbove:n,isBelow:o,isBetween:s,isMobile:t<e.md,isTablet:t>=e.md&&t<e.lg,isDesktop:t>=e.lg}}function Je(e){const[t,r]=l.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(e).matches);return l.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const a=window.matchMedia(e);r(a.matches);const n=o=>r(o.matches);return a.addEventListener("change",n),()=>a.removeEventListener("change",n)},[e]),t}function qc(e,t=Se){const{current:r}=$e(t);return l.useMemo(()=>{if(e==null||typeof e!="object"||Array.isArray(e))return e;const a=e,n=fe.indexOf(r);for(let o=n;o>=0;o--){const s=a[fe[o]];if(s!==void 0)return s}for(let o=n+1;o<fe.length;o++){const s=a[fe[o]];if(s!==void 0)return s}},[e,r])}function Yc(e){const[t,r]=l.useState({width:0,height:0});return l.useEffect(()=>{const a=e.current;if(!a)return;const n=new ResizeObserver(([o])=>{const{width:s,height:i}=o.contentRect;r({width:s,height:i})});return n.observe(a),()=>n.disconnect()},[e]),t}function ha(){const{width:e,isMobile:t}=$e(),r=l.useMemo(()=>typeof window>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0,[]),a=Je("(prefers-reduced-motion: reduce)"),n=Je("(orientation: portrait)"),o=l.useMemo(()=>typeof window>"u"?1:window.devicePixelRatio||1,[]),s=t&&r,i=!t&&e<Se.lg&&r,c=!r||e>=Se.lg;return{isMobile:s||i,isTouch:r,isPhone:s,isTablet:i,isDesktop:c,prefersReducedMotion:a,isPortrait:n,pixelRatio:o}}function Jc(e={}){const{forceVariant:t,breakpoints:r=Se}=e,{isMobile:a,isTablet:n,isDesktop:o}=$e(r),s=ha();return t||(s.isPhone?"mobile":s.isTablet?"tablet":s.isDesktop?"desktop":a?"mobile":n?"tablet":"desktop")}function Qc(e={}){const{showAt:t,hideAt:r,mobileOnly:a,desktopOnly:n,tabletOnly:o}=e,{current:s,isMobile:i,isTablet:c,isDesktop:d}=$e();return a?i:n?d:o?c:r&&r.includes(s)?!1:t?t.includes(s):!0}function Zc(){return Je("(orientation: portrait)")?"portrait":"landscape"}function el(){const[e,t]=l.useState({top:0,right:0,bottom:0,left:0});return l.useEffect(()=>{if(typeof window>"u"||!CSS.supports("padding-top","env(safe-area-inset-top)"))return;const r=()=>{getComputedStyle(document.documentElement);const a=document.createElement("div");a.style.cssText=`
12
12
  position: fixed;
13
13
  top: 0;
14
14
  left: 0;
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}const kc=/(auto|scroll|overlay)/;function oa(e){var a;const t=((a=e==null?void 0:e.ownerDocument)==null?void 0:a.defaultView)??(typeof window<"u"?window:null);let r=(e==null?void 0:e.parentElement)??null;for(;r&&t;){if(kc.test(t.getComputedStyle(r).overflowY))return r;r=r.parentElement}return t??globalThis}function Cc(e,t){return e==="nearest"?oa(t):(typeof e=="function"?e():e)??(typeof window<"u"?window:globalThis)}const sa=e=>e.window===e;function Ec(e){return sa(e)?e.scrollY:e.scrollTop}function Nc(e,t,r=0){const a=t.getBoundingClientRect().top;return sa(e)?a+e.scrollY-r:a-e.getBoundingClientRect().top+e.scrollTop-r}function ia(e="normal"){return typeof e=="number"?e:e==="fast"?120:e==="slow"?300:200}const wt={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:""},ca={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 Ac(e){const{visible:t,animation:r="fade",duration:a="normal",onEntered:n,onExited:o}=e,[s,i]=l.useState(t?"entered":"exited"),[c,d]=l.useState(t),u=l.useRef(void 0),f=ia(a),b=l.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[]),h=b||r==="none"?0:f;l.useEffect(()=>(u.current&&clearTimeout(u.current),t?(d(!0),i("entering"),u.current=setTimeout(()=>{i("entered"),n==null||n()},h)):(i("exiting"),u.current=setTimeout(()=>{i("exited"),d(!1),o==null||o()},h)),()=>{u.current&&clearTimeout(u.current)}),[t,h]);const g=l.useMemo(()=>r==="none"||b?"":s==="entering"?wt[r]:s==="exiting"?ca[r]:s==="entered"?`${wt[r]} nice-anim-active`:"",[r,s,b]),p=l.useMemo(()=>({animationDuration:`${h}ms`,transitionDuration:`${h}ms`}),[h]);return{state:s,shouldRender:c,className:g,style:p}}function Mc(e,t){const{expanded:r,duration:a="normal"}=t,[n,o]=l.useState(r?"auto":0),s=ia(a);return l.useEffect(()=>{const i=e.current;if(i)if(r){const c=i.scrollHeight;o(c);const d=setTimeout(()=>o("auto"),s);return()=>clearTimeout(d)}else{const c=i.scrollHeight;o(c),requestAnimationFrame(()=>{requestAnimationFrame(()=>o(0))})}},[r,s,e]),{overflow:"hidden",height:typeof n=="number"?`${n}px`:n,transition:`height ${s}ms ease`}}function Tc(e,t=50){return`${e*t}ms`}function Ic(e,t){return t==="enter"?wt[e]:ca[e]}const la=l.createContext({direction:"ltr",isRTL:!1,flip:e=>e,flipStyle:(e,t)=>({[e]:t})}),da=({direction:e,children:t})=>{const r=l.useMemo(()=>e!=="auto"?e:typeof document<"u"&&document.documentElement.getAttribute("dir")==="rtl"?"rtl":"ltr",[e]),a=r==="rtl";l.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=l.useCallback(i=>a?{left:"right",right:"left",start:"end",end:"start"}[i]??i:i,[a]),o=l.useCallback((i,c)=>a?{[{paddingLeft:"paddingRight",paddingRight:"paddingLeft",marginLeft:"marginRight",marginRight:"marginLeft"}[i]||i]:c}:{[i]:c},[a]),s=l.useMemo(()=>({direction:r,isRTL:a,flip:n,flipStyle:o}),[r,a,n,o]);return x.jsx(la.Provider,{value:s,children:x.jsx("div",{dir:r,style:{direction:r,display:"contents"},children:t})})};process.env.NODE_ENV!=="production"&&(da.displayName="NiceRTLProvider");function Rc(){return l.useContext(la)}const Lc={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"}},ua=l.createContext({permissions:{},getAccessMode:()=>"full"}),fa=({permissions:e,children:t})=>{const r=l.useMemo(()=>({permissions:e,getAccessMode:(a,n)=>{var o,s;return n&&a&&((o=e.fields)!=null&&o[`${a}.${n}`])?e.fields[`${a}.${n}`]:a&&((s=e.components)!=null&&s[a])?e.components[a]:e.defaultMode??"full"}}),[e]);return x.jsx(ua.Provider,{value:r,children:t})};process.env.NODE_ENV!=="production"&&(fa.displayName="NiceAccessControl");function Fc(e,t,r){const a=l.useContext(ua);return e||a.getAccessMode(t,r)}function Dc(e){switch(e){case"disabled":return{disabled:!0,"aria-disabled":!0,tabIndex:-1};case"readOnly":return{readOnly:!0};default:return{}}}function Pc(e={}){const{threshold:t=50,maxDuration:r=300,onSwipe:a,onSwipeLeft:n,onSwipeRight:o,onSwipeUp:s,onSwipeDown:i,enabled:c=!0}=e,d=l.useRef(null),[u,f]=l.useState(!1),[b,h]=l.useState(null),g=l.useRef(null);return l.useEffect(()=>{const p=d.current;if(!p||!c)return;const m=w=>{if(w.touches.length!==1)return;const E=w.touches[0];g.current={x:E.clientX,y:E.clientY,timestamp:Date.now()},f(!0),h(null)},v=w=>{if(!g.current||w.touches.length!==1)return;const E=w.touches[0],k=E.clientX-g.current.x,C=E.clientY-g.current.y;Math.abs(k)>Math.abs(C)?h(k>0?"right":"left"):h(C>0?"down":"up")},y=w=>{if(!g.current)return;const E=w.changedTouches[0],k={x:E.clientX,y:E.clientY,timestamp:Date.now()},C=k.x-g.current.x,N=k.y-g.current.y,M=k.timestamp-g.current.timestamp,T=Math.sqrt(C*C+N*N),P=T/M;if(f(!1),M<=r&&T>=t){let $;Math.abs(C)>Math.abs(N)?$=C>0?"right":"left":$=N>0?"down":"up";const H={direction:$,distance:T,velocity:P,duration:M};switch(a==null||a(H),$){case"left":n==null||n(H);break;case"right":o==null||o(H);break;case"up":s==null||s(H);break;case"down":i==null||i(H);break}}g.current=null,h(null)},S=()=>{g.current=null,f(!1),h(null)};return p.addEventListener("touchstart",m,{passive:!0}),p.addEventListener("touchmove",v,{passive:!0}),p.addEventListener("touchend",y,{passive:!0}),p.addEventListener("touchcancel",S,{passive:!0}),()=>{p.removeEventListener("touchstart",m),p.removeEventListener("touchmove",v),p.removeEventListener("touchend",y),p.removeEventListener("touchcancel",S)}},[c,t,r,a,n,o,s,i]),{ref:d,isSwiping:u,swipeDirection:b}}function $c(e={}){const{onPinch:t,onPinchStart:r,onPinchEnd:a,minScale:n=.5,maxScale:o=3,enabled:s=!0}=e,i=l.useRef(null),[c,d]=l.useState(1),[u,f]=l.useState(!1),b=l.useRef(null),h=l.useRef(1);return l.useEffect(()=>{const g=i.current;if(!g||!s)return;const p=(w,E)=>{const k=w.clientX-E.clientX,C=w.clientY-E.clientY;return Math.sqrt(k*k+C*C)},m=(w,E)=>({x:(w.clientX+E.clientX)/2,y:(w.clientY+E.clientY)/2}),v=w=>{w.touches.length===2&&(b.current=p(w.touches[0],w.touches[1]),h.current=c,f(!0),r==null||r())},y=w=>{if(w.touches.length!==2||!b.current)return;const E=p(w.touches[0],w.touches[1]),k=Math.min(o,Math.max(n,h.current*(E/b.current)));d(k),t==null||t({scale:k,center:m(w.touches[0],w.touches[1])})},S=()=>{u&&(f(!1),a==null||a(c),b.current=null)};return g.addEventListener("touchstart",v,{passive:!0}),g.addEventListener("touchmove",y,{passive:!0}),g.addEventListener("touchend",S,{passive:!0}),g.addEventListener("touchcancel",S,{passive:!0}),()=>{g.removeEventListener("touchstart",v),g.removeEventListener("touchmove",y),g.removeEventListener("touchend",S),g.removeEventListener("touchcancel",S)}},[s,c,u,n,o,t,r,a]),{ref:i,scale:c,isPinching:u}}function Hc(e={}){const{onPan:t,onPanStart:r,onPanEnd:a,enabled:n=!0}=e,o=l.useRef(null),[s,i]=l.useState(!1),[c,d]=l.useState(0),[u,f]=l.useState(0),b=l.useRef(null),h=l.useRef(null);return l.useEffect(()=>{const g=o.current;if(!g||!n)return;const p=y=>{if(y.touches.length!==1)return;const S=y.touches[0],w={x:S.clientX,y:S.clientY,timestamp:Date.now()};b.current=w,h.current=w,i(!0),d(0),f(0),r==null||r()},m=y=>{if(!b.current||!h.current||y.touches.length!==1)return;const S=y.touches[0],w=Date.now(),E={x:S.clientX,y:S.clientY,timestamp:w},k=E.x-b.current.x,C=E.y-b.current.y,N=E.timestamp-h.current.timestamp||1,M=(E.x-h.current.x)/N,T=(E.y-h.current.y)/N;d(k),f(C),t==null||t({deltaX:k,deltaY:C,velocityX:M,velocityY:T}),h.current=E},v=()=>{if(!s||!b.current||!h.current)return;const y=c,S=u,w=h.current.timestamp-b.current.timestamp||1;a==null||a({deltaX:y,deltaY:S,velocityX:y/w,velocityY:S/w}),i(!1),b.current=null,h.current=null};return g.addEventListener("touchstart",p,{passive:!0}),g.addEventListener("touchmove",m,{passive:!0}),g.addEventListener("touchend",v,{passive:!0}),g.addEventListener("touchcancel",v,{passive:!0}),()=>{g.removeEventListener("touchstart",p),g.removeEventListener("touchmove",m),g.removeEventListener("touchend",v),g.removeEventListener("touchcancel",v)}},[n,s,c,u,t,r,a]),{ref:o,isPanning:s,deltaX:c,deltaY:u}}function ma(e){const{onRefresh:t,threshold:r=80,maxPull:a=120,enabled:n=!0}=e,o=l.useRef(null),[s,i]=l.useState(!1),[c,d]=l.useState(!1),[u,f]=l.useState(0),b=l.useRef(null),h=Math.min(1,u/r);return l.useEffect(()=>{const g=o.current;if(!g||!n||c)return;const p=y=>{g.scrollTop>0||y.touches.length===1&&(b.current=y.touches[0].clientY)},m=y=>{if(b.current===null||y.touches.length!==1)return;const w=y.touches[0].clientY-b.current;if(w<=0){f(0),i(!1);return}const k=Math.min(a,w*.5);f(k),i(k>0),k>0&&y.preventDefault()},v=async()=>{if(u>=r&&!c){d(!0),f(r);try{await t()}finally{d(!1),f(0)}}else f(0);i(!1),b.current=null};return g.addEventListener("touchstart",p,{passive:!0}),g.addEventListener("touchmove",m,{passive:!1}),g.addEventListener("touchend",v,{passive:!0}),g.addEventListener("touchcancel",v,{passive:!0}),()=>{g.removeEventListener("touchstart",p),g.removeEventListener("touchmove",m),g.removeEventListener("touchend",v),g.removeEventListener("touchcancel",v)}},[n,c,u,r,a,t]),{ref:o,isPulling:s,isRefreshing:c,pullDistance:u,pullProgress:h}}const zc=({children:e,leftActions:t=[],rightActions:r=[],actionWidth:a=80,maxSwipe:n=1.5,threshold:o=.5,className:s,style:i})=>{const c=l.useRef(null),d=l.useRef(null),[u,f]=l.useState(0),[b,h]=l.useState(!1),g=l.useRef(0),p=l.useRef(0),m=t.length*a,v=r.length*a,y=m*n,S=v*n,w=l.useCallback(M=>{h(!1),g.current=M.touches[0].clientX,p.current=u},[u]),E=l.useCallback(M=>{const T=M.touches[0].clientX-g.current;let P=p.current+T;P>y?P=y+(P-y)*.2:P<-S&&(P=-S+(P+S)*.2),!(P>0&&t.length===0)&&(P<0&&r.length===0||f(P))},[y,S,t.length,r.length]),k=l.useCallback(()=>{h(!0),u>m*o?f(m):u<-v*o?f(-v):f(0)},[u,m,v,o]),C=l.useCallback(M=>{h(!0),f(0),M.onAction()},[]),N=l.useCallback(()=>{h(!0),f(0)},[]);return x.jsxs("div",{ref:c,className:`nice-swipeable ${s||""}`,style:{...i,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:m},children:t.map(M=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:M.color,border:"none",color:"var(--nice-color-white, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(M),children:M.content},M.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(M=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:M.color,border:"none",color:"var(--nice-color-white, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(M),children:M.content},M.key))}),x.jsx("div",{role:"presentation",ref:d,className:"nice-swipeable__content",style:{transform:`translateX(${u}px)`,transition:b?"transform 0.3s ease-out":"none",background:"var(--nice-bg-primary, #fff)",position:"relative",zIndex:1},onTouchStart:w,onTouchMove:E,onTouchEnd:k,onClick:u!==0?N:void 0,children:e})]})},_c=({children:e,onRefresh:t,threshold:r=80,pullingContent:a,refreshingContent:n,enabled:o=!0,className:s,style:i})=>{const{ref:c,isPulling:d,isRefreshing:u,pullDistance:f,pullProgress:b}=ma({onRefresh:t,threshold:r,enabled:o});return x.jsxs("div",{ref:c,className:`nice-pull-refresh ${s||""}`,style:{...i,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(${b>=1?180:0}deg)`,transition:"transform 0.2s ease",opacity:b},children:x.jsx(A.NiceIcon,{name:"arrow-up",size:24})})}),x.jsx("div",{className:"nice-pull-refresh__content",style:{transform:`translateY(${f}px)`,transition:d?"none":"transform 0.2s ease-out"},children:e})]})};function pa(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 Oc(){return l.useCallback((e="light")=>{pa(e)},[])}const Bc=({minSize:e=44,children:t,className:r,style:a,onClick:n})=>x.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:n?A.clickOnActivationKey:void 0,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 jc(){const[e,t]=l.useState(!1),[r,a]=l.useState(0),n=l.useRef(typeof window<"u"?window.innerHeight:0);return l.useEffect(()=>{if(typeof window>"u")return;if("visualViewport"in window&&window.visualViewport){const s=window.visualViewport,i=()=>{const c=n.current-s.height,d=150;t(c>d),a(c>d?c:0)};return s.addEventListener("resize",i),()=>s.removeEventListener("resize",i)}const o=()=>{const s=n.current-window.innerHeight,i=150;t(s>i),a(s>i?s:0)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),{isKeyboardVisible:e,keyboardHeight:r}}const Wc=[],ga={announceChanges:!0,reduceMotion:"auto",highContrast:"auto",focusStyle:"auto",keyboardShortcuts:!0,minTouchTarget:44},ya=l.createContext(null),ha=({config:e,children:t})=>{const r=l.useMemo(()=>({...ga,...e}),[e]),a=l.useRef(null),n=l.useRef(null),[o,s]=l.useState(!1);l.useEffect(()=>{const h=window.matchMedia("(prefers-reduced-motion: reduce)");s(h.matches);const g=p=>s(p.matches);return h.addEventListener("change",g),()=>h.removeEventListener("change",g)},[]);const[i,c]=l.useState(!1);l.useEffect(()=>{const h=window.matchMedia("(prefers-contrast: more)");c(h.matches);const g=p=>c(p.matches);return h.addEventListener("change",g),()=>h.removeEventListener("change",g)},[]);const d=r.reduceMotion==="always"?!0:r.reduceMotion==="never"?!1:o,u=r.highContrast==="always"?!0:r.highContrast==="never"?!1:i,f=l.useCallback((h,g="polite")=>{if(!r.announceChanges)return;const p=g==="assertive"?n.current:a.current;p&&(p.textContent="",requestAnimationFrame(()=>{p.textContent=h}))},[r.announceChanges]),b=l.useMemo(()=>({config:r,announce:f,prefersReducedMotion:d,prefersHighContrast:u}),[r,f,d,u]);return x.jsxs(ya.Provider,{value:b,children:[t,x.jsx("div",{ref:a,role:"status","aria-live":"polite","aria-atomic":"true",style:kt}),x.jsx("div",{ref:n,role:"alert","aria-live":"assertive","aria-atomic":"true",style:kt})]})};process.env.NODE_ENV!=="production"&&(ha.displayName="NiceA11yProvider");function Vc(){const e=l.useContext(ya);return e||{config:ga,announce:()=>{},prefersReducedMotion:!1,prefersHighContrast:!1}}const kt={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function ba(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function Uc(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":ba(t,r),"aria-errormessage":t}}function Kc(e,t){const{direction:r,wrap:a=!0,itemSelector:n='[role="option"], [role="tab"], [role="menuitem"], [role="radio"], button, a, [tabindex]'}=t;A.useRovingFocus(e,{orientation:r,wrap:a,itemSelector:n})}function Gc(e){const t=l.useRef(null);l.useEffect(()=>(e&&(t.current=document.activeElement),()=>{e&&t.current&&typeof t.current.focus=="function"&&t.current.focus()}),[e])}const va=({children:e,as:t="span"})=>l.createElement(t,{style:kt},e);process.env.NODE_ENV!=="production"&&(va.displayName="NiceVisuallyHidden");const Sa=({targetId:e,children:t})=>{const{t:r}=W.useNiceTranslation();return x.jsx("a",{href:`#${e}`,className:"nice-skip-link",onClick:a=>{a.preventDefault();const n=document.getElementById(e);n&&(n.tabIndex=-1,n.focus())},children:t??r("a11y.skipToMain","Skip to main content")})};process.env.NODE_ENV!=="production"&&(Sa.displayName="NiceSkipLink");const Xc={submit:{intent:"activate",key:"Enter",description:"Submit / Confirm",descriptionKey:"shortcuts.submit"},cancel:{intent:"back",key:"Escape",description:"Cancel / Close",descriptionKey:"shortcuts.cancel"},clear:{key:"Delete",description:"Clear value",descriptionKey:"shortcuts.clear",modifiers:["ctrl"]},moveUp:{intent:"navigate",direction:"up",key:"ArrowUp",description:"Move up",descriptionKey:"shortcuts.moveUp"},moveDown:{intent:"navigate",direction:"down",key:"ArrowDown",description:"Move down",descriptionKey:"shortcuts.moveDown"},moveLeft:{intent:"navigate",direction:"left",key:"ArrowLeft",description:"Move left",descriptionKey:"shortcuts.moveLeft"},moveRight:{intent:"navigate",direction:"right",key:"ArrowRight",description:"Move right",descriptionKey:"shortcuts.moveRight"},first:{intent:"first",key:"Home",description:"Go to first",descriptionKey:"shortcuts.first"},last:{intent:"last",key:"End",description:"Go to last",descriptionKey:"shortcuts.last"},pageUp:{intent:"pagePrev",key:"PageUp",description:"Page up",descriptionKey:"shortcuts.pageUp"},pageDown:{intent:"pageNext",key:"PageDown",description:"Page down",descriptionKey:"shortcuts.pageDown"},selectAll:{key:"A",description:"Select all",descriptionKey:"shortcuts.selectAll",modifiers:["ctrl"]},toggleSelect:{intent:"activate",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:{intent:"activate",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:{intent:"activate",key:"ArrowDown",description:"Open dropdown",descriptionKey:"shortcuts.open"},close:{intent:"back",key:"Escape",description:"Close popup",descriptionKey:"shortcuts.close"},increment:{intent:"navigate",direction:"up",key:"ArrowUp",description:"Increase value",descriptionKey:"shortcuts.increment"},decrement:{intent:"navigate",direction:"down",key:"ArrowDown",description:"Decrease value",descriptionKey:"shortcuts.decrement"},incrementBig:{intent:"sectionNext",key:"PageUp",description:"Increase by 10",descriptionKey:"shortcuts.incrementBig"},decrementBig:{intent:"sectionPrev",key:"PageDown",description:"Decrease by 10",descriptionKey:"shortcuts.decrementBig"}};function qc(e){var r,a,n,o;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"),(o=e.modifiers)!=null&&o.includes("meta")&&t.push("⌘"),t.push(e.key),t.join("+")}function Yc(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)}function Jc(e){return[...(e.modifiers??[]).map(r=>r.charAt(0).toUpperCase()+r.slice(1)),e.key].join("+")}const xa=({shortcuts:e=Wc,position:t="top",icon:r,size:a="sm",className:n})=>{const{t:o}=W.useNiceTranslation(),s=A.useInputMethod(),i=s==="gamepad"||s==="remote",[c,d]=l.useState(!1),u=l.useRef(null),[f,b]=l.useState({top:0,left:0}),h=l.useCallback(()=>{if(!u.current)return;const m=u.current.getBoundingClientRect(),v=8;let y=0,S=0;switch(t){case"top":y=m.top-v,S=m.left+m.width/2;break;case"bottom":y=m.bottom+v,S=m.left+m.width/2;break;case"left":y=m.top+m.height/2,S=m.left-v;break;case"right":y=m.top+m.height/2,S=m.right+v;break}b({top:y,left:S})},[t]),g=l.useCallback(()=>{h(),d(!0)},[h]),p=l.useCallback(()=>{h(),d(!0)},[h]);return e.length===0?null:x.jsxs(x.Fragment,{children:[x.jsx("button",{ref:u,type:"button",className:`nice-keyboard-hint nice-keyboard-hint--${a} ${n||""}`,onMouseEnter:g,onMouseLeave:()=>d(!1),onFocus:p,onBlur:()=>d(!1),"aria-label":o("a11y.keyboardShortcuts","Keyboard shortcuts"),children:r??x.jsx(A.NiceIcon,{name:"keyboard",size:a==="sm"?14:18})}),c&&x.jsxs("div",{className:`nice-keyboard-hint__tooltip nice-keyboard-hint__tooltip--${t}`,style:{position:"fixed",top:f.top,left:f.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:o("a11y.keyboardShortcuts2","Keyboard Shortcuts")}),x.jsx("ul",{className:"nice-keyboard-hint__list",children:e.map((m,v)=>x.jsxs("li",{className:"nice-keyboard-hint__item",children:[i&&m.intent?x.jsx(A.NiceButtonPrompt,{intent:m.intent,direction:m.direction,size:"sm"}):x.jsx(A.NiceKeyCap,{keys:Jc(m),size:"sm"}),x.jsx("span",{className:"nice-keyboard-hint__desc",children:m.descriptionKey?o(m.descriptionKey,m.description):m.description})]},v))})]})]})};process.env.NODE_ENV!=="production"&&(xa.displayName="NiceKeyboardHint");function Qc(e={}){const{enabled:t=!1,onSubmit:r,preventDefault:a=!0,requireCtrl:n=!1,skipTextarea:o=!0}=e;return l.useCallback(s=>{!t||!r||s.key==="Enter"&&(n&&!s.ctrlKey&&!s.metaKey||o&&s.target.tagName==="TEXTAREA"||(a&&s.preventDefault(),r()))},[t,r,a,n,o])}function Zc(e={}){const{onClick:t,disabled:r=!1,role:a,tabIndex:n,triggerOnSpace:o=!0,as:s,selected:i}=e,c=a??s??"button",d=l.useCallback(b=>{r||t==null||t(b)},[r,t]),u=l.useCallback(b=>{if(r)return;const h=o&&(b.key===" "||b.key==="Spacebar");(b.key==="Enter"||h)&&(b.preventDefault(),t==null||t(b))},[r,t,o]),f={role:c,tabIndex:n??(r?-1:0),onClick:d,onKeyDown:u};return r&&(f["aria-disabled"]=!0),i!==void 0&&(c==="option"||c==="tab"||c==="row")&&(f["aria-selected"]=i),f}function el(e={}){const[t,r]=l.useState(!1),[a,n]=l.useState(""),o=l.useRef(null),s=typeof window<"u"&&("SpeechRecognition"in window||"webkitSpeechRecognition"in window),i=l.useCallback(h=>{if(!e.commands)return;const g=h.toLowerCase().trim();for(const p of e.commands)if(typeof p.phrase=="string"){if(g===p.phrase.toLowerCase()){p.action([],h);return}}else{const m=h.match(p.phrase);if(m){p.action(Array.from(m),h);return}}},[e.commands]),c=l.useRef(e);c.current=e;const d=l.useRef(i);d.current=i;const u=l.useRef(!1),f=l.useCallback(()=>{if(!s||u.current)return;const h=window.SpeechRecognition??window.webkitSpeechRecognition,g=c.current,p=new h;p.lang=g.language??"en-US",p.continuous=g.continuous??!0,p.interimResults=g.interimResults??!1,p.onresult=m=>{var w,E;const v=m.results[m.results.length-1],y=v[0].transcript,S=v.isFinal;n(y),(E=(w=c.current).onTranscript)==null||E.call(w,y,S),S&&d.current(y)},p.onerror=m=>{var v,y;(y=(v=c.current).onError)==null||y.call(v,m.error),m.error==="not-allowed"&&(u.current=!1,r(!1))},p.onend=()=>{if(u.current&&c.current.continuous)try{p.start()}catch{u.current=!1,r(!1)}else u.current=!1,r(!1)},o.current=p,p.start(),u.current=!0,r(!0)},[s]),b=l.useCallback(()=>{var h;u.current=!1,(h=o.current)==null||h.stop(),o.current=null,r(!1)},[]);return l.useEffect(()=>()=>b(),[b]),{isListening:t,isSupported:s,start:f,stop:b,transcript:a}}function wa(e={}){const[t,r]=l.useState(""),a=l.useRef(void 0),n=l.useCallback(s=>{r(""),requestAnimationFrame(()=>{r(s),e.clearAfterMs&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>r(""),e.clearAfterMs))})},[e.clearAfterMs]);l.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const o={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:o}}function tl(){const{t:e}=W.useNiceTranslation(),{announce:t,regionProps:r,message:a}=wa({politeness:"assertive",clearAfterMs:3e3});return{announcePageChange:l.useCallback(o=>{t(e("a11y.navigatedTo","Navigated to: {pageTitle}").replace("{pageTitle}",String(o))),typeof document<"u"&&(document.title=o)},[t,e]),regionProps:r,message:a}}function rl(){const e=l.useRef(null),t=l.useCallback(()=>{var o;const n=(o=e.current)==null?void 0:o.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');n==null||n.focus()},[]),r=l.useCallback(n=>{var o,s;(s=(o=e.current)==null?void 0:o.querySelector(n))==null||s.focus()},[]),a=l.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 Er={simplifiedMode:!1,increasedSpacing:!1,readingGuide:!1,enhancedFocus:!1,reduceMotion:!1,iconLabels:!1,largeTargets:!1,dyslexiaFont:!1,lineSpacing:1.5,wordSpacing:1};function al(e=Er){const[t,r]=l.useState({...Er,...e}),a=l.useCallback((i,c)=>{r(d=>({...d,[i]:c}))},[]),n=nl(t),o=[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(" "),s={};return t.lineSpacing&&t.lineSpacing!==1.5&&(s.lineHeight=String(t.lineSpacing)),t.wordSpacing&&t.wordSpacing!==1&&(s.wordSpacing=`${(t.wordSpacing-1)*.25}em`),{settings:t,updateSetting:a,css:n,rootClasses:o,rootStyle:s}}function nl(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}const tl=/(auto|scroll|overlay)/;function ba(e){var a;const t=((a=e==null?void 0:e.ownerDocument)==null?void 0:a.defaultView)??(typeof window<"u"?window:null);let r=(e==null?void 0:e.parentElement)??null;for(;r&&t;){if(tl.test(t.getComputedStyle(r).overflowY))return r;r=r.parentElement}return t??globalThis}function rl(e,t){return e==="nearest"?ba(t):(typeof e=="function"?e():e)??(typeof window<"u"?window:globalThis)}const va=e=>e.window===e;function al(e){return va(e)?e.scrollY:e.scrollTop}function nl(e,t,r=0){const a=t.getBoundingClientRect().top;return va(e)?a+e.scrollY-r:a-e.getBoundingClientRect().top+e.scrollTop-r}function Sa(e="normal"){return typeof e=="number"?e:e==="fast"?120:e==="slow"?300:200}const Mt={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:""},xa={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 ol(e){const{visible:t,animation:r="fade",duration:a="normal",onEntered:n,onExited:o}=e,[s,i]=l.useState(t?"entered":"exited"),[c,d]=l.useState(t),u=l.useRef(void 0),f=Sa(a),b=l.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[]),h=b||r==="none"?0:f;l.useEffect(()=>(u.current&&clearTimeout(u.current),t?(d(!0),i("entering"),u.current=setTimeout(()=>{i("entered"),n==null||n()},h)):(i("exiting"),u.current=setTimeout(()=>{i("exited"),d(!1),o==null||o()},h)),()=>{u.current&&clearTimeout(u.current)}),[t,h]);const g=l.useMemo(()=>r==="none"||b?"":s==="entering"?Mt[r]:s==="exiting"?xa[r]:s==="entered"?`${Mt[r]} nice-anim-active`:"",[r,s,b]),p=l.useMemo(()=>({animationDuration:`${h}ms`,transitionDuration:`${h}ms`}),[h]);return{state:s,shouldRender:c,className:g,style:p}}function sl(e,t){const{expanded:r,duration:a="normal"}=t,[n,o]=l.useState(r?"auto":0),s=Sa(a);return l.useEffect(()=>{const i=e.current;if(i)if(r){const c=i.scrollHeight;o(c);const d=setTimeout(()=>o("auto"),s);return()=>clearTimeout(d)}else{const c=i.scrollHeight;o(c),requestAnimationFrame(()=>{requestAnimationFrame(()=>o(0))})}},[r,s,e]),{overflow:"hidden",height:typeof n=="number"?`${n}px`:n,transition:`height ${s}ms ease`}}function il(e,t=50){return`${e*t}ms`}function cl(e,t){return t==="enter"?Mt[e]:xa[e]}const wa=l.createContext({direction:"ltr",isRTL:!1,flip:e=>e,flipStyle:(e,t)=>({[e]:t})}),ka=({direction:e,children:t})=>{const r=l.useMemo(()=>e!=="auto"?e:typeof document<"u"&&document.documentElement.getAttribute("dir")==="rtl"?"rtl":"ltr",[e]),a=r==="rtl";l.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=l.useCallback(i=>a?{left:"right",right:"left",start:"end",end:"start"}[i]??i:i,[a]),o=l.useCallback((i,c)=>a?{[{paddingLeft:"paddingRight",paddingRight:"paddingLeft",marginLeft:"marginRight",marginRight:"marginLeft"}[i]||i]:c}:{[i]:c},[a]),s=l.useMemo(()=>({direction:r,isRTL:a,flip:n,flipStyle:o}),[r,a,n,o]);return x.jsx(wa.Provider,{value:s,children:x.jsx("div",{dir:r,style:{direction:r,display:"contents"},children:t})})};process.env.NODE_ENV!=="production"&&(ka.displayName="NiceRTLProvider");function ll(){return l.useContext(wa)}const dl={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"}},Ca=l.createContext({permissions:{},getAccessMode:()=>"full"}),Ea=({permissions:e,children:t})=>{const r=l.useMemo(()=>({permissions:e,getAccessMode:(a,n)=>{var o,s;return n&&a&&((o=e.fields)!=null&&o[`${a}.${n}`])?e.fields[`${a}.${n}`]:a&&((s=e.components)!=null&&s[a])?e.components[a]:e.defaultMode??"full"}}),[e]);return x.jsx(Ca.Provider,{value:r,children:t})};process.env.NODE_ENV!=="production"&&(Ea.displayName="NiceAccessControl");function ul(e,t,r){const a=l.useContext(Ca);return e||a.getAccessMode(t,r)}function fl(e){switch(e){case"disabled":return{disabled:!0,"aria-disabled":!0,tabIndex:-1};case"readOnly":return{readOnly:!0};default:return{}}}function ml(e={}){const{threshold:t=50,maxDuration:r=300,onSwipe:a,onSwipeLeft:n,onSwipeRight:o,onSwipeUp:s,onSwipeDown:i,enabled:c=!0}=e,d=l.useRef(null),[u,f]=l.useState(!1),[b,h]=l.useState(null),g=l.useRef(null);return l.useEffect(()=>{const p=d.current;if(!p||!c)return;const m=w=>{if(w.touches.length!==1)return;const E=w.touches[0];g.current={x:E.clientX,y:E.clientY,timestamp:Date.now()},f(!0),h(null)},v=w=>{if(!g.current||w.touches.length!==1)return;const E=w.touches[0],k=E.clientX-g.current.x,C=E.clientY-g.current.y;Math.abs(k)>Math.abs(C)?h(k>0?"right":"left"):h(C>0?"down":"up")},y=w=>{if(!g.current)return;const E=w.changedTouches[0],k={x:E.clientX,y:E.clientY,timestamp:Date.now()},C=k.x-g.current.x,N=k.y-g.current.y,M=k.timestamp-g.current.timestamp,T=Math.sqrt(C*C+N*N),P=T/M;if(f(!1),M<=r&&T>=t){let $;Math.abs(C)>Math.abs(N)?$=C>0?"right":"left":$=N>0?"down":"up";const z={direction:$,distance:T,velocity:P,duration:M};switch(a==null||a(z),$){case"left":n==null||n(z);break;case"right":o==null||o(z);break;case"up":s==null||s(z);break;case"down":i==null||i(z);break}}g.current=null,h(null)},S=()=>{g.current=null,f(!1),h(null)};return p.addEventListener("touchstart",m,{passive:!0}),p.addEventListener("touchmove",v,{passive:!0}),p.addEventListener("touchend",y,{passive:!0}),p.addEventListener("touchcancel",S,{passive:!0}),()=>{p.removeEventListener("touchstart",m),p.removeEventListener("touchmove",v),p.removeEventListener("touchend",y),p.removeEventListener("touchcancel",S)}},[c,t,r,a,n,o,s,i]),{ref:d,isSwiping:u,swipeDirection:b}}function pl(e={}){const{onPinch:t,onPinchStart:r,onPinchEnd:a,minScale:n=.5,maxScale:o=3,enabled:s=!0}=e,i=l.useRef(null),[c,d]=l.useState(1),[u,f]=l.useState(!1),b=l.useRef(null),h=l.useRef(1);return l.useEffect(()=>{const g=i.current;if(!g||!s)return;const p=(w,E)=>{const k=w.clientX-E.clientX,C=w.clientY-E.clientY;return Math.sqrt(k*k+C*C)},m=(w,E)=>({x:(w.clientX+E.clientX)/2,y:(w.clientY+E.clientY)/2}),v=w=>{w.touches.length===2&&(b.current=p(w.touches[0],w.touches[1]),h.current=c,f(!0),r==null||r())},y=w=>{if(w.touches.length!==2||!b.current)return;const E=p(w.touches[0],w.touches[1]),k=Math.min(o,Math.max(n,h.current*(E/b.current)));d(k),t==null||t({scale:k,center:m(w.touches[0],w.touches[1])})},S=()=>{u&&(f(!1),a==null||a(c),b.current=null)};return g.addEventListener("touchstart",v,{passive:!0}),g.addEventListener("touchmove",y,{passive:!0}),g.addEventListener("touchend",S,{passive:!0}),g.addEventListener("touchcancel",S,{passive:!0}),()=>{g.removeEventListener("touchstart",v),g.removeEventListener("touchmove",y),g.removeEventListener("touchend",S),g.removeEventListener("touchcancel",S)}},[s,c,u,n,o,t,r,a]),{ref:i,scale:c,isPinching:u}}function gl(e={}){const{onPan:t,onPanStart:r,onPanEnd:a,enabled:n=!0}=e,o=l.useRef(null),[s,i]=l.useState(!1),[c,d]=l.useState(0),[u,f]=l.useState(0),b=l.useRef(null),h=l.useRef(null);return l.useEffect(()=>{const g=o.current;if(!g||!n)return;const p=y=>{if(y.touches.length!==1)return;const S=y.touches[0],w={x:S.clientX,y:S.clientY,timestamp:Date.now()};b.current=w,h.current=w,i(!0),d(0),f(0),r==null||r()},m=y=>{if(!b.current||!h.current||y.touches.length!==1)return;const S=y.touches[0],w=Date.now(),E={x:S.clientX,y:S.clientY,timestamp:w},k=E.x-b.current.x,C=E.y-b.current.y,N=E.timestamp-h.current.timestamp||1,M=(E.x-h.current.x)/N,T=(E.y-h.current.y)/N;d(k),f(C),t==null||t({deltaX:k,deltaY:C,velocityX:M,velocityY:T}),h.current=E},v=()=>{if(!s||!b.current||!h.current)return;const y=c,S=u,w=h.current.timestamp-b.current.timestamp||1;a==null||a({deltaX:y,deltaY:S,velocityX:y/w,velocityY:S/w}),i(!1),b.current=null,h.current=null};return g.addEventListener("touchstart",p,{passive:!0}),g.addEventListener("touchmove",m,{passive:!0}),g.addEventListener("touchend",v,{passive:!0}),g.addEventListener("touchcancel",v,{passive:!0}),()=>{g.removeEventListener("touchstart",p),g.removeEventListener("touchmove",m),g.removeEventListener("touchend",v),g.removeEventListener("touchcancel",v)}},[n,s,c,u,t,r,a]),{ref:o,isPanning:s,deltaX:c,deltaY:u}}function Na(e){const{onRefresh:t,threshold:r=80,maxPull:a=120,enabled:n=!0}=e,o=l.useRef(null),[s,i]=l.useState(!1),[c,d]=l.useState(!1),[u,f]=l.useState(0),b=l.useRef(null),h=Math.min(1,u/r);return l.useEffect(()=>{const g=o.current;if(!g||!n||c)return;const p=y=>{g.scrollTop>0||y.touches.length===1&&(b.current=y.touches[0].clientY)},m=y=>{if(b.current===null||y.touches.length!==1)return;const w=y.touches[0].clientY-b.current;if(w<=0){f(0),i(!1);return}const k=Math.min(a,w*.5);f(k),i(k>0),k>0&&y.preventDefault()},v=async()=>{if(u>=r&&!c){d(!0),f(r);try{await t()}finally{d(!1),f(0)}}else f(0);i(!1),b.current=null};return g.addEventListener("touchstart",p,{passive:!0}),g.addEventListener("touchmove",m,{passive:!1}),g.addEventListener("touchend",v,{passive:!0}),g.addEventListener("touchcancel",v,{passive:!0}),()=>{g.removeEventListener("touchstart",p),g.removeEventListener("touchmove",m),g.removeEventListener("touchend",v),g.removeEventListener("touchcancel",v)}},[n,c,u,r,a,t]),{ref:o,isPulling:s,isRefreshing:c,pullDistance:u,pullProgress:h}}const yl=({children:e,leftActions:t=[],rightActions:r=[],actionWidth:a=80,maxSwipe:n=1.5,threshold:o=.5,className:s,style:i})=>{const c=l.useRef(null),d=l.useRef(null),[u,f]=l.useState(0),[b,h]=l.useState(!1),g=l.useRef(0),p=l.useRef(0),m=t.length*a,v=r.length*a,y=m*n,S=v*n,w=l.useCallback(M=>{h(!1),g.current=M.touches[0].clientX,p.current=u},[u]),E=l.useCallback(M=>{const T=M.touches[0].clientX-g.current;let P=p.current+T;P>y?P=y+(P-y)*.2:P<-S&&(P=-S+(P+S)*.2),!(P>0&&t.length===0)&&(P<0&&r.length===0||f(P))},[y,S,t.length,r.length]),k=l.useCallback(()=>{h(!0),u>m*o?f(m):u<-v*o?f(-v):f(0)},[u,m,v,o]),C=l.useCallback(M=>{h(!0),f(0),M.onAction()},[]),N=l.useCallback(()=>{h(!0),f(0)},[]);return x.jsxs("div",{ref:c,className:`nice-swipeable ${s||""}`,style:{...i,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:m},children:t.map(M=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:M.color,border:"none",color:"var(--nice-color-white, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(M),children:M.content},M.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(M=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:M.color,border:"none",color:"var(--nice-color-white, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(M),children:M.content},M.key))}),x.jsx("div",{role:"presentation",ref:d,className:"nice-swipeable__content",style:{transform:`translateX(${u}px)`,transition:b?"transform 0.3s ease-out":"none",background:"var(--nice-bg-primary, #fff)",position:"relative",zIndex:1},onTouchStart:w,onTouchMove:E,onTouchEnd:k,onClick:u!==0?N:void 0,children:e})]})},hl=({children:e,onRefresh:t,threshold:r=80,pullingContent:a,refreshingContent:n,enabled:o=!0,className:s,style:i})=>{const{ref:c,isPulling:d,isRefreshing:u,pullDistance:f,pullProgress:b}=Na({onRefresh:t,threshold:r,enabled:o});return x.jsxs("div",{ref:c,className:`nice-pull-refresh ${s||""}`,style:{...i,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(${b>=1?180:0}deg)`,transition:"transform 0.2s ease",opacity:b},children:x.jsx(A.NiceIcon,{name:"arrow-up",size:24})})}),x.jsx("div",{className:"nice-pull-refresh__content",style:{transform:`translateY(${f}px)`,transition:d?"none":"transform 0.2s ease-out"},children:e})]})};function Aa(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 bl(){return l.useCallback((e="light")=>{Aa(e)},[])}const vl=({minSize:e=44,children:t,className:r,style:a,onClick:n})=>x.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:n?A.clickOnActivationKey:void 0,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 Sl(){const[e,t]=l.useState(!1),[r,a]=l.useState(0),n=l.useRef(typeof window<"u"?window.innerHeight:0);return l.useEffect(()=>{if(typeof window>"u")return;if("visualViewport"in window&&window.visualViewport){const s=window.visualViewport,i=()=>{const c=n.current-s.height,d=150;t(c>d),a(c>d?c:0)};return s.addEventListener("resize",i),()=>s.removeEventListener("resize",i)}const o=()=>{const s=n.current-window.innerHeight,i=150;t(s>i),a(s>i?s:0)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),{isKeyboardVisible:e,keyboardHeight:r}}const xl=[],Ma={announceChanges:!0,reduceMotion:"auto",highContrast:"auto",focusStyle:"auto",keyboardShortcuts:!0,minTouchTarget:44},Ta=l.createContext(null),Ia=({config:e,children:t})=>{const r=l.useMemo(()=>({...Ma,...e}),[e]),a=l.useRef(null),n=l.useRef(null),[o,s]=l.useState(!1);l.useEffect(()=>{const h=window.matchMedia("(prefers-reduced-motion: reduce)");s(h.matches);const g=p=>s(p.matches);return h.addEventListener("change",g),()=>h.removeEventListener("change",g)},[]);const[i,c]=l.useState(!1);l.useEffect(()=>{const h=window.matchMedia("(prefers-contrast: more)");c(h.matches);const g=p=>c(p.matches);return h.addEventListener("change",g),()=>h.removeEventListener("change",g)},[]);const d=r.reduceMotion==="always"?!0:r.reduceMotion==="never"?!1:o,u=r.highContrast==="always"?!0:r.highContrast==="never"?!1:i,f=l.useCallback((h,g="polite")=>{if(!r.announceChanges)return;const p=g==="assertive"?n.current:a.current;p&&(p.textContent="",requestAnimationFrame(()=>{p.textContent=h}))},[r.announceChanges]),b=l.useMemo(()=>({config:r,announce:f,prefersReducedMotion:d,prefersHighContrast:u}),[r,f,d,u]);return x.jsxs(Ta.Provider,{value:b,children:[t,x.jsx("div",{ref:a,role:"status","aria-live":"polite","aria-atomic":"true",style:Tt}),x.jsx("div",{ref:n,role:"alert","aria-live":"assertive","aria-atomic":"true",style:Tt})]})};process.env.NODE_ENV!=="production"&&(Ia.displayName="NiceA11yProvider");function wl(){const e=l.useContext(Ta);return e||{config:Ma,announce:()=>{},prefersReducedMotion:!1,prefersHighContrast:!1}}const Tt={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function Ra(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function kl(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":Ra(t,r),"aria-errormessage":t}}function Cl(e,t){const{direction:r,wrap:a=!0,itemSelector:n='[role="option"], [role="tab"], [role="menuitem"], [role="radio"], button, a, [tabindex]'}=t;A.useRovingFocus(e,{orientation:r,wrap:a,itemSelector:n})}function El(e){const t=l.useRef(null);l.useEffect(()=>(e&&(t.current=document.activeElement),()=>{e&&t.current&&typeof t.current.focus=="function"&&t.current.focus()}),[e])}const La=({children:e,as:t="span"})=>l.createElement(t,{style:Tt},e);process.env.NODE_ENV!=="production"&&(La.displayName="NiceVisuallyHidden");const Fa=({targetId:e,children:t})=>{const{t:r}=W.useNiceTranslation();return x.jsx("a",{href:`#${e}`,className:"nice-skip-link",onClick:a=>{a.preventDefault();const n=document.getElementById(e);n&&(n.tabIndex=-1,n.focus())},children:t??r("a11y.skipToMain","Skip to main content")})};process.env.NODE_ENV!=="production"&&(Fa.displayName="NiceSkipLink");const Nl={submit:{intent:"activate",key:"Enter",description:"Submit / Confirm",descriptionKey:"shortcuts.submit"},cancel:{intent:"back",key:"Escape",description:"Cancel / Close",descriptionKey:"shortcuts.cancel"},clear:{key:"Delete",description:"Clear value",descriptionKey:"shortcuts.clear",modifiers:["ctrl"]},moveUp:{intent:"navigate",direction:"up",key:"ArrowUp",description:"Move up",descriptionKey:"shortcuts.moveUp"},moveDown:{intent:"navigate",direction:"down",key:"ArrowDown",description:"Move down",descriptionKey:"shortcuts.moveDown"},moveLeft:{intent:"navigate",direction:"left",key:"ArrowLeft",description:"Move left",descriptionKey:"shortcuts.moveLeft"},moveRight:{intent:"navigate",direction:"right",key:"ArrowRight",description:"Move right",descriptionKey:"shortcuts.moveRight"},first:{intent:"first",key:"Home",description:"Go to first",descriptionKey:"shortcuts.first"},last:{intent:"last",key:"End",description:"Go to last",descriptionKey:"shortcuts.last"},pageUp:{intent:"pagePrev",key:"PageUp",description:"Page up",descriptionKey:"shortcuts.pageUp"},pageDown:{intent:"pageNext",key:"PageDown",description:"Page down",descriptionKey:"shortcuts.pageDown"},selectAll:{key:"A",description:"Select all",descriptionKey:"shortcuts.selectAll",modifiers:["ctrl"]},toggleSelect:{intent:"activate",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:{intent:"activate",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:{intent:"activate",key:"ArrowDown",description:"Open dropdown",descriptionKey:"shortcuts.open"},close:{intent:"back",key:"Escape",description:"Close popup",descriptionKey:"shortcuts.close"},increment:{intent:"navigate",direction:"up",key:"ArrowUp",description:"Increase value",descriptionKey:"shortcuts.increment"},decrement:{intent:"navigate",direction:"down",key:"ArrowDown",description:"Decrease value",descriptionKey:"shortcuts.decrement"},incrementBig:{intent:"sectionNext",key:"PageUp",description:"Increase by 10",descriptionKey:"shortcuts.incrementBig"},decrementBig:{intent:"sectionPrev",key:"PageDown",description:"Decrease by 10",descriptionKey:"shortcuts.decrementBig"}};function Al(e){var r,a,n,o;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"),(o=e.modifiers)!=null&&o.includes("meta")&&t.push("⌘"),t.push(e.key),t.join("+")}function Ml(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)}function Tl(e){return[...(e.modifiers??[]).map(r=>r.charAt(0).toUpperCase()+r.slice(1)),e.key].join("+")}const Da=({shortcuts:e=xl,position:t="top",icon:r,size:a="sm",className:n})=>{const{t:o}=W.useNiceTranslation(),s=A.useInputMethod(),i=s==="gamepad"||s==="remote",[c,d]=l.useState(!1),u=l.useRef(null),[f,b]=l.useState({top:0,left:0}),h=l.useCallback(()=>{if(!u.current)return;const m=u.current.getBoundingClientRect(),v=8;let y=0,S=0;switch(t){case"top":y=m.top-v,S=m.left+m.width/2;break;case"bottom":y=m.bottom+v,S=m.left+m.width/2;break;case"left":y=m.top+m.height/2,S=m.left-v;break;case"right":y=m.top+m.height/2,S=m.right+v;break}b({top:y,left:S})},[t]),g=l.useCallback(()=>{h(),d(!0)},[h]),p=l.useCallback(()=>{h(),d(!0)},[h]);return e.length===0?null:x.jsxs(x.Fragment,{children:[x.jsx("button",{ref:u,type:"button",className:`nice-keyboard-hint nice-keyboard-hint--${a} ${n||""}`,onMouseEnter:g,onMouseLeave:()=>d(!1),onFocus:p,onBlur:()=>d(!1),"aria-label":o("a11y.keyboardShortcuts","Keyboard shortcuts"),children:r??x.jsx(A.NiceIcon,{name:"keyboard",size:a==="sm"?14:18})}),c&&x.jsxs("div",{className:`nice-keyboard-hint__tooltip nice-keyboard-hint__tooltip--${t}`,style:{position:"fixed",top:f.top,left:f.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:o("a11y.keyboardShortcuts2","Keyboard Shortcuts")}),x.jsx("ul",{className:"nice-keyboard-hint__list",children:e.map((m,v)=>x.jsxs("li",{className:"nice-keyboard-hint__item",children:[i&&m.intent?x.jsx(A.NiceButtonPrompt,{intent:m.intent,direction:m.direction,size:"sm"}):x.jsx(A.NiceKeyCap,{keys:Tl(m),size:"sm"}),x.jsx("span",{className:"nice-keyboard-hint__desc",children:m.descriptionKey?o(m.descriptionKey,m.description):m.description})]},v))})]})]})};process.env.NODE_ENV!=="production"&&(Da.displayName="NiceKeyboardHint");function Il(e={}){const{enabled:t=!1,onSubmit:r,preventDefault:a=!0,requireCtrl:n=!1,skipTextarea:o=!0}=e;return l.useCallback(s=>{!t||!r||s.key==="Enter"&&(n&&!s.ctrlKey&&!s.metaKey||o&&s.target.tagName==="TEXTAREA"||(a&&s.preventDefault(),r()))},[t,r,a,n,o])}function Rl(e={}){const{onClick:t,disabled:r=!1,role:a,tabIndex:n,triggerOnSpace:o=!0,as:s,selected:i}=e,c=a??s??"button",d=l.useCallback(b=>{r||t==null||t(b)},[r,t]),u=l.useCallback(b=>{if(r)return;const h=o&&(b.key===" "||b.key==="Spacebar");(b.key==="Enter"||h)&&(b.preventDefault(),t==null||t(b))},[r,t,o]),f={role:c,tabIndex:n??(r?-1:0),onClick:d,onKeyDown:u};return r&&(f["aria-disabled"]=!0),i!==void 0&&(c==="option"||c==="tab"||c==="row")&&(f["aria-selected"]=i),f}function Ll(e={}){const[t,r]=l.useState(!1),[a,n]=l.useState(""),o=l.useRef(null),s=typeof window<"u"&&("SpeechRecognition"in window||"webkitSpeechRecognition"in window),i=l.useCallback(h=>{if(!e.commands)return;const g=h.toLowerCase().trim();for(const p of e.commands)if(typeof p.phrase=="string"){if(g===p.phrase.toLowerCase()){p.action([],h);return}}else{const m=h.match(p.phrase);if(m){p.action(Array.from(m),h);return}}},[e.commands]),c=l.useRef(e);c.current=e;const d=l.useRef(i);d.current=i;const u=l.useRef(!1),f=l.useCallback(()=>{if(!s||u.current)return;const h=window.SpeechRecognition??window.webkitSpeechRecognition,g=c.current,p=new h;p.lang=g.language??"en-US",p.continuous=g.continuous??!0,p.interimResults=g.interimResults??!1,p.onresult=m=>{var w,E;const v=m.results[m.results.length-1],y=v[0].transcript,S=v.isFinal;n(y),(E=(w=c.current).onTranscript)==null||E.call(w,y,S),S&&d.current(y)},p.onerror=m=>{var v,y;(y=(v=c.current).onError)==null||y.call(v,m.error),m.error==="not-allowed"&&(u.current=!1,r(!1))},p.onend=()=>{if(u.current&&c.current.continuous)try{p.start()}catch{u.current=!1,r(!1)}else u.current=!1,r(!1)},o.current=p,p.start(),u.current=!0,r(!0)},[s]),b=l.useCallback(()=>{var h;u.current=!1,(h=o.current)==null||h.stop(),o.current=null,r(!1)},[]);return l.useEffect(()=>()=>b(),[b]),{isListening:t,isSupported:s,start:f,stop:b,transcript:a}}function Pa(e={}){const[t,r]=l.useState(""),a=l.useRef(void 0),n=l.useCallback(s=>{r(""),requestAnimationFrame(()=>{r(s),e.clearAfterMs&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>r(""),e.clearAfterMs))})},[e.clearAfterMs]);l.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const o={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:o}}function Fl(){const{t:e}=W.useNiceTranslation(),{announce:t,regionProps:r,message:a}=Pa({politeness:"assertive",clearAfterMs:3e3});return{announcePageChange:l.useCallback(o=>{t(e("a11y.navigatedTo","Navigated to: {pageTitle}").replace("{pageTitle}",String(o))),typeof document<"u"&&(document.title=o)},[t,e]),regionProps:r,message:a}}function Dl(){const e=l.useRef(null),t=l.useCallback(()=>{var o;const n=(o=e.current)==null?void 0:o.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');n==null||n.focus()},[]),r=l.useCallback(n=>{var o,s;(s=(o=e.current)==null?void 0:o.querySelector(n))==null||s.focus()},[]),a=l.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 Rr={simplifiedMode:!1,increasedSpacing:!1,readingGuide:!1,enhancedFocus:!1,reduceMotion:!1,iconLabels:!1,largeTargets:!1,dyslexiaFont:!1,lineSpacing:1.5,wordSpacing:1};function Pl(e=Rr){const[t,r]=l.useState({...Rr,...e}),a=l.useCallback((i,c)=>{r(d=>({...d,[i]:c}))},[]),n=$l(t),o=[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(" "),s={};return t.lineSpacing&&t.lineSpacing!==1.5&&(s.lineHeight=String(t.lineSpacing)),t.wordSpacing&&t.wordSpacing!==1&&(s.wordSpacing=`${(t.wordSpacing-1)*.25}em`),{settings:t,updateSetting:a,css:n,rootClasses:o,rootStyle:s}}function $l(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,9 +35,9 @@
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 ol(e,t,r=!1){const a=Ar(Nr(e)),n=Ar(Nr(t)),o=il(a,n),s=r?4.5:7;return{rule:"1.4.6",level:"AAA",passed:o>=s,message:`Contrast ratio ${o.toFixed(2)}:1 (requires ${s}:1 for AAA${r?" large text":""})`}}function sl(){if(typeof document>"u")return[];const e=[];return document.querySelectorAll("a").forEach(r=>{var s;const a=((s=r.textContent)==null?void 0:s.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),o=parseFloat(a.fontSize);o>0&&n/o>80&&e.push({rule:"1.4.8",level:"AAA",passed:!1,message:`Text block exceeds 80 character width (${Math.round(n/o)} 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 Nr(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 Ar([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 il(e,t){const r=Math.max(e,t),a=Math.min(e,t);return(r+.05)/(a+.05)}const cl=["none","protanopia","protanomaly","deuteranopia","deuteranomaly","tritanopia","tritanomaly","achromatopsia","achromatomaly"],Mr="nice2dev-color-blind-filters",Tr="nice2dev-color-blind-styles",Ct={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 ll(){if(typeof document>"u"||document.getElementById(Mr))return;const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.id=Mr,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(Ct)){const o=document.createElementNS(e,"filter");o.id=`nice-cb-${a}`,o.setAttribute("color-interpolation-filters","sRGB");const s=document.createElementNS(e,"feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("values",n),o.appendChild(s),r.appendChild(o)}if(t.appendChild(r),document.body.appendChild(t),!document.getElementById(Tr)){const a=document.createElement("style");a.id=Tr,a.textContent=Object.keys(Ct).map(n=>`.nice-color-blind-${n}{filter:url(#nice-cb-${n})!important;}`).join(""),document.head.appendChild(a)}}function Bt(e){for(const t of Object.keys(Ct))e.classList.remove(`nice-color-blind-${t}`)}function jt(e,t=typeof document<"u"?document.documentElement:null){t&&(ll(),Bt(t),e!=="none"&&t.classList.add(`nice-color-blind-${e}`))}function ka(e,t={}){const{target:r}=t,a=l.useRef(null);l.useEffect(()=>{const n=r??(typeof document<"u"?document.documentElement:null);return a.current=n,jt(e,n),()=>{const o=a.current;o&&Bt(o)}},[e,r])}function dl(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 ul(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 fl(e={}){const{storageKey:t="nice2dev.a11y.cvd",storage:r="localStorage",defaultMode:a="none",target:n,cookieMaxAgeSeconds:o=3600*24*60}=e,s=l.useCallback(h=>{if(typeof window>"u"||r==="cookie")return()=>{};const g=p=>{p.key===t&&h()};return window.addEventListener("storage",g),()=>window.removeEventListener("storage",g)},[r,t]),i=l.useCallback(()=>dl(t,r)??a,[r,t,a]),c=l.useCallback(()=>a,[a]),d=l.useSyncExternalStore(s,i,c),[u,f]=l.useState(d);l.useEffect(()=>{d!==u&&f(d)},[d]),ka(u,{target:n});const b=l.useCallback(h=>{f(h),ul(t,h,r,o)},[r,t,o]);return[u,b]}function ml(e=typeof document<"u"?document.documentElement:null){return{set:t=>jt(t,e),clear:()=>{e&&Bt(e)}}}function Ca(e,t){var s;if(typeof document>"u"||typeof getComputedStyle>"u")return Ea(e);const r=e.trim().match(/^var\(\s*([^,\s)]+)\s*(?:,\s*(.+))?\)$/);if(!r)return e;const a=typeof Element<"u"&&t instanceof Element&&t.isConnected?t:document.documentElement,n=getComputedStyle(a).getPropertyValue(r[1]).trim();if(n)return n;const o=(s=r[2])==null?void 0:s.trim();return o?Ca(o,t):e}function Ea(e){const t=e.trim().match(/^var\(\s*[^,\s)]+\s*(?:,\s*(.+))?\)$/);return t!=null&&t[1]?Ea(t[1]):e}function pl(){const e=globalThis.crypto;if(typeof(e==null?void 0:e.randomUUID)=="function")return e.randomUUID();const t=new Uint8Array(16);if(typeof(e==null?void 0:e.getRandomValues)=="function")e.getRandomValues(t);else for(let a=0;a<t.length;a++)t[a]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const r=Array.from(t,a=>a.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}const gl=e=>[...e],yl=()=>{const e=new Map;return{getItem:t=>Promise.resolve(e.get(t)),setItem:(t,r)=>(e.set(t,r),Promise.resolve())}};function hl(e={}){var b,h;const t=e.permissionPolicy??gl,r=e.storage;let a;r&&typeof r.getItem=="function"&&typeof r.setItem=="function"?a={getItem:r.getItem,setItem:r.setItem}:a=yl();const n=(b=e.permissions)==null?void 0:b.canActivate,o={user:(h=e.permissions)==null?void 0:h.user},s=e.logger,i=new Map,c=new Map,d=new Map,u=(g,p)=>{const m=d.get(g);if(m)for(const v of m)try{v(p)}catch{}},f=(g,p,m)=>{const v=new Set(p);return{permissions:v,log:(y,...S)=>{s&&s(g.id,y,S)},on:(y,S)=>{let w=c.get(y);w||(w=new Set,c.set(y,w)),w.add(S);const E=()=>{w.delete(S)};return m.push(E),E},emit:(y,S)=>{if(!v.has("events:emit"))return;const w=c.get(y);if(w)for(const E of w)try{E(S)}catch{}},setItem:async(y,S)=>{v.has("storage:write")&&await a.setItem(`${g.id}:${y}`,S)},getItem:async y=>{if(v.has("storage:read"))return await a.getItem(`${g.id}:${y}`)}}};return{register(g){const p=g.manifest.id;if(i.has(p))throw new Error(`Plugin "${p}" already registered`);const m={manifest:g.manifest,status:"registered"};return i.set(p,{plugin:g,record:m,cleanups:[]}),u("register",m),m},unregister(g){return i.get(g)?(i.delete(g),!0):!1},async activate(g){const p=i.get(g);if(!p)throw new Error(`Unknown plugin "${g}"`);if(p.record.status==="active")return p.record;for(const m of p.plugin.manifest.dependsOn??[]){const v=i.get(m);if(!v)throw p.record.status="error",p.record.error=`Missing dependency: ${m}`,u("error",p.record),new Error(p.record.error);v.record.status!=="active"&&await this.activate(m)}p.record.status="activating";try{if(n&&!n(p.plugin.manifest,o))throw p.record.status="error",p.record.error="permission-denied",u("error",p.record),new Error(p.record.error);const m=t(p.plugin.manifest.permissions??[],p.plugin.manifest),v=f(p.plugin.manifest,m,p.cleanups);await p.plugin.activate(v),p.record.status="active",p.record.activatedAt=Date.now(),p.record.error=void 0,u("activate",p.record)}catch(m){throw p.record.status="error",p.record.error=m instanceof Error?m.message:String(m),u("error",p.record),m}return p.record},async deactivate(g){var m,v;const p=i.get(g);if(!p)throw new Error(`Unknown plugin "${g}"`);if(p.record.status!=="active")return p.record;p.record.status="deactivating";try{await((v=(m=p.plugin).deactivate)==null?void 0:v.call(m));for(const y of p.cleanups.splice(0))await y();p.record.status="inactive",u("deactivate",p.record)}catch(y){throw p.record.status="error",p.record.error=y instanceof Error?y.message:String(y),u("error",p.record),y}return p.record},list(){return[...i.values()].map(g=>({...g.record}))},get(g){const p=i.get(g);return p?{...p.record}:void 0},on(g,p){let m=d.get(g);return m||(m=new Set,d.set(g,m)),m.add(p),()=>{m.delete(p)}},events:{on(g,p){const v={"plugin:registered":"register","plugin:activated":"activate","plugin:deactivated":"deactivate","plugin:error":"error"}[g];let y=d.get(v);return y||(y=new Set,d.set(v,y)),y.add(p),()=>{y.delete(p)}},emit(g,p){const m=c.get(g);if(m)for(const v of m)try{v(p)}catch{}}}}}const ve="#ffffff",Na="#000000",bl=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,vl=/^rgba?\(\s*([\d.]+%?)\s*[,\s]\s*([\d.]+%?)\s*[,\s]\s*([\d.]+%?)\s*(?:[,/]\s*([\d.]+%?)\s*)?\)$/i,Sl=/^hsla?\(\s*([\d.]+)(?:deg)?\s*[,\s]\s*([\d.]+)%\s*[,\s]\s*([\d.]+)%\s*(?:[,/]\s*([\d.]+%?)\s*)?\)$/i,yt=e=>e.endsWith("%")?parseFloat(e)/100*255:parseFloat(e),Ir=e=>e===void 0?void 0:e.endsWith("%")?parseFloat(e)/100:parseFloat(e);function xl(e,t,r){const a=s=>(s+e/30)%12,n=t*Math.min(r,1-r),o=s=>r-n*Math.max(-1,Math.min(a(s)-3,Math.min(9-a(s),1)));return{r:o(0)*255,g:o(8)*255,b:o(4)*255}}function G(e){if(!e)return null;const t=e.trim(),r=t.match(bl);if(r){let o=r[1];o.length<=4&&(o=o.split("").map(i=>i+i).join(""));const s=i=>parseInt(o.slice(i,i+2),16);return{r:s(0),g:s(2),b:s(4),...o.length===8?{a:s(6)/255}:{}}}const a=t.match(vl);if(a){const o=Ir(a[4]);return{r:yt(a[1]),g:yt(a[2]),b:yt(a[3]),...o!==void 0?{a:o}:{}}}const n=t.match(Sl);if(n){const o=Ir(n[4]);return{...xl(parseFloat(n[1])%360,parseFloat(n[2])/100,parseFloat(n[3])/100),...o!==void 0?{a:o}:{}}}return null}function Wt({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 Pe(e,t,r){const a=G(e),n=G(t);return!a||!n?e:Wt({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 ee(e,t,r){if(G(e)&&G(t))return Pe(e,t,r);const a=Math.round(Math.max(0,Math.min(1,r))*1e3)/10;return`color-mix(in srgb, ${t} ${a}%, ${e})`}const Vt=(e,t)=>Pe(e,ve,t),Ut=(e,t)=>Pe(e,Na,t);function ie(e){const t=G(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 qe(e,t){return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function Et(e,t){return!G(e)||!G(t)?1:qe(ie(e),ie(t))}function Aa(e,t,r){if(!G(e))return r;const a=ie(e),n=G(t)?ie(t):1,o=G(r)?ie(r):0;return qe(a,n)>=qe(a,o)?t:r}function Nt(e){var a;const t=((a=e.match(/#[0-9a-f]{3,8}\b|rgba?\([^)]*\)|hsla?\([^)]*\)/gi))==null?void 0:a.filter(n=>G(n)))??[];if(t.length===0)return null;const r=t.map(n=>G(n)).reduce((n,o)=>({r:n.r+o.r,g:n.g+o.g,b:n.b+o.b}),{r:0,g:0,b:0});return Wt({r:r.r/t.length,g:r.g/t.length,b:r.b/t.length})}const Se=e=>!!e&&/gradient\(/i.test(e),Ma=[1,.4,.28,.18,.11,.06],Ta=[.14,.22,.3,.38,.46,.54],wl=6,Kt={"colors.accent":"{colors.primary}","colors.secondary":"{colors.accent}","colors.link":"{colors.primary}","colors.focus":"{colors.primary}","backgrounds.elevated":"{backgrounds.primary}","backgrounds.canvas":"{backgrounds.secondary}","text.onPrimary":ve,"text.onAccent":"{text.onPrimary}","text.inverse":"{backgrounds.primary}","borders.divider":"{borders.color}","borders.focusColor":"{colors.focus}","layout.body.background":"{backgrounds.secondary}","layout.body.text":"{text.primary}","layout.panel.background":"{backgrounds.primary}","layout.panel.text":"{text.primary}","layout.panel.border":"{borders.color}","layout.topNav.background":"{backgrounds.elevated}","layout.topNav.text":"{text.primary}","layout.topNav.border":"{borders.color}","layout.sideNav.background":"{backgrounds.primary}","layout.sideNav.text":"{text.primary}","layout.sideNav.border":"{borders.color}","layout.sideNav.headers.base":"{colors.primary}","layout.sideNav.items.text":"{layout.sideNav.text}","layout.sideNav.highlight.base":"{colors.primary}","layout.sideNav.highlight.text":"{text.onPrimary}","scrollbar.track":"transparent","scrollbar.thumb":"{borders.color}","scrollbar.thumbHover":"{colors.primary}"},Ia=["layout.body.background","layout.panel.background","layout.topNav.background","layout.sideNav.background","scrollbar.thumb"],kl=/^\{\s*([\w.-]+)\s*\}$/,Ra=/\{\s*([\w.-]+)\s*\}/g;function La(e){var t;return typeof e=="string"?((t=e.match(kl))==null?void 0:t[1])??null:null}function rt(e){return[...(typeof e=="string"?e:e&&typeof e=="object"&&"css"in e?`${e.css} ${e.base??""}`:"").matchAll(Ra)].map(r=>r[1])}function at(e,t){return t.split(".").reduce((r,a)=>{if(r&&typeof r=="object")return r[a]},e)}function Gt(e,t,r){if(typeof e=="string")r.push({path:t,value:e});else if(e&&typeof e=="object"){if(!Array.isArray(e)&&"css"in e&&t.startsWith("gradients."))return r.push({path:t,value:e}),r;for(const[a,n]of Object.entries(e))Gt(n,t?`${t}.${a}`:a,r)}return r}function Cl(e,t){return Gt(e,"",[]).filter(r=>rt(r.value).includes(t)).map(r=>r.path)}function El(e,t,r){const a=new Set,n=[r];for(;n.length>0;){const o=n.pop();if(o===t)return!0;if(a.has(o))continue;a.add(o);const s=at(e,o)??Kt[o];n.push(...rt(s))}return!1}function Nl(e,t,r){const a=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`\\{\\s*${a}\\s*\\}`,"g"),o=s=>typeof s=="string"?s.replace(n,`{${r}}`):Array.isArray(s)?s.map(o):s&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,c])=>[i,o(c)])):s;return o(e)}class Ie{constructor(t){this.theme=t,this.cache=new Map,this.cyclic=new Set,this.diagnostics=[]}diag(t){this.diagnostics.some(r=>r.path===t.path&&r.kind===t.kind&&r.ref===t.ref)||this.diagnostics.push(t)}resolve(t,r=[]){if(this.cache.has(t))return this.cache.get(t)??null;if(r.includes(t))return this.cyclic.add(t),this.diag({path:r[r.length-1]??t,kind:"cycle",ref:t,message:`Link loop: ${[...r.slice(r.indexOf(t)),t].join(" → ")}`}),null;const a=[...r,t],n=at(this.theme,t);let o=n!==void 0?this.resolveRaw(t,n,a):null;const s=Kt[t];return!o&&s!==void 0&&s!==n&&(o=this.resolveRaw(t,s,a)),this.cache.set(t,o),o}resolveRaw(t,r,a){var o;if(r&&typeof r=="object"&&"css"in r){const s=r,i=this.substitute(t,s.css,a),c=s.base?(o=this.resolveRaw(t,s.base,a))==null?void 0:o.color:void 0;return{css:i,color:c??Nt(i)??"transparent"}}if(typeof r!="string")return null;const n=La(r);if(n){const s=this.resolve(n,a);return!s&&!this.cyclic.has(n)&&this.diag({path:t,kind:"missing",ref:n,message:`Link to a missing value: {${n}}`}),s}if(Se(r)){const s=this.substitute(t,r,a);return{css:s,color:Nt(s)??"transparent"}}return{css:r,color:r}}substitute(t,r,a){return r.replace(Ra,(n,o)=>{const s=this.resolve(o,a);return s?s.color:(this.diag({path:t,kind:"missing",ref:o,message:`Link to a missing value: {${o}}`}),"transparent")})}color(t){const r=this.resolve(t);return r?(Se(r.css)&&this.diag({path:t,kind:"gradient-in-color",message:`${t} takes a colour; the gradient's base colour is used`}),r.color):null}inlineColor(t,r){var a;return r===void 0?null:((a=this.resolveRaw(t,r,[t]))==null?void 0:a.color)??null}}function Fa(e,t,r){return G(e)?Et(e,t)>=Et(e,r)?t:r:t}function Rr(e,t,r){return G(e)?ie(e)>.5?Ut(e,r):Vt(e,r*1.3):ee(e,t,r)}function Da(e,t){var d,u,f;const r=Math.max(1,Math.min(10,Math.round(e.count??wl))),a=(d=e.curve)!=null&&d.length?e.curve:t.curve,n=e.mode??"shade",o=t.color(e.base,`${t.path}.base`)??t.base,s=n==="palette"?((u=e.swatches)!=null&&u.length?e.swatches:Object.keys(t.palette)).map(b=>t.palette[b]).filter(b=>!!b):[],i=n==="list"||e.sync===!1,c=[];for(let b=0;b<r;b++){const h=i?(f=e.levels)==null?void 0:f[b]:void 0,g=`${t.path}.levels.${b}`,p=s.length>0?s[b%s.length]:ee(t.over,o,a[Math.min(b,a.length-1)]),m=t.color(h==null?void 0:h.background,`${g}.background`)??p,v=t.color(h==null?void 0:h.text,`${g}.text`)??Fa(m,t.text,t.onBase);c.push({bg:m,text:v,hoverBg:t.color(h==null?void 0:h.hoverBackground,`${g}.hoverBackground`)??Rr(m,v,.06),activeBg:t.color(h==null?void 0:h.activeBackground,`${g}.activeBackground`)??Rr(m,v,.12)})}return c}function Al(e,t){return new Ie(e).resolve(t)}function Ml(e,t){const r=Re(e);if(t==="headers")return(r.headerLevels??nt(e,new Ie(e))).map(o=>({background:o.bg,text:o.text}));const a=new Ie(e);return Pa(e,a).map(n=>({background:n.bg,text:n.text}))}function Tl(e,t,r,a){const n={};for(const o of Object.keys(e.palette??{})){const s=t.color(`palette.${o}`);s&&(n[o]=s)}return{over:t.color("layout.sideNav.background")??"transparent",base:t.color(`${r}.base`)??"transparent",text:t.color("layout.sideNav.text")??ve,onBase:t.color("text.onPrimary")??ve,palette:n,curve:a,color:(o,s)=>t.inlineColor(s,o),path:r}}function nt(e,t){var a,n;const r=((n=(a=e.layout)==null?void 0:a.sideNav)==null?void 0:n.headers)??{};return Da(r,Tl(e,t,"layout.sideNav.headers",Ma))}function Pa(e,t){var c,d,u;const r=((d=(c=e.layout)==null?void 0:c.sideNav)==null?void 0:d.highlight)??{},a=nt(e,t),n=t.color("layout.sideNav.highlight.base")??"transparent",o=t.color("layout.sideNav.highlight.text")??ve,s=(u=r.curve)!=null&&u.length?r.curve:Ta,i=r.mode==="list"||r.sync===!1;return a.map((f,b)=>{var m;const h=i?(m=r.levels)==null?void 0:m[b]:void 0,g=`layout.sideNav.highlight.levels.${b}`,p=t.inlineColor(`${g}.background`,h==null?void 0:h.background)??ee(f.bg,n,s[Math.min(b,s.length-1)]);return{bg:p,text:t.inlineColor(`${g}.text`,h==null?void 0:h.text)??Fa(p,f.text,o)}})}const Lr=new WeakMap;function Il(e){const t=Lr.get(e);if(t)return t;const r=new Ie(e),a=u=>{const f=r.resolve(u);return{color:(f==null?void 0:f.color)??"transparent",image:f&&Se(f.css)?f.css:void 0}},n=a("layout.topNav.background"),o=a("layout.sideNav.background"),s=a("layout.body.background"),i=a("layout.panel.background"),c=nt(e,r).slice(0,3),d={topNav:n.color,topNavImage:n.image,topNavText:r.color("layout.topNav.text")??"currentColor",sideNav:o.color,sideNavImage:o.image,sideNavText:r.color("layout.sideNav.text")??"currentColor",headers:c.map(u=>u.bg),headerTexts:c.map(u=>u.text),highlight:r.color("layout.sideNav.highlight.base")??"transparent",body:s.color,bodyImage:s.image,panel:i.color,panelImage:i.image,panelBorder:r.color("layout.panel.border")??"transparent",text:r.color("text.primary")??"currentColor",primary:r.color("colors.primary")??"currentColor",accent:r.color("colors.accent")??"currentColor"};return Lr.set(e,d),d}const Rl=[["layout.body","body"],["layout.panel","panel"],["layout.topNav","topnav"],["layout.sideNav","sidenav"]],Fr=e=>`${Math.round(Math.max(0,Math.min(1,e))*1e3)/10}%`,Dr=new WeakMap;function Re(e){var h,g,p;const t=Dr.get(e);if(t)return t;const r=new Ie(e),a=m=>at(e,m)!==void 0,n=new Set(Ia),o=m=>n.has(m)||m.startsWith("gradients."),s=Gt(e,"",[]).filter(m=>rt(m.value).length>0);let i=e;if(s.length>0){i=JSON.parse(JSON.stringify(e));for(const{path:m}of s){const v=r.resolve(m),y=v?o(m)?v.css:v.color:void 0,S=m.split(".");let w=i;for(const E of S.slice(0,-1))w=w[E];y===void 0?delete w[S[S.length-1]]:w[S[S.length-1]]=y}}const c={};for(const[m,v]of Rl){if(a(`${m}.background`)){const y=r.resolve(`${m}.background`);y&&(c[`--nice-bg-${v}`]=y.color,c[`--nice-bg-${v}-image`]=Se(y.css)?y.css:"none")}if(a(`${m}.text`)){const y=r.color(`${m}.text`);y&&(c[`--nice-text-${v}`]=y)}if(v!=="body"&&a(`${m}.border`)){const y=r.color(`${m}.border`);y&&(c[`--nice-border-${v}`]=y)}if((v==="topnav"||v==="sidenav")&&(a(`${m}.background`)||a(`${m}.text`))){const y=((h=r.resolve(`${m}.background`))==null?void 0:h.color)??null,S=r.color(`${m}.text`);y&&S&&(c[`--nice-bg-${v}-2`]=ee(y,S,.05),c[`--nice-bg-${v}-3`]=ee(y,S,.09),c[`--nice-text-${v}-2`]=ee(S,y,.25),c[`--nice-text-${v}-3`]=ee(S,y,.42),c[`--nice-hover-bg-${v}`]=ee(y,S,.08))}}const d=(g=e.layout)==null?void 0:g.sideNav;if(d!=null&&d.items){const m={"--nice-bg-sidenav-item":d.items.background!==void 0?r.color("layout.sideNav.items.background"):null,"--nice-text-sidenav-item":d.items.text!==void 0?r.color("layout.sideNav.items.text"):null};for(const[v,y]of Object.entries(m))y&&(c[v]=y);typeof d.items.tint=="number"&&(c["--nice-sidenav-item-tint"]=Fr(d.items.tint))}let u;if(d!=null&&d.headers){u=nt(e,r),u.forEach((v,y)=>{const S=y+1;c[`--nice-sidebar-level-${S}-bg`]=v.bg,c[`--nice-sidebar-level-${S}-text`]=v.text,c[`--nice-sidebar-level-${S}-hover-bg`]=v.hoverBg,c[`--nice-sidebar-level-${S}-active-bg`]=v.activeBg}),c["--nice-sidebar-levels"]=String(u.length);const m=r.color("layout.sideNav.headers.base");m&&(c["--nice-sidenav-header-base"]=m),c["--nice-text-sidenav-header"]=u[0].text}if(d!=null&&d.highlight){const m=r.color("layout.sideNav.highlight.base");m&&(c["--nice-sidenav-highlight"]=m);const v=r.color("layout.sideNav.highlight.text");v&&(c["--nice-text-sidenav-highlight"]=v),(p=d.highlight.curve)==null||p.forEach((y,S)=>{S<6&&(c[`--nice-sidenav-highlight-step-${S+1}`]=Fr(y))}),(d.highlight.mode==="list"||d.highlight.sync===!1)&&Pa(e,r).forEach((y,S)=>{c[`--nice-sidenav-path-${S+1}-bg`]=y.bg,c[`--nice-sidenav-path-${S+1}-text`]=y.text})}const f=e.scrollbar;if(f){if(f.track!==void 0){const m=r.color("scrollbar.track");m&&(c["--nice-scrollbar-track"]=m)}if(f.thumb!==void 0){const m=r.resolve("scrollbar.thumb");m&&(c["--nice-scrollbar-thumb"]=m.color,c["--nice-scrollbar-thumb-image"]=Se(m.css)?m.css:"none")}if(f.thumbHover!==void 0){const m=r.color("scrollbar.thumbHover");m&&(c["--nice-scrollbar-thumb-hover"]=m)}f.width&&(c["--nice-scrollbar-size"]=f.width),f.thumbWidth&&(c["--nice-scrollbar-thumb-size"]=f.thumbWidth),f.radius&&(c["--nice-scrollbar-radius"]=f.radius==="full"?"var(--nice-radius-full)":f.radius)}const b={theme:i,vars:c,headerLevels:u,diagnostics:r.diagnostics};return Dr.set(e,b),b}const $a={"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","text.onSuccess":"--text-on-success","text.onError":"--text-on-error","text.onInfo":"--text-on-info","text.onWarning":"--text-on-warning","borders.color":"--border-color","borders.radiusSm":"--nice-radius-sm","borders.radiusMd":"--nice-radius-md","borders.radiusLg":"--nice-radius-lg","borders.radiusXl":"--nice-radius-xl","borders.radiusFull":"--nice-radius-full","borders.width":"--border-width","borders.focusColor":"--border-focus-color","borders.divider":"--border-divider","shadows.sm":"--shadow-sm","shadows.md":"--shadow-md","shadows.lg":"--shadow-lg","shadows.xl":"--shadow-xl","shadows.inner":"--shadow-inner","shadows.glow":"--shadow-glow","spacing.space1":"--nice-space-1","spacing.space2":"--nice-space-2","spacing.space3":"--nice-space-3","spacing.space4":"--nice-space-4","spacing.space5":"--nice-space-5","spacing.space6":"--nice-space-6","spacing.space8":"--nice-space-8","spacing.space10":"--nice-space-10","spacing.space12":"--nice-space-12","spacing.space16":"--nice-space-16","typography.fontFamily":"--nice-font-family","typography.fontSizeXs":"--nice-font-size-xs","typography.fontSizeSm":"--nice-font-size-sm","typography.fontSizeMd":"--nice-font-size-md","typography.fontSizeLg":"--nice-font-size-lg","typography.fontSizeXl":"--nice-font-size-xl","typography.fontSize2xl":"--nice-font-size-2xl","typography.fontSize3xl":"--nice-font-size-3xl","typography.fontWeightNormal":"--nice-font-weight-normal","typography.fontWeightMedium":"--nice-font-weight-medium","typography.fontWeightSemibold":"--nice-font-weight-semibold","typography.fontWeightBold":"--nice-font-weight-bold","typography.lineHeight":"--nice-line-height","typography.headingFontFamily":"--nice-heading-font-family","typography.monoFontFamily":"--nice-mono-font-family","typography.letterSpacing":"--nice-letter-spacing","typography.headingLetterSpacing":"--nice-heading-letter-spacing","transitions.fast":"--nice-transition-fast","transitions.normal":"--nice-transition","transitions.slow":"--nice-transition-slow"};function Ll(e,t){return t.split(".").reduce((r,a)=>{if(r&&typeof r=="object")return r[a]},e)}function Ha(e){return e.startsWith("--nice-")?null:`--nice-${e.slice(2)}`}function Ye(e){var n,o,s;const t=Re(e),r=t.theme,a={};for(const[i,c]of Object.entries($a)){const d=Ll(r,i);if(d!==void 0){a[c]=String(d);const u=Ha(c);u&&(a[u]=String(d))}}if(r.nesting)for(const i of["sidebar","menu","tree"]){const c=r.nesting[i];if(!c||i==="sidebar"&&((o=(n=r.layout)==null?void 0:n.sideNav)!=null&&o.headers))continue;const d=r.backgrounds.secondary||r.backgrounds.primary||"#ffffff",u=((s=r.text)==null?void 0:s.primary)||"#111111";Object.assign(a,Ul(i,c,d,u))}return Object.assign(a,t.vars),a}const Fl=()=>[...["body","panel","topnav","sidenav"].flatMap(e=>[`--nice-bg-${e}`,`--nice-bg-${e}-image`,`--nice-text-${e}`,`--nice-border-${e}`]),...["topnav","sidenav"].flatMap(e=>[`--nice-bg-${e}-2`,`--nice-bg-${e}-3`,`--nice-text-${e}-2`,`--nice-text-${e}-3`,`--nice-hover-bg-${e}`]),"--nice-bg-sidenav-item","--nice-text-sidenav-item","--nice-sidenav-item-tint","--nice-sidenav-header-base","--nice-text-sidenav-header","--nice-sidenav-highlight","--nice-text-sidenav-highlight",...[1,2,3,4,5,6].map(e=>`--nice-sidenav-highlight-step-${e}`),...[1,2,3,4,5,6,7,8,9,10].flatMap(e=>[`--nice-sidenav-path-${e}-bg`,`--nice-sidenav-path-${e}-text`]),"--nice-scrollbar-track","--nice-scrollbar-thumb","--nice-scrollbar-thumb-image","--nice-scrollbar-thumb-hover","--nice-scrollbar-size","--nice-scrollbar-thumb-size","--nice-scrollbar-radius"];function Dl(e,t){const r=t??document.documentElement,a=Ye(e);for(const[n,o]of Object.entries(a))r.style.setProperty(n,o);$l(e.backgroundImage,r),e.darkMode&&(r.dataset.ntdColorScheme=e.darkMode)}const Pl={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 $l(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=Pl[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 At(e){const t=e??document.documentElement;for(const r of Object.values($a)){t.style.removeProperty(r);const a=Ha(r);a&&t.style.removeProperty(a)}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);for(const r of Fl())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 Hl(e){const t=e??document.documentElement,r=getComputedStyle(t),a=s=>r.getPropertyValue(s).trim(),n=s=>parseFloat(r.getPropertyValue(s))||0,o=s=>a(s)||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:o("--color-accent"),accentHover:o("--color-accent-hover"),link:o("--color-link"),linkHover:o("--color-link-hover"),focus:o("--color-focus"),overlay:o("--color-overlay"),surface:o("--color-surface"),surfaceHover:o("--color-surface-hover"),disabled:o("--color-disabled"),disabledText:o("--color-disabled-text")},backgrounds:{primary:a("--bg-primary"),secondary:a("--bg-secondary"),tertiary:a("--bg-tertiary"),hover:a("--hover-bg"),elevated:o("--bg-elevated"),inset:o("--bg-inset"),canvas:o("--bg-canvas")},text:{primary:a("--text-primary"),secondary:a("--text-secondary"),muted:a("--text-muted"),inverse:o("--text-inverse"),onPrimary:o("--text-on-primary"),onAccent:o("--text-on-accent"),onSuccess:o("--text-on-success"),onError:o("--text-on-error"),onInfo:o("--text-on-info"),onWarning:o("--text-on-warning")},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:o("--border-width"),focusColor:o("--border-focus-color"),divider:o("--border-divider")},shadows:{sm:a("--shadow-sm"),md:a("--shadow-md"),lg:a("--shadow-lg"),xl:a("--shadow-xl"),inner:o("--shadow-inner"),glow:o("--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:o("--nice-space-10"),space12:o("--nice-space-12"),space16:o("--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:o("--nice-heading-font-family"),monoFontFamily:o("--nice-mono-font-family"),fontSize2xl:o("--nice-font-size-2xl"),fontSize3xl:o("--nice-font-size-3xl"),letterSpacing:o("--nice-letter-spacing"),headingLetterSpacing:o("--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 zl(e){return JSON.stringify(e,null,2)}function _l(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 Ol=G,Bl=Pe,Mt=Vt,Tt=Ut,Pr=ie,jl=Aa;function Wl(e,t,r){const a=t.palette??[],n=t.bgStep??.06,o=a[0]??r;switch(t.bgDerivation??"tint"){case"palette":return a.length===0?r:a[(e-1)%a.length];case"shade":return Tt(o,Math.min(.9,n*(e-1)));case"mix-surface":return Bl(o,r,Math.min(1,n*(e-1)));case"tint":default:return Mt(o,Math.min(.9,n*(e-1)))}}function Vl(e){return Ol(e)!=null}function za(e,t,r,a){var o;const n=[];for(let s=1;s<=e;s++){const i=(o=t.overrides)==null?void 0:o[s],c=(i==null?void 0:i.background)??Wl(s,t,r);n.push({bg:c,text:(i==null?void 0:i.text)??jl(c,"#ffffff",a),hoverBg:(i==null?void 0:i.hoverBackground)??(Pr(c)>.5?Tt(c,.06):Mt(c,.08)),activeBg:(i==null?void 0:i.activeBackground)??(Pr(c)>.5?Tt(c,.12):Mt(c,.16)),border:i==null?void 0:i.border})}return n}function Ul(e,t,r,a){const n={},o=Math.max(1,Math.min(10,t.levels??5));return za(o,t,r,a).forEach((s,i)=>{const c=i+1;n[`--nice-${e}-level-${c}-bg`]=s.bg,n[`--nice-${e}-level-${c}-text`]=s.text,n[`--nice-${e}-level-${c}-hover-bg`]=s.hoverBg,n[`--nice-${e}-level-${c}-active-bg`]=s.activeBg,s.border&&(n[`--nice-${e}-level-${c}-border`]=s.border)}),n[`--nice-${e}-levels`]=String(o),n}const Xt=l.createContext(null);function Kl(){const e=l.useContext(Xt);if(!e)throw new Error("useNiceTheme must be used within a NiceThemeProvider");return e}const ce={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},me={fontFamily:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",headingFontFamily:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",monoFontFamily:"'JetBrains Mono', ui-monospace, monospace",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},pe={fast:"120ms cubic-bezier(0.4,0,0.2,1)",normal:"200ms cubic-bezier(0.4,0,0.2,1)",slow:"320ms cubic-bezier(0.4,0,0.2,1)"},_a={sm:"0 1px 2px rgba(15,23,42,0.06)",md:"0 4px 10px -2px rgba(15,23,42,0.10), 0 2px 4px -2px rgba(15,23,42,0.06)",lg:"0 12px 24px -6px rgba(15,23,42,0.14), 0 4px 8px -4px rgba(15,23,42,0.08)",xl:"0 24px 48px -12px rgba(15,23,42,0.22)"},Oa={sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 12px rgba(0,0,0,0.55)",lg:"0 12px 28px rgba(0,0,0,0.65)",xl:"0 24px 56px rgba(0,0,0,0.75)"},Gl={onyx:"#050505",jet:"#0e0e0e",graphite:"#161616",smoke:"#1f1f1f",gold:"#c89848",goldLight:"#e0b868",goldDeep:"#9c7430",champagne:"#e8d0a0",ivory:"#f0ead8",sand:"#a89870",bronze:"#3a2e18",ink:"#120d04"},ot={name:"Black Tie Gala",schemaVersion:2,darkMode:"dark",recommendedDisplayStyle:"luxe",palette:Gl,gradients:{goldFoil:"linear-gradient(135deg, {palette.goldLight} 0%, {palette.gold} 55%, {palette.goldDeep} 100%)",nightBar:{css:"linear-gradient(90deg, {palette.jet} 0%, #17130b 60%, #2a2112 100%)",base:"{palette.jet}"},goldThumb:"linear-gradient(180deg, {palette.goldLight}, {palette.gold})"},colors:{primary:"#c89848",primaryHover:"#e0b868",success:"#6db37f",warning:"#e0b050",error:"#e06a6a",info:"#8eb0d8",accent:"#e8d0a0",accentHover:"#f0ead8",link:"#e0b868",linkHover:"#e8d0a0",focus:"#c89848",surface:"#0e0e0e",surfaceHover:"#161616"},backgrounds:{primary:"#050505",secondary:"#0e0e0e",tertiary:"#161616",hover:"#1f1f1f",elevated:"#121212",inset:"#020202",canvas:"#030303"},text:{primary:"#f0ead8",secondary:"#a89870",muted:"#8a7c60",inverse:"#050505",onPrimary:"#120d04",onAccent:"#120d04",onSuccess:"#120d04",onError:"#120d04",onInfo:"#120d04",onWarning:"#120d04"},borders:{color:"#3a2e18",divider:"#241a0c",focusColor:"#c89848",width:"1px",radiusSm:"3px",radiusMd:"5px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(200,152,72,0.10)",md:"0 4px 16px rgba(0,0,0,0.8), 0 0 0 1px rgba(200,152,72,0.14)",lg:"0 10px 32px rgba(0,0,0,0.9), 0 0 0 1px rgba(200,152,72,0.22)",xl:"0 24px 56px rgba(0,0,0,1), 0 0 0 1px rgba(200,152,72,0.3)",glow:"0 0 24px rgba(200,152,72,0.25)"},spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.jet}",text:"{palette.ivory}"},panel:{background:"#121212",text:"{palette.ivory}",border:"#2a2214"},topNav:{background:"{gradients.nightBar}",text:"{palette.champagne}",border:"{palette.bronze}"},sideNav:{background:"{palette.onyx}",text:"{palette.ivory}",border:"{palette.bronze}",headers:{mode:"shade",base:"{palette.gold}",sync:!0},highlight:{base:"{palette.goldLight}",text:"{palette.ink}"}}},scrollbar:{track:"transparent",thumb:"{gradients.goldThumb}",thumbHover:"{palette.goldLight}",width:"10px",thumbWidth:"6px",radius:"full"}},Xl={blue:"#0078d4",blueHover:"#106ebe",blueDark:"#005a9e",white:"#ffffff",canvas:"#faf9f8",mist:"#f3f2f1",fog:"#edebe9",line:"#e1dfdd",ink:"#323130",slate:"#605e5c",ash:"#8a8886"},qt={name:"Fluent",schemaVersion:2,darkMode:"light",palette:Xl,gradients:{brandBar:"linear-gradient(90deg, {palette.blueDark} 0%, {palette.blue} 100%)"},colors:{primary:"#0078d4",primaryHover:"#106ebe",success:"#107c10",warning:"#c19c00",error:"#d13438",info:"#0078a8",accent:"#8764b8",link:"#0078d4",focus:"#0078d4",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:"#8a8886",inverse:"#ffffff",onPrimary:"#ffffff"},borders:{color:"#e1dfdd",divider:"#edebe9",focusColor:"#0078d4",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:ce,typography:{fontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",headingFontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",monoFontFamily:"'Cascadia Code', 'JetBrains Mono', ui-monospace, monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.45},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)"},layout:{body:{background:"{palette.canvas}",text:"{palette.ink}"},panel:{background:"{palette.white}",text:"{palette.ink}",border:"{palette.line}"},topNav:{background:"{gradients.brandBar}",text:"{palette.white}",border:"{palette.blueDark}"},sideNav:{background:"{palette.mist}",text:"{palette.ink}",border:"{palette.line}",headers:{mode:"shade",base:"{palette.blue}",sync:!0},highlight:{base:"{palette.blue}",text:"{palette.white}"}}},scrollbar:{track:"transparent",thumb:"#c8c6c4",thumbHover:"{palette.ash}",width:"12px",thumbWidth:"6px",radius:"full"}},ql={s50:"#f8fafc",s100:"#f1f5f9",s200:"#e2e8f0",s300:"#cbd5e1",s500:"#64748b",s600:"#475569",s700:"#334155",s800:"#1e293b",s900:"#0f172a",sky:"#0369a1",white:"#ffffff"},Yt={name:"Slate",schemaVersion:2,darkMode:"light",palette:ql,gradients:{slateBar:"linear-gradient(90deg, {palette.s900} 0%, {palette.s800} 100%)"},colors:{primary:"#475569",primaryHover:"#334155",success:"#047857",warning:"#b45309",error:"#dc2626",info:"#0369a1",accent:"#0369a1",link:"#0369a1",focus:"#0369a1",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#f1f5f9"},text:{primary:"#0f172a",secondary:"#475569",muted:"#64748b",inverse:"#ffffff",onPrimary:"#ffffff"},borders:{color:"#e2e8f0",divider:"#e2e8f0",focusColor:"#0369a1",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:_a,spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.s100}",text:"{palette.s900}"},panel:{background:"{palette.white}",text:"{palette.s900}",border:"{palette.s200}"},topNav:{background:"{gradients.slateBar}",text:"{palette.s100}",border:"{palette.s900}"},sideNav:{background:"{palette.s50}",text:"{palette.s900}",border:"{palette.s200}",headers:{mode:"shade",base:"{palette.s700}",sync:!0},highlight:{base:"{palette.sky}",text:"{palette.white}"}}},scrollbar:{track:"transparent",thumb:"{palette.s300}",thumbHover:"{palette.s500}",width:"10px",thumbWidth:"6px",radius:"full"}},Yl={white:"#ffffff",z50:"#fafafa",z100:"#f4f4f5",z200:"#e4e4e7",z300:"#d4d4d8",z400:"#a1a1aa",z500:"#71717a",z600:"#52525b",z800:"#27272a",z900:"#18181b"},Jt={name:"Minimalism",schemaVersion:2,darkMode:"light",palette:Yl,colors:{primary:"#18181b",primaryHover:"#27272a",success:"#15803d",warning:"#a16207",error:"#dc2626",info:"#2563eb",accent:"#52525b",link:"#18181b",focus:"#18181b",surface:"#ffffff",surfaceHover:"#fafafa"},backgrounds:{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f4f4f5",hover:"#f4f4f5",elevated:"#ffffff",inset:"#f4f4f5",canvas:"#fafafa"},text:{primary:"#18181b",secondary:"#52525b",muted:"#71717a",inverse:"#ffffff",onPrimary:"#ffffff"},borders:{color:"#e4e4e7",divider:"#f4f4f5",focusColor:"#18181b",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"10px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(24,24,27,0.05)",md:"0 2px 8px rgba(24,24,27,0.06)",lg:"0 8px 20px rgba(24,24,27,0.08)",xl:"0 16px 40px rgba(24,24,27,0.12)"},spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.z50}",text:"{palette.z900}"},panel:{background:"{palette.white}",text:"{palette.z900}",border:"{palette.z200}"},topNav:{background:"{palette.white}",text:"{palette.z900}",border:"{palette.z200}"},sideNav:{background:"{palette.white}",text:"{palette.z900}",border:"{palette.z200}",headers:{mode:"shade",base:"{palette.z800}",sync:!0,curve:[1,.3,.2,.12,.07,.04]},highlight:{base:"{palette.z900}",text:"{palette.white}"}}},scrollbar:{track:"transparent",thumb:"{palette.z300}",thumbHover:"{palette.z400}",width:"8px",thumbWidth:"4px",radius:"full"}},Jl={navy:"#1e3a5f",navyDeep:"#13294b",navyHover:"#152c4a",gold:"#b8860b",goldLight:"#d4a843",paper:"#f4f6f9",white:"#ffffff",mist:"#e8edf3",line:"#d9e0e9",ink:"#0f1e33",steel:"#4a5b72",pewter:"#6b7a8f",inkGold:"#1a1206"},Qt={name:"Banking",schemaVersion:2,darkMode:"light",palette:Jl,gradients:{vault:"linear-gradient(90deg, {palette.navyDeep} 0%, {palette.navy} 100%)"},colors:{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#1d4ed8",accent:"#b8860b",accentHover:"#d4a843",link:"#1e3a5f",focus:"#b8860b",surface:"#ffffff",surfaceHover:"#f4f6f9"},backgrounds:{primary:"#ffffff",secondary:"#f4f6f9",tertiary:"#e8edf3",hover:"#e8edf3",elevated:"#ffffff",inset:"#e8edf3",canvas:"#f4f6f9"},text:{primary:"#0f1e33",secondary:"#4a5b72",muted:"#6b7a8f",inverse:"#ffffff",onPrimary:"#ffffff",onAccent:"#1a1206"},borders:{color:"#d9e0e9",divider:"#e8edf3",focusColor:"#b8860b",radiusSm:"3px",radiusMd:"5px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:_a,spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.paper}",text:"{palette.ink}"},panel:{background:"{palette.white}",text:"{palette.ink}",border:"{palette.line}"},topNav:{background:"{gradients.vault}",text:"{palette.white}",border:"{palette.navyDeep}"},sideNav:{background:"{palette.white}",text:"{palette.ink}",border:"{palette.line}",headers:{mode:"shade",base:"{palette.navy}",sync:!0},highlight:{base:"{palette.gold}",text:"{palette.inkGold}"}}},scrollbar:{track:"transparent",thumb:"#b4c0cf",thumbHover:"{palette.pewter}",width:"10px",thumbWidth:"6px",radius:"full"}},Ql={night:"#0b0a12",deep:"#13111c",plum:"#1b1828",dusk:"#252136",violet:"#a78bfa",violetLight:"#c4b5fd",violetDeep:"#7c3aed",orchid:"#e879f9",mist:"#ede9fe",haze:"#b8acd9",smoke:"#8b80ad",line:"#2e2945",ink:"#140f24"},Zt={name:"Obsidian",schemaVersion:2,darkMode:"dark",palette:Ql,gradients:{glassBar:{css:"linear-gradient(90deg, {palette.deep} 0%, #2a1f4d 100%)",base:"{palette.deep}"},amethyst:"linear-gradient(180deg, {palette.violetLight}, {palette.violetDeep})"},colors:{primary:"#a78bfa",primaryHover:"#c4b5fd",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#7dd3fc",accent:"#e879f9",link:"#c4b5fd",focus:"#a78bfa",surface:"#13111c",surfaceHover:"#1b1828"},backgrounds:{primary:"#0b0a12",secondary:"#13111c",tertiary:"#1b1828",hover:"#252136",elevated:"#1b1828",inset:"#07060c",canvas:"#0b0a12"},text:{primary:"#ede9fe",secondary:"#b8acd9",muted:"#8b80ad",inverse:"#0b0a12",onPrimary:"#140f24",onAccent:"#140f24"},borders:{color:"#2e2945",divider:"#1b1828",focusColor:"#a78bfa",radiusSm:"4px",radiusMd:"6px",radiusLg:"10px",radiusXl:"14px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 12px rgba(0,0,0,0.55)",lg:"0 12px 28px rgba(0,0,0,0.65)",xl:"0 24px 56px rgba(0,0,0,0.75)",glow:"0 0 24px rgba(167,139,250,0.3)"},spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.deep}",text:"{palette.mist}"},panel:{background:"{palette.plum}",text:"{palette.mist}",border:"{palette.line}"},topNav:{background:"{gradients.glassBar}",text:"{palette.mist}",border:"{palette.line}"},sideNav:{background:"{palette.night}",text:"{palette.mist}",border:"{palette.line}",headers:{mode:"shade",base:"{palette.violet}",sync:!0},highlight:{base:"{palette.violetLight}",text:"{palette.ink}"}}},scrollbar:{track:"transparent",thumb:"{gradients.amethyst}",thumbHover:"{palette.violetLight}",width:"10px",thumbWidth:"6px",radius:"full"}},Zl={black:"#0a0a0a",coal:"#141414",iron:"#1f1f1f",steel:"#2a2a2a",blue:"#2563eb",sky:"#60a5fa",snow:"#f5f5f5",silver:"#a3a3a3",ash:"#8a8a8a",line:"#2e2e2e"},er={name:"Onyx",schemaVersion:2,darkMode:"dark",palette:Zl,colors:{primary:"#60a5fa",primaryHover:"#93c5fd",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#38bdf8",accent:"#2563eb",link:"#60a5fa",focus:"#60a5fa",surface:"#141414",surfaceHover:"#1f1f1f"},backgrounds:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1f1f1f",hover:"#2a2a2a",elevated:"#1f1f1f",inset:"#050505",canvas:"#0a0a0a"},text:{primary:"#f5f5f5",secondary:"#a3a3a3",muted:"#8a8a8a",inverse:"#0a0a0a",onPrimary:"#0a0a0a",onAccent:"#f5f5f5"},borders:{color:"#2e2e2e",divider:"#1f1f1f",focusColor:"#60a5fa",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:Oa,spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.coal}",text:"{palette.snow}"},panel:{background:"{palette.iron}",text:"{palette.snow}",border:"{palette.line}"},topNav:{background:"{palette.coal}",text:"{palette.snow}",border:"{palette.line}"},sideNav:{background:"{palette.black}",text:"{palette.snow}",border:"{palette.line}",headers:{mode:"shade",base:"{palette.blue}",sync:!0},highlight:{base:"{palette.sky}",text:"{palette.black}"}}},scrollbar:{track:"transparent",thumb:"#3a3a3a",thumbHover:"{palette.sky}",width:"10px",thumbWidth:"6px",radius:"full"}},ed={void:"#111214",graphite:"#18191c",slate:"#202226",iron:"#2a2c31",zinc:"#52525b",pewter:"#a1a1aa",fog:"#e5e7eb",ash:"#8b8b94",line:"#2f3136"},tr={name:"Shadow",schemaVersion:2,darkMode:"dark",palette:ed,colors:{primary:"#d4d4d8",primaryHover:"#e5e7eb",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#93c5fd",accent:"#a1a1aa",link:"#e5e7eb",focus:"#a1a1aa",surface:"#18191c",surfaceHover:"#202226"},backgrounds:{primary:"#111214",secondary:"#18191c",tertiary:"#202226",hover:"#2a2c31",elevated:"#202226",inset:"#0c0d0f",canvas:"#111214"},text:{primary:"#e5e7eb",secondary:"#a1a1aa",muted:"#8b8b94",inverse:"#111214",onPrimary:"#111214",onAccent:"#111214"},borders:{color:"#2f3136",divider:"#202226",focusColor:"#a1a1aa",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:Oa,spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.graphite}",text:"{palette.fog}"},panel:{background:"{palette.slate}",text:"{palette.fog}",border:"{palette.line}"},topNav:{background:"{palette.graphite}",text:"{palette.fog}",border:"{palette.line}"},sideNav:{background:"{palette.void}",text:"{palette.fog}",border:"{palette.line}",headers:{mode:"shade",base:"{palette.zinc}",sync:!0},highlight:{base:"{palette.fog}",text:"{palette.void}",curve:[.12,.17,.22,.28,.34,.4]}}},scrollbar:{track:"transparent",thumb:"#3d3f46",thumbHover:"{palette.zinc}",width:"10px",thumbWidth:"6px",radius:"full"}},td=[{meta:{id:"blackTieGala",name:"Black Tie Gala",tagline:"Absolute black and gold foil — premium, prestige.",tags:["dark","premium","default"]},theme:ot,displayStyle:"luxe"},{meta:{id:"fluent",name:"Fluent",tagline:"Fluent 2: white surfaces, Segoe, communication blue.",tags:["light"]},theme:qt,displayStyle:"default"},{meta:{id:"slate",name:"Slate",tagline:"Cool slate greys with a slate top bar and one sky accent.",tags:["light"]},theme:Yt,displayStyle:"default"},{meta:{id:"minimalism",name:"Minimalism",tagline:"White and zinc ink — nothing that is not needed.",tags:["light"]},theme:Jt,displayStyle:"default"},{meta:{id:"banking",name:"Banking",tagline:"Navy and gold — the calm of a private bank.",tags:["light"]},theme:Qt,displayStyle:"default"},{meta:{id:"obsidian",name:"Obsidian",tagline:"Volcanic glass: near-black violet, lavender light.",tags:["dark"]},theme:Zt,displayStyle:"default"},{meta:{id:"onyx",name:"Onyx",tagline:"Neutral black with one electric blue.",tags:["dark"]},theme:er,displayStyle:"default"},{meta:{id:"shadow",name:"Shadow",tagline:"Graphite greys, quiet and even.",tags:["dark"]},theme:tr,displayStyle:"default"}],rr=[ot,qt,Yt,Jt,Qt,Zt,er,tr],It=ot,ge={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},st={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},$e={color:"#e2e8f0",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},He={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},Ba={name:"Light",darkMode:"light",colors:{primary:"#2563eb",primaryHover:"#1d4ed8",success:"#047857",warning:"#f59e0b",error:"#dc2626",info:"#0e7490",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:"#64748b",inverse:"#ffffff"},borders:$e,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:ge,typography:st,transitions:He},ja=(function(){return{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:"#858585",inverse:"#0f172a"},borders:{...$e,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:ge,typography:st,transitions:He}})(),Wa=(function(){return{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:{...$e,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:ge,typography:st,transitions:He}})(),Va=(function(){return{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:{...$e,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:ge,typography:st,transitions:He}})(),Ua=(function(){return{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:{...$e,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:ge,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)"}}})(),Ka={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:ge,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:He},Ga={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:ge,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)"}},Rt=(function(){return[...rr]})(),rd=["primary","primary-hover","primary-light","primary-bg","success","warning","error","info","accent","surface","surface-hover"];function ad(e,t){return e??t.recommendedDisplayStyle??"default"}function $r(e){return e.toLowerCase().replace(/[\s_-]+/g,"")}function Hr(e){if(e&&typeof e=="object")return e;if(typeof e=="string"){const t=$r(e);if(t==="light")return Ba;if(t==="dark")return ja;const r=Rt.find(a=>$r(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 '${It.name}'. Available: ${Rt.map(a=>a.name).join(", ")}. A theme from before 1.4.0 is in NICE_THEME_ARCHIVE — import it and pass the object.`)}return It}const ar=({theme:e,darkTheme:t,variantConfig:r,darkMode:a,displayStyle:n,animateTransitions:o=!0,children:s})=>{const i=l.useMemo(()=>Hr(e),[e]),c=l.useMemo(()=>t===void 0?void 0:Hr(t),[t]),d=l.useId(),u=l.useMemo(()=>`p${d.replace(/:/g,"")}`,[d]),f=l.useRef(null),b=l.useRef(null),h=l.useRef(new Set),[g,p]=l.useState(null),[m,v]=l.useState(null),y=m&&m.over===i&&m.overDark===c?m.theme:null,[S,w]=l.useState(!1),[E,k]=l.useState(()=>ad(n,i));l.useEffect(()=>{n!==void 0?k(n):i.recommendedDisplayStyle&&k(i.recommendedDisplayStyle)},[n,i.recommendedDisplayStyle]),l.useEffect(()=>{const R=window.matchMedia("(prefers-color-scheme: dark)");w(R.matches);const L=F=>w(F.matches);return R.addEventListener("change",L),()=>R.removeEventListener("change",L)},[]);const C=a??(y??i).darkMode??"light",N=C==="dark"||C==="auto"&&S,M=y??(N&&c?c:i);l.useEffect(()=>{if(typeof document>"u")return;const R=document.createElement("div");return R.className="nice-theme-scope nice-theme-portal-host",R.dataset.ntdProvider=u,R.style.display="contents",document.body.appendChild(R),b.current=R,p(R),()=>{R.parentNode&&R.parentNode.removeChild(R),b.current=null,p(null)}},[u]),l.useEffect(()=>{const R=f.current;if(!R)return;o&&(R.style.transition="background-color 300ms ease, color 300ms ease");const L=Ye(M);for(const[U,K]of Object.entries(L))R.style.setProperty(U,K);const F=b.current;if(F)for(const[U,K]of Object.entries(L))F.style.setProperty(U,K);R.style.colorScheme=N?"dark":"light",R.dataset.ntdColorScheme=N?"dark":"light",R.dataset.theme=N?"dark":"light",N?R.classList.add("nice-dark"):R.classList.remove("nice-dark"),F&&(F.style.colorScheme=N?"dark":"light",F.dataset.ntdColorScheme=N?"dark":"light",F.dataset.theme=N?"dark":"light",N?F.classList.add("nice-dark"):F.classList.remove("nice-dark"));const z=M.backgroundImage;if(z&&z.type!=="none"&&z.type==="gradient"&&z.gradient&&R.style.setProperty("--ntd-bg-image",z.gradient),process.env.NODE_ENV!=="production"){const{diagnostics:U}=Re(M);U.length>0&&!h.current.has(M.name)&&(h.current.add(M.name),console.warn(`[NiceThemeProvider] theme "${M.name}": ${U.map(K=>K.message).join("; ")}`))}return()=>{R&&At(R),F&&At(F)}},[M,N,o,g]);const T=l.useRef(new Set);l.useEffect(()=>{if(process.env.NODE_ENV==="production"||typeof window>"u"||typeof document>"u")return;const R=window.setTimeout(()=>{const L=Ye(M),F=["--color-primary","--nice-primary","--bg-primary","--text-primary"].find(Z=>L[Z])??Object.keys(L)[0];if(!F)return;const z=String(L[F]??"").trim();if(!z)return;const U=getComputedStyle(document.documentElement).getPropertyValue(F).trim();if(!U||U===z)return;const K=`${u}::${M.name??"unnamed"}::${F}`;T.current.has(K)||(T.current.add(K),console.warn(`[NiceThemeProvider] CSS var "${F}" on documentElement (${U}) does not match the active provider pack "${M.name??"unnamed"}" (${z}). 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(R)},[M,u]);const P=l.useRef(!1);l.useEffect(()=>{if(process.env.NODE_ENV==="production"||P.current||typeof window>"u"||typeof document>"u")return;const R=window.setTimeout(()=>{const L=getComputedStyle(document.documentElement);if(!L.getPropertyValue("--nice-overlay-8").trim())return;const F=rd.filter(z=>!L.getPropertyValue(`--nice-${z}`).trim()&&!L.getPropertyValue(`--nice-color-${z}`).trim());F.length!==0&&(P.current=!0,console.warn(`[NiceThemeProvider] ${F.map(z=>`--nice-${z} / --nice-color-${z}`).join(", ")} resolve to nothing on :root, so dropdowns, dialogs and anything else outside this provider fall back to their built-in colours. Usually an alias cycle in your CSS: the stylesheet already points each --nice-<name> at --nice-color-<name>, so declaring --nice-color-<name> in terms of --nice-<name> closes a loop. Set the --nice-color-* tokens to real values (or use the theme) instead.`))},0);return()=>window.clearTimeout(R)},[M]),l.useEffect(()=>{const R=f.current;if(!R)return;const L=r?{...te,...r}:Te(E);Ot(L,R,u);const F=aa(E);for(const[z,U]of Object.entries(F))R.setAttribute(z,U);return()=>{ta(u,R)}},[r,E,u]);const $=l.useCallback(R=>v({theme:R,over:i,overDark:c}),[i,c]),H=l.useMemo(()=>({theme:Re(M).theme,sourceTheme:M,setTheme:$,portalTarget:g}),[M,$,g]),_=l.useMemo(()=>({displayStyle:E,variantConfig:Te(E),setDisplayStyle:k}),[E]);return x.jsx(Xt.Provider,{value:H,children:x.jsx(tt.Provider,{value:_,children:x.jsx("div",{ref:f,className:"nice-theme-scope","data-ntd-provider":u,style:{display:"contents"},children:s})})})};process.env.NODE_ENV!=="production"&&(ar.displayName="NiceThemeProvider");function nd(...e){return e.join("-")}const od={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"},Xa=({children:e,theme:t,direction:r="ltr",t:a})=>{let n=l.createElement("div",{dir:r,"data-testid":"nice-test-root",style:{direction:r}},e);return a&&(n=l.createElement(W.NiceI18nLazyProvider,{t:a,children:n})),t&&(n=l.createElement(ar,{theme:t,children:n})),n};process.env.NODE_ENV!=="production"&&(Xa.displayName="NiceTestWrapper");function sd(e,t,r){const a=new KeyboardEvent("keydown",{key:t,bubbles:!0,cancelable:!0,...r});e.dispatchEvent(a)}function id(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 cd(e){const{data:t,delay:r=0,keyField:a="id"}=e;let n=[...t];return{key:a,load:async()=>(r>0&&await new Promise(o=>setTimeout(o,r)),{data:[...n],totalCount:n.length}),insert:async o=>(n.push(o),o),update:async(o,s)=>{const i=n.findIndex(c=>c[a]===o);i>=0&&(n[i]={...n[i],...s})},remove:async o=>{n=n.filter(s=>s[a]!==o)},getData:()=>[...n],reset:()=>{n=[...t]}}}function ld(e){const t=[];return e.querySelectorAll('button, input, select, textarea, [role="button"], [role="link"], [role="checkbox"], [role="radio"]').forEach(o=>{var i;o.getAttribute("aria-label")||o.getAttribute("aria-labelledby")||((i=o.textContent)==null?void 0:i.trim())||o.getAttribute("title")||t.push(`${o.tagName.toLowerCase()}${o.id?"#"+o.id:""} missing accessible name`)}),e.querySelectorAll("img").forEach(o=>{!o.alt&&o.getAttribute("role")!=="presentation"&&t.push(`img${o.src?'[src="'+o.src.substring(0,40)+'..."]':""} missing alt text`)}),e.querySelectorAll('input:not([type="hidden"]), select, textarea').forEach(o=>{const s=o.id&&e.querySelector(`label[for="${o.id}"]`),i=o.getAttribute("aria-label")||o.getAttribute("aria-labelledby");!s&&!i&&t.push(`${o.tagName.toLowerCase()}${o.name?'[name="'+o.name+'"]':""} missing label`)}),t}const qa=process.env.NODE_ENV==="development";let O={enabled:qa,logToConsole:!1,slowRenderThreshold:16,samplingRate:1,enableUserTiming:!0,trackPropsChanges:!1};const it=[],re=new Map,ct=new Map;let dd=1;function Ya(e){O={...O,...e}}function Ja(){return new Map(re)}function Qa(e){return re.get(e)}function ud(e=100){return it.slice(-e)}function nr(){it.length=0,re.clear(),ct.clear()}function or(e){const t=e??O.slowRenderThreshold??16;return it.filter(r=>r.actualDuration>t)}function fd(){return Math.random()<(O.samplingRate??1)}function md(e){const t=re.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>(O.slowRenderThreshold??16)&&t.slowRenderCount++):re.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>(O.slowRenderThreshold??16)?1:0})}function Q(e){return e<1?`${(e*1e3).toFixed(0)}μs`:e<1e3?`${e.toFixed(2)}ms`:`${(e/1e3).toFixed(2)}s`}const pd=({id:e,children:t,onRender:r,onSlowRender:a,slowThreshold:n,logToConsole:o})=>{const s=l.useCallback((i,c,d,u,f,b)=>{var m,v,y;if(!O.enabled||!fd()||(m=O.ignoreComponents)!=null&&m.includes(i))return;const h={componentName:i,renderId:`render-${dd++}`,phase:c,actualDuration:d,baseDuration:u,startTime:f,commitTime:b,interactions:new Set,timestamp:Date.now()};if(it.push(h),md(h),O.enableUserTiming)try{performance.measure(`Nice:${i}:${c}`,{start:f,duration:d})}catch{}if(o??O.logToConsole){const S=n??O.slowRenderThreshold??16,w=d>S;console.log(`%c[Profile] ${i} ${c}`,`color: ${w?"var(--nice-color-error, #dc2626)":"var(--nice-color-success, #22c55e)"}; font-weight: ${w?"bold":"normal"}`,{actual:Q(d),base:Q(u),savings:`${((1-d/u)*100).toFixed(1)}%`})}r==null||r(h),(v=O.onRender)==null||v.call(O,h);const p=n??O.slowRenderThreshold??16;d>p&&(a==null||a(h),(y=O.onSlowRender)==null||y.call(O,h))},[r,a,n,o]);return O.enabled?x.jsx(l.Profiler,{id:e,onRender:s,children:t}):x.jsx(x.Fragment,{children:t})};function Za(e,t){const r=l.useRef(void 0),a=l.useRef(0);l.useEffect(()=>{if(!O.enabled||!O.trackPropsChanges)return;if(a.current++,a.current===1){r.current=t;return}const n=r.current,o=[],s=new Set([...Object.keys(n||{}),...Object.keys(t)]);for(const i of s){const c=n==null?void 0:n[i],d=t[i];Object.is(c,d)||o.push({propName:i,oldValue:c,newValue:d,timestamp:Date.now()})}o.length>0&&O.logToConsole&&console.log(`%c[Why render?] ${e}`,"color: var(--nice-info, #6366f1); font-weight: bold",`Render #${a.current}`,o.map(i=>({prop:i.propName,from:i.oldValue,to:i.newValue,type:typeof i.newValue}))),r.current=t})}function gd(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>(Za(r,n),x.jsx(e,{...n}));return a.displayName=`WhyDidYouRender(${r})`,a}function yd(e){const t=l.useRef(0);return t.current++,l.useEffect(()=>{O.enabled&&O.logToConsole&&e&&console.log(`%c[Render count] ${e}: ${t.current}`,`color: ${t.current>10?"var(--nice-color-warning, #f59e0b)":"var(--nice-color-success, #22c55e)"}`)}),t.current}function lt(e,t){if(!O.enabled)return;const r={name:e,startTime:performance.now(),detail:t};if(ct.set(e,r),O.enableUserTiming)try{performance.mark(`Nice:${e}:start`,{detail:t})}catch{}}function dt(e){if(!O.enabled)return 0;const t=ct.get(e);if(!t)return console.warn(`[Profile] No mark found for: ${e}`),0;const r=performance.now()-t.startTime;if(t.duration=r,O.enableUserTiming)try{performance.mark(`Nice:${e}:end`),performance.measure(`Nice:${e}`,`Nice:${e}:start`,`Nice:${e}:end`)}catch{}return O.logToConsole&&console.log(`%c[Measure] ${e}: ${Q(r)}`,`color: ${r>100?"var(--nice-color-warning, #f59e0b)":"var(--nice-color-success, #22c55e)"}`),r}async function hd(e,t,r){lt(e,r);try{return await t()}finally{dt(e)}}function bd(e,t,r){lt(e,r);try{return t()}finally{dt(e)}}function vd(e,t,r){l.useEffect(()=>{lt(e);const a=t();return dt(e),a},r)}function en(){const e=Array.from(re.values()),t=or(),r=e.reduce((o,s)=>o+s.renderCount,0),a=e.length>0?e.reduce((o,s)=>o+s.avgRenderTime,0)/e.length:0,n=Array.from(ct.values());return{stats:e,slowRenders:t,totalRenders:r,avgRenderTime:a,marks:n}}function sr(){const e=en();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: ${Q(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":Q(t.avgRenderTime),"Max Time":Q(t.maxRenderTime),"Total Time":Q(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:Q(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:Q(t.duration)}))),console.groupEnd()),console.groupEnd()}const tn=new Map;function rn(){for(const[e,t]of re)tn.set(e,{...t});console.log("[Profile] Baseline saved")}function an(e=20){const t=[];for(const[r,a]of re){const n=tn.get(r);if(!n)continue;const o=(a.avgRenderTime-n.avgRenderTime)/n.avgRenderTime*100;o>e&&t.push({componentName:r,metric:"avgRenderTime",baseline:n.avgRenderTime,current:a.avgRenderTime,changePercent:o});const s=(a.maxRenderTime-n.maxRenderTime)/n.maxRenderTime*100;s>e&&t.push({componentName:r,metric:"maxRenderTime",baseline:n.maxRenderTime,current:a.maxRenderTime,changePercent:s})}return t.length>0&&O.logToConsole&&console.warn("%c[Regression] Performance regressions detected!","color: var(--nice-danger-dark, #dc2626); font-weight: bold",t),t}const Sd=Object.assign(l.memo(({position:e="bottom-right",defaultCollapsed:t=!0})=>{const{t:r}=W.useNiceTranslation(),[a,n]=l.useState(t),[o,s]=l.useState([]),[i,c]=l.useState({used:0,total:0});if(l.useEffect(()=>{const u=()=>{const b=Array.from(re.values());s(b.sort((g,p)=>p.totalRenderTime-g.totalRenderTime).slice(0,10));const h=window.performance;h.memory&&c({used:h.memory.usedJSHeapSize/1024/1024,total:h.memory.totalJSHeapSize/1024/1024})};u();const f=setInterval(u,2e3);return()=>clearInterval(f)},[]),!O.enabled)return null;const d={position:"fixed",zIndex:99999,...e.includes("top")?{top:8}:{bottom:8},...e.includes("left")?{left:8}:{right:8}};return x.jsxs("div",{style:{...d,background:"var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",color:"var(--nice-color-white, #fff)",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:a?"4px 8px":8,maxWidth:a?"auto":300,maxHeight:a?"auto":400,overflow:"auto"},children:[x.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":!a,onKeyDown:A.clickOnActivationKey,style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>n(u=>!u),children:[x.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:"var(--nice-color-success, #22c55e)"}}),x.jsx("span",{children:r("profiling.profiler","Profiler")}),i.used>0&&x.jsxs("span",{style:{color:i.used>100?"var(--nice-color-warning, #f59e0b)":"var(--nice-text-muted, #64748b)"},children:[i.used.toFixed(0),"MB"]}),x.jsx("span",{style:{marginLeft:"auto",opacity:.5,display:"inline-flex"},children:x.jsx(A.NiceIcon,{name:a?"chevron-down":"chevron-up",size:12})})]}),!a&&x.jsxs("div",{style:{marginTop:8},children:[x.jsx("div",{style:{borderBottom:"1px solid var(--nice-border-color, #333)",paddingBottom:4,marginBottom:8},children:x.jsx("strong",{children:r("profiling.topComponents","Top Components")})}),o.map(u=>x.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[x.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:u.componentName}),x.jsx("span",{style:{color:u.avgRenderTime>16?"var(--nice-color-warning, #f59e0b)":"var(--nice-color-success, #22c55e)"},children:Q(u.avgRenderTime)}),x.jsxs("span",{style:{color:"var(--nice-text-muted, #64748b)",minWidth:30,textAlign:"right"},children:["x",u.renderCount]})]},u.componentName)),x.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[x.jsx("button",{onClick:sr,style:{flex:1,padding:"4px 8px",background:"var(--nice-bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:10},children:r("profiling.printReport","Print Report")}),x.jsx("button",{onClick:nr,style:{flex:1,padding:"4px 8px",background:"var(--nice-bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:10},children:r("profiling.clear","Clear")})]})]})]})}),{displayName:"ProfilerOverlay"});function xd(){qa&&(window.__NICE2DEV_PROFILER__={getStats:Ja,getComponentStats:Qa,getSlowRenders:or,printReport:sr,clear:nr,saveBaseline:rn,checkRegression:an,configure:Ya},console.log("%c[Nice2Dev Profiler] DevTools integration ready. Use __NICE2DEV_PROFILER__ in console.","color: var(--nice-info, #6366f1)"))}const ir=process.env.NODE_ENV==="development";let B={enabled:ir,logToConsole:!0,samplingRate:1,trackDetachedNodes:!1,closureSizeThreshold:1024*1024};const ut=[],Je=new Map,ht=new Map,zr=new WeakMap;let wd=1;function kd(){return Math.random()<(B.samplingRate??1)}function ft(){var e;try{throw new Error}catch(t){return((e=t.stack)==null?void 0:e.split(`
38
+ `)}function zl(e,t,r=!1){const a=Fr(Lr(e)),n=Fr(Lr(t)),o=_l(a,n),s=r?4.5:7;return{rule:"1.4.6",level:"AAA",passed:o>=s,message:`Contrast ratio ${o.toFixed(2)}:1 (requires ${s}:1 for AAA${r?" large text":""})`}}function Hl(){if(typeof document>"u")return[];const e=[];return document.querySelectorAll("a").forEach(r=>{var s;const a=((s=r.textContent)==null?void 0:s.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),o=parseFloat(a.fontSize);o>0&&n/o>80&&e.push({rule:"1.4.8",level:"AAA",passed:!1,message:`Text block exceeds 80 character width (${Math.round(n/o)} 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 Lr(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 Fr([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 _l(e,t){const r=Math.max(e,t),a=Math.min(e,t);return(r+.05)/(a+.05)}const Bl=["none","protanopia","protanomaly","deuteranopia","deuteranomaly","tritanopia","tritanomaly","achromatopsia","achromatomaly"],Dr="nice2dev-color-blind-filters",Pr="nice2dev-color-blind-styles",It={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 Ol(){if(typeof document>"u"||document.getElementById(Dr))return;const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.id=Dr,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(It)){const o=document.createElementNS(e,"filter");o.id=`nice-cb-${a}`,o.setAttribute("color-interpolation-filters","sRGB");const s=document.createElementNS(e,"feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("values",n),o.appendChild(s),r.appendChild(o)}if(t.appendChild(r),document.body.appendChild(t),!document.getElementById(Pr)){const a=document.createElement("style");a.id=Pr,a.textContent=Object.keys(It).map(n=>`.nice-color-blind-${n}{filter:url(#nice-cb-${n})!important;}`).join(""),document.head.appendChild(a)}}function Gt(e){for(const t of Object.keys(It))e.classList.remove(`nice-color-blind-${t}`)}function Xt(e,t=typeof document<"u"?document.documentElement:null){t&&(Ol(),Gt(t),e!=="none"&&t.classList.add(`nice-color-blind-${e}`))}function $a(e,t={}){const{target:r}=t,a=l.useRef(null);l.useEffect(()=>{const n=r??(typeof document<"u"?document.documentElement:null);return a.current=n,Xt(e,n),()=>{const o=a.current;o&&Gt(o)}},[e,r])}function jl(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 Wl(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 Vl(e={}){const{storageKey:t="nice2dev.a11y.cvd",storage:r="localStorage",defaultMode:a="none",target:n,cookieMaxAgeSeconds:o=3600*24*60}=e,s=l.useCallback(h=>{if(typeof window>"u"||r==="cookie")return()=>{};const g=p=>{p.key===t&&h()};return window.addEventListener("storage",g),()=>window.removeEventListener("storage",g)},[r,t]),i=l.useCallback(()=>jl(t,r)??a,[r,t,a]),c=l.useCallback(()=>a,[a]),d=l.useSyncExternalStore(s,i,c),[u,f]=l.useState(d);l.useEffect(()=>{d!==u&&f(d)},[d]),$a(u,{target:n});const b=l.useCallback(h=>{f(h),Wl(t,h,r,o)},[r,t,o]);return[u,b]}function Ul(e=typeof document<"u"?document.documentElement:null){return{set:t=>Xt(t,e),clear:()=>{e&&Gt(e)}}}function za(e,t){var s;if(typeof document>"u"||typeof getComputedStyle>"u")return Ha(e);const r=e.trim().match(/^var\(\s*([^,\s)]+)\s*(?:,\s*(.+))?\)$/);if(!r)return e;const a=typeof Element<"u"&&t instanceof Element&&t.isConnected?t:document.documentElement,n=getComputedStyle(a).getPropertyValue(r[1]).trim();if(n)return n;const o=(s=r[2])==null?void 0:s.trim();return o?za(o,t):e}function Ha(e){const t=e.trim().match(/^var\(\s*[^,\s)]+\s*(?:,\s*(.+))?\)$/);return t!=null&&t[1]?Ha(t[1]):e}function Kl(){const e=globalThis.crypto;if(typeof(e==null?void 0:e.randomUUID)=="function")return e.randomUUID();const t=new Uint8Array(16);if(typeof(e==null?void 0:e.getRandomValues)=="function")e.getRandomValues(t);else for(let a=0;a<t.length;a++)t[a]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const r=Array.from(t,a=>a.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}const Gl=e=>[...e],Xl=()=>{const e=new Map;return{getItem:t=>Promise.resolve(e.get(t)),setItem:(t,r)=>(e.set(t,r),Promise.resolve())}};function ql(e={}){var b,h;const t=e.permissionPolicy??Gl,r=e.storage;let a;r&&typeof r.getItem=="function"&&typeof r.setItem=="function"?a={getItem:r.getItem,setItem:r.setItem}:a=Xl();const n=(b=e.permissions)==null?void 0:b.canActivate,o={user:(h=e.permissions)==null?void 0:h.user},s=e.logger,i=new Map,c=new Map,d=new Map,u=(g,p)=>{const m=d.get(g);if(m)for(const v of m)try{v(p)}catch{}},f=(g,p,m)=>{const v=new Set(p);return{permissions:v,log:(y,...S)=>{s&&s(g.id,y,S)},on:(y,S)=>{let w=c.get(y);w||(w=new Set,c.set(y,w)),w.add(S);const E=()=>{w.delete(S)};return m.push(E),E},emit:(y,S)=>{if(!v.has("events:emit"))return;const w=c.get(y);if(w)for(const E of w)try{E(S)}catch{}},setItem:async(y,S)=>{v.has("storage:write")&&await a.setItem(`${g.id}:${y}`,S)},getItem:async y=>{if(v.has("storage:read"))return await a.getItem(`${g.id}:${y}`)}}};return{register(g){const p=g.manifest.id;if(i.has(p))throw new Error(`Plugin "${p}" already registered`);const m={manifest:g.manifest,status:"registered"};return i.set(p,{plugin:g,record:m,cleanups:[]}),u("register",m),m},unregister(g){return i.get(g)?(i.delete(g),!0):!1},async activate(g){const p=i.get(g);if(!p)throw new Error(`Unknown plugin "${g}"`);if(p.record.status==="active")return p.record;for(const m of p.plugin.manifest.dependsOn??[]){const v=i.get(m);if(!v)throw p.record.status="error",p.record.error=`Missing dependency: ${m}`,u("error",p.record),new Error(p.record.error);v.record.status!=="active"&&await this.activate(m)}p.record.status="activating";try{if(n&&!n(p.plugin.manifest,o))throw p.record.status="error",p.record.error="permission-denied",u("error",p.record),new Error(p.record.error);const m=t(p.plugin.manifest.permissions??[],p.plugin.manifest),v=f(p.plugin.manifest,m,p.cleanups);await p.plugin.activate(v),p.record.status="active",p.record.activatedAt=Date.now(),p.record.error=void 0,u("activate",p.record)}catch(m){throw p.record.status="error",p.record.error=m instanceof Error?m.message:String(m),u("error",p.record),m}return p.record},async deactivate(g){var m,v;const p=i.get(g);if(!p)throw new Error(`Unknown plugin "${g}"`);if(p.record.status!=="active")return p.record;p.record.status="deactivating";try{await((v=(m=p.plugin).deactivate)==null?void 0:v.call(m));for(const y of p.cleanups.splice(0))await y();p.record.status="inactive",u("deactivate",p.record)}catch(y){throw p.record.status="error",p.record.error=y instanceof Error?y.message:String(y),u("error",p.record),y}return p.record},list(){return[...i.values()].map(g=>({...g.record}))},get(g){const p=i.get(g);return p?{...p.record}:void 0},on(g,p){let m=d.get(g);return m||(m=new Set,d.set(g,m)),m.add(p),()=>{m.delete(p)}},events:{on(g,p){const v={"plugin:registered":"register","plugin:activated":"activate","plugin:deactivated":"deactivate","plugin:error":"error"}[g];let y=d.get(v);return y||(y=new Set,d.set(v,y)),y.add(p),()=>{y.delete(p)}},emit(g,p){const m=c.get(g);if(m)for(const v of m)try{v(p)}catch{}}}}}const ce={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},me={fontFamily:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",headingFontFamily:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",monoFontFamily:"'JetBrains Mono', ui-monospace, monospace",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},pe={fast:"120ms cubic-bezier(0.4,0,0.2,1)",normal:"200ms cubic-bezier(0.4,0,0.2,1)",slow:"320ms cubic-bezier(0.4,0,0.2,1)"},_a={sm:"0 1px 2px rgba(15,23,42,0.06)",md:"0 4px 10px -2px rgba(15,23,42,0.10), 0 2px 4px -2px rgba(15,23,42,0.06)",lg:"0 12px 24px -6px rgba(15,23,42,0.14), 0 4px 8px -4px rgba(15,23,42,0.08)",xl:"0 24px 48px -12px rgba(15,23,42,0.22)"},Ba={sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 12px rgba(0,0,0,0.55)",lg:"0 12px 28px rgba(0,0,0,0.65)",xl:"0 24px 56px rgba(0,0,0,0.75)"},Yl={onyx:"#050505",jet:"#0e0e0e",graphite:"#161616",smoke:"#1f1f1f",gold:"#c89848",goldLight:"#e0b868",goldDeep:"#9c7430",champagne:"#e8d0a0",ivory:"#f0ead8",sand:"#a89870",bronze:"#3a2e18",ink:"#120d04"},st={name:"Black Tie Gala",schemaVersion:2,darkMode:"dark",recommendedDisplayStyle:"luxe",palette:Yl,gradients:{goldFoil:"linear-gradient(135deg, {palette.goldLight} 0%, {palette.gold} 55%, {palette.goldDeep} 100%)",nightBar:{css:"linear-gradient(90deg, {palette.jet} 0%, #17130b 60%, #2a2112 100%)",base:"{palette.jet}"},goldThumb:"linear-gradient(180deg, {palette.goldLight}, {palette.gold})"},colors:{primary:"#c89848",primaryHover:"#e0b868",success:"#6db37f",warning:"#e0b050",error:"#e06a6a",info:"#8eb0d8",accent:"#e8d0a0",accentHover:"#f0ead8",link:"#e0b868",linkHover:"#e8d0a0",focus:"#c89848",surface:"#0e0e0e",surfaceHover:"#161616"},backgrounds:{primary:"#050505",secondary:"#0e0e0e",tertiary:"#161616",hover:"#1f1f1f",elevated:"#121212",inset:"#020202",canvas:"#030303"},text:{primary:"#f0ead8",secondary:"#a89870",muted:"#8a7c60",inverse:"#050505",onPrimary:"#120d04",onAccent:"#120d04",onSuccess:"#120d04",onError:"#120d04",onInfo:"#120d04",onWarning:"#120d04"},borders:{color:"#3a2e18",divider:"#241a0c",focusColor:"#c89848",width:"1px",radiusSm:"3px",radiusMd:"5px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(200,152,72,0.10)",md:"0 4px 16px rgba(0,0,0,0.8), 0 0 0 1px rgba(200,152,72,0.14)",lg:"0 10px 32px rgba(0,0,0,0.9), 0 0 0 1px rgba(200,152,72,0.22)",xl:"0 24px 56px rgba(0,0,0,1), 0 0 0 1px rgba(200,152,72,0.3)",glow:"0 0 24px rgba(200,152,72,0.25)"},spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.jet}",text:"{palette.ivory}"},panel:{background:"#121212",text:"{palette.ivory}",border:"#2a2214"},topNav:{background:"{gradients.nightBar}",text:"{palette.champagne}",border:"{palette.bronze}"},sideNav:{background:"{palette.onyx}",text:"{palette.ivory}",border:"{palette.bronze}",headers:{mode:"shade",base:"{palette.gold}",sync:!0},highlight:{base:"{palette.goldLight}",text:"{palette.ink}"}}},scrollbar:{track:"transparent",thumb:"{gradients.goldThumb}",thumbHover:"{palette.goldLight}",width:"10px",thumbWidth:"6px",radius:"full"}},Jl={blue:"#0078d4",blueHover:"#106ebe",blueDark:"#005a9e",white:"#ffffff",canvas:"#faf9f8",mist:"#f3f2f1",fog:"#edebe9",line:"#e1dfdd",ink:"#323130",slate:"#605e5c",ash:"#8a8886"},qt={name:"Fluent",schemaVersion:2,darkMode:"light",palette:Jl,gradients:{brandBar:"linear-gradient(90deg, {palette.blueDark} 0%, {palette.blue} 100%)"},colors:{primary:"#0078d4",primaryHover:"#106ebe",success:"#107c10",warning:"#c19c00",error:"#d13438",info:"#0078a8",accent:"#8764b8",link:"#0078d4",focus:"#0078d4",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:"#8a8886",inverse:"#ffffff",onPrimary:"#ffffff"},borders:{color:"#e1dfdd",divider:"#edebe9",focusColor:"#0078d4",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:ce,typography:{fontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",headingFontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",monoFontFamily:"'Cascadia Code', 'JetBrains Mono', ui-monospace, monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.45},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)"},layout:{body:{background:"{palette.canvas}",text:"{palette.ink}"},panel:{background:"{palette.white}",text:"{palette.ink}",border:"{palette.line}"},topNav:{background:"{gradients.brandBar}",text:"{palette.white}",border:"{palette.blueDark}"},sideNav:{background:"{palette.mist}",text:"{palette.ink}",border:"{palette.line}",headers:{mode:"shade",base:"{palette.blue}",sync:!0},highlight:{base:"{palette.blue}",text:"{palette.white}"}}},scrollbar:{track:"transparent",thumb:"#c8c6c4",thumbHover:"{palette.ash}",width:"12px",thumbWidth:"6px",radius:"full"}},Ql={s50:"#f8fafc",s100:"#f1f5f9",s200:"#e2e8f0",s300:"#cbd5e1",s500:"#64748b",s600:"#475569",s700:"#334155",s800:"#1e293b",s900:"#0f172a",sky:"#0369a1",white:"#ffffff"},Yt={name:"Slate",schemaVersion:2,darkMode:"light",palette:Ql,gradients:{slateBar:"linear-gradient(90deg, {palette.s900} 0%, {palette.s800} 100%)"},colors:{primary:"#475569",primaryHover:"#334155",success:"#047857",warning:"#b45309",error:"#dc2626",info:"#0369a1",accent:"#0369a1",link:"#0369a1",focus:"#0369a1",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#f1f5f9"},text:{primary:"#0f172a",secondary:"#475569",muted:"#64748b",inverse:"#ffffff",onPrimary:"#ffffff"},borders:{color:"#e2e8f0",divider:"#e2e8f0",focusColor:"#0369a1",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:_a,spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.s100}",text:"{palette.s900}"},panel:{background:"{palette.white}",text:"{palette.s900}",border:"{palette.s200}"},topNav:{background:"{gradients.slateBar}",text:"{palette.s100}",border:"{palette.s900}"},sideNav:{background:"{palette.s50}",text:"{palette.s900}",border:"{palette.s200}",headers:{mode:"shade",base:"{palette.s700}",sync:!0},highlight:{base:"{palette.sky}",text:"{palette.white}"}}},scrollbar:{track:"transparent",thumb:"{palette.s300}",thumbHover:"{palette.s500}",width:"10px",thumbWidth:"6px",radius:"full"}},Zl={white:"#ffffff",z50:"#fafafa",z100:"#f4f4f5",z200:"#e4e4e7",z300:"#d4d4d8",z400:"#a1a1aa",z500:"#71717a",z600:"#52525b",z800:"#27272a",z900:"#18181b"},Jt={name:"Minimalism",schemaVersion:2,darkMode:"light",palette:Zl,colors:{primary:"#18181b",primaryHover:"#27272a",success:"#15803d",warning:"#a16207",error:"#dc2626",info:"#2563eb",accent:"#52525b",link:"#18181b",focus:"#18181b",surface:"#ffffff",surfaceHover:"#fafafa"},backgrounds:{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f4f4f5",hover:"#f4f4f5",elevated:"#ffffff",inset:"#f4f4f5",canvas:"#fafafa"},text:{primary:"#18181b",secondary:"#52525b",muted:"#71717a",inverse:"#ffffff",onPrimary:"#ffffff"},borders:{color:"#e4e4e7",divider:"#f4f4f5",focusColor:"#18181b",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"10px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(24,24,27,0.05)",md:"0 2px 8px rgba(24,24,27,0.06)",lg:"0 8px 20px rgba(24,24,27,0.08)",xl:"0 16px 40px rgba(24,24,27,0.12)"},spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.z50}",text:"{palette.z900}"},panel:{background:"{palette.white}",text:"{palette.z900}",border:"{palette.z200}"},topNav:{background:"{palette.white}",text:"{palette.z900}",border:"{palette.z200}"},sideNav:{background:"{palette.white}",text:"{palette.z900}",border:"{palette.z200}",headers:{mode:"shade",base:"{palette.z800}",sync:!0,curve:[1,.3,.2,.12,.07,.04]},highlight:{base:"{palette.z900}",text:"{palette.white}"}}},scrollbar:{track:"transparent",thumb:"{palette.z300}",thumbHover:"{palette.z400}",width:"8px",thumbWidth:"4px",radius:"full"}},ed={navy:"#1e3a5f",navyDeep:"#13294b",navyHover:"#152c4a",gold:"#b8860b",goldLight:"#d4a843",paper:"#f4f6f9",white:"#ffffff",mist:"#e8edf3",line:"#d9e0e9",ink:"#0f1e33",steel:"#4a5b72",pewter:"#6b7a8f",inkGold:"#1a1206"},Qt={name:"Banking",schemaVersion:2,darkMode:"light",palette:ed,gradients:{vault:"linear-gradient(90deg, {palette.navyDeep} 0%, {palette.navy} 100%)"},colors:{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#1d4ed8",accent:"#b8860b",accentHover:"#d4a843",link:"#1e3a5f",focus:"#b8860b",surface:"#ffffff",surfaceHover:"#f4f6f9"},backgrounds:{primary:"#ffffff",secondary:"#f4f6f9",tertiary:"#e8edf3",hover:"#e8edf3",elevated:"#ffffff",inset:"#e8edf3",canvas:"#f4f6f9"},text:{primary:"#0f1e33",secondary:"#4a5b72",muted:"#6b7a8f",inverse:"#ffffff",onPrimary:"#ffffff",onAccent:"#1a1206"},borders:{color:"#d9e0e9",divider:"#e8edf3",focusColor:"#b8860b",radiusSm:"3px",radiusMd:"5px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:_a,spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.paper}",text:"{palette.ink}"},panel:{background:"{palette.white}",text:"{palette.ink}",border:"{palette.line}"},topNav:{background:"{gradients.vault}",text:"{palette.white}",border:"{palette.navyDeep}"},sideNav:{background:"{palette.white}",text:"{palette.ink}",border:"{palette.line}",headers:{mode:"shade",base:"{palette.navy}",sync:!0},highlight:{base:"{palette.gold}",text:"{palette.inkGold}"}}},scrollbar:{track:"transparent",thumb:"#b4c0cf",thumbHover:"{palette.pewter}",width:"10px",thumbWidth:"6px",radius:"full"}},td={night:"#0b0a12",deep:"#13111c",plum:"#1b1828",dusk:"#252136",violet:"#a78bfa",violetLight:"#c4b5fd",violetDeep:"#7c3aed",orchid:"#e879f9",mist:"#ede9fe",haze:"#b8acd9",smoke:"#8b80ad",line:"#2e2945",ink:"#140f24"},Zt={name:"Obsidian",schemaVersion:2,darkMode:"dark",palette:td,gradients:{glassBar:{css:"linear-gradient(90deg, {palette.deep} 0%, #2a1f4d 100%)",base:"{palette.deep}"},amethyst:"linear-gradient(180deg, {palette.violetLight}, {palette.violetDeep})"},colors:{primary:"#a78bfa",primaryHover:"#c4b5fd",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#7dd3fc",accent:"#e879f9",link:"#c4b5fd",focus:"#a78bfa",surface:"#13111c",surfaceHover:"#1b1828"},backgrounds:{primary:"#0b0a12",secondary:"#13111c",tertiary:"#1b1828",hover:"#252136",elevated:"#1b1828",inset:"#07060c",canvas:"#0b0a12"},text:{primary:"#ede9fe",secondary:"#b8acd9",muted:"#8b80ad",inverse:"#0b0a12",onPrimary:"#140f24",onAccent:"#140f24"},borders:{color:"#2e2945",divider:"#1b1828",focusColor:"#a78bfa",radiusSm:"4px",radiusMd:"6px",radiusLg:"10px",radiusXl:"14px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 12px rgba(0,0,0,0.55)",lg:"0 12px 28px rgba(0,0,0,0.65)",xl:"0 24px 56px rgba(0,0,0,0.75)",glow:"0 0 24px rgba(167,139,250,0.3)"},spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.deep}",text:"{palette.mist}"},panel:{background:"{palette.plum}",text:"{palette.mist}",border:"{palette.line}"},topNav:{background:"{gradients.glassBar}",text:"{palette.mist}",border:"{palette.line}"},sideNav:{background:"{palette.night}",text:"{palette.mist}",border:"{palette.line}",headers:{mode:"shade",base:"{palette.violet}",sync:!0},highlight:{base:"{palette.violetLight}",text:"{palette.ink}"}}},scrollbar:{track:"transparent",thumb:"{gradients.amethyst}",thumbHover:"{palette.violetLight}",width:"10px",thumbWidth:"6px",radius:"full"}},rd={black:"#0a0a0a",coal:"#141414",iron:"#1f1f1f",steel:"#2a2a2a",blue:"#2563eb",sky:"#60a5fa",snow:"#f5f5f5",silver:"#a3a3a3",ash:"#8a8a8a",line:"#2e2e2e"},er={name:"Onyx",schemaVersion:2,darkMode:"dark",palette:rd,colors:{primary:"#60a5fa",primaryHover:"#93c5fd",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#38bdf8",accent:"#2563eb",link:"#60a5fa",focus:"#60a5fa",surface:"#141414",surfaceHover:"#1f1f1f"},backgrounds:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1f1f1f",hover:"#2a2a2a",elevated:"#1f1f1f",inset:"#050505",canvas:"#0a0a0a"},text:{primary:"#f5f5f5",secondary:"#a3a3a3",muted:"#8a8a8a",inverse:"#0a0a0a",onPrimary:"#0a0a0a",onAccent:"#f5f5f5"},borders:{color:"#2e2e2e",divider:"#1f1f1f",focusColor:"#60a5fa",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:Ba,spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.coal}",text:"{palette.snow}"},panel:{background:"{palette.iron}",text:"{palette.snow}",border:"{palette.line}"},topNav:{background:"{palette.coal}",text:"{palette.snow}",border:"{palette.line}"},sideNav:{background:"{palette.black}",text:"{palette.snow}",border:"{palette.line}",headers:{mode:"shade",base:"{palette.blue}",sync:!0},highlight:{base:"{palette.sky}",text:"{palette.black}"}}},scrollbar:{track:"transparent",thumb:"#3a3a3a",thumbHover:"{palette.sky}",width:"10px",thumbWidth:"6px",radius:"full"}},ad={void:"#111214",graphite:"#18191c",slate:"#202226",iron:"#2a2c31",zinc:"#52525b",pewter:"#a1a1aa",fog:"#e5e7eb",ash:"#8b8b94",line:"#2f3136"},tr={name:"Shadow",schemaVersion:2,darkMode:"dark",palette:ad,colors:{primary:"#d4d4d8",primaryHover:"#e5e7eb",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#93c5fd",accent:"#a1a1aa",link:"#e5e7eb",focus:"#a1a1aa",surface:"#18191c",surfaceHover:"#202226"},backgrounds:{primary:"#111214",secondary:"#18191c",tertiary:"#202226",hover:"#2a2c31",elevated:"#202226",inset:"#0c0d0f",canvas:"#111214"},text:{primary:"#e5e7eb",secondary:"#a1a1aa",muted:"#8b8b94",inverse:"#111214",onPrimary:"#111214",onAccent:"#111214"},borders:{color:"#2f3136",divider:"#202226",focusColor:"#a1a1aa",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:Ba,spacing:ce,typography:me,transitions:pe,layout:{body:{background:"{palette.graphite}",text:"{palette.fog}"},panel:{background:"{palette.slate}",text:"{palette.fog}",border:"{palette.line}"},topNav:{background:"{palette.graphite}",text:"{palette.fog}",border:"{palette.line}"},sideNav:{background:"{palette.void}",text:"{palette.fog}",border:"{palette.line}",headers:{mode:"shade",base:"{palette.zinc}",sync:!0},highlight:{base:"{palette.fog}",text:"{palette.void}",curve:[.12,.17,.22,.28,.34,.4]}}},scrollbar:{track:"transparent",thumb:"#3d3f46",thumbHover:"{palette.zinc}",width:"10px",thumbWidth:"6px",radius:"full"}},nd=[{meta:{id:"blackTieGala",name:"Black Tie Gala",tagline:"Absolute black and gold foil — premium, prestige.",tags:["dark","premium","default"]},theme:st,displayStyle:"luxe"},{meta:{id:"fluent",name:"Fluent",tagline:"Fluent 2: white surfaces, Segoe, communication blue.",tags:["light"]},theme:qt,displayStyle:"default"},{meta:{id:"slate",name:"Slate",tagline:"Cool slate greys with a slate top bar and one sky accent.",tags:["light"]},theme:Yt,displayStyle:"default"},{meta:{id:"minimalism",name:"Minimalism",tagline:"White and zinc ink — nothing that is not needed.",tags:["light"]},theme:Jt,displayStyle:"default"},{meta:{id:"banking",name:"Banking",tagline:"Navy and gold — the calm of a private bank.",tags:["light"]},theme:Qt,displayStyle:"default"},{meta:{id:"obsidian",name:"Obsidian",tagline:"Volcanic glass: near-black violet, lavender light.",tags:["dark"]},theme:Zt,displayStyle:"default"},{meta:{id:"onyx",name:"Onyx",tagline:"Neutral black with one electric blue.",tags:["dark"]},theme:er,displayStyle:"default"},{meta:{id:"shadow",name:"Shadow",tagline:"Graphite greys, quiet and even.",tags:["dark"]},theme:tr,displayStyle:"default"}],rr=[st,qt,Yt,Jt,Qt,Zt,er,tr],Rt=st,ge={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},it={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},ze={color:"#e2e8f0",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},He={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},Oa={name:"Light",darkMode:"light",colors:{primary:"#2563eb",primaryHover:"#1d4ed8",success:"#047857",warning:"#f59e0b",error:"#dc2626",info:"#0e7490",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:"#64748b",inverse:"#ffffff"},borders:ze,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:ge,typography:it,transitions:He},ja=(function(){return{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:"#858585",inverse:"#0f172a"},borders:{...ze,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:ge,typography:it,transitions:He}})(),Wa=(function(){return{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:{...ze,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:ge,typography:it,transitions:He}})(),Va=(function(){return{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:{...ze,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:ge,typography:it,transitions:He}})(),Ua=(function(){return{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:{...ze,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:ge,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)"}}})(),Ka={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:ge,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:He},Ga={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:ge,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=(function(){return[...rr]})(),od=["primary","primary-hover","primary-light","primary-bg","success","warning","error","info","accent","surface","surface-hover"];function sd(e,t){return e??t.recommendedDisplayStyle??"default"}function $r(e){return e.toLowerCase().replace(/[\s_-]+/g,"")}function zr(e){if(e&&typeof e=="object")return e;if(typeof e=="string"){const t=$r(e);if(t==="light")return Oa;if(t==="dark")return ja;const r=Lt.find(a=>$r(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 '${Rt.name}'. Available: ${Lt.map(a=>a.name).join(", ")}. A theme from before 1.4.0 is in NICE_THEME_ARCHIVE — import it and pass the object.`)}return Rt}const ar=({theme:e,darkTheme:t,variantConfig:r,darkMode:a,displayStyle:n,animateTransitions:o=!0,children:s})=>{const i=l.useMemo(()=>zr(e),[e]),c=l.useMemo(()=>t===void 0?void 0:zr(t),[t]),d=l.useId(),u=l.useMemo(()=>`p${d.replace(/:/g,"")}`,[d]),f=l.useRef(null),b=l.useRef(null),h=l.useRef(new Set),[g,p]=l.useState(null),[m,v]=l.useState(null),y=m&&m.over===i&&m.overDark===c?m.theme:null,[S,w]=l.useState(!1),[E,k]=l.useState(()=>sd(n,i));l.useEffect(()=>{n!==void 0?k(n):i.recommendedDisplayStyle&&k(i.recommendedDisplayStyle)},[n,i.recommendedDisplayStyle]),l.useEffect(()=>{const R=window.matchMedia("(prefers-color-scheme: dark)");w(R.matches);const L=F=>w(F.matches);return R.addEventListener("change",L),()=>R.removeEventListener("change",L)},[]);const C=a??(y??i).darkMode??"light",N=C==="dark"||C==="auto"&&S,M=y??(N&&c?c:i);l.useEffect(()=>{if(typeof document>"u")return;const R=document.createElement("div");return R.className="nice-theme-scope nice-theme-portal-host",R.dataset.ntdProvider=u,R.style.display="contents",document.body.appendChild(R),b.current=R,p(R),()=>{R.parentNode&&R.parentNode.removeChild(R),b.current=null,p(null)}},[u]),l.useEffect(()=>{const R=f.current;if(!R)return;o&&(R.style.transition="background-color 300ms ease, color 300ms ease");const L=Ye(M);for(const[U,K]of Object.entries(L))R.style.setProperty(U,K);const F=b.current;if(F)for(const[U,K]of Object.entries(L))F.style.setProperty(U,K);R.style.colorScheme=N?"dark":"light",R.dataset.ntdColorScheme=N?"dark":"light",R.dataset.theme=N?"dark":"light",N?R.classList.add("nice-dark"):R.classList.remove("nice-dark"),F&&(F.style.colorScheme=N?"dark":"light",F.dataset.ntdColorScheme=N?"dark":"light",F.dataset.theme=N?"dark":"light",N?F.classList.add("nice-dark"):F.classList.remove("nice-dark"));const H=M.backgroundImage;if(H&&H.type!=="none"&&H.type==="gradient"&&H.gradient&&R.style.setProperty("--ntd-bg-image",H.gradient),process.env.NODE_ENV!=="production"){const{diagnostics:U}=Re(M);U.length>0&&!h.current.has(M.name)&&(h.current.add(M.name),console.warn(`[NiceThemeProvider] theme "${M.name}": ${U.map(K=>K.message).join("; ")}`))}return()=>{R&&Et(R),F&&Et(F)}},[M,N,o,g]);const T=l.useRef(new Set);l.useEffect(()=>{if(process.env.NODE_ENV==="production"||typeof window>"u"||typeof document>"u")return;const R=window.setTimeout(()=>{const L=Ye(M),F=["--color-primary","--nice-primary","--bg-primary","--text-primary"].find(Z=>L[Z])??Object.keys(L)[0];if(!F)return;const H=String(L[F]??"").trim();if(!H)return;const U=getComputedStyle(document.documentElement).getPropertyValue(F).trim();if(!U||U===H)return;const K=`${u}::${M.name??"unnamed"}::${F}`;T.current.has(K)||(T.current.add(K),console.warn(`[NiceThemeProvider] CSS var "${F}" on documentElement (${U}) does not match the active provider pack "${M.name??"unnamed"}" (${H}). 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(R)},[M,u]);const P=l.useRef(!1);l.useEffect(()=>{if(process.env.NODE_ENV==="production"||P.current||typeof window>"u"||typeof document>"u")return;const R=window.setTimeout(()=>{const L=getComputedStyle(document.documentElement);if(!L.getPropertyValue("--nice-overlay-8").trim())return;const F=od.filter(H=>!L.getPropertyValue(`--nice-${H}`).trim()&&!L.getPropertyValue(`--nice-color-${H}`).trim());F.length!==0&&(P.current=!0,console.warn(`[NiceThemeProvider] ${F.map(H=>`--nice-${H} / --nice-color-${H}`).join(", ")} resolve to nothing on :root, so dropdowns, dialogs and anything else outside this provider fall back to their built-in colours. Usually an alias cycle in your CSS: the stylesheet already points each --nice-<name> at --nice-color-<name>, so declaring --nice-color-<name> in terms of --nice-<name> closes a loop. Set the --nice-color-* tokens to real values (or use the theme) instead.`))},0);return()=>window.clearTimeout(R)},[M]),l.useEffect(()=>{const R=f.current;if(!R)return;const L=r?{...te,...r}:Te(E);Ot(L,R,u);const F=aa(E);for(const[H,U]of Object.entries(F))R.setAttribute(H,U);return()=>{ta(u,R)}},[r,E,u]);const $=l.useCallback(R=>v({theme:R,over:i,overDark:c}),[i,c]),z=l.useMemo(()=>({theme:Re(M).theme,sourceTheme:M,setTheme:$,portalTarget:g}),[M,$,g]),_=l.useMemo(()=>({displayStyle:E,variantConfig:Te(E),setDisplayStyle:k}),[E]);return x.jsx(Le.Provider,{value:z,children:x.jsx(rt.Provider,{value:_,children:x.jsx("div",{ref:f,className:"nice-theme-scope","data-ntd-provider":u,style:{display:"contents"},children:s})})})};process.env.NODE_ENV!=="production"&&(ar.displayName="NiceThemeProvider");function id(...e){return e.join("-")}const cd={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"},Xa=({children:e,theme:t,direction:r="ltr",t:a})=>{let n=l.createElement("div",{dir:r,"data-testid":"nice-test-root",style:{direction:r}},e);return a&&(n=l.createElement(W.NiceI18nLazyProvider,{t:a,children:n})),t&&(n=l.createElement(ar,{theme:t,children:n})),n};process.env.NODE_ENV!=="production"&&(Xa.displayName="NiceTestWrapper");function ld(e,t,r){const a=new KeyboardEvent("keydown",{key:t,bubbles:!0,cancelable:!0,...r});e.dispatchEvent(a)}function dd(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 ud(e){const{data:t,delay:r=0,keyField:a="id"}=e;let n=[...t];return{key:a,load:async()=>(r>0&&await new Promise(o=>setTimeout(o,r)),{data:[...n],totalCount:n.length}),insert:async o=>(n.push(o),o),update:async(o,s)=>{const i=n.findIndex(c=>c[a]===o);i>=0&&(n[i]={...n[i],...s})},remove:async o=>{n=n.filter(s=>s[a]!==o)},getData:()=>[...n],reset:()=>{n=[...t]}}}function fd(e){const t=[];return e.querySelectorAll('button, input, select, textarea, [role="button"], [role="link"], [role="checkbox"], [role="radio"]').forEach(o=>{var i;o.getAttribute("aria-label")||o.getAttribute("aria-labelledby")||((i=o.textContent)==null?void 0:i.trim())||o.getAttribute("title")||t.push(`${o.tagName.toLowerCase()}${o.id?"#"+o.id:""} missing accessible name`)}),e.querySelectorAll("img").forEach(o=>{!o.alt&&o.getAttribute("role")!=="presentation"&&t.push(`img${o.src?'[src="'+o.src.substring(0,40)+'..."]':""} missing alt text`)}),e.querySelectorAll('input:not([type="hidden"]), select, textarea').forEach(o=>{const s=o.id&&e.querySelector(`label[for="${o.id}"]`),i=o.getAttribute("aria-label")||o.getAttribute("aria-labelledby");!s&&!i&&t.push(`${o.tagName.toLowerCase()}${o.name?'[name="'+o.name+'"]':""} missing label`)}),t}const qa=process.env.NODE_ENV==="development";let B={enabled:qa,logToConsole:!1,slowRenderThreshold:16,samplingRate:1,enableUserTiming:!0,trackPropsChanges:!1};const ct=[],re=new Map,lt=new Map;let md=1;function Ya(e){B={...B,...e}}function Ja(){return new Map(re)}function Qa(e){return re.get(e)}function pd(e=100){return ct.slice(-e)}function nr(){ct.length=0,re.clear(),lt.clear()}function or(e){const t=e??B.slowRenderThreshold??16;return ct.filter(r=>r.actualDuration>t)}function gd(){return Math.random()<(B.samplingRate??1)}function yd(e){const t=re.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>(B.slowRenderThreshold??16)&&t.slowRenderCount++):re.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>(B.slowRenderThreshold??16)?1:0})}function Q(e){return e<1?`${(e*1e3).toFixed(0)}μs`:e<1e3?`${e.toFixed(2)}ms`:`${(e/1e3).toFixed(2)}s`}const hd=({id:e,children:t,onRender:r,onSlowRender:a,slowThreshold:n,logToConsole:o})=>{const s=l.useCallback((i,c,d,u,f,b)=>{var m,v,y;if(!B.enabled||!gd()||(m=B.ignoreComponents)!=null&&m.includes(i))return;const h={componentName:i,renderId:`render-${md++}`,phase:c,actualDuration:d,baseDuration:u,startTime:f,commitTime:b,interactions:new Set,timestamp:Date.now()};if(ct.push(h),yd(h),B.enableUserTiming)try{performance.measure(`Nice:${i}:${c}`,{start:f,duration:d})}catch{}if(o??B.logToConsole){const S=n??B.slowRenderThreshold??16,w=d>S;console.log(`%c[Profile] ${i} ${c}`,`color: ${w?"var(--nice-color-error, #dc2626)":"var(--nice-color-success, #22c55e)"}; font-weight: ${w?"bold":"normal"}`,{actual:Q(d),base:Q(u),savings:`${((1-d/u)*100).toFixed(1)}%`})}r==null||r(h),(v=B.onRender)==null||v.call(B,h);const p=n??B.slowRenderThreshold??16;d>p&&(a==null||a(h),(y=B.onSlowRender)==null||y.call(B,h))},[r,a,n,o]);return B.enabled?x.jsx(l.Profiler,{id:e,onRender:s,children:t}):x.jsx(x.Fragment,{children:t})};function Za(e,t){const r=l.useRef(void 0),a=l.useRef(0);l.useEffect(()=>{if(!B.enabled||!B.trackPropsChanges)return;if(a.current++,a.current===1){r.current=t;return}const n=r.current,o=[],s=new Set([...Object.keys(n||{}),...Object.keys(t)]);for(const i of s){const c=n==null?void 0:n[i],d=t[i];Object.is(c,d)||o.push({propName:i,oldValue:c,newValue:d,timestamp:Date.now()})}o.length>0&&B.logToConsole&&console.log(`%c[Why render?] ${e}`,"color: var(--nice-info, #6366f1); font-weight: bold",`Render #${a.current}`,o.map(i=>({prop:i.propName,from:i.oldValue,to:i.newValue,type:typeof i.newValue}))),r.current=t})}function bd(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>(Za(r,n),x.jsx(e,{...n}));return a.displayName=`WhyDidYouRender(${r})`,a}function vd(e){const t=l.useRef(0);return t.current++,l.useEffect(()=>{B.enabled&&B.logToConsole&&e&&console.log(`%c[Render count] ${e}: ${t.current}`,`color: ${t.current>10?"var(--nice-color-warning, #f59e0b)":"var(--nice-color-success, #22c55e)"}`)}),t.current}function dt(e,t){if(!B.enabled)return;const r={name:e,startTime:performance.now(),detail:t};if(lt.set(e,r),B.enableUserTiming)try{performance.mark(`Nice:${e}:start`,{detail:t})}catch{}}function ut(e){if(!B.enabled)return 0;const t=lt.get(e);if(!t)return console.warn(`[Profile] No mark found for: ${e}`),0;const r=performance.now()-t.startTime;if(t.duration=r,B.enableUserTiming)try{performance.mark(`Nice:${e}:end`),performance.measure(`Nice:${e}`,`Nice:${e}:start`,`Nice:${e}:end`)}catch{}return B.logToConsole&&console.log(`%c[Measure] ${e}: ${Q(r)}`,`color: ${r>100?"var(--nice-color-warning, #f59e0b)":"var(--nice-color-success, #22c55e)"}`),r}async function Sd(e,t,r){dt(e,r);try{return await t()}finally{ut(e)}}function xd(e,t,r){dt(e,r);try{return t()}finally{ut(e)}}function wd(e,t,r){l.useEffect(()=>{dt(e);const a=t();return ut(e),a},r)}function en(){const e=Array.from(re.values()),t=or(),r=e.reduce((o,s)=>o+s.renderCount,0),a=e.length>0?e.reduce((o,s)=>o+s.avgRenderTime,0)/e.length:0,n=Array.from(lt.values());return{stats:e,slowRenders:t,totalRenders:r,avgRenderTime:a,marks:n}}function sr(){const e=en();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: ${Q(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":Q(t.avgRenderTime),"Max Time":Q(t.maxRenderTime),"Total Time":Q(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:Q(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:Q(t.duration)}))),console.groupEnd()),console.groupEnd()}const tn=new Map;function rn(){for(const[e,t]of re)tn.set(e,{...t});console.log("[Profile] Baseline saved")}function an(e=20){const t=[];for(const[r,a]of re){const n=tn.get(r);if(!n)continue;const o=(a.avgRenderTime-n.avgRenderTime)/n.avgRenderTime*100;o>e&&t.push({componentName:r,metric:"avgRenderTime",baseline:n.avgRenderTime,current:a.avgRenderTime,changePercent:o});const s=(a.maxRenderTime-n.maxRenderTime)/n.maxRenderTime*100;s>e&&t.push({componentName:r,metric:"maxRenderTime",baseline:n.maxRenderTime,current:a.maxRenderTime,changePercent:s})}return t.length>0&&B.logToConsole&&console.warn("%c[Regression] Performance regressions detected!","color: var(--nice-danger-dark, #dc2626); font-weight: bold",t),t}const kd=Object.assign(l.memo(({position:e="bottom-right",defaultCollapsed:t=!0})=>{const{t:r}=W.useNiceTranslation(),[a,n]=l.useState(t),[o,s]=l.useState([]),[i,c]=l.useState({used:0,total:0});if(l.useEffect(()=>{const u=()=>{const b=Array.from(re.values());s(b.sort((g,p)=>p.totalRenderTime-g.totalRenderTime).slice(0,10));const h=window.performance;h.memory&&c({used:h.memory.usedJSHeapSize/1024/1024,total:h.memory.totalJSHeapSize/1024/1024})};u();const f=setInterval(u,2e3);return()=>clearInterval(f)},[]),!B.enabled)return null;const d={position:"fixed",zIndex:99999,...e.includes("top")?{top:8}:{bottom:8},...e.includes("left")?{left:8}:{right:8}};return x.jsxs("div",{style:{...d,background:"var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",color:"var(--nice-color-white, #fff)",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:a?"4px 8px":8,maxWidth:a?"auto":300,maxHeight:a?"auto":400,overflow:"auto"},children:[x.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":!a,onKeyDown:A.clickOnActivationKey,style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>n(u=>!u),children:[x.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:"var(--nice-color-success, #22c55e)"}}),x.jsx("span",{children:r("profiling.profiler","Profiler")}),i.used>0&&x.jsxs("span",{style:{color:i.used>100?"var(--nice-color-warning, #f59e0b)":"var(--nice-text-muted, #64748b)"},children:[i.used.toFixed(0),"MB"]}),x.jsx("span",{style:{marginLeft:"auto",opacity:.5,display:"inline-flex"},children:x.jsx(A.NiceIcon,{name:a?"chevron-down":"chevron-up",size:12})})]}),!a&&x.jsxs("div",{style:{marginTop:8},children:[x.jsx("div",{style:{borderBottom:"1px solid var(--nice-border-color, #333)",paddingBottom:4,marginBottom:8},children:x.jsx("strong",{children:r("profiling.topComponents","Top Components")})}),o.map(u=>x.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[x.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:u.componentName}),x.jsx("span",{style:{color:u.avgRenderTime>16?"var(--nice-color-warning, #f59e0b)":"var(--nice-color-success, #22c55e)"},children:Q(u.avgRenderTime)}),x.jsxs("span",{style:{color:"var(--nice-text-muted, #64748b)",minWidth:30,textAlign:"right"},children:["x",u.renderCount]})]},u.componentName)),x.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[x.jsx("button",{onClick:sr,style:{flex:1,padding:"4px 8px",background:"var(--nice-bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:10},children:r("profiling.printReport","Print Report")}),x.jsx("button",{onClick:nr,style:{flex:1,padding:"4px 8px",background:"var(--nice-bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--nice-text-primary, #fff)",cursor:"pointer",fontSize:10},children:r("profiling.clear","Clear")})]})]})]})}),{displayName:"ProfilerOverlay"});function Cd(){qa&&(window.__NICE2DEV_PROFILER__={getStats:Ja,getComponentStats:Qa,getSlowRenders:or,printReport:sr,clear:nr,saveBaseline:rn,checkRegression:an,configure:Ya},console.log("%c[Nice2Dev Profiler] DevTools integration ready. Use __NICE2DEV_PROFILER__ in console.","color: var(--nice-info, #6366f1)"))}const ir=process.env.NODE_ENV==="development";let O={enabled:ir,logToConsole:!0,samplingRate:1,trackDetachedNodes:!1,closureSizeThreshold:1024*1024};const ft=[],Qe=new Map,bt=new Map,Hr=new WeakMap;let Ed=1;function Nd(){return Math.random()<(O.samplingRate??1)}function mt(){var e;try{throw new Error}catch(t){return((e=t.stack)==null?void 0:e.split(`
39
39
  `).slice(3).join(`
40
- `))??""}}function bt(e,t,r){return`${e.__ntd_id??Math.random()}-${t}-${r.toString().slice(0,50)}`}function le(e,t,r="warning",a,n){var s,i;if(!B.enabled||!kd()||a&&((s=B.ignoreComponents)!=null&&s.includes(a)))return;const o={id:`leak-${wd++}`,type:e,severity:r,componentName:a,message:t,stack:ft(),timestamp:Date.now(),data:n};ut.push(o),B.logToConsole&&console[r==="critical"?"error":r==="warning"?"warn":"info"](`%c[NTD Leak Detector] ${e}`,`color: ${r==="critical"?"var(--nice-color-error, #dc2626)":r==="warning"?"var(--nice-color-warning, #f59e0b)":"var(--nice-color-primary, #3b82f6)"}; font-weight: bold`,t,a?`(${a})`:"",""),(i=B.onLeak)==null||i.call(B,o)}function Cd(e){B={...B,...e}}function Ed(){return[...ut]}function Nd(){ut.length=0}function nn(){return ut.reduce((e,t)=>(e[t.type]=(e[t.type]||0)+1,e),{})}function Ad(e,t){const[r,a]=l.useState(e),n=l.useRef(!0),o=l.useRef(t);l.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]);const s=l.useCallback(i=>{n.current?a(i):B.enabled&&le("setState-after-unmount","setState called on unmounted component","warning",o.current)},[]);return[r,s]}function Md(e){const t=l.useRef(null),r=l.useRef(e),a=l.useCallback(()=>{t.current&&(clearTimeout(t.current),B.enabled&&Je.delete(t.current),t.current=null)},[]),n=l.useCallback((o,s)=>{a(),t.current=setTimeout(o,s),B.enabled&&Je.set(t.current,{id:t.current,type:"timeout",componentName:r.current,stack:ft(),createdAt:Date.now()})},[a]);return l.useEffect(()=>{const o=r.current;return()=>{t.current&&(B.enabled&&le("timer-not-cleared","Timeout would have leaked without cleanup","info",o),a())}},[a]),[n,a]}function Td(e){const t=l.useRef(null),r=l.useRef(e),a=l.useCallback(()=>{t.current&&(clearInterval(t.current),B.enabled&&Je.delete(t.current),t.current=null)},[]),n=l.useCallback((o,s)=>{a(),t.current=setInterval(o,s),B.enabled&&Je.set(t.current,{id:t.current,type:"interval",componentName:r.current,stack:ft(),createdAt:Date.now()})},[a]);return l.useEffect(()=>{const o=r.current;return()=>{t.current&&(B.enabled&&le("timer-not-cleared","Interval would have leaked without cleanup","warning",o),a())}},[a]),[n,a]}function Id(e){const t=l.useRef([]),r=l.useRef(e);return l.useEffect(()=>{const a=t.current,n=r.current;return()=>{for(const{target:o,type:s,listener:i,options:c}of a)if(o.removeEventListener(s,i,c),B.enabled){const d=bt(o,s,i);ht.delete(d)}a.length>0&&B.enabled&&le("listener-not-removed",`${a.length} event listener(s) would have leaked without cleanup`,"info",n),t.current=[]}},[]),l.useCallback((a,n,o,s)=>{if(a.addEventListener(n,o,s),t.current.push({target:a,type:n,listener:o,options:s}),B.enabled){const i=bt(a,n,o);ht.set(i,{target:a,type:n,listener:o,componentName:r.current,stack:ft(),createdAt:Date.now()})}return()=>{if(a.removeEventListener(n,o,s),t.current=t.current.filter(i=>i.target!==a||i.type!==n||i.listener!==o),B.enabled){const i=bt(a,n,o);ht.delete(i)}}},[])}function on(e){const t=l.useRef(null),r=l.useRef(e);return l.useEffect(()=>{const a=r.current;return()=>{t.current&&!t.current.signal.aborted&&(t.current.abort(),B.enabled&&le("abort-controller-not-aborted","AbortController was auto-aborted on unmount (fetch may have leaked)","info",a))}},[]),l.useCallback(()=>(t.current&&t.current.abort(),t.current=new AbortController,t.current.signal),[])}function Rd(e){const t=on(e);return l.useCallback((r,a)=>{const n=t();return fetch(r,{...a,signal:n})},[t])}function Ld(e){const t=l.useRef([]),r=l.useRef(e);return l.useEffect(()=>{const a=t.current,n=r.current;return()=>{for(const o of a)try{o()}catch(s){console.error("Error during subscription cleanup:",s)}a.length>0&&B.enabled&&le("subscription-not-unsubscribed",`${a.length} subscription(s) would have leaked without cleanup`,"info",n),t.current=[]}},[]),l.useCallback(a=>{typeof a=="function"?t.current.push(a):a&&typeof a.unsubscribe=="function"&&t.current.push(()=>a.unsubscribe())},[])}function Fd(e,t,r){const[a,n]=l.useState(null),[o,s]=l.useState(WebSocket.CLOSED),i=l.useRef(r);l.useEffect(()=>{if(!e)return;const u=new WebSocket(e,t);n(u);const f=i.current;return u.onopen=()=>s(u.readyState),u.onclose=()=>s(u.readyState),u.onerror=()=>s(u.readyState),()=>{(u.readyState===WebSocket.OPEN||u.readyState===WebSocket.CONNECTING)&&(u.close(),B.enabled&&le("websocket-not-closed","WebSocket was auto-closed on unmount","info",f))}},[e,t]);const c=l.useCallback(u=>{(a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(u)},[a]),d=l.useCallback((u,f)=>{a==null||a.close(u,f)},[a]);return{socket:a,readyState:o,send:c,close:d}}function Dd(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>{const o=l.useRef({});return l.useEffect(()=>{if(!B.enabled)return;const s=o.current;return zr.set(s,{name:r,mountedAt:Date.now()}),()=>{zr.delete(s)}},[]),x.jsx(e,{...n})};return a.displayName=`LeakTracked(${r})`,a}function Pd(e){const t=l.useRef(Date.now());l.useEffect(()=>{B.enabled&&B.logToConsole&&console.log(`%c[NTD] ${e} mounted`,"color: var(--nice-success, #22c55e)");const r=t.current;return()=>{if(B.enabled&&B.logToConsole){const a=Date.now()-r;console.log(`%c[NTD] ${e} unmounted (lifetime: ${a}ms)`,"color: var(--nice-warning, #f59e0b)")}}},[e])}async function $d(e){if(!ir)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 Hd(){ir&&(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 zd(e=5e3,t=100){const[r,a]=l.useState({usedMB:0,totalMB:0,limitMB:0,isWarning:!1});return l.useEffect(()=>{const n=window.performance;if(!n.memory)return;const o=()=>{const i=n.memory;if(!i)return;const c=i.usedJSHeapSize/1024/1024,d=i.totalJSHeapSize/1024/1024,u=i.jsHeapSizeLimit/1024/1024,f=c>t;a({usedMB:c,totalMB:d,limitMB:u,isWarning:f}),f&&B.enabled&&le("large-closure",`Memory usage exceeded ${t}MB (${c.toFixed(2)}MB)`,"warning")};o();const s=setInterval(o,e);return()=>clearInterval(s)},[e,t]),r}const _d=Object.assign(()=>{const e=l.useMemo(()=>nn(),[]),t=Object.values(e).reduce((r,a)=>r+a,0);return!B.enabled||t===0,null},{displayName:"NiceLeakDetectorStatus"});function Od(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 Bd(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 jd(e={}){const t=e.actionPrefix??"nice";return r=>a=>n=>{const o=a(n);if(n.type.startsWith(`${t}/grid/`)){const i=n.type.split("/")[2];i&&e.onGridStateChange&&e.onGridStateChange(i,n.payload)}if(n.type.startsWith(`${t}/form/`)){const i=n.type.split("/")[2];i&&e.onFormStateChange&&e.onFormStateChange(i,n.payload)}return o}}function Wd(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 Vd(e="nice"){return(t={},r)=>{if(!r.type.startsWith(`${e}/`))return t;const a=r.type.split("/"),[,n,o,s]=a;if(!n||!o)return t;const i=`${n}/${o}`;switch(s){case"setState":return{...t,[i]:{...t[i]??{},...r.payload}};case"setFilter":case"setSort":case"setValues":return{...t,[i]:{...t[i]??{},[s]:r.payload}};case"reset":return{...t,[i]:{}};default:return t}}}function Ud(e){let t=null,r=[];return{load:async()=>{if(r.length>0)return r;const o=await e.queryFn();return r=o,o},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=o=>{var s,i;try{const c=JSON.parse(o.data);c.type==="data"&&((s=c.payload)!=null&&s.data)&&(r=(e.extractData??(u=>{const f=u,b=Object.keys(f)[0];return b?f[b]:[]}))(c.payload.data),(i=e.onData)==null||i.call(e,r))}catch{}},()=>{t==null||t.close(),t=null}),unsubscribe:()=>{t==null||t.close(),t=null}}}async function Kd(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(),o=(((d=a.components)==null?void 0:d.schemas)??a.definitions??{})[t];if(!o)throw new Error(`Schema "${t}" not found in OpenAPI spec`);const s=new Set(o.required??[]),i=[],c=[];for(const[u,f]of Object.entries(o.properties??{})){const b=cr(f),h=f.title??lr(u);i.push({dataField:u,caption:h,dataType:b,allowEditing:!f.readOnly,visible:!u.toLowerCase().endsWith("id")||u==="id",...f.enum?{lookup:{dataSource:f.enum,valueExpr:"this",displayExpr:"this"}}:{}}),c.push({dataField:u,label:h,editorType:sn(f,b),isRequired:s.has(u),editorOptions:cn(f),...s.has(u)?{validationRules:[{type:"required",message:`${h} jest wymagane`}]}:{}})}return{columns:i,formFields:c,schema:o}}function Gd(e){const t=[];for(const[r,a]of Object.entries(e.properties??{}))t.push({dataField:r,caption:a.title??lr(r),dataType:cr(a),allowEditing:!a.readOnly});return t}function Xd(e){const t=new Set(e.required??[]),r=[];for(const[a,n]of Object.entries(e.properties??{})){const o=cr(n);r.push({dataField:a,label:n.title??lr(a),editorType:sn(n,o),isRequired:t.has(a),editorOptions:cn(n)})}return r}function cr(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 sn(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 cn(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 lr(e){return e.replace(/([A-Z])/g," $1").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}const ln={enabled:!0,defaultExpanded:!1,showHelpIcon:!0,position:"tooltip",locale:"en"},qd=async(e,t)=>{try{return null}catch{return null}},dn=l.createContext(null),un=({children:e,config:t,helpContent:r})=>{const[a,n]=l.useState({...ln,...t}),[o,s]=l.useState(new Set),[i,c]=l.useState(()=>new Map(Object.entries(r||{}))),d=l.useCallback(m=>{n(v=>({...v,...m}))},[]),u=l.useCallback(()=>{n(m=>({...m,enabled:!m.enabled}))},[]),f=l.useCallback(m=>{s(v=>new Set(v).add(m))},[]),b=l.useCallback(m=>{s(v=>{const y=new Set(v);return y.delete(m),y})},[]),h=l.useCallback(m=>a.enabled&&!o.has(m),[a.enabled,o]),g=l.useCallback(async m=>{if(i.has(m))return i.get(m)||null;const y=await(a.contentLoader||qd)(m,a.locale);return y&&c(S=>new Map(S).set(m,y)),y},[i,a.contentLoader,a.locale]),p=l.useMemo(()=>({config:a,setConfig:d,toggleGlobalHelp:u,disabledComponents:o,disableComponentHelp:f,enableComponentHelp:b,isHelpEnabled:h,getHelpContent:g,helpCache:i}),[a,d,u,o,f,b,h,g,i]);return x.jsx(dn.Provider,{value:p,children:e})};process.env.NODE_ENV!=="production"&&(un.displayName="NiceHelpProvider");function fn(){const e=l.useContext(dn);return e||{config:ln,setConfig:()=>{},toggleGlobalHelp:()=>{},disabledComponents:new Set,disableComponentHelp:()=>{},enableComponentHelp:()=>{},isHelpEnabled:()=>!0,getHelpContent:async()=>null,helpCache:new Map}}function mn(e){const{isHelpEnabled:t,getHelpContent:r,helpCache:a,config:n}=fn(),[o,s]=l.useState(a.get(e)||null),[i,c]=l.useState(!1),d=t(e),u=l.useCallback(async()=>{if(!d)return;c(!0);const f=await r(e);s(f),c(!1)},[d,e,r]);return{content:o,loading:i,enabled:d,loadContent:u,position:n.position,defaultExpanded:n.defaultExpanded,showHelpIcon:n.showHelpIcon}}const pn=({props:e,compact:t})=>{const{t:r}=W.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))})]})]})},Lt=({tips:e})=>{const{t}=W.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:x.jsx(A.NiceIcon,{name:"lightbulb",size:14})}),r]},a))})]})},Yd=({examples:e})=>{var n,o;const{t}=W.useNiceTranslation(),[r,a]=l.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((s,i)=>x.jsx("button",{className:`nice-help__example-tab ${r===i?"nice-help__example-tab--active":""}`,onClick:()=>a(i),children:s.title},i))}),x.jsx("pre",{className:"nice-help__code",children:x.jsx("code",{className:`language-${((n=e[r])==null?void 0:n.language)||"tsx"}`,children:(o=e[r])==null?void 0:o.code})})]})},gn=({componentName:e,content:t,children:r,position:a,defaultExpanded:n,disabled:o=!1,className:s,icon:i,title:c,showProps:d=!0,showExamples:u=!1,showTips:f=!0,compact:b=!1})=>{const{t:h}=W.useNiceTranslation(),{content:g,loading:p,enabled:m,loadContent:v,position:y,defaultExpanded:S,showHelpIcon:w}=mn(e),E=t||g,k=a||y,C=n??S,[N,M]=l.useState(C);return l.useEffect(()=>{m&&!t&&!g&&v()},[m,t,g,v]),o||!m?x.jsx(x.Fragment,{children:r}):k==="tooltip"?x.jsxs("div",{className:`nice-help-tooltip-wrapper ${s||""}`,children:[r,w&&E&&x.jsx("button",{className:"nice-help__trigger",onClick:()=>M(!N),"aria-label":h("help.toggle","Toggle help"),"aria-expanded":N,children:i||x.jsx(A.NiceIcon,{name:"help",size:16})}),N&&E&&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:c||E.name}),x.jsx("p",{className:"nice-help__description",children:E.description}),f&&E.tips&&x.jsx(Lt,{tips:E.tips}),d&&E.props&&x.jsx(pn,{props:E.props,compact:!0})]})})]}):x.jsxs("div",{className:`nice-help ${k==="bottom"?"nice-help--bottom":""} ${s||""}`,children:[k==="top"&&E&&x.jsx(_r,{content:E,expanded:N,onToggle:()=>M(!N),loading:p,title:c,showProps:d,showExamples:u,showTips:f,compact:b}),r,k==="bottom"&&E&&x.jsx(_r,{content:E,expanded:N,onToggle:()=>M(!N),loading:p,title:c,showProps:d,showExamples:u,showTips:f,compact:b}),k==="inline"&&E&&N&&x.jsxs("div",{className:"nice-help__inline",children:[x.jsx("p",{className:"nice-help__description",children:E.description}),f&&E.tips&&x.jsx(Lt,{tips:E.tips})]})]})};process.env.NODE_ENV!=="production"&&(gn.displayName="NiceInlineHelp");const _r=({content:e,expanded:t,onToggle:r,loading:a,title:n,showProps:o,showExamples:s,showTips:i,compact:c})=>{const{t:d}=W.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:x.jsx(A.NiceIcon,{name:t?"chevron-down":"chevron-right",size:14})}),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}),i&&e.tips&&x.jsx(Lt,{tips:e.tips}),o&&e.props&&x.jsx(pn,{props:e.props,compact:c}),s&&e.examples&&x.jsx(Yd,{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))})]})]})]})},yn=({text:e,position:t="top",className:r,children:a})=>{const[n,o]=l.useState(!1);return x.jsxs("span",{className:`nice-quick-help nice-quick-help--${t} ${r||""}`,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:[a,n&&x.jsx("span",{className:"nice-quick-help__popup",role:"tooltip",children:e})]})};process.env.NODE_ENV!=="production"&&(yn.displayName="NiceQuickHelp");const hn=({content:e,size:t="sm",className:r,onOpen:a})=>{const{t:n}=W.useNiceTranslation(),[o,s]=l.useState(!1),i=l.useCallback(()=>{s(!o),!o&&a&&a()},[o,a]),c=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:i,"aria-label":n("help.showHelp","Show help"),"aria-expanded":o,children:x.jsx(A.NiceIcon,{name:"help",size:16})}),o&&x.jsxs("div",{className:"nice-help-icon__popup",children:[d&&x.jsx("strong",{children:d}),x.jsx("p",{children:c}),x.jsx("button",{"aria-label":n("help.close","Close"),className:"nice-help-icon__close",onClick:()=>s(!1),children:x.jsx(A.NiceIcon,{name:"close",size:14})})]})]})};process.env.NODE_ENV!=="production"&&(hn.displayName="NiceHelpIcon");const dr=l.createContext({enabled:!0,active:!1,run:()=>{}}),Jd=({enabled:e=!0,active:t=!1,onRun:r,children:a})=>{const n=l.useMemo(()=>({enabled:e,active:t,run:r??(()=>{})}),[e,t,r]);return x.jsx(dr.Provider,{value:n,children:a})};function bn(){return l.useContext(dr)}function Qd(){return l.useContext(dr).enabled}function Zd(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 vn(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 eu=({steps:e,autoStart:t,label:r,size:a="md",className:n,style:o,"data-testid":s})=>{tu();const{enabled:i,run:c}=bn(),{t:d}=W.useNiceTranslation();if(!i||!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:o,"data-testid":s,"aria-label":u,title:u,onClick:()=>c(vn(e,d),{autoStart:t}),children:"?"})},Or="nice-tutorial-button-styles";function tu(){if(typeof document>"u"||document.getElementById(Or))return;const e=document.createElement("style");e.id=Or,e.textContent=`
40
+ `))??""}}function vt(e,t,r){return`${e.__ntd_id??Math.random()}-${t}-${r.toString().slice(0,50)}`}function le(e,t,r="warning",a,n){var s,i;if(!O.enabled||!Nd()||a&&((s=O.ignoreComponents)!=null&&s.includes(a)))return;const o={id:`leak-${Ed++}`,type:e,severity:r,componentName:a,message:t,stack:mt(),timestamp:Date.now(),data:n};ft.push(o),O.logToConsole&&console[r==="critical"?"error":r==="warning"?"warn":"info"](`%c[NTD Leak Detector] ${e}`,`color: ${r==="critical"?"var(--nice-color-error, #dc2626)":r==="warning"?"var(--nice-color-warning, #f59e0b)":"var(--nice-color-primary, #3b82f6)"}; font-weight: bold`,t,a?`(${a})`:"",""),(i=O.onLeak)==null||i.call(O,o)}function Ad(e){O={...O,...e}}function Md(){return[...ft]}function Td(){ft.length=0}function nn(){return ft.reduce((e,t)=>(e[t.type]=(e[t.type]||0)+1,e),{})}function Id(e,t){const[r,a]=l.useState(e),n=l.useRef(!0),o=l.useRef(t);l.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]);const s=l.useCallback(i=>{n.current?a(i):O.enabled&&le("setState-after-unmount","setState called on unmounted component","warning",o.current)},[]);return[r,s]}function Rd(e){const t=l.useRef(null),r=l.useRef(e),a=l.useCallback(()=>{t.current&&(clearTimeout(t.current),O.enabled&&Qe.delete(t.current),t.current=null)},[]),n=l.useCallback((o,s)=>{a(),t.current=setTimeout(o,s),O.enabled&&Qe.set(t.current,{id:t.current,type:"timeout",componentName:r.current,stack:mt(),createdAt:Date.now()})},[a]);return l.useEffect(()=>{const o=r.current;return()=>{t.current&&(O.enabled&&le("timer-not-cleared","Timeout would have leaked without cleanup","info",o),a())}},[a]),[n,a]}function Ld(e){const t=l.useRef(null),r=l.useRef(e),a=l.useCallback(()=>{t.current&&(clearInterval(t.current),O.enabled&&Qe.delete(t.current),t.current=null)},[]),n=l.useCallback((o,s)=>{a(),t.current=setInterval(o,s),O.enabled&&Qe.set(t.current,{id:t.current,type:"interval",componentName:r.current,stack:mt(),createdAt:Date.now()})},[a]);return l.useEffect(()=>{const o=r.current;return()=>{t.current&&(O.enabled&&le("timer-not-cleared","Interval would have leaked without cleanup","warning",o),a())}},[a]),[n,a]}function Fd(e){const t=l.useRef([]),r=l.useRef(e);return l.useEffect(()=>{const a=t.current,n=r.current;return()=>{for(const{target:o,type:s,listener:i,options:c}of a)if(o.removeEventListener(s,i,c),O.enabled){const d=vt(o,s,i);bt.delete(d)}a.length>0&&O.enabled&&le("listener-not-removed",`${a.length} event listener(s) would have leaked without cleanup`,"info",n),t.current=[]}},[]),l.useCallback((a,n,o,s)=>{if(a.addEventListener(n,o,s),t.current.push({target:a,type:n,listener:o,options:s}),O.enabled){const i=vt(a,n,o);bt.set(i,{target:a,type:n,listener:o,componentName:r.current,stack:mt(),createdAt:Date.now()})}return()=>{if(a.removeEventListener(n,o,s),t.current=t.current.filter(i=>i.target!==a||i.type!==n||i.listener!==o),O.enabled){const i=vt(a,n,o);bt.delete(i)}}},[])}function on(e){const t=l.useRef(null),r=l.useRef(e);return l.useEffect(()=>{const a=r.current;return()=>{t.current&&!t.current.signal.aborted&&(t.current.abort(),O.enabled&&le("abort-controller-not-aborted","AbortController was auto-aborted on unmount (fetch may have leaked)","info",a))}},[]),l.useCallback(()=>(t.current&&t.current.abort(),t.current=new AbortController,t.current.signal),[])}function Dd(e){const t=on(e);return l.useCallback((r,a)=>{const n=t();return fetch(r,{...a,signal:n})},[t])}function Pd(e){const t=l.useRef([]),r=l.useRef(e);return l.useEffect(()=>{const a=t.current,n=r.current;return()=>{for(const o of a)try{o()}catch(s){console.error("Error during subscription cleanup:",s)}a.length>0&&O.enabled&&le("subscription-not-unsubscribed",`${a.length} subscription(s) would have leaked without cleanup`,"info",n),t.current=[]}},[]),l.useCallback(a=>{typeof a=="function"?t.current.push(a):a&&typeof a.unsubscribe=="function"&&t.current.push(()=>a.unsubscribe())},[])}function $d(e,t,r){const[a,n]=l.useState(null),[o,s]=l.useState(WebSocket.CLOSED),i=l.useRef(r);l.useEffect(()=>{if(!e)return;const u=new WebSocket(e,t);n(u);const f=i.current;return u.onopen=()=>s(u.readyState),u.onclose=()=>s(u.readyState),u.onerror=()=>s(u.readyState),()=>{(u.readyState===WebSocket.OPEN||u.readyState===WebSocket.CONNECTING)&&(u.close(),O.enabled&&le("websocket-not-closed","WebSocket was auto-closed on unmount","info",f))}},[e,t]);const c=l.useCallback(u=>{(a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(u)},[a]),d=l.useCallback((u,f)=>{a==null||a.close(u,f)},[a]);return{socket:a,readyState:o,send:c,close:d}}function zd(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>{const o=l.useRef({});return l.useEffect(()=>{if(!O.enabled)return;const s=o.current;return Hr.set(s,{name:r,mountedAt:Date.now()}),()=>{Hr.delete(s)}},[]),x.jsx(e,{...n})};return a.displayName=`LeakTracked(${r})`,a}function Hd(e){const t=l.useRef(Date.now());l.useEffect(()=>{O.enabled&&O.logToConsole&&console.log(`%c[NTD] ${e} mounted`,"color: var(--nice-success, #22c55e)");const r=t.current;return()=>{if(O.enabled&&O.logToConsole){const a=Date.now()-r;console.log(`%c[NTD] ${e} unmounted (lifetime: ${a}ms)`,"color: var(--nice-warning, #f59e0b)")}}},[e])}async function _d(e){if(!ir)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 Bd(){ir&&(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 Od(e=5e3,t=100){const[r,a]=l.useState({usedMB:0,totalMB:0,limitMB:0,isWarning:!1});return l.useEffect(()=>{const n=window.performance;if(!n.memory)return;const o=()=>{const i=n.memory;if(!i)return;const c=i.usedJSHeapSize/1024/1024,d=i.totalJSHeapSize/1024/1024,u=i.jsHeapSizeLimit/1024/1024,f=c>t;a({usedMB:c,totalMB:d,limitMB:u,isWarning:f}),f&&O.enabled&&le("large-closure",`Memory usage exceeded ${t}MB (${c.toFixed(2)}MB)`,"warning")};o();const s=setInterval(o,e);return()=>clearInterval(s)},[e,t]),r}const jd=Object.assign(()=>{const e=l.useMemo(()=>nn(),[]),t=Object.values(e).reduce((r,a)=>r+a,0);return!O.enabled||t===0,null},{displayName:"NiceLeakDetectorStatus"});function Wd(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 Vd(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 Ud(e={}){const t=e.actionPrefix??"nice";return r=>a=>n=>{const o=a(n);if(n.type.startsWith(`${t}/grid/`)){const i=n.type.split("/")[2];i&&e.onGridStateChange&&e.onGridStateChange(i,n.payload)}if(n.type.startsWith(`${t}/form/`)){const i=n.type.split("/")[2];i&&e.onFormStateChange&&e.onFormStateChange(i,n.payload)}return o}}function Kd(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 Gd(e="nice"){return(t={},r)=>{if(!r.type.startsWith(`${e}/`))return t;const a=r.type.split("/"),[,n,o,s]=a;if(!n||!o)return t;const i=`${n}/${o}`;switch(s){case"setState":return{...t,[i]:{...t[i]??{},...r.payload}};case"setFilter":case"setSort":case"setValues":return{...t,[i]:{...t[i]??{},[s]:r.payload}};case"reset":return{...t,[i]:{}};default:return t}}}function Xd(e){let t=null,r=[];return{load:async()=>{if(r.length>0)return r;const o=await e.queryFn();return r=o,o},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=o=>{var s,i;try{const c=JSON.parse(o.data);c.type==="data"&&((s=c.payload)!=null&&s.data)&&(r=(e.extractData??(u=>{const f=u,b=Object.keys(f)[0];return b?f[b]:[]}))(c.payload.data),(i=e.onData)==null||i.call(e,r))}catch{}},()=>{t==null||t.close(),t=null}),unsubscribe:()=>{t==null||t.close(),t=null}}}async function qd(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(),o=(((d=a.components)==null?void 0:d.schemas)??a.definitions??{})[t];if(!o)throw new Error(`Schema "${t}" not found in OpenAPI spec`);const s=new Set(o.required??[]),i=[],c=[];for(const[u,f]of Object.entries(o.properties??{})){const b=cr(f),h=f.title??lr(u);i.push({dataField:u,caption:h,dataType:b,allowEditing:!f.readOnly,visible:!u.toLowerCase().endsWith("id")||u==="id",...f.enum?{lookup:{dataSource:f.enum,valueExpr:"this",displayExpr:"this"}}:{}}),c.push({dataField:u,label:h,editorType:sn(f,b),isRequired:s.has(u),editorOptions:cn(f),...s.has(u)?{validationRules:[{type:"required",message:`${h} jest wymagane`}]}:{}})}return{columns:i,formFields:c,schema:o}}function Yd(e){const t=[];for(const[r,a]of Object.entries(e.properties??{}))t.push({dataField:r,caption:a.title??lr(r),dataType:cr(a),allowEditing:!a.readOnly});return t}function Jd(e){const t=new Set(e.required??[]),r=[];for(const[a,n]of Object.entries(e.properties??{})){const o=cr(n);r.push({dataField:a,label:n.title??lr(a),editorType:sn(n,o),isRequired:t.has(a),editorOptions:cn(n)})}return r}function cr(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 sn(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 cn(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 lr(e){return e.replace(/([A-Z])/g," $1").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}const ln={enabled:!0,defaultExpanded:!1,showHelpIcon:!0,position:"tooltip",locale:"en"},Qd=async(e,t)=>{try{return null}catch{return null}},dn=l.createContext(null),un=({children:e,config:t,helpContent:r})=>{const[a,n]=l.useState({...ln,...t}),[o,s]=l.useState(new Set),[i,c]=l.useState(()=>new Map(Object.entries(r||{}))),d=l.useCallback(m=>{n(v=>({...v,...m}))},[]),u=l.useCallback(()=>{n(m=>({...m,enabled:!m.enabled}))},[]),f=l.useCallback(m=>{s(v=>new Set(v).add(m))},[]),b=l.useCallback(m=>{s(v=>{const y=new Set(v);return y.delete(m),y})},[]),h=l.useCallback(m=>a.enabled&&!o.has(m),[a.enabled,o]),g=l.useCallback(async m=>{if(i.has(m))return i.get(m)||null;const y=await(a.contentLoader||Qd)(m,a.locale);return y&&c(S=>new Map(S).set(m,y)),y},[i,a.contentLoader,a.locale]),p=l.useMemo(()=>({config:a,setConfig:d,toggleGlobalHelp:u,disabledComponents:o,disableComponentHelp:f,enableComponentHelp:b,isHelpEnabled:h,getHelpContent:g,helpCache:i}),[a,d,u,o,f,b,h,g,i]);return x.jsx(dn.Provider,{value:p,children:e})};process.env.NODE_ENV!=="production"&&(un.displayName="NiceHelpProvider");function fn(){const e=l.useContext(dn);return e||{config:ln,setConfig:()=>{},toggleGlobalHelp:()=>{},disabledComponents:new Set,disableComponentHelp:()=>{},enableComponentHelp:()=>{},isHelpEnabled:()=>!0,getHelpContent:async()=>null,helpCache:new Map}}function mn(e){const{isHelpEnabled:t,getHelpContent:r,helpCache:a,config:n}=fn(),[o,s]=l.useState(a.get(e)||null),[i,c]=l.useState(!1),d=t(e),u=l.useCallback(async()=>{if(!d)return;c(!0);const f=await r(e);s(f),c(!1)},[d,e,r]);return{content:o,loading:i,enabled:d,loadContent:u,position:n.position,defaultExpanded:n.defaultExpanded,showHelpIcon:n.showHelpIcon}}const pn=({props:e,compact:t})=>{const{t:r}=W.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))})]})]})},Ft=({tips:e})=>{const{t}=W.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:x.jsx(A.NiceIcon,{name:"lightbulb",size:14})}),r]},a))})]})},Zd=({examples:e})=>{var n,o;const{t}=W.useNiceTranslation(),[r,a]=l.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((s,i)=>x.jsx("button",{className:`nice-help__example-tab ${r===i?"nice-help__example-tab--active":""}`,onClick:()=>a(i),children:s.title},i))}),x.jsx("pre",{className:"nice-help__code",children:x.jsx("code",{className:`language-${((n=e[r])==null?void 0:n.language)||"tsx"}`,children:(o=e[r])==null?void 0:o.code})})]})},gn=({componentName:e,content:t,children:r,position:a,defaultExpanded:n,disabled:o=!1,className:s,icon:i,title:c,showProps:d=!0,showExamples:u=!1,showTips:f=!0,compact:b=!1})=>{const{t:h}=W.useNiceTranslation(),{content:g,loading:p,enabled:m,loadContent:v,position:y,defaultExpanded:S,showHelpIcon:w}=mn(e),E=t||g,k=a||y,C=n??S,[N,M]=l.useState(C);return l.useEffect(()=>{m&&!t&&!g&&v()},[m,t,g,v]),o||!m?x.jsx(x.Fragment,{children:r}):k==="tooltip"?x.jsxs("div",{className:`nice-help-tooltip-wrapper ${s||""}`,children:[r,w&&E&&x.jsx("button",{className:"nice-help__trigger",onClick:()=>M(!N),"aria-label":h("help.toggle","Toggle help"),"aria-expanded":N,children:i||x.jsx(A.NiceIcon,{name:"help",size:16})}),N&&E&&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:c||E.name}),x.jsx("p",{className:"nice-help__description",children:E.description}),f&&E.tips&&x.jsx(Ft,{tips:E.tips}),d&&E.props&&x.jsx(pn,{props:E.props,compact:!0})]})})]}):x.jsxs("div",{className:`nice-help ${k==="bottom"?"nice-help--bottom":""} ${s||""}`,children:[k==="top"&&E&&x.jsx(_r,{content:E,expanded:N,onToggle:()=>M(!N),loading:p,title:c,showProps:d,showExamples:u,showTips:f,compact:b}),r,k==="bottom"&&E&&x.jsx(_r,{content:E,expanded:N,onToggle:()=>M(!N),loading:p,title:c,showProps:d,showExamples:u,showTips:f,compact:b}),k==="inline"&&E&&N&&x.jsxs("div",{className:"nice-help__inline",children:[x.jsx("p",{className:"nice-help__description",children:E.description}),f&&E.tips&&x.jsx(Ft,{tips:E.tips})]})]})};process.env.NODE_ENV!=="production"&&(gn.displayName="NiceInlineHelp");const _r=({content:e,expanded:t,onToggle:r,loading:a,title:n,showProps:o,showExamples:s,showTips:i,compact:c})=>{const{t:d}=W.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:x.jsx(A.NiceIcon,{name:t?"chevron-down":"chevron-right",size:14})}),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}),i&&e.tips&&x.jsx(Ft,{tips:e.tips}),o&&e.props&&x.jsx(pn,{props:e.props,compact:c}),s&&e.examples&&x.jsx(Zd,{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))})]})]})]})},yn=({text:e,position:t="top",className:r,children:a})=>{const[n,o]=l.useState(!1);return x.jsxs("span",{className:`nice-quick-help nice-quick-help--${t} ${r||""}`,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:[a,n&&x.jsx("span",{className:"nice-quick-help__popup",role:"tooltip",children:e})]})};process.env.NODE_ENV!=="production"&&(yn.displayName="NiceQuickHelp");const hn=({content:e,size:t="sm",className:r,onOpen:a})=>{const{t:n}=W.useNiceTranslation(),[o,s]=l.useState(!1),i=l.useCallback(()=>{s(!o),!o&&a&&a()},[o,a]),c=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:i,"aria-label":n("help.showHelp","Show help"),"aria-expanded":o,children:x.jsx(A.NiceIcon,{name:"help",size:16})}),o&&x.jsxs("div",{className:"nice-help-icon__popup",children:[d&&x.jsx("strong",{children:d}),x.jsx("p",{children:c}),x.jsx("button",{"aria-label":n("help.close","Close"),className:"nice-help-icon__close",onClick:()=>s(!1),children:x.jsx(A.NiceIcon,{name:"close",size:14})})]})]})};process.env.NODE_ENV!=="production"&&(hn.displayName="NiceHelpIcon");const dr=l.createContext({enabled:!0,active:!1,run:()=>{}}),eu=({enabled:e=!0,active:t=!1,onRun:r,children:a})=>{const n=l.useMemo(()=>({enabled:e,active:t,run:r??(()=>{})}),[e,t,r]);return x.jsx(dr.Provider,{value:n,children:a})};function bn(){return l.useContext(dr)}function tu(){return l.useContext(dr).enabled}function ru(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 vn(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 au=({steps:e,autoStart:t,label:r,size:a="md",className:n,style:o,"data-testid":s})=>{nu();const{enabled:i,run:c}=bn(),{t:d}=W.useNiceTranslation();if(!i||!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:o,"data-testid":s,"aria-label":u,title:u,onClick:()=>c(vn(e,d),{autoStart:t}),children:"?"})},Br="nice-tutorial-button-styles";function nu(){if(typeof document>"u"||document.getElementById(Br))return;const e=document.createElement("style");e.id=Br,e.textContent=`
41
41
  .nice-tutorial-button {
42
42
  display: inline-flex;
43
43
  align-items: center;
@@ -63,8 +63,8 @@
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)}const ru={cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",source:"default",requiresConsentBanner:!1,resolvedAt:Date.now(),version:"1.0.0"},Sn={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}},xe=["traceless","ephemeral","private","balanced","full","custom"];function au(e,t){const r=xe.indexOf(e),a=xe.indexOf(t);return r<=a?e:t}function Ue(e,t){const r=xe.indexOf(e),a=xe.indexOf(t);return r<=a}function nu(e,t,r,a){let n=e.defaultMode,o="instance";t&&e.allowTenantOverride&&Ue(t.mode,n)&&(n=t.mode,o="tenant"),r&&(t!=null&&t.allowGroupOverride)&&Ue(r.mode,n)&&(n=r.mode,o="group"),a&&(t!=null&&t.allowUserOverride||r!=null&&r.allowUserLockdown)&&Ue(a.preferredMode,n)&&(n=a.preferredMode,o="user");const s=Sn[n],i={...s,cookiesAllowed:s.cookiesAllowed&&e.maxCookies,localStorageAllowed:s.localStorageAllowed&&e.maxLocalStorage,sessionStorageAllowed:s.sessionStorageAllowed&&e.maxSessionStorage,source:o,resolvedAt:Date.now(),version:"1.0.0"};return a&&(a.restrictCookies&&(i.cookiesAllowed=!1),a.restrictLocalStorage&&(i.localStorageAllowed=!1),a.restrictSessionStorage&&(i.sessionStorageAllowed=!1)),i.effectiveMode=ur(i),i.requiresConsentBanner=xn(i),i}function ur(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 xn(e){return!e.cookiesAllowed&&!e.localStorageAllowed?!1:e.effectiveMode==="full"||e.effectiveMode==="balanced"}const wn=new Map;class kn{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 wn}getKey(t){return`${this.namespace}:${t}`}get(t,r){const a=this.getBackend(r),n=this.getKey(t);try{const o=a instanceof Map?a.get(n):a.getItem(n);if(o==null)return null;try{return JSON.parse(o)}catch{return o}}catch{return null}}set(t,r,a){const n=this.getBackend(a),o=this.getKey(t);try{const s=typeof r=="string"?r:JSON.stringify(r);return n instanceof Map?n.set(o,s):n.setItem(o,s),!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 o=0;o<r.length;o++){const s=r.key(o);s&&s.startsWith(a)&&n.push(s)}n.forEach(o=>r.removeItem(o))}}catch{}}keys(t){const r=this.getBackend(t),a=`${this.namespace}:`,n=[];try{if(r instanceof Map)for(const o of r.keys())o.startsWith(a)&&n.push(o.slice(a.length));else for(let o=0;o<r.length;o++){const s=r.key(o);s&&s.startsWith(a)&&n.push(s.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 ou(e,t){const{cookies:r,localStorage:a,storageMode:n}=t,o={...e};if(n&&n!=="auto")switch(n){case"traceless":o.cookiesAllowed=!1,o.localStorageAllowed=!1,o.sessionStorageAllowed=!1;break;case"ephemeral":o.cookiesAllowed=!1,o.localStorageAllowed=!1;break}return r===!1&&(o.cookiesAllowed=!1),a===!1&&(o.localStorageAllowed=!1),o.effectiveMode=ur(o),o.source="control",o}function su(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:iu(e)}}function iu(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 cu(e){const{effectiveMode:t}=e;switch(t){case"traceless":return{mode:"traceless",icon:"eye-off",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:"clock",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:"lock",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:"scale",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:"database",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:"settings",color:"var(--nice-text-secondary, #6b7280)",label:"Custom",tooltip:"Custom storage configuration.",cssClass:"nice-traceless-badge--custom"}}}function lu(e,t){const r=e.localStorageAllowed,a=e.sessionStorageAllowed,o={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:o.message,warningKey:o.key}:!r&&a?{canPersist:!1,canSession:!0,warningMessage:t!=="auth"?o.message:void 0,warningKey:t!=="auth"?o.key:void 0}:{canPersist:!0,canSession:!0}}const du="X-OmniVerk-Storage-Policy";function uu(e){const t=e.toLowerCase().trim();return xe.includes(t)?t:null}function fu(e){return e.effectiveMode}function mu(e,t){return new kn(e,t)}function pu(e){return{maxCookies:!1,maxLocalStorage:!1,maxSessionStorage:!0,defaultMode:"ephemeral",allowTenantOverride:!1,instanceId:e}}function gu(e){return{maxCookies:!0,maxLocalStorage:!0,maxSessionStorage:!0,defaultMode:"balanced",allowTenantOverride:!0,instanceId:e}}function yu(){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{}wn.clear()}function hu(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 Cn=l.createContext(null),bu=({config:e,children:t})=>{const[r,a]=l.useState(!1),[n,o]=l.useState(null),s=l.useRef(null);l.useEffect(()=>()=>{var g;(g=s.current)==null||g.abort()},[]);const i=l.useCallback(()=>{var g;(g=s.current)==null||g.abort(),s.current=null,a(!1)},[]),c=async(g,p,m)=>{var S,w,E,k,C,N;const v=new TextDecoder;let y="";for(;;){const{done:M,value:T}=await g.read();if(M)break;y+=v.decode(T,{stream:!0});const P=y.split(`
67
- `);y=P.pop()||"";for(const $ of P)if($.startsWith("data: ")){const H=$.slice(6).trim();if(H==="[DONE]"){p({content:"",done:!0});return}try{const _=JSON.parse(H);let R="",L=!1;m==="openai"||m==="azure-openai"?(R=((E=(w=(S=_.choices)==null?void 0:S[0])==null?void 0:w.delta)==null?void 0:E.content)||"",L=((C=(k=_.choices)==null?void 0:k[0])==null?void 0:C.finish_reason)==="stop"):m==="anthropic"&&(_.type==="content_block_delta"?R=((N=_.delta)==null?void 0:N.text)||"":_.type==="message_stop"&&(L=!0)),(R||L)&&p({content:R,done:L})}catch{}}}p({content:"",done:!0})},d=l.useCallback((g,p)=>{var m;return{model:p.model||e.defaultModel||"gpt-4",messages:p.systemPrompt?[{role:"system",content:p.systemPrompt},...g]:g,temperature:p.temperature??.7,max_tokens:p.maxTokens,stop:p.stop,stream:p.stream??!1,tools:(m=p.tools)==null?void 0:m.map(v=>({type:"function",function:{name:v.name,description:v.description,parameters:v.parameters}}))}},[e.defaultModel]),u=l.useCallback((g,p)=>{var y;const m=p.systemPrompt||((y=g.find(S=>S.role==="system"))==null?void 0:y.content),v=g.filter(S=>S.role!=="system");return{model:p.model||e.defaultModel||"claude-3-opus-20240229",max_tokens:p.maxTokens||4096,system:m,messages:v.map(S=>({role:S.role==="assistant"?"assistant":"user",content:S.content})),temperature:p.temperature??.7,stop_sequences:p.stop,stream:p.stream??!1}},[e.defaultModel]),f=l.useCallback(async(g,p={})=>{var m,v,y,S,w,E;if(e.provider==="custom"&&e.customHandler)return e.customHandler(g,p);a(!0),o(null),s.current=new AbortController;try{let k,C,N;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},N=d(g,{...p,stream:!1});else if(e.provider==="azure-openai")k=e.endpoint||"",C={"Content-Type":"application/json","api-key":e.apiKey||"",...e.headers},N=d(g,{...p,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},N=u(g,{...p,stream:!1});else throw new Error(`Unsupported provider: ${e.provider}`);const M=await fetch(k,{method:"POST",headers:C,body:JSON.stringify(N),signal:s.current.signal});if(!M.ok){const $=await M.text();throw new Error(`AI request failed: ${M.status} ${$}`)}const T=await M.json();let P;if(e.provider==="openai"||e.provider==="azure-openai"){const $=(m=T.choices)==null?void 0:m[0];P={content:((v=$==null?void 0:$.message)==null?void 0:v.content)||"",finishReason:($==null?void 0:$.finish_reason)||"stop",toolCalls:(S=(y=$==null?void 0:$.message)==null?void 0:y.tool_calls)==null?void 0:S.map(H=>({id:H.id,name:H.function.name,arguments:JSON.parse(H.function.arguments)})),usage:T.usage&&{promptTokens:T.usage.prompt_tokens,completionTokens:T.usage.completion_tokens,totalTokens:T.usage.total_tokens}}}else e.provider==="anthropic"?P={content:((E=(w=T.content)==null?void 0:w[0])==null?void 0:E.text)||"",finishReason:T.stop_reason||"stop",usage:T.usage&&{promptTokens:T.usage.input_tokens,completionTokens:T.usage.output_tokens,totalTokens:T.usage.input_tokens+T.usage.output_tokens}}:P={content:"",finishReason:"stop"};return P}catch(k){throw k.name==="AbortError"?new Error("Request cancelled"):(o(k),k)}finally{a(!1)}},[e,d,u]),b=l.useCallback(async(g,p,m={})=>{if(e.provider==="custom"&&e.customStreamHandler)return e.customStreamHandler(g,m,p);a(!0),o(null),s.current=new AbortController;try{let v,y,S;if(e.provider==="openai")v=e.endpoint||"https://api.openai.com/v1/chat/completions",y={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`,...e.organizationId&&{"OpenAI-Organization":e.organizationId},...e.headers},S=d(g,{...m,stream:!0});else if(e.provider==="azure-openai")v=e.endpoint||"",y={"Content-Type":"application/json","api-key":e.apiKey||"",...e.headers},S=d(g,{...m,stream:!0});else if(e.provider==="anthropic")v=e.endpoint||"https://api.anthropic.com/v1/messages",y={"Content-Type":"application/json","x-api-key":e.apiKey||"","anthropic-version":"2023-06-01",...e.headers},S=u(g,{...m,stream:!0});else throw new Error(`Unsupported provider: ${e.provider}`);const w=await fetch(v,{method:"POST",headers:y,body:JSON.stringify(S),signal:s.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 E=w.body.getReader();await c(E,p,e.provider)}catch(v){if(v.name==="AbortError"){p({content:"",done:!0});return}throw o(v),v}finally{a(!1)}},[e,d,u]),h={isConfigured:!!e.apiKey||e.provider==="custom"||e.provider==="local",provider:e.provider,defaultModel:e.defaultModel||null,complete:f,stream:b,cancel:i,isLoading:r,error:n};return x.jsx(Cn.Provider,{value:h,children:t})};function ye(){const e=l.useContext(Cn);if(!e)throw new Error("useNiceAI must be used within a NiceAIProvider");return e}function vu(e={}){const t=ye(),[r,a]=l.useState(""),[n,o]=l.useState([]),[s,i]=l.useState(!1),[c,d]=l.useState(null),u=l.useCallback(async p=>{i(!0),d(null),a("");const m=[...n,{role:"user",content:p}];try{const v=await t.complete(m,{systemPrompt:e.systemPrompt,model:e.model,temperature:e.temperature});return o([...m,{role:"assistant",content:v.content}]),a(v.content),v.content}catch(v){throw d(v),v}finally{i(!1)}},[t,n,e]),f=l.useCallback(async(p,m)=>{i(!0),d(null),a("");const v=[...n,{role:"user",content:p}];try{let y="";return await t.stream(v,S=>{S.done||(y+=S.content,a(y),m==null||m(S.content))},{systemPrompt:e.systemPrompt,model:e.model,temperature:e.temperature}),o([...v,{role:"assistant",content:y}]),y}catch(y){throw d(y),y}finally{i(!1)}},[t,n,e]),b=l.useCallback(()=>{a(""),d(null)},[]),h=l.useCallback(()=>{o([]),a(""),d(null)},[]),g=l.useCallback(()=>{t.cancel(),i(!1)},[t]);return{response:r,isLoading:s,error:c,send:u,sendStreaming:f,clear:b,cancel:g,history:n,clearHistory:h}}function Su(e={}){const t=ye(),[r,a]=l.useState(""),[n,o]=l.useState(!1),s=l.useCallback(async(u,f="")=>{o(!0),a("");try{const h=(await t.complete([{role:"user",content:`Complete the following ${e.language||""} code. Return ONLY the completion text, no explanation.
66
+ `,document.head.appendChild(e)}const ou={cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",source:"default",requiresConsentBanner:!1,resolvedAt:Date.now(),version:"1.0.0"},Sn={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}},xe=["traceless","ephemeral","private","balanced","full","custom"];function su(e,t){const r=xe.indexOf(e),a=xe.indexOf(t);return r<=a?e:t}function Ke(e,t){const r=xe.indexOf(e),a=xe.indexOf(t);return r<=a}function iu(e,t,r,a){let n=e.defaultMode,o="instance";t&&e.allowTenantOverride&&Ke(t.mode,n)&&(n=t.mode,o="tenant"),r&&(t!=null&&t.allowGroupOverride)&&Ke(r.mode,n)&&(n=r.mode,o="group"),a&&(t!=null&&t.allowUserOverride||r!=null&&r.allowUserLockdown)&&Ke(a.preferredMode,n)&&(n=a.preferredMode,o="user");const s=Sn[n],i={...s,cookiesAllowed:s.cookiesAllowed&&e.maxCookies,localStorageAllowed:s.localStorageAllowed&&e.maxLocalStorage,sessionStorageAllowed:s.sessionStorageAllowed&&e.maxSessionStorage,source:o,resolvedAt:Date.now(),version:"1.0.0"};return a&&(a.restrictCookies&&(i.cookiesAllowed=!1),a.restrictLocalStorage&&(i.localStorageAllowed=!1),a.restrictSessionStorage&&(i.sessionStorageAllowed=!1)),i.effectiveMode=ur(i),i.requiresConsentBanner=xn(i),i}function ur(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 xn(e){return!e.cookiesAllowed&&!e.localStorageAllowed?!1:e.effectiveMode==="full"||e.effectiveMode==="balanced"}const wn=new Map;class kn{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 wn}getKey(t){return`${this.namespace}:${t}`}get(t,r){const a=this.getBackend(r),n=this.getKey(t);try{const o=a instanceof Map?a.get(n):a.getItem(n);if(o==null)return null;try{return JSON.parse(o)}catch{return o}}catch{return null}}set(t,r,a){const n=this.getBackend(a),o=this.getKey(t);try{const s=typeof r=="string"?r:JSON.stringify(r);return n instanceof Map?n.set(o,s):n.setItem(o,s),!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 o=0;o<r.length;o++){const s=r.key(o);s&&s.startsWith(a)&&n.push(s)}n.forEach(o=>r.removeItem(o))}}catch{}}keys(t){const r=this.getBackend(t),a=`${this.namespace}:`,n=[];try{if(r instanceof Map)for(const o of r.keys())o.startsWith(a)&&n.push(o.slice(a.length));else for(let o=0;o<r.length;o++){const s=r.key(o);s&&s.startsWith(a)&&n.push(s.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 cu(e,t){const{cookies:r,localStorage:a,storageMode:n}=t,o={...e};if(n&&n!=="auto")switch(n){case"traceless":o.cookiesAllowed=!1,o.localStorageAllowed=!1,o.sessionStorageAllowed=!1;break;case"ephemeral":o.cookiesAllowed=!1,o.localStorageAllowed=!1;break}return r===!1&&(o.cookiesAllowed=!1),a===!1&&(o.localStorageAllowed=!1),o.effectiveMode=ur(o),o.source="control",o}function lu(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:du(e)}}function du(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 uu(e){const{effectiveMode:t}=e;switch(t){case"traceless":return{mode:"traceless",icon:"eye-off",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:"clock",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:"lock",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:"scale",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:"database",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:"settings",color:"var(--nice-text-secondary, #6b7280)",label:"Custom",tooltip:"Custom storage configuration.",cssClass:"nice-traceless-badge--custom"}}}function fu(e,t){const r=e.localStorageAllowed,a=e.sessionStorageAllowed,o={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:o.message,warningKey:o.key}:!r&&a?{canPersist:!1,canSession:!0,warningMessage:t!=="auth"?o.message:void 0,warningKey:t!=="auth"?o.key:void 0}:{canPersist:!0,canSession:!0}}const mu="X-OmniVerk-Storage-Policy";function pu(e){const t=e.toLowerCase().trim();return xe.includes(t)?t:null}function gu(e){return e.effectiveMode}function yu(e,t){return new kn(e,t)}function hu(e){return{maxCookies:!1,maxLocalStorage:!1,maxSessionStorage:!0,defaultMode:"ephemeral",allowTenantOverride:!1,instanceId:e}}function bu(e){return{maxCookies:!0,maxLocalStorage:!0,maxSessionStorage:!0,defaultMode:"balanced",allowTenantOverride:!0,instanceId:e}}function vu(){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{}wn.clear()}function Su(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 Cn=l.createContext(null),xu=({config:e,children:t})=>{const[r,a]=l.useState(!1),[n,o]=l.useState(null),s=l.useRef(null);l.useEffect(()=>()=>{var g;(g=s.current)==null||g.abort()},[]);const i=l.useCallback(()=>{var g;(g=s.current)==null||g.abort(),s.current=null,a(!1)},[]),c=async(g,p,m)=>{var S,w,E,k,C,N;const v=new TextDecoder;let y="";for(;;){const{done:M,value:T}=await g.read();if(M)break;y+=v.decode(T,{stream:!0});const P=y.split(`
67
+ `);y=P.pop()||"";for(const $ of P)if($.startsWith("data: ")){const z=$.slice(6).trim();if(z==="[DONE]"){p({content:"",done:!0});return}try{const _=JSON.parse(z);let R="",L=!1;m==="openai"||m==="azure-openai"?(R=((E=(w=(S=_.choices)==null?void 0:S[0])==null?void 0:w.delta)==null?void 0:E.content)||"",L=((C=(k=_.choices)==null?void 0:k[0])==null?void 0:C.finish_reason)==="stop"):m==="anthropic"&&(_.type==="content_block_delta"?R=((N=_.delta)==null?void 0:N.text)||"":_.type==="message_stop"&&(L=!0)),(R||L)&&p({content:R,done:L})}catch{}}}p({content:"",done:!0})},d=l.useCallback((g,p)=>{var m;return{model:p.model||e.defaultModel||"gpt-4",messages:p.systemPrompt?[{role:"system",content:p.systemPrompt},...g]:g,temperature:p.temperature??.7,max_tokens:p.maxTokens,stop:p.stop,stream:p.stream??!1,tools:(m=p.tools)==null?void 0:m.map(v=>({type:"function",function:{name:v.name,description:v.description,parameters:v.parameters}}))}},[e.defaultModel]),u=l.useCallback((g,p)=>{var y;const m=p.systemPrompt||((y=g.find(S=>S.role==="system"))==null?void 0:y.content),v=g.filter(S=>S.role!=="system");return{model:p.model||e.defaultModel||"claude-3-opus-20240229",max_tokens:p.maxTokens||4096,system:m,messages:v.map(S=>({role:S.role==="assistant"?"assistant":"user",content:S.content})),temperature:p.temperature??.7,stop_sequences:p.stop,stream:p.stream??!1}},[e.defaultModel]),f=l.useCallback(async(g,p={})=>{var m,v,y,S,w,E;if(e.provider==="custom"&&e.customHandler)return e.customHandler(g,p);a(!0),o(null),s.current=new AbortController;try{let k,C,N;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},N=d(g,{...p,stream:!1});else if(e.provider==="azure-openai")k=e.endpoint||"",C={"Content-Type":"application/json","api-key":e.apiKey||"",...e.headers},N=d(g,{...p,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},N=u(g,{...p,stream:!1});else throw new Error(`Unsupported provider: ${e.provider}`);const M=await fetch(k,{method:"POST",headers:C,body:JSON.stringify(N),signal:s.current.signal});if(!M.ok){const $=await M.text();throw new Error(`AI request failed: ${M.status} ${$}`)}const T=await M.json();let P;if(e.provider==="openai"||e.provider==="azure-openai"){const $=(m=T.choices)==null?void 0:m[0];P={content:((v=$==null?void 0:$.message)==null?void 0:v.content)||"",finishReason:($==null?void 0:$.finish_reason)||"stop",toolCalls:(S=(y=$==null?void 0:$.message)==null?void 0:y.tool_calls)==null?void 0:S.map(z=>({id:z.id,name:z.function.name,arguments:JSON.parse(z.function.arguments)})),usage:T.usage&&{promptTokens:T.usage.prompt_tokens,completionTokens:T.usage.completion_tokens,totalTokens:T.usage.total_tokens}}}else e.provider==="anthropic"?P={content:((E=(w=T.content)==null?void 0:w[0])==null?void 0:E.text)||"",finishReason:T.stop_reason||"stop",usage:T.usage&&{promptTokens:T.usage.input_tokens,completionTokens:T.usage.output_tokens,totalTokens:T.usage.input_tokens+T.usage.output_tokens}}:P={content:"",finishReason:"stop"};return P}catch(k){throw k.name==="AbortError"?new Error("Request cancelled"):(o(k),k)}finally{a(!1)}},[e,d,u]),b=l.useCallback(async(g,p,m={})=>{if(e.provider==="custom"&&e.customStreamHandler)return e.customStreamHandler(g,m,p);a(!0),o(null),s.current=new AbortController;try{let v,y,S;if(e.provider==="openai")v=e.endpoint||"https://api.openai.com/v1/chat/completions",y={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`,...e.organizationId&&{"OpenAI-Organization":e.organizationId},...e.headers},S=d(g,{...m,stream:!0});else if(e.provider==="azure-openai")v=e.endpoint||"",y={"Content-Type":"application/json","api-key":e.apiKey||"",...e.headers},S=d(g,{...m,stream:!0});else if(e.provider==="anthropic")v=e.endpoint||"https://api.anthropic.com/v1/messages",y={"Content-Type":"application/json","x-api-key":e.apiKey||"","anthropic-version":"2023-06-01",...e.headers},S=u(g,{...m,stream:!0});else throw new Error(`Unsupported provider: ${e.provider}`);const w=await fetch(v,{method:"POST",headers:y,body:JSON.stringify(S),signal:s.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 E=w.body.getReader();await c(E,p,e.provider)}catch(v){if(v.name==="AbortError"){p({content:"",done:!0});return}throw o(v),v}finally{a(!1)}},[e,d,u]),h={isConfigured:!!e.apiKey||e.provider==="custom"||e.provider==="local",provider:e.provider,defaultModel:e.defaultModel||null,complete:f,stream:b,cancel:i,isLoading:r,error:n};return x.jsx(Cn.Provider,{value:h,children:t})};function ye(){const e=l.useContext(Cn);if(!e)throw new Error("useNiceAI must be used within a NiceAIProvider");return e}function wu(e={}){const t=ye(),[r,a]=l.useState(""),[n,o]=l.useState([]),[s,i]=l.useState(!1),[c,d]=l.useState(null),u=l.useCallback(async p=>{i(!0),d(null),a("");const m=[...n,{role:"user",content:p}];try{const v=await t.complete(m,{systemPrompt:e.systemPrompt,model:e.model,temperature:e.temperature});return o([...m,{role:"assistant",content:v.content}]),a(v.content),v.content}catch(v){throw d(v),v}finally{i(!1)}},[t,n,e]),f=l.useCallback(async(p,m)=>{i(!0),d(null),a("");const v=[...n,{role:"user",content:p}];try{let y="";return await t.stream(v,S=>{S.done||(y+=S.content,a(y),m==null||m(S.content))},{systemPrompt:e.systemPrompt,model:e.model,temperature:e.temperature}),o([...v,{role:"assistant",content:y}]),y}catch(y){throw d(y),y}finally{i(!1)}},[t,n,e]),b=l.useCallback(()=>{a(""),d(null)},[]),h=l.useCallback(()=>{o([]),a(""),d(null)},[]),g=l.useCallback(()=>{t.cancel(),i(!1)},[t]);return{response:r,isLoading:s,error:c,send:u,sendStreaming:f,clear:b,cancel:g,history:n,clearHistory:h}}function ku(e={}){const t=ye(),[r,a]=l.useState(""),[n,o]=l.useState(!1),s=l.useCallback(async(u,f="")=>{o(!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:
70
70
  \`\`\`
@@ -93,21 +93,21 @@ Refactored code:`}],{model:e.model,temperature:.2}),h=b.content.match(/```[\w]*\
93
93
 
94
94
  Description: ${u}
95
95
 
96
- Code:`}],{model:e.model,temperature:.3}),b=f.content.match(/```[\w]*\n?([\s\S]*?)```/);return b?b[1].trim():f.content.trim()}finally{o(!1)}},[t,e]);return{suggestion:r,isLoading:n,complete:s,explain:i,refactor:c,generateFromComment:d}}function xu(){const e=ye(),[t,r]=l.useState(!1);return{parseFilter:l.useCallback(async(n,o)=>{r(!0);try{const s=await e.complete([{role:"user",content:`Convert this natural language query to filter conditions. Available columns: ${JSON.stringify(o)}
96
+ Code:`}],{model:e.model,temperature:.3}),b=f.content.match(/```[\w]*\n?([\s\S]*?)```/);return b?b[1].trim():f.content.trim()}finally{o(!1)}},[t,e]);return{suggestion:r,isLoading:n,complete:s,explain:i,refactor:c,generateFromComment:d}}function Cu(){const e=ye(),[t,r]=l.useState(!1);return{parseFilter:l.useCallback(async(n,o)=>{r(!0);try{const s=await e.complete([{role:"user",content:`Convert this natural language query to filter conditions. Available columns: ${JSON.stringify(o)}
97
97
 
98
98
  Query: "${n}"
99
99
 
100
100
  Return a JSON array of filter objects with: field, operator (eq, ne, gt, gte, lt, lte, contains, startsWith, endsWith), value.
101
- Only return the JSON array, no explanation.`}],{temperature:.1,maxTokens:500});try{const i=JSON.parse(s.content);return Array.isArray(i)?i:[]}catch{return[]}}finally{r(!1)}},[e]),isLoading:t}}function wu(){const e=ye(),[t,r]=l.useState(!1),a=l.useCallback(async(o,s)=>{r(!0);try{const i=o.slice(0,5),c=await e.complete([{role:"user",content:`Analyze this data and suggest the best chart type. Data sample: ${JSON.stringify(i)}
101
+ Only return the JSON array, no explanation.`}],{temperature:.1,maxTokens:500});try{const i=JSON.parse(s.content);return Array.isArray(i)?i:[]}catch{return[]}}finally{r(!1)}},[e]),isLoading:t}}function Eu(){const e=ye(),[t,r]=l.useState(!1),a=l.useCallback(async(o,s)=>{r(!0);try{const i=o.slice(0,5),c=await e.complete([{role:"user",content:`Analyze this data and suggest the best chart type. Data sample: ${JSON.stringify(i)}
102
102
  ${s?`Context: ${s}`:""}
103
103
 
104
104
  Return JSON with: type (line, bar, pie, scatter, area, donut), reason (brief explanation), config (suggested chart configuration like xField, yField, etc.)
105
105
  Only return JSON.`}],{temperature:.2,maxTokens:500});try{return JSON.parse(c.content)}catch{return{type:"bar",reason:"Default chart type",config:{}}}}finally{r(!1)}},[e]),n=l.useCallback(async(o,s)=>{r(!0);try{const i=await e.complete([{role:"user",content:`Analyze this ${s} chart data and provide 3-5 key insights. Data: ${JSON.stringify(o.slice(0,20))}
106
106
 
107
- Return a JSON array of insight strings.`}],{temperature:.3,maxTokens:500});try{return JSON.parse(i.content)}catch{return[]}}finally{r(!1)}},[e]);return{suggestChartType:a,generateInsights:n,isLoading:t}}function ku(){const e=ye(),[t,r]=l.useState(!1);return{generateForm:l.useCallback(async n=>{r(!0);try{const o=await e.complete([{role:"user",content:`Generate a form definition from this description: "${n}"
107
+ Return a JSON array of insight strings.`}],{temperature:.3,maxTokens:500});try{return JSON.parse(i.content)}catch{return[]}}finally{r(!1)}},[e]);return{suggestChartType:a,generateInsights:n,isLoading:t}}function Nu(){const e=ye(),[t,r]=l.useState(!1);return{generateForm:l.useCallback(async n=>{r(!0);try{const o=await e.complete([{role:"user",content:`Generate a form definition from this description: "${n}"
108
108
 
109
109
  Return a JSON array of field objects with: label, field (camelCase), type (text, number, email, date, select, checkbox, textarea), required (boolean), options (for select type).
110
- Only return JSON.`}],{temperature:.3,maxTokens:1e3});try{return JSON.parse(o.content)}catch{return[]}}finally{r(!1)}},[e]),isLoading:t}}function Cu(){const e=ye(),[t,r]=l.useState(!1),a=l.useCallback(async(s,i)=>{r(!0);try{return(await e.complete([{role:"user",content:`Improve this text to be more ${i||"professional"}. Keep the same meaning. Return only the improved text.
110
+ Only return JSON.`}],{temperature:.3,maxTokens:1e3});try{return JSON.parse(o.content)}catch{return[]}}finally{r(!1)}},[e]),isLoading:t}}function Au(){const e=ye(),[t,r]=l.useState(!1),a=l.useCallback(async(s,i)=>{r(!0);try{return(await e.complete([{role:"user",content:`Improve this text to be more ${i||"professional"}. Keep the same meaning. Return only the improved text.
111
111
 
112
112
  Text: ${s}
113
113
 
@@ -119,7 +119,7 @@ Translation:`}],{temperature:.2})).content.trim()}finally{r(!1)}},[e]),o=l.useCa
119
119
 
120
120
  Prompt: ${s}
121
121
 
122
- HTML:`}],{temperature:.3}),c=i.content.match(/```html?\n?([\s\S]*?)```/);return c?c[1].trim():i.content.trim()}finally{r(!1)}},[e]);return{improveText:a,translate:n,generateHtml:o,isLoading:t}}class mt{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 Eu(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 En(e,t){if(t.items.length===0)return!0;const r=a=>a.type==="condition"?Eu(e,a):En(e,a);return t.logic==="and"?t.items.every(r):t.items.some(r)}function Nu(e,t){var n;let r=[...e];if(t.filter&&(r=r.filter(o=>En(o,t.filter))),t.search){const o=t.search.toLowerCase(),s=t.searchFields;r=r.filter(i=>(s?s.map(d=>i[d]):Object.values(i)).some(d=>String(d??"").toLowerCase().includes(o)))}const a=r.length;if((n=t.sort)!=null&&n.length&&r.sort((o,s)=>{for(const i of t.sort){const c=o[i.field]??"",d=s[i.field]??"",u=typeof c=="number"&&typeof d=="number"?c-d:String(c).localeCompare(String(d));if(u!==0)return i.direction==="desc"?-u:u}return 0}),t.skip!=null||t.take!=null){const o=t.skip??0,s=t.take??r.length;r=r.slice(o,o+s)}return{data:r,totalCount:a}}function Au(e){const t=e.keyField??"id";let r=[...e.data];const a=new mt;return{keyField:t,writable:!0,async load(o={}){a.emit("loading",!0);try{const s=Nu(r,o);return a.emit("loaded",s),a.emit("loading",!1),s}catch(s){throw a.emit("error",s instanceof Error?s:new Error(String(s))),a.emit("loading",!1),s}},async byKey(o){return r.find(s=>s[t]===o)},async insert(o){const s={...o};return r=[...r,s],a.emit("changed"),s},async update(o,s){const i=r.findIndex(d=>d[t]===o);if(i===-1)throw new Error(`Record not found: ${o}`);const c={...r[i],...s};return r=r.map((d,u)=>u===i?c:d),a.emit("changed"),c},async remove(o){r=r.filter(s=>s[t]!==o),a.emit("changed")},on:a.on.bind(a)}}async function Mu(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 vt(e,t,r){return typeof e=="function"?e(r):e||`${t}/${encodeURIComponent(String(r))}`}function Tu(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(o=>`${o.field} ${o.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 Iu(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 Nn(e){const t=e.keyField??"id",r=new mt;async function a(o,s){const i=await Mu(e),c=await fetch(o,{...e.fetchOptions,...s,headers:{...i,...s==null?void 0:s.headers}});if(!c.ok){const u=await c.text().catch(()=>c.statusText);throw new Error(`HTTP ${c.status}: ${u}`)}return(c.headers.get("content-type")??"").includes("json")?c.json():c.text()}return{keyField:t,writable:!0,async load(o={}){var s;r.emit("loading",!0);try{const i=e.loadUrl??e.url,c=e.mapLoadParams?e.mapLoadParams(o):Tu(o),d=new URLSearchParams(c).toString(),u=d?`${i}?${d}`:i,f=await a(u),b=e.extractLoadResult?e.extractLoadResult(f):Iu(f);return r.emit("loaded",b),r.emit("loading",!1),b}catch(i){const c=i instanceof Error?i:new Error(String(i));throw r.emit("error",c),r.emit("loading",!1),(s=e.onError)==null||s.call(e,c,"load"),c}},async byKey(o){const s=vt(e.byKeyUrl,e.url,o),i=await a(s);return e.extractItem?e.extractItem(i):i},async insert(o){const s=e.insertUrl??e.url,i=e.prepareInsertBody?e.prepareInsertBody(o):o,c=await a(s,{method:"POST",body:JSON.stringify(i)}),d=e.extractItem?e.extractItem(c):c;return r.emit("changed"),d},async update(o,s){const i=vt(e.updateUrl,e.url,o),c=e.prepareUpdateBody?e.prepareUpdateBody(o,s):s,d=await a(i,{method:e.updateMethod??"PUT",body:JSON.stringify(c)}),u=e.extractItem?e.extractItem(d):d;return r.emit("changed"),u},async remove(o){const s=vt(e.deleteUrl,e.url,o);await a(s,{method:"DELETE"}),r.emit("changed")},on:r.on.bind(r)}}function Ru(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 An(e,t){return e.items.length===0?"":e.items.map(a=>a.type==="condition"?Ru(a,t):`(${An(a,t)})`).join(e.logic==="and"?" and ":" or ")}function Lu(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 o,s,i;const n={};if(t>=4&&(n.$count="true"),a.skip!=null&&(n.$skip=String(a.skip)),a.take!=null&&(n.$top=String(a.take)),(o=a.sort)!=null&&o.length&&(n.$orderby=a.sort.map(c=>`${c.field} ${c.direction}`).join(",")),a.filter){const c=An(a.filter,t);c&&(n.$filter=c)}return a.search&&(n.$search=`"${a.search}"`),(s=a.select)!=null&&s.length&&(n.$select=a.select.join(",")),(i=a.expand)!=null&&i.length&&(n.$expand=a.expand.join(",")),n},extractLoadResult(a){var i,c;const n=a,o=n.value??((i=n.d)==null?void 0:i.results)??[],s=n["@odata.count"]??((c=n.d)==null?void 0:c.__count)??o.length;return{data:o,totalCount:s}},byKeyUrl:a=>{const n=typeof a=="number"?a:`'${String(a).replace(/'/g,"''")}'`;return`${e.url}(${n})`}};return Nn(r)}function Fu(e){const t=e.keyField??"id",r=new mt;async function a(c,d){var g;const u={"Content-Type":"application/json"},f=e.headers?typeof e.headers=="function"?await e.headers():e.headers:{},b=await fetch(e.url,{method:"POST",headers:{...u,...f},body:JSON.stringify({query:c,variables:d})});if(!b.ok){const p=await b.text().catch(()=>b.statusText);throw new Error(`GraphQL HTTP ${b.status}: ${p}`)}const h=await b.json();if((g=h.errors)!=null&&g.length)throw new Error(h.errors.map(p=>p.message).join("; "));return h.data}function n(c){var u;const d={};return c.skip!=null&&(d.skip=c.skip),c.take!=null&&(d.take=c.take),c.search&&(d.search=c.search),(u=c.sort)!=null&&u.length&&(d.sort=c.sort),c.filter&&(d.filter=c.filter),d}function o(c){if(!c||typeof c!="object")return{data:[],totalCount:0};const d=Object.values(c)[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 s(c){return!c||typeof c!="object"?c:Object.values(c)[0]}return{keyField:t,writable:!!(e.queries.insert||e.queries.update||e.queries.remove),async load(c={}){var d;r.emit("loading",!0);try{const u=e.mapVariables?e.mapVariables(c):n(c),f=await a(e.queries.load,u),b=e.extractLoadResult?e.extractLoadResult(f):o(f);return r.emit("loaded",b),r.emit("loading",!1),b}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(c){if(!e.queries.byKey)throw new Error("byKey query not configured");const d=await a(e.queries.byKey,{[t]:c});return e.extractItem?e.extractItem(d):s(d)},insert:e.queries.insert?async c=>{const d=await a(e.queries.insert,{input:c}),u=e.extractItem?e.extractItem(d):s(d);return r.emit("changed"),u}:void 0,update:e.queries.update?async(c,d)=>{const u=await a(e.queries.update,{[t]:c,input:d}),f=e.extractItem?e.extractItem(u):s(u);return r.emit("changed"),f}:void 0,remove:e.queries.remove?async c=>{await a(e.queries.remove,{[t]:c}),r.emit("changed")}:void 0,on:r.on.bind(r)}}function Du(e){const t=e.keyField??"id",r=new mt;return{keyField:t,writable:!!(e.insert||e.update||e.remove),async load(n={}){r.emit("loading",!0);try{const o=await e.load(n);return r.emit("loaded",o),r.emit("loading",!1),o}catch(o){const s=o instanceof Error?o:new Error(String(o));throw r.emit("error",s),r.emit("loading",!1),s}},async byKey(n){if(!e.byKey)throw new Error("byKey handler not configured");return e.byKey(n)},insert:e.insert?async n=>{const o=await e.insert(n);return r.emit("changed"),o}:void 0,update:e.update?async(n,o)=>{const s=await e.update(n,o);return r.emit("changed"),s}:void 0,remove:e.remove?async n=>{await e.remove(n),r.emit("changed")}:void 0,on:r.on.bind(r)}}function Mn(e){return/^[A-Za-z_][A-Za-z0-9_.]*$/.test(e)?e:`"${e.replace(/"/g,'""')}"`}function Pu(e,t={}){const r=[],a=t.placeholder??(()=>"?"),n=t.quoteField??Mn,o=c=>(r.push(c),a(r.length-1)),s=c=>{const d=n(c.field);switch(c.operator){case"=":case"<>":case"<":case"<=":case">":case">=":return`${d} ${c.operator} ${o(c.value)}`;case"contains":return`${d} LIKE ${o(`%${String(c.value)}%`)}`;case"notcontains":return`${d} NOT LIKE ${o(`%${String(c.value)}%`)}`;case"startswith":return`${d} LIKE ${o(`${String(c.value)}%`)}`;case"endswith":return`${d} LIKE ${o(`%${String(c.value)}`)}`;case"between":{const u=Array.isArray(c.value)?c.value:[c.value,c.value];return`${d} BETWEEN ${o(u[0])} AND ${o(u[1])}`}case"isblank":return`(${d} IS NULL OR ${d} = ${o("")})`;case"isnotblank":return`(${d} IS NOT NULL AND ${d} <> ${o("")})`;case"in":{const u=Array.isArray(c.value)?c.value:[c.value];return u.length?`${d} IN (${u.map(o).join(", ")})`:"1 = 0"}default:return`${d} = ${o(c.value)}`}},i=c=>{const d=[];for(const u of c.items)if(u.type==="group"){const f=i(u);f&&d.push(`(${f})`)}else d.push(s(u));return d.join(c.logic==="or"?" OR ":" AND ")};return{sql:i(e),params:r}}function $u(e,t={}){const r=t.quoteField??Mn;return e.filter(a=>a.field).map(a=>`${r(a.field)} ${a.direction==="desc"?"DESC":"ASC"}`).join(", ")}function ne(e){return String(e??"").toLowerCase()}function Tn(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 ne(r).includes(ne(a));case"notcontains":return!ne(r).includes(ne(a));case"startswith":return ne(r).startsWith(ne(a));case"endswith":return ne(r).endsWith(ne(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(o=>r==o);default:return!0}}function fr(e,t){if(!t.items.length)return!0;const r=a=>a.type==="condition"?Tn(e,a):fr(e,a);return t.logic==="or"?t.items.some(r):t.items.every(r)}function Hu(e,t){return t!=null&&t.groups?e.group?t.groups.includes(e.group):t.includeUngrouped===!0:!0}function Br(e){return e==null||e===""}const zu=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function _u(e){const t=String(e);try{return new URL(t),!0}catch{return/^https?:\/\/[^\s]+$/.test(t)}}function X(e){return typeof e=="number"?e:parseFloat(String(e))}function In(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 Rn(e,t){const r=t[e.field];if(e.op==="required")return!Br(r);if(Br(r))return!0;const a=e.compareField!=null?t[e.compareField]:void 0;switch(e.op){case"minLength":return String(r).length>=X(e.value);case"maxLength":return String(r).length<=X(e.value);case"min":return X(r)>=X(e.value);case"max":return X(r)<=X(e.value);case"pattern":try{return new RegExp(String(e.value)).test(String(r))}catch{return!0}case"email":return zu.test(String(r));case"url":return _u(r);case"equals":return r===e.value;case"notEquals":return r!==e.value;case"greaterThan":return X(r)>X(e.value);case"lessThan":return X(r)<X(e.value);case"matchesField":return r===a;case"greaterThanField":return X(r)>X(a);case"lessThanField":return X(r)<X(a);case"custom":return e.validate?e.validate(r,t):!0;default:return!0}}function Ln(e,t,r){const a=[];for(const n of e??[])Hu(n,r)&&(n.when&&!fr(t,n.when)||Rn(n,t)||a.push({field:n.field,message:n.message??In(n),severity:n.severity??"error",ruleId:n.id}));return a}function Ou(e,t,r){return Ln(e,t,r).every(a=>a.severity!=="error")}class Ft{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 Fn{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 Bu(e,t={}){const r=new Ft(t),a=new Ft(t),n=new Fn,o=t.generateKey??(c=>JSON.stringify(c)),s=t.cacheLoads!==!1,i=t.cacheByKey!==!1;return{...e,cache:r,async load(c={}){const d=`load:${o(c)}`;if(s){const u=r.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.load(c);return s&&r.set(d,u),u})},async byKey(c){const d=`byKey:${String(c)}`;if(i){const u=a.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.byKey(c);return i&&u&&a.set(d,u),u})},async insert(c){const d=await e.insert(c);return r.invalidateAll(),d},async update(c,d){const u=await e.update(c,d);return r.invalidateAll(),a.invalidate(`byKey:${String(c)}`),u},async remove(c){await e.remove(c),r.invalidateAll(),a.invalidate(`byKey:${String(c)}`)},invalidateCache(){r.invalidateAll(),a.invalidateAll()}}}function ju(e,t){const{cursorField:r,pageSize:a=20,direction:n="asc"}=t;return{async loadPage(o={}){var m;const s=o.pageSize??a,i=o.direction??"forward",c=o.cursor?{type:"condition",field:r,operator:i==="forward"?n==="asc"?">":"<":n==="asc"?"<":">",value:Wu(o.cursor)}:null,d=c?{type:"group",logic:"and",items:[...((m=o.filter)==null?void 0:m.items)??[],c]}:o.filter,u=[{field:r,direction:i==="forward"?n:n==="asc"?"desc":"asc"},...o.sort??[]],f=await e.load({...o,filter:d,sort:u,take:s+1}),b=f.data.length>s,h=b?f.data.slice(0,s):f.data;i==="backward"&&h.reverse();const g=h[h.length-1],p=h[0];return{data:h,nextCursor:b&&g?St(g[r]):null,prevCursor:p&&o.cursor?St(p[r]):null,hasMore:b}},async*loadAll(o={}){let s=null;do{const i=await e.load({...o,...s?{cursor:s}:{}});if(i.data.length===0)break;yield i.data;const c=i.data[i.data.length-1];s=c?St(c[r]):null}while(s)}}}function St(e){return btoa(JSON.stringify(e))}function Wu(e){try{return JSON.parse(atob(e))}catch{return e}}function Vu(e,t={}){const{pageSize:r=50,threshold:a=200,initialPage:n=0}=t;let o={items:[],isLoading:!1,hasMore:!0,error:null,page:n,totalCount:0};const s=new Set;function i(){s.forEach(h=>h(o))}function c(h){o={...o,...h},i()}let d={};async function u(){if(!(o.isLoading||!o.hasMore)){c({isLoading:!0,error:null});try{const h=await e.load({...d,skip:o.page*r,take:r}),g=[...o.items,...h.data],p=g.length<h.totalCount;c({items:g,page:o.page+1,totalCount:h.totalCount,hasMore:p,isLoading:!1})}catch(h){c({error:h instanceof Error?h:new Error(String(h)),isLoading:!1})}}}function f(h={}){d=h,o={items:[],isLoading:!1,hasMore:!0,error:null,page:0,totalCount:0},i()}function b(h){const g=h.target;if(!g)return;g.scrollHeight-g.scrollTop-g.clientHeight<a&&u()}return{get state(){return o},loadMore:u,reset:f,handleScroll:b,subscribe(h){return s.add(h),()=>s.delete(h)},setOptions(h){d=h}}}function Uu(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:o=10,heartbeatInterval:s=3e4}=e;let i=null,c=0,d=null,u=[];const f=new Map;function b(k,...C){var N;(N=f.get(k))==null||N.forEach(M=>M(...C))}function h(k){if(e.parseMessage)return e.parseMessage(k);try{return JSON.parse(k.data)}catch{return null}}function g(k){return e.serializeMessage?e.serializeMessage(k):JSON.stringify(k)}function p(k){switch(k.type){case"insert":k.data&&(u=[...u,k.data],b("changed"));break;case"update":k.key&&k.changes&&(u=u.map(C=>C[a]===k.key?{...C,...k.changes}:C),b("changed"));break;case"remove":k.key&&(u=u.filter(C=>C[a]!==k.key),b("changed"));break;case"refresh":case"sync":E.load().catch(()=>{});break}}function m(){(i==null?void 0:i.readyState)!==WebSocket.OPEN&&(i=new WebSocket(t),i.onopen=()=>{c=0,b("connected"),y()},i.onmessage=k=>{const C=h(k);C&&(p(C),b("message",C))},i.onerror=k=>{b("error",new Error("WebSocket error"))},i.onclose=()=>{S(),b("disconnected"),c<o&&(c++,setTimeout(m,n*Math.min(c,5)))})}function v(){S(),i&&(i.close(),i=null)}function y(){S(),d=window.setInterval(()=>{(i==null?void 0:i.readyState)===WebSocket.OPEN&&i.send(JSON.stringify({type:"ping"}))},s)}function S(){d&&(clearInterval(d),d=null)}function w(k){(i==null?void 0:i.readyState)===WebSocket.OPEN&&i.send(g(k))}const E={keyField:a,writable:r.writable,async load(k={}){b("loading",!0);try{const C=await r.load(k);return u=C.data,b("loaded",C),b("loading",!1),C}catch(C){throw b("error",C),b("loading",!1),C}},async byKey(k){const C=u.find(N=>N[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 N=await r.update(k,C);return w({type:"update",key:k,changes:C}),N},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 N;return(N=f.get(k))==null?void 0:N.delete(C)}},connect:m,disconnect:v,isConnected:()=>(i==null?void 0:i.readyState)===WebSocket.OPEN,sendMessage:w};return E}function Ku(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 o=[];const s=new Map;function i(f,...b){var h;(h=s.get(f))==null||h.forEach(g=>g(...b))}const c=f=>{o=[...o,f],i("changed")},d=(f,b)=>{o=o.map(h=>h[n]===f?{...h,...b}:h),i("changed")},u=f=>{o=o.filter(b=>b[n]!==f),i("changed")};return{keyField:n,writable:r.writable,async load(f={}){i("loading",!0);try{const b=await r.load(f);return o=b.data,i("loaded",b),i("loading",!1),b}catch(b){throw i("error",b),i("loading",!1),b}},async byKey(f){const b=o.find(h=>h[n]===f);return b||r.byKey(f)},async insert(f){return await t.invoke(a.insert,f)},async update(f,b){return await t.invoke(a.update,f,b)},async remove(f){await t.invoke(a.remove,f)},on(f,b){return s.has(f)||s.set(f,new Set),s.get(f).add(b),()=>{var h;return(h=s.get(f))==null?void 0:h.delete(b)}},async connect(){t.on(a.onInsert,c),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,c),t.off(a.onUpdate,d),t.off(a.onRemove,u),t.off(a.onRefresh,()=>{}),await t.stop()}}}function Gu(e,t={}){const r=e.keyField;let a=[];const n=new Map;let o=0;const s=new Map;function i(d,...u){var f;(f=s.get(d))==null||f.forEach(b=>b(...u))}function c(){return`op_${++o}_${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 b,h,g;const u=c(),f={...d};a=[...a,f],n.set(u,{id:u,action:"insert",item:f}),(b=t.onOptimisticApply)==null||b.call(t,f,"insert"),i("changed");try{const p=await e.insert(d);return a=a.map(m=>m===f?p:m),n.delete(u),(h=t.onConfirm)==null||h.call(t,p,"insert"),i("changed"),p}catch(p){throw a=a.filter(m=>m!==f),n.delete(u),(g=t.onRollback)==null||g.call(t,f,"insert",p instanceof Error?p:new Error(String(p))),i("changed"),p}},async update(d,u){var p,m,v;const f=c(),b=a.findIndex(y=>y[r]===d);if(b===-1)return e.update(d,u);const h=a[b],g={...h,...u};a=a.map((y,S)=>S===b?g:y),n.set(f,{id:f,action:"update",key:d,originalItem:h}),(p=t.onOptimisticApply)==null||p.call(t,g,"update"),i("changed");try{const y=await e.update(d,u);return a=a.map((S,w)=>w===b?y:S),n.delete(f),(m=t.onConfirm)==null||m.call(t,y,"update"),i("changed"),y}catch(y){throw a=a.map((S,w)=>w===b?h:S),n.delete(f),(v=t.onRollback)==null||v.call(t,h,"update",y instanceof Error?y:new Error(String(y))),i("changed"),y}},async remove(d){var b,h,g;const u=c(),f=a.find(p=>p[r]===d);if(!f)return e.remove(d);a=a.filter(p=>p!==f),n.set(u,{id:u,action:"remove",key:d,originalItem:f}),(b=t.onOptimisticApply)==null||b.call(t,f,"remove"),i("changed");try{await e.remove(d),n.delete(u),(h=t.onConfirm)==null||h.call(t,f,"remove")}catch(p){throw a=[...a,f],n.delete(u),(g=t.onRollback)==null||g.call(t,f,"remove",p instanceof Error?p:new Error(String(p))),i("changed"),p}},on(d,u){return s.has(d)||s.set(d,new Set),s.get(d).add(u),()=>{var f;return(f=s.get(d))==null?void 0:f.delete(u)}},hasPendingChanges:()=>n.size>0,getPendingCount:()=>n.size}}function Dn(e,t,r){const a=new Map(e.map(d=>[d[r],d])),n=new Map(t.map(d=>[d[r],d])),o=[],s=[],i=[],c=[];for(const[d,u]of n){const f=a.get(d);if(!f)o.push(u);else if(Pn(f,u))c.push(u);else{const b={};for(const h of Object.keys(u))f[h]!==u[h]&&(b[h]=u[h]);s.push({key:d,changes:b,oldItem:f,newItem:u})}}for(const[d,u]of a)n.has(d)||i.push(u);return{inserted:o,updated:s,removed:i,unchanged:c}}function Pn(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 o of n)if(!Pn(r[o],a[o]))return!1;return!0}function Xu(e,t={}){const{interval:r=5e3,autoStart:a=!1,pauseWhenHidden:n=!0,onDataChange:o}=t;let s=r,i=null,c=[],d={};const u=new Map;function f(m,...v){var y;(y=u.get(m))==null||y.forEach(S=>S(...v))}async function b(){if(!(n&&document.hidden))try{const m=await e.load(d),v=Dn(c,m.data,e.keyField);(v.inserted.length||v.updated.length||v.removed.length)&&(c=m.data,f("changed"),o==null||o(v))}catch{}}function h(){i||(i=window.setInterval(b,s))}function g(){i&&(clearInterval(i),i=null)}n&&document.addEventListener("visibilitychange",()=>{document.hidden||i&&b()});const p={...e,async load(m={}){d=m;const v=await e.load(m);return c=v.data,v},on(m,v){u.has(m)||u.set(m,new Set),u.get(m).add(v);const y=e.on(m,v);return()=>{var S;(S=u.get(m))==null||S.delete(v),y()}},startPolling:h,stopPolling:g,isPolling:()=>i!==null,setInterval(m){s=m,i&&(g(),h())}};return a&&h(),p}function qu(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:o=10,withCredentials:s=!1}=e;let i=null,c=0,d=null,u=[];const f=new Map;function b(y,...S){var w;(w=f.get(y))==null||w.forEach(E=>E(...S))}function h(y){if(e.parseEvent)return e.parseEvent(y);try{return JSON.parse(y.data)}catch{return null}}function g(y){switch(y.type){case"insert":y.data&&(u=[...u,y.data],b("changed"));break;case"update":y.key&&y.changes&&(u=u.map(S=>S[a]===y.key?{...S,...y.changes}:S),b("changed"));break;case"remove":y.key&&(u=u.filter(S=>S[a]!==y.key),b("changed"));break;case"snapshot":Array.isArray(y.data)&&(u=y.data,b("changed"));break;case"refresh":v.load().catch(()=>{});break}}function p(){(i==null?void 0:i.readyState)!==EventSource.OPEN&&(m(),i=new EventSource(t,{withCredentials:s}),i.onopen=()=>{c=0,b("connected")},i.onmessage=y=>{const S=h(y);S&&(g(S),b("message",S))},i.onerror=()=>{if(b("error",new Error("SSE connection error")),(i==null?void 0:i.readyState)===EventSource.CLOSED&&(b("disconnected"),i=null,c<o)){c++;const y=n*Math.min(c,5);d=setTimeout(p,y)}})}function m(){d&&(clearTimeout(d),d=null),i&&(i.close(),i=null)}const v={keyField:a,writable:r.writable,async load(y={}){b("loading",!0);try{const S=await r.load(y);return u=S.data,b("loaded",S),b("loading",!1),S}catch(S){throw b("error",S),b("loading",!1),S}},async byKey(y){const S=u.find(w=>w[a]===y);return S||r.byKey(y)},async insert(y){return r.insert(y)},async update(y,S){return r.update(y,S)},async remove(y){return r.remove(y)},on(y,S){return f.has(y)||f.set(y,new Set),f.get(y).add(S),()=>{var w;return(w=f.get(y))==null?void 0:w.delete(S)}},connect:p,disconnect:m,isConnected:()=>(i==null?void 0:i.readyState)===EventSource.OPEN};return v}function se(e,t){const r={};for(const a of t){const n=e.map(s=>s[a.field]).filter(s=>s!=null),o=a.alias??`${a.fn}_${a.field}`;switch(a.fn){case"sum":r[o]=n.reduce((s,i)=>Number(s)+Number(i),0);break;case"avg":r[o]=n.length?n.reduce((s,i)=>Number(s)+Number(i),0)/n.length:0;break;case"min":r[o]=n.length?Math.min(...n.map(Number)):null;break;case"max":r[o]=n.length?Math.max(...n.map(Number)):null;break;case"count":r[o]=n.length;break;case"first":r[o]=n[0]??null;break;case"last":r[o]=n[n.length-1]??null;break;case"distinct":r[o]=[...new Set(n)];break}}return r}function mr(e,t){const{groupBy:r,aggregates:a=[],includeItems:n=!1,sortGroups:o}=t;if(r.length===0)return[{key:{},count:e.length,aggregates:se(e,a),items:n?e:void 0}];const s=new Map;for(const c of e){const d={};for(const f of r)d[f]=c[f];const u=JSON.stringify(d);s.has(u)||s.set(u,{key:d,items:[]}),s.get(u).items.push(c)}const i=[];for(const[,c]of s)i.push({key:c.key,count:c.items.length,aggregates:se(c.items,a),items:n?c.items:void 0});return o!=null&&o.length&&i.sort((c,d)=>{for(const u of o){const f=c.key[u.field]??c.aggregates[u.field],b=d.key[u.field]??d.aggregates[u.field],h=typeof f=="number"&&typeof b=="number"?f-b:String(f??"").localeCompare(String(b??""));if(h!==0)return u.direction==="desc"?-h:h}return 0}),i}function $n(e,t,r=[]){if(t.length===0)return[{key:{},count:e.length,aggregates:se(e,r),items:e}];const[a,...n]=t,o=mr(e,{groupBy:[a],aggregates:r,includeItems:!0});if(n.length>0)for(const s of o)s.groups=$n(s.items,n,r),delete s.items;return o}function Yu(e,t){const{rows:r,columns:a,values:n,aggregateFunction:o="sum",rowTotals:s=!0,columnTotals:i=!0,grandTotal:c=!0}=t,d=[...new Set(e.map(g=>String(g[a])))].sort(),u=mr(e,{groupBy:r,includeItems:!0}),f=[];for(const g of u){const p={rowKey:g.key,values:{}};for(const m of d){const v=g.items.filter(S=>String(S[a])===m),y=se(v,[{field:n,fn:o}]);p.values[m]=y[`${o}_${n}`]??null}if(s){const m=se(g.items,[{field:n,fn:o}]);p.rowTotal=m[`${o}_${n}`]}f.push(p)}let b;if(i){b={};for(const g of d){const p=e.filter(v=>String(v[a])===g),m=se(p,[{field:n,fn:o}]);b[g]=m[`${o}_${n}`]}}let h;return c&&(h=se(e,[{field:n,fn:o}])[`${o}_${n}`]),{columnHeaders:d,rows:f,columnTotals:b,grandTotal:h}}function Ju(e,t){return e.map((r,a)=>{const n={...r};for(const o of t)n[o.name]=o.formula(r,a,e);return n})}const Qu={runningSum:e=>(t,r,a)=>a.slice(0,r+1).reduce((n,o)=>n+Number(o[e]??0),0),runningAvg:e=>(t,r,a)=>{const n=a.slice(0,r+1);return n.reduce((o,s)=>o+Number(s[e]??0),0)/n.length},percentOfTotal:e=>(t,r,a)=>{const n=a.reduce((o,s)=>o+Number(s[e]??0),0);return n?Number(t[e]??0)/n*100:0},rank:(e,t="desc")=>(r,a,n)=>[...n].sort((s,i)=>{const c=Number(s[e]??0)-Number(i[e]??0);return t==="desc"?-c:c}).findIndex(s=>s===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 o=Math.max(0,a-t+1),s=n.slice(o,a+1);return s.reduce((i,c)=>i+Number(c[e]??0),0)/s.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 Zu(e,t){const r=[],a=new Map,n=new Map;for(let i=0;i<e.length;i++){const c=e[i];for(const d of t)if(!d.validate(c,i,e)){const u=typeof d.message=="function"?d.message(c):d.message,f={index:i,rule:d.name,message:u,severity:d.severity??"error",fields:d.fields??[],item:c};r.push(f),a.has(i)||a.set(i,[]),a.get(i).push(f);for(const b of f.fields)n.has(b)||n.set(b,[]),n.get(b).push(f)}}const o=r.filter(i=>i.severity==="error").length,s=r.filter(i=>i.severity==="warning").length;return{isValid:o===0,errorCount:o,warningCount:s,errors:r,byIndex:a,byField:n}}const ef={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(o=>o[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})},tf=(function(){return{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,o=[],s=[];let i=0;if(a)for(let c=0;c<e.length;c+=n){const d=e.slice(c,c+n),u=await Promise.allSettled(d.map((f,b)=>t(f,c+b)));for(let f=0;f<u.length;f++){const b=u[f];b.status==="fulfilled"?(o.push(b.value),i++):s.push({index:c+f,item:d[f],error:b.reason})}}else for(let c=0;c<e.length;c++)try{const d=await t(e[c],c);o.push(d),i++}catch(d){s.push({index:c,item:e[c],error:d instanceof Error?d:new Error(String(d))})}return{succeeded:i,failed:s.length,errors:s,results:o}},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:o=!0}=a,s=new Map(e.map(c=>[c[r],c])),i=[...e];for(const c of t){const d=c[r],u=s.get(d);if(u){if(n){const f=i.indexOf(u);i[f]={...u,...c}}}else o&&i.push(c)}return i}}})();function rf(e,t){const r=(t==null?void 0:t.autoLoad)??!0,a=(t==null?void 0:t.defaultPageSize)??20,[n,o]=l.useState([]),[s,i]=l.useState(0),[c,d]=l.useState(!1),[u,f]=l.useState(null),[b,h]=l.useState(1),[g,p]=l.useState(a),[m,v]=l.useState((t==null?void 0:t.defaultSort)??[]),[y,S]=l.useState(t==null?void 0:t.defaultFilter),[w,E]=l.useState((t==null?void 0:t.defaultSearch)??""),k=l.useRef(0),C=t==null?void 0:t.loadOptions,N=l.useCallback(async()=>{if(!e)return;const L=++k.current;d(!0),f(null);try{const F=await e.load({skip:(b-1)*g,take:g,sort:m.length?m:void 0,filter:y,search:w||void 0,...C});if(L!==k.current)return;o(F.data),i(F.totalCount)}catch(F){if(L!==k.current)return;f(F instanceof Error?F.message:String(F))}finally{L===k.current&&d(!1)}},[e,b,g,m,y,w,C]);l.useEffect(()=>{r&&N()},[N,r]),l.useEffect(()=>{if(e)return e.on("changed",()=>{N()})},[e,N]);const M=l.useCallback((L,F)=>{v([{field:L,direction:F}]),h(1)},[]),T=l.useCallback(L=>{S(L),h(1)},[]),P=l.useCallback(L=>{E(L),h(1)},[]),$=l.useCallback(L=>{p(L),h(1)},[]),H=l.useCallback(async L=>{if(!(e!=null&&e.insert))throw new Error("DataSource is not writable");await e.insert(L)},[e]),_=l.useCallback(async(L,F)=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");await e.update(L,F)},[e]),R=l.useCallback(async L=>{if(!(e!=null&&e.remove))throw new Error("DataSource is not writable");await e.remove(L)},[e]);return{data:n,totalCount:s,loading:c,error:u,page:b,pageSize:g,sort:m,filter:y,search:w,setPage:h,setPageSize:$,setSort:v,setSortField:M,setFilter:T,setSearch:P,reload:N,insert:H,update:_,remove:R}}function Hn(e,t){const[r,a]=l.useState(void 0),[n,o]=l.useState({}),[s,i]=l.useState(!1),[c,d]=l.useState(null),u=l.useRef(0),f=l.useCallback(async()=>{if(!e||t==null){a(void 0);return}const y=++u.current;i(!0),d(null);try{const S=await e.byKey(t);if(y!==u.current)return;a(S),o({})}catch(S){if(y!==u.current)return;d(S instanceof Error?S.message:String(S))}finally{y===u.current&&i(!1)}},[e,t]);l.useEffect(()=>{f()},[f]),l.useEffect(()=>{if(e)return e.on("changed",()=>{f()})},[e,f]);const b=l.useMemo(()=>({...r??{},...n}),[r,n]),h=Object.keys(n).length>0,g=l.useCallback((y,S)=>{o(w=>({...w,[y]:S}))},[]),p=l.useCallback(y=>{o(S=>({...S,...y}))},[]),m=l.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=l.useCallback(()=>{o({})},[]);return{data:r,editData:b,loading:s,error:c,changes:n,isDirty:h,set:g,setMany:p,save:m,reload:f,reset:v}}function af(e,t,r){const a=Hn(e,t),n=a.editData[r],o=l.useCallback(i=>{a.set(r,i)},[a,r]),s=l.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");const i={[r]:a.editData[r]};await e.update(t,i)},[e,t,r,a.editData]);return{value:n,setValue:o,loading:a.loading,error:a.error,isDirty:r in a.changes,save:s}}function nf(e,t,r,a){const n=(a==null?void 0:a.autoLoad)??!0,o=(a==null?void 0:a.take)??200,[s,i]=l.useState([]),[c,d]=l.useState(!1),[u,f]=l.useState(null),b=l.useRef(0),h=l.useCallback(async m=>{if(!e)return;const v=++b.current;d(!0),f(null);try{const y=await e.load({take:o,search:m||void 0,searchFields:a==null?void 0:a.searchFields});if(v!==b.current)return;i(y.data)}catch(y){if(v!==b.current)return;f(y instanceof Error?y.message:String(y))}finally{v===b.current&&d(!1)}},[e,o,a==null?void 0:a.searchFields]);l.useEffect(()=>{n&&h()},[h,n]);const g=l.useMemo(()=>s.map(m=>{const v=m,y={value:String(v[t]??""),label:String(v[r]??"")};return a!=null&&a.iconField&&v[a.iconField]!=null&&(y.icon=v[a.iconField]),a!=null&&a.descriptionField&&v[a.descriptionField]!=null&&(y.description=String(v[a.descriptionField])),a!=null&&a.groupField&&v[a.groupField]!=null&&(y.group=String(v[a.groupField])),y}),[s,t,r,a==null?void 0:a.iconField,a==null?void 0:a.descriptionField,a==null?void 0:a.groupField]),p=l.useCallback(m=>{h(m)},[h]);return{options:g,loading:c,error:u,search:p,reload:()=>h()}}function Dt(e){const{dbName:t,storeName:r,keyField:a="id",version:n=1,indexes:o=[]}=e;let s=null;const i=new Map;function c(g,...p){var m;(m=i.get(g))==null||m.forEach(v=>v(...p))}async function d(){return s||new Promise((g,p)=>{const m=indexedDB.open(t,n);m.onerror=()=>p(m.error),m.onsuccess=()=>{s=m.result,g(s)},m.onupgradeneeded=v=>{const y=v.target.result;if(!y.objectStoreNames.contains(r)){const S=y.createObjectStore(r,{keyPath:a});for(const w of o)S.createIndex(w.name,w.keyPath,{unique:w.unique??!1})}}})}async function u(g,p){const m=await d();return new Promise((v,y)=>{const w=m.transaction(r,g).objectStore(r),E=p(w);E.onsuccess=()=>v(E.result),E.onerror=()=>y(E.error)})}async function f(g,p,m){const v=await d();return new Promise((y,S)=>{var _;const E=v.transaction(r,g).objectStore(r),k=[];let C=E,N="next";if((_=p.sort)!=null&&_.length){const R=p.sort[0].field,L=p.sort[0].direction;E.indexNames.contains(R)&&(C=E.index(R)),N=L==="desc"?"prev":"next"}const M=C.openCursor(null,N);let T=0,P=0;const $=p.skip??0,H=p.take??1/0;M.onsuccess=()=>{const R=M.result;if(!R||P>=H){y(k);return}const L=R.value;if(p.filter&&!b(L,p.filter)){R.continue();return}if(p.search&&!h(L,p.search,p.searchFields)){R.continue();return}if(T<$){T++,R.continue();return}k.push(L),P++,R.continue()},M.onerror=()=>S(M.error)})}function b(g,p){if(!p.items.length)return!0;const m=v=>{if(v.type==="group")return b(g,v);const y=g[v.field],S=v.value;switch(v.operator){case"=":return y==S;case"<>":return y!=S;case"<":return y<S;case"<=":return y<=S;case">":return y>S;case">=":return y>=S;case"contains":return String(y??"").toLowerCase().includes(String(S??"").toLowerCase());case"notcontains":return!String(y??"").toLowerCase().includes(String(S??"").toLowerCase());case"startswith":return String(y??"").toLowerCase().startsWith(String(S??"").toLowerCase());case"endswith":return String(y??"").toLowerCase().endsWith(String(S??"").toLowerCase());case"isblank":return y==null||y==="";case"isnotblank":return y!=null&&y!=="";default:return!0}};return p.logic==="and"?p.items.every(m):p.items.some(m)}function h(g,p,m){const v=p.toLowerCase();return(m?m.map(S=>g[S]):Object.values(g)).some(S=>String(S??"").toLowerCase().includes(v))}return{keyField:a,writable:!0,async load(g={}){var p;c("loading",!0);try{const m=await f("readonly",g,()=>{});(p=g.sort)!=null&&p.length&&m.sort((S,w)=>{for(const E of g.sort){const k=S[E.field]??"",C=w[E.field]??"",N=typeof k=="number"&&typeof C=="number"?k-C:String(k).localeCompare(String(C));if(N!==0)return E.direction==="desc"?-N:N}return 0});const v=await this.count(),y={data:m,totalCount:v};return c("loaded",y),c("loading",!1),y}catch(m){throw c("error",m),c("loading",!1),m}},async byKey(g){return u("readonly",p=>p.get(g))},async insert(g){return await u("readwrite",p=>p.add(g)),c("changed"),g},async update(g,p){const m=await this.byKey(g);if(!m)throw new Error(`Record not found: ${g}`);const v={...m,...p};return await u("readwrite",y=>y.put(v)),c("changed"),v},async remove(g){await u("readwrite",p=>p.delete(g)),c("changed")},on(g,p){return i.has(g)||i.set(g,new Set),i.get(g).add(p),()=>{var m;return(m=i.get(g))==null?void 0:m.delete(p)}},async clear(){await u("readwrite",g=>g.clear()),c("changed")},async count(){return u("readonly",g=>g.count())},async getAll(){return u("readonly",g=>g.getAll())},async bulkInsert(g){const p=await d();return new Promise((m,v)=>{const y=p.transaction(r,"readwrite"),S=y.objectStore(r);for(const w of g)S.put(w);y.oncomplete=()=>{c("changed"),m()},y.onerror=()=>v(y.error)})},async bulkDelete(g){const p=await d();return new Promise((m,v)=>{const y=p.transaction(r,"readwrite"),S=y.objectStore(r);for(const w of g)S.delete(w);y.oncomplete=()=>{c("changed"),m()},y.onerror=()=>v(y.error)})},async exportData(){return this.getAll()},async importData(g){await this.clear(),await this.bulkInsert(g)}}}function of(e){const{remoteSource:t,offlineConfig:r,syncStrategy:a="remote-first",onConflict:n,onSync:o,autoSyncInterval:s=0}=e,i=r.keyField??t.keyField,c=Dt({...r,keyField:i}),d=Dt({dbName:r.dbName,storeName:`${r.storeName}_pending`,keyField:"id"});let u=navigator.onLine,f=0;const b=new Map;function h(m,...v){var y;(y=b.get(m))==null||y.forEach(S=>S(...v))}window.addEventListener("online",()=>{u=!0,h("online"),p()}),window.addEventListener("offline",()=>{u=!1,h("offline")});async function g(m,v,y){const S={id:`pending_${++f}_${Date.now()}`,action:m,key:v,data:y,timestamp:Date.now(),retries:0};await d.insert(S)}async function p(){if(u){h("syncing",!0);try{let m=0,v=0,y=0;const S=await d.load();for(const w of S.data)try{switch(w.action){case"insert":await t.insert(w.data),m++;break;case"update":await t.update(w.key,w.data),v++;break;case"remove":await t.remove(w.key),y++;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 c.importData(w.data);else if(a==="merge"&&n){const E=await c.load(),k=new Map(E.data.map(N=>[N[i],N])),C=[];for(const N of w.data){const M=k.get(N[i]);M?C.push(n(M,N)):C.push(N)}await c.importData(C)}}h("synced",{added:m,updated:v,removed:y}),o==null||o({added:m,updated:v,removed:y})}catch(m){h("syncError",m)}finally{h("syncing",!1)}}}return s>0&&window.setInterval(p,s),{keyField:i,writable:!0,async load(m={}){if(u&&a==="remote-first")try{const v=await t.load(m);return await c.bulkInsert(v.data),v}catch{}return c.load(m)},async byKey(m){if(u)try{const v=await t.byKey(m);return v&&await c.update(m,v).catch(()=>c.insert(v)),v}catch{}return c.byKey(m)},async insert(m){const v=await c.insert(m);if(u)try{return await t.insert(m)}catch{await g("insert",void 0,m)}else await g("insert",void 0,m);return h("changed"),v},async update(m,v){const y=await c.update(m,v);if(u)try{return await t.update(m,v)}catch{await g("update",m,v)}else await g("update",m,v);return h("changed"),y},async remove(m){if(await c.remove(m),u)try{await t.remove(m)}catch{await g("remove",m)}else await g("remove",m);h("changed")},on(m,v){return b.has(m)||b.set(m,new Set),b.get(m).add(v),()=>{var y;return(y=b.get(m))==null?void 0:y.delete(v)}},sync:p,isOnline:()=>u,async getPendingChanges(){return(await d.load()).data},async clearPendingChanges(){await d.clear()}}}function sf(e){const{channelName:t,source:r}=e,a=new BroadcastChannel(t),n=new Map;function o(i,...c){var d;(d=n.get(i))==null||d.forEach(u=>u(...c))}a.onmessage=i=>{const c=i.data;switch(c.type){case"insert":case"update":case"remove":o("changed"),o("crossTabChange",c);break;case"refresh":o("refresh");break;case"request-sync":r.load().then(d=>{a.postMessage({type:"sync-data",data:d.data})});break}};function s(i){a.postMessage(i)}return{...r,async insert(i){const c=await r.insert(i);return s({type:"insert",data:c}),c},async update(i,c){const d=await r.update(i,c);return s({type:"update",key:i,changes:c}),d},async remove(i){await r.remove(i),s({type:"remove",key:i})},on(i,c){n.has(i)||n.set(i,new Set),n.get(i).add(c);const d=r.on(i,c);return()=>{var u;(u=n.get(i))==null||u.delete(c),d()}},broadcast:s,requestSync(){s({type:"request-sync"})}}}function cf(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 o(i){if(a)window.location.hash=i.toString();else{const c=new URL(window.location.href);c.search=i.toString(),window.history.replaceState({},"",c.toString())}}function s(i){return t?`${t}_${i}`:i}return{read(){const i=n(),c={};if(r.filter){const d=i.get(s("filter"));if(d)try{c.filter=JSON.parse(d)}catch{}}if(r.sort){const d=i.get(s("sort"));if(d)try{c.sort=JSON.parse(d)}catch{}}if(r.page){const d=i.get(s("skip")),u=i.get(s("take"));d&&(c.skip=parseInt(d,10)),u&&(c.take=parseInt(u,10))}if(r.search){const d=i.get(s("search"));d&&(c.search=d)}return c},write(i){const c=n();r.filter&&(i.filter&&i.filter.items.length>0?c.set(s("filter"),JSON.stringify(i.filter)):c.delete(s("filter"))),r.sort&&(i.sort&&i.sort.length>0?c.set(s("sort"),JSON.stringify(i.sort)):c.delete(s("sort"))),r.page&&(i.skip?c.set(s("skip"),String(i.skip)):c.delete(s("skip")),i.take?c.set(s("take"),String(i.take)):c.delete(s("take"))),r.search&&(i.search?c.set(s("search"),i.search):c.delete(s("search"))),o(c)},clear(){const i=n();i.delete(s("filter")),i.delete(s("sort")),i.delete(s("skip")),i.delete(s("take")),i.delete(s("search")),o(i)},toLoadOptions(){const i=this.read();return{filter:i.filter,sort:i.sort,skip:i.skip,take:i.take,search:i.search}}}}const lf={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 o=0,s=0;r.replace&&"clear"in e&&await e.clear();for(const i of n){if(r.validate&&!r.validate(i)){s++;continue}try{await e.insert(i),o++}catch{s++}}return{imported:o,skipped:s}},async downloadAsJSON(e,t="export.json"){const r=await this.exportToJSON(e),a=new Blob([r],{type:"application/json"}),n=URL.createObjectURL(a),o=document.createElement("a");o.href=n,o.download=t,o.click(),URL.revokeObjectURL(n)},async importFromFile(e,t,r){const a=await t.text();return this.importFromJSON(e,a,r)}};function df(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,o){return r()[n]??o},set(n,o){const s=r();s[n]=o,a(s)},remove(n){const o=r();delete o[n],a(o)},getAll(){return{...r()}},setAll(n){a(n)},clear(){t={},localStorage.removeItem(e)},merge(n){a({...r(),...n})}}}const ze={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},_e={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},Oe={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},pr=e=>({color:e,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),zn={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)"},uf={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:pr(n),shadows:zn,spacing:ze,typography:_e,transitions:Oe}}function V(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:pr(n),shadows:uf,spacing:ze,typography:_e,transitions:Oe}}const _n=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"),On=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"),Bn=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"),jn=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"),Wn=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"),Vn=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"),Un=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"),Kn=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"),Gn=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"),Xn=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"),qn=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"),Yn=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"),Jn=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"),Qn=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"),Zn=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"),eo=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"),to=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"),ro=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"),ao=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"),no=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"),oo=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"),so=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"),io=V("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"),co=V("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"),lo=V("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"),uo=V("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"),fo=V("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"),mo=V("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",onPrimary:"#ffffff"},"#374151"),po=V("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"),go=V("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"),yo=V("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"),ho=V("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"),bo=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"),vo=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"),So=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"),xo=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"),wo=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"),ko=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"),Co=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"),Eo=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"),No=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"),Ao=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"),Mo=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"),To=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"),Io=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"),Ro=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"),Lo=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"),Fo=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"),Do=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"),Po=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"),$o=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"),Ho=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"),zo=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"),_o=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"),Oo=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"),Bo=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"),jo=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"),Wo=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"),Vo=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"),Uo=V("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"),Ko=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"),Go=V("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",onError:"#ffffff"},"#073642"),Xo=V("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"),qo=V("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"),Yo=V("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"),Jo=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"),Qo=V("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"),Zo=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"),es=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"),ts=V("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",onInfo:"#ffffff"},"#1c3a44"),rs=V("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"),as=V("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"),ns=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"),os=V("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",onInfo:"#ffffff"},"#5c3400"),ss=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"),is=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"),cs=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"),ls=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"),ds=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"),us=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"),fs=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"),ms=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"),ps=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"),gs=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"),ys=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"),hs=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"),bs=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"),vs=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"),Ss=V("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"),xs=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"),ws=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"),ks={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:pr("#e2e8f0"),shadows:zn,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:Oe},Cs={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:ze,typography:_e,transitions:{fast:"150ms ease",normal:"250ms ease",slow:"350ms ease"}},Es={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:ze,typography:_e,transitions:Oe},Ns={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:ze,typography:_e,transitions:Oe},As=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"),Ms=V("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"),Ts=V("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"),Is=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"),Rs=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"),Ls=[_n,On,Bn,jn,Wn,Vn,Un,Kn,Gn,Xn,qn,Yn,Jn,Qn,Zn,eo,to,ro,ao,no,oo,so,io,co,lo,uo,fo,mo,po,go,yo,ho,bo,vo,So,xo,wo,ko,Co,Eo,No,Ao,Mo,To,Io,Ro,Lo,Fo,Do,Po,$o,Ho,zo,_o,Oo,Bo,jo,Wo,Vo,Uo,Ko,Go,Xo,qo,Yo,Jo,Qo,Zo,es,ts,rs,as,ns,os,ss,is,cs,ls,ds,us,fs,ms,ps,gs,ys,hs,bs,vs,Ss,xs,ws,ks,Cs,Es,Ns,As,Ms,Ts,Is,Rs],ff=["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"],mf={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},de={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},gr={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},Fs={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:gr,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"}},Ds={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:de,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"}},Ps={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:gr,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"}},$s={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:de,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"}},Hs={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:de,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:de,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"}},_s={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:de,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"}},Os={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:de,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"}},Bs={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:gr,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"}},js={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:de,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"}},Ws={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:de,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"}},Vs={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:mf,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"}},yr={obsidianEditorial:Fs,neonArcade:Ds,hyggeScandinavian:Ps,brutalistRaw:$s,glassAurora:Hs,candyPop:zs,newspaperBroadsheet:_s,synthwave84:Os,zenMinimal:Bs,claymorphism:js,bauhaus:Ws,bankVault:Vs},hr=Object.values(yr);function pf(e){return yr[e]}function gf(e){return hr.filter(t=>t.meta.tags.includes(e))}const yf=["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"],Us={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},q={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Be={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},pt={space1:"8px",space2:"16px",space3:"24px",space4:"32px",space5:"44px",space6:"56px",space8:"80px"},Ks={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:Be,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"}},Gs={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:Be,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"}},Xs={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:pt,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"}},qs={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:q,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"}},Ys={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:pt,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"}},Js={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:q,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"}},Qs={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:Be,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"}},Zs={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:q,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"}},ei={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:q,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"}},ti={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:q,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"}},ri={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:q,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"}},ai={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:q,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"}},ni={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:q,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"}},oi={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:q,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"}},si={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:q,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"}},ii={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:pt,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"}},ci={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:q,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"}},li={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:q,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"}},di={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:Be,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"}},ui={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:q,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"}},fi={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:pt,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"}},mi={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:Us,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"}},pi={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:Be,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"}},gi={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:Us,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"}},br={forestCanopy:Ks,desertDune:Gs,arcticCrystal:Xs,autumnFoliage:qs,japaneseWashi:Ys,moroccanMosaic:Js,artDecoGatsby:Qs,sovietConstructivist:Zs,blueprint:ei,hologramUI:ti,deepSea:ri,analog70s:ai,vhsTracking:ni,typewriterPress:oi,y2kAqua:si,vogueDidone:ii,comicHalftone:ci,zinePunk:li,watercolorWash:di,memphis80s:ui,inkSumie:fi,dieterRams:mi,blackTieGala:pi,swissGrid:gi},vr=Object.values(br);function hf(e){return br[e]}function bf(e){return vr.filter(t=>t.meta.tags.includes(e))}function Pt(e){return rr.some(t=>t.name.toLowerCase()===e.name.toLowerCase())?{...e,name:`${e.name} Classic`}:e}function jr(e){const t=Pt(e.theme);return t===e.theme?e:{...e,meta:{...e.meta,name:t.name},theme:t}}const xt={};function Ee(e,t){return e in xt||(xt[e]=t()),xt[e]}const Ae={get core(){return Ee("core",()=>[Wa,Va,Ua,Ka,Ga].map(Pt))},get gallery(){return Ee("gallery",()=>Ls.map(Pt))},get packs(){return Ee("packs",()=>hr.map(jr))},get packsExtended(){return Ee("packsExtended",()=>vr.map(jr))},get all(){return Ee("all",()=>[...Ae.core,...Ae.gallery,...Ae.packs.map(e=>e.theme),...Ae.packsExtended.map(e=>e.theme)])}},yi=l.createContext(null);function hi(){const e=l.useContext(yi);if(!e)throw new Error("useThemeVariants must be used within NiceThemeVariantProvider");return e}function vf({initialConfig:e,storageKey:t="ntd-variant-config",autoApply:r=!0,children:a}){const[n,o]=l.useState(()=>{if(typeof window<"u"&&t){const d=localStorage.getItem(t);if(d)try{return{...te,...JSON.parse(d)}}catch{}}return{...te,...e}});l.useEffect(()=>{r&&typeof window<"u"&&Ot(n)},[n,r]),l.useEffect(()=>{typeof window<"u"&&t&&localStorage.setItem(t,JSON.stringify(n))},[n,t]);const s=l.useCallback(d=>{o(u=>({...u,...d}))},[]),i=l.useCallback(d=>{const u=et[d];u&&o(u)},[]),c=l.useCallback(()=>{o(te)},[]);return x.jsx(yi.Provider,{value:{config:n,setConfig:s,applyPreset:i,reset:c},children:a})}function Sf({showPresets:e=!0,showPreview:t=!0,showCSS:r=!1,collapsible:a=!0,className:n,style:o}){const{t:s}=W.useNiceTranslation(),{config:i,setConfig:c,applyPreset:d,reset:u}=hi(),[f,b]=l.useState(new Set(["presets","radius","shadow"])),h=p=>{a&&b(m=>{const v=new Set(m);return v.has(p)?v.delete(p):v.add(p),v})},g=p=>!a||f.has(p);return x.jsxs("div",{className:`ntd-theme-variant-configurator ${n||""}`,style:{fontFamily:"system-ui, sans-serif",fontSize:"14px",...o},children:[e&&x.jsx(J,{title:s("themeVariants.presets","Presets"),expanded:g("presets"),onToggle:()=>h("presets"),children:x.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[Object.keys(et).map(p=>x.jsx("button",{onClick:()=>d(p),style:{padding:"6px 12px",border:"1px solid var(--nice-border-color, #e5e7eb)",borderRadius:"6px",background:"var(--nice-bg-secondary, #f9fafb)",cursor:"pointer",textTransform:"capitalize"},children:p},p)),x.jsx("button",{onClick:u,style:{padding:"6px 12px",border:"1px solid var(--nice-danger-dark, #dc2626)",borderRadius:"6px",background:"var(--nice-danger-bg, #fef2f2)",color:"var(--nice-color-error, #dc2626)",cursor:"pointer"},children:s("themeVariants.reset","Reset")})]})}),x.jsx(J,{title:s("themeVariants.borderRadius","Border Radius"),expanded:g("radius"),onToggle:()=>h("radius"),children:x.jsx(ue,{options:Object.keys(Me),value:i.radius,onChange:p=>c({radius:p}),renderPreview:p=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--nice-color-accent, #6366f1)",borderRadius:Me[p].md}})})}),x.jsx(J,{title:s("themeVariants.shadows","Shadows"),expanded:g("shadow"),onToggle:()=>h("shadow"),children:x.jsx(ue,{options:Object.keys(Ge),value:i.shadow,onChange:p=>c({shadow:p}),renderPreview:p=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--nice-bg-primary, #fff)",borderRadius:"4px",boxShadow:Ge[p]}})})}),x.jsx(J,{title:s("themeVariants.buttonStyle","Button Style"),expanded:g("button"),onToggle:()=>h("button"),children:x.jsx(ue,{options:["flat","raised","outlined","ghost","soft","gradient","3d","neumorphic"],value:i.buttonStyle,onChange:p=>c({buttonStyle:p})})}),x.jsx(J,{title:s("themeVariants.inputStyle","Input Style"),expanded:g("input"),onToggle:()=>h("input"),children:x.jsx(ue,{options:["bordered","filled","underlined","floating","soft","neumorphic"],value:i.inputStyle,onChange:p=>c({inputStyle:p})})}),x.jsx(J,{title:s("themeVariants.cardStyle","Card Style"),expanded:g("card"),onToggle:()=>h("card"),children:x.jsx(ue,{options:["flat","elevated","bordered","glass","gradient","neumorphic"],value:i.cardStyle,onChange:p=>c({cardStyle:p})})}),x.jsx(J,{title:s("themeVariants.animation","Animation"),expanded:g("animation"),onToggle:()=>h("animation"),children:x.jsx(ue,{options:Object.keys(Ze),value:i.animation,onChange:p=>c({animation:p})})}),x.jsx(J,{title:s("themeVariants.density","Density"),expanded:g("density"),onToggle:()=>h("density"),children:x.jsx(ue,{options:Object.keys(Le),value:i.density,onChange:p=>c({density:p})})}),t&&x.jsx(J,{title:s("themeVariants.preview","Preview"),expanded:g("preview"),onToggle:()=>h("preview"),children:x.jsx(xf,{config:i})}),r&&x.jsx(J,{title:s("themeVariants.generatedCss","Generated CSS"),expanded:g("css"),onToggle:()=>h("css"),children:x.jsx("pre",{style:{background:"var(--nice-text-primary, #1f2937)",color:"var(--nice-text-inverse, #e5e7eb)",padding:"12px",borderRadius:"6px",fontSize:"12px",overflow:"auto",maxHeight:"200px"},children:_t(i)})})]})}function J({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(--nice-text-secondary, #374151)",textAlign:"left"},children:[x.jsx("span",{style:{display:"inline-flex",transform:t?"rotate(90deg)":"none",transition:"transform 150ms"},children:x.jsx(A.NiceIcon,{name:"chevron-right",size:14})}),e]}),t&&x.jsx("div",{style:{paddingLeft:"20px",paddingTop:"8px"},children:a})]})}function ue({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(--nice-border-color, #e5e7eb)",borderRadius:"6px",background:t===n?"var(--nice-primary-bg, #eef2ff)":"var(--nice-bg-primary, #fff)",cursor:"pointer",textTransform:"capitalize",fontSize:"13px"},children:[a&&a(n),n]},n))})}function xf({config:e}){const{t}=W.useNiceTranslation(),r=$t(e.buttonStyle,"var(--nice-color-accent, #6366f1)"),a=Ht(e.inputStyle),n=zt(e.cardStyle),o=Me[e.radius],s=Le[e.density];return x.jsxs("div",{style:{padding:"20px",background:"var(--nice-bg-secondary, #f9fafb)",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"16px"},children:[x.jsxs("div",{style:{padding:s.paddingX,borderRadius:o.lg,...n},children:[x.jsx("h4",{style:{margin:"0 0 12px",fontSize:s.fontSize},children:t("themeVariants.cardPreview","Card Preview")}),x.jsxs("div",{style:{display:"flex",gap:s.gap,marginBottom:"12px"},children:[x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:o.md,color:"var(--nice-text-primary, #fff)",fontSize:s.fontSize,cursor:"pointer",...r},children:t("themeVariants.primary","Primary")}),x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:o.md,background:"var(--nice-border-color, #e5e7eb)",border:"none",fontSize:s.fontSize,cursor:"pointer"},children:t("themeVariants.secondary","Secondary")})]}),x.jsx("input",{type:"text",placeholder:t("themeVariants.inputPreview","Input preview..."),style:{width:"100%",height:s.inputHeight,padding:`0 ${s.paddingX}`,fontSize:s.fontSize,outline:"none",boxSizing:"border-box",...a}})]}),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:o.full,background:"var(--nice-border-color, #e5e7eb)",fontSize:"12px"},children:i},i))})]})}function wf(e){const[t,r]=l.useState(()=>typeof window>"u"?!1:Wr());return l.useEffect(()=>{var d,u,f;if(typeof window>"u")return;const a=()=>(e==null?void 0:e.current)??document.documentElement,n=()=>r(Wr(a()));n();const o=new MutationObserver(n),s={attributes:!0,attributeFilter:["data-theme","class","style"]};o.observe(document.documentElement,s);const i=(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");i&&i!==document.documentElement&&o.observe(i,s);const c=typeof window.matchMedia=="function"?window.matchMedia("(prefers-color-scheme: dark)"):null;return(f=c==null?void 0:c.addEventListener)==null||f.call(c,"change",n),()=>{var b;o.disconnect(),(b=c==null?void 0:c.removeEventListener)==null||b.call(c,"change",n)}},[e]),t}function Wr(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 o=getComputedStyle(e),s=o.getPropertyValue("--text-primary").trim()||o.color;if(s){const i=s.match(/rgba?\(([^)]+)\)/);if(i){const[c,d,u]=i[1].split(",").map(f=>parseFloat(f.trim()));return(.299*c+.587*d+.114*u)/255>.5}if(/^#([0-9a-f]{3,8})$/i.test(s)){const c=s.replace("#",""),d=c.length===3?c.split("").map(h=>h+h).join(""):c.slice(0,6),u=parseInt(d.slice(0,2),16),f=parseInt(d.slice(2,4),16),b=parseInt(d.slice(4,6),16);return(.299*u+.587*f+.114*b)/255>.5}}return((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)??!1}catch{return!1}}const kf=["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","NiceChartRangeSelector","NiceVectorMap","NiceHeatMap","NiceTreeMap","NiceStockChart","NiceOrganizationChart","NiceActionSheet","NicePopover","NiceLoadPanel","NiceWindow","NiceBlockUI","NiceScheduler","NiceGantt","NiceDiagramViewer","NiceStepper","NiceBox","NiceResponsiveBox","NiceResizable","NiceScrollView","NiceChatWindow","NiceUpload","NiceFileManager","NiceFilterBuilder","NiceGallery","NiceMap","div","span","row","column","stack","container"];function Cf(e){const t=[];bi(e.root,t,"root");const r=new Set((e.dataSources??[]).map(a=>a.id));return vi(e.root,r,t),t}function bi(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++)bi(e.children[a],t,`${r}.children[${a}]`)}function vi(e,t,r){if(e.bindings)for(const[a,n]of Object.entries(e.bindings)){const o=n.split(".")[0];!t.has(o)&&o!=="form"&&o!=="route"&&r.push(`Binding "${a}" references unknown data source "${o}"`)}if(e.children)for(const a of e.children)vi(a,t,r)}function Ef(e,t){const r=Nf(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 Nf(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 Si(e){const{itemCount:t,itemHeight:r,containerHeight:a,overscan:n=3,initialScrollTop:o=0}=e,[s,i]=l.useState(o),[c,d]=l.useState(!1),u=l.useRef(void 0),f=l.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]),b=l.useMemo(()=>typeof r=="number"?t*r:f?f[t]:0,[t,r,f]),h=l.useCallback(k=>typeof r=="number"?r:r(k),[r]),g=l.useCallback(k=>typeof r=="number"?k*r:f?f[k]:0,[r,f]),p=l.useCallback(k=>{if(typeof r=="number")return Math.floor(k/r);if(!f)return 0;let C=0,N=t-1;for(;C<=N;){const M=Math.floor((C+N)/2),T=f[M];if(T===k)return M;T<k?C=M+1:N=M-1}return Math.max(0,C-1)},[t,r,f]),{startIndex:m,endIndex:v,visibleItems:y}=l.useMemo(()=>{const k=Math.max(0,p(s)-n);let C=k,N=g(k);for(;C<t&&N<s+a;)N+=h(C),C++;C=Math.min(t,C+n);const M=[];for(let T=k;T<C;T++)M.push({index:T,offset:g(T),height:h(T),key:T});return{startIndex:k,endIndex:C,visibleItems:M}},[s,a,t,n,p,g,h]),S=l.useCallback(k=>{const C=k.currentTarget;i(C.scrollTop),d(!0),u.current&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{d(!1)},150)},[]),w=l.useCallback((k,C="start")=>{const N=g(k),M=h(k);let T;switch(C){case"center":T=N-a/2+M/2;break;case"end":T=N-a+M;break;default:T=N}i(Math.max(0,Math.min(T,b-a)))},[g,h,a,b]),E=l.useCallback(k=>{i(Math.max(0,Math.min(k,b-a)))},[b,a]);return l.useEffect(()=>()=>{u.current&&window.clearTimeout(u.current)},[]),{visibleItems:y,totalHeight:b,scrollTop:s,scrollToIndex:w,scrollTo:E,onScroll:S,startIndex:m,endIndex:v,isScrolling:c}}function Af(e){const{rowCount:t,columnCount:r,rowHeight:a,columnWidth:n,containerHeight:o,containerWidth:s,overscan:i=2}=e,[c,d]=l.useState(0),[u,f]=l.useState(0),[b,h]=l.useState(!1),g=l.useRef(void 0),p=l.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]),m=l.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=l.useMemo(()=>{const S=[];let w=0,E=0;if(typeof a=="number")w=Math.floor(c/a),E=w*a;else for(;w<t&&E+a(w)<c;)E+=a(w),w++;w=Math.max(0,w-i);let k=w,C=typeof a=="number"?w*a:E;for(;k<t&&C<c+o;)C+=typeof a=="number"?a:a(k),k++;k=Math.min(t,k+i);let N=0,M=0;if(typeof n=="number")N=Math.floor(u/n),M=N*n;else for(;N<r&&M+n(N)<u;)M+=n(N),N++;N=Math.max(0,N-i);let T=N,P=typeof n=="number"?N*n:M;for(;T<r&&P<u+s;)P+=typeof n=="number"?n:n(T),T++;T=Math.min(r,T+i);let $=typeof a=="number"?w*a:(()=>{let H=0;for(let _=0;_<w;_++)H+=a(_);return H})();for(let H=w;H<k;H++){const _=typeof a=="number"?a:a(H);let R=typeof n=="number"?N*n:(()=>{let L=0;for(let F=0;F<N;F++)L+=n(F);return L})();for(let L=N;L<T;L++){const F=typeof n=="number"?n:n(L);S.push({rowIndex:H,columnIndex:L,top:$,left:R,width:F,height:_,key:`${H}:${L}`}),R+=F}$+=_}return S},[c,u,t,r,a,n,o,s,i]),y=l.useCallback(S=>{const w=S.currentTarget;d(w.scrollTop),f(w.scrollLeft),h(!0),g.current&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{h(!1)},150)},[]);return l.useEffect(()=>()=>{g.current&&window.clearTimeout(g.current)},[]),{visibleCells:v,totalWidth:m,totalHeight:p,onScroll:y,scrollTop:c,scrollLeft:u,isScrolling:b}}function Mf(e,t,r,a=3){const n=Si({itemCount:e.length,itemHeight:r,containerHeight:t,overscan:a}),o=l.useCallback(s=>e[s.index],[e]);return{...n,getItemData:o,containerStyle:{height:t,overflow:"auto"},innerStyle:{height:n.totalHeight,position:"relative"},getItemStyle:s=>({position:"absolute",top:s.offset,left:0,right:0,height:s.height})}}function Tf(e){const{items:t,searchFn:r,debounce:a=0,minLength:n=0}=e,[o,s]=l.useState(""),i=l.useDeferredValue(o),[c,d]=l.useState(""),u=l.useRef(void 0);l.useEffect(()=>{if(a>0)return u.current=window.setTimeout(()=>{d(o)},a),()=>{u.current&&window.clearTimeout(u.current)};d(o)},[o,a]);const f=l.useDeferredValue(c),b=l.useMemo(()=>f.length<n?t:t.filter(g=>r(g,f)),[t,f,r,n]);return{query:o,setQuery:s,results:b,isStale:f!==i,deferredQuery:f}}function If(e){const[t,r]=l.useState(e),[a,n]=l.useState(e),[o,s]=l.useTransition(),i=l.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),s(()=>{r(u)})},[t]),c=l.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),r(u)},[t]);return{value:t,pendingValue:a,isPending:o,setValue:i,setValueImmediate:c}}function Rf(e){const{data:t,processFn:r,chunkSize:a=1e3,priority:n="user-visible"}=e,[o,s]=l.useState(null),[i,c]=l.useState(0),[d,u]=l.useState(!1),f=l.useRef(!1),b=l.useCallback(async()=>{if(t.length===0){s([]);return}u(!0),c(0),f.current=!1;const g=[],p=t.length;for(let m=0;m<p&&!f.current;m+=a){const v=t.slice(m,m+a),y=v.map((w,E)=>r(w,m+E));g.push(...y);const S=Math.min(100,(m+v.length)/p*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)),l.startTransition(()=>{c(S)})}s(g),u(!1),c(100)},[t,r,a,n]),h=l.useCallback(()=>{f.current=!0},[]);return l.useEffect(()=>(b(),()=>{f.current=!0}),[b]),{result:o,progress:i,isProcessing:d,process:b,cancel:h}}function Lf(e,t={}){const{initialCount:r=20,batchSize:a=50,batchDelay:n=16}=t,[o,s]=l.useState(Math.min(r,e.length)),[i,c]=l.useState(e.length<=r);return l.useEffect(()=>{if(o>=e.length){c(!0);return}const u=setTimeout(()=>{l.startTransition(()=>{s(f=>Math.min(f+a,e.length))})},n);return()=>clearTimeout(u)},[o,e.length,a,n]),l.useEffect(()=>{s(Math.min(r,e.length)),c(e.length<=r)},[e,r]),{visibleItems:l.useMemo(()=>e.slice(0,o),[e,o]),visibleCount:o,totalCount:e.length,isComplete:i,progress:o/e.length*100}}function Ff(e){const{initial:t,mutate:r,rollbackOnError:a=!0}=e,[n,o]=l.useState(t),[s,i]=l.useState(!1),[c,d]=l.useState(null),u=l.useRef(t),f=l.useCallback(async h=>{u.current=n,d(null),o(h),i(!0);try{const g=await r(h);o(g)}catch(g){d(g instanceof Error?g:new Error(String(g))),a&&o(u.current)}finally{i(!1)}},[n,r,a]),b=l.useCallback(()=>{o(t),d(null),i(!1)},[t]);return{value:n,update:f,isPending:s,error:c,reset:b}}function Df(e){const{workerScript:t,idleTimeout:r=3e4}=e,[a,n]=l.useState(null),[o,s]=l.useState(!1),[i,c]=l.useState(null),d=l.useRef(null),u=l.useRef(0),f=l.useRef(null),b=l.useRef(void 0),h=l.useRef(()=>{}),g=l.useCallback(()=>{if(!d.current){if(typeof t=="function"){const S=new Blob([`(${t.toString()})()`],{type:"application/javascript"});d.current=new Worker(URL.createObjectURL(S))}else d.current=new Worker(t,{type:"module"});d.current.onmessage=S=>{const w=S.data;w.id===f.current&&(w.type==="result"?(n(w.result??null),s(!1),f.current=null,h.current()):w.type==="error"&&(c(new Error(w.error)),s(!1),f.current=null,h.current()))},d.current.onerror=S=>{c(new Error(S.message)),s(!1),f.current=null}}return d.current},[t]),p=l.useCallback(()=>{b.current&&window.clearTimeout(b.current),r>0&&(b.current=window.setTimeout(()=>{d.current&&!f.current&&(d.current.terminate(),d.current=null)},r))},[r]);h.current=p;const m=l.useCallback(S=>new Promise((w,E)=>{const k=g(),C=`task-${++u.current}`;f.current=C,s(!0),c(null);const N=k.onmessage;k.onmessage=M=>{N==null||N.call(k,M),M.data.id===C&&(M.data.type==="result"?w(M.data.result):M.data.type==="error"&&E(new Error(M.data.error)))},k.postMessage({type:"task",id:C,data:S})}),[g]),v=l.useCallback(()=>{d.current&&f.current&&(d.current.postMessage({type:"cancel",id:f.current}),f.current=null,s(!1))},[]),y=l.useCallback(()=>{d.current&&(d.current.terminate(),d.current=null),b.current&&window.clearTimeout(b.current),f.current=null,s(!1)},[]);return l.useEffect(()=>()=>{y()},[y]),{result:a,isProcessing:o,error:i,execute:m,cancel:v,terminate:y}}function Pf(e){const{workerScript:t,poolSize:r=navigator.hardwareConcurrency||4,idleTimeout:a=6e4}=e,n=l.useRef([]),o=l.useRef([]),s=l.useRef(0),i=l.useRef(void 0),c=l.useCallback(()=>{if(typeof t=="function"){const v=new Blob([`(${t.toString()})()`],{type:"application/javascript"});return new Worker(URL.createObjectURL(v))}return new Worker(t,{type:"module"})},[t]),d=l.useCallback(()=>{const v=n.current.find(y=>!y.busy);if(v)return v;if(n.current.length<r){const S={worker:c(),busy:!1,taskId:null};return n.current.push(S),S}return null},[c,r]),u=l.useRef(()=>{}),f=l.useCallback(()=>{for(;o.current.length>0;){const v=d();if(!v)break;const y=o.current.shift();v.busy=!0,v.taskId=y.id,v.worker.onmessage=S=>{const w=S.data;w.id===y.id&&(v.busy=!1,v.taskId=null,w.type==="result"?y.resolve(w.result):w.type==="error"&&y.reject(new Error(w.error)),f(),u.current())},v.worker.onerror=S=>{v.busy=!1,v.taskId=null,y.reject(new Error(S.message)),f()},v.worker.postMessage({type:"task",id:y.id,data:y.data})}},[d]),b=l.useCallback(()=>{i.current&&window.clearTimeout(i.current),a>0&&(i.current=window.setTimeout(()=>{n.current.filter(y=>!y.busy).forEach(y=>{y.worker.terminate(),n.current=n.current.filter(S=>S!==y)})},a))},[a]);u.current=b;const h=l.useCallback(v=>new Promise((y,S)=>{const w=`pool-task-${++s.current}`;o.current.push({id:w,data:v,resolve:y,reject:S}),f()}),[f]),g=l.useCallback(v=>Promise.all(v.map(y=>h(y))),[h]),p=l.useCallback(()=>{n.current.forEach(v=>v.worker.terminate()),n.current=[],o.current=[],i.current&&window.clearTimeout(i.current)},[]),m=l.useCallback(()=>({total:n.current.length,busy:n.current.filter(v=>v.busy).length,idle:n.current.filter(v=>!v.busy).length,queued:o.current.length}),[]);return l.useEffect(()=>()=>{p()},[p]),{execute:h,executeAll:g,terminateAll:p,getStats:m}}function $f(e){const t=`
122
+ HTML:`}],{temperature:.3}),c=i.content.match(/```html?\n?([\s\S]*?)```/);return c?c[1].trim():i.content.trim()}finally{r(!1)}},[e]);return{improveText:a,translate:n,generateHtml:o,isLoading:t}}class pt{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 Mu(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 En(e,t){if(t.items.length===0)return!0;const r=a=>a.type==="condition"?Mu(e,a):En(e,a);return t.logic==="and"?t.items.every(r):t.items.some(r)}function Tu(e,t){var n;let r=[...e];if(t.filter&&(r=r.filter(o=>En(o,t.filter))),t.search){const o=t.search.toLowerCase(),s=t.searchFields;r=r.filter(i=>(s?s.map(d=>i[d]):Object.values(i)).some(d=>String(d??"").toLowerCase().includes(o)))}const a=r.length;if((n=t.sort)!=null&&n.length&&r.sort((o,s)=>{for(const i of t.sort){const c=o[i.field]??"",d=s[i.field]??"",u=typeof c=="number"&&typeof d=="number"?c-d:String(c).localeCompare(String(d));if(u!==0)return i.direction==="desc"?-u:u}return 0}),t.skip!=null||t.take!=null){const o=t.skip??0,s=t.take??r.length;r=r.slice(o,o+s)}return{data:r,totalCount:a}}function Iu(e){const t=e.keyField??"id";let r=[...e.data];const a=new pt;return{keyField:t,writable:!0,async load(o={}){a.emit("loading",!0);try{const s=Tu(r,o);return a.emit("loaded",s),a.emit("loading",!1),s}catch(s){throw a.emit("error",s instanceof Error?s:new Error(String(s))),a.emit("loading",!1),s}},async byKey(o){return r.find(s=>s[t]===o)},async insert(o){const s={...o};return r=[...r,s],a.emit("changed"),s},async update(o,s){const i=r.findIndex(d=>d[t]===o);if(i===-1)throw new Error(`Record not found: ${o}`);const c={...r[i],...s};return r=r.map((d,u)=>u===i?c:d),a.emit("changed"),c},async remove(o){r=r.filter(s=>s[t]!==o),a.emit("changed")},on:a.on.bind(a)}}async function Ru(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 St(e,t,r){return typeof e=="function"?e(r):e||`${t}/${encodeURIComponent(String(r))}`}function Lu(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(o=>`${o.field} ${o.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 Fu(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 Nn(e){const t=e.keyField??"id",r=new pt;async function a(o,s){const i=await Ru(e),c=await fetch(o,{...e.fetchOptions,...s,headers:{...i,...s==null?void 0:s.headers}});if(!c.ok){const u=await c.text().catch(()=>c.statusText);throw new Error(`HTTP ${c.status}: ${u}`)}return(c.headers.get("content-type")??"").includes("json")?c.json():c.text()}return{keyField:t,writable:!0,async load(o={}){var s;r.emit("loading",!0);try{const i=e.loadUrl??e.url,c=e.mapLoadParams?e.mapLoadParams(o):Lu(o),d=new URLSearchParams(c).toString(),u=d?`${i}?${d}`:i,f=await a(u),b=e.extractLoadResult?e.extractLoadResult(f):Fu(f);return r.emit("loaded",b),r.emit("loading",!1),b}catch(i){const c=i instanceof Error?i:new Error(String(i));throw r.emit("error",c),r.emit("loading",!1),(s=e.onError)==null||s.call(e,c,"load"),c}},async byKey(o){const s=St(e.byKeyUrl,e.url,o),i=await a(s);return e.extractItem?e.extractItem(i):i},async insert(o){const s=e.insertUrl??e.url,i=e.prepareInsertBody?e.prepareInsertBody(o):o,c=await a(s,{method:"POST",body:JSON.stringify(i)}),d=e.extractItem?e.extractItem(c):c;return r.emit("changed"),d},async update(o,s){const i=St(e.updateUrl,e.url,o),c=e.prepareUpdateBody?e.prepareUpdateBody(o,s):s,d=await a(i,{method:e.updateMethod??"PUT",body:JSON.stringify(c)}),u=e.extractItem?e.extractItem(d):d;return r.emit("changed"),u},async remove(o){const s=St(e.deleteUrl,e.url,o);await a(s,{method:"DELETE"}),r.emit("changed")},on:r.on.bind(r)}}function Du(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 An(e,t){return e.items.length===0?"":e.items.map(a=>a.type==="condition"?Du(a,t):`(${An(a,t)})`).join(e.logic==="and"?" and ":" or ")}function Pu(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 o,s,i;const n={};if(t>=4&&(n.$count="true"),a.skip!=null&&(n.$skip=String(a.skip)),a.take!=null&&(n.$top=String(a.take)),(o=a.sort)!=null&&o.length&&(n.$orderby=a.sort.map(c=>`${c.field} ${c.direction}`).join(",")),a.filter){const c=An(a.filter,t);c&&(n.$filter=c)}return a.search&&(n.$search=`"${a.search}"`),(s=a.select)!=null&&s.length&&(n.$select=a.select.join(",")),(i=a.expand)!=null&&i.length&&(n.$expand=a.expand.join(",")),n},extractLoadResult(a){var i,c;const n=a,o=n.value??((i=n.d)==null?void 0:i.results)??[],s=n["@odata.count"]??((c=n.d)==null?void 0:c.__count)??o.length;return{data:o,totalCount:s}},byKeyUrl:a=>{const n=typeof a=="number"?a:`'${String(a).replace(/'/g,"''")}'`;return`${e.url}(${n})`}};return Nn(r)}function $u(e){const t=e.keyField??"id",r=new pt;async function a(c,d){var g;const u={"Content-Type":"application/json"},f=e.headers?typeof e.headers=="function"?await e.headers():e.headers:{},b=await fetch(e.url,{method:"POST",headers:{...u,...f},body:JSON.stringify({query:c,variables:d})});if(!b.ok){const p=await b.text().catch(()=>b.statusText);throw new Error(`GraphQL HTTP ${b.status}: ${p}`)}const h=await b.json();if((g=h.errors)!=null&&g.length)throw new Error(h.errors.map(p=>p.message).join("; "));return h.data}function n(c){var u;const d={};return c.skip!=null&&(d.skip=c.skip),c.take!=null&&(d.take=c.take),c.search&&(d.search=c.search),(u=c.sort)!=null&&u.length&&(d.sort=c.sort),c.filter&&(d.filter=c.filter),d}function o(c){if(!c||typeof c!="object")return{data:[],totalCount:0};const d=Object.values(c)[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 s(c){return!c||typeof c!="object"?c:Object.values(c)[0]}return{keyField:t,writable:!!(e.queries.insert||e.queries.update||e.queries.remove),async load(c={}){var d;r.emit("loading",!0);try{const u=e.mapVariables?e.mapVariables(c):n(c),f=await a(e.queries.load,u),b=e.extractLoadResult?e.extractLoadResult(f):o(f);return r.emit("loaded",b),r.emit("loading",!1),b}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(c){if(!e.queries.byKey)throw new Error("byKey query not configured");const d=await a(e.queries.byKey,{[t]:c});return e.extractItem?e.extractItem(d):s(d)},insert:e.queries.insert?async c=>{const d=await a(e.queries.insert,{input:c}),u=e.extractItem?e.extractItem(d):s(d);return r.emit("changed"),u}:void 0,update:e.queries.update?async(c,d)=>{const u=await a(e.queries.update,{[t]:c,input:d}),f=e.extractItem?e.extractItem(u):s(u);return r.emit("changed"),f}:void 0,remove:e.queries.remove?async c=>{await a(e.queries.remove,{[t]:c}),r.emit("changed")}:void 0,on:r.on.bind(r)}}function zu(e){const t=e.keyField??"id",r=new pt;return{keyField:t,writable:!!(e.insert||e.update||e.remove),async load(n={}){r.emit("loading",!0);try{const o=await e.load(n);return r.emit("loaded",o),r.emit("loading",!1),o}catch(o){const s=o instanceof Error?o:new Error(String(o));throw r.emit("error",s),r.emit("loading",!1),s}},async byKey(n){if(!e.byKey)throw new Error("byKey handler not configured");return e.byKey(n)},insert:e.insert?async n=>{const o=await e.insert(n);return r.emit("changed"),o}:void 0,update:e.update?async(n,o)=>{const s=await e.update(n,o);return r.emit("changed"),s}:void 0,remove:e.remove?async n=>{await e.remove(n),r.emit("changed")}:void 0,on:r.on.bind(r)}}function Mn(e){return/^[A-Za-z_][A-Za-z0-9_.]*$/.test(e)?e:`"${e.replace(/"/g,'""')}"`}function Hu(e,t={}){const r=[],a=t.placeholder??(()=>"?"),n=t.quoteField??Mn,o=c=>(r.push(c),a(r.length-1)),s=c=>{const d=n(c.field);switch(c.operator){case"=":case"<>":case"<":case"<=":case">":case">=":return`${d} ${c.operator} ${o(c.value)}`;case"contains":return`${d} LIKE ${o(`%${String(c.value)}%`)}`;case"notcontains":return`${d} NOT LIKE ${o(`%${String(c.value)}%`)}`;case"startswith":return`${d} LIKE ${o(`${String(c.value)}%`)}`;case"endswith":return`${d} LIKE ${o(`%${String(c.value)}`)}`;case"between":{const u=Array.isArray(c.value)?c.value:[c.value,c.value];return`${d} BETWEEN ${o(u[0])} AND ${o(u[1])}`}case"isblank":return`(${d} IS NULL OR ${d} = ${o("")})`;case"isnotblank":return`(${d} IS NOT NULL AND ${d} <> ${o("")})`;case"in":{const u=Array.isArray(c.value)?c.value:[c.value];return u.length?`${d} IN (${u.map(o).join(", ")})`:"1 = 0"}default:return`${d} = ${o(c.value)}`}},i=c=>{const d=[];for(const u of c.items)if(u.type==="group"){const f=i(u);f&&d.push(`(${f})`)}else d.push(s(u));return d.join(c.logic==="or"?" OR ":" AND ")};return{sql:i(e),params:r}}function _u(e,t={}){const r=t.quoteField??Mn;return e.filter(a=>a.field).map(a=>`${r(a.field)} ${a.direction==="desc"?"DESC":"ASC"}`).join(", ")}function ne(e){return String(e??"").toLowerCase()}function Tn(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 ne(r).includes(ne(a));case"notcontains":return!ne(r).includes(ne(a));case"startswith":return ne(r).startsWith(ne(a));case"endswith":return ne(r).endsWith(ne(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(o=>r==o);default:return!0}}function fr(e,t){if(!t.items.length)return!0;const r=a=>a.type==="condition"?Tn(e,a):fr(e,a);return t.logic==="or"?t.items.some(r):t.items.every(r)}function Bu(e,t){return t!=null&&t.groups?e.group?t.groups.includes(e.group):t.includeUngrouped===!0:!0}function Or(e){return e==null||e===""}const Ou=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function ju(e){const t=String(e);try{return new URL(t),!0}catch{return/^https?:\/\/[^\s]+$/.test(t)}}function X(e){return typeof e=="number"?e:parseFloat(String(e))}function In(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 Rn(e,t){const r=t[e.field];if(e.op==="required")return!Or(r);if(Or(r))return!0;const a=e.compareField!=null?t[e.compareField]:void 0;switch(e.op){case"minLength":return String(r).length>=X(e.value);case"maxLength":return String(r).length<=X(e.value);case"min":return X(r)>=X(e.value);case"max":return X(r)<=X(e.value);case"pattern":try{return new RegExp(String(e.value)).test(String(r))}catch{return!0}case"email":return Ou.test(String(r));case"url":return ju(r);case"equals":return r===e.value;case"notEquals":return r!==e.value;case"greaterThan":return X(r)>X(e.value);case"lessThan":return X(r)<X(e.value);case"matchesField":return r===a;case"greaterThanField":return X(r)>X(a);case"lessThanField":return X(r)<X(a);case"custom":return e.validate?e.validate(r,t):!0;default:return!0}}function Ln(e,t,r){const a=[];for(const n of e??[])Bu(n,r)&&(n.when&&!fr(t,n.when)||Rn(n,t)||a.push({field:n.field,message:n.message??In(n),severity:n.severity??"error",ruleId:n.id}));return a}function Wu(e,t,r){return Ln(e,t,r).every(a=>a.severity!=="error")}class Dt{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 Fn{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 Vu(e,t={}){const r=new Dt(t),a=new Dt(t),n=new Fn,o=t.generateKey??(c=>JSON.stringify(c)),s=t.cacheLoads!==!1,i=t.cacheByKey!==!1;return{...e,cache:r,async load(c={}){const d=`load:${o(c)}`;if(s){const u=r.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.load(c);return s&&r.set(d,u),u})},async byKey(c){const d=`byKey:${String(c)}`;if(i){const u=a.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.byKey(c);return i&&u&&a.set(d,u),u})},async insert(c){const d=await e.insert(c);return r.invalidateAll(),d},async update(c,d){const u=await e.update(c,d);return r.invalidateAll(),a.invalidate(`byKey:${String(c)}`),u},async remove(c){await e.remove(c),r.invalidateAll(),a.invalidate(`byKey:${String(c)}`)},invalidateCache(){r.invalidateAll(),a.invalidateAll()}}}function Uu(e,t){const{cursorField:r,pageSize:a=20,direction:n="asc"}=t;return{async loadPage(o={}){var m;const s=o.pageSize??a,i=o.direction??"forward",c=o.cursor?{type:"condition",field:r,operator:i==="forward"?n==="asc"?">":"<":n==="asc"?"<":">",value:Ku(o.cursor)}:null,d=c?{type:"group",logic:"and",items:[...((m=o.filter)==null?void 0:m.items)??[],c]}:o.filter,u=[{field:r,direction:i==="forward"?n:n==="asc"?"desc":"asc"},...o.sort??[]],f=await e.load({...o,filter:d,sort:u,take:s+1}),b=f.data.length>s,h=b?f.data.slice(0,s):f.data;i==="backward"&&h.reverse();const g=h[h.length-1],p=h[0];return{data:h,nextCursor:b&&g?xt(g[r]):null,prevCursor:p&&o.cursor?xt(p[r]):null,hasMore:b}},async*loadAll(o={}){let s=null;do{const i=await e.load({...o,...s?{cursor:s}:{}});if(i.data.length===0)break;yield i.data;const c=i.data[i.data.length-1];s=c?xt(c[r]):null}while(s)}}}function xt(e){return btoa(JSON.stringify(e))}function Ku(e){try{return JSON.parse(atob(e))}catch{return e}}function Gu(e,t={}){const{pageSize:r=50,threshold:a=200,initialPage:n=0}=t;let o={items:[],isLoading:!1,hasMore:!0,error:null,page:n,totalCount:0};const s=new Set;function i(){s.forEach(h=>h(o))}function c(h){o={...o,...h},i()}let d={};async function u(){if(!(o.isLoading||!o.hasMore)){c({isLoading:!0,error:null});try{const h=await e.load({...d,skip:o.page*r,take:r}),g=[...o.items,...h.data],p=g.length<h.totalCount;c({items:g,page:o.page+1,totalCount:h.totalCount,hasMore:p,isLoading:!1})}catch(h){c({error:h instanceof Error?h:new Error(String(h)),isLoading:!1})}}}function f(h={}){d=h,o={items:[],isLoading:!1,hasMore:!0,error:null,page:0,totalCount:0},i()}function b(h){const g=h.target;if(!g)return;g.scrollHeight-g.scrollTop-g.clientHeight<a&&u()}return{get state(){return o},loadMore:u,reset:f,handleScroll:b,subscribe(h){return s.add(h),()=>s.delete(h)},setOptions(h){d=h}}}function Xu(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:o=10,heartbeatInterval:s=3e4}=e;let i=null,c=0,d=null,u=[];const f=new Map;function b(k,...C){var N;(N=f.get(k))==null||N.forEach(M=>M(...C))}function h(k){if(e.parseMessage)return e.parseMessage(k);try{return JSON.parse(k.data)}catch{return null}}function g(k){return e.serializeMessage?e.serializeMessage(k):JSON.stringify(k)}function p(k){switch(k.type){case"insert":k.data&&(u=[...u,k.data],b("changed"));break;case"update":k.key&&k.changes&&(u=u.map(C=>C[a]===k.key?{...C,...k.changes}:C),b("changed"));break;case"remove":k.key&&(u=u.filter(C=>C[a]!==k.key),b("changed"));break;case"refresh":case"sync":E.load().catch(()=>{});break}}function m(){(i==null?void 0:i.readyState)!==WebSocket.OPEN&&(i=new WebSocket(t),i.onopen=()=>{c=0,b("connected"),y()},i.onmessage=k=>{const C=h(k);C&&(p(C),b("message",C))},i.onerror=k=>{b("error",new Error("WebSocket error"))},i.onclose=()=>{S(),b("disconnected"),c<o&&(c++,setTimeout(m,n*Math.min(c,5)))})}function v(){S(),i&&(i.close(),i=null)}function y(){S(),d=window.setInterval(()=>{(i==null?void 0:i.readyState)===WebSocket.OPEN&&i.send(JSON.stringify({type:"ping"}))},s)}function S(){d&&(clearInterval(d),d=null)}function w(k){(i==null?void 0:i.readyState)===WebSocket.OPEN&&i.send(g(k))}const E={keyField:a,writable:r.writable,async load(k={}){b("loading",!0);try{const C=await r.load(k);return u=C.data,b("loaded",C),b("loading",!1),C}catch(C){throw b("error",C),b("loading",!1),C}},async byKey(k){const C=u.find(N=>N[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 N=await r.update(k,C);return w({type:"update",key:k,changes:C}),N},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 N;return(N=f.get(k))==null?void 0:N.delete(C)}},connect:m,disconnect:v,isConnected:()=>(i==null?void 0:i.readyState)===WebSocket.OPEN,sendMessage:w};return E}function qu(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 o=[];const s=new Map;function i(f,...b){var h;(h=s.get(f))==null||h.forEach(g=>g(...b))}const c=f=>{o=[...o,f],i("changed")},d=(f,b)=>{o=o.map(h=>h[n]===f?{...h,...b}:h),i("changed")},u=f=>{o=o.filter(b=>b[n]!==f),i("changed")};return{keyField:n,writable:r.writable,async load(f={}){i("loading",!0);try{const b=await r.load(f);return o=b.data,i("loaded",b),i("loading",!1),b}catch(b){throw i("error",b),i("loading",!1),b}},async byKey(f){const b=o.find(h=>h[n]===f);return b||r.byKey(f)},async insert(f){return await t.invoke(a.insert,f)},async update(f,b){return await t.invoke(a.update,f,b)},async remove(f){await t.invoke(a.remove,f)},on(f,b){return s.has(f)||s.set(f,new Set),s.get(f).add(b),()=>{var h;return(h=s.get(f))==null?void 0:h.delete(b)}},async connect(){t.on(a.onInsert,c),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,c),t.off(a.onUpdate,d),t.off(a.onRemove,u),t.off(a.onRefresh,()=>{}),await t.stop()}}}function Yu(e,t={}){const r=e.keyField;let a=[];const n=new Map;let o=0;const s=new Map;function i(d,...u){var f;(f=s.get(d))==null||f.forEach(b=>b(...u))}function c(){return`op_${++o}_${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 b,h,g;const u=c(),f={...d};a=[...a,f],n.set(u,{id:u,action:"insert",item:f}),(b=t.onOptimisticApply)==null||b.call(t,f,"insert"),i("changed");try{const p=await e.insert(d);return a=a.map(m=>m===f?p:m),n.delete(u),(h=t.onConfirm)==null||h.call(t,p,"insert"),i("changed"),p}catch(p){throw a=a.filter(m=>m!==f),n.delete(u),(g=t.onRollback)==null||g.call(t,f,"insert",p instanceof Error?p:new Error(String(p))),i("changed"),p}},async update(d,u){var p,m,v;const f=c(),b=a.findIndex(y=>y[r]===d);if(b===-1)return e.update(d,u);const h=a[b],g={...h,...u};a=a.map((y,S)=>S===b?g:y),n.set(f,{id:f,action:"update",key:d,originalItem:h}),(p=t.onOptimisticApply)==null||p.call(t,g,"update"),i("changed");try{const y=await e.update(d,u);return a=a.map((S,w)=>w===b?y:S),n.delete(f),(m=t.onConfirm)==null||m.call(t,y,"update"),i("changed"),y}catch(y){throw a=a.map((S,w)=>w===b?h:S),n.delete(f),(v=t.onRollback)==null||v.call(t,h,"update",y instanceof Error?y:new Error(String(y))),i("changed"),y}},async remove(d){var b,h,g;const u=c(),f=a.find(p=>p[r]===d);if(!f)return e.remove(d);a=a.filter(p=>p!==f),n.set(u,{id:u,action:"remove",key:d,originalItem:f}),(b=t.onOptimisticApply)==null||b.call(t,f,"remove"),i("changed");try{await e.remove(d),n.delete(u),(h=t.onConfirm)==null||h.call(t,f,"remove")}catch(p){throw a=[...a,f],n.delete(u),(g=t.onRollback)==null||g.call(t,f,"remove",p instanceof Error?p:new Error(String(p))),i("changed"),p}},on(d,u){return s.has(d)||s.set(d,new Set),s.get(d).add(u),()=>{var f;return(f=s.get(d))==null?void 0:f.delete(u)}},hasPendingChanges:()=>n.size>0,getPendingCount:()=>n.size}}function Dn(e,t,r){const a=new Map(e.map(d=>[d[r],d])),n=new Map(t.map(d=>[d[r],d])),o=[],s=[],i=[],c=[];for(const[d,u]of n){const f=a.get(d);if(!f)o.push(u);else if(Pn(f,u))c.push(u);else{const b={};for(const h of Object.keys(u))f[h]!==u[h]&&(b[h]=u[h]);s.push({key:d,changes:b,oldItem:f,newItem:u})}}for(const[d,u]of a)n.has(d)||i.push(u);return{inserted:o,updated:s,removed:i,unchanged:c}}function Pn(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 o of n)if(!Pn(r[o],a[o]))return!1;return!0}function Ju(e,t={}){const{interval:r=5e3,autoStart:a=!1,pauseWhenHidden:n=!0,onDataChange:o}=t;let s=r,i=null,c=[],d={};const u=new Map;function f(m,...v){var y;(y=u.get(m))==null||y.forEach(S=>S(...v))}async function b(){if(!(n&&document.hidden))try{const m=await e.load(d),v=Dn(c,m.data,e.keyField);(v.inserted.length||v.updated.length||v.removed.length)&&(c=m.data,f("changed"),o==null||o(v))}catch{}}function h(){i||(i=window.setInterval(b,s))}function g(){i&&(clearInterval(i),i=null)}n&&document.addEventListener("visibilitychange",()=>{document.hidden||i&&b()});const p={...e,async load(m={}){d=m;const v=await e.load(m);return c=v.data,v},on(m,v){u.has(m)||u.set(m,new Set),u.get(m).add(v);const y=e.on(m,v);return()=>{var S;(S=u.get(m))==null||S.delete(v),y()}},startPolling:h,stopPolling:g,isPolling:()=>i!==null,setInterval(m){s=m,i&&(g(),h())}};return a&&h(),p}function Qu(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:o=10,withCredentials:s=!1}=e;let i=null,c=0,d=null,u=[];const f=new Map;function b(y,...S){var w;(w=f.get(y))==null||w.forEach(E=>E(...S))}function h(y){if(e.parseEvent)return e.parseEvent(y);try{return JSON.parse(y.data)}catch{return null}}function g(y){switch(y.type){case"insert":y.data&&(u=[...u,y.data],b("changed"));break;case"update":y.key&&y.changes&&(u=u.map(S=>S[a]===y.key?{...S,...y.changes}:S),b("changed"));break;case"remove":y.key&&(u=u.filter(S=>S[a]!==y.key),b("changed"));break;case"snapshot":Array.isArray(y.data)&&(u=y.data,b("changed"));break;case"refresh":v.load().catch(()=>{});break}}function p(){(i==null?void 0:i.readyState)!==EventSource.OPEN&&(m(),i=new EventSource(t,{withCredentials:s}),i.onopen=()=>{c=0,b("connected")},i.onmessage=y=>{const S=h(y);S&&(g(S),b("message",S))},i.onerror=()=>{if(b("error",new Error("SSE connection error")),(i==null?void 0:i.readyState)===EventSource.CLOSED&&(b("disconnected"),i=null,c<o)){c++;const y=n*Math.min(c,5);d=setTimeout(p,y)}})}function m(){d&&(clearTimeout(d),d=null),i&&(i.close(),i=null)}const v={keyField:a,writable:r.writable,async load(y={}){b("loading",!0);try{const S=await r.load(y);return u=S.data,b("loaded",S),b("loading",!1),S}catch(S){throw b("error",S),b("loading",!1),S}},async byKey(y){const S=u.find(w=>w[a]===y);return S||r.byKey(y)},async insert(y){return r.insert(y)},async update(y,S){return r.update(y,S)},async remove(y){return r.remove(y)},on(y,S){return f.has(y)||f.set(y,new Set),f.get(y).add(S),()=>{var w;return(w=f.get(y))==null?void 0:w.delete(S)}},connect:p,disconnect:m,isConnected:()=>(i==null?void 0:i.readyState)===EventSource.OPEN};return v}function se(e,t){const r={};for(const a of t){const n=e.map(s=>s[a.field]).filter(s=>s!=null),o=a.alias??`${a.fn}_${a.field}`;switch(a.fn){case"sum":r[o]=n.reduce((s,i)=>Number(s)+Number(i),0);break;case"avg":r[o]=n.length?n.reduce((s,i)=>Number(s)+Number(i),0)/n.length:0;break;case"min":r[o]=n.length?Math.min(...n.map(Number)):null;break;case"max":r[o]=n.length?Math.max(...n.map(Number)):null;break;case"count":r[o]=n.length;break;case"first":r[o]=n[0]??null;break;case"last":r[o]=n[n.length-1]??null;break;case"distinct":r[o]=[...new Set(n)];break}}return r}function mr(e,t){const{groupBy:r,aggregates:a=[],includeItems:n=!1,sortGroups:o}=t;if(r.length===0)return[{key:{},count:e.length,aggregates:se(e,a),items:n?e:void 0}];const s=new Map;for(const c of e){const d={};for(const f of r)d[f]=c[f];const u=JSON.stringify(d);s.has(u)||s.set(u,{key:d,items:[]}),s.get(u).items.push(c)}const i=[];for(const[,c]of s)i.push({key:c.key,count:c.items.length,aggregates:se(c.items,a),items:n?c.items:void 0});return o!=null&&o.length&&i.sort((c,d)=>{for(const u of o){const f=c.key[u.field]??c.aggregates[u.field],b=d.key[u.field]??d.aggregates[u.field],h=typeof f=="number"&&typeof b=="number"?f-b:String(f??"").localeCompare(String(b??""));if(h!==0)return u.direction==="desc"?-h:h}return 0}),i}function $n(e,t,r=[]){if(t.length===0)return[{key:{},count:e.length,aggregates:se(e,r),items:e}];const[a,...n]=t,o=mr(e,{groupBy:[a],aggregates:r,includeItems:!0});if(n.length>0)for(const s of o)s.groups=$n(s.items,n,r),delete s.items;return o}function Zu(e,t){const{rows:r,columns:a,values:n,aggregateFunction:o="sum",rowTotals:s=!0,columnTotals:i=!0,grandTotal:c=!0}=t,d=[...new Set(e.map(g=>String(g[a])))].sort(),u=mr(e,{groupBy:r,includeItems:!0}),f=[];for(const g of u){const p={rowKey:g.key,values:{}};for(const m of d){const v=g.items.filter(S=>String(S[a])===m),y=se(v,[{field:n,fn:o}]);p.values[m]=y[`${o}_${n}`]??null}if(s){const m=se(g.items,[{field:n,fn:o}]);p.rowTotal=m[`${o}_${n}`]}f.push(p)}let b;if(i){b={};for(const g of d){const p=e.filter(v=>String(v[a])===g),m=se(p,[{field:n,fn:o}]);b[g]=m[`${o}_${n}`]}}let h;return c&&(h=se(e,[{field:n,fn:o}])[`${o}_${n}`]),{columnHeaders:d,rows:f,columnTotals:b,grandTotal:h}}function ef(e,t){return e.map((r,a)=>{const n={...r};for(const o of t)n[o.name]=o.formula(r,a,e);return n})}const tf={runningSum:e=>(t,r,a)=>a.slice(0,r+1).reduce((n,o)=>n+Number(o[e]??0),0),runningAvg:e=>(t,r,a)=>{const n=a.slice(0,r+1);return n.reduce((o,s)=>o+Number(s[e]??0),0)/n.length},percentOfTotal:e=>(t,r,a)=>{const n=a.reduce((o,s)=>o+Number(s[e]??0),0);return n?Number(t[e]??0)/n*100:0},rank:(e,t="desc")=>(r,a,n)=>[...n].sort((s,i)=>{const c=Number(s[e]??0)-Number(i[e]??0);return t==="desc"?-c:c}).findIndex(s=>s===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 o=Math.max(0,a-t+1),s=n.slice(o,a+1);return s.reduce((i,c)=>i+Number(c[e]??0),0)/s.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 rf(e,t){const r=[],a=new Map,n=new Map;for(let i=0;i<e.length;i++){const c=e[i];for(const d of t)if(!d.validate(c,i,e)){const u=typeof d.message=="function"?d.message(c):d.message,f={index:i,rule:d.name,message:u,severity:d.severity??"error",fields:d.fields??[],item:c};r.push(f),a.has(i)||a.set(i,[]),a.get(i).push(f);for(const b of f.fields)n.has(b)||n.set(b,[]),n.get(b).push(f)}}const o=r.filter(i=>i.severity==="error").length,s=r.filter(i=>i.severity==="warning").length;return{isValid:o===0,errorCount:o,warningCount:s,errors:r,byIndex:a,byField:n}}const af={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(o=>o[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})},nf=(function(){return{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,o=[],s=[];let i=0;if(a)for(let c=0;c<e.length;c+=n){const d=e.slice(c,c+n),u=await Promise.allSettled(d.map((f,b)=>t(f,c+b)));for(let f=0;f<u.length;f++){const b=u[f];b.status==="fulfilled"?(o.push(b.value),i++):s.push({index:c+f,item:d[f],error:b.reason})}}else for(let c=0;c<e.length;c++)try{const d=await t(e[c],c);o.push(d),i++}catch(d){s.push({index:c,item:e[c],error:d instanceof Error?d:new Error(String(d))})}return{succeeded:i,failed:s.length,errors:s,results:o}},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:o=!0}=a,s=new Map(e.map(c=>[c[r],c])),i=[...e];for(const c of t){const d=c[r],u=s.get(d);if(u){if(n){const f=i.indexOf(u);i[f]={...u,...c}}}else o&&i.push(c)}return i}}})();function of(e,t){const r=(t==null?void 0:t.autoLoad)??!0,a=(t==null?void 0:t.defaultPageSize)??20,[n,o]=l.useState([]),[s,i]=l.useState(0),[c,d]=l.useState(!1),[u,f]=l.useState(null),[b,h]=l.useState(1),[g,p]=l.useState(a),[m,v]=l.useState((t==null?void 0:t.defaultSort)??[]),[y,S]=l.useState(t==null?void 0:t.defaultFilter),[w,E]=l.useState((t==null?void 0:t.defaultSearch)??""),k=l.useRef(0),C=t==null?void 0:t.loadOptions,N=l.useCallback(async()=>{if(!e)return;const L=++k.current;d(!0),f(null);try{const F=await e.load({skip:(b-1)*g,take:g,sort:m.length?m:void 0,filter:y,search:w||void 0,...C});if(L!==k.current)return;o(F.data),i(F.totalCount)}catch(F){if(L!==k.current)return;f(F instanceof Error?F.message:String(F))}finally{L===k.current&&d(!1)}},[e,b,g,m,y,w,C]);l.useEffect(()=>{r&&N()},[N,r]),l.useEffect(()=>{if(e)return e.on("changed",()=>{N()})},[e,N]);const M=l.useCallback((L,F)=>{v([{field:L,direction:F}]),h(1)},[]),T=l.useCallback(L=>{S(L),h(1)},[]),P=l.useCallback(L=>{E(L),h(1)},[]),$=l.useCallback(L=>{p(L),h(1)},[]),z=l.useCallback(async L=>{if(!(e!=null&&e.insert))throw new Error("DataSource is not writable");await e.insert(L)},[e]),_=l.useCallback(async(L,F)=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");await e.update(L,F)},[e]),R=l.useCallback(async L=>{if(!(e!=null&&e.remove))throw new Error("DataSource is not writable");await e.remove(L)},[e]);return{data:n,totalCount:s,loading:c,error:u,page:b,pageSize:g,sort:m,filter:y,search:w,setPage:h,setPageSize:$,setSort:v,setSortField:M,setFilter:T,setSearch:P,reload:N,insert:z,update:_,remove:R}}function zn(e,t){const[r,a]=l.useState(void 0),[n,o]=l.useState({}),[s,i]=l.useState(!1),[c,d]=l.useState(null),u=l.useRef(0),f=l.useCallback(async()=>{if(!e||t==null){a(void 0);return}const y=++u.current;i(!0),d(null);try{const S=await e.byKey(t);if(y!==u.current)return;a(S),o({})}catch(S){if(y!==u.current)return;d(S instanceof Error?S.message:String(S))}finally{y===u.current&&i(!1)}},[e,t]);l.useEffect(()=>{f()},[f]),l.useEffect(()=>{if(e)return e.on("changed",()=>{f()})},[e,f]);const b=l.useMemo(()=>({...r??{},...n}),[r,n]),h=Object.keys(n).length>0,g=l.useCallback((y,S)=>{o(w=>({...w,[y]:S}))},[]),p=l.useCallback(y=>{o(S=>({...S,...y}))},[]),m=l.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=l.useCallback(()=>{o({})},[]);return{data:r,editData:b,loading:s,error:c,changes:n,isDirty:h,set:g,setMany:p,save:m,reload:f,reset:v}}function sf(e,t,r){const a=zn(e,t),n=a.editData[r],o=l.useCallback(i=>{a.set(r,i)},[a,r]),s=l.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");const i={[r]:a.editData[r]};await e.update(t,i)},[e,t,r,a.editData]);return{value:n,setValue:o,loading:a.loading,error:a.error,isDirty:r in a.changes,save:s}}function cf(e,t,r,a){const n=(a==null?void 0:a.autoLoad)??!0,o=(a==null?void 0:a.take)??200,[s,i]=l.useState([]),[c,d]=l.useState(!1),[u,f]=l.useState(null),b=l.useRef(0),h=l.useCallback(async m=>{if(!e)return;const v=++b.current;d(!0),f(null);try{const y=await e.load({take:o,search:m||void 0,searchFields:a==null?void 0:a.searchFields});if(v!==b.current)return;i(y.data)}catch(y){if(v!==b.current)return;f(y instanceof Error?y.message:String(y))}finally{v===b.current&&d(!1)}},[e,o,a==null?void 0:a.searchFields]);l.useEffect(()=>{n&&h()},[h,n]);const g=l.useMemo(()=>s.map(m=>{const v=m,y={value:String(v[t]??""),label:String(v[r]??"")};return a!=null&&a.iconField&&v[a.iconField]!=null&&(y.icon=v[a.iconField]),a!=null&&a.descriptionField&&v[a.descriptionField]!=null&&(y.description=String(v[a.descriptionField])),a!=null&&a.groupField&&v[a.groupField]!=null&&(y.group=String(v[a.groupField])),y}),[s,t,r,a==null?void 0:a.iconField,a==null?void 0:a.descriptionField,a==null?void 0:a.groupField]),p=l.useCallback(m=>{h(m)},[h]);return{options:g,loading:c,error:u,search:p,reload:()=>h()}}function Pt(e){const{dbName:t,storeName:r,keyField:a="id",version:n=1,indexes:o=[]}=e;let s=null;const i=new Map;function c(g,...p){var m;(m=i.get(g))==null||m.forEach(v=>v(...p))}async function d(){return s||new Promise((g,p)=>{const m=indexedDB.open(t,n);m.onerror=()=>p(m.error),m.onsuccess=()=>{s=m.result,g(s)},m.onupgradeneeded=v=>{const y=v.target.result;if(!y.objectStoreNames.contains(r)){const S=y.createObjectStore(r,{keyPath:a});for(const w of o)S.createIndex(w.name,w.keyPath,{unique:w.unique??!1})}}})}async function u(g,p){const m=await d();return new Promise((v,y)=>{const w=m.transaction(r,g).objectStore(r),E=p(w);E.onsuccess=()=>v(E.result),E.onerror=()=>y(E.error)})}async function f(g,p,m){const v=await d();return new Promise((y,S)=>{var _;const E=v.transaction(r,g).objectStore(r),k=[];let C=E,N="next";if((_=p.sort)!=null&&_.length){const R=p.sort[0].field,L=p.sort[0].direction;E.indexNames.contains(R)&&(C=E.index(R)),N=L==="desc"?"prev":"next"}const M=C.openCursor(null,N);let T=0,P=0;const $=p.skip??0,z=p.take??1/0;M.onsuccess=()=>{const R=M.result;if(!R||P>=z){y(k);return}const L=R.value;if(p.filter&&!b(L,p.filter)){R.continue();return}if(p.search&&!h(L,p.search,p.searchFields)){R.continue();return}if(T<$){T++,R.continue();return}k.push(L),P++,R.continue()},M.onerror=()=>S(M.error)})}function b(g,p){if(!p.items.length)return!0;const m=v=>{if(v.type==="group")return b(g,v);const y=g[v.field],S=v.value;switch(v.operator){case"=":return y==S;case"<>":return y!=S;case"<":return y<S;case"<=":return y<=S;case">":return y>S;case">=":return y>=S;case"contains":return String(y??"").toLowerCase().includes(String(S??"").toLowerCase());case"notcontains":return!String(y??"").toLowerCase().includes(String(S??"").toLowerCase());case"startswith":return String(y??"").toLowerCase().startsWith(String(S??"").toLowerCase());case"endswith":return String(y??"").toLowerCase().endsWith(String(S??"").toLowerCase());case"isblank":return y==null||y==="";case"isnotblank":return y!=null&&y!=="";default:return!0}};return p.logic==="and"?p.items.every(m):p.items.some(m)}function h(g,p,m){const v=p.toLowerCase();return(m?m.map(S=>g[S]):Object.values(g)).some(S=>String(S??"").toLowerCase().includes(v))}return{keyField:a,writable:!0,async load(g={}){var p;c("loading",!0);try{const m=await f("readonly",g,()=>{});(p=g.sort)!=null&&p.length&&m.sort((S,w)=>{for(const E of g.sort){const k=S[E.field]??"",C=w[E.field]??"",N=typeof k=="number"&&typeof C=="number"?k-C:String(k).localeCompare(String(C));if(N!==0)return E.direction==="desc"?-N:N}return 0});const v=await this.count(),y={data:m,totalCount:v};return c("loaded",y),c("loading",!1),y}catch(m){throw c("error",m),c("loading",!1),m}},async byKey(g){return u("readonly",p=>p.get(g))},async insert(g){return await u("readwrite",p=>p.add(g)),c("changed"),g},async update(g,p){const m=await this.byKey(g);if(!m)throw new Error(`Record not found: ${g}`);const v={...m,...p};return await u("readwrite",y=>y.put(v)),c("changed"),v},async remove(g){await u("readwrite",p=>p.delete(g)),c("changed")},on(g,p){return i.has(g)||i.set(g,new Set),i.get(g).add(p),()=>{var m;return(m=i.get(g))==null?void 0:m.delete(p)}},async clear(){await u("readwrite",g=>g.clear()),c("changed")},async count(){return u("readonly",g=>g.count())},async getAll(){return u("readonly",g=>g.getAll())},async bulkInsert(g){const p=await d();return new Promise((m,v)=>{const y=p.transaction(r,"readwrite"),S=y.objectStore(r);for(const w of g)S.put(w);y.oncomplete=()=>{c("changed"),m()},y.onerror=()=>v(y.error)})},async bulkDelete(g){const p=await d();return new Promise((m,v)=>{const y=p.transaction(r,"readwrite"),S=y.objectStore(r);for(const w of g)S.delete(w);y.oncomplete=()=>{c("changed"),m()},y.onerror=()=>v(y.error)})},async exportData(){return this.getAll()},async importData(g){await this.clear(),await this.bulkInsert(g)}}}function lf(e){const{remoteSource:t,offlineConfig:r,syncStrategy:a="remote-first",onConflict:n,onSync:o,autoSyncInterval:s=0}=e,i=r.keyField??t.keyField,c=Pt({...r,keyField:i}),d=Pt({dbName:r.dbName,storeName:`${r.storeName}_pending`,keyField:"id"});let u=navigator.onLine,f=0;const b=new Map;function h(m,...v){var y;(y=b.get(m))==null||y.forEach(S=>S(...v))}window.addEventListener("online",()=>{u=!0,h("online"),p()}),window.addEventListener("offline",()=>{u=!1,h("offline")});async function g(m,v,y){const S={id:`pending_${++f}_${Date.now()}`,action:m,key:v,data:y,timestamp:Date.now(),retries:0};await d.insert(S)}async function p(){if(u){h("syncing",!0);try{let m=0,v=0,y=0;const S=await d.load();for(const w of S.data)try{switch(w.action){case"insert":await t.insert(w.data),m++;break;case"update":await t.update(w.key,w.data),v++;break;case"remove":await t.remove(w.key),y++;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 c.importData(w.data);else if(a==="merge"&&n){const E=await c.load(),k=new Map(E.data.map(N=>[N[i],N])),C=[];for(const N of w.data){const M=k.get(N[i]);M?C.push(n(M,N)):C.push(N)}await c.importData(C)}}h("synced",{added:m,updated:v,removed:y}),o==null||o({added:m,updated:v,removed:y})}catch(m){h("syncError",m)}finally{h("syncing",!1)}}}return s>0&&window.setInterval(p,s),{keyField:i,writable:!0,async load(m={}){if(u&&a==="remote-first")try{const v=await t.load(m);return await c.bulkInsert(v.data),v}catch{}return c.load(m)},async byKey(m){if(u)try{const v=await t.byKey(m);return v&&await c.update(m,v).catch(()=>c.insert(v)),v}catch{}return c.byKey(m)},async insert(m){const v=await c.insert(m);if(u)try{return await t.insert(m)}catch{await g("insert",void 0,m)}else await g("insert",void 0,m);return h("changed"),v},async update(m,v){const y=await c.update(m,v);if(u)try{return await t.update(m,v)}catch{await g("update",m,v)}else await g("update",m,v);return h("changed"),y},async remove(m){if(await c.remove(m),u)try{await t.remove(m)}catch{await g("remove",m)}else await g("remove",m);h("changed")},on(m,v){return b.has(m)||b.set(m,new Set),b.get(m).add(v),()=>{var y;return(y=b.get(m))==null?void 0:y.delete(v)}},sync:p,isOnline:()=>u,async getPendingChanges(){return(await d.load()).data},async clearPendingChanges(){await d.clear()}}}function df(e){const{channelName:t,source:r}=e,a=new BroadcastChannel(t),n=new Map;function o(i,...c){var d;(d=n.get(i))==null||d.forEach(u=>u(...c))}a.onmessage=i=>{const c=i.data;switch(c.type){case"insert":case"update":case"remove":o("changed"),o("crossTabChange",c);break;case"refresh":o("refresh");break;case"request-sync":r.load().then(d=>{a.postMessage({type:"sync-data",data:d.data})});break}};function s(i){a.postMessage(i)}return{...r,async insert(i){const c=await r.insert(i);return s({type:"insert",data:c}),c},async update(i,c){const d=await r.update(i,c);return s({type:"update",key:i,changes:c}),d},async remove(i){await r.remove(i),s({type:"remove",key:i})},on(i,c){n.has(i)||n.set(i,new Set),n.get(i).add(c);const d=r.on(i,c);return()=>{var u;(u=n.get(i))==null||u.delete(c),d()}},broadcast:s,requestSync(){s({type:"request-sync"})}}}function uf(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 o(i){if(a)window.location.hash=i.toString();else{const c=new URL(window.location.href);c.search=i.toString(),window.history.replaceState({},"",c.toString())}}function s(i){return t?`${t}_${i}`:i}return{read(){const i=n(),c={};if(r.filter){const d=i.get(s("filter"));if(d)try{c.filter=JSON.parse(d)}catch{}}if(r.sort){const d=i.get(s("sort"));if(d)try{c.sort=JSON.parse(d)}catch{}}if(r.page){const d=i.get(s("skip")),u=i.get(s("take"));d&&(c.skip=parseInt(d,10)),u&&(c.take=parseInt(u,10))}if(r.search){const d=i.get(s("search"));d&&(c.search=d)}return c},write(i){const c=n();r.filter&&(i.filter&&i.filter.items.length>0?c.set(s("filter"),JSON.stringify(i.filter)):c.delete(s("filter"))),r.sort&&(i.sort&&i.sort.length>0?c.set(s("sort"),JSON.stringify(i.sort)):c.delete(s("sort"))),r.page&&(i.skip?c.set(s("skip"),String(i.skip)):c.delete(s("skip")),i.take?c.set(s("take"),String(i.take)):c.delete(s("take"))),r.search&&(i.search?c.set(s("search"),i.search):c.delete(s("search"))),o(c)},clear(){const i=n();i.delete(s("filter")),i.delete(s("sort")),i.delete(s("skip")),i.delete(s("take")),i.delete(s("search")),o(i)},toLoadOptions(){const i=this.read();return{filter:i.filter,sort:i.sort,skip:i.skip,take:i.take,search:i.search}}}}const ff={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 o=0,s=0;r.replace&&"clear"in e&&await e.clear();for(const i of n){if(r.validate&&!r.validate(i)){s++;continue}try{await e.insert(i),o++}catch{s++}}return{imported:o,skipped:s}},async downloadAsJSON(e,t="export.json"){const r=await this.exportToJSON(e),a=new Blob([r],{type:"application/json"}),n=URL.createObjectURL(a),o=document.createElement("a");o.href=n,o.download=t,o.click(),URL.revokeObjectURL(n)},async importFromFile(e,t,r){const a=await t.text();return this.importFromJSON(e,a,r)}};function mf(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,o){return r()[n]??o},set(n,o){const s=r();s[n]=o,a(s)},remove(n){const o=r();delete o[n],a(o)},getAll(){return{...r()}},setAll(n){a(n)},clear(){t={},localStorage.removeItem(e)},merge(n){a({...r(),...n})}}}const _e={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Be={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},Oe={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},pr=e=>({color:e,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),Hn={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)"},pf={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:pr(n),shadows:Hn,spacing:_e,typography:Be,transitions:Oe}}function V(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:pr(n),shadows:pf,spacing:_e,typography:Be,transitions:Oe}}const _n=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"),Bn=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"),On=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"),jn=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"),Wn=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"),Vn=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"),Un=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"),Kn=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"),Gn=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"),Xn=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"),qn=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"),Yn=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"),Jn=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"),Qn=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"),Zn=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"),eo=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"),to=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"),ro=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"),ao=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"),no=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"),oo=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"),so=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"),io=V("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"),co=V("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"),lo=V("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"),uo=V("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"),fo=V("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"),mo=V("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",onPrimary:"#ffffff"},"#374151"),po=V("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"),go=V("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"),yo=V("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"),ho=V("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"),bo=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"),vo=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"),So=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"),xo=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"),wo=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"),ko=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"),Co=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"),Eo=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"),No=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"),Ao=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"),Mo=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"),To=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"),Io=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"),Ro=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"),Lo=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"),Fo=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"),Do=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"),Po=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"),$o=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"),zo=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"),Ho=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"),_o=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"),Bo=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"),Oo=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"),jo=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"),Wo=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"),Vo=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"),Uo=V("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"),Ko=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"),Go=V("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",onError:"#ffffff"},"#073642"),Xo=V("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"),qo=V("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"),Yo=V("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"),Jo=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"),Qo=V("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"),Zo=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"),es=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"),ts=V("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",onInfo:"#ffffff"},"#1c3a44"),rs=V("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"),as=V("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"),ns=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"),os=V("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",onInfo:"#ffffff"},"#5c3400"),ss=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"),is=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"),cs=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"),ls=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"),ds=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"),us=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"),fs=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"),ms=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"),ps=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"),gs=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"),ys=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"),hs=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"),bs=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"),vs=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"),Ss=V("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"),xs=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"),ws=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"),ks={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:pr("#e2e8f0"),shadows:Hn,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:Oe},Cs={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:_e,typography:Be,transitions:{fast:"150ms ease",normal:"250ms ease",slow:"350ms ease"}},Es={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:_e,typography:Be,transitions:Oe},Ns={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:_e,typography:Be,transitions:Oe},As=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"),Ms=V("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"),Ts=V("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"),Is=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"),Rs=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"),Ls=[_n,Bn,On,jn,Wn,Vn,Un,Kn,Gn,Xn,qn,Yn,Jn,Qn,Zn,eo,to,ro,ao,no,oo,so,io,co,lo,uo,fo,mo,po,go,yo,ho,bo,vo,So,xo,wo,ko,Co,Eo,No,Ao,Mo,To,Io,Ro,Lo,Fo,Do,Po,$o,zo,Ho,_o,Bo,Oo,jo,Wo,Vo,Uo,Ko,Go,Xo,qo,Yo,Jo,Qo,Zo,es,ts,rs,as,ns,os,ss,is,cs,ls,ds,us,fs,ms,ps,gs,ys,hs,bs,vs,Ss,xs,ws,ks,Cs,Es,Ns,As,Ms,Ts,Is,Rs],gf=["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"],yf={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},de={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},gr={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},Fs={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:gr,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"}},Ds={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:de,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"}},Ps={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:gr,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"}},$s={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:de,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"}},zs={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:de,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"}},Hs={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:de,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"}},_s={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:de,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"}},Bs={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:de,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"}},Os={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:gr,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"}},js={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:de,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"}},Ws={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:de,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"}},Vs={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:yf,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"}},yr={obsidianEditorial:Fs,neonArcade:Ds,hyggeScandinavian:Ps,brutalistRaw:$s,glassAurora:zs,candyPop:Hs,newspaperBroadsheet:_s,synthwave84:Bs,zenMinimal:Os,claymorphism:js,bauhaus:Ws,bankVault:Vs},hr=Object.values(yr);function hf(e){return yr[e]}function bf(e){return hr.filter(t=>t.meta.tags.includes(e))}const vf=["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"],Us={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},q={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},je={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},gt={space1:"8px",space2:"16px",space3:"24px",space4:"32px",space5:"44px",space6:"56px",space8:"80px"},Ks={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:je,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"}},Gs={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:je,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"}},Xs={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:gt,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"}},qs={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:q,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"}},Ys={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:gt,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"}},Js={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:q,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"}},Qs={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:je,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"}},Zs={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:q,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"}},ei={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:q,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"}},ti={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:q,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"}},ri={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:q,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"}},ai={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:q,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"}},ni={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:q,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"}},oi={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:q,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"}},si={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:q,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"}},ii={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:gt,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"}},ci={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:q,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"}},li={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:q,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"}},di={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:je,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"}},ui={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:q,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"}},fi={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:gt,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"}},mi={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:Us,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"}},pi={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:je,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"}},gi={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:Us,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"}},br={forestCanopy:Ks,desertDune:Gs,arcticCrystal:Xs,autumnFoliage:qs,japaneseWashi:Ys,moroccanMosaic:Js,artDecoGatsby:Qs,sovietConstructivist:Zs,blueprint:ei,hologramUI:ti,deepSea:ri,analog70s:ai,vhsTracking:ni,typewriterPress:oi,y2kAqua:si,vogueDidone:ii,comicHalftone:ci,zinePunk:li,watercolorWash:di,memphis80s:ui,inkSumie:fi,dieterRams:mi,blackTieGala:pi,swissGrid:gi},vr=Object.values(br);function Sf(e){return br[e]}function xf(e){return vr.filter(t=>t.meta.tags.includes(e))}function $t(e){return rr.some(t=>t.name.toLowerCase()===e.name.toLowerCase())?{...e,name:`${e.name} Classic`}:e}function jr(e){const t=$t(e.theme);return t===e.theme?e:{...e,meta:{...e.meta,name:t.name},theme:t}}const wt={};function Ee(e,t){return e in wt||(wt[e]=t()),wt[e]}const Ae={get core(){return Ee("core",()=>[Wa,Va,Ua,Ka,Ga].map($t))},get gallery(){return Ee("gallery",()=>Ls.map($t))},get packs(){return Ee("packs",()=>hr.map(jr))},get packsExtended(){return Ee("packsExtended",()=>vr.map(jr))},get all(){return Ee("all",()=>[...Ae.core,...Ae.gallery,...Ae.packs.map(e=>e.theme),...Ae.packsExtended.map(e=>e.theme)])}},yi=l.createContext(null);function hi(){const e=l.useContext(yi);if(!e)throw new Error("useThemeVariants must be used within NiceThemeVariantProvider");return e}function wf({initialConfig:e,storageKey:t="ntd-variant-config",autoApply:r=!0,children:a}){const[n,o]=l.useState(()=>{if(typeof window<"u"&&t){const d=localStorage.getItem(t);if(d)try{return{...te,...JSON.parse(d)}}catch{}}return{...te,...e}});l.useEffect(()=>{r&&typeof window<"u"&&Ot(n)},[n,r]),l.useEffect(()=>{typeof window<"u"&&t&&localStorage.setItem(t,JSON.stringify(n))},[n,t]);const s=l.useCallback(d=>{o(u=>({...u,...d}))},[]),i=l.useCallback(d=>{const u=tt[d];u&&o(u)},[]),c=l.useCallback(()=>{o(te)},[]);return x.jsx(yi.Provider,{value:{config:n,setConfig:s,applyPreset:i,reset:c},children:a})}function kf({showPresets:e=!0,showPreview:t=!0,showCSS:r=!1,collapsible:a=!0,className:n,style:o}){const{t:s}=W.useNiceTranslation(),{config:i,setConfig:c,applyPreset:d,reset:u}=hi(),[f,b]=l.useState(new Set(["presets","radius","shadow"])),h=p=>{a&&b(m=>{const v=new Set(m);return v.has(p)?v.delete(p):v.add(p),v})},g=p=>!a||f.has(p);return x.jsxs("div",{className:`ntd-theme-variant-configurator ${n||""}`,style:{fontFamily:"system-ui, sans-serif",fontSize:"14px",...o},children:[e&&x.jsx(J,{title:s("themeVariants.presets","Presets"),expanded:g("presets"),onToggle:()=>h("presets"),children:x.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[Object.keys(tt).map(p=>x.jsx("button",{onClick:()=>d(p),style:{padding:"6px 12px",border:"1px solid var(--nice-border-color, #e5e7eb)",borderRadius:"6px",background:"var(--nice-bg-secondary, #f9fafb)",cursor:"pointer",textTransform:"capitalize"},children:p},p)),x.jsx("button",{onClick:u,style:{padding:"6px 12px",border:"1px solid var(--nice-danger-dark, #dc2626)",borderRadius:"6px",background:"var(--nice-danger-bg, #fef2f2)",color:"var(--nice-color-error, #dc2626)",cursor:"pointer"},children:s("themeVariants.reset","Reset")})]})}),x.jsx(J,{title:s("themeVariants.borderRadius","Border Radius"),expanded:g("radius"),onToggle:()=>h("radius"),children:x.jsx(ue,{options:Object.keys(Me),value:i.radius,onChange:p=>c({radius:p}),renderPreview:p=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--nice-color-accent, #6366f1)",borderRadius:Me[p].md}})})}),x.jsx(J,{title:s("themeVariants.shadows","Shadows"),expanded:g("shadow"),onToggle:()=>h("shadow"),children:x.jsx(ue,{options:Object.keys(Xe),value:i.shadow,onChange:p=>c({shadow:p}),renderPreview:p=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--nice-bg-primary, #fff)",borderRadius:"4px",boxShadow:Xe[p]}})})}),x.jsx(J,{title:s("themeVariants.buttonStyle","Button Style"),expanded:g("button"),onToggle:()=>h("button"),children:x.jsx(ue,{options:["flat","raised","outlined","ghost","soft","gradient","3d","neumorphic"],value:i.buttonStyle,onChange:p=>c({buttonStyle:p})})}),x.jsx(J,{title:s("themeVariants.inputStyle","Input Style"),expanded:g("input"),onToggle:()=>h("input"),children:x.jsx(ue,{options:["bordered","filled","underlined","floating","soft","neumorphic"],value:i.inputStyle,onChange:p=>c({inputStyle:p})})}),x.jsx(J,{title:s("themeVariants.cardStyle","Card Style"),expanded:g("card"),onToggle:()=>h("card"),children:x.jsx(ue,{options:["flat","elevated","bordered","glass","gradient","neumorphic"],value:i.cardStyle,onChange:p=>c({cardStyle:p})})}),x.jsx(J,{title:s("themeVariants.animation","Animation"),expanded:g("animation"),onToggle:()=>h("animation"),children:x.jsx(ue,{options:Object.keys(et),value:i.animation,onChange:p=>c({animation:p})})}),x.jsx(J,{title:s("themeVariants.density","Density"),expanded:g("density"),onToggle:()=>h("density"),children:x.jsx(ue,{options:Object.keys(Fe),value:i.density,onChange:p=>c({density:p})})}),t&&x.jsx(J,{title:s("themeVariants.preview","Preview"),expanded:g("preview"),onToggle:()=>h("preview"),children:x.jsx(Cf,{config:i})}),r&&x.jsx(J,{title:s("themeVariants.generatedCss","Generated CSS"),expanded:g("css"),onToggle:()=>h("css"),children:x.jsx("pre",{style:{background:"var(--nice-text-primary, #1f2937)",color:"var(--nice-text-inverse, #e5e7eb)",padding:"12px",borderRadius:"6px",fontSize:"12px",overflow:"auto",maxHeight:"200px"},children:Bt(i)})})]})}function J({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(--nice-text-secondary, #374151)",textAlign:"left"},children:[x.jsx("span",{style:{display:"inline-flex",transform:t?"rotate(90deg)":"none",transition:"transform 150ms"},children:x.jsx(A.NiceIcon,{name:"chevron-right",size:14})}),e]}),t&&x.jsx("div",{style:{paddingLeft:"20px",paddingTop:"8px"},children:a})]})}function ue({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(--nice-border-color, #e5e7eb)",borderRadius:"6px",background:t===n?"var(--nice-primary-bg, #eef2ff)":"var(--nice-bg-primary, #fff)",cursor:"pointer",textTransform:"capitalize",fontSize:"13px"},children:[a&&a(n),n]},n))})}function Cf({config:e}){const{t}=W.useNiceTranslation(),r=zt(e.buttonStyle,"var(--nice-color-accent, #6366f1)"),a=Ht(e.inputStyle),n=_t(e.cardStyle),o=Me[e.radius],s=Fe[e.density];return x.jsxs("div",{style:{padding:"20px",background:"var(--nice-bg-secondary, #f9fafb)",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"16px"},children:[x.jsxs("div",{style:{padding:s.paddingX,borderRadius:o.lg,...n},children:[x.jsx("h4",{style:{margin:"0 0 12px",fontSize:s.fontSize},children:t("themeVariants.cardPreview","Card Preview")}),x.jsxs("div",{style:{display:"flex",gap:s.gap,marginBottom:"12px"},children:[x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:o.md,color:"var(--nice-text-primary, #fff)",fontSize:s.fontSize,cursor:"pointer",...r},children:t("themeVariants.primary","Primary")}),x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:o.md,background:"var(--nice-border-color, #e5e7eb)",border:"none",fontSize:s.fontSize,cursor:"pointer"},children:t("themeVariants.secondary","Secondary")})]}),x.jsx("input",{type:"text",placeholder:t("themeVariants.inputPreview","Input preview..."),style:{width:"100%",height:s.inputHeight,padding:`0 ${s.paddingX}`,fontSize:s.fontSize,outline:"none",boxSizing:"border-box",...a}})]}),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:o.full,background:"var(--nice-border-color, #e5e7eb)",fontSize:"12px"},children:i},i))})]})}function Ef(e){const[t,r]=l.useState(()=>typeof window>"u"?!1:Wr());return l.useEffect(()=>{var d,u,f;if(typeof window>"u")return;const a=()=>(e==null?void 0:e.current)??document.documentElement,n=()=>r(Wr(a()));n();const o=new MutationObserver(n),s={attributes:!0,attributeFilter:["data-theme","class","style"]};o.observe(document.documentElement,s);const i=(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");i&&i!==document.documentElement&&o.observe(i,s);const c=typeof window.matchMedia=="function"?window.matchMedia("(prefers-color-scheme: dark)"):null;return(f=c==null?void 0:c.addEventListener)==null||f.call(c,"change",n),()=>{var b;o.disconnect(),(b=c==null?void 0:c.removeEventListener)==null||b.call(c,"change",n)}},[e]),t}function Wr(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 o=getComputedStyle(e),s=o.getPropertyValue("--text-primary").trim()||o.color;if(s){const i=s.match(/rgba?\(([^)]+)\)/);if(i){const[c,d,u]=i[1].split(",").map(f=>parseFloat(f.trim()));return(.299*c+.587*d+.114*u)/255>.5}if(/^#([0-9a-f]{3,8})$/i.test(s)){const c=s.replace("#",""),d=c.length===3?c.split("").map(h=>h+h).join(""):c.slice(0,6),u=parseInt(d.slice(0,2),16),f=parseInt(d.slice(2,4),16),b=parseInt(d.slice(4,6),16);return(.299*u+.587*f+.114*b)/255>.5}}return((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)??!1}catch{return!1}}const Nf=["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","NiceChartRangeSelector","NiceVectorMap","NiceHeatMap","NiceTreeMap","NiceStockChart","NiceOrganizationChart","NiceActionSheet","NicePopover","NiceLoadPanel","NiceWindow","NiceBlockUI","NiceScheduler","NiceGantt","NiceDiagramViewer","NiceStepper","NiceBox","NiceResponsiveBox","NiceResizable","NiceScrollView","NiceChatWindow","NiceUpload","NiceFileManager","NiceFilterBuilder","NiceGallery","NiceMap","div","span","row","column","stack","container"];function Af(e){const t=[];bi(e.root,t,"root");const r=new Set((e.dataSources??[]).map(a=>a.id));return vi(e.root,r,t),t}function bi(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++)bi(e.children[a],t,`${r}.children[${a}]`)}function vi(e,t,r){if(e.bindings)for(const[a,n]of Object.entries(e.bindings)){const o=n.split(".")[0];!t.has(o)&&o!=="form"&&o!=="route"&&r.push(`Binding "${a}" references unknown data source "${o}"`)}if(e.children)for(const a of e.children)vi(a,t,r)}function Mf(e,t){const r=Tf(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 Tf(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 Si(e){const{itemCount:t,itemHeight:r,containerHeight:a,overscan:n=3,initialScrollTop:o=0}=e,[s,i]=l.useState(o),[c,d]=l.useState(!1),u=l.useRef(void 0),f=l.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]),b=l.useMemo(()=>typeof r=="number"?t*r:f?f[t]:0,[t,r,f]),h=l.useCallback(k=>typeof r=="number"?r:r(k),[r]),g=l.useCallback(k=>typeof r=="number"?k*r:f?f[k]:0,[r,f]),p=l.useCallback(k=>{if(typeof r=="number")return Math.floor(k/r);if(!f)return 0;let C=0,N=t-1;for(;C<=N;){const M=Math.floor((C+N)/2),T=f[M];if(T===k)return M;T<k?C=M+1:N=M-1}return Math.max(0,C-1)},[t,r,f]),{startIndex:m,endIndex:v,visibleItems:y}=l.useMemo(()=>{const k=Math.max(0,p(s)-n);let C=k,N=g(k);for(;C<t&&N<s+a;)N+=h(C),C++;C=Math.min(t,C+n);const M=[];for(let T=k;T<C;T++)M.push({index:T,offset:g(T),height:h(T),key:T});return{startIndex:k,endIndex:C,visibleItems:M}},[s,a,t,n,p,g,h]),S=l.useCallback(k=>{const C=k.currentTarget;i(C.scrollTop),d(!0),u.current&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{d(!1)},150)},[]),w=l.useCallback((k,C="start")=>{const N=g(k),M=h(k);let T;switch(C){case"center":T=N-a/2+M/2;break;case"end":T=N-a+M;break;default:T=N}i(Math.max(0,Math.min(T,b-a)))},[g,h,a,b]),E=l.useCallback(k=>{i(Math.max(0,Math.min(k,b-a)))},[b,a]);return l.useEffect(()=>()=>{u.current&&window.clearTimeout(u.current)},[]),{visibleItems:y,totalHeight:b,scrollTop:s,scrollToIndex:w,scrollTo:E,onScroll:S,startIndex:m,endIndex:v,isScrolling:c}}function If(e){const{rowCount:t,columnCount:r,rowHeight:a,columnWidth:n,containerHeight:o,containerWidth:s,overscan:i=2}=e,[c,d]=l.useState(0),[u,f]=l.useState(0),[b,h]=l.useState(!1),g=l.useRef(void 0),p=l.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]),m=l.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=l.useMemo(()=>{const S=[];let w=0,E=0;if(typeof a=="number")w=Math.floor(c/a),E=w*a;else for(;w<t&&E+a(w)<c;)E+=a(w),w++;w=Math.max(0,w-i);let k=w,C=typeof a=="number"?w*a:E;for(;k<t&&C<c+o;)C+=typeof a=="number"?a:a(k),k++;k=Math.min(t,k+i);let N=0,M=0;if(typeof n=="number")N=Math.floor(u/n),M=N*n;else for(;N<r&&M+n(N)<u;)M+=n(N),N++;N=Math.max(0,N-i);let T=N,P=typeof n=="number"?N*n:M;for(;T<r&&P<u+s;)P+=typeof n=="number"?n:n(T),T++;T=Math.min(r,T+i);let $=typeof a=="number"?w*a:(()=>{let z=0;for(let _=0;_<w;_++)z+=a(_);return z})();for(let z=w;z<k;z++){const _=typeof a=="number"?a:a(z);let R=typeof n=="number"?N*n:(()=>{let L=0;for(let F=0;F<N;F++)L+=n(F);return L})();for(let L=N;L<T;L++){const F=typeof n=="number"?n:n(L);S.push({rowIndex:z,columnIndex:L,top:$,left:R,width:F,height:_,key:`${z}:${L}`}),R+=F}$+=_}return S},[c,u,t,r,a,n,o,s,i]),y=l.useCallback(S=>{const w=S.currentTarget;d(w.scrollTop),f(w.scrollLeft),h(!0),g.current&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{h(!1)},150)},[]);return l.useEffect(()=>()=>{g.current&&window.clearTimeout(g.current)},[]),{visibleCells:v,totalWidth:m,totalHeight:p,onScroll:y,scrollTop:c,scrollLeft:u,isScrolling:b}}function Rf(e,t,r,a=3){const n=Si({itemCount:e.length,itemHeight:r,containerHeight:t,overscan:a}),o=l.useCallback(s=>e[s.index],[e]);return{...n,getItemData:o,containerStyle:{height:t,overflow:"auto"},innerStyle:{height:n.totalHeight,position:"relative"},getItemStyle:s=>({position:"absolute",top:s.offset,left:0,right:0,height:s.height})}}function Lf(e){const{items:t,searchFn:r,debounce:a=0,minLength:n=0}=e,[o,s]=l.useState(""),i=l.useDeferredValue(o),[c,d]=l.useState(""),u=l.useRef(void 0);l.useEffect(()=>{if(a>0)return u.current=window.setTimeout(()=>{d(o)},a),()=>{u.current&&window.clearTimeout(u.current)};d(o)},[o,a]);const f=l.useDeferredValue(c),b=l.useMemo(()=>f.length<n?t:t.filter(g=>r(g,f)),[t,f,r,n]);return{query:o,setQuery:s,results:b,isStale:f!==i,deferredQuery:f}}function Ff(e){const[t,r]=l.useState(e),[a,n]=l.useState(e),[o,s]=l.useTransition(),i=l.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),s(()=>{r(u)})},[t]),c=l.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),r(u)},[t]);return{value:t,pendingValue:a,isPending:o,setValue:i,setValueImmediate:c}}function Df(e){const{data:t,processFn:r,chunkSize:a=1e3,priority:n="user-visible"}=e,[o,s]=l.useState(null),[i,c]=l.useState(0),[d,u]=l.useState(!1),f=l.useRef(!1),b=l.useCallback(async()=>{if(t.length===0){s([]);return}u(!0),c(0),f.current=!1;const g=[],p=t.length;for(let m=0;m<p&&!f.current;m+=a){const v=t.slice(m,m+a),y=v.map((w,E)=>r(w,m+E));g.push(...y);const S=Math.min(100,(m+v.length)/p*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)),l.startTransition(()=>{c(S)})}s(g),u(!1),c(100)},[t,r,a,n]),h=l.useCallback(()=>{f.current=!0},[]);return l.useEffect(()=>(b(),()=>{f.current=!0}),[b]),{result:o,progress:i,isProcessing:d,process:b,cancel:h}}function Pf(e,t={}){const{initialCount:r=20,batchSize:a=50,batchDelay:n=16}=t,[o,s]=l.useState(Math.min(r,e.length)),[i,c]=l.useState(e.length<=r);return l.useEffect(()=>{if(o>=e.length){c(!0);return}const u=setTimeout(()=>{l.startTransition(()=>{s(f=>Math.min(f+a,e.length))})},n);return()=>clearTimeout(u)},[o,e.length,a,n]),l.useEffect(()=>{s(Math.min(r,e.length)),c(e.length<=r)},[e,r]),{visibleItems:l.useMemo(()=>e.slice(0,o),[e,o]),visibleCount:o,totalCount:e.length,isComplete:i,progress:o/e.length*100}}function $f(e){const{initial:t,mutate:r,rollbackOnError:a=!0}=e,[n,o]=l.useState(t),[s,i]=l.useState(!1),[c,d]=l.useState(null),u=l.useRef(t),f=l.useCallback(async h=>{u.current=n,d(null),o(h),i(!0);try{const g=await r(h);o(g)}catch(g){d(g instanceof Error?g:new Error(String(g))),a&&o(u.current)}finally{i(!1)}},[n,r,a]),b=l.useCallback(()=>{o(t),d(null),i(!1)},[t]);return{value:n,update:f,isPending:s,error:c,reset:b}}function zf(e){const{workerScript:t,idleTimeout:r=3e4}=e,[a,n]=l.useState(null),[o,s]=l.useState(!1),[i,c]=l.useState(null),d=l.useRef(null),u=l.useRef(0),f=l.useRef(null),b=l.useRef(void 0),h=l.useRef(()=>{}),g=l.useCallback(()=>{if(!d.current){if(typeof t=="function"){const S=new Blob([`(${t.toString()})()`],{type:"application/javascript"});d.current=new Worker(URL.createObjectURL(S))}else d.current=new Worker(t,{type:"module"});d.current.onmessage=S=>{const w=S.data;w.id===f.current&&(w.type==="result"?(n(w.result??null),s(!1),f.current=null,h.current()):w.type==="error"&&(c(new Error(w.error)),s(!1),f.current=null,h.current()))},d.current.onerror=S=>{c(new Error(S.message)),s(!1),f.current=null}}return d.current},[t]),p=l.useCallback(()=>{b.current&&window.clearTimeout(b.current),r>0&&(b.current=window.setTimeout(()=>{d.current&&!f.current&&(d.current.terminate(),d.current=null)},r))},[r]);h.current=p;const m=l.useCallback(S=>new Promise((w,E)=>{const k=g(),C=`task-${++u.current}`;f.current=C,s(!0),c(null);const N=k.onmessage;k.onmessage=M=>{N==null||N.call(k,M),M.data.id===C&&(M.data.type==="result"?w(M.data.result):M.data.type==="error"&&E(new Error(M.data.error)))},k.postMessage({type:"task",id:C,data:S})}),[g]),v=l.useCallback(()=>{d.current&&f.current&&(d.current.postMessage({type:"cancel",id:f.current}),f.current=null,s(!1))},[]),y=l.useCallback(()=>{d.current&&(d.current.terminate(),d.current=null),b.current&&window.clearTimeout(b.current),f.current=null,s(!1)},[]);return l.useEffect(()=>()=>{y()},[y]),{result:a,isProcessing:o,error:i,execute:m,cancel:v,terminate:y}}function Hf(e){const{workerScript:t,poolSize:r=navigator.hardwareConcurrency||4,idleTimeout:a=6e4}=e,n=l.useRef([]),o=l.useRef([]),s=l.useRef(0),i=l.useRef(void 0),c=l.useCallback(()=>{if(typeof t=="function"){const v=new Blob([`(${t.toString()})()`],{type:"application/javascript"});return new Worker(URL.createObjectURL(v))}return new Worker(t,{type:"module"})},[t]),d=l.useCallback(()=>{const v=n.current.find(y=>!y.busy);if(v)return v;if(n.current.length<r){const S={worker:c(),busy:!1,taskId:null};return n.current.push(S),S}return null},[c,r]),u=l.useRef(()=>{}),f=l.useCallback(()=>{for(;o.current.length>0;){const v=d();if(!v)break;const y=o.current.shift();v.busy=!0,v.taskId=y.id,v.worker.onmessage=S=>{const w=S.data;w.id===y.id&&(v.busy=!1,v.taskId=null,w.type==="result"?y.resolve(w.result):w.type==="error"&&y.reject(new Error(w.error)),f(),u.current())},v.worker.onerror=S=>{v.busy=!1,v.taskId=null,y.reject(new Error(S.message)),f()},v.worker.postMessage({type:"task",id:y.id,data:y.data})}},[d]),b=l.useCallback(()=>{i.current&&window.clearTimeout(i.current),a>0&&(i.current=window.setTimeout(()=>{n.current.filter(y=>!y.busy).forEach(y=>{y.worker.terminate(),n.current=n.current.filter(S=>S!==y)})},a))},[a]);u.current=b;const h=l.useCallback(v=>new Promise((y,S)=>{const w=`pool-task-${++s.current}`;o.current.push({id:w,data:v,resolve:y,reject:S}),f()}),[f]),g=l.useCallback(v=>Promise.all(v.map(y=>h(y))),[h]),p=l.useCallback(()=>{n.current.forEach(v=>v.worker.terminate()),n.current=[],o.current=[],i.current&&window.clearTimeout(i.current)},[]),m=l.useCallback(()=>({total:n.current.length,busy:n.current.filter(v=>v.busy).length,idle:n.current.filter(v=>!v.busy).length,queued:o.current.length}),[]);return l.useEffect(()=>()=>{p()},[p]),{execute:h,executeAll:g,terminateAll:p,getStats:m}}function _f(e){const t=`
123
123
  self.onmessage = function(e) {
124
124
  const msg = e.data;
125
125
 
@@ -142,7 +142,7 @@ HTML:`}],{temperature:.3}),c=i.content.match(/```html?\n?([\s\S]*?)```/);return
142
142
  }
143
143
  }
144
144
  };
145
- `,r=new Blob([t],{type:"application/javascript"});return new URL(URL.createObjectURL(r))}function Hf(e){const t=[],r=a=>{a instanceof ArrayBuffer||a instanceof MessagePort?t.push(a):"buffer"in a&&a.buffer instanceof ArrayBuffer?t.push(a.buffer):a instanceof ImageBitmap?t.push(a):Array.isArray(a)?a.forEach(r):a&&typeof a=="object"&&Object.values(a).forEach(r)};return r(e),t}function zf(){const e=new WeakMap;return{get:t=>e.get(t),set:(t,r)=>{e.set(t,r)},has:t=>e.has(t),delete:t=>e.delete(t)}}function _f(e={}){const{maxSize:t=1e3,ttl:r}=e,a=new Map,n=s=>r?Date.now()-s.timestamp>r:!1,o=()=>{if(a.size<=t)return;const s=[];for(const[i,c]of a.entries())if((n(c)||a.size-s.length>t)&&s.push(i),a.size-s.length<=t)break;s.forEach(i=>a.delete(i))};return{get:s=>{const i=a.get(s);if(i){if(n(i)){a.delete(s);return}return a.delete(s),a.set(s,{...i,timestamp:Date.now()}),i.value}},set:(s,i)=>{a.delete(s),a.set(s,{value:i,timestamp:Date.now()}),o()},has:s=>{const i=a.get(s);return i?n(i)?(a.delete(s),!1):!0:!1},delete:s=>a.delete(s),clear:()=>a.clear(),size:()=>a.size,keys:()=>Array.from(a.keys())}}function Of(){const e=new Map,t=new FinalizationRegistry(r=>{e.delete(r)});return{get:r=>{const a=e.get(r);if(!a)return;const n=a.deref();return n===void 0&&e.delete(r),n},set:(r,a)=>{const n=e.get(r);if(n){const o=n.deref();o&&t.unregister(o)}e.set(r,new WeakRef(a)),t.register(a,r,a)},has:r=>{const a=e.get(r);return a?a.deref()!==void 0:!1},delete:r=>{const a=e.get(r);if(a){const n=a.deref();n&&t.unregister(n)}return e.delete(r)},clear:()=>e.clear(),size:()=>{let r=0;for(const a of e.values())a.deref()!==void 0&&r++;return r}}}function Bf(){const e=l.useRef([]),t=l.useCallback((n,o,s,i)=>{n.addEventListener(o,s,i),e.current.push({target:n,event:o,handler:s,options:i})},[]),r=l.useCallback(()=>{e.current.forEach(({target:n,event:o,handler:s,options:i})=>{n.removeEventListener(o,s,i)}),e.current=[]},[]),a=l.useCallback(()=>e.current.length,[]);return l.useEffect(()=>()=>{r()},[r]),{add:t,removeAll:r,count:a}}function jf(){const e=[];return{add:(t,r,a,n)=>{t.addEventListener(r,a,n),e.push({target:t,event:r,handler:a,options:n})},removeAll:()=>{e.forEach(({target:t,event:r,handler:a,options:n})=>{t.removeEventListener(r,a,n)}),e.length=0},count:()=>e.length,dispose:()=>{e.forEach(({target:t,event:r,handler:a,options:n})=>{t.removeEventListener(r,a,n)}),e.length=0}}}function Ke(){const e=window.performance;if(!e.memory)return{jsHeapSizeLimit:0,totalJSHeapSize:0,usedJSHeapSize:0,usedPercent:0,isSupported:!1};const{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:a}=e.memory;return{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:a,usedPercent:a/t*100,isSupported:!0}}function Wf(e={}){const{warningThreshold:t=75,pollInterval:r=1e4,onHighUsage:a}=e,[n,o]=l.useState(Ke),[s,i]=l.useState(!1);return l.useEffect(()=>{if(!Ke().isSupported)return;const d=setInterval(()=>{const u=Ke();o(u);const f=u.usedPercent>t;i(f),f&&a&&a(u)},r);return()=>clearInterval(d)},[t,r,a]),{stats:n,isHighUsage:s}}function Vf(e){const{src:t,rootMargin:r="200px",threshold:a=0,placeholder:n,progressive:o}=e,s=l.useRef(null),[i,c]=l.useState(!1),[d,u]=l.useState(!1),[f,b]=l.useState(n||"");return l.useEffect(()=>{const h=s.current;if(!h)return;const g=new IntersectionObserver(([p])=>{p.isIntersecting&&(c(!0),g.disconnect())},{rootMargin:r,threshold:a});return g.observe(h),()=>g.disconnect()},[r,a]),l.useEffect(()=>{if(!i)return;const h=new Image;return h.onload=()=>{b(t),u(!0)},h.src=t,()=>{h.onload=null}},[i,t,o]),{ref:s,isInView:i,isLoaded:d,currentSrc:f}}function Uf(e){const{create:t,reset:r,maxSize:a=100}=e,n=[];return{acquire:()=>n.length>0?n.pop():t(),release:o=>{n.length<a&&(r&&r(o),n.push(o))},preallocate:o=>{const s=Math.min(o,a-n.length);for(let i=0;i<s;i++)n.push(t())},clear:()=>{n.length=0},size:()=>n.length}}const Ne={avif:null,webp:null};async function Qe(e){if(Ne[e]!==null)return Ne[e];const t={avif:"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKBzgABhAQ0AIy0IEAAAAAAAAAAMHN",webp:"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"};return new Promise(r=>{const a=new Image;a.onload=()=>{Ne[e]=a.width>0&&a.height>0,r(Ne[e])},a.onerror=()=>{Ne[e]=!1,r(!1)},a.src=t[e]})}function xi(){const[e,t]=l.useState({avif:!1,webp:!1,jpg:!0,png:!0,gif:!0}),[r,a]=l.useState(!0);return l.useEffect(()=>{Promise.all([Qe("avif"),Qe("webp")]).then(([n,o])=>{t(s=>({...s,avif:n,webp:o})),a(!1)})},[]),{formats:e,isChecking:r}}function wi(e){return e.map(t=>`${t.src} ${t.width}w`).join(", ")}function ki(e,t){const r=e.map(a=>`(max-width: ${a.maxWidth}px) ${a.size}`);return r.push(t),r.join(", ")}function Ci(e,t,r=window.devicePixelRatio){const a=t*r,n=[...e].sort((o,s)=>o.width-s.width);for(const o of n)if(o.width>=a)return o;return n[n.length-1]}function Ei(e){const{src:t,lqip:r,rootMargin:a="200px",threshold:n=0,blurRadius:o=20,delay:s=0,priority:i="auto",onLoad:c,onError:d}=e,u=l.useRef(null),[f,b]=l.useState({currentSrc:r||null,thumbnailSrc:r||null,fullSrc:t,stage:"idle",isLoaded:!1,isInView:!1,error:null});l.useEffect(()=>{if(i==="high"){b(m=>({...m,isInView:!0}));return}const g=u.current;if(!g)return;const p=new IntersectionObserver(([m])=>{m.isIntersecting&&(b(v=>({...v,isInView:!0})),p.disconnect())},{rootMargin:a,threshold:n});return p.observe(g),()=>p.disconnect()},[a,n,i]),l.useEffect(()=>{if(!f.isInView||f.isLoaded)return;b(m=>({...m,stage:r?"thumbnail":"loading"}));const g=s>0?setTimeout(p,s):null;g||p();function p(){const m=new Image;m.onload=()=>{b(v=>({...v,currentSrc:t,stage:"loaded",isLoaded:!0})),c==null||c()},m.onerror=()=>{const v=new Error(`Failed to load image: ${t}`);b(y=>({...y,stage:"error",error:v})),d==null||d(v)},m.src=t}return()=>{g&&clearTimeout(g)}},[f.isInView,f.isLoaded,t,r,s,c,d]);const h={filter:f.stage==="thumbnail"?`blur(${o}px)`:"none",transition:"filter 0.3s ease-out",...f.stage==="thumbnail"&&{transform:"scale(1.05)"}};return{ref:u,...f,style:h}}function Ni(e){return Promise.all(e.map(t=>new Promise((r,a)=>{const n=new Image;n.onload=()=>r(),n.onerror=()=>a(new Error(`Failed to preload: ${t}`)),n.src=t})))}function Ai(e){const[t,r]=l.useState({loaded:0,total:e.length,isComplete:!1,errors:[]});return l.useEffect(()=>{if(e.length===0){r({loaded:0,total:0,isComplete:!0,errors:[]});return}let a=0;const n=[];e.forEach(s=>{const i=new Image;i.onload=()=>{a++,o()},i.onerror=()=>{a++,n.push(s),o()},i.src=s});function o(){r({loaded:a,total:e.length,isComplete:a===e.length,errors:n})}},[e]),t}async function Sr(e){const t=new Image;return t.src=e,typeof t.decode=="function"?await t.decode():await new Promise((r,a)=>{t.onload=()=>r(),t.onerror=()=>a(new Error(`Failed to load: ${e}`))}),t}function Mi(e){const[t,r]=l.useState(null),[a,n]=l.useState(!1),[o,s]=l.useState(null);return l.useEffect(()=>{if(!e){r(null);return}let i=!1;return n(!0),s(null),Sr(e).then(c=>{i||(r(c),n(!1))}).catch(c=>{i||(s(c),n(!1))}),()=>{i=!0}},[e]),{image:t,isLoading:a,error:o}}function Ti(e={}){const t=new Map,r=new IntersectionObserver(a=>{a.forEach(n=>{const o=t.get(n.target);o&&n.isIntersecting&&o(n)})},e);return{observe:(a,n)=>{t.set(a,n),r.observe(a)},unobserve:a=>{t.delete(a),r.unobserve(a)},disconnect:()=>{t.clear(),r.disconnect()}}}function Ii(e,t){const r=l.useRef(null),[a,n]=l.useState(!1);return l.useEffect(()=>{const o=r.current;if(o)return e.observe(o,()=>{n(!0),t(),e.unobserve(o)}),()=>{e.unobserve(o)}},[e,t]),{ref:r,isInView:a}}function Ri(e,t=10,r=10){const a=`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${r}"><rect width="100%" height="100%" fill="${e}"/></svg>`;return`data:image/svg+xml,${encodeURIComponent(a)}`}function Li(e,t="vertical",r=10,a=10){const i=`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${a}">
145
+ `,r=new Blob([t],{type:"application/javascript"});return new URL(URL.createObjectURL(r))}function Bf(e){const t=[],r=a=>{a instanceof ArrayBuffer||a instanceof MessagePort?t.push(a):"buffer"in a&&a.buffer instanceof ArrayBuffer?t.push(a.buffer):a instanceof ImageBitmap?t.push(a):Array.isArray(a)?a.forEach(r):a&&typeof a=="object"&&Object.values(a).forEach(r)};return r(e),t}function Of(){const e=new WeakMap;return{get:t=>e.get(t),set:(t,r)=>{e.set(t,r)},has:t=>e.has(t),delete:t=>e.delete(t)}}function jf(e={}){const{maxSize:t=1e3,ttl:r}=e,a=new Map,n=s=>r?Date.now()-s.timestamp>r:!1,o=()=>{if(a.size<=t)return;const s=[];for(const[i,c]of a.entries())if((n(c)||a.size-s.length>t)&&s.push(i),a.size-s.length<=t)break;s.forEach(i=>a.delete(i))};return{get:s=>{const i=a.get(s);if(i){if(n(i)){a.delete(s);return}return a.delete(s),a.set(s,{...i,timestamp:Date.now()}),i.value}},set:(s,i)=>{a.delete(s),a.set(s,{value:i,timestamp:Date.now()}),o()},has:s=>{const i=a.get(s);return i?n(i)?(a.delete(s),!1):!0:!1},delete:s=>a.delete(s),clear:()=>a.clear(),size:()=>a.size,keys:()=>Array.from(a.keys())}}function Wf(){const e=new Map,t=new FinalizationRegistry(r=>{e.delete(r)});return{get:r=>{const a=e.get(r);if(!a)return;const n=a.deref();return n===void 0&&e.delete(r),n},set:(r,a)=>{const n=e.get(r);if(n){const o=n.deref();o&&t.unregister(o)}e.set(r,new WeakRef(a)),t.register(a,r,a)},has:r=>{const a=e.get(r);return a?a.deref()!==void 0:!1},delete:r=>{const a=e.get(r);if(a){const n=a.deref();n&&t.unregister(n)}return e.delete(r)},clear:()=>e.clear(),size:()=>{let r=0;for(const a of e.values())a.deref()!==void 0&&r++;return r}}}function Vf(){const e=l.useRef([]),t=l.useCallback((n,o,s,i)=>{n.addEventListener(o,s,i),e.current.push({target:n,event:o,handler:s,options:i})},[]),r=l.useCallback(()=>{e.current.forEach(({target:n,event:o,handler:s,options:i})=>{n.removeEventListener(o,s,i)}),e.current=[]},[]),a=l.useCallback(()=>e.current.length,[]);return l.useEffect(()=>()=>{r()},[r]),{add:t,removeAll:r,count:a}}function Uf(){const e=[];return{add:(t,r,a,n)=>{t.addEventListener(r,a,n),e.push({target:t,event:r,handler:a,options:n})},removeAll:()=>{e.forEach(({target:t,event:r,handler:a,options:n})=>{t.removeEventListener(r,a,n)}),e.length=0},count:()=>e.length,dispose:()=>{e.forEach(({target:t,event:r,handler:a,options:n})=>{t.removeEventListener(r,a,n)}),e.length=0}}}function Ge(){const e=window.performance;if(!e.memory)return{jsHeapSizeLimit:0,totalJSHeapSize:0,usedJSHeapSize:0,usedPercent:0,isSupported:!1};const{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:a}=e.memory;return{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:a,usedPercent:a/t*100,isSupported:!0}}function Kf(e={}){const{warningThreshold:t=75,pollInterval:r=1e4,onHighUsage:a}=e,[n,o]=l.useState(Ge),[s,i]=l.useState(!1);return l.useEffect(()=>{if(!Ge().isSupported)return;const d=setInterval(()=>{const u=Ge();o(u);const f=u.usedPercent>t;i(f),f&&a&&a(u)},r);return()=>clearInterval(d)},[t,r,a]),{stats:n,isHighUsage:s}}function Gf(e){const{src:t,rootMargin:r="200px",threshold:a=0,placeholder:n,progressive:o}=e,s=l.useRef(null),[i,c]=l.useState(!1),[d,u]=l.useState(!1),[f,b]=l.useState(n||"");return l.useEffect(()=>{const h=s.current;if(!h)return;const g=new IntersectionObserver(([p])=>{p.isIntersecting&&(c(!0),g.disconnect())},{rootMargin:r,threshold:a});return g.observe(h),()=>g.disconnect()},[r,a]),l.useEffect(()=>{if(!i)return;const h=new Image;return h.onload=()=>{b(t),u(!0)},h.src=t,()=>{h.onload=null}},[i,t,o]),{ref:s,isInView:i,isLoaded:d,currentSrc:f}}function Xf(e){const{create:t,reset:r,maxSize:a=100}=e,n=[];return{acquire:()=>n.length>0?n.pop():t(),release:o=>{n.length<a&&(r&&r(o),n.push(o))},preallocate:o=>{const s=Math.min(o,a-n.length);for(let i=0;i<s;i++)n.push(t())},clear:()=>{n.length=0},size:()=>n.length}}const Ne={avif:null,webp:null};async function Ze(e){if(Ne[e]!==null)return Ne[e];const t={avif:"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKBzgABhAQ0AIy0IEAAAAAAAAAAMHN",webp:"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"};return new Promise(r=>{const a=new Image;a.onload=()=>{Ne[e]=a.width>0&&a.height>0,r(Ne[e])},a.onerror=()=>{Ne[e]=!1,r(!1)},a.src=t[e]})}function xi(){const[e,t]=l.useState({avif:!1,webp:!1,jpg:!0,png:!0,gif:!0}),[r,a]=l.useState(!0);return l.useEffect(()=>{Promise.all([Ze("avif"),Ze("webp")]).then(([n,o])=>{t(s=>({...s,avif:n,webp:o})),a(!1)})},[]),{formats:e,isChecking:r}}function wi(e){return e.map(t=>`${t.src} ${t.width}w`).join(", ")}function ki(e,t){const r=e.map(a=>`(max-width: ${a.maxWidth}px) ${a.size}`);return r.push(t),r.join(", ")}function Ci(e,t,r=window.devicePixelRatio){const a=t*r,n=[...e].sort((o,s)=>o.width-s.width);for(const o of n)if(o.width>=a)return o;return n[n.length-1]}function Ei(e){const{src:t,lqip:r,rootMargin:a="200px",threshold:n=0,blurRadius:o=20,delay:s=0,priority:i="auto",onLoad:c,onError:d}=e,u=l.useRef(null),[f,b]=l.useState({currentSrc:r||null,thumbnailSrc:r||null,fullSrc:t,stage:"idle",isLoaded:!1,isInView:!1,error:null});l.useEffect(()=>{if(i==="high"){b(m=>({...m,isInView:!0}));return}const g=u.current;if(!g)return;const p=new IntersectionObserver(([m])=>{m.isIntersecting&&(b(v=>({...v,isInView:!0})),p.disconnect())},{rootMargin:a,threshold:n});return p.observe(g),()=>p.disconnect()},[a,n,i]),l.useEffect(()=>{if(!f.isInView||f.isLoaded)return;b(m=>({...m,stage:r?"thumbnail":"loading"}));const g=s>0?setTimeout(p,s):null;g||p();function p(){const m=new Image;m.onload=()=>{b(v=>({...v,currentSrc:t,stage:"loaded",isLoaded:!0})),c==null||c()},m.onerror=()=>{const v=new Error(`Failed to load image: ${t}`);b(y=>({...y,stage:"error",error:v})),d==null||d(v)},m.src=t}return()=>{g&&clearTimeout(g)}},[f.isInView,f.isLoaded,t,r,s,c,d]);const h={filter:f.stage==="thumbnail"?`blur(${o}px)`:"none",transition:"filter 0.3s ease-out",...f.stage==="thumbnail"&&{transform:"scale(1.05)"}};return{ref:u,...f,style:h}}function Ni(e){return Promise.all(e.map(t=>new Promise((r,a)=>{const n=new Image;n.onload=()=>r(),n.onerror=()=>a(new Error(`Failed to preload: ${t}`)),n.src=t})))}function Ai(e){const[t,r]=l.useState({loaded:0,total:e.length,isComplete:!1,errors:[]});return l.useEffect(()=>{if(e.length===0){r({loaded:0,total:0,isComplete:!0,errors:[]});return}let a=0;const n=[];e.forEach(s=>{const i=new Image;i.onload=()=>{a++,o()},i.onerror=()=>{a++,n.push(s),o()},i.src=s});function o(){r({loaded:a,total:e.length,isComplete:a===e.length,errors:n})}},[e]),t}async function Sr(e){const t=new Image;return t.src=e,typeof t.decode=="function"?await t.decode():await new Promise((r,a)=>{t.onload=()=>r(),t.onerror=()=>a(new Error(`Failed to load: ${e}`))}),t}function Mi(e){const[t,r]=l.useState(null),[a,n]=l.useState(!1),[o,s]=l.useState(null);return l.useEffect(()=>{if(!e){r(null);return}let i=!1;return n(!0),s(null),Sr(e).then(c=>{i||(r(c),n(!1))}).catch(c=>{i||(s(c),n(!1))}),()=>{i=!0}},[e]),{image:t,isLoading:a,error:o}}function Ti(e={}){const t=new Map,r=new IntersectionObserver(a=>{a.forEach(n=>{const o=t.get(n.target);o&&n.isIntersecting&&o(n)})},e);return{observe:(a,n)=>{t.set(a,n),r.observe(a)},unobserve:a=>{t.delete(a),r.unobserve(a)},disconnect:()=>{t.clear(),r.disconnect()}}}function Ii(e,t){const r=l.useRef(null),[a,n]=l.useState(!1);return l.useEffect(()=>{const o=r.current;if(o)return e.observe(o,()=>{n(!0),t(),e.unobserve(o)}),()=>{e.unobserve(o)}},[e,t]),{ref:r,isInView:a}}function Ri(e,t=10,r=10){const a=`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${r}"><rect width="100%" height="100%" fill="${e}"/></svg>`;return`data:image/svg+xml,${encodeURIComponent(a)}`}function Li(e,t="vertical",r=10,a=10){const i=`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${a}">
146
146
  <defs>
147
147
  <linearGradient id="g" x1="0%" y1="0%" x2="${t==="horizontal"?"100%":"0%"}" y2="${t==="vertical"?"100%":"0%"}">
148
148
  <stop offset="0%" style="stop-color:${e[0]}"/>
@@ -150,4 +150,4 @@ HTML:`}],{temperature:.3}),c=i.content.match(/```html?\n?([\s\S]*?)```/);return
150
150
  </linearGradient>
151
151
  </defs>
152
152
  <rect width="100%" height="100%" fill="url(#g)"/>
153
- </svg>`;return`data:image/svg+xml,${encodeURIComponent(i)}`}const Kf={checkFormatSupport:Qe,useImageFormats:xi,generateSrcset:wi,generateSizes:ki,selectOptimalSource:Ci,useProgressiveImage:Ei,preloadImages:Ni,useImagePreload:Ai,loadAndDecodeImage:Sr,useDecodedImage:Mi,createImageObserver:Ti,useSharedImageObserver:Ii,generateColorPlaceholder:Ri,generateGradientPlaceholder:Li};function Gf(e){return e["data-testid"]??e.testId}function xr(e){return e.error||e.status==="error"?"error":e.warning||e.status==="warning"?"warning":e.success||e.status==="success"?"success":e.status??"idle"}function Xf(e){const t=xr(e),r={};return t==="error"&&(r["aria-invalid"]=!0),e.required&&(r["aria-required"]=!0),e.disabled&&(r["aria-disabled"]=!0),e.readOnly&&(r["aria-readonly"]=!0),e.describedById&&(r["aria-describedby"]=e.describedById),r}const Vr=new Set;function Fi(e,t,r){process.env.NODE_ENV!=="production"&&t!==void 0&&r!==void 0&&!Vr.has(e)&&(Vr.add(e),console.warn(`[Nice2Dev] <${e}> received both \`value\` and \`defaultValue\`. Use one or the other (controlled XOR uncontrolled).`))}const Ur=new Set;function Di(e,t){process.env.NODE_ENV!=="production"&&(Ur.has(e)||(Ur.add(e),t()))}function Pi(e){const{componentName:t,prop:r,replacement:a,removeIn:n,reason:o}=e;Di(`prop:${t}.${r}`,()=>{const s=[`[Nice2Dev] Prop \`${r}\` on <${t}> is deprecated.`,a?`Use \`${a}\` instead.`:"",n?`Will be removed in ${n}.`:"",o?`Reason: ${o}`:""].filter(Boolean);console.warn(s.join(" "))})}function qf(e){const{symbol:t,replacement:r,removeIn:a,reason:n}=e;Di(`symbol:${t}`,()=>{const o=[`[Nice2Dev] \`${t}\` is deprecated.`,r?`Use \`${r}\` instead.`:"",a?`Will be removed in ${a}.`:"",n?`Reason: ${n}`:""].filter(Boolean);console.warn(o.join(" "))})}function Yf(e){return e.value!==void 0&&e.newValue===void 0&&Pi({componentName:e.componentName,prop:e.prop,replacement:e.replacement,removeIn:e.removeIn}),e.newValue??e.value}const Kr=new Set;function Jf(e){const{value:t,defaultValue:r,fallbackValue:a,onChange:n,componentName:o="Component"}=e,s=t!==void 0,[i,c]=l.useState(()=>r!==void 0?r:a),d=l.useRef(s);process.env.NODE_ENV!=="production"&&(d.current!==s&&!Kr.has(o)&&(Kr.add(o),console.warn(`[Nice2Dev] <${o}> switched between controlled and uncontrolled. A component should not change between the two over its lifetime.`)),d.current=s,Fi(o,t,r));const u=s?t:i,f=l.useRef(u);f.current=u;const b=l.useCallback((h,g)=>{const p=typeof h=="function"?h(f.current):h;f.current=p,s||c(p),g===void 0?n==null||n(p):n==null||n(p,g)},[s,n]);return[u,b,s]}const Qf={idle:"nice-field-status nice-field-status--idle",success:"nice-field-status nice-field-status--success",warning:"nice-field-status nice-field-status--warning",error:"nice-field-status nice-field-status--error"};function Zf(e){const t=xr(e),r=t==="error"&&(typeof e.error=="string"?e.error:void 0)||t==="warning"&&e.warning||t==="success"&&e.success||e.helperText||null;return r?x.jsx("div",{id:e.id,role:t==="error"?"alert":void 0,"aria-live":t==="error"?"assertive":"polite","data-testid":e.testId,className:[Qf[t],e.className].filter(Boolean).join(" "),children:r}):null}const $i={0:"A",1:"B",2:"X",3:"Y",4:"LB",5:"RB",6:"LT",7:"RT",8:"Back",9:"Start",10:"LS",11:"RS",12:"DpadUp",13:"DpadDown",14:"DpadLeft",15:"DpadRight",16:"Home"},em={0:"LeftX",1:"LeftY",2:"RightX",3:"RightY"},tm={Cross:"A",Circle:"B",Square:"X",Triangle:"Y",L1:"LB",R1:"RB",L2:"LT",R2:"RT",Share:"Back",Options:"Start",L3:"LS",R3:"RS",PS:"Home"},wr=Object.values($i);function rm(e,t){if(e.connected!==t.connected||e.id!==t.id||e.leftTrigger!==t.leftTrigger||e.rightTrigger!==t.rightTrigger)return!1;for(const r of wr)if(e.buttons[r]!==t.buttons[r])return!1;return Object.keys(e.axes).every(r=>e.axes[r]===t.axes[r])}function am(e={}){const{index:t=0,deadzone:r=.15,pollRate:a=16,actions:n={},enabled:o=!0,onButtonDown:s,onButtonUp:i}=e,[c,d]=l.useState({connected:!1,id:"",buttons:Ve(),axes:{LeftX:0,LeftY:0,RightX:0,RightY:0},leftTrigger:0,rightTrigger:0,vibrate:()=>{}}),u=l.useRef(Ve()),f=l.useRef(new Map),b=l.useRef(n);b.current=n;const h=l.useRef({onButtonDown:s,onButtonUp:i});h.current={onButtonDown:s,onButtonUp:i};const g=l.useRef({left:0,right:0}),p=l.useCallback((v,y=.5,S=.5)=>{typeof window<"u"&&A.getInputEngine().rumble(t,v,y,S)},[t]),m=l.useCallback(v=>{if(Math.abs(v)<r)return 0;const y=v>0?1:-1,S=(Math.abs(v)-r)/(1-r);return y*S},[r]);return l.useEffect(()=>{if(!o||typeof window>"u")return;const v=A.getInputEngine();let y=-1/0;const S=(C,N)=>{var U,K,Z,we,je,We,ke,kr;if(N-y<a)return;y=N;const M=C.find(j=>j.index===t);if(!M)return;const T=Ve();for(let j=0;j<M.buttons.length;j++){const D=$i[j];D&&(T[D]=M.buttons[j].pressed)}const P={LeftX:0,LeftY:0,RightX:0,RightY:0};for(let j=0;j<Math.min(M.axes.length,4);j++){const D=em[j];D&&(P[D]=m(M.axes[j]))}const $=((U=M.buttons[6])==null?void 0:U.value)??0,H=((K=M.buttons[7])==null?void 0:K.value)??0,{onButtonDown:_,onButtonUp:R}=h.current;if(_||R)for(const j of wr)T[j]&&!u.current[j]?_==null||_(j):!T[j]&&u.current[j]&&(R==null||R(j));const L=Date.now(),F=b.current;for(const[j,D]of Object.entries(F)){if(D.button||D.buttons){const Y=D.buttons||[D.button],he=Y.every(ae=>T[ae]),Ce=Y.every(ae=>u.current[ae]);if(he&&!Ce)(Z=D.onPress)==null||Z.call(D),f.current.set(j,{startTime:L,lastRepeat:L});else if(!he&&Ce)(we=D.onRelease)==null||we.call(D),f.current.delete(j);else if(he&&((je=D.onHold)==null||je.call(D),D.repeatDelay!==void 0&&D.repeatRate!==void 0)){const ae=f.current.get(j);ae&&L-ae.startTime>D.repeatDelay&&L-ae.lastRepeat>=D.repeatRate&&((We=D.onPress)==null||We.call(D),ae.lastRepeat=L)}}if(D.axis&&D.onAxisChange){const Y=P[D.axis];D.axisDirection?D.axisDirection==="positive"&&Y>0?D.onAxisChange(Y):D.axisDirection==="negative"&&Y<0&&D.onAxisChange(Math.abs(Y)):D.onAxisChange(Y)}if(D.trigger){const Y=D.trigger==="LT"?$:H,he=D.trigger==="LT"?g.current.left>.5:g.current.right>.5,Ce=Y>.5;Ce&&!he?(ke=D.onPress)==null||ke.call(D):!Ce&&he&&((kr=D.onRelease)==null||kr.call(D))}}u.current=T,g.current={left:$,right:H};const z={connected:!0,id:M.id,buttons:T,axes:P,leftTrigger:$,rightTrigger:H,vibrate:p};d(j=>rm(j,z)&&j.vibrate===p?j:z)},w=()=>{const C=v.getState().pads.find(N=>N.index===t);C||(u.current=Ve()),d(N=>N.connected===!!C&&N.id===((C==null?void 0:C.id)??"")?N:{...N,connected:!!C,id:(C==null?void 0:C.id)??"",vibrate:p})},E=v.subscribeGamepadFrames(S),k=v.subscribe(w);return w(),()=>{E(),k()}},[o,t,a,m,p]),c}function Ve(){return{A:!1,B:!1,X:!1,Y:!1,LB:!1,RB:!1,LT:!1,RT:!1,Back:!1,Start:!1,LS:!1,RS:!1,DpadUp:!1,DpadDown:!1,DpadLeft:!1,DpadRight:!1,Home:!1}}function Gr(e){let t=!0;return r=>{r>.8&&t?(t=!1,e()):r<.3&&(t=!0)}}function nm(e){const t={};return e.onNavigateUp&&(t.navUp={button:"DpadUp",onPress:e.onNavigateUp,repeatDelay:400,repeatRate:100},t.navUpStick={axis:"LeftY",axisDirection:"negative",onAxisChange:Gr(()=>{var r;return(r=e.onNavigateUp)==null?void 0:r.call(e)})}),e.onNavigateDown&&(t.navDown={button:"DpadDown",onPress:e.onNavigateDown,repeatDelay:400,repeatRate:100},t.navDownStick={axis:"LeftY",axisDirection:"positive",onAxisChange:Gr(()=>{var r;return(r=e.onNavigateDown)==null?void 0:r.call(e)})}),e.onNavigateLeft&&(t.navLeft={button:"DpadLeft",onPress:e.onNavigateLeft,repeatDelay:400,repeatRate:100}),e.onNavigateRight&&(t.navRight={button:"DpadRight",onPress:e.onNavigateRight,repeatDelay:400,repeatRate:100}),e.onConfirm&&(t.confirm={button:"A",onPress:e.onConfirm}),e.onCancel&&(t.cancel={button:"B",onPress:e.onCancel}),e.onTabNext&&(t.tabNext={button:"RB",onPress:e.onTabNext}),e.onTabPrev&&(t.tabPrev={button:"LB",onPress:e.onTabPrev}),e.onMenu&&(t.menu={button:"Start",onPress:e.onMenu}),t}const gt=l.createContext(null);function Xr(e){if(!e)return null;const t=e.getBoundingClientRect();return t.width===0&&t.height===0?null:{x:t.left+t.width/2,y:t.top+t.height/2}}const om={up:[0,-1],down:[0,1],left:[-1,0],right:[1,0]},sm=({keyboard:e=!0,gamepad:t=!0,children:r})=>{const[a,n]=l.useState([]),[o,s]=l.useState(null),i=l.useRef([]),c=l.useRef(null),d=l.useRef([]),u=l.useRef(0);l.useEffect(()=>{i.current=a},[a]),l.useEffect(()=>{c.current=o},[o]);const f=l.useCallback(()=>{u.current+=1},[]),b=l.useCallback(()=>{u.current=Math.max(0,u.current-1)},[]),h=l.useCallback((E,k)=>{d.current=[...d.current,{prefix:E,onDismiss:k}]},[]),g=l.useCallback(()=>{var C;const E=d.current;if(E.length===0)return;const k=E[E.length-1];d.current=E.slice(0,-1),(C=k.onDismiss)==null||C.call(k)},[]),p=l.useCallback(E=>{n(k=>k.some(C=>C.id===E.id)?k:[...k,E])},[]),m=l.useCallback(E=>{n(k=>{var N;const C=k.filter(M=>M.id!==E);if(c.current===E){const M=((N=C[0])==null?void 0:N.id)??null;s(M),c.current=M}return C})},[]),v=l.useCallback(E=>{s(E),c.current=E},[]),y=l.useCallback((E,k)=>{var L,F;if(u.current>0)return;const C=i.current.filter(z=>!z.disabled);if(C.length===0)return;const N=c.current,M=N?C.find(z=>z.id===N):void 0;if(!M){const z=C[0];v(z.id),(L=z.ref.current)==null||L.focus();return}const T=d.current,P=T.length>0?T[T.length-1]:void 0,$=C.filter(z=>z.id!==N&&(!P||z.id.startsWith(P.prefix))),H=Xr(M.ref.current);if(!H||$.length===0)return;let _=null,R=1/0;for(const z of $){const U=Xr(z.ref.current);if(!U)continue;const K=U.x-H.x,Z=U.y-H.y,we=E*K+k*Z;if(we<=0)continue;const je=we,We=Math.abs(E*Z-k*K),ke=Math.sqrt(K*K+Z*Z)+We*2-je*.001;ke<R&&(R=ke,_=z)}_&&(v(_.id),(F=_.ref.current)==null||F.focus())},[v]),S=l.useCallback(E=>{var N;if(u.current>0)return;const k=E??c.current;if(!k)return;const C=i.current.find(M=>M.id===k);C&&(C.onActivate?C.onActivate():(N=C.ref.current)==null||N.click())},[]);A.useIntent(["navigate","activate","back"],E=>{if(u.current>0)return!1;const k=E.source==="keyboard";if(k&&!e||!k&&!t)return!1;if(E.intent==="navigate"){if(i.current.length===0||!E.direction)return!1;const[C,N]=om[E.direction];return y(C,N),!0}return E.intent==="activate"?c.current?(S(),!0):!1:d.current.length===0?!1:(g(),!0)});const w=l.useMemo(()=>({register:p,unregister:m,moveFocus:y,activate:S,setActive:v,activeId:o,focusables:a,pushFocusTrap:h,popFocusTrap:g,pauseNavigation:f,resumeNavigation:b}),[p,m,y,S,v,o,a,h,g,f,b]);return x.jsx(gt.Provider,{value:w,children:r})};function im(){return l.useContext(gt)}function cm(){const e=l.useContext(gt);if(!e)throw new Error("useSpatialNav must be used inside a NiceSpatialNavProvider");return e}function Hi(e,t){const r=l.useContext(gt),{id:a,onActivate:n,disabled:o}=t,s=l.useRef(n);s.current=n;const i=r==null?void 0:r.register,c=r==null?void 0:r.unregister,d=r==null?void 0:r.setActive;l.useEffect(()=>{if(!(!i||!c||o))return i({id:a,ref:e,onActivate:()=>{var f;return(f=s.current)==null?void 0:f.call(s)},disabled:o}),()=>c(a)},[i,c,a,o,e]),l.useEffect(()=>{const f=e.current;if(!f||!d||o)return;const b=()=>d(a);return f.addEventListener("focus",b),()=>f.removeEventListener("focus",b)},[d,a,o,e]);const u=(r==null?void 0:r.activeId)===a;return l.useEffect(()=>{const f=e.current;f&&(u?f.dataset.active="true":delete f.dataset.active)},[u,e]),{active:u}}const lm=({focusId:e,onActivate:t,disabled:r,as:a="div",className:n,style:o,children:s,...i})=>{const c=l.useRef(null),{active:d}=Hi(c,{id:e,onActivate:t,disabled:r});return x.jsx(a,{ref:c,tabIndex:r?-1:0,className:`nice-focusable${d?" nice-focusable--active":""}${n?` ${n}`:""}`,style:o,onClick:t,...i,children:s})};exports.IndexedDBAdapter=A.IndexedDBAdapter;exports.LocalStorageAdapter=A.LocalStorageAdapter;exports.NICE_BUILTIN_ICONS=A.NICE_BUILTIN_ICONS;exports.NICE_DEFAULT_GAMEPAD_BINDINGS=A.NICE_DEFAULT_GAMEPAD_BINDINGS;exports.NICE_DEFAULT_KEYBOARD_BINDINGS=A.NICE_DEFAULT_KEYBOARD_BINDINGS;exports.NICE_ENGAGE_EVENT=A.NICE_ENGAGE_EVENT;exports.NICE_GAMEPAD_BUTTONS=A.NICE_GAMEPAD_BUTTONS;exports.NICE_INPUT_DEFAULTS=A.NICE_INPUT_DEFAULTS;exports.NICE_INTENTS=A.NICE_INTENTS;exports.NICE_INTENT_EVENT=A.NICE_INTENT_EVENT;exports.NICE_KEYBOARD_LAYOUTS=A.NICE_KEYBOARD_LAYOUTS;exports.NICE_KEYBOARD_NUMERIC=A.NICE_KEYBOARD_NUMERIC;exports.NICE_KEYBOARD_NUMPAD=A.NICE_KEYBOARD_NUMPAD;exports.NICE_KEYBOARD_PHONE=A.NICE_KEYBOARD_PHONE;exports.NICE_KEYBOARD_PIN=A.NICE_KEYBOARD_PIN;exports.NICE_KEY_BACKSPACE=A.NICE_KEY_BACKSPACE;exports.NICE_KEY_CAPS=A.NICE_KEY_CAPS;exports.NICE_KEY_ENTER=A.NICE_KEY_ENTER;exports.NICE_KEY_SHIFT=A.NICE_KEY_SHIFT;exports.NICE_KEY_SPACE=A.NICE_KEY_SPACE;exports.NICE_KEY_TAB=A.NICE_KEY_TAB;exports.NICE_ROVING_ITEMS=A.NICE_ROVING_ITEMS;exports.NiceButtonPrompt=A.NiceButtonPrompt;exports.NiceControlHint=A.NiceControlHint;exports.NiceFocusScope=A.NiceFocusScope;exports.NiceGamepadPoller=A.NiceGamepadPoller;exports.NiceIcon=A.NiceIcon;exports.NiceIconProvider=A.NiceIconProvider;exports.NiceInputEngine=A.NiceInputEngine;exports.NiceInputHintBar=A.NiceInputHintBar;exports.NiceInputProvider=A.NiceInputProvider;exports.NiceKeyCap=A.NiceKeyCap;exports.NicePreferencesPanel=A.NicePreferencesPanel;exports.NiceUserPreferencesProvider=A.NiceUserPreferencesProvider;exports.RestAPISyncAdapter=A.RestAPISyncAdapter;exports.applyFocusScope=A.applyFocusScope;exports.buildKeyboardRows=A.buildKeyboardRows;exports.chordMatches=A.chordMatches;exports.chordToString=A.chordToString;exports.clickElement=A.clickElement;exports.clickOnActivationKey=A.clickOnActivationKey;exports.confirmButtonFor=A.confirmButtonFor;exports.createTabEscape=A.createTabEscape;exports.deleteBeforeCaret=A.deleteBeforeCaret;exports.detectGamepadFamily=A.detectGamepadFamily;exports.engageKindOf=A.engageKindOf;exports.findFocusTarget=A.findFocusTarget;exports.findRegionTarget=A.findRegionTarget;exports.focusCandidates=A.focusCandidates;exports.gamepadButtonLabel=A.gamepadButtonLabel;exports.gamepadGlyphName=A.gamepadGlyphName;exports.gamepadIntentMap=A.gamepadIntentMap;exports.getInputEngine=A.getInputEngine;exports.hintsForFocus=A.hintsForFocus;exports.insertAtCaret=A.insertAtCaret;exports.intentFromKey=A.intentFromKey;exports.isClickActivatable=A.isClickActivatable;exports.isEngaged=A.isEngaged;exports.isFocusCandidate=A.isFocusCandidate;exports.isMacPlatform=A.isMacPlatform;exports.isRtlKeyboardLanguage=A.isRtlKeyboardLanguage;exports.isTextInput=A.isTextInput;exports.keyFace=A.keyFace;exports.moveTextCaret=A.moveTextCaret;exports.normalizeKey=A.normalizeKey;exports.parseKeyChord=A.parseKeyChord;exports.pickInDirection=A.pickInDirection;exports.readScope=A.readScope;exports.rectOf=A.rectOf;exports.remoteIntent=A.remoteIntent;exports.resolveGamepadBindings=A.resolveGamepadBindings;exports.resolveKeyboardBindings=A.resolveKeyboardBindings;exports.restoresOnCancel=A.restoresOnCancel;exports.setFieldText=A.setFieldText;exports.setInputHints=A.setInputHints;exports.spatialScore=A.spatialScore;exports.splitChord=A.splitChord;exports.toAriaKeyShortcuts=A.toAriaKeyShortcuts;exports.toGamepadButton=A.toGamepadButton;exports.triggerNiceAction=A.triggerNiceAction;exports.useChartPreferences=A.useChartPreferences;exports.useConnectedGamepads=A.useConnectedGamepads;exports.useControlPreferences=A.useControlPreferences;exports.useEngage=A.useEngage;exports.useFocusScope=A.useFocusScope;exports.useFocusedElement=A.useFocusedElement;exports.useGamepadFamily=A.useGamepadFamily;exports.useGridFocus=A.useGridFocus;exports.useGridPreferences=A.useGridPreferences;exports.useHintsVisible=A.useHintsVisible;exports.useInputEngine=A.useInputEngine;exports.useInputHints=A.useInputHints;exports.useInputMethod=A.useInputMethod;exports.useInputPreferences=A.useInputPreferences;exports.useInputState=A.useInputState;exports.useIntent=A.useIntent;exports.useMenuButton=A.useMenuButton;exports.useNiceAction=A.useNiceAction;exports.useNiceActions=A.useNiceActions;exports.useNiceIcon=A.useNiceIcon;exports.useOverlayFocus=A.useOverlayFocus;exports.useRovingFocus=A.useRovingFocus;exports.useTreeFocus=A.useTreeFocus;exports.useUserPreferences=A.useUserPreferences;exports.useUserPreferencesOptional=A.useUserPreferencesOptional;Object.defineProperty(exports,"NICE_SUPPORTED_LANGS",{enumerable:!0,get:()=>W.NICE_SUPPORTED_LANGS});Object.defineProperty(exports,"NiceI18nLazyProvider",{enumerable:!0,get:()=>W.NiceI18nLazyProvider});Object.defineProperty(exports,"NiceI18nProvider",{enumerable:!0,get:()=>W.NiceI18nProvider});Object.defineProperty(exports,"createICUTranslator",{enumerable:!0,get:()=>W.createICUTranslator});Object.defineProperty(exports,"formatICU",{enumerable:!0,get:()=>W.formatICU});Object.defineProperty(exports,"getLoadedNiceDictionary",{enumerable:!0,get:()=>W.getLoadedNiceDictionary});Object.defineProperty(exports,"loadNiceDictionary",{enumerable:!0,get:()=>W.loadNiceDictionary});Object.defineProperty(exports,"useNiceTranslation",{enumerable:!0,get:()=>W.useNiceTranslation});exports.ANIMATION_VALUES=Ze;exports.BatchOperations=tf;exports.COMMON_SHORTCUTS=Xc;exports.CheckMark=ec;exports.ChevronMark=rc;exports.CloseMark=nc;exports.ColumnFormulas=Qu;exports.DEFAULT_TRACELESS_POLICY=ru;exports.DEFAULT_VARIANT_CONFIG=te;exports.DENSITY_VALUES=Le;exports.DisplayModeView=Ji;exports.DotMark=ac;exports.GAMEPAD_BUTTONS=wr;exports.ImageOptimization=Kf;exports.LeakDetectorStatus=_d;exports.NICE_BREAKPOINTS=be;exports.NICE_COLOR_BLIND_MODES=cl;exports.NICE_DISPLAY_STYLES=Wi;exports.NICE_DISPLAY_STYLE_INFO=qi;exports.NICE_THEME_ARCHIVE=Ae;exports.NICE_THEME_CURATED=rr;exports.NICE_THEME_CURATED_PACKS=td;exports.NICE_THEME_DEFAULT=It;exports.NICE_THEME_GALLERY=Ls;exports.NICE_THEME_PACKS=yr;exports.NICE_THEME_PACKS_EXTENDED=br;exports.NICE_THEME_PACK_FONT_LINKS=ff;exports.NICE_THEME_PACK_FONT_LINKS_EXTENDED=yf;exports.NICE_THEME_PACK_LIST=hr;exports.NICE_THEME_PACK_LIST_EXTENDED=vr;exports.NICE_THEME_PRESETS=Rt;exports.NICE_VIEW_COMPONENT_TYPES=kf;exports.NiceA11yProvider=ha;exports.NiceAIProvider=bu;exports.NiceAccessControl=fa;exports.NiceDataCache=Ft;exports.NiceDisplayStyleContext=tt;exports.NiceFieldStatus=Zf;exports.NiceFocusable=lm;exports.NiceHelpIcon=hn;exports.NiceHelpProvider=un;exports.NiceInlineHelp=gn;exports.NiceKeyboardHint=xa;exports.NiceProfiler=pd;exports.NicePullToRefresh=_c;exports.NiceQuickHelp=yn;exports.NiceRTLProvider=da;exports.NiceRequestDeduplicator=Fn;exports.NiceSkipLink=Sa;exports.NiceSpatialNavProvider=sm;exports.NiceStateIO=lf;exports.NiceSwipeableListItem=zc;exports.NiceTestWrapper=Xa;exports.NiceThemeContext=Xt;exports.NiceThemeProvider=ar;exports.NiceThemeVariantConfigurator=Sf;exports.NiceThemeVariantProvider=vf;exports.NiceTouchTarget=Bc;exports.NiceTutorialButton=eu;exports.NiceTutorialsProvider=Jd;exports.NiceVisuallyHidden=va;exports.PRIVACY_LEVEL_ORDER=xe;exports.PS_BUTTON_ALIASES=tm;exports.ProfilerOverlay=Sd;exports.RADIUS_VALUES=Me;exports.RefreshMark=tc;exports.SHADOW_DARK_MODE_VALUES=qr;exports.SHADOW_VALUES=Ge;exports.StorageAdapter=kn;exports.THEME_BLACK=Na;exports.THEME_DEFAULT_LINKS=Kt;exports.THEME_HEADER_CURVE=Ma;exports.THEME_HIGHLIGHT_CURVE=Ta;exports.THEME_SURFACE_PATHS=Ia;exports.THEME_WHITE=ve;exports.TRACELESS_MODE_PRESETS=Sn;exports.TRACELESS_POLICY_HEADER=du;exports.VARIANT_PRESETS=et;exports.ValidationRules=ef;exports.accessModeAttrs=Dc;exports.aggregate=se;exports.analog70s=ai;exports.applyColorBlindMode=jt;exports.applyTheme=Dl;exports.applyVariantConfig=Ot;exports.applyVariantsToTheme=ji;exports.arcticCrystal=Xs;exports.artDecoGatsby=Qs;exports.auditStorageCompliance=hu;exports.auditWCAG22AAA=sl;exports.autumnFoliage=qs;exports.bankVault=Vs;exports.bauhaus=Ws;exports.blackTieGala=pi;exports.blueprint=ei;exports.brutalistRaw=$s;exports.buildAriaDescribedBy=ba;exports.buildFieldA11y=Xf;exports.buildFormFieldAria=Uc;exports.calculateDataDiff=Dn;exports.candyPop=zs;exports.checkAriaCompliance=ld;exports.checkContrastAAA=ol;exports.checkFormatSupport=Qe;exports.checkRegression=an;exports.claymorphism=js;exports.clearAllClientStorage=yu;exports.clearLeakReports=Nd;exports.clearProfilingData=nr;exports.colorSetSnapshot=Ml;exports.comicHalftone=ci;exports.configureLeakDetector=Cd;exports.configureProfiler=Ya;exports.createArrayDataSource=Au;exports.createColorBlindController=ml;exports.createCustomDataSource=Du;exports.createEventCleanup=jf;exports.createGraphQLDataSource=Fu;exports.createGraphQLSubscriptionSource=Ud;exports.createId=pl;exports.createImageObserver=Ti;exports.createIndexedDBDataSource=Dt;exports.createInfiniteScroll=Vu;exports.createInlineWorker=$f;exports.createLRUCache=_f;exports.createMockDataSource=cd;exports.createNavigationActions=nm;exports.createNicePluginSystem=hl;exports.createNiceReduxMiddleware=jd;exports.createODataDataSource=Lu;exports.createObjectPool=Uf;exports.createOfflineFirstDataSource=of;exports.createPermissiveInstanceCeiling=gu;exports.createPolicyHeader=fu;exports.createReactQueryAdapter=Od;exports.createRestDataSource=Nn;exports.createRestrictiveInstanceCeiling=pu;exports.createSSEDataSource=qu;exports.createSignalRDataSource=Ku;exports.createStorageAdapter=mu;exports.createURLStateManager=cf;exports.createUserPreferencesStore=df;exports.createWeakCache=zf;exports.createWeakRefCache=Of;exports.createWebSocketDataSource=Uu;exports.createZustandAdapter=Bd;exports.deepSea=ri;exports.defaultValidationMessage=In;exports.deprecateProp=Pi;exports.deprecateSymbol=qf;exports.deriveColorSet=Da;exports.deriveMode=ur;exports.deserializeTheme=_l;exports.desertDune=Gs;exports.dieterRams=mi;exports.endMark=dt;exports.evaluateCondition=Ef;exports.evaluateValidation=Ln;exports.evaluateValidationRule=Rn;exports.filterGroupToWhere=Pu;exports.filterNiceThemePacksByTag=gf;exports.filterNiceThemePacksExtendedByTag=bf;exports.forceGC=Hd;exports.forestCanopy=Ks;exports.formatShortcut=qc;exports.forwardDeprecated=Yf;exports.generateBadgeStyles=Yr;exports.generateButtonStyles=$t;exports.generateCardStyles=zt;exports.generateColorPlaceholder=Ri;exports.generateColumnsFromSchema=Gd;exports.generateFillStyles=Bi;exports.generateFormFieldsFromSchema=Xd;exports.generateFromOpenAPI=Kd;exports.generateGradientPlaceholder=Li;exports.generateInputStyles=Ht;exports.generatePaletteFromColor=yc;exports.generateSizes=ki;exports.generateSrcset=wi;exports.generateTabStyles=Jr;exports.generateTableStyles=ea;exports.generateToggleStyles=Qr;exports.generateTooltipStyles=Zr;exports.generateTracelessComplianceReport=su;exports.generateVariantCSS=_t;exports.getComponentStats=Qa;exports.getComponentStyleFromConfig=ra;exports.getComputedTheme=Hl;exports.getDisplayStyleDataAttrs=aa;exports.getGracefulDegradationInfo=lu;exports.getLeakReports=Ed;exports.getLeakSummary=nn;exports.getMemoryStats=Ke;exports.getMorePrivateMode=au;exports.getNiceAnimationClass=Ic;exports.getNiceThemePack=pf;exports.getNiceThemePackExtended=hf;exports.getPerformanceReport=en;exports.getProfilingStats=Ja;exports.getRecentTimings=ud;exports.getScrollParent=oa;exports.getSlowRenders=or;exports.getThemeValue=at;exports.getTracelessBadgeInfo=cu;exports.getTransferables=Hf;exports.glassAurora=Hs;exports.gradientBaseColor=Nt;exports.groupBy=mr;exports.groupByHierarchical=$n;exports.hologramUI=ti;exports.hyggeScandinavian=Ps;exports.inkSumie=fi;exports.isAtLeastAsPrivate=Ue;exports.isDerivableColor=Vl;exports.isRecordValid=Ou;exports.isSafeUrl=Zi;exports.isThemeGradient=Se;exports.japaneseWashi=Ys;exports.loadAndDecodeImage=Sr;exports.logicalProps=Lc;exports.matchesFilterCondition=Tn;exports.matchesFilterGroup=fr;exports.matchesShortcut=Yc;exports.measureAsync=hd;exports.measureSync=bd;exports.memphis80s=ui;exports.mixThemeColor=Pe;exports.mixThemeColorCss=ee;exports.moroccanMosaic=Js;exports.neonArcade=Ds;exports.nestingLevelColors=za;exports.newspaperBroadsheet=_s;exports.niceReduxActions=Wd;exports.niceReduxReducer=Vd;exports.niceSelectors=od;exports.niceStaggerDelay=Tc;exports.niceThemeBankingV2=Qt;exports.niceThemeBlackTieGala=ot;exports.niceThemeBlue=Wa;exports.niceThemeBootstrap=Ka;exports.niceThemeDark=ja;exports.niceThemeFluent=Ga;exports.niceThemeFluentV2=qt;exports.niceThemeHighContrast=Va;exports.niceThemeLight=Ba;exports.niceThemeMaterial=Ua;exports.niceThemeMinimalism=Jt;exports.niceThemeObsidianV2=Zt;exports.niceThemeOnyxV2=er;exports.niceThemeShadowV2=tr;exports.niceThemeSlateV2=Yt;exports.normalizeSize=_i;exports.normalizeVariant=Oi;exports.obsidianEditorial=Fs;exports.parsePolicyFromHeader=uu;exports.parseThemeColor=G;exports.parseThemeRef=La;exports.pivot=Yu;exports.preloadImages=Ni;exports.printPerformanceReport=sr;exports.removeTheme=At;exports.removeVariantConfig=ta;exports.renameThemeRef=Nl;exports.resolveControlStoragePermissions=ou;exports.resolveCssColor=Ca;exports.resolveDisplayStyleConfig=Te;exports.resolveScrollContainer=Cc;exports.resolveStatus=xr;exports.resolveStepsI18n=vn;exports.resolveTestId=Gf;exports.resolveTheme=Re;exports.resolveThemeValue=Al;exports.resolveTracelessPolicy=nu;exports.resolveTutorial=Zd;exports.sanitizeHtml=Qi;exports.saveBaseline=rn;exports.scrollTopFor=Nc;exports.scrollTopOf=Ec;exports.selectOptimalSource=Ci;exports.serializeTheme=zl;exports.setupReactDevToolsIntegration=xd;exports.shadeThemeColor=Ut;exports.shouldShowConsentBanner=xn;exports.simulateKeyboard=sd;exports.simulateType=id;exports.sortModelToOrderBy=$u;exports.sovietConstructivist=Zs;exports.startMark=lt;exports.swissGrid=gi;exports.synthwave84=Os;exports.takeMemorySnapshot=$d;exports.testId=nd;exports.themeAbyss=go;exports.themeAfricanEarth=vs;exports.themeAmber=qn;exports.themeArctic=No;exports.themeAurora=wo;exports.themeAutumn=Co;exports.themeBanking=$o;exports.themeBrazilianCarnival=bs;exports.themeCarbon=fo;exports.themeCharcoal=Un;exports.themeCherryBlossom=ds;exports.themeChineseNewYear=ys;exports.themeChristmas=ns;exports.themeCoffee=Is;exports.themeColorContrast=Et;exports.themeColorToHex=Wt;exports.themeContrastRatio=qe;exports.themeContrastText=Aa;exports.themeCoolGray=jn;exports.themeCoral=so;exports.themeCosmos=mo;exports.themeCyan=Zn;exports.themeCyberpunk=ts;exports.themeDesert=So;exports.themeDracula=Uo;exports.themeEaster=is;exports.themeEclipse=lo;exports.themeEducation=jo;exports.themeEmerald=Xn;exports.themeEmeraldDark=ho;exports.themeEnhancedContrast=ws;exports.themeEnterprise=Oo;exports.themeForest=bo;exports.themeFuchsia=ao;exports.themeGlassmorphism=Cs;exports.themeGovernment=Bo;exports.themeHalloween=os;exports.themeHarvest=us;exports.themeHealthcare=Ho;exports.themeHighContrastDark=Ss;exports.themeIndianFestive=hs;exports.themeIndigo=Qn;exports.themeIvory=Kn;exports.themeJapaneseZen=fs;exports.themeLargeText=ks;exports.themeLavender=ko;exports.themeLegal=zo;exports.themeLime=eo;exports.themeLuminance=ie;exports.themeMediterranean=gs;exports.themeMidnight=io;exports.themeMinimalist=As;exports.themeMonochrome=xs;exports.themeMonokai=Xo;exports.themeMoroccan=ms;exports.themeNebula=po;exports.themeNeon=rs;exports.themeNeumorphismDark=Ns;exports.themeNeumorphismLight=Es;exports.themeNord=Vo;exports.themeObsidian=co;exports.themeOcean=vo;exports.themeOneDark=qo;exports.themeOnyx=uo;exports.themeOrange=ro;exports.themePastelCoral=Po;exports.themePastelLavender=Lo;exports.themePastelLemon=Fo;exports.themePastelMint=Io;exports.themePastelPeach=Ro;exports.themePastelRose=Mo;exports.themePastelSage=Do;exports.themePastelSky=To;exports.themePink=to;exports.themePreviewRoles=Il;exports.themeRealEstate=Wo;exports.themeRefsIn=rt;exports.themeRefsOf=Cl;exports.themeRetrowave=as;exports.themeRose=Gn;exports.themeRuby=oo;exports.themeScandinavian=ps;exports.themeSepia=Zo;exports.themeShadow=yo;exports.themeSilver=Vn;exports.themeSky=no;exports.themeSlate=_n;exports.themeSoftDark=Ts;exports.themeSolarizedDark=Go;exports.themeSolarizedLight=Ko;exports.themeSpring=Eo;exports.themeStone=Bn;exports.themeSummerBeach=cs;exports.themeSunset=xo;exports.themeSynthwave=Yo;exports.themeTeal=Jn;exports.themeTechStartup=_o;exports.themeTerminalGreen=Qo;exports.themeToCssVars=Ye;exports.themeTropical=Ao;exports.themeValentine=ss;exports.themeVaporwave=Jo;exports.themeVintage=es;exports.themeViolet=Yn;exports.themeWarmDark=Ms;exports.themeWarmGray=Wn;exports.themeWine=Rs;exports.themeWinterFrost=ls;exports.themeZinc=On;exports.tintThemeColor=Vt;exports.triggerHaptic=pa;exports.typewriterPress=oi;exports.useAICompletion=vu;exports.useAccessibleClick=Zc;exports.useAdaptiveVariant=vc;exports.useBrandColors=pc;exports.useBreakpoint=De;exports.useChartSuggestion=wu;exports.useChunkedProcessor=Rf;exports.useClickOutside=uc;exports.useCodeCompletion=Su;exports.useCognitiveAccessibility=al;exports.useColorBlindMode=ka;exports.useColorBlindModePersisted=fl;exports.useComponentDisplayClass=Ki;exports.useComponentDisplayStyle=Ui;exports.useComponentHelp=mn;exports.useContainerSize=bc;exports.useControlId=lc;exports.useControllableState=Jf;exports.useDarkMode=mc;exports.useDebouncedValue=dc;exports.useDecodedImage=Mi;exports.useDeferredList=Lf;exports.useDeferredSearch=Tf;exports.useDevice=na;exports.useDisplayAnimation=Xi;exports.useDisplayDensity=Gi;exports.useDisplayModeEdit=Yi;exports.useEventCleanup=Bf;exports.useFocusManagement=rl;exports.useFocusTrap=fc;exports.useFormGeneration=ku;exports.useGamepad=am;exports.useHaptic=Oc;exports.useHoldRepeat=cc;exports.useImageFormats=xi;exports.useImagePreload=Ai;exports.useInputMode=sc;exports.useIsTouchDevice=oc;exports.useLazyImage=Vf;exports.useLiveAnnouncement=wa;exports.useLongPress=ic;exports.useMeasureEffect=vd;exports.useMediaQuery=Xe;exports.useMemoryMonitor=zd;exports.useMemoryMonitorPerf=Wf;exports.useNaturalLanguageFilter=xu;exports.useNiceA11y=Vc;exports.useNiceAI=ye;exports.useNiceAccessMode=Fc;exports.useNiceCollapse=Mc;exports.useNiceDataSource=rf;exports.useNiceDisplayStyle=Vi;exports.useNiceField=af;exports.useNiceHelp=fn;exports.useNiceLookupSource=nf;exports.useNiceRTL=Rc;exports.useNiceRecord=Hn;exports.useNiceTheme=Kl;exports.useNiceTransition=Ac;exports.useNiceTutorials=bn;exports.useNiceTutorialsEnabled=Qd;exports.useOptimistic=Ff;exports.useOrientation=xc;exports.usePan=Hc;exports.usePinch=$c;exports.useProgressiveImage=Ei;exports.usePullToRefresh=ma;exports.useRenderCount=yd;exports.useResolvedDisplayStyle=Fe;exports.useResponsiveValue=hc;exports.useRestoreFocus=Gc;exports.useRouteAnnouncement=tl;exports.useRovingTabIndex=Kc;exports.useSafeAbortController=on;exports.useSafeAreaInsets=wc;exports.useSafeEventListener=Id;exports.useSafeFetch=Rd;exports.useSafeInterval=Td;exports.useSafeState=Ad;exports.useSafeSubscription=Ld;exports.useSafeTimeout=Md;exports.useSafeWebSocket=Fd;exports.useSharedImageObserver=Ii;exports.useShowAt=Sc;exports.useSpatialFocusable=Hi;exports.useSpatialNav=cm;exports.useSpatialNavOptional=im;exports.useSubmitOnEnter=Qc;exports.useSwipe=Pc;exports.useTextImprovement=Cu;exports.useThemeIsDark=wf;exports.useThemeVariants=hi;exports.useTransitionState=If;exports.useUnmountLog=Pd;exports.useVirtualGrid=Af;exports.useVirtualKeyboard=jc;exports.useVirtualScroll=Si;exports.useVoiceControl=el;exports.useWhyDidYouRender=Za;exports.useWindowedList=Mf;exports.useWorker=Df;exports.useWorkerPool=Pf;exports.validateData=Zu;exports.validateViewDocument=Cf;exports.vhsTracking=ni;exports.vogueDidone=ii;exports.warnControlledClash=Fi;exports.watercolorWash=di;exports.withCaching=Bu;exports.withCalculatedColumns=Ju;exports.withCrossTabSync=sf;exports.withCursorPagination=ju;exports.withLeakTracking=Dd;exports.withOptimisticUpdates=Gu;exports.withPolling=Xu;exports.withWhyDidYouRender=gd;exports.wouldCreateCycle=El;exports.y2kAqua=si;exports.zenMinimal=Bs;exports.zinePunk=li;
153
+ </svg>`;return`data:image/svg+xml,${encodeURIComponent(i)}`}const qf={checkFormatSupport:Ze,useImageFormats:xi,generateSrcset:wi,generateSizes:ki,selectOptimalSource:Ci,useProgressiveImage:Ei,preloadImages:Ni,useImagePreload:Ai,loadAndDecodeImage:Sr,useDecodedImage:Mi,createImageObserver:Ti,useSharedImageObserver:Ii,generateColorPlaceholder:Ri,generateGradientPlaceholder:Li};function Yf(e){return e["data-testid"]??e.testId}function xr(e){return e.error||e.status==="error"?"error":e.warning||e.status==="warning"?"warning":e.success||e.status==="success"?"success":e.status??"idle"}function Jf(e){const t=xr(e),r={};return t==="error"&&(r["aria-invalid"]=!0),e.required&&(r["aria-required"]=!0),e.disabled&&(r["aria-disabled"]=!0),e.readOnly&&(r["aria-readonly"]=!0),e.describedById&&(r["aria-describedby"]=e.describedById),r}const Vr=new Set;function Fi(e,t,r){process.env.NODE_ENV!=="production"&&t!==void 0&&r!==void 0&&!Vr.has(e)&&(Vr.add(e),console.warn(`[Nice2Dev] <${e}> received both \`value\` and \`defaultValue\`. Use one or the other (controlled XOR uncontrolled).`))}const Ur=new Set;function Di(e,t){process.env.NODE_ENV!=="production"&&(Ur.has(e)||(Ur.add(e),t()))}function Pi(e){const{componentName:t,prop:r,replacement:a,removeIn:n,reason:o}=e;Di(`prop:${t}.${r}`,()=>{const s=[`[Nice2Dev] Prop \`${r}\` on <${t}> is deprecated.`,a?`Use \`${a}\` instead.`:"",n?`Will be removed in ${n}.`:"",o?`Reason: ${o}`:""].filter(Boolean);console.warn(s.join(" "))})}function Qf(e){const{symbol:t,replacement:r,removeIn:a,reason:n}=e;Di(`symbol:${t}`,()=>{const o=[`[Nice2Dev] \`${t}\` is deprecated.`,r?`Use \`${r}\` instead.`:"",a?`Will be removed in ${a}.`:"",n?`Reason: ${n}`:""].filter(Boolean);console.warn(o.join(" "))})}function Zf(e){return e.value!==void 0&&e.newValue===void 0&&Pi({componentName:e.componentName,prop:e.prop,replacement:e.replacement,removeIn:e.removeIn}),e.newValue??e.value}const Kr=new Set;function em(e){const{value:t,defaultValue:r,fallbackValue:a,onChange:n,componentName:o="Component"}=e,s=t!==void 0,[i,c]=l.useState(()=>r!==void 0?r:a),d=l.useRef(s);process.env.NODE_ENV!=="production"&&(d.current!==s&&!Kr.has(o)&&(Kr.add(o),console.warn(`[Nice2Dev] <${o}> switched between controlled and uncontrolled. A component should not change between the two over its lifetime.`)),d.current=s,Fi(o,t,r));const u=s?t:i,f=l.useRef(u);f.current=u;const b=l.useCallback((h,g)=>{const p=typeof h=="function"?h(f.current):h;f.current=p,s||c(p),g===void 0?n==null||n(p):n==null||n(p,g)},[s,n]);return[u,b,s]}const tm={idle:"nice-field-status nice-field-status--idle",success:"nice-field-status nice-field-status--success",warning:"nice-field-status nice-field-status--warning",error:"nice-field-status nice-field-status--error"};function rm(e){const t=xr(e),r=t==="error"&&(typeof e.error=="string"?e.error:void 0)||t==="warning"&&e.warning||t==="success"&&e.success||e.helperText||null;return r?x.jsx("div",{id:e.id,role:t==="error"?"alert":void 0,"aria-live":t==="error"?"assertive":"polite","data-testid":e.testId,className:[tm[t],e.className].filter(Boolean).join(" "),children:r}):null}const $i={0:"A",1:"B",2:"X",3:"Y",4:"LB",5:"RB",6:"LT",7:"RT",8:"Back",9:"Start",10:"LS",11:"RS",12:"DpadUp",13:"DpadDown",14:"DpadLeft",15:"DpadRight",16:"Home"},am={0:"LeftX",1:"LeftY",2:"RightX",3:"RightY"},nm={Cross:"A",Circle:"B",Square:"X",Triangle:"Y",L1:"LB",R1:"RB",L2:"LT",R2:"RT",Share:"Back",Options:"Start",L3:"LS",R3:"RS",PS:"Home"},wr=Object.values($i);function om(e,t){if(e.connected!==t.connected||e.id!==t.id||e.leftTrigger!==t.leftTrigger||e.rightTrigger!==t.rightTrigger)return!1;for(const r of wr)if(e.buttons[r]!==t.buttons[r])return!1;return Object.keys(e.axes).every(r=>e.axes[r]===t.axes[r])}function sm(e={}){const{index:t=0,deadzone:r=.15,pollRate:a=16,actions:n={},enabled:o=!0,onButtonDown:s,onButtonUp:i}=e,[c,d]=l.useState({connected:!1,id:"",buttons:Ue(),axes:{LeftX:0,LeftY:0,RightX:0,RightY:0},leftTrigger:0,rightTrigger:0,vibrate:()=>{}}),u=l.useRef(Ue()),f=l.useRef(new Map),b=l.useRef(n);b.current=n;const h=l.useRef({onButtonDown:s,onButtonUp:i});h.current={onButtonDown:s,onButtonUp:i};const g=l.useRef({left:0,right:0}),p=l.useCallback((v,y=.5,S=.5)=>{typeof window<"u"&&A.getInputEngine().rumble(t,v,y,S)},[t]),m=l.useCallback(v=>{if(Math.abs(v)<r)return 0;const y=v>0?1:-1,S=(Math.abs(v)-r)/(1-r);return y*S},[r]);return l.useEffect(()=>{if(!o||typeof window>"u")return;const v=A.getInputEngine();let y=-1/0;const S=(C,N)=>{var U,K,Z,we,We,Ve,ke,kr;if(N-y<a)return;y=N;const M=C.find(j=>j.index===t);if(!M)return;const T=Ue();for(let j=0;j<M.buttons.length;j++){const D=$i[j];D&&(T[D]=M.buttons[j].pressed)}const P={LeftX:0,LeftY:0,RightX:0,RightY:0};for(let j=0;j<Math.min(M.axes.length,4);j++){const D=am[j];D&&(P[D]=m(M.axes[j]))}const $=((U=M.buttons[6])==null?void 0:U.value)??0,z=((K=M.buttons[7])==null?void 0:K.value)??0,{onButtonDown:_,onButtonUp:R}=h.current;if(_||R)for(const j of wr)T[j]&&!u.current[j]?_==null||_(j):!T[j]&&u.current[j]&&(R==null||R(j));const L=Date.now(),F=b.current;for(const[j,D]of Object.entries(F)){if(D.button||D.buttons){const Y=D.buttons||[D.button],he=Y.every(ae=>T[ae]),Ce=Y.every(ae=>u.current[ae]);if(he&&!Ce)(Z=D.onPress)==null||Z.call(D),f.current.set(j,{startTime:L,lastRepeat:L});else if(!he&&Ce)(we=D.onRelease)==null||we.call(D),f.current.delete(j);else if(he&&((We=D.onHold)==null||We.call(D),D.repeatDelay!==void 0&&D.repeatRate!==void 0)){const ae=f.current.get(j);ae&&L-ae.startTime>D.repeatDelay&&L-ae.lastRepeat>=D.repeatRate&&((Ve=D.onPress)==null||Ve.call(D),ae.lastRepeat=L)}}if(D.axis&&D.onAxisChange){const Y=P[D.axis];D.axisDirection?D.axisDirection==="positive"&&Y>0?D.onAxisChange(Y):D.axisDirection==="negative"&&Y<0&&D.onAxisChange(Math.abs(Y)):D.onAxisChange(Y)}if(D.trigger){const Y=D.trigger==="LT"?$:z,he=D.trigger==="LT"?g.current.left>.5:g.current.right>.5,Ce=Y>.5;Ce&&!he?(ke=D.onPress)==null||ke.call(D):!Ce&&he&&((kr=D.onRelease)==null||kr.call(D))}}u.current=T,g.current={left:$,right:z};const H={connected:!0,id:M.id,buttons:T,axes:P,leftTrigger:$,rightTrigger:z,vibrate:p};d(j=>om(j,H)&&j.vibrate===p?j:H)},w=()=>{const C=v.getState().pads.find(N=>N.index===t);C||(u.current=Ue()),d(N=>N.connected===!!C&&N.id===((C==null?void 0:C.id)??"")?N:{...N,connected:!!C,id:(C==null?void 0:C.id)??"",vibrate:p})},E=v.subscribeGamepadFrames(S),k=v.subscribe(w);return w(),()=>{E(),k()}},[o,t,a,m,p]),c}function Ue(){return{A:!1,B:!1,X:!1,Y:!1,LB:!1,RB:!1,LT:!1,RT:!1,Back:!1,Start:!1,LS:!1,RS:!1,DpadUp:!1,DpadDown:!1,DpadLeft:!1,DpadRight:!1,Home:!1}}function Gr(e){let t=!0;return r=>{r>.8&&t?(t=!1,e()):r<.3&&(t=!0)}}function im(e){const t={};return e.onNavigateUp&&(t.navUp={button:"DpadUp",onPress:e.onNavigateUp,repeatDelay:400,repeatRate:100},t.navUpStick={axis:"LeftY",axisDirection:"negative",onAxisChange:Gr(()=>{var r;return(r=e.onNavigateUp)==null?void 0:r.call(e)})}),e.onNavigateDown&&(t.navDown={button:"DpadDown",onPress:e.onNavigateDown,repeatDelay:400,repeatRate:100},t.navDownStick={axis:"LeftY",axisDirection:"positive",onAxisChange:Gr(()=>{var r;return(r=e.onNavigateDown)==null?void 0:r.call(e)})}),e.onNavigateLeft&&(t.navLeft={button:"DpadLeft",onPress:e.onNavigateLeft,repeatDelay:400,repeatRate:100}),e.onNavigateRight&&(t.navRight={button:"DpadRight",onPress:e.onNavigateRight,repeatDelay:400,repeatRate:100}),e.onConfirm&&(t.confirm={button:"A",onPress:e.onConfirm}),e.onCancel&&(t.cancel={button:"B",onPress:e.onCancel}),e.onTabNext&&(t.tabNext={button:"RB",onPress:e.onTabNext}),e.onTabPrev&&(t.tabPrev={button:"LB",onPress:e.onTabPrev}),e.onMenu&&(t.menu={button:"Start",onPress:e.onMenu}),t}const yt=l.createContext(null);function Xr(e){if(!e)return null;const t=e.getBoundingClientRect();return t.width===0&&t.height===0?null:{x:t.left+t.width/2,y:t.top+t.height/2}}const cm={up:[0,-1],down:[0,1],left:[-1,0],right:[1,0]},lm=({keyboard:e=!0,gamepad:t=!0,children:r})=>{const[a,n]=l.useState([]),[o,s]=l.useState(null),i=l.useRef([]),c=l.useRef(null),d=l.useRef([]),u=l.useRef(0);l.useEffect(()=>{i.current=a},[a]),l.useEffect(()=>{c.current=o},[o]);const f=l.useCallback(()=>{u.current+=1},[]),b=l.useCallback(()=>{u.current=Math.max(0,u.current-1)},[]),h=l.useCallback((E,k)=>{d.current=[...d.current,{prefix:E,onDismiss:k}]},[]),g=l.useCallback(()=>{var C;const E=d.current;if(E.length===0)return;const k=E[E.length-1];d.current=E.slice(0,-1),(C=k.onDismiss)==null||C.call(k)},[]),p=l.useCallback(E=>{n(k=>k.some(C=>C.id===E.id)?k:[...k,E])},[]),m=l.useCallback(E=>{n(k=>{var N;const C=k.filter(M=>M.id!==E);if(c.current===E){const M=((N=C[0])==null?void 0:N.id)??null;s(M),c.current=M}return C})},[]),v=l.useCallback(E=>{s(E),c.current=E},[]),y=l.useCallback((E,k)=>{var L,F;if(u.current>0)return;const C=i.current.filter(H=>!H.disabled);if(C.length===0)return;const N=c.current,M=N?C.find(H=>H.id===N):void 0;if(!M){const H=C[0];v(H.id),(L=H.ref.current)==null||L.focus();return}const T=d.current,P=T.length>0?T[T.length-1]:void 0,$=C.filter(H=>H.id!==N&&(!P||H.id.startsWith(P.prefix))),z=Xr(M.ref.current);if(!z||$.length===0)return;let _=null,R=1/0;for(const H of $){const U=Xr(H.ref.current);if(!U)continue;const K=U.x-z.x,Z=U.y-z.y,we=E*K+k*Z;if(we<=0)continue;const We=we,Ve=Math.abs(E*Z-k*K),ke=Math.sqrt(K*K+Z*Z)+Ve*2-We*.001;ke<R&&(R=ke,_=H)}_&&(v(_.id),(F=_.ref.current)==null||F.focus())},[v]),S=l.useCallback(E=>{var N;if(u.current>0)return;const k=E??c.current;if(!k)return;const C=i.current.find(M=>M.id===k);C&&(C.onActivate?C.onActivate():(N=C.ref.current)==null||N.click())},[]);A.useIntent(["navigate","activate","back"],E=>{if(u.current>0)return!1;const k=E.source==="keyboard";if(k&&!e||!k&&!t)return!1;if(E.intent==="navigate"){if(i.current.length===0||!E.direction)return!1;const[C,N]=cm[E.direction];return y(C,N),!0}return E.intent==="activate"?c.current?(S(),!0):!1:d.current.length===0?!1:(g(),!0)});const w=l.useMemo(()=>({register:p,unregister:m,moveFocus:y,activate:S,setActive:v,activeId:o,focusables:a,pushFocusTrap:h,popFocusTrap:g,pauseNavigation:f,resumeNavigation:b}),[p,m,y,S,v,o,a,h,g,f,b]);return x.jsx(yt.Provider,{value:w,children:r})};function dm(){return l.useContext(yt)}function um(){const e=l.useContext(yt);if(!e)throw new Error("useSpatialNav must be used inside a NiceSpatialNavProvider");return e}function zi(e,t){const r=l.useContext(yt),{id:a,onActivate:n,disabled:o}=t,s=l.useRef(n);s.current=n;const i=r==null?void 0:r.register,c=r==null?void 0:r.unregister,d=r==null?void 0:r.setActive;l.useEffect(()=>{if(!(!i||!c||o))return i({id:a,ref:e,onActivate:()=>{var f;return(f=s.current)==null?void 0:f.call(s)},disabled:o}),()=>c(a)},[i,c,a,o,e]),l.useEffect(()=>{const f=e.current;if(!f||!d||o)return;const b=()=>d(a);return f.addEventListener("focus",b),()=>f.removeEventListener("focus",b)},[d,a,o,e]);const u=(r==null?void 0:r.activeId)===a;return l.useEffect(()=>{const f=e.current;f&&(u?f.dataset.active="true":delete f.dataset.active)},[u,e]),{active:u}}const fm=({focusId:e,onActivate:t,disabled:r,as:a="div",className:n,style:o,children:s,...i})=>{const c=l.useRef(null),{active:d}=zi(c,{id:e,onActivate:t,disabled:r});return x.jsx(a,{ref:c,tabIndex:r?-1:0,className:`nice-focusable${d?" nice-focusable--active":""}${n?` ${n}`:""}`,style:o,onClick:t,...i,children:s})};exports.IndexedDBAdapter=A.IndexedDBAdapter;exports.LocalStorageAdapter=A.LocalStorageAdapter;exports.NICE_BUILTIN_ICONS=A.NICE_BUILTIN_ICONS;exports.NICE_DEFAULT_GAMEPAD_BINDINGS=A.NICE_DEFAULT_GAMEPAD_BINDINGS;exports.NICE_DEFAULT_KEYBOARD_BINDINGS=A.NICE_DEFAULT_KEYBOARD_BINDINGS;exports.NICE_ENGAGE_EVENT=A.NICE_ENGAGE_EVENT;exports.NICE_GAMEPAD_BUTTONS=A.NICE_GAMEPAD_BUTTONS;exports.NICE_INPUT_DEFAULTS=A.NICE_INPUT_DEFAULTS;exports.NICE_INTENTS=A.NICE_INTENTS;exports.NICE_INTENT_EVENT=A.NICE_INTENT_EVENT;exports.NICE_KEYBOARD_LAYOUTS=A.NICE_KEYBOARD_LAYOUTS;exports.NICE_KEYBOARD_NUMERIC=A.NICE_KEYBOARD_NUMERIC;exports.NICE_KEYBOARD_NUMPAD=A.NICE_KEYBOARD_NUMPAD;exports.NICE_KEYBOARD_PHONE=A.NICE_KEYBOARD_PHONE;exports.NICE_KEYBOARD_PIN=A.NICE_KEYBOARD_PIN;exports.NICE_KEY_BACKSPACE=A.NICE_KEY_BACKSPACE;exports.NICE_KEY_CAPS=A.NICE_KEY_CAPS;exports.NICE_KEY_ENTER=A.NICE_KEY_ENTER;exports.NICE_KEY_SHIFT=A.NICE_KEY_SHIFT;exports.NICE_KEY_SPACE=A.NICE_KEY_SPACE;exports.NICE_KEY_TAB=A.NICE_KEY_TAB;exports.NICE_ROVING_ITEMS=A.NICE_ROVING_ITEMS;exports.NiceButtonPrompt=A.NiceButtonPrompt;exports.NiceControlHint=A.NiceControlHint;exports.NiceFocusScope=A.NiceFocusScope;exports.NiceGamepadPoller=A.NiceGamepadPoller;exports.NiceIcon=A.NiceIcon;exports.NiceIconProvider=A.NiceIconProvider;exports.NiceInputEngine=A.NiceInputEngine;exports.NiceInputHintBar=A.NiceInputHintBar;exports.NiceInputProvider=A.NiceInputProvider;exports.NiceKeyCap=A.NiceKeyCap;exports.NicePreferencesPanel=A.NicePreferencesPanel;exports.NiceUserPreferencesProvider=A.NiceUserPreferencesProvider;exports.RestAPISyncAdapter=A.RestAPISyncAdapter;exports.applyFocusScope=A.applyFocusScope;exports.buildKeyboardRows=A.buildKeyboardRows;exports.chordMatches=A.chordMatches;exports.chordToString=A.chordToString;exports.clickElement=A.clickElement;exports.clickOnActivationKey=A.clickOnActivationKey;exports.confirmButtonFor=A.confirmButtonFor;exports.createTabEscape=A.createTabEscape;exports.deleteBeforeCaret=A.deleteBeforeCaret;exports.detectGamepadFamily=A.detectGamepadFamily;exports.engageKindOf=A.engageKindOf;exports.findFocusTarget=A.findFocusTarget;exports.findRegionTarget=A.findRegionTarget;exports.focusCandidates=A.focusCandidates;exports.gamepadButtonLabel=A.gamepadButtonLabel;exports.gamepadGlyphName=A.gamepadGlyphName;exports.gamepadIntentMap=A.gamepadIntentMap;exports.getInputEngine=A.getInputEngine;exports.hintsForFocus=A.hintsForFocus;exports.insertAtCaret=A.insertAtCaret;exports.intentFromKey=A.intentFromKey;exports.isClickActivatable=A.isClickActivatable;exports.isEngaged=A.isEngaged;exports.isFocusCandidate=A.isFocusCandidate;exports.isMacPlatform=A.isMacPlatform;exports.isRtlKeyboardLanguage=A.isRtlKeyboardLanguage;exports.isTextInput=A.isTextInput;exports.keyFace=A.keyFace;exports.moveTextCaret=A.moveTextCaret;exports.normalizeKey=A.normalizeKey;exports.parseKeyChord=A.parseKeyChord;exports.pickInDirection=A.pickInDirection;exports.readScope=A.readScope;exports.rectOf=A.rectOf;exports.remoteIntent=A.remoteIntent;exports.resolveGamepadBindings=A.resolveGamepadBindings;exports.resolveKeyboardBindings=A.resolveKeyboardBindings;exports.restoresOnCancel=A.restoresOnCancel;exports.setFieldText=A.setFieldText;exports.setInputHints=A.setInputHints;exports.spatialScore=A.spatialScore;exports.splitChord=A.splitChord;exports.toAriaKeyShortcuts=A.toAriaKeyShortcuts;exports.toGamepadButton=A.toGamepadButton;exports.triggerNiceAction=A.triggerNiceAction;exports.useChartPreferences=A.useChartPreferences;exports.useConnectedGamepads=A.useConnectedGamepads;exports.useControlPreferences=A.useControlPreferences;exports.useEngage=A.useEngage;exports.useFocusScope=A.useFocusScope;exports.useFocusedElement=A.useFocusedElement;exports.useGamepadFamily=A.useGamepadFamily;exports.useGridFocus=A.useGridFocus;exports.useGridPreferences=A.useGridPreferences;exports.useHintsVisible=A.useHintsVisible;exports.useInputEngine=A.useInputEngine;exports.useInputHints=A.useInputHints;exports.useInputMethod=A.useInputMethod;exports.useInputPreferences=A.useInputPreferences;exports.useInputState=A.useInputState;exports.useIntent=A.useIntent;exports.useMenuButton=A.useMenuButton;exports.useNiceAction=A.useNiceAction;exports.useNiceActions=A.useNiceActions;exports.useNiceIcon=A.useNiceIcon;exports.useOverlayFocus=A.useOverlayFocus;exports.useRovingFocus=A.useRovingFocus;exports.useTreeFocus=A.useTreeFocus;exports.useUserPreferences=A.useUserPreferences;exports.useUserPreferencesOptional=A.useUserPreferencesOptional;Object.defineProperty(exports,"NICE_SUPPORTED_LANGS",{enumerable:!0,get:()=>W.NICE_SUPPORTED_LANGS});Object.defineProperty(exports,"NiceI18nLazyProvider",{enumerable:!0,get:()=>W.NiceI18nLazyProvider});Object.defineProperty(exports,"NiceI18nProvider",{enumerable:!0,get:()=>W.NiceI18nProvider});Object.defineProperty(exports,"createICUTranslator",{enumerable:!0,get:()=>W.createICUTranslator});Object.defineProperty(exports,"formatICU",{enumerable:!0,get:()=>W.formatICU});Object.defineProperty(exports,"getLoadedNiceDictionary",{enumerable:!0,get:()=>W.getLoadedNiceDictionary});Object.defineProperty(exports,"loadNiceDictionary",{enumerable:!0,get:()=>W.loadNiceDictionary});Object.defineProperty(exports,"useNiceTranslation",{enumerable:!0,get:()=>W.useNiceTranslation});exports.ANIMATION_VALUES=et;exports.BatchOperations=nf;exports.COMMON_SHORTCUTS=Nl;exports.CheckMark=ec;exports.ChevronMark=rc;exports.CloseMark=nc;exports.ColumnFormulas=tf;exports.DEFAULT_TRACELESS_POLICY=ou;exports.DEFAULT_VARIANT_CONFIG=te;exports.DENSITY_VALUES=Fe;exports.DisplayModeView=Ji;exports.DotMark=ac;exports.GAMEPAD_BUTTONS=wr;exports.ImageOptimization=qf;exports.LeakDetectorStatus=jd;exports.NICE_BREAKPOINTS=Se;exports.NICE_COLOR_BLIND_MODES=Bl;exports.NICE_DISPLAY_STYLES=Wi;exports.NICE_DISPLAY_STYLE_INFO=qi;exports.NICE_THEME_ARCHIVE=Ae;exports.NICE_THEME_CURATED=rr;exports.NICE_THEME_CURATED_PACKS=nd;exports.NICE_THEME_DEFAULT=Rt;exports.NICE_THEME_GALLERY=Ls;exports.NICE_THEME_PACKS=yr;exports.NICE_THEME_PACKS_EXTENDED=br;exports.NICE_THEME_PACK_FONT_LINKS=gf;exports.NICE_THEME_PACK_FONT_LINKS_EXTENDED=vf;exports.NICE_THEME_PACK_LIST=hr;exports.NICE_THEME_PACK_LIST_EXTENDED=vr;exports.NICE_THEME_PRESETS=Lt;exports.NICE_VIEW_COMPONENT_TYPES=Nf;exports.NiceA11yProvider=Ia;exports.NiceAIProvider=xu;exports.NiceAccessControl=Ea;exports.NiceDataCache=Dt;exports.NiceDisplayStyleContext=rt;exports.NiceFieldStatus=rm;exports.NiceFocusable=fm;exports.NiceHelpIcon=hn;exports.NiceHelpProvider=un;exports.NiceInlineHelp=gn;exports.NiceKeyboardHint=Da;exports.NicePortalTargetProvider=Xc;exports.NiceProfiler=hd;exports.NicePullToRefresh=hl;exports.NiceQuickHelp=yn;exports.NiceRTLProvider=ka;exports.NiceRequestDeduplicator=Fn;exports.NiceSkipLink=Fa;exports.NiceSpatialNavProvider=lm;exports.NiceStateIO=ff;exports.NiceSwipeableListItem=yl;exports.NiceTestWrapper=Xa;exports.NiceThemeContext=Le;exports.NiceThemeProvider=ar;exports.NiceThemeVariantConfigurator=kf;exports.NiceThemeVariantProvider=wf;exports.NiceTouchTarget=vl;exports.NiceTutorialButton=au;exports.NiceTutorialsProvider=eu;exports.NiceVisuallyHidden=La;exports.PRIVACY_LEVEL_ORDER=xe;exports.PS_BUTTON_ALIASES=nm;exports.ProfilerOverlay=kd;exports.RADIUS_VALUES=Me;exports.RefreshMark=tc;exports.SHADOW_DARK_MODE_VALUES=qr;exports.SHADOW_VALUES=Xe;exports.StorageAdapter=kn;exports.THEME_BLACK=na;exports.THEME_DEFAULT_LINKS=Ut;exports.THEME_HEADER_CURVE=sa;exports.THEME_HIGHLIGHT_CURVE=ia;exports.THEME_SURFACE_PATHS=ca;exports.THEME_WHITE=be;exports.TRACELESS_MODE_PRESETS=Sn;exports.TRACELESS_POLICY_HEADER=mu;exports.VARIANT_PRESETS=tt;exports.ValidationRules=af;exports.accessModeAttrs=fl;exports.aggregate=se;exports.analog70s=ai;exports.applyColorBlindMode=Xt;exports.applyTheme=Fc;exports.applyVariantConfig=Ot;exports.applyVariantsToTheme=ji;exports.arcticCrystal=Xs;exports.artDecoGatsby=Qs;exports.auditStorageCompliance=Su;exports.auditWCAG22AAA=Hl;exports.autumnFoliage=qs;exports.bankVault=Vs;exports.bauhaus=Ws;exports.blackTieGala=pi;exports.blueprint=ei;exports.brutalistRaw=$s;exports.buildAriaDescribedBy=Ra;exports.buildFieldA11y=Jf;exports.buildFormFieldAria=kl;exports.calculateDataDiff=Dn;exports.candyPop=Hs;exports.checkAriaCompliance=fd;exports.checkContrastAAA=zl;exports.checkFormatSupport=Ze;exports.checkRegression=an;exports.claymorphism=js;exports.clearAllClientStorage=vu;exports.clearLeakReports=Td;exports.clearProfilingData=nr;exports.colorSetSnapshot=Ac;exports.comicHalftone=ci;exports.configureLeakDetector=Ad;exports.configureProfiler=Ya;exports.createArrayDataSource=Iu;exports.createColorBlindController=Ul;exports.createCustomDataSource=zu;exports.createEventCleanup=Uf;exports.createGraphQLDataSource=$u;exports.createGraphQLSubscriptionSource=Xd;exports.createId=Kl;exports.createImageObserver=Ti;exports.createIndexedDBDataSource=Pt;exports.createInfiniteScroll=Gu;exports.createInlineWorker=_f;exports.createLRUCache=jf;exports.createMockDataSource=ud;exports.createNavigationActions=im;exports.createNicePluginSystem=ql;exports.createNiceReduxMiddleware=Ud;exports.createODataDataSource=Pu;exports.createObjectPool=Xf;exports.createOfflineFirstDataSource=lf;exports.createPermissiveInstanceCeiling=bu;exports.createPolicyHeader=gu;exports.createReactQueryAdapter=Wd;exports.createRestDataSource=Nn;exports.createRestrictiveInstanceCeiling=hu;exports.createSSEDataSource=Qu;exports.createSignalRDataSource=qu;exports.createStorageAdapter=yu;exports.createURLStateManager=uf;exports.createUserPreferencesStore=mf;exports.createWeakCache=Of;exports.createWeakRefCache=Wf;exports.createWebSocketDataSource=Xu;exports.createZustandAdapter=Vd;exports.deepSea=ri;exports.defaultValidationMessage=In;exports.deprecateProp=Pi;exports.deprecateSymbol=Qf;exports.deriveColorSet=fa;exports.deriveMode=ur;exports.deserializeTheme=Hc;exports.desertDune=Gs;exports.dieterRams=mi;exports.endMark=ut;exports.evaluateCondition=Mf;exports.evaluateValidation=Ln;exports.evaluateValidationRule=Rn;exports.filterGroupToWhere=Hu;exports.filterNiceThemePacksByTag=bf;exports.filterNiceThemePacksExtendedByTag=xf;exports.forceGC=Bd;exports.forestCanopy=Ks;exports.formatShortcut=Al;exports.forwardDeprecated=Zf;exports.generateBadgeStyles=Yr;exports.generateButtonStyles=zt;exports.generateCardStyles=_t;exports.generateColorPlaceholder=Ri;exports.generateColumnsFromSchema=Yd;exports.generateFillStyles=Oi;exports.generateFormFieldsFromSchema=Jd;exports.generateFromOpenAPI=qd;exports.generateGradientPlaceholder=Li;exports.generateInputStyles=Ht;exports.generatePaletteFromColor=yc;exports.generateSizes=ki;exports.generateSrcset=wi;exports.generateTabStyles=Jr;exports.generateTableStyles=ea;exports.generateToggleStyles=Qr;exports.generateTooltipStyles=Zr;exports.generateTracelessComplianceReport=lu;exports.generateVariantCSS=Bt;exports.getComponentStats=Qa;exports.getComponentStyleFromConfig=ra;exports.getComputedTheme=$c;exports.getDisplayStyleDataAttrs=aa;exports.getGracefulDegradationInfo=fu;exports.getLeakReports=Md;exports.getLeakSummary=nn;exports.getMemoryStats=Ge;exports.getMorePrivateMode=su;exports.getNiceAnimationClass=cl;exports.getNiceThemePack=hf;exports.getNiceThemePackExtended=Sf;exports.getPerformanceReport=en;exports.getProfilingStats=Ja;exports.getRecentTimings=pd;exports.getScrollParent=ba;exports.getSlowRenders=or;exports.getThemeValue=nt;exports.getTracelessBadgeInfo=uu;exports.getTransferables=Bf;exports.glassAurora=zs;exports.gradientBaseColor=Ct;exports.groupBy=mr;exports.groupByHierarchical=$n;exports.hologramUI=ti;exports.hyggeScandinavian=Ps;exports.inkSumie=fi;exports.isAtLeastAsPrivate=Ke;exports.isDerivableColor=Wc;exports.isRecordValid=Wu;exports.isSafeUrl=Zi;exports.isThemeGradient=ve;exports.japaneseWashi=Ys;exports.loadAndDecodeImage=Sr;exports.logicalProps=dl;exports.matchesFilterCondition=Tn;exports.matchesFilterGroup=fr;exports.matchesShortcut=Ml;exports.measureAsync=Sd;exports.measureSync=xd;exports.memphis80s=ui;exports.mixThemeColor=Pe;exports.mixThemeColorCss=ee;exports.moroccanMosaic=Js;exports.neonArcade=Ds;exports.nestingLevelColors=ya;exports.newspaperBroadsheet=_s;exports.niceReduxActions=Kd;exports.niceReduxReducer=Gd;exports.niceSelectors=cd;exports.niceStaggerDelay=il;exports.niceThemeBankingV2=Qt;exports.niceThemeBlackTieGala=st;exports.niceThemeBlue=Wa;exports.niceThemeBootstrap=Ka;exports.niceThemeDark=ja;exports.niceThemeFluent=Ga;exports.niceThemeFluentV2=qt;exports.niceThemeHighContrast=Va;exports.niceThemeLight=Oa;exports.niceThemeMaterial=Ua;exports.niceThemeMinimalism=Jt;exports.niceThemeObsidianV2=Zt;exports.niceThemeOnyxV2=er;exports.niceThemeShadowV2=tr;exports.niceThemeSlateV2=Yt;exports.normalizeSize=_i;exports.normalizeVariant=Bi;exports.obsidianEditorial=Fs;exports.parsePolicyFromHeader=pu;exports.parseThemeColor=G;exports.parseThemeRef=da;exports.pivot=Zu;exports.preloadImages=Ni;exports.printPerformanceReport=sr;exports.removeTheme=Et;exports.removeVariantConfig=ta;exports.renameThemeRef=Ec;exports.resolveControlStoragePermissions=cu;exports.resolveCssColor=za;exports.resolveDisplayStyleConfig=Te;exports.resolveScrollContainer=rl;exports.resolveStatus=xr;exports.resolveStepsI18n=vn;exports.resolveTestId=Yf;exports.resolveTheme=Re;exports.resolveThemeValue=Nc;exports.resolveTracelessPolicy=iu;exports.resolveTutorial=ru;exports.sanitizeHtml=Qi;exports.saveBaseline=rn;exports.scrollTopFor=nl;exports.scrollTopOf=al;exports.selectOptimalSource=Ci;exports.serializeTheme=zc;exports.setupReactDevToolsIntegration=Cd;exports.shadeThemeColor=Vt;exports.shouldShowConsentBanner=xn;exports.simulateKeyboard=ld;exports.simulateType=dd;exports.sortModelToOrderBy=_u;exports.sovietConstructivist=Zs;exports.startMark=dt;exports.swissGrid=gi;exports.synthwave84=Bs;exports.takeMemorySnapshot=_d;exports.testId=id;exports.themeAbyss=go;exports.themeAfricanEarth=vs;exports.themeAmber=qn;exports.themeArctic=No;exports.themeAurora=wo;exports.themeAutumn=Co;exports.themeBanking=$o;exports.themeBrazilianCarnival=bs;exports.themeCarbon=fo;exports.themeCharcoal=Un;exports.themeCherryBlossom=ds;exports.themeChineseNewYear=ys;exports.themeChristmas=ns;exports.themeCoffee=Is;exports.themeColorContrast=kt;exports.themeColorToHex=jt;exports.themeContrastRatio=qe;exports.themeContrastText=oa;exports.themeCoolGray=jn;exports.themeCoral=so;exports.themeCosmos=mo;exports.themeCyan=Zn;exports.themeCyberpunk=ts;exports.themeDesert=So;exports.themeDracula=Uo;exports.themeEaster=is;exports.themeEclipse=lo;exports.themeEducation=jo;exports.themeEmerald=Xn;exports.themeEmeraldDark=ho;exports.themeEnhancedContrast=ws;exports.themeEnterprise=Bo;exports.themeForest=bo;exports.themeFuchsia=ao;exports.themeGlassmorphism=Cs;exports.themeGovernment=Oo;exports.themeHalloween=os;exports.themeHarvest=us;exports.themeHealthcare=zo;exports.themeHighContrastDark=Ss;exports.themeIndianFestive=hs;exports.themeIndigo=Qn;exports.themeIvory=Kn;exports.themeJapaneseZen=fs;exports.themeLargeText=ks;exports.themeLavender=ko;exports.themeLegal=Ho;exports.themeLime=eo;exports.themeLuminance=ie;exports.themeMediterranean=gs;exports.themeMidnight=io;exports.themeMinimalist=As;exports.themeMonochrome=xs;exports.themeMonokai=Xo;exports.themeMoroccan=ms;exports.themeNebula=po;exports.themeNeon=rs;exports.themeNeumorphismDark=Ns;exports.themeNeumorphismLight=Es;exports.themeNord=Vo;exports.themeObsidian=co;exports.themeOcean=vo;exports.themeOneDark=qo;exports.themeOnyx=uo;exports.themeOrange=ro;exports.themePastelCoral=Po;exports.themePastelLavender=Lo;exports.themePastelLemon=Fo;exports.themePastelMint=Io;exports.themePastelPeach=Ro;exports.themePastelRose=Mo;exports.themePastelSage=Do;exports.themePastelSky=To;exports.themePink=to;exports.themePreviewRoles=Tc;exports.themeRealEstate=Wo;exports.themeRefsIn=at;exports.themeRefsOf=kc;exports.themeRetrowave=as;exports.themeRose=Gn;exports.themeRuby=oo;exports.themeScandinavian=ps;exports.themeSepia=Zo;exports.themeShadow=yo;exports.themeSilver=Vn;exports.themeSky=no;exports.themeSlate=_n;exports.themeSoftDark=Ts;exports.themeSolarizedDark=Go;exports.themeSolarizedLight=Ko;exports.themeSpring=Eo;exports.themeStone=On;exports.themeSummerBeach=cs;exports.themeSunset=xo;exports.themeSynthwave=Yo;exports.themeTeal=Jn;exports.themeTechStartup=_o;exports.themeTerminalGreen=Qo;exports.themeToCssVars=Ye;exports.themeTropical=Ao;exports.themeValentine=ss;exports.themeVaporwave=Jo;exports.themeVintage=es;exports.themeViolet=Yn;exports.themeWarmDark=Ms;exports.themeWarmGray=Wn;exports.themeWine=Rs;exports.themeWinterFrost=ls;exports.themeZinc=Bn;exports.tintThemeColor=Wt;exports.triggerHaptic=Aa;exports.typewriterPress=oi;exports.useAICompletion=wu;exports.useAccessibleClick=Rl;exports.useAdaptiveVariant=Jc;exports.useBrandColors=pc;exports.useBreakpoint=$e;exports.useChartSuggestion=Eu;exports.useChunkedProcessor=Df;exports.useClickOutside=uc;exports.useCodeCompletion=ku;exports.useCognitiveAccessibility=Pl;exports.useColorBlindMode=$a;exports.useColorBlindModePersisted=Vl;exports.useComponentDisplayClass=Ki;exports.useComponentDisplayStyle=Ui;exports.useComponentHelp=mn;exports.useContainerSize=Yc;exports.useControlId=lc;exports.useControllableState=em;exports.useDarkMode=mc;exports.useDebouncedValue=dc;exports.useDecodedImage=Mi;exports.useDeferredList=Pf;exports.useDeferredSearch=Lf;exports.useDevice=ha;exports.useDisplayAnimation=Xi;exports.useDisplayDensity=Gi;exports.useDisplayModeEdit=Yi;exports.useEventCleanup=Vf;exports.useFocusManagement=Dl;exports.useFocusTrap=fc;exports.useFormGeneration=Nu;exports.useGamepad=sm;exports.useHaptic=bl;exports.useHoldRepeat=cc;exports.useImageFormats=xi;exports.useImagePreload=Ai;exports.useInputMode=sc;exports.useIsTouchDevice=oc;exports.useLazyImage=Gf;exports.useLiveAnnouncement=Pa;exports.useLongPress=ic;exports.useMeasureEffect=wd;exports.useMediaQuery=Je;exports.useMemoryMonitor=Od;exports.useMemoryMonitorPerf=Kf;exports.useNaturalLanguageFilter=Cu;exports.useNiceA11y=wl;exports.useNiceAI=ye;exports.useNiceAccessMode=ul;exports.useNiceCollapse=sl;exports.useNiceDataSource=of;exports.useNiceDisplayStyle=Vi;exports.useNiceField=sf;exports.useNiceFullscreen=Gc;exports.useNiceHelp=fn;exports.useNiceLookupSource=cf;exports.useNiceRTL=ll;exports.useNiceRecord=zn;exports.useNiceTheme=Uc;exports.useNiceTransition=ol;exports.useNiceTutorials=bn;exports.useNiceTutorialsEnabled=tu;exports.useOptimistic=$f;exports.useOrientation=Zc;exports.usePan=gl;exports.usePinch=pl;exports.useProgressiveImage=Ei;exports.usePullToRefresh=Na;exports.useRenderCount=vd;exports.useResolvedDisplayStyle=De;exports.useResponsiveValue=qc;exports.useRestoreFocus=El;exports.useRouteAnnouncement=Fl;exports.useRovingTabIndex=Cl;exports.useSafeAbortController=on;exports.useSafeAreaInsets=el;exports.useSafeEventListener=Fd;exports.useSafeFetch=Dd;exports.useSafeInterval=Ld;exports.useSafeState=Id;exports.useSafeSubscription=Pd;exports.useSafeTimeout=Rd;exports.useSafeWebSocket=$d;exports.useSharedImageObserver=Ii;exports.useShowAt=Qc;exports.useSpatialFocusable=zi;exports.useSpatialNav=um;exports.useSpatialNavOptional=dm;exports.useSubmitOnEnter=Il;exports.useSwipe=ml;exports.useTextImprovement=Au;exports.useThemeIsDark=Ef;exports.useThemeVariants=hi;exports.useTransitionState=Ff;exports.useUnmountLog=Hd;exports.useVirtualGrid=If;exports.useVirtualKeyboard=Sl;exports.useVirtualScroll=Si;exports.useVoiceControl=Ll;exports.useWhyDidYouRender=Za;exports.useWindowedList=Rf;exports.useWorker=zf;exports.useWorkerPool=Hf;exports.validateData=rf;exports.validateViewDocument=Af;exports.vhsTracking=ni;exports.vogueDidone=ii;exports.warnControlledClash=Fi;exports.watercolorWash=di;exports.withCaching=Vu;exports.withCalculatedColumns=ef;exports.withCrossTabSync=df;exports.withCursorPagination=Uu;exports.withLeakTracking=zd;exports.withOptimisticUpdates=Yu;exports.withPolling=Ju;exports.withWhyDidYouRender=bd;exports.wouldCreateCycle=Cc;exports.y2kAqua=si;exports.zenMinimal=Os;exports.zinePunk=li;