@cashdoc/cashdoc-cms-design-system 2.8.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -25,7 +25,7 @@
25
25
  `),ghost:P("border-none bg-transparent","hover:bg-cms-gray-100 hover:text-cms-gray-900","disabled:bg-transparent disabled:text-cms-gray-450",`
26
26
  disabled:cursor-not-allowed
27
27
  disabled:hover:bg-transparent
28
- `)},size:{sm:"h-7 px-2.5 text-[13px]",default:"h-9 px-3 text-sm",lg:"h-11 px-3.5 text-[15px]"}},defaultVariants:{variant:"default",size:"default"}}),RP=Ee(P("box-border h-9 w-full","px-3","rounded-cms-md","border border-solid","leading-tight font-normal","transition-[border-color,box-shadow] duration-150 ease-out","outline-none","bg-cms-white text-sm text-cms-gray-900","placeholder:text-sm placeholder:text-cms-gray-450","hover:border-cms-gray-350"),{variants:{variant:{default:P("border-cms-gray-250","focus:border-cms-gray-900","focus:shadow-[0_0_0_3px_rgba(15,20,25,0.08)]","disabled:bg-cms-gray-100","disabled:text-cms-gray-450","disabled:border-cms-gray-200","disabled:cursor-not-allowed","disabled:hover:border-cms-gray-200"),error:P("border-cms-red-500","focus:border-cms-red-500","focus:shadow-[0_0_0_3px_rgba(229,56,74,0.22)]","hover:border-cms-red-500")},fullWidth:{true:"w-full",false:"w-auto"}},defaultVariants:{variant:"default",fullWidth:!0}}),am=Ee("mb-1.5 block text-[13px] font-medium text-cms-gray-800"),eM=Ee("mt-1.5 block text-[12px] font-normal text-cms-red-500"),tM=Ee("mt-1.5 block text-[12px] font-normal text-cms-gray-550"),ou=y.forwardRef(({className:e,variant:t,fullWidth:r,label:n,required:o,error:a,errorMessage:i,helperText:s,showCharCount:l,maxLength:c,value:d,defaultValue:u,onChange:f,id:p,labelLayout:g="vertical",labelWidth:m="120px",prefix:v,suffix:b,disabled:x,...O},E)=>{const S=y.useId(),C=d!==void 0,_=te=>te==null?"":String(te),[M,A]=y.useState(_(u)),D=p||S,I=`${D}-error`,k=`${D}-helper`,H=a?"error":t,L=(C?_(d):M).length,N=te=>{C||A(te.target.value),f==null||f(te)},T=C?{value:d}:{defaultValue:u},$=n||l&&c,W=g==="horizontal",U=a&&i?I:s?k:void 0,J=v!=null||b!=null,re=P("absolute inset-y-0 flex items-center","pointer-events-none",x?"text-cms-gray-400":"text-cms-gray-450"),R=te=>{const ne=h.jsx("input",{id:D,ref:E,className:P(RP({variant:H,fullWidth:te}),v!=null&&"pl-9",b!=null&&"pr-9",e),maxLength:c,...T,onChange:N,required:o,disabled:x,"aria-invalid":a||void 0,"aria-describedby":U,...O});return J?h.jsxs("div",{className:"relative",children:[v!=null&&h.jsx("div",{className:P(re,"left-3"),"aria-hidden":"true",children:v}),ne,b!=null&&h.jsx("div",{className:P(re,"right-3"),"aria-hidden":"true",children:b})]}):ne};return h.jsxs("div",{className:P("w-full",!r&&"w-auto"),children:[W&&$?h.jsxs("div",{className:"flex items-center gap-3",children:[n&&h.jsxs("label",{htmlFor:D,className:P(am(),"mb-0 shrink-0"),style:{width:m},children:[n,o&&h.jsx("span",{className:"ml-1 text-cms-red-400",children:"*"})]}),h.jsx("div",{className:"flex-1",children:R(!0)}),l&&c&&h.jsxs("span",{className:"shrink-0 text-sm text-cms-gray-600",children:[L," / ",c]})]}):h.jsxs(h.Fragment,{children:[$&&h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[n?h.jsxs("label",{htmlFor:D,className:am(),children:[n,o&&h.jsx("span",{className:"ml-1 text-cms-red-400",children:"*"})]}):h.jsx("div",{}),l&&c&&h.jsxs("span",{className:"text-sm text-cms-gray-600",children:[L," / ",c]})]}),R(r)]}),a&&i&&h.jsx("span",{id:I,className:eM(),children:i}),!a&&s&&h.jsx("span",{id:k,className:tM(),children:s})]})});ou.displayName="TextInput";function rM(e){return"group"in e}function nM(e){return e.map((t,r)=>rM(t)?{value:`__group_${r}_${t.label}`,label:t.label,disabled:t.disabled,children:t.group}:t)}const im=y.forwardRef(({options:e,value:t,placeholder:r="선택하세요",onValueChange:n,onValuesChange:o,disabled:a=!1,className:i,dropdownClassName:s,variant:l,size:c,searchable:d=!1,clearable:u=!1,multiple:f=!1,selectAll:p=!1,maxHeight:g=200,defaultOpen:m=!1,renderOption:v,onSearchChange:b,...x},O)=>{if(p&&!f)throw new Error("Dropdown: selectAll={true} requires multiple={true}.");const E=y.useMemo(()=>nM(e),[e]),[S,C]=y.useState(m),[_,M]=y.useState(!1),[A,D]=y.useState(!1),[I,k]=y.useState(null),[H,j]=y.useState(""),[L,N]=y.useState(f?t?t.split(",").filter(Boolean):[]:[]),T=f&&t!==void 0?t.split(",").filter(Boolean):L,[$,W]=y.useState(null),U=y.useRef(new Map),J=y.useRef(null),{ref:re,nodeRef:R,showEnd:te,refresh:ne}=nm("y"),oe=y.useRef(null),me=y.useRef(null),le=y.useRef(null),V=y.useRef(null),K=(ie,ve)=>{for(const Se of ie){if(Se.value===ve)return Se;if(Se.children){const ot=K(Se.children,ve);if(ot)return ot}}},G=K(E,t||""),F=f?T.length>0?`${T.length}개 선택됨`:r:(G==null?void 0:G.displayLabel)||(G==null?void 0:G.label)||r,ee=E.filter(ie=>{const ve=H.toLowerCase();return ie.label.toLowerCase().includes(ve)?!0:ie.children?ie.children.some(Se=>Se.label.toLowerCase().includes(ve)):!1}),q=y.useCallback(()=>{M(!0)},[]),X=()=>{if(a)return;if(S&&!_){q();return}const ie=me.current;if(ie){const ve=ie.getBoundingClientRect(),Se=window.innerHeight-ve.bottom,ot=ve.top,ht=(d?40:0)+g+16,qt=Se<ht&&ot>Se;D(qt),k({topAnchor:ve.bottom+4,bottomAnchor:window.innerHeight-ve.top+4,left:ve.left,width:ve.width})}M(!1),C(!0),H&&(j(""),b==null||b(""))},ce=ie=>{ie.animationName==="dropdownHide"&&ie.currentTarget===ie.target&&(C(!1),M(!1),H&&(j(""),b==null||b("")))},Y=()=>{J.current!==null&&(window.clearTimeout(J.current),J.current=null)},Q=()=>{Y(),J.current=window.setTimeout(()=>{W(null)},300)},ae=y.useCallback((ie,ve)=>{if(Y(),!ve){W(null);return}const Se=U.current.get(ie.value);if(Se&&R.current){const ot=Se.getBoundingClientRect(),ht=R.current.getBoundingClientRect();W({value:ie.value,top:ot.top-ht.top+R.current.scrollTop})}},[R]);y.useEffect(()=>()=>{Y()},[]);const we=ie=>{o?o(ie):n==null||n(ie.join(","))},Ze=ie=>{if(!ie.disabled)if(f){const ve=T.includes(ie.value)?T.filter(Se=>Se!==ie.value):[...T,ie.value];t===void 0&&N(ve),we(ve)}else n==null||n(ie.value),q()},ze=()=>{if(!f)return;const ie=ee.filter(Se=>!Se.disabled).map(Se=>Se.value),ve=Array.from(new Set([...T,...ie]));t===void 0&&N(ve),n==null||n(ve.join(","))},St=ie=>{ie.stopPropagation(),f?(t===void 0&&N([]),we([])):n==null||n("")},Eo=ie=>{ie.key==="Escape"?q():(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),X())};return y.useEffect(()=>{if(!S)return;const ie=ve=>{var ot,ht;const Se=ve.target;(ot=oe.current)!=null&&ot.contains(Se)||(ht=le.current)!=null&&ht.contains(Se)||q()};return document.addEventListener("mousedown",ie),()=>document.removeEventListener("mousedown",ie)},[S,q]),y.useEffect(()=>{if(!S)return;const ie=Se=>{var ht;const ot=Se.target;ot&&((ht=le.current)!=null&&ht.contains(ot))||q()},ve=()=>q();return window.addEventListener("scroll",ie,!0),window.addEventListener("resize",ve),()=>{window.removeEventListener("scroll",ie,!0),window.removeEventListener("resize",ve)}},[S,q]),y.useEffect(()=>{S&&d&&V.current&&V.current.focus()},[S,d]),h.jsxs("div",{ref:oe,className:"relative w-full",children:[p&&h.jsxs("div",{className:"mb-1 flex justify-start -space-x-4",children:[h.jsx(bt,{variant:"underline",type:"button",onClick:ze,disabled:a,children:"모두 선택"}),h.jsx(bt,{variant:"underline",type:"button",onClick:St,disabled:a,children:"해제"})]}),h.jsxs("div",{ref:me,className:"relative",children:[h.jsx("button",{ref:O,type:"button",className:P(om({variant:l,size:c}),"pr-8",i),onClick:X,onKeyDown:Eo,disabled:a,"aria-expanded":S,"aria-haspopup":"listbox",...x,children:h.jsx("span",{className:P("flex-1 truncate text-left",!G&&!f&&"text-cms-gray-400"),children:F})}),h.jsxs("div",{className:P("absolute top-1/2 right-3 -translate-y-1/2","flex items-center gap-2","pointer-events-none",a&&"text-cms-gray-400"),children:[u&&(t||T.length>0)&&h.jsx("button",{type:"button",className:P("pointer-events-auto border-0 bg-transparent","rounded-cms-md p-1 text-cms-gray-400 transition-colors","hover:text-cms-black"),onClick:St,"aria-label":"선택 취소",children:h.jsx(yn,{className:"size-3"})}),h.jsx(es,{size:14,strokeWidth:2,className:P("transition-transform duration-200",S&&"rotate-180")})]}),S&&I&&Ta.createPortal(h.jsxs("div",{ref:le,role:"listbox","aria-multiselectable":f||void 0,className:P("fixed z-cms-overlay min-w-0 py-1","rounded-cms-xl border border-cms-gray-300","bg-cms-white shadow-lg",_?"cms-dropdown-hide":"cms-dropdown-show",s),style:{top:A?"auto":I.topAnchor,bottom:A?I.bottomAnchor:"auto",left:I.left,width:I.width,maxHeight:`${g}px`},onAnimationEnd:ce,children:[d&&h.jsx("div",{className:"border-b border-cms-gray-200 p-2",children:h.jsx(ou,{ref:V,type:"text",value:H,onChange:ie=>{j(ie.target.value),b==null||b(ie.target.value),requestAnimationFrame(()=>ne())},placeholder:"검색..."})}),h.jsxs("div",{className:"relative min-h-0 flex-1",children:[h.jsx("div",{className:P("h-full overflow-hidden",d?"rounded-b-cms-xl":"rounded-cms-xl"),children:h.jsxs("div",{ref:re,className:"overflow-y-auto",style:{maxHeight:`${g}px`},onMouseEnter:Y,onMouseLeave:Q,children:[ee.length===0?h.jsx("div",{className:P("px-3 py-2","text-sm text-cms-gray-400","text-center"),children:H?"검색 결과가 없습니다":"옵션이 없습니다"}):ee.map(ie=>{var ht;const ve=f?T.includes(ie.value):t===ie.value,Se=!!((ht=ie.children)!=null&&ht.length),ot=($==null?void 0:$.value)===ie.value;return h.jsx("div",{ref:qt=>{qt?U.current.set(ie.value,qt):U.current.delete(ie.value)},onMouseEnter:()=>ae(ie,Se),onMouseLeave:()=>{Se&&Q()},children:h.jsxs("button",{type:"button",role:"option","aria-selected":ve,"aria-haspopup":Se?"menu":void 0,className:P("border-0","flex items-center justify-between gap-2","w-full px-3 py-2","text-left text-sm","transition-colors",ie.disabled?P("cursor-not-allowed bg-cms-white","text-cms-gray-400"):P("bg-cms-white text-cms-black","hover:bg-cms-gray-100","cursor-pointer"),ve&&"bg-cms-gray-150 font-medium",ot&&"bg-cms-gray-100"),onClick:()=>{Se||Ze(ie)},disabled:ie.disabled,children:[v?v(ie):h.jsx("span",{className:"truncate",children:ie.label}),Se?h.jsx(Kp,{className:P("size-3 shrink-0","text-cms-gray-400")}):ve?h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-4 w-4 shrink-0 text-cms-black",children:h.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null]})},ie.value)}),te&&h.jsx("div",{className:P("sticky bottom-0 -mt-8 flex h-8 w-full items-end","justify-center pb-1","bg-linear-to-t from-cms-white to-transparent","pointer-events-none"),children:h.jsx(es,{size:16,strokeWidth:2,className:P("text-cms-gray-400","animate-bounce")})})]})}),$&&(()=>{const ie=ee.find(ve=>ve.value===$.value);return ie!=null&&ie.children?h.jsx("div",{role:"menu",className:P(`
28
+ `)},size:{sm:"h-7 px-2.5 text-[13px]",default:"h-9 px-3 text-sm",lg:"h-11 px-3.5 text-[15px]"}},defaultVariants:{variant:"default",size:"default"}}),RP=Ee(P("box-border h-9 w-full","px-3","rounded-cms-md","border border-solid","leading-tight font-normal","transition-[border-color,box-shadow] duration-150 ease-out","outline-none","bg-cms-white text-sm text-cms-gray-900","placeholder:text-sm placeholder:text-cms-gray-450","hover:border-cms-gray-350"),{variants:{variant:{default:P("border-cms-gray-250","focus:border-cms-gray-900","focus:shadow-[0_0_0_3px_rgba(15,20,25,0.08)]","disabled:bg-cms-gray-100","disabled:text-cms-gray-450","disabled:border-cms-gray-200","disabled:cursor-not-allowed","disabled:hover:border-cms-gray-200"),error:P("border-cms-red-500","focus:border-cms-red-500","focus:shadow-[0_0_0_3px_rgba(229,56,74,0.22)]","hover:border-cms-red-500")},fullWidth:{true:"w-full",false:"w-auto"}},defaultVariants:{variant:"default",fullWidth:!0}}),am=Ee("mb-1.5 block text-[13px] font-medium text-cms-gray-800"),eM=Ee("mt-1.5 block text-[12px] font-normal text-cms-red-500"),tM=Ee("mt-1.5 block text-[12px] font-normal text-cms-gray-550"),ou=y.forwardRef(({className:e,variant:t,fullWidth:r,label:n,required:o,error:a,errorMessage:i,helperText:s,showCharCount:l,maxLength:c,value:d,defaultValue:u,onChange:f,id:p,labelLayout:g="vertical",labelWidth:m="120px",prefix:v,suffix:b,disabled:x,...O},E)=>{const S=y.useId(),C=d!==void 0,_=te=>te==null?"":String(te),[M,A]=y.useState(_(u)),D=p||S,I=`${D}-error`,k=`${D}-helper`,H=a?"error":t,L=(C?_(d):M).length,N=te=>{C||A(te.target.value),f==null||f(te)},T=C?{value:d}:{defaultValue:u},$=n||l&&c,W=g==="horizontal",U=a&&i?I:s?k:void 0,J=v!=null||b!=null,re=P("absolute inset-y-0 flex items-center","pointer-events-none",x?"text-cms-gray-400":"text-cms-gray-450"),R=te=>{const ne=h.jsx("input",{id:D,ref:E,className:P(RP({variant:H,fullWidth:te}),v!=null&&"pl-9",b!=null&&"pr-9",e),maxLength:c,...T,onChange:N,required:o,disabled:x,"aria-invalid":a||void 0,"aria-describedby":U,...O});return J?h.jsxs("div",{className:"relative",children:[v!=null&&h.jsx("div",{className:P(re,"left-3"),"aria-hidden":"true",children:v}),ne,b!=null&&h.jsx("div",{className:P(re,"right-3"),"aria-hidden":"true",children:b})]}):ne};return h.jsxs("div",{className:P("w-full",!r&&"w-auto"),children:[W&&$?h.jsxs("div",{className:"flex items-center gap-3",children:[n&&h.jsxs("label",{htmlFor:D,className:P(am(),"mb-0 shrink-0"),style:{width:m},children:[n,o&&h.jsx("span",{className:"ml-1 text-cms-red-400",children:"*"})]}),h.jsx("div",{className:"flex-1",children:R(!0)}),l&&c&&h.jsxs("span",{className:"shrink-0 text-sm text-cms-gray-600",children:[L," / ",c]})]}):h.jsxs(h.Fragment,{children:[$&&h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[n?h.jsxs("label",{htmlFor:D,className:am(),children:[n,o&&h.jsx("span",{className:"ml-1 text-cms-red-400",children:"*"})]}):h.jsx("div",{}),l&&c&&h.jsxs("span",{className:"text-sm text-cms-gray-600",children:[L," / ",c]})]}),R(r)]}),a&&i&&h.jsx("span",{id:I,className:eM(),children:i}),!a&&s&&h.jsx("span",{id:k,className:tM(),children:s})]})});ou.displayName="TextInput";function rM(e){return"group"in e}function nM(e){return e.map((t,r)=>rM(t)?{value:`__group_${r}_${t.label}`,label:t.label,disabled:t.disabled,children:t.group}:t)}const im=y.forwardRef(({options:e,value:t,placeholder:r="선택하세요",onValueChange:n,onValuesChange:o,disabled:a=!1,className:i,dropdownClassName:s,variant:l,size:c,searchable:d=!1,clearable:u=!1,multiple:f=!1,selectAll:p=!1,maxHeight:g=200,defaultOpen:m=!1,renderOption:v,onSearchChange:b,...x},O)=>{if(p&&!f)throw new Error("Dropdown: selectAll={true} requires multiple={true}.");const E=y.useMemo(()=>nM(e),[e]),[S,C]=y.useState(m),[_,M]=y.useState(!1),[A,D]=y.useState(!1),[I,k]=y.useState(null),[H,j]=y.useState(""),[L,N]=y.useState(f?t?t.split(",").filter(Boolean):[]:[]),T=f&&t!==void 0?t.split(",").filter(Boolean):L,[$,W]=y.useState(null),U=y.useRef(new Map),J=y.useRef(null),{ref:re,nodeRef:R,showEnd:te,refresh:ne}=nm("y"),oe=y.useRef(null),me=y.useRef(null),le=y.useRef(null),V=y.useRef(null),K=(ie,ve)=>{for(const Se of ie){if(Se.value===ve)return Se;if(Se.children){const ot=K(Se.children,ve);if(ot)return ot}}},G=K(E,t||""),F=f?T.length>0?`${T.length}개 선택됨`:r:(G==null?void 0:G.displayLabel)||(G==null?void 0:G.label)||r,ee=E.filter(ie=>{const ve=H.toLowerCase();return ie.label.toLowerCase().includes(ve)?!0:ie.children?ie.children.some(Se=>Se.label.toLowerCase().includes(ve)):!1}),q=y.useCallback(()=>{M(!0)},[]),X=()=>{if(a)return;if(S&&!_){q();return}const ie=me.current;if(ie){const ve=ie.getBoundingClientRect(),Se=window.innerHeight-ve.bottom,ot=ve.top,ht=(d?40:0)+g+16,qt=Se<ht&&ot>Se;D(qt),k({topAnchor:ve.bottom+4,bottomAnchor:window.innerHeight-ve.top+4,left:ve.left,width:ve.width})}M(!1),C(!0),H&&(j(""),b==null||b(""))},ce=ie=>{ie.animationName==="dropdownHide"&&ie.currentTarget===ie.target&&(C(!1),M(!1),H&&(j(""),b==null||b("")))},Y=()=>{J.current!==null&&(window.clearTimeout(J.current),J.current=null)},Q=()=>{Y(),J.current=window.setTimeout(()=>{W(null)},300)},ae=y.useCallback((ie,ve)=>{if(Y(),!ve){W(null);return}const Se=U.current.get(ie.value);if(Se&&R.current){const ot=Se.getBoundingClientRect(),ht=R.current.getBoundingClientRect();W({value:ie.value,top:ot.top-ht.top+R.current.scrollTop})}},[R]);y.useEffect(()=>()=>{Y()},[]);const we=ie=>{o?o(ie):n==null||n(ie.join(","))},Ze=ie=>{if(!ie.disabled)if(f){const ve=T.includes(ie.value)?T.filter(Se=>Se!==ie.value):[...T,ie.value];t===void 0&&N(ve),we(ve)}else n==null||n(ie.value),q()},ze=()=>{if(!f)return;const ie=ee.filter(Se=>!Se.disabled).map(Se=>Se.value),ve=Array.from(new Set([...T,...ie]));t===void 0&&N(ve),n==null||n(ve.join(","))},St=ie=>{ie.stopPropagation(),f?(t===void 0&&N([]),we([])):n==null||n("")},Eo=ie=>{ie.key==="Escape"?q():(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),X())};return y.useEffect(()=>{if(!S)return;const ie=ve=>{var ot,ht;const Se=ve.target;(ot=oe.current)!=null&&ot.contains(Se)||(ht=le.current)!=null&&ht.contains(Se)||q()};return document.addEventListener("mousedown",ie),()=>document.removeEventListener("mousedown",ie)},[S,q]),y.useEffect(()=>{if(!S)return;const ie=Se=>{var ht;const ot=Se.target;ot&&((ht=le.current)!=null&&ht.contains(ot))||q()},ve=()=>q();return window.addEventListener("scroll",ie,!0),window.addEventListener("resize",ve),()=>{window.removeEventListener("scroll",ie,!0),window.removeEventListener("resize",ve)}},[S,q]),y.useEffect(()=>{S&&d&&V.current&&V.current.focus()},[S,d]),h.jsxs("div",{ref:oe,className:"relative w-full",children:[p&&h.jsxs("div",{className:"mb-1 flex justify-start -space-x-4",children:[h.jsx(bt,{variant:"underline",type:"button",onClick:ze,disabled:a,children:"모두 선택"}),h.jsx(bt,{variant:"underline",type:"button",onClick:St,disabled:a,children:"해제"})]}),h.jsxs("div",{ref:me,className:"relative",children:[h.jsx("button",{ref:O,type:"button",className:P(om({variant:l,size:c}),"pr-8",i),onClick:X,onKeyDown:Eo,disabled:a,"aria-expanded":S,"aria-haspopup":"listbox",...x,children:h.jsx("span",{className:P("flex-1 truncate text-left",!G&&!f&&"text-cms-gray-400"),children:F})}),h.jsxs("div",{className:P("absolute top-1/2 right-3 -translate-y-1/2","flex items-center gap-2","pointer-events-none",a&&"text-cms-gray-400"),children:[u&&(t||T.length>0)&&h.jsx("button",{type:"button",className:P("pointer-events-auto border-0 bg-transparent","rounded-cms-md p-1 text-cms-gray-400 transition-colors","hover:text-cms-black"),onClick:St,"aria-label":"선택 취소",children:h.jsx(yn,{className:"size-3"})}),h.jsx(es,{size:14,strokeWidth:2,className:P("transition-transform duration-200",S&&"rotate-180")})]}),S&&I&&Ta.createPortal(h.jsxs("div",{ref:le,role:"listbox","aria-multiselectable":f||void 0,className:P("fixed z-cms-overlay min-w-0 py-1","rounded-cms-xl border border-cms-gray-300","bg-cms-white shadow-lg",_?"cms-dropdown-hide":"cms-dropdown-show",s),style:{top:A?"auto":I.topAnchor,bottom:A?I.bottomAnchor:"auto",left:I.left,width:I.width,maxHeight:`${g}px`},onAnimationEnd:ce,children:[d&&h.jsx("div",{className:"border-b border-cms-gray-200 p-2",children:h.jsx(ou,{ref:V,type:"text",value:H,onChange:ie=>{j(ie.target.value),b==null||b(ie.target.value),requestAnimationFrame(()=>ne())},placeholder:"검색..."})}),h.jsxs("div",{className:"relative min-h-0 flex-1",children:[h.jsx("div",{className:P("h-full overflow-hidden",d?"rounded-b-cms-xl":"rounded-cms-xl"),children:h.jsxs("div",{ref:re,className:"overflow-y-auto overscroll-contain",style:{maxHeight:`${g}px`},onMouseEnter:Y,onMouseLeave:Q,children:[ee.length===0?h.jsx("div",{className:P("px-3 py-2","text-sm text-cms-gray-400","text-center"),children:H?"검색 결과가 없습니다":"옵션이 없습니다"}):ee.map(ie=>{var ht;const ve=f?T.includes(ie.value):t===ie.value,Se=!!((ht=ie.children)!=null&&ht.length),ot=($==null?void 0:$.value)===ie.value;return h.jsx("div",{ref:qt=>{qt?U.current.set(ie.value,qt):U.current.delete(ie.value)},onMouseEnter:()=>ae(ie,Se),onMouseLeave:()=>{Se&&Q()},children:h.jsxs("button",{type:"button",role:"option","aria-selected":ve,"aria-haspopup":Se?"menu":void 0,className:P("border-0","flex items-center justify-between gap-2","w-full px-3 py-2","text-left text-sm","transition-colors",ie.disabled?P("cursor-not-allowed bg-cms-white","text-cms-gray-400"):P("bg-cms-white text-cms-black","hover:bg-cms-gray-100","cursor-pointer"),ve&&"bg-cms-gray-150 font-medium",ot&&"bg-cms-gray-100"),onClick:()=>{Se||Ze(ie)},disabled:ie.disabled,children:[v?v(ie):h.jsx("span",{className:"truncate",children:ie.label}),Se?h.jsx(Kp,{className:P("size-3 shrink-0","text-cms-gray-400")}):ve?h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-4 w-4 shrink-0 text-cms-black",children:h.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null]})},ie.value)}),te&&h.jsx("div",{className:P("sticky bottom-0 -mt-8 flex h-8 w-full items-end","justify-center pb-1","bg-linear-to-t from-cms-white to-transparent","pointer-events-none"),children:h.jsx(es,{size:16,strokeWidth:2,className:P("text-cms-gray-400","animate-bounce")})})]})}),$&&(()=>{const ie=ee.find(ve=>ve.value===$.value);return ie!=null&&ie.children?h.jsx("div",{role:"menu",className:P(`
29
29
  absolute left-full z-cms-overlay ml-1 min-w-40
30
30
  py-1
31
31
  `,"rounded-cms-xl border border-cms-gray-300","bg-cms-white shadow-lg","cms-dropdown-show"),style:{top:$.top},onMouseEnter:()=>{Y(),W($)},onMouseLeave:Q,children:ie.children.map(ve=>{const Se=f?T.includes(ve.value):t===ve.value;return h.jsxs("button",{type:"button",role:"menuitem","aria-selected":Se,className:P("border-0","flex items-center justify-between gap-2","w-full px-3 py-2","text-left text-sm","transition-colors",ve.disabled?P("cursor-not-allowed bg-cms-white","text-cms-gray-400"):P("bg-cms-white text-cms-black","hover:bg-cms-gray-100","cursor-pointer"),Se&&"bg-cms-gray-150 font-medium"),onClick:()=>Ze(ve),disabled:ve.disabled,children:[h.jsx("span",{className:"truncate",children:ve.label}),Se&&h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-4 w-4 shrink-0 text-cms-black",children:h.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},ve.value)})}):null})()]})]}),document.body)]})]})});im.displayName="Dropdown";const os=im,sm=y.forwardRef(({label:e,helperText:t,error:r,required:n,className:o,...a},i)=>h.jsxs("div",{className:P("space-y-1",o),children:[e&&h.jsxs("label",{className:"block text-sm font-medium text-cms-black",children:[e,n&&h.jsx("span",{className:"ml-1 text-cms-red-500",children:"*"})]}),h.jsx(os,{ref:i,...a,className:P(r&&"border-cms-red-500 focus:ring-cms-red-500")}),(t||r)&&h.jsx("p",{className:P("text-xs",r?"text-cms-red-500":"text-cms-gray-400"),children:r||t})]}));sm.displayName="Select";const lm=y.forwardRef(({options:e,loading:t=!1,createable:r=!1,onCreateOption:n,...o},a)=>{const[i]=y.useState(""),s=e.filter(g=>g.label.toLowerCase().includes(i.toLowerCase())),l=s.some(g=>g.label.toLowerCase()===i.toLowerCase()),c=[...s,...r&&i&&!l?[{value:`__create__${i}`,label:`"${i}" 생성`,disabled:!1}]:[]],d=g=>{var m;if(g.startsWith("__create__")){const v=g.replace("__create__","");n==null||n(v)}else(m=o.onValueChange)==null||m.call(o,g)},{multiple:u,selectAll:f,...p}=o;return u===!0?h.jsx(os,{...p,ref:a,options:c,searchable:!0,multiple:!0,selectAll:f,dropdownClassName:P(t&&"opacity-75",o.dropdownClassName),onValueChange:d}):h.jsx(os,{...p,ref:a,options:c,searchable:!0,dropdownClassName:P(t&&"opacity-75",o.dropdownClassName),onValueChange:d})});lm.displayName="Combobox";function Ce(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function cm(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function um(...e){return t=>{let r=!1;const n=e.map(o=>{const a=cm(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){const a=n[o];typeof a=="function"?a():cm(e[o],null)}}}}function We(...e){return w.useCallback(um(...e),e)}function oM(e,t){const r=w.createContext(t),n=a=>{const{children:i,...s}=a,l=w.useMemo(()=>s,Object.values(s));return h.jsx(r.Provider,{value:l,children:i})};n.displayName=e+"Provider";function o(a){const i=w.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,o]}function At(e,t=[]){let r=[];function n(a,i){const s=w.createContext(i),l=r.length;r=[...r,i];const c=u=>{var b;const{scope:f,children:p,...g}=u,m=((b=f==null?void 0:f[e])==null?void 0:b[l])||s,v=w.useMemo(()=>g,Object.values(g));return h.jsx(m.Provider,{value:v,children:p})};c.displayName=a+"Provider";function d(u,f){var m;const p=((m=f==null?void 0:f[e])==null?void 0:m[l])||s,g=w.useContext(p);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${a}\``)}return[c,d]}const o=()=>{const a=r.map(i=>w.createContext(i));return function(s){const l=(s==null?void 0:s[e])||a;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[n,aM(o,...t)]}function aM(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=n.reduce((s,{useScope:l,scopeName:c})=>{const u=l(a)[`__scope${c}`];return{...s,...u}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Ya(e){const t=iM(e),r=w.forwardRef((n,o)=>{const{children:a,...i}=n,s=w.Children.toArray(a),l=s.find(lM);if(l){const c=l.props.children,d=s.map(u=>u===l?w.Children.count(c)>1?w.Children.only(null):w.isValidElement(c)?c.props.children:null:u);return h.jsx(t,{...i,ref:o,children:w.isValidElement(c)?w.cloneElement(c,void 0,d):null})}return h.jsx(t,{...i,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function iM(e){const t=w.forwardRef((r,n)=>{const{children:o,...a}=r;if(w.isValidElement(o)){const i=uM(o),s=cM(a,o.props);return o.type!==w.Fragment&&(s.ref=n?um(n,i):i),w.cloneElement(o,s)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dm=Symbol("radix.slottable");function sM(e){const t=({children:r})=>h.jsx(h.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=dm,t}function lM(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dm}function cM(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...s)=>{const l=a(...s);return o(...s),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function uM(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var dM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xe=dM.reduce((e,t)=>{const r=Ya(`Primitive.${t}`),n=w.forwardRef((o,a)=>{const{asChild:i,...s}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function fM(e,t){e&&Tp.flushSync(()=>e.dispatchEvent(t))}function Wn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function hM(e,t=globalThis==null?void 0:globalThis.document){const r=Wn(e);w.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var pM="DismissableLayer",au="dismissableLayer.update",mM="dismissableLayer.pointerDownOutside",vM="dismissableLayer.focusOutside",fm,hm=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),as=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...l}=e,c=w.useContext(hm),[d,u]=w.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=w.useState({}),g=We(t,_=>u(_)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(v),x=d?m.indexOf(d):-1,O=c.layersWithOutsidePointerEventsDisabled.size>0,E=x>=b,S=bM(_=>{const M=_.target,A=[...c.branches].some(D=>D.contains(M));!E||A||(o==null||o(_),i==null||i(_),_.defaultPrevented||s==null||s())},f),C=wM(_=>{const M=_.target;[...c.branches].some(D=>D.contains(M))||(a==null||a(_),i==null||i(_),_.defaultPrevented||s==null||s())},f);return hM(_=>{x===c.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&s&&(_.preventDefault(),s()))},f),w.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(fm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),pm(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=fm)}},[d,f,r,c]),w.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),pm())},[d,c]),w.useEffect(()=>{const _=()=>p({});return document.addEventListener(au,_),()=>document.removeEventListener(au,_)},[]),h.jsx(xe.div,{...l,ref:g,style:{pointerEvents:O?E?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,S.onPointerDownCapture)})});as.displayName=pM;var gM="DismissableLayerBranch",yM=w.forwardRef((e,t)=>{const r=w.useContext(hm),n=w.useRef(null),o=We(t,n);return w.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),h.jsx(xe.div,{...e,ref:o})});yM.displayName=gM;function bM(e,t=globalThis==null?void 0:globalThis.document){const r=Wn(e),n=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const a=s=>{if(s.target&&!n.current){let l=function(){mm(mM,r,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function wM(e,t=globalThis==null?void 0:globalThis.document){const r=Wn(e),n=w.useRef(!1);return w.useEffect(()=>{const o=a=>{a.target&&!n.current&&mm(vM,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function pm(){const e=new CustomEvent(au);document.dispatchEvent(e)}function mm(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?fM(o,a):o.dispatchEvent(a)}var iu=0;function vm(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??gm()),document.body.insertAdjacentElement("beforeend",e[1]??gm()),iu++,()=>{iu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),iu--}},[])}function gm(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var su="focusScope.autoFocusOnMount",lu="focusScope.autoFocusOnUnmount",ym={bubbles:!1,cancelable:!0},xM="FocusScope",cu=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[s,l]=w.useState(null),c=Wn(o),d=Wn(a),u=w.useRef(null),f=We(t,m=>l(m)),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let m=function(O){if(p.paused||!s)return;const E=O.target;s.contains(E)?u.current=E:bn(u.current,{select:!0})},v=function(O){if(p.paused||!s)return;const E=O.relatedTarget;E!==null&&(s.contains(E)||bn(u.current,{select:!0}))},b=function(O){if(document.activeElement===document.body)for(const S of O)S.removedNodes.length>0&&bn(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const x=new MutationObserver(b);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),x.disconnect()}}},[n,s,p.paused]),w.useEffect(()=>{if(s){xm.add(p);const m=document.activeElement;if(!s.contains(m)){const b=new CustomEvent(su,ym);s.addEventListener(su,c),s.dispatchEvent(b),b.defaultPrevented||(OM(PM(bm(s)),{select:!0}),document.activeElement===m&&bn(s))}return()=>{s.removeEventListener(su,c),setTimeout(()=>{const b=new CustomEvent(lu,ym);s.addEventListener(lu,d),s.dispatchEvent(b),b.defaultPrevented||bn(m??document.body,{select:!0}),s.removeEventListener(lu,d),xm.remove(p)},0)}}},[s,c,d,p]);const g=w.useCallback(m=>{if(!r&&!n||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(v&&b){const x=m.currentTarget,[O,E]=CM(x);O&&E?!m.shiftKey&&b===E?(m.preventDefault(),r&&bn(O,{select:!0})):m.shiftKey&&b===O&&(m.preventDefault(),r&&bn(E,{select:!0})):b===x&&m.preventDefault()}},[r,n,p.paused]);return h.jsx(xe.div,{tabIndex:-1,...i,ref:f,onKeyDown:g})});cu.displayName=xM;function OM(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(bn(n,{select:t}),document.activeElement!==r)return}function CM(e){const t=bm(e),r=wm(t,e),n=wm(t.reverse(),e);return[r,n]}function bm(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function wm(e,t){for(const r of e)if(!SM(r,{upTo:t}))return r}function SM(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function EM(e){return e instanceof HTMLInputElement&&"select"in e}function bn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&EM(e)&&t&&e.select()}}var xm=_M();function _M(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Om(e,t),e.unshift(t)},remove(t){var r;e=Om(e,t),(r=e[0])==null||r.resume()}}}function Om(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function PM(e){return e.filter(t=>t.tagName!=="A")}var Ur=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},MM=w[" useId ".trim().toString()]||(()=>{}),kM=0;function Gr(e){const[t,r]=w.useState(MM());return Ur(()=>{r(n=>n??String(kM++))},[e]),e||(t?`radix-${t}`:"")}const NM=["top","right","bottom","left"],wn=Math.min,zt=Math.max,is=Math.round,ss=Math.floor,xr=e=>({x:e,y:e}),AM={left:"right",right:"left",bottom:"top",top:"bottom"},DM={start:"end",end:"start"};function uu(e,t,r){return zt(e,wn(t,r))}function Kr(e,t){return typeof e=="function"?e(t):e}function qr(e){return e.split("-")[0]}function ko(e){return e.split("-")[1]}function du(e){return e==="x"?"y":"x"}function fu(e){return e==="y"?"height":"width"}const TM=new Set(["top","bottom"]);function Or(e){return TM.has(qr(e))?"y":"x"}function hu(e){return du(Or(e))}function IM(e,t,r){r===void 0&&(r=!1);const n=ko(e),o=hu(e),a=fu(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=ls(i)),[i,ls(i)]}function $M(e){const t=ls(e);return[pu(e),t,pu(t)]}function pu(e){return e.replace(/start|end/g,t=>DM[t])}const Cm=["left","right"],Sm=["right","left"],jM=["top","bottom"],LM=["bottom","top"];function YM(e,t,r){switch(e){case"top":case"bottom":return r?t?Sm:Cm:t?Cm:Sm;case"left":case"right":return t?jM:LM;default:return[]}}function zM(e,t,r,n){const o=ko(e);let a=YM(qr(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(pu)))),a}function ls(e){return e.replace(/left|right|bottom|top/g,t=>AM[t])}function FM(e){return{top:0,right:0,bottom:0,left:0,...e}}function Em(e){return typeof e!="number"?FM(e):{top:e,right:e,bottom:e,left:e}}function cs(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function _m(e,t,r){let{reference:n,floating:o}=e;const a=Or(t),i=hu(t),s=fu(i),l=qr(t),c=a==="y",d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,f=n[s]/2-o[s]/2;let p;switch(l){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-o.width,y:u};break;default:p={x:n.x,y:n.y}}switch(ko(t)){case"start":p[i]-=f*(r&&c?-1:1);break;case"end":p[i]+=f*(r&&c?-1:1);break}return p}const WM=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=_m(c,n,l),f=n,p={},g=0;for(let m=0;m<s.length;m++){const{name:v,fn:b}=s[m],{x,y:O,data:E,reset:S}=await b({x:d,y:u,initialPlacement:n,placement:f,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});d=x??d,u=O??u,p={...p,[v]:{...p[v],...E}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:d,y:u}=_m(c,f,l)),m=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:p}};async function za(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=Kr(t,e),g=Em(p),v=s[f?u==="floating"?"reference":"floating":u],b=cs(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(v)))==null||r?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),x=u==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),E=await(a.isElement==null?void 0:a.isElement(O))?await(a.getScale==null?void 0:a.getScale(O))||{x:1,y:1}:{x:1,y:1},S=cs(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:O,strategy:l}):x);return{top:(b.top-S.top+g.top)/E.y,bottom:(S.bottom-b.bottom+g.bottom)/E.y,left:(b.left-S.left+g.left)/E.x,right:(S.right-b.right+g.right)/E.x}}const BM=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=Kr(e,t)||{};if(c==null)return{};const u=Em(d),f={x:r,y:n},p=hu(o),g=fu(p),m=await i.getDimensions(c),v=p==="y",b=v?"top":"left",x=v?"bottom":"right",O=v?"clientHeight":"clientWidth",E=a.reference[g]+a.reference[p]-f[p]-a.floating[g],S=f[p]-a.reference[p],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let _=C?C[O]:0;(!_||!await(i.isElement==null?void 0:i.isElement(C)))&&(_=s.floating[O]||a.floating[g]);const M=E/2-S/2,A=_/2-m[g]/2-1,D=wn(u[b],A),I=wn(u[x],A),k=D,H=_-m[g]-I,j=_/2-m[g]/2+M,L=uu(k,j,H),N=!l.arrow&&ko(o)!=null&&j!==L&&a.reference[g]/2-(j<k?D:I)-m[g]/2<0,T=N?j<k?j-k:j-H:0;return{[p]:f[p]+T,data:{[p]:L,centerOffset:j-L-T,...N&&{alignmentOffset:T}},reset:N}}}),VM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...v}=Kr(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const b=qr(o),x=Or(s),O=qr(s)===s,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(O||!m?[ls(s)]:$M(s)),C=g!=="none";!f&&C&&S.push(...zM(s,m,g,E));const _=[s,...S],M=await za(t,v),A=[];let D=((n=a.flip)==null?void 0:n.overflows)||[];if(d&&A.push(M[b]),u){const j=IM(o,i,E);A.push(M[j[0]],M[j[1]])}if(D=[...D,{placement:o,overflows:A}],!A.every(j=>j<=0)){var I,k;const j=(((I=a.flip)==null?void 0:I.index)||0)+1,L=_[j];if(L&&(!(u==="alignment"?x!==Or(L):!1)||D.every($=>Or($.placement)===x?$.overflows[0]>0:!0)))return{data:{index:j,overflows:D},reset:{placement:L}};let N=(k=D.filter(T=>T.overflows[0]<=0).sort((T,$)=>T.overflows[1]-$.overflows[1])[0])==null?void 0:k.placement;if(!N)switch(p){case"bestFit":{var H;const T=(H=D.filter($=>{if(C){const W=Or($.placement);return W===x||W==="y"}return!0}).map($=>[$.placement,$.overflows.filter(W=>W>0).reduce((W,U)=>W+U,0)]).sort(($,W)=>$[1]-W[1])[0])==null?void 0:H[0];T&&(N=T);break}case"initialPlacement":N=s;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function Pm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Mm(e){return NM.some(t=>e[t]>=0)}const HM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Kr(e,t);switch(n){case"referenceHidden":{const a=await za(t,{...o,elementContext:"reference"}),i=Pm(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Mm(i)}}}case"escaped":{const a=await za(t,{...o,altBoundary:!0}),i=Pm(a,r.floating);return{data:{escapedOffsets:i,escaped:Mm(i)}}}default:return{}}}}},km=new Set(["left","top"]);async function UM(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=qr(r),s=ko(r),l=Or(r)==="y",c=km.has(i)?-1:1,d=a&&l?-1:1,u=Kr(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof g=="number"&&(p=s==="end"?g*-1:g),l?{x:p*d,y:f*c}:{x:f*c,y:p*d}}const GM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await UM(t,e);return i===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},KM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:v=>{let{x:b,y:x}=v;return{x:b,y:x}}},...l}=Kr(e,t),c={x:r,y:n},d=await za(t,l),u=Or(qr(o)),f=du(u);let p=c[f],g=c[u];if(a){const v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=p+d[v],O=p-d[b];p=uu(x,p,O)}if(i){const v=u==="y"?"top":"left",b=u==="y"?"bottom":"right",x=g+d[v],O=g-d[b];g=uu(x,g,O)}const m=s.fn({...t,[f]:p,[u]:g});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[f]:a,[u]:i}}}}}},qM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Kr(e,t),d={x:r,y:n},u=Or(o),f=du(u);let p=d[f],g=d[u];const m=Kr(s,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const O=f==="y"?"height":"width",E=a.reference[f]-a.floating[O]+v.mainAxis,S=a.reference[f]+a.reference[O]-v.mainAxis;p<E?p=E:p>S&&(p=S)}if(c){var b,x;const O=f==="y"?"width":"height",E=km.has(qr(o)),S=a.reference[u]-a.floating[O]+(E&&((b=i.offset)==null?void 0:b[u])||0)+(E?0:v.crossAxis),C=a.reference[u]+a.reference[O]+(E?0:((x=i.offset)==null?void 0:x[u])||0)-(E?v.crossAxis:0);g<S?g=S:g>C&&(g=C)}return{[f]:p,[u]:g}}}},XM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Kr(e,t),d=await za(t,c),u=qr(o),f=ko(o),p=Or(o)==="y",{width:g,height:m}=a.floating;let v,b;u==="top"||u==="bottom"?(v=u,b=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,v=f==="end"?"top":"bottom");const x=m-d.top-d.bottom,O=g-d.left-d.right,E=wn(m-d[v],x),S=wn(g-d[b],O),C=!t.middlewareData.shift;let _=E,M=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(M=O),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(_=x),C&&!f){const D=zt(d.left,0),I=zt(d.right,0),k=zt(d.top,0),H=zt(d.bottom,0);p?M=g-2*(D!==0||I!==0?D+I:zt(d.left,d.right)):_=m-2*(k!==0||H!==0?k+H:zt(d.top,d.bottom))}await l({...t,availableWidth:M,availableHeight:_});const A=await i.getDimensions(s.floating);return g!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}};function us(){return typeof window<"u"}function No(e){return Nm(e)?(e.nodeName||"").toLowerCase():"#document"}function Ft(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cr(e){var t;return(t=(Nm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nm(e){return us()?e instanceof Node||e instanceof Ft(e).Node:!1}function ar(e){return us()?e instanceof Element||e instanceof Ft(e).Element:!1}function Sr(e){return us()?e instanceof HTMLElement||e instanceof Ft(e).HTMLElement:!1}function Am(e){return!us()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ft(e).ShadowRoot}const ZM=new Set(["inline","contents"]);function Fa(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!ZM.has(o)}const QM=new Set(["table","td","th"]);function JM(e){return QM.has(No(e))}const RM=[":popover-open",":modal"];function ds(e){return RM.some(t=>{try{return e.matches(t)}catch{return!1}})}const ek=["transform","translate","scale","rotate","perspective"],tk=["transform","translate","scale","rotate","perspective","filter"],rk=["paint","layout","strict","content"];function mu(e){const t=vu(),r=ar(e)?ir(e):e;return ek.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||tk.some(n=>(r.willChange||"").includes(n))||rk.some(n=>(r.contain||"").includes(n))}function nk(e){let t=xn(e);for(;Sr(t)&&!Ao(t);){if(mu(t))return t;if(ds(t))return null;t=xn(t)}return null}function vu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ok=new Set(["html","body","#document"]);function Ao(e){return ok.has(No(e))}function ir(e){return Ft(e).getComputedStyle(e)}function fs(e){return ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xn(e){if(No(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Am(e)&&e.host||Cr(e);return Am(t)?t.host:t}function Dm(e){const t=xn(e);return Ao(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sr(t)&&Fa(t)?t:Dm(t)}function Wa(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Dm(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=Ft(o);if(a){const s=gu(i);return t.concat(i,i.visualViewport||[],Fa(o)?o:[],s&&r?Wa(s):[])}return t.concat(o,Wa(o,[],r))}function gu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tm(e){const t=ir(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Sr(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=is(r)!==a||is(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function yu(e){return ar(e)?e:e.contextElement}function Do(e){const t=yu(e);if(!Sr(t))return xr(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=Tm(t);let i=(a?is(r.width):r.width)/n,s=(a?is(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const ak=xr(0);function Im(e){const t=Ft(e);return!vu()||!t.visualViewport?ak:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ik(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ft(e)?!1:t}function Bn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=yu(e);let i=xr(1);t&&(n?ar(n)&&(i=Do(n)):i=Do(e));const s=ik(a,r,n)?Im(a):xr(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(a){const f=Ft(a),p=n&&ar(n)?Ft(n):n;let g=f,m=gu(g);for(;m&&n&&p!==g;){const v=Do(m),b=m.getBoundingClientRect(),x=ir(m),O=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*v.x,E=b.top+(m.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,u*=v.y,l+=O,c+=E,g=Ft(m),m=gu(g)}}return cs({width:d,height:u,x:l,y:c})}function hs(e,t){const r=fs(e).scrollLeft;return t?t.left+r:Bn(Cr(e)).left+r}function $m(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-hs(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function sk(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",i=Cr(n),s=t?ds(t.floating):!1;if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=xr(1);const d=xr(0),u=Sr(n);if((u||!u&&!a)&&((No(n)!=="body"||Fa(i))&&(l=fs(n)),Sr(n))){const p=Bn(n);c=Do(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const f=i&&!u&&!a?$m(i,l):xr(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:r.y*c.y-l.scrollTop*c.y+d.y+f.y}}function lk(e){return Array.from(e.getClientRects())}function ck(e){const t=Cr(e),r=fs(e),n=e.ownerDocument.body,o=zt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=zt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+hs(e);const s=-r.scrollTop;return ir(n).direction==="rtl"&&(i+=zt(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}const jm=25;function uk(e,t){const r=Ft(e),n=Cr(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const d=vu();(!d||d&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}const c=hs(n);if(c<=0){const d=n.ownerDocument,u=d.body,f=getComputedStyle(u),p=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(n.clientWidth-u.clientWidth-p);g<=jm&&(a-=g)}else c<=jm&&(a+=c);return{width:a,height:i,x:s,y:l}}const dk=new Set(["absolute","fixed"]);function fk(e,t){const r=Bn(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Sr(e)?Do(e):xr(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,l=o*a.x,c=n*a.y;return{width:i,height:s,x:l,y:c}}function Lm(e,t,r){let n;if(t==="viewport")n=uk(e,r);else if(t==="document")n=ck(Cr(e));else if(ar(t))n=fk(t,r);else{const o=Im(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return cs(n)}function Ym(e,t){const r=xn(e);return r===t||!ar(r)||Ao(r)?!1:ir(r).position==="fixed"||Ym(r,t)}function hk(e,t){const r=t.get(e);if(r)return r;let n=Wa(e,[],!1).filter(s=>ar(s)&&No(s)!=="body"),o=null;const a=ir(e).position==="fixed";let i=a?xn(e):e;for(;ar(i)&&!Ao(i);){const s=ir(i),l=mu(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&dk.has(o.position)||Fa(i)&&!l&&Ym(e,i))?n=n.filter(d=>d!==i):o=s,i=xn(i)}return t.set(e,n),n}function pk(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?ds(t)?[]:hk(t,this._c):[].concat(r),n],s=i[0],l=i.reduce((c,d)=>{const u=Lm(t,d,o);return c.top=zt(u.top,c.top),c.right=wn(u.right,c.right),c.bottom=wn(u.bottom,c.bottom),c.left=zt(u.left,c.left),c},Lm(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function mk(e){const{width:t,height:r}=Tm(e);return{width:t,height:r}}function vk(e,t,r){const n=Sr(t),o=Cr(t),a=r==="fixed",i=Bn(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=xr(0);function c(){l.x=hs(o)}if(n||!n&&!a)if((No(t)!=="body"||Fa(o))&&(s=fs(t)),n){const p=Bn(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();a&&!n&&o&&c();const d=o&&!n&&!a?$m(o,s):xr(0),u=i.left+s.scrollLeft-l.x-d.x,f=i.top+s.scrollTop-l.y-d.y;return{x:u,y:f,width:i.width,height:i.height}}function bu(e){return ir(e).position==="static"}function zm(e,t){if(!Sr(e)||ir(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Cr(e)===r&&(r=r.ownerDocument.body),r}function Fm(e,t){const r=Ft(e);if(ds(e))return r;if(!Sr(e)){let o=xn(e);for(;o&&!Ao(o);){if(ar(o)&&!bu(o))return o;o=xn(o)}return r}let n=zm(e,t);for(;n&&JM(n)&&bu(n);)n=zm(n,t);return n&&Ao(n)&&bu(n)&&!mu(n)?r:n||nk(e)||r}const gk=async function(e){const t=this.getOffsetParent||Fm,r=this.getDimensions,n=await r(e.floating);return{reference:vk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function yk(e){return ir(e).direction==="rtl"}const bk={convertOffsetParentRelativeRectToViewportRelativeRect:sk,getDocumentElement:Cr,getClippingRect:pk,getOffsetParent:Fm,getElementRects:gk,getClientRects:lk,getDimensions:mk,getScale:Do,isElement:ar,isRTL:yk};function Wm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wk(e,t){let r=null,n;const o=Cr(e);function a(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:p}=c;if(s||t(),!f||!p)return;const g=ss(u),m=ss(o.clientWidth-(d+f)),v=ss(o.clientHeight-(u+p)),b=ss(d),O={rootMargin:-g+"px "+-m+"px "+-v+"px "+-b+"px",threshold:zt(0,wn(1,l))||1};let E=!0;function S(C){const _=C[0].intersectionRatio;if(_!==l){if(!E)return i();_?i(!1,_):n=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!Wm(c,e.getBoundingClientRect())&&i(),E=!1}try{r=new IntersectionObserver(S,{...O,root:o.ownerDocument})}catch{r=new IntersectionObserver(S,O)}r.observe(e)}return i(!0),a}function xk(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=yu(e),d=o||a?[...c?Wa(c):[],...Wa(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),a&&b.addEventListener("resize",r)});const u=c&&s?wk(c,r):null;let f=-1,p=null;i&&(p=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var O;(O=p)==null||O.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let g,m=l?Bn(e):null;l&&v();function v(){const b=Bn(e);m&&!Wm(m,b)&&r(),m=b,g=requestAnimationFrame(v)}return r(),()=>{var b;d.forEach(x=>{o&&x.removeEventListener("scroll",r),a&&x.removeEventListener("resize",r)}),u==null||u(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const Ok=GM,Ck=KM,Sk=VM,Ek=XM,_k=HM,Bm=BM,Pk=qM,Mk=(e,t,r)=>{const n=new Map,o={platform:bk,...r},a={...o.platform,_c:n};return WM(e,t,{...o,platform:a})};var kk=typeof document<"u",Nk=function(){},ps=kk?y.useLayoutEffect:Nk;function ms(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!ms(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!ms(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Vm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hm(e,t){const r=Vm(e);return Math.round(t*r)/r}function wu(e){const t=w.useRef(e);return ps(()=>{t.current=e}),t}function Ak(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[d,u]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(n);ms(f,n)||p(n);const[g,m]=w.useState(null),[v,b]=w.useState(null),x=w.useCallback($=>{$!==C.current&&(C.current=$,m($))},[]),O=w.useCallback($=>{$!==_.current&&(_.current=$,b($))},[]),E=a||g,S=i||v,C=w.useRef(null),_=w.useRef(null),M=w.useRef(d),A=l!=null,D=wu(l),I=wu(o),k=wu(c),H=w.useCallback(()=>{if(!C.current||!_.current)return;const $={placement:t,strategy:r,middleware:f};I.current&&($.platform=I.current),Mk(C.current,_.current,$).then(W=>{const U={...W,isPositioned:k.current!==!1};j.current&&!ms(M.current,U)&&(M.current=U,Tp.flushSync(()=>{u(U)}))})},[f,t,r,I,k]);ps(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,u($=>({...$,isPositioned:!1})))},[c]);const j=w.useRef(!1);ps(()=>(j.current=!0,()=>{j.current=!1}),[]),ps(()=>{if(E&&(C.current=E),S&&(_.current=S),E&&S){if(D.current)return D.current(E,S,H);H()}},[E,S,H,D,A]);const L=w.useMemo(()=>({reference:C,floating:_,setReference:x,setFloating:O}),[x,O]),N=w.useMemo(()=>({reference:E,floating:S}),[E,S]),T=w.useMemo(()=>{const $={position:r,left:0,top:0};if(!N.floating)return $;const W=Hm(N.floating,d.x),U=Hm(N.floating,d.y);return s?{...$,transform:"translate("+W+"px, "+U+"px)",...Vm(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:W,top:U}},[r,s,N.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:H,refs:L,elements:N,floatingStyles:T}),[d,H,L,N,T])}const Dk=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Bm({element:n.current,padding:o}).fn(r):{}:n?Bm({element:n,padding:o}).fn(r):{}}}},Tk=(e,t)=>({...Ok(e),options:[e,t]}),Ik=(e,t)=>({...Ck(e),options:[e,t]}),$k=(e,t)=>({...Pk(e),options:[e,t]}),jk=(e,t)=>({...Sk(e),options:[e,t]}),Lk=(e,t)=>({...Ek(e),options:[e,t]}),Yk=(e,t)=>({..._k(e),options:[e,t]}),zk=(e,t)=>({...Dk(e),options:[e,t]});var Fk="Arrow",Um=w.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return h.jsx(xe.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});Um.displayName=Fk;var Wk=Um;function vs(e){const[t,r]=w.useState(void 0);return Ur(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,s;if("borderBoxSize"in a){const l=a.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,s=c.blockSize}else i=e.offsetWidth,s=e.offsetHeight;r({width:i,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var xu="Popper",[Gm,gs]=At(xu),[Bk,Km]=Gm(xu),qm=e=>{const{__scopePopper:t,children:r}=e,[n,o]=w.useState(null);return h.jsx(Bk,{scope:t,anchor:n,onAnchorChange:o,children:r})};qm.displayName=xu;var Xm="PopperAnchor",Zm=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=Km(Xm,r),i=w.useRef(null),s=We(t,i),l=w.useRef(null);return w.useEffect(()=>{const c=l.current;l.current=(n==null?void 0:n.current)||i.current,c!==l.current&&a.onAnchorChange(l.current)}),n?null:h.jsx(xe.div,{...o,ref:s})});Zm.displayName=Xm;var Ou="PopperContent",[Vk,Hk]=Gm(Ou),Qm=w.forwardRef((e,t)=>{var me,le,V,K,G,F;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:g,...m}=e,v=Km(Ou,r),[b,x]=w.useState(null),O=We(t,ee=>x(ee)),[E,S]=w.useState(null),C=vs(E),_=(C==null?void 0:C.width)??0,M=(C==null?void 0:C.height)??0,A=n+(a!=="center"?"-"+a:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(c)?c:[c],k=I.length>0,H={padding:D,boundary:I.filter(Gk),altBoundary:k},{refs:j,floatingStyles:L,placement:N,isPositioned:T,middlewareData:$}=Ak({strategy:"fixed",placement:A,whileElementsMounted:(...ee)=>xk(...ee,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Tk({mainAxis:o+M,alignmentAxis:i}),l&&Ik({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?$k():void 0,...H}),l&&jk({...H}),Lk({...H,apply:({elements:ee,rects:q,availableWidth:X,availableHeight:ce})=>{const{width:Y,height:Q}=q.reference,ae=ee.floating.style;ae.setProperty("--radix-popper-available-width",`${X}px`),ae.setProperty("--radix-popper-available-height",`${ce}px`),ae.setProperty("--radix-popper-anchor-width",`${Y}px`),ae.setProperty("--radix-popper-anchor-height",`${Q}px`)}}),E&&zk({element:E,padding:s}),Kk({arrowWidth:_,arrowHeight:M}),f&&Yk({strategy:"referenceHidden",...H})]}),[W,U]=ev(N),J=Wn(g);Ur(()=>{T&&(J==null||J())},[T,J]);const re=(me=$.arrow)==null?void 0:me.x,R=(le=$.arrow)==null?void 0:le.y,te=((V=$.arrow)==null?void 0:V.centerOffset)!==0,[ne,oe]=w.useState();return Ur(()=>{b&&oe(window.getComputedStyle(b).zIndex)},[b]),h.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:T?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(K=$.transformOrigin)==null?void 0:K.x,(G=$.transformOrigin)==null?void 0:G.y].join(" "),...((F=$.hide)==null?void 0:F.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(Vk,{scope:r,placedSide:W,onArrowChange:S,arrowX:re,arrowY:R,shouldHideArrow:te,children:h.jsx(xe.div,{"data-side":W,"data-align":U,...m,ref:O,style:{...m.style,animation:T?void 0:"none"}})})})});Qm.displayName=Ou;var Jm="PopperArrow",Uk={top:"bottom",right:"left",bottom:"top",left:"right"},Rm=w.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=Hk(Jm,n),i=Uk[a.placedSide];return h.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:h.jsx(Wk,{...o,ref:r,style:{...o.style,display:"block"}})})});Rm.displayName=Jm;function Gk(e){return e!==null}var Kk=e=>({name:"transformOrigin",options:e,fn(t){var v,b,x;const{placement:r,rects:n,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=ev(r),u={start:"0%",center:"50%",end:"100%"}[d],f=(((b=o.arrow)==null?void 0:b.x)??0)+s/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let g="",m="";return c==="bottom"?(g=i?u:`${f}px`,m=`${-l}px`):c==="top"?(g=i?u:`${f}px`,m=`${n.floating.height+l}px`):c==="right"?(g=`${-l}px`,m=i?u:`${p}px`):c==="left"&&(g=`${n.floating.width+l}px`,m=i?u:`${p}px`),{data:{x:g,y:m}}}});function ev(e){const[t,r="center"]=e.split("-");return[t,r]}var tv=qm,Cu=Zm,rv=Qm,nv=Rm,qk="Portal",ys=w.forwardRef((e,t)=>{var s;const{container:r,...n}=e,[o,a]=w.useState(!1);Ur(()=>a(!0),[]);const i=r||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return i?Ta.createPortal(h.jsx(xe.div,{...n,ref:t}),i):null});ys.displayName=qk;function Xk(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var Xt=e=>{const{present:t,children:r}=e,n=Zk(t),o=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),a=We(n.ref,Qk(o));return typeof r=="function"||n.isPresent?w.cloneElement(o,{ref:a}):null};Xt.displayName="Presence";function Zk(e){const[t,r]=w.useState(),n=w.useRef(null),o=w.useRef(e),a=w.useRef("none"),i=e?"mounted":"unmounted",[s,l]=Xk(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=bs(n.current);a.current=s==="mounted"?c:"none"},[s]),Ur(()=>{const c=n.current,d=o.current;if(d!==e){const f=a.current,p=bs(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ur(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=p=>{const m=bs(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=p=>{p.target===t&&(a.current=bs(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function bs(e){return(e==null?void 0:e.animationName)||"none"}function Qk(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Jk=w[" useInsertionEffect ".trim().toString()]||Ur;function Dt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,i]=Rk({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:o;{const d=w.useRef(e!==void 0);w.useEffect(()=>{const u=d.current;u!==s&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,n])}const c=w.useCallback(d=>{var u;if(s){const f=eN(d)?d(e):d;f!==e&&((u=i.current)==null||u.call(i,f))}else a(d)},[s,e,a,i]);return[l,c]}function Rk({defaultProp:e,onChange:t}){const[r,n]=w.useState(e),o=w.useRef(r),a=w.useRef(t);return Jk(()=>{a.current=t},[t]),w.useEffect(()=>{var i;o.current!==r&&((i=a.current)==null||i.call(a,r),o.current=r)},[r,o]),[r,n,a]}function eN(e){return typeof e=="function"}var tN=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},To=new WeakMap,ws=new WeakMap,xs={},Su=0,ov=function(e){return e&&(e.host||ov(e.parentNode))},rN=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=ov(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},nN=function(e,t,r,n){var o=rN(t,Array.isArray(e)?e:[e]);xs[r]||(xs[r]=new WeakMap);var a=xs[r],i=[],s=new Set,l=new Set(o),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};o.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(f){if(s.has(f))d(f);else try{var p=f.getAttribute(n),g=p!==null&&p!=="false",m=(To.get(f)||0)+1,v=(a.get(f)||0)+1;To.set(f,m),a.set(f,v),i.push(f),m===1&&g&&ws.set(f,!0),v===1&&f.setAttribute(r,"true"),g||f.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),s.clear(),Su++,function(){i.forEach(function(u){var f=To.get(u)-1,p=a.get(u)-1;To.set(u,f),a.set(u,p),f||(ws.has(u)||u.removeAttribute(n),ws.delete(u)),p||u.removeAttribute(r)}),Su--,Su||(To=new WeakMap,To=new WeakMap,ws=new WeakMap,xs={})}},av=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=tN(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),nN(n,o,r,"aria-hidden")):function(){return null}},Er=function(){return Er=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Er.apply(this,arguments)};function iv(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function oN(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Os="right-scroll-bar-position",Cs="width-before-scroll-bar",aN="with-scroll-bars-hidden",iN="--removed-body-scroll-bar-size";function Eu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function sN(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var lN=typeof window<"u"?w.useLayoutEffect:w.useEffect,sv=new WeakMap;function cN(e,t){var r=sN(null,function(n){return e.forEach(function(o){return Eu(o,n)})});return lN(function(){var n=sv.get(r);if(n){var o=new Set(n),a=new Set(e),i=r.current;o.forEach(function(s){a.has(s)||Eu(s,null)}),a.forEach(function(s){o.has(s)||Eu(s,i)})}sv.set(r,e)},[e]),r}function uN(e){return e}function dN(e,t){t===void 0&&(t=uN);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,n);return r.push(i),function(){r=r.filter(function(s){return s!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(s){return a(s)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var s=r;r=[],s.forEach(a),i=r}var l=function(){var d=i;i=[],d.forEach(a)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){i.push(d),c()},filter:function(d){return i=i.filter(d),r}}}};return o}function fN(e){e===void 0&&(e={});var t=dN(null);return t.options=Er({async:!0,ssr:!1},e),t}var lv=function(e){var t=e.sideCar,r=iv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return w.createElement(n,Er({},r))};lv.isSideCarExport=!0;function hN(e,t){return e.useMedium(t),lv}var cv=fN(),_u=function(){},Ss=w.forwardRef(function(e,t){var r=w.useRef(null),n=w.useState({onScrollCapture:_u,onWheelCapture:_u,onTouchMoveCapture:_u}),o=n[0],a=n[1],i=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,u=e.shards,f=e.sideCar,p=e.noRelative,g=e.noIsolation,m=e.inert,v=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,O=e.gapMode,E=iv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,C=cN([r,t]),_=Er(Er({},E),o);return w.createElement(w.Fragment,null,d&&w.createElement(S,{sideCar:cv,removeScrollBar:c,shards:u,noRelative:p,noIsolation:g,inert:m,setCallbacks:a,allowPinchZoom:!!v,lockRef:r,gapMode:O}),i?w.cloneElement(w.Children.only(s),Er(Er({},_),{ref:C})):w.createElement(x,Er({},_,{className:l,ref:C}),s))});Ss.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ss.classNames={fullWidth:Cs,zeroRight:Os};var pN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pN();return t&&e.setAttribute("nonce",t),e}function vN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gN(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yN=function(){var e=0,t=null;return{add:function(r){e==0&&(t=mN())&&(vN(t,r),gN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bN=function(){var e=yN();return function(t,r){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},uv=function(){var e=bN(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},wN={left:0,top:0,right:0,gap:0},Pu=function(e){return parseInt(e||"",10)||0},xN=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Pu(r),Pu(n),Pu(o)]},ON=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wN;var t=xN(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},CN=uv(),Io="data-scroll-locked",SN=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,s=e.gap;return r===void 0&&(r="margin"),`