stoop 0.1.0 → 0.2.1

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.
Files changed (83) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +142 -51
  3. package/dist/api/create-theme.d.ts +13 -0
  4. package/dist/api/css.d.ts +16 -0
  5. package/dist/api/global-css.d.ts +18 -0
  6. package/dist/api/keyframes.d.ts +16 -0
  7. package/dist/api/provider.d.ts +19 -0
  8. package/dist/api/styled.d.ts +41 -0
  9. package/dist/api/use-theme.d.ts +13 -0
  10. package/dist/constants.d.ts +21 -0
  11. package/dist/core/cache.d.ts +39 -0
  12. package/dist/core/compiler.d.ts +19 -0
  13. package/dist/core/theme-manager.d.ts +30 -0
  14. package/dist/core/variants.d.ts +15 -0
  15. package/dist/create-stoop.d.ts +12 -0
  16. package/dist/index.d.ts +6 -6
  17. package/dist/index.js +13 -156
  18. package/dist/inject/browser.d.ts +59 -0
  19. package/dist/inject/dedup.d.ts +29 -0
  20. package/dist/inject/index.d.ts +41 -0
  21. package/dist/inject/ssr.d.ts +28 -0
  22. package/dist/types/index.d.ts +141 -0
  23. package/dist/types/react-polymorphic-types.d.ts +17 -0
  24. package/dist/utils/string.d.ts +102 -0
  25. package/dist/utils/theme-map.d.ts +25 -0
  26. package/dist/utils/theme-validation.d.ts +13 -0
  27. package/dist/utils/theme.d.ts +43 -0
  28. package/dist/utils/type-guards.d.ts +26 -0
  29. package/dist/utils/utilities.d.ts +14 -0
  30. package/package.json +65 -41
  31. package/dist/components/Badge/index.d.ts +0 -13
  32. package/dist/components/Badge/styles.d.ts +0 -3
  33. package/dist/components/Badge/types.d.ts +0 -13
  34. package/dist/components/Button/index.d.ts +0 -14
  35. package/dist/components/Button/styles.d.ts +0 -6
  36. package/dist/components/Button/types.d.ts +0 -22
  37. package/dist/components/Card/index.d.ts +0 -14
  38. package/dist/components/Card/styles.d.ts +0 -16
  39. package/dist/components/Card/types.d.ts +0 -18
  40. package/dist/components/Input/index.d.ts +0 -13
  41. package/dist/components/Input/styles.d.ts +0 -3
  42. package/dist/components/Input/types.d.ts +0 -8
  43. package/dist/components/Menu/index.d.ts +0 -13
  44. package/dist/components/Menu/styles.d.ts +0 -9
  45. package/dist/components/Menu/types.d.ts +0 -26
  46. package/dist/components/Modal/index.d.ts +0 -14
  47. package/dist/components/Modal/styles.d.ts +0 -14
  48. package/dist/components/Modal/types.d.ts +0 -18
  49. package/dist/components/Popover/index.d.ts +0 -13
  50. package/dist/components/Popover/styles.d.ts +0 -4
  51. package/dist/components/Popover/types.d.ts +0 -16
  52. package/dist/components/Provider/GlobalStyles.d.ts +0 -10
  53. package/dist/components/Provider/StoopProvider.d.ts +0 -41
  54. package/dist/components/Provider/index.d.ts +0 -2
  55. package/dist/components/Section/index.d.ts +0 -15
  56. package/dist/components/Section/styles.d.ts +0 -5
  57. package/dist/components/Section/types.d.ts +0 -20
  58. package/dist/components/Select/index.d.ts +0 -13
  59. package/dist/components/Select/styles.d.ts +0 -7
  60. package/dist/components/Select/types.d.ts +0 -30
  61. package/dist/components/Stack/index.d.ts +0 -16
  62. package/dist/components/Stack/styles.d.ts +0 -10
  63. package/dist/components/Stack/types.d.ts +0 -42
  64. package/dist/components/Tabs/index.d.ts +0 -13
  65. package/dist/components/Tabs/styles.d.ts +0 -8
  66. package/dist/components/Tabs/types.d.ts +0 -20
  67. package/dist/components/Text/index.d.ts +0 -14
  68. package/dist/components/Text/styles.d.ts +0 -4
  69. package/dist/components/Text/types.d.ts +0 -21
  70. package/dist/components/Textarea/index.d.ts +0 -15
  71. package/dist/components/Textarea/styles.d.ts +0 -3
  72. package/dist/components/Textarea/types.d.ts +0 -10
  73. package/dist/components/index.d.ts +0 -27
  74. package/dist/hooks/index.d.ts +0 -5
  75. package/dist/hooks/useBreakpoints.d.ts +0 -14
  76. package/dist/hooks/useEventListener.d.ts +0 -6
  77. package/dist/hooks/useFloating.d.ts +0 -18
  78. package/dist/hooks/useOutsideClick.d.ts +0 -6
  79. package/dist/hooks/usePortal.d.ts +0 -9
  80. package/dist/styles/compiler.d.ts +0 -25
  81. package/dist/styles/index.d.ts +0 -2
  82. package/dist/styles/theme.d.ts +0 -495
  83. package/dist/styles/types.d.ts +0 -66
package/dist/index.js CHANGED
@@ -1,156 +1,13 @@
1
- var{defineProperty:g0,getOwnPropertyNames:$2,getOwnPropertyDescriptor:q2}=Object,J2=Object.prototype.hasOwnProperty;var Y$=new WeakMap,Z2=($)=>{var q=Y$.get($),J;if(q)return q;if(q=g0({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function")$2($).map((Z)=>!J2.call(q,Z)&&g0(q,Z,{get:()=>$[Z],enumerable:!(J=q2($,Z))||J.enumerable}));return Y$.set($,q),q};var G2=($,q)=>{for(var J in q)g0($,J,{get:q[J],enumerable:!0,configurable:!0,set:(Z)=>q[J]=()=>Z})};var f0=($,q)=>()=>($&&(q=$($=0)),q);function W$($,q){let J={};for(let Z in q)J[Z]=`theme.${$}.${Z}`;return J}var p0,Q2,m0,S,b,d0,c0,r0,l0,o0,i0,L0,s,U2,H$,j6;var C=f0(()=>{p0={background:"#F5F5F5",border:"rgba(214, 209, 204, 0.5)",brand:"rgb(255, 140, 0)",fill:"#fff",hover:"rgba(214, 209, 204, 0.25)",overlay:"rgba(0, 0, 0, 0.5)",text:"#000"},Q2={background:"#1a1a1a",border:"rgba(255, 255, 255, 0.1)",brand:"rgb(255, 140, 0)",fill:"#2a2a2a",hover:"rgba(255, 255, 255, 0.05)",overlay:"rgba(0, 0, 0, 0.8)",text:"#fff"},m0=p0,S={large:"1200px",medium:"1024px",small:"768px"},b={huge:"48px",large:"24px",larger:"32px",massive:"64px",medium:"16px",small:"8px",smaller:"4px"},d0={default:"'Standard Book', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif",heading:"'Standard Bold', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif"},c0={bold:"700",div:"inherit",h1:"clamp(2rem, 1.75rem + 1vw, 3rem)",h2:"clamp(1.75rem, 1.5rem + 0.75vw, 2.5rem)",h3:"clamp(1.5rem, 1.25rem + 0.75vw, 2rem)",h4:"clamp(1.25rem, 1.125rem + 0.5vw, 1.5rem)",h5:"clamp(1.125rem, 1rem + 0.5vw, 1.25rem)",h6:"clamp(1rem, 0.9375rem + 0.25vw, 1.125rem)",label:"clamp(0.8125rem, 0.75rem + 0.25vw, 0.875rem)",medium:"500",micro:"clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem)",normalHeight:"1.4",normalWeight:"400",p:"clamp(0.9375rem, 0.875rem + 0.25vw, 1rem)",relaxed:"1.6",semibold:"600",small:"clamp(0.8125rem, 0.75rem + 0.25vw, 0.875rem)",span:"inherit",strong:"inherit",tight:"1.2"},r0={default:"all 0.2s ease",fast:"all 0.15s ease",slow:"all 0.3s ease",spring:"all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275)"},l0={disabled:"0.5",light:"0.55",muted:"0.7",overlay:"0.8"},o0={base:1,dropdown:10,modal:40,popover:30,toast:50,tooltip:20},i0={medium:"6px",none:"0px",small:"3px"},L0={large:`@media (min-width: ${S.medium})`,medium:`@media (min-width: ${S.small}) and (max-width: ${S.medium})`,small:`@media (max-width: ${S.small})`},s={borderRadius:i0,breakpoints:S,colors:p0,fonts:d0,media:L0,opacities:l0,spacing:b,transitions:r0,typography:c0,zIndices:o0},U2={borderRadius:i0,breakpoints:S,colors:Q2,fonts:d0,media:L0,opacities:l0,spacing:b,transitions:r0,typography:c0,zIndices:o0},H$={dark:U2,light:s};j6={borderRadius:i0,breakpoints:S,colors:W$("colors",p0),fonts:d0,media:L0,opacities:l0,spacing:W$("spacing",b),transitions:r0,typography:c0,zIndices:o0}});function L$($=s){let{colors:q,fonts:J,transitions:Z,typography:G}=$;return`
2
- /* Custom font loading */
3
- @font-face {
4
- font-family: 'Standard Book';
5
- src: url('./fonts/standard-book.woff2') format('woff2');
6
- font-weight: 400;
7
- font-style: normal;
8
- font-display: swap;
9
- }
10
-
11
- @font-face {
12
- font-family: 'Standard Bold';
13
- src: url('./fonts/standard-bold.woff2') format('woff2');
14
- font-weight: 700;
15
- font-style: normal;
16
- font-display: swap;
17
- }
18
-
19
- /* CSS Reset */
20
- *, *::before, *::after {
21
- box-sizing: border-box;
22
- margin: 0;
23
- padding: 0;
24
- }
25
-
26
- /* Base HTML styles with design tokens */
27
- html {
28
- font-family: ${J.default};
29
- font-size: ${G.p};
30
- line-height: ${G.normalHeight};
31
- -webkit-text-size-adjust: 100%;
32
- -webkit-font-smoothing: antialiased;
33
- -moz-osx-font-smoothing: grayscale;
34
- scroll-behavior: smooth;
35
- }
36
-
37
- body {
38
- color: ${q.text};
39
- background-color: ${q.background};
40
- font-family: ${J.default};
41
- line-height: ${G.normalHeight};
42
- text-rendering: optimizeLegibility;
43
- overflow-x: hidden;
44
- transition: background-color 0.2s ease, color 0.2s ease;
45
- }
46
-
47
- /* Remove default button styles - inherit font from design system */
48
- button {
49
- background: none;
50
- border: none;
51
- font-family: inherit;
52
- font-size: inherit;
53
- line-height: inherit;
54
- cursor: pointer;
55
- transition: ${Z.default};
56
- }
57
-
58
- /* Remove default input styles - inherit font from design system */
59
- input, textarea, select {
60
- font-family: inherit;
61
- font-size: inherit;
62
- line-height: inherit;
63
- border: none;
64
- outline: none;
65
- background: none;
66
- transition: ${Z.default};
67
- }
68
-
69
- /* Remove default list styles */
70
- ul, ol {
71
- list-style: none;
72
- }
73
-
74
- /* Remove default link styles */
75
- a {
76
- color: inherit;
77
- text-decoration: none;
78
- transition: ${Z.default};
79
- }
80
-
81
- /* Consistent focus styles across all interactive elements */
82
- *:focus-visible {
83
- outline: 2px solid ${q.brand};
84
- outline-offset: 2px;
85
- }
86
-
87
- /* Brand selection styles */
88
- ::selection {
89
- background-color: ${q.brand};
90
- color: ${q.fill};
91
- }
92
-
93
- /* Scrollbar styles (webkit) */
94
- ::-webkit-scrollbar {
95
- width: 8px;
96
- height: 8px;
97
- }
98
-
99
- ::-webkit-scrollbar-track {
100
- background: ${q.border};
101
- }
102
-
103
- ::-webkit-scrollbar-thumb {
104
- background: ${q.text};
105
- border-radius: 4px;
106
- }
107
-
108
- ::-webkit-scrollbar-thumb:hover {
109
- background: ${q.brand};
110
- }
111
-
112
- /* Base typography scale using design tokens - all sizes inherit from design system */
113
- h1, h2, h3, h4, h5, h6 {
114
- font-family: ${J.heading};
115
- font-weight: ${G.bold};
116
- line-height: ${G.tight};
117
- margin: 0; /* Reset margins - components handle their own spacing */
118
- }
119
-
120
- h1 { font-size: ${G.h1}; }
121
- h2 { font-size: ${G.h2}; }
122
- h3 { font-size: ${G.h3}; }
123
- h4 { font-size: ${G.h4}; }
124
- h5 { font-size: ${G.h5}; }
125
- h6 { font-size: ${G.h6}; }
126
-
127
- p {
128
- font-family: ${J.default};
129
- font-size: ${G.p};
130
- line-height: ${G.relaxed};
131
- margin: 0; /* Reset margins - components handle their own spacing */
132
- }
133
-
134
- small {
135
- font-size: ${G.small};
136
- line-height: ${G.normalHeight};
137
- }
138
-
139
- strong {
140
- font-family: ${J.heading};
141
- font-weight: ${G.bold};
142
- }
143
-
144
- /* Utility classes */
145
- .sr-only {
146
- position: absolute;
147
- width: 1px;
148
- height: 1px;
149
- padding: 0;
150
- margin: -1px;
151
- overflow: hidden;
152
- clip: rect(0, 0, 0, 0);
153
- white-space: nowrap;
154
- border: 0;
155
- }
156
- `}function a0($=s){if(typeof document==="undefined")return;let q=document.getElementById("stoop-global-styles");if(q)q.remove();let J=document.createElement("style");J.id="stoop-global-styles",J.textContent=L$($),document.head.appendChild(J)}var s0=f0(()=>{C()});var M$={};G2(M$,{useTheme:()=>n0,useStoopConfig:()=>I$,StoopProvider:()=>j0,StoopContext:()=>B0});import{createContext as X2,useContext as F$,useEffect as B$,useState as K2}from"react";import{jsxDEV as W2}from"react/jsx-dev-runtime";function Y2(){if(typeof window==="undefined")return null;try{return localStorage.getItem("stoop-theme")}catch{return null}}function z$($){if(typeof window==="undefined")return;try{localStorage.setItem("stoop-theme",$)}catch{}}function j0({children:$,config:q={injectGlobalStyles:!0,theme:"light"}}){let[J,Z]=K2(()=>{return Y2()||q.theme||"light"}),G=H$[J],X={...q,currentTheme:G,setTheme:(K)=>{Z(K),z$(K)},themeName:J,toggleTheme:()=>{Z((K)=>{let Y=K==="light"?"dark":"light";return z$(Y),Y})}};return B$(()=>{if(q.injectGlobalStyles!==!1)a0(G);if(q.customCSS){let K=document.createElement("style");return K.id="stoop-custom-styles",K.textContent=q.customCSS,document.head.appendChild(K),()=>{let Y=document.getElementById("stoop-custom-styles");if(Y)Y.remove()}}},[q.injectGlobalStyles,q.customCSS,G]),B$(()=>{return document.body.setAttribute("data-theme",J),()=>{document.body.removeAttribute("data-theme")}},[J]),W2(B0.Provider,{value:X,children:$},void 0,!1,void 0,this)}function I$(){let $=F$(B0);if(!$)throw new Error("useStoopConfig must be used within a StoopProvider");return $}function n0(){let $=F$(B0);if(!$)throw new Error("useTheme must be used within a StoopProvider");return{setTheme:$.setTheme,theme:$.currentTheme,themeName:$.themeName,toggleTheme:$.toggleTheme}}var B0;var t0=f0(()=>{C();s0();B0=X2({currentTheme:s,injectGlobalStyles:!0,setTheme:()=>{},theme:"light",themeName:"light",toggleTheme:()=>{}})});t0();s0();C();import{useMemo as _$,forwardRef as H2,createElement as L2,useContext as B2,createContext as z2}from"react";var N$=new Set,D0=Object.freeze({}),T0=null;function F2(){if(!T0)try{return T0=(t0(),Z2(M$)).StoopContext,T0}catch{return null}return T0}function I2($){let q=0;for(let J=0;J<$.length;J++){let Z=$.charCodeAt(J);q=(q<<5)-q+Z,q=q&q}return Math.abs(q).toString(36)}function M2($){return $.replace(/([A-Z])/g,"-$1").toLowerCase()}function V$($,q){if($.startsWith("theme.")){if($.startsWith("theme.colors.")){let J=$.replace("theme.colors.","");return q.colors[J]||$}if($.startsWith("theme.spacing.")){let J=$.replace("theme.spacing.","");return q.spacing[J]||$}return $}if($.startsWith("$")){let J=$.slice(1);if(J.startsWith("colors.")){let Z=J.replace("colors.","");return q.colors[Z]||$}if(J.startsWith("spacing.")){let Z=J.replace("spacing.","");return q.spacing[Z]||$}if(J.startsWith("zIndices.")){let Z=J.replace("zIndices.","");return q.zIndices[Z]?.toString()||$}if(J in q.colors)return q.colors[J];if(J in q.spacing)return q.spacing[J];if(J in q.zIndices)return q.zIndices[J].toString()}return $}function _2($,q){if(!$.includes(" ")&&($.startsWith("theme.")||$.startsWith("$")))return V$($,q);return $.replace(/(\$[a-zA-Z][a-zA-Z0-9]*(?:\.[a-zA-Z][a-zA-Z0-9]*)?|theme\.[a-zA-Z][a-zA-Z0-9]*\.[a-zA-Z][a-zA-Z0-9]*)/g,(J)=>{return V$(J,q)})}function b0($,q){if(!$||typeof $!=="object")return $;let J={};return Object.entries($).forEach(([Z,G])=>{if(typeof G==="object"&&G!==null)J[Z]=b0(G,q);else if(typeof G==="string"&&(G.includes("theme.")||G.includes("$")))J[Z]=_2(G,q);else J[Z]=G}),J}function $0($,q="",J=0){if(J>10)return console.warn("CSS nesting depth exceeded 10 levels - possible circular reference"),"";let Z="",G="";return Object.entries($).forEach(([U,X])=>{if(typeof X==="object"&&X!==null){if(U==="small"||U==="medium"||U==="large"){let K=L0[U],Y=$0(X,q,J+1);G+=`${K} { ${Y} }`}else if(U.startsWith("@")){let K=$0(X,q,J+1);G+=`${U} { ${K} }`}else if(U.includes("&")){let K=U.replace(/&/g,q),Y=$0(X,K,J+1);G+=Y}else if(U.startsWith(":")){let K=`${q}${U}`,Y=$0(X,K,J+1);G+=Y}else if(U.includes(" ")||U.includes(">")||U.includes("+")||U.includes("~")){let K=`${q} ${U}`,Y=$0(X,K,J+1);G+=Y}}else if(X!==void 0){let K=M2(U);Z+=`${K}: ${X}; `}}),(Z?`${q} { ${Z}}`:"")+G}function N2($){if(typeof document==="undefined"||N$.has($))return;N$.add($);let q=document.createElement("style");q.textContent=$,document.head.appendChild(q)}function P0($){let q=$0($),J=`css-${I2(q)}`,Z=$0($,`.${J}`,0);return N2(Z),J}function V2($,q,J=D0){let Z={...J};return Object.entries($).forEach(([G,Q])=>{let U=q[G];if(U&&typeof U==="string"&&Q[U])Z={...Z,...Q[U]};else if(U===!0&&Q.true)Z={...Z,...Q.true};else if(U===!1&&Q.false)Z={...Z,...Q.false}}),P0(Z)}function M($,q=D0,J){return H2(function Z({as:G,className:Q,css:U,...X},K){let Y=G||$,H=U&&typeof U==="object"?U:D0,W={},L={};if(J)Object.entries(X).forEach(([V,F])=>{if(V in J)W[V]=F;else L[V]=F});else Object.assign(L,X);let B=F2(),z=B2(B||z2(null))?.currentTheme||s,N=_$(()=>{let V=b0(q,z),F=J?Object.fromEntries(Object.entries(J).map(([T,A])=>[T,Object.fromEntries(Object.entries(A).map(([v,P])=>[v,b0(P,z)]))])):void 0;return F?V2(F,W,V):P0(V)},[J,W,q,z]),_=_$(()=>{if(H!==D0){let V=b0(H,z);return P0(V)}return""},[H,z]),j=[N,_,Q].filter(Boolean).join(" ")||void 0;return L2(Y,{...L,className:j,ref:K})})}C();C();import{useState as j2,useEffect as T2}from"react";var U0={large:parseInt(S.large),medium:parseInt(S.medium),small:parseInt(S.small)};function D2($){if($<U0.small)return"small";else if($<U0.medium)return"medium";else return"large"}function b2(){let[$,q]=j2("large");return T2(()=>{let Q=()=>{if(typeof window!=="undefined"){let U=D2(window.innerWidth);q(U)}};return Q(),window.addEventListener("resize",Q),()=>{window.removeEventListener("resize",Q)}},[]),{current:$,down:(Q)=>{let U=U0[$],X=U0[Q];return U<X},is:(Q)=>$===Q,isLarge:$==="large",isMedium:$==="medium",isSmall:$==="small",up:(Q)=>{let U=U0[$],X=U0[Q];return U>=X}}}import{useEffect as P2,useRef as E2}from"react";import{createPortal as A2}from"react-dom";function d($){let q=E2(null);P2(()=>{let Z=document.createElement("div");Z.style.position="relative",Z.style.zIndex="9999";let G;if(typeof $==="string")G=document.querySelector($)||document.body;else if($ instanceof HTMLElement)G=$;else{let Q=document.querySelectorAll("main");G=Q.length===1?Q[0]:document.body}return G.appendChild(Z),q.current=Z,()=>{if(Z.parentNode)Z.parentNode.removeChild(Z);q.current=null}},[$]);let J=(Z)=>{if(!q.current)return null;return A2(Z,q.current)};return{portalElement:q.current,renderPortal:J}}import{useEffect as j$,useRef as C2}from"react";function x($,q,J,Z){let G=C2(q);j$(()=>{G.current=q},[q]),j$(()=>{let Q=null;if(!J)Q=window;else if("current"in J)Q=J.current;else Q=J;if(!Q)return;let U=(X)=>{G.current(X)};return Q.addEventListener($,U,Z),()=>{Q?.removeEventListener($,U,Z)}},[$,J,Z])}function c($,q,J="mousedown"){x(J,(Z)=>{let G=$.current,Q=Z.target;if(!G)return;if(G.contains(Q))return;q(Z)})}var{min:X0,max:r,round:F0,floor:I0}=Math,w=($)=>({x:$,y:$}),R2={left:"right",right:"left",bottom:"top",top:"bottom"},O2={start:"end",end:"start"};function e0($,q,J){return r($,X0(q,J))}function q0($,q){return typeof $==="function"?$(q):$}function l($){return $.split("-")[0]}function M0($){return $.split("-")[1]}function A0($){return $==="x"?"y":"x"}function $$($){return $==="y"?"height":"width"}var k2=new Set(["top","bottom"]);function h($){return k2.has(l($))?"y":"x"}function q$($){return A0(h($))}function b$($,q,J){if(J===void 0)J=!1;let Z=M0($),G=q$($),Q=$$(G),U=G==="x"?Z===(J?"end":"start")?"right":"left":Z==="start"?"bottom":"top";if(q.reference[Q]>q.floating[Q])U=z0(U);return[U,z0(U)]}function P$($){let q=z0($);return[E0($),q,E0(q)]}function E0($){return $.replace(/start|end/g,(q)=>O2[q])}var T$=["left","right"],D$=["right","left"],S2=["top","bottom"],x2=["bottom","top"];function w2($,q,J){switch($){case"top":case"bottom":if(J)return q?D$:T$;return q?T$:D$;case"left":case"right":return q?S2:x2;default:return[]}}function E$($,q,J,Z){let G=M0($),Q=w2(l($),J==="start",Z);if(G){if(Q=Q.map((U)=>U+"-"+G),q)Q=Q.concat(Q.map(E0))}return Q}function z0($){return $.replace(/left|right|bottom|top/g,(q)=>R2[q])}function y2($){return{top:0,right:0,bottom:0,left:0,...$}}function A$($){return typeof $!=="number"?y2($):{top:$,right:$,bottom:$,left:$}}function J0($){let{x:q,y:J,width:Z,height:G}=$;return{width:Z,height:G,top:J,left:q,right:q+Z,bottom:J+G,x:q,y:J}}function C$($,q,J){let{reference:Z,floating:G}=$,Q=h(q),U=q$(q),X=$$(U),K=l(q),Y=Q==="y",H=Z.x+Z.width/2-G.width/2,W=Z.y+Z.height/2-G.height/2,L=Z[X]/2-G[X]/2,B;switch(K){case"top":B={x:H,y:Z.y-G.height};break;case"bottom":B={x:H,y:Z.y+Z.height};break;case"right":B={x:Z.x+Z.width,y:W};break;case"left":B={x:Z.x-G.width,y:W};break;default:B={x:Z.x,y:Z.y}}switch(M0(q)){case"start":B[U]-=L*(J&&Y?-1:1);break;case"end":B[U]+=L*(J&&Y?-1:1);break}return B}var R$=async($,q,J)=>{let{placement:Z="bottom",strategy:G="absolute",middleware:Q=[],platform:U}=J,X=Q.filter(Boolean),K=await(U.isRTL==null?void 0:U.isRTL(q)),Y=await U.getElementRects({reference:$,floating:q,strategy:G}),{x:H,y:W}=C$(Y,Z,K),L=Z,B={},I=0;for(let z=0;z<X.length;z++){let{name:N,fn:_}=X[z],{x:j,y:V,data:F,reset:T}=await _({x:H,y:W,initialPlacement:Z,placement:L,strategy:G,middlewareData:B,rects:Y,platform:U,elements:{reference:$,floating:q}});if(H=j!=null?j:H,W=V!=null?V:W,B={...B,[N]:{...B[N],...F}},T&&I<=50){if(I++,typeof T==="object"){if(T.placement)L=T.placement;if(T.rects)Y=T.rects===!0?await U.getElementRects({reference:$,floating:q,strategy:G}):T.rects;({x:H,y:W}=C$(Y,L,K))}z=-1}}return{x:H,y:W,placement:L,strategy:G,middlewareData:B}};async function J$($,q){var J;if(q===void 0)q={};let{x:Z,y:G,platform:Q,rects:U,elements:X,strategy:K}=$,{boundary:Y="clippingAncestors",rootBoundary:H="viewport",elementContext:W="floating",altBoundary:L=!1,padding:B=0}=q0(q,$),I=A$(B),N=X[L?W==="floating"?"reference":"floating":W],_=J0(await Q.getClippingRect({element:((J=await(Q.isElement==null?void 0:Q.isElement(N)))!=null?J:!0)?N:N.contextElement||await(Q.getDocumentElement==null?void 0:Q.getDocumentElement(X.floating)),boundary:Y,rootBoundary:H,strategy:K})),j=W==="floating"?{x:Z,y:G,width:U.floating.width,height:U.floating.height}:U.reference,V=await(Q.getOffsetParent==null?void 0:Q.getOffsetParent(X.floating)),F=await(Q.isElement==null?void 0:Q.isElement(V))?await(Q.getScale==null?void 0:Q.getScale(V))||{x:1,y:1}:{x:1,y:1},T=J0(Q.convertOffsetParentRelativeRectToViewportRelativeRect?await Q.convertOffsetParentRelativeRectToViewportRelativeRect({elements:X,rect:j,offsetParent:V,strategy:K}):j);return{top:(_.top-T.top+I.top)/F.y,bottom:(T.bottom-_.bottom+I.bottom)/F.y,left:(_.left-T.left+I.left)/F.x,right:(T.right-_.right+I.right)/F.x}}var O$=function($){if($===void 0)$={};return{name:"flip",options:$,async fn(q){var J,Z;let{placement:G,middlewareData:Q,rects:U,initialPlacement:X,platform:K,elements:Y}=q,{mainAxis:H=!0,crossAxis:W=!0,fallbackPlacements:L,fallbackStrategy:B="bestFit",fallbackAxisSideDirection:I="none",flipAlignment:z=!0,...N}=q0($,q);if((J=Q.arrow)!=null&&J.alignmentOffset)return{};let _=l(G),j=h(X),V=l(X)===X,F=await(K.isRTL==null?void 0:K.isRTL(Y.floating)),T=L||(V||!z?[z0(X)]:P$(X)),A=I!=="none";if(!L&&A)T.push(...E$(X,z,I,F));let v=[X,...T],P=await J$(q,N),i=[],p=((Z=Q.flip)==null?void 0:Z.overflows)||[];if(H)i.push(P[_]);if(W){let t=b$(G,U,F);i.push(P[t[0]],P[t[1]])}if(p=[...p,{placement:G,overflows:i}],!i.every((t)=>t<=0)){var v0,D;let t=(((v0=Q.flip)==null?void 0:v0.index)||0)+1,h0=v[t];if(h0){if(!(W==="alignment"?j!==h(h0):!1)||p.every((k)=>h(k.placement)===j?k.overflows[0]>0:!0))return{data:{index:t,overflows:p},reset:{placement:h0}}}let H0=(D=p.filter((e)=>e.overflows[0]<=0).sort((e,k)=>e.overflows[1]-k.overflows[1])[0])==null?void 0:D.placement;if(!H0)switch(B){case"bestFit":{var m;let e=(m=p.filter((k)=>{if(A){let a=h(k.placement);return a===j||a==="y"}return!0}).map((k)=>[k.placement,k.overflows.filter((a)=>a>0).reduce((a,e1)=>a+e1,0)]).sort((k,a)=>k[1]-a[1])[0])==null?void 0:m[0];if(e)H0=e;break}case"initialPlacement":H0=X;break}if(G!==H0)return{reset:{placement:H0}}}return{}}}};var k$=new Set(["left","top"]);async function u2($,q){let{placement:J,platform:Z,elements:G}=$,Q=await(Z.isRTL==null?void 0:Z.isRTL(G.floating)),U=l(J),X=M0(J),K=h(J)==="y",Y=k$.has(U)?-1:1,H=Q&&K?-1:1,W=q0(q,$),{mainAxis:L,crossAxis:B,alignmentAxis:I}=typeof W==="number"?{mainAxis:W,crossAxis:0,alignmentAxis:null}:{mainAxis:W.mainAxis||0,crossAxis:W.crossAxis||0,alignmentAxis:W.alignmentAxis};if(X&&typeof I==="number")B=X==="end"?I*-1:I;return K?{x:B*H,y:L*Y}:{x:L*Y,y:B*H}}var S$=function($){if($===void 0)$=0;return{name:"offset",options:$,async fn(q){var J,Z;let{x:G,y:Q,placement:U,middlewareData:X}=q,K=await u2(q,$);if(U===((J=X.offset)==null?void 0:J.placement)&&(Z=X.arrow)!=null&&Z.alignmentOffset)return{};return{x:G+K.x,y:Q+K.y,data:{...K,placement:U}}}}},x$=function($){if($===void 0)$={};return{name:"shift",options:$,async fn(q){let{x:J,y:Z,placement:G}=q,{mainAxis:Q=!0,crossAxis:U=!1,limiter:X={fn:(N)=>{let{x:_,y:j}=N;return{x:_,y:j}}},...K}=q0($,q),Y={x:J,y:Z},H=await J$(q,K),W=h(l(G)),L=A0(W),B=Y[L],I=Y[W];if(Q){let N=L==="y"?"top":"left",_=L==="y"?"bottom":"right",j=B+H[N],V=B-H[_];B=e0(j,B,V)}if(U){let N=W==="y"?"top":"left",_=W==="y"?"bottom":"right",j=I+H[N],V=I-H[_];I=e0(j,I,V)}let z=X.fn({...q,[L]:B,[W]:I});return{...z,data:{x:z.x-J,y:z.y-Z,enabled:{[L]:Q,[W]:U}}}}}},w$=function($){if($===void 0)$={};return{options:$,fn(q){let{x:J,y:Z,placement:G,rects:Q,middlewareData:U}=q,{offset:X=0,mainAxis:K=!0,crossAxis:Y=!0}=q0($,q),H={x:J,y:Z},W=h(G),L=A0(W),B=H[L],I=H[W],z=q0(X,q),N=typeof z==="number"?{mainAxis:z,crossAxis:0}:{mainAxis:0,crossAxis:0,...z};if(K){let V=L==="y"?"height":"width",F=Q.reference[L]-Q.floating[V]+N.mainAxis,T=Q.reference[L]+Q.reference[V]-N.mainAxis;if(B<F)B=F;else if(B>T)B=T}if(Y){var _,j;let V=L==="y"?"width":"height",F=k$.has(l(G)),T=Q.reference[W]-Q.floating[V]+(F?((_=U.offset)==null?void 0:_[W])||0:0)+(F?0:N.crossAxis),A=Q.reference[W]+Q.reference[V]+(F?0:((j=U.offset)==null?void 0:j[W])||0)-(F?N.crossAxis:0);if(I<T)I=T;else if(I>A)I=A}return{[L]:B,[W]:I}}}};function C0(){return typeof window!=="undefined"}function Z0($){if(u$($))return($.nodeName||"").toLowerCase();return"#document"}function E($){var q;return($==null||(q=$.ownerDocument)==null?void 0:q.defaultView)||window}function y($){var q;return(q=(u$($)?$.ownerDocument:$.document)||window.document)==null?void 0:q.documentElement}function u$($){if(!C0())return!1;return $ instanceof Node||$ instanceof E($).Node}function R($){if(!C0())return!1;return $ instanceof Element||$ instanceof E($).Element}function u($){if(!C0())return!1;return $ instanceof HTMLElement||$ instanceof E($).HTMLElement}function y$($){if(!C0()||typeof ShadowRoot==="undefined")return!1;return $ instanceof ShadowRoot||$ instanceof E($).ShadowRoot}var v2=new Set(["inline","contents"]);function Y0($){let{overflow:q,overflowX:J,overflowY:Z,display:G}=O($);return/auto|scroll|overlay|hidden|clip/.test(q+Z+J)&&!v2.has(G)}var h2=new Set(["table","td","th"]);function v$($){return h2.has(Z0($))}var g2=[":popover-open",":modal"];function _0($){return g2.some((q)=>{try{return $.matches(q)}catch(J){return!1}})}var f2=["transform","translate","scale","rotate","perspective"],p2=["transform","translate","scale","rotate","perspective","filter"],m2=["paint","layout","strict","content"];function R0($){let q=O0(),J=R($)?O($):$;return f2.some((Z)=>J[Z]?J[Z]!=="none":!1)||(J.containerType?J.containerType!=="normal":!1)||!q&&(J.backdropFilter?J.backdropFilter!=="none":!1)||!q&&(J.filter?J.filter!=="none":!1)||p2.some((Z)=>(J.willChange||"").includes(Z))||m2.some((Z)=>(J.contain||"").includes(Z))}function h$($){let q=o($);while(u(q)&&!G0(q)){if(R0(q))return q;else if(_0(q))return null;q=o(q)}return null}function O0(){if(typeof CSS==="undefined"||!CSS.supports)return!1;return CSS.supports("-webkit-backdrop-filter","none")}var d2=new Set(["html","body","#document"]);function G0($){return d2.has(Z0($))}function O($){return E($).getComputedStyle($)}function N0($){if(R($))return{scrollLeft:$.scrollLeft,scrollTop:$.scrollTop};return{scrollLeft:$.scrollX,scrollTop:$.scrollY}}function o($){if(Z0($)==="html")return $;let q=$.assignedSlot||$.parentNode||y$($)&&$.host||y($);return y$(q)?q.host:q}function g$($){let q=o($);if(G0(q))return $.ownerDocument?$.ownerDocument.body:$.body;if(u(q)&&Y0(q))return q;return g$(q)}function K0($,q,J){var Z;if(q===void 0)q=[];if(J===void 0)J=!0;let G=g$($),Q=G===((Z=$.ownerDocument)==null?void 0:Z.body),U=E(G);if(Q){let X=k0(U);return q.concat(U,U.visualViewport||[],Y0(G)?G:[],X&&J?K0(X):[])}return q.concat(G,K0(G,[],J))}function k0($){return $.parent&&Object.getPrototypeOf($.parent)?$.frameElement:null}function m$($){let q=O($),J=parseFloat(q.width)||0,Z=parseFloat(q.height)||0,G=u($),Q=G?$.offsetWidth:J,U=G?$.offsetHeight:Z,X=F0(J)!==Q||F0(Z)!==U;if(X)J=Q,Z=U;return{width:J,height:Z,$:X}}function G$($){return!R($)?$.contextElement:$}function W0($){let q=G$($);if(!u(q))return w(1);let J=q.getBoundingClientRect(),{width:Z,height:G,$:Q}=m$(q),U=(Q?F0(J.width):J.width)/Z,X=(Q?F0(J.height):J.height)/G;if(!U||!Number.isFinite(U))U=1;if(!X||!Number.isFinite(X))X=1;return{x:U,y:X}}var c2=w(0);function d$($){let q=E($);if(!O0()||!q.visualViewport)return c2;return{x:q.visualViewport.offsetLeft,y:q.visualViewport.offsetTop}}function r2($,q,J){if(q===void 0)q=!1;if(!J||q&&J!==E($))return!1;return q}function Q0($,q,J,Z){if(q===void 0)q=!1;if(J===void 0)J=!1;let G=$.getBoundingClientRect(),Q=G$($),U=w(1);if(q)if(Z){if(R(Z))U=W0(Z)}else U=W0($);let X=r2(Q,J,Z)?d$(Q):w(0),K=(G.left+X.x)/U.x,Y=(G.top+X.y)/U.y,H=G.width/U.x,W=G.height/U.y;if(Q){let L=E(Q),B=Z&&R(Z)?E(Z):Z,I=L,z=k0(I);while(z&&Z&&B!==I){let N=W0(z),_=z.getBoundingClientRect(),j=O(z),V=_.left+(z.clientLeft+parseFloat(j.paddingLeft))*N.x,F=_.top+(z.clientTop+parseFloat(j.paddingTop))*N.y;K*=N.x,Y*=N.y,H*=N.x,W*=N.y,K+=V,Y+=F,I=E(z),z=k0(I)}}return J0({width:H,height:W,x:K,y:Y})}function Q$($,q){let J=N0($).scrollLeft;if(!q)return Q0(y($)).left+J;return q.left+J}function c$($,q,J){if(J===void 0)J=!1;let Z=$.getBoundingClientRect(),G=Z.left+q.scrollLeft-(J?0:Q$($,Z)),Q=Z.top+q.scrollTop;return{x:G,y:Q}}function l2($){let{elements:q,rect:J,offsetParent:Z,strategy:G}=$,Q=G==="fixed",U=y(Z),X=q?_0(q.floating):!1;if(Z===U||X&&Q)return J;let K={scrollLeft:0,scrollTop:0},Y=w(1),H=w(0),W=u(Z);if(W||!W&&!Q){if(Z0(Z)!=="body"||Y0(U))K=N0(Z);if(u(Z)){let B=Q0(Z);Y=W0(Z),H.x=B.x+Z.clientLeft,H.y=B.y+Z.clientTop}}let L=U&&!W&&!Q?c$(U,K,!0):w(0);return{width:J.width*Y.x,height:J.height*Y.y,x:J.x*Y.x-K.scrollLeft*Y.x+H.x+L.x,y:J.y*Y.y-K.scrollTop*Y.y+H.y+L.y}}function o2($){return Array.from($.getClientRects())}function i2($){let q=y($),J=N0($),Z=$.ownerDocument.body,G=r(q.scrollWidth,q.clientWidth,Z.scrollWidth,Z.clientWidth),Q=r(q.scrollHeight,q.clientHeight,Z.scrollHeight,Z.clientHeight),U=-J.scrollLeft+Q$($),X=-J.scrollTop;if(O(Z).direction==="rtl")U+=r(q.clientWidth,Z.clientWidth)-G;return{width:G,height:Q,x:U,y:X}}function a2($,q){let J=E($),Z=y($),G=J.visualViewport,Q=Z.clientWidth,U=Z.clientHeight,X=0,K=0;if(G){Q=G.width,U=G.height;let Y=O0();if(!Y||Y&&q==="fixed")X=G.offsetLeft,K=G.offsetTop}return{width:Q,height:U,x:X,y:K}}var s2=new Set(["absolute","fixed"]);function n2($,q){let J=Q0($,!0,q==="fixed"),Z=J.top+$.clientTop,G=J.left+$.clientLeft,Q=u($)?W0($):w(1),U=$.clientWidth*Q.x,X=$.clientHeight*Q.y,K=G*Q.x,Y=Z*Q.y;return{width:U,height:X,x:K,y:Y}}function f$($,q,J){let Z;if(q==="viewport")Z=a2($,J);else if(q==="document")Z=i2(y($));else if(R(q))Z=n2(q,J);else{let G=d$($);Z={x:q.x-G.x,y:q.y-G.y,width:q.width,height:q.height}}return J0(Z)}function r$($,q){let J=o($);if(J===q||!R(J)||G0(J))return!1;return O(J).position==="fixed"||r$(J,q)}function t2($,q){let J=q.get($);if(J)return J;let Z=K0($,[],!1).filter((X)=>R(X)&&Z0(X)!=="body"),G=null,Q=O($).position==="fixed",U=Q?o($):$;while(R(U)&&!G0(U)){let X=O(U),K=R0(U);if(!K&&X.position==="fixed")G=null;if(Q?!K&&!G:!K&&X.position==="static"&&!!G&&s2.has(G.position)||Y0(U)&&!K&&r$($,U))Z=Z.filter((H)=>H!==U);else G=X;U=o(U)}return q.set($,Z),Z}function e2($){let{element:q,boundary:J,rootBoundary:Z,strategy:G}=$,U=[...J==="clippingAncestors"?_0(q)?[]:t2(q,this._c):[].concat(J),Z],X=U[0],K=U.reduce((Y,H)=>{let W=f$(q,H,G);return Y.top=r(W.top,Y.top),Y.right=X0(W.right,Y.right),Y.bottom=X0(W.bottom,Y.bottom),Y.left=r(W.left,Y.left),Y},f$(q,X,G));return{width:K.right-K.left,height:K.bottom-K.top,x:K.left,y:K.top}}function $6($){let{width:q,height:J}=m$($);return{width:q,height:J}}function q6($,q,J){let Z=u(q),G=y(q),Q=J==="fixed",U=Q0($,!0,Q,q),X={scrollLeft:0,scrollTop:0},K=w(0);function Y(){K.x=Q$(G)}if(Z||!Z&&!Q){if(Z0(q)!=="body"||Y0(G))X=N0(q);if(Z){let B=Q0(q,!0,Q,q);K.x=B.x+q.clientLeft,K.y=B.y+q.clientTop}else if(G)Y()}if(Q&&!Z&&G)Y();let H=G&&!Z&&!Q?c$(G,X):w(0),W=U.left+X.scrollLeft-K.x-H.x,L=U.top+X.scrollTop-K.y-H.y;return{x:W,y:L,width:U.width,height:U.height}}function Z$($){return O($).position==="static"}function p$($,q){if(!u($)||O($).position==="fixed")return null;if(q)return q($);let J=$.offsetParent;if(y($)===J)J=J.ownerDocument.body;return J}function l$($,q){let J=E($);if(_0($))return J;if(!u($)){let G=o($);while(G&&!G0(G)){if(R(G)&&!Z$(G))return G;G=o(G)}return J}let Z=p$($,q);while(Z&&v$(Z)&&Z$(Z))Z=p$(Z,q);if(Z&&G0(Z)&&Z$(Z)&&!R0(Z))return J;return Z||h$($)||J}var J6=async function($){let q=this.getOffsetParent||l$,J=this.getDimensions,Z=await J($.floating);return{reference:q6($.reference,await q($.floating),$.strategy),floating:{x:0,y:0,width:Z.width,height:Z.height}}};function Z6($){return O($).direction==="rtl"}var G6={convertOffsetParentRelativeRectToViewportRelativeRect:l2,getDocumentElement:y,getClippingRect:e2,getOffsetParent:l$,getElementRects:J6,getClientRects:o2,getDimensions:$6,getScale:W0,isElement:R,isRTL:Z6};function o$($,q){return $.x===q.x&&$.y===q.y&&$.width===q.width&&$.height===q.height}function Q6($,q){let J=null,Z,G=y($);function Q(){var X;clearTimeout(Z),(X=J)==null||X.disconnect(),J=null}function U(X,K){if(X===void 0)X=!1;if(K===void 0)K=1;Q();let Y=$.getBoundingClientRect(),{left:H,top:W,width:L,height:B}=Y;if(!X)q();if(!L||!B)return;let I=I0(W),z=I0(G.clientWidth-(H+L)),N=I0(G.clientHeight-(W+B)),_=I0(H),V={rootMargin:-I+"px "+-z+"px "+-N+"px "+-_+"px",threshold:r(0,X0(1,K))||1},F=!0;function T(A){let v=A[0].intersectionRatio;if(v!==K){if(!F)return U();if(!v)Z=setTimeout(()=>{U(!1,0.0000001)},1000);else U(!1,v)}if(v===1&&!o$(Y,$.getBoundingClientRect()))U();F=!1}try{J=new IntersectionObserver(T,{...V,root:G.ownerDocument})}catch(A){J=new IntersectionObserver(T,V)}J.observe($)}return U(!0),Q}function i$($,q,J,Z){if(Z===void 0)Z={};let{ancestorScroll:G=!0,ancestorResize:Q=!0,elementResize:U=typeof ResizeObserver==="function",layoutShift:X=typeof IntersectionObserver==="function",animationFrame:K=!1}=Z,Y=G$($),H=G||Q?[...Y?K0(Y):[],...K0(q)]:[];H.forEach((_)=>{G&&_.addEventListener("scroll",J,{passive:!0}),Q&&_.addEventListener("resize",J)});let W=Y&&X?Q6(Y,J):null,L=-1,B=null;if(U){if(B=new ResizeObserver((_)=>{let[j]=_;if(j&&j.target===Y&&B)B.unobserve(q),cancelAnimationFrame(L),L=requestAnimationFrame(()=>{var V;(V=B)==null||V.observe(q)});J()}),Y&&!K)B.observe(Y);B.observe(q)}let I,z=K?Q0($):null;if(K)N();function N(){let _=Q0($);if(z&&!o$(z,_))J();z=_,I=requestAnimationFrame(N)}return J(),()=>{var _;if(H.forEach((j)=>{G&&j.removeEventListener("scroll",J),Q&&j.removeEventListener("resize",J)}),W==null||W(),(_=B)==null||_.disconnect(),B=null,K)cancelAnimationFrame(I)}}var a$=S$;var s$=x$,n$=O$;var t$=w$,e$=($,q,J)=>{let Z=new Map,G={platform:G6,...J},Q={...G.platform,_c:Z};return R$($,q,{...G,platform:Q})};import{useState as $1,useRef as U$,useEffect as q1}from"react";function V0(){let[$,q]=$1(!1),[J,Z]=$1(!1),G=U$(null),Q=U$(null),U=U$(null),X=()=>{if(!G.current||!Q.current)return;let L="fixed";e$(G.current,Q.current,{middleware:[a$(8),n$({fallbackPlacements:["bottom","top","bottom-start","top-start","bottom-end","top-end"],padding:8}),s$({limiter:t$(),padding:8})],placement:"bottom",strategy:L}).then(({x:B,y:I})=>{if(!Q.current||!G.current)return;Q.current.style.position=L,Q.current.style.left=`${Math.round(B)}px`,Q.current.style.top=`${Math.round(I)}px`,Q.current.style.visibility="visible"})},K=(L)=>{if(!L)return;L.style.position="fixed",L.style.top="0",L.style.left="0",L.style.transform="",L.style.visibility="hidden"};q1(()=>{if(!J||!G.current||!Q.current){if(U.current)U.current(),U.current=null;return}return K(Q.current),X(),U.current=i$(G.current,Q.current,X,{ancestorResize:!0,ancestorScroll:!0,elementResize:!0}),()=>{if(U.current)U.current(),U.current=null}},[J]),q1(()=>{return()=>{if(U.current)U.current(),U.current=null}},[]);function Y(){Z(!0),q(!0)}function H(){q(!1),setTimeout(()=>Z(!1),200)}function W(){if($||J)H();else Y()}return{contentRef:Q,handleClick:W,handleClose:H,handleOpen:Y,isMounted:J,isOpen:$,triggerRef:G}}C();var J1=M("div",{display:"flex"},{align:{baseline:{alignItems:"baseline"},center:{alignItems:"center"},end:{alignItems:"flex-end"},start:{alignItems:"flex-start"},stretch:{alignItems:"stretch"}},alignContent:{around:{alignContent:"space-around"},between:{alignContent:"space-between"},center:{alignContent:"center"},end:{alignContent:"flex-end"},start:{alignContent:"flex-start"},stretch:{alignContent:"stretch"}},direction:{column:{flexDirection:"column"},"column-reverse":{flexDirection:"column-reverse"},row:{flexDirection:"row"},"row-reverse":{flexDirection:"row-reverse"}},inline:{false:{display:"flex"},true:{display:"inline-flex"}},justify:{around:{justifyContent:"space-around"},between:{justifyContent:"space-between"},center:{justifyContent:"center"},end:{justifyContent:"flex-end"},evenly:{justifyContent:"space-evenly"},start:{justifyContent:"flex-start"}},minimal:{false:{},true:{padding:"0 !important"}},textAlign:{center:{textAlign:"center"},justify:{textAlign:"justify"},left:{textAlign:"left"},right:{textAlign:"right"}},wrap:{false:{flexWrap:"nowrap"},reverse:{flexWrap:"wrap-reverse"},true:{flexWrap:"wrap"}}});import{jsxDEV as U6}from"react/jsx-dev-runtime";function Z1({align:$,alignContent:q,as:J="div",basis:Z,bottom:G,children:Q,css:U,direction:X="column",gap:K,grow:Y,inline:H=!1,justify:W,minimal:L=!1,shrink:B,textAlign:I,top:z,wrap:N,..._}){let j={...Y!==void 0&&{flexGrow:Y},...B!==void 0&&{flexShrink:B},...Z&&{flexBasis:Z},...K&&{gap:b[K]}},V={...z&&{paddingTop:b[z]},...G&&{paddingBottom:b[G]}};return U6(J1,{align:$,alignContent:q,as:J,css:{...j,...V,...U},direction:X,inline:H,justify:W,minimal:L,textAlign:I,wrap:N,..._,children:Q},void 0,!1,void 0,this)}C();var G1=M("section",{"@media (max-width: 768px)":{paddingLeft:"$small",paddingRight:"$small"},paddingLeft:"$medium",paddingRight:"$medium",position:"relative",width:"100%"}),Q1=M("div",{margin:"0 auto",position:"relative",width:"100%"},{container:{false:{width:"100%"},true:{maxWidth:"1200px",width:"96%"}},wide:{false:{},true:{maxWidth:"1600px",width:"98%"}}});import{jsxDEV as U1}from"react/jsx-dev-runtime";function X1({as:$="section",bottom:q,children:J,container:Z=!0,css:G,top:Q,wide:U=!1,...X}){let K={...Q&&{paddingTop:b[Q]},...q&&{paddingBottom:b[q]}},Y=Z?U1(Q1,{container:Z,wide:U,children:J},void 0,!1,void 0,this):J;return U1(G1,{as:$,css:{...K,...G},...X,children:Y},void 0,!1,void 0,this)}C();var K1=M("p",{margin:0,padding:0},{muted:{false:{},true:{opacity:"0.7"}},size:{h1:{paddingBottom:"$medium"},h2:{paddingBottom:"$medium"},h3:{paddingBottom:"$medium"},h4:{paddingBottom:"$small"},h5:{paddingBottom:"$small"},h6:{paddingBottom:"$small"},label:{display:"block",fontSize:"clamp(0.8125rem, 0.75rem + 0.25vw, 0.875rem)",fontWeight:"600",lineHeight:"1.4",paddingBottom:"$smaller"},p:{paddingBottom:"$small"},small:{paddingBottom:"$smaller"},span:{},strong:{}}});import{jsxDEV as X6}from"react/jsx-dev-runtime";function S0({as:$="p",bottom:q,children:J,css:Z,muted:G=!1,size:Q,top:U,...X}){let K=Q||$,Y={...U&&{marginTop:0,paddingTop:b[U]},...q&&{marginBottom:0,paddingBottom:b[q]}};return X6(K1,{as:$,css:{...Y,...Z},muted:G,size:K,...X,children:J},void 0,!1,void 0,this)}C();var Y1=M("button",{"&:disabled":{cursor:"not-allowed",opacity:"0.5"},alignItems:"center",appearance:"none",border:"1px solid transparent",borderRadius:"$medium",display:"inline-flex",fontWeight:"700",justifyContent:"center",minHeight:"40px",outline:"none",padding:"$small $medium",position:"relative",textDecoration:"none",whiteSpace:"nowrap"},{block:{false:{display:"inline-flex",width:"auto"},true:{display:"flex",width:"100%"}},loading:{false:{},true:{cursor:"wait",opacity:"0.7"}},size:{normal:{minHeight:"40px",padding:"$small $medium"},small:{fontSize:"0.875rem",minHeight:"32px",padding:"$smaller $small"}},variant:{minimal:{"&:active:not(:disabled)":{backgroundColor:"$border"},"&:hover:not(:disabled)":{backgroundColor:"$hover"},backgroundColor:"transparent",border:"1px solid transparent",color:"$text"},primary:{"&:active:not(:disabled)":{opacity:"0.8"},"&:hover:not(:disabled)":{opacity:"0.9"},backgroundColor:"$brand"},secondary:{"&:active:not(:disabled)":{backgroundColor:"$border"},"&:hover:not(:disabled)":{backgroundColor:"$hover"},backgroundColor:"$fill",color:"$text"}}});import{jsxDEV as K6}from"react/jsx-dev-runtime";function x0({block:$=!1,bottom:q,children:J,css:Z,disabled:G,loading:Q=!1,size:U="normal",top:X,variant:K="primary",...Y}){let H={...X&&{marginTop:b[X]},...q&&{marginBottom:b[q]}};return K6(Y1,{block:$,css:{...H,...Z},disabled:G||Q,loading:Q,size:U,variant:K,...Y,children:Q?"Loading...":J},void 0,!1,void 0,this)}C();var W1=M("span",{alignItems:"center",backgroundColor:"$text",border:"1px solid transparent",borderRadius:"$medium",color:"$background",display:"inline-flex",fontSize:"0.75rem",fontWeight:"700",justifyContent:"center",margin:0,outline:"none",padding:"$smaller $smaller",position:"relative",textDecoration:"none",verticalAlign:"middle",whiteSpace:"nowrap"},{clickable:{false:{},true:{"&:active":{opacity:"0.5"},"&:hover":{opacity:"0.7"},cursor:"pointer",transition:"opacity 0.2s ease"}}});import{jsxDEV as Y6}from"react/jsx-dev-runtime";function H1({bottom:$,clickable:q=!1,css:J,top:Z,...G}){let Q={...Z&&{marginTop:b[Z]},...$&&{marginBottom:b[$]}};return Y6(W1,{clickable:q,css:{...Q,...J},...G},void 0,!1,void 0,this)}var L1=M("div",{borderRadius:"$small",color:"$text",display:"flex",flexDirection:"column",margin:0,overflow:"hidden",position:"relative",width:"100%"},{clickable:{false:{},true:{"&:active":{transform:"translateY(0)"},"&:focus-visible":{outline:"1px solid $brand",outlineOffset:"2px"},"&:hover":{transform:"translateY(-2px)"},cursor:"pointer",transition:"all 0.2s ease"}},padding:{default:{padding:"$medium"},minimal:{padding:"0"},small:{padding:"$small"}},variant:{bordered:{backgroundColor:"transparent",border:"1px solid $border"},default:{backgroundColor:"$fill",border:"1px solid $border"}}}),B1=M("div",{borderBottom:"1px solid $border",fontWeight:"600"},{padding:{default:{padding:"$medium $medium $small $medium"},minimal:{padding:"0"},small:{padding:"$small $small $smaller $small"}}}),z1=M("div",{borderTop:"1px solid $border",marginTop:"auto"},{padding:{default:{padding:"$small $medium $medium $medium"},minimal:{padding:"0"},small:{padding:"$smaller $small $small $small"}}}),F1=M("div",{flex:"1"},{hasFooter:{false:{},true:{paddingBottom:"0"}},hasHeader:{false:{},true:{paddingTop:"0"}},padding:{default:{padding:"$medium"},minimal:{padding:"0"},small:{padding:"$small"}}});import{jsxDEV as w0}from"react/jsx-dev-runtime";function I1({as:$="div",children:q,clickable:J=!1,css:Z,footer:G,header:Q,onClick:U,padding:X="default",variant:K="default",...Y}){let H=J||!!U,W=!!Q,L=!!G;return w0(L1,{as:$,clickable:H,css:Z,padding:W||L?"minimal":X,variant:K,onClick:U,...H&&{role:"button",tabIndex:0},...Y,children:[W&&w0(B1,{padding:X,children:Q},void 0,!1,void 0,this),w0(F1,{hasFooter:L,hasHeader:W,padding:W||L?X:"minimal",children:q},void 0,!1,void 0,this),L&&w0(z1,{padding:X,children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var M1=M("input",{"&::placeholder":{color:"$border",opacity:1},"&:disabled":{backgroundColor:"$border",cursor:"not-allowed",opacity:0.6},"&:focus":{borderColor:"$brand"},appearance:"none",backgroundColor:"$fill",border:"1px solid $border",borderRadius:"$small",color:"$text",display:"block",fontSize:"1rem",fontWeight:"400",lineHeight:"1.4",minHeight:"40px",outline:"none",padding:"$small $medium",transition:"border-color 0.2s ease",width:"100%"},{variant:{default:{backgroundColor:"$fill",border:"1px solid $border"},error:{borderColor:"red"}}});import{jsxDEV as W6}from"react/jsx-dev-runtime";function y0({state:$="default",...q}){return W6(M1,{variant:$,...q},void 0,!1,void 0,this)}var _1=M("textarea",{"&:disabled":{backgroundColor:"$fill",color:"$text",cursor:"not-allowed",opacity:0.6},"&:focus":{borderColor:"$brand",outline:"1px solid $brand",outlineOffset:"2px"},appearance:"none",background:"none",backgroundColor:"$fill",border:"1px solid $border",borderRadius:"$small",color:"$text",display:"block",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"1rem",lineHeight:"1.5",margin:0,minHeight:"100px",outline:"none",padding:"$small $medium",resize:"vertical",width:"100%"},{variant:{default:{backgroundColor:"$fill",border:"1px solid $border"},minimal:{backgroundColor:"transparent",border:"1px solid transparent",borderBottom:"1px solid $border"}}});import{jsxDEV as H6}from"react/jsx-dev-runtime";function N1({css:$,variant:q="default",...J}){return H6(_1,{css:$,variant:q,...J},void 0,!1,void 0,this)}import{useState as L6}from"react";var V1=M("div",{display:"flex",flexDirection:"column",width:"100%"}),j1=M("div",{borderBottom:"1px solid $border",display:"flex",marginBottom:"$medium"},{variant:{default:{borderBottom:"1px solid $border"},minimal:{borderBottom:"1px solid $border"}}}),T1=M("button",{"&:disabled":{cursor:"not-allowed",opacity:0.5},"&:focus":{outline:"1px solid $brand",outlineOffset:"2px"},"&:hover":{backgroundColor:"$hover"},background:"none",border:"none",borderRadius:"$small $small 0 0",color:"$text",cursor:"pointer",fontSize:"1rem",fontWeight:"500",padding:"$small $medium",position:"relative",transition:"all 0.2s ease"},{active:{false:{},true:{"&::after":{backgroundColor:"$brand",bottom:"-2px",content:'""',height:"2px",left:0,position:"absolute",right:0},color:"$text",fontWeight:"600"}}}),D1=M("div",{"&:focus":{outline:"1px solid $brand",outlineOffset:"2px"},outline:"none",padding:"$medium 0"});import{jsxDEV as u0}from"react/jsx-dev-runtime";function b1({css:$,defaultActive:q=0,items:J,onTabChange:Z,variant:G="default",...Q}){let[U,X]=L6(q),K=(H)=>{X(H),Z?.(H)},Y=(H,W)=>{if(H.key==="Enter"||H.key===" ")H.preventDefault(),K(W)};return u0(V1,{css:$,...Q,children:[u0(j1,{role:"tablist",variant:G,children:J.map((H,W)=>u0(T1,{active:U===W,"aria-controls":`panel-${W}`,"aria-selected":U===W,disabled:H.disabled,id:`tab-${W}`,role:"tab",tabIndex:U===W?0:-1,onClick:()=>K(W),onKeyDown:(L)=>Y(L,W),children:H.label},H.id||W,!1,void 0,this))},void 0,!1,void 0,this),J.map((H,W)=>u0(D1,{"aria-labelledby":`tab-${W}`,hidden:U!==W,id:`panel-${W}`,role:"tabpanel",tabIndex:0,children:U===W&&H.content},`panel-${H.id||W}`,!1,void 0,this))]},void 0,!0,void 0,this)}import{useState as O1,useRef as k1,useEffect as B6}from"react";C();var P1=M("div",{cursor:"pointer",display:"inline-block"}),E1=M("div",{alignItems:"center",backgroundColor:"$overlay",bottom:0,display:"flex",justifyContent:"center",left:0,position:"fixed",right:0,top:0,transition:"opacity 0.2s ease",zIndex:"$dropdown"}),A1=M("div",{backgroundColor:"$fill",border:"1px solid $border",borderRadius:"$small",maxHeight:"70vh",maxWidth:"400px",minWidth:"250px",outline:"none",overflowY:"auto",transition:"transform 0.2s ease, opacity 0.2s ease"},{variant:{default:{backgroundColor:"$fill",border:"1px solid $border"},elevated:{backgroundColor:"$fill",border:"none"}}}),C1=M("div",{"&:disabled":{cursor:"not-allowed",opacity:0.5},"&:focus":{backgroundColor:"$hover",outline:"1px solid $brand",outlineOffset:"-2px"},"&:hover":{backgroundColor:"$hover"},alignItems:"center",background:"none",border:"none",cursor:"pointer",display:"flex",gap:"$small",padding:"$small $medium",textAlign:"left",transition:"background-color 0.2s ease",width:"100%"},{variant:{danger:{"&:hover":{backgroundColor:"$hover",color:"$text"},color:"$text"},default:{color:"$text"}}}),R1=M("div",{backgroundColor:"$border",height:"1px",margin:"$smaller 0"});import{jsxDEV as g,Fragment as S1}from"react/jsx-dev-runtime";function x1({children:$,css:q,initial:J,logo:Z,onSelection:G,options:Q,trigger:U,triggerCss:X,...K}){let[Y,H]=O1(!1),[W,L]=O1(J?Q.findIndex((F)=>F.value===J):-1),B=k1(null),I=k1(null),{renderPortal:z}=d(),N=()=>H(!Y),_=()=>H(!1),j=(F)=>{G?.(F.value,F.label),_()};return x("keydown",(F)=>{if(!Y)return;switch(F.key){case"Escape":_();break;case"ArrowDown":F.preventDefault(),L((T)=>(T+1)%Q.length);break;case"ArrowUp":F.preventDefault(),L((T)=>(T-1+Q.length)%Q.length);break;case"Enter":if(F.preventDefault(),W>=0)j(Q[W]);break}}),c(I,_),B6(()=>{if(Y&&I.current)I.current.focus()},[Y]),g(S1,{children:[g(P1,{ref:B,css:X,onClick:N,...K,children:U},void 0,!1,void 0,this),Y&&z(g(E1,{onClick:_,children:g(A1,{ref:I,css:q,tabIndex:-1,variant:"default",onClick:(F)=>F.stopPropagation(),children:[Z&&g("div",{style:{borderBottom:`1px solid ${m0.border}`,padding:"16px"},children:Z},void 0,!1,void 0,this),Q.map((F,T)=>g(C1,{style:{backgroundColor:W===T?m0.hover:void 0},variant:F.value.includes("delete")||F.value.includes("remove")?"danger":"default",onClick:()=>j(F),onMouseEnter:()=>L(T),children:[F.iconPosition!=="right"&&F.icon,g("span",{children:F.label},void 0,!1,void 0,this),F.iconPosition==="right"&&F.icon]},F.value,!0,void 0,this)),$&&g(S1,{children:[g(R1,{},void 0,!1,void 0,this),g("div",{style:{padding:"8px"},children:typeof $==="function"?$(_):$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this))]},void 0,!0,void 0,this)}import{useState as X$,useEffect as p1}from"react";var w1=M("div",{cursor:"pointer",display:"inline-block",position:"relative",width:"fit-content"}),y1=M("div",{backgroundColor:"$fill",border:"1px solid $border",borderRadius:"$small",maxHeight:"300px",maxWidth:"400px",minWidth:"200px",opacity:1,outline:"none",overflowY:"auto",position:"fixed",transition:"opacity 0.2s ease",visibility:"hidden",zIndex:"$dropdown"}),u1=M("div",{backgroundColor:"$hover",borderBottom:"1px solid $border",color:"$text",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"0.875rem",fontWeight:"600",padding:"$small $medium"}),v1=M("div",{borderBottom:"1px solid $border",padding:"$small"}),h1=M("button",{"&:hover":{backgroundColor:"$hover"},'&[data-focused="true"]':{backgroundColor:"$hover",outline:"1px solid $brand",outlineOffset:"-2px"},'&[data-selected="true"]':{backgroundColor:"$brand",fontWeight:"600"},alignItems:"center",backgroundColor:"transparent",border:"none",color:"$text",cursor:"pointer",display:"flex",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"1rem",padding:"$small $medium",textAlign:"left",transition:"background-color 0.2s ease",width:"100%"}),g1=M("div",{color:"$text",fontSize:"0.875rem",fontStyle:"italic",padding:"$medium $medium",textAlign:"center"}),f1=M("div",{color:"$text",fontSize:"0.875rem",padding:"$medium $medium",textAlign:"center"});import{jsxDEV as f,Fragment as z6}from"react/jsx-dev-runtime";function m1({css:$,disabled:q=!1,filter:J=!1,initial:Z,label:G,loading:Q=!1,onSelection:U,options:X,trigger:K,triggerCss:Y,...H}){let{contentRef:W,handleClick:L,handleClose:B,isMounted:I,isOpen:z,triggerRef:N}=V0(),[_,j]=X$(Z),[V,F]=X$(Z?X.findIndex((D)=>D.value===Z):-1),[T,A]=X$(""),{renderPortal:v}=d(),P=J?X.filter((D)=>D.label.toLowerCase().includes(T.toLowerCase())):X,i=()=>{B(),A("")},p=(D)=>{j(D.value),U?.(D.value,D.label),i()};return x("keydown",(D)=>{if(!z)return;switch(D.key){case"Escape":D.preventDefault(),i();break;case"ArrowDown":D.preventDefault(),F((m)=>(m+1)%P.length);break;case"ArrowUp":D.preventDefault(),F((m)=>(m-1+P.length)%P.length);break;case"Enter":if(D.preventDefault(),V>=0&&P[V])p(P[V]);break}}),c(W,i),p1(()=>{if(z&&W.current)W.current.focus()},[z]),p1(()=>{if(z&&P.length>0)F(_?P.findIndex((D)=>D.value===_):0)},[z,P,_]),f(z6,{children:[f(w1,{ref:N,css:Y,onClick:q?void 0:L,...H,children:K},void 0,!1,void 0,this),I&&v(f(y1,{ref:W,css:{opacity:z?1:0,transition:"opacity 0.2s ease",...$},tabIndex:-1,onClick:(D)=>D.stopPropagation(),children:[G&&f(u1,{children:G},void 0,!1,void 0,this),J&&f(v1,{children:f(y0,{placeholder:"Type to search...",value:T,onChange:(D)=>A(D.target.value)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Q?f(f1,{children:"Loading..."},void 0,!1,void 0,this):P.length>0?P.map((D,m)=>f(h1,{"data-focused":V===m?"true":void 0,"data-selected":D.value===_?"true":void 0,onClick:()=>p(D),onMouseEnter:()=>F(m),children:[D.iconPosition!=="right"&&D.icon,f("span",{children:D.label},void 0,!1,void 0,this),D.iconPosition==="right"&&D.icon]},D.value,!0,void 0,this)):f(g1,{children:"No matching options"},void 0,!1,void 0,this)]},void 0,!0,void 0,this))]},void 0,!0,void 0,this)}import{useEffect as F6}from"react";var d1=M("div",{cursor:"pointer",display:"inline-block",position:"relative",width:"fit-content"}),c1=M("div",{backgroundColor:"$fill",border:"1px solid $border",borderRadius:"$small",maxHeight:"70vh",minWidth:"200px",opacity:1,outline:"none",overflowY:"auto",position:"fixed",transition:"opacity 0.2s ease",visibility:"hidden",zIndex:"$popover"},{variant:{default:{backgroundColor:"$fill",border:"1px solid $border",padding:"$small"},minimal:{backgroundColor:"$fill",border:"1px solid $border",padding:"0"}}});import{jsxDEV as K$,Fragment as I6}from"react/jsx-dev-runtime";function r1({children:$,css:q,disabled:J=!1,trigger:Z,triggerCss:G,variant:Q="default",...U}){let{contentRef:X,handleClick:K,handleClose:Y,isMounted:H,isOpen:W,triggerRef:L}=V0();x("keydown",(N)=>{if(!W)return;if(N.key==="Escape")N.preventDefault(),Y()}),c(X,Y),F6(()=>{if(W&&X.current)X.current.focus()},[W]);let{renderPortal:I}=d(),z=typeof $==="function"?$(Y):$;return K$(I6,{children:[K$(d1,{ref:L,css:G,onClick:J?void 0:K,...U,children:Z},void 0,!1,void 0,this),H&&I(K$(c1,{ref:X,css:{opacity:W?1:0,transition:"opacity 0.2s ease",...q},tabIndex:-1,variant:Q,onClick:(N)=>N.stopPropagation(),children:z},void 0,!1,void 0,this))]},void 0,!0,void 0,this)}import{useState as n1,useRef as M6,useEffect as _6}from"react";var l1=M("div",{cursor:"pointer",display:"inline-block"},{disabled:{true:{cursor:"not-allowed",opacity:0.6}}}),o1=M("div",{backdropFilter:"blur(2px)",backgroundColor:"$overlay",bottom:0,left:0,position:"fixed",right:0,top:0,zIndex:1000}),i1=M("div",{"&:focus":{outline:"1px solid $brand",outlineOffset:"2px"},"@media (max-width: 768px)":{maxHeight:"90vh",width:"95%"},backgroundColor:"$fill",borderRadius:"$small",color:"$text",display:"flex",flexDirection:"column",left:"50%",maxHeight:"80vh",maxWidth:"600px",opacity:0,outline:"none",overflow:"hidden",position:"fixed",top:"50%",transform:"translate(-50%, -50%) translateY(20px) scale(0.95)",transition:"$default",width:"90%"},{isOpen:{true:{opacity:1,transform:"translate(-50%, -50%) translateY(0) scale(1)"}},small:{true:{maxWidth:"280px"}},variant:{bordered:{backgroundColor:"$fill",border:"1px solid $border"},default:{backgroundColor:"$fill",border:"none"}}}),a1=M("div",{alignItems:"center",borderBottom:"1px solid $border",display:"flex",flexShrink:0,justifyContent:"space-between",padding:"$large",paddingBottom:"$medium"}),r7=M("h2",{color:"$text",fontSize:"1.25rem",fontWeight:"600",margin:0}),l7=M("button",{"&:focus":{outline:"1px solid $brand",outlineOffset:"2px"},"&:hover":{backgroundColor:"$hover"},background:"none",border:"none",borderRadius:"$small",color:"$text",cursor:"pointer",fontSize:"1.5rem",padding:"$smaller"}),s1=M("div",{flex:1,overflow:"auto",padding:"$large",paddingTop:"$medium"}),o7=M("div",{borderTop:"1px solid $border",display:"flex",gap:"$small",justifyContent:"flex-end",marginTop:"$medium",paddingTop:"$small"});import{jsxDEV as n,Fragment as N6}from"react/jsx-dev-runtime";function t1({children:$,css:q,disabled:J=!1,small:Z=!1,title:G,trigger:Q,triggerCss:U,...X}){let[K,Y]=n1(!1),[H,W]=n1(!1),L=M6(null),{renderPortal:B}=d(),I=K||H,z=()=>{Y(!1),setTimeout(()=>{W(!1)},200)},N=()=>{if(J)return;Y(!0),W(!0)},_=()=>{if(J)return;if(I)z();else N()};return x("keydown",(V)=>{if(V.key==="Escape"&&I)V.preventDefault(),z()}),c(L,()=>{if(I)z()}),_6(()=>{if(H)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[H]),n(N6,{children:[n(l1,{css:U,disabled:J,onClick:_,...X,children:Q},void 0,!1,void 0,this),H&&B(n(o1,{children:n(i1,{ref:L,css:q,isOpen:K,small:Z,tabIndex:-1,variant:"default",children:[n(a1,{children:[n(S0,{as:"h3",css:{flex:1,margin:0},children:G},void 0,!1,void 0,this),n(x0,{css:{flexShrink:0,fontSize:"18px",height:"32px",padding:"0",width:"32px"},size:"small",variant:"minimal",onClick:z,children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n(s1,{children:typeof $==="function"?$(z):$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this))]},void 0,!0,void 0,this)}export{o0 as zIndices,n0 as useTheme,I$ as useStoopConfig,d as usePortal,c as useOutsideClick,V0 as useFloating,x as useEventListener,b2 as useBreakpoints,c0 as typography,r0 as transitions,H$ as themes,j6 as theme,M as styled,b as spacing,l0 as opacities,L0 as media,s as lightTheme,a0 as injectGlobalStyles,d0 as fonts,U2 as darkTheme,P0 as css,L$ as createGlobalStyles,m0 as colors,S as breakpoints,i0 as borderRadius,N1 as Textarea,S0 as Text,b1 as Tabs,j0 as StoopProvider,B0 as StoopContext,Z1 as Stack,m1 as Select,X1 as Section,r1 as Popover,t1 as Modal,x1 as Menu,y0 as Input,I1 as Card,x0 as Button,H1 as Badge};
1
+ import{createContext as C4}from"react";import{createContext as W4}from"react";var YJ=Object.freeze({}),PJ=1e4,XJ=5000,GJ=10,NJ=W4(null),QJ=["colors","opacities","space","radii","sizes","fonts","fontWeights","fontSizes","letterSpacings","shadows","zIndices","transitions"],a={accentColor:"colors",animation:"transitions",animationDelay:"transitions",animationDuration:"transitions",animationTimingFunction:"transitions",backdropFilter:"shadows",background:"colors",backgroundColor:"colors",blockSize:"sizes",border:"colors",borderBlockColor:"colors",borderBlockEndColor:"colors",borderBlockStartColor:"colors",borderBottomColor:"colors",borderBottomLeftRadius:"radii",borderBottomRightRadius:"radii",borderColor:"colors",borderEndEndRadius:"radii",borderEndStartRadius:"radii",borderInlineColor:"colors",borderInlineEndColor:"colors",borderInlineStartColor:"colors",borderLeftColor:"colors",borderRadius:"radii",borderRightColor:"colors",borderStartEndRadius:"radii",borderStartStartRadius:"radii",borderTopColor:"colors",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",bottom:"space",boxShadow:"shadows",caretColor:"colors",color:"colors",columnGap:"space",columnRuleColor:"colors",fill:"colors",filter:"shadows",flexBasis:"sizes",floodColor:"colors",font:"fontSizes",fontFamily:"fonts",fontSize:"fontSizes",fontWeight:"fontWeights",gap:"space",gridColumnGap:"space",gridGap:"space",gridRowGap:"space",height:"sizes",inlineSize:"sizes",inset:"space",insetBlock:"space",insetBlockEnd:"space",insetBlockStart:"space",insetInline:"space",insetInlineEnd:"space",insetInlineStart:"space",left:"space",letterSpacing:"letterSpacings",lightingColor:"colors",margin:"space",marginBlock:"space",marginBlockEnd:"space",marginBlockStart:"space",marginBottom:"space",marginInline:"space",marginInlineEnd:"space",marginInlineStart:"space",marginLeft:"space",marginRight:"space",marginTop:"space",maxBlockSize:"sizes",maxHeight:"sizes",maxInlineSize:"sizes",maxWidth:"sizes",minBlockSize:"sizes",minHeight:"sizes",minInlineSize:"sizes",minWidth:"sizes",opacity:"opacities",outline:"colors",outlineColor:"colors",padding:"space",paddingBlock:"space",paddingBlockEnd:"space",paddingBlockStart:"space",paddingBottom:"space",paddingInline:"space",paddingInlineEnd:"space",paddingInlineStart:"space",paddingLeft:"space",paddingRight:"space",paddingTop:"space",right:"space",rowGap:"space",size:"sizes",stopColor:"colors",stroke:"colors",textDecorationColor:"colors",textEmphasisColor:"colors",textShadow:"shadows",top:"space",transition:"transitions",transitionDelay:"transitions",transitionDuration:"transitions",transitionProperty:"transitions",transitionTimingFunction:"transitions",width:"sizes",zIndex:"zIndices"},t=Symbol.for("stoop.component");function BJ(J){if(!J||typeof J!=="object"||Array.isArray(J))throw new Error("[Stoop] Theme must be a non-null object");let $=J,Z=[];for(let X in $){if(X==="media")continue;if(!QJ.includes(X))Z.push(X)}if(Z.length>0){let X=`[Stoop] Theme contains invalid scales: ${Z.join(", ")}. Only these scales are allowed: ${QJ.join(", ")}`;if(typeof process!=="undefined"&&process.env?.NODE_ENV!=="production")throw new Error(X);console.warn(X)}return J}function C(J){return typeof J==="object"&&J!==null}function D4(J){return typeof J==="object"&&J!==null&&"__isStoopStyled"in J&&"__stoopClassName"in J&&J.__isStoopStyled===!0}function wJ(J){return C(J)&&!D4(J)}function o(J){return typeof J==="object"&&J!==null&&!Array.isArray(J)}function xJ(J){return function $(Z){let X=BJ(Z);function q(Y,Q){let G={...Y},W=Object.keys(Q);for(let B of W){let D=Q[B],H=Y[B];if(o(D)&&o(H))G[B]={...H,...D};else if(D!==void 0)G[B]=D}let F=Object.keys(Y);for(let B of F)if(!(B in G))G[B]=Y[B];return G}return q(J,X)}}var gJ=new Map;class UJ extends Map{maxSize;constructor(J){super();this.maxSize=J}get(J){let $=super.get(J);if($!==void 0)super.delete(J),super.set(J,$);return $}set(J,$){if(super.has(J))super.delete(J);else if(this.size>=this.maxSize){let Z=this.keys().next().value;if(Z!==void 0)super.delete(Z)}return super.set(J,$),this}}var p=new UJ(XJ),e=new UJ(XJ);function bJ(J){return gJ.has(J)}function vJ(J){gJ.set(J,J)}function TJ(){if(p.size>XJ){let J=p.keys().next().value;if(J)p.delete(J),e.delete(J)}}function FJ(J){let $=0;for(let Z=0;Z<J.length;Z++){let X=J.charCodeAt(Z);$=($<<5)-$+X,$=$&$}return Math.abs($).toString(36)}function WJ(J){try{return FJ(JSON.stringify(J))}catch{return FJ(String(J))}}function H4(J){return J.replace(/([A-Z])/g,"-$1").toLowerCase()}function h(J){return String(J).replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/'/g,"\\'").replace(/;/g,"\\;").replace(/\n/g,"\\A ").replace(/\r/g,"").replace(/\f/g,"\\C ")}function P(J){let $=J.replace(/[^a-zA-Z0-9\s\-_>+~:.#[\]&@()]/g,"");if(!$.trim()||/^[>+~:.#[\]&@()\s]+$/.test($))return"";return $}function f(J){return J.replace(/[^a-zA-Z0-9-_]/g,"-").replace(/^[\d-]+/,"").replace(/^-+/,"")||"invalid"}function kJ(J){return String(J).replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/'/g,"\\'").replace(/;/g,"\\;").replace(/\n/g,"\\A ").replace(/\r/g,"").replace(/\f/g,"\\C ").replace(/\{/g,"\\7B ").replace(/\}/g,"\\7D ")}function M(J){if(!J)return"";return J.replace(/[^a-zA-Z0-9-_]/g,"").replace(/^[\d-]+/,"").replace(/^-+/,"")||""}function CJ(J){if(!J)return"";return J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function DJ(J){if(!J||typeof J!=="string")return"";let $=J.replace(/[^a-zA-Z0-9\s():,<>=\-@]/g,"");if(!$.trim()||!/[a-zA-Z]/.test($))return"";return $}function fJ(J){if(!J||typeof J!=="string")return"";let $=J.trim().split(/\s+/),Z=[];for(let X of $){if(!X)continue;let Y=X.replace(/[^a-zA-Z0-9-_]/g,"").replace(/^\d+/,"");if(Y&&/^[a-zA-Z-_]/.test(Y))Z.push(Y)}return Z.join(" ")}function c(J){if(!J||typeof J!=="string")return"";return H4(J).replace(/[^a-zA-Z0-9-]/g,"").replace(/^-+|-+$/g,"").replace(/^\d+/,"")||""}function SJ(J){if(!J||typeof J!=="string")return!1;if(J==="from"||J==="to")return!0;if(/^\d+(\.\d+)?%$/.test(J)){let Z=parseFloat(J);return Z>=0&&Z<=100}return!1}function L4(J){if(J.includes("Color")||J==="fill"||J==="stroke"||J==="accentColor"||J==="caretColor"||J==="border"||J==="outline"||J.includes("background")&&!J.includes("Size")&&!J.includes("Image"))return"colors";if(/^(margin|padding|gap|inset|top|right|bottom|left|rowGap|columnGap|gridGap|gridRowGap|gridColumnGap)/.test(J)||J.includes("Block")||J.includes("Inline"))return"space";if(/(width|height|size|basis)$/i.test(J)||J.includes("BlockSize")||J.includes("InlineSize"))return"sizes";if(J==="fontSize"||J==="font"&&!J.includes("Family"))return"fontSizes";if(J==="fontFamily"||J.includes("FontFamily"))return"fonts";if(J==="fontWeight"||J.includes("FontWeight"))return"fontWeights";if(J==="letterSpacing"||J.includes("LetterSpacing"))return"letterSpacings";if(J.includes("Radius")||J.includes("radius"))return"radii";if(J.includes("Shadow")||J.includes("shadow")||J==="filter"||J==="backdropFilter")return"shadows";if(J==="zIndex"||J.includes("ZIndex")||J.includes("z-index"))return"zIndices";if(J==="opacity"||J.includes("Opacity"))return"opacities";if(J.startsWith("transition")||J.startsWith("animation")||J.includes("Transition")||J.includes("Animation"))return"transitions";return}function dJ(J,$){if($&&J in $)return $[J];if(J in a)return a[J];return L4(J)}var yJ=new WeakMap;function w4(J){let $=yJ.get(J);if($)return $;let Z=new Map;function X(q,Y=[]){let Q=Object.keys(q).sort();for(let G of Q){let W=q[G],F=[...Y,G];if(o(W))X(W,F);else{let B=Z.get(G);if(B)B.push(F);else Z.set(G,[F])}}}X(J);for(let[q,Y]of Z.entries())if(Y.length>1){if(Y.sort((Q,G)=>{let W=Q.length-G.length;if(W!==0)return W;let F=Q.join("."),B=G.join(".");return F.localeCompare(B)}),typeof process!=="undefined"&&process.env?.NODE_ENV!=="production")console.warn(`[Stoop] Ambiguous token "$${q}" found in multiple categories: ${Y.map((Q)=>Q.join(".")).join(", ")}. Using "${Y[0].join(".")}" (deterministic: shorter paths first, then alphabetical). Use full path "$${Y[0].join(".")}" to be explicit.`)}return yJ.set(J,Z),Z}function U4(J,$){let Z=Object.keys(J).filter((q)=>q!=="media"),X=Object.keys($).filter((q)=>q!=="media");if(Z.length!==X.length)return!1;for(let q of Z)if(!(q in $))return!1;return!0}function uJ(J,$){if(J===$)return!0;if(!J||!$)return!1;if(!U4(J,$))return!1;let Z={...J},X={...$};return delete Z.media,delete X.media,JSON.stringify(Z)===JSON.stringify(X)}function RJ(J,$,Z){if(Z&&Z in J){let Y=J[Z];if(Y&&typeof Y==="object"&&!Array.isArray(Y)&&$ in Y)return[Z,$]}let q=w4(J).get($);if(!q||q.length===0)return null;return q[0]}function R4(J,$,Z,X){if(!J.startsWith("$"))return J;let q=J.slice(1);if(q.includes("$")||q.includes("."))return`var(${`--${(q.includes("$")?q.split("$"):q.split(".")).map((B)=>f(B)).join("-")}`})`;if($&&Z){let G=dJ(Z,X);if(G){let F=RJ($,q,G);if(F)return`var(${`--${F.map((H)=>f(H)).join("-")}`})`}let W=RJ($,q);if(W)return`var(${`--${W.map((D)=>f(D)).join("-")}`})`}else if($){let G=RJ($,q);if(G)return`var(${`--${G.map((B)=>f(B)).join("-")}`})`}return`var(${`--${f(q)}`})`}function n(J,$=""){let Z=CJ($),X=Z?`:root[data-stoop="${Z}"]`:":root",q=[];function Y(Q,G=[]){let W=Object.keys(Q).sort();for(let F of W){if(F==="media")continue;let B=Q[F],D=[...G,F];if(o(B))Y(B,D);else{let L=`--${D.map((R)=>f(R)).join("-")}`,O=typeof B==="string"||typeof B==="number"?kJ(B):String(B);q.push(` ${L}: ${O};`)}}}if(Y(J),q.length===0)return"";return`${X} {
2
+ ${q.join(`
3
+ `)}
4
+ }`}function S(J,$,Z,X){if(!J||typeof J!=="object")return J;let q={};for(let Y in J){let Q=J[Y];if(C(Q))q[Y]=S(Q,$,Z,X);else if(typeof Q==="string"&&Q.includes("$")){let G=X||Y;q[Y]=Q.replace(/(calc\()?(-?)(\$[a-zA-Z][a-zA-Z0-9]*(?:\$[a-zA-Z][a-zA-Z0-9]*)?(?:\.[a-zA-Z][a-zA-Z0-9]*)?)/g,(W,F,B,D,H,L)=>{let O=R4(D,$,G,Z),R=L.slice(Math.max(0,H-10),H),A=R.includes("calc(")&&!R.includes(")");if(B==="-"){if(A||F==="calc(")return`${F||""}-${O}`;return`calc(-1 * ${O})`}if(F==="calc(")return`${F}${O}`;return O})}else q[Y]=Q}return q}var AJ=new Map;function g(J){return AJ.has(J)}function N(J,$){AJ.set(J,$)}function HJ(){return new Map(AJ)}var m=[];function JJ(J){if(m.includes(J))return;if(m.length>=PJ)m.shift();m.push(J)}function IJ(){return m.join(`
5
+ `)}function pJ(J){return m.includes(J)}var U=null,_J=new Map,cJ=new Map,A4=new Map,l=new Map,d=null;if(typeof document!=="undefined")(function J(){if(!U)U=document.createElement("style"),U.setAttribute("data-stoop","stoop"),document.head.appendChild(U)})();function nJ(){if(l.size===0||!U||!U.parentNode){d=null;return}let J=Array.from(l.values()).join(`
6
+ `);if(!J){l.clear(),d=null;return}let{sheet:$}=U;if($&&$.insertRule&&!J.includes("@")&&!J.includes("&"))try{let X=J.split(/(?<=})\s*(?=\S)/),q=!0;for(let Y of X){let Q=Y.trim();if(Q)try{$.insertRule(Q,$.cssRules.length)}catch{q=!1;break}}if(q){l.clear(),d=null;return}}catch{}let Z=U.textContent||"";U.textContent=Z+(Z?`
7
+ `:"")+J,l.clear(),d=null}function I4(J,$){if(l.set($,J),!d&&typeof requestAnimationFrame!=="undefined")d=requestAnimationFrame(nJ);else if(!d)nJ()}function KJ(J=""){if(typeof document==="undefined")throw new Error("Cannot access document in SSR context");let $=M(J);if(U){if(U.parentNode)return U;if(U.textContent)try{return document.head.appendChild(U),U}catch{}U=null}return U=document.createElement("style"),U.setAttribute("data-stoop",$||"stoop"),document.head.appendChild(U),U}function OJ(J,$,Z=""){if(!J)return;let X=M(Z),q=`__theme_vars_${X}`;if((cJ.get(q)??null)===J){if((_J.get(q)??null)!==$)_J.set(q,$);return}if(_J.set(q,$),cJ.set(q,J),typeof document==="undefined"){JJ(J);return}let Q=KJ(X),G=Q.textContent||"";if(g(q)){let W=X?`:root[data-stoop="${X}"]`:":root",F=new RegExp(`${W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\{[\\s\\S]*?\\}`,"g"),B=G.replace(F,"").trim();Q.textContent=J+(B?`
8
+ `+B:""),N(q,J)}else Q.textContent=J+(G?`
9
+ `+G:""),N(q,J)}function mJ(J,$=""){let Z=M($);if(A4.set(Z,J),typeof document!=="undefined"){KJ(Z);let X=n(J,Z);OJ(X,J,Z)}}function _4(J,$,Z=""){if(typeof document==="undefined")return;let X=M(Z);if(U&&U.parentNode){let q=U.textContent||"",Y=J.replace(/\s+/g," ").trim();if(q.replace(/\s+/g," ").trim().includes(Y)){if(!g($))N($,J);return}}try{let q=KJ(X),Y=q.textContent||"",Q=J.replace(/\s+/g," ").trim();if(Y.replace(/\s+/g," ").trim().includes(Q)){if(!g($))N($,J);return}if(!Y){let W=HJ();if(W.size>0){let F=Array.from(W.entries()).filter(([B])=>!B.startsWith("__theme_vars_")&&B!==$).map(([,B])=>B).join(`
10
+ `);q.textContent=F+(F?`
11
+ `:"")+J}else q.textContent=J}else I4(J,$);if(!g($))N($,J)}catch{if(!g($))N($,J)}if(!pJ(J))JJ(J)}function lJ(J,$,Z=""){if(g($))return;if(N($,J),bJ(J))return;vJ(J);let X=M(Z);if(U&&U.parentNode)try{let q=U.textContent||"",Y=J.replace(/\s+/g," ").trim();if(q.replace(/\s+/g," ").trim().includes(Y))return}catch{}_4(J,$,X)}function iJ(){return U}function T(J,$="",Z){let X=Z||J;if(typeof document==="undefined"){if(!g(X))N(X,J);JJ(J);return}lJ(J,X,$)}function rJ(J,$,Z=""){OJ(J,$,Z)}function sJ(J,$=""){mJ(J,$)}function aJ(){if(typeof document!=="undefined"){let J=iJ();if(J&&J.parentNode){let $=J.textContent||"";if(!$&&HJ().size>0)return IJ();return $}}return IJ()}function $J(J,$){if(!$||!J||typeof J!=="object")return J;let Z={},X=Object.keys($);for(let q in J){let Y=J[q];if(X.includes(q)&&$[q])try{let Q=$[q](Y);if(Q&&typeof Q==="object")Object.assign(Z,Q)}catch{Z[q]=Y}else if(C(Y))Z[q]=$J(Y,$);else Z[q]=Y}return Z}function O4(J,$){if(typeof J==="symbol"&&J===t)return!0;if(typeof $==="object"&&$!==null&&t in $)return!0;if(typeof J==="string"&&J.startsWith("__STOOP_COMPONENT_"))return!0;return!1}function E4(J,$){if(typeof $==="object"&&$!==null&&"__stoopClassName"in $&&typeof $.__stoopClassName==="string")return $.__stoopClassName;if(typeof J==="string"&&J.startsWith("__STOOP_COMPONENT_"))return J.replace("__STOOP_COMPONENT_","");return""}function x(J,$="",Z=0,X){if(!J||typeof J!=="object")return"";if(Z>GJ)return"";let q="",Y="";for(let G in J){let W=J[G];if(O4(G,W)){let F=E4(G,W);if(!F)continue;let B=P(F);if(!B)continue;let D=`.${B}`,H=wJ(W)?x(W,D,Z+1,X):"";Y+=H;continue}if(wJ(W))if(X&&G in X){let F=DJ(X[G]);if(F){let B=x(W,$,Z+1,X);Y+=`${F} { ${B} }`}}else if(G.startsWith("@")){let F=P(G);if(F){let B=x(W,$,Z+1,X);Y+=`${F} { ${B} }`}}else if(G.includes("&")){let F=P(G);if(F){let B=F.replace(/&/g,$),D=x(W,B,Z+1,X);Y+=D}}else if(G.startsWith(":")){let F=P(G);if(F){let B=`${$}${F}`,D=x(W,B,Z+1,X);Y+=D}}else if(G.includes(" ")||G.includes(">")||G.includes("+")||G.includes("~")){let F=P(G);if(F){let B=`${$} ${F}`,D=x(W,B,Z+1,X);Y+=D}}else{let F=P(G);if(F){let B=$?`${$} ${F}`:F,D=x(W,B,Z+1,X);Y+=D}}else if(W!==void 0){let F=c(G);if(F&&(typeof W==="string"||typeof W==="number")){let B=h(W);q+=`${F}: ${B}; `}}}return(q?`${$} { ${q.trim()}}`:"")+Y}function y(J,$,Z="",X,q,Y){let Q=M(Z),G=$J(J,q),W=S(G,$,Y),F=x(W,"",0,X),B=FJ(F),D=`${Q}:${B}`,H=p.get(D);if(H){let R=e.get(D);if(R)return T(R,Q,D),H;let A=x(W,`.${H}`,0,X);return e.set(D,A),T(A,Q,D),H}let L=Q?`${Q}-${B}`:`css-${B}`,O=x(W,`.${L}`,0,X);return p.set(D,L),e.set(D,O),TJ(),T(O,Q,D),L}function tJ(J,$="",Z,X,q){return function Y(Q){return y(Q,J,$,Z,X,q)}}function eJ(J,$="",Z,X,q){let Y=new Set;return function Q(G){if(typeof document==="undefined")return()=>{};let W=WJ(G);if(Y.has(W))return()=>{};Y.add(W);function F(O,R=0){if(R>GJ)return"";let A="";return Object.entries(O).forEach(([z,_])=>{if(C(_))if(Z&&z in Z){let K=DJ(Z[z]);if(K){let w=F(_,R+1);A+=`${K} { ${w} }`}}else if(z.startsWith("@")){let K=P(z);if(K){let w=F(_,R+1);A+=`${K} { ${w} }`}}else{let K=P(z);if(K){let w=F(_,R+1);A+=`${K} { ${w} }`}}else if(_!==void 0){let K=c(z);if(K&&(typeof _==="string"||typeof _==="number")){let w=h(_);A+=`${K}: ${w}; `}}}),A}let B=M($),D=$J(G,X),H=S(D,J,q),L=F(H);return T(L,B,`__global_${W}`),()=>{Y.delete(W)}}}function M4(J,$,Z,X){let q=`@keyframes ${$} {`,Y=Object.keys(J).sort((Q,G)=>{let W=parseFloat(Q.replace("%","")),F=parseFloat(G.replace("%",""));if(Q==="from")return-1;if(G==="from")return 1;if(Q==="to")return 1;if(G==="to")return-1;return W-F});for(let Q of Y){if(!SJ(Q))continue;let G=J[Q];if(!G||typeof G!=="object")continue;q+=` ${Q} {`;let W=S(G,Z,X);for(let F in W){let B=W[F];if(B!==void 0&&(typeof B==="string"||typeof B==="number")){let D=c(F);if(D){let H=h(B);q+=` ${D}: ${H};`}}}q+=" }"}return q+=" }",q}function J4(J="",$,Z){let X=M(J),q=new Map;return function Y(Q){let G=WJ(Q),W=q.get(G);if(W)return W;let F=G.slice(0,8),B=X?`${X}-${F}`:`stoop-${F}`,D=M4(Q,B,$,Z),H=`__keyframes_${B}`;return T(D,X,H),q.set(G,B),B}}import{createContext as V4,useCallback as EJ,useLayoutEffect as q4,useMemo as MJ,useState as P4}from"react";var $4=new Map;function Z4(J,$=""){let Z=$||"";$4.set(Z,J)}function z4(J=""){let $=J||"";return $4.get($)||null}function j4(J,$=""){let Z=z4($);if(!Z)return J;if(uJ(J,Z))return J;let X={...Z},q=Object.keys(J);for(let Y of q){if(Y==="media")continue;let Q=J[Y],G=Z[Y];if(Q&&typeof Q==="object"&&!Array.isArray(Q)&&G&&typeof G==="object"&&!Array.isArray(G))X[Y]={...G,...Q};else if(Q!==void 0)X[Y]=Q}return X}function LJ(J,$=""){if(typeof document==="undefined")return;let Z=j4(J,$),X=n(Z,$);rJ(X,Z,$)}import{jsxDEV as Y4}from"react/jsx-dev-runtime";function X4(J,$,Z,X=""){let q=V4(null),Y=Object.keys($),Q=Y[0]||"default";function G({attribute:W="data-theme",children:F,defaultTheme:B,storageKey:D="stoop-theme"}){let H=EJ(()=>{if(typeof window==="undefined")return B||Q;try{let w=localStorage.getItem(D);if(w&&$[w])return w}catch{}return B||Q},[B,D]),[L,O]=P4(H),R=MJ(()=>{return $[L]||$[B||Q]||Z},[L,B]);q4(()=>{if(R)LJ(R,X)},[R]),q4(()=>{if(typeof document!=="undefined"&&W)document.documentElement.setAttribute(W,L)},[L,W]);let A=EJ((w)=>{if($[w]){O(w);try{localStorage.setItem(D,w)}catch{}}else if(typeof process!=="undefined"&&process.env?.NODE_ENV!=="production")console.warn(`[Stoop] Theme "${w}" not found. Available themes: ${Y.join(", ")}`)},[D]),z=MJ(()=>({theme:R,themeName:L}),[R,L]),_=EJ(()=>{let V=(Y.indexOf(L)+1)%Y.length,k=Y[V];A(k)},[L,A]),K=MJ(()=>({availableThemes:Y,setTheme:A,theme:R,themeName:L,toggleTheme:_}),[R,L,A,_]);return Y4(J.Provider,{value:z,children:Y4(q.Provider,{value:K,children:F},void 0,!1,void 0,this)},void 0,!1,void 0,this)}return{Provider:G,ThemeManagementContext:q}}import{useMemo as zJ,forwardRef as N4,createElement as x4,useContext as g4}from"react";function G4(J,$,Z){let X=!1,q=[];for(let Y in J){let Q=$[Y];if(Q===void 0)continue;let G=J[Y],W=Q===!0?"true":Q===!1?"false":String(Q);if(G[W])q.push(G[W]),X=!0}return X?Object.assign({},Z,...q):Z}function b4(J){return{__isStoopStyled:!0,__stoopClassName:J,[t]:J,toString:()=>`__STOOP_COMPONENT_${J}`}}function v4(J){return typeof J==="object"&&J!==null&&"__isStoopStyled"in J&&J.__isStoopStyled===!0}function T4(J,$){if(!$)return{elementProps:J,variantProps:{}};let Z=new Set(Object.keys($)),X={},q={};for(let Y in J)if(Z.has(Y))X[Y]=J[Y];else q[Y]=J[Y];return{elementProps:q,variantProps:X}}function Q4(J,$="",Z,X,q,Y){return function Q(G,W,F){let B=W||YJ,D=F;if(W&&"variants"in W&&typeof W.variants==="object"){D=W.variants;let{compoundVariants:A,variants:z,..._}=W;B=_}let H=y(B,J,$,Z,X,q),L;if(typeof G!=="string"&&v4(G))L=G.__stoopClassName;let R=N4(function A(z,_){let{as:K,className:w,css:V,...k}=z,I=K||G,E=V&&typeof V==="object"&&V!==null?V:YJ,{elementProps:b,variantProps:v}=T4(k,D),i=g4(Y||NJ)?.theme||J,qJ=i.media||Z,r=zJ(()=>{if(!D)return"";let j=Object.entries(v);if(j.length===0)return"";return j.sort(([u],[s])=>u.localeCompare(s)).map(([u,s])=>`${u}:${String(s)}`).join("|")},[D,...Object.values(v)]),jJ=zJ(()=>{let j=B;if(D&&r)j=G4(D,v,B);if(E!==YJ)j=Object.assign({},j,E);return j},[r,E]),F4=zJ(()=>{let j=[];if(L)j.push(L);let u=y(jJ,i,$,qJ,X,q);if(u)j.push(u);if(w){let s=typeof w==="string"?w:String(w),VJ=fJ(s);if(VJ)j.push(VJ)}return j.length>0?j.join(" "):void 0},[jJ,i,$,qJ,X,q,w,L]);return x4(I,{...b,className:F4,ref:_})});return R.selector=b4(H),R}}import{useContext as k4}from"react";function B4(J){return function $(){let Z=k4(J);if(!Z)throw new Error("useTheme must be used within a Provider");return Z}}function f4(J){let{media:$,prefix:Z="",theme:X,themeMap:q,utils:Y}=J,Q=M(Z),G=BJ(X),W=G.media||$,F={...a,...q},B=C4(null);Z4(G,Q),sJ(G,Q);let D=tJ(G,Q,W,Y,F),H=xJ(G),L=eJ(G,Q,W,Y,F),O=J4(Q,G,F),R=Q4(G,Q,W,Y,F,B),A=Object.freeze({...G});function z(I){for(let E of I)try{y(E,G,Q,W,Y,F)}catch{}}function _(I){let E;if(typeof I==="string")if(J.themes&&J.themes[I])E=J.themes[I];else{if(typeof process!=="undefined"&&process.env?.NODE_ENV!=="production")console.warn(`[Stoop] Theme "${I}" not found. Available themes: ${J.themes?Object.keys(J.themes).join(", "):"none"}`);return}else E=I;LJ(E,Q)}function K(I){let E=G;if(I)if(typeof I==="string"){if(J.themes&&J.themes[I])E=J.themes[I];else if(typeof process!=="undefined"&&process.env?.NODE_ENV!=="production")console.warn(`[Stoop] Theme "${I}" not found. Using default theme. Available: ${J.themes?Object.keys(J.themes).join(", "):"none"}`)}else E=I;let b="",v=n(E,Q);if(v)b+=v+`
12
+ `;let ZJ=aJ(),i=Q?`:root[data-stoop="${Q}"]`:":root",qJ=new RegExp(`${i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\{[^}]*\\}`,"g"),r=ZJ.replace(qJ,"").trim();if(r)b+=(b?`
13
+ `:"")+r;return b}let w,V;if(J.themes){let I={};for(let[v,ZJ]of Object.entries(J.themes))I[v]=H(ZJ);let{Provider:E,ThemeManagementContext:b}=X4(B,I,G,Q);w=E,V=B4(b)}let k={config:{...J,prefix:Q},createTheme:H,css:D,getCssText:K,globalCss:L,keyframes:O,preloadTheme:_,styled:R,theme:A,warmCache:z};if(w)k.Provider=w;if(V)k.useTheme=V;return k}export{f4 as createStoop};
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Browser-specific CSS injection.
3
+ * Manages a single stylesheet element that gets updated with new CSS rules.
4
+ * Handles theme variable injection, deduplication, and stylesheet lifecycle.
5
+ */
6
+ import type { Theme } from "../types";
7
+ /**
8
+ * Gets or creates the stylesheet element for CSS injection.
9
+ *
10
+ * @param prefix - Optional prefix for stylesheet identification
11
+ * @returns HTMLStyleElement
12
+ * @throws Error if called in SSR context
13
+ */
14
+ export declare function getStylesheet(prefix?: string): HTMLStyleElement;
15
+ /**
16
+ * Injects theme CSS variables into the stylesheet.
17
+ * Automatically ensures stylesheet exists before injection.
18
+ *
19
+ * @param cssVars - CSS variables string
20
+ * @param theme - Theme object
21
+ * @param prefix - Optional prefix for CSS variables
22
+ */
23
+ export declare function injectThemeVariables(cssVars: string, theme: Theme, prefix?: string): void;
24
+ /**
25
+ * Registers a theme for injection (browser-specific).
26
+ * Automatically ensures stylesheet exists and injects theme variables.
27
+ * Note: This is typically called with the default theme from createStoop.
28
+ * Additional themes should use updateThemeVariables which handles merging.
29
+ *
30
+ * @param theme - Theme object to register
31
+ * @param prefix - Optional prefix for CSS variables
32
+ */
33
+ export declare function registerTheme(theme: Theme, prefix?: string): void;
34
+ /**
35
+ * Updates the stylesheet with new CSS rules.
36
+ *
37
+ * @param css - CSS string to inject
38
+ * @param ruleKey - Unique key for deduplication
39
+ * @param prefix - Optional prefix for CSS rules
40
+ */
41
+ export declare function updateStylesheet(css: string, ruleKey: string, prefix?: string): void;
42
+ /**
43
+ * Injects CSS into the browser stylesheet with deduplication.
44
+ *
45
+ * @param css - CSS string to inject
46
+ * @param ruleKey - Unique key for deduplication
47
+ * @param prefix - Optional prefix for CSS rules
48
+ */
49
+ export declare function injectBrowserCSS(css: string, ruleKey: string, prefix?: string): void;
50
+ /**
51
+ * Gets the current stylesheet element.
52
+ *
53
+ * @returns HTMLStyleElement or null if not created
54
+ */
55
+ export declare function getStylesheetElement(): HTMLStyleElement | null;
56
+ /**
57
+ * Clears the stylesheet and all pending updates.
58
+ */
59
+ export declare function clearStylesheet(): void;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * CSS injection deduplication.
3
+ * Tracks which CSS rules have been injected to prevent duplicates.
4
+ * Used by both browser and SSR injection systems.
5
+ */
6
+ /**
7
+ * Checks if a CSS rule has already been injected.
8
+ *
9
+ * @param key - Rule key to check
10
+ * @returns True if rule is already injected
11
+ */
12
+ export declare function isInjectedRule(key: string): boolean;
13
+ /**
14
+ * Marks a CSS rule as injected.
15
+ *
16
+ * @param key - Rule key
17
+ * @param css - CSS string
18
+ */
19
+ export declare function markRuleAsInjected(key: string, css: string): void;
20
+ /**
21
+ * Gets all injected rules as a new Map.
22
+ *
23
+ * @returns Map of all injected rules
24
+ */
25
+ export declare function getAllInjectedRules(): Map<string, string>;
26
+ /**
27
+ * Clears all injected rule tracking.
28
+ */
29
+ export declare function clearInjectedRules(): void;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * CSS injection public API.
3
+ * Composes browser, SSR, and deduplication modules into a unified interface.
4
+ * Provides single stylesheet injection with automatic SSR support.
5
+ */
6
+ import type { Theme } from "../types";
7
+ export { isInjectedRule } from "./dedup";
8
+ /**
9
+ * Injects CSS into the document with automatic SSR support.
10
+ *
11
+ * @param css - CSS string to inject
12
+ * @param prefix - Optional prefix for CSS rules
13
+ * @param ruleKey - Optional unique key for deduplication
14
+ */
15
+ export declare function injectCSS(css: string, prefix?: string, ruleKey?: string): void;
16
+ /**
17
+ * Injects theme CSS variables into the document.
18
+ *
19
+ * @param cssVars - CSS variables string
20
+ * @param theme - Theme object
21
+ * @param prefix - Optional prefix for CSS variables
22
+ */
23
+ export declare function injectThemeVariables(cssVars: string, theme: Theme, prefix?: string): void;
24
+ /**
25
+ * Registers a theme for injection.
26
+ * Automatically ensures stylesheet exists and injects theme variables.
27
+ *
28
+ * @param theme - Theme object to register
29
+ * @param prefix - Optional prefix for CSS variables
30
+ */
31
+ export declare function registerTheme(theme: Theme, prefix?: string): void;
32
+ /**
33
+ * Gets all injected CSS text (browser or SSR).
34
+ *
35
+ * @returns CSS text string
36
+ */
37
+ export declare function getCssText(): string;
38
+ /**
39
+ * Clears all injected CSS and caches.
40
+ */
41
+ export declare function clearStylesheet(): void;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * SSR cache management for CSS injection.
3
+ * Maintains a cache of CSS text for server-side rendering.
4
+ * Implements FIFO eviction to prevent memory leaks.
5
+ */
6
+ /**
7
+ * Adds CSS to the SSR cache with FIFO eviction.
8
+ *
9
+ * @param css - CSS string to cache
10
+ */
11
+ export declare function addToSSRCache(css: string): void;
12
+ /**
13
+ * Gets all cached CSS text for SSR.
14
+ *
15
+ * @returns Joined CSS text string
16
+ */
17
+ export declare function getSSRCacheText(): string;
18
+ /**
19
+ * Clears the SSR cache.
20
+ */
21
+ export declare function clearSSRCache(): void;
22
+ /**
23
+ * Checks if CSS is already in the SSR cache.
24
+ *
25
+ * @param css - CSS string to check
26
+ * @returns True if CSS is cached
27
+ */
28
+ export declare function isInSSRCache(css: string): boolean;