1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
"use strict";exports.id=4543,exports.ids=[4543],exports.modules={41360:(e,r,t)=>{t.d(r,{UC:()=>W,B8:()=>X,bL:()=>V,l9:()=>_});var n=t(43210),o=t(70569),a=t(11273),i=t(72031),s=t(98599),l=t(96963),d=t(3416),u=t(13495),c=t(65551),p=t(43),f=t(60687),m="rovingFocusGroup.onEntryFocus",v={bubbles:!1,cancelable:!0},h="RovingFocusGroup",[g,w,x]=(0,i.N)(h),[y,b]=(0,a.A)(h,[x]),[A,j]=y(h),R=n.forwardRef((e,r)=>(0,f.jsx)(g.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(g.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(C,{...e,ref:r})})}));R.displayName=h;var C=n.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:t,orientation:a,loop:i=!1,dir:l,currentTabStopId:h,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:x,onEntryFocus:y,preventScrollOnEntryFocus:b=!1,...j}=e,R=n.useRef(null),C=(0,s.s)(r,R),F=(0,p.jH)(l),[I=null,D]=(0,c.i)({prop:h,defaultProp:g,onChange:x}),[S,$]=n.useState(!1),N=(0,u.c)(y),P=w(t),T=n.useRef(!1),[G,B]=n.useState(0);return n.useEffect(()=>{let e=R.current;if(e)return e.addEventListener(m,N),()=>e.removeEventListener(m,N)},[N]),(0,f.jsx)(A,{scope:t,orientation:a,dir:F,loop:i,currentTabStopId:I,onItemFocus:n.useCallback(e=>D(e),[D]),onItemShiftTab:n.useCallback(()=>$(!0),[]),onFocusableItemAdd:n.useCallback(()=>B(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>B(e=>e-1),[]),children:(0,f.jsx)(d.sG.div,{tabIndex:S||0===G?-1:0,"data-orientation":a,...j,ref:C,style:{outline:"none",...e.style},onMouseDown:(0,o.m)(e.onMouseDown,()=>{T.current=!0}),onFocus:(0,o.m)(e.onFocus,e=>{let r=!T.current;if(e.target===e.currentTarget&&r&&!S){let r=new CustomEvent(m,v);if(e.currentTarget.dispatchEvent(r),!r.defaultPrevented){let e=P().filter(e=>e.focusable);E([e.find(e=>e.active),e.find(e=>e.id===I),...e].filter(Boolean).map(e=>e.ref.current),b)}}T.current=!1}),onBlur:(0,o.m)(e.onBlur,()=>$(!1))})})}),F="RovingFocusGroupItem",I=n.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:t,focusable:a=!0,active:i=!1,tabStopId:s,...u}=e,c=(0,l.B)(),p=s||c,m=j(F,t),v=m.currentTabStopId===p,h=w(t),{onFocusableItemAdd:x,onFocusableItemRemove:y}=m;return n.useEffect(()=>{if(a)return x(),()=>y()},[a,x,y]),(0,f.jsx)(g.ItemSlot,{scope:t,id:p,focusable:a,active:i,children:(0,f.jsx)(d.sG.span,{tabIndex:v?0:-1,"data-orientation":m.orientation,...u,ref:r,onMouseDown:(0,o.m)(e.onMouseDown,e=>{a?m.onItemFocus(p):e.preventDefault()}),onFocus:(0,o.m)(e.onFocus,()=>m.onItemFocus(p)),onKeyDown:(0,o.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;let r=function(e,r,t){var n;let o=(n=e.key,"rtl"!==t?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===r&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===r&&["ArrowUp","ArrowDown"].includes(o)))return D[o]}(e,m.orientation,m.dir);if(void 0!==r){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let t=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===r)t.reverse();else if("prev"===r||"next"===r){"prev"===r&&t.reverse();let n=t.indexOf(e.currentTarget);t=m.loop?function(e,r){return e.map((t,n)=>e[(r+n)%e.length])}(t,n+1):t.slice(n+1)}setTimeout(()=>E(t))}})})})});I.displayName=F;var D={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function E(e,r=!1){let t=document.activeElement;for(let n of e)if(n===t||(n.focus({preventScroll:r}),document.activeElement!==t))return}var S=t(46059),$="Tabs",[N,P]=(0,a.A)($,[b]),T=b(),[G,B]=N($),K=n.forwardRef((e,r)=>{let{__scopeTabs:t,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",dir:s,activationMode:u="automatic",...m}=e,v=(0,p.jH)(s),[h,g]=(0,c.i)({prop:n,onChange:o,defaultProp:a});return(0,f.jsx)(G,{scope:t,baseId:(0,l.B)(),value:h,onValueChange:g,orientation:i,dir:v,activationMode:u,children:(0,f.jsx)(d.sG.div,{dir:v,"data-orientation":i,...m,ref:r})})});K.displayName=$;var M="TabsList",k=n.forwardRef((e,r)=>{let{__scopeTabs:t,loop:n=!0,...o}=e,a=B(M,t),i=T(t);return(0,f.jsx)(R,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:n,children:(0,f.jsx)(d.sG.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:r})})});k.displayName=M;var L="TabsTrigger",H=n.forwardRef((e,r)=>{let{__scopeTabs:t,value:n,disabled:a=!1,...i}=e,s=B(L,t),l=T(t),u=z(s.baseId,n),c=Y(s.baseId,n),p=n===s.value;return(0,f.jsx)(I,{asChild:!0,...l,focusable:!a,active:p,children:(0,f.jsx)(d.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":c,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:u,...i,ref:r,onMouseDown:(0,o.m)(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(n)}),onKeyDown:(0,o.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(n)}),onFocus:(0,o.m)(e.onFocus,()=>{let e="manual"!==s.activationMode;p||a||!e||s.onValueChange(n)})})})});H.displayName=L;var U="TabsContent",O=n.forwardRef((e,r)=>{let{__scopeTabs:t,value:o,forceMount:a,children:i,...s}=e,l=B(U,t),u=z(l.baseId,o),c=Y(l.baseId,o),p=o===l.value,m=n.useRef(p);return n.useEffect(()=>{let e=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,f.jsx)(S.C,{present:a||p,children:({present:t})=>(0,f.jsx)(d.sG.div,{"data-state":p?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!t,id:c,tabIndex:0,...s,ref:r,style:{...e.style,animationDuration:m.current?"0s":void 0},children:t&&i})})});function z(e,r){return`${e}-trigger-${r}`}function Y(e,r){return`${e}-content-${r}`}O.displayName=U;var V=K,X=k,_=H,W=O},57678:(e,r,t)=>{t.d(r,{Mz:()=>P,i3:()=>G,UC:()=>T,bL:()=>N,Bk:()=>h});var n=t(43210),o=t(4503),a=t(51865),i=t(3416),s=t(60687),l=n.forwardRef((e,r)=>{let{children:t,width:n=10,height:o=5,...a}=e;return(0,s.jsx)(i.sG.svg,{...a,ref:r,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?t:(0,s.jsx)("polygon",{points:"0,0 30,0 15,10"})})});l.displayName="Arrow";var d=t(98599),u=t(11273),c=t(13495),p=t(66156),f=t(18853),m="Popper",[v,h]=(0,u.A)(m),[g,w]=v(m),x=e=>{let{__scopePopper:r,children:t}=e,[o,a]=n.useState(null);return(0,s.jsx)(g,{scope:r,anchor:o,onAnchorChange:a,children:t})};x.displayName=m;var y="PopperAnchor",b=n.forwardRef((e,r)=>{let{__scopePopper:t,virtualRef:o,...a}=e,l=w(y,t),u=n.useRef(null),c=(0,d.s)(r,u);return n.useEffect(()=>{l.onAnchorChange(o?.current||u.current)}),o?null:(0,s.jsx)(i.sG.div,{...a,ref:c})});b.displayName=y;var A="PopperContent",[j,R]=v(A),C=n.forwardRef((e,r)=>{let{__scopePopper:t,side:l="bottom",sideOffset:u=0,align:m="center",alignOffset:v=0,arrowPadding:h=0,avoidCollisions:g=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:R=!1,updatePositionStrategy:C="optimized",onPlaced:F,...I}=e,D=w(A,t),[N,P]=n.useState(null),T=(0,d.s)(r,e=>P(e)),[G,B]=n.useState(null),K=(0,f.X)(G),M=K?.width??0,k=K?.height??0,L="number"==typeof y?y:{top:0,right:0,bottom:0,left:0,...y},H=Array.isArray(x)?x:[x],U=H.length>0,O={padding:L,boundary:H.filter(E),altBoundary:U},{refs:z,floatingStyles:Y,placement:V,isPositioned:X,middlewareData:_}=(0,o.we)({strategy:"fixed",placement:l+("center"!==m?"-"+m:""),whileElementsMounted:(...e)=>(0,a.ll)(...e,{animationFrame:"always"===C}),elements:{reference:D.anchor},middleware:[(0,o.cY)({mainAxis:u+k,alignmentAxis:v}),g&&(0,o.BN)({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?(0,o.ER)():void 0,...O}),g&&(0,o.UU)({...O}),(0,o.Ej)({...O,apply:({elements:e,rects:r,availableWidth:t,availableHeight:n})=>{let{width:o,height:a}=r.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${t}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`)}}),G&&(0,o.UE)({element:G,padding:h}),S({arrowWidth:M,arrowHeight:k}),R&&(0,o.jD)({strategy:"referenceHidden",...O})]}),[W,q]=$(V),Z=(0,c.c)(F);(0,p.N)(()=>{X&&Z?.()},[X,Z]);let J=_.arrow?.x,Q=_.arrow?.y,ee=_.arrow?.centerOffset!==0,[er,et]=n.useState();return(0,p.N)(()=>{N&&et(window.getComputedStyle(N).zIndex)},[N]),(0,s.jsx)("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:X?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:er,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,s.jsx)(j,{scope:t,placedSide:W,onArrowChange:B,arrowX:J,arrowY:Q,shouldHideArrow:ee,children:(0,s.jsx)(i.sG.div,{"data-side":W,"data-align":q,...I,ref:T,style:{...I.style,animation:X?void 0:"none"}})})})});C.displayName=A;var F="PopperArrow",I={top:"bottom",right:"left",bottom:"top",left:"right"},D=n.forwardRef(function(e,r){let{__scopePopper:t,...n}=e,o=R(F,t),a=I[o.placedSide];return(0,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:(0,s.jsx)(l,{...n,ref:r,style:{...n.style,display:"block"}})})});function E(e){return null!==e}D.displayName=F;var S=e=>({name:"transformOrigin",options:e,fn(r){let{placement:t,rects:n,middlewareData:o}=r,a=o.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,d]=$(t),u={start:"0%",center:"50%",end:"100%"}[d],c=(o.arrow?.x??0)+i/2,p=(o.arrow?.y??0)+s/2,f="",m="";return"bottom"===l?(f=a?u:`${c}px`,m=`${-s}px`):"top"===l?(f=a?u:`${c}px`,m=`${n.floating.height+s}px`):"right"===l?(f=`${-s}px`,m=a?u:`${p}px`):"left"===l&&(f=`${n.floating.width+s}px`,m=a?u:`${p}px`),{data:{x:f,y:m}}}});function $(e){let[r,t="center"]=e.split("-");return[r,t]}var N=x,P=b,T=C,G=D},83721:(e,r,t)=>{t.d(r,{Z:()=>o});var n=t(43210);function o(e){let r=n.useRef({value:e,previous:e});return n.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}}}; |