Files
chinese-family-tree-2/.next/static/chunks/844398dafa6354e8.js
T
freedakgmail 2b4bc92f1b 0.0.3.0
2025-11-23 13:31:06 +08:00

3 lines
64 KiB
JavaScript

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82772,30846,51788,55772,29300,34072,32301,59786,34811,79096,47934,77760,88434,68072,e=>{"use strict";var t=e.i(36792),r=e.i(3965),n=e.i(27458),o=e.i(27706);let a=(0,o.default)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);e.s(["Search",()=>a],30846);let i=(0,o.default)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]),l=(0,o.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",()=>l],51788);let s=(0,o.default)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),c=(0,o.default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["default",()=>c],55772);let u=(0,o.default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>u],29300);let d=(0,o.default)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);e.s(["Trash2",()=>d],34072);let f=(0,o.default)("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);e.s(["Network",()=>f],32301);let p=(0,o.default)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var m=e.i(9991),h=e.i(77627),x=e.i(34346),g=e.i(57213),v=e.i(60515),w=e.i(42668),y=e.i(14268),b="Avatar",[j,R]=(0,g.createContextScope)(b),[C,k]=j(b),E=x.forwardRef((e,r)=>{let{__scopeAvatar:n,...o}=e,[a,i]=x.useState("idle");return(0,t.jsx)(C,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:(0,t.jsx)(y.Primitive.span,{...o,ref:r})})});E.displayName=b;var N="AvatarImage",S=x.forwardRef((e,r)=>{let{__scopeAvatar:n,src:o,onLoadingStatusChange:a=()=>{},...i}=e,l=k(N,n),s=function(e,t){let[r,n]=x.useState("idle");return(0,w.useLayoutEffect)(()=>{if(!e)return void n("error");let r=!0,o=new window.Image,a=e=>()=>{r&&n(e)};return n("loading"),o.onload=a("loaded"),o.onerror=a("error"),o.src=e,t&&(o.referrerPolicy=t),()=>{r=!1}},[e,t]),r}(o,i.referrerPolicy),c=(0,v.useCallbackRef)(e=>{a(e),l.onImageLoadingStatusChange(e)});return(0,w.useLayoutEffect)(()=>{"idle"!==s&&c(s)},[s,c]),"loaded"===s?(0,t.jsx)(y.Primitive.img,{...i,ref:r,src:o}):null});S.displayName=N;var P="AvatarFallback",M=x.forwardRef((e,r)=>{let{__scopeAvatar:n,delayMs:o,...a}=e,i=k(P,n),[l,s]=x.useState(void 0===o);return x.useEffect(()=>{if(void 0!==o){let e=window.setTimeout(()=>s(!0),o);return()=>window.clearTimeout(e)}},[o]),l&&"loaded"!==i.imageLoadingStatus?(0,t.jsx)(y.Primitive.span,{...a,ref:r}):null});M.displayName=P;var A=e.i(69744);function D({className:e,...r}){return(0,t.jsx)(E,{"data-slot":"avatar",className:(0,A.cn)("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...r})}function T({className:e,...r}){return(0,t.jsx)(S,{"data-slot":"avatar-image",className:(0,A.cn)("aspect-square size-full",e),...r})}function L({className:e,...r}){return(0,t.jsx)(M,{"data-slot":"avatar-fallback",className:(0,A.cn)("bg-muted flex size-full items-center justify-center rounded-full",e),...r})}e.s(["Avatar",()=>D,"AvatarFallback",()=>L,"AvatarImage",()=>T],59786);var I=e.i(82502),O=e.i(6580),F=e.i(53607),_=e.i(22436);function H(e){let r=e+"CollectionProvider",[n,o]=(0,g.createContextScope)(r),[a,i]=n(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{let{scope:r,children:n}=e,o=x.default.useRef(null),i=x.default.useRef(new Map).current;return(0,t.jsx)(a,{scope:r,itemMap:i,collectionRef:o,children:n})};l.displayName=r;let s=e+"CollectionSlot",c=x.default.forwardRef((e,r)=>{let{scope:n,children:o}=e,a=i(s,n),l=(0,O.useComposedRefs)(r,a.collectionRef);return(0,t.jsx)(_.Slot,{ref:l,children:o})});c.displayName=s;let u=e+"CollectionItemSlot",d="data-radix-collection-item",f=x.default.forwardRef((e,r)=>{let{scope:n,children:o,...a}=e,l=x.default.useRef(null),s=(0,O.useComposedRefs)(r,l),c=i(u,n);return x.default.useEffect(()=>(c.itemMap.set(l,{ref:l,...a}),()=>void c.itemMap.delete(l))),(0,t.jsx)(_.Slot,{...{[d]:""},ref:s,children:o})});return f.displayName=u,[{Provider:l,Slot:c,ItemSlot:f},function(t){let r=i(e+"CollectionConsumer",t);return x.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},o]}e.s(["createCollection",()=>H],34811);var z=x.createContext(void 0);function B(e){let t=x.useContext(z);return e||t||"ltr"}e.s(["useDirection",()=>B],79096);var $=e.i(28698),K=e.i(49989),V=e.i(76400),U=e.i(21471);let W=["top","right","bottom","left"],G=Math.min,q=Math.max,X=Math.round,Y=Math.floor,Z=e=>({x:e,y:e}),J={left:"right",right:"left",bottom:"top",top:"bottom"},Q={start:"end",end:"start"};function ee(e,t){return"function"==typeof e?e(t):e}function et(e){return e.split("-")[0]}function er(e){return e.split("-")[1]}function en(e){return"x"===e?"y":"x"}function eo(e){return"y"===e?"height":"width"}let ea=new Set(["top","bottom"]);function ei(e){return ea.has(et(e))?"y":"x"}function el(e){return e.replace(/start|end/g,e=>Q[e])}let es=["left","right"],ec=["right","left"],eu=["top","bottom"],ed=["bottom","top"];function ef(e){return e.replace(/left|right|bottom|top/g,e=>J[e])}function ep(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function em(e){let{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 eh(e,t,r){let n,{reference:o,floating:a}=e,i=ei(t),l=en(ei(t)),s=eo(l),c=et(t),u="y"===i,d=o.x+o.width/2-a.width/2,f=o.y+o.height/2-a.height/2,p=o[s]/2-a[s]/2;switch(c){case"top":n={x:d,y:o.y-a.height};break;case"bottom":n={x:d,y:o.y+o.height};break;case"right":n={x:o.x+o.width,y:f};break;case"left":n={x:o.x-a.width,y:f};break;default:n={x:o.x,y:o.y}}switch(er(t)){case"start":n[l]-=p*(r&&u?-1:1);break;case"end":n[l]+=p*(r&&u?-1:1)}return n}let ex=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,l=a.filter(Boolean),s=await (null==i.isRTL?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=eh(c,n,s),f=n,p={},m=0;for(let r=0;r<l.length;r++){let{name:a,fn:h}=l[r],{x:x,y:g,data:v,reset:w}=await h({x:u,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=x?x:u,d=null!=g?g:d,p={...p,[a]:{...p[a],...v}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:d}=eh(c,f,s)),r=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}};async function eg(e,t){var r;void 0===t&&(t={});let{x:n,y:o,platform:a,rects:i,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=ee(t,e),m=ep(p),h=l[f?"floating"===d?"reference":"floating":d],x=em(await a.getClippingRect({element:null==(r=await (null==a.isElement?void 0:a.isElement(h)))||r?h:h.contextElement||await (null==a.getDocumentElement?void 0:a.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g="floating"===d?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await (null==a.getOffsetParent?void 0:a.getOffsetParent(l.floating)),w=await (null==a.isElement?void 0:a.isElement(v))&&await (null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},y=em(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:v,strategy:s}):g);return{top:(x.top-y.top+m.top)/w.y,bottom:(y.bottom-x.bottom+m.bottom)/w.y,left:(x.left-y.left+m.left)/w.x,right:(y.right-x.right+m.right)/w.x}}function ev(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ew(e){return W.some(t=>e[t]>=0)}let ey=new Set(["left","top"]);async function eb(e,t){let{placement:r,platform:n,elements:o}=e,a=await (null==n.isRTL?void 0:n.isRTL(o.floating)),i=et(r),l=er(r),s="y"===ei(r),c=ey.has(i)?-1:1,u=a&&s?-1:1,d=ee(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof m&&(p="end"===l?-1*m:m),s?{x:p*u,y:f*c}:{x:f*c,y:p*u}}function ej(){return"undefined"!=typeof window}function eR(e){return eE(e)?(e.nodeName||"").toLowerCase():"#document"}function eC(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ek(e){var t;return null==(t=(eE(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function eE(e){return!!ej()&&(e instanceof Node||e instanceof eC(e).Node)}function eN(e){return!!ej()&&(e instanceof Element||e instanceof eC(e).Element)}function eS(e){return!!ej()&&(e instanceof HTMLElement||e instanceof eC(e).HTMLElement)}function eP(e){return!!ej()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof eC(e).ShadowRoot)}let eM=new Set(["inline","contents"]);function eA(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=e$(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!eM.has(o)}let eD=new Set(["table","td","th"]),eT=[":popover-open",":modal"];function eL(e){return eT.some(t=>{try{return e.matches(t)}catch(e){return!1}})}let eI=["transform","translate","scale","rotate","perspective"],eO=["transform","translate","scale","rotate","perspective","filter"],eF=["paint","layout","strict","content"];function e_(e){let t=eH(),r=eN(e)?e$(e):e;return eI.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||eO.some(e=>(r.willChange||"").includes(e))||eF.some(e=>(r.contain||"").includes(e))}function eH(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let ez=new Set(["html","body","#document"]);function eB(e){return ez.has(eR(e))}function e$(e){return eC(e).getComputedStyle(e)}function eK(e){return eN(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eV(e){if("html"===eR(e))return e;let t=e.assignedSlot||e.parentNode||eP(e)&&e.host||ek(e);return eP(t)?t.host:t}function eU(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let o=function e(t){let r=eV(t);return eB(r)?t.ownerDocument?t.ownerDocument.body:t.body:eS(r)&&eA(r)?r:e(r)}(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=eC(o);if(a){let e=eW(i);return t.concat(i,i.visualViewport||[],eA(o)?o:[],e&&r?eU(e):[])}return t.concat(o,eU(o,[],r))}function eW(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eG(e){let t=e$(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=eS(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,l=X(r)!==a||X(n)!==i;return l&&(r=a,n=i),{width:r,height:n,$:l}}function eq(e){return eN(e)?e:e.contextElement}function eX(e){let t=eq(e);if(!eS(t))return Z(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:a}=eG(t),i=(a?X(r.width):r.width)/n,l=(a?X(r.height):r.height)/o;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}let eY=Z(0);function eZ(e){let t=eC(e);return eH()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eY}function eJ(e,t,r,n){var o;void 0===t&&(t=!1),void 0===r&&(r=!1);let a=e.getBoundingClientRect(),i=eq(e),l=Z(1);t&&(n?eN(n)&&(l=eX(n)):l=eX(e));let s=(void 0===(o=r)&&(o=!1),n&&(!o||n===eC(i))&&o)?eZ(i):Z(0),c=(a.left+s.x)/l.x,u=(a.top+s.y)/l.y,d=a.width/l.x,f=a.height/l.y;if(i){let e=eC(i),t=n&&eN(n)?eC(n):n,r=e,o=eW(r);for(;o&&n&&t!==r;){let e=eX(o),t=o.getBoundingClientRect(),n=e$(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=a,u+=i,o=eW(r=eC(o))}}return em({width:d,height:f,x:c,y:u})}function eQ(e,t){let r=eK(e).scrollLeft;return t?t.left+r:eJ(ek(e)).left+r}function e0(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-eQ(e,r),y:r.top+t.scrollTop}}let e1=new Set(["absolute","fixed"]);function e2(e,t,r){var n;let o;if("viewport"===t)o=function(e,t){let r=eC(e),n=ek(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,l=0,s=0;if(o){a=o.width,i=o.height;let e=eH();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}let c=eQ(n);if(c<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,i=Math.abs(n.clientWidth-t.clientWidth-o);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:l,y:s}}(e,r);else if("document"===t){let t,r,a,i,l,s,c;n=ek(e),t=ek(n),r=eK(n),a=n.ownerDocument.body,i=q(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),l=q(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight),s=-r.scrollLeft+eQ(n),c=-r.scrollTop,"rtl"===e$(a).direction&&(s+=q(t.clientWidth,a.clientWidth)-i),o={width:i,height:l,x:s,y:c}}else if(eN(t)){let e,n,a,i,l,s;n=(e=eJ(t,!0,"fixed"===r)).top+t.clientTop,a=e.left+t.clientLeft,i=eS(t)?eX(t):Z(1),l=t.clientWidth*i.x,s=t.clientHeight*i.y,o={width:l,height:s,x:a*i.x,y:n*i.y}}else{let r=eZ(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return em(o)}function e7(e){return"static"===e$(e).position}function e4(e,t){if(!eS(e)||"fixed"===e$(e).position)return null;if(t)return t(e);let r=e.offsetParent;return ek(e)===r&&(r=r.ownerDocument.body),r}function e3(e,t){var r;let n=eC(e);if(eL(e))return n;if(!eS(e)){let t=eV(e);for(;t&&!eB(t);){if(eN(t)&&!e7(t))return t;t=eV(t)}return n}let o=e4(e,t);for(;o&&(r=o,eD.has(eR(r)))&&e7(o);)o=e4(o,t);return o&&eB(o)&&e7(o)&&!e_(o)?n:o||function(e){let t=eV(e);for(;eS(t)&&!eB(t);){if(e_(t))return t;if(eL(t))break;t=eV(t)}return null}(e)||n}let e5=async function(e){let t=this.getOffsetParent||e3,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=eS(t),o=ek(t),a="fixed"===r,i=eJ(e,!0,a,t),l={scrollLeft:0,scrollTop:0},s=Z(0);if(n||!n&&!a)if(("body"!==eR(t)||eA(o))&&(l=eK(t)),n){let e=eJ(t,!0,a,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=eQ(o));a&&!n&&o&&(s.x=eQ(o));let c=!o||n||a?Z(0):e0(o,l);return{x:i.left+l.scrollLeft-s.x-c.x,y:i.top+l.scrollTop-s.y-c.y,width:i.width,height:i.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},e6={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,a="fixed"===o,i=ek(n),l=!!t&&eL(t.floating);if(n===i||l&&a)return r;let s={scrollLeft:0,scrollTop:0},c=Z(1),u=Z(0),d=eS(n);if((d||!d&&!a)&&(("body"!==eR(n)||eA(i))&&(s=eK(n)),eS(n))){let e=eJ(n);c=eX(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}let f=!i||d||a?Z(0):e0(i,s);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-s.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-s.scrollTop*c.y+u.y+f.y}},getDocumentElement:ek,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,a=[..."clippingAncestors"===r?eL(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=eU(e,[],!1).filter(e=>eN(e)&&"body"!==eR(e)),o=null,a="fixed"===e$(e).position,i=a?eV(e):e;for(;eN(i)&&!eB(i);){let t=e$(i),r=e_(i);r||"fixed"!==t.position||(o=null),(a?!r&&!o:!r&&"static"===t.position&&!!o&&e1.has(o.position)||eA(i)&&!r&&function e(t,r){let n=eV(t);return!(n===r||!eN(n)||eB(n))&&("fixed"===e$(n).position||e(n,r))}(e,i))?n=n.filter(e=>e!==i):o=t,i=eV(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=a[0],l=a.reduce((e,r)=>{let n=e2(t,r,o);return e.top=q(n.top,e.top),e.right=G(n.right,e.right),e.bottom=G(n.bottom,e.bottom),e.left=q(n.left,e.left),e},e2(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:e3,getElementRects:e5,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=eG(e);return{width:t,height:r}},getScale:eX,isElement:eN,isRTL:function(e){return"rtl"===e$(e).direction}};function e8(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let e9=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:a,platform:i,elements:l,middlewareData:s}=t,{element:c,padding:u=0}=ee(e,t)||{};if(null==c)return{};let d=ep(u),f={x:r,y:n},p=en(ei(o)),m=eo(p),h=await i.getDimensions(c),x="y"===p,g=x?"clientHeight":"clientWidth",v=a.reference[m]+a.reference[p]-f[p]-a.floating[m],w=f[p]-a.reference[p],y=await (null==i.getOffsetParent?void 0:i.getOffsetParent(c)),b=y?y[g]:0;b&&await (null==i.isElement?void 0:i.isElement(y))||(b=l.floating[g]||a.floating[m]);let j=b/2-h[m]/2-1,R=G(d[x?"top":"left"],j),C=G(d[x?"bottom":"right"],j),k=b-h[m]-C,E=b/2-h[m]/2+(v/2-w/2),N=q(R,G(E,k)),S=!s.arrow&&null!=er(o)&&E!==N&&a.reference[m]/2-(E<R?R:C)-h[m]/2<0,P=S?E<R?E-R:E-k:0;return{[p]:f[p]+P,data:{[p]:N,centerOffset:E-N-P,...S&&{alignmentOffset:P}},reset:S}}});var te=e.i(76124),tt="undefined"!=typeof document?x.useLayoutEffect:function(){};function tr(e,t){let r,n,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!tr(e[n],t[n]))return!1;return!0}if((r=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){let r=o[n];if(("_owner"!==r||!e.$$typeof)&&!tr(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function tn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function to(e,t){let r=tn(e);return Math.round(t*r)/r}function ta(e){let t=x.useRef(e);return tt(()=>{t.current=e}),t}var ti=x.forwardRef((e,r)=>{let{children:n,width:o=10,height:a=5,...i}=e;return(0,t.jsx)(y.Primitive.svg,{...i,ref:r,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,t.jsx)("polygon",{points:"0,0 30,0 15,10"})})});function tl(e){let[t,r]=x.useState(void 0);return(0,w.useLayoutEffect)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,o;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,o=t.blockSize}else n=e.offsetWidth,o=e.offsetHeight;r({width:n,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}ti.displayName="Arrow",e.s(["useSize",()=>tl],47934);var ts="Popper",[tc,tu]=(0,g.createContextScope)(ts),[td,tf]=tc(ts),tp=e=>{let{__scopePopper:r,children:n}=e,[o,a]=x.useState(null);return(0,t.jsx)(td,{scope:r,anchor:o,onAnchorChange:a,children:n})};tp.displayName=ts;var tm="PopperAnchor",th=x.forwardRef((e,r)=>{let{__scopePopper:n,virtualRef:o,...a}=e,i=tf(tm,n),l=x.useRef(null),s=(0,O.useComposedRefs)(r,l);return x.useEffect(()=>{i.onAnchorChange(o?.current||l.current)}),o?null:(0,t.jsx)(y.Primitive.div,{...a,ref:s})});th.displayName=tm;var tx="PopperContent",[tg,tv]=tc(tx),tw=x.forwardRef((e,r)=>{var n,o,a,i,l,s,c,u,d,f,p,m,h;let{__scopePopper:g,side:b="bottom",sideOffset:j=0,align:R="center",alignOffset:C=0,arrowPadding:k=0,avoidCollisions:E=!0,collisionBoundary:N=[],collisionPadding:S=0,sticky:P="partial",hideWhenDetached:M=!1,updatePositionStrategy:A="optimized",onPlaced:D,...T}=e,L=tf(tx,g),[I,F]=x.useState(null),_=(0,O.useComposedRefs)(r,e=>F(e)),[H,z]=x.useState(null),B=tl(H),$=B?.width??0,K=B?.height??0,V="number"==typeof S?S:{top:0,right:0,bottom:0,left:0,...S},U=Array.isArray(N)?N:[N],W=U.length>0,X={padding:V,boundary:U.filter(tR),altBoundary:W},{refs:Z,floatingStyles:J,placement:Q,isPositioned:ea,middlewareData:ep}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:s,open:c}=e,[u,d]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=x.useState(n);tr(f,n)||p(n);let[m,h]=x.useState(null),[g,v]=x.useState(null),w=x.useCallback(e=>{e!==R.current&&(R.current=e,h(e))},[]),y=x.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),b=a||m,j=i||g,R=x.useRef(null),C=x.useRef(null),k=x.useRef(u),E=null!=s,N=ta(s),S=ta(o),P=ta(c),M=x.useCallback(()=>{var e,n;let o,a,i;if(!R.current||!C.current)return;let l={placement:t,strategy:r,middleware:f};S.current&&(l.platform=S.current),(e=R.current,n=C.current,o=new Map,i={...(a={platform:e6,...l}).platform,_c:o},ex(e,n,{...a,platform:i})).then(e=>{let t={...e,isPositioned:!1!==P.current};A.current&&!tr(k.current,t)&&(k.current=t,te.flushSync(()=>{d(t)}))})},[f,t,r,S,P]);tt(()=>{!1===c&&k.current.isPositioned&&(k.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let A=x.useRef(!1);tt(()=>(A.current=!0,()=>{A.current=!1}),[]),tt(()=>{if(b&&(R.current=b),j&&(C.current=j),b&&j){if(N.current)return N.current(b,j,M);M()}},[b,j,M,N,E]);let D=x.useMemo(()=>({reference:R,floating:C,setReference:w,setFloating:y}),[w,y]),T=x.useMemo(()=>({reference:b,floating:j}),[b,j]),L=x.useMemo(()=>{let e={position:r,left:0,top:0};if(!T.floating)return e;let t=to(T.floating,u.x),n=to(T.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...tn(T.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,T.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:M,refs:D,elements:T,floatingStyles:L}),[u,M,D,T,L])}({strategy:"fixed",placement:b+("center"!==R?"-"+R:""),whileElementsMounted:(...e)=>(function(e,t,r,n){let o;void 0===n&&(n={});let{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,u=eq(e),d=a||i?[...u?eU(u):[],...eU(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)});let f=u&&s?function(e,t){let r,n=null,o=ek(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function i(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),a();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(l||t(),!f||!p)return;let m={rootMargin:-Y(d)+"px "+-Y(o.clientWidth-(u+f))+"px "+-Y(o.clientHeight-(d+p))+"px "+-Y(u)+"px",threshold:q(0,G(1,s))||1},h=!0;function x(t){let n=t[0].intersectionRatio;if(n!==s){if(!h)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||e8(c,e.getBoundingClientRect())||i(),h=!1}try{n=new IntersectionObserver(x,{...m,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(x,m)}n.observe(e)}(!0),a}(u,r):null,p=-1,m=null;l&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),u&&!c&&m.observe(u),m.observe(t));let h=c?eJ(e):null;return c&&function t(){let n=eJ(e);h&&!e8(h,n)&&r(),h=n,o=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(o)}})(...e,{animationFrame:"always"===A}),elements:{reference:L.anchor},middleware:[{...{name:"offset",options:o=n={mainAxis:j+K,alignmentAxis:C},async fn(e){var t,r;let{x:n,y:a,placement:i,middlewareData:l}=e,s=await eb(e,o);return i===(null==(t=l.offset)?void 0:t.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:n+s.x,y:a+s.y,data:{...s,placement:i}}}},options:[n,void 0]},E&&{...{name:"shift",options:l=i={mainAxis:!0,crossAxis:!1,limiter:"partial"===P?{...(a=void 0,{options:a={},fn(e){let{x:t,y:r,placement:n,rects:o,middlewareData:i}=e,{offset:l=0,mainAxis:s=!0,crossAxis:c=!0}=ee(a,e),u={x:t,y:r},d=ei(n),f=en(d),p=u[f],m=u[d],h=ee(l,e),x="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){let e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+x.mainAxis,r=o.reference[f]+o.reference[e]-x.mainAxis;p<t?p=t:p>r&&(p=r)}if(c){var g,v;let e="y"===f?"width":"height",t=ey.has(et(n)),r=o.reference[d]-o.floating[e]+(t&&(null==(g=i.offset)?void 0:g[d])||0)+(t?0:x.crossAxis),a=o.reference[d]+o.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?x.crossAxis:0);m<r?m=r:m>a&&(m=a)}return{[f]:p,[d]:m}}}),options:[void 0,void 0]}:void 0,...X},async fn(e){let{x:t,y:r,placement:n}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:i={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=ee(l,e),c={x:t,y:r},u=await eg(e,s),d=ei(et(n)),f=en(d),p=c[f],m=c[d];if(o){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=p+u[e],n=p-u[t];p=q(r,G(p,n))}if(a){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=m+u[e],n=m-u[t];m=q(r,G(m,n))}let h=i.fn({...e,[f]:p,[d]:m});return{...h,data:{x:h.x-t,y:h.y-r,enabled:{[f]:o,[d]:a}}}}},options:[i,void 0]},E&&{...{name:"flip",options:c=s={...X},async fn(e){var t,r,n,o,a,i,l,s;let u,d,f,{placement:p,middlewareData:m,rects:h,initialPlacement:x,platform:g,elements:v}=e,{mainAxis:w=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:j="bestFit",fallbackAxisSideDirection:R="none",flipAlignment:C=!0,...k}=ee(c,e);if(null!=(t=m.arrow)&&t.alignmentOffset)return{};let E=et(p),N=ei(x),S=et(x)===x,P=await (null==g.isRTL?void 0:g.isRTL(v.floating)),M=b||(S||!C?[ef(x)]:(u=ef(x),[el(x),u,el(u)])),A="none"!==R;!b&&A&&M.push(...(d=er(x),f=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?ec:es;return t?es:ec;case"left":case"right":return t?eu:ed;default:return[]}}(et(x),"start"===R,P),d&&(f=f.map(e=>e+"-"+d),C&&(f=f.concat(f.map(el)))),f));let D=[x,...M],T=await eg(e,k),L=[],I=(null==(r=m.flip)?void 0:r.overflows)||[];if(w&&L.push(T[E]),y){let e,t,r,n,o=(i=p,l=h,void 0===(s=P)&&(s=!1),e=er(i),r=eo(t=en(ei(i))),n="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",l.reference[r]>l.floating[r]&&(n=ef(n)),[n,ef(n)]);L.push(T[o[0]],T[o[1]])}if(I=[...I,{placement:p,overflows:L}],!L.every(e=>e<=0)){let e=((null==(n=m.flip)?void 0:n.index)||0)+1,t=D[e];if(t&&("alignment"!==y||N===ei(t)||I.every(e=>ei(e.placement)!==N||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}};let r=null==(o=I.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(j){case"bestFit":{let e=null==(a=I.filter(e=>{if(A){let t=ei(e.placement);return t===N||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=x}if(p!==r)return{reset:{placement:r}}}return{}}},options:[s,void 0]},{...{name:"size",options:d=u={...X,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{let{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}},async fn(e){var t,r;let n,o,{placement:a,rects:i,platform:l,elements:s}=e,{apply:c=()=>{},...u}=ee(d,e),f=await eg(e,u),p=et(a),m=er(a),h="y"===ei(a),{width:x,height:g}=i.floating;"top"===p||"bottom"===p?(n=p,o=m===(await (null==l.isRTL?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(o=p,n="end"===m?"top":"bottom");let v=g-f.top-f.bottom,w=x-f.left-f.right,y=G(g-f[n],v),b=G(x-f[o],w),j=!e.middlewareData.shift,R=y,C=b;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(C=w),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(R=v),j&&!m){let e=q(f.left,0),t=q(f.right,0),r=q(f.top,0),n=q(f.bottom,0);h?C=x-2*(0!==e||0!==t?e+t:q(f.left,f.right)):R=g-2*(0!==r||0!==n?r+n:q(f.top,f.bottom))}await c({...e,availableWidth:C,availableHeight:R});let k=await l.getDimensions(s.floating);return x!==k.width||g!==k.height?{reset:{rects:!0}}:{}}},options:[u,void 0]},H&&{...{name:"arrow",options:p=f={element:H,padding:k},fn(e){let{element:t,padding:r}="function"==typeof p?p(e):p;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?e9({element:t.current,padding:r}).fn(e):{}:t?e9({element:t,padding:r}).fn(e):{}}},options:[f,void 0]},tC({arrowWidth:$,arrowHeight:K}),M&&{...{name:"hide",options:h=m={strategy:"referenceHidden",...X},async fn(e){let{rects:t}=e,{strategy:r="referenceHidden",...n}=ee(h,e);switch(r){case"referenceHidden":{let r=ev(await eg(e,{...n,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:ew(r)}}}case"escaped":{let r=ev(await eg(e,{...n,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:ew(r)}}}default:return{}}}},options:[m,void 0]}]}),[em,eh]=tk(Q),ej=(0,v.useCallbackRef)(D);(0,w.useLayoutEffect)(()=>{ea&&ej?.()},[ea,ej]);let eR=ep.arrow?.x,eC=ep.arrow?.y,eE=ep.arrow?.centerOffset!==0,[eN,eS]=x.useState();return(0,w.useLayoutEffect)(()=>{I&&eS(window.getComputedStyle(I).zIndex)},[I]),(0,t.jsx)("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:ea?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eN,"--radix-popper-transform-origin":[ep.transformOrigin?.x,ep.transformOrigin?.y].join(" "),...ep.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,t.jsx)(tg,{scope:g,placedSide:em,onArrowChange:z,arrowX:eR,arrowY:eC,shouldHideArrow:eE,children:(0,t.jsx)(y.Primitive.div,{"data-side":em,"data-align":eh,...T,ref:_,style:{...T.style,animation:ea?void 0:"none"}})})})});tw.displayName=tx;var ty="PopperArrow",tb={top:"bottom",right:"left",bottom:"top",left:"right"},tj=x.forwardRef(function(e,r){let{__scopePopper:n,...o}=e,a=tv(ty,n),i=tb[a.placedSide];return(0,t.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:(0,t.jsx)(ti,{...o,ref:r,style:{...o.style,display:"block"}})})});function tR(e){return null!==e}tj.displayName=ty;var tC=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,c]=tk(r),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+l/2,p="",m="";return"bottom"===s?(p=a?u:`${d}px`,m=`${-l}px`):"top"===s?(p=a?u:`${d}px`,m=`${n.floating.height+l}px`):"right"===s?(p=`${-l}px`,m=a?u:`${f}px`):"left"===s&&(p=`${n.floating.width+l}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function tk(e){let[t,r="center"]=e.split("-");return[t,r]}e.s(["Anchor",()=>th,"Arrow",()=>tj,"Content",()=>tw,"Root",()=>tp,"createPopperScope",()=>tu],77760);var tE=e.i(61896),tN=e.i(19594),tS="rovingFocusGroup.onEntryFocus",tP={bubbles:!1,cancelable:!0},tM="RovingFocusGroup",[tA,tD,tT]=H(tM),[tL,tI]=(0,g.createContextScope)(tM,[tT]),[tO,tF]=tL(tM),t_=x.forwardRef((e,r)=>(0,t.jsx)(tA.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(tA.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(tH,{...e,ref:r})})}));t_.displayName=tM;var tH=x.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=x.useRef(null),m=(0,O.useComposedRefs)(r,p),h=B(i),[g=null,w]=(0,F.useControllableState)({prop:l,defaultProp:s,onChange:c}),[b,j]=x.useState(!1),R=(0,v.useCallbackRef)(u),C=tD(n),k=x.useRef(!1),[E,N]=x.useState(0);return x.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(tS,R),()=>e.removeEventListener(tS,R)},[R]),(0,t.jsx)(tO,{scope:n,orientation:o,dir:h,loop:a,currentTabStopId:g,onItemFocus:x.useCallback(e=>w(e),[w]),onItemShiftTab:x.useCallback(()=>j(!0),[]),onFocusableItemAdd:x.useCallback(()=>N(e=>e+1),[]),onFocusableItemRemove:x.useCallback(()=>N(e=>e-1),[]),children:(0,t.jsx)(y.Primitive.div,{tabIndex:b||0===E?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:(0,I.composeEventHandlers)(e.onMouseDown,()=>{k.current=!0}),onFocus:(0,I.composeEventHandlers)(e.onFocus,e=>{let t=!k.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(tS,tP);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);tK([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}k.current=!1}),onBlur:(0,I.composeEventHandlers)(e.onBlur,()=>j(!1))})})}),tz="RovingFocusGroupItem",tB=x.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:i,...l}=e,s=(0,U.useId)(),c=i||s,u=tF(tz,n),d=u.currentTabStopId===c,f=tD(n),{onFocusableItemAdd:p,onFocusableItemRemove:m}=u;return x.useEffect(()=>{if(o)return p(),()=>m()},[o,p,m]),(0,t.jsx)(tA.ItemSlot,{scope:n,id:c,focusable:o,active:a,children:(0,t.jsx)(y.Primitive.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...l,ref:r,onMouseDown:(0,I.composeEventHandlers)(e.onMouseDown,e=>{o?u.onItemFocus(c):e.preventDefault()}),onFocus:(0,I.composeEventHandlers)(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:(0,I.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void u.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let o=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return t$[o]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){var r,n;"prev"===t&&o.reverse();let a=o.indexOf(e.currentTarget);o=u.loop?(r=o,n=a+1,r.map((e,t)=>r[(n+t)%r.length])):o.slice(a+1)}setTimeout(()=>tK(o))}})})})});tB.displayName=tz;var t$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tK(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",()=>tB,"Root",()=>t_,"createRovingFocusGroupScope",()=>tI],88434);var tV=e.i(89123),tU=e.i(19706),tW=["Enter"," "],tG=["ArrowUp","PageDown","End"],tq=["ArrowDown","PageUp","Home",...tG],tX={ltr:[...tW,"ArrowRight"],rtl:[...tW,"ArrowLeft"]},tY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},tZ="Menu",[tJ,tQ,t0]=H(tZ),[t1,t2]=(0,g.createContextScope)(tZ,[t0,tu,tI]),t7=tu(),t4=tI(),[t3,t5]=t1(tZ),[t6,t8]=t1(tZ),t9=e=>{let{__scopeMenu:r,open:n=!1,children:o,dir:a,onOpenChange:i,modal:l=!0}=e,s=t7(r),[c,u]=x.useState(null),d=x.useRef(!1),f=(0,v.useCallbackRef)(i),p=B(a);return x.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,t.jsx)(tp,{...s,children:(0,t.jsx)(t3,{scope:r,open:n,onOpenChange:f,content:c,onContentChange:u,children:(0,t.jsx)(t6,{scope:r,onClose:x.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:l,children:o})})})};t9.displayName=tZ;var re=x.forwardRef((e,r)=>{let{__scopeMenu:n,...o}=e,a=t7(n);return(0,t.jsx)(th,{...a,...o,ref:r})});re.displayName="MenuAnchor";var rt="MenuPortal",[rr,rn]=t1(rt,{forceMount:void 0}),ro=e=>{let{__scopeMenu:r,forceMount:n,children:o,container:a}=e,i=t5(rt,r);return(0,t.jsx)(rr,{scope:r,forceMount:n,children:(0,t.jsx)(tN.Presence,{present:n||i.open,children:(0,t.jsx)(tE.Portal,{asChild:!0,container:a,children:o})})})};ro.displayName=rt;var ra="MenuContent",[ri,rl]=t1(ra),rs=x.forwardRef((e,r)=>{let n=rn(ra,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=t5(ra,e.__scopeMenu),l=t8(ra,e.__scopeMenu);return(0,t.jsx)(tJ.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(tN.Presence,{present:o||i.open,children:(0,t.jsx)(tJ.Slot,{scope:e.__scopeMenu,children:l.modal?(0,t.jsx)(rc,{...a,ref:r}):(0,t.jsx)(ru,{...a,ref:r})})})})}),rc=x.forwardRef((e,r)=>{let n=t5(ra,e.__scopeMenu),o=x.useRef(null),a=(0,O.useComposedRefs)(r,o);return x.useEffect(()=>{let e=o.current;if(e)return(0,tV.hideOthers)(e)},[]),(0,t.jsx)(rd,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:(0,I.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ru=x.forwardRef((e,r)=>{let n=t5(ra,e.__scopeMenu);return(0,t.jsx)(rd,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),rd=x.forwardRef((e,r)=>{let{__scopeMenu:n,loop:o=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:h,...g}=e,v=t5(ra,n),w=t8(ra,n),y=t7(n),b=t4(n),j=tQ(n),[R,C]=x.useState(null),k=x.useRef(null),E=(0,O.useComposedRefs)(r,k,v.onContentChange),N=x.useRef(0),S=x.useRef(""),P=x.useRef(0),M=x.useRef(null),A=x.useRef("right"),D=x.useRef(0),T=h?tU.RemoveScroll:x.Fragment,L=h?{as:_.Slot,allowPinchZoom:!0}:void 0;x.useEffect(()=>()=>window.clearTimeout(N.current),[]),(0,K.useFocusGuards)();let F=x.useCallback(e=>{var t,r;return A.current===M.current?.side&&(t=e,!!(r=M.current?.area)&&function(e,t){let{x:r,y:n}=e,o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let i=t[e].x,l=t[e].y,s=t[a].x,c=t[a].y;l>n!=c>n&&r<(s-i)*(n-l)/(c-l)+i&&(o=!o)}return o}({x:t.clientX,y:t.clientY},r))},[]);return(0,t.jsx)(ri,{scope:n,searchRef:S,onItemEnter:x.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:x.useCallback(e=>{F(e)||(k.current?.focus(),C(null))},[F]),onTriggerLeave:x.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:P,onPointerGraceIntentChange:x.useCallback(e=>{M.current=e},[]),children:(0,t.jsx)(T,{...L,children:(0,t.jsx)(V.FocusScope,{asChild:!0,trapped:a,onMountAutoFocus:(0,I.composeEventHandlers)(i,e=>{e.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:(0,t.jsx)($.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:(0,t.jsx)(t_,{asChild:!0,...b,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:C,onEntryFocus:(0,I.composeEventHandlers)(c,e=>{w.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,t.jsx)(tw,{role:"menu","aria-orientation":"vertical","data-state":rF(v.open),"data-radix-menu-content":"",dir:w.dir,...y,...g,ref:E,style:{outline:"none",...g.style},onKeyDown:(0,I.composeEventHandlers)(g.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;if(t){var o;let t,a,i,l,s,c;"Tab"===e.key&&e.preventDefault(),!r&&n&&(o=e.key,t=S.current+o,a=j().filter(e=>!e.disabled),i=document.activeElement,l=a.find(e=>e.ref.current===i)?.textValue,s=function(e,t,r){var n;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1,i=(n=Math.max(a,0),e.map((t,r)=>e[(n+r)%e.length]));1===o.length&&(i=i.filter(e=>e!==r));let l=i.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}(a.map(e=>e.textValue),t,l),c=a.find(e=>e.textValue===s)?.ref.current,function e(t){S.current=t,window.clearTimeout(N.current),""!==t&&(N.current=window.setTimeout(()=>e(""),1e3))}(t),c&&setTimeout(()=>c.focus()))}let a=k.current;if(e.target!==a||!tq.includes(e.key))return;e.preventDefault();let i=j().filter(e=>!e.disabled).map(e=>e.ref.current);tG.includes(e.key)&&i.reverse(),function(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(i)}),onBlur:(0,I.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),S.current="")}),onPointerMove:(0,I.composeEventHandlers)(e.onPointerMove,rz(e=>{let t=e.target,r=D.current!==e.clientX;e.currentTarget.contains(t)&&r&&(A.current=e.clientX>D.current?"right":"left",D.current=e.clientX)}))})})})})})})});rs.displayName=ra;var rf=x.forwardRef((e,r)=>{let{__scopeMenu:n,...o}=e;return(0,t.jsx)(y.Primitive.div,{role:"group",...o,ref:r})});rf.displayName="MenuGroup";var rp=x.forwardRef((e,r)=>{let{__scopeMenu:n,...o}=e;return(0,t.jsx)(y.Primitive.div,{...o,ref:r})});rp.displayName="MenuLabel";var rm="MenuItem",rh="menu.itemSelect",rx=x.forwardRef((e,r)=>{let{disabled:n=!1,onSelect:o,...a}=e,i=x.useRef(null),l=t8(rm,e.__scopeMenu),s=rl(rm,e.__scopeMenu),c=(0,O.useComposedRefs)(r,i),u=x.useRef(!1);return(0,t.jsx)(rg,{...a,ref:c,disabled:n,onClick:(0,I.composeEventHandlers)(e.onClick,()=>{let e=i.current;if(!n&&e){let t=new CustomEvent(rh,{bubbles:!0,cancelable:!0});e.addEventListener(rh,e=>o?.(e),{once:!0}),(0,y.dispatchDiscreteCustomEvent)(e,t),t.defaultPrevented?u.current=!1:l.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:(0,I.composeEventHandlers)(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:(0,I.composeEventHandlers)(e.onKeyDown,e=>{let t=""!==s.searchRef.current;n||t&&" "===e.key||tW.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});rx.displayName=rm;var rg=x.forwardRef((e,r)=>{let{__scopeMenu:n,disabled:o=!1,textValue:a,...i}=e,l=rl(rm,n),s=t4(n),c=x.useRef(null),u=(0,O.useComposedRefs)(r,c),[d,f]=x.useState(!1),[p,m]=x.useState("");return x.useEffect(()=>{let e=c.current;e&&m((e.textContent??"").trim())},[i.children]),(0,t.jsx)(tJ.ItemSlot,{scope:n,disabled:o,textValue:a??p,children:(0,t.jsx)(tB,{asChild:!0,...s,focusable:!o,children:(0,t.jsx)(y.Primitive.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:u,onPointerMove:(0,I.composeEventHandlers)(e.onPointerMove,rz(e=>{o?l.onItemLeave(e):(l.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,I.composeEventHandlers)(e.onPointerLeave,rz(e=>l.onItemLeave(e))),onFocus:(0,I.composeEventHandlers)(e.onFocus,()=>f(!0)),onBlur:(0,I.composeEventHandlers)(e.onBlur,()=>f(!1))})})})}),rv=x.forwardRef((e,r)=>{let{checked:n=!1,onCheckedChange:o,...a}=e;return(0,t.jsx)(rE,{scope:e.__scopeMenu,checked:n,children:(0,t.jsx)(rx,{role:"menuitemcheckbox","aria-checked":r_(n)?"mixed":n,...a,ref:r,"data-state":rH(n),onSelect:(0,I.composeEventHandlers)(a.onSelect,()=>o?.(!!r_(n)||!n),{checkForDefaultPrevented:!1})})})});rv.displayName="MenuCheckboxItem";var rw="MenuRadioGroup",[ry,rb]=t1(rw,{value:void 0,onValueChange:()=>{}}),rj=x.forwardRef((e,r)=>{let{value:n,onValueChange:o,...a}=e,i=(0,v.useCallbackRef)(o);return(0,t.jsx)(ry,{scope:e.__scopeMenu,value:n,onValueChange:i,children:(0,t.jsx)(rf,{...a,ref:r})})});rj.displayName=rw;var rR="MenuRadioItem",rC=x.forwardRef((e,r)=>{let{value:n,...o}=e,a=rb(rR,e.__scopeMenu),i=n===a.value;return(0,t.jsx)(rE,{scope:e.__scopeMenu,checked:i,children:(0,t.jsx)(rx,{role:"menuitemradio","aria-checked":i,...o,ref:r,"data-state":rH(i),onSelect:(0,I.composeEventHandlers)(o.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});rC.displayName=rR;var rk="MenuItemIndicator",[rE,rN]=t1(rk,{checked:!1}),rS=x.forwardRef((e,r)=>{let{__scopeMenu:n,forceMount:o,...a}=e,i=rN(rk,n);return(0,t.jsx)(tN.Presence,{present:o||r_(i.checked)||!0===i.checked,children:(0,t.jsx)(y.Primitive.span,{...a,ref:r,"data-state":rH(i.checked)})})});rS.displayName=rk;var rP=x.forwardRef((e,r)=>{let{__scopeMenu:n,...o}=e;return(0,t.jsx)(y.Primitive.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})});rP.displayName="MenuSeparator";var rM=x.forwardRef((e,r)=>{let{__scopeMenu:n,...o}=e,a=t7(n);return(0,t.jsx)(tj,{...a,...o,ref:r})});rM.displayName="MenuArrow";var[rA,rD]=t1("MenuSub"),rT="MenuSubTrigger",rL=x.forwardRef((e,r)=>{let n=t5(rT,e.__scopeMenu),o=t8(rT,e.__scopeMenu),a=rD(rT,e.__scopeMenu),i=rl(rT,e.__scopeMenu),l=x.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},d=x.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return x.useEffect(()=>d,[d]),x.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,t.jsx)(re,{asChild:!0,...u,children:(0,t.jsx)(rg,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":rF(n.open),...e,ref:(0,O.composeRefs)(r,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:(0,I.composeEventHandlers)(e.onPointerMove,rz(t=>{i.onItemEnter(t),!t.defaultPrevented&&(e.disabled||n.open||l.current||(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100)))})),onPointerLeave:(0,I.composeEventHandlers)(e.onPointerLeave,rz(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,o="right"===r,a=t[o?"left":"right"],l=t[o?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+(o?-5:5),y:e.clientY},{x:a,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:a,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:(0,I.composeEventHandlers)(e.onKeyDown,t=>{let r=""!==i.searchRef.current;e.disabled||r&&" "===t.key||tX[o.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});rL.displayName=rT;var rI="MenuSubContent",rO=x.forwardRef((e,r)=>{let n=rn(ra,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=t5(ra,e.__scopeMenu),l=t8(ra,e.__scopeMenu),s=rD(rI,e.__scopeMenu),c=x.useRef(null),u=(0,O.useComposedRefs)(r,c);return(0,t.jsx)(tJ.Provider,{scope:e.__scopeMenu,children:(0,t.jsx)(tN.Presence,{present:o||i.open,children:(0,t.jsx)(tJ.Slot,{scope:e.__scopeMenu,children:(0,t.jsx)(rd,{id:s.contentId,"aria-labelledby":s.triggerId,...a,ref:u,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,I.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:(0,I.composeEventHandlers)(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:(0,I.composeEventHandlers)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),r=tY[l.dir].includes(e.key);t&&r&&(i.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});function rF(e){return e?"open":"closed"}function r_(e){return"indeterminate"===e}function rH(e){return r_(e)?"indeterminate":e?"checked":"unchecked"}function rz(e){return t=>"mouse"===t.pointerType?e(t):void 0}rO.displayName=rI;var rB="DropdownMenu",[r$,rK]=(0,g.createContextScope)(rB,[t2]),rV=t2(),[rU,rW]=r$(rB),rG=e=>{let{__scopeDropdownMenu:r,children:n,dir:o,open:a,defaultOpen:i,onOpenChange:l,modal:s=!0}=e,c=rV(r),u=x.useRef(null),[d=!1,f]=(0,F.useControllableState)({prop:a,defaultProp:i,onChange:l});return(0,t.jsx)(rU,{scope:r,triggerId:(0,U.useId)(),triggerRef:u,contentId:(0,U.useId)(),open:d,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(e=>!e),[f]),modal:s,children:(0,t.jsx)(t9,{...c,open:d,onOpenChange:f,dir:o,modal:s,children:n})})};rG.displayName=rB;var rq="DropdownMenuTrigger",rX=x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,disabled:o=!1,...a}=e,i=rW(rq,n),l=rV(n);return(0,t.jsx)(re,{asChild:!0,...l,children:(0,t.jsx)(y.Primitive.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:(0,O.composeRefs)(r,i.triggerRef),onPointerDown:(0,I.composeEventHandlers)(e.onPointerDown,e=>{!o&&0===e.button&&!1===e.ctrlKey&&(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:(0,I.composeEventHandlers)(e.onKeyDown,e=>{!o&&(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});rX.displayName=rq;var rY=e=>{let{__scopeDropdownMenu:r,...n}=e,o=rV(r);return(0,t.jsx)(ro,{...o,...n})};rY.displayName="DropdownMenuPortal";var rZ="DropdownMenuContent",rJ=x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rW(rZ,n),i=rV(n),l=x.useRef(!1);return(0,t.jsx)(rs,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...o,ref:r,onCloseAutoFocus:(0,I.composeEventHandlers)(e.onCloseAutoFocus,e=>{l.current||a.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:(0,I.composeEventHandlers)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rJ.displayName=rZ,x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rf,{...a,...o,ref:r})}).displayName="DropdownMenuGroup";var rQ=x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rp,{...a,...o,ref:r})});rQ.displayName="DropdownMenuLabel";var r0=x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rx,{...a,...o,ref:r})});r0.displayName="DropdownMenuItem",x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rv,{...a,...o,ref:r})}).displayName="DropdownMenuCheckboxItem",x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rj,{...a,...o,ref:r})}).displayName="DropdownMenuRadioGroup",x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rC,{...a,...o,ref:r})}).displayName="DropdownMenuRadioItem",x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rS,{...a,...o,ref:r})}).displayName="DropdownMenuItemIndicator";var r1=x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rP,{...a,...o,ref:r})});r1.displayName="DropdownMenuSeparator",x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rM,{...a,...o,ref:r})}).displayName="DropdownMenuArrow",x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rL,{...a,...o,ref:r})}).displayName="DropdownMenuSubTrigger",x.forwardRef((e,r)=>{let{__scopeDropdownMenu:n,...o}=e,a=rV(n);return(0,t.jsx)(rO,{...a,...o,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";let r2=(0,o.default)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function r7({...e}){return(0,t.jsx)(rG,{"data-slot":"dropdown-menu",...e})}function r4({...e}){return(0,t.jsx)(rX,{"data-slot":"dropdown-menu-trigger",...e})}function r3({className:e,sideOffset:r=4,...n}){return(0,t.jsx)(rY,{children:(0,t.jsx)(rJ,{"data-slot":"dropdown-menu-content",sideOffset:r,className:(0,A.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function r5({className:e,inset:r,variant:n="default",...o}){return(0,t.jsx)(r0,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":n,className:(0,A.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o})}function r6({className:e,inset:r,...n}){return(0,t.jsx)(rQ,{"data-slot":"dropdown-menu-label","data-inset":r,className:(0,A.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function r8({className:e,...r}){return(0,t.jsx)(r1,{"data-slot":"dropdown-menu-separator",className:(0,A.cn)("bg-border -mx-1 my-1 h-px",e),...r})}e.s(["CheckIcon",()=>r2],68072),(0,o.default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),(0,o.default)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var r9=e.i(92879),ne=e.i(69074),nt=e.i(87830),nr=e.i(75212);function nn(){let{searchMembers:e,searchResults:o}=(0,r9.useFamily)(),{data:g,status:v}=(0,nt.useSession)(),{showAlert:w,showConfirm:y,showPrompt:b}=(0,nr.useDialog)(),j=(0,ne.usePathname)(),R=(0,ne.useSearchParams)(),[C,k]=(0,x.useState)(""),[E,N]=(0,x.useState)(!1),[S,P]=(0,x.useState)([]),[M,A]=(0,x.useState)(null),[I,O]=(0,x.useState)(null),F=(0,x.useRef)(null),_=(0,ne.useRouter)(),H=R.get("view")||"traditional",z=e=>M?.id?`${e}?treeId=${M.id}`:e,B=e=>{let t=new URLSearchParams(R.toString());t.set("view",e),M?.id&&t.set("treeId",M.id),_.push(`${j}?${t.toString()}`)},$=async()=>{await (0,nt.signOut)({callbackUrl:"/auth/signin"})},K=async(e,t)=>{if(t.stopPropagation(),e.ownerId!==g?.user?.id)return void await w("只有家族树的创建者才能删除","权限不足");let r=`确定要删除家族树"${e.name}"吗?
此操作将永久删除所有成员、活动日志和协作者数据,且不可撤销!`;if(await y(r,"删除家族树","destructive")){if(await b(`请输入家族树名称"${e.name}"以确认删除:`,"","确认删除")!==e.name)return void await w("名称不匹配,删除已取消","操作已取消");O(e.id);try{let t=await fetch(`/api/trees/${e.id}`,{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"删除失败")}await V(),M?.id===e.id&&(window.location.href="/")}catch(e){console.error("删除家族树失败:",e),await w("删除失败:"+e.message,"错误")}finally{O(null)}}},V=(0,x.useCallback)(()=>{if(!g?.user?.id||"authenticated"!==v)return;let e=new AbortController;return fetch("/api/trees",{signal:e.signal}).then(e=>{if(!e.ok)throw Error(`HTTP error! status: ${e.status}`);return e.json()}).then(e=>{if(e.trees){P(e.trees);let t=new URLSearchParams(window.location.search).get("treeId");if(t){let r=e.trees.find(e=>e.id===t);r?A(r):e.trees.length>0&&A(e.trees[0])}else e.trees.length>0&&A(e.trees[0])}}).catch(e=>{"AbortError"!==e.name&&"Failed to fetch"!==e.message&&console.error("获取家族树列表失败:",e)}),()=>e.abort()},[g?.user?.id,v]);return(0,x.useEffect)(()=>{V()},[V]),(0,x.useEffect)(()=>{let e=()=>{V()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[V]),(0,x.useEffect)(()=>{function e(e){F.current&&!F.current.contains(e.target)&&N(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsx)("header",{className:"sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:(0,t.jsxs)("div",{className:"container mx-auto flex h-16 items-center px-4",children:[(0,t.jsxs)("div",{className:"mr-8 flex items-center gap-4",children:[(0,t.jsxs)(r.default,{href:"/",className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-primary text-primary-foreground",children:(0,t.jsx)(n.BookOpen,{className:"h-5 w-5"})}),(0,t.jsx)("span",{className:"text-xl font-serif font-bold tracking-tight",children:"华夏谱"})]}),g&&S.length>0&&(0,t.jsxs)(r7,{children:[(0,t.jsx)(r4,{asChild:!0,children:(0,t.jsxs)(m.Button,{variant:"outline",className:"gap-2 min-w-[200px]",children:[(0,t.jsx)("span",{className:"flex-1 truncate text-left",children:M?.name||"选择家族树"}),(0,t.jsx)(c,{className:"h-4 w-4 flex-shrink-0"})]})}),(0,t.jsxs)(r3,{align:"start",className:"w-[var(--radix-dropdown-menu-trigger-width)] min-w-[200px]",children:[(0,t.jsx)(r6,{children:"我的家族树"}),(0,t.jsx)(r8,{}),S.map(e=>(0,t.jsxs)(r5,{onClick:()=>{A(e);let t=window.location.pathname;_.push(`${t}?treeId=${e.id}`)},className:"cursor-pointer flex items-center justify-between group",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(e=>{switch(e){case"OWNER":return(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-purple-100 text-purple-700 border border-purple-200 ml-2",children:"所有者"});case"EDITOR":return(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-blue-100 text-blue-700 border border-blue-200 ml-2",children:"编辑"});case"VIEWER":return(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-gray-100 text-gray-700 border border-gray-200 ml-2",children:"查看"});default:return null}})(e.currentUserRole)]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[M?.id===e.id&&(0,t.jsx)("span",{className:"text-primary",children:"✓"}),e.ownerId===g?.user?.id&&(0,t.jsx)(m.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-destructive hover:text-destructive-foreground",onClick:t=>K(e,t),disabled:I===e.id,children:(0,t.jsx)(d,{className:"h-3 w-3"})})]})]},e.id)),(0,t.jsx)(r8,{}),(0,t.jsxs)(r5,{onClick:()=>_.push("/trees/new"),className:"cursor-pointer text-primary",children:[(0,t.jsx)(u,{className:"h-4 w-4 mr-2"}),"创建新家族树"]})]})]})]}),(0,t.jsxs)("nav",{className:"hidden md:flex items-center gap-6 text-sm font-medium text-muted-foreground",children:[(0,t.jsx)(r.default,{href:z("/"),className:"transition-colors hover:text-foreground data-[active=true]:text-foreground data-[active=true]:font-semibold",children:"总览 (Overview)"}),(0,t.jsx)(r.default,{href:z("/tree"),className:"transition-colors hover:text-foreground",children:"族谱 (Tree)"}),(0,t.jsx)(r.default,{href:z("/members"),className:"transition-colors hover:text-foreground",children:"成员 (Members)"}),(0,t.jsx)(r.default,{href:z("/timeline"),className:"transition-colors hover:text-foreground",children:"大事记 (Timeline)"}),"/tree"===j&&(0,t.jsxs)(r7,{children:[(0,t.jsx)(r4,{asChild:!0,children:(0,t.jsxs)(m.Button,{variant:"outline",size:"sm",className:"gap-2",children:["traditional"===H?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f,{className:"h-4 w-4"}),"传统族谱"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p,{className:"h-4 w-4"}),"组织架构"]}),(0,t.jsx)(c,{className:"h-3 w-3"})]})}),(0,t.jsxs)(r3,{align:"end",children:[(0,t.jsx)(r6,{children:"显示模式"}),(0,t.jsx)(r8,{}),(0,t.jsxs)(r5,{onClick:()=>B("traditional"),children:[(0,t.jsx)(f,{className:"h-4 w-4 mr-2"}),"传统族谱","traditional"===H&&(0,t.jsx)("span",{className:"ml-auto text-primary",children:"✓"})]}),(0,t.jsxs)(r5,{onClick:()=>B("org-chart"),children:[(0,t.jsx)(p,{className:"h-4 w-4 mr-2"}),"组织架构","org-chart"===H&&(0,t.jsx)("span",{className:"ml-auto text-primary",children:"✓"})]})]})]})]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"relative hidden sm:block",ref:F,children:[(0,t.jsx)(a,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(h.Input,{type:"search",placeholder:"搜索成员...",value:C,onChange:t=>{var r;k(r=t.target.value),e(r),N(r.length>0)},className:"h-9 w-64 rounded-full bg-muted pl-9 text-sm focus-visible:ring-primary"}),E&&o.length>0&&(0,t.jsx)("div",{className:"absolute top-full mt-2 w-full bg-background border border-border rounded-lg shadow-lg max-h-96 overflow-y-auto z-50",children:o.map(e=>(0,t.jsx)("button",{onClick:()=>{var t;return t=e.id,void(_.push(`/members/${t}`),k(""),N(!1))},className:"w-full px-4 py-3 text-left hover:bg-muted transition-colors border-b border-border last:border-0",children:(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.fullName}),(0,t.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded ${"MALE"===e.gender?"bg-blue-100 text-blue-700":"bg-pink-100 text-pink-700"}`,children:"MALE"===e.gender?"男":"女"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["第",e.generation,"世"]})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:[e.birthDate&&`生于 ${e.birthDate}`,e.birthPlace&&` \xb7 ${e.birthPlace}`]})]})})},e.id))}),E&&C&&0===o.length&&(0,t.jsx)("div",{className:"absolute top-full mt-2 w-full bg-background border border-border rounded-lg shadow-lg p-4 text-center text-sm text-muted-foreground z-50",children:"未找到匹配的成员"})]}),(0,t.jsxs)(m.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",children:[(0,t.jsx)(i,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"sr-only",children:"Notifications"})]}),(0,t.jsx)(r.default,{href:"/settings",children:(0,t.jsxs)(m.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",children:[(0,t.jsx)(l,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"sr-only",children:"Settings"})]})}),"loading"===v?(0,t.jsx)(D,{className:"h-8 w-8 border border-border",children:(0,t.jsx)(L,{children:"..."})}):g?(0,t.jsxs)(r7,{children:[(0,t.jsx)(r4,{asChild:!0,children:(0,t.jsx)(m.Button,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:(0,t.jsxs)(D,{className:"h-8 w-8 border border-border",children:[(0,t.jsx)(T,{src:void 0,alt:g.user?.name||"User"}),(0,t.jsx)(L,{children:g?.user?.name?g.user.name.charAt(0).toUpperCase():g?.user?.email?g.user.email.charAt(0).toUpperCase():"U"})]})})}),(0,t.jsxs)(r3,{className:"w-56",align:"end",forceMount:!0,children:[(0,t.jsx)(r6,{className:"font-normal",children:(0,t.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium leading-none",children:g.user?.name||"用户"}),(0,t.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:g.user?.email})]})}),(0,t.jsx)(r8,{}),(0,t.jsx)(r5,{asChild:!0,children:(0,t.jsxs)(r.default,{href:"/settings",className:"cursor-pointer",children:[(0,t.jsx)(l,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{children:"系统设置"})]})}),(0,t.jsx)(r8,{}),(0,t.jsxs)(r5,{onClick:$,className:"cursor-pointer text-red-600",children:[(0,t.jsx)(s,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{children:"退出登录"})]})]})]}):(0,t.jsx)(r.default,{href:"/auth/signin",children:(0,t.jsx)(m.Button,{variant:"default",size:"sm",children:"登录"})})]})]})})}e.s(["SiteHeader",()=>nn],82772)}]);