@univerjs/design 0.10.14 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +134 -130
- package/lib/index.js +134 -130
- package/lib/types/components/confirm/Confirm.d.ts +5 -0
- package/lib/umd/index.js +2 -2
- package/package.json +4 -4
|
@@ -30,5 +30,10 @@ export interface IConfirmProps {
|
|
|
30
30
|
* The width of the Confirm.
|
|
31
31
|
*/
|
|
32
32
|
width?: number | string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to show the close button.
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
closable?: boolean;
|
|
33
38
|
}
|
|
34
39
|
export declare function Confirm(props: IConfirmProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/umd/index.js
CHANGED
|
@@ -118,7 +118,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
118
118
|
hsl(180, 100%, 50%),
|
|
119
119
|
hsl(240, 100%, 50%),
|
|
120
120
|
hsl(300, 100%, 50%),
|
|
121
|
-
hsl(360, 100%, 50%))`},onPointerDown:y=>{i(!0),u(y.clientX)},children:S.jsx("div",{ref:a,className:"univer-absolute univer-top-1/2 univer-box-border univer-size-2 univer-rounded-full univer-bg-transparent univer-shadow-md univer-ring-2 univer-ring-white univer-transition-transform univer-duration-75 univer-will-change-transform",style:{left:l(),transform:"translateY(-50%)",transition:n?"none":"all 0.1s ease-out"}})})})}const Rg=P.memo(Ig),Lg=P.memo(Ag),$g=P.memo(Og),zg=P.memo(Tg);function Fg({format:e="hex",value:t="#000000",onChange:r}){if(!$o)return null;const{locale:n}=P.useContext(rr),[i,o]=P.useState([0,100,100]),[a,s]=P.useState(!1),u=P.useCallback((y,h,g)=>Qo(y,h,g),[]);P.useEffect(()=>{try{if(e==="hex"){const[y,h,g]=t?_a(t):i;o([y,h,g])}}catch(y){console.error("Invalid value:",y)}},[t]);function c(y,h,g){o([y,h,g])}function f(y,h,g){const[w,d,v]=u(y,h,g);if(e==="hex"){const p=Vu(w,d,v);r==null||r(p)}}function l(){const[y,h,g]=i,w=Jo(y,h,g);r==null||r(w),s(!1)}return S.jsxs("div",{"data-u-comp":"color-picker",className:"univer-cursor-default univer-space-y-2 univer-rounded-lg univer-bg-white dark:!univer-bg-gray-700",onClick:y=>y.stopPropagation(),children:[S.jsx(zg,{hsv:i,onChange:(y,h,g)=>{c(y,h,g),f(y,h,g)}}),S.jsx("div",{className:"univer-flex univer-h-7 univer-items-center",children:S.jsx("a",{className:"univer-cursor-pointer univer-gap-2 univer-text-sm univer-text-gray-900 univer-transition-opacity hover:univer-opacity-80 dark:!univer-text-white",onClick:()=>s(!0),children:n==null?void 0:n.ColorPicker.more})}),S.jsx(Da,{className:"!univer-w-fit !univer-p-2.5",closable:!1,maskClosable:!1,open:a,onOpenChange:s,children:S.jsxs("div",{className:"univer-grid univer-w-64 univer-gap-2",children:[S.jsx(Rg,{hsv:i,onChange:c}),S.jsxs("div",{className:"univer-flex univer-items-center univer-gap-2",children:[S.jsx("div",{className:"univer-size-6 univer-flex-shrink-0 univer-rounded-sm",style:{backgroundColor:Jo(...i)}}),S.jsx(Lg,{hsv:i,onChange:c})]}),S.jsx($g,{hsv:i,onChange:c}),S.jsxs("footer",{className:"univer-flex univer-items-center univer-justify-end univer-gap-2",children:[S.jsx(_r,{onClick:()=>s(!1),children:n==null?void 0:n.ColorPicker.cancel}),S.jsx(_r,{variant:"primary",onClick:l,children:n==null?void 0:n.ColorPicker.confirm})]})]})})]})}function Hg(e){const{locale:t,cancelText:r,confirmText:n,onClose:i,onConfirm:o}=e;return S.jsxs("footer",{className:"univer-flex univer-items-center univer-justify-end univer-gap-2",children:[S.jsx(_r,{onClick:i,children:r!=null?r:t==null?void 0:t.Confirm.cancel}),S.jsx(_r,{variant:"primary",onClick:o,children:n!=null?n:t==null?void 0:t.Confirm.confirm})]})}function Wg(e){const{children:t,visible:r=!1,title:n,cancelText:i,confirmText:o,width:a,onClose:s,onConfirm:u}=e,{locale:c}=P.useContext(rr);return S.jsx(Da,{open:r,title:n,maskClosable:!1,footer:S.jsx(Hg,{locale:c,cancelText:i,confirmText:o,onClose:s,onConfirm:u}),onClose:s,width:a,children:t})}const Bg=["top","right","bottom","left"],Ar=Math.min,Tt=Math.max,ei=Math.round,ti=Math.floor,ir=e=>({x:e,y:e}),jg={left:"right",right:"left",bottom:"top",top:"bottom"},Vg={start:"end",end:"start"};function Oa(e,t,r){return Tt(e,Ar(t,r))}function yr(e,t){return typeof e=="function"?e(t):e}function br(e){return e.split("-")[0]}function bn(e){return e.split("-")[1]}function ka(e){return e==="x"?"y":"x"}function Ta(e){return e==="y"?"height":"width"}const qg=new Set(["top","bottom"]);function ar(e){return qg.has(br(e))?"y":"x"}function Ia(e){return ka(ar(e))}function Gg(e,t,r){r===void 0&&(r=!1);const n=bn(e),i=Ia(e),o=Ta(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=ri(a)),[a,ri(a)]}function Ug(e){const t=ri(e);return[Aa(e),t,Aa(t)]}function Aa(e){return e.replace(/start|end/g,t=>Vg[t])}const Gu=["left","right"],Uu=["right","left"],Kg=["top","bottom"],Yg=["bottom","top"];function Xg(e,t,r){switch(e){case"top":case"bottom":return r?t?Uu:Gu:t?Gu:Uu;case"left":case"right":return t?Kg:Yg;default:return[]}}function Zg(e,t,r,n){const i=bn(e);let o=Xg(br(e),r==="start",n);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Aa)))),o}function ri(e){return e.replace(/left|right|bottom|top/g,t=>jg[t])}function Qg(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ku(e){return typeof e!="number"?Qg(e):{top:e,right:e,bottom:e,left:e}}function ni(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function Yu(e,t,r){let{reference:n,floating:i}=e;const o=ar(t),a=Ia(t),s=Ta(a),u=br(t),c=o==="y",f=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2,y=n[s]/2-i[s]/2;let h;switch(u){case"top":h={x:f,y:n.y-i.height};break;case"bottom":h={x:f,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:l};break;case"left":h={x:n.x-i.width,y:l};break;default:h={x:n.x,y:n.y}}switch(bn(t)){case"start":h[a]-=y*(r&&c?-1:1);break;case"end":h[a]+=y*(r&&c?-1:1);break}return h}const Jg=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:l}=Yu(c,n,u),y=n,h={},g=0;for(let w=0;w<s.length;w++){const{name:d,fn:v}=s[w],{x:p,y:b,data:x,reset:C}=await v({x:f,y:l,initialPlacement:n,placement:y,strategy:i,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});f=p!=null?p:f,l=b!=null?b:l,h={...h,[d]:{...h[d],...x}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(y=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:f,y:l}=Yu(c,y,u)),w=-1)}return{x:f,y:l,placement:y,strategy:i,middlewareData:h}};async function Un(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:l="floating",altBoundary:y=!1,padding:h=0}=yr(t,e),g=Ku(h),d=s[y?l==="floating"?"reference":"floating":l],v=ni(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(d)))==null||r?d:d.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:u})),p=l==="floating"?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),x=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},C=ni(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:p,offsetParent:b,strategy:u}):p);return{top:(v.top-C.top+g.top)/x.y,bottom:(C.bottom-v.bottom+g.bottom)/x.y,left:(v.left-C.left+g.left)/x.x,right:(C.right-v.right+g.right)/x.x}}const e0=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s,middlewareData:u}=t,{element:c,padding:f=0}=yr(e,t)||{};if(c==null)return{};const l=Ku(f),y={x:r,y:n},h=Ia(i),g=Ta(h),w=await a.getDimensions(c),d=h==="y",v=d?"top":"left",p=d?"bottom":"right",b=d?"clientHeight":"clientWidth",x=o.reference[g]+o.reference[h]-y[h]-o.floating[g],C=y[h]-o.reference[h],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let M=E?E[b]:0;(!M||!await(a.isElement==null?void 0:a.isElement(E)))&&(M=s.floating[b]||o.floating[g]);const N=x/2-C/2,k=M/2-w[g]/2-1,D=Ar(l[v],k),I=Ar(l[p],k),R=D,W=M-w[g]-I,L=M/2-w[g]/2+N,$=Oa(R,L,W),_=!u.arrow&&bn(i)!=null&&L!==$&&o.reference[g]/2-(L<R?D:I)-w[g]/2<0,z=_?L<R?L-R:L-W:0;return{[h]:y[h]+z,data:{[h]:$,centerOffset:L-$-z,..._&&{alignmentOffset:z}},reset:_}}}),t0=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:l=!0,fallbackPlacements:y,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...d}=yr(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const v=br(i),p=ar(s),b=br(s)===s,x=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=y||(b||!w?[ri(s)]:Ug(s)),E=g!=="none";!y&&E&&C.push(...Zg(s,w,g,x));const M=[s,...C],N=await Un(t,d),k=[];let D=((n=o.flip)==null?void 0:n.overflows)||[];if(f&&k.push(N[v]),l){const L=Gg(i,a,x);k.push(N[L[0]],N[L[1]])}if(D=[...D,{placement:i,overflows:k}],!k.every(L=>L<=0)){var I,R;const L=(((I=o.flip)==null?void 0:I.index)||0)+1,$=M[L];if($&&(!(l==="alignment"?p!==ar($):!1)||D.every(A=>ar(A.placement)===p?A.overflows[0]>0:!0)))return{data:{index:L,overflows:D},reset:{placement:$}};let _=(R=D.filter(z=>z.overflows[0]<=0).sort((z,A)=>z.overflows[1]-A.overflows[1])[0])==null?void 0:R.placement;if(!_)switch(h){case"bestFit":{var W;const z=(W=D.filter(A=>{if(E){const F=ar(A.placement);return F===p||F==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(F=>F>0).reduce((F,j)=>F+j,0)]).sort((A,F)=>A[1]-F[1])[0])==null?void 0:W[0];z&&(_=z);break}case"initialPlacement":_=s;break}if(i!==_)return{reset:{placement:_}}}return{}}}};function Xu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zu(e){return Bg.some(t=>e[t]>=0)}const r0=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=yr(e,t);switch(n){case"referenceHidden":{const o=await Un(t,{...i,elementContext:"reference"}),a=Xu(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Zu(a)}}}case"escaped":{const o=await Un(t,{...i,altBoundary:!0}),a=Xu(o,r.floating);return{data:{escapedOffsets:a,escaped:Zu(a)}}}default:return{}}}}},Qu=new Set(["left","top"]);async function n0(e,t){const{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=br(r),s=bn(r),u=ar(r)==="y",c=Qu.has(a)?-1:1,f=o&&u?-1:1,l=yr(t,e);let{mainAxis:y,crossAxis:h,alignmentAxis:g}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return s&&typeof g=="number"&&(h=s==="end"?g*-1:g),u?{x:h*f,y:y*c}:{x:y*c,y:h*f}}const o0=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:a,middlewareData:s}=t,u=await n0(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},i0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:d=>{let{x:v,y:p}=d;return{x:v,y:p}}},...u}=yr(e,t),c={x:r,y:n},f=await Un(t,u),l=ar(br(i)),y=ka(l);let h=c[y],g=c[l];if(o){const d=y==="y"?"top":"left",v=y==="y"?"bottom":"right",p=h+f[d],b=h-f[v];h=Oa(p,h,b)}if(a){const d=l==="y"?"top":"left",v=l==="y"?"bottom":"right",p=g+f[d],b=g-f[v];g=Oa(p,g,b)}const w=s.fn({...t,[y]:h,[l]:g});return{...w,data:{x:w.x-r,y:w.y-n,enabled:{[y]:o,[l]:a}}}}}},a0=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=yr(e,t),f={x:r,y:n},l=ar(i),y=ka(l);let h=f[y],g=f[l];const w=yr(s,t),d=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const b=y==="y"?"height":"width",x=o.reference[y]-o.floating[b]+d.mainAxis,C=o.reference[y]+o.reference[b]-d.mainAxis;h<x?h=x:h>C&&(h=C)}if(c){var v,p;const b=y==="y"?"width":"height",x=Qu.has(br(i)),C=o.reference[l]-o.floating[b]+(x&&((v=a.offset)==null?void 0:v[l])||0)+(x?0:d.crossAxis),E=o.reference[l]+o.reference[b]+(x?0:((p=a.offset)==null?void 0:p[l])||0)-(x?d.crossAxis:0);g<C?g=C:g>E&&(g=E)}return{[y]:h,[l]:g}}}},s0=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:u=()=>{},...c}=yr(e,t),f=await Un(t,c),l=br(i),y=bn(i),h=ar(i)==="y",{width:g,height:w}=o.floating;let d,v;l==="top"||l==="bottom"?(d=l,v=y===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=l,d=y==="end"?"top":"bottom");const p=w-f.top-f.bottom,b=g-f.left-f.right,x=Ar(w-f[d],p),C=Ar(g-f[v],b),E=!t.middlewareData.shift;let M=x,N=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(N=b),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(M=p),E&&!y){const D=Tt(f.left,0),I=Tt(f.right,0),R=Tt(f.top,0),W=Tt(f.bottom,0);h?N=g-2*(D!==0||I!==0?D+I:Tt(f.left,f.right)):M=w-2*(R!==0||W!==0?R+W:Tt(f.top,f.bottom))}await u({...t,availableWidth:N,availableHeight:M});const k=await a.getDimensions(s.floating);return g!==k.width||w!==k.height?{reset:{rects:!0}}:{}}}};function oi(){return typeof window<"u"}function wn(e){return Ju(e)?(e.nodeName||"").toLowerCase():"#document"}function It(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sr(e){var t;return(t=(Ju(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ju(e){return oi()?e instanceof Node||e instanceof It(e).Node:!1}function qt(e){return oi()?e instanceof Element||e instanceof It(e).Element:!1}function lr(e){return oi()?e instanceof HTMLElement||e instanceof It(e).HTMLElement:!1}function ec(e){return!oi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof It(e).ShadowRoot}const l0=new Set(["inline","contents"]);function Kn(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Gt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!l0.has(i)}const u0=new Set(["table","td","th"]);function c0(e){return u0.has(wn(e))}const d0=[":popover-open",":modal"];function ii(e){return d0.some(t=>{try{return e.matches(t)}catch{return!1}})}const f0=["transform","translate","scale","rotate","perspective"],v0=["transform","translate","scale","rotate","perspective","filter"],p0=["paint","layout","strict","content"];function Ra(e){const t=La(),r=qt(e)?Gt(e):e;return f0.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)||v0.some(n=>(r.willChange||"").includes(n))||p0.some(n=>(r.contain||"").includes(n))}function h0(e){let t=Rr(e);for(;lr(t)&&!Cn(t);){if(Ra(t))return t;if(ii(t))return null;t=Rr(t)}return null}function La(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const m0=new Set(["html","body","#document"]);function Cn(e){return m0.has(wn(e))}function Gt(e){return It(e).getComputedStyle(e)}function ai(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rr(e){if(wn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ec(e)&&e.host||sr(e);return ec(t)?t.host:t}function tc(e){const t=Rr(e);return Cn(t)?e.ownerDocument?e.ownerDocument.body:e.body:lr(t)&&Kn(t)?t:tc(t)}function Yn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=tc(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),a=It(i);if(o){const s=$a(a);return t.concat(a,a.visualViewport||[],Kn(i)?i:[],s&&r?Yn(s):[])}return t.concat(i,Yn(i,[],r))}function $a(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rc(e){const t=Gt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=lr(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=ei(r)!==o||ei(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function za(e){return qt(e)?e:e.contextElement}function xn(e){const t=za(e);if(!lr(t))return ir(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=rc(t);let a=(o?ei(r.width):r.width)/n,s=(o?ei(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const g0=ir(0);function nc(e){const t=It(e);return!La()||!t.visualViewport?g0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function y0(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==It(e)?!1:t}function Jr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=za(e);let a=ir(1);t&&(n?qt(n)&&(a=xn(n)):a=xn(e));const s=y0(o,r,n)?nc(o):ir(0);let u=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,l=i.height/a.y;if(o){const y=It(o),h=n&&qt(n)?It(n):n;let g=y,w=$a(g);for(;w&&n&&h!==g;){const d=xn(w),v=w.getBoundingClientRect(),p=Gt(w),b=v.left+(w.clientLeft+parseFloat(p.paddingLeft))*d.x,x=v.top+(w.clientTop+parseFloat(p.paddingTop))*d.y;u*=d.x,c*=d.y,f*=d.x,l*=d.y,u+=b,c+=x,g=It(w),w=$a(g)}}return ni({width:f,height:l,x:u,y:c})}function si(e,t){const r=ai(e).scrollLeft;return t?t.left+r:Jr(sr(e)).left+r}function oc(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-si(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function b0(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o=i==="fixed",a=sr(n),s=t?ii(t.floating):!1;if(n===a||s&&o)return r;let u={scrollLeft:0,scrollTop:0},c=ir(1);const f=ir(0),l=lr(n);if((l||!l&&!o)&&((wn(n)!=="body"||Kn(a))&&(u=ai(n)),lr(n))){const h=Jr(n);c=xn(n),f.x=h.x+n.clientLeft,f.y=h.y+n.clientTop}const y=a&&!l&&!o?oc(a,u):ir(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-u.scrollLeft*c.x+f.x+y.x,y:r.y*c.y-u.scrollTop*c.y+f.y+y.y}}function w0(e){return Array.from(e.getClientRects())}function C0(e){const t=sr(e),r=ai(e),n=e.ownerDocument.body,i=Tt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Tt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+si(e);const s=-r.scrollTop;return Gt(n).direction==="rtl"&&(a+=Tt(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:s}}const ic=25;function x0(e,t){const r=It(e),n=sr(e),i=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const f=La();(!f||f&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}const c=si(n);if(c<=0){const f=n.ownerDocument,l=f.body,y=getComputedStyle(l),h=f.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,g=Math.abs(n.clientWidth-l.clientWidth-h);g<=ic&&(o-=g)}else c<=ic&&(o+=c);return{width:o,height:a,x:s,y:u}}const S0=new Set(["absolute","fixed"]);function E0(e,t){const r=Jr(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=lr(e)?xn(e):ir(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,c=n*o.y;return{width:a,height:s,x:u,y:c}}function ac(e,t,r){let n;if(t==="viewport")n=x0(e,r);else if(t==="document")n=C0(sr(e));else if(qt(t))n=E0(t,r);else{const i=nc(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ni(n)}function sc(e,t){const r=Rr(e);return r===t||!qt(r)||Cn(r)?!1:Gt(r).position==="fixed"||sc(r,t)}function M0(e,t){const r=t.get(e);if(r)return r;let n=Yn(e,[],!1).filter(s=>qt(s)&&wn(s)!=="body"),i=null;const o=Gt(e).position==="fixed";let a=o?Rr(e):e;for(;qt(a)&&!Cn(a);){const s=Gt(a),u=Ra(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&!!i&&S0.has(i.position)||Kn(a)&&!u&&sc(e,a))?n=n.filter(f=>f!==a):i=s,a=Rr(a)}return t.set(e,n),n}function P0(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const a=[...r==="clippingAncestors"?ii(t)?[]:M0(t,this._c):[].concat(r),n],s=a[0],u=a.reduce((c,f)=>{const l=ac(t,f,i);return c.top=Tt(l.top,c.top),c.right=Ar(l.right,c.right),c.bottom=Ar(l.bottom,c.bottom),c.left=Tt(l.left,c.left),c},ac(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function N0(e){const{width:t,height:r}=rc(e);return{width:t,height:r}}function D0(e,t,r){const n=lr(t),i=sr(t),o=r==="fixed",a=Jr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const u=ir(0);function c(){u.x=si(i)}if(n||!n&&!o)if((wn(t)!=="body"||Kn(i))&&(s=ai(t)),n){const h=Jr(t,!0,o,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else i&&c();o&&!n&&i&&c();const f=i&&!n&&!o?oc(i,s):ir(0),l=a.left+s.scrollLeft-u.x-f.x,y=a.top+s.scrollTop-u.y-f.y;return{x:l,y,width:a.width,height:a.height}}function Fa(e){return Gt(e).position==="static"}function lc(e,t){if(!lr(e)||Gt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return sr(e)===r&&(r=r.ownerDocument.body),r}function uc(e,t){const r=It(e);if(ii(e))return r;if(!lr(e)){let i=Rr(e);for(;i&&!Cn(i);){if(qt(i)&&!Fa(i))return i;i=Rr(i)}return r}let n=lc(e,t);for(;n&&c0(n)&&Fa(n);)n=lc(n,t);return n&&Cn(n)&&Fa(n)&&!Ra(n)?r:n||h0(e)||r}const _0=async function(e){const t=this.getOffsetParent||uc,r=this.getDimensions,n=await r(e.floating);return{reference:D0(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function O0(e){return Gt(e).direction==="rtl"}const k0={convertOffsetParentRelativeRectToViewportRelativeRect:b0,getDocumentElement:sr,getClippingRect:P0,getOffsetParent:uc,getElementRects:_0,getClientRects:w0,getDimensions:N0,getScale:xn,isElement:qt,isRTL:O0};function cc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function T0(e,t){let r=null,n;const i=sr(e);function o(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const c=e.getBoundingClientRect(),{left:f,top:l,width:y,height:h}=c;if(s||t(),!y||!h)return;const g=ti(l),w=ti(i.clientWidth-(f+y)),d=ti(i.clientHeight-(l+h)),v=ti(f),b={rootMargin:-g+"px "+-w+"px "+-d+"px "+-v+"px",threshold:Tt(0,Ar(1,u))||1};let x=!0;function C(E){const M=E[0].intersectionRatio;if(M!==u){if(!x)return a();M?a(!1,M):n=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!cc(c,e.getBoundingClientRect())&&a(),x=!1}try{r=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,b)}r.observe(e)}return a(!0),o}function I0(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,c=za(e),f=i||o?[...c?Yn(c):[],...Yn(t)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",r,{passive:!0}),o&&v.addEventListener("resize",r)});const l=c&&s?T0(c,r):null;let y=-1,h=null;a&&(h=new ResizeObserver(v=>{let[p]=v;p&&p.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),r()}),c&&!u&&h.observe(c),h.observe(t));let g,w=u?Jr(e):null;u&&d();function d(){const v=Jr(e);w&&!cc(w,v)&&r(),w=v,g=requestAnimationFrame(d)}return r(),()=>{var v;f.forEach(p=>{i&&p.removeEventListener("scroll",r),o&&p.removeEventListener("resize",r)}),l==null||l(),(v=h)==null||v.disconnect(),h=null,u&&cancelAnimationFrame(g)}}const A0=o0,R0=i0,L0=t0,$0=s0,z0=r0,dc=e0,F0=a0,H0=(e,t,r)=>{const n=new Map,i={platform:k0,...r},o={...i.platform,_c:n};return Jg(e,t,{...i,platform:o})};var W0=typeof document<"u",B0=function(){},li=W0?P.useLayoutEffect:B0;function ui(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,i;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(!ui(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!ui(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function fc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vc(e,t){const r=fc(e);return Math.round(t*r)/r}function Ha(e){const t=m.useRef(e);return li(()=>{t.current=e}),t}function j0(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[f,l]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[y,h]=m.useState(n);ui(y,n)||h(n);const[g,w]=m.useState(null),[d,v]=m.useState(null),p=m.useCallback(A=>{A!==E.current&&(E.current=A,w(A))},[]),b=m.useCallback(A=>{A!==M.current&&(M.current=A,v(A))},[]),x=o||g,C=a||d,E=m.useRef(null),M=m.useRef(null),N=m.useRef(f),k=u!=null,D=Ha(u),I=Ha(i),R=Ha(c),W=m.useCallback(()=>{if(!E.current||!M.current)return;const A={placement:t,strategy:r,middleware:y};I.current&&(A.platform=I.current),H0(E.current,M.current,A).then(F=>{const j={...F,isPositioned:R.current!==!1};L.current&&!ui(N.current,j)&&(N.current=j,hl.flushSync(()=>{l(j)}))})},[y,t,r,I,R]);li(()=>{c===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,l(A=>({...A,isPositioned:!1})))},[c]);const L=m.useRef(!1);li(()=>(L.current=!0,()=>{L.current=!1}),[]),li(()=>{if(x&&(E.current=x),C&&(M.current=C),x&&C){if(D.current)return D.current(x,C,W);W()}},[x,C,W,D,k]);const $=m.useMemo(()=>({reference:E,floating:M,setReference:p,setFloating:b}),[p,b]),_=m.useMemo(()=>({reference:x,floating:C}),[x,C]),z=m.useMemo(()=>{const A={position:r,left:0,top:0};if(!_.floating)return A;const F=vc(_.floating,f.x),j=vc(_.floating,f.y);return s?{...A,transform:"translate("+F+"px, "+j+"px)",...fc(_.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:j}},[r,s,_.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:W,refs:$,elements:_,floatingStyles:z}),[f,W,$,_,z])}const V0=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?dc({element:n.current,padding:i}).fn(r):{}:n?dc({element:n,padding:i}).fn(r):{}}}},q0=(e,t)=>({...A0(e),options:[e,t]}),G0=(e,t)=>({...R0(e),options:[e,t]}),U0=(e,t)=>({...F0(e),options:[e,t]}),K0=(e,t)=>({...L0(e),options:[e,t]}),Y0=(e,t)=>({...$0(e),options:[e,t]}),X0=(e,t)=>({...z0(e),options:[e,t]}),Z0=(e,t)=>({...V0(e),options:[e,t]});var Q0="Arrow",pc=m.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...o}=e;return S.jsx(Qe.svg,{...o,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});pc.displayName=Q0;var J0=pc;function ey(e){const[t,r]=m.useState(void 0);return Tr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,c=Array.isArray(u)?u[0]:u;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Wa="Popper",[hc,Sn]=kr(Wa),[ty,mc]=hc(Wa),gc=e=>{const{__scopePopper:t,children:r}=e,[n,i]=m.useState(null);return S.jsx(ty,{scope:t,anchor:n,onAnchorChange:i,children:r})};gc.displayName=Wa;var yc="PopperAnchor",bc=m.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=mc(yc,r),a=m.useRef(null),s=lt(t,a),u=m.useRef(null);return m.useEffect(()=>{const c=u.current;u.current=(n==null?void 0:n.current)||a.current,c!==u.current&&o.onAnchorChange(u.current)}),n?null:S.jsx(Qe.div,{...i,ref:s})});bc.displayName=yc;var Ba="PopperContent",[ry,ny]=hc(Ba),wc=m.forwardRef((e,t)=>{var ge,V,G,J,O,T,H,K;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:y=!1,updatePositionStrategy:h="optimized",onPlaced:g,...w}=e,d=mc(Ba,r),[v,p]=m.useState(null),b=lt(t,Q=>p(Q)),[x,C]=m.useState(null),E=ey(x),M=(ge=E==null?void 0:E.width)!=null?ge:0,N=(V=E==null?void 0:E.height)!=null?V:0,k=n+(o!=="center"?"-"+o:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(c)?c:[c],R=I.length>0,W={padding:D,boundary:I.filter(iy),altBoundary:R},{refs:L,floatingStyles:$,placement:_,isPositioned:z,middlewareData:A}=j0({strategy:"fixed",placement:k,whileElementsMounted:(...Q)=>I0(...Q,{animationFrame:h==="always"}),elements:{reference:d.anchor},middleware:[q0({mainAxis:i+N,alignmentAxis:a}),u&&G0({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?U0():void 0,...W}),u&&K0({...W}),Y0({...W,apply:({elements:Q,rects:X,availableWidth:ie,availableHeight:ee})=>{const{width:ne,height:ye}=X.reference,be=Q.floating.style;be.setProperty("--radix-popper-available-width",`${ie}px`),be.setProperty("--radix-popper-available-height",`${ee}px`),be.setProperty("--radix-popper-anchor-width",`${ne}px`),be.setProperty("--radix-popper-anchor-height",`${ye}px`)}}),x&&Z0({element:x,padding:s}),ay({arrowWidth:M,arrowHeight:N}),y&&X0({strategy:"referenceHidden",...W})]}),[F,j]=Sc(_),B=nr(g);Tr(()=>{z&&(B==null||B())},[z,B]);const Y=(G=A.arrow)==null?void 0:G.x,U=(J=A.arrow)==null?void 0:J.y,q=((O=A.arrow)==null?void 0:O.centerOffset)!==0,[Z,le]=m.useState();return Tr(()=>{v&&le(window.getComputedStyle(v).zIndex)},[v]),S.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:z?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(T=A.transformOrigin)==null?void 0:T.x,(H=A.transformOrigin)==null?void 0:H.y].join(" "),...((K=A.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(ry,{scope:r,placedSide:F,onArrowChange:C,arrowX:Y,arrowY:U,shouldHideArrow:q,children:S.jsx(Qe.div,{"data-side":F,"data-align":j,...w,ref:b,style:{...w.style,animation:z?void 0:"none"}})})})});wc.displayName=Ba;var Cc="PopperArrow",oy={top:"bottom",right:"left",bottom:"top",left:"right"},xc=m.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,o=ny(Cc,n),a=oy[o.placedSide];return S.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:S.jsx(J0,{...i,ref:r,style:{...i.style,display:"block"}})})});xc.displayName=Cc;function iy(e){return e!==null}var ay=e=>({name:"transformOrigin",options:e,fn(t){var d,v,p,b,x;const{placement:r,rects:n,middlewareData:i}=t,a=((d=i.arrow)==null?void 0:d.centerOffset)!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[c,f]=Sc(r),l={start:"0%",center:"50%",end:"100%"}[f],y=((p=(v=i.arrow)==null?void 0:v.x)!=null?p:0)+s/2,h=((x=(b=i.arrow)==null?void 0:b.y)!=null?x:0)+u/2;let g="",w="";return c==="bottom"?(g=a?l:`${y}px`,w=`${-u}px`):c==="top"?(g=a?l:`${y}px`,w=`${n.floating.height+u}px`):c==="right"?(g=`${-u}px`,w=a?l:`${h}px`):c==="left"&&(g=`${n.floating.width+u}px`,w=a?l:`${h}px`),{data:{x:g,y:w}}}});function Sc(e){const[t,r="center"]=e.split("-");return[t,r]}var ci=gc,di=bc,ja=wc,Va=xc,fi="Popover",[Ec]=kr(fi,[Sn]),Xn=Sn(),[sy,Lr]=Ec(fi),Mc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:a=!1}=e,s=Xn(t),u=m.useRef(null),[c,f]=m.useState(!1),[l,y]=pn({prop:n,defaultProp:i!=null?i:!1,onChange:o,caller:fi});return S.jsx(ci,{...s,children:S.jsx(sy,{scope:t,contentId:gr(),triggerRef:u,open:l,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(h=>!h),[y]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>f(!0),[]),onCustomAnchorRemove:m.useCallback(()=>f(!1),[]),modal:a,children:r})})};Mc.displayName=fi;var Pc="PopoverAnchor",ly=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Lr(Pc,r),o=Xn(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return m.useEffect(()=>(a(),()=>s()),[a,s]),S.jsx(di,{...o,...n,ref:t})});ly.displayName=Pc;var Nc="PopoverTrigger",Dc=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Lr(Nc,r),o=Xn(r),a=lt(t,i.triggerRef),s=S.jsx(Qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ic(i.open),...n,ref:a,onClick:we(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:S.jsx(di,{asChild:!0,...o,children:s})});Dc.displayName=Nc;var qa="PopoverPortal",[uy,cy]=Ec(qa,{forceMount:void 0}),_c=e=>{const{__scopePopover:t,forceMount:r,children:n,container:i}=e,o=Lr(qa,t);return S.jsx(uy,{scope:t,forceMount:r,children:S.jsx(Ft,{present:r||o.open,children:S.jsx(Gn,{asChild:!0,container:i,children:n})})})};_c.displayName=qa;var En="PopoverContent",Oc=m.forwardRef((e,t)=>{const r=cy(En,e.__scopePopover),{forceMount:n=r.forceMount,...i}=e,o=Lr(En,e.__scopePopover);return S.jsx(Ft,{present:n||o.open,children:o.modal?S.jsx(fy,{...i,ref:t}):S.jsx(vy,{...i,ref:t})})});Oc.displayName=En;var dy=Zr("PopoverContent.RemoveScroll"),fy=m.forwardRef((e,t)=>{const r=Lr(En,e.__scopePopover),n=m.useRef(null),i=lt(t,n),o=m.useRef(!1);return m.useEffect(()=>{const a=n.current;if(a)return Ea(a)},[]),S.jsx(Uo,{as:dy,allowPinchZoom:!0,children:S.jsx(kc,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),o.current||(s=r.triggerRef.current)==null||s.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,c=s.button===2||u;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:we(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),vy=m.forwardRef((e,t)=>{const r=Lr(En,e.__scopePopover),n=m.useRef(!1),i=m.useRef(!1);return S.jsx(kc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(s=r.triggerRef.current)==null||s.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),kc=m.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:f,...l}=e,y=Lr(En,r),h=Xn(r);return ya(),S.jsx(Ho,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(qn,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>y.onOpenChange(!1),children:S.jsx(ja,{"data-state":Ic(y.open),role:"dialog",id:y.contentId,...h,...l,ref:t,style:{...l.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)"}})})})}),Tc="PopoverClose",py=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Lr(Tc,r);return S.jsx(Qe.button,{type:"button",...n,ref:t,onClick:we(e.onClick,()=>i.onOpenChange(!1))})});py.displayName=Tc;var hy="PopoverArrow",my=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Xn(r);return S.jsx(Va,{...i,...n,ref:t})});my.displayName=hy;function Ic(e){return e?"open":"closed"}var gy=Mc,yy=Dc,by=_c,wy=Oc;function Cy({...e}){return S.jsx(gy,{"data-slot":"popover",...e})}function xy({...e}){return S.jsx(yy,{"data-slot":"popover-trigger",...e})}function Sy({className:e,align:t="center",sideOffset:r=4,...n}){return S.jsx(by,{children:S.jsx(wy,{"data-slot":"popover-content",align:t,sideOffset:r,className:ae(`
|
|
121
|
+
hsl(360, 100%, 50%))`},onPointerDown:y=>{i(!0),u(y.clientX)},children:S.jsx("div",{ref:a,className:"univer-absolute univer-top-1/2 univer-box-border univer-size-2 univer-rounded-full univer-bg-transparent univer-shadow-md univer-ring-2 univer-ring-white univer-transition-transform univer-duration-75 univer-will-change-transform",style:{left:l(),transform:"translateY(-50%)",transition:n?"none":"all 0.1s ease-out"}})})})}const Rg=P.memo(Ig),Lg=P.memo(Ag),$g=P.memo(Og),zg=P.memo(Tg);function Fg({format:e="hex",value:t="#000000",onChange:r}){if(!$o)return null;const{locale:n}=P.useContext(rr),[i,o]=P.useState([0,100,100]),[a,s]=P.useState(!1),u=P.useCallback((y,h,g)=>Qo(y,h,g),[]);P.useEffect(()=>{try{if(e==="hex"){const[y,h,g]=t?_a(t):i;o([y,h,g])}}catch(y){console.error("Invalid value:",y)}},[t]);function c(y,h,g){o([y,h,g])}function f(y,h,g){const[w,d,v]=u(y,h,g);if(e==="hex"){const p=Vu(w,d,v);r==null||r(p)}}function l(){const[y,h,g]=i,w=Jo(y,h,g);r==null||r(w),s(!1)}return S.jsxs("div",{"data-u-comp":"color-picker",className:"univer-cursor-default univer-space-y-2 univer-rounded-lg univer-bg-white dark:!univer-bg-gray-700",onClick:y=>y.stopPropagation(),children:[S.jsx(zg,{hsv:i,onChange:(y,h,g)=>{c(y,h,g),f(y,h,g)}}),S.jsx("div",{className:"univer-flex univer-h-7 univer-items-center",children:S.jsx("a",{className:"univer-cursor-pointer univer-gap-2 univer-text-sm univer-text-gray-900 univer-transition-opacity hover:univer-opacity-80 dark:!univer-text-white",onClick:()=>s(!0),children:n==null?void 0:n.ColorPicker.more})}),S.jsx(Da,{className:"!univer-w-fit !univer-p-2.5",closable:!1,maskClosable:!1,open:a,onOpenChange:s,children:S.jsxs("div",{className:"univer-grid univer-w-64 univer-gap-2",children:[S.jsx(Rg,{hsv:i,onChange:c}),S.jsxs("div",{className:"univer-flex univer-items-center univer-gap-2",children:[S.jsx("div",{className:"univer-size-6 univer-flex-shrink-0 univer-rounded-sm",style:{backgroundColor:Jo(...i)}}),S.jsx(Lg,{hsv:i,onChange:c})]}),S.jsx($g,{hsv:i,onChange:c}),S.jsxs("footer",{className:"univer-flex univer-items-center univer-justify-end univer-gap-2",children:[S.jsx(_r,{onClick:()=>s(!1),children:n==null?void 0:n.ColorPicker.cancel}),S.jsx(_r,{variant:"primary",onClick:l,children:n==null?void 0:n.ColorPicker.confirm})]})]})})]})}function Hg(e){const{locale:t,cancelText:r,confirmText:n,onClose:i,onConfirm:o,closable:a=!0}=e;return S.jsxs("footer",{className:"univer-flex univer-items-center univer-justify-end univer-gap-2",children:[a&&S.jsx(_r,{onClick:i,children:r!=null?r:t==null?void 0:t.Confirm.cancel}),S.jsx(_r,{variant:"primary",onClick:o,children:n!=null?n:t==null?void 0:t.Confirm.confirm})]})}function Wg(e){const{children:t,visible:r=!1,title:n,cancelText:i,confirmText:o,width:a,onClose:s,onConfirm:u,closable:c=!0}=e,{locale:f}=P.useContext(rr);return S.jsx(Da,{open:r,title:n,maskClosable:!1,footer:S.jsx(Hg,{locale:f,cancelText:i,confirmText:o,onClose:s,onConfirm:u,closable:c}),onClose:s,width:a,closable:c,children:t})}const Bg=["top","right","bottom","left"],Ar=Math.min,Tt=Math.max,ei=Math.round,ti=Math.floor,ir=e=>({x:e,y:e}),jg={left:"right",right:"left",bottom:"top",top:"bottom"},Vg={start:"end",end:"start"};function Oa(e,t,r){return Tt(e,Ar(t,r))}function yr(e,t){return typeof e=="function"?e(t):e}function br(e){return e.split("-")[0]}function bn(e){return e.split("-")[1]}function ka(e){return e==="x"?"y":"x"}function Ta(e){return e==="y"?"height":"width"}const qg=new Set(["top","bottom"]);function ar(e){return qg.has(br(e))?"y":"x"}function Ia(e){return ka(ar(e))}function Gg(e,t,r){r===void 0&&(r=!1);const n=bn(e),i=Ia(e),o=Ta(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=ri(a)),[a,ri(a)]}function Ug(e){const t=ri(e);return[Aa(e),t,Aa(t)]}function Aa(e){return e.replace(/start|end/g,t=>Vg[t])}const Gu=["left","right"],Uu=["right","left"],Kg=["top","bottom"],Yg=["bottom","top"];function Xg(e,t,r){switch(e){case"top":case"bottom":return r?t?Uu:Gu:t?Gu:Uu;case"left":case"right":return t?Kg:Yg;default:return[]}}function Zg(e,t,r,n){const i=bn(e);let o=Xg(br(e),r==="start",n);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Aa)))),o}function ri(e){return e.replace(/left|right|bottom|top/g,t=>jg[t])}function Qg(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ku(e){return typeof e!="number"?Qg(e):{top:e,right:e,bottom:e,left:e}}function ni(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function Yu(e,t,r){let{reference:n,floating:i}=e;const o=ar(t),a=Ia(t),s=Ta(a),u=br(t),c=o==="y",f=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2,y=n[s]/2-i[s]/2;let h;switch(u){case"top":h={x:f,y:n.y-i.height};break;case"bottom":h={x:f,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:l};break;case"left":h={x:n.x-i.width,y:l};break;default:h={x:n.x,y:n.y}}switch(bn(t)){case"start":h[a]-=y*(r&&c?-1:1);break;case"end":h[a]+=y*(r&&c?-1:1);break}return h}const Jg=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:l}=Yu(c,n,u),y=n,h={},g=0;for(let w=0;w<s.length;w++){const{name:d,fn:v}=s[w],{x:p,y:b,data:x,reset:C}=await v({x:f,y:l,initialPlacement:n,placement:y,strategy:i,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});f=p!=null?p:f,l=b!=null?b:l,h={...h,[d]:{...h[d],...x}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(y=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:f,y:l}=Yu(c,y,u)),w=-1)}return{x:f,y:l,placement:y,strategy:i,middlewareData:h}};async function Un(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:l="floating",altBoundary:y=!1,padding:h=0}=yr(t,e),g=Ku(h),d=s[y?l==="floating"?"reference":"floating":l],v=ni(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(d)))==null||r?d:d.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:u})),p=l==="floating"?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),x=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},C=ni(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:p,offsetParent:b,strategy:u}):p);return{top:(v.top-C.top+g.top)/x.y,bottom:(C.bottom-v.bottom+g.bottom)/x.y,left:(v.left-C.left+g.left)/x.x,right:(C.right-v.right+g.right)/x.x}}const e0=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s,middlewareData:u}=t,{element:c,padding:f=0}=yr(e,t)||{};if(c==null)return{};const l=Ku(f),y={x:r,y:n},h=Ia(i),g=Ta(h),w=await a.getDimensions(c),d=h==="y",v=d?"top":"left",p=d?"bottom":"right",b=d?"clientHeight":"clientWidth",x=o.reference[g]+o.reference[h]-y[h]-o.floating[g],C=y[h]-o.reference[h],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let M=E?E[b]:0;(!M||!await(a.isElement==null?void 0:a.isElement(E)))&&(M=s.floating[b]||o.floating[g]);const N=x/2-C/2,k=M/2-w[g]/2-1,D=Ar(l[v],k),I=Ar(l[p],k),R=D,W=M-w[g]-I,L=M/2-w[g]/2+N,$=Oa(R,L,W),_=!u.arrow&&bn(i)!=null&&L!==$&&o.reference[g]/2-(L<R?D:I)-w[g]/2<0,z=_?L<R?L-R:L-W:0;return{[h]:y[h]+z,data:{[h]:$,centerOffset:L-$-z,..._&&{alignmentOffset:z}},reset:_}}}),t0=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:l=!0,fallbackPlacements:y,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...d}=yr(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const v=br(i),p=ar(s),b=br(s)===s,x=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=y||(b||!w?[ri(s)]:Ug(s)),E=g!=="none";!y&&E&&C.push(...Zg(s,w,g,x));const M=[s,...C],N=await Un(t,d),k=[];let D=((n=o.flip)==null?void 0:n.overflows)||[];if(f&&k.push(N[v]),l){const L=Gg(i,a,x);k.push(N[L[0]],N[L[1]])}if(D=[...D,{placement:i,overflows:k}],!k.every(L=>L<=0)){var I,R;const L=(((I=o.flip)==null?void 0:I.index)||0)+1,$=M[L];if($&&(!(l==="alignment"?p!==ar($):!1)||D.every(A=>ar(A.placement)===p?A.overflows[0]>0:!0)))return{data:{index:L,overflows:D},reset:{placement:$}};let _=(R=D.filter(z=>z.overflows[0]<=0).sort((z,A)=>z.overflows[1]-A.overflows[1])[0])==null?void 0:R.placement;if(!_)switch(h){case"bestFit":{var W;const z=(W=D.filter(A=>{if(E){const F=ar(A.placement);return F===p||F==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(F=>F>0).reduce((F,j)=>F+j,0)]).sort((A,F)=>A[1]-F[1])[0])==null?void 0:W[0];z&&(_=z);break}case"initialPlacement":_=s;break}if(i!==_)return{reset:{placement:_}}}return{}}}};function Xu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zu(e){return Bg.some(t=>e[t]>=0)}const r0=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=yr(e,t);switch(n){case"referenceHidden":{const o=await Un(t,{...i,elementContext:"reference"}),a=Xu(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Zu(a)}}}case"escaped":{const o=await Un(t,{...i,altBoundary:!0}),a=Xu(o,r.floating);return{data:{escapedOffsets:a,escaped:Zu(a)}}}default:return{}}}}},Qu=new Set(["left","top"]);async function n0(e,t){const{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=br(r),s=bn(r),u=ar(r)==="y",c=Qu.has(a)?-1:1,f=o&&u?-1:1,l=yr(t,e);let{mainAxis:y,crossAxis:h,alignmentAxis:g}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return s&&typeof g=="number"&&(h=s==="end"?g*-1:g),u?{x:h*f,y:y*c}:{x:y*c,y:h*f}}const o0=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:a,middlewareData:s}=t,u=await n0(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},i0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:d=>{let{x:v,y:p}=d;return{x:v,y:p}}},...u}=yr(e,t),c={x:r,y:n},f=await Un(t,u),l=ar(br(i)),y=ka(l);let h=c[y],g=c[l];if(o){const d=y==="y"?"top":"left",v=y==="y"?"bottom":"right",p=h+f[d],b=h-f[v];h=Oa(p,h,b)}if(a){const d=l==="y"?"top":"left",v=l==="y"?"bottom":"right",p=g+f[d],b=g-f[v];g=Oa(p,g,b)}const w=s.fn({...t,[y]:h,[l]:g});return{...w,data:{x:w.x-r,y:w.y-n,enabled:{[y]:o,[l]:a}}}}}},a0=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=yr(e,t),f={x:r,y:n},l=ar(i),y=ka(l);let h=f[y],g=f[l];const w=yr(s,t),d=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const b=y==="y"?"height":"width",x=o.reference[y]-o.floating[b]+d.mainAxis,C=o.reference[y]+o.reference[b]-d.mainAxis;h<x?h=x:h>C&&(h=C)}if(c){var v,p;const b=y==="y"?"width":"height",x=Qu.has(br(i)),C=o.reference[l]-o.floating[b]+(x&&((v=a.offset)==null?void 0:v[l])||0)+(x?0:d.crossAxis),E=o.reference[l]+o.reference[b]+(x?0:((p=a.offset)==null?void 0:p[l])||0)-(x?d.crossAxis:0);g<C?g=C:g>E&&(g=E)}return{[y]:h,[l]:g}}}},s0=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:u=()=>{},...c}=yr(e,t),f=await Un(t,c),l=br(i),y=bn(i),h=ar(i)==="y",{width:g,height:w}=o.floating;let d,v;l==="top"||l==="bottom"?(d=l,v=y===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=l,d=y==="end"?"top":"bottom");const p=w-f.top-f.bottom,b=g-f.left-f.right,x=Ar(w-f[d],p),C=Ar(g-f[v],b),E=!t.middlewareData.shift;let M=x,N=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(N=b),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(M=p),E&&!y){const D=Tt(f.left,0),I=Tt(f.right,0),R=Tt(f.top,0),W=Tt(f.bottom,0);h?N=g-2*(D!==0||I!==0?D+I:Tt(f.left,f.right)):M=w-2*(R!==0||W!==0?R+W:Tt(f.top,f.bottom))}await u({...t,availableWidth:N,availableHeight:M});const k=await a.getDimensions(s.floating);return g!==k.width||w!==k.height?{reset:{rects:!0}}:{}}}};function oi(){return typeof window<"u"}function wn(e){return Ju(e)?(e.nodeName||"").toLowerCase():"#document"}function It(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sr(e){var t;return(t=(Ju(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ju(e){return oi()?e instanceof Node||e instanceof It(e).Node:!1}function qt(e){return oi()?e instanceof Element||e instanceof It(e).Element:!1}function lr(e){return oi()?e instanceof HTMLElement||e instanceof It(e).HTMLElement:!1}function ec(e){return!oi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof It(e).ShadowRoot}const l0=new Set(["inline","contents"]);function Kn(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Gt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!l0.has(i)}const u0=new Set(["table","td","th"]);function c0(e){return u0.has(wn(e))}const d0=[":popover-open",":modal"];function ii(e){return d0.some(t=>{try{return e.matches(t)}catch{return!1}})}const f0=["transform","translate","scale","rotate","perspective"],v0=["transform","translate","scale","rotate","perspective","filter"],p0=["paint","layout","strict","content"];function Ra(e){const t=La(),r=qt(e)?Gt(e):e;return f0.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)||v0.some(n=>(r.willChange||"").includes(n))||p0.some(n=>(r.contain||"").includes(n))}function h0(e){let t=Rr(e);for(;lr(t)&&!Cn(t);){if(Ra(t))return t;if(ii(t))return null;t=Rr(t)}return null}function La(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const m0=new Set(["html","body","#document"]);function Cn(e){return m0.has(wn(e))}function Gt(e){return It(e).getComputedStyle(e)}function ai(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rr(e){if(wn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ec(e)&&e.host||sr(e);return ec(t)?t.host:t}function tc(e){const t=Rr(e);return Cn(t)?e.ownerDocument?e.ownerDocument.body:e.body:lr(t)&&Kn(t)?t:tc(t)}function Yn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=tc(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),a=It(i);if(o){const s=$a(a);return t.concat(a,a.visualViewport||[],Kn(i)?i:[],s&&r?Yn(s):[])}return t.concat(i,Yn(i,[],r))}function $a(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rc(e){const t=Gt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=lr(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=ei(r)!==o||ei(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function za(e){return qt(e)?e:e.contextElement}function xn(e){const t=za(e);if(!lr(t))return ir(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=rc(t);let a=(o?ei(r.width):r.width)/n,s=(o?ei(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const g0=ir(0);function nc(e){const t=It(e);return!La()||!t.visualViewport?g0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function y0(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==It(e)?!1:t}function Jr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=za(e);let a=ir(1);t&&(n?qt(n)&&(a=xn(n)):a=xn(e));const s=y0(o,r,n)?nc(o):ir(0);let u=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,l=i.height/a.y;if(o){const y=It(o),h=n&&qt(n)?It(n):n;let g=y,w=$a(g);for(;w&&n&&h!==g;){const d=xn(w),v=w.getBoundingClientRect(),p=Gt(w),b=v.left+(w.clientLeft+parseFloat(p.paddingLeft))*d.x,x=v.top+(w.clientTop+parseFloat(p.paddingTop))*d.y;u*=d.x,c*=d.y,f*=d.x,l*=d.y,u+=b,c+=x,g=It(w),w=$a(g)}}return ni({width:f,height:l,x:u,y:c})}function si(e,t){const r=ai(e).scrollLeft;return t?t.left+r:Jr(sr(e)).left+r}function oc(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-si(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function b0(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o=i==="fixed",a=sr(n),s=t?ii(t.floating):!1;if(n===a||s&&o)return r;let u={scrollLeft:0,scrollTop:0},c=ir(1);const f=ir(0),l=lr(n);if((l||!l&&!o)&&((wn(n)!=="body"||Kn(a))&&(u=ai(n)),lr(n))){const h=Jr(n);c=xn(n),f.x=h.x+n.clientLeft,f.y=h.y+n.clientTop}const y=a&&!l&&!o?oc(a,u):ir(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-u.scrollLeft*c.x+f.x+y.x,y:r.y*c.y-u.scrollTop*c.y+f.y+y.y}}function w0(e){return Array.from(e.getClientRects())}function C0(e){const t=sr(e),r=ai(e),n=e.ownerDocument.body,i=Tt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Tt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+si(e);const s=-r.scrollTop;return Gt(n).direction==="rtl"&&(a+=Tt(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:s}}const ic=25;function x0(e,t){const r=It(e),n=sr(e),i=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const f=La();(!f||f&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}const c=si(n);if(c<=0){const f=n.ownerDocument,l=f.body,y=getComputedStyle(l),h=f.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,g=Math.abs(n.clientWidth-l.clientWidth-h);g<=ic&&(o-=g)}else c<=ic&&(o+=c);return{width:o,height:a,x:s,y:u}}const S0=new Set(["absolute","fixed"]);function E0(e,t){const r=Jr(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=lr(e)?xn(e):ir(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,c=n*o.y;return{width:a,height:s,x:u,y:c}}function ac(e,t,r){let n;if(t==="viewport")n=x0(e,r);else if(t==="document")n=C0(sr(e));else if(qt(t))n=E0(t,r);else{const i=nc(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ni(n)}function sc(e,t){const r=Rr(e);return r===t||!qt(r)||Cn(r)?!1:Gt(r).position==="fixed"||sc(r,t)}function M0(e,t){const r=t.get(e);if(r)return r;let n=Yn(e,[],!1).filter(s=>qt(s)&&wn(s)!=="body"),i=null;const o=Gt(e).position==="fixed";let a=o?Rr(e):e;for(;qt(a)&&!Cn(a);){const s=Gt(a),u=Ra(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&!!i&&S0.has(i.position)||Kn(a)&&!u&&sc(e,a))?n=n.filter(f=>f!==a):i=s,a=Rr(a)}return t.set(e,n),n}function P0(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const a=[...r==="clippingAncestors"?ii(t)?[]:M0(t,this._c):[].concat(r),n],s=a[0],u=a.reduce((c,f)=>{const l=ac(t,f,i);return c.top=Tt(l.top,c.top),c.right=Ar(l.right,c.right),c.bottom=Ar(l.bottom,c.bottom),c.left=Tt(l.left,c.left),c},ac(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function N0(e){const{width:t,height:r}=rc(e);return{width:t,height:r}}function D0(e,t,r){const n=lr(t),i=sr(t),o=r==="fixed",a=Jr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const u=ir(0);function c(){u.x=si(i)}if(n||!n&&!o)if((wn(t)!=="body"||Kn(i))&&(s=ai(t)),n){const h=Jr(t,!0,o,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else i&&c();o&&!n&&i&&c();const f=i&&!n&&!o?oc(i,s):ir(0),l=a.left+s.scrollLeft-u.x-f.x,y=a.top+s.scrollTop-u.y-f.y;return{x:l,y,width:a.width,height:a.height}}function Fa(e){return Gt(e).position==="static"}function lc(e,t){if(!lr(e)||Gt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return sr(e)===r&&(r=r.ownerDocument.body),r}function uc(e,t){const r=It(e);if(ii(e))return r;if(!lr(e)){let i=Rr(e);for(;i&&!Cn(i);){if(qt(i)&&!Fa(i))return i;i=Rr(i)}return r}let n=lc(e,t);for(;n&&c0(n)&&Fa(n);)n=lc(n,t);return n&&Cn(n)&&Fa(n)&&!Ra(n)?r:n||h0(e)||r}const _0=async function(e){const t=this.getOffsetParent||uc,r=this.getDimensions,n=await r(e.floating);return{reference:D0(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function O0(e){return Gt(e).direction==="rtl"}const k0={convertOffsetParentRelativeRectToViewportRelativeRect:b0,getDocumentElement:sr,getClippingRect:P0,getOffsetParent:uc,getElementRects:_0,getClientRects:w0,getDimensions:N0,getScale:xn,isElement:qt,isRTL:O0};function cc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function T0(e,t){let r=null,n;const i=sr(e);function o(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const c=e.getBoundingClientRect(),{left:f,top:l,width:y,height:h}=c;if(s||t(),!y||!h)return;const g=ti(l),w=ti(i.clientWidth-(f+y)),d=ti(i.clientHeight-(l+h)),v=ti(f),b={rootMargin:-g+"px "+-w+"px "+-d+"px "+-v+"px",threshold:Tt(0,Ar(1,u))||1};let x=!0;function C(E){const M=E[0].intersectionRatio;if(M!==u){if(!x)return a();M?a(!1,M):n=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!cc(c,e.getBoundingClientRect())&&a(),x=!1}try{r=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,b)}r.observe(e)}return a(!0),o}function I0(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,c=za(e),f=i||o?[...c?Yn(c):[],...Yn(t)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",r,{passive:!0}),o&&v.addEventListener("resize",r)});const l=c&&s?T0(c,r):null;let y=-1,h=null;a&&(h=new ResizeObserver(v=>{let[p]=v;p&&p.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),r()}),c&&!u&&h.observe(c),h.observe(t));let g,w=u?Jr(e):null;u&&d();function d(){const v=Jr(e);w&&!cc(w,v)&&r(),w=v,g=requestAnimationFrame(d)}return r(),()=>{var v;f.forEach(p=>{i&&p.removeEventListener("scroll",r),o&&p.removeEventListener("resize",r)}),l==null||l(),(v=h)==null||v.disconnect(),h=null,u&&cancelAnimationFrame(g)}}const A0=o0,R0=i0,L0=t0,$0=s0,z0=r0,dc=e0,F0=a0,H0=(e,t,r)=>{const n=new Map,i={platform:k0,...r},o={...i.platform,_c:n};return Jg(e,t,{...i,platform:o})};var W0=typeof document<"u",B0=function(){},li=W0?P.useLayoutEffect:B0;function ui(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,i;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(!ui(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!ui(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function fc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vc(e,t){const r=fc(e);return Math.round(t*r)/r}function Ha(e){const t=m.useRef(e);return li(()=>{t.current=e}),t}function j0(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[f,l]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[y,h]=m.useState(n);ui(y,n)||h(n);const[g,w]=m.useState(null),[d,v]=m.useState(null),p=m.useCallback(A=>{A!==E.current&&(E.current=A,w(A))},[]),b=m.useCallback(A=>{A!==M.current&&(M.current=A,v(A))},[]),x=o||g,C=a||d,E=m.useRef(null),M=m.useRef(null),N=m.useRef(f),k=u!=null,D=Ha(u),I=Ha(i),R=Ha(c),W=m.useCallback(()=>{if(!E.current||!M.current)return;const A={placement:t,strategy:r,middleware:y};I.current&&(A.platform=I.current),H0(E.current,M.current,A).then(F=>{const j={...F,isPositioned:R.current!==!1};L.current&&!ui(N.current,j)&&(N.current=j,hl.flushSync(()=>{l(j)}))})},[y,t,r,I,R]);li(()=>{c===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,l(A=>({...A,isPositioned:!1})))},[c]);const L=m.useRef(!1);li(()=>(L.current=!0,()=>{L.current=!1}),[]),li(()=>{if(x&&(E.current=x),C&&(M.current=C),x&&C){if(D.current)return D.current(x,C,W);W()}},[x,C,W,D,k]);const $=m.useMemo(()=>({reference:E,floating:M,setReference:p,setFloating:b}),[p,b]),_=m.useMemo(()=>({reference:x,floating:C}),[x,C]),z=m.useMemo(()=>{const A={position:r,left:0,top:0};if(!_.floating)return A;const F=vc(_.floating,f.x),j=vc(_.floating,f.y);return s?{...A,transform:"translate("+F+"px, "+j+"px)",...fc(_.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:j}},[r,s,_.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:W,refs:$,elements:_,floatingStyles:z}),[f,W,$,_,z])}const V0=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?dc({element:n.current,padding:i}).fn(r):{}:n?dc({element:n,padding:i}).fn(r):{}}}},q0=(e,t)=>({...A0(e),options:[e,t]}),G0=(e,t)=>({...R0(e),options:[e,t]}),U0=(e,t)=>({...F0(e),options:[e,t]}),K0=(e,t)=>({...L0(e),options:[e,t]}),Y0=(e,t)=>({...$0(e),options:[e,t]}),X0=(e,t)=>({...z0(e),options:[e,t]}),Z0=(e,t)=>({...V0(e),options:[e,t]});var Q0="Arrow",pc=m.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...o}=e;return S.jsx(Qe.svg,{...o,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});pc.displayName=Q0;var J0=pc;function ey(e){const[t,r]=m.useState(void 0);return Tr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,c=Array.isArray(u)?u[0]:u;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Wa="Popper",[hc,Sn]=kr(Wa),[ty,mc]=hc(Wa),gc=e=>{const{__scopePopper:t,children:r}=e,[n,i]=m.useState(null);return S.jsx(ty,{scope:t,anchor:n,onAnchorChange:i,children:r})};gc.displayName=Wa;var yc="PopperAnchor",bc=m.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=mc(yc,r),a=m.useRef(null),s=lt(t,a),u=m.useRef(null);return m.useEffect(()=>{const c=u.current;u.current=(n==null?void 0:n.current)||a.current,c!==u.current&&o.onAnchorChange(u.current)}),n?null:S.jsx(Qe.div,{...i,ref:s})});bc.displayName=yc;var Ba="PopperContent",[ry,ny]=hc(Ba),wc=m.forwardRef((e,t)=>{var ge,V,G,J,O,T,H,K;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:y=!1,updatePositionStrategy:h="optimized",onPlaced:g,...w}=e,d=mc(Ba,r),[v,p]=m.useState(null),b=lt(t,Q=>p(Q)),[x,C]=m.useState(null),E=ey(x),M=(ge=E==null?void 0:E.width)!=null?ge:0,N=(V=E==null?void 0:E.height)!=null?V:0,k=n+(o!=="center"?"-"+o:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(c)?c:[c],R=I.length>0,W={padding:D,boundary:I.filter(iy),altBoundary:R},{refs:L,floatingStyles:$,placement:_,isPositioned:z,middlewareData:A}=j0({strategy:"fixed",placement:k,whileElementsMounted:(...Q)=>I0(...Q,{animationFrame:h==="always"}),elements:{reference:d.anchor},middleware:[q0({mainAxis:i+N,alignmentAxis:a}),u&&G0({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?U0():void 0,...W}),u&&K0({...W}),Y0({...W,apply:({elements:Q,rects:X,availableWidth:ie,availableHeight:ee})=>{const{width:ne,height:ye}=X.reference,be=Q.floating.style;be.setProperty("--radix-popper-available-width",`${ie}px`),be.setProperty("--radix-popper-available-height",`${ee}px`),be.setProperty("--radix-popper-anchor-width",`${ne}px`),be.setProperty("--radix-popper-anchor-height",`${ye}px`)}}),x&&Z0({element:x,padding:s}),ay({arrowWidth:M,arrowHeight:N}),y&&X0({strategy:"referenceHidden",...W})]}),[F,j]=Sc(_),B=nr(g);Tr(()=>{z&&(B==null||B())},[z,B]);const Y=(G=A.arrow)==null?void 0:G.x,U=(J=A.arrow)==null?void 0:J.y,q=((O=A.arrow)==null?void 0:O.centerOffset)!==0,[Z,le]=m.useState();return Tr(()=>{v&&le(window.getComputedStyle(v).zIndex)},[v]),S.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:z?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(T=A.transformOrigin)==null?void 0:T.x,(H=A.transformOrigin)==null?void 0:H.y].join(" "),...((K=A.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(ry,{scope:r,placedSide:F,onArrowChange:C,arrowX:Y,arrowY:U,shouldHideArrow:q,children:S.jsx(Qe.div,{"data-side":F,"data-align":j,...w,ref:b,style:{...w.style,animation:z?void 0:"none"}})})})});wc.displayName=Ba;var Cc="PopperArrow",oy={top:"bottom",right:"left",bottom:"top",left:"right"},xc=m.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,o=ny(Cc,n),a=oy[o.placedSide];return S.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:S.jsx(J0,{...i,ref:r,style:{...i.style,display:"block"}})})});xc.displayName=Cc;function iy(e){return e!==null}var ay=e=>({name:"transformOrigin",options:e,fn(t){var d,v,p,b,x;const{placement:r,rects:n,middlewareData:i}=t,a=((d=i.arrow)==null?void 0:d.centerOffset)!==0,s=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[c,f]=Sc(r),l={start:"0%",center:"50%",end:"100%"}[f],y=((p=(v=i.arrow)==null?void 0:v.x)!=null?p:0)+s/2,h=((x=(b=i.arrow)==null?void 0:b.y)!=null?x:0)+u/2;let g="",w="";return c==="bottom"?(g=a?l:`${y}px`,w=`${-u}px`):c==="top"?(g=a?l:`${y}px`,w=`${n.floating.height+u}px`):c==="right"?(g=`${-u}px`,w=a?l:`${h}px`):c==="left"&&(g=`${n.floating.width+u}px`,w=a?l:`${h}px`),{data:{x:g,y:w}}}});function Sc(e){const[t,r="center"]=e.split("-");return[t,r]}var ci=gc,di=bc,ja=wc,Va=xc,fi="Popover",[Ec]=kr(fi,[Sn]),Xn=Sn(),[sy,Lr]=Ec(fi),Mc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:a=!1}=e,s=Xn(t),u=m.useRef(null),[c,f]=m.useState(!1),[l,y]=pn({prop:n,defaultProp:i!=null?i:!1,onChange:o,caller:fi});return S.jsx(ci,{...s,children:S.jsx(sy,{scope:t,contentId:gr(),triggerRef:u,open:l,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(h=>!h),[y]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>f(!0),[]),onCustomAnchorRemove:m.useCallback(()=>f(!1),[]),modal:a,children:r})})};Mc.displayName=fi;var Pc="PopoverAnchor",ly=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Lr(Pc,r),o=Xn(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return m.useEffect(()=>(a(),()=>s()),[a,s]),S.jsx(di,{...o,...n,ref:t})});ly.displayName=Pc;var Nc="PopoverTrigger",Dc=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Lr(Nc,r),o=Xn(r),a=lt(t,i.triggerRef),s=S.jsx(Qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ic(i.open),...n,ref:a,onClick:we(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:S.jsx(di,{asChild:!0,...o,children:s})});Dc.displayName=Nc;var qa="PopoverPortal",[uy,cy]=Ec(qa,{forceMount:void 0}),_c=e=>{const{__scopePopover:t,forceMount:r,children:n,container:i}=e,o=Lr(qa,t);return S.jsx(uy,{scope:t,forceMount:r,children:S.jsx(Ft,{present:r||o.open,children:S.jsx(Gn,{asChild:!0,container:i,children:n})})})};_c.displayName=qa;var En="PopoverContent",Oc=m.forwardRef((e,t)=>{const r=cy(En,e.__scopePopover),{forceMount:n=r.forceMount,...i}=e,o=Lr(En,e.__scopePopover);return S.jsx(Ft,{present:n||o.open,children:o.modal?S.jsx(fy,{...i,ref:t}):S.jsx(vy,{...i,ref:t})})});Oc.displayName=En;var dy=Zr("PopoverContent.RemoveScroll"),fy=m.forwardRef((e,t)=>{const r=Lr(En,e.__scopePopover),n=m.useRef(null),i=lt(t,n),o=m.useRef(!1);return m.useEffect(()=>{const a=n.current;if(a)return Ea(a)},[]),S.jsx(Uo,{as:dy,allowPinchZoom:!0,children:S.jsx(kc,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),o.current||(s=r.triggerRef.current)==null||s.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,c=s.button===2||u;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:we(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),vy=m.forwardRef((e,t)=>{const r=Lr(En,e.__scopePopover),n=m.useRef(!1),i=m.useRef(!1);return S.jsx(kc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(s=r.triggerRef.current)==null||s.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),kc=m.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:f,...l}=e,y=Lr(En,r),h=Xn(r);return ya(),S.jsx(Ho,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(qn,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>y.onOpenChange(!1),children:S.jsx(ja,{"data-state":Ic(y.open),role:"dialog",id:y.contentId,...h,...l,ref:t,style:{...l.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)"}})})})}),Tc="PopoverClose",py=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Lr(Tc,r);return S.jsx(Qe.button,{type:"button",...n,ref:t,onClick:we(e.onClick,()=>i.onOpenChange(!1))})});py.displayName=Tc;var hy="PopoverArrow",my=m.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Xn(r);return S.jsx(Va,{...i,...n,ref:t})});my.displayName=hy;function Ic(e){return e?"open":"closed"}var gy=Mc,yy=Dc,by=_c,wy=Oc;function Cy({...e}){return S.jsx(gy,{"data-slot":"popover",...e})}function xy({...e}){return S.jsx(yy,{"data-slot":"popover-trigger",...e})}function Sy({className:e,align:t="center",sideOffset:r=4,...n}){return S.jsx(by,{children:S.jsx(wy,{"data-slot":"popover-content",align:t,sideOffset:r,className:ae(`
|
|
122
122
|
univer-outline-hidden univer-z-[1080] univer-max-h-[var(--radix-popper-available-height)]
|
|
123
123
|
univer-overflow-y-auto univer-rounded-md univer-bg-white univer-text-gray-900 univer-shadow-md
|
|
124
124
|
data-[state=open]:univer-animate-in data-[state=open]:univer-fade-in-0
|
|
@@ -229,7 +229,7 @@ html body {
|
|
|
229
229
|
placeholder:univer-text-gray-400
|
|
230
230
|
focus:univer-border-primary-600 focus:univer-outline-none focus:univer-ring-2 focus:univer-ring-primary-50
|
|
231
231
|
dark:!univer-bg-gray-700 dark:!univer-text-white dark:focus:!univer-ring-primary-900
|
|
232
|
-
`,{variants:{size:{mini:"univer-h-7 univer-px-1.5 univer-text-sm",small:"univer-h-8 univer-px-2 univer-text-sm",middle:"univer-h-10 univer-px-3 univer-text-base",large:"univer-h-12 univer-px-4 univer-text-lg"}},defaultVariants:{size:"small"}}),Lv=P.forwardRef(({autoFocus:e=!1,className:t,style:r,type:n="text",placeholder:i,value:o,size:a="small",allowClear:s=!1,disabled:u=!1,onClick:c,onKeyDown:f,onChange:l,onFocus:y,onBlur:h,slot:g,inputClass:w,inputStyle:d,...v},p)=>{const b=k=>{k.stopPropagation(),l==null||l("")},x=k=>{l==null||l(k.target.value)},C=P.useMemo(()=>s&&o&&!u||g,[s,u,g,o]),[E,M]=P.useState(0),N=P.useRef(null);return P.useEffect(()=>{let k=null;return g&&N.current&&(k=new MutationObserver(()=>{N.current&&M(N.current.offsetWidth+8)}),k.observe(N.current,{childList:!0,subtree:!0}),M(N.current.offsetWidth+8)),()=>k==null?void 0:k.disconnect()},[N.current]),S.jsxs("div",{"data-u-comp":"input",className:ae("univer-relative univer-inline-flex univer-w-full univer-items-center univer-rounded-md",u&&"univer-cursor-not-allowed",t),style:r,children:[S.jsx("input",{ref:p,type:n,className:ae(KC({size:a}),Ct,u&&`
|
|
232
|
+
`,{variants:{size:{mini:"univer-h-7 univer-px-1.5 univer-text-sm",small:"univer-h-8 univer-px-2 univer-text-sm",middle:"univer-h-10 univer-px-3 univer-text-base",large:"univer-h-12 univer-px-4 univer-text-lg"}},defaultVariants:{size:"small"}}),Lv=P.forwardRef(({autoFocus:e=!1,className:t,style:r,type:n="text",placeholder:i,value:o,size:a="small",allowClear:s=!1,disabled:u=!1,onClick:c,onKeyDown:f,onChange:l,onFocus:y,onBlur:h,slot:g,inputClass:w,inputStyle:d,...v},p)=>{const b=k=>{k.stopPropagation(),l==null||l("")},x=k=>{l==null||l(k.target.value)},C=P.useMemo(()=>s&&o&&!u||g,[s,u,g,o]),[E,M]=P.useState(0),N=P.useRef(null);return P.useEffect(()=>{let k=null;return g&&N.current&&(k=new MutationObserver(()=>{N.current&&M(N.current.offsetWidth+8)}),k.observe(N.current,{childList:!0,subtree:!0}),M(N.current.offsetWidth+8)),()=>k==null?void 0:k.disconnect()},[N.current]),P.useEffect(()=>{s&&!(g&&N.current)&&M(26)},[]),S.jsxs("div",{"data-u-comp":"input",className:ae("univer-relative univer-inline-flex univer-w-full univer-items-center univer-rounded-md",u&&"univer-cursor-not-allowed",t),style:r,children:[S.jsx("input",{ref:p,type:n,className:ae(KC({size:a}),Ct,u&&`
|
|
233
233
|
univer-cursor-not-allowed univer-bg-gray-50 univer-text-gray-400
|
|
234
234
|
dark:!univer-text-gray-500
|
|
235
235
|
`,s&&!g&&"univer-pr-8",w),placeholder:i,value:o,disabled:u,autoFocus:e,onClick:c,onKeyDown:f,onChange:x,onFocus:y,onBlur:h,style:{...d,paddingRight:E},...v}),C&&S.jsxs("div",{className:"univer-absolute univer-right-2 univer-flex univer-items-center univer-gap-1 univer-rounded-full",ref:N,children:[g,s&&o&&!u&&S.jsx("button",{type:"button",onClick:b,className:"univer-flex univer-size-4 univer-cursor-pointer univer-items-center univer-rounded-full univer-border-none univer-bg-transparent univer-p-1 univer-text-gray-400 univer-transition-colors univer-duration-200 hover:univer-text-gray-500 focus:univer-outline-none",children:S.jsx(Ro,{className:"univer-size-3"})})]})]})}),YC=P.forwardRef(({value:e,defaultValue:t,size:r="small",min:n=Number.MIN_SAFE_INTEGER,max:i=Number.MAX_SAFE_INTEGER,step:o=1,precision:a,formatter:s,parser:u,controls:c=!0,className:f,inputClassName:l,controlsClassName:y,disabled:h,onChange:g,onKeyDown:w,onPressEnter:d,onFocus:v,onBlur:p,allowEmpty:b=!1},x)=>{const[C,E]=P.useState(e!==void 0?e:t!==void 0?t:null),M=P.useRef(C),[N,k]=P.useState(L(C)),D=P.useRef(null),I=P.useRef(null),R=P.useRef(null),W=B=>{x&&(typeof x=="function"?x(B):x.current=B),D.current=B};P.useEffect(()=>{e!==void 0&&e!==C&&(E(e),M.current=e,k(L(e)))},[e]),P.useEffect(()=>{C!==null&&(M.current=C)},[C]),P.useEffect(()=>()=>{I.current&&clearTimeout(I.current),R.current&&clearInterval(R.current)},[]);function L(B){if(B==null)return"";let Y=B;return a!==void 0&&(Y=Number(B).toFixed(a)),s?s(Y):String(Y)}function $(B){if(!B)return null;let Y=B;u&&(Y=u(B));try{const q=Y.replace(/[^\d.-]/g,"").split("."),Z=q[0],le=q.length>1?q.slice(1).join(""):"",ge=Z+(le?`.${le}`:""),V=Number(ge);if(Number.isNaN(V))return null;let G;if(a!==void 0){const J=10**a,O=Math.round(V*J)/J;O.toString().includes("e")?G=Number.parseFloat(O.toFixed(a)):G=O}else V.toString().includes("e")?G=Number.parseFloat(V.toFixed(16).replace(/\.?0+$/,"")):G=V;return i!==void 0&&G>i&&(G=i),n!==void 0&&G<n&&(G=n),G}catch{return null}}function _(B){if(k(B),b&&B===""){E(null),g==null||g(null);return}const Y=$(B);E(Y),g==null||g(Y)}function z(B){if(C===null){if(N===""&&b)g&&g(null);else{const U=M.current;E(U),k(L(U)),g&&g(U)}p==null||p(B);return}let Y=C;i!==void 0&&Y>i&&(Y=i),n!==void 0&&Y<n&&(Y=n),Y!==C?(E(Y),k(L(Y)),g==null||g(Y)):k(L(C)),p==null||p(B)}function A(B){if(h)return;const Y=B?o:-o;let U;C!==null?U=C:M.current!==null?U=M.current:U=n>0?n:0;let q=U+Y;i!==void 0&&q>i&&(q=i),n!==void 0&&q<n&&(q=n),q!==U&&(E(q),M.current=q,k(L(q)),g==null||g(q))}function F(B){h||(w==null||w(B),B.key==="ArrowUp"?(B.preventDefault(),A(!0)):B.key==="ArrowDown"?(B.preventDefault(),A(!1)):B.key==="Enter"&&(d==null||d(B)))}function j(B){var Y;h||(A(B),(Y=D.current)==null||Y.focus())}return S.jsx("div",{className:ae("univer-inline-block",f),children:S.jsxs("div",{className:"univer-relative univer-w-full",children:[S.jsx(Lv,{ref:W,className:ae("univer-box-border",l),size:r,value:N,disabled:h,onChange:_,onFocus:v,onBlur:z,onKeyDown:F}),c&&S.jsxs("div",{className:ae(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "UI component library for building exceptional Univer.",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"react-transition-group": "^4.4.5",
|
|
72
72
|
"sonner": "^2.0.7",
|
|
73
73
|
"tailwind-merge": "2.6.0",
|
|
74
|
-
"@univerjs/themes": "0.
|
|
74
|
+
"@univerjs/themes": "0.11.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@testing-library/jest-dom": "6.9.1",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"typescript": "^5.9.3",
|
|
87
87
|
"vite": "^7.1.12",
|
|
88
88
|
"vitest": "^3.2.4",
|
|
89
|
-
"@univerjs/
|
|
90
|
-
"@univerjs
|
|
89
|
+
"@univerjs-infra/shared": "0.11.0",
|
|
90
|
+
"@univerjs/core": "0.11.0"
|
|
91
91
|
},
|
|
92
92
|
"scripts": {
|
|
93
93
|
"test": "vitest run",
|