@enonic/ui 0.15.0 → 0.16.0
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/enonic-ui.cjs +5 -5
- package/dist/enonic-ui.es.js +1012 -115
- package/dist/styles/style.css +1 -1
- package/dist/types/components/combobox/combobox.d.ts +9 -3
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/listbox/listbox.d.ts +5 -2
- package/dist/types/components/menu/menu.d.ts +3 -4
- package/dist/types/components/menubar/index.d.ts +2 -0
- package/dist/types/components/menubar/menubar.d.ts +346 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/use-controlled-state-with-null.d.ts +47 -0
- package/dist/types/hooks/use-controlled-state.d.ts +20 -2
- package/dist/types/providers/index.d.ts +2 -0
- package/dist/types/providers/listbox-provider.d.ts +9 -1
- package/dist/types/providers/menubar-menu-provider.d.ts +36 -0
- package/dist/types/providers/menubar-provider.d.ts +75 -0
- package/package.json +1 -1
package/dist/enonic-ui.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("preact"),t=require("react"),r=require("@radix-ui/react-slot"),o=require("focus-trap-react"),a=require("react-dom");var n=0;function s(t,r,o,a,s,i){r||(r={});var l,c,d=r;if("ref"in d)for(c in d={},r)"ref"==c?l=r[c]:d[c]=r[c];var u={type:t,props:d,key:o,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--n,__i:-1,__u:0,__source:s,__self:i};if("function"==typeof t&&(l=t.defaultProps))for(c in l)void 0===d[c]&&(d[c]=l[c]);return e.options.vnode&&e.options.vnode(u),u}const i=t.createContext(void 0),l=({value:e,children:t})=>s(i.Provider,{value:e,children:t});l.displayName="AvatarProvider";const c=()=>{const e=t.useContext(i);if(!e)throw new Error("useAvatar must be used within an Avatar");return e},d=t.createContext(void 0),u=({value:e,children:t})=>s(d.Provider,{value:e,children:t});u.displayName="ComboboxProvider";const m=()=>{const e=t.useContext(d);if(!e)throw new Error("useCombobox must be used within a ComboboxProvider");return e},f=t.createContext(void 0),p=({value:e,children:t})=>s(f.Provider,{value:e,children:t});p.displayName="DialogProvider";const b=()=>{const e=t.useContext(f);if(!e)throw new Error("useDialog must be used within a DialogProvider");return e},h=t.createContext(void 0),g=({children:e,prefix:t})=>s(h.Provider,{value:{prefix:t},children:e});g.displayName="IdProvider";const v=(e,r)=>{const o=e??t.useId(),a=t.useContext(h);return[a?.prefix,r,o].filter(Boolean).join("-")},x=t.createContext(void 0),w=({value:e,children:t})=>s(x.Provider,{value:e,children:t});w.displayName="ListboxProvider";const y=()=>{const e=t.useContext(x);if(!e)throw new Error("useListbox must be used within a Listbox");return e},k=t.createContext(void 0),N=({value:e,children:t})=>s(k.Provider,{value:e,children:t}),C=()=>{const e=t.useContext(k);if(!e)throw new Error("useMenu must be used within a MenuProvider");return e},I=t.createContext(void 0),z=({value:e,children:t})=>s(I.Provider,{value:e,children:t}),S=()=>{const e=t.useContext(I);if(!e)throw new Error("useSearchField must be used within a SearchFieldProvider");return e};function R(e,t){return`${e}-${t}`}function D(e,t,r){return`${e}-${t}-item-${r}`}function M(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=M(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function E(){for(var e,t,r=0,o="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=M(e))&&(o&&(o+=" "),o+=t);return o}const O=e=>{const t=j(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),A(r,t)||L(e)},getConflictingClassGroupIds:(e,t)=>{const a=r[e]||[];return t&&o[e]?[...a,...o[e]]:a}}},A=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),a=o?A(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;const n=e.join("-");return t.validators.find(({validator:e})=>e(n))?.classGroupId},P=/^\[(.+)\]$/,L=e=>{if(P.test(e)){const t=P.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},j=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const a in r)$(r[a],o,a,t);return o},$=(e,t,r,o)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:V(t,e)).classGroupId=r)}if("function"==typeof e)return F(e)?void $(e(o),t,r,o):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,a])=>{$(a,V(t,e),r,o)})})},V=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},F=e=>e.isThemeGetter,T=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const a=(a,n)=>{r.set(a,n),t++,t>e&&(t=0,o=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=o.get(e))?(a(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):a(e,t)}}},W=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=e=>{const t=[];let r,o=0,a=0,n=0;for(let l=0;l<e.length;l++){let s=e[l];if(0===o&&0===a){if(":"===s){t.push(e.slice(n,l)),n=l+1;continue}if("/"===s){r=l;continue}}"["===s?o++:"]"===s?o--:"("===s?a++:")"===s&&a--}const s=0===t.length?e:e.substring(n),i=_(s);return{modifiers:t,hasImportantModifier:i!==s,baseClassName:i,maybePostfixModifierPosition:r&&r>n?r-n:void 0}};if(t){const e=t+":",r=o;o=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){const e=o;o=t=>r({className:t,parseClassName:e})}return o},_=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,q=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const r=[];let o=[];return e.forEach(e=>{"["===e[0]||t[e]?(r.push(...o.sort(),e),o=[]):o.push(e)}),r.push(...o.sort()),r}},B=/\s+/;function G(){let e,t,r=0,o="";for(;r<arguments.length;)(e=arguments[r++])&&(t=H(e))&&(o&&(o+=" "),o+=t);return o}const H=e=>{if("string"==typeof e)return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=H(e[o]))&&(r&&(r+=" "),r+=t);return r};function K(e,...t){let r,o,a,n=function(i){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:T(e.cacheSize),parseClassName:W(e),sortModifiers:q(e),...O(e)}))(l),o=r.cache.get,a=r.cache.set,n=s,s(i)};function s(e){const t=o(e);if(t)return t;const n=((e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:n}=t,s=[],i=e.trim().split(B);let l="";for(let c=i.length-1;c>=0;c-=1){const e=i[c],{isExternal:t,modifiers:d,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:f}=r(e);if(t){l=e+(l.length>0?" "+l:l);continue}let p=!!f,b=o(p?m.substring(0,f):m);if(!b){if(!p){l=e+(l.length>0?" "+l:l);continue}if(b=o(m),!b){l=e+(l.length>0?" "+l:l);continue}p=!1}const h=n(d).join(":"),g=u?h+"!":h,v=g+b;if(s.includes(v))continue;s.push(v);const x=a(b,p);for(let r=0;r<x.length;++r){const e=x[r];s.push(g+e)}l=e+(l.length>0?" "+l:l)}return l})(e,r);return a(e,n),n}return function(){return n(G.apply(null,arguments))}}const X=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Y=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,U=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Z=/^\d+\/\d+$/,J=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Q=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,te=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,re=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=e=>Z.test(e),ae=e=>!!e&&!Number.isNaN(Number(e)),ne=e=>!!e&&Number.isInteger(Number(e)),se=e=>e.endsWith("%")&&ae(e.slice(0,-1)),ie=e=>J.test(e),le=()=>!0,ce=e=>Q.test(e)&&!ee.test(e),de=()=>!1,ue=e=>te.test(e),me=e=>re.test(e),fe=e=>!be(e)&&!ye(e),pe=e=>Re(e,Oe,de),be=e=>Y.test(e),he=e=>Re(e,Ae,ce),ge=e=>Re(e,Pe,ae),ve=e=>Re(e,Me,de),xe=e=>Re(e,Ee,me),we=e=>Re(e,je,ue),ye=e=>U.test(e),ke=e=>De(e,Ae),Ne=e=>De(e,Le),Ce=e=>De(e,Me),Ie=e=>De(e,Oe),ze=e=>De(e,Ee),Se=e=>De(e,je,!0),Re=(e,t,r)=>{const o=Y.exec(e);return!!o&&(o[1]?t(o[1]):r(o[2]))},De=(e,t,r=!1)=>{const o=U.exec(e);return!!o&&(o[1]?t(o[1]):r)},Me=e=>"position"===e||"percentage"===e,Ee=e=>"image"===e||"url"===e,Oe=e=>"length"===e||"size"===e||"bg-size"===e,Ae=e=>"length"===e,Pe=e=>"number"===e,Le=e=>"family-name"===e,je=e=>"shadow"===e,$e=K(()=>{const e=X("color"),t=X("font"),r=X("text"),o=X("font-weight"),a=X("tracking"),n=X("leading"),s=X("breakpoint"),i=X("container"),l=X("spacing"),c=X("radius"),d=X("shadow"),u=X("inset-shadow"),m=X("text-shadow"),f=X("drop-shadow"),p=X("blur"),b=X("perspective"),h=X("aspect"),g=X("ease"),v=X("animate"),x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ye,be],w=()=>[ye,be,l],y=()=>[oe,"full","auto",...w()],k=()=>[ne,"none","subgrid",ye,be],N=()=>["auto",{span:["full",ne,ye,be]},ne,ye,be],C=()=>[ne,"auto",ye,be],I=()=>["auto","min","max","fr",ye,be],z=()=>["auto",...w()],S=()=>[oe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],R=()=>[e,ye,be],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Ce,ve,{position:[ye,be]}],M=()=>["auto","cover","contain",Ie,pe,{size:[ye,be]}],E=()=>[se,ke,he],O=()=>["","none","full",c,ye,be],A=()=>["",ae,ke,he],P=()=>[ae,se,Ce,ve],L=()=>["","none",p,ye,be],j=()=>["none",ae,ye,be],$=()=>["none",ae,ye,be],V=()=>[ae,ye,be],F=()=>[oe,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ie],breakpoint:[ie],color:[le],container:[ie],"drop-shadow":[ie],ease:["in","out","in-out"],font:[fe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ie],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ie],shadow:[ie],spacing:["px",ae],text:[ie],"text-shadow":[ie],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oe,be,ye,h]}],container:["container"],columns:[{columns:[ae,be,ye,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:y()}],"inset-x":[{"inset-x":y()}],"inset-y":[{"inset-y":y()}],start:[{start:y()}],end:[{end:y()}],top:[{top:y()}],right:[{right:y()}],bottom:[{bottom:y()}],left:[{left:y()}],visibility:["visible","invisible","collapse"],z:[{z:[ne,"auto",ye,be]}],basis:[{basis:[oe,"full","auto",i,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ae,oe,"auto","initial","none",be]}],grow:[{grow:["",ae,ye,be]}],shrink:[{shrink:["",ae,ye,be]}],order:[{order:[ne,"first","last","none",ye,be]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],w:[{w:[i,"screen",...S()]}],"min-w":[{"min-w":[i,"screen","none",...S()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",r,ke,he]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,ye,ge]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",se,be]}],"font-family":[{font:[Ne,be,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ye,be]}],"line-clamp":[{"line-clamp":[ae,"none",ye,ge]}],leading:[{leading:[n,...w()]}],"list-image":[{"list-image":["none",ye,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[ae,"from-font","auto",ye,he]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[ae,"auto",ye,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ne,ye,be],radial:["",ye,be],conic:[ne,ye,be]},ze,xe]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:E()}],"gradient-via-pos":[{via:E()}],"gradient-to-pos":[{to:E()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":A()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[ae,ye,be]}],"outline-w":[{outline:["",ae,ke,he]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",d,Se,we]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",u,Se,we]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[ae,he]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",m,Se,we]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[ae,ye,be]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[ye,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,be]}],filter:[{filter:["","none",ye,be]}],blur:[{blur:L()}],brightness:[{brightness:[ae,ye,be]}],contrast:[{contrast:[ae,ye,be]}],"drop-shadow":[{"drop-shadow":["","none",f,Se,we]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",ae,ye,be]}],"hue-rotate":[{"hue-rotate":[ae,ye,be]}],invert:[{invert:["",ae,ye,be]}],saturate:[{saturate:[ae,ye,be]}],sepia:[{sepia:["",ae,ye,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,be]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[ae,ye,be]}],"backdrop-contrast":[{"backdrop-contrast":[ae,ye,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ae,ye,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ae,ye,be]}],"backdrop-invert":[{"backdrop-invert":["",ae,ye,be]}],"backdrop-opacity":[{"backdrop-opacity":[ae,ye,be]}],"backdrop-saturate":[{"backdrop-saturate":[ae,ye,be]}],"backdrop-sepia":[{"backdrop-sepia":["",ae,ye,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ae,"initial",ye,be]}],ease:[{ease:["linear","initial",g,ye,be]}],delay:[{delay:[ae,ye,be]}],animate:[{animate:["none",v,ye,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ye,be]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:j()}],"rotate-x":[{"rotate-x":j()}],"rotate-y":[{"rotate-y":j()}],"rotate-z":[{"rotate-z":j()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:V()}],"skew-x":[{"skew-x":V()}],"skew-y":[{"skew-y":V()}],transform:[{transform:[ye,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,be]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[ae,ke,he,ge]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ve(...e){return $e(E(e))}function Fe(e,t){if(e)if("function"==typeof e)e(t);else try{e.current=t}catch{}}function Te(...e){return t.useCallback(t=>{e.forEach(e=>Fe(e,t))},e)}function We(e){return function(e){return!!(e&&"object"==typeof e&&"value"in e&&"peek"in e&&"function"==typeof e.peek&&"subscribe"in e&&"function"==typeof e.subscribe)}(e)?e.value:e}const _e=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,qe=E,Be=(e,t)=>r=>{var o;if(null==(null==t?void 0:t.variants))return qe(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:n}=t,s=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],o=null==n?void 0:n[e];if(null===t)return null;const s=_e(t)||_e(o);return a[e][s]}),i=r&&Object.entries(r).reduce((e,t)=>{let[r,o]=t;return void 0===o||(e[r]=o),e},{}),l=null==t||null===(o=t.compoundVariants)||void 0===o?void 0:o.reduce((e,t)=>{let{class:r,className:o,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...n,...i}[t]):{...n,...i}[t]===r})?[...e,r,o]:e},[]);return qe(e,s,l,null==r?void 0:r.class,null==r?void 0:r.className)},Ge=Be("relative flex shrink-0 overflow-hidden",{variants:{size:{sm:"w-6 h-6 text-xs",md:"w-8 h-8 text-sm",lg:"w-12 h-12 text-base"},shape:{circle:"rounded-full",square:"rounded-md"}},defaultVariants:{size:"md",shape:"circle"}}),He=t.forwardRef(({children:e,className:r,size:o,shape:a,...n},i)=>{const[c,d]=t.useState("idle"),u=t.useCallback(e=>{d(e)},[]),m=t.useMemo(()=>({imageLoadingStatus:c,onImageLoadingStatusChange:u}),[c,u]);return s(l,{value:m,children:s("span",{ref:i,className:Ve(Ge({size:o,shape:a}),r),...n,children:e})})});He.displayName="AvatarRoot";const Ke=t.forwardRef(({src:e,alt:r,className:o,onLoadingStatusChange:a,...n},i)=>{const{imageLoadingStatus:l,onImageLoadingStatusChange:d}=c(),[u,m]=t.useState(!1);return t.useEffect(()=>{if(m(!1),!e)return;d("loading"),a?.("loading");const t=new Image,r=()=>{d("loaded"),a?.("loaded")},o=()=>{m(!0),d("error"),a?.("error")};return t.addEventListener("load",r),t.addEventListener("error",o),t.src=e,()=>{t.removeEventListener("load",r),t.removeEventListener("error",o)}},[e,d,a]),!e||u||"error"===l?null:s("img",{ref:i,src:e,alt:r,className:Ve("aspect-square h-full w-full object-cover",o),...n})});Ke.displayName="AvatarImage";const Xe=t.forwardRef(({children:e,className:r,delayMs:o=0,...a},n)=>{const{imageLoadingStatus:i}=c(),[l,d]=t.useState(0===o);t.useEffect(()=>{if(0===o)return;const e=setTimeout(()=>{d(!0)},o);return()=>{clearTimeout(e)}},[o]);return l&&("idle"===i||"error"===i)?s("span",{ref:n,className:Ve("flex h-full w-full items-center justify-center","bg-surface-secondary text-alt font-medium uppercase cursor-default",r),...a,children:e}):null});Xe.displayName="AvatarFallback";const Ye=Object.assign(He,{Root:He,Image:Ke,Fallback:Xe}),Ue=Be(["inline-flex items-center justify-center","text-main font-semibold","box-border rounded-sm transition-highlight","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-offset-0","disabled:select-none disabled:pointer-events-none disabled:opacity-30","overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer"],{variants:{variant:{text:"bg-btn-primary hover:bg-btn-primary-hover active:bg-btn-active active:text-alt",filled:"bg-btn-secondary hover:bg-btn-secondary-hover active:bg-btn-active active:text-alt",solid:"bg-btn-tertiary text-alt hover:bg-btn-tertiary-hover active:bg-btn-active",outline:"bg-btn-primary hover:bg-btn-primary-hover active:bg-btn-active active:text-alt border border-bdr-strong"},size:{sm:"h-9 px-3.5 gap-2 text-sm",md:"h-10 px-3.5 gap-2.5 text-base",lg:"h-11.5 px-4 gap-3 text-lg"}},defaultVariants:{variant:"text",size:"md"}}),Ze=t.forwardRef(({className:e,variant:t="text",size:r="md",iconSize:o,iconStrokeWidth:a=1.5,startIcon:n,label:i,endIcon:l,title:c,children:d,...u},m)=>{const f=n,p=l,b=o??(e=>{switch(e){case"sm":return 14;case"md":return 20;case"lg":return 24}})(r??"md");return s("button",{ref:m,type:"button",className:Ve(Ue({variant:t,size:r}),e),title:c,"aria-label":c??i,"aria-disabled":u.disabled,...u,children:[f&&s(f,{size:b,strokeWidth:a}),d,i,p&&s(p,{size:b,strokeWidth:a})]})});Ze.displayName="Button";const Je=(e,r)=>{t.useEffect(()=>{if(!e)return;const t=r??document.body,o=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=o}},[e,r])};function Qe(e,r,o){const[a,n]=t.useState(r),s=void 0!==e;return[s?e:a,t.useCallback(e=>{s||n(e),o?.(e)},[s,o])]}function et(){const e=t.useRef(new Map);return{registerItem:t.useCallback((t,r=!1)=>{e.current.set(t,{disabled:r})},[]),unregisterItem:t.useCallback(t=>{e.current.delete(t)},[]),getItems:t.useCallback(()=>Array.from(e.current.keys()),[]),isItemDisabled:t.useCallback(t=>e.current.get(t)?.disabled??!1,[])}}function tt(e){const{getItems:r,isItemDisabled:o,active:a,setActive:n,loop:s=!1,orientation:i="vertical",onSelect:l,onEscape:c}=e,d=t.useCallback(e=>{const t=r();if(!t.length)return;const i=a?t.indexOf(a):-1;let l,c=0;const d=t.length;for(l=-1===i?e>0?0:t.length-1:i+e;c<d;){if(s)l<0?l=t.length-1:l>=t.length&&(l=0);else if(l<0||l>=t.length)return;if(!o(t[l]))return void n(t[l]);l+=e,c++}},[r,a,n,s,o]),u=t.useCallback(e=>{const t=r();if(!t.length)return;const s="vertical"===i,u=s?"ArrowDown":"ArrowRight",m=s?"ArrowUp":"ArrowLeft";switch(e.key){case u:e.preventDefault(),d(1);break;case m:e.preventDefault(),d(-1);break;case"Home":e.preventDefault();{const e=t.find(e=>!o(e));e&&n(e)}break;case"End":e.preventDefault();{const e=[...t].reverse().find(e=>!o(e));e&&n(e)}break;case"Enter":case" ":e.preventDefault(),a&&!o(a)&&l?.(a);break;case"Escape":e.preventDefault(),c?.()}},[r,a,d,n,o,i,l,c]);return{moveActive:d,handleKeyDown:u}}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("preact"),t=require("react"),r=require("@radix-ui/react-slot"),o=require("focus-trap-react"),n=require("react-dom");var a=0;function s(t,r,o,n,s,i){r||(r={});var l,c,d=r;if("ref"in d)for(c in d={},r)"ref"==c?l=r[c]:d[c]=r[c];var u={type:t,props:d,key:o,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--a,__i:-1,__u:0,__source:s,__self:i};if("function"==typeof t&&(l=t.defaultProps))for(c in l)void 0===d[c]&&(d[c]=l[c]);return e.options.vnode&&e.options.vnode(u),u}const i=t.createContext(void 0),l=({value:e,children:t})=>s(i.Provider,{value:e,children:t});l.displayName="AvatarProvider";const c=()=>{const e=t.useContext(i);if(!e)throw new Error("useAvatar must be used within an Avatar");return e},d=t.createContext(void 0),u=({value:e,children:t})=>s(d.Provider,{value:e,children:t});u.displayName="ComboboxProvider";const m=()=>{const e=t.useContext(d);if(!e)throw new Error("useCombobox must be used within a ComboboxProvider");return e},f=t.createContext(void 0),p=({value:e,children:t})=>s(f.Provider,{value:e,children:t});p.displayName="DialogProvider";const b=()=>{const e=t.useContext(f);if(!e)throw new Error("useDialog must be used within a DialogProvider");return e},h=t.createContext(void 0),g=({children:e,prefix:t})=>s(h.Provider,{value:{prefix:t},children:e});g.displayName="IdProvider";const v=(e,r)=>{const o=e??t.useId(),n=t.useContext(h);return[n?.prefix,r,o].filter(Boolean).join("-")},x=t.createContext(void 0),w=({value:e,children:t})=>s(x.Provider,{value:e,children:t});w.displayName="ListboxProvider";const y=()=>{const e=t.useContext(x);if(!e)throw new Error("useListbox must be used within a Listbox");return e},k=t.createContext(void 0),N=({value:e,children:t})=>s(k.Provider,{value:e,children:t}),C=()=>{const e=t.useContext(k);if(!e)throw new Error("useMenu must be used within a MenuProvider");return e},I=t.createContext(void 0),M=I.Provider;function S(){const e=t.useContext(I);if(!e)throw new Error("useMenubarMenu must be used within a Menubar.Menu component");return e}const E=t.createContext(void 0),z=({value:e,children:t})=>s(E.Provider,{value:e,children:t});z.displayName="MenubarProvider";const D=()=>{const e=t.useContext(E);if(!e)throw new Error("useMenubar must be used within a MenubarProvider");return e},R=t.createContext(void 0),P=({value:e,children:t})=>s(R.Provider,{value:e,children:t}),A=()=>{const e=t.useContext(R);if(!e)throw new Error("useSearchField must be used within a SearchFieldProvider");return e};function O(e,t){return`${e}-${t}`}function L(e,t,r){return`${e}-${t}-item-${r}`}function j(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=j(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function $(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=j(e))&&(o&&(o+=" "),o+=t);return o}const F=e=>{const t=W(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),V(r,t)||T(e)},getConflictingClassGroupIds:(e,t)=>{const n=r[e]||[];return t&&o[e]?[...n,...o[e]]:n}}},V=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),n=o?V(e.slice(1),o):void 0;if(n)return n;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},B=/^\[(.+)\]$/,T=e=>{if(B.test(e)){const t=B.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},W=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const n in r)_(r[n],o,n,t);return o},_=(e,t,r,o)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:q(t,e)).classGroupId=r)}if("function"==typeof e)return K(e)?void _(e(o),t,r,o):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,n])=>{_(n,q(t,e),r,o)})})},q=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},K=e=>e.isThemeGetter,G=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const n=(n,a)=>{r.set(n,a),t++,t>e&&(t=0,o=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=o.get(e))?(n(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):n(e,t)}}},H=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=e=>{const t=[];let r,o=0,n=0,a=0;for(let l=0;l<e.length;l++){let s=e[l];if(0===o&&0===n){if(":"===s){t.push(e.slice(a,l)),a=l+1;continue}if("/"===s){r=l;continue}}"["===s?o++:"]"===s?o--:"("===s?n++:")"===s&&n--}const s=0===t.length?e:e.substring(a),i=U(s);return{modifiers:t,hasImportantModifier:i!==s,baseClassName:i,maybePostfixModifierPosition:r&&r>a?r-a:void 0}};if(t){const e=t+":",r=o;o=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){const e=o;o=t=>r({className:t,parseClassName:e})}return o},U=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,X=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const r=[];let o=[];return e.forEach(e=>{"["===e[0]||t[e]?(r.push(...o.sort(),e),o=[]):o.push(e)}),r.push(...o.sort()),r}},Y=/\s+/;function Z(){let e,t,r=0,o="";for(;r<arguments.length;)(e=arguments[r++])&&(t=J(e))&&(o&&(o+=" "),o+=t);return o}const J=e=>{if("string"==typeof e)return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=J(e[o]))&&(r&&(r+=" "),r+=t);return r};function Q(e,...t){let r,o,n,a=function(i){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:G(e.cacheSize),parseClassName:H(e),sortModifiers:X(e),...F(e)}))(l),o=r.cache.get,n=r.cache.set,a=s,s(i)};function s(e){const t=o(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:a}=t,s=[],i=e.trim().split(Y);let l="";for(let c=i.length-1;c>=0;c-=1){const e=i[c],{isExternal:t,modifiers:d,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:f}=r(e);if(t){l=e+(l.length>0?" "+l:l);continue}let p=!!f,b=o(p?m.substring(0,f):m);if(!b){if(!p){l=e+(l.length>0?" "+l:l);continue}if(b=o(m),!b){l=e+(l.length>0?" "+l:l);continue}p=!1}const h=a(d).join(":"),g=u?h+"!":h,v=g+b;if(s.includes(v))continue;s.push(v);const x=n(b,p);for(let r=0;r<x.length;++r){const e=x[r];s.push(g+e)}l=e+(l.length>0?" "+l:l)}return l})(e,r);return n(e,a),a}return function(){return a(Z.apply(null,arguments))}}const ee=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},te=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,re=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oe=/^\d+\/\d+$/,ne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ae=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,se=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,le=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ce=e=>oe.test(e),de=e=>!!e&&!Number.isNaN(Number(e)),ue=e=>!!e&&Number.isInteger(Number(e)),me=e=>e.endsWith("%")&&de(e.slice(0,-1)),fe=e=>ne.test(e),pe=()=>!0,be=e=>ae.test(e)&&!se.test(e),he=()=>!1,ge=e=>ie.test(e),ve=e=>le.test(e),xe=e=>!ye(e)&&!Se(e),we=e=>Oe(e,Fe,he),ye=e=>te.test(e),ke=e=>Oe(e,Ve,be),Ne=e=>Oe(e,Be,de),Ce=e=>Oe(e,je,he),Ie=e=>Oe(e,$e,ve),Me=e=>Oe(e,We,ge),Se=e=>re.test(e),Ee=e=>Le(e,Ve),ze=e=>Le(e,Te),De=e=>Le(e,je),Re=e=>Le(e,Fe),Pe=e=>Le(e,$e),Ae=e=>Le(e,We,!0),Oe=(e,t,r)=>{const o=te.exec(e);return!!o&&(o[1]?t(o[1]):r(o[2]))},Le=(e,t,r=!1)=>{const o=re.exec(e);return!!o&&(o[1]?t(o[1]):r)},je=e=>"position"===e||"percentage"===e,$e=e=>"image"===e||"url"===e,Fe=e=>"length"===e||"size"===e||"bg-size"===e,Ve=e=>"length"===e,Be=e=>"number"===e,Te=e=>"family-name"===e,We=e=>"shadow"===e,_e=Q(()=>{const e=ee("color"),t=ee("font"),r=ee("text"),o=ee("font-weight"),n=ee("tracking"),a=ee("leading"),s=ee("breakpoint"),i=ee("container"),l=ee("spacing"),c=ee("radius"),d=ee("shadow"),u=ee("inset-shadow"),m=ee("text-shadow"),f=ee("drop-shadow"),p=ee("blur"),b=ee("perspective"),h=ee("aspect"),g=ee("ease"),v=ee("animate"),x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Se,ye],w=()=>[Se,ye,l],y=()=>[ce,"full","auto",...w()],k=()=>[ue,"none","subgrid",Se,ye],N=()=>["auto",{span:["full",ue,Se,ye]},ue,Se,ye],C=()=>[ue,"auto",Se,ye],I=()=>["auto","min","max","fr",Se,ye],M=()=>["auto",...w()],S=()=>[ce,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],E=()=>[e,Se,ye],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",De,Ce,{position:[Se,ye]}],D=()=>["auto","cover","contain",Re,we,{size:[Se,ye]}],R=()=>[me,Ee,ke],P=()=>["","none","full",c,Se,ye],A=()=>["",de,Ee,ke],O=()=>[de,me,De,Ce],L=()=>["","none",p,Se,ye],j=()=>["none",de,Se,ye],$=()=>["none",de,Se,ye],F=()=>[de,Se,ye],V=()=>[ce,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fe],breakpoint:[fe],color:[pe],container:[fe],"drop-shadow":[fe],ease:["in","out","in-out"],font:[xe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fe],shadow:[fe],spacing:["px",de],text:[fe],"text-shadow":[fe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ce,ye,Se,h]}],container:["container"],columns:[{columns:[de,ye,Se,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:y()}],"inset-x":[{"inset-x":y()}],"inset-y":[{"inset-y":y()}],start:[{start:y()}],end:[{end:y()}],top:[{top:y()}],right:[{right:y()}],bottom:[{bottom:y()}],left:[{left:y()}],visibility:["visible","invisible","collapse"],z:[{z:[ue,"auto",Se,ye]}],basis:[{basis:[ce,"full","auto",i,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[de,ce,"auto","initial","none",ye]}],grow:[{grow:["",de,Se,ye]}],shrink:[{shrink:["",de,Se,ye]}],order:[{order:[ue,"first","last","none",Se,ye]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],w:[{w:[i,"screen",...S()]}],"min-w":[{"min-w":[i,"screen","none",...S()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",r,Ee,ke]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Se,Ne]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",me,ye]}],"font-family":[{font:[ze,ye,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,Se,ye]}],"line-clamp":[{"line-clamp":[de,"none",Se,Ne]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",Se,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[de,"from-font","auto",Se,ke]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[de,"auto",Se,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ue,Se,ye],radial:["",Se,ye],conic:[ue,Se,ye]},Pe,Ie]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":A()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[de,Se,ye]}],"outline-w":[{outline:["",de,Ee,ke]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",d,Ae,Me]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",u,Ae,Me]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[de,ke]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",m,Ae,Me]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[de,Se,ye]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[de]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[Se,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[de]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,ye]}],filter:[{filter:["","none",Se,ye]}],blur:[{blur:L()}],brightness:[{brightness:[de,Se,ye]}],contrast:[{contrast:[de,Se,ye]}],"drop-shadow":[{"drop-shadow":["","none",f,Ae,Me]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",de,Se,ye]}],"hue-rotate":[{"hue-rotate":[de,Se,ye]}],invert:[{invert:["",de,Se,ye]}],saturate:[{saturate:[de,Se,ye]}],sepia:[{sepia:["",de,Se,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,ye]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[de,Se,ye]}],"backdrop-contrast":[{"backdrop-contrast":[de,Se,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",de,Se,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[de,Se,ye]}],"backdrop-invert":[{"backdrop-invert":["",de,Se,ye]}],"backdrop-opacity":[{"backdrop-opacity":[de,Se,ye]}],"backdrop-saturate":[{"backdrop-saturate":[de,Se,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",de,Se,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[de,"initial",Se,ye]}],ease:[{ease:["linear","initial",g,Se,ye]}],delay:[{delay:[de,Se,ye]}],animate:[{animate:["none",v,Se,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Se,ye]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:j()}],"rotate-x":[{"rotate-x":j()}],"rotate-y":[{"rotate-y":j()}],"rotate-z":[{"rotate-z":j()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[Se,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Se,ye]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Se,ye]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[de,Ee,ke,Ne]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function qe(...e){return _e($(e))}function Ke(e,t){if(e)if("function"==typeof e)e(t);else try{e.current=t}catch{}}function Ge(...e){return t.useCallback(t=>{e.forEach(e=>Ke(e,t))},e)}function He(e){return function(e){return!!(e&&"object"==typeof e&&"value"in e&&"peek"in e&&"function"==typeof e.peek&&"subscribe"in e&&"function"==typeof e.subscribe)}(e)?e.value:e}const Ue=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Xe=$,Ye=(e,t)=>r=>{var o;if(null==(null==t?void 0:t.variants))return Xe(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:n,defaultVariants:a}=t,s=Object.keys(n).map(e=>{const t=null==r?void 0:r[e],o=null==a?void 0:a[e];if(null===t)return null;const s=Ue(t)||Ue(o);return n[e][s]}),i=r&&Object.entries(r).reduce((e,t)=>{let[r,o]=t;return void 0===o||(e[r]=o),e},{}),l=null==t||null===(o=t.compoundVariants)||void 0===o?void 0:o.reduce((e,t)=>{let{class:r,className:o,...n}=t;return Object.entries(n).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...i}[t]):{...a,...i}[t]===r})?[...e,r,o]:e},[]);return Xe(e,s,l,null==r?void 0:r.class,null==r?void 0:r.className)},Ze=Ye("relative flex shrink-0 overflow-hidden",{variants:{size:{sm:"w-6 h-6 text-xs",md:"w-8 h-8 text-sm",lg:"w-12 h-12 text-base"},shape:{circle:"rounded-full",square:"rounded-md"}},defaultVariants:{size:"md",shape:"circle"}}),Je=t.forwardRef(({children:e,className:r,size:o,shape:n,...a},i)=>{const[c,d]=t.useState("idle"),u=t.useCallback(e=>{d(e)},[]),m=t.useMemo(()=>({imageLoadingStatus:c,onImageLoadingStatusChange:u}),[c,u]);return s(l,{value:m,children:s("span",{ref:i,className:qe(Ze({size:o,shape:n}),r),...a,children:e})})});Je.displayName="AvatarRoot";const Qe=t.forwardRef(({src:e,alt:r,className:o,onLoadingStatusChange:n,...a},i)=>{const{imageLoadingStatus:l,onImageLoadingStatusChange:d}=c(),[u,m]=t.useState(!1);return t.useEffect(()=>{if(m(!1),!e)return;d("loading"),n?.("loading");const t=new Image,r=()=>{d("loaded"),n?.("loaded")},o=()=>{m(!0),d("error"),n?.("error")};return t.addEventListener("load",r),t.addEventListener("error",o),t.src=e,()=>{t.removeEventListener("load",r),t.removeEventListener("error",o)}},[e,d,n]),!e||u||"error"===l?null:s("img",{ref:i,src:e,alt:r,className:qe("aspect-square h-full w-full object-cover",o),...a})});Qe.displayName="AvatarImage";const et=t.forwardRef(({children:e,className:r,delayMs:o=0,...n},a)=>{const{imageLoadingStatus:i}=c(),[l,d]=t.useState(0===o);t.useEffect(()=>{if(0===o)return;const e=setTimeout(()=>{d(!0)},o);return()=>{clearTimeout(e)}},[o]);return l&&("idle"===i||"error"===i)?s("span",{ref:a,className:qe("flex h-full w-full items-center justify-center","bg-surface-secondary text-alt font-medium uppercase cursor-default",r),...n,children:e}):null});et.displayName="AvatarFallback";const tt=Object.assign(Je,{Root:Je,Image:Qe,Fallback:et}),rt=Ye(["inline-flex items-center justify-center","text-main font-semibold","box-border rounded-sm transition-highlight","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-bdr-strong focus-visible:ring-offset-3 focus-visible:ring-offset-surface-neutral","active:bg-btn-active active:text-alt data-[active=true]:bg-btn-active data-[active=true]:text-alt","disabled:select-none disabled:pointer-events-none disabled:opacity-30","overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer"],{variants:{variant:{text:"bg-btn-primary hover:bg-btn-primary-hover hover:text-main",filled:"bg-btn-secondary hover:bg-btn-secondary-hover hover:text-main",solid:"bg-btn-tertiary text-alt hover:bg-btn-tertiary-hover",outline:"bg-btn-primary hover:bg-btn-primary-hover border border-bdr-strong"},size:{sm:"h-9 px-3.5 gap-2 text-sm",md:"h-10 px-3.5 gap-2.5 text-base",lg:"h-11.5 px-4 gap-3 text-lg"}},defaultVariants:{variant:"text",size:"md"}}),ot=t.forwardRef(({className:e,variant:t="text",size:r="md",iconSize:o,iconStrokeWidth:n=1.5,startIcon:a,label:i,endIcon:l,title:c,children:d,...u},m)=>{const f=a,p=l,b=o??(e=>{switch(e){case"sm":return 14;case"md":return 20;case"lg":return 24}})(r??"md");return s("button",{ref:m,type:"button",className:qe(rt({variant:t,size:r}),e),title:c,"aria-label":c??i,"aria-disabled":u.disabled,...u,children:[f&&s(f,{size:b,strokeWidth:n}),d,i,p&&s(p,{size:b,strokeWidth:n})]})});ot.displayName="Button";const nt=(e,r)=>{t.useEffect(()=>{if(!e)return;const t=r??document.body,o=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=o}},[e,r])};function at(e,r,o){const[n,a]=t.useState(r),s=void 0!==e;return[s?e:n,t.useCallback(e=>{s||a(e),o?.(e)},[s,o])]}function st(e,r,o){const n=null===e?void 0:e,a=t.useCallback(e=>{o?.(e??null)},[o]),[s,i]=at(n,r,a);return[s,t.useCallback(e=>{i(e??void 0)},[i])]}function it(){const e=t.useRef(new Map);return{registerItem:t.useCallback((t,r=!1)=>{e.current.set(t,{disabled:r})},[]),unregisterItem:t.useCallback(t=>{e.current.delete(t)},[]),getItems:t.useCallback(()=>Array.from(e.current.keys()),[]),isItemDisabled:t.useCallback(t=>e.current.get(t)?.disabled??!1,[])}}function lt(e){const{getItems:r,isItemDisabled:o,active:n,setActive:a,loop:s=!1,orientation:i="vertical",onSelect:l,onEscape:c}=e,d=t.useCallback(e=>{const t=r();if(!t.length)return;const i=n?t.indexOf(n):-1;let l,c=0;const d=t.length;for(l=-1===i?e>0?0:t.length-1:i+e;c<d;){if(s)l<0?l=t.length-1:l>=t.length&&(l=0);else if(l<0||l>=t.length)return;if(!o(t[l]))return void a(t[l]);l+=e,c++}},[r,n,a,s,o]),u=t.useCallback(e=>{const t=r();if(!t.length)return;const s="vertical"===i,u=s?"ArrowDown":"ArrowRight",m=s?"ArrowUp":"ArrowLeft";switch(e.key){case u:e.preventDefault(),d(1);break;case m:e.preventDefault(),d(-1);break;case"Home":e.preventDefault();{const e=t.find(e=>!o(e));e&&a(e)}break;case"End":e.preventDefault();{const e=[...t].reverse().find(e=>!o(e));e&&a(e)}break;case"Enter":case" ":e.preventDefault(),n&&!o(n)&&l?.(n);break;case"Escape":e.preventDefault(),c?.()}},[r,n,d,a,o,i,l,c]);return{moveActive:d,handleKeyDown:u}}
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-react v0.545.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const
|
|
7
|
+
*/const ct=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},dt=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),ut=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
8
8
|
/**
|
|
9
9
|
* @license lucide-react v0.545.0 - ISC
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the ISC license.
|
|
12
12
|
* See the LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
|
-
var
|
|
14
|
+
var mt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
|
|
15
15
|
/**
|
|
16
16
|
* @license lucide-react v0.545.0 - ISC
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the ISC license.
|
|
19
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/const
|
|
20
|
+
*/const ft=t.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:n,className:a="",children:s,iconNode:i,...l},c)=>t.createElement("svg",{ref:c,...mt,width:r,height:r,stroke:e,strokeWidth:n?24*Number(o)/Number(r):o,className:dt("lucide",a),...!s&&!ut(l)&&{"aria-hidden":"true"},...l},[...i.map(([e,r])=>t.createElement(e,r)),...Array.isArray(s)?s:[s]])),pt=(e,r)=>{const o=t.forwardRef(({className:o,...n},a)=>{return t.createElement(ft,{ref:a,iconNode:r,className:dt(`lucide-${s=ct(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o),...n});var s});return o.displayName=ct(e),o},bt=pt("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),ht=pt("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),gt=pt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),vt=pt("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),xt=pt("lock-keyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]),wt=pt("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),yt=pt("octagon-alert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]),kt=pt("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Nt=pt("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ct=Ye(["inline-block","flex-shrink-0 flex items-center justify-center","h-3.5 w-3.5","border-[1.5px] rounded-xs","bg-transparent","transition-highlight"],{variants:{editable:{true:[],false:"opacity-30"},state:{default:["border-main","peer-checked:bg-main peer-checked:border-main","peer-indeterminate:bg-main peer-indeterminate:border-main","group-data-[tone=inverse]:border-alt","group-data-[tone=inverse]:peer-checked:bg-alt","group-data-[tone=inverse]:peer-checked:border-alt","group-data-[tone=inverse]:peer-indeterminate:bg-alt","group-data-[tone=inverse]:peer-indeterminate:border-alt"],error:["border-error","peer-checked:bg-error peer-checked:border-error","peer-indeterminate:bg-error peer-indeterminate:border-error"]}},defaultVariants:{state:"default",editable:!0}}),It=t.forwardRef(({id:e,className:t,name:r,label:o,defaultChecked:n=!1,checked:a,align:i="left",error:l,disabled:c,readOnly:d,required:u,value:m="on",onCheckedChange:f,errorMessage:p,...b},h)=>{const g=v(He(e)),x=l?"error":"default",w=!c&&!d,[y,k]=at(a,n,f),N="indeterminate"===y,C=!0===y;return s("div",{className:"flex flex-col gap-1 w-fit",children:[s("label",{htmlFor:g,className:qe("relative flex items-center select-none gap-2 my-0.75 rounded-xs leading-4","right"===i&&"flex-row-reverse justify-end",w?"cursor-pointer":"cursor-default",w&&"focus-within:outline-none focus-within:ring-3 focus-within:ring-bdr-strong focus-within:ring-offset-3 focus-within:ring-offset-surface-neutral",l&&w&&"focus-within:ring-error",t),children:[s("input",{ref:e=>{"function"==typeof h?h(e):h&&(h.current=e),e&&(e.indeterminate=N)},...b,id:g,type:"checkbox",className:"peer sr-only",checked:C,disabled:d??c,required:u,name:r,value:m,"aria-checked":N?"mixed":C,"aria-disabled":c,"aria-invalid":l,"aria-readonly":d,"data-state":N?"indeterminate":C?"checked":"unchecked","data-disabled":c?"":void 0,onChange:e=>{if(!w)return;let t;t=!N&&e.currentTarget.checked,k(t)}}),s("span",{className:qe(Ct({state:x,editable:w})),"aria-hidden":"true",children:N?s(wt,{size:10,className:qe("text-rev",!l&&"group-data-[tone=inverse]:text-alt-rev"),strokeWidth:4}):C?s(ht,{size:10,className:qe("text-rev",!l&&"group-data-[tone=inverse]:text-alt-rev"),strokeWidth:4}):null}),o&&s("span",{className:qe("text-main group-data-[tone=inverse]:text-alt",c&&"opacity-30"),children:o})]}),"error"===x&&p&&s("div",{className:qe("flex items-center gap-2 text-error leading-5",c&&"opacity-30"),children:[s(yt,{size:14,strokeWidth:2.5}),p]})]})});
|
|
21
21
|
/**
|
|
22
22
|
* @license lucide-react v0.545.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/vt.displayName="Checkbox";const xt=Be(["p-0"],{variants:{size:{sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11.5 w-11.5"},shape:{square:"rounded-sm",round:"rounded-full"}},defaultVariants:{size:"md",shape:"square"}}),wt=t.forwardRef(({className:e,variant:t="text",size:r="md",shape:o="square",icon:a,...n},i)=>s(Ze,{ref:i,className:Ve(xt({size:r,shape:o}),e),variant:t,size:r,startIcon:a,label:"",...n}));function yt(e,t,r="any"){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;const o="any"===r?[...e].sort():e,a="any"===r?[...t].sort():t;for(let n=0;n<o.length;n+=1)if(o[n]!==a[n])return!1;return!0}wt.displayName="IconButton";const kt=[],Nt=e=>t=>yt(t,e)?t:e,Ct=({children:e,open:r,defaultOpen:o=!1,onOpenChange:a,closeOnBlur:n=!0,value:i,defaultValue:l="",onChange:c,disabled:d=!1,error:m=!1,selectionMode:f="single",selection:p,defaultSelection:b=kt,onSelectionChange:h,active:g,defaultActive:x,setActive:w})=>{const y=v(),[k,N]=Qe(r,o,a),[C,I]=Qe(i,l,c),z="single"!==f,S="staged"===f,[R,D]=t.useState(()=>new Set(b)),M=void 0!==p,E=t.useMemo(()=>M?new Set(p):R,[M,p,R]),O=t.useMemo(()=>Array.from(E),[E]),[A,P]=t.useState(O);t.useEffect(()=>{P(S?Nt(O):O)},[O,S]);const L=S?A:O,j=t.useMemo(()=>new Set(L),[L]),$=t.useMemo(()=>S&&!yt(A,O),[S,A,O]),V=t.useCallback(()=>{S&&P(Nt(O))},[S,O]),[F,T]=Qe(g,x,w),{registerItem:W,unregisterItem:_,getItems:q,isItemDisabled:B}=et(),G=t.useCallback(e=>{I(e),N(!0)},[I,N]),H=t.useCallback(e=>{N(e),e||V()},[N,V]),K=t.useCallback(e=>{const t=new Set(e);M||D(t),h?.(e),"single"===f&&N(!1)},[M,h,f,N]),X=t.useCallback(e=>{S?P(e):K(e)},[S,K]),Y=t.useCallback(()=>{S&&(yt(A,O)||K(A),N(!1))},[S,A,O,K,N]),{handleKeyDown:U}=tt({getItems:q,isItemDisabled:B,active:F,setActive:T,loop:!1,orientation:"vertical",onSelect:e=>{let t;t=z?L.includes(e)?L.filter(t=>t!==e):[...L,e]:[e],X(t)}}),Z=t.useCallback(e=>{if(!d){if("ArrowDown"!==e.key&&"ArrowUp"!==e.key||k||(e.preventDefault(),N(!0)),"Escape"===e.key)return e.preventDefault(),void H(!1);U(e)}},[d,k,N,H,U]);t.useEffect(()=>{if(k&&void 0===F){const e=q();e.length>0&&T(e[0])}},[k,F,q,T]);const J=t.useMemo(()=>({open:k,setOpen:H,inputValue:C,setInputValue:G,baseId:y,active:F,disabled:d,error:m,closeOnBlur:n,keyHandler:Z,selection:j,appliedSelection:O,stagedSelection:A,stagingEnabled:S,hasStagedChanges:$,applyStagedSelection:Y,resetStagedSelection:V}),[k,H,n,Z,C,G,F,y,d,m,j,O,A,S,$,Y,V]);return s(u,{value:J,children:s(ur.Root,{selectionMode:z?"multiple":"single",selection:L,onSelectionChange:X,disabled:d,active:F,focusable:!1,baseId:y,setActive:T,keyHandler:Z,registerItem:W,unregisterItem:_,getItems:q,isItemDisabled:B,children:e})})};Ct.displayName="Combobox.Root";const It=t.forwardRef(({className:e,children:r,...o},a)=>{const n=t.useRef(null),{setOpen:i,closeOnBlur:l}=m(),c=l?t.useCallback(e=>{const t=e.relatedTarget;t&&n.current?.contains(t)||i(!1)},[i]):void 0;return s("div",{ref:Te(a,n),className:e,onBlur:c,...o,children:r})});It.displayName="Combobox.Content";const zt=Be(["flex gap-2.5 items-center","h-12 rounded-sm border bg-surface-neutral","focus-within:outline-none focus-within:ring-3 focus-within:ring-ring/50 focus-within:ring-offset-0","transition-highlight"],{variants:{error:{true:"border-error focus-within:border-error focus-within:ring-error/50",false:"border-bdr-subtle focus-within:border-bdr-strong"},open:{true:"border-bdr-strong",false:null},disabled:{true:"pointer-events-none select-none opacity-30",false:null}},defaultVariants:{error:!1,open:!1,disabled:!1}}),St=({className:e,children:t,...r})=>{const{open:o,disabled:a,error:n}=m();return s("div",{className:Ve(zt({error:n,open:o,disabled:a}),e),"data-open":o?"true":void 0,...r,children:t})};St.displayName="Combobox.Control";const Rt=t.forwardRef(({placeholder:e,...r},o)=>{const a=t.useRef(null),{open:n,keyHandler:i,baseId:l,active:c,disabled:d,error:u}=m();return t.useEffect(()=>{n&&!d&&a.current?.focus()},[n,d]),s(Ir.Input,{ref:Te(o,a),id:`${l}-input`,onKeyDown:i,"aria-disabled":d,"aria-invalid":u??void 0,role:"combobox","aria-autocomplete":"list","aria-expanded":n,"aria-haspopup":"listbox","aria-controls":`${l}-listbox`,"aria-activedescendant":c?`${l}-listbox-option-${c}`:void 0,...r})});Rt.displayName="Combobox.Input";const Dt=({children:e,className:t,...r})=>{const{inputValue:o,setInputValue:a}=m();return s(Ir.Root,{value:o,onChange:a,className:Ve("w-full pr-0","border-0 focus-within:border-0 focus-within:ring-0 focus-within:ring-offset-0",t),...r,children:e})};Dt.displayName="Combobox.Search";const Mt=({className:e,...t})=>{const{open:r,setOpen:o,disabled:a}=m();return s(wt,{type:"button",variant:"text",size:"lg",icon:dt,"aria-label":"Toggle",onClick:()=>{a||o(!r)},disabled:a,tabIndex:-1,className:Ve("shrink-0 text-subtle transition-transform hover:bg-surface-primary-hover",r&&"rotate-180",e),...t})};Mt.displayName="Combobox.Toggle";const Et=({className:e,label:t="Apply",...r})=>{const{stagingEnabled:o,hasStagedChanges:a,applyStagedSelection:n}=m();return o&&a?s(Ze,{className:Ve("h-7 px-2.5 min-w-14 gap-2 text-xs",e),type:"button",label:t,variant:"outline",onClick:n,...r}):null};Et.displayName="Combobox.Apply";const Ot=({children:e,className:t,...r})=>{const{open:o}=m();return o?s("div",{className:Ve("absolute left-0 right-0 z-50 mt-1 rounded-sm bg-surface-neutral shadow-lg ring-1 ring-bdr-subtle",t),...r,children:e}):null};Ot.displayName="Combobox.Popup";const At=Object.assign(Ct,{Root:Ct,Content:It,Control:St,Search:Dt,Input:Rt,SearchIcon:Ir.Icon,Toggle:Mt,Apply:Et,Popup:Ot}),Pt=({open:e,defaultOpen:r=!1,onOpenChange:o,children:a})=>{const[n,i]=Qe(e,r,o),l=t.useMemo(()=>({open:n,setOpen:i}),[n,i]);return s(p,{value:l,children:a})};Pt.displayName="Dialog.Root";const Lt=t.forwardRef(({asChild:e,children:t,onClick:o,...a},n)=>{const{setOpen:i}=b();return s(e?r.Slot:"button",{ref:n,type:e?void 0:"button",onClick:e=>{o?.(e),i(!0)},...a,children:t})});Lt.displayName="Dialog.Trigger";const jt=({children:e,container:r,forceMount:o})=>{const{open:n}=b(),[s,i]=t.useState(!1);return t.useEffect(()=>{i(!0)},[]),s&&(o||n)?a.createPortal(e,r??document.body):null};jt.displayName="Dialog.Portal";const $t=t.forwardRef(({className:e,forceMount:t,...r},o)=>{const{open:a}=b();return t||a?s("div",{ref:o,"data-state":a?"open":"closed",className:Ve("fixed inset-0 z-30 bg-overlay backdrop-blur-xs","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}):null});$t.displayName="Dialog.Overlay";const Vt=t.forwardRef(({children:e,className:r,forceMount:a,onEscapeKeyDown:n,onPointerDownOutside:i,onInteractOutside:l,onOpenAutoFocus:c,onCloseAutoFocus:d,...u},m)=>{const{open:f,setOpen:p}=b(),h=t.useRef(null),g=t.useId(),v=t.useId();t.useEffect(()=>{"function"==typeof m?m(h.current):m&&(m.current=h.current)},[m]),Je(f);const x=t.useCallback(e=>{"Escape"===e.key&&(n?.(e),e.defaultPrevented||p(!1))},[n,p]);t.useEffect(()=>{if(f)return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[f,x]);const w=t.useCallback(e=>{const t=e.target;h.current&&!h.current.contains(t)&&(i?.(e),l?.(e),e.defaultPrevented||p(!1))},[i,l,p]);return t.useEffect(()=>{if(f)return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[f,w]),a||f?s(o.FocusTrap,{active:f,focusTrapOptions:{initialFocus:!1,fallbackFocus:()=>h.current??document.body,escapeDeactivates:!1,clickOutsideDeactivates:!1,returnFocusOnDeactivate:!0,allowOutsideClick:!0,preventScroll:!1,onActivate:()=>{requestAnimationFrame(()=>{const e=new Event("openautofocus",{bubbles:!0,cancelable:!0});c?.(e),!e.defaultPrevented&&h.current&&h.current.focus()})},onDeactivate:()=>{requestAnimationFrame(()=>{const e=new Event("closeautofocus",{bubbles:!0,cancelable:!0});d?.(e)})}},children:s("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-4",children:s("div",{ref:h,role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":v,"data-state":f?"open":"closed",tabIndex:-1,className:Ve("relative rounded-lg shadow-xl bg-surface-neutral","flex flex-col max-w-lg w-full max-h-[90vh] gap-10 p-10","border border-bdr-subtle outline-none overflow-hidden","focus:outline-none focus:ring-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",r),...u,children:e})})}):null});Vt.displayName="Dialog.Content";const Ft=t.forwardRef(({className:e,children:t,...r},o)=>s("header",{ref:o,className:Ve("relative grid gap-2.5 self-stretch",e),...r,children:t}));Ft.displayName="Dialog.Header";const Tt=t.forwardRef(({children:e,asChild:o,onClick:a,...n},i)=>{const{setOpen:l}=b(),c=t.useCallback(e=>{a?.(e),e.defaultPrevented||l(!1)},[a,l]);return s(o?r.Slot:"button",{ref:i,type:o?void 0:"button",onClick:c,...n,children:e})});Tt.displayName="Dialog.Close";const Wt=t.forwardRef(({children:e,className:t,asChild:o,...a},n)=>s(o?r.Slot:"h2",{ref:n,className:Ve("text-2xl font-semibold",t),...a,children:e}));Wt.displayName="Dialog.Title";const _t=t.forwardRef(({children:e,className:t,asChild:o,...a},n)=>s(o?r.Slot:"p",{ref:n,className:Ve("",t),...a,children:e}));_t.displayName="Dialog.Description";const qt=t.forwardRef(({className:e,children:t,...r},o)=>s("div",{ref:o,className:Ve("min-h-0 flex-1 overflow-y-auto",e),...r,children:t}));qt.displayName="Dialog.Body";const Bt=t.forwardRef(({className:e,children:t,...r},o)=>s("footer",{ref:o,className:Ve("flex justify-end gap-2.5",e),...r,children:t}));Bt.displayName="Dialog.Footer";const Gt=t.forwardRef((e,t)=>s(Tt,{asChild:!0,ref:t,...e,children:s(wt,{"aria-label":"Close","data-area":"close",icon:ht,size:"lg",iconSize:36,iconStrokeWidth:1,shape:"round",variant:"filled"})}));Gt.displayName="Dialog.DefaultClose";const Ht=t.forwardRef(({title:e,description:t,withClose:r,className:o,children:a,...n},i)=>s(Ft,{ref:i,className:Ve(r&&"grid-cols-[minmax(0,1fr)_auto]",o),...n,children:[s(Wt,{className:Ve(r&&"col-start-1 row-start-1 min-w-0"),children:e}),r&&s(Gt,{className:"col-start-2 row-start-1 row-span-2 self-start justify-self-end"}),t&&s(_t,{className:Ve(r&&"row-start-2"),children:t}),a]}));Ht.displayName="Dialog.DefaultHeader";const Kt=Object.assign(Pt,{Root:Pt,Trigger:Lt,Portal:jt,Overlay:$t,Content:Vt,Header:Ft,Close:Tt,Title:Wt,Description:_t,Body:qt,Footer:Bt,DefaultClose:Gt,DefaultHeader:Ht}),Xt=Be(["relative flex rounded-sm overflow-hidden","h-12 border focus-within:border-bdr-solid","focus-within:outline-none focus-within:ring-3 focus-within:ring-ring/50 focus-within:ring-offset-0","transition-highlight"],{variants:{state:{default:"border-bdr-subtle focus-within:border-bdr-strong",error:"border-error focus-within:border-error focus-within:ring-error/50"},disabled:{true:"select-none"}},defaultVariants:{state:"default",disabled:!1}}),Yt=({children:e,error:t})=>s("div",{className:Ve("flex items-center justify-center shrink-0 min-w-12 px-4","text-sm text-subtle bg-surface-primary","first:rounded-l-sm first:border-r first:border-bdr-subtle","last:rounded-r-sm last:border-l last:border-bdr-subtle",t&&"first:border-error last:border-error"),children:e}),Ut=t.forwardRef(({className:e,label:t,description:r,error:o,startAddon:a,endAddon:n,id:i,disabled:l,readOnly:c,...d},u)=>{const m=v(We(i)),f=o?"error":"default",p="error"===f;return s("div",{className:Ve("w-full",l&&"opacity-30",e),children:[(!!t||!!r)&&s("div",{className:"mb-2",children:[t&&s("label",{htmlFor:m,className:"block text-base font-semibold text-main",children:s("div",{className:"flex items-center gap-2",children:[c&&s(mt,{size:16,strokeWidth:2.5}),t]})}),r&&s("div",{className:"text-sm text-subtle",children:r})]}),s("div",{className:Ve(Xt({state:f,disabled:l})),children:[a&&s(Yt,{error:p,children:a}),s("input",{ref:u,id:m,className:Ve("flex-1 w-full px-4.5 text-base","text-main bg-surface-neutral placeholder:text-subtle","border-0 focus:outline-none","disabled:select-none enabled:read-only:bg-surface-primary",a&&"rounded-l-none",n&&"rounded-r-none"),disabled:l,readOnly:c,...d}),n&&s(Yt,{error:p,children:n})]}),o&&s("div",{className:"flex items-center gap-2 mt-2 leading-5 text-error",children:[s(pt,{size:16,strokeWidth:2.5}),o]})]})});function Zt(e,t,r=!1){return"function"==typeof e?e:!0===e||void 0===e&&r?t:void 0}Ut.displayName="Input";const Jt=t.forwardRef(({className:e,href:t,external:r="auto",newTab:o,leftIcon:a,rightIcon:n,children:i,rel:l,...c},d)=>{const u="auto"===r?function(e){try{if(e.startsWith("mailto:")||e.startsWith("tel:"))return!0;const t="undefined"!=typeof window?window.location:void 0;return!t||new URL(e,t.origin).origin!==t.origin}catch{return!0}}(t):r,m=o??u?"_blank":void 0,f=Zt(a,lt),p=Zt(n,ut,u);return s("a",{ref:d,href:t,className:Ve("inline-flex items-center align-baseline gap-1","text-sm font-normal underline underline-offset-3 decoration-1","visited:text-link-visited hover:text-main-hover",e),target:m,rel:o||u?"noopener noreferrer":"noreferrer",...c,children:[f&&s(f,{className:"inline-block flex-none w-3.5 h-3.5",strokeWidth:1.5,"aria-hidden":"true"}),i,p&&s(p,{className:"inline-block flex-none w-3.5 h-3.5",strokeWidth:1.5,"aria-hidden":"true"})]})});function Qt(e,r){return t.Children.toArray(e).find(e=>function(e,r){return t.isValidElement(e)&&e.type===r}(e,r))}Jt.displayName="Link";const er=({children:e,className:t,...r})=>s("div",{className:Ve("flex items-center gap-2.5 flex-shrink-0",t),...r,children:e}),tr=({className:e,children:t,...r})=>s("div",{className:Ve("flex-1 min-w-0",e),...r,children:t});tr.displayName="ListItem.Content";const rr=({className:e,label:t,description:r,metadata:o,icon:a})=>s(tr,{className:Ve(a&&"grid grid-cols-[auto_1fr] gap-2.5 items-center",e),children:[a&&s("div",{className:"flex items-center justify-center flex-shrink-0 group-data-[tone=inverse]:text-alt",children:a}),s("div",{className:"min-w-0 text-left",children:[t&&s("h1",{className:"truncate font-semibold group-data-[tone=inverse]:text-alt",children:t}),r&&s("p",{className:"truncate text-sm text-subtle group-data-[tone=inverse]:text-alt",children:r}),o&&s("p",{className:"text-xs text-subtle group-data-[tone=inverse]:text-alt",children:o})]})]}),or=({children:e,className:t,...r})=>s("div",{className:Ve("flex items-center gap-5 flex-shrink-0",t),...r,children:e});or.displayName="ListItem.Right";const ar=({children:e,className:t,selected:r,...o})=>{const a=Qt(e,er),n=Qt(e,tr)??Qt(e,rr),i=Qt(e,or);return s("div",{className:Ve("group flex items-center px-2.5 py-1 gap-2.5",r&&"bg-surface-primary-selected text-alt",t),"data-tone":r&&"inverse",role:"listitem",...o,children:[a,n,i]})};ar.displayName="ListItem";const nr=Object.assign(ar,{Left:er,Content:tr,DefaultContent:rr,Right:or}),sr=[],ir=({baseId:e,selection:r,defaultSelection:o=sr,onSelectionChange:a,active:n,defaultActive:i,setActive:l,selectionMode:c="single",focusable:d=!0,disabled:u,children:m,keyHandler:f,registerItem:p,unregisterItem:b,getItems:h,isItemDisabled:g})=>{const x=e??v(),[y,k]=t.useState(()=>new Set(o)),N=void 0!==r,C=t.useMemo(()=>N?new Set(r):y,[N,r,y]),[I,z]=Qe(n,i,l),S=et(),R=p??S.registerItem,D=b??S.unregisterItem,M=h??S.getItems,E=g??S.isItemDisabled,O=t.useCallback(e=>{const t=C.has(e),r=new Set(C);"single"===c?(r.clear(),t||r.add(e)):t?r.delete(e):r.add(e),N||k(r),a?.(Array.from(r)),z(e)},[C,c,N,a,z]),A=t.useMemo(()=>({active:I,selection:C,selectionMode:c,focusable:d,disabled:u,setActive:z,toggleValue:O,baseId:x,keyHandler:f,registerItem:R,unregisterItem:D,getItems:M,isItemDisabled:E}),[I,C,c,d,u,z,O,x,f,R,D,M,E]);return s(w,{value:A,children:m})};ir.displayName="ListboxRoot";const lr=t.forwardRef(({className:e,label:r,children:o,...a},n)=>{const i=t.useRef(null),{active:l,disabled:c,setActive:d,toggleValue:u,baseId:m,selectionMode:f,keyHandler:p,focusable:b=!0,getItems:h,isItemDisabled:g}=y(),{handleKeyDown:v}=tt({getItems:h,isItemDisabled:g,active:l,setActive:d,loop:!1,orientation:"vertical",onSelect:e=>{u(e)}}),x=p??v;return t.useEffect(()=>{if(!l||!i.current)return;const e=i.current.querySelector(`#${m}-listbox-option-${l}`);e&&e.scrollIntoView({block:"nearest",behavior:"auto"})},[l,m]),s("div",{ref:Te(n,i),id:`${m}-listbox`,className:Ve("flex flex-col items-start grow shrink-0 basis-0","max-h-100 overflow-y-auto","focus-within:outline-none focus-within:ring-3 focus-within:ring-ring/50",c&&"pointer-events-none select-none opacity-30",e),role:"listbox","aria-disabled":c,"aria-label":r,"aria-multiselectable":"multiple"===f||void 0,"aria-activedescendant":l?`${m}-listbox-option-${l}`:void 0,tabIndex:b&&!c?0:-1,onKeyDown:x,...a,children:o})});lr.displayName="ListboxContent";const cr=Be("group flex w-full items-center px-4.5 py-1 gap-x-2.5 cursor-pointer",{variants:{selected:{true:"bg-surface-primary-selected text-alt hover:bg-surface-primary-selected-hover",false:"hover:bg-surface-primary-hover"},active:{true:"bg-surface-primary-hover",false:""},disabled:{true:"opacity-30 cursor-not-allowed pointer-events-none",false:""}},compoundVariants:[{selected:!0,active:!0,class:"bg-surface-primary-selected-hover"}],defaultVariants:{selected:!1,active:!1,disabled:!1}}),dr=({value:e,disabled:r=!1,children:o,className:a,...n})=>{const i=y(),{disabled:l,toggleValue:c,baseId:d,registerItem:u,unregisterItem:m}=i,f=i.selection.has(e),p=i.active===e,b=r||l;t.useEffect(()=>(u(e,b),()=>m(e)),[e,b,u,m]);const h=t.useCallback(()=>{b||c(e)},[b,c,e]);return s("div",{id:`${d}-listbox-option-${e}`,className:Ve(cr({selected:f,active:p,disabled:b}),a),role:"option","aria-selected":f,"aria-disabled":b??void 0,"data-value":e,"data-active":p||void 0,"data-tone":f&&"inverse",onClick:h,...n,children:o})};dr.displayName="ListboxItem";const ur=Object.assign(ir,{Root:ir,Content:lr,Item:dr}),mr=({open:e,defaultOpen:r=!1,onOpenChange:o,children:a})=>{const n=t.useRef(null),i=v(void 0,"menu-trigger"),l=v(void 0,"menu"),[c,d]=Qe(e,r,o),[u,m]=t.useState(void 0),{registerItem:f,unregisterItem:p,getItems:b,isItemDisabled:h}=et(),g=t.useMemo(()=>({open:c,setOpen:d,active:u,setActive:m,registerItem:f,unregisterItem:p,getItems:b,isItemDisabled:h,triggerId:i,menuId:l,triggerRef:n}),[c,d,u,m,f,p,b,h,i,l]);return t.useEffect(()=>{!c&&n.current&&n.current.focus()},[c]),s(N,{value:g,children:a})};mr.displayName="Menu.Root";const fr=t.forwardRef(({asChild:e,onClick:t,onKeyDown:o,className:a,children:n,...i},l)=>{const{open:c,setOpen:d,triggerId:u,menuId:m,triggerRef:f}=C();return s(e?r.Slot:"button",{ref:Te(l,f),id:u,type:e?void 0:"button","aria-haspopup":"menu","aria-expanded":c,"aria-controls":c?m:void 0,onClick:e=>{t?.(e),d(!c)},onKeyDown:e=>{o?.(e),"ArrowDown"!==e.key||c||(e.preventDefault(),d(!0))},className:a,...i,children:n})});fr.displayName="Menu.Trigger";const pr=({container:e,forceMount:r,children:o})=>{const{open:n}=C(),[s,i]=t.useState(!1);return t.useEffect(()=>{i(!0)},[]),s&&(r||n)?a.createPortal(o,e??document.body):null};pr.displayName="Menu.Portal";const br=t.forwardRef(({forceMount:e,align:r="start",loop:o=!0,onEscapeKeyDown:a,onPointerDownOutside:n,onInteractOutside:i,className:l,children:c,...d},u)=>{const{open:m,setOpen:f,active:p,setActive:b,getItems:h,isItemDisabled:g,menuId:v,triggerRef:x}=C(),w=t.useRef(null),y=Te(u,w),[k,N]=t.useState(void 0);t.useEffect(()=>{if(!m||!x?.current||!w.current)return;const e=()=>{if(!x.current||!w.current)return;const e=x.current.getBoundingClientRect(),t=w.current.getBoundingClientRect(),o=window.innerWidth,a=window.innerHeight;let n=e.bottom;if(n+t.height>a&&(n=e.top-t.height),n<0&&(n=10),"start"===r){let r=e.left;r+t.width>o&&(r=e.right-t.width),r<0&&(r=10),N({top:n,left:r})}else{let r=o-e.right;e.right-t.width<0&&(r=o-(e.left+t.width)),r<0&&(r=10),N({top:n,right:r})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[m,x,r]),t.useEffect(()=>{if(m&&w.current){w.current.focus();const e=h().find(e=>!g(e));e&&b(e)}},[m,h,g,b]);const{handleKeyDown:I}=tt({getItems:h,isItemDisabled:g,active:p,setActive:b,loop:o,orientation:"vertical",onSelect:e=>{const t=document.getElementById(e);t&&t.click()}}),z=t.useCallback(e=>{if("Tab"!==e.key)return"Escape"===e.key?(e.preventDefault(),a?.(e),void f(!1)):void I(e);f(!1)},[I,f,a]),S=t.useCallback(e=>{const t=e.target;t instanceof Node&&(x?.current?.contains(t)||w.current&&!w.current.contains(t)&&(n?.(e),i?.(e),e.defaultPrevented||f(!1)))},[n,i,f,x]);return t.useEffect(()=>{if(m)return document.addEventListener("pointerdown",S),()=>document.removeEventListener("pointerdown",S)},[m,S]),t.useEffect(()=>{if(!p||!w.current)return;const e=w.current.querySelector(`#${p}`);e&&e.scrollIntoView({block:"nearest",behavior:"auto"})},[p]),e||m?s("div",{ref:y,id:v,role:"menu","aria-orientation":"vertical","aria-activedescendant":p,tabIndex:-1,"data-state":m?"open":"closed",className:Ve("fixed z-40 flex flex-col items-start w-fit py-2.5 mt-2.5 overflow-hidden","rounded-sm border border-bdr-subtle bg-surface-neutral shadow-lg outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",!k&&"opacity-0 pointer-events-none",l),style:{...k},onKeyDown:z,...d,children:c}):null});br.displayName="Menu.Content";const hr=Be("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none",{variants:{active:{true:"bg-surface-primary-selected",false:""},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""}},compoundVariants:[{active:!0,disabled:!1,class:"text-alt outline-none ring-3 ring-inset ring-bdr-strong"}],defaultVariants:{active:!1,disabled:!1}}),gr=({id:e,asChild:o=!1,disabled:a=!1,onSelect:n,className:i,children:l,...c})=>{const d=v(e,e?void 0:"menu-item"),{active:u,setActive:m,setOpen:f,registerItem:p,unregisterItem:b}=C(),h=u===d,g=a;t.useEffect(()=>(p(d,a),()=>b(d)),[d,a,p,b]);const x=t.useCallback(()=>{if(g)return;const e=new Event("select",{bubbles:!0,cancelable:!0});n?.(e),e.defaultPrevented||f(!1)},[g,n,f]),w=t.useCallback(()=>{h||m(d)},[h,m,d]),y=t.useCallback(()=>{m(void 0)},[m]);return s(o?r.Slot:"div",{id:d,role:"menuitem","aria-disabled":g,"data-active":h||void 0,"data-disabled":g||void 0,className:Ve(hr({active:h,disabled:g}),i),onClick:x,onPointerMove:w,onPointerLeave:y,...c,children:l})};gr.displayName="Menu.Item";const vr=t.forwardRef(({className:e,children:t,...r},o)=>s("div",{ref:o,className:Ve("px-3 py-1.5 text-xs font-semibold text-subtle",e),...r,children:t}));vr.displayName="Menu.Label";const xr=t.forwardRef(({className:e,...t},r)=>s("div",{ref:r,role:"separator","aria-orientation":"horizontal",className:Ve("my-1 h-px bg-bdr-subtle",e),...t}));xr.displayName="Menu.Separator";const wr=Object.assign(mr,{Root:mr,Trigger:fr,Portal:pr,Content:br,Item:gr,Label:vr,Separator:xr}),yr=({id:e,value:r,defaultValue:o="",onChange:a,placeholder:n="Search",clearLabel:i="Clear",disabled:l,readOnly:c,children:d,className:u,...m})=>{const f=v(We(e)),p=t.useRef(null),[b,h]=Qe(r,o,a),g=t.useMemo(()=>({id:f,value:b,disabled:l,readOnly:c,placeholder:n,clearLabel:i,setValue:h,inputRef:p}),[f,b,l,c,n,i,h]);return s(z,{value:g,children:s("div",{className:Ve("relative flex gap-2.5 items-center rounded-sm overflow-hidden","h-11.5 px-4.5 py-3","border border-bdr-subtle focus-within:border-bdr-strong","focus-within:outline-none focus-within:ring-3 focus-within:ring-ring/50 focus-within:ring-offset-0","transition-highlight",c?"bg-surface-primary":"bg-surface-neutral",l&&"pointer-events-none select-none opacity-30",u),...m,children:d})})};yr.displayName="SearchFieldRoot";const kr=({className:e})=>s(bt,{className:Ve("flex items-center justify-center shrink-0 size-5.5 text-subtle",e),strokeWidth:1.5});kr.displayName="SearchFieldIcon";const Nr=t.forwardRef(({className:e,...t},r)=>{const{id:o,value:a,disabled:n,readOnly:i,placeholder:l,setValue:c,inputRef:d}=S();return s("input",{ref:Te(r,d),id:o,className:Ve("h-5.5 w-full text-base border-0","text-main bg-surface-neutral","placeholder:text-subtle","focus:outline-none","enabled:read-only:bg-surface-primary",e),value:a,onChange:e=>{c(e.currentTarget.value)},readOnly:i,disabled:n,placeholder:l,"aria-label":"Search","aria-disabled":n,...t})});Nr.displayName="SearchFieldInput";const Cr=({className:e,...t})=>{const{value:r,disabled:o,readOnly:a,clearLabel:n,setValue:i,inputRef:l}=S();if(!r||o||a)return null;return s(wt,{className:Ve("flex items-center justify-center shrink-0 size-7 -mx-1.5 text-subtle",e),icon:ht,title:n,onClick:()=>{i(""),l.current?.focus()},disabled:o,iconSize:28,iconStrokeWidth:1.25,...t})};Cr.displayName="SearchFieldClear";const Ir=Object.assign(yr,{Root:yr,Icon:kr,Input:Nr,Clear:Cr}),zr=({className:e,selected:t,children:r,label:o,description:a,metadata:n,icon:i,readOnly:l,checked:c,defaultChecked:d,onCheckedChange:u,...m})=>s(nr,{className:Ve(!t&&"hover:bg-surface-primary-hover",e),selected:t,role:"row","aria-selected":t,...m,children:[s(nr.Left,{children:s(vt,{checked:c,defaultChecked:d,onCheckedChange:u,readOnly:l})}),s(nr.DefaultContent,{label:o,description:a,metadata:n,icon:i}),s(nr.Right,{children:r})]});zr.displayName="SelectableListItem";const Sr=({className:e,label:t,decorative:r=!1,...o})=>{const a=r?"true":void 0;return t?s("div",{role:"separator","aria-orientation":"horizontal","aria-hidden":a,className:Ve("inline-flex w-full gap-2.5",e),...o,children:[s("span",{className:"min-w-0 truncate text-subtle uppercase",children:t}),s("span",{className:"min-w-6 flex-1 border-b-1 border-bdr-subtle"})]}):s("hr",{"aria-hidden":a,className:Ve("w-full border-bdr-subtle",e)})};Sr.displayName="Separator";const Rr={top:"bottom",bottom:"top",left:"right",right:"left"};function Dr({children:e,asChild:t,triggerRef:o,isOpen:a,onMouseEnter:n,onMouseLeave:i,onFocus:l,onBlur:c}){return s(t?r.Root:"div",{ref:o,className:t?void 0:"inline-flex",onMouseEnter:n,onMouseLeave:i,onFocus:l,onBlur:c,"aria-describedby":a?"tooltip":void 0,role:t?void 0:"button",tabIndex:t?void 0:0,children:e})}function Mr({children:e,actualSide:t,className:r,position:o,tooltipRef:a}){return s("div",{ref:a,role:"tooltip",className:Ve("fixed z-50 pointer-events-none select-none",!o.transformOrigin&&"opacity-0"),style:{top:`${o.top}px`,left:`${o.left}px`,transformOrigin:o.transformOrigin},children:s("div",{className:Ve("relative w-fit rounded-xs px-2 py-1 text-xs","bg-tooltip text-tooltip-foreground shadow-md","animate-in fade-in-0 zoom-in-95","top"===t&&"slide-in-from-top-2","bottom"===t&&"slide-in-from-bottom-2","left"===t&&"slide-in-from-left-2","right"===t&&"slide-in-from-right-2",r),children:[e,s("div",{className:Ve("absolute size-2 rotate-45","top"===t&&"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2","bottom"===t&&"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2","left"===t&&"right-0 top-1/2 -translate-y-1/2 translate-x-1/2","right"===t&&"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"),style:{backgroundColor:"inherit"}})]})})}exports.Avatar=Ye,exports.AvatarProvider=l,exports.Button=Ze,exports.Checkbox=vt,exports.Combobox=At,exports.ComboboxProvider=u,exports.Dialog=Kt,exports.DialogProvider=p,exports.IconButton=wt,exports.IdProvider=g,exports.Input=Ut,exports.Link=Jt,exports.ListItem=nr,exports.Listbox=ur,exports.ListboxProvider=w,exports.Menu=wr,exports.MenuProvider=N,exports.SearchField=Ir,exports.SearchFieldProvider=z,exports.SelectableListItem=zr,exports.Separator=Sr,exports.Tooltip=function({className:r,children:o,value:a,side:n="bottom",asChild:i=!0,delay:l=0}){const[c,d]=t.useState(!1),u=t.useRef(null),m=t.useRef(null),f=t.useRef(),p=null!=a&&""!==a,b=function(e,r,o,a){const[n,s]=t.useState({top:0,left:0,transformOrigin:"",actualSide:r});return t.useEffect(()=>{if(!e||!o.current||!a.current)return;const t=o.current.getBoundingClientRect(),n=a.current.getBoundingClientRect(),i=e=>{let r=0,o=0,a="";switch(e){case"top":r=t.top+window.scrollY-n.height-8,o=t.left+window.scrollX+(t.width-n.width)/2,a="bottom center";break;case"bottom":r=t.bottom+window.scrollY+8,o=t.left+window.scrollX+(t.width-n.width)/2,a="top center";break;case"left":r=t.top+window.scrollY+(t.height-n.height)/2,o=t.left+window.scrollX-n.width-8,a="center right";break;case"right":r=t.top+window.scrollY+(t.height-n.height)/2,o=t.right+window.scrollX+8,a="center left"}return{top:r,left:o,transformOrigin:a,actualSide:e}},l=({top:e,left:t})=>{const r=window.scrollY+8,o=window.scrollY+window.innerHeight-n.height-8,a=window.scrollX+8,s=window.scrollX+window.innerWidth-n.width-8;return e>=r&&e<=o&&t>=a&&t<=s};let c=i(r);if(!l(c)){const e=i(Rr[r]);l(e)&&(c=e)}s(c)},[e,r]),n}(c&&p,n,u,m);t.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const h=t.useCallback(()=>{p&&(f.current&&clearTimeout(f.current),l>0?f.current=window.setTimeout(()=>d(!0),l):d(!0))},[l,p]),g=t.useCallback(()=>{f.current&&clearTimeout(f.current),d(!1)},[]),v=t.useCallback(()=>{p&&d(!0)},[p]),x=t.useCallback(()=>d(!1),[]);return s(e.Fragment,{children:[s(Dr,{asChild:i,triggerRef:u,isOpen:c,onMouseEnter:h,onMouseLeave:g,onFocus:v,onBlur:x,children:o}),c&&p&&t.createPortal(s(Mr,{actualSide:b.actualSide,className:r,position:b,tooltipRef:m,children:a}),document.body)]})},exports.cn=Ve,exports.generateAriaId=R,exports.generateAriaIds=function(e,t){return t.reduce((t,r)=>(t[r]=R(e,r),t),{})},exports.generateItemId=D,exports.getActiveDescendantId=function(e,t,r){if(r)return D(e,t,r)},exports.setRef=Fe,exports.unwrap=We,exports.useAvatar=c,exports.useCombobox=m,exports.useComposedRefs=Te,exports.useControlledState=Qe,exports.useDialog=b,exports.useItemRegistry=et,exports.useKeyboardNavigation=tt,exports.useListbox=y,exports.useMenu=C,exports.usePrefixedId=v,exports.useScrollLock=Je,exports.useSearchField=S;
|
|
26
|
+
*/It.displayName="Checkbox";const Mt=Ye(["p-0"],{variants:{size:{sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11.5 w-11.5"},shape:{square:"rounded-sm",round:"rounded-full"}},defaultVariants:{size:"md",shape:"square"}}),St=t.forwardRef(({className:e,variant:t="text",size:r="md",shape:o="square",icon:n,...a},i)=>s(ot,{ref:i,className:qe(Mt({size:r,shape:o}),e),variant:t,size:r,startIcon:n,label:"",...a}));function Et(e,t,r="any"){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;const o="any"===r?[...e].sort():e,n="any"===r?[...t].sort():t;for(let a=0;a<o.length;a+=1)if(o[a]!==n[a])return!1;return!0}St.displayName="IconButton";const zt=[],Dt=e=>t=>Et(t,e)?t:e,Rt=({children:e,open:r,defaultOpen:o=!1,onOpenChange:n,closeOnBlur:a=!0,value:i,defaultValue:l="",onChange:c,disabled:d=!1,error:m=!1,selectionMode:f="single",selection:p,defaultSelection:b=zt,onSelectionChange:h,active:g,defaultActive:x,setActive:w})=>{const y=v(),[k,N]=at(r,o,n),[C,I]=at(i,l,c),M="single"!==f,S="staged"===f,[E,z]=t.useState(()=>new Set(b)),D=void 0!==p,R=t.useMemo(()=>D?new Set(p):E,[D,p,E]),P=t.useMemo(()=>Array.from(R),[R]),[A,O]=t.useState(P);t.useEffect(()=>{O(S?Dt(P):P)},[P,S]);const L=S?A:P,j=t.useMemo(()=>new Set(L),[L]),$=t.useMemo(()=>S&&!Et(A,P),[S,A,P]),F=t.useCallback(()=>{S&&O(Dt(P))},[S,P]),[V,B]=st(g,x,w),{registerItem:T,unregisterItem:W,getItems:_,isItemDisabled:q}=it(),K=t.useCallback(e=>{I(e),N(!0)},[I,N]),G=t.useCallback(e=>{N(e),e||F()},[N,F]),H=t.useCallback(e=>{const t=new Set(e);D||z(t),h?.(e),"single"===f&&N(!1)},[D,h,f,N]),U=t.useCallback(e=>{S?O(e):H(e)},[S,H]),X=t.useCallback(()=>{S&&(Et(A,P)||H(A),N(!1))},[S,A,P,H,N]),{handleKeyDown:Y}=lt({getItems:_,isItemDisabled:q,active:V,setActive:B,loop:!1,orientation:"vertical",onSelect:e=>{let t;t=M?L.includes(e)?L.filter(t=>t!==e):[...L,e]:[e],U(t)}}),Z=t.useCallback(e=>{if(!d){if("ArrowDown"!==e.key&&"ArrowUp"!==e.key||k||(e.preventDefault(),N(!0)),"Escape"===e.key)return e.preventDefault(),void G(!1);Y(e)}},[d,k,N,G,Y]);t.useEffect(()=>{if(k&&void 0===V){const e=_();e.length>0&&B(e[0])}},[k,V,_,B]);const J=t.useMemo(()=>({open:k,setOpen:G,inputValue:C,setInputValue:K,baseId:y,active:V,disabled:d,error:m,closeOnBlur:a,keyHandler:Z,selection:j,appliedSelection:P,stagedSelection:A,stagingEnabled:S,hasStagedChanges:$,applyStagedSelection:X,resetStagedSelection:F}),[k,G,a,Z,C,K,V,y,d,m,j,P,A,S,$,X,F]);return s(u,{value:J,children:s(xr.Root,{selectionMode:M?"multiple":"single",selection:L,onSelectionChange:U,disabled:d,active:V,focusable:!1,baseId:y,setActive:B,keyHandler:Z,registerItem:T,unregisterItem:W,getItems:_,isItemDisabled:q,children:e})})};Rt.displayName="Combobox.Root";const Pt=t.forwardRef(({className:e,children:r,...o},n)=>{const a=t.useRef(null),{setOpen:i,closeOnBlur:l}=m(),c=l?t.useCallback(e=>{const t=e.relatedTarget;t&&a.current?.contains(t)||i(!1)},[i]):void 0;return s("div",{ref:Ge(n,a),className:e,onBlur:c,...o,children:r})});Pt.displayName="Combobox.Content";const At=Ye(["flex gap-2.5 items-center","h-12 rounded-sm border bg-surface-neutral","focus-within:outline-none focus-within:ring-3 focus-within:ring-bdr-strong focus-within:ring-offset-3 focus-within:ring-offset-surface-neutral","transition-highlight"],{variants:{error:{true:"border-error focus-within:border-error focus-within:ring-error",false:"border-bdr-subtle focus-within:border-bdr-strong"},open:{true:"border-bdr-strong",false:null},disabled:{true:"pointer-events-none select-none opacity-30",false:null}},defaultVariants:{error:!1,open:!1,disabled:!1}}),Ot=({className:e,children:t,...r})=>{const{open:o,disabled:n,error:a}=m();return s("div",{className:qe(At({error:a,open:o,disabled:n}),e),"data-open":o?"true":void 0,...r,children:t})};Ot.displayName="Combobox.Control";const Lt=t.forwardRef((e,r)=>{const o=t.useRef(null),{open:n,keyHandler:a,baseId:i,active:l,disabled:c,error:d}=m();return t.useEffect(()=>{n&&!c&&o.current?.focus()},[n,c]),s(Gr.Input,{ref:Ge(r,o),id:`${i}-input`,onKeyDown:a,"aria-disabled":c,"aria-invalid":d??void 0,role:"combobox","aria-autocomplete":"list","aria-expanded":n,"aria-haspopup":"listbox","aria-controls":`${i}-listbox`,"aria-activedescendant":l?`${i}-listbox-option-${l}`:void 0,...e})});Lt.displayName="Combobox.Input";const jt=({children:e,className:t,...r})=>{const{inputValue:o,setInputValue:n}=m();return s(Gr.Root,{value:o,onChange:n,className:qe("w-full pr-0","border-0 focus-within:border-0 focus-within:ring-0",t),...r,children:e})};jt.displayName="Combobox.Search";const $t=({className:e,...t})=>s(Gr.Icon,{className:e,...t});$t.displayName="Combobox.SearchIcon";const Ft=({className:e,...t})=>{const{open:r,setOpen:o,disabled:n}=m();return s(St,{type:"button",variant:"text",size:"lg",icon:gt,"aria-label":"Toggle",onClick:()=>{n||o(!r)},disabled:n,tabIndex:-1,className:qe("shrink-0 text-subtle transition-transform hover:bg-surface-primary-hover",r&&"rotate-180",e),...t})};Ft.displayName="Combobox.Toggle";const Vt=({className:e,label:t="Apply",...r})=>{const{stagingEnabled:o,hasStagedChanges:n,applyStagedSelection:a}=m();return o&&n?s(ot,{className:qe("h-7 px-2.5 min-w-14 gap-2 text-xs",e),type:"button",label:t,variant:"outline",onClick:a,...r}):null};Vt.displayName="Combobox.Apply";const Bt=({children:e,className:t,...r})=>{const{open:o}=m();return o?s("div",{className:qe("absolute left-0 right-0 z-50 mt-1 rounded-sm bg-surface-neutral shadow-lg ring-1 ring-bdr-subtle",t),...r,children:e}):null};Bt.displayName="Combobox.Popup";const Tt=Object.assign(Rt,{Root:Rt,Content:Pt,Control:Ot,Search:jt,Input:Lt,SearchIcon:$t,Toggle:Ft,Apply:Vt,Popup:Bt}),Wt=({open:e,defaultOpen:r=!1,onOpenChange:o,children:n})=>{const[a,i]=at(e,r,o),l=t.useMemo(()=>({open:a,setOpen:i}),[a,i]);return s(p,{value:l,children:n})};Wt.displayName="Dialog.Root";const _t=t.forwardRef(({asChild:e,children:t,onClick:o,...n},a)=>{const{setOpen:i}=b();return s(e?r.Slot:"button",{ref:a,type:e?void 0:"button",onClick:e=>{o?.(e),i(!0)},...n,children:t})});_t.displayName="Dialog.Trigger";const qt=({children:e,container:r,forceMount:o})=>{const{open:a}=b(),[s,i]=t.useState(!1);return t.useEffect(()=>{i(!0)},[]),s&&(o||a)?n.createPortal(e,r??document.body):null};qt.displayName="Dialog.Portal";const Kt=t.forwardRef(({className:e,forceMount:t,...r},o)=>{const{open:n}=b();return t||n?s("div",{ref:o,"data-state":n?"open":"closed",className:qe("fixed inset-0 z-30 bg-overlay backdrop-blur-xs","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}):null});Kt.displayName="Dialog.Overlay";const Gt=t.forwardRef(({children:e,className:r,forceMount:n,onEscapeKeyDown:a,onPointerDownOutside:i,onInteractOutside:l,onOpenAutoFocus:c,onCloseAutoFocus:d,...u},m)=>{const{open:f,setOpen:p}=b(),h=t.useRef(null),g=t.useId(),v=t.useId();t.useEffect(()=>{"function"==typeof m?m(h.current):m&&(m.current=h.current)},[m]),nt(f);const x=t.useCallback(e=>{"Escape"===e.key&&(a?.(e),e.defaultPrevented||p(!1))},[a,p]);t.useEffect(()=>{if(f)return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[f,x]);const w=t.useCallback(e=>{const t=e.target;h.current&&!h.current.contains(t)&&(i?.(e),l?.(e),e.defaultPrevented||p(!1))},[i,l,p]);return t.useEffect(()=>{if(f)return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[f,w]),n||f?s(o.FocusTrap,{active:f,focusTrapOptions:{initialFocus:!1,fallbackFocus:()=>h.current??document.body,escapeDeactivates:!1,clickOutsideDeactivates:!1,returnFocusOnDeactivate:!0,allowOutsideClick:!0,preventScroll:!1,onActivate:()=>{requestAnimationFrame(()=>{const e=new Event("openautofocus",{bubbles:!0,cancelable:!0});c?.(e),!e.defaultPrevented&&h.current&&h.current.focus()})},onDeactivate:()=>{requestAnimationFrame(()=>{const e=new Event("closeautofocus",{bubbles:!0,cancelable:!0});d?.(e)})}},children:s("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-4",children:s("div",{ref:h,role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":v,"data-state":f?"open":"closed",tabIndex:-1,className:qe("relative rounded-lg shadow-xl bg-surface-neutral","flex flex-col max-w-lg w-full max-h-[90vh] gap-10 p-10","border border-bdr-subtle outline-none overflow-hidden","focus:outline-none focus:ring-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",r),...u,children:e})})}):null});Gt.displayName="Dialog.Content";const Ht=t.forwardRef(({className:e,children:t,...r},o)=>s("header",{ref:o,className:qe("relative grid gap-2.5 self-stretch",e),...r,children:t}));Ht.displayName="Dialog.Header";const Ut=t.forwardRef(({children:e,asChild:o,onClick:n,...a},i)=>{const{setOpen:l}=b(),c=t.useCallback(e=>{n?.(e),e.defaultPrevented||l(!1)},[n,l]);return s(o?r.Slot:"button",{ref:i,type:o?void 0:"button",onClick:c,...a,children:e})});Ut.displayName="Dialog.Close";const Xt=t.forwardRef(({children:e,className:t,asChild:o,...n},a)=>s(o?r.Slot:"h2",{ref:a,className:qe("text-2xl font-semibold",t),...n,children:e}));Xt.displayName="Dialog.Title";const Yt=t.forwardRef(({children:e,className:t,asChild:o,...n},a)=>s(o?r.Slot:"p",{ref:a,className:qe("",t),...n,children:e}));Yt.displayName="Dialog.Description";const Zt=t.forwardRef(({className:e,children:t,...r},o)=>s("div",{ref:o,className:qe("min-h-0 flex-1 overflow-y-auto",e),...r,children:t}));Zt.displayName="Dialog.Body";const Jt=t.forwardRef(({className:e,children:t,...r},o)=>s("footer",{ref:o,className:qe("flex justify-end gap-2.5",e),...r,children:t}));Jt.displayName="Dialog.Footer";const Qt=t.forwardRef((e,t)=>s(Ut,{asChild:!0,ref:t,...e,children:s(St,{"aria-label":"Close","data-area":"close",icon:Nt,size:"lg",iconSize:36,iconStrokeWidth:1,shape:"round",variant:"filled"})}));Qt.displayName="Dialog.DefaultClose";const er=t.forwardRef(({title:e,description:t,withClose:r,className:o,children:n,...a},i)=>s(Ht,{ref:i,className:qe(r&&"grid-cols-[minmax(0,1fr)_auto]",o),...a,children:[s(Xt,{className:qe(r&&"col-start-1 row-start-1 min-w-0"),children:e}),r&&s(Qt,{className:"col-start-2 row-start-1 row-span-2 self-start justify-self-end"}),t&&s(Yt,{className:qe(r&&"row-start-2"),children:t}),n]}));er.displayName="Dialog.DefaultHeader";const tr=Object.assign(Wt,{Root:Wt,Trigger:_t,Portal:qt,Overlay:Kt,Content:Gt,Header:Ht,Close:Ut,Title:Xt,Description:Yt,Body:Zt,Footer:Jt,DefaultClose:Qt,DefaultHeader:er}),rr=Ye(["relative flex rounded-sm overflow-hidden","h-12 border focus-within:border-bdr-solid","focus-within:outline-none focus-within:ring-3 focus-within:ring-bdr-strong focus-within:ring-offset-3 focus-within:ring-offset-surface-neutral","transition-highlight"],{variants:{state:{default:"border-bdr-subtle focus-within:border-bdr-strong",error:"border-error focus-within:border-error focus-within:ring-error"},disabled:{true:"select-none"}},defaultVariants:{state:"default",disabled:!1}}),or=({children:e,error:t})=>s("div",{className:qe("flex items-center justify-center shrink-0 min-w-12 px-4","text-sm text-subtle bg-surface-primary","first:rounded-l-sm first:border-r first:border-bdr-subtle","last:rounded-r-sm last:border-l last:border-bdr-subtle",t&&"first:border-error last:border-error"),children:e}),nr=t.forwardRef(({className:e,label:t,description:r,error:o,startAddon:n,endAddon:a,id:i,disabled:l,readOnly:c,...d},u)=>{const m=v(He(i)),f=o?"error":"default",p="error"===f;return s("div",{className:qe("w-full",l&&"opacity-30",e),children:[(!!t||!!r)&&s("div",{className:"mb-2",children:[t&&s("label",{htmlFor:m,className:"block text-base font-semibold text-main",children:s("div",{className:"flex items-center gap-2",children:[c&&s(xt,{size:16,strokeWidth:2.5}),t]})}),r&&s("div",{className:"text-sm text-subtle",children:r})]}),s("div",{className:qe(rr({state:f,disabled:l})),children:[n&&s(or,{error:p,children:n}),s("input",{ref:u,id:m,className:qe("flex-1 w-full px-4.5 text-base","text-main bg-surface-neutral placeholder:text-subtle","border-0 focus:outline-none","disabled:select-none enabled:read-only:bg-surface-primary",n&&"rounded-l-none",a&&"rounded-r-none"),disabled:l,readOnly:c,...d}),a&&s(or,{error:p,children:a})]}),o&&s("div",{className:"flex items-center gap-2 mt-2 leading-5 text-error",children:[s(yt,{size:16,strokeWidth:2.5}),o]})]})});function ar(e,t,r=!1){return"function"==typeof e?e:!0===e||void 0===e&&r?t:void 0}nr.displayName="Input";const sr=t.forwardRef(({className:e,href:t,external:r="auto",newTab:o,leftIcon:n,rightIcon:a,children:i,rel:l,...c},d)=>{const u="auto"===r?function(e){try{if(e.startsWith("mailto:")||e.startsWith("tel:"))return!0;const t="undefined"!=typeof window?window.location:void 0;return!t||new URL(e,t.origin).origin!==t.origin}catch{return!0}}(t):r,m=o??u?"_blank":void 0,f=ar(n,bt),p=ar(a,vt,u);return s("a",{ref:d,href:t,className:qe("inline-flex items-center align-baseline gap-1","text-sm font-normal underline underline-offset-3 decoration-1","visited:text-link-visited hover:text-main-hover","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-bdr-strong focus-visible:bg-main focus-visible:text-rev","transition-highlight",e),target:m,rel:o||u?"noopener noreferrer":"noreferrer",...c,children:[f&&s(f,{className:"inline-block flex-none w-3.5 h-3.5",strokeWidth:1.5,"aria-hidden":"true"}),i,p&&s(p,{className:"inline-block flex-none w-3.5 h-3.5",strokeWidth:1.5,"aria-hidden":"true"})]})});function ir(e,r){return t.Children.toArray(e).find(e=>function(e,r){return t.isValidElement(e)&&e.type===r}(e,r))}sr.displayName="Link";const lr=({children:e,className:t,...r})=>s("div",{className:qe("flex items-center gap-2.5 flex-shrink-0",t),...r,children:e}),cr=({className:e,children:t,...r})=>s("div",{className:qe("flex-1 min-w-0",e),...r,children:t});cr.displayName="ListItem.Content";const dr=({className:e,label:t,description:r,metadata:o,icon:n})=>s(cr,{className:qe(n&&"grid grid-cols-[auto_1fr] gap-2.5 items-center",e),children:[n&&s("div",{className:"flex items-center justify-center flex-shrink-0 group-data-[tone=inverse]:text-alt",children:n}),s("div",{className:"min-w-0 text-left",children:[t&&s("h1",{className:"truncate font-semibold group-data-[tone=inverse]:text-alt",children:t}),r&&s("p",{className:"truncate text-sm text-subtle group-data-[tone=inverse]:text-alt",children:r}),o&&s("p",{className:"text-xs text-subtle group-data-[tone=inverse]:text-alt",children:o})]})]}),ur=({children:e,className:t,...r})=>s("div",{className:qe("flex items-center gap-5 flex-shrink-0",t),...r,children:e});ur.displayName="ListItem.Right";const mr=({children:e,className:t,selected:r,...o})=>{const n=ir(e,lr),a=ir(e,cr)??ir(e,dr),i=ir(e,ur);return s("div",{className:qe("group flex items-center px-2.5 py-1 gap-2.5",r&&"bg-surface-primary-selected text-alt",t),"data-tone":r?"inverse":void 0,role:"listitem",...o,children:[n,a,i]})};mr.displayName="ListItem";const fr=Object.assign(mr,{Left:lr,Content:cr,DefaultContent:dr,Right:ur}),pr=[],br=({baseId:e,selection:r,defaultSelection:o=pr,onSelectionChange:n,active:a,defaultActive:i,setActive:l,selectionMode:c="single",focusable:d=!0,disabled:u,children:m,keyHandler:f,registerItem:p,unregisterItem:b,getItems:h,isItemDisabled:g})=>{const x=e??v(),[y,k]=t.useState(()=>new Set(o)),N=void 0!==r,C=t.useMemo(()=>N?new Set(r):y,[N,r,y]),[I,M]=st(a,i,l),S=it(),E=p??S.registerItem,z=b??S.unregisterItem,D=h??S.getItems,R=g??S.isItemDisabled,P=t.useCallback(e=>{const t=C.has(e),r=new Set(C);"single"===c?(r.clear(),t||r.add(e)):t?r.delete(e):r.add(e),N||k(r),n?.(Array.from(r)),M(e)},[C,c,N,n,M]),A=t.useMemo(()=>({active:I,selection:C,selectionMode:c,focusable:d,disabled:u,setActive:M,toggleValue:P,baseId:x,keyHandler:f,registerItem:E,unregisterItem:z,getItems:D,isItemDisabled:R}),[I,C,c,d,u,M,P,x,f,E,z,D,R]);return s(w,{value:A,children:m})};br.displayName="ListboxRoot";const hr=t.forwardRef(({className:e,label:r,children:o,...n},a)=>{const i=t.useRef(null),{active:l,disabled:c,setActive:d,toggleValue:u,baseId:m,selectionMode:f,keyHandler:p,focusable:b=!0,getItems:h,isItemDisabled:g}=y(),{handleKeyDown:v}=lt({getItems:h,isItemDisabled:g,active:l,setActive:d,loop:!1,orientation:"vertical",onSelect:e=>{u(e)}}),x=p??v;return t.useEffect(()=>{if(!l||!i.current)return;const e=i.current.querySelector(`#${m}-listbox-option-${l}`);e&&e.scrollIntoView({block:"nearest",behavior:"auto"})},[l,m]),s("div",{ref:Ge(a,i),id:`${m}-listbox`,className:qe("flex flex-col items-start grow shrink-0 basis-0","max-h-100 overflow-y-auto","focus-within:outline-none focus-within:ring-3 focus-within:ring-bdr-strong focus-within:ring-offset-3 focus-within:ring-offset-surface-neutral","transition-highlight",c&&"pointer-events-none select-none opacity-30",e),role:"listbox","aria-disabled":c,"aria-label":r,"aria-multiselectable":"multiple"===f||void 0,"aria-activedescendant":l?`${m}-listbox-option-${l}`:void 0,tabIndex:b&&!c?0:-1,onKeyDown:x,...n,children:o})});hr.displayName="ListboxContent";const gr=Ye("group flex w-full items-center px-4.5 py-1 gap-x-2.5 cursor-pointer",{variants:{selected:{true:"bg-surface-primary-selected text-alt hover:bg-surface-primary-selected-hover",false:"hover:bg-surface-primary-hover"},active:{true:"bg-surface-primary-hover",false:""},disabled:{true:"opacity-30 cursor-not-allowed pointer-events-none",false:""}},compoundVariants:[{selected:!0,active:!0,class:"bg-surface-primary-selected-hover"}],defaultVariants:{selected:!1,active:!1,disabled:!1}}),vr=({value:e,disabled:r=!1,children:o,className:n,...a})=>{const i=y(),{disabled:l,toggleValue:c,baseId:d,registerItem:u,unregisterItem:m}=i,f=i.selection.has(e),p=i.active===e,b=r||l;t.useEffect(()=>(u(e,b),()=>m(e)),[e,b,u,m]);const h=t.useCallback(()=>{b||c(e)},[b,c,e]);return s("div",{id:`${d}-listbox-option-${e}`,className:qe(gr({selected:f,active:p,disabled:b}),n),role:"option","aria-selected":f,"aria-disabled":b??void 0,"data-value":e,"data-active":p||void 0,"data-tone":f?"inverse":void 0,onClick:h,...a,children:o})};vr.displayName="ListboxItem";const xr=Object.assign(br,{Root:br,Content:hr,Item:vr}),wr=({open:e,defaultOpen:r=!1,onOpenChange:o,children:n})=>{const a=t.useRef(null),i=v(void 0,"menu-trigger"),l=v(void 0,"menu"),[c,d]=at(e,r,o),[u,m]=t.useState(void 0),{registerItem:f,unregisterItem:p,getItems:b,isItemDisabled:h}=it(),g=t.useMemo(()=>({open:c,setOpen:d,active:u,setActive:m,registerItem:f,unregisterItem:p,getItems:b,isItemDisabled:h,triggerId:i,menuId:l,triggerRef:a}),[c,d,u,m,f,p,b,h,i,l]);return t.useEffect(()=>{!c&&a.current&&a.current.focus()},[c]),s(N,{value:g,children:n})};wr.displayName="Menu.Root";const yr=t.forwardRef(({asChild:e,onClick:t,onKeyDown:o,className:n,children:a,...i},l)=>{const{open:c,setOpen:d,triggerId:u,menuId:m,triggerRef:f}=C();return s(e?r.Slot:"button",{ref:Ge(l,f),id:u,type:e?void 0:"button","aria-haspopup":"menu","aria-expanded":c,"data-active":c,"aria-controls":c?m:void 0,onClick:e=>{t?.(e),d(!c)},onKeyDown:e=>{o?.(e),"ArrowDown"!==e.key||c||(e.preventDefault(),d(!0))},className:qe(c&&"bg-btn-active text-alt",n),...i,children:a})});yr.displayName="Menu.Trigger";const kr=({container:e,forceMount:r,children:o})=>{const{open:a}=C(),[s,i]=t.useState(!1);return t.useEffect(()=>{i(!0)},[]),s&&(r||a)?n.createPortal(o,e??document.body):null};kr.displayName="Menu.Portal";const Nr=t.forwardRef(({forceMount:e,align:r="start",loop:o=!0,onEscapeKeyDown:n,onPointerDownOutside:a,onInteractOutside:i,className:l,children:c,...d},u)=>{const{open:m,setOpen:f,active:p,setActive:b,getItems:h,isItemDisabled:g,menuId:v,triggerRef:x}=C(),w=t.useRef(null),y=Ge(u,w),[k,N]=t.useState(void 0);t.useEffect(()=>{if(!m||!x?.current||!w.current)return;const e=()=>{if(!x.current||!w.current)return;const e=x.current.getBoundingClientRect(),t=w.current.getBoundingClientRect(),o=window.innerWidth,n=window.innerHeight;let a=e.bottom;if(a+t.height>n&&(a=e.top-t.height),a<0&&(a=10),"start"===r){let r=e.left;r+t.width>o&&(r=e.right-t.width),r<0&&(r=10),N({top:a,left:r})}else{let r=o-e.right;e.right-t.width<0&&(r=o-(e.left+t.width)),r<0&&(r=10),N({top:a,right:r})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[m,x,r]),t.useEffect(()=>{if(m&&w.current){w.current.focus();const e=h().find(e=>!g(e));e&&b(e)}},[m,h,g,b]);const{handleKeyDown:I}=lt({getItems:h,isItemDisabled:g,active:p,setActive:b,loop:o,orientation:"vertical",onSelect:e=>{const t=document.getElementById(e);t&&t.click()}}),M=t.useCallback(e=>{if("Tab"!==e.key)return"Escape"===e.key?(e.preventDefault(),n?.(e),void f(!1)):void I(e);f(!1)},[I,f,n]),S=t.useCallback(e=>{const t=e.target;t instanceof Node&&(x?.current?.contains(t)||w.current&&!w.current.contains(t)&&(a?.(e),i?.(e),e.defaultPrevented||f(!1)))},[a,i,f,x]);return t.useEffect(()=>{if(m)return document.addEventListener("pointerdown",S),()=>document.removeEventListener("pointerdown",S)},[m,S]),t.useEffect(()=>{if(!p||!w.current)return;const e=w.current.querySelector(`#${p}`);e&&e.scrollIntoView({block:"nearest",behavior:"auto"})},[p]),e||m?s("div",{ref:y,id:v,role:"menu","aria-orientation":"vertical","aria-activedescendant":p,tabIndex:-1,"data-state":m?"open":"closed",className:qe("fixed z-40 flex flex-col items-start w-fit py-2.5 mt-2.5 overflow-hidden","rounded-sm border border-bdr-subtle bg-surface-neutral shadow-lg outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",!k&&"opacity-0 pointer-events-none",l),style:{...k},onKeyDown:M,...d,children:c}):null});Nr.displayName="Menu.Content";const Cr=Ye("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none",{variants:{active:{true:"bg-surface-primary-selected text-alt",false:""},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""}},compoundVariants:[{active:!0,disabled:!1,class:"focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-bdr-strong hover:bg-surface-primary-selected hover:text-alt"}],defaultVariants:{active:!1,disabled:!1}}),Ir=t.forwardRef(({id:e,asChild:o=!1,disabled:n=!1,onSelect:a,className:i,children:l,onClick:c,onPointerMove:d,onPointerLeave:u,onFocus:m,...f},p)=>{const b=v(e,e?void 0:"menu-item"),{active:h,setActive:g,setOpen:x,registerItem:w,unregisterItem:y,getItems:k,isItemDisabled:N}=C(),I=h===b,M=n,S=t.useRef(null),E=Ge(p,S);t.useEffect(()=>(w(b,n),()=>y(b)),[b,n,w,y]);const z=t.useCallback(e=>{if(c?.(e),M)return;const t=new Event("select",{bubbles:!0,cancelable:!0});a?.(t),t.defaultPrevented||x(!1)},[M,a,x,c]),D=t.useCallback(e=>{d?.(e),I||M||g(b)},[I,g,b,M,d]),R=t.useCallback(e=>{u?.(e),document.activeElement!==S.current&&g(void 0)},[g,u,S]),P=t.useCallback(e=>{m?.(e),M||g(b)},[m,M,g,b]),A=k(),O=A.length>0?A[0]:void 0,L=h??A.find(e=>!N(e))??O??b,j=!M&&L===b;t.useEffect(()=>{!M&&I&&document.activeElement!==S.current&&S.current?.focus()},[I,M]);return s(o?r.Slot:"div",{ref:E,id:b,role:"menuitem",tabIndex:M?-1:j?0:-1,"aria-disabled":M,"data-active":I||void 0,"data-disabled":M||void 0,"data-tone":I?"inverse":void 0,className:qe(Cr({active:I,disabled:M}),i),onClick:z,onPointerMove:D,onPointerLeave:R,onFocus:P,...f,children:l})});Ir.displayName="Menu.Item";const Mr=t.forwardRef(({className:e,children:t,...r},o)=>s("div",{ref:o,className:qe("px-3 py-1.5 text-xs font-semibold text-subtle",e),...r,children:t}));Mr.displayName="Menu.Label";const Sr=t.forwardRef(({className:e,...t},r)=>s("div",{ref:r,role:"separator","aria-orientation":"horizontal",className:qe("my-1 h-px bg-bdr-subtle",e),...t}));Sr.displayName="Menu.Separator";const Er=Object.assign(wr,{Root:wr,Trigger:yr,Portal:kr,Content:Nr,Item:Ir,Label:Mr,Separator:Sr}),zr=t.createContext(void 0);const Dr=({defaultActive:e,onActiveChange:r,id:o,children:n})=>{const a=v(o,"menubar"),i=t.useRef(null),[l,c]=t.useState(e),d=t.useCallback(e=>{c(e),r?.(e)},[r]),{registerItem:u,unregisterItem:m,getItems:f,isItemDisabled:p}=it(),[b,h]=t.useState(void 0),g=t.useMemo(()=>({active:l,setActive:d,registerItem:u,unregisterItem:m,getItems:f,isItemDisabled:p,openMenuId:b,setOpenMenuId:h,menubarId:a,menubarRef:i}),[l,d,u,m,f,p,b,a]);return s(z,{value:g,children:n})};Dr.displayName="Menubar.Root";const Rr=t.forwardRef(({"aria-label":e,loop:r=!0,className:o,children:n,onKeyDown:a,onBlur:i,...l},c)=>{const{active:d,setActive:u,getItems:m,isItemDisabled:f,menubarId:p,menubarRef:b,setOpenMenuId:h,openMenuId:g}=D(),v=Ge(c,b),{handleKeyDown:x}=lt({getItems:m,isItemDisabled:f,active:d,setActive:u,loop:r,orientation:"horizontal",onSelect:e=>{const t=document.getElementById(e);t&&t.click()}}),w=t.useCallback(e=>{a?.(e);if(("ArrowDown"===e.key||"Enter"===e.key||" "===e.key)&&d){const t=document.getElementById(d);if(t&&"menu"===t.getAttribute("aria-haspopup"))return e.preventDefault(),void h(d)}if("ArrowUp"===e.key&&d){const t=document.getElementById(d);if(t&&"menu"===t.getAttribute("aria-haspopup"))return e.preventDefault(),void h(d)}x(e)},[a,x,d,h]),y=t.useCallback(e=>{i?.(e);const t=e.relatedTarget;b?.current&&t instanceof Node&&b.current.contains(t)||g||u(void 0)},[i,u,b,g]);return t.useEffect(()=>{if(!d||!b?.current)return;const e=b.current.querySelector(`#${d}`);e&&e.scrollIntoView({block:"nearest",inline:"nearest",behavior:"auto"})},[d,b]),s("div",{ref:v,id:p,role:"menubar","aria-label":e,"aria-orientation":"horizontal",tabIndex:-1,className:qe("flex items-center gap-1.5 p-1.5",o),onKeyDown:w,onBlur:y,...l,children:n})});Rr.displayName="Menubar.Nav";const Pr=t.forwardRef(({id:e,disabled:o=!1,onSelect:n,asChild:a,className:i,children:l,onClick:c,onPointerMove:d,onPointerDown:u,onPointerLeave:m,onFocus:f,...p},b)=>{const h=v(e,"menubar-button"),{active:g,setActive:x,registerItem:w,unregisterItem:y,openMenuId:k,getItems:N,isItemDisabled:C}=D(),I=g===h,M=t.useRef(null),S=Ge(b,M);t.useEffect(()=>(w(h,o),()=>y(h)),[h,o,w,y]);const E=t.useCallback(e=>{u?.(e),o||x(h)},[o,h,u,x]),z=t.useCallback(e=>{if(c?.(e),o)return;I||x(h);const t=new Event("select",{bubbles:!0,cancelable:!0});n?.(t)},[o,I,c,x,h,n]),R=t.useCallback(e=>{d?.(e),!o&&k&&void 0!==g&&x(h)},[o,k,x,g,h,d]),P=t.useCallback(e=>{m?.(e),k&&k===h||document.activeElement===M.current||x(void 0)},[k,h,g,x,m,M]),A=t.useCallback(e=>{f?.(e),o||x(h)},[f,o,x,h]),O=N(),L=O.length>0?O[0]:void 0,j=g??O.find(e=>!C(e))??L??h,$=!o&&j===h;t.useEffect(()=>{!o&&I&&document.activeElement!==M.current&&M.current?.focus()},[I,o]);return s(a?r.Slot:"button",{ref:S,id:h,type:a?void 0:"button",role:"menuitem",tabIndex:o?-1:$?0:-1,"aria-disabled":o,"data-disabled":o||void 0,"data-tone":I?"inverse":void 0,className:qe("group px-4.5 py-2.5 rounded-sm text-sm cursor-pointer outline-none","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-bdr-strong focus-visible:ring-offset-3",i),onClick:z,onPointerDown:E,onPointerMove:R,onPointerLeave:P,onFocus:A,...p,children:l})});Pr.displayName="Menubar.Button";const Ar=t.forwardRef(({className:e,...r},o)=>s("div",void 0!==t.useContext(zr)?{ref:o,role:"separator","aria-orientation":"horizontal",className:qe("my-1 h-px w-full bg-bdr-subtle",e),...r}:{ref:o,role:"separator","aria-orientation":"vertical",className:qe("mx-1 w-px h-4 bg-bdr-subtle",e),...r}));Ar.displayName="Menubar.Separator";const Or=({id:e,disabled:r=!1,children:o})=>{const n=v(e,"menubar-menu"),a=`${n}-content`,i=t.useRef(null),l=D(),{registerItem:c,unregisterItem:d,openMenuId:u,setOpenMenuId:m}=l,[f,p]=t.useState(!1);t.useEffect(()=>(c(n,r),()=>d(n)),[n,r,c,d]),t.useEffect(()=>{u!==n||f?u!==n&&f&&p(!1):p(!0)},[u,n,f]);const b=t.useCallback(e=>{p(e),m(e?n:void 0)},[n,m]),h=t.useMemo(()=>({menuId:n,contentId:a,open:f,setOpen:b,menubarContext:l,triggerRef:i}),[n,a,f,b,l]);return s(M,{value:h,children:o})};Or.displayName="Menubar.Menu";const Lr=t.forwardRef(({asChild:e,className:o,children:n,onClick:a,onKeyDown:i,onPointerMove:l,onPointerDown:c,onPointerLeave:d,onFocus:u,...m},f)=>{const{menuId:p,contentId:b,open:h,setOpen:g,triggerRef:v,menubarContext:x}=S(),{active:w,setActive:y,openMenuId:k,isItemDisabled:N,getItems:C}=x,I=Ge(f,v),M=w===p,E=N(p),z=t.useCallback(e=>{a?.(e),E||g(!h)},[E,h,g,a]),D=t.useCallback(e=>{i?.(e),E||("ArrowDown"!==e.key||h)&&(" "!==e.key&&"Enter"!==e.key||h)||(e.preventDefault(),g(!0))},[E,h,g,i]),R=t.useCallback(e=>{c?.(e),E||y(p)},[E,p,c,y]),P=t.useCallback(e=>{l?.(e),E||void 0!==w&&(y(p),k&&k!==p&&g(!0))},[E,k,p,w,y,g,l]),A=t.useCallback(e=>{d?.(e),h||document.activeElement===v?.current||y(void 0)},[h,y,d,v]),O=t.useCallback(e=>{u?.(e),E||y(p)},[u,E,y,p]),L=C(),j=L.length>0?L[0]:void 0,$=w??L.find(e=>!N(e))??j??p,F=!E&&$===p;t.useEffect(()=>{!E&&M&&v&&document.activeElement!==v.current&&v.current?.focus()},[M,E,v]);return s(e?r.Slot:"button",{ref:I,id:p,type:e?void 0:"button",role:"menuitem",tabIndex:E?-1:F?0:-1,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?b:void 0,"aria-disabled":E,"data-active":h,"data-disabled":E||void 0,"data-state":h?"open":"closed","data-tone":M?"inverse":void 0,className:qe("group px-4.5 py-2.5 rounded-sm text-sm cursor-pointer outline-none","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-bdr-strong focus-visible:ring-offset-3",h&&"bg-btn-active text-alt",E&&"opacity-30 cursor-not-allowed pointer-events-none",o),onClick:z,onKeyDown:D,onPointerDown:R,onPointerMove:P,onPointerLeave:A,onFocus:O,...m,children:n})});Lr.displayName="Menubar.Trigger";const jr=({container:r,forceMount:o=!1,children:a})=>{const{open:i}=S(),[l,c]=t.useState(!1);if(t.useEffect(()=>{c(!0)},[]),!l)return null;if(!(o||i))return null;const d=r??document.body;return n.createPortal(s(e.Fragment,{children:a}),d)};jr.displayName="Menubar.Portal";const $r=t.forwardRef(({align:e="start",loop:r=!0,forceMount:o=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onInteractOutside:i,className:l,children:c,onKeyDown:d,...u},m)=>{const{menuId:f,contentId:p,open:b,setOpen:h,triggerRef:g,menubarContext:v}=S(),{getItems:x,setActive:w}=v,y=t.useRef(null),k=Ge(m,y),{registerItem:N,unregisterItem:C,getItems:I,isItemDisabled:M}=it(),[E,z]=t.useState(void 0),[D,R]=t.useState(null);if(!b&&!o)return null;const{handleKeyDown:P}=lt({getItems:I,isItemDisabled:M,active:E,setActive:z,loop:r,orientation:"vertical",onSelect:e=>{const t=document.getElementById(e);t&&t.click()}}),A=t.useCallback(e=>{if(d?.(e),"Escape"===e.key)return e.preventDefault(),e.stopPropagation(),h(!1),n?.(e),void g?.current?.focus();if("Tab"!==e.key){if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();const t=x(),r=t.indexOf(f);if(-1===r)return;const o="ArrowRight"===e.key?1:-1;let n=(r+o+t.length)%t.length,a=0;for(;a<t.length&&v.isItemDisabled(t[n]);)n=(n+o+t.length)%t.length,a+=1;const s=t[n];if(!s||v.isItemDisabled(s))return;w(s);const i=document.getElementById(s);return i?.focus(),void(i&&"menu"===i.getAttribute("aria-haspopup")?v.setOpenMenuId(s):h(!1))}P(e)}else h(!1)},[d,h,n,f,x,w,v,P,g]);t.useEffect(()=>{if(b&&null!==D){const e=I(),t=e.length>0?e[0]:void 0,r=e.find(e=>!M(e))??t;r&&z(r)}else b||z(void 0)},[b,D,I,M]),t.useEffect(()=>{if(!b||!g?.current||!y.current)return;const t=()=>{if(!g?.current||!y.current)return;const t=g.current.getBoundingClientRect(),r=y.current.getBoundingClientRect(),o=window.innerWidth,n=window.innerHeight;let a,s,i=t.bottom;if(i+r.height>n-10){const e=t.top-r.height;e>=10&&(i=e)}"start"===e?(a=t.left,a+r.width>o-10&&(a=void 0,s=o-t.right)):(s=o-t.right,t.right-r.width<10&&(s=void 0,a=t.left)),R({top:i,left:a,right:s})};return t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[b,e,g]),t.useEffect(()=>{if(!b)return;const e=e=>{const t=e.target;g?.current?.contains(t)||y.current?.contains(t)||(a?.(e),i?.(e),h(!1))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[b,h,a,i,g]);const O=t.useMemo(()=>({registerItem:N,unregisterItem:C,getItems:I,isItemDisabled:M,active:E,setActive:z}),[N,C,I,M,E,z]),L=null!==D;return s(zr.Provider,{value:O,children:s("div",{ref:k,id:p,role:"menu","aria-orientation":"vertical","aria-labelledby":f,tabIndex:-1,"data-state":b?"open":"closed","data-align":e,style:{position:"fixed",top:D?`${D.top}px`:"0",left:void 0!==D?.left?`${D.left}px`:void 0,right:void 0!==D?.right?`${D.right}px`:void 0,zIndex:9999,visibility:L?"visible":"hidden"},className:qe("flex flex-col items-start w-fit py-2.5 mt-2.5 overflow-hidden","rounded-sm border border-bdr-subtle bg-surface-neutral shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",l),onKeyDown:A,...u,children:c})})});$r.displayName="Menubar.Content";const Fr=Ye("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none",{variants:{active:{true:"bg-surface-primary-selected text-alt",false:""},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""}},compoundVariants:[{active:!0,disabled:!1,class:"focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-bdr-strong"},{active:!1,disabled:!1,class:"hover:bg-surface-primary-hover"}],defaultVariants:{active:!1,disabled:!1}}),Vr=t.forwardRef(({id:e,disabled:o=!1,onSelect:n,asChild:a,className:i,children:l,onClick:c,onPointerMove:d,onPointerLeave:u,onFocus:m,...f},p)=>{const b=v(e,"menubar-item"),{registerItem:h,unregisterItem:g,active:x,setActive:w,getItems:y,isItemDisabled:k}=function(){const e=t.useContext(zr);if(!e)throw new Error("Menubar menu item components must be used within Menubar.Content");return e}(),{setOpen:N,triggerRef:C}=S(),I=x===b,M=t.useRef(null),E=Ge(p,M);t.useEffect(()=>(h(b,o),()=>g(b)),[b,o,h,g]);const z=t.useCallback(e=>{if(c?.(e),o)return;const t=new Event("select",{bubbles:!0,cancelable:!0});n?.(t),N(!1),C?.current?.focus()},[o,c,n,N,C]),D=t.useCallback(e=>{d?.(e),o||w(b)},[o,b,w,d]),R=t.useCallback(e=>{u?.(e),document.activeElement!==M.current&&w(void 0)},[w,u,M]),P=t.useCallback(e=>{m?.(e),o||w(b)},[m,o,w,b]),A=y(),O=A.length>0?A[0]:void 0,L=x??A.find(e=>!k(e))??O??b,j=!o&&L===b;t.useEffect(()=>{!o&&I&&document.activeElement!==M.current&&M.current?.focus()},[I,o]);return s(a?r.Slot:"div",{ref:E,id:b,role:"menuitem",tabIndex:o?-1:j?0:-1,"aria-disabled":o,"data-active":I||void 0,"data-disabled":o||void 0,"data-tone":I?"inverse":void 0,className:qe(Fr({active:I,disabled:o}),i),onClick:z,onPointerMove:D,onPointerLeave:R,onFocus:P,...f,children:l})});Vr.displayName="Menubar.Item";const Br=t.forwardRef(({className:e,children:t,...r},o)=>s("div",{ref:o,role:"none",className:qe("px-3 py-1.5 text-xs font-semibold text-subtle",e),...r,children:t}));Br.displayName="Menubar.Label";const Tr=Object.assign(Dr,{Root:Dr,Nav:Rr,Content:$r,Button:Pr,Separator:Ar,Menu:Or,Trigger:Lr,Portal:jr,Item:Vr,Label:Br}),Wr=({id:e,value:r,defaultValue:o="",onChange:n,placeholder:a="Search",clearLabel:i="Clear",disabled:l,readOnly:c,children:d,className:u,...m})=>{const f=v(He(e)),p=t.useRef(null),[b,h]=at(r,o,n),g=t.useMemo(()=>({id:f,value:b,disabled:l,readOnly:c,placeholder:a,clearLabel:i,setValue:h,inputRef:p}),[f,b,l,c,a,i,h]);return s(P,{value:g,children:s("div",{className:qe("relative flex gap-2.5 items-center rounded-sm overflow-hidden","h-11.5 px-4.5 py-3","border border-bdr-subtle focus-within:border-bdr-strong","focus-within:outline-none focus-within:ring-3 focus-within:ring-bdr-strong focus-within:ring-offset-3 focus-within:ring-offset-surface-neutral","transition-highlight",c?"bg-surface-primary":"bg-surface-neutral",l&&"pointer-events-none select-none opacity-30",u),...m,children:d})})};Wr.displayName="SearchFieldRoot";const _r=({className:e})=>s(kt,{className:qe("flex items-center justify-center shrink-0 size-5.5 text-subtle",e),strokeWidth:1.5});_r.displayName="SearchFieldIcon";const qr=t.forwardRef(({className:e,...t},r)=>{const{id:o,value:n,disabled:a,readOnly:i,placeholder:l,setValue:c,inputRef:d}=A();return s("input",{ref:Ge(r,d),id:o,className:qe("h-5.5 w-full text-base border-0","text-main bg-surface-neutral","placeholder:text-subtle","focus:outline-none","enabled:read-only:bg-surface-primary",e),value:n,onChange:e=>{c(e.currentTarget.value)},readOnly:i,disabled:a,placeholder:l,"aria-label":"Search","aria-disabled":a,...t})});qr.displayName="SearchFieldInput";const Kr=({className:e,...t})=>{const{value:r,disabled:o,readOnly:n,clearLabel:a,setValue:i,inputRef:l}=A();if(!r||o||n)return null;return s(St,{className:qe("flex items-center justify-center shrink-0 size-7 -mx-1.5 text-subtle",e),icon:Nt,title:a,onClick:()=>{i(""),l.current?.focus()},disabled:o,iconSize:28,iconStrokeWidth:1.25,...t})};Kr.displayName="SearchFieldClear";const Gr=Object.assign(Wr,{Root:Wr,Icon:_r,Input:qr,Clear:Kr}),Hr=({className:e,selected:t,children:r,label:o,description:n,metadata:a,icon:i,readOnly:l,checked:c,defaultChecked:d,onCheckedChange:u,...m})=>s(fr,{className:qe(!t&&"hover:bg-surface-primary-hover",e),selected:t,role:"row","aria-selected":t,...m,children:[s(fr.Left,{children:s(It,{checked:c,defaultChecked:d,onCheckedChange:u,readOnly:l})}),s(fr.DefaultContent,{label:o,description:n,metadata:a,icon:i}),s(fr.Right,{children:r})]});Hr.displayName="SelectableListItem";const Ur=({className:e,label:t,decorative:r=!1,...o})=>{const n=r?"true":void 0;return t?s("div",{role:"separator","aria-orientation":"horizontal","aria-hidden":n,className:qe("inline-flex w-full gap-2.5",e),...o,children:[s("span",{className:"min-w-0 truncate text-subtle uppercase",children:t}),s("span",{className:"min-w-6 flex-1 border-b-1 border-bdr-subtle"})]}):s("hr",{"aria-hidden":n,className:qe("w-full border-bdr-subtle",e)})};Ur.displayName="Separator";const Xr={top:"bottom",bottom:"top",left:"right",right:"left"};function Yr({children:e,asChild:t,triggerRef:o,isOpen:n,onMouseEnter:a,onMouseLeave:i,onFocus:l,onBlur:c}){return s(t?r.Root:"div",{ref:o,className:t?void 0:"inline-flex",onMouseEnter:a,onMouseLeave:i,onFocus:l,onBlur:c,"aria-describedby":n?"tooltip":void 0,role:t?void 0:"button",tabIndex:t?void 0:0,children:e})}function Zr({children:e,actualSide:t,className:r,position:o,tooltipRef:n}){return s("div",{ref:n,role:"tooltip",className:qe("fixed z-50 pointer-events-none select-none",!o.transformOrigin&&"opacity-0"),style:{top:`${o.top}px`,left:`${o.left}px`,transformOrigin:o.transformOrigin},children:s("div",{className:qe("relative w-fit rounded-xs px-2 py-1 text-xs","bg-tooltip text-tooltip-foreground shadow-md","animate-in fade-in-0 zoom-in-95","top"===t&&"slide-in-from-top-2","bottom"===t&&"slide-in-from-bottom-2","left"===t&&"slide-in-from-left-2","right"===t&&"slide-in-from-right-2",r),children:[e,s("div",{className:qe("absolute size-2 rotate-45","top"===t&&"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2","bottom"===t&&"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2","left"===t&&"right-0 top-1/2 -translate-y-1/2 translate-x-1/2","right"===t&&"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"),style:{backgroundColor:"inherit"}})]})})}exports.Avatar=tt,exports.AvatarProvider=l,exports.Button=ot,exports.Checkbox=It,exports.Combobox=Tt,exports.ComboboxProvider=u,exports.Dialog=tr,exports.DialogProvider=p,exports.IconButton=St,exports.IdProvider=g,exports.Input=nr,exports.Link=sr,exports.ListItem=fr,exports.Listbox=xr,exports.ListboxProvider=w,exports.Menu=Er,exports.MenuProvider=N,exports.Menubar=Tr,exports.MenubarMenuContext=I,exports.MenubarMenuProvider=M,exports.MenubarProvider=z,exports.SearchField=Gr,exports.SearchFieldProvider=P,exports.SelectableListItem=Hr,exports.Separator=Ur,exports.Tooltip=function({className:r,children:o,value:n,side:a="bottom",asChild:i=!0,delay:l=0}){const[c,d]=t.useState(!1),u=t.useRef(null),m=t.useRef(null),f=t.useRef(),p=null!=n&&""!==n,b=function(e,r,o,n){const[a,s]=t.useState({top:0,left:0,transformOrigin:"",actualSide:r});return t.useEffect(()=>{if(!e||!o.current||!n.current)return;const t=o.current.getBoundingClientRect(),a=n.current.getBoundingClientRect(),i=e=>{let r=0,o=0,n="";switch(e){case"top":r=t.top+window.scrollY-a.height-8,o=t.left+window.scrollX+(t.width-a.width)/2,n="bottom center";break;case"bottom":r=t.bottom+window.scrollY+8,o=t.left+window.scrollX+(t.width-a.width)/2,n="top center";break;case"left":r=t.top+window.scrollY+(t.height-a.height)/2,o=t.left+window.scrollX-a.width-8,n="center right";break;case"right":r=t.top+window.scrollY+(t.height-a.height)/2,o=t.right+window.scrollX+8,n="center left"}return{top:r,left:o,transformOrigin:n,actualSide:e}},l=({top:e,left:t})=>{const r=window.scrollY+8,o=window.scrollY+window.innerHeight-a.height-8,n=window.scrollX+8,s=window.scrollX+window.innerWidth-a.width-8;return e>=r&&e<=o&&t>=n&&t<=s};let c=i(r);if(!l(c)){const e=i(Xr[r]);l(e)&&(c=e)}s(c)},[e,r]),a}(c&&p,a,u,m);t.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const h=t.useCallback(()=>{p&&(f.current&&clearTimeout(f.current),l>0?f.current=window.setTimeout(()=>d(!0),l):d(!0))},[l,p]),g=t.useCallback(()=>{f.current&&clearTimeout(f.current),d(!1)},[]),v=t.useCallback(()=>{p&&d(!0)},[p]),x=t.useCallback(()=>d(!1),[]);return s(e.Fragment,{children:[s(Yr,{asChild:i,triggerRef:u,isOpen:c,onMouseEnter:h,onMouseLeave:g,onFocus:v,onBlur:x,children:o}),c&&p&&t.createPortal(s(Zr,{actualSide:b.actualSide,className:r,position:b,tooltipRef:m,children:n}),document.body)]})},exports.cn=qe,exports.generateAriaId=O,exports.generateAriaIds=function(e,t){return t.reduce((t,r)=>(t[r]=O(e,r),t),{})},exports.generateItemId=L,exports.getActiveDescendantId=function(e,t,r){if(r)return L(e,t,r)},exports.setRef=Ke,exports.unwrap=He,exports.useAvatar=c,exports.useCombobox=m,exports.useComposedRefs=Ge,exports.useControlledState=at,exports.useControlledStateWithNull=st,exports.useDialog=b,exports.useItemRegistry=it,exports.useKeyboardNavigation=lt,exports.useListbox=y,exports.useMenu=C,exports.useMenubar=D,exports.useMenubarMenu=S,exports.useMenubarMenuOptional=function(){return t.useContext(I)},exports.useMenubarOptional=()=>t.useContext(E),exports.usePrefixedId=v,exports.useScrollLock=nt,exports.useSearchField=A;
|