canny-ui-react 6.5.0 → 6.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
*
|
|
172
172
|
* This source code is licensed under the ISC license.
|
|
173
173
|
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const nP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wt=xe("x",nP),rP=S.forwardRef(function({color:e="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:a=!1,filled:c=!1,type:u="text",disabled:d,className:f,style:h,sx:m,value:g,defaultValue:y,onChange:v,...x},w){const b=g!==void 0,[C,P]=S.useState(y!=null?String(y):""),R=b?String(g??""):C,M=S.useRef(null);S.useImperativeHandle(w,()=>M.current,[]);const[j,T]=S.useState(!1),E=a&&j&&u==="password"?"text":u,k=s&&!d&&R!=="",_=k||a,$=r!=null||o!=null||_,G=O=>{b||P(O.target.value),v==null||v(O)},Q=O=>{var X;O.preventDefault(),b||P("");const D=M.current;if(D){const A=(X=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:X.set;A==null||A.call(D,""),D.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},V=se($?void 0:m,$?void 0:h,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,c&&"filled",f),I=l.jsx("input",{ref:M,type:E,className:V.className,style:V.style,disabled:d,value:b?g:void 0,defaultValue:b?void 0:y,onChange:G,...x});if(!$)return l.jsxs(l.Fragment,{children:[V.styleTag,I]});const L=se(m,h,"cny-input-affix",r!=null&&"has-prefix",o!=null&&!_&&"has-suffix",_&&"has-action");return l.jsxs("span",{className:L.className,style:L.style,children:[L.styleTag,r!=null&&l.jsx("span",{className:"cny-input-prefix",children:r}),I,o!=null&&!_&&l.jsx("span",{className:"cny-input-suffix",children:o}),k&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:Q,"aria-label":"Clear",tabIndex:-1,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})}),a&&u==="password"&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>T(O=>!O),"aria-label":j?"Hide password":"Show password","aria-pressed":j,children:j?l.jsx(LS,{size:14,"aria-hidden":"true"}):l.jsx(FS,{size:14,"aria-hidden":"true"})})]})}),oP=S.forwardRef(function({color:e="default",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,r,"card",e!=="default"&&e,n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),sP={info:Rp,success:Sp,warning:Ep,danger:Cp};function iP({color:t}){const e=sP[t];return l.jsx(e,{size:16,className:"alert-icon-glyph","aria-hidden":"true"})}const aP=S.forwardRef(function({color:e="info",solid:n=!1,title:r,className:o,style:s,sx:i,children:a,icon:c,action:u,onDismiss:d,dismissLabel:f="Dismiss",...h},m){const g=c!==!1,y=c&&c!==!0?c:l.jsx(iP,{color:e}),{className:v,style:x,styleTag:w}=se(i,s,"alert",e,n&&"solid",o),b=e==="danger"?"alert":"status";return l.jsxs("div",{ref:m,role:b,className:v,style:x,...h,children:[w,g&&l.jsx("span",{className:"alert-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"alert-content",children:[r&&l.jsx("p",{className:"alert-title",children:r}),a&&l.jsx("p",{className:"alert-body",children:a})]}),u&&l.jsx("div",{className:"alert-action",children:u}),d&&l.jsx("button",{type:"button",className:"alert-close",onClick:d,"aria-label":f,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})})]})}),cP=S.forwardRef(function({size:e="md",status:n,src:r,alt:o,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:m}=se(a,i,"avatar",e!=="md"&&e,n,s);return l.jsxs("span",{ref:d,className:f,style:h,...u,children:[m,r?l.jsx("img",{src:r,alt:o??""}):c]})}),lP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:U("avatar-stack",e),...r,children:n})}),uP=S.forwardRef(function({value:e=0,color:n="primary",indeterminate:r=!1,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d=r?s??{}:{...s??{},"--value":`${u}%`},{className:f,style:h,styleTag:m}=se(i,d,"progress",r&&"indeterminate",n!=="primary"&&n,o);return l.jsxs("div",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r?void 0:u,className:f,style:h,...a,children:[m,l.jsx("span",{className:"progress-bar"})]})}),dP=S.forwardRef(function({value:e,size:n="md",showLabel:r=!0,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d={...s??{},"--value":u},{className:f,style:h,styleTag:m}=se(i,d,"progress-ring",n==="lg"&&"lg",o);return l.jsxs("span",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":u,className:f,style:h,...a,children:[m,r&&l.jsxs("span",{children:[u,"%"]})]})}),fP={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},jp=S.forwardRef(function({variant:e="default",tone:n="neutral",axis:r="both",maxHeight:o,maxWidth:s,region:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m={...fP[r],maxHeight:o,maxWidth:s,...c??{}},{className:g,style:y,styleTag:v}=se(u,m,i?"cny-scroll-region":"cny-scroll",e!=="default"&&e,n==="primary"&&"primary",a);return l.jsxs("div",{ref:h,className:g,style:y,...f,children:[v,d]})}),hP=S.forwardRef(function(e,n){return l.jsx(jp,{ref:n,region:!0,...e})}),ia=S.forwardRef(function({shape:e="text",width:n,height:r,className:o,style:s,sx:i,...a},c){const{className:u,style:d,styleTag:f}=se(i,{...s??{},width:n,height:r},"skeleton",e,o);return l.jsx("span",{ref:c,"aria-hidden":"true",className:u,style:d,...a,children:f})}),pP=S.forwardRef(function({solid:e=!1,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,r,"cny-navbar",e&&"solid",n);return l.jsxs("header",{ref:a,className:c,style:u,...i,children:[d,s]})}),mP=S.forwardRef(function({mark:e=!0,className:n,children:r,...o},s){return l.jsxs("a",{ref:s,className:U("cny-navbar-brand",n),...o,children:[e&&l.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),gP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("nav",{ref:o,className:U("cny-navbar-nav",e),...r,children:n})}),yP=S.forwardRef(function({active:e=!1,className:n,children:r,...o},s){return l.jsx("a",{ref:s,"aria-current":e?"page":void 0,className:U("cny-navbar-item",e&&"active",n),...o,children:r})}),vP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:U("cny-navbar-actions",e),...r,children:n})}),xP=S.forwardRef(function({open:e=!1,className:n,children:r,"aria-label":o,...s},i){return l.jsx("button",{ref:i,type:"button","aria-expanded":e,"aria-label":o??(e?"Close menu":"Open menu"),className:U("cny-navbar-toggle",n),...s,children:r??l.jsx(XS,{size:20,"aria-hidden":"true"})})}),bP="(max-width: 900px)",wP=S.forwardRef(function({width:e="default",sticky:n=!1,collapsed:r=!1,responsive:o=!1,mobileOpen:s=!1,onMobileOpenChange:i,className:a,style:c,sx:u,children:d,...f},h){const m=o&&!!i,g=m&&s,y=S.useRef(null);S.useEffect(()=>{var P;if(!g)return;if(typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(bP).matches){const R=((P=y.current)==null?void 0:P.querySelector('[data-cny-sidebar-item][tabindex="0"]'))??y.current;R==null||R.focus()}const C=R=>{R.key==="Escape"&&(i==null||i(!1))};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[g,i]);const{className:v,style:x,styleTag:w}=se(u,c,"cny-sidebar",e!=="default"&&e,n&&"sticky",r&&!g&&"collapsed",o&&"responsive",m&&"mobile-drawer",g&&"mobile-open",a);return l.jsxs(l.Fragment,{children:[m&&l.jsx("div",{className:U("cny-sidebar-backdrop",g&&"open"),"aria-hidden":"true",onClick:()=>i==null?void 0:i(!1)}),l.jsxs("aside",{ref:b=>{y.current=b,typeof h=="function"?h(b):h&&(h.current=b)},tabIndex:m?-1:void 0,className:v,style:x,...f,children:[w,d]})]})}),CP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:U("cny-sidebar-header",e),...r,children:n})}),SP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:U("cny-sidebar-footer",e),...r,children:n})}),PP=S.forwardRef(function({collapsed:e=!1,onClick:n,className:r,children:o,...s},i){return l.jsx("button",{ref:i,type:"button","aria-expanded":!e,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:U("cny-sidebar-toggle",e&&"collapsed",r),onClick:n,...s,children:o??l.jsx(JS,{size:16,"aria-hidden":"true"})})});function aa(t){const e=Array.from(t.querySelectorAll("[data-cny-sidebar-item]")),n=[];if(e.forEach(o=>{o.hasAttribute("aria-disabled")?o.setAttribute("tabindex","-1"):n.push(o)}),n.length===0)return;const r=n.find(o=>o.classList.contains("active"))??n[0];n.forEach(o=>o.setAttribute("tabindex",o===r?"0":"-1"))}const RP=S.forwardRef(function({title:e,className:n,children:r,...o},s){const i=S.useRef(null),a=S.useCallback(c=>{const u=i.current;if(!u)return;const f=Array.from(u.querySelectorAll("[data-cny-sidebar-item]")).filter(y=>!y.hasAttribute("aria-disabled"));if(f.length===0)return;const h=f.findIndex(y=>y===document.activeElement);let m=h;switch(c.key){case"ArrowDown":c.preventDefault(),m=h<f.length-1?h+1:0;break;case"ArrowUp":c.preventDefault(),m=h<=0?f.length-1:h-1;break;case"Home":c.preventDefault(),m=0;break;case"End":c.preventDefault(),m=f.length-1;break;default:return}const g=f[m];g&&g!==document.activeElement&&(f.forEach(y=>y.setAttribute("tabindex","-1")),g.setAttribute("tabindex","0"),g.focus())},[]);return S.useLayoutEffect(()=>{const c=i.current;if(!c||(aa(c),typeof MutationObserver>"u"))return;const u=new MutationObserver(()=>aa(c));return u.observe(c,{childList:!0,subtree:!0}),()=>u.disconnect()},[]),l.jsxs("div",{ref:s,className:U("cny-sidebar-section",n),...o,children:[e&&l.jsx("div",{className:"cny-sidebar-title",children:e}),l.jsx("nav",{ref:i,className:"cny-sidebar-nav",onKeyDown:a,children:r})]})}),TP=S.forwardRef(function({active:e=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){const u=S.useRef(null),d=S.useId();S.useLayoutEffect(()=>{const h=u.current;if(!h)return;const m=h.closest('[class*="cny-sidebar-nav"]');m&&aa(m)},[e,n]);const f=typeof i=="string"&&!a["aria-label"]?i:void 0;return l.jsxs("a",{ref:h=>{u.current=h,typeof c=="function"?c(h):c&&(c.current=h)},"data-cny-sidebar-item":d,"aria-current":e?"page":void 0,"aria-disabled":n||void 0,"aria-label":f,className:U("cny-sidebar-item",e&&"active",n&&"disabled",s),...a,children:[r&&l.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),l.jsx("span",{className:"cny-sidebar-item-label",children:i}),o&&l.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function MP(t){const e=[];return t.display&&e.push(t.display),t.direction==="row"?e.push("flex-row"):t.direction==="column"?e.push("flex-col"):t.direction==="row-reverse"?e.push("flex-row-reverse"):t.direction==="column-reverse"&&e.push("flex-col-reverse"),t.align&&e.push(`items-${t.align==="start"||t.align==="end",t.align}`),t.justify&&e.push(`justify-${t.justify}`),t.wrap&&e.push("flex-wrap"),t.p!==void 0&&e.push(`p-${t.p}`),t.px!==void 0&&e.push(`px-${t.px}`),t.py!==void 0&&e.push(`py-${t.py}`),t.pt!==void 0&&e.push(`pt-${t.pt}`),t.pr!==void 0&&e.push(`pr-${t.pr}`),t.pb!==void 0&&e.push(`pb-${t.pb}`),t.pl!==void 0&&e.push(`pl-${t.pl}`),t.m!==void 0&&e.push(`m-${t.m}`),t.mx!==void 0&&e.push(`mx-${t.mx}`),t.my!==void 0&&e.push(`my-${t.my}`),t.mt!==void 0&&e.push(`mt-${t.mt}`),t.mr!==void 0&&e.push(`mr-${t.mr}`),t.mb!==void 0&&e.push(`mb-${t.mb}`),t.ml!==void 0&&e.push(`ml-${t.ml}`),t.gap!==void 0&&e.push(`gap-${t.gap}`),t.gapX!==void 0&&e.push(`gap-x-${t.gapX}`),t.gapY!==void 0&&e.push(`gap-y-${t.gapY}`),t.w&&e.push(`w-${t.w}`),t.h&&e.push(`h-${t.h}`),t.grow&&e.push("flex-1"),e}const Dn=S.forwardRef(function({as:e,className:n,style:r,children:o,...s},i){const a=e??"div",{layoutProps:c,domProps:u}=EP(s),{sx:d,...f}=c,h=d?Na(d):void 0,m=U(...MP(f),h==null?void 0:h.className,n),g=h!=null&&h.style||r?{...h==null?void 0:h.style,...r}:void 0,y=S.createElement(a,{ref:i,className:m||void 0,style:g,...u},o);return h!=null&&h.css?S.createElement(S.Fragment,null,S.createElement(ka,{css:h.css}),y):y});function EP(t){const e=new Set(["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gapX","gapY","display","direction","align","justify","wrap","w","h","grow","sx"]),n={},r={};for(const[o,s]of Object.entries(t))e.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const jP=S.forwardRef(function(e,n){return l.jsx(Dn,{ref:n,display:"flex",direction:"column",...e})}),AP=S.forwardRef(function(e,n){const{align:r="center",...o}=e;return l.jsx(Dn,{ref:n,display:"flex",direction:"row",align:r,...o})}),sd=t=>t.map(e=>`minmax(0,${e}fr)`).join(" "),DP=S.forwardRef(function({cols:e,minColWidth:n,ratio:r,template:o,className:s,sx:i,...a},c){let u;if(o)u=o;else if(r)if(Array.isArray(r))u=sd(r);else{const f={};for(const[h,m]of Object.entries(r))m&&(f[h]=sd(m));u=f}else n&&(u=`repeat(auto-fit, minmax(${n}, 1fr))`);const d=u?{gridTemplateColumns:u,...i??{}}:i;return l.jsx(Dn,{ref:c,display:"grid",className:U(!u&&e&&`grid-cols-${e}`,s),sx:d,...a})}),IP=S.forwardRef(function({size:e="lg",className:n,...r},o){return l.jsx(Dn,{ref:o,className:U("cny-container",e,n),...r})}),kP=S.forwardRef(function({orientation:e="horizontal",className:n,style:r,sx:o,...s},i){const{className:a,style:c,styleTag:u}=se(o,r,"cny-divider",e,n);return e==="vertical"?l.jsxs(l.Fragment,{children:[u,l.jsx("span",{ref:i,role:"separator","aria-orientation":"vertical",className:a,style:c,...s})]}):l.jsxs(l.Fragment,{children:[u,l.jsx("hr",{ref:i,className:a,style:c,...s})]})}),NP=S.forwardRef(function({className:e,style:n,sx:r,...o},s){const{className:i,style:a,styleTag:c}=se(r,n,"cny-spacer",e);return l.jsx("span",{ref:s,"aria-hidden":"true",className:i,style:a,...o,children:c})}),_P=S.forwardRef(function({ratio:e=16/9,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,{aspectRatio:String(e),...r},"aspect-ratio",n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),OP=S.forwardRef(function(e,n){return l.jsx(Dn,{ref:n,display:"flex",align:"center",justify:"center",...e})}),LP=S.forwardRef(function(e,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=e;return l.jsx(Dn,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),$P={display:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",small:"small",caption:"span",code:"code",kbd:"kbd"},FP=S.forwardRef(function({as:e,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m=e??$P[n],{className:g,style:y,styleTag:v}=se(u,c,"cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return S.createElement(m,{ref:h,className:g,style:y,...f},v,d)});function VP({label:t,hint:e,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,style:u,sx:d,children:f,...h}){const m=S.useId(),g=S.Children.only(f),y=g.props.id??m,v=n!=null&&n!==!1,x=a??(v?"danger":"default"),w=e||n?`${y}-hint`:void 0,b=S.cloneElement(g,{id:y,"aria-invalid":v||g.props["aria-invalid"]||void 0,"aria-describedby":w??g.props["aria-describedby"],className:U(g.props.className,x!=="default"&&x)}),C=i!=null&&s!=null&&s>i?"danger":"default",{className:P,style:R,styleTag:M}=se(d,u,"cny-field",c);return l.jsxs("div",{className:P,style:R,...h,children:[M,(t!=null||s!=null)&&l.jsxs("div",{className:"cny-field-label-row",children:[t!=null?l.jsxs("label",{htmlFor:y,className:"cny-field-label",children:[t,r&&l.jsx("span",{className:"cny-field-required","aria-hidden":"true",children:"*"}),o&&!r&&l.jsx("span",{className:"cny-field-optional",children:"optional"})]}):l.jsx("span",{}),s!=null&&l.jsx("span",{className:U("cny-field-counter",C==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),b,(n||e)&&l.jsx("span",{id:w,className:U("cny-field-hint",x!=="default"&&x),children:n??e})]})}const BP=S.forwardRef(function({color:e="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,style:i,sx:a,onChange:c,...u},d){const f=S.useRef(null);S.useImperativeHandle(d,()=>f.current,[]);const h=S.useCallback(()=>{const x=f.current;if(!x||!r)return;x.style.height="auto";const b=parseFloat(getComputedStyle(x).lineHeight||"20")*o;x.style.height=`${Math.min(x.scrollHeight,b)}px`,x.style.overflowY=x.scrollHeight>b?"auto":"hidden"},[r,o]);S.useEffect(()=>{h()},[h,u.value,u.defaultValue]);const m=x=>{c==null||c(x),r&&h()},{className:g,style:y,styleTag:v}=se(a,i,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return l.jsxs(l.Fragment,{children:[v,l.jsx("textarea",{ref:f,className:g,style:y,onChange:m,...u})]})});var GP=Object.defineProperty,zP=(t,e)=>GP(t,"name",{value:e,configurable:!0});function Ar(t,[e,n]){return Math.min(n,Math.max(e,t))}zP(Ar,"clamp");var UP=Object.defineProperty,Ne=(t,e)=>UP(t,"name",{value:e,configurable:!0}),ca="dismissableLayer.update",HP="dismissableLayer.pointerDownOutside",WP="dismissableLayer.focusOutside",id,Ap=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ur=p.forwardRef(Ne(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...d}=e,f=p.useContext(Ap),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=p.useState({}),v=ie(n,m),x=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=w?x.indexOf(w):-1,C=h?x.indexOf(h):-1,P=f.layersWithOutsidePointerEventsDisabled.size>0,R=C>=b,M=p.useRef(!1),j=Ip(_=>{i==null||i(_),c==null||c(_),_.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(_=>{if(!(_ instanceof Node))return!1;const $=[...f.branches].some(G=>G.contains(_));return R&&!$},[f.branches,R])}),T=kp(_=>{if(o&&M.current)return;const $=_.target;[...f.branches].some(Q=>Q.contains($))||(a==null||a(_),c==null||c(_),_.defaultPrevented||u==null||u())},g),E=h?C===x.length-1:!1,k=Qe(_=>{_.key==="Escape"&&(s==null||s(_),!_.defaultPrevented&&u&&(_.preventDefault(),u()))});return p.useEffect(()=>{if(E)return g.addEventListener("keydown",k,{capture:!0}),()=>g.removeEventListener("keydown",k,{capture:!0})},[g,E,k]),p.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(id=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),la(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=id))}},[h,g,r,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),la())},[h,f]),p.useEffect(()=>{const _=Ne(()=>y({}),"handleUpdate");return document.addEventListener(ca,_),()=>document.removeEventListener(ca,_)},[]),l.jsx(re.div,{...d,ref:v,style:{pointerEvents:P?R?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,T.onFocusCapture),onBlurCapture:H(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,j.onPointerDownCapture)})},"DismissableLayer"));function Dp(){const t=p.useContext(Ap),[e,n]=p.useState(null);return p.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Ne(Dp,"useDismissableLayerSurface");var KP=Ne(()=>!0,"IS_TRUE");function Ip(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=KP}=e,a=Qe(t),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,o.current=!1,d.current.clear()}Ne(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Ne(m,"isOutsideInteractionIntercepted");function g(b){if(!u.current)return;const C=b.target;C instanceof Node&&[...s].some(R=>R.contains(C))||d.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Ne(g,"handleInteractionCapture");function y(b){u.current&&d.current.set(b.type,!1)}Ne(y,"handleInteractionBubble");const v=Ne(b=>{if(b.target&&!c.current){let C=function(){n.removeEventListener("click",f.current);const R=m();h(),R||mc(HP,a,P,{discrete:!0})};if(Ne(C,"handleAndDispatchPointerDownOutsideEvent"),!i(b.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const P={originalEvent:b};u.current=!0,o.current=r&&b.button===0,d.current.clear(),!r||b.button!==0?C():(n.removeEventListener("click",f.current),f.current=C,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const b of x)n.addEventListener(b,g,!0),n.addEventListener(b,y);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const b of x)n.removeEventListener(b,g,!0),n.removeEventListener(b,y)}},[n,a,r,o,s,i]),{onPointerDownCapture:Ne(()=>c.current=!0,"onPointerDownCapture")}}Ne(Ip,"usePointerDownOutside");function kp(t,e=globalThis==null?void 0:globalThis.document){const n=Qe(t),r=p.useRef(!1);return p.useEffect(()=>{const o=Ne(s=>{s.target&&!r.current&&mc(WP,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:Ne(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ne(()=>r.current=!1,"onBlurCapture")}}Ne(kp,"useFocusOutside");function la(){const t=new CustomEvent(ca);document.dispatchEvent(t)}Ne(la,"dispatchUpdate");function mc(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?dc(o,s):o.dispatchEvent(s)}Ne(mc,"handleAndDispatchCustomEvent");var YP=Object.defineProperty,gc=(t,e)=>YP(t,"name",{value:e,configurable:!0}),yo=0,Pt=null;function XP(t){return ur(),t.children}gc(XP,"FocusGuards");function ur(){p.useEffect(()=>{Pt||(Pt={start:ua(),end:ua()});const{start:t,end:e}=Pt;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),yo++,()=>{yo===1&&(Pt==null||Pt.start.remove(),Pt==null||Pt.end.remove(),Pt=null),yo=Math.max(0,yo-1)}},[])}gc(ur,"useFocusGuards");function ua(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}gc(ua,"createFocusGuard");var qP=Object.defineProperty,Xe=(t,e)=>qP(t,"name",{value:e,configurable:!0}),fi="focusScope.autoFocusOnMount",hi="focusScope.autoFocusOnUnmount",ad={bubbles:!1,cancelable:!0},hs=p.forwardRef(Xe(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[c,u]=p.useState(null),d=Qe(s),f=Qe(i),h=p.useRef(null),m=ie(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(o){let v=function(C){if(g.paused||!c)return;const P=C.target;c.contains(P)?h.current=P:Lt(h.current,{select:!0})},x=function(C){if(g.paused||!c)return;const P=C.relatedTarget;P!==null&&(c.contains(P)||Lt(h.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&Lt(c)};Xe(v,"handleFocusIn"),Xe(x,"handleFocusOut"),Xe(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",x);const b=new MutationObserver(w);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),b.disconnect()}}},[o,c,g.paused]),p.useEffect(()=>{if(c){cd.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(fi,ad);c.addEventListener(fi,d),c.dispatchEvent(w),w.defaultPrevented||(Np(Fp(yc(c)),{select:!0}),document.activeElement===v&&Lt(c))}return()=>{c.removeEventListener(fi,d),setTimeout(()=>{const w=new CustomEvent(hi,ad);c.addEventListener(hi,f),c.dispatchEvent(w),w.defaultPrevented||Lt(v??document.body,{select:!0}),c.removeEventListener(hi,f),cd.remove(g)},0)}}},[c,d,f,g]);const y=p.useCallback(v=>{if(!r&&!o||g.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(x&&w){const b=v.currentTarget,[C,P]=_p(b);C&&P?!v.shiftKey&&w===P?(v.preventDefault(),r&&Lt(C,{select:!0})):v.shiftKey&&w===C&&(v.preventDefault(),r&&Lt(P,{select:!0})):w===b&&v.preventDefault()}},[r,o,g.paused]);return l.jsx(re.div,{tabIndex:-1,...a,ref:m,onKeyDown:y})},"FocusScope"));function Np(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Lt(r,{select:e}),document.activeElement!==n)return}Xe(Np,"focusFirst");function _p(t){const e=yc(t),n=da(e,t),r=da(e.reverse(),t);return[n,r]}Xe(_p,"getTabbableEdges");function yc(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Xe(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}Xe(yc,"getTabbableCandidates");function da(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Op(r,{upTo:e})))return r}Xe(da,"findVisible");function Op(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}Xe(Op,"isHidden");function Lp(t){return t instanceof HTMLInputElement&&"select"in t}Xe(Lp,"isSelectableInput");function Lt(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Lp(t)&&e&&t.select()}}Xe(Lt,"focus");var cd=$p();function $p(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=fa(t,e),t.unshift(e)},remove(e){var n;t=fa(t,e),(n=t[0])==null||n.resume()}}}Xe($p,"createFocusScopesStack");function fa(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Xe(fa,"arrayRemove");function Fp(t){return t.filter(e=>e.tagName!=="A")}Xe(Fp,"removeLinks");const ZP=["top","right","bottom","left"],on=Math.min,at=Math.max,es=Math.round,vo=Math.floor,It=t=>({x:t,y:t}),QP={left:"right",right:"left",bottom:"top",top:"bottom"};function ha(t,e,n){return at(t,on(e,n))}function Bt(t,e){return typeof t=="function"?t(e):t}function Gt(t){return t.split("-")[0]}function dr(t){return t.split("-")[1]}function vc(t){return t==="x"?"y":"x"}function xc(t){return t==="y"?"height":"width"}function At(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function bc(t){return vc(At(t))}function JP(t,e,n){n===void 0&&(n=!1);const r=dr(t),o=bc(t),s=xc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=ts(i)),[i,ts(i)]}function eR(t){const e=ts(t);return[pa(t),e,pa(e)]}function pa(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ld=["left","right"],ud=["right","left"],tR=["top","bottom"],nR=["bottom","top"];function rR(t,e,n){switch(t){case"top":case"bottom":return n?e?ud:ld:e?ld:ud;case"left":case"right":return e?tR:nR;default:return[]}}function oR(t,e,n,r){const o=dr(t);let s=rR(Gt(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(pa)))),s}function ts(t){const e=Gt(t);return QP[e]+t.slice(e.length)}function sR(t){return{top:0,right:0,bottom:0,left:0,...t}}function Vp(t){return typeof t!="number"?sR(t):{top:t,right:t,bottom:t,left:t}}function ns(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function dd(t,e,n){let{reference:r,floating:o}=t;const s=At(e),i=bc(e),a=xc(i),c=Gt(e),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(dr(e)){case"start":m[i]-=h*(n&&u?-1:1);break;case"end":m[i]+=h*(n&&u?-1:1);break}return m}async function iR(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Bt(e,t),g=Vp(m),v=a[h?f==="floating"?"reference":"floating":f],x=ns(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},P=ns(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:c}):w);return{top:(x.top-P.top+g.top)/C.y,bottom:(P.bottom-x.bottom+g.bottom)/C.y,left:(x.left-P.left+g.left)/C.x,right:(P.right-x.right+g.right)/C.x}}const aR=50,cR=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:iR},c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:f}=dd(u,r,c),h=r,m=0;const g={};for(let y=0;y<s.length;y++){const v=s[y];if(!v)continue;const{name:x,fn:w}=v,{x:b,y:C,data:P,reset:R}=await w({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:u,platform:a,elements:{reference:t,floating:e}});d=b??d,f=C??f,g[x]={...g[x],...P},R&&m<aR&&(m++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(u=R.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:o}):R.rects),{x:d,y:f}=dd(u,h,c)),y=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:g}},lR=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=e,{element:u,padding:d=0}=Bt(t,e)||{};if(u==null)return{};const f=Vp(d),h={x:n,y:r},m=bc(o),g=xc(m),y=await i.getDimensions(u),v=m==="y",x=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[m]-h[m]-s.floating[g],P=h[m]-s.reference[m],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let M=R?R[b]:0;(!M||!await(i.isElement==null?void 0:i.isElement(R)))&&(M=a.floating[b]||s.floating[g]);const j=C/2-P/2,T=M/2-y[g]/2-1,E=on(f[x],T),k=on(f[w],T),_=E,$=M-y[g]-k,G=M/2-y[g]/2+j,Q=ha(_,G,$),V=!c.arrow&&dr(o)!=null&&G!==Q&&s.reference[g]/2-(G<_?E:k)-y[g]/2<0,I=V?G<_?G-_:G-$:0;return{[m]:h[m]+I,data:{[m]:Q,centerOffset:G-Q-I,...V&&{alignmentOffset:I}},reset:V}}}),uR=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=Bt(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Gt(o),w=At(a),b=Gt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),P=h||(b||!y?[ts(a)]:eR(a)),R=g!=="none";!h&&R&&P.push(...oR(a,y,g,C));const M=[a,...P],j=await c.detectOverflow(e,v),T=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&T.push(j[x]),f){const G=JP(o,i,C);T.push(j[G[0]],j[G[1]])}if(E=[...E,{placement:o,overflows:T}],!T.every(G=>G<=0)){var k,_;const G=(((k=s.flip)==null?void 0:k.index)||0)+1,Q=M[G];if(Q&&(!(f==="alignment"?w!==At(Q):!1)||E.every(L=>At(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:G,overflows:E},reset:{placement:Q}};let V=(_=E.filter(I=>I.overflows[0]<=0).sort((I,L)=>I.overflows[1]-L.overflows[1])[0])==null?void 0:_.placement;if(!V)switch(m){case"bestFit":{var $;const I=($=E.filter(L=>{if(R){const O=At(L.placement);return O===w||O==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(O=>O>0).reduce((O,D)=>O+D,0)]).sort((L,O)=>L[1]-O[1])[0])==null?void 0:$[0];I&&(V=I);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function fd(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function hd(t){return ZP.some(e=>t[e]>=0)}const dR=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...s}=Bt(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=fd(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:hd(a)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),a=fd(i,n.floating);return{data:{escapedOffsets:a,escaped:hd(a)}}}default:return{}}}}},Bp=new Set(["left","top"]);async function fR(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Gt(n),a=dr(n),c=At(n)==="y",u=Bp.has(i)?-1:1,d=s&&c?-1:1,f=Bt(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const hR=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=e,c=await fR(e,t);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},pR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:w,y:b}=x;return{x:w,y:b}}},...u}=Bt(t,e),d={x:n,y:r},f=await s.detectOverflow(e,u),h=At(Gt(o)),m=vc(h);let g=d[m],y=d[h];if(i){const x=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=g+f[x],C=g-f[w];g=ha(b,g,C)}if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=y+f[x],C=y-f[w];y=ha(b,y,C)}const v=c.fn({...e,[m]:g,[h]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:i,[h]:a}}}}}},mR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Bt(t,e),d={x:n,y:r},f=At(o),h=vc(f);let m=d[h],g=d[f];const y=Bt(a,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const b=h==="y"?"height":"width",C=s.reference[h]-s.floating[b]+v.mainAxis,P=s.reference[h]+s.reference[b]-v.mainAxis;m<C?m=C:m>P&&(m=P)}if(u){var x,w;const b=h==="y"?"width":"height",C=Bp.has(Gt(o)),P=s.reference[f]-s.floating[b]+(C&&((x=i.offset)==null?void 0:x[f])||0)+(C?0:v.crossAxis),R=s.reference[f]+s.reference[b]+(C?0:((w=i.offset)==null?void 0:w[f])||0)-(C?v.crossAxis:0);g<P?g=P:g>R&&(g=R)}return{[h]:m,[f]:g}}}},gR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:s,platform:i,elements:a}=e,{apply:c=()=>{},...u}=Bt(t,e),d=await i.detectOverflow(e,u),f=Gt(o),h=dr(o),m=At(o)==="y",{width:g,height:y}=s.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const w=y-d.top-d.bottom,b=g-d.left-d.right,C=on(y-d[v],w),P=on(g-d[x],b),R=!e.middlewareData.shift;let M=C,j=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=w),R&&!h){const E=at(d.left,0),k=at(d.right,0),_=at(d.top,0),$=at(d.bottom,0);m?j=g-2*(E!==0||k!==0?E+k:at(d.left,d.right)):M=y-2*(_!==0||$!==0?_+$:at(d.top,d.bottom))}await c({...e,availableWidth:j,availableHeight:M});const T=await i.getDimensions(a.floating);return g!==T.width||y!==T.height?{reset:{rects:!0}}:{}}}};function ps(){return typeof window<"u"}function fr(t){return Gp(t)?(t.nodeName||"").toLowerCase():"#document"}function ct(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function _t(t){var e;return(e=(Gp(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gp(t){return ps()?t instanceof Node||t instanceof ct(t).Node:!1}function xt(t){return ps()?t instanceof Element||t instanceof ct(t).Element:!1}function Kt(t){return ps()?t instanceof HTMLElement||t instanceof ct(t).HTMLElement:!1}function pd(t){return!ps()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ct(t).ShadowRoot}function Hr(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=bt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function yR(t){return/^(table|td|th)$/.test(fr(t))}function ms(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const vR=/transform|translate|scale|rotate|perspective|filter/,xR=/paint|layout|strict|content/,bn=t=>!!t&&t!=="none";let pi;function wc(t){const e=xt(t)?bt(t):t;return bn(e.transform)||bn(e.translate)||bn(e.scale)||bn(e.rotate)||bn(e.perspective)||!Cc()&&(bn(e.backdropFilter)||bn(e.filter))||vR.test(e.willChange||"")||xR.test(e.contain||"")}function bR(t){let e=sn(t);for(;Kt(e)&&!Jn(e);){if(wc(e))return e;if(ms(e))return null;e=sn(e)}return null}function Cc(){return pi==null&&(pi=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pi}function Jn(t){return/^(html|body|#document)$/.test(fr(t))}function bt(t){return ct(t).getComputedStyle(t)}function gs(t){return xt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function sn(t){if(fr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pd(t)&&t.host||_t(t);return pd(e)?e.host:e}function zp(t){const e=sn(t);return Jn(e)?t.ownerDocument?t.ownerDocument.body:t.body:Kt(e)&&Hr(e)?e:zp(e)}function Dr(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=zp(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=ct(o);if(s){const a=ma(i);return e.concat(i,i.visualViewport||[],Hr(o)?o:[],a&&n?Dr(a):[])}else return e.concat(o,Dr(o,[],n))}function ma(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Up(t){const e=bt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Kt(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,a=es(n)!==s||es(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Sc(t){return xt(t)?t:t.contextElement}function Yn(t){const e=Sc(t);if(!Kt(e))return It(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=Up(e);let i=(s?es(n.width):n.width)/r,a=(s?es(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const wR=It(0);function Hp(t){const e=ct(t);return!Cc()||!e.visualViewport?wR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function CR(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ct(t)?!1:e}function Mn(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=Sc(t);let i=It(1);e&&(r?xt(r)&&(i=Yn(r)):i=Yn(t));const a=CR(s,n,r)?Hp(s):It(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const h=ct(s),m=r&&xt(r)?ct(r):r;let g=h,y=ma(g);for(;y&&r&&m!==g;){const v=Yn(y),x=y.getBoundingClientRect(),w=bt(y),b=x.left+(y.clientLeft+parseFloat(w.paddingLeft))*v.x,C=x.top+(y.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=b,u+=C,g=ct(y),y=ma(g)}}return ns({width:d,height:f,x:c,y:u})}function ys(t,e){const n=gs(t).scrollLeft;return e?e.left+n:Mn(_t(t)).left+n}function Wp(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-ys(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function SR(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=_t(r),a=e?ms(e.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=It(1);const d=It(0),f=Kt(r);if((f||!f&&!s)&&((fr(r)!=="body"||Hr(i))&&(c=gs(r)),f)){const m=Mn(r);u=Yn(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=i&&!f&&!s?Wp(i,c):It(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function PR(t){return Array.from(t.getClientRects())}function RR(t){const e=_t(t),n=gs(t),r=t.ownerDocument.body,o=at(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=at(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ys(t);const a=-n.scrollTop;return bt(r).direction==="rtl"&&(i+=at(e.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const md=25;function TR(t,e){const n=ct(t),r=_t(t),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Cc();(!d||d&&e==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=ys(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=md&&(s-=g)}else u<=md&&(s+=u);return{width:s,height:i,x:a,y:c}}function MR(t,e){const n=Mn(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=Kt(t)?Yn(t):It(1),i=t.clientWidth*s.x,a=t.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function gd(t,e,n){let r;if(e==="viewport")r=TR(t,n);else if(e==="document")r=RR(_t(t));else if(xt(e))r=MR(e,n);else{const o=Hp(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return ns(r)}function Kp(t,e){const n=sn(t);return n===e||!xt(n)||Jn(n)?!1:bt(n).position==="fixed"||Kp(n,e)}function ER(t,e){const n=e.get(t);if(n)return n;let r=Dr(t,[],!1).filter(a=>xt(a)&&fr(a)!=="body"),o=null;const s=bt(t).position==="fixed";let i=s?sn(t):t;for(;xt(i)&&!Jn(i);){const a=bt(i),c=wc(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Hr(i)&&!c&&Kp(t,i))?r=r.filter(d=>d!==i):o=a,i=sn(i)}return e.set(t,r),r}function jR(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?ms(e)?[]:ER(e,this._c):[].concat(n),r],a=gd(e,i[0],o);let c=a.top,u=a.right,d=a.bottom,f=a.left;for(let h=1;h<i.length;h++){const m=gd(e,i[h],o);c=at(m.top,c),u=on(m.right,u),d=on(m.bottom,d),f=at(m.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function AR(t){const{width:e,height:n}=Up(t);return{width:e,height:n}}function DR(t,e,n){const r=Kt(e),o=_t(e),s=n==="fixed",i=Mn(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=It(0);function u(){c.x=ys(o)}if(r||!r&&!s)if((fr(e)!=="body"||Hr(o))&&(a=gs(e)),r){const m=Mn(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Wp(o,a):It(0),f=i.left+a.scrollLeft-c.x-d.x,h=i.top+a.scrollTop-c.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function mi(t){return bt(t).position==="static"}function yd(t,e){if(!Kt(t)||bt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return _t(t)===n&&(n=n.ownerDocument.body),n}function Yp(t,e){const n=ct(t);if(ms(t))return n;if(!Kt(t)){let o=sn(t);for(;o&&!Jn(o);){if(xt(o)&&!mi(o))return o;o=sn(o)}return n}let r=yd(t,e);for(;r&&yR(r)&&mi(r);)r=yd(r,e);return r&&Jn(r)&&mi(r)&&!wc(r)?n:r||bR(t)||n}const IR=async function(t){const e=this.getOffsetParent||Yp,n=this.getDimensions,r=await n(t.floating);return{reference:DR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kR(t){return bt(t).direction==="rtl"}const NR={convertOffsetParentRelativeRectToViewportRelativeRect:SR,getDocumentElement:_t,getClippingRect:jR,getOffsetParent:Yp,getElementRects:IR,getClientRects:PR,getDimensions:AR,getScale:Yn,isElement:xt,isRTL:kR};function Xp(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function _R(t,e){let n=null,r;const o=_t(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(a||e(),!h||!m)return;const g=vo(f),y=vo(o.clientWidth-(d+h)),v=vo(o.clientHeight-(f+m)),x=vo(d),b={rootMargin:-g+"px "+-y+"px "+-v+"px "+-x+"px",threshold:at(0,on(1,c))||1};let C=!0;function P(R){const M=R[0].intersectionRatio;if(M!==c){if(!C)return i();M?i(!1,M):r=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!Xp(u,t.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(P,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,b)}n.observe(t)}return i(!0),s}function OR(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Sc(t),d=o||s?[...u?Dr(u):[],...e?Dr(e):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&a?_R(u,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&m&&e&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(e)})),n()}),u&&!c&&m.observe(u),e&&m.observe(e));let g,y=c?Mn(t):null;c&&v();function v(){const x=Mn(t);y&&!Xp(y,x)&&n(),y=x,g=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const LR=hR,$R=pR,FR=uR,VR=gR,BR=dR,vd=lR,GR=mR,zR=(t,e,n)=>{const r=new Map,o={platform:NR,...n},s={...o.platform,_c:r};return cR(t,e,{...o,platform:s})};var UR=typeof document<"u",HR=function(){},Bo=UR?S.useLayoutEffect:HR;function rs(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!rs(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&t.$$typeof)&&!rs(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function qp(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function xd(t,e){const n=qp(t);return Math.round(e*n)/n}function gi(t){const e=p.useRef(t);return Bo(()=>{e.current=t}),e}function WR(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=t,[d,f]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);rs(h,r)||m(r);const[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useCallback(L=>{L!==R.current&&(R.current=L,y(L))},[]),b=p.useCallback(L=>{L!==M.current&&(M.current=L,x(L))},[]),C=s||g,P=i||v,R=p.useRef(null),M=p.useRef(null),j=p.useRef(d),T=c!=null,E=gi(c),k=gi(o),_=gi(u),$=p.useCallback(()=>{if(!R.current||!M.current)return;const L={placement:e,strategy:n,middleware:h};k.current&&(L.platform=k.current),zR(R.current,M.current,L).then(O=>{const D={...O,isPositioned:_.current!==!1};G.current&&!rs(j.current,D)&&(j.current=D,Lr.flushSync(()=>{f(D)}))})},[h,e,n,k,_]);Bo(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const G=p.useRef(!1);Bo(()=>(G.current=!0,()=>{G.current=!1}),[]),Bo(()=>{if(C&&(R.current=C),P&&(M.current=P),C&&P){if(E.current)return E.current(C,P,$);$()}},[C,P,$,E,T]);const Q=p.useMemo(()=>({reference:R,floating:M,setReference:w,setFloating:b}),[w,b]),V=p.useMemo(()=>({reference:C,floating:P}),[C,P]),I=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!V.floating)return L;const O=xd(V.floating,d.x),D=xd(V.floating,d.y);return a?{...L,transform:"translate("+O+"px, "+D+"px)",...qp(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:D}},[n,a,V.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:$,refs:Q,elements:V,floatingStyles:I}),[d,$,Q,V,I])}const KR=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?vd({element:r.current,padding:o}).fn(n):{}:r?vd({element:r,padding:o}).fn(n):{}}}},YR=(t,e)=>{const n=LR(t);return{name:n.name,fn:n.fn,options:[t,e]}},XR=(t,e)=>{const n=$R(t);return{name:n.name,fn:n.fn,options:[t,e]}},qR=(t,e)=>({fn:GR(t).fn,options:[t,e]}),ZR=(t,e)=>{const n=FR(t);return{name:n.name,fn:n.fn,options:[t,e]}},QR=(t,e)=>{const n=VR(t);return{name:n.name,fn:n.fn,options:[t,e]}},JR=(t,e)=>{const n=BR(t);return{name:n.name,fn:n.fn,options:[t,e]}},eT=(t,e)=>{const n=KR(t);return{name:n.name,fn:n.fn,options:[t,e]}};var tT=Object.defineProperty,nT=(t,e)=>tT(t,"name",{value:e,configurable:!0}),rT=p.forwardRef(nT(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return l.jsx(re.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),oT=rT,sT=Object.defineProperty,iT=(t,e)=>sT(t,"name",{value:e,configurable:!0});function hr(t){const[e,n]=p.useState(void 0);return Ee(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=t.offsetWidth,a=t.offsetHeight;n({width:i,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}iT(hr,"useSize");var aT=Object.defineProperty,$t=(t,e)=>aT(t,"name",{value:e,configurable:!0}),Zp="Popper",[Qp,dn]=Re(Zp),[cT,Jp]=Qp(Zp),lT=$t(t=>{const{__scopePopper:e,children:n}=t,[r,o]=p.useState(null),[s,i]=p.useState(void 0);return l.jsx(cT,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),uT="PopperAnchor",dT=p.forwardRef($t(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=Jp(uT,r),a=p.useRef(null),c=i.onAnchorChange,u=p.useCallback(y=>{a.current=y,y&&c(y)},[c]),d=ie(n,u),f=p.useRef(null);p.useEffect(()=>{if(!o)return;const y=f.current;f.current=o.current,y!==f.current&&c(f.current)});const h=i.placementState&&vs(i.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return o?null:l.jsx(re.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),em="PopperContent",[fT,hT]=Qp(em),pT=p.forwardRef($t(function(e,n){var z,Z,le,ce,F,q,he;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,x=Jp(em,r),[w,b]=p.useState(null),C=ie(n,b),[P,R]=p.useState(null),M=hr(P),j=(M==null?void 0:M.width)??0,T=(M==null?void 0:M.height)??0,E=o+(i!=="center"?"-"+i:""),k=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(d)?d:[d],$=_.length>0,G={padding:k,boundary:_.filter(tm),altBoundary:$},{refs:Q,floatingStyles:V,placement:I,isPositioned:L,middlewareData:O}=WR({strategy:"fixed",placement:E,whileElementsMounted:$t((...ue)=>OR(...ue,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[YR({mainAxis:s+T,alignmentAxis:a}),u&&XR({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?qR():void 0,...G}),u&&ZR({...G}),QR({...G,apply:$t(({elements:ue,rects:He,availableWidth:ve,availableHeight:qe})=>{const{width:gn,height:pe}=He.reference,we=ue.floating.style;we.setProperty("--radix-popper-available-width",`${ve}px`),we.setProperty("--radix-popper-available-height",`${qe}px`),we.setProperty("--radix-popper-anchor-width",`${gn}px`),we.setProperty("--radix-popper-anchor-height",`${pe}px`)},"apply")}),P&&eT({element:P,padding:c}),vT({arrowWidth:j,arrowHeight:T}),m&&JR({strategy:"referenceHidden",...G,boundary:$?G.boundary:void 0})]}),D=x.setPlacementState;Ee(()=>(D(I),()=>{D(void 0)}),[I,D]);const[X,A]=vs(I),B=Qe(y);Ee(()=>{L&&(B==null||B())},[L,B]);const ee=(z=O.arrow)==null?void 0:z.x,K=(Z=O.arrow)==null?void 0:Z.y,W=((le=O.arrow)==null?void 0:le.centerOffset)!==0,[oe,Y]=p.useState();return Ee(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:L?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(ce=O.transformOrigin)==null?void 0:ce.x,(F=O.transformOrigin)==null?void 0:F.y].join(" "),...((q=O.hide)==null?void 0:q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(fT,{scope:r,placedSide:X,placedAlign:A,onArrowChange:R,arrowX:ee,arrowY:K,shouldHideArrow:W,children:l.jsx(re.div,{"data-side":X,"data-align":A,...v,ref:C,style:{...v.style,animation:L?(he=v.style)==null?void 0:he.animation:"none"}})})})},"PopperContent")),mT="PopperArrow",gT={top:"bottom",right:"left",bottom:"top",left:"right"},yT=p.forwardRef($t(function(e,n){const{__scopePopper:r,...o}=e,s=hT(mT,r),i=gT[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(oT,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function tm(t){return t!==null}$t(tm,"isNotNull");var vT=$t(t=>({name:"transformOrigin",options:t,fn(e){var v,x,w;const{placement:n,rects:r,middlewareData:o}=e,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,d]=vs(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,m=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let g="",y="";return u==="bottom"?(g=i?f:`${h}px`,y=`${-c}px`):u==="top"?(g=i?f:`${h}px`,y=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,y=i?f:`${m}px`):u==="left"&&(g=`${r.floating.width+c}px`,y=i?f:`${m}px`),{data:{x:g,y}}}}),"transformOrigin");function vs(t){const[e,n="center"]=t.split("-");return[e,n]}$t(vs,"getSideAndAlignFromPlacement");var Wr=lT,Kr=dT,xs=pT,nm=yT,xT=Object.defineProperty,bT=(t,e)=>xT(t,"name",{value:e,configurable:!0}),Yr=p.forwardRef(bT(function(e,n){var c;const{container:r,...o}=e,[s,i]=p.useState(!1);Ee(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Lr.createPortal(l.jsx(re.div,{...o,ref:n}),a):null},"Portal")),wT=Object.defineProperty,zt=(t,e)=>wT(t,"name",{value:e,configurable:!0});function rm(t,e){return p.useReducer((n,r)=>e[n][r]??n,t)}zt(rm,"useStateMachine");var Ue=zt(t=>{const{present:e,children:n}=t,r=om(e),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=sm(r.ref,im(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null},"Presence");function om(t){const[e,n]=p.useState(),r=p.useRef(null),o=p.useRef(t),s=p.useRef("none"),i=p.useRef(void 0),a=t?"mounted":"unmounted",[c,u]=rm(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=i.current??Bn(r.current),i.current=void 0):s.current="none"},[c]),Ee(()=>{const d=r.current,f=o.current;if(f!==t){const m=s.current,g=Bn(d);t?(i.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),Ee(()=>{if(e){let d;const f=e.ownerDocument.defaultView??window,h=zt(g=>{const v=Bn(r.current).includes(CSS.escape(g.animationName));if(g.target===e&&v&&(u("ANIMATION_END"),!o.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",d=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),m=zt(g=>{g.target===e&&(s.current=Bn(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(d),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,i.current=Bn(f)}else r.current=null;n(d)},[])}}zt(om,"usePresence");function ga(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}zt(ga,"setRef");function sm(...t){const e=p.useRef(t);return e.current=t,p.useCallback(n=>{const r=e.current;let o=!1;const s=r.map(i=>{const a=ga(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():ga(r[i],null)}}},[])}zt(sm,"useStableComposedRefs");function Bn(t){return(t==null?void 0:t.animationName)||"none"}zt(Bn,"getAnimationName");function im(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}zt(im,"getElementRef");var CT=Object.defineProperty,ST=(t,e)=>CT(t,"name",{value:e,configurable:!0});function Pc(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}ST(Pc,"usePrevious");var PT=Object.defineProperty,RT=(t,e)=>PT(t,"name",{value:e,configurable:!0}),am=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cm=p.forwardRef(RT(function(e,n){return l.jsx(re.span,{...e,ref:n,style:{...am,...e.style}})},"VisuallyHidden")),TT=cm,MT=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ln=new WeakMap,xo=new WeakMap,bo={},yi=0,lm=function(t){return t&&(t.host||lm(t.parentNode))},ET=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=lm(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},jT=function(t,e,n,r){var o=ET(e,Array.isArray(t)?t:[t]);bo[n]||(bo[n]=new WeakMap);var s=bo[n],i=[],a=new Set,c=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var m=h.getAttribute(r),g=m!==null&&m!=="false",y=(Ln.get(h)||0)+1,v=(s.get(h)||0)+1;Ln.set(h,y),s.set(h,v),i.push(h),y===1&&g&&xo.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(e),a.clear(),yi++,function(){i.forEach(function(f){var h=Ln.get(f)-1,m=s.get(f)-1;Ln.set(f,h),s.set(f,m),h||(xo.has(f)||f.removeAttribute(r),xo.delete(f)),m||f.removeAttribute(n)}),yi--,yi||(Ln=new WeakMap,Ln=new WeakMap,xo=new WeakMap,bo={})}},bs=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=MT(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),jT(r,o,n,"aria-hidden")):function(){return null}},jt=function(){return jt=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},jt.apply(this,arguments)};function um(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function AT(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,s;r<o;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Go="right-scroll-bar-position",zo="width-before-scroll-bar",DT="with-scroll-bars-hidden",IT="--removed-body-scroll-bar-size";function vi(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function kT(t,e){var n=S.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var NT=typeof window<"u"?p.useLayoutEffect:p.useEffect,bd=new WeakMap;function _T(t,e){var n=kT(null,function(r){return t.forEach(function(o){return vi(o,r)})});return NT(function(){var r=bd.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(a){s.has(a)||vi(a,null)}),s.forEach(function(a){o.has(a)||vi(a,i)})}bd.set(n,t)},[t]),n}function OT(t){return t}function LT(t,e){e===void 0&&(e=OT);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var i=e(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function $T(t){t===void 0&&(t={});var e=LT(null);return e.options=jt({async:!0,ssr:!1},t),e}var dm=function(t){var e=t.sideCar,n=um(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,jt({},n))};dm.isSideCarExport=!0;function FT(t,e){return t.useMedium(e),dm}var fm=$T(),xi=function(){},ws=p.forwardRef(function(t,e){var n=p.useRef(null),r=p.useState({onScrollCapture:xi,onWheelCapture:xi,onTouchMoveCapture:xi}),o=r[0],s=r[1],i=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,h=t.sideCar,m=t.noRelative,g=t.noIsolation,y=t.inert,v=t.allowPinchZoom,x=t.as,w=x===void 0?"div":x,b=t.gapMode,C=um(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=h,R=_T([n,e]),M=jt(jt({},C),o);return p.createElement(p.Fragment,null,d&&p.createElement(P,{sideCar:fm,removeScrollBar:u,shards:f,noRelative:m,noIsolation:g,inert:y,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:b}),i?p.cloneElement(p.Children.only(a),jt(jt({},M),{ref:R})):p.createElement(w,jt({},M,{className:c,ref:R}),a))});ws.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ws.classNames={fullWidth:zo,zeroRight:Go};var VT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BT(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=VT();return e&&t.setAttribute("nonce",e),t}function GT(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function zT(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var UT=function(){var t=0,e=null;return{add:function(n){t==0&&(e=BT())&&(GT(e,n),zT(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},HT=function(){var t=UT();return function(e,n){p.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},hm=function(){var t=HT(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},WT={left:0,top:0,right:0,gap:0},bi=function(t){return parseInt(t||"",10)||0},KT=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[bi(n),bi(r),bi(o)]},YT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return WT;var e=KT(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},XT=hm(),Xn="data-scroll-locked",qT=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
174
|
+
*/const nP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wt=xe("x",nP),rP=S.forwardRef(function({color:e="primary",size:n,prefix:r,suffix:o,clearable:s=!1,onClear:i,showPasswordToggle:a=!1,filled:c=!1,type:u="text",disabled:d,className:f,style:h,sx:m,value:g,defaultValue:y,onChange:v,...x},w){const b=g!==void 0,[C,P]=S.useState(y!=null?String(y):""),R=b?String(g??""):C,M=S.useRef(null);S.useImperativeHandle(w,()=>M.current,[]);const[j,T]=S.useState(!1),E=a&&j&&u==="password"?"text":u,k=s&&!d&&R!=="",_=k||a,$=r!=null||o!=null||_,G=O=>{b||P(O.target.value),v==null||v(O)},Q=O=>{var X;O.preventDefault(),b||P("");const D=M.current;if(D){const A=(X=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:X.set;A==null||A.call(D,""),D.dispatchEvent(new Event("input",{bubbles:!0}))}i==null||i()},V=se($?void 0:m,$?void 0:h,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,c&&"filled",f),I=l.jsx("input",{ref:M,type:E,className:V.className,style:V.style,disabled:d,value:b?g:void 0,defaultValue:b?void 0:y,onChange:G,...x});if(!$)return l.jsxs(l.Fragment,{children:[V.styleTag,I]});const L=se(m,h,"cny-input-affix",r!=null&&"has-prefix",o!=null&&!_&&"has-suffix",_&&"has-action");return l.jsxs("span",{className:L.className,style:L.style,children:[L.styleTag,r!=null&&l.jsx("span",{className:"cny-input-prefix",children:r}),I,o!=null&&!_&&l.jsx("span",{className:"cny-input-suffix",children:o}),k&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:Q,"aria-label":"Clear",tabIndex:-1,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})}),a&&u==="password"&&l.jsx("button",{type:"button",className:"cny-input-action",onClick:()=>T(O=>!O),"aria-label":j?"Hide password":"Show password","aria-pressed":j,children:j?l.jsx(LS,{size:14,"aria-hidden":"true"}):l.jsx(FS,{size:14,"aria-hidden":"true"})})]})}),oP=S.forwardRef(function({color:e="default",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,r,"card",e!=="default"&&e,n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),sP={info:Rp,success:Sp,warning:Ep,danger:Cp};function iP({color:t}){const e=sP[t];return l.jsx(e,{size:16,className:"alert-icon-glyph","aria-hidden":"true"})}const aP=S.forwardRef(function({color:e="info",solid:n=!1,title:r,className:o,style:s,sx:i,children:a,icon:c,action:u,onDismiss:d,dismissLabel:f="Dismiss",...h},m){const g=c!==!1,y=c&&c!==!0?c:l.jsx(iP,{color:e}),{className:v,style:x,styleTag:w}=se(i,s,"alert",e,n&&"solid",o),b=e==="danger"?"alert":"status";return l.jsxs("div",{ref:m,role:b,className:v,style:x,...h,children:[w,g&&l.jsx("span",{className:"alert-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"alert-content",children:[r&&l.jsx("p",{className:"alert-title",children:r}),a&&l.jsx("p",{className:"alert-body",children:a})]}),u&&l.jsx("div",{className:"alert-action",children:u}),d&&l.jsx("button",{type:"button",className:"alert-close",onClick:d,"aria-label":f,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})})]})}),cP=S.forwardRef(function({size:e="md",status:n,src:r,alt:o,className:s,style:i,sx:a,children:c,...u},d){const{className:f,style:h,styleTag:m}=se(a,i,"avatar",e!=="md"&&e,n,s);return l.jsxs("span",{ref:d,className:f,style:h,...u,children:[m,r?l.jsx("img",{src:r,alt:o??""}):c]})}),lP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:U("avatar-stack",e),...r,children:n})}),uP=S.forwardRef(function({value:e=0,color:n="primary",indeterminate:r=!1,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d=r?s??{}:{...s??{},"--value":`${u}%`},{className:f,style:h,styleTag:m}=se(i,d,"progress",r&&"indeterminate",n!=="primary"&&n,o);return l.jsxs("div",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r?void 0:u,className:f,style:h,...a,children:[m,l.jsx("span",{className:"progress-bar"})]})}),dP=S.forwardRef(function({value:e,size:n="md",showLabel:r=!0,className:o,style:s,sx:i,...a},c){const u=Math.max(0,Math.min(100,e)),d={...s??{},"--value":u},{className:f,style:h,styleTag:m}=se(i,d,"progress-ring",n==="lg"&&"lg",o);return l.jsxs("span",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":u,className:f,style:h,...a,children:[m,r&&l.jsxs("span",{children:[u,"%"]})]})}),fP={both:{overflowX:"auto",overflowY:"auto"},x:{overflowX:"auto",overflowY:"hidden"},y:{overflowX:"hidden",overflowY:"auto"}},jp=S.forwardRef(function({variant:e="default",tone:n="neutral",axis:r="both",maxHeight:o,maxWidth:s,region:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m={...fP[r],maxHeight:o,maxWidth:s,...c??{}},{className:g,style:y,styleTag:v}=se(u,m,i?"cny-scroll-region":"cny-scroll",e!=="default"&&e,n==="primary"&&"primary",a);return l.jsxs("div",{ref:h,className:g,style:y,...f,children:[v,d]})}),hP=S.forwardRef(function(e,n){return l.jsx(jp,{ref:n,region:!0,...e})}),ia=S.forwardRef(function({shape:e="text",width:n,height:r,className:o,style:s,sx:i,...a},c){const{className:u,style:d,styleTag:f}=se(i,{...s??{},width:n,height:r},"skeleton",e,o);return l.jsx("span",{ref:c,"aria-hidden":"true",className:u,style:d,...a,children:f})}),pP=S.forwardRef(function({solid:e=!1,surface:n="base",className:r,style:o,sx:s,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(s,o,"cny-navbar",e&&"solid",n==="raised"&&"raised",r);return l.jsxs("header",{ref:c,className:u,style:d,...a,children:[f,i]})}),mP=S.forwardRef(function({mark:e=!0,className:n,children:r,...o},s){return l.jsxs("a",{ref:s,className:U("cny-navbar-brand",n),...o,children:[e&&l.jsx("span",{className:"brand-mark","aria-hidden":"true"}),r]})}),gP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("nav",{ref:o,className:U("cny-navbar-nav",e),...r,children:n})}),yP=S.forwardRef(function({active:e=!1,className:n,children:r,...o},s){return l.jsx("a",{ref:s,"aria-current":e?"page":void 0,className:U("cny-navbar-item",e&&"active",n),...o,children:r})}),vP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:U("cny-navbar-actions",e),...r,children:n})}),xP=S.forwardRef(function({open:e=!1,className:n,children:r,"aria-label":o,...s},i){return l.jsx("button",{ref:i,type:"button","aria-expanded":e,"aria-label":o??(e?"Close menu":"Open menu"),className:U("cny-navbar-toggle",n),...s,children:r??l.jsx(XS,{size:20,"aria-hidden":"true"})})}),bP="(max-width: 900px)",wP=S.forwardRef(function({width:e="default",sticky:n=!1,collapsed:r=!1,responsive:o=!1,mobileOpen:s=!1,onMobileOpenChange:i,surface:a="base",className:c,style:u,sx:d,children:f,...h},m){const g=o&&!!i,y=g&&s,v=S.useRef(null);S.useEffect(()=>{var R;if(!y)return;if(typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(bP).matches){const M=((R=v.current)==null?void 0:R.querySelector('[data-cny-sidebar-item][tabindex="0"]'))??v.current;M==null||M.focus()}const P=M=>{M.key==="Escape"&&(i==null||i(!1))};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[y,i]);const{className:x,style:w,styleTag:b}=se(d,u,"cny-sidebar",e!=="default"&&e,n&&"sticky",r&&!y&&"collapsed",o&&"responsive",a==="raised"&&"raised",g&&"mobile-drawer",y&&"mobile-open",c);return l.jsxs(l.Fragment,{children:[g&&l.jsx("div",{className:U("cny-sidebar-backdrop",y&&"open"),"aria-hidden":"true",onClick:()=>i==null?void 0:i(!1)}),l.jsxs("aside",{ref:C=>{v.current=C,typeof m=="function"?m(C):m&&(m.current=C)},tabIndex:g?-1:void 0,className:x,style:w,...h,children:[b,f]})]})}),CP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:U("cny-sidebar-header",e),...r,children:n})}),SP=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("div",{ref:o,className:U("cny-sidebar-footer",e),...r,children:n})}),PP=S.forwardRef(function({collapsed:e=!1,onClick:n,className:r,children:o,...s},i){return l.jsx("button",{ref:i,type:"button","aria-expanded":!e,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:U("cny-sidebar-toggle",e&&"collapsed",r),onClick:n,...s,children:o??l.jsx(JS,{size:16,"aria-hidden":"true"})})});function aa(t){const e=Array.from(t.querySelectorAll("[data-cny-sidebar-item]")),n=[];if(e.forEach(o=>{o.hasAttribute("aria-disabled")?o.setAttribute("tabindex","-1"):n.push(o)}),n.length===0)return;const r=n.find(o=>o.classList.contains("active"))??n[0];n.forEach(o=>o.setAttribute("tabindex",o===r?"0":"-1"))}const RP=S.forwardRef(function({title:e,className:n,children:r,...o},s){const i=S.useRef(null),a=S.useCallback(c=>{const u=i.current;if(!u)return;const f=Array.from(u.querySelectorAll("[data-cny-sidebar-item]")).filter(y=>!y.hasAttribute("aria-disabled"));if(f.length===0)return;const h=f.findIndex(y=>y===document.activeElement);let m=h;switch(c.key){case"ArrowDown":c.preventDefault(),m=h<f.length-1?h+1:0;break;case"ArrowUp":c.preventDefault(),m=h<=0?f.length-1:h-1;break;case"Home":c.preventDefault(),m=0;break;case"End":c.preventDefault(),m=f.length-1;break;default:return}const g=f[m];g&&g!==document.activeElement&&(f.forEach(y=>y.setAttribute("tabindex","-1")),g.setAttribute("tabindex","0"),g.focus())},[]);return S.useLayoutEffect(()=>{const c=i.current;if(!c||(aa(c),typeof MutationObserver>"u"))return;const u=new MutationObserver(()=>aa(c));return u.observe(c,{childList:!0,subtree:!0}),()=>u.disconnect()},[]),l.jsxs("div",{ref:s,className:U("cny-sidebar-section",n),...o,children:[e&&l.jsx("div",{className:"cny-sidebar-title",children:e}),l.jsx("nav",{ref:i,className:"cny-sidebar-nav",onKeyDown:a,children:r})]})}),TP=S.forwardRef(function({active:e=!1,disabled:n=!1,icon:r,badge:o,className:s,children:i,...a},c){const u=S.useRef(null),d=S.useId();S.useLayoutEffect(()=>{const h=u.current;if(!h)return;const m=h.closest('[class*="cny-sidebar-nav"]');m&&aa(m)},[e,n]);const f=typeof i=="string"&&!a["aria-label"]?i:void 0;return l.jsxs("a",{ref:h=>{u.current=h,typeof c=="function"?c(h):c&&(c.current=h)},"data-cny-sidebar-item":d,"aria-current":e?"page":void 0,"aria-disabled":n||void 0,"aria-label":f,className:U("cny-sidebar-item",e&&"active",n&&"disabled",s),...a,children:[r&&l.jsx("span",{className:"cny-sidebar-item-icon","aria-hidden":"true",children:r}),l.jsx("span",{className:"cny-sidebar-item-label",children:i}),o&&l.jsx("span",{className:"cny-sidebar-item-badge",children:o})]})});function MP(t){const e=[];return t.display&&e.push(t.display),t.direction==="row"?e.push("flex-row"):t.direction==="column"?e.push("flex-col"):t.direction==="row-reverse"?e.push("flex-row-reverse"):t.direction==="column-reverse"&&e.push("flex-col-reverse"),t.align&&e.push(`items-${t.align==="start"||t.align==="end",t.align}`),t.justify&&e.push(`justify-${t.justify}`),t.wrap&&e.push("flex-wrap"),t.p!==void 0&&e.push(`p-${t.p}`),t.px!==void 0&&e.push(`px-${t.px}`),t.py!==void 0&&e.push(`py-${t.py}`),t.pt!==void 0&&e.push(`pt-${t.pt}`),t.pr!==void 0&&e.push(`pr-${t.pr}`),t.pb!==void 0&&e.push(`pb-${t.pb}`),t.pl!==void 0&&e.push(`pl-${t.pl}`),t.m!==void 0&&e.push(`m-${t.m}`),t.mx!==void 0&&e.push(`mx-${t.mx}`),t.my!==void 0&&e.push(`my-${t.my}`),t.mt!==void 0&&e.push(`mt-${t.mt}`),t.mr!==void 0&&e.push(`mr-${t.mr}`),t.mb!==void 0&&e.push(`mb-${t.mb}`),t.ml!==void 0&&e.push(`ml-${t.ml}`),t.gap!==void 0&&e.push(`gap-${t.gap}`),t.gapX!==void 0&&e.push(`gap-x-${t.gapX}`),t.gapY!==void 0&&e.push(`gap-y-${t.gapY}`),t.w&&e.push(`w-${t.w}`),t.h&&e.push(`h-${t.h}`),t.grow&&e.push("flex-1"),e}const Dn=S.forwardRef(function({as:e,className:n,style:r,children:o,...s},i){const a=e??"div",{layoutProps:c,domProps:u}=EP(s),{sx:d,...f}=c,h=d?Na(d):void 0,m=U(...MP(f),h==null?void 0:h.className,n),g=h!=null&&h.style||r?{...h==null?void 0:h.style,...r}:void 0,y=S.createElement(a,{ref:i,className:m||void 0,style:g,...u},o);return h!=null&&h.css?S.createElement(S.Fragment,null,S.createElement(ka,{css:h.css}),y):y});function EP(t){const e=new Set(["p","px","py","pt","pr","pb","pl","m","mx","my","mt","mr","mb","ml","gap","gapX","gapY","display","direction","align","justify","wrap","w","h","grow","sx"]),n={},r={};for(const[o,s]of Object.entries(t))e.has(o)?n[o]=s:r[o]=s;return{layoutProps:n,domProps:r}}const jP=S.forwardRef(function(e,n){return l.jsx(Dn,{ref:n,display:"flex",direction:"column",...e})}),AP=S.forwardRef(function(e,n){const{align:r="center",...o}=e;return l.jsx(Dn,{ref:n,display:"flex",direction:"row",align:r,...o})}),sd=t=>t.map(e=>`minmax(0,${e}fr)`).join(" "),DP=S.forwardRef(function({cols:e,minColWidth:n,ratio:r,template:o,className:s,sx:i,...a},c){let u;if(o)u=o;else if(r)if(Array.isArray(r))u=sd(r);else{const f={};for(const[h,m]of Object.entries(r))m&&(f[h]=sd(m));u=f}else n&&(u=`repeat(auto-fit, minmax(${n}, 1fr))`);const d=u?{gridTemplateColumns:u,...i??{}}:i;return l.jsx(Dn,{ref:c,display:"grid",className:U(!u&&e&&`grid-cols-${e}`,s),sx:d,...a})}),IP=S.forwardRef(function({size:e="lg",className:n,...r},o){return l.jsx(Dn,{ref:o,className:U("cny-container",e,n),...r})}),kP=S.forwardRef(function({orientation:e="horizontal",className:n,style:r,sx:o,...s},i){const{className:a,style:c,styleTag:u}=se(o,r,"cny-divider",e,n);return e==="vertical"?l.jsxs(l.Fragment,{children:[u,l.jsx("span",{ref:i,role:"separator","aria-orientation":"vertical",className:a,style:c,...s})]}):l.jsxs(l.Fragment,{children:[u,l.jsx("hr",{ref:i,className:a,style:c,...s})]})}),NP=S.forwardRef(function({className:e,style:n,sx:r,...o},s){const{className:i,style:a,styleTag:c}=se(r,n,"cny-spacer",e);return l.jsx("span",{ref:s,"aria-hidden":"true",className:i,style:a,...o,children:c})}),_P=S.forwardRef(function({ratio:e=16/9,className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,{aspectRatio:String(e),...r},"aspect-ratio",n);return l.jsxs("div",{ref:a,className:c,style:u,...i,children:[d,s]})}),OP=S.forwardRef(function(e,n){return l.jsx(Dn,{ref:n,display:"flex",align:"center",justify:"center",...e})}),LP=S.forwardRef(function(e,n){const{align:r="center",gap:o=2,wrap:s=!0,...i}=e;return l.jsx(Dn,{ref:n,display:"flex",direction:"row",align:r,gap:o,wrap:s,...i})}),$P={display:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",small:"small",caption:"span",code:"code",kbd:"kbd"},FP=S.forwardRef(function({as:e,variant:n="body",weight:r,align:o,color:s,truncate:i=!1,className:a,style:c,sx:u,children:d,...f},h){const m=e??$P[n],{className:g,style:y,styleTag:v}=se(u,c,"cny-text",`cny-text-${n}`,r&&`cny-weight-${r}`,o&&`cny-text-${o}`,s&&`text-${s}`,i&&"truncate",a);return S.createElement(m,{ref:h,className:g,style:y,...f},v,d)});function VP({label:t,hint:e,error:n,required:r=!1,optional:o=!1,counter:s,maxLength:i,state:a,className:c,style:u,sx:d,children:f,...h}){const m=S.useId(),g=S.Children.only(f),y=g.props.id??m,v=n!=null&&n!==!1,x=a??(v?"danger":"default"),w=e||n?`${y}-hint`:void 0,b=S.cloneElement(g,{id:y,"aria-invalid":v||g.props["aria-invalid"]||void 0,"aria-describedby":w??g.props["aria-describedby"],className:U(g.props.className,x!=="default"&&x)}),C=i!=null&&s!=null&&s>i?"danger":"default",{className:P,style:R,styleTag:M}=se(d,u,"cny-field",c);return l.jsxs("div",{className:P,style:R,...h,children:[M,(t!=null||s!=null)&&l.jsxs("div",{className:"cny-field-label-row",children:[t!=null?l.jsxs("label",{htmlFor:y,className:"cny-field-label",children:[t,r&&l.jsx("span",{className:"cny-field-required","aria-hidden":"true",children:"*"}),o&&!r&&l.jsx("span",{className:"cny-field-optional",children:"optional"})]}):l.jsx("span",{}),s!=null&&l.jsx("span",{className:U("cny-field-counter",C==="danger"&&"danger"),"aria-live":"polite",children:i!=null?`${s}/${i}`:s})]}),b,(n||e)&&l.jsx("span",{id:w,className:U("cny-field-hint",x!=="default"&&x),children:n??e})]})}const BP=S.forwardRef(function({color:e="primary",size:n,autoGrow:r=!1,maxRows:o=12,className:s,style:i,sx:a,onChange:c,...u},d){const f=S.useRef(null);S.useImperativeHandle(d,()=>f.current,[]);const h=S.useCallback(()=>{const x=f.current;if(!x||!r)return;x.style.height="auto";const b=parseFloat(getComputedStyle(x).lineHeight||"20")*o;x.style.height=`${Math.min(x.scrollHeight,b)}px`,x.style.overflowY=x.scrollHeight>b?"auto":"hidden"},[r,o]);S.useEffect(()=>{h()},[h,u.value,u.defaultValue]);const m=x=>{c==null||c(x),r&&h()},{className:g,style:y,styleTag:v}=se(a,i,"input",e!=="primary"&&e,n==="sm"||n==="lg"?n:null,r&&"cny-textarea-autogrow",s);return l.jsxs(l.Fragment,{children:[v,l.jsx("textarea",{ref:f,className:g,style:y,onChange:m,...u})]})});var GP=Object.defineProperty,zP=(t,e)=>GP(t,"name",{value:e,configurable:!0});function Ar(t,[e,n]){return Math.min(n,Math.max(e,t))}zP(Ar,"clamp");var UP=Object.defineProperty,Ne=(t,e)=>UP(t,"name",{value:e,configurable:!0}),ca="dismissableLayer.update",HP="dismissableLayer.pointerDownOutside",WP="dismissableLayer.focusOutside",id,Ap=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ur=p.forwardRef(Ne(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...d}=e,f=p.useContext(Ap),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=p.useState({}),v=ie(n,m),x=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=w?x.indexOf(w):-1,C=h?x.indexOf(h):-1,P=f.layersWithOutsidePointerEventsDisabled.size>0,R=C>=b,M=p.useRef(!1),j=Ip(_=>{i==null||i(_),c==null||c(_),_.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(_=>{if(!(_ instanceof Node))return!1;const $=[...f.branches].some(G=>G.contains(_));return R&&!$},[f.branches,R])}),T=kp(_=>{if(o&&M.current)return;const $=_.target;[...f.branches].some(Q=>Q.contains($))||(a==null||a(_),c==null||c(_),_.defaultPrevented||u==null||u())},g),E=h?C===x.length-1:!1,k=Qe(_=>{_.key==="Escape"&&(s==null||s(_),!_.defaultPrevented&&u&&(_.preventDefault(),u()))});return p.useEffect(()=>{if(E)return g.addEventListener("keydown",k,{capture:!0}),()=>g.removeEventListener("keydown",k,{capture:!0})},[g,E,k]),p.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(id=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),la(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=id))}},[h,g,r,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),la())},[h,f]),p.useEffect(()=>{const _=Ne(()=>y({}),"handleUpdate");return document.addEventListener(ca,_),()=>document.removeEventListener(ca,_)},[]),l.jsx(re.div,{...d,ref:v,style:{pointerEvents:P?R?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,T.onFocusCapture),onBlurCapture:H(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,j.onPointerDownCapture)})},"DismissableLayer"));function Dp(){const t=p.useContext(Ap),[e,n]=p.useState(null);return p.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Ne(Dp,"useDismissableLayerSurface");var KP=Ne(()=>!0,"IS_TRUE");function Ip(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=KP}=e,a=Qe(t),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,o.current=!1,d.current.clear()}Ne(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Ne(m,"isOutsideInteractionIntercepted");function g(b){if(!u.current)return;const C=b.target;C instanceof Node&&[...s].some(R=>R.contains(C))||d.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Ne(g,"handleInteractionCapture");function y(b){u.current&&d.current.set(b.type,!1)}Ne(y,"handleInteractionBubble");const v=Ne(b=>{if(b.target&&!c.current){let C=function(){n.removeEventListener("click",f.current);const R=m();h(),R||mc(HP,a,P,{discrete:!0})};if(Ne(C,"handleAndDispatchPointerDownOutsideEvent"),!i(b.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const P={originalEvent:b};u.current=!0,o.current=r&&b.button===0,d.current.clear(),!r||b.button!==0?C():(n.removeEventListener("click",f.current),f.current=C,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const b of x)n.addEventListener(b,g,!0),n.addEventListener(b,y);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const b of x)n.removeEventListener(b,g,!0),n.removeEventListener(b,y)}},[n,a,r,o,s,i]),{onPointerDownCapture:Ne(()=>c.current=!0,"onPointerDownCapture")}}Ne(Ip,"usePointerDownOutside");function kp(t,e=globalThis==null?void 0:globalThis.document){const n=Qe(t),r=p.useRef(!1);return p.useEffect(()=>{const o=Ne(s=>{s.target&&!r.current&&mc(WP,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:Ne(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Ne(()=>r.current=!1,"onBlurCapture")}}Ne(kp,"useFocusOutside");function la(){const t=new CustomEvent(ca);document.dispatchEvent(t)}Ne(la,"dispatchUpdate");function mc(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?dc(o,s):o.dispatchEvent(s)}Ne(mc,"handleAndDispatchCustomEvent");var YP=Object.defineProperty,gc=(t,e)=>YP(t,"name",{value:e,configurable:!0}),yo=0,Pt=null;function XP(t){return ur(),t.children}gc(XP,"FocusGuards");function ur(){p.useEffect(()=>{Pt||(Pt={start:ua(),end:ua()});const{start:t,end:e}=Pt;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),yo++,()=>{yo===1&&(Pt==null||Pt.start.remove(),Pt==null||Pt.end.remove(),Pt=null),yo=Math.max(0,yo-1)}},[])}gc(ur,"useFocusGuards");function ua(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}gc(ua,"createFocusGuard");var qP=Object.defineProperty,Xe=(t,e)=>qP(t,"name",{value:e,configurable:!0}),fi="focusScope.autoFocusOnMount",hi="focusScope.autoFocusOnUnmount",ad={bubbles:!1,cancelable:!0},hs=p.forwardRef(Xe(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[c,u]=p.useState(null),d=Qe(s),f=Qe(i),h=p.useRef(null),m=ie(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(o){let v=function(C){if(g.paused||!c)return;const P=C.target;c.contains(P)?h.current=P:Lt(h.current,{select:!0})},x=function(C){if(g.paused||!c)return;const P=C.relatedTarget;P!==null&&(c.contains(P)||Lt(h.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&Lt(c)};Xe(v,"handleFocusIn"),Xe(x,"handleFocusOut"),Xe(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",x);const b=new MutationObserver(w);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),b.disconnect()}}},[o,c,g.paused]),p.useEffect(()=>{if(c){cd.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(fi,ad);c.addEventListener(fi,d),c.dispatchEvent(w),w.defaultPrevented||(Np(Fp(yc(c)),{select:!0}),document.activeElement===v&&Lt(c))}return()=>{c.removeEventListener(fi,d),setTimeout(()=>{const w=new CustomEvent(hi,ad);c.addEventListener(hi,f),c.dispatchEvent(w),w.defaultPrevented||Lt(v??document.body,{select:!0}),c.removeEventListener(hi,f),cd.remove(g)},0)}}},[c,d,f,g]);const y=p.useCallback(v=>{if(!r&&!o||g.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(x&&w){const b=v.currentTarget,[C,P]=_p(b);C&&P?!v.shiftKey&&w===P?(v.preventDefault(),r&&Lt(C,{select:!0})):v.shiftKey&&w===C&&(v.preventDefault(),r&&Lt(P,{select:!0})):w===b&&v.preventDefault()}},[r,o,g.paused]);return l.jsx(re.div,{tabIndex:-1,...a,ref:m,onKeyDown:y})},"FocusScope"));function Np(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Lt(r,{select:e}),document.activeElement!==n)return}Xe(Np,"focusFirst");function _p(t){const e=yc(t),n=da(e,t),r=da(e.reverse(),t);return[n,r]}Xe(_p,"getTabbableEdges");function yc(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Xe(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}Xe(yc,"getTabbableCandidates");function da(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Op(r,{upTo:e})))return r}Xe(da,"findVisible");function Op(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}Xe(Op,"isHidden");function Lp(t){return t instanceof HTMLInputElement&&"select"in t}Xe(Lp,"isSelectableInput");function Lt(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Lp(t)&&e&&t.select()}}Xe(Lt,"focus");var cd=$p();function $p(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=fa(t,e),t.unshift(e)},remove(e){var n;t=fa(t,e),(n=t[0])==null||n.resume()}}}Xe($p,"createFocusScopesStack");function fa(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Xe(fa,"arrayRemove");function Fp(t){return t.filter(e=>e.tagName!=="A")}Xe(Fp,"removeLinks");const ZP=["top","right","bottom","left"],on=Math.min,at=Math.max,es=Math.round,vo=Math.floor,It=t=>({x:t,y:t}),QP={left:"right",right:"left",bottom:"top",top:"bottom"};function ha(t,e,n){return at(t,on(e,n))}function Bt(t,e){return typeof t=="function"?t(e):t}function Gt(t){return t.split("-")[0]}function dr(t){return t.split("-")[1]}function vc(t){return t==="x"?"y":"x"}function xc(t){return t==="y"?"height":"width"}function At(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function bc(t){return vc(At(t))}function JP(t,e,n){n===void 0&&(n=!1);const r=dr(t),o=bc(t),s=xc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=ts(i)),[i,ts(i)]}function eR(t){const e=ts(t);return[pa(t),e,pa(e)]}function pa(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ld=["left","right"],ud=["right","left"],tR=["top","bottom"],nR=["bottom","top"];function rR(t,e,n){switch(t){case"top":case"bottom":return n?e?ud:ld:e?ld:ud;case"left":case"right":return e?tR:nR;default:return[]}}function oR(t,e,n,r){const o=dr(t);let s=rR(Gt(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(pa)))),s}function ts(t){const e=Gt(t);return QP[e]+t.slice(e.length)}function sR(t){return{top:0,right:0,bottom:0,left:0,...t}}function Vp(t){return typeof t!="number"?sR(t):{top:t,right:t,bottom:t,left:t}}function ns(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function dd(t,e,n){let{reference:r,floating:o}=t;const s=At(e),i=bc(e),a=xc(i),c=Gt(e),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(dr(e)){case"start":m[i]-=h*(n&&u?-1:1);break;case"end":m[i]+=h*(n&&u?-1:1);break}return m}async function iR(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Bt(e,t),g=Vp(m),v=a[h?f==="floating"?"reference":"floating":f],x=ns(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},P=ns(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:c}):w);return{top:(x.top-P.top+g.top)/C.y,bottom:(P.bottom-x.bottom+g.bottom)/C.y,left:(x.left-P.left+g.left)/C.x,right:(P.right-x.right+g.right)/C.x}}const aR=50,cR=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:iR},c=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:f}=dd(u,r,c),h=r,m=0;const g={};for(let y=0;y<s.length;y++){const v=s[y];if(!v)continue;const{name:x,fn:w}=v,{x:b,y:C,data:P,reset:R}=await w({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:u,platform:a,elements:{reference:t,floating:e}});d=b??d,f=C??f,g[x]={...g[x],...P},R&&m<aR&&(m++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(u=R.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:o}):R.rects),{x:d,y:f}=dd(u,h,c)),y=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:g}},lR=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=e,{element:u,padding:d=0}=Bt(t,e)||{};if(u==null)return{};const f=Vp(d),h={x:n,y:r},m=bc(o),g=xc(m),y=await i.getDimensions(u),v=m==="y",x=v?"top":"left",w=v?"bottom":"right",b=v?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[m]-h[m]-s.floating[g],P=h[m]-s.reference[m],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let M=R?R[b]:0;(!M||!await(i.isElement==null?void 0:i.isElement(R)))&&(M=a.floating[b]||s.floating[g]);const j=C/2-P/2,T=M/2-y[g]/2-1,E=on(f[x],T),k=on(f[w],T),_=E,$=M-y[g]-k,G=M/2-y[g]/2+j,Q=ha(_,G,$),V=!c.arrow&&dr(o)!=null&&G!==Q&&s.reference[g]/2-(G<_?E:k)-y[g]/2<0,I=V?G<_?G-_:G-$:0;return{[m]:h[m]+I,data:{[m]:Q,centerOffset:G-Q-I,...V&&{alignmentOffset:I}},reset:V}}}),uR=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=Bt(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Gt(o),w=At(a),b=Gt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),P=h||(b||!y?[ts(a)]:eR(a)),R=g!=="none";!h&&R&&P.push(...oR(a,y,g,C));const M=[a,...P],j=await c.detectOverflow(e,v),T=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&T.push(j[x]),f){const G=JP(o,i,C);T.push(j[G[0]],j[G[1]])}if(E=[...E,{placement:o,overflows:T}],!T.every(G=>G<=0)){var k,_;const G=(((k=s.flip)==null?void 0:k.index)||0)+1,Q=M[G];if(Q&&(!(f==="alignment"?w!==At(Q):!1)||E.every(L=>At(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:G,overflows:E},reset:{placement:Q}};let V=(_=E.filter(I=>I.overflows[0]<=0).sort((I,L)=>I.overflows[1]-L.overflows[1])[0])==null?void 0:_.placement;if(!V)switch(m){case"bestFit":{var $;const I=($=E.filter(L=>{if(R){const O=At(L.placement);return O===w||O==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(O=>O>0).reduce((O,D)=>O+D,0)]).sort((L,O)=>L[1]-O[1])[0])==null?void 0:$[0];I&&(V=I);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function fd(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function hd(t){return ZP.some(e=>t[e]>=0)}const dR=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...s}=Bt(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=fd(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:hd(a)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),a=fd(i,n.floating);return{data:{escapedOffsets:a,escaped:hd(a)}}}default:return{}}}}},Bp=new Set(["left","top"]);async function fR(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Gt(n),a=dr(n),c=At(n)==="y",u=Bp.has(i)?-1:1,d=s&&c?-1:1,f=Bt(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const hR=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=e,c=await fR(e,t);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},pR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:w,y:b}=x;return{x:w,y:b}}},...u}=Bt(t,e),d={x:n,y:r},f=await s.detectOverflow(e,u),h=At(Gt(o)),m=vc(h);let g=d[m],y=d[h];if(i){const x=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=g+f[x],C=g-f[w];g=ha(b,g,C)}if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=y+f[x],C=y-f[w];y=ha(b,y,C)}const v=c.fn({...e,[m]:g,[h]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:i,[h]:a}}}}}},mR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Bt(t,e),d={x:n,y:r},f=At(o),h=vc(f);let m=d[h],g=d[f];const y=Bt(a,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const b=h==="y"?"height":"width",C=s.reference[h]-s.floating[b]+v.mainAxis,P=s.reference[h]+s.reference[b]-v.mainAxis;m<C?m=C:m>P&&(m=P)}if(u){var x,w;const b=h==="y"?"width":"height",C=Bp.has(Gt(o)),P=s.reference[f]-s.floating[b]+(C&&((x=i.offset)==null?void 0:x[f])||0)+(C?0:v.crossAxis),R=s.reference[f]+s.reference[b]+(C?0:((w=i.offset)==null?void 0:w[f])||0)-(C?v.crossAxis:0);g<P?g=P:g>R&&(g=R)}return{[h]:m,[f]:g}}}},gR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:s,platform:i,elements:a}=e,{apply:c=()=>{},...u}=Bt(t,e),d=await i.detectOverflow(e,u),f=Gt(o),h=dr(o),m=At(o)==="y",{width:g,height:y}=s.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const w=y-d.top-d.bottom,b=g-d.left-d.right,C=on(y-d[v],w),P=on(g-d[x],b),R=!e.middlewareData.shift;let M=C,j=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=w),R&&!h){const E=at(d.left,0),k=at(d.right,0),_=at(d.top,0),$=at(d.bottom,0);m?j=g-2*(E!==0||k!==0?E+k:at(d.left,d.right)):M=y-2*(_!==0||$!==0?_+$:at(d.top,d.bottom))}await c({...e,availableWidth:j,availableHeight:M});const T=await i.getDimensions(a.floating);return g!==T.width||y!==T.height?{reset:{rects:!0}}:{}}}};function ps(){return typeof window<"u"}function fr(t){return Gp(t)?(t.nodeName||"").toLowerCase():"#document"}function ct(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function _t(t){var e;return(e=(Gp(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gp(t){return ps()?t instanceof Node||t instanceof ct(t).Node:!1}function xt(t){return ps()?t instanceof Element||t instanceof ct(t).Element:!1}function Kt(t){return ps()?t instanceof HTMLElement||t instanceof ct(t).HTMLElement:!1}function pd(t){return!ps()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ct(t).ShadowRoot}function Hr(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=bt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function yR(t){return/^(table|td|th)$/.test(fr(t))}function ms(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const vR=/transform|translate|scale|rotate|perspective|filter/,xR=/paint|layout|strict|content/,bn=t=>!!t&&t!=="none";let pi;function wc(t){const e=xt(t)?bt(t):t;return bn(e.transform)||bn(e.translate)||bn(e.scale)||bn(e.rotate)||bn(e.perspective)||!Cc()&&(bn(e.backdropFilter)||bn(e.filter))||vR.test(e.willChange||"")||xR.test(e.contain||"")}function bR(t){let e=sn(t);for(;Kt(e)&&!Jn(e);){if(wc(e))return e;if(ms(e))return null;e=sn(e)}return null}function Cc(){return pi==null&&(pi=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pi}function Jn(t){return/^(html|body|#document)$/.test(fr(t))}function bt(t){return ct(t).getComputedStyle(t)}function gs(t){return xt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function sn(t){if(fr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pd(t)&&t.host||_t(t);return pd(e)?e.host:e}function zp(t){const e=sn(t);return Jn(e)?t.ownerDocument?t.ownerDocument.body:t.body:Kt(e)&&Hr(e)?e:zp(e)}function Dr(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=zp(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=ct(o);if(s){const a=ma(i);return e.concat(i,i.visualViewport||[],Hr(o)?o:[],a&&n?Dr(a):[])}else return e.concat(o,Dr(o,[],n))}function ma(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Up(t){const e=bt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Kt(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,a=es(n)!==s||es(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Sc(t){return xt(t)?t:t.contextElement}function Yn(t){const e=Sc(t);if(!Kt(e))return It(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=Up(e);let i=(s?es(n.width):n.width)/r,a=(s?es(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const wR=It(0);function Hp(t){const e=ct(t);return!Cc()||!e.visualViewport?wR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function CR(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ct(t)?!1:e}function Mn(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=Sc(t);let i=It(1);e&&(r?xt(r)&&(i=Yn(r)):i=Yn(t));const a=CR(s,n,r)?Hp(s):It(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const h=ct(s),m=r&&xt(r)?ct(r):r;let g=h,y=ma(g);for(;y&&r&&m!==g;){const v=Yn(y),x=y.getBoundingClientRect(),w=bt(y),b=x.left+(y.clientLeft+parseFloat(w.paddingLeft))*v.x,C=x.top+(y.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=b,u+=C,g=ct(y),y=ma(g)}}return ns({width:d,height:f,x:c,y:u})}function ys(t,e){const n=gs(t).scrollLeft;return e?e.left+n:Mn(_t(t)).left+n}function Wp(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-ys(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function SR(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=_t(r),a=e?ms(e.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=It(1);const d=It(0),f=Kt(r);if((f||!f&&!s)&&((fr(r)!=="body"||Hr(i))&&(c=gs(r)),f)){const m=Mn(r);u=Yn(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=i&&!f&&!s?Wp(i,c):It(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function PR(t){return Array.from(t.getClientRects())}function RR(t){const e=_t(t),n=gs(t),r=t.ownerDocument.body,o=at(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=at(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ys(t);const a=-n.scrollTop;return bt(r).direction==="rtl"&&(i+=at(e.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const md=25;function TR(t,e){const n=ct(t),r=_t(t),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Cc();(!d||d&&e==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=ys(r);if(u<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=md&&(s-=g)}else u<=md&&(s+=u);return{width:s,height:i,x:a,y:c}}function MR(t,e){const n=Mn(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=Kt(t)?Yn(t):It(1),i=t.clientWidth*s.x,a=t.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function gd(t,e,n){let r;if(e==="viewport")r=TR(t,n);else if(e==="document")r=RR(_t(t));else if(xt(e))r=MR(e,n);else{const o=Hp(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return ns(r)}function Kp(t,e){const n=sn(t);return n===e||!xt(n)||Jn(n)?!1:bt(n).position==="fixed"||Kp(n,e)}function ER(t,e){const n=e.get(t);if(n)return n;let r=Dr(t,[],!1).filter(a=>xt(a)&&fr(a)!=="body"),o=null;const s=bt(t).position==="fixed";let i=s?sn(t):t;for(;xt(i)&&!Jn(i);){const a=bt(i),c=wc(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Hr(i)&&!c&&Kp(t,i))?r=r.filter(d=>d!==i):o=a,i=sn(i)}return e.set(t,r),r}function jR(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?ms(e)?[]:ER(e,this._c):[].concat(n),r],a=gd(e,i[0],o);let c=a.top,u=a.right,d=a.bottom,f=a.left;for(let h=1;h<i.length;h++){const m=gd(e,i[h],o);c=at(m.top,c),u=on(m.right,u),d=on(m.bottom,d),f=at(m.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function AR(t){const{width:e,height:n}=Up(t);return{width:e,height:n}}function DR(t,e,n){const r=Kt(e),o=_t(e),s=n==="fixed",i=Mn(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=It(0);function u(){c.x=ys(o)}if(r||!r&&!s)if((fr(e)!=="body"||Hr(o))&&(a=gs(e)),r){const m=Mn(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Wp(o,a):It(0),f=i.left+a.scrollLeft-c.x-d.x,h=i.top+a.scrollTop-c.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function mi(t){return bt(t).position==="static"}function yd(t,e){if(!Kt(t)||bt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return _t(t)===n&&(n=n.ownerDocument.body),n}function Yp(t,e){const n=ct(t);if(ms(t))return n;if(!Kt(t)){let o=sn(t);for(;o&&!Jn(o);){if(xt(o)&&!mi(o))return o;o=sn(o)}return n}let r=yd(t,e);for(;r&&yR(r)&&mi(r);)r=yd(r,e);return r&&Jn(r)&&mi(r)&&!wc(r)?n:r||bR(t)||n}const IR=async function(t){const e=this.getOffsetParent||Yp,n=this.getDimensions,r=await n(t.floating);return{reference:DR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kR(t){return bt(t).direction==="rtl"}const NR={convertOffsetParentRelativeRectToViewportRelativeRect:SR,getDocumentElement:_t,getClippingRect:jR,getOffsetParent:Yp,getElementRects:IR,getClientRects:PR,getDimensions:AR,getScale:Yn,isElement:xt,isRTL:kR};function Xp(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function _R(t,e){let n=null,r;const o=_t(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=t.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(a||e(),!h||!m)return;const g=vo(f),y=vo(o.clientWidth-(d+h)),v=vo(o.clientHeight-(f+m)),x=vo(d),b={rootMargin:-g+"px "+-y+"px "+-v+"px "+-x+"px",threshold:at(0,on(1,c))||1};let C=!0;function P(R){const M=R[0].intersectionRatio;if(M!==c){if(!C)return i();M?i(!1,M):r=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!Xp(u,t.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(P,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,b)}n.observe(t)}return i(!0),s}function OR(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Sc(t),d=o||s?[...u?Dr(u):[],...e?Dr(e):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=u&&a?_R(u,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&m&&e&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(e)})),n()}),u&&!c&&m.observe(u),e&&m.observe(e));let g,y=c?Mn(t):null;c&&v();function v(){const x=Mn(t);y&&!Xp(y,x)&&n(),y=x,g=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const LR=hR,$R=pR,FR=uR,VR=gR,BR=dR,vd=lR,GR=mR,zR=(t,e,n)=>{const r=new Map,o={platform:NR,...n},s={...o.platform,_c:r};return cR(t,e,{...o,platform:s})};var UR=typeof document<"u",HR=function(){},Bo=UR?S.useLayoutEffect:HR;function rs(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!rs(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&t.$$typeof)&&!rs(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function qp(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function xd(t,e){const n=qp(t);return Math.round(e*n)/n}function gi(t){const e=p.useRef(t);return Bo(()=>{e.current=t}),e}function WR(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=t,[d,f]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);rs(h,r)||m(r);const[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useCallback(L=>{L!==R.current&&(R.current=L,y(L))},[]),b=p.useCallback(L=>{L!==M.current&&(M.current=L,x(L))},[]),C=s||g,P=i||v,R=p.useRef(null),M=p.useRef(null),j=p.useRef(d),T=c!=null,E=gi(c),k=gi(o),_=gi(u),$=p.useCallback(()=>{if(!R.current||!M.current)return;const L={placement:e,strategy:n,middleware:h};k.current&&(L.platform=k.current),zR(R.current,M.current,L).then(O=>{const D={...O,isPositioned:_.current!==!1};G.current&&!rs(j.current,D)&&(j.current=D,Lr.flushSync(()=>{f(D)}))})},[h,e,n,k,_]);Bo(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const G=p.useRef(!1);Bo(()=>(G.current=!0,()=>{G.current=!1}),[]),Bo(()=>{if(C&&(R.current=C),P&&(M.current=P),C&&P){if(E.current)return E.current(C,P,$);$()}},[C,P,$,E,T]);const Q=p.useMemo(()=>({reference:R,floating:M,setReference:w,setFloating:b}),[w,b]),V=p.useMemo(()=>({reference:C,floating:P}),[C,P]),I=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!V.floating)return L;const O=xd(V.floating,d.x),D=xd(V.floating,d.y);return a?{...L,transform:"translate("+O+"px, "+D+"px)",...qp(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:D}},[n,a,V.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:$,refs:Q,elements:V,floatingStyles:I}),[d,$,Q,V,I])}const KR=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?vd({element:r.current,padding:o}).fn(n):{}:r?vd({element:r,padding:o}).fn(n):{}}}},YR=(t,e)=>{const n=LR(t);return{name:n.name,fn:n.fn,options:[t,e]}},XR=(t,e)=>{const n=$R(t);return{name:n.name,fn:n.fn,options:[t,e]}},qR=(t,e)=>({fn:GR(t).fn,options:[t,e]}),ZR=(t,e)=>{const n=FR(t);return{name:n.name,fn:n.fn,options:[t,e]}},QR=(t,e)=>{const n=VR(t);return{name:n.name,fn:n.fn,options:[t,e]}},JR=(t,e)=>{const n=BR(t);return{name:n.name,fn:n.fn,options:[t,e]}},eT=(t,e)=>{const n=KR(t);return{name:n.name,fn:n.fn,options:[t,e]}};var tT=Object.defineProperty,nT=(t,e)=>tT(t,"name",{value:e,configurable:!0}),rT=p.forwardRef(nT(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return l.jsx(re.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),oT=rT,sT=Object.defineProperty,iT=(t,e)=>sT(t,"name",{value:e,configurable:!0});function hr(t){const[e,n]=p.useState(void 0);return Ee(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=t.offsetWidth,a=t.offsetHeight;n({width:i,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}iT(hr,"useSize");var aT=Object.defineProperty,$t=(t,e)=>aT(t,"name",{value:e,configurable:!0}),Zp="Popper",[Qp,dn]=Re(Zp),[cT,Jp]=Qp(Zp),lT=$t(t=>{const{__scopePopper:e,children:n}=t,[r,o]=p.useState(null),[s,i]=p.useState(void 0);return l.jsx(cT,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),uT="PopperAnchor",dT=p.forwardRef($t(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=Jp(uT,r),a=p.useRef(null),c=i.onAnchorChange,u=p.useCallback(y=>{a.current=y,y&&c(y)},[c]),d=ie(n,u),f=p.useRef(null);p.useEffect(()=>{if(!o)return;const y=f.current;f.current=o.current,y!==f.current&&c(f.current)});const h=i.placementState&&vs(i.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return o?null:l.jsx(re.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),em="PopperContent",[fT,hT]=Qp(em),pT=p.forwardRef($t(function(e,n){var z,Z,le,ce,F,q,he;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,x=Jp(em,r),[w,b]=p.useState(null),C=ie(n,b),[P,R]=p.useState(null),M=hr(P),j=(M==null?void 0:M.width)??0,T=(M==null?void 0:M.height)??0,E=o+(i!=="center"?"-"+i:""),k=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(d)?d:[d],$=_.length>0,G={padding:k,boundary:_.filter(tm),altBoundary:$},{refs:Q,floatingStyles:V,placement:I,isPositioned:L,middlewareData:O}=WR({strategy:"fixed",placement:E,whileElementsMounted:$t((...ue)=>OR(...ue,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[YR({mainAxis:s+T,alignmentAxis:a}),u&&XR({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?qR():void 0,...G}),u&&ZR({...G}),QR({...G,apply:$t(({elements:ue,rects:He,availableWidth:ve,availableHeight:qe})=>{const{width:gn,height:pe}=He.reference,we=ue.floating.style;we.setProperty("--radix-popper-available-width",`${ve}px`),we.setProperty("--radix-popper-available-height",`${qe}px`),we.setProperty("--radix-popper-anchor-width",`${gn}px`),we.setProperty("--radix-popper-anchor-height",`${pe}px`)},"apply")}),P&&eT({element:P,padding:c}),vT({arrowWidth:j,arrowHeight:T}),m&&JR({strategy:"referenceHidden",...G,boundary:$?G.boundary:void 0})]}),D=x.setPlacementState;Ee(()=>(D(I),()=>{D(void 0)}),[I,D]);const[X,A]=vs(I),B=Qe(y);Ee(()=>{L&&(B==null||B())},[L,B]);const ee=(z=O.arrow)==null?void 0:z.x,K=(Z=O.arrow)==null?void 0:Z.y,W=((le=O.arrow)==null?void 0:le.centerOffset)!==0,[oe,Y]=p.useState();return Ee(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:L?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(ce=O.transformOrigin)==null?void 0:ce.x,(F=O.transformOrigin)==null?void 0:F.y].join(" "),...((q=O.hide)==null?void 0:q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(fT,{scope:r,placedSide:X,placedAlign:A,onArrowChange:R,arrowX:ee,arrowY:K,shouldHideArrow:W,children:l.jsx(re.div,{"data-side":X,"data-align":A,...v,ref:C,style:{...v.style,animation:L?(he=v.style)==null?void 0:he.animation:"none"}})})})},"PopperContent")),mT="PopperArrow",gT={top:"bottom",right:"left",bottom:"top",left:"right"},yT=p.forwardRef($t(function(e,n){const{__scopePopper:r,...o}=e,s=hT(mT,r),i=gT[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(oT,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function tm(t){return t!==null}$t(tm,"isNotNull");var vT=$t(t=>({name:"transformOrigin",options:t,fn(e){var v,x,w;const{placement:n,rects:r,middlewareData:o}=e,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:t.arrowWidth,c=i?0:t.arrowHeight,[u,d]=vs(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,m=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let g="",y="";return u==="bottom"?(g=i?f:`${h}px`,y=`${-c}px`):u==="top"?(g=i?f:`${h}px`,y=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,y=i?f:`${m}px`):u==="left"&&(g=`${r.floating.width+c}px`,y=i?f:`${m}px`),{data:{x:g,y}}}}),"transformOrigin");function vs(t){const[e,n="center"]=t.split("-");return[e,n]}$t(vs,"getSideAndAlignFromPlacement");var Wr=lT,Kr=dT,xs=pT,nm=yT,xT=Object.defineProperty,bT=(t,e)=>xT(t,"name",{value:e,configurable:!0}),Yr=p.forwardRef(bT(function(e,n){var c;const{container:r,...o}=e,[s,i]=p.useState(!1);Ee(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Lr.createPortal(l.jsx(re.div,{...o,ref:n}),a):null},"Portal")),wT=Object.defineProperty,zt=(t,e)=>wT(t,"name",{value:e,configurable:!0});function rm(t,e){return p.useReducer((n,r)=>e[n][r]??n,t)}zt(rm,"useStateMachine");var Ue=zt(t=>{const{present:e,children:n}=t,r=om(e),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=sm(r.ref,im(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null},"Presence");function om(t){const[e,n]=p.useState(),r=p.useRef(null),o=p.useRef(t),s=p.useRef("none"),i=p.useRef(void 0),a=t?"mounted":"unmounted",[c,u]=rm(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=i.current??Bn(r.current),i.current=void 0):s.current="none"},[c]),Ee(()=>{const d=r.current,f=o.current;if(f!==t){const m=s.current,g=Bn(d);t?(i.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),Ee(()=>{if(e){let d;const f=e.ownerDocument.defaultView??window,h=zt(g=>{const v=Bn(r.current).includes(CSS.escape(g.animationName));if(g.target===e&&v&&(u("ANIMATION_END"),!o.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",d=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),m=zt(g=>{g.target===e&&(s.current=Bn(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(d),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,i.current=Bn(f)}else r.current=null;n(d)},[])}}zt(om,"usePresence");function ga(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}zt(ga,"setRef");function sm(...t){const e=p.useRef(t);return e.current=t,p.useCallback(n=>{const r=e.current;let o=!1;const s=r.map(i=>{const a=ga(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():ga(r[i],null)}}},[])}zt(sm,"useStableComposedRefs");function Bn(t){return(t==null?void 0:t.animationName)||"none"}zt(Bn,"getAnimationName");function im(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}zt(im,"getElementRef");var CT=Object.defineProperty,ST=(t,e)=>CT(t,"name",{value:e,configurable:!0});function Pc(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}ST(Pc,"usePrevious");var PT=Object.defineProperty,RT=(t,e)=>PT(t,"name",{value:e,configurable:!0}),am=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cm=p.forwardRef(RT(function(e,n){return l.jsx(re.span,{...e,ref:n,style:{...am,...e.style}})},"VisuallyHidden")),TT=cm,MT=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ln=new WeakMap,xo=new WeakMap,bo={},yi=0,lm=function(t){return t&&(t.host||lm(t.parentNode))},ET=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=lm(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},jT=function(t,e,n,r){var o=ET(e,Array.isArray(t)?t:[t]);bo[n]||(bo[n]=new WeakMap);var s=bo[n],i=[],a=new Set,c=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var m=h.getAttribute(r),g=m!==null&&m!=="false",y=(Ln.get(h)||0)+1,v=(s.get(h)||0)+1;Ln.set(h,y),s.set(h,v),i.push(h),y===1&&g&&xo.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(e),a.clear(),yi++,function(){i.forEach(function(f){var h=Ln.get(f)-1,m=s.get(f)-1;Ln.set(f,h),s.set(f,m),h||(xo.has(f)||f.removeAttribute(r),xo.delete(f)),m||f.removeAttribute(n)}),yi--,yi||(Ln=new WeakMap,Ln=new WeakMap,xo=new WeakMap,bo={})}},bs=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=MT(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),jT(r,o,n,"aria-hidden")):function(){return null}},jt=function(){return jt=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},jt.apply(this,arguments)};function um(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function AT(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,s;r<o;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Go="right-scroll-bar-position",zo="width-before-scroll-bar",DT="with-scroll-bars-hidden",IT="--removed-body-scroll-bar-size";function vi(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function kT(t,e){var n=S.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var NT=typeof window<"u"?p.useLayoutEffect:p.useEffect,bd=new WeakMap;function _T(t,e){var n=kT(null,function(r){return t.forEach(function(o){return vi(o,r)})});return NT(function(){var r=bd.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(a){s.has(a)||vi(a,null)}),s.forEach(function(a){o.has(a)||vi(a,i)})}bd.set(n,t)},[t]),n}function OT(t){return t}function LT(t,e){e===void 0&&(e=OT);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var i=e(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function $T(t){t===void 0&&(t={});var e=LT(null);return e.options=jt({async:!0,ssr:!1},t),e}var dm=function(t){var e=t.sideCar,n=um(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,jt({},n))};dm.isSideCarExport=!0;function FT(t,e){return t.useMedium(e),dm}var fm=$T(),xi=function(){},ws=p.forwardRef(function(t,e){var n=p.useRef(null),r=p.useState({onScrollCapture:xi,onWheelCapture:xi,onTouchMoveCapture:xi}),o=r[0],s=r[1],i=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,h=t.sideCar,m=t.noRelative,g=t.noIsolation,y=t.inert,v=t.allowPinchZoom,x=t.as,w=x===void 0?"div":x,b=t.gapMode,C=um(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=h,R=_T([n,e]),M=jt(jt({},C),o);return p.createElement(p.Fragment,null,d&&p.createElement(P,{sideCar:fm,removeScrollBar:u,shards:f,noRelative:m,noIsolation:g,inert:y,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:b}),i?p.cloneElement(p.Children.only(a),jt(jt({},M),{ref:R})):p.createElement(w,jt({},M,{className:c,ref:R}),a))});ws.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ws.classNames={fullWidth:zo,zeroRight:Go};var VT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BT(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=VT();return e&&t.setAttribute("nonce",e),t}function GT(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function zT(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var UT=function(){var t=0,e=null;return{add:function(n){t==0&&(e=BT())&&(GT(e,n),zT(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},HT=function(){var t=UT();return function(e,n){p.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},hm=function(){var t=HT(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},WT={left:0,top:0,right:0,gap:0},bi=function(t){return parseInt(t||"",10)||0},KT=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[bi(n),bi(r),bi(o)]},YT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return WT;var e=KT(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},XT=hm(),Xn="data-scroll-locked",qT=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
175
175
|
.`.concat(DT,` {
|
|
176
176
|
overflow: hidden `).concat(r,`;
|
|
177
177
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
`)},wd=function(){var t=parseInt(document.body.getAttribute(Xn)||"0",10);return isFinite(t)?t:0},ZT=function(){p.useEffect(function(){return document.body.setAttribute(Xn,(wd()+1).toString()),function(){var t=wd()-1;t<=0?document.body.removeAttribute(Xn):document.body.setAttribute(Xn,t.toString())}},[])},QT=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;ZT();var s=p.useMemo(function(){return YT(o)},[o]);return p.createElement(XT,{styles:qT(s,!e,o,n?"":"!important")})},ya=!1;if(typeof window<"u")try{var wo=Object.defineProperty({},"passive",{get:function(){return ya=!0,!0}});window.addEventListener("test",wo,wo),window.removeEventListener("test",wo,wo)}catch{ya=!1}var $n=ya?{passive:!1}:!1,JT=function(t){return t.tagName==="TEXTAREA"},pm=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!JT(t)&&n[e]==="visible")},e1=function(t){return pm(t,"overflowY")},t1=function(t){return pm(t,"overflowX")},Cd=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=mm(t,r);if(o){var s=gm(t,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},n1=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},r1=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},mm=function(t,e){return t==="v"?e1(e):t1(e)},gm=function(t,e){return t==="v"?n1(e):r1(e)},o1=function(t,e){return t==="h"&&e==="rtl"?-1:1},s1=function(t,e,n,r,o){var s=o1(t,window.getComputedStyle(e).direction),i=s*r,a=n.target,c=e.contains(a),u=!1,d=i>0,f=0,h=0;do{if(!a)break;var m=gm(t,a),g=m[0],y=m[1],v=m[2],x=y-v-s*g;(g||x)&&mm(t,a)&&(f+=x,h+=g);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},Co=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Sd=function(t){return[t.deltaX,t.deltaY]},Pd=function(t){return t&&"current"in t?t.current:t},i1=function(t,e){return t[0]===e[0]&&t[1]===e[1]},a1=function(t){return`
|
|
212
212
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
213
213
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
214
|
-
`)},c1=0,Fn=[];function l1(t){var e=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(c1++)[0],s=p.useState(hm)[0],i=p.useRef(t);p.useEffect(function(){i.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var y=AT([t.lockRef.current],(t.shards||[]).map(Pd),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=p.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!i.current.allowPinchZoom;var x=Co(y),w=n.current,b="deltaX"in y?y.deltaX:w[0]-x[0],C="deltaY"in y?y.deltaY:w[1]-x[1],P,R=y.target,M=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in y&&M==="h"&&R.type==="range")return!1;var j=window.getSelection(),T=j&&j.anchorNode,E=T?T===R||T.contains(R):!1;if(E)return!1;var k=Cd(M,R);if(!k)return!0;if(k?P=M:(P=M==="v"?"h":"v",k=Cd(M,R)),!k)return!1;if(!r.current&&"changedTouches"in y&&(b||C)&&(r.current=P),!P)return!0;var _=r.current||P;return s1(_,v,y,_==="h"?b:C)},[]),c=p.useCallback(function(y){var v=y;if(!(!Fn.length||Fn[Fn.length-1]!==s)){var x="deltaY"in v?Sd(v):Co(v),w=e.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&i1(P.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(Pd).filter(Boolean).filter(function(P){return P.contains(v.target)}),C=b.length>0?a(v,b[0]):!i.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(y,v,x,w){var b={name:y,delta:v,target:x,should:w,shadowParent:u1(x)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(C){return C!==b})},1)},[]),d=p.useCallback(function(y){n.current=Co(y),r.current=void 0},[]),f=p.useCallback(function(y){u(y.type,Sd(y),y.target,a(y,t.lockRef.current))},[]),h=p.useCallback(function(y){u(y.type,Co(y),y.target,a(y,t.lockRef.current))},[]);p.useEffect(function(){return Fn.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,$n),document.addEventListener("touchmove",c,$n),document.addEventListener("touchstart",d,$n),function(){Fn=Fn.filter(function(y){return y!==s}),document.removeEventListener("wheel",c,$n),document.removeEventListener("touchmove",c,$n),document.removeEventListener("touchstart",d,$n)}},[]);var m=t.removeScrollBar,g=t.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:a1(o)}):null,m?p.createElement(QT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function u1(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const d1=FT(fm,l1);var Xr=p.forwardRef(function(t,e){return p.createElement(ws,jt({},t,{ref:e,sideCar:d1}))});Xr.classNames=ws.classNames;var f1=Object.defineProperty,me=(t,e)=>f1(t,"name",{value:e,configurable:!0}),h1=[" ","Enter","ArrowUp","ArrowDown"],p1=[" ","Enter"],er="Select",[Cs,Rc,m1]=cr(er),[In,yN]=Re(er,[m1,dn]),Tc=dn(),[g1,fn]=In(er),[y1,v1]=In(er);function ym(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:g,internal_do_not_use_render:y}=t,v=Tc(e),[x,w]=p.useState(null),[b,C]=p.useState(null),[P,R]=p.useState(!1),M=Ht(u),[j,T]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:er}),[E,k]=Pe({prop:i,defaultProp:a,onChange:c,caller:er}),_=p.useRef(null),$=p.useRef(E);p.useEffect(()=>{const A=g?x==null?void 0:x.ownerDocument.getElementById(g):x==null?void 0:x.form;if(A instanceof HTMLFormElement){const B=me(()=>k($.current),"reset");return A.addEventListener("reset",B),()=>A.removeEventListener("reset",B)}},[g,x,k]);const G=x?!!g||!!x.closest("form"):!0,[Q,V]=p.useState(new Set),I=Fe(),L=Array.from(Q).map(A=>A.props.value).join(";"),O=p.useCallback(A=>{V(B=>new Set(B).add(A))},[]),D=p.useCallback(A=>{V(B=>{const ee=new Set(B);return ee.delete(A),ee})},[]),X={required:m,trigger:x,onTriggerChange:w,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:P,onValueNodeHasChildrenChange:R,contentId:I,value:E,onValueChange:k,open:j,onOpenChange:T,dir:M,triggerPointerDownPosRef:_,disabled:h,name:d,autoComplete:f,form:g,nativeOptions:Q,nativeSelectKey:L,isFormControl:G};return l.jsx(Wr,{...v,children:l.jsx(g1,{scope:e,...X,children:l.jsx(Cs.Provider,{scope:e,children:l.jsx(y1,{scope:e,onNativeOptionAdd:O,onNativeOptionRemove:D,children:bm(y)?y(X):n})})})})}me(ym,"SelectProvider");var x1=me(t=>{const{__scopeSelect:e,children:n,...r}=t;return l.jsx(ym,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>l.jsxs(l.Fragment,{children:[n,o?l.jsx(q1,{__scopeSelect:e}):null]})})},"Select"),b1="SelectTrigger",w1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=Tc(r),a=fn(b1,r),c=a.disabled||o,u=ie(n,a.onTriggerChange),d=Rc(r),f=p.useRef("touch"),[h,m,g]=Mc(v=>{const x=d().filter(C=>!C.disabled),w=x.find(C=>C.value===a.value),b=Ec(x,v,w);b!==void 0&&a.onValueChange(b.value)}),y=me(v=>{c||(a.onOpenChange(!0),g()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})},"handleOpen");return l.jsx(Kr,{asChild:!0,...i,children:l.jsx(re.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":qr(a.value)?"":void 0,...s,ref:u,onClick:H(s.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&y(v)}),onPointerDown:H(s.onPointerDown,v=>{f.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:H(s.onKeyDown,v=>{const x=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(x&&v.key===" ")&&h1.includes(v.key)&&(y(),v.preventDefault())})})})},"SelectTrigger")),C1="SelectValue",S1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:a="",...c}=e,u=fn(C1,r),{onValueNodeHasChildrenChange:d}=u,f=i!==void 0,h=ie(n,u.onValueNodeChange);Ee(()=>{d(f)},[d,f]);const m=qr(u.value);return l.jsx(re.span,{...c,asChild:m?!1:c.asChild,ref:h,style:{pointerEvents:"none"},children:l.jsx(p.Fragment,{children:m?a:i},m?"placeholder":"value")})},"SelectValue")),P1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return l.jsx(re.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),R1="SelectPortal",[T1,M1]=In(R1,{forceMount:void 0}),E1=me(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return l.jsx(T1,{scope:t.__scopeSelect,forceMount:n,children:l.jsx(Yr,{asChild:!0,...r})})},"SelectPortal"),En="SelectContent",j1=p.forwardRef(me(function(e,n){const r=M1(En,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=fn(En,e.__scopeSelect),[a,c]=p.useState();return Ee(()=>{c(new DocumentFragment)},[]),l.jsx(Ue,{present:o||i.open,children:({present:u})=>u?l.jsx(I1,{...s,ref:n}):l.jsx(A1,{...s,fragment:a})})},"SelectContent")),A1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?Lr.createPortal(l.jsx(vm,{scope:r,children:l.jsx(Cs.Slot,{scope:r,children:l.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),gt=10,[vm,Ss]=In(En),D1=Nt("SelectContent.RemoveScroll"),I1=p.forwardRef(me(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:x,...w}=e,b=fn(En,r),[C,P]=p.useState(null),[R,M]=p.useState(null),j=ie(n,P),[T,E]=p.useState(null),[k,_]=p.useState(null),$=Rc(r),[G,Q]=p.useState(!1),V=p.useRef(!1);p.useEffect(()=>{if(C)return bs(C)},[C]),ur();const I=p.useCallback(Y=>{const[z,...Z]=$().map(F=>F.ref.current),[le]=Z.slice(-1),ce=document.activeElement;for(const F of Y)if(F===ce||(F==null||F.scrollIntoView({block:"nearest"}),F===z&&R&&(R.scrollTop=0),F===le&&R&&(R.scrollTop=R.scrollHeight),F==null||F.focus(),document.activeElement!==ce))return},[$,R]),L=p.useCallback(()=>I([T,C]),[I,T,C]);p.useEffect(()=>{G&&L()},[G,L]);const{onOpenChange:O,triggerPointerDownPosRef:D}=b;p.useEffect(()=>{if(C){let Y={x:0,y:0};const z=me(le=>{var ce,F;Y={x:Math.abs(Math.round(le.pageX)-(((ce=D.current)==null?void 0:ce.x)??0)),y:Math.abs(Math.round(le.pageY)-(((F=D.current)==null?void 0:F.y)??0))}},"handlePointerMove"),Z=me(le=>{Y.x<=10&&Y.y<=10?le.preventDefault():le.composedPath().includes(C)||O(!1),document.removeEventListener("pointermove",z),D.current=null},"handlePointerUp");return D.current!==null&&(document.addEventListener("pointermove",z),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",Z,{capture:!0})}}},[C,O,D]),p.useEffect(()=>{const Y=me(()=>O(!1),"close");return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[O]);const[X,A]=Mc(Y=>{const z=$().filter(ce=>!ce.disabled),Z=z.find(ce=>ce.ref.current===document.activeElement),le=Ec(z,Y,Z);le&&setTimeout(()=>{var ce;return(ce=le.ref.current)==null?void 0:ce.focus()})}),B=p.useCallback((Y,z,Z)=>{const le=!V.current&&!Z;(b.value!==void 0&&b.value===z||le)&&(E(Y),le&&(V.current=!0))},[b.value]),ee=p.useCallback(()=>C==null?void 0:C.focus(),[C]),K=p.useCallback((Y,z,Z)=>{const le=!V.current&&!Z;(b.value!==void 0&&b.value===z||le)&&_(Y)},[b.value]),W=o==="popper"?Rd:k1,oe=W===Rd?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:x}:{};return l.jsx(vm,{scope:r,content:C,viewport:R,onViewportChange:M,itemRefCallback:B,selectedItem:T,onItemLeave:ee,itemTextRefCallback:K,focusSelectedItem:L,selectedItemText:k,position:o,isPositioned:G,searchRef:X,children:l.jsx(Xr,{as:D1,allowPinchZoom:!0,children:l.jsx(hs,{asChild:!0,trapped:b.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:H(s,Y=>{var z;(z=b.trigger)==null||z.focus({preventScroll:!0}),Y.preventDefault()}),children:l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(W,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:Y=>Y.preventDefault(),...w,...oe,onPlaced:()=>Q(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:H(w.onKeyDown,Y=>{const z=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!z&&Y.key.length===1&&A(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let le=$().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ce=Y.target,F=le.indexOf(ce);le=le.slice(F+1)}setTimeout(()=>I(le)),Y.preventDefault()}})})})})})})},"SelectContentImpl")),k1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=fn(En,r),a=Ss(En,r),[c,u]=p.useState(null),[d,f]=p.useState(null),h=ie(n,f),m=Rc(r),g=p.useRef(!1),y=p.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:w,focusSelectedItem:b}=a,C=p.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&v&&x&&w){const j=i.trigger.getBoundingClientRect(),T=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),k=w.getBoundingClientRect();if(i.dir!=="rtl"){const ce=k.left-T.left,F=E.left-ce,q=j.left-F,he=j.width+q,ue=Math.max(he,T.width),He=window.innerWidth-gt,ve=Ar(F,[gt,Math.max(gt,He-ue)]);c.style.minWidth=he+"px",c.style.left=ve+"px"}else{const ce=T.right-k.right,F=window.innerWidth-E.right-ce,q=window.innerWidth-j.right-F,he=j.width+q,ue=Math.max(he,T.width),He=window.innerWidth-gt,ve=Ar(F,[gt,Math.max(gt,He-ue)]);c.style.minWidth=he+"px",c.style.right=ve+"px"}const _=m(),$=window.innerHeight-gt*2,G=v.scrollHeight,Q=window.getComputedStyle(d),V=parseInt(Q.borderTopWidth,10),I=parseInt(Q.paddingTop,10),L=parseInt(Q.borderBottomWidth,10),O=parseInt(Q.paddingBottom,10),D=V+I+G+O+L,X=Math.min(x.offsetHeight*5,D),A=window.getComputedStyle(v),B=parseInt(A.paddingTop,10),ee=parseInt(A.paddingBottom,10),K=j.top+j.height/2-gt,W=$-K,oe=x.offsetHeight/2,Y=x.offsetTop+oe,z=V+I+Y,Z=D-z;if(z<=K){const ce=_.length>0&&x===_[_.length-1].ref.current;c.style.bottom="0px";const F=d.clientHeight-v.offsetTop-v.offsetHeight,q=Math.max(W,oe+(ce?ee:0)+F+L),he=z+q;c.style.height=he+"px"}else{const ce=_.length>0&&x===_[0].ref.current;c.style.top="0px";const q=Math.max(K,V+v.offsetTop+(ce?B:0)+oe)+Z;c.style.height=q+"px",v.scrollTop=z-K+v.offsetTop}c.style.margin=`${gt}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=$+"px",o==null||o(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,c,d,v,x,w,i.dir,o]);Ee(()=>C(),[C]);const[P,R]=p.useState();Ee(()=>{d&&R(window.getComputedStyle(d).zIndex)},[d]);const M=p.useCallback(j=>{j&&y.current===!0&&(C(),b==null||b(),y.current=!1)},[C,b]);return l.jsx(N1,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:M,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:l.jsx(re.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),Rd=p.forwardRef(me(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=gt,...i}=e,a=Tc(r);return l.jsx(xs,{...a,...i,ref:n,align:o,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[N1,_1]=In(En,{}),Td="SelectViewport",O1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=Ss(Td,r),a=_1(Td,r),c=ie(n,i.onViewportChange),u=p.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Cs.Slot,{scope:r,children:l.jsx(re.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:H(s.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&h){const g=Math.abs(u.current-f.scrollTop);if(g>0){const y=window.innerHeight-gt*2,v=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),w=Math.max(v,x);if(w<y){const b=w+g,C=Math.min(y,b),P=b-C;h.style.height=C+"px",h.style.bottom==="0px"&&(f.scrollTop=P>0?P:0,h.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})},"SelectViewport")),L1="SelectGroup",[$1,F1]=In(L1),V1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e,s=Fe();return l.jsx($1,{scope:r,id:s,children:l.jsx(re.div,{role:"group","aria-labelledby":s,...o,ref:n})})},"SelectGroup")),B1="SelectLabel",G1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e,s=F1(B1,r);return l.jsx(re.div,{id:s.id,...o,ref:n})},"SelectLabel")),va="SelectItem",[z1,xm]=In(va),U1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...a}=e,c=fn(va,r),u=Ss(va,r),d=c.value===o,[f,h]=p.useState(i??""),[m,g]=p.useState(!1),y=Qe(C=>{var P;return(P=u.itemRefCallback)==null?void 0:P.call(u,C,o,s)}),v=ie(n,y),x=Fe(),w=p.useRef("touch"),b=me(()=>{s||(c.onValueChange(o),c.onOpenChange(!1))},"handleSelect");return l.jsx(z1,{scope:r,value:o,disabled:s,textId:x,isSelected:d,onItemTextChange:p.useCallback(C=>{h(P=>P||((C==null?void 0:C.textContent)??"").trim())},[]),children:l.jsx(Cs.ItemSlot,{scope:r,value:o,disabled:s,textValue:f,children:l.jsx(re.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:v,onFocus:H(a.onFocus,()=>g(!0)),onBlur:H(a.onBlur,()=>g(!1)),onClick:H(a.onClick,()=>{w.current!=="mouse"&&b()}),onPointerUp:H(a.onPointerUp,()=>{w.current==="mouse"&&b()}),onPointerDown:H(a.onPointerDown,C=>{w.current=C.pointerType}),onPointerMove:H(a.onPointerMove,C=>{var P;w.current=C.pointerType,s?(P=u.onItemLeave)==null||P.call(u):w.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(a.onPointerLeave,C=>{var P;C.currentTarget===document.activeElement&&((P=u.onItemLeave)==null||P.call(u))}),onKeyDown:H(a.onKeyDown,C=>{var R;s||C.target!==C.currentTarget||((R=u.searchRef)==null?void 0:R.current)!==""&&C.key===" "||(p1.includes(C.key)&&b(),C.key===" "&&C.preventDefault())})})})})},"SelectItem")),So="SelectItemText",H1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,a=fn(So,r),c=Ss(So,r),u=xm(So,r),d=v1(So,r),[f,h]=p.useState(null),m=Qe(b=>{var C;return(C=c.itemTextRefCallback)==null?void 0:C.call(c,b,u.value,u.disabled)}),g=ie(n,h,u.onItemTextChange,m),y=f==null?void 0:f.textContent,v=p.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=d;return Ee(()=>(x(v),()=>w(v)),[x,w,v]),l.jsxs(l.Fragment,{children:[l.jsx(re.span,{id:u.textId,...i,ref:g}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!qr(a.value)?Lr.createPortal(i.children,a.valueNode):null]})},"SelectItemText")),W1="SelectItemIndicator",K1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e;return xm(W1,r).isSelected?l.jsx(re.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),Y1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e;return l.jsx(re.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),X1="SelectBubbleInput",q1=p.forwardRef(me(function({__scopeSelect:e,...n},r){const o=fn(X1,e),{value:s,onValueChange:i,required:a,disabled:c,name:u,autoComplete:d,form:f}=o,{nativeOptions:h,nativeSelectKey:m}=o,g=p.useRef(null),y=ie(r,g),v=s??"",x=Pc(v),w=Array.from(h).some(b=>(b.props.value??"")==="");return p.useEffect(()=>{const b=g.current;if(!b)return;const C=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(C,"value").set;if(x!==v&&R){const M=new Event("change",{bubbles:!0});R.call(b,v),b.dispatchEvent(M)}},[x,v]),l.jsxs(re.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:u,autoComplete:d,disabled:c,form:f,onChange:b=>i(b.target.value),...n,style:{...am,...n.style},ref:y,defaultValue:v,children:[qr(s)&&!w?l.jsx("option",{value:""}):null,Array.from(h)]},m)},"SelectBubbleInput"));function bm(t){return typeof t=="function"}me(bm,"isFunction");function qr(t){return t===""||t===void 0}me(qr,"shouldShowPlaceholder");function Mc(t){const e=Qe(t),n=p.useRef(""),r=p.useRef(0),o=p.useCallback(i=>{const a=n.current+i;e(a),me((function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}),"updateSearch")(a)},[e]),s=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}me(Mc,"useTypeaheadSearch");function Ec(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=wm(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}me(Ec,"findNextItem");function wm(t,e){return t.map((n,r)=>t[(e+r)%t.length])}me(wm,"wrapArray");function Z1({placeholder:t,size:e,color:n="primary",triggerIcon:r,triggerClassName:o,contentClassName:s,id:i,className:a,style:c,sx:u,disabled:d,children:f,"aria-invalid":h,"aria-describedby":m,...g}){const{className:y,style:v,styleTag:x}=se(u,c,"cny-select-trigger",e==="sm"||e==="lg"?e:null,n!=="primary"&&n,a,o),w=Ia();return l.jsxs(x1,{disabled:d,...g,children:[l.jsxs(w1,{id:i,"aria-invalid":h,"aria-describedby":m,className:y,style:v,children:[x,r&&l.jsx("span",{style:{display:"inline-flex"},children:r}),l.jsx(S1,{placeholder:t}),l.jsx(P1,{className:"cny-select-chevron",asChild:!0,children:l.jsx(zr,{size:14,"aria-hidden":"true"})})]}),l.jsx(E1,{children:l.jsx(j1,{position:"popper",sideOffset:4,className:U("cny-select-content",s),children:l.jsx(O1,{className:"cny-select-viewport",nonce:w,children:f})})})]})}const Q1=S.forwardRef(function({className:e,children:n,...r},o){return l.jsxs(U1,{ref:o,className:U("cny-select-item",e),...r,children:[l.jsx(H1,{children:n}),l.jsx(K1,{className:"cny-select-indicator",children:l.jsx(rn,{size:14,"aria-hidden":"true"})})]})}),J1=S.forwardRef(function(e,n){return l.jsx(V1,{ref:n,...e})}),eM=S.forwardRef(function({className:e,...n},r){return l.jsx(G1,{ref:r,className:U("cny-select-group-label",e),...n})}),tM=S.forwardRef(function({className:e,...n},r){return l.jsx(Y1,{ref:r,className:U("cny-select-separator",e),...n})});var nM=Object.defineProperty,Ct=(t,e)=>nM(t,"name",{value:e,configurable:!0}),jc="Popover",[Cm,vN]=Re(jc,[dn]),Zr=dn(),[rM,hn]=Cm(jc),oM=Ct(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=t,a=Zr(e),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:jc});return l.jsx(Wr,{...a,children:l.jsx(rM,{scope:e,contentId:Fe(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:i,children:n})})},"Popover"),sM="PopoverAnchor",iM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(sM,r),i=Zr(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=s;return p.useEffect(()=>(a(),()=>c()),[a,c]),l.jsx(Kr,{...i,...o,ref:n})},"PopoverAnchor")),aM="PopoverTrigger",cM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(aM,r),i=Zr(r),a=ie(n,s.triggerRef),c=l.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Ac(s.open),...o,ref:a,onClick:H(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:l.jsx(Kr,{asChild:!0,...i,children:c})},"PopoverTrigger")),Sm="PopoverPortal",[lM,uM]=Cm(Sm,{forceMount:void 0}),dM=Ct(t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,s=hn(Sm,e);return l.jsx(lM,{scope:e,forceMount:n,children:l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:r})})})},"PopoverPortal"),Ir="PopoverContent",fM=p.forwardRef(Ct(function(e,n){const r=uM(Ir,e.__scopePopover),{forceMount:o=r.forceMount,...s}=e,i=hn(Ir,e.__scopePopover);return l.jsx(Ue,{present:o||i.open,children:i.modal?l.jsx(pM,{...s,ref:n}):l.jsx(mM,{...s,ref:n})})},"PopoverContent")),hM=Nt("PopoverContent.RemoveScroll"),pM=p.forwardRef(Ct(function(e,n){const r=hn(Ir,e.__scopePopover),o=p.useRef(null),s=ie(n,o),i=p.useRef(!1);return p.useEffect(()=>{const a=o.current;if(a)return bs(a)},[]),l.jsx(Xr,{as:hM,allowPinchZoom:!0,children:l.jsx(Pm,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),i.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),mM=p.forwardRef(Ct(function(e,n){const r=hn(Ir,e.__scopePopover),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Pm,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"PopoverContentNonModal")),Pm=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=e,m=hn(Ir,r),g=Zr(r);return ur(),l.jsx(hs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:l.jsx(xs,{"data-state":Ac(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),gM="PopoverClose",yM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(gM,r);return l.jsx(re.button,{type:"button",...o,ref:n,onClick:H(e.onClick,()=>s.onOpenChange(!1))})},"PopoverClose")),vM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=Zr(r);return l.jsx(nm,{...s,...o,ref:n})},"PopoverArrow"));function Ac(t){return t?"open":"closed"}Ct(Ac,"getState");var Dc=oM,xM=iM,Ic=cM,kc=dM,Nc=fM,bM=yM,wM=vM,Md=1,CM=.9,SM=.8,PM=.17,wi=.1,Ci=.999,RM=.9999,TM=.99,MM=/[\\\/_+.#"@\[\(\{&]/,EM=/[\\\/_+.#"@\[\(\{&]/g,jM=/[\s-]/,Rm=/[\s-]/g;function xa(t,e,n,r,o,s,i){if(s===e.length)return o===t.length?Md:TM;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),u=n.indexOf(c,o),d=0,f,h,m,g;u>=0;)f=xa(t,e,n,r,u+1,s+1,i),f>d&&(u===o?f*=Md:MM.test(t.charAt(u-1))?(f*=SM,m=t.slice(o,u-1).match(EM),m&&o>0&&(f*=Math.pow(Ci,m.length))):jM.test(t.charAt(u-1))?(f*=CM,g=t.slice(o,u-1).match(Rm),g&&o>0&&(f*=Math.pow(Ci,g.length))):(f*=PM,o>0&&(f*=Math.pow(Ci,u-o))),t.charAt(u)!==e.charAt(s)&&(f*=RM)),(f<wi&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=xa(t,e,n,r,u+1,s+2,i),h*wi>f&&(f=h*wi)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[a]=d,d}function Ed(t){return t.toLowerCase().replace(Rm," ")}function AM(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,xa(t,e,Ed(t),Ed(e),0,0,{})}var DM=Object.defineProperty,ut=(t,e)=>DM(t,"name",{value:e,configurable:!0}),_c="Dialog",[Tm,xN]=Re(_c),[IM,St]=Tm(_c),Oc=ut(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,a=p.useRef(null),c=p.useRef(null),[u,d]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:_c}),[f,h]=p.useState(0),[m,g]=p.useState(0);return l.jsx(IM,{scope:e,triggerRef:a,contentRef:c,contentId:Fe(),titleId:Fe(),descriptionId:Fe(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:h,setDescriptionCount:g,open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(y=>!y),[d]),modal:i,children:n})},"Dialog"),kM="DialogTrigger",Mm=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(kM,r),i=ie(n,s.triggerRef);return l.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Rs(s.open),...o,ref:i,onClick:H(e.onClick,s.onOpenToggle)})},"DialogTrigger")),Em="DialogPortal",[NM,jm]=Tm(Em,{forceMount:void 0}),Lc=ut(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=St(Em,e);return l.jsx(NM,{scope:e,forceMount:n,children:p.Children.map(r,i=>l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),ba="DialogOverlay",$c=p.forwardRef(ut(function(e,n){const r=jm(ba,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=St(ba,e.__scopeDialog);return i.modal?l.jsx(Ue,{present:o||i.open,children:l.jsx(OM,{...s,ref:n})}):null},"DialogOverlay")),_M=Nt("DialogOverlay.RemoveScroll"),OM=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(ba,r),i=Dp(),a=ie(n,i);return l.jsx(Xr,{as:_M,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(re.div,{"data-state":Rs(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),kr="DialogContent",Fc=p.forwardRef(ut(function(e,n){const r=jm(kr,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=St(kr,e.__scopeDialog);return l.jsx(Ue,{present:o||i.open,children:i.modal?l.jsx(LM,{...s,ref:n}):l.jsx($M,{...s,ref:n})})},"DialogContent")),LM=p.forwardRef(ut(function(e,n){const r=St(kr,e.__scopeDialog),o=p.useRef(null),s=ie(n,r.contentRef,o);return p.useEffect(()=>{const i=o.current;if(i)return bs(i)},[]),l.jsx(Am,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),$M=p.forwardRef(ut(function(e,n){const r=St(kr,e.__scopeDialog),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Am,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Am=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,c=St(kr,r);return ur(),l.jsx(l.Fragment,{children:l.jsx(hs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(Ur,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Rs(c.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),FM="DialogTitle",Vc=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(FM,r),{setTitleCount:i}=s;return Ee(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(re.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),VM="DialogDescription",Bc=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(VM,r),{setDescriptionCount:i}=s;return Ee(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(re.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),BM="DialogClose",Ps=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(BM,r);return l.jsx(re.button,{type:"button",...o,ref:n,onClick:H(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Rs(t){return t?"open":"closed"}ut(Rs,"getState");function jd(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function tr(...t){return e=>{let n=!1;const r=t.map(o=>{const s=jd(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():jd(t[o],null)}}}}function GM(t){const e=zM(t),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),c=a.find(HM);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return l.jsx(e,{...i,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return l.jsx(e,{...i,ref:o,children:s})});return n.displayName=`${t}.Slot`,n}function zM(t){const e=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=KM(o),a=WM(s,o.props);return o.type!==p.Fragment&&(a.ref=r?tr(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var UM=Symbol("radix.slottable");function HM(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===UM}function WM(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}function KM(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var YM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pn=YM.reduce((t,e)=>{const n=GM(`Primitive.${e}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),XM=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},qM=p[" useId ".trim().toString()]||(()=>{}),ZM=0;function qn(t){const[e,n]=p.useState(qM());return XM(()=>{n(r=>r??String(ZM++))},[t]),e?`radix-${e}`:""}var vr='[cmdk-group=""]',Si='[cmdk-group-items=""]',QM='[cmdk-group-heading=""]',Dm='[cmdk-item=""]',Ad=`${Dm}:not([aria-disabled="true"])`,wa="cmdk-item-select",Gn="data-value",JM=(t,e,n)=>AM(t,e,n),Im=p.createContext(void 0),Qr=()=>p.useContext(Im),km=p.createContext(void 0),Gc=()=>p.useContext(km),Nm=p.createContext(void 0),_m=p.forwardRef((t,e)=>{let n=zn(()=>{var A,B;return{search:"",value:(B=(A=t.value)!=null?A:t.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=zn(()=>new Set),o=zn(()=>new Map),s=zn(()=>new Map),i=zn(()=>new Set),a=Om(t),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:g,disablePointerSelection:y=!1,vimBindings:v=!0,...x}=t,w=qn(),b=qn(),C=qn(),P=p.useRef(null),R=uE();jn(()=>{if(d!==void 0){let A=d.trim();n.current.value=A,M.emit()}},[d]),jn(()=>{R(6,$)},[]);let M=p.useMemo(()=>({subscribe:A=>(i.current.add(A),()=>i.current.delete(A)),snapshot:()=>n.current,setState:(A,B,ee)=>{var K,W,oe,Y;if(!Object.is(n.current[A],B)){if(n.current[A]=B,A==="search")_(),E(),R(1,k);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let z=document.getElementById(C);z?z.focus():(K=document.getElementById(w))==null||K.focus()}if(R(7,()=>{var z;n.current.selectedItemId=(z=G())==null?void 0:z.id,M.emit()}),ee||R(5,$),((W=a.current)==null?void 0:W.value)!==void 0){let z=B??"";(Y=(oe=a.current).onValueChange)==null||Y.call(oe,z);return}}M.emit()}},emit:()=>{i.current.forEach(A=>A())}}),[]),j=p.useMemo(()=>({value:(A,B,ee)=>{var K;B!==((K=s.current.get(A))==null?void 0:K.value)&&(s.current.set(A,{value:B,keywords:ee}),n.current.filtered.items.set(A,T(B,ee)),R(2,()=>{E(),M.emit()}))},item:(A,B)=>(r.current.add(A),B&&(o.current.has(B)?o.current.get(B).add(A):o.current.set(B,new Set([A]))),R(3,()=>{_(),E(),n.current.value||k(),M.emit()}),()=>{s.current.delete(A),r.current.delete(A),n.current.filtered.items.delete(A);let ee=G();R(4,()=>{_(),(ee==null?void 0:ee.getAttribute("id"))===A&&k(),M.emit()})}),group:A=>(o.current.has(A)||o.current.set(A,new Set),()=>{s.current.delete(A),o.current.delete(A)}),filter:()=>a.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:C,labelId:b,listInnerRef:P}),[]);function T(A,B){var ee,K;let W=(K=(ee=a.current)==null?void 0:ee.filter)!=null?K:JM;return A?W(A,n.current.search,B):0}function E(){if(!n.current.search||a.current.shouldFilter===!1)return;let A=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(K=>{let W=o.current.get(K),oe=0;W.forEach(Y=>{let z=A.get(Y);oe=Math.max(z,oe)}),B.push([K,oe])});let ee=P.current;Q().sort((K,W)=>{var oe,Y;let z=K.getAttribute("id"),Z=W.getAttribute("id");return((oe=A.get(Z))!=null?oe:0)-((Y=A.get(z))!=null?Y:0)}).forEach(K=>{let W=K.closest(Si);W?W.appendChild(K.parentElement===W?K:K.closest(`${Si} > *`)):ee.appendChild(K.parentElement===ee?K:K.closest(`${Si} > *`))}),B.sort((K,W)=>W[1]-K[1]).forEach(K=>{var W;let oe=(W=P.current)==null?void 0:W.querySelector(`${vr}[${Gn}="${encodeURIComponent(K[0])}"]`);oe==null||oe.parentElement.appendChild(oe)})}function k(){let A=Q().find(ee=>ee.getAttribute("aria-disabled")!=="true"),B=A==null?void 0:A.getAttribute(Gn);M.setState("value",B||void 0)}function _(){var A,B,ee,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let W=0;for(let oe of r.current){let Y=(B=(A=s.current.get(oe))==null?void 0:A.value)!=null?B:"",z=(K=(ee=s.current.get(oe))==null?void 0:ee.keywords)!=null?K:[],Z=T(Y,z);n.current.filtered.items.set(oe,Z),Z>0&&W++}for(let[oe,Y]of o.current)for(let z of Y)if(n.current.filtered.items.get(z)>0){n.current.filtered.groups.add(oe);break}n.current.filtered.count=W}function $(){var A,B,ee;let K=G();K&&(((A=K.parentElement)==null?void 0:A.firstChild)===K&&((ee=(B=K.closest(vr))==null?void 0:B.querySelector(QM))==null||ee.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function G(){var A;return(A=P.current)==null?void 0:A.querySelector(`${Dm}[aria-selected="true"]`)}function Q(){var A;return Array.from(((A=P.current)==null?void 0:A.querySelectorAll(Ad))||[])}function V(A){let B=Q()[A];B&&M.setState("value",B.getAttribute(Gn))}function I(A){var B;let ee=G(),K=Q(),W=K.findIndex(Y=>Y===ee),oe=K[W+A];(B=a.current)!=null&&B.loop&&(oe=W+A<0?K[K.length-1]:W+A===K.length?K[0]:K[W+A]),oe&&M.setState("value",oe.getAttribute(Gn))}function L(A){let B=G(),ee=B==null?void 0:B.closest(vr),K;for(;ee&&!K;)ee=A>0?cE(ee,vr):lE(ee,vr),K=ee==null?void 0:ee.querySelector(Ad);K?M.setState("value",K.getAttribute(Gn)):I(A)}let O=()=>V(Q().length-1),D=A=>{A.preventDefault(),A.metaKey?O():A.altKey?L(1):I(1)},X=A=>{A.preventDefault(),A.metaKey?V(0):A.altKey?L(-1):I(-1)};return p.createElement(pn.div,{ref:e,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:A=>{var B;(B=x.onKeyDown)==null||B.call(x,A);let ee=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||ee))switch(A.key){case"n":case"j":{v&&A.ctrlKey&&D(A);break}case"ArrowDown":{D(A);break}case"p":case"k":{v&&A.ctrlKey&&X(A);break}case"ArrowUp":{X(A);break}case"Home":{A.preventDefault(),V(0);break}case"End":{A.preventDefault(),O();break}case"Enter":{A.preventDefault();let K=G();if(K){let W=new Event(wa);K.dispatchEvent(W)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:fE},c),Ts(t,A=>p.createElement(km.Provider,{value:M},p.createElement(Im.Provider,{value:j},A))))}),eE=p.forwardRef((t,e)=>{var n,r;let o=qn(),s=p.useRef(null),i=p.useContext(Nm),a=Qr(),c=Om(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;jn(()=>{if(!u)return a.item(o,i==null?void 0:i.id)},[u]);let d=Lm(o,s,[t.value,t.children,s],t.keywords),f=Gc(),h=an(R=>R.value&&R.value===d.current),m=an(R=>u||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);p.useEffect(()=>{let R=s.current;if(!(!R||t.disabled))return R.addEventListener(wa,g),()=>R.removeEventListener(wa,g)},[m,t.onSelect,t.disabled]);function g(){var R,M;y(),(M=(R=c.current).onSelect)==null||M.call(R,d.current)}function y(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:v,value:x,onSelect:w,forceMount:b,keywords:C,...P}=t;return p.createElement(pn.div,{ref:tr(s,e),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||a.getDisablePointerSelection()?void 0:y,onClick:v?void 0:g},t.children)}),tE=p.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...s}=t,i=qn(),a=p.useRef(null),c=p.useRef(null),u=qn(),d=Qr(),f=an(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);jn(()=>d.group(i),[]),Lm(i,a,[t.value,t.heading,c]);let h=p.useMemo(()=>({id:i,forceMount:o}),[o]);return p.createElement(pn.div,{ref:tr(a,e),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Ts(t,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},p.createElement(Nm.Provider,{value:h},m))))}),nE=p.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=p.useRef(null),s=an(i=>!i.search);return!n&&!s?null:p.createElement(pn.div,{ref:tr(o,e),...r,"cmdk-separator":"",role:"separator"})}),rE=p.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,s=Gc(),i=an(u=>u.search),a=an(u=>u.selectedItemId),c=Qr();return p.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),p.createElement(pn.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":a,id:c.inputId,type:"text",value:o?t.value:i,onChange:u=>{o||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),oE=p.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,s=p.useRef(null),i=p.useRef(null),a=an(u=>u.selectedItemId),c=Qr();return p.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),p.createElement(pn.div,{ref:tr(s,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},Ts(t,u=>p.createElement("div",{ref:tr(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),sE=p.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=t;return p.createElement(Oc,{open:n,onOpenChange:r},p.createElement(Lc,{container:i},p.createElement($c,{"cmdk-overlay":"",className:o}),p.createElement(Fc,{"aria-label":t.label,"cmdk-dialog":"",className:s},p.createElement(_m,{ref:e,...a}))))}),iE=p.forwardRef((t,e)=>an(n=>n.filtered.count===0)?p.createElement(pn.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),aE=p.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...s}=t;return p.createElement(pn.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ts(t,i=>p.createElement("div",{"aria-hidden":!0},i)))}),De=Object.assign(_m,{List:oE,Item:eE,Input:rE,Group:tE,Separator:nE,Dialog:sE,Empty:iE,Loading:aE});function cE(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function lE(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function Om(t){let e=p.useRef(t);return jn(()=>{e.current=t}),e}var jn=typeof window>"u"?p.useEffect:p.useLayoutEffect;function zn(t){let e=p.useRef();return e.current===void 0&&(e.current=t()),e}function an(t){let e=Gc(),n=()=>t(e.snapshot());return p.useSyncExternalStore(e.subscribe,n,n)}function Lm(t,e,n,r=[]){let o=p.useRef(),s=Qr();return jn(()=>{var i;let a=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():o.current}})(),c=r.map(u=>u.trim());s.value(t,a,c),(i=e.current)==null||i.setAttribute(Gn,a),o.current=a}),o}var uE=()=>{let[t,e]=p.useState(),n=zn(()=>new Map);return jn(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function dE(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Ts({asChild:t,children:e},n){return t&&p.isValidElement(e)?p.cloneElement(dE(e),{ref:e.ref},n(e.props.children)):n(e)}var fE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function hE({options:t,value:e,defaultValue:n,onValueChange:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No matches.",maxItems:a,size:c,color:u="primary",disabled:d=!1,id:f,className:h,style:m,sx:g,"aria-invalid":y,"aria-describedby":v,"aria-label":x}){const[w,b]=S.useState(!1),[C,P]=S.useState(n??[]),[R,M]=S.useState(""),j=S.useRef(null),T=e??C,E=S.useCallback(D=>{e===void 0&&P(D),r==null||r(D)},[e,r]),k=S.useCallback(D=>{T.includes(D)?E(T.filter(X=>X!==D)):(a==null||T.length<a)&&E([...T,D])},[T,E,a]),_=S.useCallback(D=>E(T.filter(X=>X!==D)),[T,E]),$=S.useMemo(()=>{const D=new Map;for(const X of t)D.set(X.value,X);return D},[t]),G=S.useMemo(()=>{const D=new Map;for(const X of t){const A=X.group??"";D.has(A)||D.set(A,[]),D.get(A).push(X)}return D},[t]),Q=D=>{D.key==="Backspace"&&R===""&&T.length>0&&(D.preventDefault(),_(T[T.length-1]))};S.useEffect(()=>{w&&queueMicrotask(()=>{var D;return(D=j.current)==null?void 0:D.focus()})},[w]);const{className:V,style:I,styleTag:L}=se(g,m,"cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,u!=="primary"&&u,h),O=a!=null&&T.length>=a;return l.jsxs(Dc,{open:w,onOpenChange:D=>!d&&b(D),children:[l.jsx(Ic,{asChild:!0,children:l.jsxs("div",{role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-invalid":y,"aria-describedby":v,"aria-label":x,"data-state":w?"open":"closed","data-disabled":d||void 0,id:f,className:V,style:I,onClick:()=>!d&&b(D=>!D),tabIndex:d?-1:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" "||D.key==="ArrowDown")&&!w&&(D.preventDefault(),b(!0))},children:[L,T.length===0&&l.jsx("span",{className:"cny-multiselect-placeholder",children:o}),T.map(D=>{const X=$.get(D);return l.jsxs("span",{className:"cny-chip",children:[l.jsx("span",{className:"cny-chip-label",children:(X==null?void 0:X.label)??D}),!d&&l.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(X==null?void 0:X.label)??D}`,onClick:A=>{A.stopPropagation(),_(D)},children:l.jsx(Wt,{size:12,"aria-hidden":"true"})})]},D)}),l.jsx(zr,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),l.jsx(kc,{children:l.jsx(Nc,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:D=>D.preventDefault(),children:l.jsxs(De,{shouldFilter:!0,label:"Options",children:[l.jsx(De.Input,{ref:j,placeholder:s,value:R,onValueChange:M,onKeyDown:Q}),l.jsxs(De.List,{children:[l.jsx(De.Empty,{children:i}),Array.from(G.entries()).map(([D,X])=>l.jsx(De.Group,{heading:D||void 0,children:X.map(A=>{const B=T.includes(A.value),ee=A.disabled||!B&&O;return l.jsxs(De.Item,{value:`${A.label} ${A.description??""} ${A.value}`,disabled:ee,onSelect:()=>k(A.value),children:[A.icon&&l.jsx("span",{style:{display:"inline-flex"},children:A.icon}),l.jsx("span",{children:A.label}),A.description&&l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:A.description}),B&&l.jsx("span",{className:"cny-check",children:l.jsx(rn,{size:14,"aria-hidden":"true"})})]},A.value)})},D||"default"))]})]})})})]})}var pE=Object.defineProperty,Ut=(t,e)=>pE(t,"name",{value:e,configurable:!0}),zc="Checkbox",[mE,bN]=Re(zc),[gE,Uc]=mE(zc);function $m(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=Pe({prop:n,defaultProp:o??!1,onChange:c,caller:zc}),[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=g?!!i||!!g.closest("form"):!0,R={checked:h,disabled:s,setChecked:m,control:g,setControl:y,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:Ft(o)?!1:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(gE,{scope:e,...R,children:Fm(f)?f(R):r})}Ut($m,"CheckboxProvider");var yE="CheckboxTrigger",vE=p.forwardRef(Ut(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...o},s){const{control:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:y,bubbleInput:v}=Uc(yE,e),x=ie(s,f),w=p.useRef(u);return p.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const C=Ut(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[i,h]),l.jsx(re.button,{type:"button",role:"checkbox","aria-checked":Ft(u)?"mixed":u,"aria-required":d,"data-state":Hc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:x,onKeyDown:H(n,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:H(r,b=>{g(),h(C=>Ft(C)?!0:!C),v&&y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"CheckboxTrigger")),Dd=p.forwardRef(Ut(function(e,n){const{__scopeCheckbox:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx($m,{__scopeCheckbox:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(vE,{...h,ref:n,__scopeCheckbox:r}),m&&l.jsx(CE,{__scopeCheckbox:r})]})})},"Checkbox")),xE="CheckboxIndicator",bE=p.forwardRef(Ut(function(e,n){const{__scopeCheckbox:r,forceMount:o,...s}=e,i=Uc(xE,r);return l.jsx(Ue,{present:o||Ft(i.checked)||i.checked===!0,children:l.jsx(re.span,{"data-state":Hc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),wE="CheckboxBubbleInput",CE=p.forwardRef(Ut(function({__scopeCheckbox:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:y,setBubbleInput:v}=Uc(wE,e),x=ie(o,v),w=hr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=y;if(!M)return;const j=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(j,"checked").set,k=a!==P.current;P.current=a;const _=C.current!==c;C.current=c;const $=!(k&&i.current);if(_&&E){b.current=!k;const G=new Event("click",{bubbles:$});M.indeterminate=Ft(c),E.call(M,Ft(c)?!1:c),M.dispatchEvent(G),b.current=!1}},[y,c,i,a]);const R=p.useRef(Ft(c)?!1:c);return l.jsx(re.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:g,...r,tabIndex:-1,ref:x,onClick:H(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Fm(t){return typeof t=="function"}Ut(Fm,"isFunction");function Ft(t){return t==="indeterminate"}Ut(Ft,"isIndeterminate");function Hc(t){return Ft(t)?"indeterminate":t?"checked":"unchecked"}Ut(Hc,"getState");const Ca=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){const a=l.jsx(bE,{children:s.checked==="indeterminate"?l.jsx(ZS,{size:12,"aria-hidden":"true"}):l.jsx(rn,{size:12,"aria-hidden":"true"})});if(!o){const{className:f,style:h,styleTag:m}=se(r,n,"checkbox",e);return l.jsxs(Dd,{ref:i,className:f,style:h,...s,children:[m,a]})}const{className:c,style:u,styleTag:d}=se(r,n,"control");return l.jsxs("label",{className:c,style:u,children:[d,l.jsx(Dd,{ref:i,className:U("checkbox",e),...s,children:a}),l.jsx("span",{children:o})]})});var SE=Object.defineProperty,ze=(t,e)=>SE(t,"name",{value:e,configurable:!0}),Vm="Radio",[PE,Bm]=Re(Vm),[RE,Ms]=PE(Vm);function Gm(t){const{__scopeRadio:e,checked:n=!1,children:r,disabled:o,form:s,name:i,onCheck:a,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,h]=p.useState(null),[m,g]=p.useState(null),y=p.useRef(!1),[v,x]=p.useReducer(C=>C+1,0),w=f?!!s||!!f.closest("form"):!0,b={checked:n,disabled:o,required:c,name:i,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:y,userInteractionCount:v,onUserInteraction:x,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:ze(()=>a==null?void 0:a(),"onCheck")};return l.jsx(RE,{scope:e,...b,children:zm(d)?d(b):r})}ze(Gm,"RadioProvider");var TE="RadioTrigger",ME=p.forwardRef(ze(function({__scopeRadio:e,onClick:n,...r},o){const{checked:s,disabled:i,value:a,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=Ms(TE,e),g=ie(o,c);return l.jsx(re.button,{type:"button",role:"radio","aria-checked":s,"data-state":Wc(s),"data-disabled":i?"":void 0,disabled:i,value:a,...r,ref:g,onClick:H(n,y=>{s||(f(),u()),m&&h&&(d.current=y.isPropagationStopped(),d.current||y.stopPropagation())})})},"RadioTrigger")),EE="RadioIndicator",jE=p.forwardRef(ze(function(e,n){const{__scopeRadio:r,forceMount:o,...s}=e,i=Ms(EE,r);return l.jsx(Ue,{present:o||i.checked,children:l.jsx(re.span,{"data-state":Wc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),AE="RadioBubbleInput",DE=p.forwardRef(ze(function({__scopeRadio:e,onClick:n,...r},o){const{control:s,checked:i,required:a,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:y}=Ms(AE,e),v=ie(o,m),x=hr(s),w=p.useRef(!1),b=p.useRef(i),C=p.useRef(y);p.useEffect(()=>{const R=h;if(!R)return;const M=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(M,"checked").set,E=y!==C.current;C.current=y;const k=b.current!==i;b.current=i;const _=!(E&&g.current);if(k&&T){w.current=!E;const $=new Event("click",{bubbles:_});T.call(R,i),R.dispatchEvent($),w.current=!1}},[h,i,g,y]);const P=p.useRef(i);return l.jsx(re.input,{type:"radio","aria-hidden":!0,defaultChecked:P.current,required:a,disabled:c,name:u,value:d,form:f,...r,tabIndex:-1,ref:v,onClick:H(n,R=>{w.current&&R.stopPropagation()}),style:{...r.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function zm(t){return typeof t=="function"}ze(zm,"isFunction");function Wc(t){return t?"checked":"unchecked"}ze(Wc,"getState");var IE=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Kc="RadioGroup",[kE,wN]=Re(Kc,[un,Bm]),Um=un(),Es=Bm(),[NE,_E]=kE(Kc),OE=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,name:o,form:s,defaultValue:i,value:a,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=e,y=Um(r),v=Ht(f),[x,w]=Pe({prop:a,defaultProp:i??null,onChange:m,caller:Kc}),[b,C]=p.useState(null),P=ie(n,C),R=p.useRef(x);return p.useEffect(()=>{const M=s?b==null?void 0:b.ownerDocument.getElementById(s):b==null?void 0:b.closest("form");if(M instanceof HTMLFormElement){const j=ze(()=>w(R.current),"reset");return M.addEventListener("reset",j),()=>M.removeEventListener("reset",j)}},[b,s,w]),l.jsx(NE,{scope:r,name:o,form:s,required:c,disabled:u,value:x,onValueChange:w,children:l.jsx(ds,{asChild:!0,...y,orientation:d,dir:v,loop:h,children:l.jsx(re.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:P})})})},"RadioGroup")),LE="RadioGroupItemProvider",$E="RadioGroupItemTrigger";function Hm(t){const{__scopeRadioGroup:e,value:n,disabled:r,children:o,internal_do_not_use_render:s}=t,i=_E(LE,e),a=Es(e),c=i.disabled||r;return l.jsx(Gm,{...a,checked:i.value===n,disabled:c,required:i.required,name:i.name,form:i.form,value:n,onCheck:()=>i.onValueChange(n),internal_do_not_use_render:s,children:o})}ze(Hm,"RadioGroupItemProvider");var FE=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Um(r),i=Es(r),{checked:a,disabled:c}=Ms($E,i.__scopeRadio),u=p.useRef(null),d=ie(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=ze(g=>{IE.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=ze(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),l.jsx(fs,{asChild:!0,...s,focusable:!c,active:a,children:l.jsx(ME,{...i,...o,ref:d,onKeyDown:H(o.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:H(o.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),Id=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,value:o,disabled:s,...i}=e;return l.jsx(Hm,{__scopeRadioGroup:r,value:o,disabled:s,internal_do_not_use_render:({isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(FE,{...i,ref:n,__scopeRadioGroup:r}),a&&l.jsx(VE,{__scopeRadioGroup:r})]})})},"RadioGroupItem")),VE=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Es(r);return l.jsx(DE,{...s,...o,ref:n})},"RadioGroupItemBubbleInput")),kd=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Es(r);return l.jsx(jE,{...s,...o,ref:n})},"RadioGroupIndicator"));const BE=S.forwardRef(function({orientation:e="vertical",className:n,style:r,...o},s){return l.jsx(OE,{ref:s,className:U("cny-radio-group",e==="horizontal"&&"cny-radio-group-horizontal",n),style:r,...o})}),GE=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=se(r,n,"radio",e);return l.jsxs(Id,{ref:i,className:d,style:f,...s,children:[h,l.jsx(kd,{})]})}const{className:a,style:c,styleTag:u}=se(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Id,{ref:i,className:U("radio",e),...s,children:l.jsx(kd,{})}),l.jsx("span",{children:o})]})});var zE=Object.defineProperty,cn=(t,e)=>zE(t,"name",{value:e,configurable:!0}),Yc="Switch",[UE,CN]=Re(Yc),[HE,Xc]=UE(Yc);function Wm(t){const{__scopeSwitch:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=Pe({prop:n,defaultProp:o??!1,onChange:c,caller:Yc}),[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=g?!!i||!!g.closest("form"):!0,R={checked:h,setChecked:m,disabled:s,control:g,setControl:y,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(HE,{scope:e,...R,children:Km(f)?f(R):r})}cn(Wm,"SwitchProvider");var WE="SwitchTrigger",KE=p.forwardRef(cn(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,form:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:y,bubbleInput:v}=Xc(WE,e),x=ie(o,f),w=p.useRef(u);return p.useEffect(()=>{const b=i?s==null?void 0:s.ownerDocument.getElementById(i):s==null?void 0:s.form;if(b instanceof HTMLFormElement){const C=cn(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[s,i,h]),l.jsx(re.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":qc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...r,ref:x,onClick:H(n,b=>{g(),h(C=>!C),v&&y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"SwitchTrigger")),Nd=p.forwardRef(cn(function(e,n){const{__scopeSwitch:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx(Wm,{__scopeSwitch:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(KE,{...h,ref:n,__scopeSwitch:r}),m&&l.jsx(qE,{__scopeSwitch:r})]})})},"Switch")),YE="SwitchThumb",_d=p.forwardRef(cn(function(e,n){const{__scopeSwitch:r,...o}=e,s=Xc(YE,r);return l.jsx(re.span,{"data-state":qc(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:n})},"SwitchThumb")),XE="SwitchBubbleInput",qE=p.forwardRef(cn(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:y,setBubbleInput:v}=Xc(XE,e),x=ie(o,v),w=hr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=y;if(!M)return;const j=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(j,"checked").set,k=a!==P.current;P.current=a;const _=C.current!==c;C.current=c;const $=!(k&&i.current);if(_&&E){b.current=!k;const G=new Event("click",{bubbles:$});E.call(M,c),M.dispatchEvent(G),b.current=!1}},[y,c,i,a]);const R=p.useRef(c);return l.jsx(re.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:g,...r,tabIndex:-1,ref:x,onClick:H(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Km(t){return typeof t=="function"}cn(Km,"isFunction");function qc(t){return t?"checked":"unchecked"}cn(qc,"getState");const ZE=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=se(r,n,"switch",e);return l.jsxs(Nd,{ref:i,className:d,style:f,...s,children:[h,l.jsx(_d,{className:"switch-thumb"})]})}const{className:a,style:c,styleTag:u}=se(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Nd,{ref:i,className:U("switch",e),...s,children:l.jsx(_d,{className:"switch-thumb"})}),l.jsx("span",{children:o})]})});function Uo(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Od(t){const e=new Date(t);return e.setHours(23,59,59,999),e}function Po(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Pi(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}function QE(t,e){return t.getFullYear()===e.getFullYear()}function Mt(t){return new Date(t.getFullYear(),t.getMonth(),1)}function JE(t){return new Date(t.getFullYear(),0,1)}function Ld(t){return new Date(Math.floor(t.getFullYear()/10)*10,0,1)}function Ro(t,e){const n=new Date(t);return n.setDate(1),n.setMonth(n.getMonth()+e),n}function os(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Rt(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n}function Ri(t,e,n,r=0){const o=new Date(t);return o.setHours(e,n,r,0),o}function We(t,e,n){return e&&t.getTime()<e.getTime()?new Date(e):n&&t.getTime()>n.getTime()?new Date(n):t}function ej(t,e){const n=Mt(t),r=(n.getDay()-e+7)%7,o=os(n,-r);return Array.from({length:42},(s,i)=>os(o,i))}function tj(t,e){const n=new Intl.DateTimeFormat(t,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=os(r,(s+e)%7);return n.format(i)})}function nj(t,e="short"){const n=new Intl.DateTimeFormat(t,{month:e});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function $d(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function rj(t,e){return new Intl.DateTimeFormat(e,{year:"numeric"}).format(t)}function oj(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function Ym(t,e){return new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"}).format(t)}function Xm(t,e,n,r){return new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(t)}function sj(t,e,n,r){return`${Ym(t,e)} · ${Xm(t,e,n,r)}`}function To(t){if(t==null||t==="")return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:new Date(t);const e=new Date(t);return Number.isNaN(e.getTime())?null:e}function Mo(t,e){return t.getTime()<e.getTime()}function Eo(t,e){return t.getTime()>e.getTime()}function jo(t){return t<10?`0${t}`:String(t)}function ij(t){return t||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function aj(t){try{return new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function cj(t,e,n,r,o){switch(e){case"year":return rj(t,n);case"month":return oj(t,n);case"time":return Xm(t,n,r,o);case"datetime":return sj(t,n,r,o);case"date":default:return Ym(t,n)}}function lj(t,e){switch(e){case"year":return JE(t);case"month":return Mt(t);case"date":return Uo(t);default:return new Date(t)}}const uj=S.forwardRef(function({mode:e="date",value:n,defaultValue:r,onChange:o,min:s,max:i,allow:a="any",disabledDate:c,disabledTime:u,placeholder:d,size:f,color:h="primary",disabled:m=!1,clearable:g=!0,locale:y,weekStartsOn:v=0,hour12:x,showSeconds:w=!1,minuteStep:b=1,secondStep:C=1,format:P,icon:R,required:M=!1,validate:j,error:T,onValidate:E,id:k,className:_,style:$,sx:G,"aria-invalid":Q,"aria-describedby":V,dialogLabel:I,name:L,open:O,onOpenChange:D,...X},A){const B=ij(y),ee=x??aj(B),K=S.useId(),W=k??`cny-dp-${K}`,oe=`${W}-dialog`,Y=`${W}-hint`,z=S.useMemo(()=>{const N=To(s),J=a==="future"||a==="current"?Uo(new Date):null;return N&&J?N.getTime()>J.getTime()?N:J:N??J},[s,a]),Z=S.useMemo(()=>{const N=To(i),J=a==="past"||a==="current"?Od(new Date):null;return N&&J?N.getTime()<J.getTime()?N:J:N??J},[i,a]),le=n!==void 0,[ce,F]=S.useState(()=>To(r)),q=le?To(n):ce,he=O!==void 0,[ue,He]=S.useState(!1),ve=he?O:ue,qe=S.useCallback(N=>{he||He(N),D==null||D(N)},[he,D]),gn=S.useMemo(()=>q??We(new Date,z,Z),[q,z,Z]),[pe,we]=S.useState(()=>Mt(gn)),[Se,ke]=S.useState(()=>gn),$s=e==="month"?"month":e==="year"?"year":"date",[nt,yn]=S.useState($s),Fs=S.useRef(null);S.useImperativeHandle(A,()=>Fs.current,[]);const mr=S.useRef(null),Vs=S.useRef(null),bl=S.useRef(null),Bs=S.useRef(null),[Sy,Py]=S.useState({}),[Ry,Ty]=S.useState(!1);S.useEffect(()=>Ty(!0),[]);const Nn=S.useCallback(N=>z&&Mo(N,z)||Z&&Eo(N,Z)?!0:c?c(N):!1,[z,Z,c]),oo=S.useCallback(N=>u?u(N):!1,[u]),_n=S.useMemo(()=>{if(T)return typeof T=="string"?T:"Invalid";if(M&&!q)return"Required";if(q){const J=Uo(new Date);if(a==="future"&&Mo(q,J))return"Must be today or later";if(a==="past"&&Eo(q,Od(new Date)))return"Must be today or earlier";if(a==="current"&&!Po(q,J))return"Must be today";if(z&&Mo(q,z))return"Too early";if(Z&&Eo(q,Z))return"Too late";if(c&&c(q))return"Unavailable date";if(u&&u(q))return"Unavailable time"}const N=j==null?void 0:j(q);return N||null},[T,M,q,a,z,Z,c,u,j]),wl=S.useRef(null);S.useEffect(()=>{wl.current!==_n&&(wl.current=_n,E==null||E(_n))},[_n,E]);const so=_n!==null,Cl=so?"danger":h,My=q?P?P(q,e):cj(q,e,B,ee,w):"",Ey=d??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[e],jy=I??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[e],Yt=S.useCallback(N=>{le||F(N),o==null||o(N)},[le,o]),io=S.useCallback(()=>{var N;qe(!1),(N=mr.current)==null||N.focus()},[qe]),Ay=S.useCallback(N=>{var J;N.stopPropagation(),Yt(null),(J=mr.current)==null||J.focus()},[Yt]),Sl=S.useCallback(()=>{if(m)return;const N=q??We(new Date,z,Z);we(Mt(N)),ke(N),yn($s),qe(!0)},[m,q,z,Z,qe,$s]);S.useEffect(()=>{if(!ve)return;const N=J=>{var ge,te;const ae=J.target;(ge=Fs.current)!=null&&ge.contains(ae)||(te=Vs.current)!=null&&te.contains(ae)||qe(!1)};return document.addEventListener("pointerdown",N,!0),()=>document.removeEventListener("pointerdown",N,!0)},[ve,qe]);const ao=S.useCallback(()=>{const N=mr.current,J=Vs.current;if(!N||!J)return;const ae=N.getBoundingClientRect(),ge=J.offsetHeight||340,te=J.offsetWidth||264,rt=window.innerHeight,Be=window.innerWidth,ot=4,je=8,Xt=rt-ae.bottom,zs=ae.top,ev=Xt<ge+ot&&zs>Xt?Math.max(je,ae.top-ot-ge):Math.min(rt-ge-je,ae.bottom+ot),tv=Math.max(je,Math.min(ae.left,Be-te-je));Py({position:"fixed",top:ev,left:tv,width:te})},[]);S.useLayoutEffect(()=>{ve&&ao()},[ve,e,ao]),S.useEffect(()=>{if(!ve)return;const N=()=>ao();return window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[ve,ao]),S.useEffect(()=>{var N,J;ve&&(nt==="date"&&(e==="date"||e==="datetime")?(N=bl.current)==null||N.focus():(nt==="month"||nt==="year")&&((J=Bs.current)==null||J.focus()))},[ve,Se,e,nt]);const Pl=S.useCallback(()=>{var N;nt==="year"&&e!=="year"?yn("month"):nt==="month"&&e!=="month"?yn("date"):(qe(!1),(N=mr.current)==null||N.focus())},[nt,e,qe]),co=S.useCallback(N=>{const J=We(N,z,Z);ke(J),we(ae=>Pi(ae,J)?ae:Mt(J))},[z,Z]),gr=S.useCallback((N,J)=>{const ae=lj(N,e);if(e!=="time"&&Nn(ae))return;const ge=e==="time"||e==="datetime"?Ri(ae,(q??N).getHours(),(q??N).getMinutes(),w?(q??N).getSeconds():0):ae;Yt(ge),ke(ge),((J==null?void 0:J.close)??(e!=="datetime"&&e!=="time"))&&io()},[e,Nn,Yt,q,w,io]),lo=S.useCallback((N,J)=>{const ae=q??We(new Date,z,Z),ge=N==="hour"?J:ae.getHours(),te=N==="minute"?J:ae.getMinutes(),rt=N==="second"?J:w?ae.getSeconds():0,Be=Ri(ae,ge,te,rt);oo(Be)||(Yt(Be),ke(Be))},[q,z,Z,w,oo,Yt]),On=S.useCallback(N=>co(os(Se,N)),[co,Se]),Dy=N=>{switch(N.key){case"ArrowLeft":N.preventDefault(),On(-1);break;case"ArrowRight":N.preventDefault(),On(1);break;case"ArrowUp":N.preventDefault(),On(-7);break;case"ArrowDown":N.preventDefault(),On(7);break;case"Home":{N.preventDefault();const J=(Se.getDay()-v+7)%7;On(-J);break}case"End":{N.preventDefault();const J=(Se.getDay()-v+7)%7;On(6-J);break}case"PageUp":N.preventDefault(),co(N.shiftKey?Rt(Se,-1):Ro(Se,-1));break;case"PageDown":N.preventDefault(),co(N.shiftKey?Rt(Se,1):Ro(Se,1));break;case"Enter":case" ":N.preventDefault(),gr(Se);break;case"Escape":N.preventDefault(),Pl();break}},Iy=S.useMemo(()=>ej(pe,v),[pe,v]),ky=S.useMemo(()=>tj(B,v),[B,v]),Ny=S.useMemo(()=>nj(B,"short"),[B]),Gs=S.useMemo(()=>Uo(new Date),[]),_y=!z||!Mo(Mt(pe),Mt(z)),Oy=!Z||!Eo(Mt(pe),Mt(Z)),Ly=!z||pe.getFullYear()-1>=z.getFullYear(),$y=!Z||pe.getFullYear()+1<=Z.getFullYear(),vn=Ld(pe).getFullYear(),Fy=!z||vn-10+9>=z.getFullYear(),Vy=!Z||vn+10<=Z.getFullYear(),By=e==="time"?!oo(new Date):!Nn(Gs),Gy=()=>{if(e==="time"){const N=new Date;if(oo(N))return;const ae=Ri(q??N,N.getHours(),N.getMinutes(),w?N.getSeconds():0);Yt(ae),ke(ae);return}gr(Gs,{close:e!=="datetime"})},zy=U("cny-datepicker-trigger","input",Cl!=="primary"&&Cl,f==="sm"||f==="lg"?f:null,q&&"has-value",ve&&"is-open"),Uy=R??(e==="time"?l.jsx(DS,{size:15}):l.jsx(bS,{size:15})),Rl=(N,J)=>{let ge=!0;switch(N.key){case"ArrowLeft":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()+11)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()-1,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"ArrowRight":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()+1)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()+1,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"ArrowUp":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()-3+12)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()-3,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"ArrowDown":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()+3)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()+3,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"PageUp":we(J==="month"?te=>Rt(te,N.shiftKey?-10:-1):te=>Rt(te,N.shiftKey?-100:-10));break;case"PageDown":we(J==="month"?te=>Rt(te,N.shiftKey?10:1):te=>Rt(te,N.shiftKey?100:10));break;case"Enter":case" ":J==="month"?Tl(new Date(pe.getFullYear(),Se.getMonth(),1)):Ml(Se.getFullYear());break;case"Escape":Pl();break;default:ge=!1}ge&&N.preventDefault()};S.useEffect(()=>{if(ve&&nt==="year"){const N=Ld(pe).getFullYear(),J=Se.getFullYear();(J<N-1||J>N+10)&&we(new Date(J,0,1))}},[ve,nt,Se,pe]);const Tl=N=>{e==="month"?gr(N):(we(Mt(N)),ke(We(N,z,Z)),yn("date"))},Ml=N=>{if(e==="year")gr(new Date(N,0,1));else{const J=new Date(N,pe.getMonth(),1);we(J),ke(We(new Date(N,Se.getMonth(),Math.min(Se.getDate(),28)),z,Z)),yn("month")}},Hy=()=>{const N=Se.getMonth();return Ny.map((J,ae)=>{const ge=new Date(pe.getFullYear(),ae,1),te=!!q&&Pi(ge,q)&&QE(ge,q),rt=ge.getMonth()===pe.getMonth()&&e!=="month",Be=ae===N,ot=Nn(ge);return l.jsx("button",{ref:Be?Bs:void 0,type:"button",tabIndex:Be?0:-1,className:U("cny-datepicker-chip",te&&"is-selected",rt&&!te&&"is-current"),disabled:ot,onClick:()=>Tl(ge),onFocus:()=>ke(new Date(pe.getFullYear(),ae,Math.min(Se.getDate(),28))),children:J},ae)})},Wy=()=>{const N=vn-1,J=Se.getFullYear();return Array.from({length:12},(ae,ge)=>{const te=N+ge,rt=new Date(te,0,1),Be=!!q&&q.getFullYear()===te,ot=te===pe.getFullYear()&&e!=="year",je=te===J,Xt=Nn(rt),zs=te<vn||te>=vn+10;return l.jsx("button",{ref:je?Bs:void 0,type:"button",tabIndex:je?0:-1,className:U("cny-datepicker-chip",Be&&"is-selected",ot&&!Be&&"is-current",zs&&"is-outside"),disabled:Xt,onClick:()=>Ml(te),onFocus:()=>ke(new Date(te,Se.getMonth(),Math.min(Se.getDate(),28))),children:te},te)})},Ky=S.useRef(null),El=S.useRef(null),jl=S.useRef(null),Al=()=>{const N=q??We(new Date,z,Z),J=N.getHours(),ae=N.getMinutes(),ge=N.getSeconds(),te=J>=12,rt=ee?J%12===0?12:J%12:J,Be=je=>{const Xt=ee?te?je===12?12:je+12:je===12?0:je:je;lo("hour",Xt)},ot=je=>{const Xt=je?J<12?J+12:J:J>=12?J-12:J;lo("hour",Xt)};return l.jsx("div",{className:"cny-dp-time",children:l.jsxs("div",{className:"cny-dp-time-row",children:[l.jsx(Ti,{ref:Ky,ariaLabel:"Hour",value:rt,min:ee?1:0,max:ee?12:23,step:1,nextRef:El,onChange:Be}),l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ti,{ref:El,ariaLabel:"Minute",value:ae-ae%Math.max(1,b),min:0,max:59,step:Math.max(1,b),nextRef:w?jl:void 0,onChange:je=>lo("minute",je)}),w&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ti,{ref:jl,ariaLabel:"Second",value:ge-ge%Math.max(1,C),min:0,max:59,step:Math.max(1,C),onChange:je=>lo("second",je)})]}),ee&&l.jsxs("div",{className:"cny-dp-ampm",role:"radiogroup","aria-label":"AM or PM",children:[l.jsx("button",{type:"button",role:"radio","aria-checked":!te,className:U("cny-dp-ampm-btn",!te&&"is-active"),onClick:()=>ot(!1),children:"AM"}),l.jsx("button",{type:"button",role:"radio","aria-checked":te,className:U("cny-dp-ampm-btn",te&&"is-active"),onClick:()=>ot(!0),children:"PM"})]})]})})},Yy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous month",disabled:!_y,onClick:()=>we(N=>Ro(N,-1)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${$d(pe,B)})`,onClick:()=>yn("month"),children:$d(pe,B)}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!Oy,onClick:()=>we(N=>Ro(N,1)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:Dy,children:[l.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:ky.map((N,J)=>l.jsx("span",{role:"columnheader","aria-label":N,className:"cny-datepicker-weekday",children:N.slice(0,2)},J))}),Array.from({length:6},(N,J)=>l.jsx("div",{role:"row",className:"cny-datepicker-row",children:Iy.slice(J*7,J*7+7).map(ae=>{const ge=!Pi(ae,pe),te=Po(ae,q),rt=Po(ae,Gs),Be=Po(ae,Se),ot=Nn(ae);return l.jsx("button",{ref:Be?bl:void 0,type:"button",role:"gridcell",tabIndex:Be?0:-1,"aria-selected":te,"aria-current":rt?"date":void 0,"aria-disabled":ot||void 0,disabled:ot,className:U("cny-datepicker-cell",ge&&"is-outside",te&&"is-selected",rt&&"is-today"),onClick:()=>gr(ae),onFocus:()=>ke(ae),children:ae.getDate()},ae.toISOString())})},J))]})]}),Xy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous year",disabled:!Ly,onClick:()=>we(N=>Rt(N,-1)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${pe.getFullYear()})`,onClick:()=>yn("year"),children:pe.getFullYear()}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!$y,onClick:()=>we(N=>Rt(N,1)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:N=>Rl(N,"month"),children:Hy()})]}),qy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous decade",disabled:!Fy,onClick:()=>we(N=>Rt(N,-10)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("span",{className:"cny-datepicker-title",children:`${vn} – ${vn+9}`}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!Vy,onClick:()=>we(N=>Rt(N,10)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:N=>Rl(N,"year"),children:Wy()})]}),{className:Zy,style:Qy,styleTag:Jy}=se(G,$,"cny-datepicker",`mode-${e}`,m&&"is-disabled",_);return l.jsxs("div",{ref:Fs,className:Zy,style:Qy,...X,children:[Jy,L&&l.jsx("input",{type:"hidden",name:L,value:q?q.toISOString():"",readOnly:!0}),l.jsxs("button",{ref:mr,type:"button",id:W,className:zy,"aria-haspopup":"dialog","aria-expanded":ve,"aria-controls":ve?oe:void 0,"aria-invalid":Q||so,"aria-describedby":U(V,so?Y:void 0)||void 0,"aria-required":M||void 0,disabled:m,onClick:Sl,onKeyDown:N=>{N.key==="ArrowDown"||N.key==="Enter"||N.key===" "?(N.preventDefault(),Sl()):N.key==="Escape"&&ve&&(N.preventDefault(),qe(!1))},children:[l.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:Uy}),l.jsx("span",{className:U("cny-datepicker-value",!q&&"is-placeholder"),children:My||Ey}),g&&q&&!m&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:Ay,onPointerDown:N=>N.stopPropagation(),children:l.jsx(Wt,{size:13,"aria-hidden":"true"})})]}),so&&T!==!1&&l.jsx("span",{id:Y,className:"cny-datepicker-error",role:"alert",children:typeof T=="string"?T:T??_n}),ve&&Ry&&Da.createPortal(l.jsxs("div",{ref:Vs,id:oe,role:"dialog","aria-modal":"false","aria-label":jy,className:U("cny-datepicker-panel",`is-${e}`),style:Sy,children:[l.jsxs("div",{className:"cny-datepicker-body",children:[(e==="date"||e==="datetime")&&nt==="date"&&Yy(),(e==="date"||e==="datetime"||e==="month")&&nt==="month"&&Xy(),(e==="date"||e==="datetime"||e==="month"||e==="year")&&nt==="year"&&qy(),e==="time"&&Al(),e==="datetime"&&nt==="date"&&Al()]}),l.jsxs("div",{className:"cny-datepicker-footer",children:[l.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!By,onClick:Gy,children:e==="time"?"Now":e==="year"?"This year":e==="month"?"This month":"Today"}),l.jsx("div",{className:"cny-datepicker-footer-spacer"}),g&&q&&l.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{Yt(null),io()},children:"Clear"}),(e==="datetime"||e==="time")&&l.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:io,children:"Done"})]})]}),document.body)]})}),Ti=S.forwardRef(function({value:e,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const u=S.useRef(null);S.useImperativeHandle(c,()=>u.current,[]);const[d,f]=S.useState(()=>jo(e)),h=S.useRef(!1);S.useEffect(()=>{h.current||f(jo(e))},[e]);const m=S.useCallback(x=>{if(!Number.isFinite(x))return;let w=Math.max(n,Math.min(r,x));w=Math.round(w/o)*o,w>r&&(w=Math.floor(r/o)*o),a(w),f(jo(w))},[n,r,o,a]),g=()=>{const x=e+o;m(x>r?n:x)},y=()=>{const x=e-o;m(x<n?Math.floor(r/o)*o:x)},v=x=>{switch(x.key){case"ArrowUp":x.preventDefault(),g();break;case"ArrowDown":x.preventDefault(),y();break;case"PageUp":x.preventDefault(),m(e+o*5);break;case"PageDown":x.preventDefault(),m(e-o*5);break;case"Home":x.preventDefault(),m(n);break;case"End":x.preventDefault(),m(r);break;case"Enter":x.preventDefault(),m(parseInt(d,10));break}};return l.jsxs("div",{className:"cny-dp-timefield",onWheel:x=>{document.activeElement===u.current&&(x.preventDefault(),x.deltaY<0?g():x.deltaY>0&&y())},children:[l.jsx("input",{ref:u,type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:2,className:"cny-dp-timefield-input",value:d,"aria-label":s,"aria-valuenow":e,"aria-valuemin":n,"aria-valuemax":r,onFocus:x=>{h.current=!0,x.target.select()},onChange:x=>{var b;const w=x.target.value.replace(/[^0-9]/g,"").slice(0,2);if(f(w),w.length===2){const C=parseInt(w,10);Number.isFinite(C)&&C>=n&&C<=r&&(m(C),(b=i==null?void 0:i.current)==null||b.focus())}},onBlur:()=>{h.current=!1;const x=parseInt(d,10);Number.isFinite(x)?m(x):f(jo(e))},onKeyDown:v}),l.jsxs("div",{className:"cny-dp-timefield-controls",children:[l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Increment ${s.toLowerCase()}`,tabIndex:-1,onClick:g,onMouseDown:x=>x.preventDefault(),children:l.jsx(bp,{size:10,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Decrement ${s.toLowerCase()}`,tabIndex:-1,onClick:y,onMouseDown:x=>x.preventDefault(),children:l.jsx(zr,{size:10,"aria-hidden":"true"})})]})]})});function dj({hotkey:t=!0}={}){const[e,n]=S.useState(!1);return S.useEffect(()=>{if(!t)return;const r=o=>{o.key==="k"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),n(s=>!s))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t]),{open:e,setOpen:n,toggle:()=>n(r=>!r)}}function fj({open:t,onOpenChange:e,sections:n,placeholder:r="Search…",title:o="Command palette",description:s="Search and navigate. Use arrow keys to move, Enter to open, Escape to dismiss.",emptyText:i="No matches found.",footer:a,onItemSelect:c,contentClassName:u}){const d=f=>{var h;f.disabled||((h=f.onSelect)==null||h.call(f),c==null||c(f),e(!1))};return l.jsxs(De.Dialog,{open:t,onOpenChange:e,label:o,contentClassName:U("cny-cmdk-content",u),children:[l.jsxs(cm,{children:[l.jsx(Vc,{children:o}),l.jsx(Bc,{children:s})]}),l.jsxs("div",{className:"cny-cmdk-header",children:[l.jsx(Mp,{size:16,"aria-hidden":"true"}),l.jsx(De.Input,{placeholder:r}),l.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),l.jsxs(De.List,{className:"cny-cmdk-list",children:[l.jsx(De.Empty,{className:"cny-cmdk-empty",children:i}),n.map(f=>l.jsx(De.Group,{heading:f.title,className:"cny-cmdk-group",children:f.items.map(h=>{var m;return l.jsxs(De.Item,{value:`${f.title} ${h.label} ${((m=h.keywords)==null?void 0:m.join(" "))??""}`,disabled:h.disabled,onSelect:()=>d(h),className:"cny-cmdk-item",children:[h.icon&&l.jsx("span",{className:"cny-cmdk-item-icon",children:h.icon}),l.jsx("span",{className:"cny-cmdk-item-label",children:h.label}),h.badge&&l.jsx("span",{className:"cny-cmdk-item-badge",children:h.badge}),h.hint&&l.jsx("span",{className:"cny-cmdk-item-hint",children:h.hint})]},h.id)})},f.title))]}),a!==!1&&l.jsx("div",{className:"cny-cmdk-footer",children:a??l.jsxs(l.Fragment,{children:[l.jsx("kbd",{children:"↑↓"})," navigate",l.jsx("kbd",{children:"↵"})," open",l.jsx("kbd",{children:"Esc"})," dismiss"]})})]})}function hj({onClick:t,label:e="Search…",shortcut:n="⌘K",className:r}){return l.jsxs("button",{type:"button",onClick:t,className:U("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[l.jsx(Mp,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"cny-cmdk-trigger-label",children:e}),l.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let pj=0;const mj=()=>`cny-toast-${Date.now().toString(36)}-${++pj}`,qm=S.createContext(null),gj={default:null,success:l.jsx(Sp,{size:16,"aria-hidden":"true"}),info:l.jsx(Rp,{size:16,"aria-hidden":"true"}),warning:l.jsx(Ep,{size:16,"aria-hidden":"true"}),danger:l.jsx(Cp,{size:16,"aria-hidden":"true"}),loading:l.jsx(Tp,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function yj({children:t,position:e="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=S.useState([]),[a,c]=S.useState(!1);S.useEffect(()=>c(!0),[]);const u=S.useCallback(y=>{i(v=>v.map(x=>y==null||x.id===y?{...x,exiting:!0}:x)),window.setTimeout(()=>{i(v=>v.filter(x=>y==null?!1:x.id!==y||!x.exiting)),i(v=>(v.filter(x=>x.exiting&&(y==null||x.id===y)).forEach(x=>{var w;return(w=x.onDismiss)==null?void 0:w.call(x)}),v.filter(x=>!x.exiting||y!=null&&x.id!==y)))},200)},[]),d=S.useCallback(y=>{const v=y.id??mj(),x={id:v,title:y.title,description:y.description,action:y.action,icon:y.icon,variant:y.variant??"default",duration:y.duration??n,dismissible:y.dismissible??!0,onDismiss:y.onDismiss,sx:y.sx};return i(w=>{const C=[...w.filter(P=>P.id!==v),x];return C.length>r?C.slice(C.length-r):C}),v},[n,r]),f=S.useCallback((y,v)=>{i(x=>x.map(w=>w.id===y?{...w,...v,variant:v.variant??w.variant,duration:v.duration??w.duration,dismissible:v.dismissible??w.dismissible}:w))},[]),h=S.useMemo(()=>{const y=(v=>d(typeof v=="string"?{title:v}:v));return y.success=(v,x)=>d({...x,title:v,variant:"success"}),y.info=(v,x)=>d({...x,title:v,variant:"info"}),y.warning=(v,x)=>d({...x,title:v,variant:"warning"}),y.error=(v,x)=>d({...x,title:v,variant:"danger"}),y.loading=(v,x)=>d({...x,title:v,variant:"loading",duration:(x==null?void 0:x.duration)??1/0}),y},[d]),m=S.useMemo(()=>({toast:h,dismiss:u,update:f}),[h,u,f]),g=e.startsWith("top-");return l.jsxs(qm.Provider,{value:m,children:[t,a&&Da.createPortal(l.jsx("ol",{className:U("cny-toast-viewport",`pos-${e}`),style:{"--cny-toast-offset":o},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(g?[...s].reverse():s).map(y=>l.jsx(vj,{toast:y,onDismiss:()=>u(y.id)},y.id))}),document.body)]})}function vj({toast:t,onDismiss:e}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c,sx:u}=t,[d,f]=S.useState(!1),h=S.useRef(null);S.useEffect(()=>{if(!t.exiting&&!(!Number.isFinite(a)||a<0)&&!d)return h.current=setTimeout(e,a),()=>{h.current&&clearTimeout(h.current)}},[d,a,e,t.exiting]);const m=n==="danger"||n==="warning"?"alert":"status",g=i!==!1,y=i!==void 0&&i!==!1?i:gj[n],{className:v,style:x,styleTag:w}=se(u,void 0,"cny-toast",n,t.exiting&&"is-exiting");return l.jsxs("li",{role:m,"aria-atomic":"true",className:v,style:x,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),children:[w,g&&y&&l.jsx("span",{className:"cny-toast-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"cny-toast-body",children:[r!=null&&l.jsx("p",{className:"cny-toast-title",children:r}),o!=null&&l.jsx("p",{className:"cny-toast-description",children:o})]}),s!=null&&l.jsx("div",{className:"cny-toast-action",children:s}),c&&l.jsx("button",{type:"button",className:"cny-toast-close","aria-label":"Dismiss",onClick:e,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})})]})}function xj(){const t=S.useContext(qm);if(!t)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return t}const Zm=S.forwardRef(function({title:e,description:n,children:r,footer:o,size:s="md",hideClose:i,className:a,style:c,sx:u,...d},f){const{className:h,style:m,styleTag:g}=se(u,c,"cny-dialog-content",`size-${s}`,a);return l.jsx(Oc,{...d,children:l.jsxs(Lc,{children:[l.jsx($c,{className:"cny-dialog-overlay"}),l.jsxs(Fc,{ref:f,className:h,style:m,children:[g,l.jsxs("header",{className:"cny-dialog-header",children:[l.jsxs("div",{className:"cny-dialog-titles",children:[l.jsx(Vc,{className:"cny-dialog-title",children:e}),n&&l.jsx(Bc,{className:"cny-dialog-description",children:n})]}),!i&&l.jsx(Ps,{className:"cny-dialog-close","aria-label":"Close dialog",children:l.jsx(Wt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-dialog-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-dialog-footer",children:o})]})]})})}),bj=Mm,wj=Ps;function Qm({open:t,onOpenChange:e,title:n,message:r,children:o,confirmLabel:s="Confirm",cancelLabel:i="Cancel",danger:a=!1,loading:c=!1,onConfirm:u,onCancel:d,className:f,style:h,sx:m}){const g=()=>{d==null||d(),e(!1)};return l.jsx(Zm,{open:t,onOpenChange:e,size:"sm",title:n,className:U("cny-confirm",f),style:h,sx:m,footer:l.jsxs(l.Fragment,{children:[l.jsx(jr,{variant:"ghost",color:"primary",onClick:g,disabled:c,children:i}),l.jsx(jr,{variant:"solid",color:a?"danger":"primary",loading:c,onClick:u,children:s})]}),children:o??l.jsx("p",{className:"cny-confirm-message",children:r})})}function Cj(){const[t,e]=S.useState(null),n=S.useCallback(i=>new Promise(a=>{e({...i,resolve:a})}),[]),r=S.useCallback(i=>{i||e(a=>(a==null||a.resolve(!1),null))},[]),o=S.useCallback(()=>{e(i=>(i==null||i.resolve(!0),null))},[]),s=t?l.jsx(Qm,{open:!0,onOpenChange:r,title:t.title,message:t.message,confirmLabel:t.confirmLabel,cancelLabel:t.cancelLabel,danger:t.danger,onConfirm:o}):null;return{confirm:n,confirmDialog:s}}const Sj=S.forwardRef(function({title:e,description:n,children:r,footer:o,side:s="right",size:i="md",hideClose:a,className:c,style:u,sx:d,...f},h){const{className:m,style:g,styleTag:y}=se(d,u,"cny-drawer-content",`side-${s}`,`size-${i}`,c);return l.jsx(Oc,{...f,children:l.jsxs(Lc,{children:[l.jsx($c,{className:"cny-drawer-overlay"}),l.jsxs(Fc,{ref:h,className:m,style:g,children:[y,l.jsxs("header",{className:"cny-drawer-header",children:[l.jsxs("div",{className:"cny-drawer-titles",children:[l.jsx(Vc,{className:"cny-drawer-title",children:e}),n&&l.jsx(Bc,{className:"cny-drawer-description",children:n})]}),!a&&l.jsx(Ps,{className:"cny-drawer-close","aria-label":"Close drawer",children:l.jsx(Wt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-drawer-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-drawer-footer",children:o})]})]})})}),Pj=Mm,Rj=Ps;var Tj=Object.defineProperty,de=(t,e)=>Tj(t,"name",{value:e,configurable:!0}),Sa=["Enter"," "],Mj=["ArrowDown","PageUp","Home"],Jm=["ArrowUp","PageDown","End"],Ej=[...Mj,...Jm],jj={ltr:[...Sa,"ArrowRight"],rtl:[...Sa,"ArrowLeft"]},Aj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},js="Menu",[Nr,Dj,Ij]=cr(js),[kn,As]=Re(js,[Ij,dn,un]),Ds=dn(),eg=un(),[tg,mn]=kn(js),[kj,Jr]=kn(js),Nj=de(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,a=Ds(e),[c,u]=p.useState(null),d=p.useRef(!1),f=Qe(s),h=Ht(o);return p.useEffect(()=>{const m=de(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=de(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=de(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),l.jsx(Wr,{...a,children:l.jsx(tg,{scope:e,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(kj,{scope:e,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})},"Menu"),ng=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e,s=Ds(r);return l.jsx(Kr,{...s,...o,ref:n})},"MenuAnchor")),rg="MenuPortal",[_j,og]=kn(rg,{forceMount:void 0}),Oj=de(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=mn(rg,e);return l.jsx(_j,{scope:e,forceMount:n,children:l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:r})})})},"MenuPortal"),vt="MenuContent",[Lj,Zc]=kn(vt),$j=p.forwardRef(de(function(e,n){const r=og(vt,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=mn(vt,e.__scopeMenu),a=Jr(vt,e.__scopeMenu);return l.jsx(Nr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ue,{present:o||i.open,children:l.jsx(Nr.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(Fj,{...s,ref:n}):l.jsx(Vj,{...s,ref:n})})})})},"MenuContent")),Fj=p.forwardRef(de(function(e,n){const r=mn(vt,e.__scopeMenu),o=p.useRef(null),s=ie(n,o);return p.useEffect(()=>{const i=o.current;if(i)return bs(i)},[]),l.jsx(Qc,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),Vj=p.forwardRef(de(function(e,n){const r=mn(vt,e.__scopeMenu);return l.jsx(Qc,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Bj=Nt("MenuContent.ScrollLock"),Qc=p.forwardRef(de(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:y,...v}=e,x=mn(vt,r),w=Jr(vt,r),b=Ds(r),C=eg(r),P=Dj(r),[R,M]=p.useState(null),j=p.useRef(null),T=ie(n,j,x.onContentChange),E=p.useRef(0),k=p.useRef(""),_=p.useRef(0),$=p.useRef(null),G=p.useRef("right"),Q=p.useRef(0),V=y?Xr:p.Fragment,I=y?{as:Bj,allowPinchZoom:!0}:void 0,L=de(D=>{var Y,z;const X=k.current+D,A=P().filter(Z=>!Z.disabled),B=document.activeElement,ee=(Y=A.find(Z=>Z.ref.current===B))==null?void 0:Y.textValue,K=A.map(Z=>Z.textValue),W=fg(K,X,ee),oe=(z=A.find(Z=>Z.textValue===W))==null?void 0:z.ref.current;de((function Z(le){k.current=le,window.clearTimeout(E.current),le!==""&&(E.current=window.setTimeout(()=>Z(""),1e3))}),"updateSearch")(X),oe&&setTimeout(()=>oe.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(E.current),[]),ur();const O=p.useCallback(D=>{var A,B;return G.current===((A=$.current)==null?void 0:A.side)&&pg(D,(B=$.current)==null?void 0:B.area)},[]);return l.jsx(Lj,{scope:r,searchRef:k,onItemEnter:p.useCallback(D=>{O(D)&&D.preventDefault()},[O]),onItemLeave:p.useCallback(D=>{var X;O(D)||((X=j.current)==null||X.focus(),M(null))},[O]),onTriggerLeave:p.useCallback(D=>{O(D)&&D.preventDefault()},[O]),pointerGraceTimerRef:_,onPointerGraceIntentChange:p.useCallback(D=>{$.current=D},[]),children:l.jsx(V,{...I,children:l.jsx(hs,{asChild:!0,trapped:s,onMountAutoFocus:H(i,D=>{var X;D.preventDefault(),(X=j.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:l.jsx(ds,{asChild:!0,...C,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:M,onEntryFocus:H(u,D=>{w.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(xs,{role:"menu","aria-orientation":"vertical","data-state":el(x.open),"data-radix-menu-content":"",dir:w.dir,...b,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:H(v.onKeyDown,D=>{const A=D.target.closest("[data-radix-menu-content]")===D.currentTarget,B=D.ctrlKey||D.altKey||D.metaKey,ee=D.key.length===1;A&&(D.key==="Tab"&&D.preventDefault(),!B&&ee&&L(D.key));const K=j.current;if(D.target!==K||!Ej.includes(D.key))return;D.preventDefault();const oe=P().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);Jm.includes(D.key)&&oe.reverse(),ug(oe)}),onBlur:H(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(E.current),k.current="")}),onPointerMove:H(e.onPointerMove,nr(D=>{const X=D.target,A=Q.current!==D.clientX;if(D.currentTarget.contains(X)&&A){const B=D.clientX>Q.current?"right":"left";G.current=B,Q.current=D.clientX}}))})})})})})})},"MenuContentImpl")),Gj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(re.div,{role:"group",...o,ref:n})},"MenuGroup")),zj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(re.div,{...o,ref:n})},"MenuLabel")),Pa="MenuItem",Fd="menu.itemSelect",Jc=p.forwardRef(de(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=p.useRef(null),a=Jr(Pa,e.__scopeMenu),c=Zc(Pa,e.__scopeMenu),u=ie(n,i),d=p.useRef(!1),f=de(()=>{const h=i.current;if(!r&&h){const m=new CustomEvent(Fd,{bubbles:!0,cancelable:!0});h.addEventListener(Fd,g=>o==null?void 0:o(g),{once:!0}),dc(h,m),m.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return l.jsx(sg,{...s,ref:u,disabled:r,onClick:H(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:H(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:H(e.onKeyDown,h=>{r||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||Sa.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),sg=p.forwardRef(de(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,a=Zc(Pa,r),c=eg(r),u=p.useRef(null),d=ie(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const y=u.current;y&&g((y.textContent??"").trim())},[i.children]),l.jsx(Nr.ItemSlot,{scope:r,disabled:o,textValue:s??m,children:l.jsx(fs,{asChild:!0,...c,focusable:!o,children:l.jsx(re.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:H(e.onPointerMove,nr(y=>{o?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:H(e.onPointerLeave,nr(y=>a.onItemLeave(y))),onFocus:H(e.onFocus,()=>h(!0)),onBlur:H(e.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Uj=p.forwardRef(de(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return l.jsx(ag,{scope:e.__scopeMenu,checked:r,children:l.jsx(Jc,{role:"menuitemcheckbox","aria-checked":_r(r)?"mixed":r,...s,ref:n,"data-state":Is(r),onSelect:H(s.onSelect,()=>o==null?void 0:o(_r(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Hj="MenuRadioGroup",[Wj,Kj]=kn(Hj,{value:void 0,onValueChange:de(()=>{},"onValueChange")}),Yj=p.forwardRef(de(function(e,n){const{value:r,onValueChange:o,...s}=e,i=Qe(o);return l.jsx(Wj,{scope:e.__scopeMenu,value:r,onValueChange:i,children:l.jsx(Gj,{...s,ref:n})})},"MenuRadioGroup")),Xj="MenuRadioItem",qj=p.forwardRef(de(function(e,n){const{value:r,...o}=e,s=Kj(Xj,e.__scopeMenu),i=r===s.value;return l.jsx(ag,{scope:e.__scopeMenu,checked:i,children:l.jsx(Jc,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":Is(i),onSelect:H(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),ig="MenuItemIndicator",[ag,Zj]=kn(ig,{checked:!1}),Qj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=Zj(ig,r);return l.jsx(Ue,{present:o||_r(i.checked)||i.checked===!0,children:l.jsx(re.span,{...s,ref:n,"data-state":Is(i.checked)})})},"MenuItemIndicator")),Jj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(re.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),cg="MenuSub",[eA,lg]=kn(cg),tA=de(t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,s=mn(cg,e),i=Ds(e),[a,c]=p.useState(null),[u,d]=p.useState(null),f=Qe(o);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(Wr,{...i,children:l.jsx(tg,{scope:e,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(eA,{scope:e,contentId:Fe(),triggerId:Fe(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),Ao="MenuSubTrigger",nA=p.forwardRef(de(function(e,n){const r=mn(Ao,e.__scopeMenu),o=Jr(Ao,e.__scopeMenu),s=lg(Ao,e.__scopeMenu),i=Zc(Ao,e.__scopeMenu),a=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},f=p.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=ie(n,s.onTriggerChange);return l.jsx(ng,{asChild:!0,...d,children:l.jsx(sg,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":el(r.open),...e,ref:h,onClick:m=>{var g;(g=e.onClick)==null||g.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:H(e.onPointerMove,nr(m=>{i.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:H(e.onPointerLeave,nr(m=>{var y,v;f();const g=(y=r.content)==null?void 0:y.getBoundingClientRect();if(g){const x=(v=r.content)==null?void 0:v.dataset.side,w=x==="right",b=w?-5:5,C=g[w?"left":"right"],P=g[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+b,y:m.clientY},{x:C,y:g.top},{x:P,y:g.top},{x:P,y:g.bottom},{x:C,y:g.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:H(e.onKeyDown,m=>{var y;e.disabled||m.target!==m.currentTarget||i.searchRef.current!==""&&m.key===" "||jj[o.dir].includes(m.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),m.preventDefault())})})})},"MenuSubTrigger")),rA="MenuSubContent",oA=p.forwardRef(de(function(e,n){const r=og(vt,e.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=e,a=mn(vt,e.__scopeMenu),c=Jr(vt,e.__scopeMenu),u=lg(rA,e.__scopeMenu),d=p.useRef(null),f=ie(n,d);return l.jsx(Nr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ue,{present:o||a.open,children:l.jsx(Nr.Slot,{scope:e.__scopeMenu,children:l.jsx(Qc,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:H(e.onFocusOutside,h=>{h.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:H(e.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:H(e.onKeyDown,h=>{var y;const m=h.currentTarget.contains(h.target),g=Aj[c.dir].includes(h.key);m&&g&&(a.onOpenChange(!1),(y=u.trigger)==null||y.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function el(t){return t?"open":"closed"}de(el,"getOpenState");function _r(t){return t==="indeterminate"}de(_r,"isIndeterminate");function Is(t){return _r(t)?"indeterminate":t?"checked":"unchecked"}de(Is,"getCheckedState");function ug(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}de(ug,"focusFirst");function dg(t,e){return t.map((n,r)=>t[(e+r)%t.length])}de(dg,"wrapArray");function fg(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=dg(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}de(fg,"getNextMatch");function hg(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}de(hg,"isPointInPolygon");function pg(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return hg(n,e)}de(pg,"isPointerInGraceArea");function nr(t){return e=>e.pointerType==="mouse"?t(e):void 0}de(nr,"whenMouse");var mg=Nj,gg=ng,yg=Oj,vg=$j,xg=zj,bg=Jc,wg=Uj,Cg=Yj,Sg=qj,Pg=Qj,Rg=Jj,Tg=tA,Mg=nA,Eg=oA,sA=Object.defineProperty,Je=(t,e)=>sA(t,"name",{value:e,configurable:!0}),tl="DropdownMenu",[iA,SN]=Re(tl,[As]),et=As(),[aA,jg]=iA(tl),cA=Je(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,c=et(e),u=p.useRef(null),[d,f]=Pe({prop:o,defaultProp:s??!1,onChange:i,caller:tl});return l.jsx(aA,{scope:e,triggerId:Fe(),triggerRef:u,contentId:Fe(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(mg,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})},"DropdownMenu"),lA="DropdownMenuTrigger",uA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=jg(lA,r),a=et(r),c=ie(n,i.triggerRef);return l.jsx(gg,{asChild:!0,...a,children:l.jsx(re.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:H(e.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:H(e.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),dA=Je(t=>{const{__scopeDropdownMenu:e,...n}=t,r=et(e);return l.jsx(yg,{...r,...n})},"DropdownMenuPortal"),fA="DropdownMenuContent",hA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=jg(fA,r),i=et(r),a=p.useRef(!1);return l.jsx(vg,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:H(e.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:H(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),pA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(xg,{...s,...o,ref:n})},"DropdownMenuLabel")),mA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(bg,{...s,...o,ref:n})},"DropdownMenuItem")),gA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(wg,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),yA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Cg,{...s,...o,ref:n})},"DropdownMenuRadioGroup")),vA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Sg,{...s,...o,ref:n})},"DropdownMenuRadioItem")),xA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Pg,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),bA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Rg,{...s,...o,ref:n})},"DropdownMenuSeparator")),wA=Je(t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:s}=t,i=et(e),[a,c]=Pe({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return l.jsx(Tg,{...i,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),CA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Mg,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),SA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Eg,{...s,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),PA=cA,RA=uA,Ag=dA,TA=hA,MA=pA,EA=mA,jA=gA,AA=yA,DA=vA,Dg=xA,IA=bA,kA=wA,NA=CA,_A=SA;const OA=PA,LA=RA,$A=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",sideOffset:s=6,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(Ag,{children:l.jsxs(TA,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i]})})}),FA=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(EA,{ref:a,className:U("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),VA=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(jA,{ref:s,className:U("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Dg,{children:l.jsx(rn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),BA=AA,GA=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(DA,{ref:s,className:U("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Dg,{children:l.jsx(Pp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),zA=S.forwardRef(function({className:e,...n},r){return l.jsx(MA,{ref:r,className:U("cny-menu-label",e),...n})}),UA=S.forwardRef(function({className:e,...n},r){return l.jsx(IA,{ref:r,className:U("cny-menu-separator",e),...n})}),HA=kA,WA=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(NA,{ref:s,className:U("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Jt,{size:13,"aria-hidden":"true"})})]})}),KA=S.forwardRef(function({className:e,...n},r){return l.jsx(Ag,{children:l.jsx(_A,{ref:r,className:U("cny-menu-content",e),...n})})});var YA=Object.defineProperty,Ve=(t,e)=>YA(t,"name",{value:e,configurable:!0}),nl="ContextMenu",[XA,PN]=Re(nl,[As]),tt=As(),[qA,Ig]=XA(nl),ZA=Ve(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,dir:s,modal:i=!0}=t,a=p.useRef(!1),[c,u]=Pe({prop:o,defaultProp:!1,onChange:r,caller:nl}),d=tt(e);return l.jsx(qA,{scope:e,open:c,onOpenChange:u,modal:i,hasInteractedRef:a,children:l.jsx(mg,{...d,dir:s,open:c,onOpenChange:u,modal:i,children:n})})},"ContextMenu"),QA="ContextMenuTrigger",JA=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,disabled:o=!1,...s}=e,i=Ig(QA,r),a=tt(r),[c,u]=p.useState({x:0,y:0}),d=p.useMemo(()=>({current:{getBoundingClientRect:Ve(()=>DOMRect.fromRect({width:0,height:0,...c}),"getBoundingClientRect")}}),[c]),f=p.useRef(0),h=p.useCallback(()=>window.clearTimeout(f.current),[]),m=Ve(g=>{i.hasInteractedRef.current=!0,u({x:g.clientX,y:g.clientY}),i.onOpenChange(!0)},"handleOpen");return p.useEffect(()=>h,[h]),p.useEffect(()=>void(o&&h()),[o,h]),l.jsxs(l.Fragment,{children:[l.jsx(gg,{...a,virtualRef:d}),l.jsx(re.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...s,ref:n,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:H(e.onContextMenu,g=>{h(),m(g),g.preventDefault()}),onPointerDown:o?e.onPointerDown:H(e.onPointerDown,br(g=>{h(),i.open&&i.onOpenChange(!1),f.current=window.setTimeout(()=>m(g),700)})),onPointerMove:o?e.onPointerMove:H(e.onPointerMove,br(h)),onPointerCancel:o?e.onPointerCancel:H(e.onPointerCancel,br(h)),onPointerUp:o?e.onPointerUp:H(e.onPointerUp,br(h))})]})},"ContextMenuTrigger")),eD=Ve(t=>{const{__scopeContextMenu:e,...n}=t,r=tt(e);return l.jsx(yg,{...r,...n})},"ContextMenuPortal"),tD="ContextMenuContent",nD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Ig(tD,r),i=tt(r),a=p.useRef(!1);return l.jsx(vg,{...i,...o,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=e.onInteractOutside)==null||u.call(e,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),rD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(xg,{...s,...o,ref:n})},"ContextMenuLabel")),oD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(bg,{...s,...o,ref:n})},"ContextMenuItem")),sD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(wg,{...s,...o,ref:n})},"ContextMenuCheckboxItem")),iD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Cg,{...s,...o,ref:n})},"ContextMenuRadioGroup")),aD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Sg,{...s,...o,ref:n})},"ContextMenuRadioItem")),cD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Pg,{...s,...o,ref:n})},"ContextMenuItemIndicator")),lD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Rg,{...s,...o,ref:n})},"ContextMenuSeparator")),uD="ContextMenuSub",dD=Ve(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:s}=t,i=tt(e),[a,c]=Pe({prop:o,defaultProp:s??!1,onChange:r,caller:uD});return l.jsx(Tg,{...i,open:a,onOpenChange:c,children:n})},"ContextMenuSub"),fD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Mg,{...s,...o,ref:n})},"ContextMenuSubTrigger")),hD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Eg,{...s,...o,ref:n,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function br(t){return e=>e.pointerType!=="mouse"?t(e):void 0}Ve(br,"whenTouchOrPen");var pD=ZA,mD=JA,kg=eD,gD=nD,yD=rD,vD=oD,xD=sD,bD=iD,wD=aD,Ng=cD,CD=lD,SD=dD,PD=fD,RD=hD;const TD=pD,MD=mD,ED=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",alignOffset:s=-4,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(kg,{children:l.jsxs(gD,{ref:c,className:u,style:d,alignOffset:s,...a,children:[f,i]})})}),jD=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(vD,{ref:a,className:U("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),AD=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(xD,{ref:s,className:U("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Ng,{children:l.jsx(rn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),DD=bD,ID=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(wD,{ref:s,className:U("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Ng,{children:l.jsx(Pp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),kD=S.forwardRef(function({className:e,...n},r){return l.jsx(yD,{ref:r,className:U("cny-menu-label",e),...n})}),ND=S.forwardRef(function({className:e,...n},r){return l.jsx(CD,{ref:r,className:U("cny-menu-separator",e),...n})}),_D=SD,OD=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(PD,{ref:s,className:U("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Jt,{size:13,"aria-hidden":"true"})})]})}),LD=S.forwardRef(function({className:e,...n},r){return l.jsx(kg,{children:l.jsx(RD,{ref:r,className:U("cny-menu-content",e),...n})})});var $D=Object.defineProperty,Ie=(t,e)=>$D(t,"name",{value:e,configurable:!0}),[rl,RN]=Re("Tooltip",[dn]),ks=dn(),FD="TooltipProvider",VD=700,Ra="tooltip.open",[BD,ol]=rl(FD),GD=Ie(t=>{const{__scopeTooltip:e,delayDuration:n=VD,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=p.useRef(!0),a=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(BD,{scope:e,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),Ta="Tooltip",[zD,eo]=rl(Ta),UD=Ie(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=t,c=ol(Ta,t.__scopeTooltip),u=ks(e),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=Fe(),y=p.useRef(0),v=i??c.disableHoverableContent,x=a??c.delayDuration,w=p.useRef(!1),[b,C]=Pe({prop:r,defaultProp:o??!1,onChange:Ie(E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ra))):c.onClose(),s==null||s(E)},"onChange"),caller:Ta}),P=p.useMemo(()=>b?w.current?"delayed-open":"instant-open":"closed",[b]),R=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,C(!0)},[C]),M=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C(!1)},[C]),j=p.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{w.current=!0,C(!0),y.current=0},x)},[x,C]);p.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const T=h??g;return l.jsx(Wr,{...u,children:l.jsx(zD,{scope:e,contentId:T,setContentId:m,open:b,stateAttribute:P,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?j():R()},[c.isOpenDelayedRef,j,R]),onTriggerLeave:p.useCallback(()=>{v?M():(window.clearTimeout(y.current),y.current=0)},[M,v]),onOpen:R,onClose:M,disableHoverableContent:v,children:n})})},"Tooltip"),Vd="TooltipTrigger",HD=p.forwardRef(Ie(function(e,n){const{__scopeTooltip:r,...o}=e,s=eo(Vd,r),i=ol(Vd,r),a=ks(r),c=p.useRef(null),u=ie(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(Kr,{asChild:!0,...a,children:l.jsx(re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:H(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:H(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:H(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:H(e.onBlur,s.onClose),onClick:H(e.onClick,s.onClose)})})},"TooltipTrigger")),_g="TooltipPortal",[WD,KD]=rl(_g,{forceMount:void 0}),YD=Ie(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=eo(_g,e);return l.jsx(WD,{scope:e,forceMount:n,children:l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Or="TooltipContent",XD=p.forwardRef(Ie(function(e,n){const r=KD(Or,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,a=eo(Or,e.__scopeTooltip);return l.jsx(Ue,{present:o||a.open,children:a.disableHoverableContent?l.jsx(Og,{side:s,...i,ref:n}):l.jsx(qD,{side:s,...i,ref:n})})},"TooltipContent")),qD=p.forwardRef(Ie(function(e,n){const r=eo(Or,e.__scopeTooltip),o=ol(Or,e.__scopeTooltip),s=p.useRef(null),i=ie(n,s),[a,c]=p.useState(null),{trigger:u,onClose:d}=r,f=s.current,{onPointerInTransitChange:h}=o,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((y,v)=>{const x=y.currentTarget,w={x:y.clientX,y:y.clientY},b=Lg(w,x.getBoundingClientRect()),C=$g(w,b),P=Fg(v.getBoundingClientRect()),R=Bg([...C,...P]);c(R),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const y=Ie(x=>g(x,f),"handleTriggerLeave"),v=Ie(x=>g(x,u),"handleContentLeave");return u.addEventListener("pointerleave",y),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(a){const y=Ie(v=>{const x=v.target,w={x:v.clientX,y:v.clientY},b=(u==null?void 0:u.contains(x))||(f==null?void 0:f.contains(x)),C=!Vg(w,a);b?m():C&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,f,a,d,m]),l.jsx(Og,{...e,ref:i})},"TooltipContentHoverable")),ZD=Yh("TooltipContent"),Og=p.forwardRef(Ie(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=e,d=eo(Or,r),f=ks(r),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(Ra,h),()=>document.removeEventListener(Ra,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=Ie(y=>{y.target instanceof Node&&y.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Ee(()=>(m(i),()=>{m(void 0)}),[i,m]),l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:l.jsxs(xs,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(ZD,{children:o}),s?l.jsx(TT,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),QD=p.forwardRef(Ie(function(e,n){const{__scopeTooltip:r,...o}=e,s=ks(r);return l.jsx(nm,{...s,...o,ref:n})},"TooltipArrow"));function Lg(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Ie(Lg,"getExitSideFromRect");function $g(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Ie($g,"getPaddedExitPoints");function Fg(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}Ie(Fg,"getPointsFromRect");function Vg(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}Ie(Vg,"isPointInPolygon");function Bg(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Gg(e)}Ie(Bg,"getHull");function Gg(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Ie(Gg,"getHullPresorted");var JD=GD,zg=UD,Ug=HD,Hg=YD,Wg=XD,eI=QD;const tI=JD,nI=S.forwardRef(function({children:e,content:n,side:r="top",align:o="center",sideOffset:s=6,delayDuration:i,open:a,disabled:c,contentClassName:u,contentStyle:d,sx:f},h){const{className:m,style:g,styleTag:y}=se(f,d,"cny-tooltip-content",u);return c?l.jsx(l.Fragment,{children:e}):l.jsxs(zg,{delayDuration:i,open:a,children:[l.jsx(Ug,{asChild:!0,children:e}),l.jsx(Hg,{children:l.jsxs(Wg,{ref:h,side:r,align:o,sideOffset:s,className:m,style:g,children:[y,n,l.jsx(eI,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),rI=zg,oI=Ug,sI=S.forwardRef(function({className:e,...n},r){return l.jsx(Hg,{children:l.jsx(Wg,{ref:r,className:U("cny-tooltip-content",e),...n})})}),iI=Dc,aI=Ic,cI=xM,lI=bM,uI=S.forwardRef(function({className:e,style:n,sx:r,withArrow:o=!1,sideOffset:s=8,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(r,n,"cny-popover-content",e);return l.jsx(kc,{children:l.jsxs(Nc,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i,o&&l.jsx(wM,{className:"cny-popover-arrow",width:12,height:6})]})})}),dI=S.forwardRef(function({color:e="default",variant:n="soft",size:r="md",icon:o,avatar:s,onDelete:i,deleteLabel:a="Remove",onClick:c,disabled:u,className:d,style:f,sx:h,children:m,...g},y){const v=!u&&c!=null,{className:x,style:w,styleTag:b}=se(h,f,"cny-chip",e,n,r==="sm"&&"sm",v&&"is-interactive",u&&"is-disabled",d);return l.jsxs("span",{ref:y,role:v?"button":void 0,tabIndex:v?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:c,onKeyDown:v?C=>{C.target===C.currentTarget&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),c==null||c(C))}:void 0,className:x,style:w,...g,children:[b,s&&l.jsx("span",{className:"cny-chip-avatar",children:s}),o&&l.jsx("span",{className:"cny-chip-icon",children:o}),l.jsx("span",{className:"cny-chip-label",children:m}),i&&!u&&l.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":a,onClick:C=>{C.stopPropagation(),i(C)},children:l.jsx(Wt,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),fI=S.forwardRef(function({count:e,dot:n=!1,max:r=99,showZero:o=!1,color:s="danger",placement:i="top-right",standalone:a=!1,children:c,className:u,style:d,sx:f,...h},m){const g=typeof e=="number",y=g&&e>r?`${r}+`:e,x=!n&&g&&e===0&&!o?null:l.jsx("span",{className:U("cny-badge-indicator",`cny-badge-${s}`,n&&"cny-badge-dot",!a&&`cny-badge-${i}`),children:n?null:y});if(a){const{className:P,style:R,styleTag:M}=se(f,d,"cny-badge","cny-badge-standalone",u);return l.jsxs("span",{ref:m,className:P,style:R,...h,children:[M,x]})}const{className:w,style:b,styleTag:C}=se(f,d,"cny-badge",u);return l.jsxs("span",{ref:m,className:w,style:b,...h,children:[C,c,x]})}),hI=S.forwardRef(function({position:e="right",orientation:n="vertical",size:r="md",className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=se(i,s,"cny-timeline",n==="horizontal"?"cny-timeline-horizontal":`cny-timeline-${e}`,r!=="md"&&`cny-timeline-${r}`,o);return l.jsxs("ol",{ref:u,className:d,style:f,...c,children:[h,a]})}),pI=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,className:U("cny-timeline-item",e),...n})}),mI=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:U("cny-timeline-separator",e),...n})}),gI=S.forwardRef(function({color:e="neutral",variant:n="filled",icon:r,active:o=!1,className:s,children:i,...a},c){const u=r??i;return l.jsx("span",{ref:c,className:U("cny-timeline-dot",`cny-timeline-dot-${e}`,`cny-timeline-dot-${n}`,u!=null&&u!==!1&&"cny-timeline-dot-icon",o&&"cny-timeline-dot-active",s),...a,children:u})}),yI=S.forwardRef(function({color:e,lineStyle:n="solid",className:r,...o},s){return l.jsx("span",{ref:s,className:U("cny-timeline-connector",e&&`cny-timeline-connector-${e}`,n!=="solid"&&`cny-timeline-connector-${n}`,r),"aria-hidden":"true",...o})}),vI=S.forwardRef(function({variant:e="plain",accentColor:n,className:r,...o},s){const i=e==="card"||e==="elevated";return l.jsx("div",{ref:s,className:U("cny-timeline-content",i&&"cny-timeline-content-card",e==="elevated"&&"cny-timeline-content-elevated",n&&"cny-timeline-content-accent",n&&`cny-timeline-content-accent-${n}`,r),...o})}),xI=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:U("cny-timeline-opposite-content",e),...n})}),Kg=S.createContext(null);function bI(){const t=S.useContext(Kg);if(!t)throw new Error("TreeItem must be used within a <TreeView>.");return t}const Yg=S.forwardRef(function({expandedIds:e,defaultExpandedIds:n,onExpandedChange:r,selectedId:o,defaultSelectedId:s=null,onSelectedChange:i,onItemExpandToggle:a,defaultIcons:c=!0,className:u,style:d,sx:f,children:h,...m},g){const[y,v]=S.useState(n??[]),[x,w]=S.useState(s),[b,C]=S.useState(null),P=e??y,R=o!==void 0?o:x,M=S.useMemo(()=>new Set(P),[P]),j=S.useCallback(I=>M.has(I),[M]),T=S.useCallback(I=>{const L=!M.has(I),O=L?[...P,I]:P.filter(D=>D!==I);e===void 0&&v(O),r==null||r(O),a==null||a(I,L)},[P,M,e,r,a]),E=S.useCallback(I=>{o===void 0&&w(I),i==null||i(I)},[o,i]),k=S.useMemo(()=>({isExpanded:j,toggle:T,selectedId:R,select:E,activeId:b,setActive:C,defaultIcons:c}),[j,T,R,E,b,c]),_=S.useRef(null),$=S.useCallback(I=>{_.current=I,typeof g=="function"?g(I):g&&(g.current=I)},[g]);S.useEffect(()=>{var O;if(b!==null)return;const I=(O=_.current)==null?void 0:O.querySelector('[role="treeitem"]'),L=I==null?void 0:I.dataset.treeId;L&&C(L)},[b]);const{className:G,style:Q,styleTag:V}=se(f,d,"cny-tree",u);return l.jsx(Kg.Provider,{value:k,children:l.jsxs("ul",{ref:$,role:"tree",className:G,style:Q,...m,children:[V,h]})})});function wI(t){return t?Array.from(t.querySelectorAll('[role="treeitem"]')):[]}const Xg=S.forwardRef(function({itemId:e,label:n,icon:r,children:o,className:s,...i},a){const{isExpanded:c,toggle:u,selectedId:d,select:f,activeId:h,setActive:m,defaultIcons:g}=bI(),y=!!o,v=y&&c(e),x=d===e,w=h===e,b=r??(g?y?v?l.jsx(zS,{size:16}):l.jsx(HS,{size:16}):l.jsx(BS,{size:16}):null),C=()=>{m(e),f(e),y&&u(e)},P=M=>{M.preventDefault(),M.stopPropagation(),m(e),u(e)},R=M=>{var T;const j=M.currentTarget.closest('[role="tree"]');switch(M.key){case"ArrowRight":if(M.preventDefault(),y&&!v)u(e);else if(v){const E=M.currentTarget.querySelector('[role="treeitem"]');E==null||E.focus()}break;case"ArrowLeft":if(M.preventDefault(),y&&v)u(e);else{const E=(T=M.currentTarget.parentElement)==null?void 0:T.closest('[role="treeitem"]');E==null||E.focus()}break;case"ArrowDown":case"ArrowUp":{M.preventDefault();const E=wI(j),k=E.indexOf(M.currentTarget),_=E[k+(M.key==="ArrowDown"?1:-1)];_==null||_.focus();break}case"Enter":case" ":M.preventDefault(),f(e),y&&u(e);break}};return l.jsxs("li",{ref:a,role:"treeitem","data-tree-id":e,"aria-expanded":y?v:void 0,"aria-selected":x,tabIndex:w?0:-1,className:U("cny-tree-item",s),onKeyDown:R,onFocus:M=>{M.target===M.currentTarget&&m(e)},...i,children:[l.jsxs("div",{className:U("cny-tree-row",x&&"is-selected"),onClick:C,children:[y?l.jsx("button",{type:"button",tabIndex:-1,className:U("cny-tree-toggle",v&&"is-open"),"aria-label":`Toggle ${typeof n=="string"?n:e}`,onClick:P,children:l.jsx(Jt,{size:16,"aria-hidden":"true"})}):l.jsx("span",{className:"cny-tree-toggle-spacer","aria-hidden":"true"}),b!=null&&l.jsx("span",{className:"cny-tree-icon",children:b}),l.jsx("span",{className:"cny-tree-label",children:n})]}),v&&l.jsx("ul",{role:"group",className:"cny-tree-group",children:o})]})}),CI=S.forwardRef(function({items:e,getItemId:n=c=>String(c.id),getItemLabel:r=c=>c.label,getItemChildren:o=c=>c.children,getItemIcon:s,...i},a){const c=u=>u.map(d=>{const f=n(d),h=o(d);return l.jsx(Xg,{itemId:f,label:r(d),icon:s==null?void 0:s(d),children:h&&h.length>0?c(h):null},f)});return l.jsx(Yg,{ref:a,...i,children:c(e)})});function SI(t){if(!t)return[];if(typeof t=="string")return t.split(",").map(n=>n.trim()).filter(Boolean);if(Array.isArray(t))return t.map(n=>n.trim()).filter(Boolean);const e=[];for(const[n,r]of Object.entries(t)){e.push(n);for(const o of r)e.push(o)}return e}function PI(t,e){if(e.length===0)return!0;const n=t.name.toLowerCase(),r=(t.type||"").toLowerCase();return e.some(o=>{const s=o.toLowerCase();return s==="*"||s==="*/*"?!0:s.startsWith(".")?n.endsWith(s):s.endsWith("/*")?r.startsWith(s.slice(0,-1)):r===s})}function qg(t={}){const{accept:e,maxSize:n,minSize:r,multiple:o=!1,maxFiles:s,disabled:i=!1,onDrop:a,onDropAccepted:c,onDropRejected:u}=t,[d,f]=S.useState(!1),h=S.useRef(null),m=S.useRef(0),g=S.useMemo(()=>SI(e),[e]),y=g.join(",")||void 0,v=S.useCallback(P=>{const R=[];return PI(P,g)||R.push({code:"file-invalid-type",message:"File type is not allowed."}),typeof n=="number"&&P.size>n&&R.push({code:"file-too-large",message:`File is larger than ${n} bytes.`}),typeof r=="number"&&P.size<r&&R.push({code:"file-too-small",message:`File is smaller than ${r} bytes.`}),R},[g,n,r]),x=S.useCallback(P=>{if(i||P.length===0)return;const R=[],M=[];if(!o&&P.length>1||typeof s=="number"&&P.length>s)for(const T of P)M.push({file:T,errors:[{code:"too-many-files",message:"Too many files."}]});else for(const T of P){const E=v(T);E.length?M.push({file:T,errors:E}):R.push(T)}a==null||a(R,M),R.length&&(c==null||c(R)),M.length&&(u==null||u(M))},[i,o,s,v,a,c,u]),w=S.useCallback(()=>{var P;i||(P=h.current)==null||P.click()},[i]),b=S.useCallback((P={})=>{const{onClick:R,onKeyDown:M,onDragOver:j,onDragEnter:T,onDragLeave:E,onDrop:k,..._}=P;return{..._,role:"button",tabIndex:i?-1:0,"aria-disabled":i||void 0,onClick:$=>{R==null||R($),i||w()},onKeyDown:$=>{M==null||M($),($.key==="Enter"||$.key===" ")&&($.preventDefault(),w())},onDragOver:$=>{j==null||j($),$.preventDefault(),i||f(!0)},onDragEnter:$=>{T==null||T($),$.preventDefault(),!i&&(m.current+=1,f(!0))},onDragLeave:$=>{E==null||E($),m.current=Math.max(0,m.current-1),m.current===0&&f(!1)},onDrop:$=>{var G;k==null||k($),$.preventDefault(),m.current=0,f(!1),!i&&x(Array.from(((G=$.dataTransfer)==null?void 0:G.files)??[]))}}},[i,w,x]),C=S.useCallback((P={})=>{const{onChange:R,...M}=P;return{...M,ref:h,type:"file",accept:y,multiple:o,style:{display:"none"},onChange:j=>{R==null||R(j),x(Array.from(j.target.files??[])),j.target.value=""}}},[y,o,x]);return{getRootProps:b,getInputProps:C,open:w,isDragActive:d,inputRef:h}}const RI=S.forwardRef(function({onDrop:e,label:n="Drop files here or click to upload",hint:r,icon:o,children:s,buttonLabel:i="Browse files",size:a="md",accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,className:g,style:y,sx:v},x){const{getRootProps:w,getInputProps:b,isDragActive:C,open:P}=qg({accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,onDrop:e}),{className:R,style:M,styleTag:j}=se(v,y,"cny-uploader",`cny-uploader-${a}`,C&&"is-dragging",m&&"is-disabled",g);return l.jsxs("div",{...w(),ref:x,"aria-label":typeof n=="string"?n:"Upload files",className:R,style:M,children:[j,l.jsx("input",{...b()}),s??l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-uploader-icon","aria-hidden":"true",children:o??l.jsx(kS,{})}),l.jsxs("span",{className:"cny-uploader-text",children:[l.jsx("span",{className:"cny-uploader-label",children:n}),r!=null&&l.jsx("span",{className:"cny-uploader-hint",children:r})]}),i!==!1&&l.jsx(jr,{type:"button",variant:"outline",size:a==="sm"?"sm":"md",disabled:m,tabIndex:-1,onClick:T=>{T.stopPropagation(),P()},children:i})]})]})}),TI=5;function Bd(t){if(t.length===0)return[];const n=t.reduce((a,c)=>a+(c.def??0),0),r=t.filter(a=>a.def==null).length,o=r?Math.max(0,100-n)/r:0,s=t.map(a=>a.def==null?o:a.def),i=s.reduce((a,c)=>a+c,0)||1;return s.map(a=>a/i*100)}function Gd(t,e,n,r){if(e<0||e+1>=t.length)return t;const o=t[e]+t[e+1];let s=Math.max(r[e].min,Math.min(r[e].max,t[e]+n));const i=Math.max(r[e+1].min,Math.min(r[e+1].max,o-s));s=Math.max(r[e].min,Math.min(r[e].max,o-i));const a=[...t];return a[e]=s,a[e+1]=i,a}const Ma=S.forwardRef(function({defaultSize:e,minSize:n,maxSize:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=se(i,s,"cny-panel",o);return l.jsxs("div",{ref:u,className:d,style:f,...c,children:[h,a]})}),Zg=S.forwardRef(function({disabled:e,className:n,__internal:r,...o},s){const i=(r==null?void 0:r.direction)!=="vertical",a=c=>{if(!r||e)return;const u=i?"ArrowRight":"ArrowDown",d=i?"ArrowLeft":"ArrowUp";c.key===u?(c.preventDefault(),r.onKeyResize(1)):c.key===d&&(c.preventDefault(),r.onKeyResize(-1))};return l.jsx("div",{ref:s,role:"separator",tabIndex:e?-1:0,"aria-orientation":i?"vertical":"horizontal","aria-valuenow":r==null?void 0:r.valueNow,"aria-valuemin":r==null?void 0:r.valueMin,"aria-valuemax":r==null?void 0:r.valueMax,"aria-disabled":e||void 0,className:U("cny-panel-handle",i?"cny-panel-handle-h":"cny-panel-handle-v",n),onPointerDown:c=>{e||(c.preventDefault(),r==null||r.onResizeStart(c))},onKeyDown:a,...o})}),MI=S.forwardRef(function({direction:e="horizontal",className:n,style:r,sx:o,children:s,...i},a){const c=S.useRef(null),u=S.Children.toArray(s).filter(S.isValidElement),d=u.filter(j=>j.type===Ma).map(j=>{const T=j.props;return{min:T.minSize??10,max:T.maxSize??90,def:T.defaultSize??null}}),[f,h]=S.useState(()=>Bd(d)),m=f.length===d.length?f:Bd(d),g=S.useRef(null),y=(j,T)=>{const E=e==="horizontal"?T.clientX:T.clientY;g.current={g:j,start:E,startSizes:m};const k=$=>{var O;const G=g.current,Q=(O=c.current)==null?void 0:O.getBoundingClientRect();if(!G||!Q)return;const V=e==="horizontal"?Q.width:Q.height;if(!V)return;const L=((e==="horizontal"?$.clientX:$.clientY)-G.start)/V*100;h(Gd(G.startSizes,G.g,L,d))},_=()=>{g.current=null,window.removeEventListener("pointermove",k),window.removeEventListener("pointerup",_)};window.addEventListener("pointermove",k),window.addEventListener("pointerup",_)},v=(j,T)=>{h(Gd(m,j,T*TI,d))},x=j=>{c.current=j,typeof a=="function"?a(j):a&&(a.current=j)};let w=-1,b=-1;const C=u.map(j=>{var T,E;if(j.type===Ma){w+=1;const k=w,_={...j.props.style,flexBasis:`${m[k]??0}%`,flexGrow:0,flexShrink:0};return S.cloneElement(j,{key:j.key??`panel-${k}`,style:_})}if(j.type===Zg){b+=1;const k=b,_={direction:e,valueNow:Math.round(m[k]??0),valueMin:((T=d[k])==null?void 0:T.min)??0,valueMax:((E=d[k])==null?void 0:E.max)??100,onResizeStart:$=>y(k,$),onKeyResize:$=>v(k,$)};return S.cloneElement(j,{key:j.key??`handle-${k}`,__internal:_})}return j}),{className:P,style:R,styleTag:M}=se(o,r,"cny-panel-group",e==="vertical"&&"is-vertical",n);return l.jsxs("div",{ref:x,className:P,style:R,...i,children:[M,C]})});function EI(){}function jI(t,e,n,r){if(e<1)return[];if(e===1)return[{type:"page",page:1}];const o=e,s=Math.max(1,t-n),i=Math.min(o,t+n),a=[],c=r&&s>1,u=r&&i<o,d=c&&s>2,f=u&&i<o-1;c&&a.push({type:"page",page:1}),d&&a.push({type:"ellipsis",key:"l"});for(let h=s;h<=i;h++)a.push({type:"page",page:h});return f&&a.push({type:"ellipsis",key:"r"}),u&&a.push({type:"page",page:o}),a.filter((h,m,g)=>h.type!=="page"?!0:g.findIndex(y=>y.type==="page"&&y.page===h.page)===m)}const Qg=S.forwardRef(function({page:e,pageCount:n,onPageChange:r,siblingCount:o=1,showEdges:s=!0,hideControls:i=!1,size:a="md",className:c,style:u,sx:d,"aria-label":f="Pagination"},h){const m=S.useMemo(()=>jI(e,n,o,s),[e,n,o,s]),g=w=>{w<1||w>n||w===e||r(w)},{className:y,style:v,styleTag:x}=se(d,u,"cny-pagination",`cny-pagination-${a}`,c);return l.jsxs("nav",{ref:h,role:"navigation","aria-label":f,className:y,style:v,children:[x,!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>g(e-1),disabled:e<=1,"aria-label":"Previous page",children:l.jsx(Vo,{size:14,"aria-hidden":"true"})}),m.map(w=>w.type==="ellipsis"?l.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:l.jsx(_S,{size:14})},`e-${w.key}`):l.jsx("button",{type:"button",className:U("cny-pagination-btn",w.page===e&&"is-active"),"aria-current":w.page===e?"page":void 0,onClick:()=>g(w.page),children:w.page},w.page)),!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>g(e+1),disabled:e>=n,"aria-label":"Next page",children:l.jsx(Jt,{size:14,"aria-hidden":"true"})})]})}),Mi={left:"cny-dt-left",center:"cny-dt-center",right:"cny-dt-right"};function AI(t){return t.id}function DI(t,e){return!t||t.field!==e?{field:e,sort:"asc"}:t.sort==="asc"?{field:e,sort:"desc"}:null}const II=S.forwardRef(function({columns:e,rows:n,getRowId:r=AI,loading:o=!1,rowCount:s,paginationModel:i,onPaginationModelChange:a,checkboxSelection:c=!1,rowSelectionModel:u,onRowSelectionModelChange:d,sortModel:f,onSortModelChange:h,onRowClick:m,noRowsLabel:g="No rows",disableColumnResize:y=!1,density:v="standard",checkboxColumnWidth:x=44,stickyHeader:w=!1,tableLayout:b="auto",getRowClassName:C,className:P,style:R,sx:M},j){const T=e.length+(c?1:0),E=S.useRef(null),[k,_]=S.useState(null),$=(F,q)=>{var gn;q.preventDefault(),q.stopPropagation();const he={};(gn=E.current)==null||gn.querySelectorAll("thead th[data-field]").forEach(pe=>{const we=pe.dataset.field;we&&(he[we]=pe.getBoundingClientRect().width)});const ue=q.clientX,He=he[F]??0;_(he);const ve=pe=>{_({...he,[F]:Math.max(60,He+(pe.clientX-ue))})},qe=()=>{window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",qe)};window.addEventListener("pointermove",ve),window.addEventListener("pointerup",qe)},G=F=>!y&&F.resizable!==!1,Q=u??[],V=new Set(Q),I=n.map(F=>r(F)),L=I.length>0&&I.every(F=>V.has(F)),O=I.some(F=>V.has(F)),D=L?!0:O?"indeterminate":!1,X=()=>{if(d)if(L)d(Q.filter(F=>!I.includes(F)));else{const F=new Set(Q);I.forEach(q=>F.add(q)),d([...F])}},A=F=>{d&&(V.has(F)?d(Q.filter(q=>q!==F)):d([...Q,F]))},B=F=>{!F.sortable||!h||h(DI(f,F.field))},ee=b==="fixed",K=e.reduce((F,q)=>q.width!=null?F:F+(q.flex??1),0),W=(c?x:0)+e.reduce((F,q)=>typeof q.width=="number"?F+q.width:F,0),oe=F=>{if(F.width!=null)return F.width;if(K<=0)return;const q=(F.flex??1)/K;return W>0?`calc((100% - ${W}px) * ${q.toFixed(6)})`:`${(q*100).toFixed(4)}%`},Y=F=>F.width!=null?{width:F.width,minWidth:F.width}:{flex:F.flex??1},z=()=>{if(!i||s==null)return null;const{page:F,pageSize:q}=i,he=Math.max(1,Math.ceil(s/q)),ue=s===0?0:F*q+1,He=Math.min(s,(F+1)*q);return l.jsxs("div",{className:"cny-dt-footer",children:[l.jsxs("span",{className:"cny-dt-count",children:[ue,"–",He," of ",s]}),l.jsx(Qg,{page:F+1,pageCount:he,size:"sm",onPageChange:ve=>a==null?void 0:a({page:ve-1,pageSize:q})})]})},{className:Z,style:le,styleTag:ce}=se(M,R,"cny-dt",v==="compact"&&"cny-dt-compact",w&&"cny-dt-sticky",P);return l.jsxs("div",{ref:j,className:Z,style:le,children:[ce,l.jsx("div",{className:"cny-dt-scroll",children:l.jsxs("table",{ref:E,className:"cny-dt-table",style:k?{tableLayout:"fixed",width:"max-content",minWidth:"100%"}:ee?{tableLayout:"fixed",width:"100%"}:void 0,children:[(k||ee)&&l.jsxs("colgroup",{children:[c&&l.jsx("col",{style:{width:x}}),e.map(F=>l.jsx("col",{style:{width:k?k[F.field]:oe(F)}},F.field))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[c&&l.jsx("th",{className:"cny-dt-checkbox-cell",scope:"col",children:l.jsx(Ca,{checked:D,onCheckedChange:X,"aria-label":"Select all rows"})}),e.map(F=>{const q=(f==null?void 0:f.field)===F.field,he=F.headerAlign??F.align;return l.jsxs("th",{scope:"col","data-field":F.field,style:k?void 0:Y(F),"aria-sort":q?f.sort==="asc"?"ascending":"descending":void 0,className:U(he&&Mi[he],F.sortable&&"cny-dt-sortable",q&&"is-sorted"),children:[F.sortable?l.jsx("button",{type:"button",className:"cny-dt-sortbtn",onClick:()=>B(F),children:l.jsxs("span",{className:"cny-dt-th-inner",children:[F.headerName??F.field,l.jsx("span",{className:"cny-dt-sort-icon","aria-hidden":"true",children:q?f.sort==="desc"?l.jsx(zr,{size:14}):l.jsx(bp,{size:14}):l.jsx(wp,{size:14})})]})}):l.jsx("span",{className:"cny-dt-th-inner",children:F.headerName??F.field}),G(F)&&l.jsx("span",{className:"cny-dt-resizer","aria-hidden":"true",onClick:ue=>ue.stopPropagation(),onPointerDown:ue=>$(F.field,ue)})]},F.field)})]})}),l.jsx("tbody",{children:o?Array.from({length:(i==null?void 0:i.pageSize)??Math.max(n.length,5)}).map((F,q)=>l.jsxs("tr",{className:"cny-dt-row",children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",children:l.jsx(ia,{shape:"avatar",width:16,height:16})}),e.map(he=>l.jsx("td",{className:he.align&&Mi[he.align],children:l.jsx(ia,{width:"70%"})},he.field))]},`sk-${q}`)):n.length===0?l.jsx("tr",{children:l.jsx("td",{className:"cny-dt-empty",colSpan:T,children:g})}):n.map(F=>{const q=r(F),he=V.has(q);return l.jsxs("tr",{className:U("cny-dt-row",he&&"is-selected",m&&"is-clickable",C==null?void 0:C(F)),onClick:()=>m==null?void 0:m(F),tabIndex:m?0:void 0,onKeyDown:m?ue=>{ue.target===ue.currentTarget&&(ue.key==="Enter"||ue.key===" ")&&(ue.preventDefault(),m(F))}:void 0,children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",onClick:ue=>ue.stopPropagation(),children:l.jsx(Ca,{checked:he,onCheckedChange:()=>A(q),"aria-label":`Select row ${String(q)}`})}),e.map(ue=>{const He=ue.valueGetter?ue.valueGetter({row:F,field:ue.field}):F[ue.field];return l.jsx("td",{className:ue.align&&Mi[ue.align],children:ue.renderCell?ue.renderCell({row:F,value:He,field:ue.field}):He},ue.field)})]},String(q))})})]})}),z()]})}),Ea=["var(--color-primary)","var(--color-success)","var(--color-warning)","var(--color-danger)","var(--color-info)","var(--color-neutral)"];function Tn(t,e){return e??Ea[t%Ea.length]}function sl(t=600){const e=S.useRef(null),[n,r]=S.useState(t);return S.useLayoutEffect(()=>{const o=e.current;if(!o||typeof ResizeObserver>"u")return;const s=new ResizeObserver(i=>{var c;const a=Math.round(((c=i[0])==null?void 0:c.contentRect.width)??0);a>0&&r(u=>u===a?u:a)});return s.observe(o),()=>s.disconnect()},[]),[e,n]}function Jg(t,e=4){if(t<=0)return{max:1,ticks:[0,1]};const n=t/e,r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r,s=(o<=1?1:o<=2?2:o<=5?5:10)*r,i=Math.ceil(t/s)*s,a=[];for(let c=0;c<=i+1e-9;c+=s)a.push(Number(c.toFixed(6)));return{max:i,ticks:a}}function kI(t,e,n,r,o,s){const i=(v,x)=>[t+v*Math.sin(x),e-v*Math.cos(x)],a=s-o>Math.PI?1:0,[c,u]=i(n,o),[d,f]=i(n,s);if(r<=0)return`M ${t} ${e} L ${c} ${u} A ${n} ${n} 0 ${a} 1 ${d} ${f} Z`;const[h,m]=i(r,s),[g,y]=i(r,o);return[`M ${c} ${u}`,`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,`L ${h} ${m}`,`A ${r} ${r} 0 ${a} 0 ${g} ${y}`,"Z"].join(" ")}function il({caption:t,head:e,rows:n}){return l.jsxs("table",{className:"cny-sr-only",children:[l.jsx("caption",{children:t}),l.jsx("thead",{children:l.jsx("tr",{children:e.map((r,o)=>l.jsx("th",{scope:"col",children:r},o))})}),l.jsx("tbody",{children:n.map((r,o)=>l.jsx("tr",{children:r.map((s,i)=>l.jsx("td",{children:s},i))},o))})]})}const Oe={top:12,right:14,bottom:28,left:40};function NI({data:t,xKey:e,series:n,height:r=260,label:o="Bar chart",stacked:s=!1,grid:i=!0,legend:a=!0,yTickFormatter:c=g=>String(g),xTickFormatter:u=g=>g,renderTooltip:d,className:f,style:h,sx:m}){const[g,y]=sl(),[v,x]=S.useState(null),w=Math.max(0,y-Oe.left-Oe.right),b=Math.max(0,r-Oe.top-Oe.bottom),C=(I,L)=>Number(I[L]??0),P=t.length?Math.max(0,...t.map(I=>s?n.reduce((L,O)=>L+C(I,O.key),0):Math.max(...n.map(L=>C(I,L.key))))):0,{max:R,ticks:M}=Jg(P),j=I=>Oe.top+b*(1-I/R),T=t.length,E=T?w/T:0,k=E*.68,_=I=>Oe.left+I*E+(E-k)/2,$=s?k:k/Math.max(1,n.length),{className:G,style:Q,styleTag:V}=se(m,{position:"relative",...h},"cny-chart",f);return l.jsxs("div",{ref:g,className:G,style:Q,children:[V,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${y} ${r}`,role:"img","aria-label":o,children:[i&&M.map(I=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:Oe.left,x2:y-Oe.right,y1:j(I),y2:j(I)}),l.jsx("text",{className:"cny-chart-axis",x:Oe.left-6,y:j(I),dy:"0.32em",textAnchor:"end",children:c(I)})]},I)),t.map((I,L)=>{let O=0;return l.jsx("g",{children:n.map((D,X)=>{const A=C(I,D.key),B=A/R*b;let ee,K;return s?(ee=_(L),K=j(O+A),O+=A):(ee=_(L)+X*$,K=j(A)),l.jsx("rect",{className:"cny-chart-bar",x:ee,y:K,width:Math.max(0,$-(s?0:2)),height:Math.max(0,B),rx:2,fill:Tn(X,D.color)},D.key)})},L)}),t.map((I,L)=>{const O=u(String(I[e]??"")),D=`${O}: ${n.map(X=>`${X.label??X.key} ${C(I,X.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:Oe.left+L*E+E/2,y:r-Oe.bottom+16,textAnchor:"middle",children:O}),l.jsx("rect",{className:"cny-chart-hit",x:Oe.left+L*E,y:Oe.top,width:E,height:b,fill:"transparent",tabIndex:0,"aria-label":D,onMouseEnter:()=>x({index:L,x:Oe.left+L*E+E/2,y:Oe.top}),onMouseLeave:()=>x(null),onFocus:()=>x({index:L,x:Oe.left+L*E+E/2,y:Oe.top}),onBlur:()=>x(null)})]},`x-${L}`)})]}),l.jsx(il,{caption:o,head:[String(e),...n.map(I=>I.label??I.key)],rows:t.map(I=>[u(String(I[e]??"")),...n.map(L=>C(I,L.key))])}),v&&t[v.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${v.x/y*100}%`,top:v.y},children:d?d({label:String(t[v.index][e]),datum:t[v.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[v.index][e])}),n.map((I,L)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(L,I.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:I.label??I.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:C(t[v.index],I.key)})]},I.key))]})}),a&&l.jsx("div",{className:"cny-chart-legend",children:n.map((I,L)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(L,I.color)}}),I.label??I.key]},I.key))})]})}const st={top:12,right:14,bottom:28,left:40};function ey({data:t,xKey:e,series:n,height:r=260,label:o="Line chart",area:s=!1,stacked:i=!1,dots:a=!0,grid:c=!0,legend:u=!0,yTickFormatter:d=v=>String(v),xTickFormatter:f=v=>v,renderTooltip:h,className:m,style:g,sx:y}){const[v,x]=sl(),[w,b]=S.useState(null),C=Math.max(0,x-st.left-st.right),P=Math.max(0,r-st.top-st.bottom),R=(O,D)=>Number(O[D]??0),M=t.length?Math.max(0,...t.map(O=>i?n.reduce((D,X)=>D+R(O,X.key),0):Math.max(...n.map(D=>R(O,D.key))))):0,{max:j,ticks:T}=Jg(M),E=O=>st.top+P*(1-O/j),k=t.length,_=k?C/k:0,$=O=>st.left+O*_+_/2,G=E(0),Q=t.map(()=>0),{className:V,style:I,styleTag:L}=se(y,{position:"relative",...g},"cny-chart",m);return l.jsxs("div",{ref:v,className:V,style:I,children:[L,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${x} ${r}`,role:"img","aria-label":o,children:[c&&T.map(O=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:st.left,x2:x-st.right,y1:E(O),y2:E(O)}),l.jsx("text",{className:"cny-chart-axis",x:st.left-6,y:E(O),dy:"0.32em",textAnchor:"end",children:d(O)})]},O)),n.map((O,D)=>{const X=Tn(D,O.color),A=t.map((K,W)=>{const oe=R(K,O.key),Y=i?Q[W]:0,z=Y+oe;return i&&(Q[W]=z),{x:$(W),y:E(z),yBase:E(Y)}});if(A.length===0)return null;const B=A.map(K=>`${K.x},${K.y}`).join(" "),ee=`M ${A[0].x} ${i?A[0].yBase:G} `+A.map(K=>`L ${K.x} ${K.y}`).join(" ")+` L ${A[A.length-1].x} ${i?A[A.length-1].yBase:G} Z`;return l.jsxs("g",{children:[s&&l.jsx("path",{className:"cny-chart-area",d:ee,fill:X}),l.jsx("polyline",{className:"cny-chart-line",points:B,fill:"none",stroke:X}),a&&A.map((K,W)=>l.jsx("circle",{className:"cny-chart-dot",cx:K.x,cy:K.y,r:3,fill:X},W))]},O.key)}),t.map((O,D)=>{const X=f(String(O[e]??"")),A=`${X}: ${n.map(B=>`${B.label??B.key} ${R(O,B.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:$(D),y:r-st.bottom+16,textAnchor:"middle",children:X}),l.jsx("rect",{className:"cny-chart-hit",x:st.left+D*_,y:st.top,width:_,height:P,fill:"transparent",tabIndex:0,"aria-label":A,onMouseEnter:()=>b({index:D,x:$(D)}),onMouseLeave:()=>b(null),onFocus:()=>b({index:D,x:$(D)}),onBlur:()=>b(null)})]},`x-${D}`)})]}),l.jsx(il,{caption:o,head:[String(e),...n.map(O=>O.label??O.key)],rows:t.map(O=>[f(String(O[e]??"")),...n.map(D=>R(O,D.key))])}),w&&t[w.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${w.x/x*100}%`,top:st.top},children:h?h({label:String(t[w.index][e]),datum:t[w.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[w.index][e])}),n.map((O,D)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(D,O.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:O.label??O.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:R(t[w.index],O.key)})]},O.key))]})}),u&&l.jsx("div",{className:"cny-chart-legend",children:n.map((O,D)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(D,O.color)}}),O.label??O.key]},O.key))})]})}function _I(t){return l.jsx(ey,{...t,area:!1})}function OI(t){return l.jsx(ey,{...t,area:!0})}function LI({data:t,height:e=260,label:n="Pie chart",innerRadius:r=0,legend:o=!0,renderTooltip:s,centerLabel:i,className:a,style:c,sx:u}){const[d,f]=sl(360),[h,m]=S.useState(null),g=t.reduce((T,E)=>T+Math.max(0,E.value),0),y=Math.min(f,e),v=f/2,x=e/2,w=y/2*.86,b=r>0?w*r:0;let C=0;const P=t.map((T,E)=>{const k=g>0?Math.max(0,T.value)/g:0,_=C,$=C+k*Math.PI*2;return C=$,{d:T,i:E,start:_,end:$,frac:k,color:Tn(E,T.color)}}),{className:R,style:M,styleTag:j}=se(u,{position:"relative",...c},"cny-chart",a);return l.jsxs("div",{ref:d,className:R,style:M,children:[j,l.jsxs("svg",{width:"100%",height:e,viewBox:`0 0 ${f} ${e}`,role:"img","aria-label":n,children:[P.map(T=>T.frac>=.9999?l.jsx("circle",{className:U("cny-chart-slice",h===T.i&&"is-active"),cx:v,cy:x,r:b>0?(w+b)/2:w,fill:b>0?"none":T.color,stroke:b>0?T.color:void 0,strokeWidth:b>0?w-b:void 0,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i):l.jsx("path",{className:U("cny-chart-slice",h===T.i&&"is-active"),d:kI(v,x,w,b,T.start,T.end),fill:T.color,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i)),i!=null&&b>0&&l.jsx("foreignObject",{x:v-b,y:x-b,width:b*2,height:b*2,children:l.jsx("div",{className:"cny-chart-center",children:i})})]}),l.jsx(il,{caption:n,head:["Slice","Value","Share"],rows:P.map(T=>[T.d.label,T.d.value,`${Math.round(T.frac*100)}%`])}),h!=null&&P[h]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:"50%",top:8,transform:"translateX(-50%)"},children:s?s({datum:P[h].d,percent:P[h].frac}):l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:P[h].color}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:P[h].d.label}),l.jsxs("span",{className:"cny-chart-tooltip-value",children:[P[h].d.value," (",Math.round(P[h].frac*100),"%)"]})]})}),o&&l.jsx("div",{className:"cny-chart-legend",children:P.map(T=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:T.color}}),T.d.label]},T.i))})]})}function $I({height:t=300,children:e,className:n,style:r,sx:o}){const s=S.Children.only(e),{className:i,style:a,styleTag:c}=se(o,{width:"100%",height:t,...r},"cny-chart-responsive",n);return l.jsxs("div",{className:i,style:a,children:[c,S.isValidElement(s)?S.cloneElement(s,{height:t}):s]})}const FI=S.forwardRef(function({variant:e="dividers",size:n="md",dense:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=se(i,s,"cny-list",e,`size-${n}`,r&&"is-dense",o);return l.jsxs("ul",{ref:u,className:d,style:f,...c,children:[h,a]})}),VI=S.forwardRef(function({leading:e,trailing:n,primary:r,secondary:o,onClick:s,href:i,disabled:a,active:c,as:u,children:d,className:f,...h},m){const g=u??(i?"a":s?"button":"li"),y=!a&&(i!=null||s!=null),v=d??l.jsxs(l.Fragment,{children:[e&&l.jsx("span",{className:"cny-list-item-leading",children:e}),l.jsxs("span",{className:"cny-list-item-body",children:[r!=null&&l.jsx("span",{className:"cny-list-item-primary",children:r}),o!=null&&l.jsx("span",{className:"cny-list-item-secondary",children:o})]}),n&&l.jsx("span",{className:"cny-list-item-trailing",children:n})]}),x=l.jsx(g,{ref:m,href:i,onClick:a?void 0:s,"aria-disabled":a||void 0,"aria-current":c?"page":void 0,tabIndex:y&&g==="div"?0:void 0,className:U("cny-list-item",c&&"is-active",a&&"is-disabled",y&&"is-interactive",f),...h,children:v});return g==="li"?x:l.jsx("li",{className:"cny-list-item-wrap",children:x})}),BI=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,role:"separator",className:U("cny-list-separator",e),...n})}),GI=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("li",{ref:o,className:U("cny-list-subheader",e),...r,children:n})});var zI=Object.defineProperty,pr=(t,e)=>zI(t,"name",{value:e,configurable:!0}),al="Tabs",[UI,TN]=Re(al,[un]),ty=un(),[HI,cl]=UI(al),WI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,value:o,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:c,activationMode:u="automatic",...d}=e,f=Ht(c),[h,m]=Pe({prop:o,onChange:s,defaultProp:i??"",caller:al});return l.jsx(HI,{scope:r,baseId:Fe(),value:h,onValueChange:m,orientation:a,dir:f,activationMode:u,children:l.jsx(re.div,{dir:f,"data-orientation":a,...d,ref:n})})},"Tabs")),KI="TabsList",YI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,loop:o=!0,...s}=e,i=cl(KI,r),a=ty(r);return l.jsx(ds,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:o,children:l.jsx(re.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:n})})},"TabsList")),XI="TabsTrigger",qI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,value:o,disabled:s=!1,...i}=e,a=cl(XI,r),c=ty(r),u=ll(a.baseId,o),d=ul(a.baseId,o),f=o===a.value;return l.jsx(fs,{asChild:!0,...c,focusable:!s,active:f,children:l.jsx(re.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...i,ref:n,onMouseDown:H(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?a.onValueChange(o):h.preventDefault()}),onKeyDown:H(e.onKeyDown,h=>{s||h.target!==h.currentTarget||[" ","Enter"].includes(h.key)&&a.onValueChange(o)}),onFocus:H(e.onFocus,()=>{const h=a.activationMode!=="manual";!f&&!s&&h&&a.onValueChange(o)})})})},"TabsTrigger")),ZI="TabsContent",QI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,value:o,forceMount:s,children:i,...a}=e,c=cl(ZI,r),u=ll(c.baseId,o),d=ul(c.baseId,o),f=o===c.value,h=p.useRef(f);return p.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Ue,{present:s||f,children:({present:m})=>l.jsx(re.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...a,ref:n,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&i})})},"TabsContent"));function ll(t,e){return`${t}-trigger-${e}`}pr(ll,"makeTriggerId");function ul(t,e){return`${t}-content-${e}`}pr(ul,"makeContentId");var JI=WI,ek=YI,tk=qI,nk=QI;const rk=S.forwardRef(function({variant:e="line",size:n="md",className:r,style:o,sx:s,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(s,o,"cny-tabs",`variant-${e}`,`size-${n}`,r);return l.jsxs(JI,{ref:c,className:u,style:d,...a,children:[f,i]})}),ok=S.forwardRef(function({className:e,...n},r){return l.jsx(ek,{ref:r,className:U("cny-tabs-list",e),...n})}),sk=S.forwardRef(function({icon:e,badge:n,className:r,children:o,...s},i){return l.jsxs(tk,{ref:i,className:U("cny-tabs-trigger",r),...s,children:[e&&l.jsx("span",{className:"cny-tabs-trigger-icon",children:e}),l.jsx("span",{className:"cny-tabs-trigger-label",children:o}),n&&l.jsx("span",{className:"cny-tabs-trigger-badge",children:n})]})}),ik=S.forwardRef(function({className:e,...n},r){return l.jsx(nk,{ref:r,className:U("cny-tabs-content",e),...n})});function ak(t){return t.multiple===!0}const ck=S.forwardRef(function(e,n){const{options:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No results.",loading:a=!1,loadingText:c="Loading…",size:u,color:d="primary",disabled:f=!1,clearable:h=!0,id:m,"aria-invalid":g,"aria-describedby":y,"aria-label":v,className:x,style:w,sx:b}=e,C=S.useId(),P=m??`cny-ac-${C}`,[R,M]=S.useState(!1),[j,T]=S.useState(""),E=S.useRef(null),k=ak(e),[_,$]=S.useState(!k&&e.defaultValue!==void 0?e.defaultValue??null:null),[G,Q]=S.useState(k&&e.defaultValue!==void 0?e.defaultValue??[]:[]),V=k?e.value!==void 0?e.value:G:(()=>{const W=e.value!==void 0?e.value:_;return W==null?[]:[W]})(),I=S.useCallback(W=>{var oe,Y;if(k)e.value===void 0&&Q(W),(oe=e.onValueChange)==null||oe.call(e,W);else{const z=W[0]??null;e.value===void 0&&$(z),(Y=e.onValueChange)==null||Y.call(e,z)}},[k,e]),L=S.useCallback(W=>{if(!W.disabled)if(k){const oe=e.maxItems,Y=V.includes(W.value);let z;if(Y)z=V.filter(Z=>Z!==W.value);else{if(oe!=null&&V.length>=oe)return;z=[...V,W.value]}I(z)}else I([W.value]),M(!1)},[I,k,V,e]),O=S.useCallback(W=>{var oe;W.stopPropagation(),I([]),(oe=E.current)==null||oe.focus()},[I]),D=S.useMemo(()=>{const W=new Map;for(const oe of r){const Y=oe.group??"";W.has(Y)||W.set(Y,[]),W.get(Y).push(oe)}return Array.from(W.entries())},[r]),X=W=>{var oe;return((oe=r.find(Y=>Y.value===W))==null?void 0:oe.label)??W},A=V.length===0?o:k?V.length===1?X(V[0]):`${X(V[0])} +${V.length-1}`:X(V[0]),{className:B,style:ee,styleTag:K}=se(b,w,"cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,V.length>0&&"has-value",R&&"is-open",x);return l.jsxs(Dc,{open:R,onOpenChange:M,children:[l.jsx(Ic,{asChild:!0,children:l.jsxs("button",{ref:W=>{E.current=W,typeof n=="function"?n(W):n&&(n.current=W)},type:"button",id:P,className:B,style:ee,disabled:f,"aria-label":v,"aria-invalid":g,"aria-describedby":y,"aria-haspopup":"listbox","aria-expanded":R,children:[K,l.jsx("span",{className:U("cny-ac-value",V.length===0&&"is-placeholder"),children:A}),h&&V.length>0&&!f&&l.jsx("span",{role:"button",tabIndex:0,className:"cny-ac-clear","aria-label":"Clear",onClick:O,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),O(W))},onPointerDown:W=>W.stopPropagation(),children:l.jsx(Wt,{size:13,"aria-hidden":"true"})}),l.jsx(wp,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),l.jsx(kc,{children:l.jsx(Nc,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(De,{className:"cny-ac-cmdk",shouldFilter:!a,children:[l.jsx("div",{className:"cny-ac-search",children:l.jsx(De.Input,{value:j,onValueChange:T,placeholder:s})}),l.jsx(De.List,{className:"cny-ac-list",children:a?l.jsxs("div",{className:"cny-ac-loading",children:[l.jsx(Tp,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),l.jsx("span",{children:c})]}):l.jsxs(l.Fragment,{children:[l.jsx(De.Empty,{className:"cny-ac-empty",children:i},"empty"),D.map(([W,oe],Y)=>{const z=oe.map((Z,le)=>{const ce=V.includes(Z.value);return l.jsxs(De.Item,{value:`${W} ${Z.label} ${Z.value}`,disabled:Z.disabled,onSelect:()=>L(Z),className:U("cny-ac-item",ce&&"is-checked"),children:[k?l.jsx("span",{className:U("cny-ac-checkbox",ce&&"is-checked"),children:ce&&l.jsx(rn,{size:12,"aria-hidden":"true"})}):l.jsxs("span",{className:"cny-ac-icon",children:[Z.icon??null,!Z.icon&&ce&&l.jsx(rn,{size:14,"aria-hidden":"true"})]}),l.jsx("span",{className:"cny-ac-item-label",children:Z.label}),Z.hint&&l.jsx("span",{className:"cny-ac-item-hint",children:Z.hint})]},Z.value||`opt-${Y}-${le}`)});return W===""?l.jsx(De.Group,{children:z},`__ungrouped_${Y}`):l.jsx(De.Group,{heading:W,children:z},W||`group_${Y}`)})]})})]})})})]})}),lk=S.forwardRef(function({items:e,separator:n,size:r="md",className:o,style:s,sx:i,...a},c){const u=n??l.jsx(Jt,{size:12,"aria-hidden":"true"}),{className:d,style:f,styleTag:h}=se(i,s,"cny-breadcrumb",`cny-breadcrumb-${r}`,o);return l.jsxs("nav",{ref:c,"aria-label":"Breadcrumb",className:d,style:f,...a,children:[h,l.jsx("ol",{className:"cny-breadcrumb-list",children:e.map((m,g)=>{const y=g===e.length-1,v=l.jsx("span",{className:U("cny-breadcrumb-label",y&&"is-current"),children:m.label}),x=m.render?m.render(v):m.href&&!y?l.jsx("a",{href:m.href,className:"cny-breadcrumb-link",children:v}):v;return l.jsxs("li",{className:"cny-breadcrumb-item",children:[y?l.jsx("span",{"aria-current":"page",children:v}):x,!y&&l.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:u})]},g)})})]})});var uk=Object.defineProperty,to=(t,e)=>uk(t,"name",{value:e,configurable:!0}),dl="Collapsible",[dk,ny]=Re(dl),[fk,fl]=dk(dl),hk=p.forwardRef(to(function(e,n){const{__scopeCollapsible:r,open:o,defaultOpen:s,disabled:i,onOpenChange:a,...c}=e,[u,d]=Pe({prop:o,defaultProp:s??!1,onChange:a,caller:dl});return l.jsx(fk,{scope:r,disabled:i,contentId:Fe(),open:u,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),children:l.jsx(re.div,{"data-state":Ns(u),"data-disabled":i?"":void 0,...c,ref:n})})},"Collapsible")),pk="CollapsibleTrigger",mk=p.forwardRef(to(function(e,n){const{__scopeCollapsible:r,...o}=e,s=fl(pk,r);return l.jsx(re.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":Ns(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...o,ref:n,onClick:H(e.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),ry="CollapsibleContent",gk=p.forwardRef(to(function(e,n){const{forceMount:r,...o}=e,s=fl(ry,e.__scopeCollapsible);return l.jsx(Ue,{present:r||s.open,children:({present:i})=>l.jsx(yk,{...o,ref:n,present:i})})},"CollapsibleContent")),yk=p.forwardRef(to(function(e,n){const{__scopeCollapsible:r,present:o,children:s,...i}=e,a=fl(ry,r),[c,u]=p.useState(o),d=p.useRef(null),f=ie(n,d),h=p.useRef(0),m=h.current,g=p.useRef(0),y=g.current,v=a.open||c,x=p.useRef(v),w=p.useRef(void 0);return p.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),Ee(()=>{const b=d.current;if(b){w.current=w.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const C=b.getBoundingClientRect();h.current=C.height,g.current=C.width,x.current||(b.style.transitionDuration=w.current.transitionDuration,b.style.animationName=w.current.animationName),u(o)}},[a.open,o]),l.jsx(re.div,{"data-state":Ns(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...i,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:v&&s})},"CollapsibleContentImpl"));function Ns(t){return t?"open":"closed"}to(Ns,"getState");var vk=hk,xk=mk,bk=gk,wk=Object.defineProperty,lt=(t,e)=>wk(t,"name",{value:e,configurable:!0}),Ot="Accordion",Ck=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[hl,Sk,Pk]=cr(Ot),[_s,MN]=Re(Ot,[Pk,ny]),pl=ny(),Rk=p.forwardRef(lt(function(e,n){const{type:r,...o}=e,s=o,i=o;return l.jsx(hl.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?l.jsx(jk,{...i,ref:n}):l.jsx(Ek,{...s,ref:n})})},"Accordion")),[oy,Tk]=_s(Ot),[sy,Mk]=_s(Ot,{collapsible:!1}),Ek=p.forwardRef(lt(function(e,n){const{value:r,defaultValue:o,onValueChange:s=lt(()=>{},"onValueChange"),collapsible:i=!1,...a}=e,[c,u]=Pe({prop:r,defaultProp:o??"",onChange:s,caller:Ot});return l.jsx(oy,{scope:e.__scopeAccordion,value:p.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:p.useCallback(()=>i&&u(""),[i,u]),children:l.jsx(sy,{scope:e.__scopeAccordion,collapsible:i,children:l.jsx(iy,{...a,ref:n})})})},"AccordionImplSingle")),jk=p.forwardRef(lt(function(e,n){const{value:r,defaultValue:o,onValueChange:s=lt(()=>{},"onValueChange"),...i}=e,[a,c]=Pe({prop:r,defaultProp:o??[],onChange:s,caller:Ot}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return l.jsx(oy,{scope:e.__scopeAccordion,value:a,onItemOpen:u,onItemClose:d,children:l.jsx(sy,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(iy,{...i,ref:n})})})},"AccordionImplMultiple")),[Ak,Os]=_s(Ot),iy=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,disabled:o,dir:s,orientation:i="vertical",...a}=e,c=p.useRef(null),u=ie(c,n),d=Sk(r),h=Ht(s)==="ltr",m=H(e.onKeyDown,g=>{var T;if(!Ck.includes(g.key))return;const y=g.target,v=d().filter(E=>{var k;return!((k=E.ref.current)!=null&&k.disabled)}),x=v.findIndex(E=>E.ref.current===y),w=v.length;if(x===-1)return;g.preventDefault();let b=x;const C=0,P=w-1,R=lt(()=>{b=x+1,b>P&&(b=C)},"moveNext"),M=lt(()=>{b=x-1,b<C&&(b=P)},"movePrev");switch(g.key){case"Home":b=C;break;case"End":b=P;break;case"ArrowRight":i==="horizontal"&&(h?R():M());break;case"ArrowDown":i==="vertical"&&R();break;case"ArrowLeft":i==="horizontal"&&(h?M():R());break;case"ArrowUp":i==="vertical"&&M();break}const j=b%w;(T=v[j].ref.current)==null||T.focus()});return l.jsx(Ak,{scope:r,disabled:o,direction:s,orientation:i,children:l.jsx(hl.Slot,{scope:r,children:l.jsx(re.div,{...a,"data-orientation":i,ref:u,onKeyDown:o?void 0:m})})})},"AccordionImpl")),ja="AccordionItem",[Dk,ml]=_s(ja),Ik=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,value:o,...s}=e,i=Os(ja,r),a=Tk(ja,r),c=pl(r),u=Fe(),d=o&&a.value.includes(o)||!1,f=i.disabled||e.disabled;return l.jsx(Dk,{scope:r,open:d,disabled:f,triggerId:u,children:l.jsx(vk,{"data-orientation":i.orientation,"data-state":gl(d),...c,...s,ref:n,disabled:f,open:d,onOpenChange:h=>{h?a.onItemOpen(o):a.onItemClose(o)}})})},"AccordionItem")),kk="AccordionHeader",Nk=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=ml(kk,r);return l.jsx(re.h3,{"data-orientation":s.orientation,"data-state":gl(i.open),"data-disabled":i.disabled?"":void 0,...o,ref:n})},"AccordionHeader")),zd="AccordionTrigger",_k=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=ml(zd,r),a=Mk(zd,r),c=pl(r);return l.jsx(hl.ItemSlot,{scope:r,children:l.jsx(xk,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...c,...o,ref:n})})},"AccordionTrigger")),Ok="AccordionContent",Lk=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=ml(Ok,r),a=pl(r);return l.jsx(bk,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function gl(t){return t?"open":"closed"}lt(gl,"getState");var $k=Rk,Fk=Ik,Vk=Nk,Bk=_k,Gk=Lk;const zk=S.forwardRef(function({variant:e="plain",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,r,"cny-accordion",`cny-accordion-${e}`,n);return l.jsxs($k,{ref:a,className:c,style:u,...i,children:[d,s]})}),Uk=S.forwardRef(function({className:e,...n},r){return l.jsx(Fk,{ref:r,className:U("cny-accordion-item",e),...n})}),Hk=S.forwardRef(function({children:e,className:n,icon:r,hideIndicator:o,...s},i){return l.jsx(Vk,{className:"cny-accordion-header",children:l.jsxs(Bk,{ref:i,className:U("cny-accordion-trigger",n),...s,children:[r&&l.jsx("span",{className:"cny-accordion-trigger-icon",children:r}),l.jsx("span",{className:"cny-accordion-trigger-label",children:e}),!o&&l.jsx(zr,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),Wk=S.forwardRef(function({children:e,className:n,...r},o){return l.jsx(Gk,{ref:o,className:U("cny-accordion-content",n),...r,children:l.jsx("div",{className:"cny-accordion-content-inner",children:e})})});var Kk=Object.defineProperty,fe=(t,e)=>Kk(t,"name",{value:e,configurable:!0}),ay=["PageUp","PageDown"],cy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ly={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},no="Slider",[Aa,Yk,Xk]=cr(no),[yl,EN]=Re(no,[Xk]),[qk,ro]=yl(no),Zk=p.forwardRef(fe(function(e,n){const{name:r,min:o=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[o],value:f,onValueChange:h=fe(()=>{},"onValueChange"),onValueCommit:m=fe(()=>{},"onValueCommit"),inverted:g=!1,form:y,...v}=e,x=p.useRef(new Set),w=p.useRef(0),b=p.useRef(!1),P=a==="horizontal"?Qk:Jk,[R,M]=p.useState(null),j=ie(n,M),[T=[],E]=Pe({prop:f,defaultProp:d,onChange:fe(I=>{var O;(O=[...x.current][w.current])==null||O.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,h(I)},"onChange")}),k=p.useRef(T),_=p.useRef(T);p.useEffect(()=>{const I=y?R==null?void 0:R.ownerDocument.getElementById(y):R==null?void 0:R.closest("form");if(I instanceof HTMLFormElement){const L=fe(()=>E(_.current),"reset");return I.addEventListener("reset",L),()=>I.removeEventListener("reset",L)}},[R,y,E]);function $(I){const L=yy(T,I);V(I,L)}fe($,"handleSlideStart");function G(I){V(I,w.current)}fe(G,"handleSlideMove");function Q(){String(T)!==String(k.current)&&m(T)}fe(Q,"handleSlideEnd");function V(I,L,{commit:O}={commit:!1}){const D=xl(i),X=Pr(Math.round((I-o)/i)*i+o,D),A=Ar(X,[o,s]);E((B=[])=>{const ee=my(B,A,L);if(by(ee,u*i)){w.current=ee.indexOf(A);const K=String(ee)!==String(B);return K&&O&&m(ee),K?ee:B}else return B})}return fe(V,"updateValues"),l.jsx(qk,{scope:e.__scopeSlider,name:r,disabled:c,min:o,max:s,valueIndexToChangeRef:w,thumbs:x.current,values:T,orientation:a,form:y,children:l.jsx(Aa.Provider,{scope:e.__scopeSlider,children:l.jsx(Aa.Slot,{scope:e.__scopeSlider,children:l.jsx(P,{"aria-disabled":c,"data-disabled":c?"":void 0,...v,ref:j,onPointerDown:H(v.onPointerDown,()=>{c||(k.current=T,b.current=!1)}),min:o,max:s,inverted:g,onSlideStart:c?void 0:$,onSlideMove:c?void 0:G,onSlideEnd:c?void 0:Q,onHomeKeyDown:()=>{c||(b.current=!0,V(o,0,{commit:!0}))},onEndKeyDown:()=>{c||(b.current=!0,V(s,T.length-1,{commit:!0}))},onStepKeyDown:({event:I,direction:L})=>{if(!c){b.current=!0;const X=ay.includes(I.key)||I.shiftKey&&cy.includes(I.key)?10:1,A=w.current,B=T[A],ee=wy(B,{min:o,step:i,direction:L,multiplier:X});V(ee,A,{commit:!0})}}})})})})},"Slider")),[uy,dy]=yl(no,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Qk=p.forwardRef(fe(function(e,n){const{min:r,max:o,dir:s,inverted:i,onSlideStart:a,onSlideMove:c,onSlideEnd:u,onStepKeyDown:d,...f}=e,[h,m]=p.useState(null),g=ie(n,m),y=p.useRef(void 0),v=Ht(s),x=v==="ltr",w=x&&!i||!x&&i;function b(C){const P=y.current||h.getBoundingClientRect(),R=[0,P.width],j=Ls(R,w?[r,o]:[o,r]);return y.current=P,j(C-P.left)}return fe(b,"getValueFromPointer"),l.jsx(uy,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:l.jsx(fy,{dir:v,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const P=b(C.clientX);a==null||a(P)},onSlideMove:C=>{const P=b(C.clientX);c==null||c(P)},onSlideEnd:()=>{y.current=void 0,u==null||u()},onStepKeyDown:C=>{const R=ly[w?"from-left":"from-right"].includes(C.key);d==null||d({event:C,direction:R?-1:1})}})})},"SliderHorizontal")),Jk=p.forwardRef(fe(function(e,n){const{min:r,max:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...d}=e,f=p.useRef(null),h=ie(n,f),m=p.useRef(void 0),g=!s;function y(v){const x=m.current||f.current.getBoundingClientRect(),w=[0,x.height],C=Ls(w,g?[o,r]:[r,o]);return m.current=x,C(v-x.top)}return fe(y,"getValueFromPointer"),l.jsx(uy,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:l.jsx(fy,{"data-orientation":"vertical",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const x=y(v.clientY);i==null||i(x)},onSlideMove:v=>{const x=y(v.clientY);a==null||a(x)},onSlideEnd:()=>{m.current=void 0,c==null||c()},onStepKeyDown:v=>{const w=ly[g?"from-bottom":"from-top"].includes(v.key);u==null||u({event:v,direction:w?-1:1})}})})},"SliderVertical")),fy=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,onSlideStart:o,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:c,onStepKeyDown:u,...d}=e,f=ro(no,r);return l.jsx(re.span,{...d,ref:n,onKeyDown:H(e.onKeyDown,h=>{h.key==="Home"?(a(h),h.preventDefault()):h.key==="End"?(c(h),h.preventDefault()):ay.concat(cy).includes(h.key)&&(u(h),h.preventDefault())}),onPointerDown:H(e.onPointerDown,h=>{const m=h.target;m.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(m)?m.focus({preventScroll:!0,focusVisible:!1}):o(h)}),onPointerMove:H(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:H(e.onPointerUp,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&(m.releasePointerCapture(h.pointerId),i(h))})})},"SliderImpl")),eN="SliderTrack",tN=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,...o}=e,s=ro(eN,r);return l.jsx(re.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...o,ref:n})},"SliderTrack")),Ud="SliderRange",nN=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,...o}=e,s=ro(Ud,r),i=dy(Ud,r),a=p.useRef(null),c=ie(n,a),u=s.values.length,d=s.values.map(m=>vl(m,s.min,s.max)),f=u>1?Math.min(...d):0,h=100-Math.max(...d);return l.jsx(re.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...o,ref:c,style:{...e.style,[i.startEdge]:f+"%",[i.endEdge]:h+"%"}})},"SliderRange")),rN="SliderThumb",[oN,hy]=yl(rN),sN="SliderThumbProvider";function py(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:o}=t,s=ro(sN,e),i=Yk(e),[a,c]=p.useState(null),u=p.useMemo(()=>a?i().findIndex(v=>v.ref.current===a):-1,[i,a]),d=hr(a),f=a?!!s.form||!!a.closest("form"):!0,h=s.values[u],m=n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),g=h===void 0?0:vl(h,s.min,s.max);p.useEffect(()=>{if(a)return s.thumbs.add(a),()=>{s.thumbs.delete(a)}},[a,s.thumbs]);const y={value:h,name:m,form:s.form,isFormControl:f,index:u,thumb:a,onThumbChange:c,percent:g,size:d};return l.jsx(oN,{scope:e,...y,children:Cy(o)?o(y):r})}fe(py,"SliderThumbProvider");var Ei="SliderThumbTrigger",iN=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,...o}=e,s=ro(Ei,r),i=dy(Ei,r),{index:a,value:c,percent:u,size:d,onThumbChange:f}=hy(Ei,r),h=ie(n,f),m=gy(a,s.values.length),g=d==null?void 0:d[i.size],y=g?vy(g,u,i.direction):0;return l.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${u}% + ${y}px)`},children:l.jsx(Aa.ItemSlot,{scope:r,children:l.jsx(re.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":s.min,"aria-valuenow":c,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...o,ref:h,style:c===void 0?{display:"none"}:e.style,onFocus:H(e.onFocus,()=>{s.valueIndexToChangeRef.current=a})})})})},"SliderThumbTrigger")),aN=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,name:o,...s}=e;return l.jsx(py,{__scopeSlider:r,name:o,internal_do_not_use_render:({index:i,isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(iN,{...s,ref:n,__scopeSlider:r}),a?l.jsx(lN,{__scopeSlider:r},i):null]})})},"SliderThumb")),cN="SliderBubbleInput",lN=p.forwardRef(fe(function({__scopeSlider:e,...n},r){const{value:o,name:s,form:i}=hy(cN,e),a=p.useRef(null),c=ie(a,r),u=Pc(o);return p.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(u!==o&&m){const g=new Event("input",{bubbles:!0});m.call(d,o),d.dispatchEvent(g)}},[u,o]),l.jsx(re.input,{style:{display:"none"},name:s,form:i,...n,ref:c,defaultValue:o})},"SliderBubbleInput"));function my(t=[],e,n){const r=[...t];return r[n]=e,r.sort((o,s)=>o-s)}fe(my,"getNextSortedValues");function vl(t,e,n){const s=100/(n-e)*(t-e);return Ar(s,[0,100])}fe(vl,"convertValueToPercentage");function gy(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}fe(gy,"getLabel");function yy(t,e){if(t.length===1)return 0;const n=t.map(o=>Math.abs(o-e)),r=Math.min(...n);return n.indexOf(r)}fe(yy,"getClosestValueIndex");function vy(t,e,n){const r=t/2,s=Ls([0,50],[0,r]);return(r-s(e)*n)*n}fe(vy,"getThumbInBoundsOffset");function xy(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}fe(xy,"getStepsBetweenValues");function by(t,e){if(e>0){const n=xy(t);return Math.min(...n)>=e}return!0}fe(by,"hasMinStepsBetweenValues");function Ls(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}fe(Ls,"linearScale");function xl(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,o]=e.split("e"),s=r.split(".")[1]||"",i=Number(o);return Math.max(0,s.length-i)}const n=e.split(".")[1];return n?n.length:0}fe(xl,"getDecimalCount");function Pr(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}fe(Pr,"roundValue");function wy(t,{min:e,step:n,direction:r,multiplier:o}){const s=xl(n),i=(t-e)/n,a=Math.round(i),c=Pr(a*n+e,s)===Pr(t,s);let u;return c?u=a+o*r:r>0?u=Math.ceil(i):u=Math.floor(i),Pr(u*n+e,s)}fe(wy,"getNextStepValue");function Cy(t){return typeof t=="function"}fe(Cy,"isFunction");const uN=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",color:s="primary",showValue:i=!1,formatValue:a,value:c,defaultValue:u,...d},f){const h=c??u??[0],m=a??(x=>x),{className:g,style:y,styleTag:v}=se(r,n,"cny-slider",`cny-slider-${o}`,`cny-slider-${s}`,e);return l.jsxs(Zk,{ref:f,className:g,style:y,value:c,defaultValue:u,...d,children:[v,l.jsx(tN,{className:"cny-slider-track",children:l.jsx(nN,{className:"cny-slider-range"})}),h.map((x,w)=>l.jsx(aN,{className:"cny-slider-thumb","aria-label":`Value ${w+1}`,children:i&&l.jsx("span",{className:"cny-slider-bubble",children:m(x)})},w))]})}),dN=S.forwardRef(function({steps:e,active:n,orientation:r="horizontal",size:o="md",onStepClick:s,className:i,style:a,sx:c,...u},d){const{className:f,style:h,styleTag:m}=se(c,a,"cny-stepper",`cny-stepper-${r}`,`cny-stepper-${o}`,i);return l.jsxs("ol",{ref:d,className:f,style:h,"aria-label":"Progress",...u,children:[m,e.map((g,y)=>{const v=y<n?"complete":y===n?"active":"upcoming",x=v==="complete"&&!!s;return l.jsxs("li",{className:U("cny-stepper-step",`is-${v}`),children:[l.jsxs("button",{type:"button",className:"cny-stepper-step-row",onClick:x?()=>s==null?void 0:s(y):void 0,disabled:!x,"aria-current":v==="active"?"step":void 0,children:[l.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:v==="complete"?l.jsx(rn,{size:14}):g.icon??y+1}),l.jsxs("span",{className:"cny-stepper-text",children:[l.jsx("span",{className:"cny-stepper-label",children:g.label}),g.description&&l.jsx("span",{className:"cny-stepper-desc",children:g.description})]})]}),y<e.length-1&&l.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},y)})]})}),fN=S.forwardRef(function({size:e=80,color:n="var(--color-primary, #3A73B3)",className:r,style:o,...s},i){const a=S.useId().replace(/[^a-zA-Z0-9_-]/g,""),c=`cny-loader-fade-reveal-${a}`,u=`cny-loader-${a}`;return l.jsxs("div",{ref:i,className:U("cny-loader",u,r),style:{width:e,height:e*(24/21.635),color:n,...o},...s,children:[l.jsx(ka,{css:`
|
|
214
|
+
`)},c1=0,Fn=[];function l1(t){var e=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(c1++)[0],s=p.useState(hm)[0],i=p.useRef(t);p.useEffect(function(){i.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var y=AT([t.lockRef.current],(t.shards||[]).map(Pd),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=p.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!i.current.allowPinchZoom;var x=Co(y),w=n.current,b="deltaX"in y?y.deltaX:w[0]-x[0],C="deltaY"in y?y.deltaY:w[1]-x[1],P,R=y.target,M=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in y&&M==="h"&&R.type==="range")return!1;var j=window.getSelection(),T=j&&j.anchorNode,E=T?T===R||T.contains(R):!1;if(E)return!1;var k=Cd(M,R);if(!k)return!0;if(k?P=M:(P=M==="v"?"h":"v",k=Cd(M,R)),!k)return!1;if(!r.current&&"changedTouches"in y&&(b||C)&&(r.current=P),!P)return!0;var _=r.current||P;return s1(_,v,y,_==="h"?b:C)},[]),c=p.useCallback(function(y){var v=y;if(!(!Fn.length||Fn[Fn.length-1]!==s)){var x="deltaY"in v?Sd(v):Co(v),w=e.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&i1(P.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(Pd).filter(Boolean).filter(function(P){return P.contains(v.target)}),C=b.length>0?a(v,b[0]):!i.current.noIsolation;C&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(y,v,x,w){var b={name:y,delta:v,target:x,should:w,shadowParent:u1(x)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(C){return C!==b})},1)},[]),d=p.useCallback(function(y){n.current=Co(y),r.current=void 0},[]),f=p.useCallback(function(y){u(y.type,Sd(y),y.target,a(y,t.lockRef.current))},[]),h=p.useCallback(function(y){u(y.type,Co(y),y.target,a(y,t.lockRef.current))},[]);p.useEffect(function(){return Fn.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,$n),document.addEventListener("touchmove",c,$n),document.addEventListener("touchstart",d,$n),function(){Fn=Fn.filter(function(y){return y!==s}),document.removeEventListener("wheel",c,$n),document.removeEventListener("touchmove",c,$n),document.removeEventListener("touchstart",d,$n)}},[]);var m=t.removeScrollBar,g=t.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:a1(o)}):null,m?p.createElement(QT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function u1(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const d1=FT(fm,l1);var Xr=p.forwardRef(function(t,e){return p.createElement(ws,jt({},t,{ref:e,sideCar:d1}))});Xr.classNames=ws.classNames;var f1=Object.defineProperty,me=(t,e)=>f1(t,"name",{value:e,configurable:!0}),h1=[" ","Enter","ArrowUp","ArrowDown"],p1=[" ","Enter"],er="Select",[Cs,Rc,m1]=cr(er),[In,yN]=Re(er,[m1,dn]),Tc=dn(),[g1,fn]=In(er),[y1,v1]=In(er);function ym(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:g,internal_do_not_use_render:y}=t,v=Tc(e),[x,w]=p.useState(null),[b,C]=p.useState(null),[P,R]=p.useState(!1),M=Ht(u),[j,T]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:er}),[E,k]=Pe({prop:i,defaultProp:a,onChange:c,caller:er}),_=p.useRef(null),$=p.useRef(E);p.useEffect(()=>{const A=g?x==null?void 0:x.ownerDocument.getElementById(g):x==null?void 0:x.form;if(A instanceof HTMLFormElement){const B=me(()=>k($.current),"reset");return A.addEventListener("reset",B),()=>A.removeEventListener("reset",B)}},[g,x,k]);const G=x?!!g||!!x.closest("form"):!0,[Q,V]=p.useState(new Set),I=Fe(),L=Array.from(Q).map(A=>A.props.value).join(";"),O=p.useCallback(A=>{V(B=>new Set(B).add(A))},[]),D=p.useCallback(A=>{V(B=>{const ee=new Set(B);return ee.delete(A),ee})},[]),X={required:m,trigger:x,onTriggerChange:w,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:P,onValueNodeHasChildrenChange:R,contentId:I,value:E,onValueChange:k,open:j,onOpenChange:T,dir:M,triggerPointerDownPosRef:_,disabled:h,name:d,autoComplete:f,form:g,nativeOptions:Q,nativeSelectKey:L,isFormControl:G};return l.jsx(Wr,{...v,children:l.jsx(g1,{scope:e,...X,children:l.jsx(Cs.Provider,{scope:e,children:l.jsx(y1,{scope:e,onNativeOptionAdd:O,onNativeOptionRemove:D,children:bm(y)?y(X):n})})})})}me(ym,"SelectProvider");var x1=me(t=>{const{__scopeSelect:e,children:n,...r}=t;return l.jsx(ym,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>l.jsxs(l.Fragment,{children:[n,o?l.jsx(q1,{__scopeSelect:e}):null]})})},"Select"),b1="SelectTrigger",w1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=Tc(r),a=fn(b1,r),c=a.disabled||o,u=ie(n,a.onTriggerChange),d=Rc(r),f=p.useRef("touch"),[h,m,g]=Mc(v=>{const x=d().filter(C=>!C.disabled),w=x.find(C=>C.value===a.value),b=Ec(x,v,w);b!==void 0&&a.onValueChange(b.value)}),y=me(v=>{c||(a.onOpenChange(!0),g()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})},"handleOpen");return l.jsx(Kr,{asChild:!0,...i,children:l.jsx(re.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":qr(a.value)?"":void 0,...s,ref:u,onClick:H(s.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&y(v)}),onPointerDown:H(s.onPointerDown,v=>{f.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:H(s.onKeyDown,v=>{const x=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(x&&v.key===" ")&&h1.includes(v.key)&&(y(),v.preventDefault())})})})},"SelectTrigger")),C1="SelectValue",S1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:a="",...c}=e,u=fn(C1,r),{onValueNodeHasChildrenChange:d}=u,f=i!==void 0,h=ie(n,u.onValueNodeChange);Ee(()=>{d(f)},[d,f]);const m=qr(u.value);return l.jsx(re.span,{...c,asChild:m?!1:c.asChild,ref:h,style:{pointerEvents:"none"},children:l.jsx(p.Fragment,{children:m?a:i},m?"placeholder":"value")})},"SelectValue")),P1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return l.jsx(re.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),R1="SelectPortal",[T1,M1]=In(R1,{forceMount:void 0}),E1=me(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return l.jsx(T1,{scope:t.__scopeSelect,forceMount:n,children:l.jsx(Yr,{asChild:!0,...r})})},"SelectPortal"),En="SelectContent",j1=p.forwardRef(me(function(e,n){const r=M1(En,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=fn(En,e.__scopeSelect),[a,c]=p.useState();return Ee(()=>{c(new DocumentFragment)},[]),l.jsx(Ue,{present:o||i.open,children:({present:u})=>u?l.jsx(I1,{...s,ref:n}):l.jsx(A1,{...s,fragment:a})})},"SelectContent")),A1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?Lr.createPortal(l.jsx(vm,{scope:r,children:l.jsx(Cs.Slot,{scope:r,children:l.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),gt=10,[vm,Ss]=In(En),D1=Nt("SelectContent.RemoveScroll"),I1=p.forwardRef(me(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:x,...w}=e,b=fn(En,r),[C,P]=p.useState(null),[R,M]=p.useState(null),j=ie(n,P),[T,E]=p.useState(null),[k,_]=p.useState(null),$=Rc(r),[G,Q]=p.useState(!1),V=p.useRef(!1);p.useEffect(()=>{if(C)return bs(C)},[C]),ur();const I=p.useCallback(Y=>{const[z,...Z]=$().map(F=>F.ref.current),[le]=Z.slice(-1),ce=document.activeElement;for(const F of Y)if(F===ce||(F==null||F.scrollIntoView({block:"nearest"}),F===z&&R&&(R.scrollTop=0),F===le&&R&&(R.scrollTop=R.scrollHeight),F==null||F.focus(),document.activeElement!==ce))return},[$,R]),L=p.useCallback(()=>I([T,C]),[I,T,C]);p.useEffect(()=>{G&&L()},[G,L]);const{onOpenChange:O,triggerPointerDownPosRef:D}=b;p.useEffect(()=>{if(C){let Y={x:0,y:0};const z=me(le=>{var ce,F;Y={x:Math.abs(Math.round(le.pageX)-(((ce=D.current)==null?void 0:ce.x)??0)),y:Math.abs(Math.round(le.pageY)-(((F=D.current)==null?void 0:F.y)??0))}},"handlePointerMove"),Z=me(le=>{Y.x<=10&&Y.y<=10?le.preventDefault():le.composedPath().includes(C)||O(!1),document.removeEventListener("pointermove",z),D.current=null},"handlePointerUp");return D.current!==null&&(document.addEventListener("pointermove",z),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",Z,{capture:!0})}}},[C,O,D]),p.useEffect(()=>{const Y=me(()=>O(!1),"close");return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[O]);const[X,A]=Mc(Y=>{const z=$().filter(ce=>!ce.disabled),Z=z.find(ce=>ce.ref.current===document.activeElement),le=Ec(z,Y,Z);le&&setTimeout(()=>{var ce;return(ce=le.ref.current)==null?void 0:ce.focus()})}),B=p.useCallback((Y,z,Z)=>{const le=!V.current&&!Z;(b.value!==void 0&&b.value===z||le)&&(E(Y),le&&(V.current=!0))},[b.value]),ee=p.useCallback(()=>C==null?void 0:C.focus(),[C]),K=p.useCallback((Y,z,Z)=>{const le=!V.current&&!Z;(b.value!==void 0&&b.value===z||le)&&_(Y)},[b.value]),W=o==="popper"?Rd:k1,oe=W===Rd?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:y,hideWhenDetached:v,avoidCollisions:x}:{};return l.jsx(vm,{scope:r,content:C,viewport:R,onViewportChange:M,itemRefCallback:B,selectedItem:T,onItemLeave:ee,itemTextRefCallback:K,focusSelectedItem:L,selectedItemText:k,position:o,isPositioned:G,searchRef:X,children:l.jsx(Xr,{as:D1,allowPinchZoom:!0,children:l.jsx(hs,{asChild:!0,trapped:b.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:H(s,Y=>{var z;(z=b.trigger)==null||z.focus({preventScroll:!0}),Y.preventDefault()}),children:l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(W,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:Y=>Y.preventDefault(),...w,...oe,onPlaced:()=>Q(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:H(w.onKeyDown,Y=>{const z=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!z&&Y.key.length===1&&A(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let le=$().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ce=Y.target,F=le.indexOf(ce);le=le.slice(F+1)}setTimeout(()=>I(le)),Y.preventDefault()}})})})})})})},"SelectContentImpl")),k1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=fn(En,r),a=Ss(En,r),[c,u]=p.useState(null),[d,f]=p.useState(null),h=ie(n,f),m=Rc(r),g=p.useRef(!1),y=p.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:w,focusSelectedItem:b}=a,C=p.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&v&&x&&w){const j=i.trigger.getBoundingClientRect(),T=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),k=w.getBoundingClientRect();if(i.dir!=="rtl"){const ce=k.left-T.left,F=E.left-ce,q=j.left-F,he=j.width+q,ue=Math.max(he,T.width),He=window.innerWidth-gt,ve=Ar(F,[gt,Math.max(gt,He-ue)]);c.style.minWidth=he+"px",c.style.left=ve+"px"}else{const ce=T.right-k.right,F=window.innerWidth-E.right-ce,q=window.innerWidth-j.right-F,he=j.width+q,ue=Math.max(he,T.width),He=window.innerWidth-gt,ve=Ar(F,[gt,Math.max(gt,He-ue)]);c.style.minWidth=he+"px",c.style.right=ve+"px"}const _=m(),$=window.innerHeight-gt*2,G=v.scrollHeight,Q=window.getComputedStyle(d),V=parseInt(Q.borderTopWidth,10),I=parseInt(Q.paddingTop,10),L=parseInt(Q.borderBottomWidth,10),O=parseInt(Q.paddingBottom,10),D=V+I+G+O+L,X=Math.min(x.offsetHeight*5,D),A=window.getComputedStyle(v),B=parseInt(A.paddingTop,10),ee=parseInt(A.paddingBottom,10),K=j.top+j.height/2-gt,W=$-K,oe=x.offsetHeight/2,Y=x.offsetTop+oe,z=V+I+Y,Z=D-z;if(z<=K){const ce=_.length>0&&x===_[_.length-1].ref.current;c.style.bottom="0px";const F=d.clientHeight-v.offsetTop-v.offsetHeight,q=Math.max(W,oe+(ce?ee:0)+F+L),he=z+q;c.style.height=he+"px"}else{const ce=_.length>0&&x===_[0].ref.current;c.style.top="0px";const q=Math.max(K,V+v.offsetTop+(ce?B:0)+oe)+Z;c.style.height=q+"px",v.scrollTop=z-K+v.offsetTop}c.style.margin=`${gt}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=$+"px",o==null||o(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,c,d,v,x,w,i.dir,o]);Ee(()=>C(),[C]);const[P,R]=p.useState();Ee(()=>{d&&R(window.getComputedStyle(d).zIndex)},[d]);const M=p.useCallback(j=>{j&&y.current===!0&&(C(),b==null||b(),y.current=!1)},[C,b]);return l.jsx(N1,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:M,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:l.jsx(re.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),Rd=p.forwardRef(me(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=gt,...i}=e,a=Tc(r);return l.jsx(xs,{...a,...i,ref:n,align:o,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[N1,_1]=In(En,{}),Td="SelectViewport",O1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=Ss(Td,r),a=_1(Td,r),c=ie(n,i.onViewportChange),u=p.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),l.jsx(Cs.Slot,{scope:r,children:l.jsx(re.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:H(s.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&h){const g=Math.abs(u.current-f.scrollTop);if(g>0){const y=window.innerHeight-gt*2,v=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),w=Math.max(v,x);if(w<y){const b=w+g,C=Math.min(y,b),P=b-C;h.style.height=C+"px",h.style.bottom==="0px"&&(f.scrollTop=P>0?P:0,h.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})},"SelectViewport")),L1="SelectGroup",[$1,F1]=In(L1),V1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e,s=Fe();return l.jsx($1,{scope:r,id:s,children:l.jsx(re.div,{role:"group","aria-labelledby":s,...o,ref:n})})},"SelectGroup")),B1="SelectLabel",G1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e,s=F1(B1,r);return l.jsx(re.div,{id:s.id,...o,ref:n})},"SelectLabel")),va="SelectItem",[z1,xm]=In(va),U1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...a}=e,c=fn(va,r),u=Ss(va,r),d=c.value===o,[f,h]=p.useState(i??""),[m,g]=p.useState(!1),y=Qe(C=>{var P;return(P=u.itemRefCallback)==null?void 0:P.call(u,C,o,s)}),v=ie(n,y),x=Fe(),w=p.useRef("touch"),b=me(()=>{s||(c.onValueChange(o),c.onOpenChange(!1))},"handleSelect");return l.jsx(z1,{scope:r,value:o,disabled:s,textId:x,isSelected:d,onItemTextChange:p.useCallback(C=>{h(P=>P||((C==null?void 0:C.textContent)??"").trim())},[]),children:l.jsx(Cs.ItemSlot,{scope:r,value:o,disabled:s,textValue:f,children:l.jsx(re.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:v,onFocus:H(a.onFocus,()=>g(!0)),onBlur:H(a.onBlur,()=>g(!1)),onClick:H(a.onClick,()=>{w.current!=="mouse"&&b()}),onPointerUp:H(a.onPointerUp,()=>{w.current==="mouse"&&b()}),onPointerDown:H(a.onPointerDown,C=>{w.current=C.pointerType}),onPointerMove:H(a.onPointerMove,C=>{var P;w.current=C.pointerType,s?(P=u.onItemLeave)==null||P.call(u):w.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(a.onPointerLeave,C=>{var P;C.currentTarget===document.activeElement&&((P=u.onItemLeave)==null||P.call(u))}),onKeyDown:H(a.onKeyDown,C=>{var R;s||C.target!==C.currentTarget||((R=u.searchRef)==null?void 0:R.current)!==""&&C.key===" "||(p1.includes(C.key)&&b(),C.key===" "&&C.preventDefault())})})})})},"SelectItem")),So="SelectItemText",H1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,a=fn(So,r),c=Ss(So,r),u=xm(So,r),d=v1(So,r),[f,h]=p.useState(null),m=Qe(b=>{var C;return(C=c.itemTextRefCallback)==null?void 0:C.call(c,b,u.value,u.disabled)}),g=ie(n,h,u.onItemTextChange,m),y=f==null?void 0:f.textContent,v=p.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=d;return Ee(()=>(x(v),()=>w(v)),[x,w,v]),l.jsxs(l.Fragment,{children:[l.jsx(re.span,{id:u.textId,...i,ref:g}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!qr(a.value)?Lr.createPortal(i.children,a.valueNode):null]})},"SelectItemText")),W1="SelectItemIndicator",K1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e;return xm(W1,r).isSelected?l.jsx(re.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),Y1=p.forwardRef(me(function(e,n){const{__scopeSelect:r,...o}=e;return l.jsx(re.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),X1="SelectBubbleInput",q1=p.forwardRef(me(function({__scopeSelect:e,...n},r){const o=fn(X1,e),{value:s,onValueChange:i,required:a,disabled:c,name:u,autoComplete:d,form:f}=o,{nativeOptions:h,nativeSelectKey:m}=o,g=p.useRef(null),y=ie(r,g),v=s??"",x=Pc(v),w=Array.from(h).some(b=>(b.props.value??"")==="");return p.useEffect(()=>{const b=g.current;if(!b)return;const C=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(C,"value").set;if(x!==v&&R){const M=new Event("change",{bubbles:!0});R.call(b,v),b.dispatchEvent(M)}},[x,v]),l.jsxs(re.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:u,autoComplete:d,disabled:c,form:f,onChange:b=>i(b.target.value),...n,style:{...am,...n.style},ref:y,defaultValue:v,children:[qr(s)&&!w?l.jsx("option",{value:""}):null,Array.from(h)]},m)},"SelectBubbleInput"));function bm(t){return typeof t=="function"}me(bm,"isFunction");function qr(t){return t===""||t===void 0}me(qr,"shouldShowPlaceholder");function Mc(t){const e=Qe(t),n=p.useRef(""),r=p.useRef(0),o=p.useCallback(i=>{const a=n.current+i;e(a),me((function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}),"updateSearch")(a)},[e]),s=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}me(Mc,"useTypeaheadSearch");function Ec(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=wm(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}me(Ec,"findNextItem");function wm(t,e){return t.map((n,r)=>t[(e+r)%t.length])}me(wm,"wrapArray");function Z1({placeholder:t,size:e,color:n="primary",triggerIcon:r,triggerClassName:o,contentClassName:s,id:i,className:a,style:c,sx:u,disabled:d,children:f,"aria-invalid":h,"aria-describedby":m,...g}){const{className:y,style:v,styleTag:x}=se(u,c,"cny-select-trigger",e==="sm"||e==="lg"?e:null,n!=="primary"&&n,a,o),w=Ia();return l.jsxs(x1,{disabled:d,...g,children:[l.jsxs(w1,{id:i,"aria-invalid":h,"aria-describedby":m,className:y,style:v,children:[x,r&&l.jsx("span",{style:{display:"inline-flex"},children:r}),l.jsx(S1,{placeholder:t}),l.jsx(P1,{className:"cny-select-chevron",asChild:!0,children:l.jsx(zr,{size:14,"aria-hidden":"true"})})]}),l.jsx(E1,{children:l.jsx(j1,{position:"popper",sideOffset:4,className:U("cny-select-content",s),children:l.jsx(O1,{className:"cny-select-viewport",nonce:w,children:f})})})]})}const Q1=S.forwardRef(function({className:e,children:n,...r},o){return l.jsxs(U1,{ref:o,className:U("cny-select-item",e),...r,children:[l.jsx(H1,{children:n}),l.jsx(K1,{className:"cny-select-indicator",children:l.jsx(rn,{size:14,"aria-hidden":"true"})})]})}),J1=S.forwardRef(function(e,n){return l.jsx(V1,{ref:n,...e})}),eM=S.forwardRef(function({className:e,...n},r){return l.jsx(G1,{ref:r,className:U("cny-select-group-label",e),...n})}),tM=S.forwardRef(function({className:e,...n},r){return l.jsx(Y1,{ref:r,className:U("cny-select-separator",e),...n})});var nM=Object.defineProperty,Ct=(t,e)=>nM(t,"name",{value:e,configurable:!0}),jc="Popover",[Cm,vN]=Re(jc,[dn]),Zr=dn(),[rM,hn]=Cm(jc),oM=Ct(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=t,a=Zr(e),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:jc});return l.jsx(Wr,{...a,children:l.jsx(rM,{scope:e,contentId:Fe(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:i,children:n})})},"Popover"),sM="PopoverAnchor",iM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(sM,r),i=Zr(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=s;return p.useEffect(()=>(a(),()=>c()),[a,c]),l.jsx(Kr,{...i,...o,ref:n})},"PopoverAnchor")),aM="PopoverTrigger",cM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(aM,r),i=Zr(r),a=ie(n,s.triggerRef),c=l.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Ac(s.open),...o,ref:a,onClick:H(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:l.jsx(Kr,{asChild:!0,...i,children:c})},"PopoverTrigger")),Sm="PopoverPortal",[lM,uM]=Cm(Sm,{forceMount:void 0}),dM=Ct(t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,s=hn(Sm,e);return l.jsx(lM,{scope:e,forceMount:n,children:l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:r})})})},"PopoverPortal"),Ir="PopoverContent",fM=p.forwardRef(Ct(function(e,n){const r=uM(Ir,e.__scopePopover),{forceMount:o=r.forceMount,...s}=e,i=hn(Ir,e.__scopePopover);return l.jsx(Ue,{present:o||i.open,children:i.modal?l.jsx(pM,{...s,ref:n}):l.jsx(mM,{...s,ref:n})})},"PopoverContent")),hM=Nt("PopoverContent.RemoveScroll"),pM=p.forwardRef(Ct(function(e,n){const r=hn(Ir,e.__scopePopover),o=p.useRef(null),s=ie(n,o),i=p.useRef(!1);return p.useEffect(()=>{const a=o.current;if(a)return bs(a)},[]),l.jsx(Xr,{as:hM,allowPinchZoom:!0,children:l.jsx(Pm,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),i.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),mM=p.forwardRef(Ct(function(e,n){const r=hn(Ir,e.__scopePopover),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Pm,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"PopoverContentNonModal")),Pm=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=e,m=hn(Ir,r),g=Zr(r);return ur(),l.jsx(hs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:l.jsx(xs,{"data-state":Ac(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),gM="PopoverClose",yM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=hn(gM,r);return l.jsx(re.button,{type:"button",...o,ref:n,onClick:H(e.onClick,()=>s.onOpenChange(!1))})},"PopoverClose")),vM=p.forwardRef(Ct(function(e,n){const{__scopePopover:r,...o}=e,s=Zr(r);return l.jsx(nm,{...s,...o,ref:n})},"PopoverArrow"));function Ac(t){return t?"open":"closed"}Ct(Ac,"getState");var Dc=oM,xM=iM,Ic=cM,kc=dM,Nc=fM,bM=yM,wM=vM,Md=1,CM=.9,SM=.8,PM=.17,wi=.1,Ci=.999,RM=.9999,TM=.99,MM=/[\\\/_+.#"@\[\(\{&]/,EM=/[\\\/_+.#"@\[\(\{&]/g,jM=/[\s-]/,Rm=/[\s-]/g;function xa(t,e,n,r,o,s,i){if(s===e.length)return o===t.length?Md:TM;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),u=n.indexOf(c,o),d=0,f,h,m,g;u>=0;)f=xa(t,e,n,r,u+1,s+1,i),f>d&&(u===o?f*=Md:MM.test(t.charAt(u-1))?(f*=SM,m=t.slice(o,u-1).match(EM),m&&o>0&&(f*=Math.pow(Ci,m.length))):jM.test(t.charAt(u-1))?(f*=CM,g=t.slice(o,u-1).match(Rm),g&&o>0&&(f*=Math.pow(Ci,g.length))):(f*=PM,o>0&&(f*=Math.pow(Ci,u-o))),t.charAt(u)!==e.charAt(s)&&(f*=RM)),(f<wi&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(h=xa(t,e,n,r,u+1,s+2,i),h*wi>f&&(f=h*wi)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[a]=d,d}function Ed(t){return t.toLowerCase().replace(Rm," ")}function AM(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,xa(t,e,Ed(t),Ed(e),0,0,{})}var DM=Object.defineProperty,ut=(t,e)=>DM(t,"name",{value:e,configurable:!0}),_c="Dialog",[Tm,xN]=Re(_c),[IM,St]=Tm(_c),Oc=ut(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,a=p.useRef(null),c=p.useRef(null),[u,d]=Pe({prop:r,defaultProp:o??!1,onChange:s,caller:_c}),[f,h]=p.useState(0),[m,g]=p.useState(0);return l.jsx(IM,{scope:e,triggerRef:a,contentRef:c,contentId:Fe(),titleId:Fe(),descriptionId:Fe(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:h,setDescriptionCount:g,open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(y=>!y),[d]),modal:i,children:n})},"Dialog"),kM="DialogTrigger",Mm=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(kM,r),i=ie(n,s.triggerRef);return l.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Rs(s.open),...o,ref:i,onClick:H(e.onClick,s.onOpenToggle)})},"DialogTrigger")),Em="DialogPortal",[NM,jm]=Tm(Em,{forceMount:void 0}),Lc=ut(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=St(Em,e);return l.jsx(NM,{scope:e,forceMount:n,children:p.Children.map(r,i=>l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),ba="DialogOverlay",$c=p.forwardRef(ut(function(e,n){const r=jm(ba,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=St(ba,e.__scopeDialog);return i.modal?l.jsx(Ue,{present:o||i.open,children:l.jsx(OM,{...s,ref:n})}):null},"DialogOverlay")),_M=Nt("DialogOverlay.RemoveScroll"),OM=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(ba,r),i=Dp(),a=ie(n,i);return l.jsx(Xr,{as:_M,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(re.div,{"data-state":Rs(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),kr="DialogContent",Fc=p.forwardRef(ut(function(e,n){const r=jm(kr,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=St(kr,e.__scopeDialog);return l.jsx(Ue,{present:o||i.open,children:i.modal?l.jsx(LM,{...s,ref:n}):l.jsx($M,{...s,ref:n})})},"DialogContent")),LM=p.forwardRef(ut(function(e,n){const r=St(kr,e.__scopeDialog),o=p.useRef(null),s=ie(n,r.contentRef,o);return p.useEffect(()=>{const i=o.current;if(i)return bs(i)},[]),l.jsx(Am,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),$M=p.forwardRef(ut(function(e,n){const r=St(kr,e.__scopeDialog),o=p.useRef(!1),s=p.useRef(!1);return l.jsx(Am,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Am=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,c=St(kr,r);return ur(),l.jsx(l.Fragment,{children:l.jsx(hs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(Ur,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Rs(c.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),FM="DialogTitle",Vc=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(FM,r),{setTitleCount:i}=s;return Ee(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(re.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),VM="DialogDescription",Bc=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(VM,r),{setDescriptionCount:i}=s;return Ee(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),l.jsx(re.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),BM="DialogClose",Ps=p.forwardRef(ut(function(e,n){const{__scopeDialog:r,...o}=e,s=St(BM,r);return l.jsx(re.button,{type:"button",...o,ref:n,onClick:H(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Rs(t){return t?"open":"closed"}ut(Rs,"getState");function jd(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function tr(...t){return e=>{let n=!1;const r=t.map(o=>{const s=jd(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():jd(t[o],null)}}}}function GM(t){const e=zM(t),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),c=a.find(HM);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return l.jsx(e,{...i,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return l.jsx(e,{...i,ref:o,children:s})});return n.displayName=`${t}.Slot`,n}function zM(t){const e=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=KM(o),a=WM(s,o.props);return o.type!==p.Fragment&&(a.ref=r?tr(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var UM=Symbol("radix.slottable");function HM(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===UM}function WM(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}function KM(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var YM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pn=YM.reduce((t,e)=>{const n=GM(`Primitive.${e}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),XM=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},qM=p[" useId ".trim().toString()]||(()=>{}),ZM=0;function qn(t){const[e,n]=p.useState(qM());return XM(()=>{n(r=>r??String(ZM++))},[t]),e?`radix-${e}`:""}var vr='[cmdk-group=""]',Si='[cmdk-group-items=""]',QM='[cmdk-group-heading=""]',Dm='[cmdk-item=""]',Ad=`${Dm}:not([aria-disabled="true"])`,wa="cmdk-item-select",Gn="data-value",JM=(t,e,n)=>AM(t,e,n),Im=p.createContext(void 0),Qr=()=>p.useContext(Im),km=p.createContext(void 0),Gc=()=>p.useContext(km),Nm=p.createContext(void 0),_m=p.forwardRef((t,e)=>{let n=zn(()=>{var A,B;return{search:"",value:(B=(A=t.value)!=null?A:t.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=zn(()=>new Set),o=zn(()=>new Map),s=zn(()=>new Map),i=zn(()=>new Set),a=Om(t),{label:c,children:u,value:d,onValueChange:f,filter:h,shouldFilter:m,loop:g,disablePointerSelection:y=!1,vimBindings:v=!0,...x}=t,w=qn(),b=qn(),C=qn(),P=p.useRef(null),R=uE();jn(()=>{if(d!==void 0){let A=d.trim();n.current.value=A,M.emit()}},[d]),jn(()=>{R(6,$)},[]);let M=p.useMemo(()=>({subscribe:A=>(i.current.add(A),()=>i.current.delete(A)),snapshot:()=>n.current,setState:(A,B,ee)=>{var K,W,oe,Y;if(!Object.is(n.current[A],B)){if(n.current[A]=B,A==="search")_(),E(),R(1,k);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let z=document.getElementById(C);z?z.focus():(K=document.getElementById(w))==null||K.focus()}if(R(7,()=>{var z;n.current.selectedItemId=(z=G())==null?void 0:z.id,M.emit()}),ee||R(5,$),((W=a.current)==null?void 0:W.value)!==void 0){let z=B??"";(Y=(oe=a.current).onValueChange)==null||Y.call(oe,z);return}}M.emit()}},emit:()=>{i.current.forEach(A=>A())}}),[]),j=p.useMemo(()=>({value:(A,B,ee)=>{var K;B!==((K=s.current.get(A))==null?void 0:K.value)&&(s.current.set(A,{value:B,keywords:ee}),n.current.filtered.items.set(A,T(B,ee)),R(2,()=>{E(),M.emit()}))},item:(A,B)=>(r.current.add(A),B&&(o.current.has(B)?o.current.get(B).add(A):o.current.set(B,new Set([A]))),R(3,()=>{_(),E(),n.current.value||k(),M.emit()}),()=>{s.current.delete(A),r.current.delete(A),n.current.filtered.items.delete(A);let ee=G();R(4,()=>{_(),(ee==null?void 0:ee.getAttribute("id"))===A&&k(),M.emit()})}),group:A=>(o.current.has(A)||o.current.set(A,new Set),()=>{s.current.delete(A),o.current.delete(A)}),filter:()=>a.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:C,labelId:b,listInnerRef:P}),[]);function T(A,B){var ee,K;let W=(K=(ee=a.current)==null?void 0:ee.filter)!=null?K:JM;return A?W(A,n.current.search,B):0}function E(){if(!n.current.search||a.current.shouldFilter===!1)return;let A=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(K=>{let W=o.current.get(K),oe=0;W.forEach(Y=>{let z=A.get(Y);oe=Math.max(z,oe)}),B.push([K,oe])});let ee=P.current;Q().sort((K,W)=>{var oe,Y;let z=K.getAttribute("id"),Z=W.getAttribute("id");return((oe=A.get(Z))!=null?oe:0)-((Y=A.get(z))!=null?Y:0)}).forEach(K=>{let W=K.closest(Si);W?W.appendChild(K.parentElement===W?K:K.closest(`${Si} > *`)):ee.appendChild(K.parentElement===ee?K:K.closest(`${Si} > *`))}),B.sort((K,W)=>W[1]-K[1]).forEach(K=>{var W;let oe=(W=P.current)==null?void 0:W.querySelector(`${vr}[${Gn}="${encodeURIComponent(K[0])}"]`);oe==null||oe.parentElement.appendChild(oe)})}function k(){let A=Q().find(ee=>ee.getAttribute("aria-disabled")!=="true"),B=A==null?void 0:A.getAttribute(Gn);M.setState("value",B||void 0)}function _(){var A,B,ee,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let W=0;for(let oe of r.current){let Y=(B=(A=s.current.get(oe))==null?void 0:A.value)!=null?B:"",z=(K=(ee=s.current.get(oe))==null?void 0:ee.keywords)!=null?K:[],Z=T(Y,z);n.current.filtered.items.set(oe,Z),Z>0&&W++}for(let[oe,Y]of o.current)for(let z of Y)if(n.current.filtered.items.get(z)>0){n.current.filtered.groups.add(oe);break}n.current.filtered.count=W}function $(){var A,B,ee;let K=G();K&&(((A=K.parentElement)==null?void 0:A.firstChild)===K&&((ee=(B=K.closest(vr))==null?void 0:B.querySelector(QM))==null||ee.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function G(){var A;return(A=P.current)==null?void 0:A.querySelector(`${Dm}[aria-selected="true"]`)}function Q(){var A;return Array.from(((A=P.current)==null?void 0:A.querySelectorAll(Ad))||[])}function V(A){let B=Q()[A];B&&M.setState("value",B.getAttribute(Gn))}function I(A){var B;let ee=G(),K=Q(),W=K.findIndex(Y=>Y===ee),oe=K[W+A];(B=a.current)!=null&&B.loop&&(oe=W+A<0?K[K.length-1]:W+A===K.length?K[0]:K[W+A]),oe&&M.setState("value",oe.getAttribute(Gn))}function L(A){let B=G(),ee=B==null?void 0:B.closest(vr),K;for(;ee&&!K;)ee=A>0?cE(ee,vr):lE(ee,vr),K=ee==null?void 0:ee.querySelector(Ad);K?M.setState("value",K.getAttribute(Gn)):I(A)}let O=()=>V(Q().length-1),D=A=>{A.preventDefault(),A.metaKey?O():A.altKey?L(1):I(1)},X=A=>{A.preventDefault(),A.metaKey?V(0):A.altKey?L(-1):I(-1)};return p.createElement(pn.div,{ref:e,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:A=>{var B;(B=x.onKeyDown)==null||B.call(x,A);let ee=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||ee))switch(A.key){case"n":case"j":{v&&A.ctrlKey&&D(A);break}case"ArrowDown":{D(A);break}case"p":case"k":{v&&A.ctrlKey&&X(A);break}case"ArrowUp":{X(A);break}case"Home":{A.preventDefault(),V(0);break}case"End":{A.preventDefault(),O();break}case"Enter":{A.preventDefault();let K=G();if(K){let W=new Event(wa);K.dispatchEvent(W)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:fE},c),Ts(t,A=>p.createElement(km.Provider,{value:M},p.createElement(Im.Provider,{value:j},A))))}),eE=p.forwardRef((t,e)=>{var n,r;let o=qn(),s=p.useRef(null),i=p.useContext(Nm),a=Qr(),c=Om(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;jn(()=>{if(!u)return a.item(o,i==null?void 0:i.id)},[u]);let d=Lm(o,s,[t.value,t.children,s],t.keywords),f=Gc(),h=an(R=>R.value&&R.value===d.current),m=an(R=>u||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);p.useEffect(()=>{let R=s.current;if(!(!R||t.disabled))return R.addEventListener(wa,g),()=>R.removeEventListener(wa,g)},[m,t.onSelect,t.disabled]);function g(){var R,M;y(),(M=(R=c.current).onSelect)==null||M.call(R,d.current)}function y(){f.setState("value",d.current,!0)}if(!m)return null;let{disabled:v,value:x,onSelect:w,forceMount:b,keywords:C,...P}=t;return p.createElement(pn.div,{ref:tr(s,e),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||a.getDisablePointerSelection()?void 0:y,onClick:v?void 0:g},t.children)}),tE=p.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...s}=t,i=qn(),a=p.useRef(null),c=p.useRef(null),u=qn(),d=Qr(),f=an(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(i):!0);jn(()=>d.group(i),[]),Lm(i,a,[t.value,t.heading,c]);let h=p.useMemo(()=>({id:i,forceMount:o}),[o]);return p.createElement(pn.div,{ref:tr(a,e),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Ts(t,m=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},p.createElement(Nm.Provider,{value:h},m))))}),nE=p.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=p.useRef(null),s=an(i=>!i.search);return!n&&!s?null:p.createElement(pn.div,{ref:tr(o,e),...r,"cmdk-separator":"",role:"separator"})}),rE=p.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,s=Gc(),i=an(u=>u.search),a=an(u=>u.selectedItemId),c=Qr();return p.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),p.createElement(pn.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":a,id:c.inputId,type:"text",value:o?t.value:i,onChange:u=>{o||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),oE=p.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,s=p.useRef(null),i=p.useRef(null),a=an(u=>u.selectedItemId),c=Qr();return p.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),p.createElement(pn.div,{ref:tr(s,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},Ts(t,u=>p.createElement("div",{ref:tr(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),sE=p.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=t;return p.createElement(Oc,{open:n,onOpenChange:r},p.createElement(Lc,{container:i},p.createElement($c,{"cmdk-overlay":"",className:o}),p.createElement(Fc,{"aria-label":t.label,"cmdk-dialog":"",className:s},p.createElement(_m,{ref:e,...a}))))}),iE=p.forwardRef((t,e)=>an(n=>n.filtered.count===0)?p.createElement(pn.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),aE=p.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...s}=t;return p.createElement(pn.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ts(t,i=>p.createElement("div",{"aria-hidden":!0},i)))}),De=Object.assign(_m,{List:oE,Item:eE,Input:rE,Group:tE,Separator:nE,Dialog:sE,Empty:iE,Loading:aE});function cE(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function lE(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function Om(t){let e=p.useRef(t);return jn(()=>{e.current=t}),e}var jn=typeof window>"u"?p.useEffect:p.useLayoutEffect;function zn(t){let e=p.useRef();return e.current===void 0&&(e.current=t()),e}function an(t){let e=Gc(),n=()=>t(e.snapshot());return p.useSyncExternalStore(e.subscribe,n,n)}function Lm(t,e,n,r=[]){let o=p.useRef(),s=Qr();return jn(()=>{var i;let a=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():o.current}})(),c=r.map(u=>u.trim());s.value(t,a,c),(i=e.current)==null||i.setAttribute(Gn,a),o.current=a}),o}var uE=()=>{let[t,e]=p.useState(),n=zn(()=>new Map);return jn(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function dE(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Ts({asChild:t,children:e},n){return t&&p.isValidElement(e)?p.cloneElement(dE(e),{ref:e.ref},n(e.props.children)):n(e)}var fE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function hE({options:t,value:e,defaultValue:n,onValueChange:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No matches.",maxItems:a,size:c,color:u="primary",disabled:d=!1,id:f,className:h,style:m,sx:g,"aria-invalid":y,"aria-describedby":v,"aria-label":x}){const[w,b]=S.useState(!1),[C,P]=S.useState(n??[]),[R,M]=S.useState(""),j=S.useRef(null),T=e??C,E=S.useCallback(D=>{e===void 0&&P(D),r==null||r(D)},[e,r]),k=S.useCallback(D=>{T.includes(D)?E(T.filter(X=>X!==D)):(a==null||T.length<a)&&E([...T,D])},[T,E,a]),_=S.useCallback(D=>E(T.filter(X=>X!==D)),[T,E]),$=S.useMemo(()=>{const D=new Map;for(const X of t)D.set(X.value,X);return D},[t]),G=S.useMemo(()=>{const D=new Map;for(const X of t){const A=X.group??"";D.has(A)||D.set(A,[]),D.get(A).push(X)}return D},[t]),Q=D=>{D.key==="Backspace"&&R===""&&T.length>0&&(D.preventDefault(),_(T[T.length-1]))};S.useEffect(()=>{w&&queueMicrotask(()=>{var D;return(D=j.current)==null?void 0:D.focus()})},[w]);const{className:V,style:I,styleTag:L}=se(g,m,"cny-multiselect-trigger",c==="sm"||c==="lg"?c:null,u!=="primary"&&u,h),O=a!=null&&T.length>=a;return l.jsxs(Dc,{open:w,onOpenChange:D=>!d&&b(D),children:[l.jsx(Ic,{asChild:!0,children:l.jsxs("div",{role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-invalid":y,"aria-describedby":v,"aria-label":x,"data-state":w?"open":"closed","data-disabled":d||void 0,id:f,className:V,style:I,onClick:()=>!d&&b(D=>!D),tabIndex:d?-1:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" "||D.key==="ArrowDown")&&!w&&(D.preventDefault(),b(!0))},children:[L,T.length===0&&l.jsx("span",{className:"cny-multiselect-placeholder",children:o}),T.map(D=>{const X=$.get(D);return l.jsxs("span",{className:"cny-chip",children:[l.jsx("span",{className:"cny-chip-label",children:(X==null?void 0:X.label)??D}),!d&&l.jsx("button",{type:"button",className:"cny-chip-remove","aria-label":`Remove ${(X==null?void 0:X.label)??D}`,onClick:A=>{A.stopPropagation(),_(D)},children:l.jsx(Wt,{size:12,"aria-hidden":"true"})})]},D)}),l.jsx(zr,{size:14,"aria-hidden":"true",className:"cny-multiselect-chevron"})]})}),l.jsx(kc,{children:l.jsx(Nc,{className:"cny-popover",align:"start",sideOffset:4,onOpenAutoFocus:D=>D.preventDefault(),children:l.jsxs(De,{shouldFilter:!0,label:"Options",children:[l.jsx(De.Input,{ref:j,placeholder:s,value:R,onValueChange:M,onKeyDown:Q}),l.jsxs(De.List,{children:[l.jsx(De.Empty,{children:i}),Array.from(G.entries()).map(([D,X])=>l.jsx(De.Group,{heading:D||void 0,children:X.map(A=>{const B=T.includes(A.value),ee=A.disabled||!B&&O;return l.jsxs(De.Item,{value:`${A.label} ${A.description??""} ${A.value}`,disabled:ee,onSelect:()=>k(A.value),children:[A.icon&&l.jsx("span",{style:{display:"inline-flex"},children:A.icon}),l.jsx("span",{children:A.label}),A.description&&l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.75rem"},children:A.description}),B&&l.jsx("span",{className:"cny-check",children:l.jsx(rn,{size:14,"aria-hidden":"true"})})]},A.value)})},D||"default"))]})]})})})]})}var pE=Object.defineProperty,Ut=(t,e)=>pE(t,"name",{value:e,configurable:!0}),zc="Checkbox",[mE,bN]=Re(zc),[gE,Uc]=mE(zc);function $m(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=Pe({prop:n,defaultProp:o??!1,onChange:c,caller:zc}),[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=g?!!i||!!g.closest("form"):!0,R={checked:h,disabled:s,setChecked:m,control:g,setControl:y,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:Ft(o)?!1:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(gE,{scope:e,...R,children:Fm(f)?f(R):r})}Ut($m,"CheckboxProvider");var yE="CheckboxTrigger",vE=p.forwardRef(Ut(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...o},s){const{control:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:y,bubbleInput:v}=Uc(yE,e),x=ie(s,f),w=p.useRef(u);return p.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const C=Ut(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[i,h]),l.jsx(re.button,{type:"button",role:"checkbox","aria-checked":Ft(u)?"mixed":u,"aria-required":d,"data-state":Hc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:x,onKeyDown:H(n,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:H(r,b=>{g(),h(C=>Ft(C)?!0:!C),v&&y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"CheckboxTrigger")),Dd=p.forwardRef(Ut(function(e,n){const{__scopeCheckbox:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx($m,{__scopeCheckbox:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(vE,{...h,ref:n,__scopeCheckbox:r}),m&&l.jsx(CE,{__scopeCheckbox:r})]})})},"Checkbox")),xE="CheckboxIndicator",bE=p.forwardRef(Ut(function(e,n){const{__scopeCheckbox:r,forceMount:o,...s}=e,i=Uc(xE,r);return l.jsx(Ue,{present:o||Ft(i.checked)||i.checked===!0,children:l.jsx(re.span,{"data-state":Hc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),wE="CheckboxBubbleInput",CE=p.forwardRef(Ut(function({__scopeCheckbox:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:y,setBubbleInput:v}=Uc(wE,e),x=ie(o,v),w=hr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=y;if(!M)return;const j=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(j,"checked").set,k=a!==P.current;P.current=a;const _=C.current!==c;C.current=c;const $=!(k&&i.current);if(_&&E){b.current=!k;const G=new Event("click",{bubbles:$});M.indeterminate=Ft(c),E.call(M,Ft(c)?!1:c),M.dispatchEvent(G),b.current=!1}},[y,c,i,a]);const R=p.useRef(Ft(c)?!1:c);return l.jsx(re.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:g,...r,tabIndex:-1,ref:x,onClick:H(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Fm(t){return typeof t=="function"}Ut(Fm,"isFunction");function Ft(t){return t==="indeterminate"}Ut(Ft,"isIndeterminate");function Hc(t){return Ft(t)?"indeterminate":t?"checked":"unchecked"}Ut(Hc,"getState");const Ca=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){const a=l.jsx(bE,{children:s.checked==="indeterminate"?l.jsx(ZS,{size:12,"aria-hidden":"true"}):l.jsx(rn,{size:12,"aria-hidden":"true"})});if(!o){const{className:f,style:h,styleTag:m}=se(r,n,"checkbox",e);return l.jsxs(Dd,{ref:i,className:f,style:h,...s,children:[m,a]})}const{className:c,style:u,styleTag:d}=se(r,n,"control");return l.jsxs("label",{className:c,style:u,children:[d,l.jsx(Dd,{ref:i,className:U("checkbox",e),...s,children:a}),l.jsx("span",{children:o})]})});var SE=Object.defineProperty,ze=(t,e)=>SE(t,"name",{value:e,configurable:!0}),Vm="Radio",[PE,Bm]=Re(Vm),[RE,Ms]=PE(Vm);function Gm(t){const{__scopeRadio:e,checked:n=!1,children:r,disabled:o,form:s,name:i,onCheck:a,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,h]=p.useState(null),[m,g]=p.useState(null),y=p.useRef(!1),[v,x]=p.useReducer(C=>C+1,0),w=f?!!s||!!f.closest("form"):!0,b={checked:n,disabled:o,required:c,name:i,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:y,userInteractionCount:v,onUserInteraction:x,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:ze(()=>a==null?void 0:a(),"onCheck")};return l.jsx(RE,{scope:e,...b,children:zm(d)?d(b):r})}ze(Gm,"RadioProvider");var TE="RadioTrigger",ME=p.forwardRef(ze(function({__scopeRadio:e,onClick:n,...r},o){const{checked:s,disabled:i,value:a,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=Ms(TE,e),g=ie(o,c);return l.jsx(re.button,{type:"button",role:"radio","aria-checked":s,"data-state":Wc(s),"data-disabled":i?"":void 0,disabled:i,value:a,...r,ref:g,onClick:H(n,y=>{s||(f(),u()),m&&h&&(d.current=y.isPropagationStopped(),d.current||y.stopPropagation())})})},"RadioTrigger")),EE="RadioIndicator",jE=p.forwardRef(ze(function(e,n){const{__scopeRadio:r,forceMount:o,...s}=e,i=Ms(EE,r);return l.jsx(Ue,{present:o||i.checked,children:l.jsx(re.span,{"data-state":Wc(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),AE="RadioBubbleInput",DE=p.forwardRef(ze(function({__scopeRadio:e,onClick:n,...r},o){const{control:s,checked:i,required:a,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:y}=Ms(AE,e),v=ie(o,m),x=hr(s),w=p.useRef(!1),b=p.useRef(i),C=p.useRef(y);p.useEffect(()=>{const R=h;if(!R)return;const M=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(M,"checked").set,E=y!==C.current;C.current=y;const k=b.current!==i;b.current=i;const _=!(E&&g.current);if(k&&T){w.current=!E;const $=new Event("click",{bubbles:_});T.call(R,i),R.dispatchEvent($),w.current=!1}},[h,i,g,y]);const P=p.useRef(i);return l.jsx(re.input,{type:"radio","aria-hidden":!0,defaultChecked:P.current,required:a,disabled:c,name:u,value:d,form:f,...r,tabIndex:-1,ref:v,onClick:H(n,R=>{w.current&&R.stopPropagation()}),style:{...r.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function zm(t){return typeof t=="function"}ze(zm,"isFunction");function Wc(t){return t?"checked":"unchecked"}ze(Wc,"getState");var IE=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Kc="RadioGroup",[kE,wN]=Re(Kc,[un,Bm]),Um=un(),Es=Bm(),[NE,_E]=kE(Kc),OE=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,name:o,form:s,defaultValue:i,value:a,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=e,y=Um(r),v=Ht(f),[x,w]=Pe({prop:a,defaultProp:i??null,onChange:m,caller:Kc}),[b,C]=p.useState(null),P=ie(n,C),R=p.useRef(x);return p.useEffect(()=>{const M=s?b==null?void 0:b.ownerDocument.getElementById(s):b==null?void 0:b.closest("form");if(M instanceof HTMLFormElement){const j=ze(()=>w(R.current),"reset");return M.addEventListener("reset",j),()=>M.removeEventListener("reset",j)}},[b,s,w]),l.jsx(NE,{scope:r,name:o,form:s,required:c,disabled:u,value:x,onValueChange:w,children:l.jsx(ds,{asChild:!0,...y,orientation:d,dir:v,loop:h,children:l.jsx(re.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:P})})})},"RadioGroup")),LE="RadioGroupItemProvider",$E="RadioGroupItemTrigger";function Hm(t){const{__scopeRadioGroup:e,value:n,disabled:r,children:o,internal_do_not_use_render:s}=t,i=_E(LE,e),a=Es(e),c=i.disabled||r;return l.jsx(Gm,{...a,checked:i.value===n,disabled:c,required:i.required,name:i.name,form:i.form,value:n,onCheck:()=>i.onValueChange(n),internal_do_not_use_render:s,children:o})}ze(Hm,"RadioGroupItemProvider");var FE=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Um(r),i=Es(r),{checked:a,disabled:c}=Ms($E,i.__scopeRadio),u=p.useRef(null),d=ie(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=ze(g=>{IE.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=ze(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),l.jsx(fs,{asChild:!0,...s,focusable:!c,active:a,children:l.jsx(ME,{...i,...o,ref:d,onKeyDown:H(o.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:H(o.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),Id=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,value:o,disabled:s,...i}=e;return l.jsx(Hm,{__scopeRadioGroup:r,value:o,disabled:s,internal_do_not_use_render:({isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(FE,{...i,ref:n,__scopeRadioGroup:r}),a&&l.jsx(VE,{__scopeRadioGroup:r})]})})},"RadioGroupItem")),VE=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Es(r);return l.jsx(DE,{...s,...o,ref:n})},"RadioGroupItemBubbleInput")),kd=p.forwardRef(ze(function(e,n){const{__scopeRadioGroup:r,...o}=e,s=Es(r);return l.jsx(jE,{...s,...o,ref:n})},"RadioGroupIndicator"));const BE=S.forwardRef(function({orientation:e="vertical",className:n,style:r,...o},s){return l.jsx(OE,{ref:s,className:U("cny-radio-group",e==="horizontal"&&"cny-radio-group-horizontal",n),style:r,...o})}),GE=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=se(r,n,"radio",e);return l.jsxs(Id,{ref:i,className:d,style:f,...s,children:[h,l.jsx(kd,{})]})}const{className:a,style:c,styleTag:u}=se(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Id,{ref:i,className:U("radio",e),...s,children:l.jsx(kd,{})}),l.jsx("span",{children:o})]})});var zE=Object.defineProperty,cn=(t,e)=>zE(t,"name",{value:e,configurable:!0}),Yc="Switch",[UE,CN]=Re(Yc),[HE,Xc]=UE(Yc);function Wm(t){const{__scopeSwitch:e,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[h,m]=Pe({prop:n,defaultProp:o??!1,onChange:c,caller:Yc}),[g,y]=p.useState(null),[v,x]=p.useState(null),w=p.useRef(!1),[b,C]=p.useReducer(M=>M+1,0),P=g?!!i||!!g.closest("form"):!0,R={checked:h,setChecked:m,disabled:s,control:g,setControl:y,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:b,onUserInteraction:C,required:u,defaultChecked:o,isFormControl:P,bubbleInput:v,setBubbleInput:x};return l.jsx(HE,{scope:e,...R,children:Km(f)?f(R):r})}cn(Wm,"SwitchProvider");var WE="SwitchTrigger",KE=p.forwardRef(cn(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,form:i,value:a,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:y,bubbleInput:v}=Xc(WE,e),x=ie(o,f),w=p.useRef(u);return p.useEffect(()=>{const b=i?s==null?void 0:s.ownerDocument.getElementById(i):s==null?void 0:s.form;if(b instanceof HTMLFormElement){const C=cn(()=>h(w.current),"reset");return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[s,i,h]),l.jsx(re.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":qc(u),"data-disabled":c?"":void 0,disabled:c,value:a,...r,ref:x,onClick:H(n,b=>{g(),h(C=>!C),v&&y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})},"SwitchTrigger")),Nd=p.forwardRef(cn(function(e,n){const{__scopeSwitch:r,name:o,checked:s,defaultChecked:i,required:a,disabled:c,value:u,onCheckedChange:d,form:f,...h}=e;return l.jsx(Wm,{__scopeSwitch:r,checked:s,defaultChecked:i,disabled:c,required:a,onCheckedChange:d,name:o,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(KE,{...h,ref:n,__scopeSwitch:r}),m&&l.jsx(qE,{__scopeSwitch:r})]})})},"Switch")),YE="SwitchThumb",_d=p.forwardRef(cn(function(e,n){const{__scopeSwitch:r,...o}=e,s=Xc(YE,r);return l.jsx(re.span,{"data-state":qc(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:n})},"SwitchThumb")),XE="SwitchBubbleInput",qE=p.forwardRef(cn(function({__scopeSwitch:e,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:y,setBubbleInput:v}=Xc(XE,e),x=ie(o,v),w=hr(s),b=p.useRef(!1),C=p.useRef(c),P=p.useRef(a);p.useEffect(()=>{const M=y;if(!M)return;const j=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(j,"checked").set,k=a!==P.current;P.current=a;const _=C.current!==c;C.current=c;const $=!(k&&i.current);if(_&&E){b.current=!k;const G=new Event("click",{bubbles:$});E.call(M,c),M.dispatchEvent(G),b.current=!1}},[y,c,i,a]);const R=p.useRef(c);return l.jsx(re.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:d,disabled:f,name:h,value:m,form:g,...r,tabIndex:-1,ref:x,onClick:H(n,M=>{b.current&&M.stopPropagation()}),style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Km(t){return typeof t=="function"}cn(Km,"isFunction");function qc(t){return t?"checked":"unchecked"}cn(qc,"getState");const ZE=S.forwardRef(function({className:e,style:n,sx:r,children:o,...s},i){if(!o){const{className:d,style:f,styleTag:h}=se(r,n,"switch",e);return l.jsxs(Nd,{ref:i,className:d,style:f,...s,children:[h,l.jsx(_d,{className:"switch-thumb"})]})}const{className:a,style:c,styleTag:u}=se(r,n,"control");return l.jsxs("label",{className:a,style:c,children:[u,l.jsx(Nd,{ref:i,className:U("switch",e),...s,children:l.jsx(_d,{className:"switch-thumb"})}),l.jsx("span",{children:o})]})});function Uo(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Od(t){const e=new Date(t);return e.setHours(23,59,59,999),e}function Po(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Pi(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}function QE(t,e){return t.getFullYear()===e.getFullYear()}function Mt(t){return new Date(t.getFullYear(),t.getMonth(),1)}function JE(t){return new Date(t.getFullYear(),0,1)}function Ld(t){return new Date(Math.floor(t.getFullYear()/10)*10,0,1)}function Ro(t,e){const n=new Date(t);return n.setDate(1),n.setMonth(n.getMonth()+e),n}function os(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Rt(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n}function Ri(t,e,n,r=0){const o=new Date(t);return o.setHours(e,n,r,0),o}function We(t,e,n){return e&&t.getTime()<e.getTime()?new Date(e):n&&t.getTime()>n.getTime()?new Date(n):t}function ej(t,e){const n=Mt(t),r=(n.getDay()-e+7)%7,o=os(n,-r);return Array.from({length:42},(s,i)=>os(o,i))}function tj(t,e){const n=new Intl.DateTimeFormat(t,{weekday:"short"}),r=new Date(2024,0,7);return Array.from({length:7},(o,s)=>{const i=os(r,(s+e)%7);return n.format(i)})}function nj(t,e="short"){const n=new Intl.DateTimeFormat(t,{month:e});return Array.from({length:12},(r,o)=>n.format(new Date(2024,o,1)))}function $d(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function rj(t,e){return new Intl.DateTimeFormat(e,{year:"numeric"}).format(t)}function oj(t,e){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function Ym(t,e){return new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"}).format(t)}function Xm(t,e,n,r){return new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit",second:r?"2-digit":void 0,hour12:n}).format(t)}function sj(t,e,n,r){return`${Ym(t,e)} · ${Xm(t,e,n,r)}`}function To(t){if(t==null||t==="")return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:new Date(t);const e=new Date(t);return Number.isNaN(e.getTime())?null:e}function Mo(t,e){return t.getTime()<e.getTime()}function Eo(t,e){return t.getTime()>e.getTime()}function jo(t){return t<10?`0${t}`:String(t)}function ij(t){return t||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function aj(t){try{return new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}function cj(t,e,n,r,o){switch(e){case"year":return rj(t,n);case"month":return oj(t,n);case"time":return Xm(t,n,r,o);case"datetime":return sj(t,n,r,o);case"date":default:return Ym(t,n)}}function lj(t,e){switch(e){case"year":return JE(t);case"month":return Mt(t);case"date":return Uo(t);default:return new Date(t)}}const uj=S.forwardRef(function({mode:e="date",value:n,defaultValue:r,onChange:o,min:s,max:i,allow:a="any",disabledDate:c,disabledTime:u,placeholder:d,size:f,color:h="primary",disabled:m=!1,clearable:g=!0,locale:y,weekStartsOn:v=0,hour12:x,showSeconds:w=!1,minuteStep:b=1,secondStep:C=1,format:P,icon:R,required:M=!1,validate:j,error:T,onValidate:E,id:k,className:_,style:$,sx:G,"aria-invalid":Q,"aria-describedby":V,dialogLabel:I,name:L,open:O,onOpenChange:D,...X},A){const B=ij(y),ee=x??aj(B),K=S.useId(),W=k??`cny-dp-${K}`,oe=`${W}-dialog`,Y=`${W}-hint`,z=S.useMemo(()=>{const N=To(s),J=a==="future"||a==="current"?Uo(new Date):null;return N&&J?N.getTime()>J.getTime()?N:J:N??J},[s,a]),Z=S.useMemo(()=>{const N=To(i),J=a==="past"||a==="current"?Od(new Date):null;return N&&J?N.getTime()<J.getTime()?N:J:N??J},[i,a]),le=n!==void 0,[ce,F]=S.useState(()=>To(r)),q=le?To(n):ce,he=O!==void 0,[ue,He]=S.useState(!1),ve=he?O:ue,qe=S.useCallback(N=>{he||He(N),D==null||D(N)},[he,D]),gn=S.useMemo(()=>q??We(new Date,z,Z),[q,z,Z]),[pe,we]=S.useState(()=>Mt(gn)),[Se,ke]=S.useState(()=>gn),$s=e==="month"?"month":e==="year"?"year":"date",[nt,yn]=S.useState($s),Fs=S.useRef(null);S.useImperativeHandle(A,()=>Fs.current,[]);const mr=S.useRef(null),Vs=S.useRef(null),bl=S.useRef(null),Bs=S.useRef(null),[Sy,Py]=S.useState({}),[Ry,Ty]=S.useState(!1);S.useEffect(()=>Ty(!0),[]);const Nn=S.useCallback(N=>z&&Mo(N,z)||Z&&Eo(N,Z)?!0:c?c(N):!1,[z,Z,c]),oo=S.useCallback(N=>u?u(N):!1,[u]),_n=S.useMemo(()=>{if(T)return typeof T=="string"?T:"Invalid";if(M&&!q)return"Required";if(q){const J=Uo(new Date);if(a==="future"&&Mo(q,J))return"Must be today or later";if(a==="past"&&Eo(q,Od(new Date)))return"Must be today or earlier";if(a==="current"&&!Po(q,J))return"Must be today";if(z&&Mo(q,z))return"Too early";if(Z&&Eo(q,Z))return"Too late";if(c&&c(q))return"Unavailable date";if(u&&u(q))return"Unavailable time"}const N=j==null?void 0:j(q);return N||null},[T,M,q,a,z,Z,c,u,j]),wl=S.useRef(null);S.useEffect(()=>{wl.current!==_n&&(wl.current=_n,E==null||E(_n))},[_n,E]);const so=_n!==null,Cl=so?"danger":h,My=q?P?P(q,e):cj(q,e,B,ee,w):"",Ey=d??{date:"Select date",month:"Select month",year:"Select year",time:"Select time",datetime:"Select date & time"}[e],jy=I??{date:"Choose date",month:"Choose month",year:"Choose year",time:"Choose time",datetime:"Choose date and time"}[e],Yt=S.useCallback(N=>{le||F(N),o==null||o(N)},[le,o]),io=S.useCallback(()=>{var N;qe(!1),(N=mr.current)==null||N.focus()},[qe]),Ay=S.useCallback(N=>{var J;N.stopPropagation(),Yt(null),(J=mr.current)==null||J.focus()},[Yt]),Sl=S.useCallback(()=>{if(m)return;const N=q??We(new Date,z,Z);we(Mt(N)),ke(N),yn($s),qe(!0)},[m,q,z,Z,qe,$s]);S.useEffect(()=>{if(!ve)return;const N=J=>{var ge,te;const ae=J.target;(ge=Fs.current)!=null&&ge.contains(ae)||(te=Vs.current)!=null&&te.contains(ae)||qe(!1)};return document.addEventListener("pointerdown",N,!0),()=>document.removeEventListener("pointerdown",N,!0)},[ve,qe]);const ao=S.useCallback(()=>{const N=mr.current,J=Vs.current;if(!N||!J)return;const ae=N.getBoundingClientRect(),ge=J.offsetHeight||340,te=J.offsetWidth||264,rt=window.innerHeight,Be=window.innerWidth,ot=4,je=8,Xt=rt-ae.bottom,zs=ae.top,ev=Xt<ge+ot&&zs>Xt?Math.max(je,ae.top-ot-ge):Math.min(rt-ge-je,ae.bottom+ot),tv=Math.max(je,Math.min(ae.left,Be-te-je));Py({position:"fixed",top:ev,left:tv,width:te})},[]);S.useLayoutEffect(()=>{ve&&ao()},[ve,e,ao]),S.useEffect(()=>{if(!ve)return;const N=()=>ao();return window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[ve,ao]),S.useEffect(()=>{var N,J;ve&&(nt==="date"&&(e==="date"||e==="datetime")?(N=bl.current)==null||N.focus():(nt==="month"||nt==="year")&&((J=Bs.current)==null||J.focus()))},[ve,Se,e,nt]);const Pl=S.useCallback(()=>{var N;nt==="year"&&e!=="year"?yn("month"):nt==="month"&&e!=="month"?yn("date"):(qe(!1),(N=mr.current)==null||N.focus())},[nt,e,qe]),co=S.useCallback(N=>{const J=We(N,z,Z);ke(J),we(ae=>Pi(ae,J)?ae:Mt(J))},[z,Z]),gr=S.useCallback((N,J)=>{const ae=lj(N,e);if(e!=="time"&&Nn(ae))return;const ge=e==="time"||e==="datetime"?Ri(ae,(q??N).getHours(),(q??N).getMinutes(),w?(q??N).getSeconds():0):ae;Yt(ge),ke(ge),((J==null?void 0:J.close)??(e!=="datetime"&&e!=="time"))&&io()},[e,Nn,Yt,q,w,io]),lo=S.useCallback((N,J)=>{const ae=q??We(new Date,z,Z),ge=N==="hour"?J:ae.getHours(),te=N==="minute"?J:ae.getMinutes(),rt=N==="second"?J:w?ae.getSeconds():0,Be=Ri(ae,ge,te,rt);oo(Be)||(Yt(Be),ke(Be))},[q,z,Z,w,oo,Yt]),On=S.useCallback(N=>co(os(Se,N)),[co,Se]),Dy=N=>{switch(N.key){case"ArrowLeft":N.preventDefault(),On(-1);break;case"ArrowRight":N.preventDefault(),On(1);break;case"ArrowUp":N.preventDefault(),On(-7);break;case"ArrowDown":N.preventDefault(),On(7);break;case"Home":{N.preventDefault();const J=(Se.getDay()-v+7)%7;On(-J);break}case"End":{N.preventDefault();const J=(Se.getDay()-v+7)%7;On(6-J);break}case"PageUp":N.preventDefault(),co(N.shiftKey?Rt(Se,-1):Ro(Se,-1));break;case"PageDown":N.preventDefault(),co(N.shiftKey?Rt(Se,1):Ro(Se,1));break;case"Enter":case" ":N.preventDefault(),gr(Se);break;case"Escape":N.preventDefault(),Pl();break}},Iy=S.useMemo(()=>ej(pe,v),[pe,v]),ky=S.useMemo(()=>tj(B,v),[B,v]),Ny=S.useMemo(()=>nj(B,"short"),[B]),Gs=S.useMemo(()=>Uo(new Date),[]),_y=!z||!Mo(Mt(pe),Mt(z)),Oy=!Z||!Eo(Mt(pe),Mt(Z)),Ly=!z||pe.getFullYear()-1>=z.getFullYear(),$y=!Z||pe.getFullYear()+1<=Z.getFullYear(),vn=Ld(pe).getFullYear(),Fy=!z||vn-10+9>=z.getFullYear(),Vy=!Z||vn+10<=Z.getFullYear(),By=e==="time"?!oo(new Date):!Nn(Gs),Gy=()=>{if(e==="time"){const N=new Date;if(oo(N))return;const ae=Ri(q??N,N.getHours(),N.getMinutes(),w?N.getSeconds():0);Yt(ae),ke(ae);return}gr(Gs,{close:e!=="datetime"})},zy=U("cny-datepicker-trigger","input",Cl!=="primary"&&Cl,f==="sm"||f==="lg"?f:null,q&&"has-value",ve&&"is-open"),Uy=R??(e==="time"?l.jsx(DS,{size:15}):l.jsx(bS,{size:15})),Rl=(N,J)=>{let ge=!0;switch(N.key){case"ArrowLeft":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()+11)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()-1,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"ArrowRight":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()+1)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()+1,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"ArrowUp":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()-3+12)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()-3,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"ArrowDown":ke(J==="month"?te=>We(new Date(pe.getFullYear(),(te.getMonth()+3)%12,Math.min(te.getDate(),28)),z,Z):te=>We(new Date(te.getFullYear()+3,te.getMonth(),Math.min(te.getDate(),28)),z,Z));break;case"PageUp":we(J==="month"?te=>Rt(te,N.shiftKey?-10:-1):te=>Rt(te,N.shiftKey?-100:-10));break;case"PageDown":we(J==="month"?te=>Rt(te,N.shiftKey?10:1):te=>Rt(te,N.shiftKey?100:10));break;case"Enter":case" ":J==="month"?Tl(new Date(pe.getFullYear(),Se.getMonth(),1)):Ml(Se.getFullYear());break;case"Escape":Pl();break;default:ge=!1}ge&&N.preventDefault()};S.useEffect(()=>{if(ve&&nt==="year"){const N=Ld(pe).getFullYear(),J=Se.getFullYear();(J<N-1||J>N+10)&&we(new Date(J,0,1))}},[ve,nt,Se,pe]);const Tl=N=>{e==="month"?gr(N):(we(Mt(N)),ke(We(N,z,Z)),yn("date"))},Ml=N=>{if(e==="year")gr(new Date(N,0,1));else{const J=new Date(N,pe.getMonth(),1);we(J),ke(We(new Date(N,Se.getMonth(),Math.min(Se.getDate(),28)),z,Z)),yn("month")}},Hy=()=>{const N=Se.getMonth();return Ny.map((J,ae)=>{const ge=new Date(pe.getFullYear(),ae,1),te=!!q&&Pi(ge,q)&&QE(ge,q),rt=ge.getMonth()===pe.getMonth()&&e!=="month",Be=ae===N,ot=Nn(ge);return l.jsx("button",{ref:Be?Bs:void 0,type:"button",tabIndex:Be?0:-1,className:U("cny-datepicker-chip",te&&"is-selected",rt&&!te&&"is-current"),disabled:ot,onClick:()=>Tl(ge),onFocus:()=>ke(new Date(pe.getFullYear(),ae,Math.min(Se.getDate(),28))),children:J},ae)})},Wy=()=>{const N=vn-1,J=Se.getFullYear();return Array.from({length:12},(ae,ge)=>{const te=N+ge,rt=new Date(te,0,1),Be=!!q&&q.getFullYear()===te,ot=te===pe.getFullYear()&&e!=="year",je=te===J,Xt=Nn(rt),zs=te<vn||te>=vn+10;return l.jsx("button",{ref:je?Bs:void 0,type:"button",tabIndex:je?0:-1,className:U("cny-datepicker-chip",Be&&"is-selected",ot&&!Be&&"is-current",zs&&"is-outside"),disabled:Xt,onClick:()=>Ml(te),onFocus:()=>ke(new Date(te,Se.getMonth(),Math.min(Se.getDate(),28))),children:te},te)})},Ky=S.useRef(null),El=S.useRef(null),jl=S.useRef(null),Al=()=>{const N=q??We(new Date,z,Z),J=N.getHours(),ae=N.getMinutes(),ge=N.getSeconds(),te=J>=12,rt=ee?J%12===0?12:J%12:J,Be=je=>{const Xt=ee?te?je===12?12:je+12:je===12?0:je:je;lo("hour",Xt)},ot=je=>{const Xt=je?J<12?J+12:J:J>=12?J-12:J;lo("hour",Xt)};return l.jsx("div",{className:"cny-dp-time",children:l.jsxs("div",{className:"cny-dp-time-row",children:[l.jsx(Ti,{ref:Ky,ariaLabel:"Hour",value:rt,min:ee?1:0,max:ee?12:23,step:1,nextRef:El,onChange:Be}),l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ti,{ref:El,ariaLabel:"Minute",value:ae-ae%Math.max(1,b),min:0,max:59,step:Math.max(1,b),nextRef:w?jl:void 0,onChange:je=>lo("minute",je)}),w&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-dp-time-sep","aria-hidden":"true",children:":"}),l.jsx(Ti,{ref:jl,ariaLabel:"Second",value:ge-ge%Math.max(1,C),min:0,max:59,step:Math.max(1,C),onChange:je=>lo("second",je)})]}),ee&&l.jsxs("div",{className:"cny-dp-ampm",role:"radiogroup","aria-label":"AM or PM",children:[l.jsx("button",{type:"button",role:"radio","aria-checked":!te,className:U("cny-dp-ampm-btn",!te&&"is-active"),onClick:()=>ot(!1),children:"AM"}),l.jsx("button",{type:"button",role:"radio","aria-checked":te,className:U("cny-dp-ampm-btn",te&&"is-active"),onClick:()=>ot(!0),children:"PM"})]})]})})},Yy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous month",disabled:!_y,onClick:()=>we(N=>Ro(N,-1)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to month picker (currently ${$d(pe,B)})`,onClick:()=>yn("month"),children:$d(pe,B)}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next month",disabled:!Oy,onClick:()=>we(N=>Ro(N,1)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsxs("div",{role:"grid",className:"cny-datepicker-grid",onKeyDown:Dy,children:[l.jsx("div",{role:"row",className:"cny-datepicker-weekdays",children:ky.map((N,J)=>l.jsx("span",{role:"columnheader","aria-label":N,className:"cny-datepicker-weekday",children:N.slice(0,2)},J))}),Array.from({length:6},(N,J)=>l.jsx("div",{role:"row",className:"cny-datepicker-row",children:Iy.slice(J*7,J*7+7).map(ae=>{const ge=!Pi(ae,pe),te=Po(ae,q),rt=Po(ae,Gs),Be=Po(ae,Se),ot=Nn(ae);return l.jsx("button",{ref:Be?bl:void 0,type:"button",role:"gridcell",tabIndex:Be?0:-1,"aria-selected":te,"aria-current":rt?"date":void 0,"aria-disabled":ot||void 0,disabled:ot,className:U("cny-datepicker-cell",ge&&"is-outside",te&&"is-selected",rt&&"is-today"),onClick:()=>gr(ae),onFocus:()=>ke(ae),children:ae.getDate()},ae.toISOString())})},J))]})]}),Xy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous year",disabled:!Ly,onClick:()=>we(N=>Rt(N,-1)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-datepicker-title is-clickable","aria-label":`Switch to year picker (currently ${pe.getFullYear()})`,onClick:()=>yn("year"),children:pe.getFullYear()}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next year",disabled:!$y,onClick:()=>we(N=>Rt(N,1)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Month picker",className:"cny-datepicker-chip-grid",onKeyDown:N=>Rl(N,"month"),children:Hy()})]}),qy=()=>l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"cny-datepicker-header",children:[l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Previous decade",disabled:!Fy,onClick:()=>we(N=>Rt(N,-10)),children:l.jsx(Vo,{size:16,"aria-hidden":"true"})}),l.jsx("span",{className:"cny-datepicker-title",children:`${vn} – ${vn+9}`}),l.jsx("button",{type:"button",className:"cny-datepicker-nav","aria-label":"Next decade",disabled:!Vy,onClick:()=>we(N=>Rt(N,10)),children:l.jsx(Jt,{size:16,"aria-hidden":"true"})})]}),l.jsx("div",{role:"grid","aria-label":"Year picker",className:"cny-datepicker-chip-grid",onKeyDown:N=>Rl(N,"year"),children:Wy()})]}),{className:Zy,style:Qy,styleTag:Jy}=se(G,$,"cny-datepicker",`mode-${e}`,m&&"is-disabled",_);return l.jsxs("div",{ref:Fs,className:Zy,style:Qy,...X,children:[Jy,L&&l.jsx("input",{type:"hidden",name:L,value:q?q.toISOString():"",readOnly:!0}),l.jsxs("button",{ref:mr,type:"button",id:W,className:zy,"aria-haspopup":"dialog","aria-expanded":ve,"aria-controls":ve?oe:void 0,"aria-invalid":Q||so,"aria-describedby":U(V,so?Y:void 0)||void 0,"aria-required":M||void 0,disabled:m,onClick:Sl,onKeyDown:N=>{N.key==="ArrowDown"||N.key==="Enter"||N.key===" "?(N.preventDefault(),Sl()):N.key==="Escape"&&ve&&(N.preventDefault(),qe(!1))},children:[l.jsx("span",{className:"cny-datepicker-icon","aria-hidden":"true",children:Uy}),l.jsx("span",{className:U("cny-datepicker-value",!q&&"is-placeholder"),children:My||Ey}),g&&q&&!m&&l.jsx("span",{role:"button",tabIndex:-1,className:"cny-datepicker-clear","aria-label":"Clear",onClick:Ay,onPointerDown:N=>N.stopPropagation(),children:l.jsx(Wt,{size:13,"aria-hidden":"true"})})]}),so&&T!==!1&&l.jsx("span",{id:Y,className:"cny-datepicker-error",role:"alert",children:typeof T=="string"?T:T??_n}),ve&&Ry&&Da.createPortal(l.jsxs("div",{ref:Vs,id:oe,role:"dialog","aria-modal":"false","aria-label":jy,className:U("cny-datepicker-panel",`is-${e}`),style:Sy,children:[l.jsxs("div",{className:"cny-datepicker-body",children:[(e==="date"||e==="datetime")&&nt==="date"&&Yy(),(e==="date"||e==="datetime"||e==="month")&&nt==="month"&&Xy(),(e==="date"||e==="datetime"||e==="month"||e==="year")&&nt==="year"&&qy(),e==="time"&&Al(),e==="datetime"&&nt==="date"&&Al()]}),l.jsxs("div",{className:"cny-datepicker-footer",children:[l.jsx("button",{type:"button",className:"cny-datepicker-action",disabled:!By,onClick:Gy,children:e==="time"?"Now":e==="year"?"This year":e==="month"?"This month":"Today"}),l.jsx("div",{className:"cny-datepicker-footer-spacer"}),g&&q&&l.jsx("button",{type:"button",className:"cny-datepicker-action",onClick:()=>{Yt(null),io()},children:"Clear"}),(e==="datetime"||e==="time")&&l.jsx("button",{type:"button",className:"cny-datepicker-action is-primary",onClick:io,children:"Done"})]})]}),document.body)]})}),Ti=S.forwardRef(function({value:e,min:n,max:r,step:o,ariaLabel:s,nextRef:i,onChange:a},c){const u=S.useRef(null);S.useImperativeHandle(c,()=>u.current,[]);const[d,f]=S.useState(()=>jo(e)),h=S.useRef(!1);S.useEffect(()=>{h.current||f(jo(e))},[e]);const m=S.useCallback(x=>{if(!Number.isFinite(x))return;let w=Math.max(n,Math.min(r,x));w=Math.round(w/o)*o,w>r&&(w=Math.floor(r/o)*o),a(w),f(jo(w))},[n,r,o,a]),g=()=>{const x=e+o;m(x>r?n:x)},y=()=>{const x=e-o;m(x<n?Math.floor(r/o)*o:x)},v=x=>{switch(x.key){case"ArrowUp":x.preventDefault(),g();break;case"ArrowDown":x.preventDefault(),y();break;case"PageUp":x.preventDefault(),m(e+o*5);break;case"PageDown":x.preventDefault(),m(e-o*5);break;case"Home":x.preventDefault(),m(n);break;case"End":x.preventDefault(),m(r);break;case"Enter":x.preventDefault(),m(parseInt(d,10));break}};return l.jsxs("div",{className:"cny-dp-timefield",onWheel:x=>{document.activeElement===u.current&&(x.preventDefault(),x.deltaY<0?g():x.deltaY>0&&y())},children:[l.jsx("input",{ref:u,type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:2,className:"cny-dp-timefield-input",value:d,"aria-label":s,"aria-valuenow":e,"aria-valuemin":n,"aria-valuemax":r,onFocus:x=>{h.current=!0,x.target.select()},onChange:x=>{var b;const w=x.target.value.replace(/[^0-9]/g,"").slice(0,2);if(f(w),w.length===2){const C=parseInt(w,10);Number.isFinite(C)&&C>=n&&C<=r&&(m(C),(b=i==null?void 0:i.current)==null||b.focus())}},onBlur:()=>{h.current=!1;const x=parseInt(d,10);Number.isFinite(x)?m(x):f(jo(e))},onKeyDown:v}),l.jsxs("div",{className:"cny-dp-timefield-controls",children:[l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Increment ${s.toLowerCase()}`,tabIndex:-1,onClick:g,onMouseDown:x=>x.preventDefault(),children:l.jsx(bp,{size:10,"aria-hidden":"true"})}),l.jsx("button",{type:"button",className:"cny-dp-timefield-btn","aria-label":`Decrement ${s.toLowerCase()}`,tabIndex:-1,onClick:y,onMouseDown:x=>x.preventDefault(),children:l.jsx(zr,{size:10,"aria-hidden":"true"})})]})]})});function dj({hotkey:t=!0}={}){const[e,n]=S.useState(!1);return S.useEffect(()=>{if(!t)return;const r=o=>{o.key==="k"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),n(s=>!s))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t]),{open:e,setOpen:n,toggle:()=>n(r=>!r)}}function fj({open:t,onOpenChange:e,sections:n,placeholder:r="Search…",title:o="Command palette",description:s="Search and navigate. Use arrow keys to move, Enter to open, Escape to dismiss.",emptyText:i="No matches found.",footer:a,onItemSelect:c,contentClassName:u}){const d=f=>{var h;f.disabled||((h=f.onSelect)==null||h.call(f),c==null||c(f),e(!1))};return l.jsxs(De.Dialog,{open:t,onOpenChange:e,label:o,contentClassName:U("cny-cmdk-content",u),children:[l.jsxs(cm,{children:[l.jsx(Vc,{children:o}),l.jsx(Bc,{children:s})]}),l.jsxs("div",{className:"cny-cmdk-header",children:[l.jsx(Mp,{size:16,"aria-hidden":"true"}),l.jsx(De.Input,{placeholder:r}),l.jsx("kbd",{className:"cny-cmdk-esc",children:"Esc"})]}),l.jsxs(De.List,{className:"cny-cmdk-list",children:[l.jsx(De.Empty,{className:"cny-cmdk-empty",children:i}),n.map(f=>l.jsx(De.Group,{heading:f.title,className:"cny-cmdk-group",children:f.items.map(h=>{var m;return l.jsxs(De.Item,{value:`${f.title} ${h.label} ${((m=h.keywords)==null?void 0:m.join(" "))??""}`,disabled:h.disabled,onSelect:()=>d(h),className:"cny-cmdk-item",children:[h.icon&&l.jsx("span",{className:"cny-cmdk-item-icon",children:h.icon}),l.jsx("span",{className:"cny-cmdk-item-label",children:h.label}),h.badge&&l.jsx("span",{className:"cny-cmdk-item-badge",children:h.badge}),h.hint&&l.jsx("span",{className:"cny-cmdk-item-hint",children:h.hint})]},h.id)})},f.title))]}),a!==!1&&l.jsx("div",{className:"cny-cmdk-footer",children:a??l.jsxs(l.Fragment,{children:[l.jsx("kbd",{children:"↑↓"})," navigate",l.jsx("kbd",{children:"↵"})," open",l.jsx("kbd",{children:"Esc"})," dismiss"]})})]})}function hj({onClick:t,label:e="Search…",shortcut:n="⌘K",className:r}){return l.jsxs("button",{type:"button",onClick:t,className:U("cny-cmdk-trigger",r),"aria-label":"Open command palette",children:[l.jsx(Mp,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"cny-cmdk-trigger-label",children:e}),l.jsx("kbd",{className:"cny-cmdk-trigger-kbd",children:n})]})}let pj=0;const mj=()=>`cny-toast-${Date.now().toString(36)}-${++pj}`,qm=S.createContext(null),gj={default:null,success:l.jsx(Sp,{size:16,"aria-hidden":"true"}),info:l.jsx(Rp,{size:16,"aria-hidden":"true"}),warning:l.jsx(Ep,{size:16,"aria-hidden":"true"}),danger:l.jsx(Cp,{size:16,"aria-hidden":"true"}),loading:l.jsx(Tp,{size:16,"aria-hidden":"true",className:"cny-toast-spin"})};function yj({children:t,position:e="bottom-right",defaultDuration:n=5e3,maxToasts:r=5,offset:o="1rem"}){const[s,i]=S.useState([]),[a,c]=S.useState(!1);S.useEffect(()=>c(!0),[]);const u=S.useCallback(y=>{i(v=>v.map(x=>y==null||x.id===y?{...x,exiting:!0}:x)),window.setTimeout(()=>{i(v=>v.filter(x=>y==null?!1:x.id!==y||!x.exiting)),i(v=>(v.filter(x=>x.exiting&&(y==null||x.id===y)).forEach(x=>{var w;return(w=x.onDismiss)==null?void 0:w.call(x)}),v.filter(x=>!x.exiting||y!=null&&x.id!==y)))},200)},[]),d=S.useCallback(y=>{const v=y.id??mj(),x={id:v,title:y.title,description:y.description,action:y.action,icon:y.icon,variant:y.variant??"default",duration:y.duration??n,dismissible:y.dismissible??!0,onDismiss:y.onDismiss,sx:y.sx};return i(w=>{const C=[...w.filter(P=>P.id!==v),x];return C.length>r?C.slice(C.length-r):C}),v},[n,r]),f=S.useCallback((y,v)=>{i(x=>x.map(w=>w.id===y?{...w,...v,variant:v.variant??w.variant,duration:v.duration??w.duration,dismissible:v.dismissible??w.dismissible}:w))},[]),h=S.useMemo(()=>{const y=(v=>d(typeof v=="string"?{title:v}:v));return y.success=(v,x)=>d({...x,title:v,variant:"success"}),y.info=(v,x)=>d({...x,title:v,variant:"info"}),y.warning=(v,x)=>d({...x,title:v,variant:"warning"}),y.error=(v,x)=>d({...x,title:v,variant:"danger"}),y.loading=(v,x)=>d({...x,title:v,variant:"loading",duration:(x==null?void 0:x.duration)??1/0}),y},[d]),m=S.useMemo(()=>({toast:h,dismiss:u,update:f}),[h,u,f]),g=e.startsWith("top-");return l.jsxs(qm.Provider,{value:m,children:[t,a&&Da.createPortal(l.jsx("ol",{className:U("cny-toast-viewport",`pos-${e}`),style:{"--cny-toast-offset":o},"aria-live":"polite","aria-relevant":"additions",tabIndex:-1,children:(g?[...s].reverse():s).map(y=>l.jsx(vj,{toast:y,onDismiss:()=>u(y.id)},y.id))}),document.body)]})}function vj({toast:t,onDismiss:e}){const{variant:n,title:r,description:o,action:s,icon:i,duration:a,dismissible:c,sx:u}=t,[d,f]=S.useState(!1),h=S.useRef(null);S.useEffect(()=>{if(!t.exiting&&!(!Number.isFinite(a)||a<0)&&!d)return h.current=setTimeout(e,a),()=>{h.current&&clearTimeout(h.current)}},[d,a,e,t.exiting]);const m=n==="danger"||n==="warning"?"alert":"status",g=i!==!1,y=i!==void 0&&i!==!1?i:gj[n],{className:v,style:x,styleTag:w}=se(u,void 0,"cny-toast",n,t.exiting&&"is-exiting");return l.jsxs("li",{role:m,"aria-atomic":"true",className:v,style:x,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),children:[w,g&&y&&l.jsx("span",{className:"cny-toast-icon","aria-hidden":"true",children:y}),l.jsxs("div",{className:"cny-toast-body",children:[r!=null&&l.jsx("p",{className:"cny-toast-title",children:r}),o!=null&&l.jsx("p",{className:"cny-toast-description",children:o})]}),s!=null&&l.jsx("div",{className:"cny-toast-action",children:s}),c&&l.jsx("button",{type:"button",className:"cny-toast-close","aria-label":"Dismiss",onClick:e,children:l.jsx(Wt,{size:14,"aria-hidden":"true"})})]})}function xj(){const t=S.useContext(qm);if(!t)throw new Error("useToast() must be called inside a <ToastProvider>. Wrap your app at the root.");return t}const Zm=S.forwardRef(function({title:e,description:n,children:r,footer:o,size:s="md",hideClose:i,className:a,style:c,sx:u,...d},f){const{className:h,style:m,styleTag:g}=se(u,c,"cny-dialog-content",`size-${s}`,a);return l.jsx(Oc,{...d,children:l.jsxs(Lc,{children:[l.jsx($c,{className:"cny-dialog-overlay"}),l.jsxs(Fc,{ref:f,className:h,style:m,children:[g,l.jsxs("header",{className:"cny-dialog-header",children:[l.jsxs("div",{className:"cny-dialog-titles",children:[l.jsx(Vc,{className:"cny-dialog-title",children:e}),n&&l.jsx(Bc,{className:"cny-dialog-description",children:n})]}),!i&&l.jsx(Ps,{className:"cny-dialog-close","aria-label":"Close dialog",children:l.jsx(Wt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-dialog-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-dialog-footer",children:o})]})]})})}),bj=Mm,wj=Ps;function Qm({open:t,onOpenChange:e,title:n,message:r,children:o,confirmLabel:s="Confirm",cancelLabel:i="Cancel",danger:a=!1,loading:c=!1,onConfirm:u,onCancel:d,className:f,style:h,sx:m}){const g=()=>{d==null||d(),e(!1)};return l.jsx(Zm,{open:t,onOpenChange:e,size:"sm",title:n,className:U("cny-confirm",f),style:h,sx:m,footer:l.jsxs(l.Fragment,{children:[l.jsx(jr,{variant:"ghost",color:"primary",onClick:g,disabled:c,children:i}),l.jsx(jr,{variant:"solid",color:a?"danger":"primary",loading:c,onClick:u,children:s})]}),children:o??l.jsx("p",{className:"cny-confirm-message",children:r})})}function Cj(){const[t,e]=S.useState(null),n=S.useCallback(i=>new Promise(a=>{e({...i,resolve:a})}),[]),r=S.useCallback(i=>{i||e(a=>(a==null||a.resolve(!1),null))},[]),o=S.useCallback(()=>{e(i=>(i==null||i.resolve(!0),null))},[]),s=t?l.jsx(Qm,{open:!0,onOpenChange:r,title:t.title,message:t.message,confirmLabel:t.confirmLabel,cancelLabel:t.cancelLabel,danger:t.danger,onConfirm:o}):null;return{confirm:n,confirmDialog:s}}const Sj=S.forwardRef(function({title:e,description:n,children:r,footer:o,side:s="right",size:i="md",hideClose:a,className:c,style:u,sx:d,...f},h){const{className:m,style:g,styleTag:y}=se(d,u,"cny-drawer-content",`side-${s}`,`size-${i}`,c);return l.jsx(Oc,{...f,children:l.jsxs(Lc,{children:[l.jsx($c,{className:"cny-drawer-overlay"}),l.jsxs(Fc,{ref:h,className:m,style:g,children:[y,l.jsxs("header",{className:"cny-drawer-header",children:[l.jsxs("div",{className:"cny-drawer-titles",children:[l.jsx(Vc,{className:"cny-drawer-title",children:e}),n&&l.jsx(Bc,{className:"cny-drawer-description",children:n})]}),!a&&l.jsx(Ps,{className:"cny-drawer-close","aria-label":"Close drawer",children:l.jsx(Wt,{size:16,"aria-hidden":"true"})})]}),r!=null&&l.jsx("div",{className:"cny-drawer-body",children:r}),o!=null&&l.jsx("footer",{className:"cny-drawer-footer",children:o})]})]})})}),Pj=Mm,Rj=Ps;var Tj=Object.defineProperty,de=(t,e)=>Tj(t,"name",{value:e,configurable:!0}),Sa=["Enter"," "],Mj=["ArrowDown","PageUp","Home"],Jm=["ArrowUp","PageDown","End"],Ej=[...Mj,...Jm],jj={ltr:[...Sa,"ArrowRight"],rtl:[...Sa,"ArrowLeft"]},Aj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},js="Menu",[Nr,Dj,Ij]=cr(js),[kn,As]=Re(js,[Ij,dn,un]),Ds=dn(),eg=un(),[tg,mn]=kn(js),[kj,Jr]=kn(js),Nj=de(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,a=Ds(e),[c,u]=p.useState(null),d=p.useRef(!1),f=Qe(s),h=Ht(o);return p.useEffect(()=>{const m=de(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=de(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=de(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),l.jsx(Wr,{...a,children:l.jsx(tg,{scope:e,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(kj,{scope:e,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:i,children:r})})})},"Menu"),ng=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e,s=Ds(r);return l.jsx(Kr,{...s,...o,ref:n})},"MenuAnchor")),rg="MenuPortal",[_j,og]=kn(rg,{forceMount:void 0}),Oj=de(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=mn(rg,e);return l.jsx(_j,{scope:e,forceMount:n,children:l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:r})})})},"MenuPortal"),vt="MenuContent",[Lj,Zc]=kn(vt),$j=p.forwardRef(de(function(e,n){const r=og(vt,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=mn(vt,e.__scopeMenu),a=Jr(vt,e.__scopeMenu);return l.jsx(Nr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ue,{present:o||i.open,children:l.jsx(Nr.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(Fj,{...s,ref:n}):l.jsx(Vj,{...s,ref:n})})})})},"MenuContent")),Fj=p.forwardRef(de(function(e,n){const r=mn(vt,e.__scopeMenu),o=p.useRef(null),s=ie(n,o);return p.useEffect(()=>{const i=o.current;if(i)return bs(i)},[]),l.jsx(Qc,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),Vj=p.forwardRef(de(function(e,n){const r=mn(vt,e.__scopeMenu);return l.jsx(Qc,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Bj=Nt("MenuContent.ScrollLock"),Qc=p.forwardRef(de(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:y,...v}=e,x=mn(vt,r),w=Jr(vt,r),b=Ds(r),C=eg(r),P=Dj(r),[R,M]=p.useState(null),j=p.useRef(null),T=ie(n,j,x.onContentChange),E=p.useRef(0),k=p.useRef(""),_=p.useRef(0),$=p.useRef(null),G=p.useRef("right"),Q=p.useRef(0),V=y?Xr:p.Fragment,I=y?{as:Bj,allowPinchZoom:!0}:void 0,L=de(D=>{var Y,z;const X=k.current+D,A=P().filter(Z=>!Z.disabled),B=document.activeElement,ee=(Y=A.find(Z=>Z.ref.current===B))==null?void 0:Y.textValue,K=A.map(Z=>Z.textValue),W=fg(K,X,ee),oe=(z=A.find(Z=>Z.textValue===W))==null?void 0:z.ref.current;de((function Z(le){k.current=le,window.clearTimeout(E.current),le!==""&&(E.current=window.setTimeout(()=>Z(""),1e3))}),"updateSearch")(X),oe&&setTimeout(()=>oe.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(E.current),[]),ur();const O=p.useCallback(D=>{var A,B;return G.current===((A=$.current)==null?void 0:A.side)&&pg(D,(B=$.current)==null?void 0:B.area)},[]);return l.jsx(Lj,{scope:r,searchRef:k,onItemEnter:p.useCallback(D=>{O(D)&&D.preventDefault()},[O]),onItemLeave:p.useCallback(D=>{var X;O(D)||((X=j.current)==null||X.focus(),M(null))},[O]),onTriggerLeave:p.useCallback(D=>{O(D)&&D.preventDefault()},[O]),pointerGraceTimerRef:_,onPointerGraceIntentChange:p.useCallback(D=>{$.current=D},[]),children:l.jsx(V,{...I,children:l.jsx(hs,{asChild:!0,trapped:s,onMountAutoFocus:H(i,D=>{var X;D.preventDefault(),(X=j.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:l.jsx(ds,{asChild:!0,...C,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:M,onEntryFocus:H(u,D=>{w.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(xs,{role:"menu","aria-orientation":"vertical","data-state":el(x.open),"data-radix-menu-content":"",dir:w.dir,...b,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:H(v.onKeyDown,D=>{const A=D.target.closest("[data-radix-menu-content]")===D.currentTarget,B=D.ctrlKey||D.altKey||D.metaKey,ee=D.key.length===1;A&&(D.key==="Tab"&&D.preventDefault(),!B&&ee&&L(D.key));const K=j.current;if(D.target!==K||!Ej.includes(D.key))return;D.preventDefault();const oe=P().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);Jm.includes(D.key)&&oe.reverse(),ug(oe)}),onBlur:H(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(E.current),k.current="")}),onPointerMove:H(e.onPointerMove,nr(D=>{const X=D.target,A=Q.current!==D.clientX;if(D.currentTarget.contains(X)&&A){const B=D.clientX>Q.current?"right":"left";G.current=B,Q.current=D.clientX}}))})})})})})})},"MenuContentImpl")),Gj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(re.div,{role:"group",...o,ref:n})},"MenuGroup")),zj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(re.div,{...o,ref:n})},"MenuLabel")),Pa="MenuItem",Fd="menu.itemSelect",Jc=p.forwardRef(de(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=p.useRef(null),a=Jr(Pa,e.__scopeMenu),c=Zc(Pa,e.__scopeMenu),u=ie(n,i),d=p.useRef(!1),f=de(()=>{const h=i.current;if(!r&&h){const m=new CustomEvent(Fd,{bubbles:!0,cancelable:!0});h.addEventListener(Fd,g=>o==null?void 0:o(g),{once:!0}),dc(h,m),m.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return l.jsx(sg,{...s,ref:u,disabled:r,onClick:H(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:H(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:H(e.onKeyDown,h=>{r||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||Sa.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),sg=p.forwardRef(de(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,a=Zc(Pa,r),c=eg(r),u=p.useRef(null),d=ie(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const y=u.current;y&&g((y.textContent??"").trim())},[i.children]),l.jsx(Nr.ItemSlot,{scope:r,disabled:o,textValue:s??m,children:l.jsx(fs,{asChild:!0,...c,focusable:!o,children:l.jsx(re.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:H(e.onPointerMove,nr(y=>{o?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:H(e.onPointerLeave,nr(y=>a.onItemLeave(y))),onFocus:H(e.onFocus,()=>h(!0)),onBlur:H(e.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Uj=p.forwardRef(de(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return l.jsx(ag,{scope:e.__scopeMenu,checked:r,children:l.jsx(Jc,{role:"menuitemcheckbox","aria-checked":_r(r)?"mixed":r,...s,ref:n,"data-state":Is(r),onSelect:H(s.onSelect,()=>o==null?void 0:o(_r(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Hj="MenuRadioGroup",[Wj,Kj]=kn(Hj,{value:void 0,onValueChange:de(()=>{},"onValueChange")}),Yj=p.forwardRef(de(function(e,n){const{value:r,onValueChange:o,...s}=e,i=Qe(o);return l.jsx(Wj,{scope:e.__scopeMenu,value:r,onValueChange:i,children:l.jsx(Gj,{...s,ref:n})})},"MenuRadioGroup")),Xj="MenuRadioItem",qj=p.forwardRef(de(function(e,n){const{value:r,...o}=e,s=Kj(Xj,e.__scopeMenu),i=r===s.value;return l.jsx(ag,{scope:e.__scopeMenu,checked:i,children:l.jsx(Jc,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":Is(i),onSelect:H(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),ig="MenuItemIndicator",[ag,Zj]=kn(ig,{checked:!1}),Qj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=Zj(ig,r);return l.jsx(Ue,{present:o||_r(i.checked)||i.checked===!0,children:l.jsx(re.span,{...s,ref:n,"data-state":Is(i.checked)})})},"MenuItemIndicator")),Jj=p.forwardRef(de(function(e,n){const{__scopeMenu:r,...o}=e;return l.jsx(re.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),cg="MenuSub",[eA,lg]=kn(cg),tA=de(t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,s=mn(cg,e),i=Ds(e),[a,c]=p.useState(null),[u,d]=p.useState(null),f=Qe(o);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(Wr,{...i,children:l.jsx(tg,{scope:e,open:r,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(eA,{scope:e,contentId:Fe(),triggerId:Fe(),trigger:a,onTriggerChange:c,children:n})})})},"MenuSub"),Ao="MenuSubTrigger",nA=p.forwardRef(de(function(e,n){const r=mn(Ao,e.__scopeMenu),o=Jr(Ao,e.__scopeMenu),s=lg(Ao,e.__scopeMenu),i=Zc(Ao,e.__scopeMenu),a=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},f=p.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=ie(n,s.onTriggerChange);return l.jsx(ng,{asChild:!0,...d,children:l.jsx(sg,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":el(r.open),...e,ref:h,onClick:m=>{var g;(g=e.onClick)==null||g.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:H(e.onPointerMove,nr(m=>{i.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:H(e.onPointerLeave,nr(m=>{var y,v;f();const g=(y=r.content)==null?void 0:y.getBoundingClientRect();if(g){const x=(v=r.content)==null?void 0:v.dataset.side,w=x==="right",b=w?-5:5,C=g[w?"left":"right"],P=g[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+b,y:m.clientY},{x:C,y:g.top},{x:P,y:g.top},{x:P,y:g.bottom},{x:C,y:g.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:H(e.onKeyDown,m=>{var y;e.disabled||m.target!==m.currentTarget||i.searchRef.current!==""&&m.key===" "||jj[o.dir].includes(m.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),m.preventDefault())})})})},"MenuSubTrigger")),rA="MenuSubContent",oA=p.forwardRef(de(function(e,n){const r=og(vt,e.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=e,a=mn(vt,e.__scopeMenu),c=Jr(vt,e.__scopeMenu),u=lg(rA,e.__scopeMenu),d=p.useRef(null),f=ie(n,d);return l.jsx(Nr.Provider,{scope:e.__scopeMenu,children:l.jsx(Ue,{present:o||a.open,children:l.jsx(Nr.Slot,{scope:e.__scopeMenu,children:l.jsx(Qc,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:H(e.onFocusOutside,h=>{h.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:H(e.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:H(e.onKeyDown,h=>{var y;const m=h.currentTarget.contains(h.target),g=Aj[c.dir].includes(h.key);m&&g&&(a.onOpenChange(!1),(y=u.trigger)==null||y.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function el(t){return t?"open":"closed"}de(el,"getOpenState");function _r(t){return t==="indeterminate"}de(_r,"isIndeterminate");function Is(t){return _r(t)?"indeterminate":t?"checked":"unchecked"}de(Is,"getCheckedState");function ug(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}de(ug,"focusFirst");function dg(t,e){return t.map((n,r)=>t[(e+r)%t.length])}de(dg,"wrapArray");function fg(t,e,n){const o=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=dg(t,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}de(fg,"getNextMatch");function hg(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}de(hg,"isPointInPolygon");function pg(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return hg(n,e)}de(pg,"isPointerInGraceArea");function nr(t){return e=>e.pointerType==="mouse"?t(e):void 0}de(nr,"whenMouse");var mg=Nj,gg=ng,yg=Oj,vg=$j,xg=zj,bg=Jc,wg=Uj,Cg=Yj,Sg=qj,Pg=Qj,Rg=Jj,Tg=tA,Mg=nA,Eg=oA,sA=Object.defineProperty,Je=(t,e)=>sA(t,"name",{value:e,configurable:!0}),tl="DropdownMenu",[iA,SN]=Re(tl,[As]),et=As(),[aA,jg]=iA(tl),cA=Je(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,c=et(e),u=p.useRef(null),[d,f]=Pe({prop:o,defaultProp:s??!1,onChange:i,caller:tl});return l.jsx(aA,{scope:e,triggerId:Fe(),triggerRef:u,contentId:Fe(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(mg,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})},"DropdownMenu"),lA="DropdownMenuTrigger",uA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=jg(lA,r),a=et(r),c=ie(n,i.triggerRef);return l.jsx(gg,{asChild:!0,...a,children:l.jsx(re.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:H(e.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:H(e.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),dA=Je(t=>{const{__scopeDropdownMenu:e,...n}=t,r=et(e);return l.jsx(yg,{...r,...n})},"DropdownMenuPortal"),fA="DropdownMenuContent",hA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=jg(fA,r),i=et(r),a=p.useRef(!1);return l.jsx(vg,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:H(e.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:H(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),pA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(xg,{...s,...o,ref:n})},"DropdownMenuLabel")),mA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(bg,{...s,...o,ref:n})},"DropdownMenuItem")),gA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(wg,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),yA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Cg,{...s,...o,ref:n})},"DropdownMenuRadioGroup")),vA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Sg,{...s,...o,ref:n})},"DropdownMenuRadioItem")),xA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Pg,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),bA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Rg,{...s,...o,ref:n})},"DropdownMenuSeparator")),wA=Je(t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:s}=t,i=et(e),[a,c]=Pe({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return l.jsx(Tg,{...i,open:a,onOpenChange:c,children:n})},"DropdownMenuSub"),CA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Mg,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),SA=p.forwardRef(Je(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=et(r);return l.jsx(Eg,{...s,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),PA=cA,RA=uA,Ag=dA,TA=hA,MA=pA,EA=mA,jA=gA,AA=yA,DA=vA,Dg=xA,IA=bA,kA=wA,NA=CA,_A=SA;const OA=PA,LA=RA,$A=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",sideOffset:s=6,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(Ag,{children:l.jsxs(TA,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i]})})}),FA=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(EA,{ref:a,className:U("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),VA=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(jA,{ref:s,className:U("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Dg,{children:l.jsx(rn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),BA=AA,GA=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(DA,{ref:s,className:U("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Dg,{children:l.jsx(Pp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),zA=S.forwardRef(function({className:e,...n},r){return l.jsx(MA,{ref:r,className:U("cny-menu-label",e),...n})}),UA=S.forwardRef(function({className:e,...n},r){return l.jsx(IA,{ref:r,className:U("cny-menu-separator",e),...n})}),HA=kA,WA=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(NA,{ref:s,className:U("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Jt,{size:13,"aria-hidden":"true"})})]})}),KA=S.forwardRef(function({className:e,...n},r){return l.jsx(Ag,{children:l.jsx(_A,{ref:r,className:U("cny-menu-content",e),...n})})});var YA=Object.defineProperty,Ve=(t,e)=>YA(t,"name",{value:e,configurable:!0}),nl="ContextMenu",[XA,PN]=Re(nl,[As]),tt=As(),[qA,Ig]=XA(nl),ZA=Ve(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,dir:s,modal:i=!0}=t,a=p.useRef(!1),[c,u]=Pe({prop:o,defaultProp:!1,onChange:r,caller:nl}),d=tt(e);return l.jsx(qA,{scope:e,open:c,onOpenChange:u,modal:i,hasInteractedRef:a,children:l.jsx(mg,{...d,dir:s,open:c,onOpenChange:u,modal:i,children:n})})},"ContextMenu"),QA="ContextMenuTrigger",JA=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,disabled:o=!1,...s}=e,i=Ig(QA,r),a=tt(r),[c,u]=p.useState({x:0,y:0}),d=p.useMemo(()=>({current:{getBoundingClientRect:Ve(()=>DOMRect.fromRect({width:0,height:0,...c}),"getBoundingClientRect")}}),[c]),f=p.useRef(0),h=p.useCallback(()=>window.clearTimeout(f.current),[]),m=Ve(g=>{i.hasInteractedRef.current=!0,u({x:g.clientX,y:g.clientY}),i.onOpenChange(!0)},"handleOpen");return p.useEffect(()=>h,[h]),p.useEffect(()=>void(o&&h()),[o,h]),l.jsxs(l.Fragment,{children:[l.jsx(gg,{...a,virtualRef:d}),l.jsx(re.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...s,ref:n,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:H(e.onContextMenu,g=>{h(),m(g),g.preventDefault()}),onPointerDown:o?e.onPointerDown:H(e.onPointerDown,br(g=>{h(),i.open&&i.onOpenChange(!1),f.current=window.setTimeout(()=>m(g),700)})),onPointerMove:o?e.onPointerMove:H(e.onPointerMove,br(h)),onPointerCancel:o?e.onPointerCancel:H(e.onPointerCancel,br(h)),onPointerUp:o?e.onPointerUp:H(e.onPointerUp,br(h))})]})},"ContextMenuTrigger")),eD=Ve(t=>{const{__scopeContextMenu:e,...n}=t,r=tt(e);return l.jsx(yg,{...r,...n})},"ContextMenuPortal"),tD="ContextMenuContent",nD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=Ig(tD,r),i=tt(r),a=p.useRef(!1);return l.jsx(vg,{...i,...o,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var u;(u=e.onCloseAutoFocus)==null||u.call(e,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var u;(u=e.onInteractOutside)==null||u.call(e,c),!c.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),rD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(xg,{...s,...o,ref:n})},"ContextMenuLabel")),oD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(bg,{...s,...o,ref:n})},"ContextMenuItem")),sD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(wg,{...s,...o,ref:n})},"ContextMenuCheckboxItem")),iD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Cg,{...s,...o,ref:n})},"ContextMenuRadioGroup")),aD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Sg,{...s,...o,ref:n})},"ContextMenuRadioItem")),cD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Pg,{...s,...o,ref:n})},"ContextMenuItemIndicator")),lD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Rg,{...s,...o,ref:n})},"ContextMenuSeparator")),uD="ContextMenuSub",dD=Ve(t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:s}=t,i=tt(e),[a,c]=Pe({prop:o,defaultProp:s??!1,onChange:r,caller:uD});return l.jsx(Tg,{...i,open:a,onOpenChange:c,children:n})},"ContextMenuSub"),fD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Mg,{...s,...o,ref:n})},"ContextMenuSubTrigger")),hD=p.forwardRef(Ve(function(e,n){const{__scopeContextMenu:r,...o}=e,s=tt(r);return l.jsx(Eg,{...s,...o,ref:n,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function br(t){return e=>e.pointerType!=="mouse"?t(e):void 0}Ve(br,"whenTouchOrPen");var pD=ZA,mD=JA,kg=eD,gD=nD,yD=rD,vD=oD,xD=sD,bD=iD,wD=aD,Ng=cD,CD=lD,SD=dD,PD=fD,RD=hD;const TD=pD,MD=mD,ED=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",alignOffset:s=-4,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(r,n,"cny-menu-content",`size-${o}`,e);return l.jsx(kg,{children:l.jsxs(gD,{ref:c,className:u,style:d,alignOffset:s,...a,children:[f,i]})})}),jD=S.forwardRef(function({icon:e,shortcut:n,destructive:r,className:o,children:s,...i},a){return l.jsxs(vD,{ref:a,className:U("cny-menu-item",r&&"is-destructive",o),...i,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:s}),n&&l.jsx("span",{className:"cny-menu-item-shortcut",children:n})]})}),AD=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(xD,{ref:s,className:U("cny-menu-item is-check",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Ng,{children:l.jsx(rn,{size:13,"aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),DD=bD,ID=S.forwardRef(function({shortcut:e,className:n,children:r,...o},s){return l.jsxs(wD,{ref:s,className:U("cny-menu-item is-radio",n),...o,children:[l.jsx("span",{className:"cny-menu-item-icon",children:l.jsx(Ng,{children:l.jsx(Pp,{size:6,fill:"currentColor","aria-hidden":"true"})})}),l.jsx("span",{className:"cny-menu-item-label",children:r}),e&&l.jsx("span",{className:"cny-menu-item-shortcut",children:e})]})}),kD=S.forwardRef(function({className:e,...n},r){return l.jsx(yD,{ref:r,className:U("cny-menu-label",e),...n})}),ND=S.forwardRef(function({className:e,...n},r){return l.jsx(CD,{ref:r,className:U("cny-menu-separator",e),...n})}),_D=SD,OD=S.forwardRef(function({icon:e,className:n,children:r,...o},s){return l.jsxs(PD,{ref:s,className:U("cny-menu-item is-sub",n),...o,children:[e&&l.jsx("span",{className:"cny-menu-item-icon",children:e}),l.jsx("span",{className:"cny-menu-item-label",children:r}),l.jsx("span",{className:"cny-menu-item-chevron",children:l.jsx(Jt,{size:13,"aria-hidden":"true"})})]})}),LD=S.forwardRef(function({className:e,...n},r){return l.jsx(kg,{children:l.jsx(RD,{ref:r,className:U("cny-menu-content",e),...n})})});var $D=Object.defineProperty,Ie=(t,e)=>$D(t,"name",{value:e,configurable:!0}),[rl,RN]=Re("Tooltip",[dn]),ks=dn(),FD="TooltipProvider",VD=700,Ra="tooltip.open",[BD,ol]=rl(FD),GD=Ie(t=>{const{__scopeTooltip:e,delayDuration:n=VD,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=p.useRef(!0),a=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(BD,{scope:e,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:p.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:p.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),Ta="Tooltip",[zD,eo]=rl(Ta),UD=Ie(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=t,c=ol(Ta,t.__scopeTooltip),u=ks(e),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=Fe(),y=p.useRef(0),v=i??c.disableHoverableContent,x=a??c.delayDuration,w=p.useRef(!1),[b,C]=Pe({prop:r,defaultProp:o??!1,onChange:Ie(E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ra))):c.onClose(),s==null||s(E)},"onChange"),caller:Ta}),P=p.useMemo(()=>b?w.current?"delayed-open":"instant-open":"closed",[b]),R=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,C(!0)},[C]),M=p.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C(!1)},[C]),j=p.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{w.current=!0,C(!0),y.current=0},x)},[x,C]);p.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const T=h??g;return l.jsx(Wr,{...u,children:l.jsx(zD,{scope:e,contentId:T,setContentId:m,open:b,stateAttribute:P,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?j():R()},[c.isOpenDelayedRef,j,R]),onTriggerLeave:p.useCallback(()=>{v?M():(window.clearTimeout(y.current),y.current=0)},[M,v]),onOpen:R,onClose:M,disableHoverableContent:v,children:n})})},"Tooltip"),Vd="TooltipTrigger",HD=p.forwardRef(Ie(function(e,n){const{__scopeTooltip:r,...o}=e,s=eo(Vd,r),i=ol(Vd,r),a=ks(r),c=p.useRef(null),u=ie(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(Kr,{asChild:!0,...a,children:l.jsx(re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:H(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:H(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:H(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:H(e.onBlur,s.onClose),onClick:H(e.onClick,s.onClose)})})},"TooltipTrigger")),_g="TooltipPortal",[WD,KD]=rl(_g,{forceMount:void 0}),YD=Ie(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=eo(_g,e);return l.jsx(WD,{scope:e,forceMount:n,children:l.jsx(Ue,{present:n||s.open,children:l.jsx(Yr,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Or="TooltipContent",XD=p.forwardRef(Ie(function(e,n){const r=KD(Or,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,a=eo(Or,e.__scopeTooltip);return l.jsx(Ue,{present:o||a.open,children:a.disableHoverableContent?l.jsx(Og,{side:s,...i,ref:n}):l.jsx(qD,{side:s,...i,ref:n})})},"TooltipContent")),qD=p.forwardRef(Ie(function(e,n){const r=eo(Or,e.__scopeTooltip),o=ol(Or,e.__scopeTooltip),s=p.useRef(null),i=ie(n,s),[a,c]=p.useState(null),{trigger:u,onClose:d}=r,f=s.current,{onPointerInTransitChange:h}=o,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((y,v)=>{const x=y.currentTarget,w={x:y.clientX,y:y.clientY},b=Lg(w,x.getBoundingClientRect()),C=$g(w,b),P=Fg(v.getBoundingClientRect()),R=Bg([...C,...P]);c(R),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const y=Ie(x=>g(x,f),"handleTriggerLeave"),v=Ie(x=>g(x,u),"handleContentLeave");return u.addEventListener("pointerleave",y),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(a){const y=Ie(v=>{const x=v.target,w={x:v.clientX,y:v.clientY},b=(u==null?void 0:u.contains(x))||(f==null?void 0:f.contains(x)),C=!Vg(w,a);b?m():C&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,f,a,d,m]),l.jsx(Og,{...e,ref:i})},"TooltipContentHoverable")),ZD=Yh("TooltipContent"),Og=p.forwardRef(Ie(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=e,d=eo(Or,r),f=ks(r),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(Ra,h),()=>document.removeEventListener(Ra,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=Ie(y=>{y.target instanceof Node&&y.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Ee(()=>(m(i),()=>{m(void 0)}),[i,m]),l.jsx(Ur,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:l.jsxs(xs,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(ZD,{children:o}),s?l.jsx(TT,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),QD=p.forwardRef(Ie(function(e,n){const{__scopeTooltip:r,...o}=e,s=ks(r);return l.jsx(nm,{...s,...o,ref:n})},"TooltipArrow"));function Lg(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Ie(Lg,"getExitSideFromRect");function $g(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Ie($g,"getPaddedExitPoints");function Fg(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}Ie(Fg,"getPointsFromRect");function Vg(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s],c=e[i],u=a.x,d=a.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(o=!o)}return o}Ie(Vg,"isPointInPolygon");function Bg(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Gg(e)}Ie(Bg,"getHull");function Gg(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Ie(Gg,"getHullPresorted");var JD=GD,zg=UD,Ug=HD,Hg=YD,Wg=XD,eI=QD;const tI=JD,nI=S.forwardRef(function({children:e,content:n,side:r="top",align:o="center",sideOffset:s=6,delayDuration:i,open:a,disabled:c,contentClassName:u,contentStyle:d,sx:f},h){const{className:m,style:g,styleTag:y}=se(f,d,"cny-tooltip-content",u);return c?l.jsx(l.Fragment,{children:e}):l.jsxs(zg,{delayDuration:i,open:a,children:[l.jsx(Ug,{asChild:!0,children:e}),l.jsx(Hg,{children:l.jsxs(Wg,{ref:h,side:r,align:o,sideOffset:s,className:m,style:g,children:[y,n,l.jsx(eI,{className:"cny-tooltip-arrow",width:10,height:5})]})})]})}),rI=zg,oI=Ug,sI=S.forwardRef(function({className:e,...n},r){return l.jsx(Hg,{children:l.jsx(Wg,{ref:r,className:U("cny-tooltip-content",e),...n})})}),iI=Dc,aI=Ic,cI=xM,lI=bM,uI=S.forwardRef(function({className:e,style:n,sx:r,withArrow:o=!1,sideOffset:s=8,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(r,n,"cny-popover-content",e);return l.jsx(kc,{children:l.jsxs(Nc,{ref:c,sideOffset:s,className:u,style:d,...a,children:[f,i,o&&l.jsx(wM,{className:"cny-popover-arrow",width:12,height:6})]})})}),dI=S.forwardRef(function({color:e="default",variant:n="soft",size:r="md",icon:o,avatar:s,onDelete:i,deleteLabel:a="Remove",onClick:c,disabled:u,className:d,style:f,sx:h,children:m,...g},y){const v=!u&&c!=null,{className:x,style:w,styleTag:b}=se(h,f,"cny-chip",e,n,r==="sm"&&"sm",v&&"is-interactive",u&&"is-disabled",d);return l.jsxs("span",{ref:y,role:v?"button":void 0,tabIndex:v?0:void 0,"aria-disabled":u||void 0,onClick:u?void 0:c,onKeyDown:v?C=>{C.target===C.currentTarget&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),c==null||c(C))}:void 0,className:x,style:w,...g,children:[b,s&&l.jsx("span",{className:"cny-chip-avatar",children:s}),o&&l.jsx("span",{className:"cny-chip-icon",children:o}),l.jsx("span",{className:"cny-chip-label",children:m}),i&&!u&&l.jsx("button",{type:"button",className:"cny-chip-delete","aria-label":a,onClick:C=>{C.stopPropagation(),i(C)},children:l.jsx(Wt,{size:r==="sm"?11:13,"aria-hidden":"true"})})]})}),fI=S.forwardRef(function({count:e,dot:n=!1,max:r=99,showZero:o=!1,color:s="danger",placement:i="top-right",standalone:a=!1,children:c,className:u,style:d,sx:f,...h},m){const g=typeof e=="number",y=g&&e>r?`${r}+`:e,x=!n&&(!g||e===0&&!o)?null:l.jsx("span",{className:U("cny-badge-indicator",`cny-badge-${s}`,n&&"cny-badge-dot",!a&&`cny-badge-${i}`),children:n?null:y});if(a){const{className:P,style:R,styleTag:M}=se(f,d,"cny-badge-standalone",u);return l.jsxs("span",{ref:m,className:P,style:R,...h,children:[M,x]})}const{className:w,style:b,styleTag:C}=se(f,d,"cny-badge-anchor",u);return l.jsxs("span",{ref:m,className:w,style:b,...h,children:[C,c,x]})}),hI=S.forwardRef(function({position:e="right",orientation:n="vertical",size:r="md",className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=se(i,s,"cny-timeline",n==="horizontal"?"cny-timeline-horizontal":`cny-timeline-${e}`,r!=="md"&&`cny-timeline-${r}`,o);return l.jsxs("ol",{ref:u,className:d,style:f,...c,children:[h,a]})}),pI=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,className:U("cny-timeline-item",e),...n})}),mI=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:U("cny-timeline-separator",e),...n})}),gI=S.forwardRef(function({color:e="neutral",variant:n="filled",icon:r,active:o=!1,className:s,children:i,...a},c){const u=r??i;return l.jsx("span",{ref:c,className:U("cny-timeline-dot",`cny-timeline-dot-${e}`,`cny-timeline-dot-${n}`,u!=null&&u!==!1&&"cny-timeline-dot-icon",o&&"cny-timeline-dot-active",s),...a,children:u})}),yI=S.forwardRef(function({color:e,lineStyle:n="solid",className:r,...o},s){return l.jsx("span",{ref:s,className:U("cny-timeline-connector",e&&`cny-timeline-connector-${e}`,n!=="solid"&&`cny-timeline-connector-${n}`,r),"aria-hidden":"true",...o})}),vI=S.forwardRef(function({variant:e="plain",accentColor:n,className:r,...o},s){const i=e==="card"||e==="elevated";return l.jsx("div",{ref:s,className:U("cny-timeline-content",i&&"cny-timeline-content-card",e==="elevated"&&"cny-timeline-content-elevated",n&&"cny-timeline-content-accent",n&&`cny-timeline-content-accent-${n}`,r),...o})}),xI=S.forwardRef(function({className:e,...n},r){return l.jsx("div",{ref:r,className:U("cny-timeline-opposite-content",e),...n})}),Kg=S.createContext(null);function bI(){const t=S.useContext(Kg);if(!t)throw new Error("TreeItem must be used within a <TreeView>.");return t}const Yg=S.forwardRef(function({expandedIds:e,defaultExpandedIds:n,onExpandedChange:r,selectedId:o,defaultSelectedId:s=null,onSelectedChange:i,onItemExpandToggle:a,defaultIcons:c=!0,className:u,style:d,sx:f,children:h,...m},g){const[y,v]=S.useState(n??[]),[x,w]=S.useState(s),[b,C]=S.useState(null),P=e??y,R=o!==void 0?o:x,M=S.useMemo(()=>new Set(P),[P]),j=S.useCallback(I=>M.has(I),[M]),T=S.useCallback(I=>{const L=!M.has(I),O=L?[...P,I]:P.filter(D=>D!==I);e===void 0&&v(O),r==null||r(O),a==null||a(I,L)},[P,M,e,r,a]),E=S.useCallback(I=>{o===void 0&&w(I),i==null||i(I)},[o,i]),k=S.useMemo(()=>({isExpanded:j,toggle:T,selectedId:R,select:E,activeId:b,setActive:C,defaultIcons:c}),[j,T,R,E,b,c]),_=S.useRef(null),$=S.useCallback(I=>{_.current=I,typeof g=="function"?g(I):g&&(g.current=I)},[g]);S.useEffect(()=>{var O;if(b!==null)return;const I=(O=_.current)==null?void 0:O.querySelector('[role="treeitem"]'),L=I==null?void 0:I.dataset.treeId;L&&C(L)},[b]);const{className:G,style:Q,styleTag:V}=se(f,d,"cny-tree",u);return l.jsx(Kg.Provider,{value:k,children:l.jsxs("ul",{ref:$,role:"tree",className:G,style:Q,...m,children:[V,h]})})});function wI(t){return t?Array.from(t.querySelectorAll('[role="treeitem"]')):[]}const Xg=S.forwardRef(function({itemId:e,label:n,icon:r,children:o,className:s,...i},a){const{isExpanded:c,toggle:u,selectedId:d,select:f,activeId:h,setActive:m,defaultIcons:g}=bI(),y=!!o,v=y&&c(e),x=d===e,w=h===e,b=r??(g?y?v?l.jsx(zS,{size:16}):l.jsx(HS,{size:16}):l.jsx(BS,{size:16}):null),C=()=>{m(e),f(e),y&&u(e)},P=M=>{M.preventDefault(),M.stopPropagation(),m(e),u(e)},R=M=>{var T;const j=M.currentTarget.closest('[role="tree"]');switch(M.key){case"ArrowRight":if(M.preventDefault(),y&&!v)u(e);else if(v){const E=M.currentTarget.querySelector('[role="treeitem"]');E==null||E.focus()}break;case"ArrowLeft":if(M.preventDefault(),y&&v)u(e);else{const E=(T=M.currentTarget.parentElement)==null?void 0:T.closest('[role="treeitem"]');E==null||E.focus()}break;case"ArrowDown":case"ArrowUp":{M.preventDefault();const E=wI(j),k=E.indexOf(M.currentTarget),_=E[k+(M.key==="ArrowDown"?1:-1)];_==null||_.focus();break}case"Enter":case" ":M.preventDefault(),f(e),y&&u(e);break}};return l.jsxs("li",{ref:a,role:"treeitem","data-tree-id":e,"aria-expanded":y?v:void 0,"aria-selected":x,tabIndex:w?0:-1,className:U("cny-tree-item",s),onKeyDown:R,onFocus:M=>{M.target===M.currentTarget&&m(e)},...i,children:[l.jsxs("div",{className:U("cny-tree-row",x&&"is-selected"),onClick:C,children:[y?l.jsx("button",{type:"button",tabIndex:-1,className:U("cny-tree-toggle",v&&"is-open"),"aria-label":`Toggle ${typeof n=="string"?n:e}`,onClick:P,children:l.jsx(Jt,{size:16,"aria-hidden":"true"})}):l.jsx("span",{className:"cny-tree-toggle-spacer","aria-hidden":"true"}),b!=null&&l.jsx("span",{className:"cny-tree-icon",children:b}),l.jsx("span",{className:"cny-tree-label",children:n})]}),v&&l.jsx("ul",{role:"group",className:"cny-tree-group",children:o})]})}),CI=S.forwardRef(function({items:e,getItemId:n=c=>String(c.id),getItemLabel:r=c=>c.label,getItemChildren:o=c=>c.children,getItemIcon:s,...i},a){const c=u=>u.map(d=>{const f=n(d),h=o(d);return l.jsx(Xg,{itemId:f,label:r(d),icon:s==null?void 0:s(d),children:h&&h.length>0?c(h):null},f)});return l.jsx(Yg,{ref:a,...i,children:c(e)})});function SI(t){if(!t)return[];if(typeof t=="string")return t.split(",").map(n=>n.trim()).filter(Boolean);if(Array.isArray(t))return t.map(n=>n.trim()).filter(Boolean);const e=[];for(const[n,r]of Object.entries(t)){e.push(n);for(const o of r)e.push(o)}return e}function PI(t,e){if(e.length===0)return!0;const n=t.name.toLowerCase(),r=(t.type||"").toLowerCase();return e.some(o=>{const s=o.toLowerCase();return s==="*"||s==="*/*"?!0:s.startsWith(".")?n.endsWith(s):s.endsWith("/*")?r.startsWith(s.slice(0,-1)):r===s})}function qg(t={}){const{accept:e,maxSize:n,minSize:r,multiple:o=!1,maxFiles:s,disabled:i=!1,onDrop:a,onDropAccepted:c,onDropRejected:u}=t,[d,f]=S.useState(!1),h=S.useRef(null),m=S.useRef(0),g=S.useMemo(()=>SI(e),[e]),y=g.join(",")||void 0,v=S.useCallback(P=>{const R=[];return PI(P,g)||R.push({code:"file-invalid-type",message:"File type is not allowed."}),typeof n=="number"&&P.size>n&&R.push({code:"file-too-large",message:`File is larger than ${n} bytes.`}),typeof r=="number"&&P.size<r&&R.push({code:"file-too-small",message:`File is smaller than ${r} bytes.`}),R},[g,n,r]),x=S.useCallback(P=>{if(i||P.length===0)return;const R=[],M=[];if(!o&&P.length>1||typeof s=="number"&&P.length>s)for(const T of P)M.push({file:T,errors:[{code:"too-many-files",message:"Too many files."}]});else for(const T of P){const E=v(T);E.length?M.push({file:T,errors:E}):R.push(T)}a==null||a(R,M),R.length&&(c==null||c(R)),M.length&&(u==null||u(M))},[i,o,s,v,a,c,u]),w=S.useCallback(()=>{var P;i||(P=h.current)==null||P.click()},[i]),b=S.useCallback((P={})=>{const{onClick:R,onKeyDown:M,onDragOver:j,onDragEnter:T,onDragLeave:E,onDrop:k,..._}=P;return{..._,role:"button",tabIndex:i?-1:0,"aria-disabled":i||void 0,onClick:$=>{R==null||R($),i||w()},onKeyDown:$=>{M==null||M($),($.key==="Enter"||$.key===" ")&&($.preventDefault(),w())},onDragOver:$=>{j==null||j($),$.preventDefault(),i||f(!0)},onDragEnter:$=>{T==null||T($),$.preventDefault(),!i&&(m.current+=1,f(!0))},onDragLeave:$=>{E==null||E($),m.current=Math.max(0,m.current-1),m.current===0&&f(!1)},onDrop:$=>{var G;k==null||k($),$.preventDefault(),m.current=0,f(!1),!i&&x(Array.from(((G=$.dataTransfer)==null?void 0:G.files)??[]))}}},[i,w,x]),C=S.useCallback((P={})=>{const{onChange:R,...M}=P;return{...M,ref:h,type:"file",accept:y,multiple:o,style:{display:"none"},onChange:j=>{R==null||R(j),x(Array.from(j.target.files??[])),j.target.value=""}}},[y,o,x]);return{getRootProps:b,getInputProps:C,open:w,isDragActive:d,inputRef:h}}const RI=S.forwardRef(function({onDrop:e,label:n="Drop files here or click to upload",hint:r,icon:o,children:s,buttonLabel:i="Browse files",size:a="md",accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,className:g,style:y,sx:v},x){const{getRootProps:w,getInputProps:b,isDragActive:C,open:P}=qg({accept:c,maxSize:u,minSize:d,multiple:f,maxFiles:h,disabled:m,onDrop:e}),{className:R,style:M,styleTag:j}=se(v,y,"cny-uploader",`cny-uploader-${a}`,C&&"is-dragging",m&&"is-disabled",g);return l.jsxs("div",{...w(),ref:x,"aria-label":typeof n=="string"?n:"Upload files",className:R,style:M,children:[j,l.jsx("input",{...b()}),s??l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"cny-uploader-icon","aria-hidden":"true",children:o??l.jsx(kS,{})}),l.jsxs("span",{className:"cny-uploader-text",children:[l.jsx("span",{className:"cny-uploader-label",children:n}),r!=null&&l.jsx("span",{className:"cny-uploader-hint",children:r})]}),i!==!1&&l.jsx(jr,{type:"button",variant:"outline",size:a==="sm"?"sm":"md",disabled:m,tabIndex:-1,onClick:T=>{T.stopPropagation(),P()},children:i})]})]})}),TI=5;function Bd(t){if(t.length===0)return[];const n=t.reduce((a,c)=>a+(c.def??0),0),r=t.filter(a=>a.def==null).length,o=r?Math.max(0,100-n)/r:0,s=t.map(a=>a.def==null?o:a.def),i=s.reduce((a,c)=>a+c,0)||1;return s.map(a=>a/i*100)}function Gd(t,e,n,r){if(e<0||e+1>=t.length)return t;const o=t[e]+t[e+1];let s=Math.max(r[e].min,Math.min(r[e].max,t[e]+n));const i=Math.max(r[e+1].min,Math.min(r[e+1].max,o-s));s=Math.max(r[e].min,Math.min(r[e].max,o-i));const a=[...t];return a[e]=s,a[e+1]=i,a}const Ma=S.forwardRef(function({defaultSize:e,minSize:n,maxSize:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=se(i,s,"cny-panel",o);return l.jsxs("div",{ref:u,className:d,style:f,...c,children:[h,a]})}),Zg=S.forwardRef(function({disabled:e,className:n,__internal:r,...o},s){const i=(r==null?void 0:r.direction)!=="vertical",a=c=>{if(!r||e)return;const u=i?"ArrowRight":"ArrowDown",d=i?"ArrowLeft":"ArrowUp";c.key===u?(c.preventDefault(),r.onKeyResize(1)):c.key===d&&(c.preventDefault(),r.onKeyResize(-1))};return l.jsx("div",{ref:s,role:"separator",tabIndex:e?-1:0,"aria-orientation":i?"vertical":"horizontal","aria-valuenow":r==null?void 0:r.valueNow,"aria-valuemin":r==null?void 0:r.valueMin,"aria-valuemax":r==null?void 0:r.valueMax,"aria-disabled":e||void 0,className:U("cny-panel-handle",i?"cny-panel-handle-h":"cny-panel-handle-v",n),onPointerDown:c=>{e||(c.preventDefault(),r==null||r.onResizeStart(c))},onKeyDown:a,...o})}),MI=S.forwardRef(function({direction:e="horizontal",className:n,style:r,sx:o,children:s,...i},a){const c=S.useRef(null),u=S.Children.toArray(s).filter(S.isValidElement),d=u.filter(j=>j.type===Ma).map(j=>{const T=j.props;return{min:T.minSize??10,max:T.maxSize??90,def:T.defaultSize??null}}),[f,h]=S.useState(()=>Bd(d)),m=f.length===d.length?f:Bd(d),g=S.useRef(null),y=(j,T)=>{const E=e==="horizontal"?T.clientX:T.clientY;g.current={g:j,start:E,startSizes:m};const k=$=>{var O;const G=g.current,Q=(O=c.current)==null?void 0:O.getBoundingClientRect();if(!G||!Q)return;const V=e==="horizontal"?Q.width:Q.height;if(!V)return;const L=((e==="horizontal"?$.clientX:$.clientY)-G.start)/V*100;h(Gd(G.startSizes,G.g,L,d))},_=()=>{g.current=null,window.removeEventListener("pointermove",k),window.removeEventListener("pointerup",_)};window.addEventListener("pointermove",k),window.addEventListener("pointerup",_)},v=(j,T)=>{h(Gd(m,j,T*TI,d))},x=j=>{c.current=j,typeof a=="function"?a(j):a&&(a.current=j)};let w=-1,b=-1;const C=u.map(j=>{var T,E;if(j.type===Ma){w+=1;const k=w,_={...j.props.style,flexBasis:`${m[k]??0}%`,flexGrow:0,flexShrink:0};return S.cloneElement(j,{key:j.key??`panel-${k}`,style:_})}if(j.type===Zg){b+=1;const k=b,_={direction:e,valueNow:Math.round(m[k]??0),valueMin:((T=d[k])==null?void 0:T.min)??0,valueMax:((E=d[k])==null?void 0:E.max)??100,onResizeStart:$=>y(k,$),onKeyResize:$=>v(k,$)};return S.cloneElement(j,{key:j.key??`handle-${k}`,__internal:_})}return j}),{className:P,style:R,styleTag:M}=se(o,r,"cny-panel-group",e==="vertical"&&"is-vertical",n);return l.jsxs("div",{ref:x,className:P,style:R,...i,children:[M,C]})});function EI(){}function jI(t,e,n,r){if(e<1)return[];if(e===1)return[{type:"page",page:1}];const o=e,s=Math.max(1,t-n),i=Math.min(o,t+n),a=[],c=r&&s>1,u=r&&i<o,d=c&&s>2,f=u&&i<o-1;c&&a.push({type:"page",page:1}),d&&a.push({type:"ellipsis",key:"l"});for(let h=s;h<=i;h++)a.push({type:"page",page:h});return f&&a.push({type:"ellipsis",key:"r"}),u&&a.push({type:"page",page:o}),a.filter((h,m,g)=>h.type!=="page"?!0:g.findIndex(y=>y.type==="page"&&y.page===h.page)===m)}const Qg=S.forwardRef(function({page:e,pageCount:n,onPageChange:r,siblingCount:o=1,showEdges:s=!0,hideControls:i=!1,size:a="md",className:c,style:u,sx:d,"aria-label":f="Pagination"},h){const m=S.useMemo(()=>jI(e,n,o,s),[e,n,o,s]),g=w=>{w<1||w>n||w===e||r(w)},{className:y,style:v,styleTag:x}=se(d,u,"cny-pagination",`cny-pagination-${a}`,c);return l.jsxs("nav",{ref:h,role:"navigation","aria-label":f,className:y,style:v,children:[x,!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>g(e-1),disabled:e<=1,"aria-label":"Previous page",children:l.jsx(Vo,{size:14,"aria-hidden":"true"})}),m.map(w=>w.type==="ellipsis"?l.jsx("span",{className:"cny-pagination-ellipsis","aria-hidden":"true",children:l.jsx(_S,{size:14})},`e-${w.key}`):l.jsx("button",{type:"button",className:U("cny-pagination-btn",w.page===e&&"is-active"),"aria-current":w.page===e?"page":void 0,onClick:()=>g(w.page),children:w.page},w.page)),!i&&l.jsx("button",{type:"button",className:"cny-pagination-btn cny-pagination-control",onClick:()=>g(e+1),disabled:e>=n,"aria-label":"Next page",children:l.jsx(Jt,{size:14,"aria-hidden":"true"})})]})}),Mi={left:"cny-dt-left",center:"cny-dt-center",right:"cny-dt-right"};function AI(t){return t.id}function DI(t,e){return!t||t.field!==e?{field:e,sort:"asc"}:t.sort==="asc"?{field:e,sort:"desc"}:null}const II=S.forwardRef(function({columns:e,rows:n,getRowId:r=AI,loading:o=!1,rowCount:s,paginationModel:i,onPaginationModelChange:a,checkboxSelection:c=!1,rowSelectionModel:u,onRowSelectionModelChange:d,sortModel:f,onSortModelChange:h,onRowClick:m,noRowsLabel:g="No rows",disableColumnResize:y=!1,density:v="standard",checkboxColumnWidth:x=44,stickyHeader:w=!1,tableLayout:b="auto",getRowClassName:C,className:P,style:R,sx:M},j){const T=e.length+(c?1:0),E=S.useRef(null),[k,_]=S.useState(null),$=(F,q)=>{var gn;q.preventDefault(),q.stopPropagation();const he={};(gn=E.current)==null||gn.querySelectorAll("thead th[data-field]").forEach(pe=>{const we=pe.dataset.field;we&&(he[we]=pe.getBoundingClientRect().width)});const ue=q.clientX,He=he[F]??0;_(he);const ve=pe=>{_({...he,[F]:Math.max(60,He+(pe.clientX-ue))})},qe=()=>{window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",qe)};window.addEventListener("pointermove",ve),window.addEventListener("pointerup",qe)},G=F=>!y&&F.resizable!==!1,Q=u??[],V=new Set(Q),I=n.map(F=>r(F)),L=I.length>0&&I.every(F=>V.has(F)),O=I.some(F=>V.has(F)),D=L?!0:O?"indeterminate":!1,X=()=>{if(d)if(L)d(Q.filter(F=>!I.includes(F)));else{const F=new Set(Q);I.forEach(q=>F.add(q)),d([...F])}},A=F=>{d&&(V.has(F)?d(Q.filter(q=>q!==F)):d([...Q,F]))},B=F=>{!F.sortable||!h||h(DI(f,F.field))},ee=b==="fixed",K=e.reduce((F,q)=>q.width!=null?F:F+(q.flex??1),0),W=(c?x:0)+e.reduce((F,q)=>typeof q.width=="number"?F+q.width:F,0),oe=F=>{if(F.width!=null)return F.width;if(K<=0)return;const q=(F.flex??1)/K;return W>0?`calc((100% - ${W}px) * ${q.toFixed(6)})`:`${(q*100).toFixed(4)}%`},Y=F=>F.width!=null?{width:F.width,minWidth:F.width}:{flex:F.flex??1},z=()=>{if(!i||s==null)return null;const{page:F,pageSize:q}=i,he=Math.max(1,Math.ceil(s/q)),ue=s===0?0:F*q+1,He=Math.min(s,(F+1)*q);return l.jsxs("div",{className:"cny-dt-footer",children:[l.jsxs("span",{className:"cny-dt-count",children:[ue,"–",He," of ",s]}),l.jsx(Qg,{page:F+1,pageCount:he,size:"sm",onPageChange:ve=>a==null?void 0:a({page:ve-1,pageSize:q})})]})},{className:Z,style:le,styleTag:ce}=se(M,R,"cny-dt",v==="compact"&&"cny-dt-compact",w&&"cny-dt-sticky",P);return l.jsxs("div",{ref:j,className:Z,style:le,children:[ce,l.jsx("div",{className:"cny-dt-scroll",children:l.jsxs("table",{ref:E,className:"cny-dt-table",style:k?{tableLayout:"fixed",width:"max-content",minWidth:"100%"}:ee?{tableLayout:"fixed",width:"100%"}:void 0,children:[(k||ee)&&l.jsxs("colgroup",{children:[c&&l.jsx("col",{style:{width:x}}),e.map(F=>l.jsx("col",{style:{width:k?k[F.field]:oe(F)}},F.field))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[c&&l.jsx("th",{className:"cny-dt-checkbox-cell",scope:"col",children:l.jsx(Ca,{checked:D,onCheckedChange:X,"aria-label":"Select all rows"})}),e.map(F=>{const q=(f==null?void 0:f.field)===F.field,he=F.headerAlign??F.align;return l.jsxs("th",{scope:"col","data-field":F.field,style:k?void 0:Y(F),"aria-sort":q?f.sort==="asc"?"ascending":"descending":void 0,className:U(he&&Mi[he],F.sortable&&"cny-dt-sortable",q&&"is-sorted"),children:[F.sortable?l.jsx("button",{type:"button",className:"cny-dt-sortbtn",onClick:()=>B(F),children:l.jsxs("span",{className:"cny-dt-th-inner",children:[F.headerName??F.field,l.jsx("span",{className:"cny-dt-sort-icon","aria-hidden":"true",children:q?f.sort==="desc"?l.jsx(zr,{size:14}):l.jsx(bp,{size:14}):l.jsx(wp,{size:14})})]})}):l.jsx("span",{className:"cny-dt-th-inner",children:F.headerName??F.field}),G(F)&&l.jsx("span",{className:"cny-dt-resizer","aria-hidden":"true",onClick:ue=>ue.stopPropagation(),onPointerDown:ue=>$(F.field,ue)})]},F.field)})]})}),l.jsx("tbody",{children:o?Array.from({length:(i==null?void 0:i.pageSize)??Math.max(n.length,5)}).map((F,q)=>l.jsxs("tr",{className:"cny-dt-row",children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",children:l.jsx(ia,{shape:"avatar",width:16,height:16})}),e.map(he=>l.jsx("td",{className:he.align&&Mi[he.align],children:l.jsx(ia,{width:"70%"})},he.field))]},`sk-${q}`)):n.length===0?l.jsx("tr",{children:l.jsx("td",{className:"cny-dt-empty",colSpan:T,children:g})}):n.map(F=>{const q=r(F),he=V.has(q);return l.jsxs("tr",{className:U("cny-dt-row",he&&"is-selected",m&&"is-clickable",C==null?void 0:C(F)),onClick:()=>m==null?void 0:m(F),tabIndex:m?0:void 0,onKeyDown:m?ue=>{ue.target===ue.currentTarget&&(ue.key==="Enter"||ue.key===" ")&&(ue.preventDefault(),m(F))}:void 0,children:[c&&l.jsx("td",{className:"cny-dt-checkbox-cell",onClick:ue=>ue.stopPropagation(),children:l.jsx(Ca,{checked:he,onCheckedChange:()=>A(q),"aria-label":`Select row ${String(q)}`})}),e.map(ue=>{const He=ue.valueGetter?ue.valueGetter({row:F,field:ue.field}):F[ue.field];return l.jsx("td",{className:ue.align&&Mi[ue.align],children:ue.renderCell?ue.renderCell({row:F,value:He,field:ue.field}):He},ue.field)})]},String(q))})})]})}),z()]})}),Ea=["var(--color-primary)","var(--color-success)","var(--color-warning)","var(--color-danger)","var(--color-info)","var(--color-neutral)"];function Tn(t,e){return e??Ea[t%Ea.length]}function sl(t=600){const e=S.useRef(null),[n,r]=S.useState(t);return S.useLayoutEffect(()=>{const o=e.current;if(!o||typeof ResizeObserver>"u")return;const s=new ResizeObserver(i=>{var c;const a=Math.round(((c=i[0])==null?void 0:c.contentRect.width)??0);a>0&&r(u=>u===a?u:a)});return s.observe(o),()=>s.disconnect()},[]),[e,n]}function Jg(t,e=4){if(t<=0)return{max:1,ticks:[0,1]};const n=t/e,r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r,s=(o<=1?1:o<=2?2:o<=5?5:10)*r,i=Math.ceil(t/s)*s,a=[];for(let c=0;c<=i+1e-9;c+=s)a.push(Number(c.toFixed(6)));return{max:i,ticks:a}}function kI(t,e,n,r,o,s){const i=(v,x)=>[t+v*Math.sin(x),e-v*Math.cos(x)],a=s-o>Math.PI?1:0,[c,u]=i(n,o),[d,f]=i(n,s);if(r<=0)return`M ${t} ${e} L ${c} ${u} A ${n} ${n} 0 ${a} 1 ${d} ${f} Z`;const[h,m]=i(r,s),[g,y]=i(r,o);return[`M ${c} ${u}`,`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,`L ${h} ${m}`,`A ${r} ${r} 0 ${a} 0 ${g} ${y}`,"Z"].join(" ")}function il({caption:t,head:e,rows:n}){return l.jsxs("table",{className:"cny-sr-only",children:[l.jsx("caption",{children:t}),l.jsx("thead",{children:l.jsx("tr",{children:e.map((r,o)=>l.jsx("th",{scope:"col",children:r},o))})}),l.jsx("tbody",{children:n.map((r,o)=>l.jsx("tr",{children:r.map((s,i)=>l.jsx("td",{children:s},i))},o))})]})}const Oe={top:12,right:14,bottom:28,left:40};function NI({data:t,xKey:e,series:n,height:r=260,label:o="Bar chart",stacked:s=!1,grid:i=!0,legend:a=!0,yTickFormatter:c=g=>String(g),xTickFormatter:u=g=>g,renderTooltip:d,className:f,style:h,sx:m}){const[g,y]=sl(),[v,x]=S.useState(null),w=Math.max(0,y-Oe.left-Oe.right),b=Math.max(0,r-Oe.top-Oe.bottom),C=(I,L)=>Number(I[L]??0),P=t.length?Math.max(0,...t.map(I=>s?n.reduce((L,O)=>L+C(I,O.key),0):Math.max(...n.map(L=>C(I,L.key))))):0,{max:R,ticks:M}=Jg(P),j=I=>Oe.top+b*(1-I/R),T=t.length,E=T?w/T:0,k=E*.68,_=I=>Oe.left+I*E+(E-k)/2,$=s?k:k/Math.max(1,n.length),{className:G,style:Q,styleTag:V}=se(m,{position:"relative",...h},"cny-chart",f);return l.jsxs("div",{ref:g,className:G,style:Q,children:[V,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${y} ${r}`,role:"img","aria-label":o,children:[i&&M.map(I=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:Oe.left,x2:y-Oe.right,y1:j(I),y2:j(I)}),l.jsx("text",{className:"cny-chart-axis",x:Oe.left-6,y:j(I),dy:"0.32em",textAnchor:"end",children:c(I)})]},I)),t.map((I,L)=>{let O=0;return l.jsx("g",{children:n.map((D,X)=>{const A=C(I,D.key),B=A/R*b;let ee,K;return s?(ee=_(L),K=j(O+A),O+=A):(ee=_(L)+X*$,K=j(A)),l.jsx("rect",{className:"cny-chart-bar",x:ee,y:K,width:Math.max(0,$-(s?0:2)),height:Math.max(0,B),rx:2,fill:Tn(X,D.color)},D.key)})},L)}),t.map((I,L)=>{const O=u(String(I[e]??"")),D=`${O}: ${n.map(X=>`${X.label??X.key} ${C(I,X.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:Oe.left+L*E+E/2,y:r-Oe.bottom+16,textAnchor:"middle",children:O}),l.jsx("rect",{className:"cny-chart-hit",x:Oe.left+L*E,y:Oe.top,width:E,height:b,fill:"transparent",tabIndex:0,"aria-label":D,onMouseEnter:()=>x({index:L,x:Oe.left+L*E+E/2,y:Oe.top}),onMouseLeave:()=>x(null),onFocus:()=>x({index:L,x:Oe.left+L*E+E/2,y:Oe.top}),onBlur:()=>x(null)})]},`x-${L}`)})]}),l.jsx(il,{caption:o,head:[String(e),...n.map(I=>I.label??I.key)],rows:t.map(I=>[u(String(I[e]??"")),...n.map(L=>C(I,L.key))])}),v&&t[v.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${v.x/y*100}%`,top:v.y},children:d?d({label:String(t[v.index][e]),datum:t[v.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[v.index][e])}),n.map((I,L)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(L,I.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:I.label??I.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:C(t[v.index],I.key)})]},I.key))]})}),a&&l.jsx("div",{className:"cny-chart-legend",children:n.map((I,L)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(L,I.color)}}),I.label??I.key]},I.key))})]})}const st={top:12,right:14,bottom:28,left:40};function ey({data:t,xKey:e,series:n,height:r=260,label:o="Line chart",area:s=!1,stacked:i=!1,dots:a=!0,grid:c=!0,legend:u=!0,yTickFormatter:d=v=>String(v),xTickFormatter:f=v=>v,renderTooltip:h,className:m,style:g,sx:y}){const[v,x]=sl(),[w,b]=S.useState(null),C=Math.max(0,x-st.left-st.right),P=Math.max(0,r-st.top-st.bottom),R=(O,D)=>Number(O[D]??0),M=t.length?Math.max(0,...t.map(O=>i?n.reduce((D,X)=>D+R(O,X.key),0):Math.max(...n.map(D=>R(O,D.key))))):0,{max:j,ticks:T}=Jg(M),E=O=>st.top+P*(1-O/j),k=t.length,_=k?C/k:0,$=O=>st.left+O*_+_/2,G=E(0),Q=t.map(()=>0),{className:V,style:I,styleTag:L}=se(y,{position:"relative",...g},"cny-chart",m);return l.jsxs("div",{ref:v,className:V,style:I,children:[L,l.jsxs("svg",{width:"100%",height:r,viewBox:`0 0 ${x} ${r}`,role:"img","aria-label":o,children:[c&&T.map(O=>l.jsxs("g",{children:[l.jsx("line",{className:"cny-chart-grid",x1:st.left,x2:x-st.right,y1:E(O),y2:E(O)}),l.jsx("text",{className:"cny-chart-axis",x:st.left-6,y:E(O),dy:"0.32em",textAnchor:"end",children:d(O)})]},O)),n.map((O,D)=>{const X=Tn(D,O.color),A=t.map((K,W)=>{const oe=R(K,O.key),Y=i?Q[W]:0,z=Y+oe;return i&&(Q[W]=z),{x:$(W),y:E(z),yBase:E(Y)}});if(A.length===0)return null;const B=A.map(K=>`${K.x},${K.y}`).join(" "),ee=`M ${A[0].x} ${i?A[0].yBase:G} `+A.map(K=>`L ${K.x} ${K.y}`).join(" ")+` L ${A[A.length-1].x} ${i?A[A.length-1].yBase:G} Z`;return l.jsxs("g",{children:[s&&l.jsx("path",{className:"cny-chart-area",d:ee,fill:X}),l.jsx("polyline",{className:"cny-chart-line",points:B,fill:"none",stroke:X}),a&&A.map((K,W)=>l.jsx("circle",{className:"cny-chart-dot",cx:K.x,cy:K.y,r:3,fill:X},W))]},O.key)}),t.map((O,D)=>{const X=f(String(O[e]??"")),A=`${X}: ${n.map(B=>`${B.label??B.key} ${R(O,B.key)}`).join(", ")}`;return l.jsxs("g",{children:[l.jsx("text",{className:"cny-chart-axis",x:$(D),y:r-st.bottom+16,textAnchor:"middle",children:X}),l.jsx("rect",{className:"cny-chart-hit",x:st.left+D*_,y:st.top,width:_,height:P,fill:"transparent",tabIndex:0,"aria-label":A,onMouseEnter:()=>b({index:D,x:$(D)}),onMouseLeave:()=>b(null),onFocus:()=>b({index:D,x:$(D)}),onBlur:()=>b(null)})]},`x-${D}`)})]}),l.jsx(il,{caption:o,head:[String(e),...n.map(O=>O.label??O.key)],rows:t.map(O=>[f(String(O[e]??"")),...n.map(D=>R(O,D.key))])}),w&&t[w.index]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:`${w.x/x*100}%`,top:st.top},children:h?h({label:String(t[w.index][e]),datum:t[w.index]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"cny-chart-tooltip-title",children:String(t[w.index][e])}),n.map((O,D)=>l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(D,O.color)}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:O.label??O.key}),l.jsx("span",{className:"cny-chart-tooltip-value",children:R(t[w.index],O.key)})]},O.key))]})}),u&&l.jsx("div",{className:"cny-chart-legend",children:n.map((O,D)=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:Tn(D,O.color)}}),O.label??O.key]},O.key))})]})}function _I(t){return l.jsx(ey,{...t,area:!1})}function OI(t){return l.jsx(ey,{...t,area:!0})}function LI({data:t,height:e=260,label:n="Pie chart",innerRadius:r=0,legend:o=!0,renderTooltip:s,centerLabel:i,className:a,style:c,sx:u}){const[d,f]=sl(360),[h,m]=S.useState(null),g=t.reduce((T,E)=>T+Math.max(0,E.value),0),y=Math.min(f,e),v=f/2,x=e/2,w=y/2*.86,b=r>0?w*r:0;let C=0;const P=t.map((T,E)=>{const k=g>0?Math.max(0,T.value)/g:0,_=C,$=C+k*Math.PI*2;return C=$,{d:T,i:E,start:_,end:$,frac:k,color:Tn(E,T.color)}}),{className:R,style:M,styleTag:j}=se(u,{position:"relative",...c},"cny-chart",a);return l.jsxs("div",{ref:d,className:R,style:M,children:[j,l.jsxs("svg",{width:"100%",height:e,viewBox:`0 0 ${f} ${e}`,role:"img","aria-label":n,children:[P.map(T=>T.frac>=.9999?l.jsx("circle",{className:U("cny-chart-slice",h===T.i&&"is-active"),cx:v,cy:x,r:b>0?(w+b)/2:w,fill:b>0?"none":T.color,stroke:b>0?T.color:void 0,strokeWidth:b>0?w-b:void 0,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i):l.jsx("path",{className:U("cny-chart-slice",h===T.i&&"is-active"),d:kI(v,x,w,b,T.start,T.end),fill:T.color,tabIndex:0,"aria-label":`${T.d.label}: ${T.d.value} (${Math.round(T.frac*100)}%)`,onMouseEnter:()=>m(T.i),onMouseLeave:()=>m(null),onFocus:()=>m(T.i),onBlur:()=>m(null)},T.i)),i!=null&&b>0&&l.jsx("foreignObject",{x:v-b,y:x-b,width:b*2,height:b*2,children:l.jsx("div",{className:"cny-chart-center",children:i})})]}),l.jsx(il,{caption:n,head:["Slice","Value","Share"],rows:P.map(T=>[T.d.label,T.d.value,`${Math.round(T.frac*100)}%`])}),h!=null&&P[h]&&l.jsx("div",{className:"cny-chart-tooltip",style:{left:"50%",top:8,transform:"translateX(-50%)"},children:s?s({datum:P[h].d,percent:P[h].frac}):l.jsxs("div",{className:"cny-chart-tooltip-row",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:P[h].color}}),l.jsx("span",{className:"cny-chart-tooltip-label",children:P[h].d.label}),l.jsxs("span",{className:"cny-chart-tooltip-value",children:[P[h].d.value," (",Math.round(P[h].frac*100),"%)"]})]})}),o&&l.jsx("div",{className:"cny-chart-legend",children:P.map(T=>l.jsxs("span",{className:"cny-chart-legend-item",children:[l.jsx("span",{className:"cny-chart-swatch",style:{background:T.color}}),T.d.label]},T.i))})]})}function $I({height:t=300,children:e,className:n,style:r,sx:o}){const s=S.Children.only(e),{className:i,style:a,styleTag:c}=se(o,{width:"100%",height:t,...r},"cny-chart-responsive",n);return l.jsxs("div",{className:i,style:a,children:[c,S.isValidElement(s)?S.cloneElement(s,{height:t}):s]})}const FI=S.forwardRef(function({variant:e="dividers",size:n="md",dense:r,className:o,style:s,sx:i,children:a,...c},u){const{className:d,style:f,styleTag:h}=se(i,s,"cny-list",e,`size-${n}`,r&&"is-dense",o);return l.jsxs("ul",{ref:u,className:d,style:f,...c,children:[h,a]})}),VI=S.forwardRef(function({leading:e,trailing:n,primary:r,secondary:o,onClick:s,href:i,disabled:a,active:c,as:u,children:d,className:f,...h},m){const g=u??(i?"a":s?"button":"li"),y=!a&&(i!=null||s!=null),v=d??l.jsxs(l.Fragment,{children:[e&&l.jsx("span",{className:"cny-list-item-leading",children:e}),l.jsxs("span",{className:"cny-list-item-body",children:[r!=null&&l.jsx("span",{className:"cny-list-item-primary",children:r}),o!=null&&l.jsx("span",{className:"cny-list-item-secondary",children:o})]}),n&&l.jsx("span",{className:"cny-list-item-trailing",children:n})]}),x=l.jsx(g,{ref:m,href:i,onClick:a?void 0:s,"aria-disabled":a||void 0,"aria-current":c?"page":void 0,tabIndex:y&&g==="div"?0:void 0,className:U("cny-list-item",c&&"is-active",a&&"is-disabled",y&&"is-interactive",f),...h,children:v});return g==="li"?x:l.jsx("li",{className:"cny-list-item-wrap",children:x})}),BI=S.forwardRef(function({className:e,...n},r){return l.jsx("li",{ref:r,role:"separator",className:U("cny-list-separator",e),...n})}),GI=S.forwardRef(function({className:e,children:n,...r},o){return l.jsx("li",{ref:o,className:U("cny-list-subheader",e),...r,children:n})});var zI=Object.defineProperty,pr=(t,e)=>zI(t,"name",{value:e,configurable:!0}),al="Tabs",[UI,TN]=Re(al,[un]),ty=un(),[HI,cl]=UI(al),WI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,value:o,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:c,activationMode:u="automatic",...d}=e,f=Ht(c),[h,m]=Pe({prop:o,onChange:s,defaultProp:i??"",caller:al});return l.jsx(HI,{scope:r,baseId:Fe(),value:h,onValueChange:m,orientation:a,dir:f,activationMode:u,children:l.jsx(re.div,{dir:f,"data-orientation":a,...d,ref:n})})},"Tabs")),KI="TabsList",YI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,loop:o=!0,...s}=e,i=cl(KI,r),a=ty(r);return l.jsx(ds,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:o,children:l.jsx(re.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:n})})},"TabsList")),XI="TabsTrigger",qI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,value:o,disabled:s=!1,...i}=e,a=cl(XI,r),c=ty(r),u=ll(a.baseId,o),d=ul(a.baseId,o),f=o===a.value;return l.jsx(fs,{asChild:!0,...c,focusable:!s,active:f,children:l.jsx(re.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...i,ref:n,onMouseDown:H(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?a.onValueChange(o):h.preventDefault()}),onKeyDown:H(e.onKeyDown,h=>{s||h.target!==h.currentTarget||[" ","Enter"].includes(h.key)&&a.onValueChange(o)}),onFocus:H(e.onFocus,()=>{const h=a.activationMode!=="manual";!f&&!s&&h&&a.onValueChange(o)})})})},"TabsTrigger")),ZI="TabsContent",QI=p.forwardRef(pr(function(e,n){const{__scopeTabs:r,value:o,forceMount:s,children:i,...a}=e,c=cl(ZI,r),u=ll(c.baseId,o),d=ul(c.baseId,o),f=o===c.value,h=p.useRef(f);return p.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx(Ue,{present:s||f,children:({present:m})=>l.jsx(re.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...a,ref:n,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&i})})},"TabsContent"));function ll(t,e){return`${t}-trigger-${e}`}pr(ll,"makeTriggerId");function ul(t,e){return`${t}-content-${e}`}pr(ul,"makeContentId");var JI=WI,ek=YI,tk=qI,nk=QI;const rk=S.forwardRef(function({variant:e="line",size:n="md",className:r,style:o,sx:s,children:i,...a},c){const{className:u,style:d,styleTag:f}=se(s,o,"cny-tabs",`variant-${e}`,`size-${n}`,r);return l.jsxs(JI,{ref:c,className:u,style:d,...a,children:[f,i]})}),ok=S.forwardRef(function({className:e,...n},r){return l.jsx(ek,{ref:r,className:U("cny-tabs-list",e),...n})}),sk=S.forwardRef(function({icon:e,badge:n,className:r,children:o,...s},i){return l.jsxs(tk,{ref:i,className:U("cny-tabs-trigger",r),...s,children:[e&&l.jsx("span",{className:"cny-tabs-trigger-icon",children:e}),l.jsx("span",{className:"cny-tabs-trigger-label",children:o}),n&&l.jsx("span",{className:"cny-tabs-trigger-badge",children:n})]})}),ik=S.forwardRef(function({className:e,...n},r){return l.jsx(nk,{ref:r,className:U("cny-tabs-content",e),...n})});function ak(t){return t.multiple===!0}const ck=S.forwardRef(function(e,n){const{options:r,placeholder:o="Select…",searchPlaceholder:s="Search…",emptyText:i="No results.",loading:a=!1,loadingText:c="Loading…",size:u,color:d="primary",disabled:f=!1,clearable:h=!0,id:m,"aria-invalid":g,"aria-describedby":y,"aria-label":v,className:x,style:w,sx:b}=e,C=S.useId(),P=m??`cny-ac-${C}`,[R,M]=S.useState(!1),[j,T]=S.useState(""),E=S.useRef(null),k=ak(e),[_,$]=S.useState(!k&&e.defaultValue!==void 0?e.defaultValue??null:null),[G,Q]=S.useState(k&&e.defaultValue!==void 0?e.defaultValue??[]:[]),V=k?e.value!==void 0?e.value:G:(()=>{const W=e.value!==void 0?e.value:_;return W==null?[]:[W]})(),I=S.useCallback(W=>{var oe,Y;if(k)e.value===void 0&&Q(W),(oe=e.onValueChange)==null||oe.call(e,W);else{const z=W[0]??null;e.value===void 0&&$(z),(Y=e.onValueChange)==null||Y.call(e,z)}},[k,e]),L=S.useCallback(W=>{if(!W.disabled)if(k){const oe=e.maxItems,Y=V.includes(W.value);let z;if(Y)z=V.filter(Z=>Z!==W.value);else{if(oe!=null&&V.length>=oe)return;z=[...V,W.value]}I(z)}else I([W.value]),M(!1)},[I,k,V,e]),O=S.useCallback(W=>{var oe;W.stopPropagation(),I([]),(oe=E.current)==null||oe.focus()},[I]),D=S.useMemo(()=>{const W=new Map;for(const oe of r){const Y=oe.group??"";W.has(Y)||W.set(Y,[]),W.get(Y).push(oe)}return Array.from(W.entries())},[r]),X=W=>{var oe;return((oe=r.find(Y=>Y.value===W))==null?void 0:oe.label)??W},A=V.length===0?o:k?V.length===1?X(V[0]):`${X(V[0])} +${V.length-1}`:X(V[0]),{className:B,style:ee,styleTag:K}=se(b,w,"cny-ac-trigger","input",d!=="primary"&&d,u==="sm"||u==="lg"?u:null,V.length>0&&"has-value",R&&"is-open",x);return l.jsxs(Dc,{open:R,onOpenChange:M,children:[l.jsx(Ic,{asChild:!0,children:l.jsxs("button",{ref:W=>{E.current=W,typeof n=="function"?n(W):n&&(n.current=W)},type:"button",id:P,className:B,style:ee,disabled:f,"aria-label":v,"aria-invalid":g,"aria-describedby":y,"aria-haspopup":"listbox","aria-expanded":R,children:[K,l.jsx("span",{className:U("cny-ac-value",V.length===0&&"is-placeholder"),children:A}),h&&V.length>0&&!f&&l.jsx("span",{role:"button",tabIndex:0,className:"cny-ac-clear","aria-label":"Clear",onClick:O,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),O(W))},onPointerDown:W=>W.stopPropagation(),children:l.jsx(Wt,{size:13,"aria-hidden":"true"})}),l.jsx(wp,{size:14,className:"cny-ac-chevron","aria-hidden":"true"})]})}),l.jsx(kc,{children:l.jsx(Nc,{className:"cny-ac-content",align:"start",sideOffset:4,style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(De,{className:"cny-ac-cmdk",shouldFilter:!a,children:[l.jsx("div",{className:"cny-ac-search",children:l.jsx(De.Input,{value:j,onValueChange:T,placeholder:s})}),l.jsx(De.List,{className:"cny-ac-list",children:a?l.jsxs("div",{className:"cny-ac-loading",children:[l.jsx(Tp,{size:14,className:"cny-ac-loading-spinner","aria-hidden":"true"}),l.jsx("span",{children:c})]}):l.jsxs(l.Fragment,{children:[l.jsx(De.Empty,{className:"cny-ac-empty",children:i},"empty"),D.map(([W,oe],Y)=>{const z=oe.map((Z,le)=>{const ce=V.includes(Z.value);return l.jsxs(De.Item,{value:`${W} ${Z.label} ${Z.value}`,disabled:Z.disabled,onSelect:()=>L(Z),className:U("cny-ac-item",ce&&"is-checked"),children:[k?l.jsx("span",{className:U("cny-ac-checkbox",ce&&"is-checked"),children:ce&&l.jsx(rn,{size:12,"aria-hidden":"true"})}):l.jsxs("span",{className:"cny-ac-icon",children:[Z.icon??null,!Z.icon&&ce&&l.jsx(rn,{size:14,"aria-hidden":"true"})]}),l.jsx("span",{className:"cny-ac-item-label",children:Z.label}),Z.hint&&l.jsx("span",{className:"cny-ac-item-hint",children:Z.hint})]},Z.value||`opt-${Y}-${le}`)});return W===""?l.jsx(De.Group,{children:z},`__ungrouped_${Y}`):l.jsx(De.Group,{heading:W,children:z},W||`group_${Y}`)})]})})]})})})]})}),lk=S.forwardRef(function({items:e,separator:n,size:r="md",className:o,style:s,sx:i,...a},c){const u=n??l.jsx(Jt,{size:12,"aria-hidden":"true"}),{className:d,style:f,styleTag:h}=se(i,s,"cny-breadcrumb",`cny-breadcrumb-${r}`,o);return l.jsxs("nav",{ref:c,"aria-label":"Breadcrumb",className:d,style:f,...a,children:[h,l.jsx("ol",{className:"cny-breadcrumb-list",children:e.map((m,g)=>{const y=g===e.length-1,v=l.jsx("span",{className:U("cny-breadcrumb-label",y&&"is-current"),children:m.label}),x=m.render?m.render(v):m.href&&!y?l.jsx("a",{href:m.href,className:"cny-breadcrumb-link",children:v}):v;return l.jsxs("li",{className:"cny-breadcrumb-item",children:[y?l.jsx("span",{"aria-current":"page",children:v}):x,!y&&l.jsx("span",{className:"cny-breadcrumb-sep","aria-hidden":"true",children:u})]},g)})})]})});var uk=Object.defineProperty,to=(t,e)=>uk(t,"name",{value:e,configurable:!0}),dl="Collapsible",[dk,ny]=Re(dl),[fk,fl]=dk(dl),hk=p.forwardRef(to(function(e,n){const{__scopeCollapsible:r,open:o,defaultOpen:s,disabled:i,onOpenChange:a,...c}=e,[u,d]=Pe({prop:o,defaultProp:s??!1,onChange:a,caller:dl});return l.jsx(fk,{scope:r,disabled:i,contentId:Fe(),open:u,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),children:l.jsx(re.div,{"data-state":Ns(u),"data-disabled":i?"":void 0,...c,ref:n})})},"Collapsible")),pk="CollapsibleTrigger",mk=p.forwardRef(to(function(e,n){const{__scopeCollapsible:r,...o}=e,s=fl(pk,r);return l.jsx(re.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":Ns(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...o,ref:n,onClick:H(e.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),ry="CollapsibleContent",gk=p.forwardRef(to(function(e,n){const{forceMount:r,...o}=e,s=fl(ry,e.__scopeCollapsible);return l.jsx(Ue,{present:r||s.open,children:({present:i})=>l.jsx(yk,{...o,ref:n,present:i})})},"CollapsibleContent")),yk=p.forwardRef(to(function(e,n){const{__scopeCollapsible:r,present:o,children:s,...i}=e,a=fl(ry,r),[c,u]=p.useState(o),d=p.useRef(null),f=ie(n,d),h=p.useRef(0),m=h.current,g=p.useRef(0),y=g.current,v=a.open||c,x=p.useRef(v),w=p.useRef(void 0);return p.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),Ee(()=>{const b=d.current;if(b){w.current=w.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const C=b.getBoundingClientRect();h.current=C.height,g.current=C.width,x.current||(b.style.transitionDuration=w.current.transitionDuration,b.style.animationName=w.current.animationName),u(o)}},[a.open,o]),l.jsx(re.div,{"data-state":Ns(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...i,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:v&&s})},"CollapsibleContentImpl"));function Ns(t){return t?"open":"closed"}to(Ns,"getState");var vk=hk,xk=mk,bk=gk,wk=Object.defineProperty,lt=(t,e)=>wk(t,"name",{value:e,configurable:!0}),Ot="Accordion",Ck=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[hl,Sk,Pk]=cr(Ot),[_s,MN]=Re(Ot,[Pk,ny]),pl=ny(),Rk=p.forwardRef(lt(function(e,n){const{type:r,...o}=e,s=o,i=o;return l.jsx(hl.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?l.jsx(jk,{...i,ref:n}):l.jsx(Ek,{...s,ref:n})})},"Accordion")),[oy,Tk]=_s(Ot),[sy,Mk]=_s(Ot,{collapsible:!1}),Ek=p.forwardRef(lt(function(e,n){const{value:r,defaultValue:o,onValueChange:s=lt(()=>{},"onValueChange"),collapsible:i=!1,...a}=e,[c,u]=Pe({prop:r,defaultProp:o??"",onChange:s,caller:Ot});return l.jsx(oy,{scope:e.__scopeAccordion,value:p.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:p.useCallback(()=>i&&u(""),[i,u]),children:l.jsx(sy,{scope:e.__scopeAccordion,collapsible:i,children:l.jsx(iy,{...a,ref:n})})})},"AccordionImplSingle")),jk=p.forwardRef(lt(function(e,n){const{value:r,defaultValue:o,onValueChange:s=lt(()=>{},"onValueChange"),...i}=e,[a,c]=Pe({prop:r,defaultProp:o??[],onChange:s,caller:Ot}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return l.jsx(oy,{scope:e.__scopeAccordion,value:a,onItemOpen:u,onItemClose:d,children:l.jsx(sy,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(iy,{...i,ref:n})})})},"AccordionImplMultiple")),[Ak,Os]=_s(Ot),iy=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,disabled:o,dir:s,orientation:i="vertical",...a}=e,c=p.useRef(null),u=ie(c,n),d=Sk(r),h=Ht(s)==="ltr",m=H(e.onKeyDown,g=>{var T;if(!Ck.includes(g.key))return;const y=g.target,v=d().filter(E=>{var k;return!((k=E.ref.current)!=null&&k.disabled)}),x=v.findIndex(E=>E.ref.current===y),w=v.length;if(x===-1)return;g.preventDefault();let b=x;const C=0,P=w-1,R=lt(()=>{b=x+1,b>P&&(b=C)},"moveNext"),M=lt(()=>{b=x-1,b<C&&(b=P)},"movePrev");switch(g.key){case"Home":b=C;break;case"End":b=P;break;case"ArrowRight":i==="horizontal"&&(h?R():M());break;case"ArrowDown":i==="vertical"&&R();break;case"ArrowLeft":i==="horizontal"&&(h?M():R());break;case"ArrowUp":i==="vertical"&&M();break}const j=b%w;(T=v[j].ref.current)==null||T.focus()});return l.jsx(Ak,{scope:r,disabled:o,direction:s,orientation:i,children:l.jsx(hl.Slot,{scope:r,children:l.jsx(re.div,{...a,"data-orientation":i,ref:u,onKeyDown:o?void 0:m})})})},"AccordionImpl")),ja="AccordionItem",[Dk,ml]=_s(ja),Ik=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,value:o,...s}=e,i=Os(ja,r),a=Tk(ja,r),c=pl(r),u=Fe(),d=o&&a.value.includes(o)||!1,f=i.disabled||e.disabled;return l.jsx(Dk,{scope:r,open:d,disabled:f,triggerId:u,children:l.jsx(vk,{"data-orientation":i.orientation,"data-state":gl(d),...c,...s,ref:n,disabled:f,open:d,onOpenChange:h=>{h?a.onItemOpen(o):a.onItemClose(o)}})})},"AccordionItem")),kk="AccordionHeader",Nk=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=ml(kk,r);return l.jsx(re.h3,{"data-orientation":s.orientation,"data-state":gl(i.open),"data-disabled":i.disabled?"":void 0,...o,ref:n})},"AccordionHeader")),zd="AccordionTrigger",_k=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=ml(zd,r),a=Mk(zd,r),c=pl(r);return l.jsx(hl.ItemSlot,{scope:r,children:l.jsx(xk,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...c,...o,ref:n})})},"AccordionTrigger")),Ok="AccordionContent",Lk=p.forwardRef(lt(function(e,n){const{__scopeAccordion:r,...o}=e,s=Os(Ot,r),i=ml(Ok,r),a=pl(r);return l.jsx(bk,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function gl(t){return t?"open":"closed"}lt(gl,"getState");var $k=Rk,Fk=Ik,Vk=Nk,Bk=_k,Gk=Lk;const zk=S.forwardRef(function({variant:e="plain",className:n,style:r,sx:o,children:s,...i},a){const{className:c,style:u,styleTag:d}=se(o,r,"cny-accordion",`cny-accordion-${e}`,n);return l.jsxs($k,{ref:a,className:c,style:u,...i,children:[d,s]})}),Uk=S.forwardRef(function({className:e,...n},r){return l.jsx(Fk,{ref:r,className:U("cny-accordion-item",e),...n})}),Hk=S.forwardRef(function({children:e,className:n,icon:r,hideIndicator:o,...s},i){return l.jsx(Vk,{className:"cny-accordion-header",children:l.jsxs(Bk,{ref:i,className:U("cny-accordion-trigger",n),...s,children:[r&&l.jsx("span",{className:"cny-accordion-trigger-icon",children:r}),l.jsx("span",{className:"cny-accordion-trigger-label",children:e}),!o&&l.jsx(zr,{size:14,"aria-hidden":"true",className:"cny-accordion-trigger-chevron"})]})})}),Wk=S.forwardRef(function({children:e,className:n,...r},o){return l.jsx(Gk,{ref:o,className:U("cny-accordion-content",n),...r,children:l.jsx("div",{className:"cny-accordion-content-inner",children:e})})});var Kk=Object.defineProperty,fe=(t,e)=>Kk(t,"name",{value:e,configurable:!0}),ay=["PageUp","PageDown"],cy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ly={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},no="Slider",[Aa,Yk,Xk]=cr(no),[yl,EN]=Re(no,[Xk]),[qk,ro]=yl(no),Zk=p.forwardRef(fe(function(e,n){const{name:r,min:o=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[o],value:f,onValueChange:h=fe(()=>{},"onValueChange"),onValueCommit:m=fe(()=>{},"onValueCommit"),inverted:g=!1,form:y,...v}=e,x=p.useRef(new Set),w=p.useRef(0),b=p.useRef(!1),P=a==="horizontal"?Qk:Jk,[R,M]=p.useState(null),j=ie(n,M),[T=[],E]=Pe({prop:f,defaultProp:d,onChange:fe(I=>{var O;(O=[...x.current][w.current])==null||O.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,h(I)},"onChange")}),k=p.useRef(T),_=p.useRef(T);p.useEffect(()=>{const I=y?R==null?void 0:R.ownerDocument.getElementById(y):R==null?void 0:R.closest("form");if(I instanceof HTMLFormElement){const L=fe(()=>E(_.current),"reset");return I.addEventListener("reset",L),()=>I.removeEventListener("reset",L)}},[R,y,E]);function $(I){const L=yy(T,I);V(I,L)}fe($,"handleSlideStart");function G(I){V(I,w.current)}fe(G,"handleSlideMove");function Q(){String(T)!==String(k.current)&&m(T)}fe(Q,"handleSlideEnd");function V(I,L,{commit:O}={commit:!1}){const D=xl(i),X=Pr(Math.round((I-o)/i)*i+o,D),A=Ar(X,[o,s]);E((B=[])=>{const ee=my(B,A,L);if(by(ee,u*i)){w.current=ee.indexOf(A);const K=String(ee)!==String(B);return K&&O&&m(ee),K?ee:B}else return B})}return fe(V,"updateValues"),l.jsx(qk,{scope:e.__scopeSlider,name:r,disabled:c,min:o,max:s,valueIndexToChangeRef:w,thumbs:x.current,values:T,orientation:a,form:y,children:l.jsx(Aa.Provider,{scope:e.__scopeSlider,children:l.jsx(Aa.Slot,{scope:e.__scopeSlider,children:l.jsx(P,{"aria-disabled":c,"data-disabled":c?"":void 0,...v,ref:j,onPointerDown:H(v.onPointerDown,()=>{c||(k.current=T,b.current=!1)}),min:o,max:s,inverted:g,onSlideStart:c?void 0:$,onSlideMove:c?void 0:G,onSlideEnd:c?void 0:Q,onHomeKeyDown:()=>{c||(b.current=!0,V(o,0,{commit:!0}))},onEndKeyDown:()=>{c||(b.current=!0,V(s,T.length-1,{commit:!0}))},onStepKeyDown:({event:I,direction:L})=>{if(!c){b.current=!0;const X=ay.includes(I.key)||I.shiftKey&&cy.includes(I.key)?10:1,A=w.current,B=T[A],ee=wy(B,{min:o,step:i,direction:L,multiplier:X});V(ee,A,{commit:!0})}}})})})})},"Slider")),[uy,dy]=yl(no,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Qk=p.forwardRef(fe(function(e,n){const{min:r,max:o,dir:s,inverted:i,onSlideStart:a,onSlideMove:c,onSlideEnd:u,onStepKeyDown:d,...f}=e,[h,m]=p.useState(null),g=ie(n,m),y=p.useRef(void 0),v=Ht(s),x=v==="ltr",w=x&&!i||!x&&i;function b(C){const P=y.current||h.getBoundingClientRect(),R=[0,P.width],j=Ls(R,w?[r,o]:[o,r]);return y.current=P,j(C-P.left)}return fe(b,"getValueFromPointer"),l.jsx(uy,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:l.jsx(fy,{dir:v,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const P=b(C.clientX);a==null||a(P)},onSlideMove:C=>{const P=b(C.clientX);c==null||c(P)},onSlideEnd:()=>{y.current=void 0,u==null||u()},onStepKeyDown:C=>{const R=ly[w?"from-left":"from-right"].includes(C.key);d==null||d({event:C,direction:R?-1:1})}})})},"SliderHorizontal")),Jk=p.forwardRef(fe(function(e,n){const{min:r,max:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:u,...d}=e,f=p.useRef(null),h=ie(n,f),m=p.useRef(void 0),g=!s;function y(v){const x=m.current||f.current.getBoundingClientRect(),w=[0,x.height],C=Ls(w,g?[o,r]:[r,o]);return m.current=x,C(v-x.top)}return fe(y,"getValueFromPointer"),l.jsx(uy,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:l.jsx(fy,{"data-orientation":"vertical",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const x=y(v.clientY);i==null||i(x)},onSlideMove:v=>{const x=y(v.clientY);a==null||a(x)},onSlideEnd:()=>{m.current=void 0,c==null||c()},onStepKeyDown:v=>{const w=ly[g?"from-bottom":"from-top"].includes(v.key);u==null||u({event:v,direction:w?-1:1})}})})},"SliderVertical")),fy=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,onSlideStart:o,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:c,onStepKeyDown:u,...d}=e,f=ro(no,r);return l.jsx(re.span,{...d,ref:n,onKeyDown:H(e.onKeyDown,h=>{h.key==="Home"?(a(h),h.preventDefault()):h.key==="End"?(c(h),h.preventDefault()):ay.concat(cy).includes(h.key)&&(u(h),h.preventDefault())}),onPointerDown:H(e.onPointerDown,h=>{const m=h.target;m.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(m)?m.focus({preventScroll:!0,focusVisible:!1}):o(h)}),onPointerMove:H(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:H(e.onPointerUp,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&(m.releasePointerCapture(h.pointerId),i(h))})})},"SliderImpl")),eN="SliderTrack",tN=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,...o}=e,s=ro(eN,r);return l.jsx(re.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...o,ref:n})},"SliderTrack")),Ud="SliderRange",nN=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,...o}=e,s=ro(Ud,r),i=dy(Ud,r),a=p.useRef(null),c=ie(n,a),u=s.values.length,d=s.values.map(m=>vl(m,s.min,s.max)),f=u>1?Math.min(...d):0,h=100-Math.max(...d);return l.jsx(re.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...o,ref:c,style:{...e.style,[i.startEdge]:f+"%",[i.endEdge]:h+"%"}})},"SliderRange")),rN="SliderThumb",[oN,hy]=yl(rN),sN="SliderThumbProvider";function py(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:o}=t,s=ro(sN,e),i=Yk(e),[a,c]=p.useState(null),u=p.useMemo(()=>a?i().findIndex(v=>v.ref.current===a):-1,[i,a]),d=hr(a),f=a?!!s.form||!!a.closest("form"):!0,h=s.values[u],m=n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),g=h===void 0?0:vl(h,s.min,s.max);p.useEffect(()=>{if(a)return s.thumbs.add(a),()=>{s.thumbs.delete(a)}},[a,s.thumbs]);const y={value:h,name:m,form:s.form,isFormControl:f,index:u,thumb:a,onThumbChange:c,percent:g,size:d};return l.jsx(oN,{scope:e,...y,children:Cy(o)?o(y):r})}fe(py,"SliderThumbProvider");var Ei="SliderThumbTrigger",iN=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,...o}=e,s=ro(Ei,r),i=dy(Ei,r),{index:a,value:c,percent:u,size:d,onThumbChange:f}=hy(Ei,r),h=ie(n,f),m=gy(a,s.values.length),g=d==null?void 0:d[i.size],y=g?vy(g,u,i.direction):0;return l.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${u}% + ${y}px)`},children:l.jsx(Aa.ItemSlot,{scope:r,children:l.jsx(re.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":s.min,"aria-valuenow":c,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...o,ref:h,style:c===void 0?{display:"none"}:e.style,onFocus:H(e.onFocus,()=>{s.valueIndexToChangeRef.current=a})})})})},"SliderThumbTrigger")),aN=p.forwardRef(fe(function(e,n){const{__scopeSlider:r,name:o,...s}=e;return l.jsx(py,{__scopeSlider:r,name:o,internal_do_not_use_render:({index:i,isFormControl:a})=>l.jsxs(l.Fragment,{children:[l.jsx(iN,{...s,ref:n,__scopeSlider:r}),a?l.jsx(lN,{__scopeSlider:r},i):null]})})},"SliderThumb")),cN="SliderBubbleInput",lN=p.forwardRef(fe(function({__scopeSlider:e,...n},r){const{value:o,name:s,form:i}=hy(cN,e),a=p.useRef(null),c=ie(a,r),u=Pc(o);return p.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(u!==o&&m){const g=new Event("input",{bubbles:!0});m.call(d,o),d.dispatchEvent(g)}},[u,o]),l.jsx(re.input,{style:{display:"none"},name:s,form:i,...n,ref:c,defaultValue:o})},"SliderBubbleInput"));function my(t=[],e,n){const r=[...t];return r[n]=e,r.sort((o,s)=>o-s)}fe(my,"getNextSortedValues");function vl(t,e,n){const s=100/(n-e)*(t-e);return Ar(s,[0,100])}fe(vl,"convertValueToPercentage");function gy(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}fe(gy,"getLabel");function yy(t,e){if(t.length===1)return 0;const n=t.map(o=>Math.abs(o-e)),r=Math.min(...n);return n.indexOf(r)}fe(yy,"getClosestValueIndex");function vy(t,e,n){const r=t/2,s=Ls([0,50],[0,r]);return(r-s(e)*n)*n}fe(vy,"getThumbInBoundsOffset");function xy(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}fe(xy,"getStepsBetweenValues");function by(t,e){if(e>0){const n=xy(t);return Math.min(...n)>=e}return!0}fe(by,"hasMinStepsBetweenValues");function Ls(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}fe(Ls,"linearScale");function xl(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,o]=e.split("e"),s=r.split(".")[1]||"",i=Number(o);return Math.max(0,s.length-i)}const n=e.split(".")[1];return n?n.length:0}fe(xl,"getDecimalCount");function Pr(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}fe(Pr,"roundValue");function wy(t,{min:e,step:n,direction:r,multiplier:o}){const s=xl(n),i=(t-e)/n,a=Math.round(i),c=Pr(a*n+e,s)===Pr(t,s);let u;return c?u=a+o*r:r>0?u=Math.ceil(i):u=Math.floor(i),Pr(u*n+e,s)}fe(wy,"getNextStepValue");function Cy(t){return typeof t=="function"}fe(Cy,"isFunction");const uN=S.forwardRef(function({className:e,style:n,sx:r,size:o="md",color:s="primary",showValue:i=!1,formatValue:a,value:c,defaultValue:u,...d},f){const h=c??u??[0],m=a??(x=>x),{className:g,style:y,styleTag:v}=se(r,n,"cny-slider",`cny-slider-${o}`,`cny-slider-${s}`,e);return l.jsxs(Zk,{ref:f,className:g,style:y,value:c,defaultValue:u,...d,children:[v,l.jsx(tN,{className:"cny-slider-track",children:l.jsx(nN,{className:"cny-slider-range"})}),h.map((x,w)=>l.jsx(aN,{className:"cny-slider-thumb","aria-label":`Value ${w+1}`,children:i&&l.jsx("span",{className:"cny-slider-bubble",children:m(x)})},w))]})}),dN=S.forwardRef(function({steps:e,active:n,orientation:r="horizontal",size:o="md",onStepClick:s,className:i,style:a,sx:c,...u},d){const{className:f,style:h,styleTag:m}=se(c,a,"cny-stepper",`cny-stepper-${r}`,`cny-stepper-${o}`,i);return l.jsxs("ol",{ref:d,className:f,style:h,"aria-label":"Progress",...u,children:[m,e.map((g,y)=>{const v=y<n?"complete":y===n?"active":"upcoming",x=v==="complete"&&!!s;return l.jsxs("li",{className:U("cny-stepper-step",`is-${v}`),children:[l.jsxs("button",{type:"button",className:"cny-stepper-step-row",onClick:x?()=>s==null?void 0:s(y):void 0,disabled:!x,"aria-current":v==="active"?"step":void 0,children:[l.jsx("span",{className:"cny-stepper-marker","aria-hidden":"true",children:v==="complete"?l.jsx(rn,{size:14}):g.icon??y+1}),l.jsxs("span",{className:"cny-stepper-text",children:[l.jsx("span",{className:"cny-stepper-label",children:g.label}),g.description&&l.jsx("span",{className:"cny-stepper-desc",children:g.description})]})]}),y<e.length-1&&l.jsx("span",{className:"cny-stepper-connector","aria-hidden":"true"})]},y)})]})}),fN=S.forwardRef(function({size:e=80,color:n="var(--color-primary, #3A73B3)",className:r,style:o,...s},i){const a=S.useId().replace(/[^a-zA-Z0-9_-]/g,""),c=`cny-loader-fade-reveal-${a}`,u=`cny-loader-${a}`;return l.jsxs("div",{ref:i,className:U("cny-loader",u,r),style:{width:e,height:e*(24/21.635),color:n,...o},...s,children:[l.jsx(ka,{css:`
|
|
215
215
|
@keyframes ${c} {
|
|
216
216
|
0%, 100% { opacity: 0; transform: translateY(8px); }
|
|
217
217
|
15%, 70% { opacity: 1; transform: translateY(0); }
|