@wraps.dev/cli 2.30.2 → 3.0.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/README.md +11 -14
- package/dist/cli.js +952 -2214
- package/dist/cli.js.map +1 -1
- package/dist/console/assets/{index-P0x5JCC4.js → index--39O8UcT.js} +3 -3
- package/dist/console/assets/index-D6au_OkL.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/lambda/agent-enforcer/.bundled +1 -1
- package/dist/lambda/event-processor/.bundled +1 -1
- package/dist/lambda/inbound-processor/.bundled +1 -1
- package/dist/lambda/sms-event-processor/.bundled +1 -1
- package/package.json +3 -4
- package/dist/api-lambda.zip +0 -0
- package/dist/console/assets/index-BP4FpEpn.css +0 -1
- package/dist/selfhost-migrations/0000_absent_rogue.sql +0 -203
- package/dist/selfhost-migrations/0001_polite_maverick.sql +0 -17
- package/dist/selfhost-migrations/0002_perpetual_scorpion.sql +0 -1
- package/dist/selfhost-migrations/0003_wealthy_absorbing_man.sql +0 -1
- package/dist/selfhost-migrations/0004_opposite_blur.sql +0 -1
- package/dist/selfhost-migrations/0005_clear_terror.sql +0 -4
- package/dist/selfhost-migrations/0006_soft_black_widow.sql +0 -20
- package/dist/selfhost-migrations/0007_dazzling_saracen.sql +0 -124
- package/dist/selfhost-migrations/0008_broad_hannibal_king.sql +0 -33
- package/dist/selfhost-migrations/0009_bouncy_mystique.sql +0 -73
- package/dist/selfhost-migrations/0010_cheerful_valeria_richards.sql +0 -18
- package/dist/selfhost-migrations/0011_absent_thunderbolts.sql +0 -2
- package/dist/selfhost-migrations/0012_demonic_donald_blake.sql +0 -1
- package/dist/selfhost-migrations/0013_nifty_preak.sql +0 -143
- package/dist/selfhost-migrations/0014_hesitant_beast.sql +0 -2
- package/dist/selfhost-migrations/0015_blue_giant_girl.sql +0 -1
- package/dist/selfhost-migrations/0016_cooing_overlord.sql +0 -1
- package/dist/selfhost-migrations/0017_tranquil_ender_wiggin.sql +0 -11
- package/dist/selfhost-migrations/0018_talented_groot.sql +0 -8
- package/dist/selfhost-migrations/0019_ambitious_devos.sql +0 -3
- package/dist/selfhost-migrations/0020_misty_master_mold.sql +0 -95
- package/dist/selfhost-migrations/0021_regular_harrier.sql +0 -14
- package/dist/selfhost-migrations/0022_sour_blizzard.sql +0 -10
- package/dist/selfhost-migrations/0023_flawless_psynapse.sql +0 -1
- package/dist/selfhost-migrations/0024_premium_blindfold.sql +0 -1
- package/dist/selfhost-migrations/0025_unusual_santa_claus.sql +0 -1
- package/dist/selfhost-migrations/0026_volatile_pandemic.sql +0 -2
- package/dist/selfhost-migrations/0027_workable_logan.sql +0 -4
- package/dist/selfhost-migrations/0028_familiar_prodigy.sql +0 -1
- package/dist/selfhost-migrations/0029_cute_maddog.sql +0 -13
- package/dist/selfhost-migrations/0030_adorable_scarecrow.sql +0 -1
- package/dist/selfhost-migrations/0031_material_slapstick.sql +0 -10
- package/dist/selfhost-migrations/0032_hot_dust.sql +0 -11
- package/dist/selfhost-migrations/0033_slow_deathbird.sql +0 -1
- package/dist/selfhost-migrations/0034_lush_rafael_vega.sql +0 -12
- package/dist/selfhost-migrations/0035_normal_red_hulk.sql +0 -8
- package/dist/selfhost-migrations/0036_marvelous_ezekiel.sql +0 -1
- package/dist/selfhost-migrations/0037_swift_talisman.sql +0 -8
- package/dist/selfhost-migrations/0038_first_mandroid.sql +0 -1
- package/dist/selfhost-migrations/0039_fixed_stryfe.sql +0 -1
- package/dist/selfhost-migrations/0040_add_channel_check_constraints.sql +0 -2
- package/dist/selfhost-migrations/0041_black_spencer_smythe.sql +0 -1
- package/dist/selfhost-migrations/0042_plain_marvel_zombies.sql +0 -2
- package/dist/selfhost-migrations/0043_curved_champions.sql +0 -1
- package/dist/selfhost-migrations/0044_clean_iceman.sql +0 -1
- package/dist/selfhost-migrations/0045_condemned_steel_serpent.sql +0 -1
- package/dist/selfhost-migrations/0046_steep_ultimo.sql +0 -2
- package/dist/selfhost-migrations/0047_empty_sleepwalker.sql +0 -2
- package/dist/selfhost-migrations/0048_cheerful_multiple_man.sql +0 -1
- package/dist/selfhost-migrations/0049_nostalgic_loki.sql +0 -3
- package/dist/selfhost-migrations/0050_add_engagement_metadata.sql +0 -4
- package/dist/selfhost-migrations/0051_odd_marrow.sql +0 -2
- package/dist/selfhost-migrations/0052_redundant_siren.sql +0 -5
- package/dist/selfhost-migrations/0053_soft_carnage.sql +0 -31
- package/dist/selfhost-migrations/0054_blushing_vin_gonzales.sql +0 -1
- package/dist/selfhost-migrations/0055_broadcast_resume_columns.sql +0 -12
- package/dist/selfhost-migrations/0056_broadcast_resume_dedup_cleanup.sql +0 -31
- package/dist/selfhost-migrations/0057_audit_log_actoremail_jsonb.sql +0 -5
- package/dist/selfhost-migrations/0058_email_log_sent_at_idx.sql +0 -1
- package/dist/selfhost-migrations/0059_message_send_claimed_at.sql +0 -1
- package/dist/selfhost-migrations/0060_harsh_nehzno.sql +0 -1
- package/dist/selfhost-migrations/0061_flashy_spirit.sql +0 -1
- package/dist/selfhost-migrations/0062_next_timeslip.sql +0 -2
- package/dist/selfhost-migrations/0063_greedy_legion.sql +0 -17
- package/dist/selfhost-migrations/0064_wise_brood.sql +0 -42
- package/dist/selfhost-migrations/0065_public_the_fallen.sql +0 -2
- package/dist/selfhost-migrations/0066_odd_yellow_claw.sql +0 -3
- package/dist/selfhost-migrations/CLAUDE.md +0 -49
- package/dist/selfhost-migrations/meta/0000_snapshot.json +0 -1311
- package/dist/selfhost-migrations/meta/0001_snapshot.json +0 -1454
- package/dist/selfhost-migrations/meta/0002_snapshot.json +0 -1460
- package/dist/selfhost-migrations/meta/0003_snapshot.json +0 -1467
- package/dist/selfhost-migrations/meta/0004_snapshot.json +0 -1473
- package/dist/selfhost-migrations/meta/0005_snapshot.json +0 -1499
- package/dist/selfhost-migrations/meta/0006_snapshot.json +0 -1617
- package/dist/selfhost-migrations/meta/0007_snapshot.json +0 -2581
- package/dist/selfhost-migrations/meta/0008_snapshot.json +0 -2861
- package/dist/selfhost-migrations/meta/0009_snapshot.json +0 -3447
- package/dist/selfhost-migrations/meta/0010_snapshot.json +0 -3586
- package/dist/selfhost-migrations/meta/0011_snapshot.json +0 -3600
- package/dist/selfhost-migrations/meta/0012_snapshot.json +0 -3607
- package/dist/selfhost-migrations/meta/0013_snapshot.json +0 -4697
- package/dist/selfhost-migrations/meta/0014_snapshot.json +0 -4704
- package/dist/selfhost-migrations/meta/0015_snapshot.json +0 -4697
- package/dist/selfhost-migrations/meta/0016_snapshot.json +0 -4703
- package/dist/selfhost-migrations/meta/0017_snapshot.json +0 -4769
- package/dist/selfhost-migrations/meta/0018_snapshot.json +0 -4821
- package/dist/selfhost-migrations/meta/0019_snapshot.json +0 -4840
- package/dist/selfhost-migrations/meta/0020_snapshot.json +0 -5602
- package/dist/selfhost-migrations/meta/0021_snapshot.json +0 -5729
- package/dist/selfhost-migrations/meta/0022_snapshot.json +0 -5792
- package/dist/selfhost-migrations/meta/0023_snapshot.json +0 -5799
- package/dist/selfhost-migrations/meta/0024_snapshot.json +0 -5821
- package/dist/selfhost-migrations/meta/0025_snapshot.json +0 -5831
- package/dist/selfhost-migrations/meta/0026_snapshot.json +0 -5844
- package/dist/selfhost-migrations/meta/0027_snapshot.json +0 -5864
- package/dist/selfhost-migrations/meta/0028_snapshot.json +0 -5871
- package/dist/selfhost-migrations/meta/0029_snapshot.json +0 -5984
- package/dist/selfhost-migrations/meta/0030_snapshot.json +0 -5990
- package/dist/selfhost-migrations/meta/0031_snapshot.json +0 -5950
- package/dist/selfhost-migrations/meta/0032_snapshot.json +0 -6042
- package/dist/selfhost-migrations/meta/0033_snapshot.json +0 -6057
- package/dist/selfhost-migrations/meta/0034_snapshot.json +0 -6130
- package/dist/selfhost-migrations/meta/0035_snapshot.json +0 -6195
- package/dist/selfhost-migrations/meta/0036_snapshot.json +0 -6201
- package/dist/selfhost-migrations/meta/0037_snapshot.json +0 -6265
- package/dist/selfhost-migrations/meta/0038_snapshot.json +0 -6271
- package/dist/selfhost-migrations/meta/0039_snapshot.json +0 -6278
- package/dist/selfhost-migrations/meta/0041_snapshot.json +0 -6284
- package/dist/selfhost-migrations/meta/0042_snapshot.json +0 -6297
- package/dist/selfhost-migrations/meta/0043_snapshot.json +0 -6297
- package/dist/selfhost-migrations/meta/0044_snapshot.json +0 -6297
- package/dist/selfhost-migrations/meta/0045_snapshot.json +0 -6303
- package/dist/selfhost-migrations/meta/0046_snapshot.json +0 -6315
- package/dist/selfhost-migrations/meta/0047_snapshot.json +0 -6330
- package/dist/selfhost-migrations/meta/0048_snapshot.json +0 -6336
- package/dist/selfhost-migrations/meta/0049_snapshot.json +0 -6366
- package/dist/selfhost-migrations/meta/0050_snapshot.json +0 -6390
- package/dist/selfhost-migrations/meta/0051_snapshot.json +0 -6403
- package/dist/selfhost-migrations/meta/0052_snapshot.json +0 -6470
- package/dist/selfhost-migrations/meta/0053_snapshot.json +0 -6470
- package/dist/selfhost-migrations/meta/0054_snapshot.json +0 -6646
- package/dist/selfhost-migrations/meta/0055_snapshot.json +0 -6713
- package/dist/selfhost-migrations/meta/0056_snapshot.json +0 -6713
- package/dist/selfhost-migrations/meta/0057_snapshot.json +0 -6731
- package/dist/selfhost-migrations/meta/0059_snapshot.json +0 -6764
- package/dist/selfhost-migrations/meta/0060_snapshot.json +0 -7125
- package/dist/selfhost-migrations/meta/0061_snapshot.json +0 -7131
- package/dist/selfhost-migrations/meta/0062_snapshot.json +0 -7143
- package/dist/selfhost-migrations/meta/0063_snapshot.json +0 -7282
- package/dist/selfhost-migrations/meta/0064_snapshot.json +0 -7626
- package/dist/selfhost-migrations/meta/0065_snapshot.json +0 -7662
- package/dist/selfhost-migrations/meta/0066_snapshot.json +0 -7682
- package/dist/selfhost-migrations/meta/_journal.json +0 -475
|
@@ -50,9 +50,9 @@ Error generating stack: `+p.message+`
|
|
|
50
50
|
|
|
51
51
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
52
|
|
|
53
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},k7="DialogDescriptionWarning",$7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Q$(k7).contentName}}.`;return S.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Wj=I$,I7=z$,Kj=q$,Xj=U$,Qj=H$,Zj=G$,Jj=Y$,Pp=K$;function L7({...e}){return c.jsx(Wj,{"data-slot":"sheet",...e})}function z7({...e}){return c.jsx(Kj,{"data-slot":"sheet-portal",...e})}function B7({className:e,...t}){return c.jsx(Xj,{className:pe("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"sheet-overlay",...t})}function q7({className:e,children:t,side:n="right",hideCloseButton:r=!1,...i}){return c.jsxs(z7,{children:[c.jsx(B7,{}),c.jsxs(Qj,{className:pe("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),"data-slot":"sheet-content",...i,children:[t,!r&&c.jsxs(Pp,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(or,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function U7({className:e,...t}){return c.jsx("div",{className:pe("flex flex-col gap-1.5 p-4",e),"data-slot":"sheet-header",...t})}function H7({className:e,...t}){return c.jsx(Zj,{className:pe("font-semibold text-foreground",e),"data-slot":"sheet-title",...t})}function F7({className:e,...t}){return c.jsx(Jj,{className:pe("text-muted-foreground text-sm",e),"data-slot":"sheet-description",...t})}function De({className:e,...t}){return c.jsx("div",{className:pe("animate-pulse rounded-md bg-accent",e),"data-slot":"skeleton",...t})}const G7=["top","right","bottom","left"],to=Math.min,ar=Math.max,am=Math.round,Eh=Math.floor,va=e=>({x:e,y:e}),V7={left:"right",right:"left",bottom:"top",top:"bottom"},Y7={start:"end",end:"start"};function G1(e,t,n){return ar(e,to(t,n))}function ii(e,t){return typeof e=="function"?e(t):e}function oi(e){return e.split("-")[0]}function lc(e){return e.split("-")[1]}function eO(e){return e==="x"?"y":"x"}function tO(e){return e==="y"?"height":"width"}const W7=new Set(["top","bottom"]);function da(e){return W7.has(oi(e))?"y":"x"}function nO(e){return eO(da(e))}function K7(e,t,n){n===void 0&&(n=!1);const r=lc(e),i=nO(e),o=tO(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=im(l)),[l,im(l)]}function X7(e){const t=im(e);return[V1(e),t,V1(t)]}function V1(e){return e.replace(/start|end/g,t=>Y7[t])}const gC=["left","right"],yC=["right","left"],Q7=["top","bottom"],Z7=["bottom","top"];function J7(e,t,n){switch(e){case"top":case"bottom":return n?t?yC:gC:t?gC:yC;case"left":case"right":return t?Q7:Z7;default:return[]}}function e9(e,t,n,r){const i=lc(e);let o=J7(oi(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(V1)))),o}function im(e){return e.replace(/left|right|bottom|top/g,t=>V7[t])}function t9(e){return{top:0,right:0,bottom:0,left:0,...e}}function Z$(e){return typeof e!="number"?t9(e):{top:e,right:e,bottom:e,left:e}}function om(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xC(e,t,n){let{reference:r,floating:i}=e;const o=da(t),l=nO(t),f=tO(l),d=oi(t),h=o==="y",v=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,g=r[f]/2-i[f]/2;let x;switch(d){case"top":x={x:v,y:r.y-i.height};break;case"bottom":x={x:v,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:m};break;case"left":x={x:r.x-i.width,y:m};break;default:x={x:r.x,y:r.y}}switch(lc(t)){case"start":x[l]-=g*(n&&h?-1:1);break;case"end":x[l]+=g*(n&&h?-1:1);break}return x}const n9=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,f=o.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:v,y:m}=xC(h,r,d),g=r,x={},O=0;for(let j=0;j<f.length;j++){const{name:b,fn:E}=f[j],{x:_,y:A,data:C,reset:N}=await E({x:v,y:m,initialPlacement:r,placement:g,strategy:i,middlewareData:x,rects:h,platform:l,elements:{reference:e,floating:t}});v=_??v,m=A??m,x={...x,[b]:{...x[b],...C}},N&&O<=50&&(O++,typeof N=="object"&&(N.placement&&(g=N.placement),N.rects&&(h=N.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):N.rects),{x:v,y:m}=xC(h,g,d)),j=-1)}return{x:v,y:m,placement:g,strategy:i,middlewareData:x}};async function Vu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:l,elements:f,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:v="viewport",elementContext:m="floating",altBoundary:g=!1,padding:x=0}=ii(t,e),O=Z$(x),b=f[g?m==="floating"?"reference":"floating":m],E=om(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(f.floating)),boundary:h,rootBoundary:v,strategy:d})),_=m==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f.floating)),C=await(o.isElement==null?void 0:o.isElement(A))?await(o.getScale==null?void 0:o.getScale(A))||{x:1,y:1}:{x:1,y:1},N=om(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:_,offsetParent:A,strategy:d}):_);return{top:(E.top-N.top+O.top)/C.y,bottom:(N.bottom-E.bottom+O.bottom)/C.y,left:(E.left-N.left+O.left)/C.x,right:(N.right-E.right+O.right)/C.x}}const r9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:f,middlewareData:d}=t,{element:h,padding:v=0}=ii(e,t)||{};if(h==null)return{};const m=Z$(v),g={x:n,y:r},x=nO(i),O=tO(x),j=await l.getDimensions(h),b=x==="y",E=b?"top":"left",_=b?"bottom":"right",A=b?"clientHeight":"clientWidth",C=o.reference[O]+o.reference[x]-g[x]-o.floating[O],N=g[x]-o.reference[x],M=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let R=M?M[A]:0;(!R||!await(l.isElement==null?void 0:l.isElement(M)))&&(R=f.floating[A]||o.floating[O]);const D=C/2-N/2,L=R/2-j[O]/2-1,H=to(m[E],L),B=to(m[_],L),U=H,Y=R-j[O]-B,Z=R/2-j[O]/2+D,X=G1(U,Z,Y),k=!d.arrow&&lc(i)!=null&&Z!==X&&o.reference[O]/2-(Z<U?H:B)-j[O]/2<0,q=k?Z<U?Z-U:Z-Y:0;return{[x]:g[x]+q,data:{[x]:X,centerOffset:Z-X-q,...k&&{alignmentOffset:q}},reset:k}}}),a9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:f,platform:d,elements:h}=t,{mainAxis:v=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:j=!0,...b}=ii(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=oi(i),_=da(f),A=oi(f)===f,C=await(d.isRTL==null?void 0:d.isRTL(h.floating)),N=g||(A||!j?[im(f)]:X7(f)),M=O!=="none";!g&&M&&N.push(...e9(f,j,O,C));const R=[f,...N],D=await Vu(t,b),L=[];let H=((r=o.flip)==null?void 0:r.overflows)||[];if(v&&L.push(D[E]),m){const Z=K7(i,l,C);L.push(D[Z[0]],D[Z[1]])}if(H=[...H,{placement:i,overflows:L}],!L.every(Z=>Z<=0)){var B,U;const Z=(((B=o.flip)==null?void 0:B.index)||0)+1,X=R[Z];if(X&&(!(m==="alignment"?_!==da(X):!1)||H.every(V=>da(V.placement)===_?V.overflows[0]>0:!0)))return{data:{index:Z,overflows:H},reset:{placement:X}};let k=(U=H.filter(q=>q.overflows[0]<=0).sort((q,V)=>q.overflows[1]-V.overflows[1])[0])==null?void 0:U.placement;if(!k)switch(x){case"bestFit":{var Y;const q=(Y=H.filter(V=>{if(M){const Q=da(V.placement);return Q===_||Q==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(Q=>Q>0).reduce((Q,ee)=>Q+ee,0)]).sort((V,Q)=>V[1]-Q[1])[0])==null?void 0:Y[0];q&&(k=q);break}case"initialPlacement":k=f;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function bC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wC(e){return G7.some(t=>e[t]>=0)}const i9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ii(e,t);switch(r){case"referenceHidden":{const o=await Vu(t,{...i,elementContext:"reference"}),l=bC(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:wC(l)}}}case"escaped":{const o=await Vu(t,{...i,altBoundary:!0}),l=bC(o,n.floating);return{data:{escapedOffsets:l,escaped:wC(l)}}}default:return{}}}}},J$=new Set(["left","top"]);async function o9(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=oi(n),f=lc(n),d=da(n)==="y",h=J$.has(l)?-1:1,v=o&&d?-1:1,m=ii(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:O}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return f&&typeof O=="number"&&(x=f==="end"?O*-1:O),d?{x:x*v,y:g*h}:{x:g*h,y:x*v}}const s9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:f}=t,d=await o9(t,e);return l===((n=f.offset)==null?void 0:n.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:l}}}}},l9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:f={fn:b=>{let{x:E,y:_}=b;return{x:E,y:_}}},...d}=ii(e,t),h={x:n,y:r},v=await Vu(t,d),m=da(oi(i)),g=eO(m);let x=h[g],O=h[m];if(o){const b=g==="y"?"top":"left",E=g==="y"?"bottom":"right",_=x+v[b],A=x-v[E];x=G1(_,x,A)}if(l){const b=m==="y"?"top":"left",E=m==="y"?"bottom":"right",_=O+v[b],A=O-v[E];O=G1(_,O,A)}const j=f.fn({...t,[g]:x,[m]:O});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[g]:o,[m]:l}}}}}},c9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:f=0,mainAxis:d=!0,crossAxis:h=!0}=ii(e,t),v={x:n,y:r},m=da(i),g=eO(m);let x=v[g],O=v[m];const j=ii(f,t),b=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(d){const A=g==="y"?"height":"width",C=o.reference[g]-o.floating[A]+b.mainAxis,N=o.reference[g]+o.reference[A]-b.mainAxis;x<C?x=C:x>N&&(x=N)}if(h){var E,_;const A=g==="y"?"width":"height",C=J$.has(oi(i)),N=o.reference[m]-o.floating[A]+(C&&((E=l.offset)==null?void 0:E[m])||0)+(C?0:b.crossAxis),M=o.reference[m]+o.reference[A]+(C?0:((_=l.offset)==null?void 0:_[m])||0)-(C?b.crossAxis:0);O<N?O=N:O>M&&(O=M)}return{[g]:x,[m]:O}}}},u9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:f}=t,{apply:d=()=>{},...h}=ii(e,t),v=await Vu(t,h),m=oi(i),g=lc(i),x=da(i)==="y",{width:O,height:j}=o.floating;let b,E;m==="top"||m==="bottom"?(b=m,E=g===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(E=m,b=g==="end"?"top":"bottom");const _=j-v.top-v.bottom,A=O-v.left-v.right,C=to(j-v[b],_),N=to(O-v[E],A),M=!t.middlewareData.shift;let R=C,D=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=A),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=_),M&&!g){const H=ar(v.left,0),B=ar(v.right,0),U=ar(v.top,0),Y=ar(v.bottom,0);x?D=O-2*(H!==0||B!==0?H+B:ar(v.left,v.right)):R=j-2*(U!==0||Y!==0?U+Y:ar(v.top,v.bottom))}await d({...t,availableWidth:D,availableHeight:R});const L=await l.getDimensions(f.floating);return O!==L.width||j!==L.height?{reset:{rects:!0}}:{}}}};function kp(){return typeof window<"u"}function cc(e){return eI(e)?(e.nodeName||"").toLowerCase():"#document"}function sr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ea(e){var t;return(t=(eI(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function eI(e){return kp()?e instanceof Node||e instanceof sr(e).Node:!1}function Kr(e){return kp()?e instanceof Element||e instanceof sr(e).Element:!1}function ja(e){return kp()?e instanceof HTMLElement||e instanceof sr(e).HTMLElement:!1}function SC(e){return!kp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sr(e).ShadowRoot}const f9=new Set(["inline","contents"]);function zf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!f9.has(i)}const d9=new Set(["table","td","th"]);function h9(e){return d9.has(cc(e))}const m9=[":popover-open",":modal"];function $p(e){return m9.some(t=>{try{return e.matches(t)}catch{return!1}})}const p9=["transform","translate","scale","rotate","perspective"],v9=["transform","translate","scale","rotate","perspective","filter"],g9=["paint","layout","strict","content"];function rO(e){const t=aO(),n=Kr(e)?Xr(e):e;return p9.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||v9.some(r=>(n.willChange||"").includes(r))||g9.some(r=>(n.contain||"").includes(r))}function y9(e){let t=no(e);for(;ja(t)&&!Dl(t);){if(rO(t))return t;if($p(t))return null;t=no(t)}return null}function aO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const x9=new Set(["html","body","#document"]);function Dl(e){return x9.has(cc(e))}function Xr(e){return sr(e).getComputedStyle(e)}function Ip(e){return Kr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function no(e){if(cc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||SC(e)&&e.host||Ea(e);return SC(t)?t.host:t}function tI(e){const t=no(e);return Dl(t)?e.ownerDocument?e.ownerDocument.body:e.body:ja(t)&&zf(t)?t:tI(t)}function Yu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=tI(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=sr(i);if(o){const f=Y1(l);return t.concat(l,l.visualViewport||[],zf(i)?i:[],f&&n?Yu(f):[])}return t.concat(i,Yu(i,[],n))}function Y1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nI(e){const t=Xr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ja(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,f=am(n)!==o||am(r)!==l;return f&&(n=o,r=l),{width:n,height:r,$:f}}function iO(e){return Kr(e)?e:e.contextElement}function Ol(e){const t=iO(e);if(!ja(t))return va(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=nI(t);let l=(o?am(n.width):n.width)/r,f=(o?am(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const b9=va(0);function rI(e){const t=sr(e);return!aO()||!t.visualViewport?b9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function w9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==sr(e)?!1:t}function ts(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=iO(e);let l=va(1);t&&(r?Kr(r)&&(l=Ol(r)):l=Ol(e));const f=w9(o,n,r)?rI(o):va(0);let d=(i.left+f.x)/l.x,h=(i.top+f.y)/l.y,v=i.width/l.x,m=i.height/l.y;if(o){const g=sr(o),x=r&&Kr(r)?sr(r):r;let O=g,j=Y1(O);for(;j&&r&&x!==O;){const b=Ol(j),E=j.getBoundingClientRect(),_=Xr(j),A=E.left+(j.clientLeft+parseFloat(_.paddingLeft))*b.x,C=E.top+(j.clientTop+parseFloat(_.paddingTop))*b.y;d*=b.x,h*=b.y,v*=b.x,m*=b.y,d+=A,h+=C,O=sr(j),j=Y1(O)}}return om({width:v,height:m,x:d,y:h})}function Lp(e,t){const n=Ip(e).scrollLeft;return t?t.left+n:ts(Ea(e)).left+n}function aI(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Lp(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function S9(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=Ea(r),f=t?$p(t.floating):!1;if(r===l||f&&o)return n;let d={scrollLeft:0,scrollTop:0},h=va(1);const v=va(0),m=ja(r);if((m||!m&&!o)&&((cc(r)!=="body"||zf(l))&&(d=Ip(r)),ja(r))){const x=ts(r);h=Ol(r),v.x=x.x+r.clientLeft,v.y=x.y+r.clientTop}const g=l&&!m&&!o?aI(l,d):va(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+v.x+g.x,y:n.y*h.y-d.scrollTop*h.y+v.y+g.y}}function j9(e){return Array.from(e.getClientRects())}function O9(e){const t=Ea(e),n=Ip(e),r=e.ownerDocument.body,i=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Lp(e);const f=-n.scrollTop;return Xr(r).direction==="rtl"&&(l+=ar(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:f}}const jC=25;function E9(e,t){const n=sr(e),r=Ea(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,f=0,d=0;if(i){o=i.width,l=i.height;const v=aO();(!v||v&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const h=Lp(r);if(h<=0){const v=r.ownerDocument,m=v.body,g=getComputedStyle(m),x=v.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,O=Math.abs(r.clientWidth-m.clientWidth-x);O<=jC&&(o-=O)}else h<=jC&&(o+=h);return{width:o,height:l,x:f,y:d}}const _9=new Set(["absolute","fixed"]);function A9(e,t){const n=ts(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ja(e)?Ol(e):va(1),l=e.clientWidth*o.x,f=e.clientHeight*o.y,d=i*o.x,h=r*o.y;return{width:l,height:f,x:d,y:h}}function OC(e,t,n){let r;if(t==="viewport")r=E9(e,n);else if(t==="document")r=O9(Ea(e));else if(Kr(t))r=A9(t,n);else{const i=rI(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return om(r)}function iI(e,t){const n=no(e);return n===t||!Kr(n)||Dl(n)?!1:Xr(n).position==="fixed"||iI(n,t)}function N9(e,t){const n=t.get(e);if(n)return n;let r=Yu(e,[],!1).filter(f=>Kr(f)&&cc(f)!=="body"),i=null;const o=Xr(e).position==="fixed";let l=o?no(e):e;for(;Kr(l)&&!Dl(l);){const f=Xr(l),d=rO(l);!d&&f.position==="fixed"&&(i=null),(o?!d&&!i:!d&&f.position==="static"&&!!i&&_9.has(i.position)||zf(l)&&!d&&iI(e,l))?r=r.filter(v=>v!==l):i=f,l=no(l)}return t.set(e,r),r}function C9(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?$p(t)?[]:N9(t,this._c):[].concat(n),r],f=l[0],d=l.reduce((h,v)=>{const m=OC(t,v,i);return h.top=ar(m.top,h.top),h.right=to(m.right,h.right),h.bottom=to(m.bottom,h.bottom),h.left=ar(m.left,h.left),h},OC(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function T9(e){const{width:t,height:n}=nI(e);return{width:t,height:n}}function M9(e,t,n){const r=ja(t),i=Ea(t),o=n==="fixed",l=ts(e,!0,o,t);let f={scrollLeft:0,scrollTop:0};const d=va(0);function h(){d.x=Lp(i)}if(r||!r&&!o)if((cc(t)!=="body"||zf(i))&&(f=Ip(t)),r){const x=ts(t,!0,o,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else i&&h();o&&!r&&i&&h();const v=i&&!r&&!o?aI(i,f):va(0),m=l.left+f.scrollLeft-d.x-v.x,g=l.top+f.scrollTop-d.y-v.y;return{x:m,y:g,width:l.width,height:l.height}}function Ex(e){return Xr(e).position==="static"}function EC(e,t){if(!ja(e)||Xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ea(e)===n&&(n=n.ownerDocument.body),n}function oI(e,t){const n=sr(e);if($p(e))return n;if(!ja(e)){let i=no(e);for(;i&&!Dl(i);){if(Kr(i)&&!Ex(i))return i;i=no(i)}return n}let r=EC(e,t);for(;r&&h9(r)&&Ex(r);)r=EC(r,t);return r&&Dl(r)&&Ex(r)&&!rO(r)?n:r||y9(e)||n}const R9=async function(e){const t=this.getOffsetParent||oI,n=this.getDimensions,r=await n(e.floating);return{reference:M9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function D9(e){return Xr(e).direction==="rtl"}const P9={convertOffsetParentRelativeRectToViewportRelativeRect:S9,getDocumentElement:Ea,getClippingRect:C9,getOffsetParent:oI,getElementRects:R9,getClientRects:j9,getDimensions:T9,getScale:Ol,isElement:Kr,isRTL:D9};function sI(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k9(e,t){let n=null,r;const i=Ea(e);function o(){var f;clearTimeout(r),(f=n)==null||f.disconnect(),n=null}function l(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),o();const h=e.getBoundingClientRect(),{left:v,top:m,width:g,height:x}=h;if(f||t(),!g||!x)return;const O=Eh(m),j=Eh(i.clientWidth-(v+g)),b=Eh(i.clientHeight-(m+x)),E=Eh(v),A={rootMargin:-O+"px "+-j+"px "+-b+"px "+-E+"px",threshold:ar(0,to(1,d))||1};let C=!0;function N(M){const R=M[0].intersectionRatio;if(R!==d){if(!C)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}R===1&&!sI(h,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{...A,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,A)}n.observe(e)}return l(!0),o}function $9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=iO(e),v=i||o?[...h?Yu(h):[],...Yu(t)]:[];v.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const m=h&&f?k9(h,n):null;let g=-1,x=null;l&&(x=new ResizeObserver(E=>{let[_]=E;_&&_.target===h&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var A;(A=x)==null||A.observe(t)})),n()}),h&&!d&&x.observe(h),x.observe(t));let O,j=d?ts(e):null;d&&b();function b(){const E=ts(e);j&&!sI(j,E)&&n(),j=E,O=requestAnimationFrame(b)}return n(),()=>{var E;v.forEach(_=>{i&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),m?.(),(E=x)==null||E.disconnect(),x=null,d&&cancelAnimationFrame(O)}}const I9=s9,L9=l9,z9=a9,B9=u9,q9=i9,_C=r9,U9=c9,H9=(e,t,n)=>{const r=new Map,i={platform:P9,...n},o={...i.platform,_c:r};return n9(e,t,{...i,platform:o})};var F9=typeof document<"u",G9=function(){},Wh=F9?S.useLayoutEffect:G9;function sm(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 n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!sm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!sm(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function lI(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function AC(e,t){const n=lI(e);return Math.round(t*n)/n}function _x(e){const t=S.useRef(e);return Wh(()=>{t.current=e}),t}function V9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:f=!0,whileElementsMounted:d,open:h}=e,[v,m]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=S.useState(r);sm(g,r)||x(r);const[O,j]=S.useState(null),[b,E]=S.useState(null),_=S.useCallback(V=>{V!==M.current&&(M.current=V,j(V))},[]),A=S.useCallback(V=>{V!==R.current&&(R.current=V,E(V))},[]),C=o||O,N=l||b,M=S.useRef(null),R=S.useRef(null),D=S.useRef(v),L=d!=null,H=_x(d),B=_x(i),U=_x(h),Y=S.useCallback(()=>{if(!M.current||!R.current)return;const V={placement:t,strategy:n,middleware:g};B.current&&(V.platform=B.current),H9(M.current,R.current,V).then(Q=>{const ee={...Q,isPositioned:U.current!==!1};Z.current&&!sm(D.current,ee)&&(D.current=ee,$f.flushSync(()=>{m(ee)}))})},[g,t,n,B,U]);Wh(()=>{h===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,m(V=>({...V,isPositioned:!1})))},[h]);const Z=S.useRef(!1);Wh(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Wh(()=>{if(C&&(M.current=C),N&&(R.current=N),C&&N){if(H.current)return H.current(C,N,Y);Y()}},[C,N,Y,H,L]);const X=S.useMemo(()=>({reference:M,floating:R,setReference:_,setFloating:A}),[_,A]),k=S.useMemo(()=>({reference:C,floating:N}),[C,N]),q=S.useMemo(()=>{const V={position:n,left:0,top:0};if(!k.floating)return V;const Q=AC(k.floating,v.x),ee=AC(k.floating,v.y);return f?{...V,transform:"translate("+Q+"px, "+ee+"px)",...lI(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:ee}},[n,f,k.floating,v.x,v.y]);return S.useMemo(()=>({...v,update:Y,refs:X,elements:k,floatingStyles:q}),[v,Y,X,k,q])}const Y9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?_C({element:r.current,padding:i}).fn(n):{}:r?_C({element:r,padding:i}).fn(n):{}}}},W9=(e,t)=>({...I9(e),options:[e,t]}),K9=(e,t)=>({...L9(e),options:[e,t]}),X9=(e,t)=>({...U9(e),options:[e,t]}),Q9=(e,t)=>({...z9(e),options:[e,t]}),Z9=(e,t)=>({...B9(e),options:[e,t]}),J9=(e,t)=>({...q9(e),options:[e,t]}),eG=(e,t)=>({...Y9(e),options:[e,t]});var tG="Arrow",cI=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return c.jsx(Ae.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});cI.displayName=tG;var nG=cI;function zp(e){const[t,n]=S.useState(void 0);return Wt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,f;if("borderBoxSize"in o){const d=o.borderBoxSize,h=Array.isArray(d)?d[0]:d;l=h.inlineSize,f=h.blockSize}else l=e.offsetWidth,f=e.offsetHeight;n({width:l,height:f})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var oO="Popper",[uI,lo]=jn(oO),[rG,fI]=uI(oO),dI=e=>{const{__scopePopper:t,children:n}=e,[r,i]=S.useState(null);return c.jsx(rG,{scope:t,anchor:r,onAnchorChange:i,children:n})};dI.displayName=oO;var hI="PopperAnchor",mI=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=fI(hI,n),l=S.useRef(null),f=Ue(t,l),d=S.useRef(null);return S.useEffect(()=>{const h=d.current;d.current=r?.current||l.current,h!==d.current&&o.onAnchorChange(d.current)}),r?null:c.jsx(Ae.div,{...i,ref:f})});mI.displayName=hI;var sO="PopperContent",[aG,iG]=uI(sO),pI=S.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:f=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:v=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:O,...j}=e,b=fI(sO,n),[E,_]=S.useState(null),A=Ue(t,oe=>_(oe)),[C,N]=S.useState(null),M=zp(C),R=M?.width??0,D=M?.height??0,L=r+(o!=="center"?"-"+o:""),H=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},B=Array.isArray(h)?h:[h],U=B.length>0,Y={padding:H,boundary:B.filter(sG),altBoundary:U},{refs:Z,floatingStyles:X,placement:k,isPositioned:q,middlewareData:V}=V9({strategy:"fixed",placement:L,whileElementsMounted:(...oe)=>$9(...oe,{animationFrame:x==="always"}),elements:{reference:b.anchor},middleware:[W9({mainAxis:i+D,alignmentAxis:l}),d&&K9({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?X9():void 0,...Y}),d&&Q9({...Y}),Z9({...Y,apply:({elements:oe,rects:me,availableWidth:ie,availableHeight:ve})=>{const{width:ye,height:le}=me.reference,Re=oe.floating.style;Re.setProperty("--radix-popper-available-width",`${ie}px`),Re.setProperty("--radix-popper-available-height",`${ve}px`),Re.setProperty("--radix-popper-anchor-width",`${ye}px`),Re.setProperty("--radix-popper-anchor-height",`${le}px`)}}),C&&eG({element:C,padding:f}),lG({arrowWidth:R,arrowHeight:D}),g&&J9({strategy:"referenceHidden",...Y})]}),[Q,ee]=yI(k),z=Wr(O);Wt(()=>{q&&z?.()},[q,z]);const G=V.arrow?.x,$=V.arrow?.y,W=V.arrow?.centerOffset!==0,[ae,ce]=S.useState();return Wt(()=>{E&&ce(window.getComputedStyle(E).zIndex)},[E]),c.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:q?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(aG,{scope:n,placedSide:Q,onArrowChange:N,arrowX:G,arrowY:$,shouldHideArrow:W,children:c.jsx(Ae.div,{"data-side":Q,"data-align":ee,...j,ref:A,style:{...j.style,animation:q?void 0:"none"}})})})});pI.displayName=sO;var vI="PopperArrow",oG={top:"bottom",right:"left",bottom:"top",left:"right"},gI=S.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=iG(vI,r),l=oG[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]: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:c.jsx(nG,{...i,ref:n,style:{...i.style,display:"block"}})})});gI.displayName=vI;function sG(e){return e!==null}var lG=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,l=i.arrow?.centerOffset!==0,f=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[h,v]=yI(n),m={start:"0%",center:"50%",end:"100%"}[v],g=(i.arrow?.x??0)+f/2,x=(i.arrow?.y??0)+d/2;let O="",j="";return h==="bottom"?(O=l?m:`${g}px`,j=`${-d}px`):h==="top"?(O=l?m:`${g}px`,j=`${r.floating.height+d}px`):h==="right"?(O=`${-d}px`,j=l?m:`${x}px`):h==="left"&&(O=`${r.floating.width+d}px`,j=l?m:`${x}px`),{data:{x:O,y:j}}}});function yI(e){const[t,n="center"]=e.split("-");return[t,n]}var Bp=dI,qp=mI,Up=pI,Hp=gI,xI=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cG="VisuallyHidden",bI=S.forwardRef((e,t)=>c.jsx(Ae.span,{...e,ref:t,style:{...xI,...e.style}}));bI.displayName=cG;var uG=bI,[Fp]=jn("Tooltip",[lo]),Gp=lo(),wI="TooltipProvider",fG=700,W1="tooltip.open",[dG,lO]=Fp(wI),SI=e=>{const{__scopeTooltip:t,delayDuration:n=fG,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,l=S.useRef(!0),f=S.useRef(!1),d=S.useRef(0);return S.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),c.jsx(dG,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:S.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:f,onPointerInTransitChange:S.useCallback(h=>{f.current=h},[]),disableHoverableContent:i,children:o})};SI.displayName=wI;var Wu="Tooltip",[hG,Bf]=Fp(Wu),jI=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:l,delayDuration:f}=e,d=lO(Wu,e.__scopeTooltip),h=Gp(t),[v,m]=S.useState(null),g=Cr(),x=S.useRef(0),O=l??d.disableHoverableContent,j=f??d.delayDuration,b=S.useRef(!1),[E,_]=An({prop:r,defaultProp:i??!1,onChange:R=>{R?(d.onOpen(),document.dispatchEvent(new CustomEvent(W1))):d.onClose(),o?.(R)},caller:Wu}),A=S.useMemo(()=>E?b.current?"delayed-open":"instant-open":"closed",[E]),C=S.useCallback(()=>{window.clearTimeout(x.current),x.current=0,b.current=!1,_(!0)},[_]),N=S.useCallback(()=>{window.clearTimeout(x.current),x.current=0,_(!1)},[_]),M=S.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{b.current=!0,_(!0),x.current=0},j)},[j,_]);return S.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),c.jsx(Bp,{...h,children:c.jsx(hG,{scope:t,contentId:g,open:E,stateAttribute:A,trigger:v,onTriggerChange:m,onTriggerEnter:S.useCallback(()=>{d.isOpenDelayedRef.current?M():C()},[d.isOpenDelayedRef,M,C]),onTriggerLeave:S.useCallback(()=>{O?N():(window.clearTimeout(x.current),x.current=0)},[N,O]),onOpen:C,onClose:N,disableHoverableContent:O,children:n})})};jI.displayName=Wu;var K1="TooltipTrigger",OI=S.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Bf(K1,n),o=lO(K1,n),l=Gp(n),f=S.useRef(null),d=Ue(t,f,i.onTriggerChange),h=S.useRef(!1),v=S.useRef(!1),m=S.useCallback(()=>h.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),c.jsx(qp,{asChild:!0,...l,children:c.jsx(Ae.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:ge(e.onPointerMove,g=>{g.pointerType!=="touch"&&!v.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),v.current=!0)}),onPointerLeave:ge(e.onPointerLeave,()=>{i.onTriggerLeave(),v.current=!1}),onPointerDown:ge(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ge(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:ge(e.onBlur,i.onClose),onClick:ge(e.onClick,i.onClose)})})});OI.displayName=K1;var cO="TooltipPortal",[mG,pG]=Fp(cO,{forceMount:void 0}),EI=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Bf(cO,t);return c.jsx(mG,{scope:t,forceMount:n,children:c.jsx(Nn,{present:n||o.open,children:c.jsx(sc,{asChild:!0,container:i,children:r})})})};EI.displayName=cO;var Pl="TooltipContent",_I=S.forwardRef((e,t)=>{const n=pG(Pl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,l=Bf(Pl,e.__scopeTooltip);return c.jsx(Nn,{present:r||l.open,children:l.disableHoverableContent?c.jsx(AI,{side:i,...o,ref:t}):c.jsx(vG,{side:i,...o,ref:t})})}),vG=S.forwardRef((e,t)=>{const n=Bf(Pl,e.__scopeTooltip),r=lO(Pl,e.__scopeTooltip),i=S.useRef(null),o=Ue(t,i),[l,f]=S.useState(null),{trigger:d,onClose:h}=n,v=i.current,{onPointerInTransitChange:m}=r,g=S.useCallback(()=>{f(null),m(!1)},[m]),x=S.useCallback((O,j)=>{const b=O.currentTarget,E={x:O.clientX,y:O.clientY},_=bG(E,b.getBoundingClientRect()),A=wG(E,_),C=SG(j.getBoundingClientRect()),N=OG([...A,...C]);f(N),m(!0)},[m]);return S.useEffect(()=>()=>g(),[g]),S.useEffect(()=>{if(d&&v){const O=b=>x(b,v),j=b=>x(b,d);return d.addEventListener("pointerleave",O),v.addEventListener("pointerleave",j),()=>{d.removeEventListener("pointerleave",O),v.removeEventListener("pointerleave",j)}}},[d,v,x,g]),S.useEffect(()=>{if(l){const O=j=>{const b=j.target,E={x:j.clientX,y:j.clientY},_=d?.contains(b)||v?.contains(b),A=!jG(E,l);_?g():A&&(g(),h())};return document.addEventListener("pointermove",O),()=>document.removeEventListener("pointermove",O)}},[d,v,l,h,g]),c.jsx(AI,{...e,ref:o})}),[gG,yG]=Fp(Wu,{isInside:!1}),xG=S$("TooltipContent"),AI=S.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:l,...f}=e,d=Bf(Pl,n),h=Gp(n),{onClose:v}=d;return S.useEffect(()=>(document.addEventListener(W1,v),()=>document.removeEventListener(W1,v)),[v]),S.useEffect(()=>{if(d.trigger){const m=g=>{g.target?.contains(d.trigger)&&v()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,v]),c.jsx(oc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:v,children:c.jsxs(Up,{"data-state":d.stateAttribute,...h,...f,ref:t,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(xG,{children:r}),c.jsx(gG,{scope:n,isInside:!0,children:c.jsx(uG,{id:d.contentId,role:"tooltip",children:i||r})})]})})});_I.displayName=Pl;var NI="TooltipArrow",CI=S.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Gp(n);return yG(NI,n).isInside?null:c.jsx(Hp,{...i,...r,ref:t})});CI.displayName=NI;function bG(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function wG(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function SG(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function jG(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const f=t[o],d=t[l],h=f.x,v=f.y,m=d.x,g=d.y;v>r!=g>r&&n<(m-h)*(r-v)/(g-v)+h&&(i=!i)}return i}function OG(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),EG(t)}function EG(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _G=SI,AG=jI,NG=OI,CG=EI,TG=_I,MG=CI;function TI({delayDuration:e=0,...t}){return c.jsx(_G,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Vp({...e}){return c.jsx(TI,{children:c.jsx(AG,{"data-slot":"tooltip",...e})})}function Yp({...e}){return c.jsx(NG,{"data-slot":"tooltip-trigger",...e})}function Wp({className:e,sideOffset:t=0,children:n,...r}){return c.jsx(CG,{children:c.jsxs(TG,{className:pe("fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-[--radix-tooltip-content-transform-origin] animate-in text-balance rounded-md bg-foreground px-3 py-1.5 text-background text-xs data-[state=closed]:animate-out",e),"data-slot":"tooltip-content",sideOffset:t,...r,children:[n,c.jsx(MG,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Ax=768;function RG(){const[e,t]=S.useState(void 0);return S.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ax-1}px)`),r=()=>{t(window.innerWidth<Ax)};return n.addEventListener("change",r),t(window.innerWidth<Ax),()=>n.removeEventListener("change",r)},[]),!!e}const DG="sidebar_state",PG=3600*24*7,kG="16rem",$G="18rem",IG="3rem",LG="b",MI=S.createContext(null);function qf(){const e=S.useContext(MI);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function zG({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:o,...l}){const f=RG(),[d,h]=S.useState(!1),[v,m]=S.useState(e),g=t??v,x=S.useCallback(E=>{const _=typeof E=="function"?E(g):E;n?n(_):m(_),document.cookie=`${DG}=${_}; path=/; max-age=${PG}`},[n,g]),O=S.useCallback(()=>f?h(E=>!E):x(E=>!E),[f,x]);S.useEffect(()=>{const E=_=>{_.key===LG&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),O())};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[O]);const j=g?"expanded":"collapsed",b=S.useMemo(()=>({state:j,open:g,setOpen:x,isMobile:f,openMobile:d,setOpenMobile:h,toggleSidebar:O}),[j,g,x,f,d,O]);return c.jsx(MI.Provider,{value:b,children:c.jsx(TI,{delayDuration:0,children:c.jsx("div",{className:pe("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),"data-slot":"sidebar-wrapper",style:{"--sidebar-width":kG,"--sidebar-width-icon":IG,...i},...l,children:o})})})}function Nx({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:i,...o}){const{isMobile:l,state:f,openMobile:d,setOpenMobile:h}=qf();return n==="none"?c.jsx("div",{className:pe("flex h-full w-[calc(var(--sidebar-width)-var(--sidebar-width-icon)+1px)]! flex-col bg-sidebar text-sidebar-foreground",r),"data-sidebar":"sidebar","data-slot":"sidebar",...o,children:i}):l?c.jsx(L7,{onOpenChange:h,open:d,...o,children:c.jsxs(q7,{className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar","data-slot":"sidebar",side:e,style:{"--sidebar-width":$G},children:[c.jsxs(U7,{className:"sr-only",children:[c.jsx(H7,{children:"Sidebar"}),c.jsx(F7,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):c.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":f==="collapsed"?n:"","data-side":e,"data-sidebar":"provider","data-slot":"sidebar","data-state":f,"data-variant":t,children:[c.jsx("div",{className:pe("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]"),"data-slot":"sidebar-gap"}),c.jsx("div",{className:pe("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),"data-slot":"sidebar-container",...o,children:c.jsx("div",{className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm","data-sidebar":"sidebar","data-slot":"sidebar-inner",children:i})})]})}function BG({className:e,onClick:t,...n}){const{toggleSidebar:r}=qf();return c.jsxs(Ce,{className:pe("size-7",e),"data-sidebar":"trigger","data-slot":"sidebar-trigger",onClick:i=>{t?.(i),r()},size:"icon",variant:"ghost",...n,children:[c.jsx(rF,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function qG({className:e,...t}){return c.jsx("main",{className:pe("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",e),"data-slot":"sidebar-inset",...t})}function UG({className:e,...t}){return c.jsx(fs,{className:pe("h-8 w-full bg-background shadow-none",e),"data-sidebar":"input","data-slot":"sidebar-input",...t})}function NC({className:e,...t}){return c.jsx("div",{className:pe("flex flex-col gap-2 p-2",e),"data-sidebar":"header","data-slot":"sidebar-header",...t})}function HG({className:e,...t}){return c.jsx("div",{className:pe("flex flex-col gap-2 p-2",e),"data-sidebar":"footer","data-slot":"sidebar-footer",...t})}function CC({className:e,...t}){return c.jsx("div",{className:pe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),"data-sidebar":"content","data-slot":"sidebar-content",...t})}function TC({className:e,...t}){return c.jsx("div",{className:pe("relative flex w-full min-w-0 flex-col p-2",e),"data-sidebar":"group","data-slot":"sidebar-group",...t})}function MC({className:e,...t}){return c.jsx("div",{className:pe("w-full text-sm",e),"data-sidebar":"group-content","data-slot":"sidebar-group-content",...t})}function X1({className:e,...t}){return c.jsx("ul",{className:pe("flex w-full min-w-0 flex-col gap-1",e),"data-sidebar":"menu","data-slot":"sidebar-menu",...t})}function Q1({className:e,...t}){return c.jsx("li",{className:pe("group/menu-item relative",e),"data-sidebar":"menu-item","data-slot":"sidebar-menu-item",...t})}const FG=ic("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Z1({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:i,className:o,...l}){const f=e?$j:"button",{isMobile:d,state:h}=qf(),v=c.jsx(f,{className:pe(FG({variant:n,size:r}),o),"data-active":t,"data-sidebar":"menu-button","data-size":r,"data-slot":"sidebar-menu-button",...l});if(!i)return v;typeof i=="string"&&(i={children:i});const m=typeof i.hidden=="boolean"?i.hidden:h!=="collapsed"||d;return c.jsxs(Vp,{children:[c.jsx(Yp,{asChild:!0,children:v}),c.jsx(Wp,{align:"center",hidden:m,side:"right",...i})]})}var GG=(e,t,n,r,i,o,l,f)=>{let d=document.documentElement,h=["light","dark"];function v(x){(Array.isArray(e)?e:[e]).forEach(O=>{let j=O==="class",b=j&&o?i.map(E=>o[E]||E):i;j?(d.classList.remove(...b),d.classList.add(o&&o[x]?o[x]:x)):d.setAttribute(O,x)}),m(x)}function m(x){f&&h.includes(x)&&(d.style.colorScheme=x)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)v(r);else try{let x=localStorage.getItem(t)||n,O=l&&x==="system"?g():x;v(O)}catch{}},VG=S.createContext(void 0),YG={setTheme:e=>{},themes:[]},WG=()=>{var e;return(e=S.useContext(VG))!=null?e:YG};S.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:l,themes:f,nonce:d,scriptProps:h})=>{let v=JSON.stringify([n,t,o,e,f,l,r,i]).slice(1,-1);return S.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${GG.toString()})(${v})`}})});function KG(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const XG=e=>{switch(e){case"success":return JG;case"info":return tV;case"warning":return eV;case"error":return nV;default:return null}},QG=Array(12).fill(0),ZG=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},QG.map((n,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),JG=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),eV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),tV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),nV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),rV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aV=()=>{const[e,t]=I.useState(document.hidden);return I.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let J1=1;class iV{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:J1++,l=this.toasts.find(d=>d.id===o),f=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(d=>d.id===o?(this.publish({...d,...t,id:o,title:r}),{...d,...t,id:o,dismissible:f,title:r}):d):this.addToast({title:r,...i,dismissible:f,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const f=i.then(async h=>{if(l=["resolve",h],I.isValidElement(h))o=!1,this.create({id:r,type:"default",message:h});else if(sV(h)&&!h.ok){o=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${h.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${h.status}`):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:g,...O})}else if(h instanceof Error){o=!1;const m=typeof n.error=="function"?await n.error(h):n.error,g=typeof n.description=="function"?await n.description(h):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:g,...O})}else if(n.success!==void 0){o=!1;const m=typeof n.success=="function"?await n.success(h):n.success,g=typeof n.description=="function"?await n.description(h):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"success",description:g,...O})}}).catch(async h=>{if(l=["reject",h],n.error!==void 0){o=!1;const v=typeof n.error=="function"?await n.error(h):n.error,m=typeof n.description=="function"?await n.description(h):n.description,x=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:r,type:"error",description:m,...x})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((h,v)=>f.then(()=>l[0]==="reject"?v(l[1]):h(l[1])).catch(v));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||J1++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const qn=new iV,oV=(e,t)=>{const n=t?.id||J1++;return qn.addToast({title:e,...t,id:n}),n},sV=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lV=oV,cV=()=>qn.toasts,uV=()=>qn.getActiveToasts(),jt=Object.assign(lV,{success:qn.success,info:qn.info,warning:qn.warning,error:qn.error,custom:qn.custom,message:qn.message,promise:qn.promise,dismiss:qn.dismiss,loading:qn.loading},{getHistory:cV,getToasts:uV});KG("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function _h(e){return e.label!==void 0}const fV=3,dV="24px",hV="16px",RC=4e3,mV=356,pV=14,vV=45,gV=200;function la(...e){return e.filter(Boolean).join(" ")}function yV(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const xV=e=>{var t,n,r,i,o,l,f,d,h;const{invert:v,toast:m,unstyled:g,interacting:x,setHeights:O,visibleToasts:j,heights:b,index:E,toasts:_,expanded:A,removeToast:C,defaultRichColors:N,closeButton:M,style:R,cancelButtonStyle:D,actionButtonStyle:L,className:H="",descriptionClassName:B="",duration:U,position:Y,gap:Z,expandByDefault:X,classNames:k,icons:q,closeButtonAriaLabel:V="Close toast"}=e,[Q,ee]=I.useState(null),[z,G]=I.useState(null),[$,W]=I.useState(!1),[ae,ce]=I.useState(!1),[oe,me]=I.useState(!1),[ie,ve]=I.useState(!1),[ye,le]=I.useState(!1),[Re,be]=I.useState(0),[qe,rt]=I.useState(0),mt=I.useRef(m.duration||U||RC),vn=I.useRef(null),Mt=I.useRef(null),fr=E===0,Yn=E+1<=j,Rt=m.type,dr=m.dismissible!==!1,tn=m.className||"",Ss=m.descriptionClassName||"",yo=I.useMemo(()=>b.findIndex(Ie=>Ie.toastId===m.id)||0,[b,m.id]),rd=I.useMemo(()=>{var Ie;return(Ie=m.closeButton)!=null?Ie:M},[m.closeButton,M]),xo=I.useMemo(()=>m.duration||U||RC,[m.duration,U]),Ec=I.useRef(0),Na=I.useRef(0),ad=I.useRef(0),yi=I.useRef(null),[bo,On]=Y.split("-"),$r=I.useMemo(()=>b.reduce((Ie,At,nn)=>nn>=yo?Ie:Ie+At.height,0),[b,yo]),gn=aV(),Qv=m.invert||v,_c=Rt==="loading";Na.current=I.useMemo(()=>yo*Z+$r,[yo,$r]),I.useEffect(()=>{mt.current=xo},[xo]),I.useEffect(()=>{W(!0)},[]),I.useEffect(()=>{const Ie=Mt.current;if(Ie){const At=Ie.getBoundingClientRect().height;return rt(At),O(nn=>[{toastId:m.id,height:At,position:m.position},...nn]),()=>O(nn=>nn.filter(yn=>yn.toastId!==m.id))}},[O,m.id]),I.useLayoutEffect(()=>{if(!$)return;const Ie=Mt.current,At=Ie.style.height;Ie.style.height="auto";const nn=Ie.getBoundingClientRect().height;Ie.style.height=At,rt(nn),O(yn=>yn.find(Dt=>Dt.toastId===m.id)?yn.map(Dt=>Dt.toastId===m.id?{...Dt,height:nn}:Dt):[{toastId:m.id,height:nn,position:m.position},...yn])},[$,m.title,m.description,O,m.id,m.jsx,m.action,m.cancel]);const ta=I.useCallback(()=>{ce(!0),be(Na.current),O(Ie=>Ie.filter(At=>At.toastId!==m.id)),setTimeout(()=>{C(m)},gV)},[m,C,O,Na]);I.useEffect(()=>{if(m.promise&&Rt==="loading"||m.duration===1/0||m.type==="loading")return;let Ie;return A||x||gn?(()=>{if(ad.current<Ec.current){const yn=new Date().getTime()-Ec.current;mt.current=mt.current-yn}ad.current=new Date().getTime()})():(()=>{mt.current!==1/0&&(Ec.current=new Date().getTime(),Ie=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),ta()},mt.current))})(),()=>clearTimeout(Ie)},[A,x,m,Rt,gn,ta]),I.useEffect(()=>{m.delete&&(ta(),m.onDismiss==null||m.onDismiss.call(m,m))},[ta,m.delete]);function js(){var Ie;if(q?.loading){var At;return I.createElement("div",{className:la(k?.loader,m==null||(At=m.classNames)==null?void 0:At.loader,"sonner-loader"),"data-visible":Rt==="loading"},q.loading)}return I.createElement(ZG,{className:la(k?.loader,m==null||(Ie=m.classNames)==null?void 0:Ie.loader),visible:Rt==="loading"})}const Os=m.icon||q?.[Rt]||XG(Rt);var wo,na;return I.createElement("li",{tabIndex:0,ref:Mt,className:la(H,tn,k?.toast,m==null||(t=m.classNames)==null?void 0:t.toast,k?.default,k?.[Rt],m==null||(n=m.classNames)==null?void 0:n[Rt]),"data-sonner-toast":"","data-rich-colors":(wo=m.richColors)!=null?wo:N,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":$,"data-promise":!!m.promise,"data-swiped":ye,"data-removed":ae,"data-visible":Yn,"data-y-position":bo,"data-x-position":On,"data-index":E,"data-front":fr,"data-swiping":oe,"data-dismissible":dr,"data-type":Rt,"data-invert":Qv,"data-swipe-out":ie,"data-swipe-direction":z,"data-expanded":!!(A||X&&$),"data-testid":m.testId,style:{"--index":E,"--toasts-before":E,"--z-index":_.length-E,"--offset":`${ae?Re:Na.current}px`,"--initial-height":X?"auto":`${qe}px`,...R,...m.style},onDragEnd:()=>{me(!1),ee(null),yi.current=null},onPointerDown:Ie=>{Ie.button!==2&&(_c||!dr||(vn.current=new Date,be(Na.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(me(!0),yi.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,At,nn;if(ie||!dr)return;yi.current=null;const yn=Number(((Ie=Mt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),xi=Number(((At=Mt.current)==null?void 0:At.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Dt=new Date().getTime()-((nn=vn.current)==null?void 0:nn.getTime()),Tn=Q==="x"?yn:xi,So=Math.abs(Tn)/Dt;if(Math.abs(Tn)>=vV||So>.11){be(Na.current),m.onDismiss==null||m.onDismiss.call(m,m),G(Q==="x"?yn>0?"right":"left":xi>0?"down":"up"),ta(),ve(!0);return}else{var Mn,Rn;(Mn=Mt.current)==null||Mn.style.setProperty("--swipe-amount-x","0px"),(Rn=Mt.current)==null||Rn.style.setProperty("--swipe-amount-y","0px")}le(!1),me(!1),ee(null)},onPointerMove:Ie=>{var At,nn,yn;if(!yi.current||!dr||((At=window.getSelection())==null?void 0:At.toString().length)>0)return;const Dt=Ie.clientY-yi.current.y,Tn=Ie.clientX-yi.current.x;var So;const Mn=(So=e.swipeDirections)!=null?So:yV(Y);!Q&&(Math.abs(Tn)>1||Math.abs(Dt)>1)&&ee(Math.abs(Tn)>Math.abs(Dt)?"x":"y");let Rn={x:0,y:0};const Es=Ir=>1/(1.5+Math.abs(Ir)/20);if(Q==="y"){if(Mn.includes("top")||Mn.includes("bottom"))if(Mn.includes("top")&&Dt<0||Mn.includes("bottom")&&Dt>0)Rn.y=Dt;else{const Ir=Dt*Es(Dt);Rn.y=Math.abs(Ir)<Math.abs(Dt)?Ir:Dt}}else if(Q==="x"&&(Mn.includes("left")||Mn.includes("right")))if(Mn.includes("left")&&Tn<0||Mn.includes("right")&&Tn>0)Rn.x=Tn;else{const Ir=Tn*Es(Tn);Rn.x=Math.abs(Ir)<Math.abs(Tn)?Ir:Tn}(Math.abs(Rn.x)>0||Math.abs(Rn.y)>0)&&le(!0),(nn=Mt.current)==null||nn.style.setProperty("--swipe-amount-x",`${Rn.x}px`),(yn=Mt.current)==null||yn.style.setProperty("--swipe-amount-y",`${Rn.y}px`)}},rd&&!m.jsx&&Rt!=="loading"?I.createElement("button",{"aria-label":V,"data-disabled":_c,"data-close-button":!0,onClick:_c||!dr?()=>{}:()=>{ta(),m.onDismiss==null||m.onDismiss.call(m,m)},className:la(k?.closeButton,m==null||(r=m.classNames)==null?void 0:r.closeButton)},(na=q?.close)!=null?na:rV):null,(Rt||m.icon||m.promise)&&m.icon!==null&&(q?.[Rt]!==null||m.icon)?I.createElement("div",{"data-icon":"",className:la(k?.icon,m==null||(i=m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||js():null,m.type!=="loading"?Os:null):null,I.createElement("div",{"data-content":"",className:la(k?.content,m==null||(o=m.classNames)==null?void 0:o.content)},I.createElement("div",{"data-title":"",className:la(k?.title,m==null||(l=m.classNames)==null?void 0:l.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?I.createElement("div",{"data-description":"",className:la(B,Ss,k?.description,m==null||(f=m.classNames)==null?void 0:f.description)},typeof m.description=="function"?m.description():m.description):null),I.isValidElement(m.cancel)?m.cancel:m.cancel&&_h(m.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||D,onClick:Ie=>{_h(m.cancel)&&dr&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Ie),ta())},className:la(k?.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,I.isValidElement(m.action)?m.action:m.action&&_h(m.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||L,onClick:Ie=>{_h(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Ie),!Ie.defaultPrevented&&ta())},className:la(k?.actionButton,m==null||(h=m.classNames)==null?void 0:h.actionButton)},m.action.label):null)};function DC(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function bV(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,l=o?"--mobile-offset":"--offset",f=o?hV:dV;function d(h){["top","right","bottom","left"].forEach(v=>{n[`${l}-${v}`]=typeof h=="number"?`${h}px`:h})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(h=>{r[h]===void 0?n[`${l}-${h}`]=f:n[`${l}-${h}`]=typeof r[h]=="number"?`${r[h]}px`:r[h]}):d(f)}),n}const wV=I.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:f,closeButton:d,className:h,offset:v,mobileOffset:m,theme:g="light",richColors:x,duration:O,style:j,visibleToasts:b=fV,toastOptions:E,dir:_=DC(),gap:A=pV,icons:C,containerAriaLabel:N="Notifications"}=t,[M,R]=I.useState([]),D=I.useMemo(()=>r?M.filter($=>$.toasterId===r):M.filter($=>!$.toasterId),[M,r]),L=I.useMemo(()=>Array.from(new Set([o].concat(D.filter($=>$.position).map($=>$.position)))),[D,o]),[H,B]=I.useState([]),[U,Y]=I.useState(!1),[Z,X]=I.useState(!1),[k,q]=I.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=I.useRef(null),Q=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=I.useRef(null),z=I.useRef(!1),G=I.useCallback($=>{R(W=>{var ae;return(ae=W.find(ce=>ce.id===$.id))!=null&&ae.delete||qn.dismiss($.id),W.filter(({id:ce})=>ce!==$.id)})},[]);return I.useEffect(()=>qn.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{R(W=>W.map(ae=>ae.id===$.id?{...ae,delete:!0}:ae))});return}setTimeout(()=>{f$.flushSync(()=>{R(W=>{const ae=W.findIndex(ce=>ce.id===$.id);return ae!==-1?[...W.slice(0,ae),{...W[ae],...$},...W.slice(ae+1)]:[$,...W]})})})}),[M]),I.useEffect(()=>{if(g!=="system"){q(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:W})=>{q(W?"dark":"light")})}catch{$.addListener(({matches:ae})=>{try{q(ae?"dark":"light")}catch(ce){console.error(ce)}})}},[g]),I.useEffect(()=>{M.length<=1&&Y(!1)},[M]),I.useEffect(()=>{const $=W=>{var ae;if(l.every(me=>W[me]||W.code===me)){var oe;Y(!0),(oe=V.current)==null||oe.focus()}W.code==="Escape"&&(document.activeElement===V.current||(ae=V.current)!=null&&ae.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[l]),I.useEffect(()=>{if(V.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,z.current=!1)}},[V.current]),I.createElement("section",{ref:n,"aria-label":`${N} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map(($,W)=>{var ae;const[ce,oe]=$.split("-");return D.length?I.createElement("ol",{key:$,dir:_==="auto"?DC():_,tabIndex:-1,ref:V,className:h,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":ce,"data-x-position":oe,style:{"--front-toast-height":`${((ae=H[0])==null?void 0:ae.height)||0}px`,"--width":`${mV}px`,"--gap":`${A}px`,...j,...bV(v,m)},onBlur:me=>{z.current&&!me.currentTarget.contains(me.relatedTarget)&&(z.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||z.current||(z.current=!0,ee.current=me.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{Z||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},D.filter(me=>!me.position&&W===0||me.position===$).map((me,ie)=>{var ve,ye;return I.createElement(xV,{key:me.id,icons:C,index:ie,toast:me,defaultRichColors:x,duration:(ve=E?.duration)!=null?ve:O,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:i,visibleToasts:b,closeButton:(ye=E?.closeButton)!=null?ye:d,interacting:Z,position:$,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:G,toasts:D.filter(le=>le.position==me.position),heights:H.filter(le=>le.position==me.position),setHeights:B,expandByDefault:f,gap:A,expanded:U,swipeDirections:t.swipeDirections})})):null}))}),SV=({...e})=>{const{theme:t="system"}=WG();return c.jsx(wV,{className:"toaster group",icons:{success:c.jsx(so,{className:"size-4"}),info:c.jsx(JH,{className:"size-4"}),warning:c.jsx(sF,{className:"size-4"}),error:c.jsx(nF,{className:"size-4"}),loading:c.jsx(fa,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},theme:t,...e})};var PC="popstate";function jV(e={}){function t(r,i){let{pathname:o,search:l,hash:f}=r.location;return eS("",{pathname:o,search:l,hash:f},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ku(i)}return EV(t,n,null,e)}function Tt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Dr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function OV(){return Math.random().toString(36).substring(2,10)}function kC(e,t){return{usr:e.state,key:e.key,idx:t}}function eS(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?uc(t):t,state:n,key:t&&t.key||r||OV()}}function Ku({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function uc(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function EV(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,f="POP",d=null,h=v();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function v(){return(l.state||{idx:null}).idx}function m(){f="POP";let b=v(),E=b==null?null:b-h;h=b,d&&d({action:f,location:j.location,delta:E})}function g(b,E){f="PUSH";let _=eS(j.location,b,E);h=v()+1;let A=kC(_,h),C=j.createHref(_);try{l.pushState(A,"",C)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(C)}o&&d&&d({action:f,location:j.location,delta:1})}function x(b,E){f="REPLACE";let _=eS(j.location,b,E);h=v();let A=kC(_,h),C=j.createHref(_);l.replaceState(A,"",C),o&&d&&d({action:f,location:j.location,delta:0})}function O(b){return _V(b)}let j={get action(){return f},get location(){return e(i,l)},listen(b){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(PC,m),d=b,()=>{i.removeEventListener(PC,m),d=null}},createHref(b){return t(i,b)},createURL:O,encodeLocation(b){let E=O(b);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:g,replace:x,go(b){return l.go(b)}};return j}function _V(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Tt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ku(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function RI(e,t,n="/"){return AV(e,t,n,!1)}function AV(e,t,n,r){let i=typeof t=="string"?uc(t):t,o=si(i.pathname||"/",n);if(o==null)return null;let l=DI(e);NV(l);let f=null;for(let d=0;f==null&&d<l.length;++d){let h=zV(o);f=IV(l[d],h,r)}return f}function DI(e,t=[],n=[],r="",i=!1){let o=(l,f,d=i,h)=>{let v={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:f,route:l};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(r)&&d)return;Tt(v.relativePath.startsWith(r),`Absolute route path "${v.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(r.length)}let m=Ja([r,v.relativePath]),g=n.concat(v);l.children&&l.children.length>0&&(Tt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),DI(l.children,t,g,m,d)),!(l.path==null&&!l.index)&&t.push({path:m,score:kV(m,l.index),routesMeta:g})};return e.forEach((l,f)=>{if(l.path===""||!l.path?.includes("?"))o(l,f);else for(let d of PI(l.path))o(l,f,!0,d)}),t}function PI(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=PI(r.join("/")),f=[];return f.push(...l.map(d=>d===""?o:[o,d].join("/"))),i&&f.push(...l),f.map(d=>e.startsWith("/")&&d===""?"/":d)}function NV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$V(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var CV=/^:[\w-]+$/,TV=3,MV=2,RV=1,DV=10,PV=-2,$C=e=>e==="*";function kV(e,t){let n=e.split("/"),r=n.length;return n.some($C)&&(r+=PV),t&&(r+=MV),n.filter(i=>!$C(i)).reduce((i,o)=>i+(CV.test(o)?TV:o===""?RV:DV),r)}function $V(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function IV(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",l=[];for(let f=0;f<r.length;++f){let d=r[f],h=f===r.length-1,v=o==="/"?t:t.slice(o.length)||"/",m=lm({path:d.relativePath,caseSensitive:d.caseSensitive,end:h},v),g=d.route;if(!m&&h&&n&&!r[r.length-1].route.index&&(m=lm({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},v)),!m)return null;Object.assign(i,m.params),l.push({params:i,pathname:Ja([o,m.pathname]),pathnameBase:HV(Ja([o,m.pathnameBase])),route:g}),m.pathnameBase!=="/"&&(o=Ja([o,m.pathnameBase]))}return l}function lm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=LV(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],l=o.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:r.reduce((h,{paramName:v,isOptional:m},g)=>{if(v==="*"){let O=f[g]||"";l=o.slice(0,o.length-O.length).replace(/(.)\/+$/,"$1")}const x=f[g];return m&&!x?h[v]=void 0:h[v]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:l,pattern:e}}function LV(e,t=!1,n=!0){Dr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,f,d)=>(r.push({paramName:f,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function zV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Dr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function si(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var BV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function qV(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?uc(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=IC(n.substring(1),"/"):o=IC(n,t)):o=t,{pathname:o,search:FV(r),hash:GV(i)}}function IC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Cx(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function UV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function uO(e){let t=UV(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function fO(e,t,n,r=!1){let i;typeof e=="string"?i=uc(e):(i={...e},Tt(!i.pathname||!i.pathname.includes("?"),Cx("?","pathname","search",i)),Tt(!i.pathname||!i.pathname.includes("#"),Cx("#","pathname","hash",i)),Tt(!i.search||!i.search.includes("#"),Cx("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,f;if(l==null)f=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),m-=1;i.pathname=g.join("/")}f=m>=0?t[m]:"/"}let d=qV(i,f),h=l&&l!=="/"&&l.endsWith("/"),v=(o||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||v)&&(d.pathname+="/"),d}var Ja=e=>e.join("/").replace(/\/\/+/g,"/"),HV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),FV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,GV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,VV=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function YV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function WV(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var kI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $I(e,t){let n=e;if(typeof n!="string"||!BV.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(kI)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=si(l.pathname,t);l.origin===o.origin&&f!=null?n=f+l.search+l.hash:i=!0}catch{Dr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var II=["POST","PUT","PATCH","DELETE"];new Set(II);var KV=["GET",...II];new Set(KV);var fc=S.createContext(null);fc.displayName="DataRouter";var Kp=S.createContext(null);Kp.displayName="DataRouterState";var XV=S.createContext(!1),LI=S.createContext({isTransitioning:!1});LI.displayName="ViewTransition";var QV=S.createContext(new Map);QV.displayName="Fetchers";var ZV=S.createContext(null);ZV.displayName="Await";var ur=S.createContext(null);ur.displayName="Navigation";var Uf=S.createContext(null);Uf.displayName="Location";var Zr=S.createContext({outlet:null,matches:[],isDataRoute:!1});Zr.displayName="Route";var dO=S.createContext(null);dO.displayName="RouteError";var zI="REACT_ROUTER_ERROR",JV="REDIRECT",eY="ROUTE_ERROR_RESPONSE";function tY(e){if(e.startsWith(`${zI}:${JV}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function nY(e){if(e.startsWith(`${zI}:${eY}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new VV(t.status,t.statusText,t.data)}catch{}}function rY(e,{relative:t}={}){Tt(dc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=S.useContext(ur),{hash:i,pathname:o,search:l}=Hf(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Ja([n,o])),r.createHref({pathname:f,search:l,hash:i})}function dc(){return S.useContext(Uf)!=null}function Jr(){return Tt(dc(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(Uf).location}var BI="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qI(e){S.useContext(ur).static||S.useLayoutEffect(e)}function _a(){let{isDataRoute:e}=S.useContext(Zr);return e?vY():aY()}function aY(){Tt(dc(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(fc),{basename:t,navigator:n}=S.useContext(ur),{matches:r}=S.useContext(Zr),{pathname:i}=Jr(),o=JSON.stringify(uO(r)),l=S.useRef(!1);return qI(()=>{l.current=!0}),S.useCallback((d,h={})=>{if(Dr(l.current,BI),!l.current)return;if(typeof d=="number"){n.go(d);return}let v=fO(d,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:Ja([t,v.pathname])),(h.replace?n.replace:n.push)(v,h.state,h)},[t,n,o,i,e])}S.createContext(null);function hO(){let{matches:e}=S.useContext(Zr),t=e[e.length-1];return t?t.params:{}}function Hf(e,{relative:t}={}){let{matches:n}=S.useContext(Zr),{pathname:r}=Jr(),i=JSON.stringify(uO(n));return S.useMemo(()=>fO(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function iY(e,t){return UI(e,t)}function UI(e,t,n,r,i){Tt(dc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=S.useContext(ur),{matches:l}=S.useContext(Zr),f=l[l.length-1],d=f?f.params:{},h=f?f.pathname:"/",v=f?f.pathnameBase:"/",m=f&&f.route;{let _=m&&m.path||"";FI(h,!m||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
53
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},k7="DialogDescriptionWarning",$7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Q$(k7).contentName}}.`;return S.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Wj=I$,I7=z$,Kj=q$,Xj=U$,Qj=H$,Zj=G$,Jj=Y$,Pp=K$;function L7({...e}){return c.jsx(Wj,{"data-slot":"sheet",...e})}function z7({...e}){return c.jsx(Kj,{"data-slot":"sheet-portal",...e})}function B7({className:e,...t}){return c.jsx(Xj,{className:pe("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"sheet-overlay",...t})}function q7({className:e,children:t,side:n="right",hideCloseButton:r=!1,...i}){return c.jsxs(z7,{children:[c.jsx(B7,{}),c.jsxs(Qj,{className:pe("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),"data-slot":"sheet-content",...i,children:[t,!r&&c.jsxs(Pp,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(or,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function U7({className:e,...t}){return c.jsx("div",{className:pe("flex flex-col gap-1.5 p-4",e),"data-slot":"sheet-header",...t})}function H7({className:e,...t}){return c.jsx(Zj,{className:pe("font-semibold text-foreground",e),"data-slot":"sheet-title",...t})}function F7({className:e,...t}){return c.jsx(Jj,{className:pe("text-muted-foreground text-sm",e),"data-slot":"sheet-description",...t})}function De({className:e,...t}){return c.jsx("div",{className:pe("animate-pulse rounded-md bg-accent",e),"data-slot":"skeleton",...t})}const G7=["top","right","bottom","left"],to=Math.min,ar=Math.max,am=Math.round,Eh=Math.floor,va=e=>({x:e,y:e}),V7={left:"right",right:"left",bottom:"top",top:"bottom"},Y7={start:"end",end:"start"};function G1(e,t,n){return ar(e,to(t,n))}function ii(e,t){return typeof e=="function"?e(t):e}function oi(e){return e.split("-")[0]}function lc(e){return e.split("-")[1]}function eO(e){return e==="x"?"y":"x"}function tO(e){return e==="y"?"height":"width"}const W7=new Set(["top","bottom"]);function da(e){return W7.has(oi(e))?"y":"x"}function nO(e){return eO(da(e))}function K7(e,t,n){n===void 0&&(n=!1);const r=lc(e),i=nO(e),o=tO(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=im(l)),[l,im(l)]}function X7(e){const t=im(e);return[V1(e),t,V1(t)]}function V1(e){return e.replace(/start|end/g,t=>Y7[t])}const gC=["left","right"],yC=["right","left"],Q7=["top","bottom"],Z7=["bottom","top"];function J7(e,t,n){switch(e){case"top":case"bottom":return n?t?yC:gC:t?gC:yC;case"left":case"right":return t?Q7:Z7;default:return[]}}function e9(e,t,n,r){const i=lc(e);let o=J7(oi(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(V1)))),o}function im(e){return e.replace(/left|right|bottom|top/g,t=>V7[t])}function t9(e){return{top:0,right:0,bottom:0,left:0,...e}}function Z$(e){return typeof e!="number"?t9(e):{top:e,right:e,bottom:e,left:e}}function om(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xC(e,t,n){let{reference:r,floating:i}=e;const o=da(t),l=nO(t),f=tO(l),d=oi(t),h=o==="y",v=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,g=r[f]/2-i[f]/2;let x;switch(d){case"top":x={x:v,y:r.y-i.height};break;case"bottom":x={x:v,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:m};break;case"left":x={x:r.x-i.width,y:m};break;default:x={x:r.x,y:r.y}}switch(lc(t)){case"start":x[l]-=g*(n&&h?-1:1);break;case"end":x[l]+=g*(n&&h?-1:1);break}return x}const n9=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,f=o.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:v,y:m}=xC(h,r,d),g=r,x={},O=0;for(let j=0;j<f.length;j++){const{name:b,fn:E}=f[j],{x:_,y:A,data:C,reset:N}=await E({x:v,y:m,initialPlacement:r,placement:g,strategy:i,middlewareData:x,rects:h,platform:l,elements:{reference:e,floating:t}});v=_??v,m=A??m,x={...x,[b]:{...x[b],...C}},N&&O<=50&&(O++,typeof N=="object"&&(N.placement&&(g=N.placement),N.rects&&(h=N.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):N.rects),{x:v,y:m}=xC(h,g,d)),j=-1)}return{x:v,y:m,placement:g,strategy:i,middlewareData:x}};async function Vu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:l,elements:f,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:v="viewport",elementContext:m="floating",altBoundary:g=!1,padding:x=0}=ii(t,e),O=Z$(x),b=f[g?m==="floating"?"reference":"floating":m],E=om(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(f.floating)),boundary:h,rootBoundary:v,strategy:d})),_=m==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f.floating)),C=await(o.isElement==null?void 0:o.isElement(A))?await(o.getScale==null?void 0:o.getScale(A))||{x:1,y:1}:{x:1,y:1},N=om(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:_,offsetParent:A,strategy:d}):_);return{top:(E.top-N.top+O.top)/C.y,bottom:(N.bottom-E.bottom+O.bottom)/C.y,left:(E.left-N.left+O.left)/C.x,right:(N.right-E.right+O.right)/C.x}}const r9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:f,middlewareData:d}=t,{element:h,padding:v=0}=ii(e,t)||{};if(h==null)return{};const m=Z$(v),g={x:n,y:r},x=nO(i),O=tO(x),j=await l.getDimensions(h),b=x==="y",E=b?"top":"left",_=b?"bottom":"right",A=b?"clientHeight":"clientWidth",C=o.reference[O]+o.reference[x]-g[x]-o.floating[O],N=g[x]-o.reference[x],M=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let R=M?M[A]:0;(!R||!await(l.isElement==null?void 0:l.isElement(M)))&&(R=f.floating[A]||o.floating[O]);const D=C/2-N/2,L=R/2-j[O]/2-1,H=to(m[E],L),B=to(m[_],L),U=H,Y=R-j[O]-B,Z=R/2-j[O]/2+D,X=G1(U,Z,Y),k=!d.arrow&&lc(i)!=null&&Z!==X&&o.reference[O]/2-(Z<U?H:B)-j[O]/2<0,q=k?Z<U?Z-U:Z-Y:0;return{[x]:g[x]+q,data:{[x]:X,centerOffset:Z-X-q,...k&&{alignmentOffset:q}},reset:k}}}),a9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:f,platform:d,elements:h}=t,{mainAxis:v=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:j=!0,...b}=ii(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=oi(i),_=da(f),A=oi(f)===f,C=await(d.isRTL==null?void 0:d.isRTL(h.floating)),N=g||(A||!j?[im(f)]:X7(f)),M=O!=="none";!g&&M&&N.push(...e9(f,j,O,C));const R=[f,...N],D=await Vu(t,b),L=[];let H=((r=o.flip)==null?void 0:r.overflows)||[];if(v&&L.push(D[E]),m){const Z=K7(i,l,C);L.push(D[Z[0]],D[Z[1]])}if(H=[...H,{placement:i,overflows:L}],!L.every(Z=>Z<=0)){var B,U;const Z=(((B=o.flip)==null?void 0:B.index)||0)+1,X=R[Z];if(X&&(!(m==="alignment"?_!==da(X):!1)||H.every(V=>da(V.placement)===_?V.overflows[0]>0:!0)))return{data:{index:Z,overflows:H},reset:{placement:X}};let k=(U=H.filter(q=>q.overflows[0]<=0).sort((q,V)=>q.overflows[1]-V.overflows[1])[0])==null?void 0:U.placement;if(!k)switch(x){case"bestFit":{var Y;const q=(Y=H.filter(V=>{if(M){const Q=da(V.placement);return Q===_||Q==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(Q=>Q>0).reduce((Q,ee)=>Q+ee,0)]).sort((V,Q)=>V[1]-Q[1])[0])==null?void 0:Y[0];q&&(k=q);break}case"initialPlacement":k=f;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function bC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wC(e){return G7.some(t=>e[t]>=0)}const i9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ii(e,t);switch(r){case"referenceHidden":{const o=await Vu(t,{...i,elementContext:"reference"}),l=bC(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:wC(l)}}}case"escaped":{const o=await Vu(t,{...i,altBoundary:!0}),l=bC(o,n.floating);return{data:{escapedOffsets:l,escaped:wC(l)}}}default:return{}}}}},J$=new Set(["left","top"]);async function o9(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=oi(n),f=lc(n),d=da(n)==="y",h=J$.has(l)?-1:1,v=o&&d?-1:1,m=ii(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:O}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return f&&typeof O=="number"&&(x=f==="end"?O*-1:O),d?{x:x*v,y:g*h}:{x:g*h,y:x*v}}const s9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:f}=t,d=await o9(t,e);return l===((n=f.offset)==null?void 0:n.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:l}}}}},l9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:f={fn:b=>{let{x:E,y:_}=b;return{x:E,y:_}}},...d}=ii(e,t),h={x:n,y:r},v=await Vu(t,d),m=da(oi(i)),g=eO(m);let x=h[g],O=h[m];if(o){const b=g==="y"?"top":"left",E=g==="y"?"bottom":"right",_=x+v[b],A=x-v[E];x=G1(_,x,A)}if(l){const b=m==="y"?"top":"left",E=m==="y"?"bottom":"right",_=O+v[b],A=O-v[E];O=G1(_,O,A)}const j=f.fn({...t,[g]:x,[m]:O});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[g]:o,[m]:l}}}}}},c9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:f=0,mainAxis:d=!0,crossAxis:h=!0}=ii(e,t),v={x:n,y:r},m=da(i),g=eO(m);let x=v[g],O=v[m];const j=ii(f,t),b=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(d){const A=g==="y"?"height":"width",C=o.reference[g]-o.floating[A]+b.mainAxis,N=o.reference[g]+o.reference[A]-b.mainAxis;x<C?x=C:x>N&&(x=N)}if(h){var E,_;const A=g==="y"?"width":"height",C=J$.has(oi(i)),N=o.reference[m]-o.floating[A]+(C&&((E=l.offset)==null?void 0:E[m])||0)+(C?0:b.crossAxis),M=o.reference[m]+o.reference[A]+(C?0:((_=l.offset)==null?void 0:_[m])||0)-(C?b.crossAxis:0);O<N?O=N:O>M&&(O=M)}return{[g]:x,[m]:O}}}},u9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:f}=t,{apply:d=()=>{},...h}=ii(e,t),v=await Vu(t,h),m=oi(i),g=lc(i),x=da(i)==="y",{width:O,height:j}=o.floating;let b,E;m==="top"||m==="bottom"?(b=m,E=g===(await(l.isRTL==null?void 0:l.isRTL(f.floating))?"start":"end")?"left":"right"):(E=m,b=g==="end"?"top":"bottom");const _=j-v.top-v.bottom,A=O-v.left-v.right,C=to(j-v[b],_),N=to(O-v[E],A),M=!t.middlewareData.shift;let R=C,D=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=A),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=_),M&&!g){const H=ar(v.left,0),B=ar(v.right,0),U=ar(v.top,0),Y=ar(v.bottom,0);x?D=O-2*(H!==0||B!==0?H+B:ar(v.left,v.right)):R=j-2*(U!==0||Y!==0?U+Y:ar(v.top,v.bottom))}await d({...t,availableWidth:D,availableHeight:R});const L=await l.getDimensions(f.floating);return O!==L.width||j!==L.height?{reset:{rects:!0}}:{}}}};function kp(){return typeof window<"u"}function cc(e){return eI(e)?(e.nodeName||"").toLowerCase():"#document"}function sr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ea(e){var t;return(t=(eI(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function eI(e){return kp()?e instanceof Node||e instanceof sr(e).Node:!1}function Kr(e){return kp()?e instanceof Element||e instanceof sr(e).Element:!1}function ja(e){return kp()?e instanceof HTMLElement||e instanceof sr(e).HTMLElement:!1}function SC(e){return!kp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sr(e).ShadowRoot}const f9=new Set(["inline","contents"]);function zf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!f9.has(i)}const d9=new Set(["table","td","th"]);function h9(e){return d9.has(cc(e))}const m9=[":popover-open",":modal"];function $p(e){return m9.some(t=>{try{return e.matches(t)}catch{return!1}})}const p9=["transform","translate","scale","rotate","perspective"],v9=["transform","translate","scale","rotate","perspective","filter"],g9=["paint","layout","strict","content"];function rO(e){const t=aO(),n=Kr(e)?Xr(e):e;return p9.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||v9.some(r=>(n.willChange||"").includes(r))||g9.some(r=>(n.contain||"").includes(r))}function y9(e){let t=no(e);for(;ja(t)&&!Dl(t);){if(rO(t))return t;if($p(t))return null;t=no(t)}return null}function aO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const x9=new Set(["html","body","#document"]);function Dl(e){return x9.has(cc(e))}function Xr(e){return sr(e).getComputedStyle(e)}function Ip(e){return Kr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function no(e){if(cc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||SC(e)&&e.host||Ea(e);return SC(t)?t.host:t}function tI(e){const t=no(e);return Dl(t)?e.ownerDocument?e.ownerDocument.body:e.body:ja(t)&&zf(t)?t:tI(t)}function Yu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=tI(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=sr(i);if(o){const f=Y1(l);return t.concat(l,l.visualViewport||[],zf(i)?i:[],f&&n?Yu(f):[])}return t.concat(i,Yu(i,[],n))}function Y1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nI(e){const t=Xr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ja(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,f=am(n)!==o||am(r)!==l;return f&&(n=o,r=l),{width:n,height:r,$:f}}function iO(e){return Kr(e)?e:e.contextElement}function Ol(e){const t=iO(e);if(!ja(t))return va(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=nI(t);let l=(o?am(n.width):n.width)/r,f=(o?am(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!f||!Number.isFinite(f))&&(f=1),{x:l,y:f}}const b9=va(0);function rI(e){const t=sr(e);return!aO()||!t.visualViewport?b9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function w9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==sr(e)?!1:t}function ts(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=iO(e);let l=va(1);t&&(r?Kr(r)&&(l=Ol(r)):l=Ol(e));const f=w9(o,n,r)?rI(o):va(0);let d=(i.left+f.x)/l.x,h=(i.top+f.y)/l.y,v=i.width/l.x,m=i.height/l.y;if(o){const g=sr(o),x=r&&Kr(r)?sr(r):r;let O=g,j=Y1(O);for(;j&&r&&x!==O;){const b=Ol(j),E=j.getBoundingClientRect(),_=Xr(j),A=E.left+(j.clientLeft+parseFloat(_.paddingLeft))*b.x,C=E.top+(j.clientTop+parseFloat(_.paddingTop))*b.y;d*=b.x,h*=b.y,v*=b.x,m*=b.y,d+=A,h+=C,O=sr(j),j=Y1(O)}}return om({width:v,height:m,x:d,y:h})}function Lp(e,t){const n=Ip(e).scrollLeft;return t?t.left+n:ts(Ea(e)).left+n}function aI(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Lp(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function S9(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=Ea(r),f=t?$p(t.floating):!1;if(r===l||f&&o)return n;let d={scrollLeft:0,scrollTop:0},h=va(1);const v=va(0),m=ja(r);if((m||!m&&!o)&&((cc(r)!=="body"||zf(l))&&(d=Ip(r)),ja(r))){const x=ts(r);h=Ol(r),v.x=x.x+r.clientLeft,v.y=x.y+r.clientTop}const g=l&&!m&&!o?aI(l,d):va(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+v.x+g.x,y:n.y*h.y-d.scrollTop*h.y+v.y+g.y}}function j9(e){return Array.from(e.getClientRects())}function O9(e){const t=Ea(e),n=Ip(e),r=e.ownerDocument.body,i=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Lp(e);const f=-n.scrollTop;return Xr(r).direction==="rtl"&&(l+=ar(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:f}}const jC=25;function E9(e,t){const n=sr(e),r=Ea(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,f=0,d=0;if(i){o=i.width,l=i.height;const v=aO();(!v||v&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const h=Lp(r);if(h<=0){const v=r.ownerDocument,m=v.body,g=getComputedStyle(m),x=v.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,O=Math.abs(r.clientWidth-m.clientWidth-x);O<=jC&&(o-=O)}else h<=jC&&(o+=h);return{width:o,height:l,x:f,y:d}}const _9=new Set(["absolute","fixed"]);function A9(e,t){const n=ts(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ja(e)?Ol(e):va(1),l=e.clientWidth*o.x,f=e.clientHeight*o.y,d=i*o.x,h=r*o.y;return{width:l,height:f,x:d,y:h}}function OC(e,t,n){let r;if(t==="viewport")r=E9(e,n);else if(t==="document")r=O9(Ea(e));else if(Kr(t))r=A9(t,n);else{const i=rI(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return om(r)}function iI(e,t){const n=no(e);return n===t||!Kr(n)||Dl(n)?!1:Xr(n).position==="fixed"||iI(n,t)}function N9(e,t){const n=t.get(e);if(n)return n;let r=Yu(e,[],!1).filter(f=>Kr(f)&&cc(f)!=="body"),i=null;const o=Xr(e).position==="fixed";let l=o?no(e):e;for(;Kr(l)&&!Dl(l);){const f=Xr(l),d=rO(l);!d&&f.position==="fixed"&&(i=null),(o?!d&&!i:!d&&f.position==="static"&&!!i&&_9.has(i.position)||zf(l)&&!d&&iI(e,l))?r=r.filter(v=>v!==l):i=f,l=no(l)}return t.set(e,r),r}function C9(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?$p(t)?[]:N9(t,this._c):[].concat(n),r],f=l[0],d=l.reduce((h,v)=>{const m=OC(t,v,i);return h.top=ar(m.top,h.top),h.right=to(m.right,h.right),h.bottom=to(m.bottom,h.bottom),h.left=ar(m.left,h.left),h},OC(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function T9(e){const{width:t,height:n}=nI(e);return{width:t,height:n}}function M9(e,t,n){const r=ja(t),i=Ea(t),o=n==="fixed",l=ts(e,!0,o,t);let f={scrollLeft:0,scrollTop:0};const d=va(0);function h(){d.x=Lp(i)}if(r||!r&&!o)if((cc(t)!=="body"||zf(i))&&(f=Ip(t)),r){const x=ts(t,!0,o,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else i&&h();o&&!r&&i&&h();const v=i&&!r&&!o?aI(i,f):va(0),m=l.left+f.scrollLeft-d.x-v.x,g=l.top+f.scrollTop-d.y-v.y;return{x:m,y:g,width:l.width,height:l.height}}function Ex(e){return Xr(e).position==="static"}function EC(e,t){if(!ja(e)||Xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ea(e)===n&&(n=n.ownerDocument.body),n}function oI(e,t){const n=sr(e);if($p(e))return n;if(!ja(e)){let i=no(e);for(;i&&!Dl(i);){if(Kr(i)&&!Ex(i))return i;i=no(i)}return n}let r=EC(e,t);for(;r&&h9(r)&&Ex(r);)r=EC(r,t);return r&&Dl(r)&&Ex(r)&&!rO(r)?n:r||y9(e)||n}const R9=async function(e){const t=this.getOffsetParent||oI,n=this.getDimensions,r=await n(e.floating);return{reference:M9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function D9(e){return Xr(e).direction==="rtl"}const P9={convertOffsetParentRelativeRectToViewportRelativeRect:S9,getDocumentElement:Ea,getClippingRect:C9,getOffsetParent:oI,getElementRects:R9,getClientRects:j9,getDimensions:T9,getScale:Ol,isElement:Kr,isRTL:D9};function sI(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k9(e,t){let n=null,r;const i=Ea(e);function o(){var f;clearTimeout(r),(f=n)==null||f.disconnect(),n=null}function l(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),o();const h=e.getBoundingClientRect(),{left:v,top:m,width:g,height:x}=h;if(f||t(),!g||!x)return;const O=Eh(m),j=Eh(i.clientWidth-(v+g)),b=Eh(i.clientHeight-(m+x)),E=Eh(v),A={rootMargin:-O+"px "+-j+"px "+-b+"px "+-E+"px",threshold:ar(0,to(1,d))||1};let C=!0;function N(M){const R=M[0].intersectionRatio;if(R!==d){if(!C)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}R===1&&!sI(h,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{...A,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,A)}n.observe(e)}return l(!0),o}function $9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=iO(e),v=i||o?[...h?Yu(h):[],...Yu(t)]:[];v.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const m=h&&f?k9(h,n):null;let g=-1,x=null;l&&(x=new ResizeObserver(E=>{let[_]=E;_&&_.target===h&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var A;(A=x)==null||A.observe(t)})),n()}),h&&!d&&x.observe(h),x.observe(t));let O,j=d?ts(e):null;d&&b();function b(){const E=ts(e);j&&!sI(j,E)&&n(),j=E,O=requestAnimationFrame(b)}return n(),()=>{var E;v.forEach(_=>{i&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),m?.(),(E=x)==null||E.disconnect(),x=null,d&&cancelAnimationFrame(O)}}const I9=s9,L9=l9,z9=a9,B9=u9,q9=i9,_C=r9,U9=c9,H9=(e,t,n)=>{const r=new Map,i={platform:P9,...n},o={...i.platform,_c:r};return n9(e,t,{...i,platform:o})};var F9=typeof document<"u",G9=function(){},Wh=F9?S.useLayoutEffect:G9;function sm(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 n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!sm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!sm(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function lI(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function AC(e,t){const n=lI(e);return Math.round(t*n)/n}function _x(e){const t=S.useRef(e);return Wh(()=>{t.current=e}),t}function V9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:f=!0,whileElementsMounted:d,open:h}=e,[v,m]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=S.useState(r);sm(g,r)||x(r);const[O,j]=S.useState(null),[b,E]=S.useState(null),_=S.useCallback(V=>{V!==M.current&&(M.current=V,j(V))},[]),A=S.useCallback(V=>{V!==R.current&&(R.current=V,E(V))},[]),C=o||O,N=l||b,M=S.useRef(null),R=S.useRef(null),D=S.useRef(v),L=d!=null,H=_x(d),B=_x(i),U=_x(h),Y=S.useCallback(()=>{if(!M.current||!R.current)return;const V={placement:t,strategy:n,middleware:g};B.current&&(V.platform=B.current),H9(M.current,R.current,V).then(Q=>{const ee={...Q,isPositioned:U.current!==!1};Z.current&&!sm(D.current,ee)&&(D.current=ee,$f.flushSync(()=>{m(ee)}))})},[g,t,n,B,U]);Wh(()=>{h===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,m(V=>({...V,isPositioned:!1})))},[h]);const Z=S.useRef(!1);Wh(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Wh(()=>{if(C&&(M.current=C),N&&(R.current=N),C&&N){if(H.current)return H.current(C,N,Y);Y()}},[C,N,Y,H,L]);const X=S.useMemo(()=>({reference:M,floating:R,setReference:_,setFloating:A}),[_,A]),k=S.useMemo(()=>({reference:C,floating:N}),[C,N]),q=S.useMemo(()=>{const V={position:n,left:0,top:0};if(!k.floating)return V;const Q=AC(k.floating,v.x),ee=AC(k.floating,v.y);return f?{...V,transform:"translate("+Q+"px, "+ee+"px)",...lI(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:ee}},[n,f,k.floating,v.x,v.y]);return S.useMemo(()=>({...v,update:Y,refs:X,elements:k,floatingStyles:q}),[v,Y,X,k,q])}const Y9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?_C({element:r.current,padding:i}).fn(n):{}:r?_C({element:r,padding:i}).fn(n):{}}}},W9=(e,t)=>({...I9(e),options:[e,t]}),K9=(e,t)=>({...L9(e),options:[e,t]}),X9=(e,t)=>({...U9(e),options:[e,t]}),Q9=(e,t)=>({...z9(e),options:[e,t]}),Z9=(e,t)=>({...B9(e),options:[e,t]}),J9=(e,t)=>({...q9(e),options:[e,t]}),eG=(e,t)=>({...Y9(e),options:[e,t]});var tG="Arrow",cI=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return c.jsx(Ae.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});cI.displayName=tG;var nG=cI;function zp(e){const[t,n]=S.useState(void 0);return Wt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,f;if("borderBoxSize"in o){const d=o.borderBoxSize,h=Array.isArray(d)?d[0]:d;l=h.inlineSize,f=h.blockSize}else l=e.offsetWidth,f=e.offsetHeight;n({width:l,height:f})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var oO="Popper",[uI,lo]=jn(oO),[rG,fI]=uI(oO),dI=e=>{const{__scopePopper:t,children:n}=e,[r,i]=S.useState(null);return c.jsx(rG,{scope:t,anchor:r,onAnchorChange:i,children:n})};dI.displayName=oO;var hI="PopperAnchor",mI=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=fI(hI,n),l=S.useRef(null),f=Ue(t,l),d=S.useRef(null);return S.useEffect(()=>{const h=d.current;d.current=r?.current||l.current,h!==d.current&&o.onAnchorChange(d.current)}),r?null:c.jsx(Ae.div,{...i,ref:f})});mI.displayName=hI;var sO="PopperContent",[aG,iG]=uI(sO),pI=S.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:f=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:v=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:O,...j}=e,b=fI(sO,n),[E,_]=S.useState(null),A=Ue(t,oe=>_(oe)),[C,N]=S.useState(null),M=zp(C),R=M?.width??0,D=M?.height??0,L=r+(o!=="center"?"-"+o:""),H=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},B=Array.isArray(h)?h:[h],U=B.length>0,Y={padding:H,boundary:B.filter(sG),altBoundary:U},{refs:Z,floatingStyles:X,placement:k,isPositioned:q,middlewareData:V}=V9({strategy:"fixed",placement:L,whileElementsMounted:(...oe)=>$9(...oe,{animationFrame:x==="always"}),elements:{reference:b.anchor},middleware:[W9({mainAxis:i+D,alignmentAxis:l}),d&&K9({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?X9():void 0,...Y}),d&&Q9({...Y}),Z9({...Y,apply:({elements:oe,rects:me,availableWidth:ie,availableHeight:ve})=>{const{width:ye,height:le}=me.reference,Re=oe.floating.style;Re.setProperty("--radix-popper-available-width",`${ie}px`),Re.setProperty("--radix-popper-available-height",`${ve}px`),Re.setProperty("--radix-popper-anchor-width",`${ye}px`),Re.setProperty("--radix-popper-anchor-height",`${le}px`)}}),C&&eG({element:C,padding:f}),lG({arrowWidth:R,arrowHeight:D}),g&&J9({strategy:"referenceHidden",...Y})]}),[Q,ee]=yI(k),z=Wr(O);Wt(()=>{q&&z?.()},[q,z]);const G=V.arrow?.x,$=V.arrow?.y,W=V.arrow?.centerOffset!==0,[ae,ce]=S.useState();return Wt(()=>{E&&ce(window.getComputedStyle(E).zIndex)},[E]),c.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:q?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(aG,{scope:n,placedSide:Q,onArrowChange:N,arrowX:G,arrowY:$,shouldHideArrow:W,children:c.jsx(Ae.div,{"data-side":Q,"data-align":ee,...j,ref:A,style:{...j.style,animation:q?void 0:"none"}})})})});pI.displayName=sO;var vI="PopperArrow",oG={top:"bottom",right:"left",bottom:"top",left:"right"},gI=S.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=iG(vI,r),l=oG[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]: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:c.jsx(nG,{...i,ref:n,style:{...i.style,display:"block"}})})});gI.displayName=vI;function sG(e){return e!==null}var lG=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,l=i.arrow?.centerOffset!==0,f=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[h,v]=yI(n),m={start:"0%",center:"50%",end:"100%"}[v],g=(i.arrow?.x??0)+f/2,x=(i.arrow?.y??0)+d/2;let O="",j="";return h==="bottom"?(O=l?m:`${g}px`,j=`${-d}px`):h==="top"?(O=l?m:`${g}px`,j=`${r.floating.height+d}px`):h==="right"?(O=`${-d}px`,j=l?m:`${x}px`):h==="left"&&(O=`${r.floating.width+d}px`,j=l?m:`${x}px`),{data:{x:O,y:j}}}});function yI(e){const[t,n="center"]=e.split("-");return[t,n]}var Bp=dI,qp=mI,Up=pI,Hp=gI,xI=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cG="VisuallyHidden",bI=S.forwardRef((e,t)=>c.jsx(Ae.span,{...e,ref:t,style:{...xI,...e.style}}));bI.displayName=cG;var uG=bI,[Fp]=jn("Tooltip",[lo]),Gp=lo(),wI="TooltipProvider",fG=700,W1="tooltip.open",[dG,lO]=Fp(wI),SI=e=>{const{__scopeTooltip:t,delayDuration:n=fG,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,l=S.useRef(!0),f=S.useRef(!1),d=S.useRef(0);return S.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),c.jsx(dG,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:S.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:f,onPointerInTransitChange:S.useCallback(h=>{f.current=h},[]),disableHoverableContent:i,children:o})};SI.displayName=wI;var Wu="Tooltip",[hG,Bf]=Fp(Wu),jI=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:l,delayDuration:f}=e,d=lO(Wu,e.__scopeTooltip),h=Gp(t),[v,m]=S.useState(null),g=Cr(),x=S.useRef(0),O=l??d.disableHoverableContent,j=f??d.delayDuration,b=S.useRef(!1),[E,_]=An({prop:r,defaultProp:i??!1,onChange:R=>{R?(d.onOpen(),document.dispatchEvent(new CustomEvent(W1))):d.onClose(),o?.(R)},caller:Wu}),A=S.useMemo(()=>E?b.current?"delayed-open":"instant-open":"closed",[E]),C=S.useCallback(()=>{window.clearTimeout(x.current),x.current=0,b.current=!1,_(!0)},[_]),N=S.useCallback(()=>{window.clearTimeout(x.current),x.current=0,_(!1)},[_]),M=S.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{b.current=!0,_(!0),x.current=0},j)},[j,_]);return S.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),c.jsx(Bp,{...h,children:c.jsx(hG,{scope:t,contentId:g,open:E,stateAttribute:A,trigger:v,onTriggerChange:m,onTriggerEnter:S.useCallback(()=>{d.isOpenDelayedRef.current?M():C()},[d.isOpenDelayedRef,M,C]),onTriggerLeave:S.useCallback(()=>{O?N():(window.clearTimeout(x.current),x.current=0)},[N,O]),onOpen:C,onClose:N,disableHoverableContent:O,children:n})})};jI.displayName=Wu;var K1="TooltipTrigger",OI=S.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Bf(K1,n),o=lO(K1,n),l=Gp(n),f=S.useRef(null),d=Ue(t,f,i.onTriggerChange),h=S.useRef(!1),v=S.useRef(!1),m=S.useCallback(()=>h.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),c.jsx(qp,{asChild:!0,...l,children:c.jsx(Ae.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:ge(e.onPointerMove,g=>{g.pointerType!=="touch"&&!v.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),v.current=!0)}),onPointerLeave:ge(e.onPointerLeave,()=>{i.onTriggerLeave(),v.current=!1}),onPointerDown:ge(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ge(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:ge(e.onBlur,i.onClose),onClick:ge(e.onClick,i.onClose)})})});OI.displayName=K1;var cO="TooltipPortal",[mG,pG]=Fp(cO,{forceMount:void 0}),EI=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Bf(cO,t);return c.jsx(mG,{scope:t,forceMount:n,children:c.jsx(Nn,{present:n||o.open,children:c.jsx(sc,{asChild:!0,container:i,children:r})})})};EI.displayName=cO;var Pl="TooltipContent",_I=S.forwardRef((e,t)=>{const n=pG(Pl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,l=Bf(Pl,e.__scopeTooltip);return c.jsx(Nn,{present:r||l.open,children:l.disableHoverableContent?c.jsx(AI,{side:i,...o,ref:t}):c.jsx(vG,{side:i,...o,ref:t})})}),vG=S.forwardRef((e,t)=>{const n=Bf(Pl,e.__scopeTooltip),r=lO(Pl,e.__scopeTooltip),i=S.useRef(null),o=Ue(t,i),[l,f]=S.useState(null),{trigger:d,onClose:h}=n,v=i.current,{onPointerInTransitChange:m}=r,g=S.useCallback(()=>{f(null),m(!1)},[m]),x=S.useCallback((O,j)=>{const b=O.currentTarget,E={x:O.clientX,y:O.clientY},_=bG(E,b.getBoundingClientRect()),A=wG(E,_),C=SG(j.getBoundingClientRect()),N=OG([...A,...C]);f(N),m(!0)},[m]);return S.useEffect(()=>()=>g(),[g]),S.useEffect(()=>{if(d&&v){const O=b=>x(b,v),j=b=>x(b,d);return d.addEventListener("pointerleave",O),v.addEventListener("pointerleave",j),()=>{d.removeEventListener("pointerleave",O),v.removeEventListener("pointerleave",j)}}},[d,v,x,g]),S.useEffect(()=>{if(l){const O=j=>{const b=j.target,E={x:j.clientX,y:j.clientY},_=d?.contains(b)||v?.contains(b),A=!jG(E,l);_?g():A&&(g(),h())};return document.addEventListener("pointermove",O),()=>document.removeEventListener("pointermove",O)}},[d,v,l,h,g]),c.jsx(AI,{...e,ref:o})}),[gG,yG]=Fp(Wu,{isInside:!1}),xG=S$("TooltipContent"),AI=S.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:l,...f}=e,d=Bf(Pl,n),h=Gp(n),{onClose:v}=d;return S.useEffect(()=>(document.addEventListener(W1,v),()=>document.removeEventListener(W1,v)),[v]),S.useEffect(()=>{if(d.trigger){const m=g=>{g.target?.contains(d.trigger)&&v()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,v]),c.jsx(oc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:v,children:c.jsxs(Up,{"data-state":d.stateAttribute,...h,...f,ref:t,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(xG,{children:r}),c.jsx(gG,{scope:n,isInside:!0,children:c.jsx(uG,{id:d.contentId,role:"tooltip",children:i||r})})]})})});_I.displayName=Pl;var NI="TooltipArrow",CI=S.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Gp(n);return yG(NI,n).isInside?null:c.jsx(Hp,{...i,...r,ref:t})});CI.displayName=NI;function bG(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function wG(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function SG(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function jG(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const f=t[o],d=t[l],h=f.x,v=f.y,m=d.x,g=d.y;v>r!=g>r&&n<(m-h)*(r-v)/(g-v)+h&&(i=!i)}return i}function OG(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),EG(t)}function EG(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _G=SI,AG=jI,NG=OI,CG=EI,TG=_I,MG=CI;function TI({delayDuration:e=0,...t}){return c.jsx(_G,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Vp({...e}){return c.jsx(TI,{children:c.jsx(AG,{"data-slot":"tooltip",...e})})}function Yp({...e}){return c.jsx(NG,{"data-slot":"tooltip-trigger",...e})}function Wp({className:e,sideOffset:t=0,children:n,...r}){return c.jsx(CG,{children:c.jsxs(TG,{className:pe("fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in text-balance rounded-md bg-foreground px-3 py-1.5 text-background text-xs data-[state=closed]:animate-out",e),"data-slot":"tooltip-content",sideOffset:t,...r,children:[n,c.jsx(MG,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Ax=768;function RG(){const[e,t]=S.useState(void 0);return S.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ax-1}px)`),r=()=>{t(window.innerWidth<Ax)};return n.addEventListener("change",r),t(window.innerWidth<Ax),()=>n.removeEventListener("change",r)},[]),!!e}const DG="sidebar_state",PG=3600*24*7,kG="16rem",$G="18rem",IG="3rem",LG="b",MI=S.createContext(null);function qf(){const e=S.useContext(MI);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function zG({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:o,...l}){const f=RG(),[d,h]=S.useState(!1),[v,m]=S.useState(e),g=t??v,x=S.useCallback(E=>{const _=typeof E=="function"?E(g):E;n?n(_):m(_),document.cookie=`${DG}=${_}; path=/; max-age=${PG}`},[n,g]),O=S.useCallback(()=>f?h(E=>!E):x(E=>!E),[f,x]);S.useEffect(()=>{const E=_=>{_.key===LG&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),O())};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[O]);const j=g?"expanded":"collapsed",b=S.useMemo(()=>({state:j,open:g,setOpen:x,isMobile:f,openMobile:d,setOpenMobile:h,toggleSidebar:O}),[j,g,x,f,d,O]);return c.jsx(MI.Provider,{value:b,children:c.jsx(TI,{delayDuration:0,children:c.jsx("div",{className:pe("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),"data-slot":"sidebar-wrapper",style:{"--sidebar-width":kG,"--sidebar-width-icon":IG,...i},...l,children:o})})})}function Nx({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:i,...o}){const{isMobile:l,state:f,openMobile:d,setOpenMobile:h}=qf();return n==="none"?c.jsx("div",{className:pe("flex h-full w-[calc(var(--sidebar-width)-var(--sidebar-width-icon)+1px)]! flex-col bg-sidebar text-sidebar-foreground",r),"data-sidebar":"sidebar","data-slot":"sidebar",...o,children:i}):l?c.jsx(L7,{onOpenChange:h,open:d,...o,children:c.jsxs(q7,{className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar","data-slot":"sidebar",side:e,style:{"--sidebar-width":$G},children:[c.jsxs(U7,{className:"sr-only",children:[c.jsx(H7,{children:"Sidebar"}),c.jsx(F7,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):c.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":f==="collapsed"?n:"","data-side":e,"data-sidebar":"provider","data-slot":"sidebar","data-state":f,"data-variant":t,children:[c.jsx("div",{className:pe("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)"),"data-slot":"sidebar-gap"}),c.jsx("div",{className:pe("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),"data-slot":"sidebar-container",...o,children:c.jsx("div",{className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm","data-sidebar":"sidebar","data-slot":"sidebar-inner",children:i})})]})}function BG({className:e,onClick:t,...n}){const{toggleSidebar:r}=qf();return c.jsxs(Ce,{className:pe("size-7",e),"data-sidebar":"trigger","data-slot":"sidebar-trigger",onClick:i=>{t?.(i),r()},size:"icon",variant:"ghost",...n,children:[c.jsx(rF,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function qG({className:e,...t}){return c.jsx("main",{className:pe("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",e),"data-slot":"sidebar-inset",...t})}function UG({className:e,...t}){return c.jsx(fs,{className:pe("h-8 w-full bg-background shadow-none",e),"data-sidebar":"input","data-slot":"sidebar-input",...t})}function NC({className:e,...t}){return c.jsx("div",{className:pe("flex flex-col gap-2 p-2",e),"data-sidebar":"header","data-slot":"sidebar-header",...t})}function HG({className:e,...t}){return c.jsx("div",{className:pe("flex flex-col gap-2 p-2",e),"data-sidebar":"footer","data-slot":"sidebar-footer",...t})}function CC({className:e,...t}){return c.jsx("div",{className:pe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),"data-sidebar":"content","data-slot":"sidebar-content",...t})}function TC({className:e,...t}){return c.jsx("div",{className:pe("relative flex w-full min-w-0 flex-col p-2",e),"data-sidebar":"group","data-slot":"sidebar-group",...t})}function MC({className:e,...t}){return c.jsx("div",{className:pe("w-full text-sm",e),"data-sidebar":"group-content","data-slot":"sidebar-group-content",...t})}function X1({className:e,...t}){return c.jsx("ul",{className:pe("flex w-full min-w-0 flex-col gap-1",e),"data-sidebar":"menu","data-slot":"sidebar-menu",...t})}function Q1({className:e,...t}){return c.jsx("li",{className:pe("group/menu-item relative",e),"data-sidebar":"menu-item","data-slot":"sidebar-menu-item",...t})}const FG=ic("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Z1({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:i,className:o,...l}){const f=e?$j:"button",{isMobile:d,state:h}=qf(),v=c.jsx(f,{className:pe(FG({variant:n,size:r}),o),"data-active":t,"data-sidebar":"menu-button","data-size":r,"data-slot":"sidebar-menu-button",...l});if(!i)return v;typeof i=="string"&&(i={children:i});const m=typeof i.hidden=="boolean"?i.hidden:h!=="collapsed"||d;return c.jsxs(Vp,{children:[c.jsx(Yp,{asChild:!0,children:v}),c.jsx(Wp,{align:"center",hidden:m,side:"right",...i})]})}var GG=(e,t,n,r,i,o,l,f)=>{let d=document.documentElement,h=["light","dark"];function v(x){(Array.isArray(e)?e:[e]).forEach(O=>{let j=O==="class",b=j&&o?i.map(E=>o[E]||E):i;j?(d.classList.remove(...b),d.classList.add(o&&o[x]?o[x]:x)):d.setAttribute(O,x)}),m(x)}function m(x){f&&h.includes(x)&&(d.style.colorScheme=x)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)v(r);else try{let x=localStorage.getItem(t)||n,O=l&&x==="system"?g():x;v(O)}catch{}},VG=S.createContext(void 0),YG={setTheme:e=>{},themes:[]},WG=()=>{var e;return(e=S.useContext(VG))!=null?e:YG};S.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:l,themes:f,nonce:d,scriptProps:h})=>{let v=JSON.stringify([n,t,o,e,f,l,r,i]).slice(1,-1);return S.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${GG.toString()})(${v})`}})});function KG(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const XG=e=>{switch(e){case"success":return JG;case"info":return tV;case"warning":return eV;case"error":return nV;default:return null}},QG=Array(12).fill(0),ZG=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},QG.map((n,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),JG=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),eV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),tV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),nV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),rV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aV=()=>{const[e,t]=I.useState(document.hidden);return I.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let J1=1;class iV{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:J1++,l=this.toasts.find(d=>d.id===o),f=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(d=>d.id===o?(this.publish({...d,...t,id:o,title:r}),{...d,...t,id:o,dismissible:f,title:r}):d):this.addToast({title:r,...i,dismissible:f,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const f=i.then(async h=>{if(l=["resolve",h],I.isValidElement(h))o=!1,this.create({id:r,type:"default",message:h});else if(sV(h)&&!h.ok){o=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${h.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${h.status}`):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:g,...O})}else if(h instanceof Error){o=!1;const m=typeof n.error=="function"?await n.error(h):n.error,g=typeof n.description=="function"?await n.description(h):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:g,...O})}else if(n.success!==void 0){o=!1;const m=typeof n.success=="function"?await n.success(h):n.success,g=typeof n.description=="function"?await n.description(h):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"success",description:g,...O})}}).catch(async h=>{if(l=["reject",h],n.error!==void 0){o=!1;const v=typeof n.error=="function"?await n.error(h):n.error,m=typeof n.description=="function"?await n.description(h):n.description,x=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:r,type:"error",description:m,...x})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((h,v)=>f.then(()=>l[0]==="reject"?v(l[1]):h(l[1])).catch(v));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||J1++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const qn=new iV,oV=(e,t)=>{const n=t?.id||J1++;return qn.addToast({title:e,...t,id:n}),n},sV=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lV=oV,cV=()=>qn.toasts,uV=()=>qn.getActiveToasts(),jt=Object.assign(lV,{success:qn.success,info:qn.info,warning:qn.warning,error:qn.error,custom:qn.custom,message:qn.message,promise:qn.promise,dismiss:qn.dismiss,loading:qn.loading},{getHistory:cV,getToasts:uV});KG("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function _h(e){return e.label!==void 0}const fV=3,dV="24px",hV="16px",RC=4e3,mV=356,pV=14,vV=45,gV=200;function la(...e){return e.filter(Boolean).join(" ")}function yV(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const xV=e=>{var t,n,r,i,o,l,f,d,h;const{invert:v,toast:m,unstyled:g,interacting:x,setHeights:O,visibleToasts:j,heights:b,index:E,toasts:_,expanded:A,removeToast:C,defaultRichColors:N,closeButton:M,style:R,cancelButtonStyle:D,actionButtonStyle:L,className:H="",descriptionClassName:B="",duration:U,position:Y,gap:Z,expandByDefault:X,classNames:k,icons:q,closeButtonAriaLabel:V="Close toast"}=e,[Q,ee]=I.useState(null),[z,G]=I.useState(null),[$,W]=I.useState(!1),[ae,ce]=I.useState(!1),[oe,me]=I.useState(!1),[ie,ve]=I.useState(!1),[ye,le]=I.useState(!1),[Re,be]=I.useState(0),[qe,rt]=I.useState(0),mt=I.useRef(m.duration||U||RC),vn=I.useRef(null),Mt=I.useRef(null),fr=E===0,Yn=E+1<=j,Rt=m.type,dr=m.dismissible!==!1,tn=m.className||"",Ss=m.descriptionClassName||"",yo=I.useMemo(()=>b.findIndex(Ie=>Ie.toastId===m.id)||0,[b,m.id]),rd=I.useMemo(()=>{var Ie;return(Ie=m.closeButton)!=null?Ie:M},[m.closeButton,M]),xo=I.useMemo(()=>m.duration||U||RC,[m.duration,U]),Ec=I.useRef(0),Na=I.useRef(0),ad=I.useRef(0),yi=I.useRef(null),[bo,On]=Y.split("-"),$r=I.useMemo(()=>b.reduce((Ie,At,nn)=>nn>=yo?Ie:Ie+At.height,0),[b,yo]),gn=aV(),Qv=m.invert||v,_c=Rt==="loading";Na.current=I.useMemo(()=>yo*Z+$r,[yo,$r]),I.useEffect(()=>{mt.current=xo},[xo]),I.useEffect(()=>{W(!0)},[]),I.useEffect(()=>{const Ie=Mt.current;if(Ie){const At=Ie.getBoundingClientRect().height;return rt(At),O(nn=>[{toastId:m.id,height:At,position:m.position},...nn]),()=>O(nn=>nn.filter(yn=>yn.toastId!==m.id))}},[O,m.id]),I.useLayoutEffect(()=>{if(!$)return;const Ie=Mt.current,At=Ie.style.height;Ie.style.height="auto";const nn=Ie.getBoundingClientRect().height;Ie.style.height=At,rt(nn),O(yn=>yn.find(Dt=>Dt.toastId===m.id)?yn.map(Dt=>Dt.toastId===m.id?{...Dt,height:nn}:Dt):[{toastId:m.id,height:nn,position:m.position},...yn])},[$,m.title,m.description,O,m.id,m.jsx,m.action,m.cancel]);const ta=I.useCallback(()=>{ce(!0),be(Na.current),O(Ie=>Ie.filter(At=>At.toastId!==m.id)),setTimeout(()=>{C(m)},gV)},[m,C,O,Na]);I.useEffect(()=>{if(m.promise&&Rt==="loading"||m.duration===1/0||m.type==="loading")return;let Ie;return A||x||gn?(()=>{if(ad.current<Ec.current){const yn=new Date().getTime()-Ec.current;mt.current=mt.current-yn}ad.current=new Date().getTime()})():(()=>{mt.current!==1/0&&(Ec.current=new Date().getTime(),Ie=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),ta()},mt.current))})(),()=>clearTimeout(Ie)},[A,x,m,Rt,gn,ta]),I.useEffect(()=>{m.delete&&(ta(),m.onDismiss==null||m.onDismiss.call(m,m))},[ta,m.delete]);function js(){var Ie;if(q?.loading){var At;return I.createElement("div",{className:la(k?.loader,m==null||(At=m.classNames)==null?void 0:At.loader,"sonner-loader"),"data-visible":Rt==="loading"},q.loading)}return I.createElement(ZG,{className:la(k?.loader,m==null||(Ie=m.classNames)==null?void 0:Ie.loader),visible:Rt==="loading"})}const Os=m.icon||q?.[Rt]||XG(Rt);var wo,na;return I.createElement("li",{tabIndex:0,ref:Mt,className:la(H,tn,k?.toast,m==null||(t=m.classNames)==null?void 0:t.toast,k?.default,k?.[Rt],m==null||(n=m.classNames)==null?void 0:n[Rt]),"data-sonner-toast":"","data-rich-colors":(wo=m.richColors)!=null?wo:N,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":$,"data-promise":!!m.promise,"data-swiped":ye,"data-removed":ae,"data-visible":Yn,"data-y-position":bo,"data-x-position":On,"data-index":E,"data-front":fr,"data-swiping":oe,"data-dismissible":dr,"data-type":Rt,"data-invert":Qv,"data-swipe-out":ie,"data-swipe-direction":z,"data-expanded":!!(A||X&&$),"data-testid":m.testId,style:{"--index":E,"--toasts-before":E,"--z-index":_.length-E,"--offset":`${ae?Re:Na.current}px`,"--initial-height":X?"auto":`${qe}px`,...R,...m.style},onDragEnd:()=>{me(!1),ee(null),yi.current=null},onPointerDown:Ie=>{Ie.button!==2&&(_c||!dr||(vn.current=new Date,be(Na.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(me(!0),yi.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,At,nn;if(ie||!dr)return;yi.current=null;const yn=Number(((Ie=Mt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),xi=Number(((At=Mt.current)==null?void 0:At.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Dt=new Date().getTime()-((nn=vn.current)==null?void 0:nn.getTime()),Tn=Q==="x"?yn:xi,So=Math.abs(Tn)/Dt;if(Math.abs(Tn)>=vV||So>.11){be(Na.current),m.onDismiss==null||m.onDismiss.call(m,m),G(Q==="x"?yn>0?"right":"left":xi>0?"down":"up"),ta(),ve(!0);return}else{var Mn,Rn;(Mn=Mt.current)==null||Mn.style.setProperty("--swipe-amount-x","0px"),(Rn=Mt.current)==null||Rn.style.setProperty("--swipe-amount-y","0px")}le(!1),me(!1),ee(null)},onPointerMove:Ie=>{var At,nn,yn;if(!yi.current||!dr||((At=window.getSelection())==null?void 0:At.toString().length)>0)return;const Dt=Ie.clientY-yi.current.y,Tn=Ie.clientX-yi.current.x;var So;const Mn=(So=e.swipeDirections)!=null?So:yV(Y);!Q&&(Math.abs(Tn)>1||Math.abs(Dt)>1)&&ee(Math.abs(Tn)>Math.abs(Dt)?"x":"y");let Rn={x:0,y:0};const Es=Ir=>1/(1.5+Math.abs(Ir)/20);if(Q==="y"){if(Mn.includes("top")||Mn.includes("bottom"))if(Mn.includes("top")&&Dt<0||Mn.includes("bottom")&&Dt>0)Rn.y=Dt;else{const Ir=Dt*Es(Dt);Rn.y=Math.abs(Ir)<Math.abs(Dt)?Ir:Dt}}else if(Q==="x"&&(Mn.includes("left")||Mn.includes("right")))if(Mn.includes("left")&&Tn<0||Mn.includes("right")&&Tn>0)Rn.x=Tn;else{const Ir=Tn*Es(Tn);Rn.x=Math.abs(Ir)<Math.abs(Tn)?Ir:Tn}(Math.abs(Rn.x)>0||Math.abs(Rn.y)>0)&&le(!0),(nn=Mt.current)==null||nn.style.setProperty("--swipe-amount-x",`${Rn.x}px`),(yn=Mt.current)==null||yn.style.setProperty("--swipe-amount-y",`${Rn.y}px`)}},rd&&!m.jsx&&Rt!=="loading"?I.createElement("button",{"aria-label":V,"data-disabled":_c,"data-close-button":!0,onClick:_c||!dr?()=>{}:()=>{ta(),m.onDismiss==null||m.onDismiss.call(m,m)},className:la(k?.closeButton,m==null||(r=m.classNames)==null?void 0:r.closeButton)},(na=q?.close)!=null?na:rV):null,(Rt||m.icon||m.promise)&&m.icon!==null&&(q?.[Rt]!==null||m.icon)?I.createElement("div",{"data-icon":"",className:la(k?.icon,m==null||(i=m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||js():null,m.type!=="loading"?Os:null):null,I.createElement("div",{"data-content":"",className:la(k?.content,m==null||(o=m.classNames)==null?void 0:o.content)},I.createElement("div",{"data-title":"",className:la(k?.title,m==null||(l=m.classNames)==null?void 0:l.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?I.createElement("div",{"data-description":"",className:la(B,Ss,k?.description,m==null||(f=m.classNames)==null?void 0:f.description)},typeof m.description=="function"?m.description():m.description):null),I.isValidElement(m.cancel)?m.cancel:m.cancel&&_h(m.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||D,onClick:Ie=>{_h(m.cancel)&&dr&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Ie),ta())},className:la(k?.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,I.isValidElement(m.action)?m.action:m.action&&_h(m.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||L,onClick:Ie=>{_h(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Ie),!Ie.defaultPrevented&&ta())},className:la(k?.actionButton,m==null||(h=m.classNames)==null?void 0:h.actionButton)},m.action.label):null)};function DC(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function bV(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,l=o?"--mobile-offset":"--offset",f=o?hV:dV;function d(h){["top","right","bottom","left"].forEach(v=>{n[`${l}-${v}`]=typeof h=="number"?`${h}px`:h})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(h=>{r[h]===void 0?n[`${l}-${h}`]=f:n[`${l}-${h}`]=typeof r[h]=="number"?`${r[h]}px`:r[h]}):d(f)}),n}const wV=I.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:f,closeButton:d,className:h,offset:v,mobileOffset:m,theme:g="light",richColors:x,duration:O,style:j,visibleToasts:b=fV,toastOptions:E,dir:_=DC(),gap:A=pV,icons:C,containerAriaLabel:N="Notifications"}=t,[M,R]=I.useState([]),D=I.useMemo(()=>r?M.filter($=>$.toasterId===r):M.filter($=>!$.toasterId),[M,r]),L=I.useMemo(()=>Array.from(new Set([o].concat(D.filter($=>$.position).map($=>$.position)))),[D,o]),[H,B]=I.useState([]),[U,Y]=I.useState(!1),[Z,X]=I.useState(!1),[k,q]=I.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=I.useRef(null),Q=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=I.useRef(null),z=I.useRef(!1),G=I.useCallback($=>{R(W=>{var ae;return(ae=W.find(ce=>ce.id===$.id))!=null&&ae.delete||qn.dismiss($.id),W.filter(({id:ce})=>ce!==$.id)})},[]);return I.useEffect(()=>qn.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{R(W=>W.map(ae=>ae.id===$.id?{...ae,delete:!0}:ae))});return}setTimeout(()=>{f$.flushSync(()=>{R(W=>{const ae=W.findIndex(ce=>ce.id===$.id);return ae!==-1?[...W.slice(0,ae),{...W[ae],...$},...W.slice(ae+1)]:[$,...W]})})})}),[M]),I.useEffect(()=>{if(g!=="system"){q(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:W})=>{q(W?"dark":"light")})}catch{$.addListener(({matches:ae})=>{try{q(ae?"dark":"light")}catch(ce){console.error(ce)}})}},[g]),I.useEffect(()=>{M.length<=1&&Y(!1)},[M]),I.useEffect(()=>{const $=W=>{var ae;if(l.every(me=>W[me]||W.code===me)){var oe;Y(!0),(oe=V.current)==null||oe.focus()}W.code==="Escape"&&(document.activeElement===V.current||(ae=V.current)!=null&&ae.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[l]),I.useEffect(()=>{if(V.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,z.current=!1)}},[V.current]),I.createElement("section",{ref:n,"aria-label":`${N} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map(($,W)=>{var ae;const[ce,oe]=$.split("-");return D.length?I.createElement("ol",{key:$,dir:_==="auto"?DC():_,tabIndex:-1,ref:V,className:h,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":ce,"data-x-position":oe,style:{"--front-toast-height":`${((ae=H[0])==null?void 0:ae.height)||0}px`,"--width":`${mV}px`,"--gap":`${A}px`,...j,...bV(v,m)},onBlur:me=>{z.current&&!me.currentTarget.contains(me.relatedTarget)&&(z.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||z.current||(z.current=!0,ee.current=me.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{Z||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},D.filter(me=>!me.position&&W===0||me.position===$).map((me,ie)=>{var ve,ye;return I.createElement(xV,{key:me.id,icons:C,index:ie,toast:me,defaultRichColors:x,duration:(ve=E?.duration)!=null?ve:O,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:i,visibleToasts:b,closeButton:(ye=E?.closeButton)!=null?ye:d,interacting:Z,position:$,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:G,toasts:D.filter(le=>le.position==me.position),heights:H.filter(le=>le.position==me.position),setHeights:B,expandByDefault:f,gap:A,expanded:U,swipeDirections:t.swipeDirections})})):null}))}),SV=({...e})=>{const{theme:t="system"}=WG();return c.jsx(wV,{className:"toaster group",icons:{success:c.jsx(so,{className:"size-4"}),info:c.jsx(JH,{className:"size-4"}),warning:c.jsx(sF,{className:"size-4"}),error:c.jsx(nF,{className:"size-4"}),loading:c.jsx(fa,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},theme:t,...e})};var PC="popstate";function jV(e={}){function t(r,i){let{pathname:o,search:l,hash:f}=r.location;return eS("",{pathname:o,search:l,hash:f},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ku(i)}return EV(t,n,null,e)}function Tt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Dr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function OV(){return Math.random().toString(36).substring(2,10)}function kC(e,t){return{usr:e.state,key:e.key,idx:t}}function eS(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?uc(t):t,state:n,key:t&&t.key||r||OV()}}function Ku({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function uc(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function EV(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,f="POP",d=null,h=v();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function v(){return(l.state||{idx:null}).idx}function m(){f="POP";let b=v(),E=b==null?null:b-h;h=b,d&&d({action:f,location:j.location,delta:E})}function g(b,E){f="PUSH";let _=eS(j.location,b,E);h=v()+1;let A=kC(_,h),C=j.createHref(_);try{l.pushState(A,"",C)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(C)}o&&d&&d({action:f,location:j.location,delta:1})}function x(b,E){f="REPLACE";let _=eS(j.location,b,E);h=v();let A=kC(_,h),C=j.createHref(_);l.replaceState(A,"",C),o&&d&&d({action:f,location:j.location,delta:0})}function O(b){return _V(b)}let j={get action(){return f},get location(){return e(i,l)},listen(b){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(PC,m),d=b,()=>{i.removeEventListener(PC,m),d=null}},createHref(b){return t(i,b)},createURL:O,encodeLocation(b){let E=O(b);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:g,replace:x,go(b){return l.go(b)}};return j}function _V(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Tt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ku(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function RI(e,t,n="/"){return AV(e,t,n,!1)}function AV(e,t,n,r){let i=typeof t=="string"?uc(t):t,o=si(i.pathname||"/",n);if(o==null)return null;let l=DI(e);NV(l);let f=null;for(let d=0;f==null&&d<l.length;++d){let h=zV(o);f=IV(l[d],h,r)}return f}function DI(e,t=[],n=[],r="",i=!1){let o=(l,f,d=i,h)=>{let v={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:f,route:l};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(r)&&d)return;Tt(v.relativePath.startsWith(r),`Absolute route path "${v.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(r.length)}let m=Ja([r,v.relativePath]),g=n.concat(v);l.children&&l.children.length>0&&(Tt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),DI(l.children,t,g,m,d)),!(l.path==null&&!l.index)&&t.push({path:m,score:kV(m,l.index),routesMeta:g})};return e.forEach((l,f)=>{if(l.path===""||!l.path?.includes("?"))o(l,f);else for(let d of PI(l.path))o(l,f,!0,d)}),t}function PI(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=PI(r.join("/")),f=[];return f.push(...l.map(d=>d===""?o:[o,d].join("/"))),i&&f.push(...l),f.map(d=>e.startsWith("/")&&d===""?"/":d)}function NV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$V(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var CV=/^:[\w-]+$/,TV=3,MV=2,RV=1,DV=10,PV=-2,$C=e=>e==="*";function kV(e,t){let n=e.split("/"),r=n.length;return n.some($C)&&(r+=PV),t&&(r+=MV),n.filter(i=>!$C(i)).reduce((i,o)=>i+(CV.test(o)?TV:o===""?RV:DV),r)}function $V(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function IV(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",l=[];for(let f=0;f<r.length;++f){let d=r[f],h=f===r.length-1,v=o==="/"?t:t.slice(o.length)||"/",m=lm({path:d.relativePath,caseSensitive:d.caseSensitive,end:h},v),g=d.route;if(!m&&h&&n&&!r[r.length-1].route.index&&(m=lm({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},v)),!m)return null;Object.assign(i,m.params),l.push({params:i,pathname:Ja([o,m.pathname]),pathnameBase:HV(Ja([o,m.pathnameBase])),route:g}),m.pathnameBase!=="/"&&(o=Ja([o,m.pathnameBase]))}return l}function lm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=LV(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],l=o.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:r.reduce((h,{paramName:v,isOptional:m},g)=>{if(v==="*"){let O=f[g]||"";l=o.slice(0,o.length-O.length).replace(/(.)\/+$/,"$1")}const x=f[g];return m&&!x?h[v]=void 0:h[v]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:l,pattern:e}}function LV(e,t=!1,n=!0){Dr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,f,d)=>(r.push({paramName:f,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function zV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Dr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function si(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var BV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function qV(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?uc(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=IC(n.substring(1),"/"):o=IC(n,t)):o=t,{pathname:o,search:FV(r),hash:GV(i)}}function IC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Cx(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function UV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function uO(e){let t=UV(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function fO(e,t,n,r=!1){let i;typeof e=="string"?i=uc(e):(i={...e},Tt(!i.pathname||!i.pathname.includes("?"),Cx("?","pathname","search",i)),Tt(!i.pathname||!i.pathname.includes("#"),Cx("#","pathname","hash",i)),Tt(!i.search||!i.search.includes("#"),Cx("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,f;if(l==null)f=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),m-=1;i.pathname=g.join("/")}f=m>=0?t[m]:"/"}let d=qV(i,f),h=l&&l!=="/"&&l.endsWith("/"),v=(o||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||v)&&(d.pathname+="/"),d}var Ja=e=>e.join("/").replace(/\/\/+/g,"/"),HV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),FV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,GV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,VV=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function YV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function WV(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var kI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $I(e,t){let n=e;if(typeof n!="string"||!BV.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(kI)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=si(l.pathname,t);l.origin===o.origin&&f!=null?n=f+l.search+l.hash:i=!0}catch{Dr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var II=["POST","PUT","PATCH","DELETE"];new Set(II);var KV=["GET",...II];new Set(KV);var fc=S.createContext(null);fc.displayName="DataRouter";var Kp=S.createContext(null);Kp.displayName="DataRouterState";var XV=S.createContext(!1),LI=S.createContext({isTransitioning:!1});LI.displayName="ViewTransition";var QV=S.createContext(new Map);QV.displayName="Fetchers";var ZV=S.createContext(null);ZV.displayName="Await";var ur=S.createContext(null);ur.displayName="Navigation";var Uf=S.createContext(null);Uf.displayName="Location";var Zr=S.createContext({outlet:null,matches:[],isDataRoute:!1});Zr.displayName="Route";var dO=S.createContext(null);dO.displayName="RouteError";var zI="REACT_ROUTER_ERROR",JV="REDIRECT",eY="ROUTE_ERROR_RESPONSE";function tY(e){if(e.startsWith(`${zI}:${JV}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function nY(e){if(e.startsWith(`${zI}:${eY}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new VV(t.status,t.statusText,t.data)}catch{}}function rY(e,{relative:t}={}){Tt(dc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=S.useContext(ur),{hash:i,pathname:o,search:l}=Hf(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Ja([n,o])),r.createHref({pathname:f,search:l,hash:i})}function dc(){return S.useContext(Uf)!=null}function Jr(){return Tt(dc(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(Uf).location}var BI="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qI(e){S.useContext(ur).static||S.useLayoutEffect(e)}function _a(){let{isDataRoute:e}=S.useContext(Zr);return e?vY():aY()}function aY(){Tt(dc(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(fc),{basename:t,navigator:n}=S.useContext(ur),{matches:r}=S.useContext(Zr),{pathname:i}=Jr(),o=JSON.stringify(uO(r)),l=S.useRef(!1);return qI(()=>{l.current=!0}),S.useCallback((d,h={})=>{if(Dr(l.current,BI),!l.current)return;if(typeof d=="number"){n.go(d);return}let v=fO(d,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:Ja([t,v.pathname])),(h.replace?n.replace:n.push)(v,h.state,h)},[t,n,o,i,e])}S.createContext(null);function hO(){let{matches:e}=S.useContext(Zr),t=e[e.length-1];return t?t.params:{}}function Hf(e,{relative:t}={}){let{matches:n}=S.useContext(Zr),{pathname:r}=Jr(),i=JSON.stringify(uO(n));return S.useMemo(()=>fO(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function iY(e,t){return UI(e,t)}function UI(e,t,n,r,i){Tt(dc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=S.useContext(ur),{matches:l}=S.useContext(Zr),f=l[l.length-1],d=f?f.params:{},h=f?f.pathname:"/",v=f?f.pathnameBase:"/",m=f&&f.route;{let _=m&&m.path||"";FI(h,!m||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
54
54
|
|
|
55
|
-
Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let g=Jr(),x;if(t){let _=typeof t=="string"?uc(t):t;Tt(v==="/"||_.pathname?.startsWith(v),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${_.pathname}" was given in the \`location\` prop.`),x=_}else x=g;let O=x.pathname||"/",j=O;if(v!=="/"){let _=v.replace(/^\//,"").split("/");j="/"+O.replace(/^\//,"").split("/").slice(_.length).join("/")}let b=RI(e,{pathname:j});Dr(m||b!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Dr(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=uY(b&&b.map(_=>Object.assign({},_,{params:Object.assign({},d,_.params),pathname:Ja([v,o.encodeLocation?o.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?v:Ja([v,o.encodeLocation?o.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),l,n,r,i);return t&&E?S.createElement(Uf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},E):E}function oY(){let e=pY(),t=YV(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:o},"ErrorBoundary")," or"," ",S.createElement("code",{style:o},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:i},n):null,l)}var sY=S.createElement(oY,null),HI=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=nY(e.digest);n&&(e=n)}let t=e!==void 0?S.createElement(Zr.Provider,{value:this.props.routeContext},S.createElement(dO.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(lY,{error:e},t):t}};HI.contextType=XV;var Tx=new WeakMap;function lY({children:e,error:t}){let{basename:n}=S.useContext(ur);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=tY(t.digest);if(r){let i=Tx.get(t);if(i)throw i;let o=$I(r.location,n);if(kI&&!Tx.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw Tx.set(t,l),l}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function cY({routeContext:e,match:t,children:n}){let r=S.useContext(fc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(Zr.Provider,{value:e},n)}function uY(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=n?.errors;if(l!=null){let v=o.findIndex(m=>m.route.id&&l?.[m.route.id]!==void 0);Tt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let f=!1,d=-1;if(n)for(let v=0;v<o.length;v++){let m=o[v];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=v),m.route.id){let{loaderData:g,errors:x}=n,O=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||O){f=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}let h=n&&r?(v,m)=>{r(v,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:WV(n.matches),errorInfo:m})}:void 0;return o.reduceRight((v,m,g)=>{let x,O=!1,j=null,b=null;n&&(x=l&&m.route.id?l[m.route.id]:void 0,j=m.route.errorElement||sY,f&&(d<0&&g===0?(FI("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,b=null):d===g&&(O=!0,b=m.route.hydrateFallbackElement||null)));let E=t.concat(o.slice(0,g+1)),_=()=>{let A;return x?A=j:O?A=b:m.route.Component?A=S.createElement(m.route.Component,null):m.route.element?A=m.route.element:A=v,S.createElement(cY,{match:m,routeContext:{outlet:v,matches:E,isDataRoute:n!=null},children:A})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?S.createElement(HI,{location:n.location,revalidation:n.revalidation,component:j,error:x,children:_(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):_()},null)}function mO(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fY(e){let t=S.useContext(fc);return Tt(t,mO(e)),t}function dY(e){let t=S.useContext(Kp);return Tt(t,mO(e)),t}function hY(e){let t=S.useContext(Zr);return Tt(t,mO(e)),t}function pO(e){let t=hY(e),n=t.matches[t.matches.length-1];return Tt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function mY(){return pO("useRouteId")}function pY(){let e=S.useContext(dO),t=dY("useRouteError"),n=pO("useRouteError");return e!==void 0?e:t.errors?.[n]}function vY(){let{router:e}=fY("useNavigate"),t=pO("useNavigate"),n=S.useRef(!1);return qI(()=>{n.current=!0}),S.useCallback(async(i,o={})=>{Dr(n.current,BI),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var LC={};function FI(e,t,n){!t&&!LC[e]&&(LC[e]=!0,Dr(!1,n))}S.memo(gY);function gY({routes:e,future:t,state:n,onError:r}){return UI(e,void 0,n,r,t)}function yY({to:e,replace:t,state:n,relative:r}){Tt(dc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=S.useContext(ur);Dr(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=S.useContext(Zr),{pathname:l}=Jr(),f=_a(),d=fO(e,uO(o),l,r==="path"),h=JSON.stringify(d);return S.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:r})},[f,h,r,t,n]),null}function Bn(e){Tt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function xY({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1,unstable_useTransitions:l}){Tt(!dc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),d=S.useMemo(()=>({basename:f,navigator:i,static:o,unstable_useTransitions:l,future:{}}),[f,i,o,l]);typeof n=="string"&&(n=uc(n));let{pathname:h="/",search:v="",hash:m="",state:g=null,key:x="default"}=n,O=S.useMemo(()=>{let j=si(h,f);return j==null?null:{location:{pathname:j,search:v,hash:m,state:g,key:x},navigationType:r}},[f,h,v,m,g,x,r]);return Dr(O!=null,`<Router basename="${f}"> is not able to match the URL "${h}${v}${m}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:S.createElement(ur.Provider,{value:d},S.createElement(Uf.Provider,{children:t,value:O}))}function bY({children:e,location:t}){return iY(tS(e),t)}function tS(e,t=[]){let n=[];return S.Children.forEach(e,(r,i)=>{if(!S.isValidElement(r))return;let o=[...t,i];if(r.type===S.Fragment){n.push.apply(n,tS(r.props.children,o));return}Tt(r.type===Bn,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Tt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=tS(r.props.children,o)),n.push(l)}),n}var Kh="get",Xh="application/x-www-form-urlencoded";function Xp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function wY(e){return Xp(e)&&e.tagName.toLowerCase()==="button"}function SY(e){return Xp(e)&&e.tagName.toLowerCase()==="form"}function jY(e){return Xp(e)&&e.tagName.toLowerCase()==="input"}function OY(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function EY(e,t){return e.button===0&&(!t||t==="_self")&&!OY(e)}function nS(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function _Y(e,t){let n=nS(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var Ah=null;function AY(){if(Ah===null)try{new FormData(document.createElement("form"),0),Ah=!1}catch{Ah=!0}return Ah}var NY=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mx(e){return e!=null&&!NY.has(e)?(Dr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xh}"`),null):e}function CY(e,t){let n,r,i,o,l;if(SY(e)){let f=e.getAttribute("action");r=f?si(f,t):null,n=e.getAttribute("method")||Kh,i=Mx(e.getAttribute("enctype"))||Xh,o=new FormData(e)}else if(wY(e)||jY(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||f.getAttribute("action");if(r=d?si(d,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Kh,i=Mx(e.getAttribute("formenctype"))||Mx(f.getAttribute("enctype"))||Xh,o=new FormData(f,e),!AY()){let{name:h,type:v,value:m}=e;if(v==="image"){let g=h?`${h}.`:"";o.append(`${g}x`,"0"),o.append(`${g}y`,"0")}else h&&o.append(h,m)}}else{if(Xp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Kh,r=null,i=Xh,l=e}return o&&i==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vO(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function TY(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&si(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function MY(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function RY(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function DY(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let l=await MY(o,n);return l.links?l.links():[]}return[]}));return IY(r.flat(1).filter(RY).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function zC(e,t,n,r,i,o){let l=(d,h)=>n[h]?d.route.id!==n[h].route.id:!0,f=(d,h)=>n[h].pathname!==d.pathname||n[h].route.path?.endsWith("*")&&n[h].params["*"]!==d.params["*"];return o==="assets"?t.filter((d,h)=>l(d,h)||f(d,h)):o==="data"?t.filter((d,h)=>{let v=r.routes[d.route.id];if(!v||!v.hasLoader)return!1;if(l(d,h)||f(d,h))return!0;if(d.route.shouldRevalidate){let m=d.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function PY(e,t,{includeHydrateFallback:n}={}){return kY(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function kY(e){return[...new Set(e)]}function $Y(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function IY(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify($Y(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function GI(){let e=S.useContext(fc);return vO(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function LY(){let e=S.useContext(Kp);return vO(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var gO=S.createContext(void 0);gO.displayName="FrameworkContext";function VI(){let e=S.useContext(gO);return vO(e,"You must render this element inside a <HydratedRouter> element"),e}function zY(e,t){let n=S.useContext(gO),[r,i]=S.useState(!1),[o,l]=S.useState(!1),{onFocus:f,onBlur:d,onMouseEnter:h,onMouseLeave:v,onTouchStart:m}=t,g=S.useRef(null);S.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let j=E=>{E.forEach(_=>{l(_.isIntersecting)})},b=new IntersectionObserver(j,{threshold:.5});return g.current&&b.observe(g.current),()=>{b.disconnect()}}},[e]),S.useEffect(()=>{if(r){let j=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(j)}}},[r]);let x=()=>{i(!0)},O=()=>{i(!1),l(!1)};return n?e!=="intent"?[o,g,{}]:[o,g,{onFocus:xu(f,x),onBlur:xu(d,O),onMouseEnter:xu(h,x),onMouseLeave:xu(v,O),onTouchStart:xu(m,x)}]:[!1,g,{}]}function xu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function BY({page:e,...t}){let{router:n}=GI(),r=S.useMemo(()=>RI(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?S.createElement(UY,{page:e,matches:r,...t}):null}function qY(e){let{manifest:t,routeModules:n}=VI(),[r,i]=S.useState([]);return S.useEffect(()=>{let o=!1;return DY(e,t,n).then(l=>{o||i(l)}),()=>{o=!0}},[e,t,n]),r}function UY({page:e,matches:t,...n}){let r=Jr(),{future:i,manifest:o,routeModules:l}=VI(),{basename:f}=GI(),{loaderData:d,matches:h}=LY(),v=S.useMemo(()=>zC(e,t,h,o,r,"data"),[e,t,h,o,r]),m=S.useMemo(()=>zC(e,t,h,o,r,"assets"),[e,t,h,o,r]),g=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let j=new Set,b=!1;if(t.forEach(_=>{let A=o.routes[_.route.id];!A||!A.hasLoader||(!v.some(C=>C.route.id===_.route.id)&&_.route.id in d&&l[_.route.id]?.shouldRevalidate||A.hasClientLoader?b=!0:j.add(_.route.id))}),j.size===0)return[];let E=TY(e,f,i.unstable_trailingSlashAwareDataRequests,"data");return b&&j.size>0&&E.searchParams.set("_routes",t.filter(_=>j.has(_.route.id)).map(_=>_.route.id).join(",")),[E.pathname+E.search]},[f,i.unstable_trailingSlashAwareDataRequests,d,r,o,v,t,e,l]),x=S.useMemo(()=>PY(m,o),[m,o]),O=qY(m);return S.createElement(S.Fragment,null,g.map(j=>S.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),x.map(j=>S.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),O.map(({key:j,link:b})=>S.createElement("link",{key:j,nonce:n.nonce,...b,crossOrigin:b.crossOrigin??n.crossOrigin})))}function HY(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var FY=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{FY&&(window.__reactRouterVersion="7.13.0")}catch{}function GY({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=S.useRef();i.current==null&&(i.current=jV({window:r,v5Compat:!0}));let o=i.current,[l,f]=S.useState({action:o.action,location:o.location}),d=S.useCallback(h=>{n===!1?f(h):S.startTransition(()=>f(h))},[n]);return S.useLayoutEffect(()=>o.listen(d),[o,d]),S.createElement(xY,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var YI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cm=S.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:l,state:f,target:d,to:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g,...x},O){let{basename:j,unstable_useTransitions:b}=S.useContext(ur),E=typeof h=="string"&&YI.test(h),_=$I(h,j);h=_.to;let A=rY(h,{relative:i}),[C,N,M]=zY(r,x),R=KY(h,{replace:l,state:f,target:d,preventScrollReset:v,relative:i,viewTransition:m,unstable_defaultShouldRevalidate:g,unstable_useTransitions:b});function D(H){t&&t(H),H.defaultPrevented||R(H)}let L=S.createElement("a",{...x,...M,href:_.absoluteURL||A,onClick:_.isExternal||o?t:D,ref:HY(O,N),target:d,"data-discover":!E&&n==="render"?"true":void 0});return C&&!E?S.createElement(S.Fragment,null,L,S.createElement(BY,{page:A})):L});cm.displayName="Link";var VY=S.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:l,viewTransition:f,children:d,...h},v){let m=Hf(l,{relative:h.relative}),g=Jr(),x=S.useContext(Kp),{navigator:O,basename:j}=S.useContext(ur),b=x!=null&&tW(m)&&f===!0,E=O.encodeLocation?O.encodeLocation(m).pathname:m.pathname,_=g.pathname,A=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(_=_.toLowerCase(),A=A?A.toLowerCase():null,E=E.toLowerCase()),A&&j&&(A=si(A,j)||A);const C=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let N=_===E||!i&&_.startsWith(E)&&_.charAt(C)==="/",M=A!=null&&(A===E||!i&&A.startsWith(E)&&A.charAt(E.length)==="/"),R={isActive:N,isPending:M,isTransitioning:b},D=N?t:void 0,L;typeof r=="function"?L=r(R):L=[r,N?"active":null,M?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let H=typeof o=="function"?o(R):o;return S.createElement(cm,{...h,"aria-current":D,className:L,ref:v,style:H,to:l,viewTransition:f},typeof d=="function"?d(R):d)});VY.displayName="NavLink";var YY=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:l=Kh,action:f,onSubmit:d,relative:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g,...x},O)=>{let{unstable_useTransitions:j}=S.useContext(ur),b=JY(),E=eW(f,{relative:h}),_=l.toLowerCase()==="get"?"get":"post",A=typeof f=="string"&&YI.test(f),C=N=>{if(d&&d(N),N.defaultPrevented)return;N.preventDefault();let M=N.nativeEvent.submitter,R=M?.getAttribute("formmethod")||l,D=()=>b(M||N.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:i,state:o,relative:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g});j&&n!==!1?S.startTransition(()=>D()):D()};return S.createElement("form",{ref:O,method:_,action:E,onSubmit:r?d:C,...x,"data-discover":!A&&e==="render"?"true":void 0})});YY.displayName="Form";function WY(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WI(e){let t=S.useContext(fc);return Tt(t,WY(e)),t}function KY(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:f,unstable_useTransitions:d}={}){let h=_a(),v=Jr(),m=Hf(e,{relative:o});return S.useCallback(g=>{if(EY(g,t)){g.preventDefault();let x=n!==void 0?n:Ku(v)===Ku(m),O=()=>h(e,{replace:x,state:r,preventScrollReset:i,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:f});d?S.startTransition(()=>O()):O()}},[v,h,m,n,r,t,e,i,o,l,f,d])}function XY(e){Dr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=S.useRef(nS(e)),n=S.useRef(!1),r=Jr(),i=S.useMemo(()=>_Y(r.search,n.current?null:t.current),[r.search]),o=_a(),l=S.useCallback((f,d)=>{const h=nS(typeof f=="function"?f(new URLSearchParams(i)):f);n.current=!0,o("?"+h,d)},[o,i]);return[i,l]}var QY=0,ZY=()=>`__${String(++QY)}__`;function JY(){let{router:e}=WI("useSubmit"),{basename:t}=S.useContext(ur),n=mY(),r=e.fetch,i=e.navigate;return S.useCallback(async(o,l={})=>{let{action:f,method:d,encType:h,formData:v,body:m}=CY(o,t);if(l.navigate===!1){let g=l.fetcherKey||ZY();await r(g,n,l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:v,body:m,formMethod:l.method||d,formEncType:l.encType||h,flushSync:l.flushSync})}else await i(l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:v,body:m,formMethod:l.method||d,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,i,t,n])}function eW(e,{relative:t}={}){let{basename:n}=S.useContext(ur),r=S.useContext(Zr);Tt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...Hf(e||".",{relative:t})},l=Jr();if(e==null){o.search=l.search;let f=new URLSearchParams(o.search),d=f.getAll("index");if(d.some(v=>v==="")){f.delete("index"),d.filter(m=>m).forEach(m=>f.append("index",m));let v=f.toString();o.search=v?`?${v}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ja([n,o.pathname])),Ku(o)}function tW(e,{relative:t}={}){let n=S.useContext(LI);Tt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=WI("useViewTransitionState"),i=Hf(e,{relative:t});if(!n.isTransitioning)return!1;let o=si(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=si(n.nextLocation.pathname,r)||n.nextLocation.pathname;return lm(i.pathname,l)!=null||lm(i.pathname,o)!=null}const nW={theme:"system",setTheme:()=>null},KI=S.createContext(nW),XI=()=>{const e=S.useContext(KI);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function QI(e,t=[]){let n=[];function r(o,l){const f=S.createContext(l);f.displayName=o+"Context";const d=n.length;n=[...n,l];const h=m=>{const{scope:g,children:x,...O}=m,j=g?.[e]?.[d]||f,b=S.useMemo(()=>O,Object.values(O));return c.jsx(j.Provider,{value:b,children:x})};h.displayName=o+"Provider";function v(m,g){const x=g?.[e]?.[d]||f,O=S.useContext(x);if(O)return O;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[h,v]}const i=()=>{const o=n.map(l=>S.createContext(l));return function(f){const d=f?.[e]||o;return S.useMemo(()=>({[`__scope${e}`]:{...f,[e]:d}}),[f,d])}};return i.scopeName=e,[r,rW(i,...t)]}function rW(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((f,{useScope:d,scopeName:h})=>{const m=d(o)[`__scope${h}`];return{...f,...m}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Rx={exports:{}},Dx={};var BC;function aW(){if(BC)return Dx;BC=1;var e=Ap();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function f(m,g){var x=g(),O=r({inst:{value:x,getSnapshot:g}}),j=O[0].inst,b=O[1];return o(function(){j.value=x,j.getSnapshot=g,d(j)&&b({inst:j})},[m,x,g]),i(function(){return d(j)&&b({inst:j}),m(function(){d(j)&&b({inst:j})})},[m]),l(x),x}function d(m){var g=m.getSnapshot;m=m.value;try{var x=g();return!n(m,x)}catch{return!0}}function h(m,g){return g()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return Dx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Dx}var qC;function iW(){return qC||(qC=1,Rx.exports=aW()),Rx.exports}var oW=iW();function sW(){return oW.useSyncExternalStore(lW,()=>!0,()=>!1)}function lW(){return()=>{}}var yO="Avatar",[cW]=QI(yO),[uW,ZI]=cW(yO),JI=S.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=S.useState("idle");return c.jsx(uW,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:c.jsx(us.span,{...r,ref:t})})});JI.displayName=yO;var e5="AvatarImage",t5=S.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,l=ZI(e5,n),f=fW(r,o),d=Wr(h=>{i(h),l.onImageLoadingStatusChange(h)});return Wt(()=>{f!=="idle"&&d(f)},[f,d]),f==="loaded"?c.jsx(us.img,{...o,ref:t,src:r}):null});t5.displayName=e5;var n5="AvatarFallback",r5=S.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=ZI(n5,n),[l,f]=S.useState(r===void 0);return S.useEffect(()=>{if(r!==void 0){const d=window.setTimeout(()=>f(!0),r);return()=>window.clearTimeout(d)}},[r]),l&&o.imageLoadingStatus!=="loaded"?c.jsx(us.span,{...i,ref:t}):null});r5.displayName=n5;function UC(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function fW(e,{referrerPolicy:t,crossOrigin:n}){const r=sW(),i=S.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[l,f]=S.useState(()=>UC(o,e));return Wt(()=>{f(UC(o,e))},[o,e]),Wt(()=>{const d=m=>()=>{f(m)};if(!o)return;const h=d("loaded"),v=d("error");return o.addEventListener("load",h),o.addEventListener("error",v),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",h),o.removeEventListener("error",v)}},[o,n,t]),l}var dW=JI,hW=t5,mW=r5;function HC({className:e,...t}){return c.jsx(dW,{className:pe("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),"data-slot":"avatar",...t})}function FC({className:e,...t}){return c.jsx(hW,{className:pe("aspect-square size-full",e),"data-slot":"avatar-image",...t})}function GC({className:e,...t}){return c.jsx(mW,{className:pe("flex size-full items-center justify-center rounded-full bg-muted",e),"data-slot":"avatar-fallback",...t})}function Qp(e){const t=e+"CollectionProvider",[n,r]=jn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=j=>{const{scope:b,children:E}=j,_=I.useRef(null),A=I.useRef(new Map).current;return c.jsx(i,{scope:b,itemMap:A,collectionRef:_,children:E})};l.displayName=t;const f=e+"CollectionSlot",d=Rl(f),h=I.forwardRef((j,b)=>{const{scope:E,children:_}=j,A=o(f,E),C=Ue(b,A.collectionRef);return c.jsx(d,{ref:C,children:_})});h.displayName=f;const v=e+"CollectionItemSlot",m="data-radix-collection-item",g=Rl(v),x=I.forwardRef((j,b)=>{const{scope:E,children:_,...A}=j,C=I.useRef(null),N=Ue(b,C),M=o(v,E);return I.useEffect(()=>(M.itemMap.set(C,{ref:C,...A}),()=>void M.itemMap.delete(C))),c.jsx(g,{[m]:"",ref:N,children:_})});x.displayName=v;function O(j){const b=o(e+"CollectionConsumer",j);return I.useCallback(()=>{const _=b.collectionRef.current;if(!_)return[];const A=Array.from(_.querySelectorAll(`[${m}]`));return Array.from(b.itemMap.values()).sort((M,R)=>A.indexOf(M.ref.current)-A.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:l,Slot:h,ItemSlot:x},O,r]}var pW=S.createContext(void 0);function hc(e){const t=S.useContext(pW);return e||t||"ltr"}var Px="rovingFocusGroup.onEntryFocus",vW={bubbles:!1,cancelable:!0},Ff="RovingFocusGroup",[rS,a5,gW]=Qp(Ff),[yW,mc]=jn(Ff,[gW]),[xW,bW]=yW(Ff),i5=S.forwardRef((e,t)=>c.jsx(rS.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(rS.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(wW,{...e,ref:t})})}));i5.displayName=Ff;var wW=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:v=!1,...m}=e,g=S.useRef(null),x=Ue(t,g),O=hc(o),[j,b]=An({prop:l,defaultProp:f??null,onChange:d,caller:Ff}),[E,_]=S.useState(!1),A=Wr(h),C=a5(n),N=S.useRef(!1),[M,R]=S.useState(0);return S.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(Px,A),()=>D.removeEventListener(Px,A)},[A]),c.jsx(xW,{scope:n,orientation:r,dir:O,loop:i,currentTabStopId:j,onItemFocus:S.useCallback(D=>b(D),[b]),onItemShiftTab:S.useCallback(()=>_(!0),[]),onFocusableItemAdd:S.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:S.useCallback(()=>R(D=>D-1),[]),children:c.jsx(Ae.div,{tabIndex:E||M===0?-1:0,"data-orientation":r,...m,ref:x,style:{outline:"none",...e.style},onMouseDown:ge(e.onMouseDown,()=>{N.current=!0}),onFocus:ge(e.onFocus,D=>{const L=!N.current;if(D.target===D.currentTarget&&L&&!E){const H=new CustomEvent(Px,vW);if(D.currentTarget.dispatchEvent(H),!H.defaultPrevented){const B=C().filter(k=>k.focusable),U=B.find(k=>k.active),Y=B.find(k=>k.id===j),X=[U,Y,...B].filter(Boolean).map(k=>k.ref.current);l5(X,v)}}N.current=!1}),onBlur:ge(e.onBlur,()=>_(!1))})})}),o5="RovingFocusGroupItem",s5=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...f}=e,d=Cr(),h=o||d,v=bW(o5,n),m=v.currentTabStopId===h,g=a5(n),{onFocusableItemAdd:x,onFocusableItemRemove:O,currentTabStopId:j}=v;return S.useEffect(()=>{if(r)return x(),()=>O()},[r,x,O]),c.jsx(rS.ItemSlot,{scope:n,id:h,focusable:r,active:i,children:c.jsx(Ae.span,{tabIndex:m?0:-1,"data-orientation":v.orientation,...f,ref:t,onMouseDown:ge(e.onMouseDown,b=>{r?v.onItemFocus(h):b.preventDefault()}),onFocus:ge(e.onFocus,()=>v.onItemFocus(h)),onKeyDown:ge(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){v.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const E=OW(b,v.orientation,v.dir);if(E!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let A=g().filter(C=>C.focusable).map(C=>C.ref.current);if(E==="last")A.reverse();else if(E==="prev"||E==="next"){E==="prev"&&A.reverse();const C=A.indexOf(b.currentTarget);A=v.loop?EW(A,C+1):A.slice(C+1)}setTimeout(()=>l5(A))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:j!=null}):l})})});s5.displayName=o5;var SW={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jW(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function OW(e,t,n){const r=jW(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return SW[r]}function l5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function EW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xO=i5,bO=s5,aS=["Enter"," "],_W=["ArrowDown","PageUp","Home"],c5=["ArrowUp","PageDown","End"],AW=[..._W,...c5],NW={ltr:[...aS,"ArrowRight"],rtl:[...aS,"ArrowLeft"]},CW={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gf="Menu",[Xu,TW,MW]=Qp(Gf),[ds,u5]=jn(Gf,[MW,lo,mc]),Zp=lo(),f5=mc(),[RW,hs]=ds(Gf),[DW,Vf]=ds(Gf),d5=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:l=!0}=e,f=Zp(t),[d,h]=S.useState(null),v=S.useRef(!1),m=Wr(o),g=hc(i);return S.useEffect(()=>{const x=()=>{v.current=!0,document.addEventListener("pointerdown",O,{capture:!0,once:!0}),document.addEventListener("pointermove",O,{capture:!0,once:!0})},O=()=>v.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",O,{capture:!0}),document.removeEventListener("pointermove",O,{capture:!0})}},[]),c.jsx(Bp,{...f,children:c.jsx(RW,{scope:t,open:n,onOpenChange:m,content:d,onContentChange:h,children:c.jsx(DW,{scope:t,onClose:S.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:v,dir:g,modal:l,children:r})})})};d5.displayName=Gf;var PW="MenuAnchor",wO=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Zp(n);return c.jsx(qp,{...i,...r,ref:t})});wO.displayName=PW;var SO="MenuPortal",[kW,h5]=ds(SO,{forceMount:void 0}),m5=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=hs(SO,t);return c.jsx(kW,{scope:t,forceMount:n,children:c.jsx(Nn,{present:n||o.open,children:c.jsx(sc,{asChild:!0,container:i,children:r})})})};m5.displayName=SO;var Tr="MenuContent",[$W,jO]=ds(Tr),p5=S.forwardRef((e,t)=>{const n=h5(Tr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=hs(Tr,e.__scopeMenu),l=Vf(Tr,e.__scopeMenu);return c.jsx(Xu.Provider,{scope:e.__scopeMenu,children:c.jsx(Nn,{present:r||o.open,children:c.jsx(Xu.Slot,{scope:e.__scopeMenu,children:l.modal?c.jsx(IW,{...i,ref:t}):c.jsx(LW,{...i,ref:t})})})})}),IW=S.forwardRef((e,t)=>{const n=hs(Tr,e.__scopeMenu),r=S.useRef(null),i=Ue(t,r);return S.useEffect(()=>{const o=r.current;if(o)return Fj(o)},[]),c.jsx(OO,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ge(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),LW=S.forwardRef((e,t)=>{const n=hs(Tr,e.__scopeMenu);return c.jsx(OO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zW=Rl("MenuContent.ScrollLock"),OO=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:f,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:m,onInteractOutside:g,onDismiss:x,disableOutsideScroll:O,...j}=e,b=hs(Tr,n),E=Vf(Tr,n),_=Zp(n),A=f5(n),C=TW(n),[N,M]=S.useState(null),R=S.useRef(null),D=Ue(t,R,b.onContentChange),L=S.useRef(0),H=S.useRef(""),B=S.useRef(0),U=S.useRef(null),Y=S.useRef("right"),Z=S.useRef(0),X=O?Rp:S.Fragment,k=O?{as:zW,allowPinchZoom:!0}:void 0,q=Q=>{const ee=H.current+Q,z=C().filter(oe=>!oe.disabled),G=document.activeElement,$=z.find(oe=>oe.ref.current===G)?.textValue,W=z.map(oe=>oe.textValue),ae=QW(W,ee,$),ce=z.find(oe=>oe.textValue===ae)?.ref.current;(function oe(me){H.current=me,window.clearTimeout(L.current),me!==""&&(L.current=window.setTimeout(()=>oe(""),1e3))})(ee),ce&&setTimeout(()=>ce.focus())};S.useEffect(()=>()=>window.clearTimeout(L.current),[]),Hj();const V=S.useCallback(Q=>Y.current===U.current?.side&&JW(Q,U.current?.area),[]);return c.jsx($W,{scope:n,searchRef:H,onItemEnter:S.useCallback(Q=>{V(Q)&&Q.preventDefault()},[V]),onItemLeave:S.useCallback(Q=>{V(Q)||(R.current?.focus(),M(null))},[V]),onTriggerLeave:S.useCallback(Q=>{V(Q)&&Q.preventDefault()},[V]),pointerGraceTimerRef:B,onPointerGraceIntentChange:S.useCallback(Q=>{U.current=Q},[]),children:c.jsx(X,{...k,children:c.jsx(Tp,{asChild:!0,trapped:i,onMountAutoFocus:ge(o,Q=>{Q.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:c.jsx(oc,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:m,onInteractOutside:g,onDismiss:x,children:c.jsx(xO,{asChild:!0,...A,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:M,onEntryFocus:ge(d,Q=>{E.isUsingKeyboardRef.current||Q.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Up,{role:"menu","aria-orientation":"vertical","data-state":M5(b.open),"data-radix-menu-content":"",dir:E.dir,..._,...j,ref:D,style:{outline:"none",...j.style},onKeyDown:ge(j.onKeyDown,Q=>{const z=Q.target.closest("[data-radix-menu-content]")===Q.currentTarget,G=Q.ctrlKey||Q.altKey||Q.metaKey,$=Q.key.length===1;z&&(Q.key==="Tab"&&Q.preventDefault(),!G&&$&&q(Q.key));const W=R.current;if(Q.target!==W||!AW.includes(Q.key))return;Q.preventDefault();const ce=C().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);c5.includes(Q.key)&&ce.reverse(),KW(ce)}),onBlur:ge(e.onBlur,Q=>{Q.currentTarget.contains(Q.target)||(window.clearTimeout(L.current),H.current="")}),onPointerMove:ge(e.onPointerMove,Qu(Q=>{const ee=Q.target,z=Z.current!==Q.clientX;if(Q.currentTarget.contains(ee)&&z){const G=Q.clientX>Z.current?"right":"left";Y.current=G,Z.current=Q.clientX}}))})})})})})})});p5.displayName=Tr;var BW="MenuGroup",EO=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ae.div,{role:"group",...r,ref:t})});EO.displayName=BW;var qW="MenuLabel",v5=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ae.div,{...r,ref:t})});v5.displayName=qW;var um="MenuItem",VC="menu.itemSelect",Jp=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=S.useRef(null),l=Vf(um,e.__scopeMenu),f=jO(um,e.__scopeMenu),d=Ue(t,o),h=S.useRef(!1),v=()=>{const m=o.current;if(!n&&m){const g=new CustomEvent(VC,{bubbles:!0,cancelable:!0});m.addEventListener(VC,x=>r?.(x),{once:!0}),j$(m,g),g.defaultPrevented?h.current=!1:l.onClose()}};return c.jsx(g5,{...i,ref:d,disabled:n,onClick:ge(e.onClick,v),onPointerDown:m=>{e.onPointerDown?.(m),h.current=!0},onPointerUp:ge(e.onPointerUp,m=>{h.current||m.currentTarget?.click()}),onKeyDown:ge(e.onKeyDown,m=>{const g=f.searchRef.current!=="";n||g&&m.key===" "||aS.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Jp.displayName=um;var g5=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,l=jO(um,n),f=f5(n),d=S.useRef(null),h=Ue(t,d),[v,m]=S.useState(!1),[g,x]=S.useState("");return S.useEffect(()=>{const O=d.current;O&&x((O.textContent??"").trim())},[o.children]),c.jsx(Xu.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:c.jsx(bO,{asChild:!0,...f,focusable:!r,children:c.jsx(Ae.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:h,onPointerMove:ge(e.onPointerMove,Qu(O=>{r?l.onItemLeave(O):(l.onItemEnter(O),O.defaultPrevented||O.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ge(e.onPointerLeave,Qu(O=>l.onItemLeave(O))),onFocus:ge(e.onFocus,()=>m(!0)),onBlur:ge(e.onBlur,()=>m(!1))})})})}),UW="MenuCheckboxItem",y5=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return c.jsx(j5,{scope:e.__scopeMenu,checked:n,children:c.jsx(Jp,{role:"menuitemcheckbox","aria-checked":fm(n)?"mixed":n,...i,ref:t,"data-state":AO(n),onSelect:ge(i.onSelect,()=>r?.(fm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});y5.displayName=UW;var x5="MenuRadioGroup",[HW,FW]=ds(x5,{value:void 0,onValueChange:()=>{}}),b5=S.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Wr(r);return c.jsx(HW,{scope:e.__scopeMenu,value:n,onValueChange:o,children:c.jsx(EO,{...i,ref:t})})});b5.displayName=x5;var w5="MenuRadioItem",S5=S.forwardRef((e,t)=>{const{value:n,...r}=e,i=FW(w5,e.__scopeMenu),o=n===i.value;return c.jsx(j5,{scope:e.__scopeMenu,checked:o,children:c.jsx(Jp,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":AO(o),onSelect:ge(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});S5.displayName=w5;var _O="MenuItemIndicator",[j5,GW]=ds(_O,{checked:!1}),O5=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=GW(_O,n);return c.jsx(Nn,{present:r||fm(o.checked)||o.checked===!0,children:c.jsx(Ae.span,{...i,ref:t,"data-state":AO(o.checked)})})});O5.displayName=_O;var VW="MenuSeparator",E5=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ae.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});E5.displayName=VW;var YW="MenuArrow",_5=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Zp(n);return c.jsx(Hp,{...i,...r,ref:t})});_5.displayName=YW;var WW="MenuSub",[rye,A5]=ds(WW),Mu="MenuSubTrigger",N5=S.forwardRef((e,t)=>{const n=hs(Mu,e.__scopeMenu),r=Vf(Mu,e.__scopeMenu),i=A5(Mu,e.__scopeMenu),o=jO(Mu,e.__scopeMenu),l=S.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:d}=o,h={__scopeMenu:e.__scopeMenu},v=S.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return S.useEffect(()=>v,[v]),S.useEffect(()=>{const m=f.current;return()=>{window.clearTimeout(m),d(null)}},[f,d]),c.jsx(wO,{asChild:!0,...h,children:c.jsx(g5,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":M5(n.open),...e,ref:kf(t,i.onTriggerChange),onClick:m=>{e.onClick?.(m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ge(e.onPointerMove,Qu(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),v()},100))})),onPointerLeave:ge(e.onPointerLeave,Qu(m=>{v();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,O=x==="right",j=O?-5:5,b=g[O?"left":"right"],E=g[O?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+j,y:m.clientY},{x:b,y:g.top},{x:E,y:g.top},{x:E,y:g.bottom},{x:b,y:g.bottom}],side:x}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ge(e.onKeyDown,m=>{const g=o.searchRef.current!=="";e.disabled||g&&m.key===" "||NW[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});N5.displayName=Mu;var C5="MenuSubContent",T5=S.forwardRef((e,t)=>{const n=h5(Tr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=hs(Tr,e.__scopeMenu),l=Vf(Tr,e.__scopeMenu),f=A5(C5,e.__scopeMenu),d=S.useRef(null),h=Ue(t,d);return c.jsx(Xu.Provider,{scope:e.__scopeMenu,children:c.jsx(Nn,{present:r||o.open,children:c.jsx(Xu.Slot,{scope:e.__scopeMenu,children:c.jsx(OO,{id:f.contentId,"aria-labelledby":f.triggerId,...i,ref:h,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{l.isUsingKeyboardRef.current&&d.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:ge(e.onFocusOutside,v=>{v.target!==f.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ge(e.onEscapeKeyDown,v=>{l.onClose(),v.preventDefault()}),onKeyDown:ge(e.onKeyDown,v=>{const m=v.currentTarget.contains(v.target),g=CW[l.dir].includes(v.key);m&&g&&(o.onOpenChange(!1),f.trigger?.focus(),v.preventDefault())})})})})})});T5.displayName=C5;function M5(e){return e?"open":"closed"}function fm(e){return e==="indeterminate"}function AO(e){return fm(e)?"indeterminate":e?"checked":"unchecked"}function KW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function XW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function QW(e,t,n){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=XW(e,Math.max(o,0));i.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function ZW(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const f=t[o],d=t[l],h=f.x,v=f.y,m=d.x,g=d.y;v>r!=g>r&&n<(m-h)*(r-v)/(g-v)+h&&(i=!i)}return i}function JW(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ZW(n,t)}function Qu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var eK=d5,tK=wO,nK=m5,rK=p5,aK=EO,iK=v5,oK=Jp,sK=y5,lK=b5,cK=S5,uK=O5,fK=E5,dK=_5,hK=N5,mK=T5,ev="DropdownMenu",[pK]=jn(ev,[u5]),Cn=u5(),[vK,R5]=pK(ev),D5=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:l,modal:f=!0}=e,d=Cn(t),h=S.useRef(null),[v,m]=An({prop:i,defaultProp:o??!1,onChange:l,caller:ev});return c.jsx(vK,{scope:t,triggerId:Cr(),triggerRef:h,contentId:Cr(),open:v,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(g=>!g),[m]),modal:f,children:c.jsx(eK,{...d,open:v,onOpenChange:m,dir:r,modal:f,children:n})})};D5.displayName=ev;var P5="DropdownMenuTrigger",k5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=R5(P5,n),l=Cn(n);return c.jsx(tK,{asChild:!0,...l,children:c.jsx(Ae.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:kf(t,o.triggerRef),onPointerDown:ge(e.onPointerDown,f=>{!r&&f.button===0&&f.ctrlKey===!1&&(o.onOpenToggle(),o.open||f.preventDefault())}),onKeyDown:ge(e.onKeyDown,f=>{r||(["Enter"," "].includes(f.key)&&o.onOpenToggle(),f.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});k5.displayName=P5;var gK="DropdownMenuPortal",$5=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Cn(t);return c.jsx(nK,{...r,...n})};$5.displayName=gK;var I5="DropdownMenuContent",L5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=R5(I5,n),o=Cn(n),l=S.useRef(!1);return c.jsx(rK,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:ge(e.onCloseAutoFocus,f=>{l.current||i.triggerRef.current?.focus(),l.current=!1,f.preventDefault()}),onInteractOutside:ge(e.onInteractOutside,f=>{const d=f.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,v=d.button===2||h;(!i.modal||v)&&(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)"}})});L5.displayName=I5;var yK="DropdownMenuGroup",xK=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(aK,{...i,...r,ref:t})});xK.displayName=yK;var bK="DropdownMenuLabel",z5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(iK,{...i,...r,ref:t})});z5.displayName=bK;var wK="DropdownMenuItem",B5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(oK,{...i,...r,ref:t})});B5.displayName=wK;var SK="DropdownMenuCheckboxItem",q5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(sK,{...i,...r,ref:t})});q5.displayName=SK;var jK="DropdownMenuRadioGroup",OK=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(lK,{...i,...r,ref:t})});OK.displayName=jK;var EK="DropdownMenuRadioItem",_K=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(cK,{...i,...r,ref:t})});_K.displayName=EK;var AK="DropdownMenuItemIndicator",U5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(uK,{...i,...r,ref:t})});U5.displayName=AK;var NK="DropdownMenuSeparator",H5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(fK,{...i,...r,ref:t})});H5.displayName=NK;var CK="DropdownMenuArrow",TK=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(dK,{...i,...r,ref:t})});TK.displayName=CK;var MK="DropdownMenuSubTrigger",RK=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(hK,{...i,...r,ref:t})});RK.displayName=MK;var DK="DropdownMenuSubContent",PK=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(mK,{...i,...r,ref:t,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)"}})});PK.displayName=DK;var kK=D5,$K=k5,IK=$5,LK=L5,zK=z5,BK=B5,qK=q5,UK=U5,HK=H5;function F5({...e}){return c.jsx(kK,{"data-slot":"dropdown-menu",...e})}function G5({...e}){return c.jsx($K,{"data-slot":"dropdown-menu-trigger",...e})}function V5({className:e,sideOffset:t=4,...n}){return c.jsx(IK,{children:c.jsx(LK,{className:pe("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-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"dropdown-menu-content",sideOffset:t,...n})})}function YC({className:e,inset:t,variant:n="default",...r}){return c.jsx(BK,{className:pe("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-inset":t,"data-slot":"dropdown-menu-item","data-variant":n,...r})}function FK({className:e,children:t,checked:n,...r}){return c.jsxs(qK,{checked:n,className:pe("relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-slot":"dropdown-menu-checkbox-item",...r,children:[c.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:c.jsx(UK,{children:c.jsx(ai,{className:"size-4"})})}),t]})}function Y5({className:e,inset:t,...n}){return c.jsx(zK,{className:pe("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",e),"data-inset":t,"data-slot":"dropdown-menu-label",...n})}function iS({className:e,...t}){return c.jsx(HK,{className:pe("-mx-1 my-1 h-px bg-border",e),"data-slot":"dropdown-menu-separator",...t})}function GK({user:e}){const{isMobile:t}=qf(),{theme:n,setTheme:r}=XI(),[i,o]=S.useState(null),[l,f]=S.useState(0);S.useEffect(()=>{(async()=>{try{const g=sessionStorage.getItem("wraps-auth-token");if(!g){console.log("No auth token found yet, will retry..."),l<5&&setTimeout(()=>{f(O=>O+1)},200);return}console.log("Fetching user info from /api/user");const x=await fetch(`/api/user?token=${g}`);if(console.log("User API response status:",x.status),x.ok){const O=await x.json();console.log("User info received:",O),o(O)}else{const O=await x.text();console.error("Failed to fetch user info:",x.status,O)}}catch(g){console.error("Error fetching user info:",g)}})().catch(g=>{console.error("Failed to fetch user info:",g)})},[l]);const d=()=>{window.confirm("Are you sure you want to close the console?")&&window.close()},h=i?.accountAlias||i?.accountId||"Loading...",v=i?.region||"...";return c.jsx(X1,{children:c.jsx(Q1,{children:c.jsxs(F5,{children:[c.jsx(G5,{asChild:!0,children:c.jsxs(Z1,{className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground md:h-8 md:p-0",size:"lg",children:[c.jsxs(HC,{className:"h-8 w-8 rounded-lg",children:[c.jsx(FC,{alt:h,src:e.avatar}),c.jsx(GC,{className:"rounded-lg bg-orange-500 text-white",children:"AWS"})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:h}),c.jsx("span",{className:"truncate text-xs",children:v})]}),c.jsx(YH,{className:"ml-auto size-4"})]})}),c.jsxs(V5,{align:"end",className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:t?"bottom":"right",sideOffset:4,children:[c.jsx(Y5,{className:"p-0 font-normal",children:c.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[c.jsxs(HC,{className:"h-8 w-8 rounded-lg",children:[c.jsx(FC,{alt:h,src:e.avatar}),c.jsx(GC,{className:"rounded-lg bg-orange-500 text-white",children:"AWS"})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:h}),c.jsx("span",{className:"truncate text-xs",children:v}),i?.accountId&&i.accountId!==i.accountAlias&&c.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:i.accountId})]})]})}),c.jsx(iS,{}),c.jsxs(YC,{onClick:()=>r(n==="dark"?"light":"dark"),children:[n==="dark"?c.jsx(iF,{}):c.jsx(tF,{}),n==="dark"?"Light Mode":"Dark Mode"]}),c.jsx(iS,{}),c.jsxs(YC,{onClick:d,children:[c.jsx(or,{}),"Close Console"]})]})]})})})}const Gi={user:{name:"Wraps Console",email:"hello@wraps.dev",avatar:"/avatars/wraps.jpg"},navMain:[{title:"Dashboard",url:"/",icon:Np,isActive:!0,isDashboard:!0},{title:"Email",url:"#",icon:Sl,isActive:!1,subItems:[{title:"Emails",icon:Sl,url:"/email"},{title:"Metrics",icon:px,url:"/email/metrics"},{title:"Settings",icon:gx,url:"/email/settings"}]},{title:"SMS",url:"#",icon:eo,isActive:!1,subItems:[{title:"Messages",icon:eo,url:"/sms"},{title:"Metrics",icon:px,url:"/sms/metrics"},{title:"Settings",icon:gx,url:"/sms/settings"}]},{title:"CDN",url:"#",icon:If,isActive:!1,subItems:[{title:"Library",icon:v$,url:"/cdn"},{title:"Metrics",icon:px,url:"/cdn/metrics"},{title:"Settings",icon:gx,url:"/cdn/settings"}]}]};function VK({...e}){const t=Jr(),n=_a(),{setOpen:r,state:i}=qf(),{theme:o}=XI(),l=S.useCallback(()=>t.pathname==="/"?Gi.navMain[0]:t.pathname.startsWith("/email")?Gi.navMain[1]:t.pathname.startsWith("/sms")?Gi.navMain[2]:t.pathname.startsWith("/cdn")?Gi.navMain[3]:Gi.navMain[0],[t.pathname]),[f,d]=S.useState(l());return S.useEffect(()=>{d(l())},[l]),c.jsxs(Nx,{className:"overflow-hidden *:data-[sidebar=sidebar]:flex-row",collapsible:"icon",...e,children:[c.jsxs(Nx,{className:"w-[calc(var(--sidebar-width-icon)+1px)]! border-r",collapsible:"none",children:[c.jsx(NC,{children:c.jsx(X1,{children:c.jsx(Q1,{children:c.jsx(Z1,{asChild:!0,className:"md:h-8 md:p-0",onClick:()=>{d(Gi.navMain[0]),r(!1)},size:"lg",children:c.jsxs(cm,{to:"/",children:[c.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg",children:c.jsx("img",{alt:"Wraps",className:"size-8 object-contain",src:o==="dark"?"/wraps-dark.png":"/wraps-light.png"})}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-semibold",children:"Wraps"}),c.jsx("span",{className:"truncate text-xs",children:"Console"})]})]})})})})}),c.jsx(CC,{children:c.jsx(TC,{children:c.jsx(MC,{className:"px-1.5 md:px-0",children:c.jsx(X1,{children:Gi.navMain.filter(h=>!h.isDashboard).map(h=>c.jsx(Q1,{children:c.jsxs(Z1,{className:"px-2.5 md:px-2",isActive:f?.title===h.title,onClick:()=>{d(h),r(!0),h.subItems&&h.subItems.length>0&&n(h.subItems[0].url)},tooltip:{children:h.title,hidden:!1},children:[c.jsx(h.icon,{}),c.jsx("span",{children:h.title})]})},h.title))})})})}),c.jsx(HG,{children:c.jsx(GK,{user:Gi.user})})]}),i==="expanded"&&c.jsx(Nx,{className:"hidden flex-1 md:flex",collapsible:"none",children:f&&!f.isDashboard&&f.subItems?c.jsxs(c.Fragment,{children:[c.jsxs(NC,{className:"gap-3.5 border-b p-4",children:[c.jsx("div",{className:"flex w-full items-center justify-between",children:c.jsxs("div",{className:"flex items-center gap-2 font-medium text-base text-foreground",children:[c.jsx(f.icon,{className:"size-4"}),f.title]})}),c.jsx(UG,{placeholder:"Search..."})]}),c.jsx(CC,{children:c.jsx(TC,{className:"px-0",children:c.jsx(MC,{children:f.subItems.map(h=>{const v=t.pathname===h.url||h.url==="/email"&&t.pathname.startsWith("/email/")&&t.pathname!=="/email/metrics"&&t.pathname!=="/email/settings"||h.url==="/sms"&&t.pathname.startsWith("/sms/")&&t.pathname!=="/sms/metrics"&&t.pathname!=="/sms/settings"||h.url==="/cdn"&&t.pathname.startsWith("/cdn/")&&t.pathname!=="/cdn/metrics"&&t.pathname!=="/cdn/settings";return c.jsxs(cm,{className:`flex items-center gap-3 border-b p-4 text-sm leading-tight transition-colors last:border-b-0 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground ${v?"bg-sidebar-accent font-semibold text-sidebar-accent-foreground":""}`,to:h.url,children:[c.jsx(h.icon,{className:"size-4 shrink-0"}),c.jsx("span",{className:"font-medium",children:h.title})]},h.title)})})})})]}):c.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:c.jsxs("div",{className:"text-muted-foreground",children:[c.jsx(Np,{className:"mx-auto mb-4 size-12 opacity-50"}),c.jsx("p",{className:"text-sm",children:"Select a product to view options"})]})})})]})}const YK=ic("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[1rem_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Un({className:e,variant:t,...n}){return c.jsx("div",{className:pe(YK({variant:t}),e),"data-slot":"alert",role:"alert",...n})}function ro({className:e,...t}){return c.jsx("div",{className:pe("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),"data-slot":"alert-title",...t})}function Hn({className:e,...t}){return c.jsx("div",{className:pe("col-start-2 grid justify-items-start gap-1 text-muted-foreground text-sm [&_p]:leading-relaxed",e),"data-slot":"alert-description",...t})}var W5="AlertDialog",[WK]=jn(W5,[$$]),mi=$$(),K5=e=>{const{__scopeAlertDialog:t,...n}=e,r=mi(t);return c.jsx(Wj,{...r,...n,modal:!0})};K5.displayName=W5;var KK="AlertDialogTrigger",XK=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=mi(n);return c.jsx(I7,{...i,...r,ref:t})});XK.displayName=KK;var QK="AlertDialogPortal",X5=e=>{const{__scopeAlertDialog:t,...n}=e,r=mi(t);return c.jsx(Kj,{...r,...n})};X5.displayName=QK;var ZK="AlertDialogOverlay",Q5=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=mi(n);return c.jsx(Xj,{...i,...r,ref:t})});Q5.displayName=ZK;var El="AlertDialogContent",[JK,eX]=WK(El),tX=S$("AlertDialogContent"),Z5=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=mi(n),l=S.useRef(null),f=Ue(t,l),d=S.useRef(null);return c.jsx(D7,{contentName:El,titleName:J5,docsSlug:"alert-dialog",children:c.jsx(JK,{scope:n,cancelRef:d,children:c.jsxs(Qj,{role:"alertdialog",...o,...i,ref:f,onOpenAutoFocus:ge(i.onOpenAutoFocus,h=>{h.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[c.jsx(tX,{children:r}),c.jsx(rX,{contentRef:l})]})})})});Z5.displayName=El;var J5="AlertDialogTitle",eL=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=mi(n);return c.jsx(Zj,{...i,...r,ref:t})});eL.displayName=J5;var tL="AlertDialogDescription",nL=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=mi(n);return c.jsx(Jj,{...i,...r,ref:t})});nL.displayName=tL;var nX="AlertDialogAction",rL=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=mi(n);return c.jsx(Pp,{...i,...r,ref:t})});rL.displayName=nX;var aL="AlertDialogCancel",iL=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=eX(aL,n),o=mi(n),l=Ue(t,i);return c.jsx(Pp,{...o,...r,ref:l})});iL.displayName=aL;var rX=({contentRef:e})=>{const t=`\`${El}\` requires a description for the component to be accessible for screen reader users.
|
|
55
|
+
Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let g=Jr(),x;if(t){let _=typeof t=="string"?uc(t):t;Tt(v==="/"||_.pathname?.startsWith(v),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${_.pathname}" was given in the \`location\` prop.`),x=_}else x=g;let O=x.pathname||"/",j=O;if(v!=="/"){let _=v.replace(/^\//,"").split("/");j="/"+O.replace(/^\//,"").split("/").slice(_.length).join("/")}let b=RI(e,{pathname:j});Dr(m||b!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Dr(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=uY(b&&b.map(_=>Object.assign({},_,{params:Object.assign({},d,_.params),pathname:Ja([v,o.encodeLocation?o.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?v:Ja([v,o.encodeLocation?o.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),l,n,r,i);return t&&E?S.createElement(Uf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},E):E}function oY(){let e=pY(),t=YV(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:o},"ErrorBoundary")," or"," ",S.createElement("code",{style:o},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:i},n):null,l)}var sY=S.createElement(oY,null),HI=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=nY(e.digest);n&&(e=n)}let t=e!==void 0?S.createElement(Zr.Provider,{value:this.props.routeContext},S.createElement(dO.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(lY,{error:e},t):t}};HI.contextType=XV;var Tx=new WeakMap;function lY({children:e,error:t}){let{basename:n}=S.useContext(ur);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=tY(t.digest);if(r){let i=Tx.get(t);if(i)throw i;let o=$I(r.location,n);if(kI&&!Tx.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw Tx.set(t,l),l}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function cY({routeContext:e,match:t,children:n}){let r=S.useContext(fc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(Zr.Provider,{value:e},n)}function uY(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=n?.errors;if(l!=null){let v=o.findIndex(m=>m.route.id&&l?.[m.route.id]!==void 0);Tt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let f=!1,d=-1;if(n)for(let v=0;v<o.length;v++){let m=o[v];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=v),m.route.id){let{loaderData:g,errors:x}=n,O=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||O){f=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}let h=n&&r?(v,m)=>{r(v,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:WV(n.matches),errorInfo:m})}:void 0;return o.reduceRight((v,m,g)=>{let x,O=!1,j=null,b=null;n&&(x=l&&m.route.id?l[m.route.id]:void 0,j=m.route.errorElement||sY,f&&(d<0&&g===0?(FI("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,b=null):d===g&&(O=!0,b=m.route.hydrateFallbackElement||null)));let E=t.concat(o.slice(0,g+1)),_=()=>{let A;return x?A=j:O?A=b:m.route.Component?A=S.createElement(m.route.Component,null):m.route.element?A=m.route.element:A=v,S.createElement(cY,{match:m,routeContext:{outlet:v,matches:E,isDataRoute:n!=null},children:A})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?S.createElement(HI,{location:n.location,revalidation:n.revalidation,component:j,error:x,children:_(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):_()},null)}function mO(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fY(e){let t=S.useContext(fc);return Tt(t,mO(e)),t}function dY(e){let t=S.useContext(Kp);return Tt(t,mO(e)),t}function hY(e){let t=S.useContext(Zr);return Tt(t,mO(e)),t}function pO(e){let t=hY(e),n=t.matches[t.matches.length-1];return Tt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function mY(){return pO("useRouteId")}function pY(){let e=S.useContext(dO),t=dY("useRouteError"),n=pO("useRouteError");return e!==void 0?e:t.errors?.[n]}function vY(){let{router:e}=fY("useNavigate"),t=pO("useNavigate"),n=S.useRef(!1);return qI(()=>{n.current=!0}),S.useCallback(async(i,o={})=>{Dr(n.current,BI),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var LC={};function FI(e,t,n){!t&&!LC[e]&&(LC[e]=!0,Dr(!1,n))}S.memo(gY);function gY({routes:e,future:t,state:n,onError:r}){return UI(e,void 0,n,r,t)}function yY({to:e,replace:t,state:n,relative:r}){Tt(dc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=S.useContext(ur);Dr(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=S.useContext(Zr),{pathname:l}=Jr(),f=_a(),d=fO(e,uO(o),l,r==="path"),h=JSON.stringify(d);return S.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:r})},[f,h,r,t,n]),null}function Bn(e){Tt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function xY({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1,unstable_useTransitions:l}){Tt(!dc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),d=S.useMemo(()=>({basename:f,navigator:i,static:o,unstable_useTransitions:l,future:{}}),[f,i,o,l]);typeof n=="string"&&(n=uc(n));let{pathname:h="/",search:v="",hash:m="",state:g=null,key:x="default"}=n,O=S.useMemo(()=>{let j=si(h,f);return j==null?null:{location:{pathname:j,search:v,hash:m,state:g,key:x},navigationType:r}},[f,h,v,m,g,x,r]);return Dr(O!=null,`<Router basename="${f}"> is not able to match the URL "${h}${v}${m}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:S.createElement(ur.Provider,{value:d},S.createElement(Uf.Provider,{children:t,value:O}))}function bY({children:e,location:t}){return iY(tS(e),t)}function tS(e,t=[]){let n=[];return S.Children.forEach(e,(r,i)=>{if(!S.isValidElement(r))return;let o=[...t,i];if(r.type===S.Fragment){n.push.apply(n,tS(r.props.children,o));return}Tt(r.type===Bn,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Tt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=tS(r.props.children,o)),n.push(l)}),n}var Kh="get",Xh="application/x-www-form-urlencoded";function Xp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function wY(e){return Xp(e)&&e.tagName.toLowerCase()==="button"}function SY(e){return Xp(e)&&e.tagName.toLowerCase()==="form"}function jY(e){return Xp(e)&&e.tagName.toLowerCase()==="input"}function OY(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function EY(e,t){return e.button===0&&(!t||t==="_self")&&!OY(e)}function nS(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function _Y(e,t){let n=nS(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var Ah=null;function AY(){if(Ah===null)try{new FormData(document.createElement("form"),0),Ah=!1}catch{Ah=!0}return Ah}var NY=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mx(e){return e!=null&&!NY.has(e)?(Dr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xh}"`),null):e}function CY(e,t){let n,r,i,o,l;if(SY(e)){let f=e.getAttribute("action");r=f?si(f,t):null,n=e.getAttribute("method")||Kh,i=Mx(e.getAttribute("enctype"))||Xh,o=new FormData(e)}else if(wY(e)||jY(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||f.getAttribute("action");if(r=d?si(d,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Kh,i=Mx(e.getAttribute("formenctype"))||Mx(f.getAttribute("enctype"))||Xh,o=new FormData(f,e),!AY()){let{name:h,type:v,value:m}=e;if(v==="image"){let g=h?`${h}.`:"";o.append(`${g}x`,"0"),o.append(`${g}y`,"0")}else h&&o.append(h,m)}}else{if(Xp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Kh,r=null,i=Xh,l=e}return o&&i==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vO(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function TY(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&si(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function MY(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function RY(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function DY(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let l=await MY(o,n);return l.links?l.links():[]}return[]}));return IY(r.flat(1).filter(RY).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function zC(e,t,n,r,i,o){let l=(d,h)=>n[h]?d.route.id!==n[h].route.id:!0,f=(d,h)=>n[h].pathname!==d.pathname||n[h].route.path?.endsWith("*")&&n[h].params["*"]!==d.params["*"];return o==="assets"?t.filter((d,h)=>l(d,h)||f(d,h)):o==="data"?t.filter((d,h)=>{let v=r.routes[d.route.id];if(!v||!v.hasLoader)return!1;if(l(d,h)||f(d,h))return!0;if(d.route.shouldRevalidate){let m=d.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function PY(e,t,{includeHydrateFallback:n}={}){return kY(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function kY(e){return[...new Set(e)]}function $Y(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function IY(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify($Y(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function GI(){let e=S.useContext(fc);return vO(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function LY(){let e=S.useContext(Kp);return vO(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var gO=S.createContext(void 0);gO.displayName="FrameworkContext";function VI(){let e=S.useContext(gO);return vO(e,"You must render this element inside a <HydratedRouter> element"),e}function zY(e,t){let n=S.useContext(gO),[r,i]=S.useState(!1),[o,l]=S.useState(!1),{onFocus:f,onBlur:d,onMouseEnter:h,onMouseLeave:v,onTouchStart:m}=t,g=S.useRef(null);S.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let j=E=>{E.forEach(_=>{l(_.isIntersecting)})},b=new IntersectionObserver(j,{threshold:.5});return g.current&&b.observe(g.current),()=>{b.disconnect()}}},[e]),S.useEffect(()=>{if(r){let j=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(j)}}},[r]);let x=()=>{i(!0)},O=()=>{i(!1),l(!1)};return n?e!=="intent"?[o,g,{}]:[o,g,{onFocus:xu(f,x),onBlur:xu(d,O),onMouseEnter:xu(h,x),onMouseLeave:xu(v,O),onTouchStart:xu(m,x)}]:[!1,g,{}]}function xu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function BY({page:e,...t}){let{router:n}=GI(),r=S.useMemo(()=>RI(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?S.createElement(UY,{page:e,matches:r,...t}):null}function qY(e){let{manifest:t,routeModules:n}=VI(),[r,i]=S.useState([]);return S.useEffect(()=>{let o=!1;return DY(e,t,n).then(l=>{o||i(l)}),()=>{o=!0}},[e,t,n]),r}function UY({page:e,matches:t,...n}){let r=Jr(),{future:i,manifest:o,routeModules:l}=VI(),{basename:f}=GI(),{loaderData:d,matches:h}=LY(),v=S.useMemo(()=>zC(e,t,h,o,r,"data"),[e,t,h,o,r]),m=S.useMemo(()=>zC(e,t,h,o,r,"assets"),[e,t,h,o,r]),g=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let j=new Set,b=!1;if(t.forEach(_=>{let A=o.routes[_.route.id];!A||!A.hasLoader||(!v.some(C=>C.route.id===_.route.id)&&_.route.id in d&&l[_.route.id]?.shouldRevalidate||A.hasClientLoader?b=!0:j.add(_.route.id))}),j.size===0)return[];let E=TY(e,f,i.unstable_trailingSlashAwareDataRequests,"data");return b&&j.size>0&&E.searchParams.set("_routes",t.filter(_=>j.has(_.route.id)).map(_=>_.route.id).join(",")),[E.pathname+E.search]},[f,i.unstable_trailingSlashAwareDataRequests,d,r,o,v,t,e,l]),x=S.useMemo(()=>PY(m,o),[m,o]),O=qY(m);return S.createElement(S.Fragment,null,g.map(j=>S.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),x.map(j=>S.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),O.map(({key:j,link:b})=>S.createElement("link",{key:j,nonce:n.nonce,...b,crossOrigin:b.crossOrigin??n.crossOrigin})))}function HY(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var FY=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{FY&&(window.__reactRouterVersion="7.13.0")}catch{}function GY({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=S.useRef();i.current==null&&(i.current=jV({window:r,v5Compat:!0}));let o=i.current,[l,f]=S.useState({action:o.action,location:o.location}),d=S.useCallback(h=>{n===!1?f(h):S.startTransition(()=>f(h))},[n]);return S.useLayoutEffect(()=>o.listen(d),[o,d]),S.createElement(xY,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var YI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cm=S.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:l,state:f,target:d,to:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g,...x},O){let{basename:j,unstable_useTransitions:b}=S.useContext(ur),E=typeof h=="string"&&YI.test(h),_=$I(h,j);h=_.to;let A=rY(h,{relative:i}),[C,N,M]=zY(r,x),R=KY(h,{replace:l,state:f,target:d,preventScrollReset:v,relative:i,viewTransition:m,unstable_defaultShouldRevalidate:g,unstable_useTransitions:b});function D(H){t&&t(H),H.defaultPrevented||R(H)}let L=S.createElement("a",{...x,...M,href:_.absoluteURL||A,onClick:_.isExternal||o?t:D,ref:HY(O,N),target:d,"data-discover":!E&&n==="render"?"true":void 0});return C&&!E?S.createElement(S.Fragment,null,L,S.createElement(BY,{page:A})):L});cm.displayName="Link";var VY=S.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:l,viewTransition:f,children:d,...h},v){let m=Hf(l,{relative:h.relative}),g=Jr(),x=S.useContext(Kp),{navigator:O,basename:j}=S.useContext(ur),b=x!=null&&tW(m)&&f===!0,E=O.encodeLocation?O.encodeLocation(m).pathname:m.pathname,_=g.pathname,A=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(_=_.toLowerCase(),A=A?A.toLowerCase():null,E=E.toLowerCase()),A&&j&&(A=si(A,j)||A);const C=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let N=_===E||!i&&_.startsWith(E)&&_.charAt(C)==="/",M=A!=null&&(A===E||!i&&A.startsWith(E)&&A.charAt(E.length)==="/"),R={isActive:N,isPending:M,isTransitioning:b},D=N?t:void 0,L;typeof r=="function"?L=r(R):L=[r,N?"active":null,M?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let H=typeof o=="function"?o(R):o;return S.createElement(cm,{...h,"aria-current":D,className:L,ref:v,style:H,to:l,viewTransition:f},typeof d=="function"?d(R):d)});VY.displayName="NavLink";var YY=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:l=Kh,action:f,onSubmit:d,relative:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g,...x},O)=>{let{unstable_useTransitions:j}=S.useContext(ur),b=JY(),E=eW(f,{relative:h}),_=l.toLowerCase()==="get"?"get":"post",A=typeof f=="string"&&YI.test(f),C=N=>{if(d&&d(N),N.defaultPrevented)return;N.preventDefault();let M=N.nativeEvent.submitter,R=M?.getAttribute("formmethod")||l,D=()=>b(M||N.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:i,state:o,relative:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g});j&&n!==!1?S.startTransition(()=>D()):D()};return S.createElement("form",{ref:O,method:_,action:E,onSubmit:r?d:C,...x,"data-discover":!A&&e==="render"?"true":void 0})});YY.displayName="Form";function WY(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WI(e){let t=S.useContext(fc);return Tt(t,WY(e)),t}function KY(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:f,unstable_useTransitions:d}={}){let h=_a(),v=Jr(),m=Hf(e,{relative:o});return S.useCallback(g=>{if(EY(g,t)){g.preventDefault();let x=n!==void 0?n:Ku(v)===Ku(m),O=()=>h(e,{replace:x,state:r,preventScrollReset:i,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:f});d?S.startTransition(()=>O()):O()}},[v,h,m,n,r,t,e,i,o,l,f,d])}function XY(e){Dr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=S.useRef(nS(e)),n=S.useRef(!1),r=Jr(),i=S.useMemo(()=>_Y(r.search,n.current?null:t.current),[r.search]),o=_a(),l=S.useCallback((f,d)=>{const h=nS(typeof f=="function"?f(new URLSearchParams(i)):f);n.current=!0,o("?"+h,d)},[o,i]);return[i,l]}var QY=0,ZY=()=>`__${String(++QY)}__`;function JY(){let{router:e}=WI("useSubmit"),{basename:t}=S.useContext(ur),n=mY(),r=e.fetch,i=e.navigate;return S.useCallback(async(o,l={})=>{let{action:f,method:d,encType:h,formData:v,body:m}=CY(o,t);if(l.navigate===!1){let g=l.fetcherKey||ZY();await r(g,n,l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:v,body:m,formMethod:l.method||d,formEncType:l.encType||h,flushSync:l.flushSync})}else await i(l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:v,body:m,formMethod:l.method||d,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,i,t,n])}function eW(e,{relative:t}={}){let{basename:n}=S.useContext(ur),r=S.useContext(Zr);Tt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...Hf(e||".",{relative:t})},l=Jr();if(e==null){o.search=l.search;let f=new URLSearchParams(o.search),d=f.getAll("index");if(d.some(v=>v==="")){f.delete("index"),d.filter(m=>m).forEach(m=>f.append("index",m));let v=f.toString();o.search=v?`?${v}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ja([n,o.pathname])),Ku(o)}function tW(e,{relative:t}={}){let n=S.useContext(LI);Tt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=WI("useViewTransitionState"),i=Hf(e,{relative:t});if(!n.isTransitioning)return!1;let o=si(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=si(n.nextLocation.pathname,r)||n.nextLocation.pathname;return lm(i.pathname,l)!=null||lm(i.pathname,o)!=null}const nW={theme:"system",setTheme:()=>null},KI=S.createContext(nW),XI=()=>{const e=S.useContext(KI);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function QI(e,t=[]){let n=[];function r(o,l){const f=S.createContext(l);f.displayName=o+"Context";const d=n.length;n=[...n,l];const h=m=>{const{scope:g,children:x,...O}=m,j=g?.[e]?.[d]||f,b=S.useMemo(()=>O,Object.values(O));return c.jsx(j.Provider,{value:b,children:x})};h.displayName=o+"Provider";function v(m,g){const x=g?.[e]?.[d]||f,O=S.useContext(x);if(O)return O;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[h,v]}const i=()=>{const o=n.map(l=>S.createContext(l));return function(f){const d=f?.[e]||o;return S.useMemo(()=>({[`__scope${e}`]:{...f,[e]:d}}),[f,d])}};return i.scopeName=e,[r,rW(i,...t)]}function rW(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((f,{useScope:d,scopeName:h})=>{const m=d(o)[`__scope${h}`];return{...f,...m}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Rx={exports:{}},Dx={};var BC;function aW(){if(BC)return Dx;BC=1;var e=Ap();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function f(m,g){var x=g(),O=r({inst:{value:x,getSnapshot:g}}),j=O[0].inst,b=O[1];return o(function(){j.value=x,j.getSnapshot=g,d(j)&&b({inst:j})},[m,x,g]),i(function(){return d(j)&&b({inst:j}),m(function(){d(j)&&b({inst:j})})},[m]),l(x),x}function d(m){var g=m.getSnapshot;m=m.value;try{var x=g();return!n(m,x)}catch{return!0}}function h(m,g){return g()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return Dx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Dx}var qC;function iW(){return qC||(qC=1,Rx.exports=aW()),Rx.exports}var oW=iW();function sW(){return oW.useSyncExternalStore(lW,()=>!0,()=>!1)}function lW(){return()=>{}}var yO="Avatar",[cW]=QI(yO),[uW,ZI]=cW(yO),JI=S.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=S.useState("idle");return c.jsx(uW,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:c.jsx(us.span,{...r,ref:t})})});JI.displayName=yO;var e5="AvatarImage",t5=S.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,l=ZI(e5,n),f=fW(r,o),d=Wr(h=>{i(h),l.onImageLoadingStatusChange(h)});return Wt(()=>{f!=="idle"&&d(f)},[f,d]),f==="loaded"?c.jsx(us.img,{...o,ref:t,src:r}):null});t5.displayName=e5;var n5="AvatarFallback",r5=S.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=ZI(n5,n),[l,f]=S.useState(r===void 0);return S.useEffect(()=>{if(r!==void 0){const d=window.setTimeout(()=>f(!0),r);return()=>window.clearTimeout(d)}},[r]),l&&o.imageLoadingStatus!=="loaded"?c.jsx(us.span,{...i,ref:t}):null});r5.displayName=n5;function UC(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function fW(e,{referrerPolicy:t,crossOrigin:n}){const r=sW(),i=S.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[l,f]=S.useState(()=>UC(o,e));return Wt(()=>{f(UC(o,e))},[o,e]),Wt(()=>{const d=m=>()=>{f(m)};if(!o)return;const h=d("loaded"),v=d("error");return o.addEventListener("load",h),o.addEventListener("error",v),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",h),o.removeEventListener("error",v)}},[o,n,t]),l}var dW=JI,hW=t5,mW=r5;function HC({className:e,...t}){return c.jsx(dW,{className:pe("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),"data-slot":"avatar",...t})}function FC({className:e,...t}){return c.jsx(hW,{className:pe("aspect-square size-full",e),"data-slot":"avatar-image",...t})}function GC({className:e,...t}){return c.jsx(mW,{className:pe("flex size-full items-center justify-center rounded-full bg-muted",e),"data-slot":"avatar-fallback",...t})}function Qp(e){const t=e+"CollectionProvider",[n,r]=jn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=j=>{const{scope:b,children:E}=j,_=I.useRef(null),A=I.useRef(new Map).current;return c.jsx(i,{scope:b,itemMap:A,collectionRef:_,children:E})};l.displayName=t;const f=e+"CollectionSlot",d=Rl(f),h=I.forwardRef((j,b)=>{const{scope:E,children:_}=j,A=o(f,E),C=Ue(b,A.collectionRef);return c.jsx(d,{ref:C,children:_})});h.displayName=f;const v=e+"CollectionItemSlot",m="data-radix-collection-item",g=Rl(v),x=I.forwardRef((j,b)=>{const{scope:E,children:_,...A}=j,C=I.useRef(null),N=Ue(b,C),M=o(v,E);return I.useEffect(()=>(M.itemMap.set(C,{ref:C,...A}),()=>void M.itemMap.delete(C))),c.jsx(g,{[m]:"",ref:N,children:_})});x.displayName=v;function O(j){const b=o(e+"CollectionConsumer",j);return I.useCallback(()=>{const _=b.collectionRef.current;if(!_)return[];const A=Array.from(_.querySelectorAll(`[${m}]`));return Array.from(b.itemMap.values()).sort((M,R)=>A.indexOf(M.ref.current)-A.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:l,Slot:h,ItemSlot:x},O,r]}var pW=S.createContext(void 0);function hc(e){const t=S.useContext(pW);return e||t||"ltr"}var Px="rovingFocusGroup.onEntryFocus",vW={bubbles:!1,cancelable:!0},Ff="RovingFocusGroup",[rS,a5,gW]=Qp(Ff),[yW,mc]=jn(Ff,[gW]),[xW,bW]=yW(Ff),i5=S.forwardRef((e,t)=>c.jsx(rS.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(rS.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(wW,{...e,ref:t})})}));i5.displayName=Ff;var wW=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:v=!1,...m}=e,g=S.useRef(null),x=Ue(t,g),O=hc(o),[j,b]=An({prop:l,defaultProp:f??null,onChange:d,caller:Ff}),[E,_]=S.useState(!1),A=Wr(h),C=a5(n),N=S.useRef(!1),[M,R]=S.useState(0);return S.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(Px,A),()=>D.removeEventListener(Px,A)},[A]),c.jsx(xW,{scope:n,orientation:r,dir:O,loop:i,currentTabStopId:j,onItemFocus:S.useCallback(D=>b(D),[b]),onItemShiftTab:S.useCallback(()=>_(!0),[]),onFocusableItemAdd:S.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:S.useCallback(()=>R(D=>D-1),[]),children:c.jsx(Ae.div,{tabIndex:E||M===0?-1:0,"data-orientation":r,...m,ref:x,style:{outline:"none",...e.style},onMouseDown:ge(e.onMouseDown,()=>{N.current=!0}),onFocus:ge(e.onFocus,D=>{const L=!N.current;if(D.target===D.currentTarget&&L&&!E){const H=new CustomEvent(Px,vW);if(D.currentTarget.dispatchEvent(H),!H.defaultPrevented){const B=C().filter(k=>k.focusable),U=B.find(k=>k.active),Y=B.find(k=>k.id===j),X=[U,Y,...B].filter(Boolean).map(k=>k.ref.current);l5(X,v)}}N.current=!1}),onBlur:ge(e.onBlur,()=>_(!1))})})}),o5="RovingFocusGroupItem",s5=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...f}=e,d=Cr(),h=o||d,v=bW(o5,n),m=v.currentTabStopId===h,g=a5(n),{onFocusableItemAdd:x,onFocusableItemRemove:O,currentTabStopId:j}=v;return S.useEffect(()=>{if(r)return x(),()=>O()},[r,x,O]),c.jsx(rS.ItemSlot,{scope:n,id:h,focusable:r,active:i,children:c.jsx(Ae.span,{tabIndex:m?0:-1,"data-orientation":v.orientation,...f,ref:t,onMouseDown:ge(e.onMouseDown,b=>{r?v.onItemFocus(h):b.preventDefault()}),onFocus:ge(e.onFocus,()=>v.onItemFocus(h)),onKeyDown:ge(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){v.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const E=OW(b,v.orientation,v.dir);if(E!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let A=g().filter(C=>C.focusable).map(C=>C.ref.current);if(E==="last")A.reverse();else if(E==="prev"||E==="next"){E==="prev"&&A.reverse();const C=A.indexOf(b.currentTarget);A=v.loop?EW(A,C+1):A.slice(C+1)}setTimeout(()=>l5(A))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:j!=null}):l})})});s5.displayName=o5;var SW={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jW(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function OW(e,t,n){const r=jW(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return SW[r]}function l5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function EW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xO=i5,bO=s5,aS=["Enter"," "],_W=["ArrowDown","PageUp","Home"],c5=["ArrowUp","PageDown","End"],AW=[..._W,...c5],NW={ltr:[...aS,"ArrowRight"],rtl:[...aS,"ArrowLeft"]},CW={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gf="Menu",[Xu,TW,MW]=Qp(Gf),[ds,u5]=jn(Gf,[MW,lo,mc]),Zp=lo(),f5=mc(),[RW,hs]=ds(Gf),[DW,Vf]=ds(Gf),d5=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:l=!0}=e,f=Zp(t),[d,h]=S.useState(null),v=S.useRef(!1),m=Wr(o),g=hc(i);return S.useEffect(()=>{const x=()=>{v.current=!0,document.addEventListener("pointerdown",O,{capture:!0,once:!0}),document.addEventListener("pointermove",O,{capture:!0,once:!0})},O=()=>v.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",O,{capture:!0}),document.removeEventListener("pointermove",O,{capture:!0})}},[]),c.jsx(Bp,{...f,children:c.jsx(RW,{scope:t,open:n,onOpenChange:m,content:d,onContentChange:h,children:c.jsx(DW,{scope:t,onClose:S.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:v,dir:g,modal:l,children:r})})})};d5.displayName=Gf;var PW="MenuAnchor",wO=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Zp(n);return c.jsx(qp,{...i,...r,ref:t})});wO.displayName=PW;var SO="MenuPortal",[kW,h5]=ds(SO,{forceMount:void 0}),m5=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=hs(SO,t);return c.jsx(kW,{scope:t,forceMount:n,children:c.jsx(Nn,{present:n||o.open,children:c.jsx(sc,{asChild:!0,container:i,children:r})})})};m5.displayName=SO;var Tr="MenuContent",[$W,jO]=ds(Tr),p5=S.forwardRef((e,t)=>{const n=h5(Tr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=hs(Tr,e.__scopeMenu),l=Vf(Tr,e.__scopeMenu);return c.jsx(Xu.Provider,{scope:e.__scopeMenu,children:c.jsx(Nn,{present:r||o.open,children:c.jsx(Xu.Slot,{scope:e.__scopeMenu,children:l.modal?c.jsx(IW,{...i,ref:t}):c.jsx(LW,{...i,ref:t})})})})}),IW=S.forwardRef((e,t)=>{const n=hs(Tr,e.__scopeMenu),r=S.useRef(null),i=Ue(t,r);return S.useEffect(()=>{const o=r.current;if(o)return Fj(o)},[]),c.jsx(OO,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ge(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),LW=S.forwardRef((e,t)=>{const n=hs(Tr,e.__scopeMenu);return c.jsx(OO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zW=Rl("MenuContent.ScrollLock"),OO=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:f,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:m,onInteractOutside:g,onDismiss:x,disableOutsideScroll:O,...j}=e,b=hs(Tr,n),E=Vf(Tr,n),_=Zp(n),A=f5(n),C=TW(n),[N,M]=S.useState(null),R=S.useRef(null),D=Ue(t,R,b.onContentChange),L=S.useRef(0),H=S.useRef(""),B=S.useRef(0),U=S.useRef(null),Y=S.useRef("right"),Z=S.useRef(0),X=O?Rp:S.Fragment,k=O?{as:zW,allowPinchZoom:!0}:void 0,q=Q=>{const ee=H.current+Q,z=C().filter(oe=>!oe.disabled),G=document.activeElement,$=z.find(oe=>oe.ref.current===G)?.textValue,W=z.map(oe=>oe.textValue),ae=QW(W,ee,$),ce=z.find(oe=>oe.textValue===ae)?.ref.current;(function oe(me){H.current=me,window.clearTimeout(L.current),me!==""&&(L.current=window.setTimeout(()=>oe(""),1e3))})(ee),ce&&setTimeout(()=>ce.focus())};S.useEffect(()=>()=>window.clearTimeout(L.current),[]),Hj();const V=S.useCallback(Q=>Y.current===U.current?.side&&JW(Q,U.current?.area),[]);return c.jsx($W,{scope:n,searchRef:H,onItemEnter:S.useCallback(Q=>{V(Q)&&Q.preventDefault()},[V]),onItemLeave:S.useCallback(Q=>{V(Q)||(R.current?.focus(),M(null))},[V]),onTriggerLeave:S.useCallback(Q=>{V(Q)&&Q.preventDefault()},[V]),pointerGraceTimerRef:B,onPointerGraceIntentChange:S.useCallback(Q=>{U.current=Q},[]),children:c.jsx(X,{...k,children:c.jsx(Tp,{asChild:!0,trapped:i,onMountAutoFocus:ge(o,Q=>{Q.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:c.jsx(oc,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:m,onInteractOutside:g,onDismiss:x,children:c.jsx(xO,{asChild:!0,...A,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:M,onEntryFocus:ge(d,Q=>{E.isUsingKeyboardRef.current||Q.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Up,{role:"menu","aria-orientation":"vertical","data-state":M5(b.open),"data-radix-menu-content":"",dir:E.dir,..._,...j,ref:D,style:{outline:"none",...j.style},onKeyDown:ge(j.onKeyDown,Q=>{const z=Q.target.closest("[data-radix-menu-content]")===Q.currentTarget,G=Q.ctrlKey||Q.altKey||Q.metaKey,$=Q.key.length===1;z&&(Q.key==="Tab"&&Q.preventDefault(),!G&&$&&q(Q.key));const W=R.current;if(Q.target!==W||!AW.includes(Q.key))return;Q.preventDefault();const ce=C().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);c5.includes(Q.key)&&ce.reverse(),KW(ce)}),onBlur:ge(e.onBlur,Q=>{Q.currentTarget.contains(Q.target)||(window.clearTimeout(L.current),H.current="")}),onPointerMove:ge(e.onPointerMove,Qu(Q=>{const ee=Q.target,z=Z.current!==Q.clientX;if(Q.currentTarget.contains(ee)&&z){const G=Q.clientX>Z.current?"right":"left";Y.current=G,Z.current=Q.clientX}}))})})})})})})});p5.displayName=Tr;var BW="MenuGroup",EO=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ae.div,{role:"group",...r,ref:t})});EO.displayName=BW;var qW="MenuLabel",v5=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ae.div,{...r,ref:t})});v5.displayName=qW;var um="MenuItem",VC="menu.itemSelect",Jp=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=S.useRef(null),l=Vf(um,e.__scopeMenu),f=jO(um,e.__scopeMenu),d=Ue(t,o),h=S.useRef(!1),v=()=>{const m=o.current;if(!n&&m){const g=new CustomEvent(VC,{bubbles:!0,cancelable:!0});m.addEventListener(VC,x=>r?.(x),{once:!0}),j$(m,g),g.defaultPrevented?h.current=!1:l.onClose()}};return c.jsx(g5,{...i,ref:d,disabled:n,onClick:ge(e.onClick,v),onPointerDown:m=>{e.onPointerDown?.(m),h.current=!0},onPointerUp:ge(e.onPointerUp,m=>{h.current||m.currentTarget?.click()}),onKeyDown:ge(e.onKeyDown,m=>{const g=f.searchRef.current!=="";n||g&&m.key===" "||aS.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Jp.displayName=um;var g5=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,l=jO(um,n),f=f5(n),d=S.useRef(null),h=Ue(t,d),[v,m]=S.useState(!1),[g,x]=S.useState("");return S.useEffect(()=>{const O=d.current;O&&x((O.textContent??"").trim())},[o.children]),c.jsx(Xu.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:c.jsx(bO,{asChild:!0,...f,focusable:!r,children:c.jsx(Ae.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:h,onPointerMove:ge(e.onPointerMove,Qu(O=>{r?l.onItemLeave(O):(l.onItemEnter(O),O.defaultPrevented||O.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ge(e.onPointerLeave,Qu(O=>l.onItemLeave(O))),onFocus:ge(e.onFocus,()=>m(!0)),onBlur:ge(e.onBlur,()=>m(!1))})})})}),UW="MenuCheckboxItem",y5=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return c.jsx(j5,{scope:e.__scopeMenu,checked:n,children:c.jsx(Jp,{role:"menuitemcheckbox","aria-checked":fm(n)?"mixed":n,...i,ref:t,"data-state":AO(n),onSelect:ge(i.onSelect,()=>r?.(fm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});y5.displayName=UW;var x5="MenuRadioGroup",[HW,FW]=ds(x5,{value:void 0,onValueChange:()=>{}}),b5=S.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Wr(r);return c.jsx(HW,{scope:e.__scopeMenu,value:n,onValueChange:o,children:c.jsx(EO,{...i,ref:t})})});b5.displayName=x5;var w5="MenuRadioItem",S5=S.forwardRef((e,t)=>{const{value:n,...r}=e,i=FW(w5,e.__scopeMenu),o=n===i.value;return c.jsx(j5,{scope:e.__scopeMenu,checked:o,children:c.jsx(Jp,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":AO(o),onSelect:ge(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});S5.displayName=w5;var _O="MenuItemIndicator",[j5,GW]=ds(_O,{checked:!1}),O5=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=GW(_O,n);return c.jsx(Nn,{present:r||fm(o.checked)||o.checked===!0,children:c.jsx(Ae.span,{...i,ref:t,"data-state":AO(o.checked)})})});O5.displayName=_O;var VW="MenuSeparator",E5=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ae.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});E5.displayName=VW;var YW="MenuArrow",_5=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Zp(n);return c.jsx(Hp,{...i,...r,ref:t})});_5.displayName=YW;var WW="MenuSub",[rye,A5]=ds(WW),Mu="MenuSubTrigger",N5=S.forwardRef((e,t)=>{const n=hs(Mu,e.__scopeMenu),r=Vf(Mu,e.__scopeMenu),i=A5(Mu,e.__scopeMenu),o=jO(Mu,e.__scopeMenu),l=S.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:d}=o,h={__scopeMenu:e.__scopeMenu},v=S.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return S.useEffect(()=>v,[v]),S.useEffect(()=>{const m=f.current;return()=>{window.clearTimeout(m),d(null)}},[f,d]),c.jsx(wO,{asChild:!0,...h,children:c.jsx(g5,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":M5(n.open),...e,ref:kf(t,i.onTriggerChange),onClick:m=>{e.onClick?.(m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ge(e.onPointerMove,Qu(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),v()},100))})),onPointerLeave:ge(e.onPointerLeave,Qu(m=>{v();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,O=x==="right",j=O?-5:5,b=g[O?"left":"right"],E=g[O?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+j,y:m.clientY},{x:b,y:g.top},{x:E,y:g.top},{x:E,y:g.bottom},{x:b,y:g.bottom}],side:x}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ge(e.onKeyDown,m=>{const g=o.searchRef.current!=="";e.disabled||g&&m.key===" "||NW[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});N5.displayName=Mu;var C5="MenuSubContent",T5=S.forwardRef((e,t)=>{const n=h5(Tr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=hs(Tr,e.__scopeMenu),l=Vf(Tr,e.__scopeMenu),f=A5(C5,e.__scopeMenu),d=S.useRef(null),h=Ue(t,d);return c.jsx(Xu.Provider,{scope:e.__scopeMenu,children:c.jsx(Nn,{present:r||o.open,children:c.jsx(Xu.Slot,{scope:e.__scopeMenu,children:c.jsx(OO,{id:f.contentId,"aria-labelledby":f.triggerId,...i,ref:h,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{l.isUsingKeyboardRef.current&&d.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:ge(e.onFocusOutside,v=>{v.target!==f.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ge(e.onEscapeKeyDown,v=>{l.onClose(),v.preventDefault()}),onKeyDown:ge(e.onKeyDown,v=>{const m=v.currentTarget.contains(v.target),g=CW[l.dir].includes(v.key);m&&g&&(o.onOpenChange(!1),f.trigger?.focus(),v.preventDefault())})})})})})});T5.displayName=C5;function M5(e){return e?"open":"closed"}function fm(e){return e==="indeterminate"}function AO(e){return fm(e)?"indeterminate":e?"checked":"unchecked"}function KW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function XW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function QW(e,t,n){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=XW(e,Math.max(o,0));i.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function ZW(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const f=t[o],d=t[l],h=f.x,v=f.y,m=d.x,g=d.y;v>r!=g>r&&n<(m-h)*(r-v)/(g-v)+h&&(i=!i)}return i}function JW(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ZW(n,t)}function Qu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var eK=d5,tK=wO,nK=m5,rK=p5,aK=EO,iK=v5,oK=Jp,sK=y5,lK=b5,cK=S5,uK=O5,fK=E5,dK=_5,hK=N5,mK=T5,ev="DropdownMenu",[pK]=jn(ev,[u5]),Cn=u5(),[vK,R5]=pK(ev),D5=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:l,modal:f=!0}=e,d=Cn(t),h=S.useRef(null),[v,m]=An({prop:i,defaultProp:o??!1,onChange:l,caller:ev});return c.jsx(vK,{scope:t,triggerId:Cr(),triggerRef:h,contentId:Cr(),open:v,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(g=>!g),[m]),modal:f,children:c.jsx(eK,{...d,open:v,onOpenChange:m,dir:r,modal:f,children:n})})};D5.displayName=ev;var P5="DropdownMenuTrigger",k5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=R5(P5,n),l=Cn(n);return c.jsx(tK,{asChild:!0,...l,children:c.jsx(Ae.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:kf(t,o.triggerRef),onPointerDown:ge(e.onPointerDown,f=>{!r&&f.button===0&&f.ctrlKey===!1&&(o.onOpenToggle(),o.open||f.preventDefault())}),onKeyDown:ge(e.onKeyDown,f=>{r||(["Enter"," "].includes(f.key)&&o.onOpenToggle(),f.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});k5.displayName=P5;var gK="DropdownMenuPortal",$5=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Cn(t);return c.jsx(nK,{...r,...n})};$5.displayName=gK;var I5="DropdownMenuContent",L5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=R5(I5,n),o=Cn(n),l=S.useRef(!1);return c.jsx(rK,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:ge(e.onCloseAutoFocus,f=>{l.current||i.triggerRef.current?.focus(),l.current=!1,f.preventDefault()}),onInteractOutside:ge(e.onInteractOutside,f=>{const d=f.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,v=d.button===2||h;(!i.modal||v)&&(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)"}})});L5.displayName=I5;var yK="DropdownMenuGroup",xK=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(aK,{...i,...r,ref:t})});xK.displayName=yK;var bK="DropdownMenuLabel",z5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(iK,{...i,...r,ref:t})});z5.displayName=bK;var wK="DropdownMenuItem",B5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(oK,{...i,...r,ref:t})});B5.displayName=wK;var SK="DropdownMenuCheckboxItem",q5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(sK,{...i,...r,ref:t})});q5.displayName=SK;var jK="DropdownMenuRadioGroup",OK=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(lK,{...i,...r,ref:t})});OK.displayName=jK;var EK="DropdownMenuRadioItem",_K=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(cK,{...i,...r,ref:t})});_K.displayName=EK;var AK="DropdownMenuItemIndicator",U5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(uK,{...i,...r,ref:t})});U5.displayName=AK;var NK="DropdownMenuSeparator",H5=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(fK,{...i,...r,ref:t})});H5.displayName=NK;var CK="DropdownMenuArrow",TK=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(dK,{...i,...r,ref:t})});TK.displayName=CK;var MK="DropdownMenuSubTrigger",RK=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(hK,{...i,...r,ref:t})});RK.displayName=MK;var DK="DropdownMenuSubContent",PK=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(mK,{...i,...r,ref:t,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)"}})});PK.displayName=DK;var kK=D5,$K=k5,IK=$5,LK=L5,zK=z5,BK=B5,qK=q5,UK=U5,HK=H5;function F5({...e}){return c.jsx(kK,{"data-slot":"dropdown-menu",...e})}function G5({...e}){return c.jsx($K,{"data-slot":"dropdown-menu-trigger",...e})}function V5({className:e,sideOffset:t=4,...n}){return c.jsx(IK,{children:c.jsx(LK,{className:pe("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-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"dropdown-menu-content",sideOffset:t,...n})})}function YC({className:e,inset:t,variant:n="default",...r}){return c.jsx(BK,{className:pe("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-inset":t,"data-slot":"dropdown-menu-item","data-variant":n,...r})}function FK({className:e,children:t,checked:n,...r}){return c.jsxs(qK,{checked:n,className:pe("relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-slot":"dropdown-menu-checkbox-item",...r,children:[c.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:c.jsx(UK,{children:c.jsx(ai,{className:"size-4"})})}),t]})}function Y5({className:e,inset:t,...n}){return c.jsx(zK,{className:pe("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",e),"data-inset":t,"data-slot":"dropdown-menu-label",...n})}function iS({className:e,...t}){return c.jsx(HK,{className:pe("-mx-1 my-1 h-px bg-border",e),"data-slot":"dropdown-menu-separator",...t})}function GK({user:e}){const{isMobile:t}=qf(),{theme:n,setTheme:r}=XI(),[i,o]=S.useState(null),[l,f]=S.useState(0);S.useEffect(()=>{(async()=>{try{const g=sessionStorage.getItem("wraps-auth-token");if(!g){console.log("No auth token found yet, will retry..."),l<5&&setTimeout(()=>{f(O=>O+1)},200);return}console.log("Fetching user info from /api/user");const x=await fetch(`/api/user?token=${g}`);if(console.log("User API response status:",x.status),x.ok){const O=await x.json();console.log("User info received:",O),o(O)}else{const O=await x.text();console.error("Failed to fetch user info:",x.status,O)}}catch(g){console.error("Error fetching user info:",g)}})().catch(g=>{console.error("Failed to fetch user info:",g)})},[l]);const d=()=>{window.confirm("Are you sure you want to close the console?")&&window.close()},h=i?.accountAlias||i?.accountId||"Loading...",v=i?.region||"...";return c.jsx(X1,{children:c.jsx(Q1,{children:c.jsxs(F5,{children:[c.jsx(G5,{asChild:!0,children:c.jsxs(Z1,{className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground md:h-8 md:p-0",size:"lg",children:[c.jsxs(HC,{className:"h-8 w-8 rounded-lg",children:[c.jsx(FC,{alt:h,src:e.avatar}),c.jsx(GC,{className:"rounded-lg bg-orange-500 text-white",children:"AWS"})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:h}),c.jsx("span",{className:"truncate text-xs",children:v})]}),c.jsx(YH,{className:"ml-auto size-4"})]})}),c.jsxs(V5,{align:"end",className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:t?"bottom":"right",sideOffset:4,children:[c.jsx(Y5,{className:"p-0 font-normal",children:c.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[c.jsxs(HC,{className:"h-8 w-8 rounded-lg",children:[c.jsx(FC,{alt:h,src:e.avatar}),c.jsx(GC,{className:"rounded-lg bg-orange-500 text-white",children:"AWS"})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:h}),c.jsx("span",{className:"truncate text-xs",children:v}),i?.accountId&&i.accountId!==i.accountAlias&&c.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:i.accountId})]})]})}),c.jsx(iS,{}),c.jsxs(YC,{onClick:()=>r(n==="dark"?"light":"dark"),children:[n==="dark"?c.jsx(iF,{}):c.jsx(tF,{}),n==="dark"?"Light Mode":"Dark Mode"]}),c.jsx(iS,{}),c.jsxs(YC,{onClick:d,children:[c.jsx(or,{}),"Close Console"]})]})]})})})}const Gi={user:{name:"Wraps Console",email:"hello@wraps.dev",avatar:"/avatars/wraps.jpg"},navMain:[{title:"Dashboard",url:"/",icon:Np,isActive:!0,isDashboard:!0},{title:"Email",url:"#",icon:Sl,isActive:!1,subItems:[{title:"Emails",icon:Sl,url:"/email"},{title:"Metrics",icon:px,url:"/email/metrics"},{title:"Settings",icon:gx,url:"/email/settings"}]},{title:"SMS",url:"#",icon:eo,isActive:!1,subItems:[{title:"Messages",icon:eo,url:"/sms"},{title:"Metrics",icon:px,url:"/sms/metrics"},{title:"Settings",icon:gx,url:"/sms/settings"}]},{title:"CDN",url:"#",icon:If,isActive:!1,subItems:[{title:"Library",icon:v$,url:"/cdn"},{title:"Metrics",icon:px,url:"/cdn/metrics"},{title:"Settings",icon:gx,url:"/cdn/settings"}]}]};function VK({...e}){const t=Jr(),n=_a(),{setOpen:r,state:i}=qf(),{theme:o}=XI(),l=S.useCallback(()=>t.pathname==="/"?Gi.navMain[0]:t.pathname.startsWith("/email")?Gi.navMain[1]:t.pathname.startsWith("/sms")?Gi.navMain[2]:t.pathname.startsWith("/cdn")?Gi.navMain[3]:Gi.navMain[0],[t.pathname]),[f,d]=S.useState(l());return S.useEffect(()=>{d(l())},[l]),c.jsxs(Nx,{className:"overflow-hidden *:data-[sidebar=sidebar]:flex-row",collapsible:"icon",...e,children:[c.jsxs(Nx,{className:"w-[calc(var(--sidebar-width-icon)+1px)]! border-r",collapsible:"none",children:[c.jsx(NC,{children:c.jsx(X1,{children:c.jsx(Q1,{children:c.jsx(Z1,{asChild:!0,className:"md:h-8 md:p-0",onClick:()=>{d(Gi.navMain[0]),r(!1)},size:"lg",children:c.jsxs(cm,{to:"/",children:[c.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg",children:c.jsx("img",{alt:"Wraps",className:"size-8 object-contain",src:o==="dark"?"/wraps-dark.png":"/wraps-light.png"})}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-semibold",children:"Wraps"}),c.jsx("span",{className:"truncate text-xs",children:"Console"})]})]})})})})}),c.jsx(CC,{children:c.jsx(TC,{children:c.jsx(MC,{className:"px-1.5 md:px-0",children:c.jsx(X1,{children:Gi.navMain.filter(h=>!h.isDashboard).map(h=>c.jsx(Q1,{children:c.jsxs(Z1,{className:"px-2.5 md:px-2",isActive:f?.title===h.title,onClick:()=>{d(h),r(!0),h.subItems&&h.subItems.length>0&&n(h.subItems[0].url)},tooltip:{children:h.title,hidden:!1},children:[c.jsx(h.icon,{}),c.jsx("span",{children:h.title})]})},h.title))})})})}),c.jsx(HG,{children:c.jsx(GK,{user:Gi.user})})]}),i==="expanded"&&c.jsx(Nx,{className:"hidden flex-1 md:flex",collapsible:"none",children:f&&!f.isDashboard&&f.subItems?c.jsxs(c.Fragment,{children:[c.jsxs(NC,{className:"gap-3.5 border-b p-4",children:[c.jsx("div",{className:"flex w-full items-center justify-between",children:c.jsxs("div",{className:"flex items-center gap-2 font-medium text-base text-foreground",children:[c.jsx(f.icon,{className:"size-4"}),f.title]})}),c.jsx(UG,{placeholder:"Search..."})]}),c.jsx(CC,{children:c.jsx(TC,{className:"px-0",children:c.jsx(MC,{children:f.subItems.map(h=>{const v=t.pathname===h.url||h.url==="/email"&&t.pathname.startsWith("/email/")&&t.pathname!=="/email/metrics"&&t.pathname!=="/email/settings"||h.url==="/sms"&&t.pathname.startsWith("/sms/")&&t.pathname!=="/sms/metrics"&&t.pathname!=="/sms/settings"||h.url==="/cdn"&&t.pathname.startsWith("/cdn/")&&t.pathname!=="/cdn/metrics"&&t.pathname!=="/cdn/settings";return c.jsxs(cm,{className:`flex items-center gap-3 border-b p-4 text-sm leading-tight transition-colors last:border-b-0 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground ${v?"bg-sidebar-accent font-semibold text-sidebar-accent-foreground":""}`,to:h.url,children:[c.jsx(h.icon,{className:"size-4 shrink-0"}),c.jsx("span",{className:"font-medium",children:h.title})]},h.title)})})})})]}):c.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:c.jsxs("div",{className:"text-muted-foreground",children:[c.jsx(Np,{className:"mx-auto mb-4 size-12 opacity-50"}),c.jsx("p",{className:"text-sm",children:"Select a product to view options"})]})})})]})}const YK=ic("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[1rem_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Un({className:e,variant:t,...n}){return c.jsx("div",{className:pe(YK({variant:t}),e),"data-slot":"alert",role:"alert",...n})}function ro({className:e,...t}){return c.jsx("div",{className:pe("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),"data-slot":"alert-title",...t})}function Hn({className:e,...t}){return c.jsx("div",{className:pe("col-start-2 grid justify-items-start gap-1 text-muted-foreground text-sm [&_p]:leading-relaxed",e),"data-slot":"alert-description",...t})}var W5="AlertDialog",[WK]=jn(W5,[$$]),mi=$$(),K5=e=>{const{__scopeAlertDialog:t,...n}=e,r=mi(t);return c.jsx(Wj,{...r,...n,modal:!0})};K5.displayName=W5;var KK="AlertDialogTrigger",XK=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=mi(n);return c.jsx(I7,{...i,...r,ref:t})});XK.displayName=KK;var QK="AlertDialogPortal",X5=e=>{const{__scopeAlertDialog:t,...n}=e,r=mi(t);return c.jsx(Kj,{...r,...n})};X5.displayName=QK;var ZK="AlertDialogOverlay",Q5=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=mi(n);return c.jsx(Xj,{...i,...r,ref:t})});Q5.displayName=ZK;var El="AlertDialogContent",[JK,eX]=WK(El),tX=S$("AlertDialogContent"),Z5=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=mi(n),l=S.useRef(null),f=Ue(t,l),d=S.useRef(null);return c.jsx(D7,{contentName:El,titleName:J5,docsSlug:"alert-dialog",children:c.jsx(JK,{scope:n,cancelRef:d,children:c.jsxs(Qj,{role:"alertdialog",...o,...i,ref:f,onOpenAutoFocus:ge(i.onOpenAutoFocus,h=>{h.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[c.jsx(tX,{children:r}),c.jsx(rX,{contentRef:l})]})})})});Z5.displayName=El;var J5="AlertDialogTitle",eL=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=mi(n);return c.jsx(Zj,{...i,...r,ref:t})});eL.displayName=J5;var tL="AlertDialogDescription",nL=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=mi(n);return c.jsx(Jj,{...i,...r,ref:t})});nL.displayName=tL;var nX="AlertDialogAction",rL=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=mi(n);return c.jsx(Pp,{...i,...r,ref:t})});rL.displayName=nX;var aL="AlertDialogCancel",iL=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=eX(aL,n),o=mi(n),l=Ue(t,i);return c.jsx(Pp,{...o,...r,ref:l})});iL.displayName=aL;var rX=({contentRef:e})=>{const t=`\`${El}\` requires a description for the component to be accessible for screen reader users.
|
|
56
56
|
|
|
57
57
|
You can add a description to the \`${El}\` by passing a \`${tL}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
58
58
|
|
|
@@ -63,7 +63,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
63
63
|
- less than the value passed to \`max\` (or ${CO} if no \`max\` prop is set)
|
|
64
64
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
65
65
|
|
|
66
|
-
Defaulting to \`null\`.`}var SX=oL,jX=lL;function tv({className:e,value:t,indicatorClassName:n,...r}){return c.jsx(SX,{className:pe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),"data-slot":"progress",...r,children:c.jsx(jX,{className:pe("h-full w-full flex-1 bg-primary transition-all",n),"data-slot":"progress-indicator",style:{transform:`translateX(-${100-(t||0)}%)`}})})}var uL="Toggle",fL=S.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[l,f]=An({prop:n,onChange:i,defaultProp:r??!1,caller:uL});return c.jsx(Ae.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:ge(e.onClick,()=>{e.disabled||f(!l)})})});fL.displayName=uL;var co="ToggleGroup",[dL]=jn(co,[mc]),hL=mc(),TO=I.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const i=r;return c.jsx(OX,{...i,ref:t})}if(n==="multiple"){const i=r;return c.jsx(EX,{...i,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${co}\``)});TO.displayName=co;var[mL,pL]=dL(co),OX=I.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[l,f]=An({prop:n,defaultProp:r??"",onChange:i,caller:co});return c.jsx(mL,{scope:e.__scopeToggleGroup,type:"single",value:I.useMemo(()=>l?[l]:[],[l]),onItemActivate:f,onItemDeactivate:I.useCallback(()=>f(""),[f]),children:c.jsx(vL,{...o,ref:t})})}),EX=I.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[l,f]=An({prop:n,defaultProp:r??[],onChange:i,caller:co}),d=I.useCallback(v=>f((m=[])=>[...m,v]),[f]),h=I.useCallback(v=>f((m=[])=>m.filter(g=>g!==v)),[f]);return c.jsx(mL,{scope:e.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:d,onItemDeactivate:h,children:c.jsx(vL,{...o,ref:t})})});TO.displayName=co;var[_X,AX]=dL(co),vL=I.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:o,dir:l,loop:f=!0,...d}=e,h=hL(n),v=hc(l),m={role:"group",dir:v,...d};return c.jsx(_X,{scope:n,rovingFocus:i,disabled:r,children:i?c.jsx(xO,{asChild:!0,...h,orientation:o,dir:v,loop:f,children:c.jsx(Ae.div,{...m,ref:t})}):c.jsx(Ae.div,{...m,ref:t})})}),wm="ToggleGroupItem",gL=I.forwardRef((e,t)=>{const n=pL(wm,e.__scopeToggleGroup),r=AX(wm,e.__scopeToggleGroup),i=hL(e.__scopeToggleGroup),o=n.value.includes(e.value),l=r.disabled||e.disabled,f={...e,pressed:o,disabled:l},d=I.useRef(null);return r.rovingFocus?c.jsx(bO,{asChild:!0,...i,focusable:!l,active:o,ref:d,children:c.jsx(XC,{...f,ref:t})}):c.jsx(XC,{...f,ref:t})});gL.displayName=wm;var XC=I.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,o=pL(wm,n),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},f=o.type==="single"?l:void 0;return c.jsx(fL,{...f,...i,ref:t,onPressedChange:d=>{d?o.onItemActivate(r):o.onItemDeactivate(r)}})}),NX=TO,CX=gL;const TX=ic("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}}),yL=S.createContext({size:"default",variant:"default",spacing:0});function MX({className:e,variant:t,size:n,spacing:r=0,children:i,...o}){return c.jsx(NX,{className:pe("group/toggle-group flex w-fit items-center gap-[var(--gap)] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",e),"data-size":n,"data-slot":"toggle-group","data-spacing":r,"data-variant":t,style:{"--gap":r},...o,children:c.jsx(yL.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function QC({className:e,children:t,variant:n,size:r,...i}){const o=S.useContext(yL);return c.jsx(CX,{className:pe(TX({variant:o.variant||n,size:o.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:first:border-l data-[spacing=0]:first:rounded-l-md",e),"data-size":o.size||r,"data-slot":"toggle-group-item","data-spacing":o.spacing,"data-variant":o.variant||n,...i,children:t})}function ha(...e){return u$(et(e))}function ma({value:e,className:t,variant:n="outline",size:r="icon",label:i}){const[o,l]=S.useState("idle"),f=async d=>{d.stopPropagation(),l("copying");try{await Promise.all([navigator.clipboard.writeText(e),new Promise(h=>setTimeout(h,150))]),l("copied"),jt.success("Copied to clipboard"),setTimeout(()=>l("idle"),2e3)}catch{l("idle"),jt.error("Failed to copy to clipboard")}};return c.jsxs(Ce,{className:ha("transition-all",o==="copied"&&"text-green-500",t),disabled:o==="copying",onClick:f,size:r,variant:n,children:[o==="copying"?c.jsx(fa,{className:ha("animate-spin",i?"mr-2 h-4 w-4":"h-4 w-4")}):o==="copied"?c.jsx(ai,{className:ha(i?"mr-2 h-4 w-4":"h-4 w-4")}):c.jsx(zj,{className:ha(i?"mr-2 h-4 w-4":"h-4 w-4")}),i]})}function xL({onDelete:e,className:t,variant:n="outline",size:r="icon",label:i}){const[o,l]=S.useState(!1),f=async d=>{d.stopPropagation(),l(!0);try{await Promise.all([e(),new Promise(h=>setTimeout(h,150))])}finally{l(!1)}};return c.jsxs(Ce,{className:ha("text-destructive transition-all hover:text-destructive",t),disabled:o,onClick:f,size:r,variant:n,children:[o?c.jsx(fa,{className:ha("animate-spin",i?"mr-1.5 h-4 w-4":"h-4 w-4")}):c.jsx(oF,{className:ha(i?"mr-1.5 h-4 w-4":"h-4 w-4")}),i]})}function MO({...e}){return c.jsx(Wj,{"data-slot":"dialog",...e})}function RX({...e}){return c.jsx(Kj,{"data-slot":"dialog-portal",...e})}function DX({className:e,...t}){return c.jsx(Xj,{className:pe("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"dialog-overlay",...t})}function RO({className:e,children:t,showCloseButton:n=!0,...r}){return c.jsxs(RX,{"data-slot":"dialog-portal",children:[c.jsx(DX,{}),c.jsxs(Qj,{className:pe("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",e),"data-slot":"dialog-content",...r,children:[t,n&&c.jsxs(Pp,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0","data-slot":"dialog-close",children:[c.jsx(or,{}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function bL({className:e,...t}){return c.jsx("div",{className:pe("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"dialog-header",...t})}function wL({className:e,...t}){return c.jsx("div",{className:pe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...t})}function SL({className:e,...t}){return c.jsx(Zj,{className:pe("font-semibold text-lg leading-none",e),"data-slot":"dialog-title",...t})}function PX({className:e,...t}){return c.jsx(Jj,{className:pe("text-muted-foreground text-sm",e),"data-slot":"dialog-description",...t})}const jL=6048e5,kX=864e5,Nh=43200,ZC=1440,JC=Symbol.for("constructDateFrom");function li(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&JC in e?e[JC](t):e instanceof Date?new e.constructor(t):new Date(t)}function sn(e,t){return li(t||e,e)}let $X={};function Yf(){return $X}function Zu(e,t){const n=Yf(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=sn(e,t?.in),o=i.getDay(),l=(o<r?7:0)+o-r;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function Sm(e,t){return Zu(e,{...t,weekStartsOn:1})}function OL(e,t){const n=sn(e,t?.in),r=n.getFullYear(),i=li(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=Sm(i),l=li(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const f=Sm(l);return n.getTime()>=o.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function jm(e){const t=sn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function nv(e,...t){const n=li.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function eT(e,t){const n=sn(e,t?.in);return n.setHours(0,0,0,0),n}function IX(e,t,n){const[r,i]=nv(n?.in,e,t),o=eT(r),l=eT(i),f=+o-jm(o),d=+l-jm(l);return Math.round((f-d)/kX)}function LX(e,t){const n=OL(e,t),r=li(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Sm(r)}function Qh(e,t){const n=+sn(e)-+sn(t);return n<0?-1:n>0?1:n}function zX(e){return li(e,Date.now())}function BX(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function qX(e){return!(!BX(e)&&typeof e!="number"||isNaN(+sn(e)))}function UX(e,t,n){const[r,i]=nv(n?.in,e,t),o=r.getFullYear()-i.getFullYear(),l=r.getMonth()-i.getMonth();return o*12+l}function HX(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function FX(e,t){return+sn(e)-+sn(t)}function GX(e,t){const n=sn(e,t?.in);return n.setHours(23,59,59,999),n}function VX(e,t){const n=sn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function YX(e,t){const n=sn(e,t?.in);return+GX(n,t)==+VX(n,t)}function WX(e,t,n){const[r,i,o]=nv(n?.in,e,e,t),l=Qh(i,o),f=Math.abs(UX(i,o));if(f<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-l*f);let d=Qh(i,o)===-l;YX(r)&&f===1&&Qh(r,o)===1&&(d=!1);const h=l*(f-+d);return h===0?0:h}function KX(e,t,n){const r=FX(e,t)/1e3;return HX(n?.roundingMethod)(r)}function XX(e,t){const n=sn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const QX={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ZX=(e,t,n)=>{let r;const i=QX[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function kx(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const JX={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},eQ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},tQ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nQ={date:kx({formats:JX,defaultWidth:"full"}),time:kx({formats:eQ,defaultWidth:"full"}),dateTime:kx({formats:tQ,defaultWidth:"full"})},rQ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},aQ=(e,t,n,r)=>rQ[e];function bu(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,f=n?.width?String(n.width):l;i=e.formattingValues[f]||e.formattingValues[l]}else{const l=e.defaultWidth,f=n?.width?String(n.width):e.defaultWidth;i=e.values[f]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const iQ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},oQ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},sQ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},lQ={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},cQ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},uQ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},fQ=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},dQ={ordinalNumber:fQ,era:bu({values:iQ,defaultWidth:"wide"}),quarter:bu({values:oQ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:bu({values:sQ,defaultWidth:"wide"}),day:bu({values:lQ,defaultWidth:"wide"}),dayPeriod:bu({values:cQ,defaultWidth:"wide",formattingValues:uQ,defaultFormattingWidth:"wide"})};function wu(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const l=o[0],f=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(f)?mQ(f,m=>m.test(l)):hQ(f,m=>m.test(l));let h;h=e.valueCallback?e.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const v=t.slice(l.length);return{value:h,rest:v}}}function hQ(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function mQ(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function pQ(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const f=t.slice(i.length);return{value:l,rest:f}}}const vQ=/^(\d+)(th|st|nd|rd)?/i,gQ=/\d+/i,yQ={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},xQ={any:[/^b/i,/^(a|c)/i]},bQ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wQ={any:[/1/i,/2/i,/3/i,/4/i]},SQ={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},jQ={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},OQ={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},EQ={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},_Q={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},AQ={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},NQ={ordinalNumber:pQ({matchPattern:vQ,parsePattern:gQ,valueCallback:e=>parseInt(e,10)}),era:wu({matchPatterns:yQ,defaultMatchWidth:"wide",parsePatterns:xQ,defaultParseWidth:"any"}),quarter:wu({matchPatterns:bQ,defaultMatchWidth:"wide",parsePatterns:wQ,defaultParseWidth:"any",valueCallback:e=>e+1}),month:wu({matchPatterns:SQ,defaultMatchWidth:"wide",parsePatterns:jQ,defaultParseWidth:"any"}),day:wu({matchPatterns:OQ,defaultMatchWidth:"wide",parsePatterns:EQ,defaultParseWidth:"any"}),dayPeriod:wu({matchPatterns:_Q,defaultMatchWidth:"any",parsePatterns:AQ,defaultParseWidth:"any"})},EL={code:"en-US",formatDistance:ZX,formatLong:nQ,formatRelative:aQ,localize:dQ,match:NQ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function CQ(e,t){const n=sn(e,t?.in);return IX(n,XX(n))+1}function TQ(e,t){const n=sn(e,t?.in),r=+Sm(n)-+LX(n);return Math.round(r/jL)+1}function _L(e,t){const n=sn(e,t?.in),r=n.getFullYear(),i=Yf(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,l=li(t?.in||e,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const f=Zu(l,t),d=li(t?.in||e,0);d.setFullYear(r,0,o),d.setHours(0,0,0,0);const h=Zu(d,t);return+n>=+f?r+1:+n>=+h?r:r-1}function MQ(e,t){const n=Yf(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=_L(e,t),o=li(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Zu(o,t)}function RQ(e,t){const n=sn(e,t?.in),r=+Zu(n,t)-+MQ(n,t);return Math.round(r/jL)+1}function dt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Vi={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return dt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):dt(n+1,2)},d(e,t){return dt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return dt(e.getHours()%12||12,t.length)},H(e,t){return dt(e.getHours(),t.length)},m(e,t){return dt(e.getMinutes(),t.length)},s(e,t){return dt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return dt(i,t.length)}},hl={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tT={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Vi.y(e,t)},Y:function(e,t,n,r){const i=_L(e,r),o=i>0?i:1-i;if(t==="YY"){const l=o%100;return dt(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):dt(o,t.length)},R:function(e,t){const n=OL(e);return dt(n,t.length)},u:function(e,t){const n=e.getFullYear();return dt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return dt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return dt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Vi.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return dt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=RQ(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):dt(i,t.length)},I:function(e,t,n){const r=TQ(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):dt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Vi.d(e,t)},D:function(e,t,n){const r=CQ(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):dt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return dt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return dt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return dt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=hl.noon:r===0?i=hl.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=hl.evening:r>=12?i=hl.afternoon:r>=4?i=hl.morning:i=hl.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Vi.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Vi.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):dt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):dt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Vi.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Vi.s(e,t)},S:function(e,t){return Vi.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return rT(r);case"XXXX":case"XX":return Uo(r);case"XXXXX":case"XXX":default:return Uo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return rT(r);case"xxxx":case"xx":return Uo(r);case"xxxxx":case"xxx":default:return Uo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nT(r,":");case"OOOO":default:return"GMT"+Uo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nT(r,":");case"zzzz":default:return"GMT"+Uo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return dt(r,t.length)},T:function(e,t,n){return dt(+e,t.length)}};function nT(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+dt(o,2)}function rT(e,t){return e%60===0?(e>0?"-":"+")+dt(Math.abs(e)/60,2):Uo(e,t)}function Uo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=dt(Math.trunc(r/60),2),o=dt(r%60,2);return n+i+t+o}const aT=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},AL=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},DQ=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return aT(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",aT(r,t)).replace("{{time}}",AL(i,t))},PQ={p:AL,P:DQ},kQ=/^D+$/,$Q=/^Y+$/,IQ=["D","DD","YY","YYYY"];function LQ(e){return kQ.test(e)}function zQ(e){return $Q.test(e)}function BQ(e,t,n){const r=qQ(e,t,n);if(console.warn(r),IQ.includes(e))throw new RangeError(r)}function qQ(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const UQ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,HQ=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FQ=/^'([^]*?)'?$/,GQ=/''/g,VQ=/[a-zA-Z]/;function oS(e,t,n){const r=Yf(),i=r.locale??EL,o=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,f=sn(e,n?.in);if(!qX(f))throw new RangeError("Invalid time value");let d=t.match(HQ).map(v=>{const m=v[0];if(m==="p"||m==="P"){const g=PQ[m];return g(v,i.formatLong)}return v}).join("").match(UQ).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const m=v[0];if(m==="'")return{isToken:!1,value:YQ(v)};if(tT[m])return{isToken:!0,value:v};if(m.match(VQ))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:v}});i.localize.preprocessor&&(d=i.localize.preprocessor(f,d));const h={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return d.map(v=>{if(!v.isToken)return v.value;const m=v.value;(zQ(m)||LQ(m))&&BQ(m,t,String(e));const g=tT[m[0]];return g(f,m,i.localize,h)}).join("")}function YQ(e){const t=e.match(FQ);return t?t[1].replace(GQ,"'"):e}function WQ(e,t,n){const r=Yf(),i=n?.locale??r.locale??EL,o=2520,l=Qh(e,t);if(isNaN(l))throw new RangeError("Invalid time value");const f=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:l}),[d,h]=nv(n?.in,...l>0?[t,e]:[e,t]),v=KX(h,d),m=(jm(h)-jm(d))/1e3,g=Math.round((v-m)/60);let x;if(g<2)return n?.includeSeconds?v<5?i.formatDistance("lessThanXSeconds",5,f):v<10?i.formatDistance("lessThanXSeconds",10,f):v<20?i.formatDistance("lessThanXSeconds",20,f):v<40?i.formatDistance("halfAMinute",0,f):v<60?i.formatDistance("lessThanXMinutes",1,f):i.formatDistance("xMinutes",1,f):g===0?i.formatDistance("lessThanXMinutes",1,f):i.formatDistance("xMinutes",g,f);if(g<45)return i.formatDistance("xMinutes",g,f);if(g<90)return i.formatDistance("aboutXHours",1,f);if(g<ZC){const O=Math.round(g/60);return i.formatDistance("aboutXHours",O,f)}else{if(g<o)return i.formatDistance("xDays",1,f);if(g<Nh){const O=Math.round(g/ZC);return i.formatDistance("xDays",O,f)}else if(g<Nh*2)return x=Math.round(g/Nh),i.formatDistance("aboutXMonths",x,f)}if(x=WX(h,d),x<12){const O=Math.round(g/Nh);return i.formatDistance("xMonths",O,f)}else{const O=x%12,j=Math.trunc(x/12);return O<3?i.formatDistance("aboutXYears",j,f):O<9?i.formatDistance("overXYears",j,f):i.formatDistance("almostXYears",j+1,f)}}function KQ(e,t){return WQ(e,zX(e),t)}function rv({starred:e,onToggle:t,className:n,variant:r="ghost",size:i="icon",label:o}){const[l,f]=S.useState(!1),d=async h=>{h.stopPropagation(),f(!0);try{await Promise.all([t(),new Promise(v=>setTimeout(v,150))])}finally{f(!1)}};return c.jsxs(Ce,{className:ha("transition-all",n),disabled:l,onClick:d,size:i,variant:r,children:[l?c.jsx(fa,{className:ha("animate-spin",o?"mr-1.5 h-4 w-4":"h-4 w-4")}):c.jsx(b$,{className:ha("transition-colors",o?"mr-1.5 h-4 w-4":"h-4 w-4",e?"fill-yellow-500 text-yellow-500":"text-muted-foreground")}),o,!o&&c.jsx("span",{className:"sr-only",children:e?"Unstar":"Star"})]})}function XQ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function NL(e){return e.split(".").pop()?.toLowerCase()||""}function QQ(e,t){if(e?.startsWith("image/"))return!0;const n=t?NL(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function ZQ({file:e,onClose:t,onToggleStar:n,onDelete:r}){const i=e.key.split("/").pop()||e.key,o=NL(i),l=QQ(e.contentType,i),f=()=>{const d=document.createElement("a");d.href=e.url,d.download=i,d.target="_blank",d.click()};return c.jsx(MO,{onOpenChange:d=>!d&&t(),open:!0,children:c.jsx(RO,{className:"max-h-[90vh] max-w-4xl overflow-y-auto [&>button]:hidden",children:c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("h2",{className:"font-bold text-2xl",children:i}),e.key!==i&&c.jsx("p",{className:"mt-1 text-muted-foreground text-sm",children:e.key})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(rv,{onToggle:()=>n(e.key,!e.starred),starred:e.starred,variant:"outline"}),c.jsx(xL,{onDelete:()=>r(e.key)}),c.jsx(Ce,{onClick:t,size:"icon",variant:"outline",children:c.jsx(or,{className:"h-4 w-4"})})]})]}),c.jsx("div",{className:"aspect-video overflow-hidden rounded-lg bg-muted",children:l&&e.url.startsWith("https://")?c.jsx("img",{alt:i,className:"h-full w-full object-contain",src:e.url}):c.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2",children:[l?c.jsx(Bj,{className:"h-16 w-16 text-muted-foreground/50"}):c.jsx(qj,{className:"h-16 w-16 text-muted-foreground/50"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Preview not available"})]})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(ma,{className:"flex-1",label:"Copy CDN URL",size:"default",value:e.url,variant:"default"}),c.jsxs(Ce,{className:"flex-1 gap-2 bg-transparent",onClick:()=>window.open(e.url,"_blank"),variant:"outline",children:[c.jsx(Hu,{className:"h-4 w-4"}),"Open in New Tab"]}),c.jsxs(Ce,{className:"flex-1 gap-2 bg-transparent",onClick:f,variant:"outline",children:[c.jsx(XH,{className:"h-4 w-4"}),"Download"]})]}),c.jsx(Vt,{}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"File Information"}),c.jsxs("dl",{className:"space-y-2 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Format"}),c.jsx("dd",{className:"font-medium",children:c.jsx(Be,{variant:"secondary",children:o.toUpperCase()})})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Size"}),c.jsx("dd",{className:"font-medium",children:XQ(e.size)})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Content Type"}),c.jsx("dd",{className:"font-medium",children:e.contentType||"Unknown"})]})]})]})}),c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"Metadata"}),c.jsxs("dl",{className:"space-y-2 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Last Modified"}),c.jsx("dd",{className:"font-medium",children:oS(new Date(e.lastModified),"MMM d, yyyy 'at' h:mm a")})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Starred"}),c.jsx("dd",{className:"font-medium",children:e.starred?"Yes":"No"})]}),e.tags.length>0&&c.jsxs("div",{children:[c.jsx("dt",{className:"mb-1 text-muted-foreground",children:"Tags"}),c.jsx("dd",{className:"flex flex-wrap gap-1",children:e.tags.filter(d=>d.key!=="starred").map(d=>c.jsxs(Be,{variant:"secondary",children:[d.key,": ",d.value]},d.key))})]})]})]})})]}),c.jsx(Vt,{}),c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"CDN URL"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("code",{className:"flex-1 break-all rounded bg-muted px-3 py-2 text-sm",children:e.url}),c.jsx(ma,{size:"sm",value:e.url})]})]})]})})})}function av(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var iv="Checkbox",[JQ]=jn(iv),[eZ,DO]=JQ(iv);function tZ(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:l,name:f,onCheckedChange:d,required:h,value:v="on",internal_do_not_use_render:m}=e,[g,x]=An({prop:n,defaultProp:i??!1,onChange:d,caller:iv}),[O,j]=S.useState(null),[b,E]=S.useState(null),_=S.useRef(!1),A=O?!!l||!!O.closest("form"):!0,C={checked:g,disabled:o,setChecked:x,control:O,setControl:j,name:f,form:l,value:v,hasConsumerStoppedPropagationRef:_,required:h,defaultChecked:Qi(i)?!1:i,isFormControl:A,bubbleInput:b,setBubbleInput:E};return c.jsx(eZ,{scope:t,...C,children:nZ(m)?m(C):r})}var CL="CheckboxTrigger",TL=S.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:l,disabled:f,checked:d,required:h,setControl:v,setChecked:m,hasConsumerStoppedPropagationRef:g,isFormControl:x,bubbleInput:O}=DO(CL,e),j=Ue(i,v),b=S.useRef(d);return S.useEffect(()=>{const E=o?.form;if(E){const _=()=>m(b.current);return E.addEventListener("reset",_),()=>E.removeEventListener("reset",_)}},[o,m]),c.jsx(Ae.button,{type:"button",role:"checkbox","aria-checked":Qi(d)?"mixed":d,"aria-required":h,"data-state":$L(d),"data-disabled":f?"":void 0,disabled:f,value:l,...r,ref:j,onKeyDown:ge(t,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:ge(n,E=>{m(_=>Qi(_)?!0:!_),O&&x&&(g.current=E.isPropagationStopped(),g.current||E.stopPropagation())})})});TL.displayName=CL;var ML=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:l,disabled:f,value:d,onCheckedChange:h,form:v,...m}=e;return c.jsx(tZ,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:f,required:l,onCheckedChange:h,name:r,form:v,value:d,internal_do_not_use_render:({isFormControl:g})=>c.jsxs(c.Fragment,{children:[c.jsx(TL,{...m,ref:t,__scopeCheckbox:n}),g&&c.jsx(kL,{__scopeCheckbox:n})]})})});ML.displayName=iv;var RL="CheckboxIndicator",DL=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=DO(RL,n);return c.jsx(Nn,{present:r||Qi(o.checked)||o.checked===!0,children:c.jsx(Ae.span,{"data-state":$L(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});DL.displayName=RL;var PL="CheckboxBubbleInput",kL=S.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:l,required:f,disabled:d,name:h,value:v,form:m,bubbleInput:g,setBubbleInput:x}=DO(PL,e),O=Ue(n,x),j=av(o),b=zp(r);S.useEffect(()=>{const _=g;if(!_)return;const A=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(A,"checked").set,M=!i.current;if(j!==o&&N){const R=new Event("click",{bubbles:M});_.indeterminate=Qi(o),N.call(_,Qi(o)?!1:o),_.dispatchEvent(R)}},[g,j,o,i]);const E=S.useRef(Qi(o)?!1:o);return c.jsx(Ae.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??E.current,required:f,disabled:d,name:h,value:v,form:m,...t,tabIndex:-1,ref:O,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});kL.displayName=PL;function nZ(e){return typeof e=="function"}function Qi(e){return e==="indeterminate"}function $L(e){return Qi(e)?"indeterminate":e?"checked":"unchecked"}function sS({className:e,...t}){return c.jsx(ML,{className:pe("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:data-[state=checked]:bg-primary dark:aria-invalid:ring-destructive/40",e),"data-slot":"checkbox",...t,children:c.jsx(DL,{className:"grid place-content-center text-current transition-none","data-slot":"checkbox-indicator",children:c.jsx(ai,{className:"size-3.5"})})})}function rZ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function IL(e){return e.split(".").pop()?.toLowerCase()||""}function aZ(e,t){if(e?.startsWith("image/"))return!0;const n=t?IL(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function iZ({files:e,selectedFiles:t,onSelectFile:n,onToggleStar:r,onFileClick:i}){const o=(l,f)=>{l.stopPropagation(),window.open(f,"_blank")};return c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:e.map(l=>{const f=l.key.split("/").pop()||l.key,d=IL(f),h=aZ(l.contentType,f),v=t.includes(l.key);return c.jsxs("div",{className:"group relative cursor-pointer overflow-hidden rounded-xl bg-muted shadow-sm transition-shadow hover:shadow-md",onClick:()=>i(l),children:[c.jsx("div",{className:"flex aspect-square items-center justify-center",children:h&&l.url.startsWith("https://")?c.jsx("img",{alt:f,className:"h-full w-full object-cover",src:l.url}):c.jsx("div",{className:"flex h-full w-full items-center justify-center",children:h?c.jsx(Bj,{className:"h-12 w-12 text-muted-foreground/50"}):c.jsx(qj,{className:"h-12 w-12 text-muted-foreground/50"})})}),c.jsx(rv,{className:"absolute top-2 right-2 rounded-full bg-background/80 hover:bg-background/90",onToggle:()=>r(l.key,!l.starred),starred:l.starred}),c.jsxs(Te,{className:"gap-2 rounded-t-none border-none py-3 shadow-none",children:[c.jsxs(Me,{className:"gap-1 px-3 py-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{onClick:m=>m.stopPropagation(),children:c.jsx(sS,{checked:v,onCheckedChange:()=>n(l.key)})}),c.jsx(Le,{className:"min-w-0 flex-1 truncate text-sm",children:f})]}),c.jsxs(We,{className:"flex items-center gap-2 pl-6",children:[c.jsx(Be,{className:"rounded-sm text-[10px]",variant:"outline",children:d.toUpperCase()}),c.jsx("span",{className:"text-xs",children:rZ(l.size)})]})]}),c.jsxs(pX,{className:"justify-end gap-1 px-3 py-0 opacity-0 transition-opacity group-hover:opacity-100",children:[c.jsx(ma,{className:"h-7 px-2",label:"Copy",size:"sm",value:l.url,variant:"ghost"}),c.jsxs(Ce,{className:"h-7 px-2",onClick:m=>o(m,l.url),size:"sm",variant:"ghost",children:[c.jsx(Hu,{className:"mr-1 h-3 w-3"}),"Open"]})]})]})]},l.key)})})}var $x,ov="HoverCard",[LL]=jn(ov,[lo]),sv=lo(),[oZ,lv]=LL(ov),zL=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:l=700,closeDelay:f=300}=e,d=sv(t),h=S.useRef(0),v=S.useRef(0),m=S.useRef(!1),g=S.useRef(!1),[x,O]=An({prop:r,defaultProp:i??!1,onChange:o,caller:ov}),j=S.useCallback(()=>{clearTimeout(v.current),h.current=window.setTimeout(()=>O(!0),l)},[l,O]),b=S.useCallback(()=>{clearTimeout(h.current),!m.current&&!g.current&&(v.current=window.setTimeout(()=>O(!1),f))},[f,O]),E=S.useCallback(()=>O(!1),[O]);return S.useEffect(()=>()=>{clearTimeout(h.current),clearTimeout(v.current)},[]),c.jsx(oZ,{scope:t,open:x,onOpenChange:O,onOpen:j,onClose:b,onDismiss:E,hasSelectionRef:m,isPointerDownOnContentRef:g,children:c.jsx(Bp,{...d,children:n})})};zL.displayName=ov;var BL="HoverCardTrigger",qL=S.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=lv(BL,n),o=sv(n);return c.jsx(qp,{asChild:!0,...o,children:c.jsx(Ae.a,{"data-state":i.open?"open":"closed",...r,ref:t,onPointerEnter:ge(e.onPointerEnter,Em(i.onOpen)),onPointerLeave:ge(e.onPointerLeave,Em(i.onClose)),onFocus:ge(e.onFocus,i.onOpen),onBlur:ge(e.onBlur,i.onClose),onTouchStart:ge(e.onTouchStart,l=>l.preventDefault())})})});qL.displayName=BL;var PO="HoverCardPortal",[sZ,lZ]=LL(PO,{forceMount:void 0}),UL=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,o=lv(PO,t);return c.jsx(sZ,{scope:t,forceMount:n,children:c.jsx(Nn,{present:n||o.open,children:c.jsx(sc,{asChild:!0,container:i,children:r})})})};UL.displayName=PO;var Om="HoverCardContent",HL=S.forwardRef((e,t)=>{const n=lZ(Om,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=lv(Om,e.__scopeHoverCard);return c.jsx(Nn,{present:r||o.open,children:c.jsx(cZ,{"data-state":o.open?"open":"closed",...i,onPointerEnter:ge(e.onPointerEnter,Em(o.onOpen)),onPointerLeave:ge(e.onPointerLeave,Em(o.onClose)),ref:t})})});HL.displayName=Om;var cZ=S.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,...f}=e,d=lv(Om,n),h=sv(n),v=S.useRef(null),m=Ue(t,v),[g,x]=S.useState(!1);return S.useEffect(()=>{if(g){const O=document.body;return $x=O.style.userSelect||O.style.webkitUserSelect,O.style.userSelect="none",O.style.webkitUserSelect="none",()=>{O.style.userSelect=$x,O.style.webkitUserSelect=$x}}},[g]),S.useEffect(()=>{if(v.current){const O=()=>{x(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",O),()=>{document.removeEventListener("pointerup",O),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),S.useEffect(()=>{v.current&&dZ(v.current).forEach(j=>j.setAttribute("tabindex","-1"))}),c.jsx(oc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:ge(o,O=>{O.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(Up,{...h,...f,onPointerDown:ge(f.onPointerDown,O=>{O.currentTarget.contains(O.target)&&x(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:m,style:{...f.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),uZ="HoverCardArrow",fZ=S.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=sv(n);return c.jsx(Hp,{...i,...r,ref:t})});fZ.displayName=uZ;function Em(e){return t=>t.pointerType==="touch"?void 0:e()}function dZ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var hZ=zL,mZ=qL,pZ=UL,vZ=HL;function gZ({...e}){return c.jsx(hZ,{"data-slot":"hover-card",...e})}function yZ({...e}){return c.jsx(mZ,{"data-slot":"hover-card-trigger",...e})}function xZ({className:e,align:t="center",sideOffset:n=4,...r}){return c.jsx(pZ,{"data-slot":"hover-card-portal",children:c.jsx(vZ,{align:t,className:pe("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 w-64 origin-[--radix-hover-card-content-transform-origin] rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"hover-card-content",sideOffset:n,...r})})}function cv({className:e,...t}){return c.jsx("div",{className:"relative w-full overflow-x-auto","data-slot":"table-container",children:c.jsx("table",{className:pe("w-full caption-bottom text-sm",e),"data-slot":"table",...t})})}function uv({className:e,...t}){return c.jsx("thead",{className:pe("[&_tr]:border-b",e),"data-slot":"table-header",...t})}function fv({className:e,...t}){return c.jsx("tbody",{className:pe("[&_tr:last-child]:border-0",e),"data-slot":"table-body",...t})}function Fn({className:e,...t}){return c.jsx("tr",{className:pe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),"data-slot":"table-row",...t})}function Pt({className:e,...t}){return c.jsx("th",{className:pe("h-10 whitespace-nowrap px-2 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),"data-slot":"table-head",...t})}function ht({className:e,...t}){return c.jsx("td",{className:pe("whitespace-nowrap p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),"data-slot":"table-cell",...t})}function bZ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function FL(e){return e.split(".").pop()?.toLowerCase()||""}function wZ(e,t){if(e?.startsWith("image/"))return!0;const n=t?FL(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function SZ({files:e,selectedFiles:t,onSelectFile:n,onSelectAll:r,onToggleStar:i,onFileClick:o}){const l=(f,d)=>{f.stopPropagation(),window.open(d,"_blank")};return c.jsx("div",{className:"overflow-hidden rounded-lg border border-border",children:c.jsxs(cv,{children:[c.jsx(uv,{children:c.jsxs(Fn,{className:"bg-muted/50",children:[c.jsx(Pt,{className:"w-12",children:c.jsx(sS,{checked:t.length===e.length&&e.length>0,onCheckedChange:r})}),c.jsx(Pt,{className:"w-12"}),c.jsx(Pt,{children:"Name"}),c.jsx(Pt,{children:"Format"}),c.jsx(Pt,{children:"Size"}),c.jsx(Pt,{children:"Modified"}),c.jsx(Pt,{className:"w-24",children:"Actions"})]})}),c.jsx(fv,{children:e.map(f=>{const d=f.key.split("/").pop()||f.key,h=FL(d),v=wZ(f.contentType,d);return c.jsxs(Fn,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>o(f),children:[c.jsx(ht,{onClick:m=>m.stopPropagation(),children:c.jsx(sS,{checked:t.includes(f.key),onCheckedChange:()=>n(f.key)})}),c.jsx(ht,{onClick:m=>m.stopPropagation(),children:c.jsx(rv,{className:"h-8 w-8",onToggle:()=>i(f.key,!f.starred),starred:f.starred})}),c.jsx(ht,{children:c.jsxs("div",{className:"flex items-center gap-3",children:[v&&f.url.startsWith("https://")?c.jsxs(gZ,{closeDelay:200,openDelay:100,children:[c.jsx(yZ,{asChild:!0,children:c.jsx("div",{className:"h-10 w-14 shrink-0 cursor-pointer overflow-hidden rounded border bg-muted",children:c.jsx("img",{alt:d,className:"h-full w-full object-cover",src:f.url})})}),c.jsxs(xZ,{align:"start",className:"w-auto p-3",side:"right",children:[c.jsx("img",{alt:d,className:"max-h-[min(400px,40vh)] max-w-[min(400px,25vw)] rounded object-contain",src:f.url}),c.jsx("p",{className:"mt-2 max-w-[min(400px,25vw)] truncate text-center text-muted-foreground text-sm",children:d})]})]}):c.jsx("div",{className:"flex h-10 w-14 shrink-0 items-center justify-center overflow-hidden rounded border bg-muted",children:v?c.jsx(Bj,{className:"h-4 w-4 text-muted-foreground"}):c.jsx(qj,{className:"h-4 w-4 text-muted-foreground"})}),c.jsx("span",{className:"truncate font-medium",children:d})]})}),c.jsx(ht,{children:c.jsx(Be,{variant:"secondary",children:h.toUpperCase()})}),c.jsx(ht,{className:"text-muted-foreground",children:bZ(f.size)}),c.jsx(ht,{className:"text-muted-foreground text-xs",children:KQ(new Date(f.lastModified),{addSuffix:!0})}),c.jsx(ht,{onClick:m=>m.stopPropagation(),children:c.jsxs("div",{className:"flex gap-1",children:[c.jsx(ma,{className:"h-8 w-8",size:"icon",value:f.url,variant:"ghost"}),c.jsx(Ce,{className:"h-8 w-8",onClick:m=>l(m,f.url),size:"icon",variant:"ghost",children:c.jsx(Hu,{className:"h-3.5 w-3.5"})})]})})]},f.key)})})]})})}var dv="Collapsible",[jZ]=jn(dv),[OZ,kO]=jZ(dv),GL=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...f}=e,[d,h]=An({prop:r,defaultProp:i??!1,onChange:l,caller:dv});return c.jsx(OZ,{scope:n,disabled:o,contentId:Cr(),open:d,onOpenToggle:S.useCallback(()=>h(v=>!v),[h]),children:c.jsx(Ae.div,{"data-state":IO(d),"data-disabled":o?"":void 0,...f,ref:t})})});GL.displayName=dv;var VL="CollapsibleTrigger",YL=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=kO(VL,n);return c.jsx(Ae.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":IO(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:ge(e.onClick,i.onOpenToggle)})});YL.displayName=VL;var $O="CollapsibleContent",WL=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=kO($O,e.__scopeCollapsible);return c.jsx(Nn,{present:n||i.open,children:({present:o})=>c.jsx(EZ,{...r,ref:t,present:o})})});WL.displayName=$O;var EZ=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,l=kO($O,n),[f,d]=S.useState(r),h=S.useRef(null),v=Ue(t,h),m=S.useRef(0),g=m.current,x=S.useRef(0),O=x.current,j=l.open||f,b=S.useRef(j),E=S.useRef(void 0);return S.useEffect(()=>{const _=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(_)},[]),Wt(()=>{const _=h.current;if(_){E.current=E.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const A=_.getBoundingClientRect();m.current=A.height,x.current=A.width,b.current||(_.style.transitionDuration=E.current.transitionDuration,_.style.animationName=E.current.animationName),d(r)}},[l.open,r]),c.jsx(Ae.div,{"data-state":IO(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!j,...o,ref:v,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":O?`${O}px`:void 0,...e.style},children:j&&i})});function IO(e){return e?"open":"closed"}var _Z=GL;function ms({...e}){return c.jsx(_Z,{"data-slot":"collapsible",...e})}function ps({...e}){return c.jsx(YL,{"data-slot":"collapsible-trigger",...e})}function vs({...e}){return c.jsx(WL,{"data-slot":"collapsible-content",...e})}var AZ="Label",KL=S.forwardRef((e,t)=>c.jsx(us.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));KL.displayName=AZ;var NZ=KL;function Ho({className:e,...t}){return c.jsx(NZ,{className:pe("flex select-none items-center gap-2 font-medium text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",e),"data-slot":"label",...t})}function _m(e,[t,n]){return Math.min(n,Math.max(t,e))}var CZ=[" ","Enter","ArrowUp","ArrowDown"],TZ=[" ","Enter"],ns="Select",[hv,mv,MZ]=Qp(ns),[pc]=jn(ns,[MZ,lo]),pv=lo(),[RZ,uo]=pc(ns),[DZ,PZ]=pc(ns),XL=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:f,onValueChange:d,dir:h,name:v,autoComplete:m,disabled:g,required:x,form:O}=e,j=pv(t),[b,E]=S.useState(null),[_,A]=S.useState(null),[C,N]=S.useState(!1),M=hc(h),[R,D]=An({prop:r,defaultProp:i??!1,onChange:o,caller:ns}),[L,H]=An({prop:l,defaultProp:f,onChange:d,caller:ns}),B=S.useRef(null),U=b?O||!!b.closest("form"):!0,[Y,Z]=S.useState(new Set),X=Array.from(Y).map(k=>k.props.value).join(";");return c.jsx(Bp,{...j,children:c.jsxs(RZ,{required:x,scope:t,trigger:b,onTriggerChange:E,valueNode:_,onValueNodeChange:A,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:Cr(),value:L,onValueChange:H,open:R,onOpenChange:D,dir:M,triggerPointerDownPosRef:B,disabled:g,children:[c.jsx(hv.Provider,{scope:t,children:c.jsx(DZ,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(k=>{Z(q=>new Set(q).add(k))},[]),onNativeOptionRemove:S.useCallback(k=>{Z(q=>{const V=new Set(q);return V.delete(k),V})},[]),children:n})}),U?c.jsxs(y3,{"aria-hidden":!0,required:x,tabIndex:-1,name:v,autoComplete:m,value:L,onChange:k=>H(k.target.value),disabled:g,form:O,children:[L===void 0?c.jsx("option",{value:""}):null,Array.from(Y)]},X):null]})})};XL.displayName=ns;var QL="SelectTrigger",ZL=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=pv(n),l=uo(QL,n),f=l.disabled||r,d=Ue(t,l.onTriggerChange),h=mv(n),v=S.useRef("touch"),[m,g,x]=b3(j=>{const b=h().filter(A=>!A.disabled),E=b.find(A=>A.value===l.value),_=w3(b,j,E);_!==void 0&&l.onValueChange(_.value)}),O=j=>{f||(l.onOpenChange(!0),x()),j&&(l.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})};return c.jsx(qp,{asChild:!0,...o,children:c.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":x3(l.value)?"":void 0,...i,ref:d,onClick:ge(i.onClick,j=>{j.currentTarget.focus(),v.current!=="mouse"&&O(j)}),onPointerDown:ge(i.onPointerDown,j=>{v.current=j.pointerType;const b=j.target;b.hasPointerCapture(j.pointerId)&&b.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(O(j),j.preventDefault())}),onKeyDown:ge(i.onKeyDown,j=>{const b=m.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&g(j.key),!(b&&j.key===" ")&&CZ.includes(j.key)&&(O(),j.preventDefault())})})})});ZL.displayName=QL;var JL="SelectValue",e3=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...f}=e,d=uo(JL,n),{onValueNodeHasChildrenChange:h}=d,v=o!==void 0,m=Ue(t,d.onValueNodeChange);return Wt(()=>{h(v)},[h,v]),c.jsx(Ae.span,{...f,ref:m,style:{pointerEvents:"none"},children:x3(d.value)?c.jsx(c.Fragment,{children:l}):o})});e3.displayName=JL;var kZ="SelectIcon",t3=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(Ae.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});t3.displayName=kZ;var $Z="SelectPortal",n3=e=>c.jsx(sc,{asChild:!0,...e});n3.displayName=$Z;var rs="SelectContent",r3=S.forwardRef((e,t)=>{const n=uo(rs,e.__scopeSelect),[r,i]=S.useState();if(Wt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?$f.createPortal(c.jsx(a3,{scope:e.__scopeSelect,children:c.jsx(hv.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(i3,{...e,ref:t})});r3.displayName=rs;var Ur=10,[a3,fo]=pc(rs),IZ="SelectContentImpl",LZ=Rl("SelectContent.RemoveScroll"),i3=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:f,sideOffset:d,align:h,alignOffset:v,arrowPadding:m,collisionBoundary:g,collisionPadding:x,sticky:O,hideWhenDetached:j,avoidCollisions:b,...E}=e,_=uo(rs,n),[A,C]=S.useState(null),[N,M]=S.useState(null),R=Ue(t,oe=>C(oe)),[D,L]=S.useState(null),[H,B]=S.useState(null),U=mv(n),[Y,Z]=S.useState(!1),X=S.useRef(!1);S.useEffect(()=>{if(A)return Fj(A)},[A]),Hj();const k=S.useCallback(oe=>{const[me,...ie]=U().map(le=>le.ref.current),[ve]=ie.slice(-1),ye=document.activeElement;for(const le of oe)if(le===ye||(le?.scrollIntoView({block:"nearest"}),le===me&&N&&(N.scrollTop=0),le===ve&&N&&(N.scrollTop=N.scrollHeight),le?.focus(),document.activeElement!==ye))return},[U,N]),q=S.useCallback(()=>k([D,A]),[k,D,A]);S.useEffect(()=>{Y&&q()},[Y,q]);const{onOpenChange:V,triggerPointerDownPosRef:Q}=_;S.useEffect(()=>{if(A){let oe={x:0,y:0};const me=ve=>{oe={x:Math.abs(Math.round(ve.pageX)-(Q.current?.x??0)),y:Math.abs(Math.round(ve.pageY)-(Q.current?.y??0))}},ie=ve=>{oe.x<=10&&oe.y<=10?ve.preventDefault():A.contains(ve.target)||V(!1),document.removeEventListener("pointermove",me),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",ie,{capture:!0})}}},[A,V,Q]),S.useEffect(()=>{const oe=()=>V(!1);return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[V]);const[ee,z]=b3(oe=>{const me=U().filter(ye=>!ye.disabled),ie=me.find(ye=>ye.ref.current===document.activeElement),ve=w3(me,oe,ie);ve&&setTimeout(()=>ve.ref.current.focus())}),G=S.useCallback((oe,me,ie)=>{const ve=!X.current&&!ie;(_.value!==void 0&&_.value===me||ve)&&(L(oe),ve&&(X.current=!0))},[_.value]),$=S.useCallback(()=>A?.focus(),[A]),W=S.useCallback((oe,me,ie)=>{const ve=!X.current&&!ie;(_.value!==void 0&&_.value===me||ve)&&B(oe)},[_.value]),ae=r==="popper"?lS:o3,ce=ae===lS?{side:f,sideOffset:d,align:h,alignOffset:v,arrowPadding:m,collisionBoundary:g,collisionPadding:x,sticky:O,hideWhenDetached:j,avoidCollisions:b}:{};return c.jsx(a3,{scope:n,content:A,viewport:N,onViewportChange:M,itemRefCallback:G,selectedItem:D,onItemLeave:$,itemTextRefCallback:W,focusSelectedItem:q,selectedItemText:H,position:r,isPositioned:Y,searchRef:ee,children:c.jsx(Rp,{as:LZ,allowPinchZoom:!0,children:c.jsx(Tp,{asChild:!0,trapped:_.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:ge(i,oe=>{_.trigger?.focus({preventScroll:!0}),oe.preventDefault()}),children:c.jsx(oc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:c.jsx(ae,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:oe=>oe.preventDefault(),...E,...ce,onPlaced:()=>Z(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:ge(E.onKeyDown,oe=>{const me=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!me&&oe.key.length===1&&z(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let ve=U().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const ye=oe.target,le=ve.indexOf(ye);ve=ve.slice(le+1)}setTimeout(()=>k(ve)),oe.preventDefault()}})})})})})})});i3.displayName=IZ;var zZ="SelectItemAlignedPosition",o3=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=uo(rs,n),l=fo(rs,n),[f,d]=S.useState(null),[h,v]=S.useState(null),m=Ue(t,R=>v(R)),g=mv(n),x=S.useRef(!1),O=S.useRef(!0),{viewport:j,selectedItem:b,selectedItemText:E,focusSelectedItem:_}=l,A=S.useCallback(()=>{if(o.trigger&&o.valueNode&&f&&h&&j&&b&&E){const R=o.trigger.getBoundingClientRect(),D=h.getBoundingClientRect(),L=o.valueNode.getBoundingClientRect(),H=E.getBoundingClientRect();if(o.dir!=="rtl"){const ye=H.left-D.left,le=L.left-ye,Re=R.left-le,be=R.width+Re,qe=Math.max(be,D.width),rt=window.innerWidth-Ur,mt=_m(le,[Ur,Math.max(Ur,rt-qe)]);f.style.minWidth=be+"px",f.style.left=mt+"px"}else{const ye=D.right-H.right,le=window.innerWidth-L.right-ye,Re=window.innerWidth-R.right-le,be=R.width+Re,qe=Math.max(be,D.width),rt=window.innerWidth-Ur,mt=_m(le,[Ur,Math.max(Ur,rt-qe)]);f.style.minWidth=be+"px",f.style.right=mt+"px"}const B=g(),U=window.innerHeight-Ur*2,Y=j.scrollHeight,Z=window.getComputedStyle(h),X=parseInt(Z.borderTopWidth,10),k=parseInt(Z.paddingTop,10),q=parseInt(Z.borderBottomWidth,10),V=parseInt(Z.paddingBottom,10),Q=X+k+Y+V+q,ee=Math.min(b.offsetHeight*5,Q),z=window.getComputedStyle(j),G=parseInt(z.paddingTop,10),$=parseInt(z.paddingBottom,10),W=R.top+R.height/2-Ur,ae=U-W,ce=b.offsetHeight/2,oe=b.offsetTop+ce,me=X+k+oe,ie=Q-me;if(me<=W){const ye=B.length>0&&b===B[B.length-1].ref.current;f.style.bottom="0px";const le=h.clientHeight-j.offsetTop-j.offsetHeight,Re=Math.max(ae,ce+(ye?$:0)+le+q),be=me+Re;f.style.height=be+"px"}else{const ye=B.length>0&&b===B[0].ref.current;f.style.top="0px";const Re=Math.max(W,X+j.offsetTop+(ye?G:0)+ce)+ie;f.style.height=Re+"px",j.scrollTop=me-W+j.offsetTop}f.style.margin=`${Ur}px 0`,f.style.minHeight=ee+"px",f.style.maxHeight=U+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,o.trigger,o.valueNode,f,h,j,b,E,o.dir,r]);Wt(()=>A(),[A]);const[C,N]=S.useState();Wt(()=>{h&&N(window.getComputedStyle(h).zIndex)},[h]);const M=S.useCallback(R=>{R&&O.current===!0&&(A(),_?.(),O.current=!1)},[A,_]);return c.jsx(qZ,{scope:n,contentWrapper:f,shouldExpandOnScrollRef:x,onScrollButtonChange:M,children:c.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(Ae.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});o3.displayName=zZ;var BZ="SelectPopperPosition",lS=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ur,...o}=e,l=pv(n);return c.jsx(Up,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});lS.displayName=BZ;var[qZ,LO]=pc(rs,{}),cS="SelectViewport",s3=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=fo(cS,n),l=LO(cS,n),f=Ue(t,o.onViewportChange),d=S.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(hv.Slot,{scope:n,children:c.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ge(i.onScroll,h=>{const v=h.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=l;if(g?.current&&m){const x=Math.abs(d.current-v.scrollTop);if(x>0){const O=window.innerHeight-Ur*2,j=parseFloat(m.style.minHeight),b=parseFloat(m.style.height),E=Math.max(j,b);if(E<O){const _=E+x,A=Math.min(O,_),C=_-A;m.style.height=A+"px",m.style.bottom==="0px"&&(v.scrollTop=C>0?C:0,m.style.justifyContent="flex-end")}}}d.current=v.scrollTop})})})]})});s3.displayName=cS;var l3="SelectGroup",[UZ,HZ]=pc(l3),FZ=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Cr();return c.jsx(UZ,{scope:n,id:i,children:c.jsx(Ae.div,{role:"group","aria-labelledby":i,...r,ref:t})})});FZ.displayName=l3;var c3="SelectLabel",GZ=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=HZ(c3,n);return c.jsx(Ae.div,{id:i.id,...r,ref:t})});GZ.displayName=c3;var Am="SelectItem",[VZ,u3]=pc(Am),f3=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,f=uo(Am,n),d=fo(Am,n),h=f.value===r,[v,m]=S.useState(o??""),[g,x]=S.useState(!1),O=Ue(t,_=>d.itemRefCallback?.(_,r,i)),j=Cr(),b=S.useRef("touch"),E=()=>{i||(f.onValueChange(r),f.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(VZ,{scope:n,value:r,disabled:i,textId:j,isSelected:h,onItemTextChange:S.useCallback(_=>{m(A=>A||(_?.textContent??"").trim())},[]),children:c.jsx(hv.ItemSlot,{scope:n,value:r,disabled:i,textValue:v,children:c.jsx(Ae.div,{role:"option","aria-labelledby":j,"data-highlighted":g?"":void 0,"aria-selected":h&&g,"data-state":h?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:O,onFocus:ge(l.onFocus,()=>x(!0)),onBlur:ge(l.onBlur,()=>x(!1)),onClick:ge(l.onClick,()=>{b.current!=="mouse"&&E()}),onPointerUp:ge(l.onPointerUp,()=>{b.current==="mouse"&&E()}),onPointerDown:ge(l.onPointerDown,_=>{b.current=_.pointerType}),onPointerMove:ge(l.onPointerMove,_=>{b.current=_.pointerType,i?d.onItemLeave?.():b.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ge(l.onPointerLeave,_=>{_.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:ge(l.onKeyDown,_=>{d.searchRef?.current!==""&&_.key===" "||(TZ.includes(_.key)&&E(),_.key===" "&&_.preventDefault())})})})})});f3.displayName=Am;var Ru="SelectItemText",d3=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=uo(Ru,n),f=fo(Ru,n),d=u3(Ru,n),h=PZ(Ru,n),[v,m]=S.useState(null),g=Ue(t,E=>m(E),d.onItemTextChange,E=>f.itemTextRefCallback?.(E,d.value,d.disabled)),x=v?.textContent,O=S.useMemo(()=>c.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:j,onNativeOptionRemove:b}=h;return Wt(()=>(j(O),()=>b(O)),[j,b,O]),c.jsxs(c.Fragment,{children:[c.jsx(Ae.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?$f.createPortal(o.children,l.valueNode):null]})});d3.displayName=Ru;var h3="SelectItemIndicator",m3=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u3(h3,n).isSelected?c.jsx(Ae.span,{"aria-hidden":!0,...r,ref:t}):null});m3.displayName=h3;var uS="SelectScrollUpButton",p3=S.forwardRef((e,t)=>{const n=fo(uS,e.__scopeSelect),r=LO(uS,e.__scopeSelect),[i,o]=S.useState(!1),l=Ue(t,r.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let f=function(){const h=d.scrollTop>0;o(h)};const d=n.viewport;return f(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),i?c.jsx(g3,{...e,ref:l,onAutoScroll:()=>{const{viewport:f,selectedItem:d}=n;f&&d&&(f.scrollTop=f.scrollTop-d.offsetHeight)}}):null});p3.displayName=uS;var fS="SelectScrollDownButton",v3=S.forwardRef((e,t)=>{const n=fo(fS,e.__scopeSelect),r=LO(fS,e.__scopeSelect),[i,o]=S.useState(!1),l=Ue(t,r.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let f=function(){const h=d.scrollHeight-d.clientHeight,v=Math.ceil(d.scrollTop)<h;o(v)};const d=n.viewport;return f(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),i?c.jsx(g3,{...e,ref:l,onAutoScroll:()=>{const{viewport:f,selectedItem:d}=n;f&&d&&(f.scrollTop=f.scrollTop+d.offsetHeight)}}):null});v3.displayName=fS;var g3=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=fo("SelectScrollButton",n),l=S.useRef(null),f=mv(n),d=S.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return S.useEffect(()=>()=>d(),[d]),Wt(()=>{f().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),c.jsx(Ae.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ge(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ge(i.onPointerMove,()=>{o.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ge(i.onPointerLeave,()=>{d()})})}),YZ="SelectSeparator",WZ=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ae.div,{"aria-hidden":!0,...r,ref:t})});WZ.displayName=YZ;var dS="SelectArrow",KZ=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pv(n),o=uo(dS,n),l=fo(dS,n);return o.open&&l.position==="popper"?c.jsx(Hp,{...i,...r,ref:t}):null});KZ.displayName=dS;var XZ="SelectBubbleInput",y3=S.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=S.useRef(null),o=Ue(r,i),l=av(t);return S.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&v){const m=new Event("change",{bubbles:!0});v.call(f,t),f.dispatchEvent(m)}},[l,t]),c.jsx(Ae.select,{...n,style:{...xI,...n.style},ref:o,defaultValue:t})});y3.displayName=XZ;function x3(e){return e===""||e===void 0}function b3(e){const t=Wr(e),n=S.useRef(""),r=S.useRef(0),i=S.useCallback(l=>{const f=n.current+l;t(f),(function d(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(f)},[t]),o=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function w3(e,t,n){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=QZ(e,Math.max(o,0));i.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.textValue.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function QZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ZZ=XL,JZ=ZL,eJ=e3,tJ=t3,nJ=n3,rJ=r3,aJ=s3,iJ=f3,oJ=d3,sJ=m3,lJ=p3,cJ=v3;function ga({...e}){return c.jsx(ZZ,{"data-slot":"select",...e})}function ya({...e}){return c.jsx(eJ,{"data-slot":"select-value",...e})}function xa({className:e,size:t="default",children:n,...r}){return c.jsxs(JZ,{className:pe("flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-size":t,"data-slot":"select-trigger",...r,children:[n,c.jsx(tJ,{asChild:!0,children:c.jsx(oo,{className:"size-4 opacity-50"})})]})}function ba({className:e,children:t,position:n="popper",align:r="center",...i}){return c.jsx(nJ,{children:c.jsxs(rJ,{align:r,className:pe("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 relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] origin-[--radix-select-content-transform-origin] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",n==="popper"&&"data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1",e),"data-slot":"select-content",position:n,...i,children:[c.jsx(uJ,{}),c.jsx(aJ,{className:pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),c.jsx(fJ,{})]})})}function Fe({className:e,children:t,...n}){return c.jsxs(iJ,{className:pe("relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),"data-slot":"select-item",...n,children:[c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(sJ,{children:c.jsx(ai,{className:"size-4"})})}),c.jsx(oJ,{children:t})]})}function uJ({className:e,...t}){return c.jsx(lJ,{className:pe("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...t,children:c.jsx(ac,{className:"size-4"})})}function fJ({className:e,...t}){return c.jsx(cJ,{className:pe("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...t,children:c.jsx(oo,{className:"size-4"})})}var S3=["PageUp","PageDown"],j3=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],O3={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},vc="Slider",[hS,dJ,hJ]=Qp(vc),[E3]=jn(vc,[hJ]),[mJ,vv]=E3(vc),_3=S.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:f=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[r],value:v,onValueChange:m=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:O,...j}=e,b=S.useRef(new Set),E=S.useRef(0),A=l==="horizontal"?pJ:vJ,[C=[],N]=An({prop:v,defaultProp:h,onChange:B=>{[...b.current][E.current]?.focus(),m(B)}}),M=S.useRef(C);function R(B){const U=wJ(C,B);H(B,U)}function D(B){H(B,E.current)}function L(){const B=M.current[E.current];C[E.current]!==B&&g(C)}function H(B,U,{commit:Y}={commit:!1}){const Z=EJ(o),X=_J(Math.round((B-r)/o)*o+r,Z),k=_m(X,[r,i]);N((q=[])=>{const V=xJ(q,k,U);if(OJ(V,d*o)){E.current=V.indexOf(k);const Q=String(V)!==String(q);return Q&&Y&&g(V),Q?V:q}else return q})}return c.jsx(mJ,{scope:e.__scopeSlider,name:n,disabled:f,min:r,max:i,valueIndexToChangeRef:E,thumbs:b.current,values:C,orientation:l,form:O,children:c.jsx(hS.Provider,{scope:e.__scopeSlider,children:c.jsx(hS.Slot,{scope:e.__scopeSlider,children:c.jsx(A,{"aria-disabled":f,"data-disabled":f?"":void 0,...j,ref:t,onPointerDown:ge(j.onPointerDown,()=>{f||(M.current=C)}),min:r,max:i,inverted:x,onSlideStart:f?void 0:R,onSlideMove:f?void 0:D,onSlideEnd:f?void 0:L,onHomeKeyDown:()=>!f&&H(r,0,{commit:!0}),onEndKeyDown:()=>!f&&H(i,C.length-1,{commit:!0}),onStepKeyDown:({event:B,direction:U})=>{if(!f){const X=S3.includes(B.key)||B.shiftKey&&j3.includes(B.key)?10:1,k=E.current,q=C[k],V=o*X*U;H(q+V,k,{commit:!0})}}})})})})});_3.displayName=vc;var[A3,N3]=E3(vc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),pJ=S.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:f,onSlideEnd:d,onStepKeyDown:h,...v}=e,[m,g]=S.useState(null),x=Ue(t,A=>g(A)),O=S.useRef(void 0),j=hc(i),b=j==="ltr",E=b&&!o||!b&&o;function _(A){const C=O.current||m.getBoundingClientRect(),N=[0,C.width],R=zO(N,E?[n,r]:[r,n]);return O.current=C,R(A-C.left)}return c.jsx(A3,{scope:e.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:c.jsx(C3,{dir:j,"data-orientation":"horizontal",...v,ref:x,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:A=>{const C=_(A.clientX);l?.(C)},onSlideMove:A=>{const C=_(A.clientX);f?.(C)},onSlideEnd:()=>{O.current=void 0,d?.()},onStepKeyDown:A=>{const N=O3[E?"from-left":"from-right"].includes(A.key);h?.({event:A,direction:N?-1:1})}})})}),vJ=S.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:f,onStepKeyDown:d,...h}=e,v=S.useRef(null),m=Ue(t,v),g=S.useRef(void 0),x=!i;function O(j){const b=g.current||v.current.getBoundingClientRect(),E=[0,b.height],A=zO(E,x?[r,n]:[n,r]);return g.current=b,A(j-b.top)}return c.jsx(A3,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:c.jsx(C3,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:j=>{const b=O(j.clientY);o?.(b)},onSlideMove:j=>{const b=O(j.clientY);l?.(b)},onSlideEnd:()=>{g.current=void 0,f?.()},onStepKeyDown:j=>{const E=O3[x?"from-bottom":"from-top"].includes(j.key);d?.({event:j,direction:E?-1:1})}})})}),C3=S.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:f,onStepKeyDown:d,...h}=e,v=vv(vc,n);return c.jsx(Ae.span,{...h,ref:t,onKeyDown:ge(e.onKeyDown,m=>{m.key==="Home"?(l(m),m.preventDefault()):m.key==="End"?(f(m),m.preventDefault()):S3.concat(j3).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:ge(e.onPointerDown,m=>{const g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),v.thumbs.has(g)?g.focus():r(m)}),onPointerMove:ge(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:ge(e.onPointerUp,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),o(m))})})}),T3="SliderTrack",M3=S.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=vv(T3,n);return c.jsx(Ae.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});M3.displayName=T3;var mS="SliderRange",R3=S.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=vv(mS,n),o=N3(mS,n),l=S.useRef(null),f=Ue(t,l),d=i.values.length,h=i.values.map(g=>k3(g,i.min,i.max)),v=d>1?Math.min(...h):0,m=100-Math.max(...h);return c.jsx(Ae.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:f,style:{...e.style,[o.startEdge]:v+"%",[o.endEdge]:m+"%"}})});R3.displayName=mS;var pS="SliderThumb",D3=S.forwardRef((e,t)=>{const n=dJ(e.__scopeSlider),[r,i]=S.useState(null),o=Ue(t,f=>i(f)),l=S.useMemo(()=>r?n().findIndex(f=>f.ref.current===r):-1,[n,r]);return c.jsx(gJ,{...e,ref:o,index:l})}),gJ=S.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=vv(pS,n),f=N3(pS,n),[d,h]=S.useState(null),v=Ue(t,_=>h(_)),m=d?l.form||!!d.closest("form"):!0,g=zp(d),x=l.values[r],O=x===void 0?0:k3(x,l.min,l.max),j=bJ(r,l.values.length),b=g?.[f.size],E=b?SJ(b,O,f.direction):0;return S.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${O}% + ${E}px)`},children:[c.jsx(hS.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(Ae.span,{role:"slider","aria-label":e["aria-label"]||j,"aria-valuemin":l.min,"aria-valuenow":x,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:v,style:x===void 0?{display:"none"}:e.style,onFocus:ge(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),m&&c.jsx(P3,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:x},r)]})});D3.displayName=pS;var yJ="RadioBubbleInput",P3=S.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=S.useRef(null),o=Ue(i,r),l=av(t);return S.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&v){const m=new Event("input",{bubbles:!0});v.call(f,t),f.dispatchEvent(m)}},[l,t]),c.jsx(Ae.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});P3.displayName=yJ;function xJ(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function k3(e,t,n){const o=100/(n-t)*(e-t);return _m(o,[0,100])}function bJ(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function wJ(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function SJ(e,t,n){const r=e/2,o=zO([0,50],[0,r]);return(r-o(t)*n)*n}function jJ(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function OJ(e,t){if(t>0){const n=jJ(e);return Math.min(...n)>=t}return!0}function zO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function EJ(e){return(String(e).split(".")[1]||"").length}function _J(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var AJ=_3,NJ=M3,CJ=R3,TJ=D3;function MJ({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...o}){const l=S.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,i],[n,t,r,i]);return c.jsxs(AJ,{className:pe("relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",e),"data-slot":"slider",defaultValue:t,max:i,min:r,value:n,...o,children:[c.jsx(NJ,{className:pe("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5"),"data-slot":"slider-track",children:c.jsx(CJ,{className:pe("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"),"data-slot":"slider-range"})}),Array.from({length:l.length},(f,d)=>c.jsx(TJ,{className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50","data-slot":"slider-thumb"},`thumb-${d}`))]})}var gv="Switch",[RJ]=jn(gv),[DJ,PJ]=RJ(gv),$3=S.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:l,disabled:f,value:d="on",onCheckedChange:h,form:v,...m}=e,[g,x]=S.useState(null),O=Ue(t,A=>x(A)),j=S.useRef(!1),b=g?v||!!g.closest("form"):!0,[E,_]=An({prop:i,defaultProp:o??!1,onChange:h,caller:gv});return c.jsxs(DJ,{scope:n,checked:E,disabled:f,children:[c.jsx(Ae.button,{type:"button",role:"switch","aria-checked":E,"aria-required":l,"data-state":B3(E),"data-disabled":f?"":void 0,disabled:f,value:d,...m,ref:O,onClick:ge(e.onClick,A=>{_(C=>!C),b&&(j.current=A.isPropagationStopped(),j.current||A.stopPropagation())})}),b&&c.jsx(z3,{control:g,bubbles:!j.current,name:r,value:d,checked:E,required:l,disabled:f,form:v,style:{transform:"translateX(-100%)"}})]})});$3.displayName=gv;var I3="SwitchThumb",L3=S.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=PJ(I3,n);return c.jsx(Ae.span,{"data-state":B3(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});L3.displayName=I3;var kJ="SwitchBubbleInput",z3=S.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const l=S.useRef(null),f=Ue(l,o),d=av(n),h=zp(t);return S.useEffect(()=>{const v=l.current;if(!v)return;const m=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(m,"checked").set;if(d!==n&&x){const O=new Event("click",{bubbles:r});x.call(v,n),v.dispatchEvent(O)}},[d,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:f,style:{...i.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});z3.displayName=kJ;function B3(e){return e?"checked":"unchecked"}var $J=$3,IJ=L3;function LJ({className:e,...t}){return c.jsx($J,{className:pe("peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",e),"data-slot":"switch",...t,children:c.jsx(IJ,{className:pe("pointer-events-none block size-4 rounded-full bg-background ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground"),"data-slot":"switch-thumb"})})}async function iT(e){try{const t=document.createElement("canvas");return t.width=1,t.height=1,t.toDataURL(e).startsWith(`data:${e}`)}catch{return!1}}async function zJ(){const[e,t]=await Promise.all([iT("image/webp"),iT("image/avif")]);return{webp:e,avif:t,offscreenCanvas:typeof OffscreenCanvas<"u",webWorker:typeof Worker<"u",wasm:typeof WebAssembly<"u"}}let Ch=null;async function BJ(){return Ch||(Ch=await zJ(),Ch)}async function qJ(e){if(e.type!=="image/gif")return{isAnimated:!1,frameCount:1,size:e.size};try{const t=await e.arrayBuffer(),n=new Uint8Array(t);let r=0;for(let i=0;i<n.length-2;i++)n[i]===33&&n[i+1]===249&&r++;return{isAnimated:r>1,frameCount:Math.max(1,r),size:e.size}}catch{return{isAnimated:!1,frameCount:1,size:e.size}}}function UJ(e){return e.type==="image/gif"}function HJ(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(new Error("Failed to read blob")),r.readAsDataURL(e)})}function q3(e){return HJ(e)}function Th(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/t**r).toFixed(1))} ${n[r]}`}function FJ(e){return new Promise((t,n)=>{const r=new Image,i=URL.createObjectURL(e);r.onload=()=>{URL.revokeObjectURL(i),t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=()=>{URL.revokeObjectURL(i),n(new Error("Failed to load image"))},r.src=i})}class GJ{worker=null;pending=new Map;getWorker(){return this.worker||(this.worker=new Worker(new URL("/assets/optimizer.worker-DZcD7Kza.js",import.meta.url),{type:"module"}),this.worker.onmessage=this.handleMessage.bind(this),this.worker.onerror=this.handleError.bind(this)),this.worker}handleMessage(t){const{id:n,result:r,error:i,progress:o}=t.data,l=this.pending.get(n);if(l){if(o!==void 0&&o<100&&l.onProgress){l.onProgress(o);return}if(i){l.reject(new Error(i)),this.pending.delete(n);return}r&&(l.resolve(r),this.pending.delete(n))}}handleError(t){console.error("Image optimizer worker error:",t);for(const[n,r]of this.pending)r.reject(new Error(`Worker error: ${t.message}`)),this.pending.delete(n);this.terminate()}generateId(){return crypto.randomUUID()}async optimize(t,n,r){const i=this.generateId();return new Promise((o,l)=>{this.pending.set(i,{resolve:o,reject:l,onProgress:r}),this.getWorker().postMessage({id:i,type:"optimize",file:t,options:n})})}async preview(t,n,r){const i=await q3(t);return{...await this.optimize(t,n,r),originalDataUrl:i}}cancelAll(){for(const[t,n]of this.pending)n.reject(new Error("Operation cancelled")),this.pending.delete(t)}terminate(){this.cancelAll(),this.worker&&(this.worker.terminate(),this.worker=null)}get isActive(){return this.worker!==null}get pendingCount(){return this.pending.size}}const VJ=new GJ;async function YJ(e,t,n){return VJ.preview(e,t,n)}const WJ=[{value:"webp",label:"WebP",description:"Best balance of size and quality"},{value:"avif",label:"AVIF",description:"Best compression"},{value:"jpeg",label:"JPEG",description:"Universal compatibility"},{value:"png",label:"PNG",description:"Lossless, supports transparency"},{value:"original",label:"Original",description:"Keep original format"}],KJ=[{value:1,label:"1x",description:"Standard displays"},{value:2,label:"2x",description:"Retina / HiDPI (recommended)"},{value:3,label:"3x",description:"iPhone Pro / flagship phones"}];function vS(e){const t=e/1024,n=t/1024;return n>2?{level:"error",message:"This image will cause delivery issues (>2MB)",suggestion:"Reduce dimensions or increase compression to under 1MB"}:n>1?{level:"warning",message:"Most email clients struggle with images >1MB",suggestion:"Consider reducing to under 500KB for best deliverability"}:t>500?{level:"info",message:"Larger than recommended for email (>500KB)",suggestion:"This may slow load times on mobile devices"}:null}function Ix(e){const t=vS(e);if(!t)return{label:"Good",color:"text-green-600"};switch(t.level){case"info":return{label:"OK",color:"text-yellow-600"};case"warning":return{label:"Large",color:"text-orange-600"};case"error":return{label:"Too Large",color:"text-red-600"};default:return{label:"Unknown",color:"text-muted-foreground"}}}const XJ=[{value:"none",label:"Original size",description:"Keep original dimensions"},{value:"600",label:"Email (600px)",description:"Standard email width"},{value:"800",label:"Medium (800px)",description:"Blog posts, cards"},{value:"1200",label:"Large (1200px)",description:"Full-width content"},{value:"1440",label:"Hero (1440px)",description:"Banner images"},{value:"1920",label:"Full HD (1920px)",description:"Desktop screens"}];function QJ({files:e,onComplete:t,onClose:n,open:r}){const[i,o]=S.useState([]),[l,f]=S.useState(null),[d,h]=S.useState(!1),v=i.reduce(($,W)=>$+W.file.size,0),m=i.reduce(($,W)=>$+(W.preview?.optimizedSize??W.file.size),0),g=v>0?Math.round((1-m/v)*100):0,x=i.length>0&&i.every($=>$.status==="ready"||$.status==="done"||$.isAnimatedGif),O=i.some($=>$.status==="pending"&&!$.isAnimatedGif),j=i.some($=>$.status==="processing"),[b,E]=S.useState(!0),[_,A]=S.useState(!1),[C,N]=S.useState({format:"webp",quality:85}),[M,R]=S.useState(85),[D,L]=S.useState("none"),[H,B]=S.useState(2),[U,Y]=S.useState(!0);S.useEffect(()=>{BJ().then($=>{Y($.wasm&&$.webWorker&&$.offscreenCanvas)})},[]),S.useEffect(()=>{if(!r||e.length===0)return;const $=e.map((W,ae)=>({id:`${W.name}-${ae}-${Date.now()}`,file:W,status:"pending"}));o($),f($[0]?.id??null),A(!1),h(!1);for(const W of $)q3(W.file).then(ae=>{o(ce=>ce.map(oe=>oe.id===W.id?{...oe,thumbnailUrl:ae}:oe))}),UJ(W.file)&&qJ(W.file).then(ae=>{ae.isAnimated&&o(ce=>ce.map(oe=>oe.id===W.id?{...oe,isAnimatedGif:!0,status:"ready"}:oe))})},[r,e]);const Z=S.useCallback(async()=>{const $=i.filter(W=>W.status==="pending"&&!W.isAnimatedGif);if($.length===0){h(!1);return}for(const W of $){o(ae=>ae.map(ce=>ce.id===W.id?{...ce,status:"processing"}:ce));try{let ae;if(D==="none"){if(H>1){const me=await FJ(W.file);ae=Math.round(me.width/H)}}else ae=Number(D)*H;const ce={...C,maxWidth:ae},oe=await YJ(W.file,ce);o(me=>me.map(ie=>ie.id===W.id?{...ie,status:"ready",preview:oe}:ie))}catch{o(ae=>ae.map(ce=>ce.id===W.id?{...ce,status:"ready"}:ce))}}h(!1)},[i,C,D,H]),X=`${C.format}-${C.quality}-${D}-${H}`,k=S.useRef(X);S.useEffect(()=>{k.current!==X&&(k.current=X,o($=>$.map(W=>W.isAnimatedGif?W:{...W,status:"pending",preview:void 0})),h(!1))},[X]);const q=$=>{const W=$.name.replace(/\.[^/.]+$/,""),ae=C.format==="original"?$.name.split(".").pop():C.format;return`${W}.${ae}`},V=()=>{h(!0),Z()},Q=()=>{const $=i.map(W=>!b||W.isAnimatedGif||!W.preview?{file:W.file,cdnFilename:W.file.name}:{file:W.preview.blob,cdnFilename:q(W.file)});t($),n()},ee=()=>{const $=i.map(W=>({file:W.file,cdnFilename:W.file.name}));t($),n()};if(!r)return null;const z=i.length===1,G=z?i[0]:null;return c.jsx(MO,{onOpenChange:$=>!$&&n(),open:r,children:c.jsxs(RO,{className:"max-w-lg",children:[c.jsx(bL,{children:c.jsx(SL,{className:"flex items-center gap-2",children:z?c.jsxs(c.Fragment,{children:[c.jsx(vx,{className:"h-5 w-5 text-muted-foreground"}),c.jsx("span",{className:"truncate",children:G?.file.name})]}):c.jsxs(c.Fragment,{children:[c.jsx(vx,{className:"h-5 w-5 text-muted-foreground"}),i.length," images selected"]})})}),c.jsxs("div",{className:"space-y-4",children:[!z&&c.jsxs("div",{className:"grid grid-cols-6 gap-2",children:[i.slice(0,11).map($=>c.jsxs(Vp,{children:[c.jsx(Yp,{asChild:!0,children:c.jsxs("div",{className:`relative aspect-square overflow-hidden rounded-md border bg-muted ${$.id===l?"ring-2 ring-primary":""}`,children:[$.thumbnailUrl?c.jsx("img",{alt:$.file.name,className:"h-full w-full object-cover",src:$.thumbnailUrl}):c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(vx,{className:"h-4 w-4 text-muted-foreground"})}),$.status==="processing"&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50",children:c.jsx(fa,{className:"h-3 w-3 animate-spin"})}),$.status==="ready"&&$.preview&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-green-500/20",children:c.jsx(ai,{className:"h-4 w-4 text-green-600"})}),$.isAnimatedGif&&c.jsx(Be,{className:"absolute right-0.5 bottom-0.5 h-4 px-1 text-[10px]",children:"GIF"})]})}),c.jsxs(Wp,{side:"bottom",children:[c.jsx("p",{className:"font-medium text-xs",children:$.file.name}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:[Th($.file.size),$.preview&&` → ${Th($.preview.optimizedSize)}`]})]})]},$.id)),i.length>11&&c.jsxs("div",{className:"flex aspect-square items-center justify-center rounded-md border bg-muted text-muted-foreground text-xs",children:["+",i.length-11]})]}),z&&G&&c.jsxs("div",{className:"relative aspect-video overflow-hidden rounded-lg border bg-muted",children:[G.thumbnailUrl?c.jsx("img",{alt:G.file.name,className:"h-full w-full object-contain",src:G.thumbnailUrl}):c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(fa,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),G.status==="processing"&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50",children:c.jsx(fa,{className:"h-6 w-6 animate-spin"})}),G.status==="ready"&&G.preview&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-green-500/10",children:c.jsx(ai,{className:"h-8 w-8 text-green-600"})})]}),c.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"text-muted-foreground text-sm",children:[c.jsx("span",{className:Ix(v).color,children:Th(v)}),b&&x&&g>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"mx-2",children:"→"}),c.jsx("span",{className:`font-medium ${Ix(m).color}`,children:Th(m)})]})]}),j&&c.jsx("p",{className:"text-muted-foreground text-xs",children:"Optimizing..."}),!j&&vS(x?m:v)&&c.jsx("p",{className:`text-xs ${Ix(x?m:v).color}`,children:vS(x?m:v)?.suggestion})]}),b&&x&&g>0&&c.jsxs(Be,{className:"bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300",variant:"secondary",children:[c.jsx(aF,{className:"mr-1 h-3 w-3"}),"Save ",g,"%"]})]}),j&&c.jsx(tv,{className:"mt-3 h-1",value:i.filter($=>$.status==="ready"||$.isAnimatedGif).length/i.length*100})]}),U&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Ho,{className:"cursor-pointer",htmlFor:"optimize-toggle",children:"Optimize before uploading"}),c.jsx(LJ,{checked:b,id:"optimize-toggle",onCheckedChange:E})]}),b&&U&&c.jsxs(ms,{onOpenChange:A,open:_,children:[c.jsx(ps,{asChild:!0,children:c.jsxs(Ce,{className:"w-full justify-start text-muted-foreground",size:"sm",variant:"ghost",children:[_?c.jsx(oo,{className:"mr-2 h-4 w-4"}):c.jsx(VH,{className:"mr-2 h-4 w-4"}),"Options"]})}),c.jsxs(vs,{className:"space-y-4 pt-2",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ho,{className:"text-muted-foreground text-xs",children:"Format"}),c.jsxs(ga,{onValueChange:$=>N({...C,format:$}),value:C.format||"webp",children:[c.jsx(xa,{className:"h-9",children:c.jsx(ya,{})}),c.jsx(ba,{children:WJ.map($=>c.jsx(Fe,{value:$.value,children:$.label},$.value))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Ho,{className:"text-muted-foreground text-xs",children:"Quality"}),c.jsxs("span",{className:"text-muted-foreground text-xs",children:[M,"%"]})]}),c.jsx(MJ,{className:"mt-2",max:100,min:50,onValueChange:([$])=>R($),onValueCommit:([$])=>N({...C,quality:$}),step:5,value:[M]})]})]}),c.jsxs("div",{className:"space-y-3 rounded-lg border bg-muted/20 p-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Ho,{className:"font-medium text-xs",children:"Resize Image"}),c.jsx("span",{className:"text-muted-foreground text-xs",children:"Maintains aspect ratio"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ho,{className:"text-muted-foreground text-xs",children:"Max Width"}),c.jsxs(ga,{onValueChange:L,value:D,children:[c.jsx(xa,{className:"h-9",children:c.jsx(ya,{})}),c.jsx(ba,{children:XJ.map($=>c.jsx(Fe,{value:$.value,children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{children:$.label}),c.jsx("span",{className:"text-muted-foreground text-xs",children:$.description})]})},$.value))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ho,{className:"text-muted-foreground text-xs",children:"Pixel Density"}),c.jsxs(ga,{onValueChange:$=>B(Number($)),value:String(H),children:[c.jsx(xa,{className:"h-9",children:c.jsx(ya,{})}),c.jsx(ba,{children:KJ.map($=>c.jsx(Fe,{value:String($.value),children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{children:$.label}),c.jsx("span",{className:"text-muted-foreground text-xs",children:$.description})]})},$.value))})]})]})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:D==="none"?H===1?"Original dimensions preserved":`Scales to 1/${H} original size`:`Output: ${Number(D)*H}px actual width`})]})]})]})]}),c.jsxs(wL,{className:"gap-2 sm:gap-0",children:[c.jsx(Ce,{onClick:n,variant:"ghost",children:"Cancel"}),b&&U?c.jsxs(c.Fragment,{children:[c.jsx(Ce,{onClick:ee,variant:"outline",children:"Upload originals"}),x?c.jsxs(Ce,{onClick:Q,children:[c.jsx(Gu,{className:"mr-2 h-4 w-4"}),"Upload",g>0&&` (save ${g}%)`]}):c.jsxs(Ce,{disabled:d||!O,onClick:V,children:[d?c.jsx(fa,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(cF,{className:"mr-2 h-4 w-4"}),d?"Optimizing...":"Optimize"]})]}):c.jsxs(Ce,{onClick:ee,children:[c.jsx(Gu,{className:"mr-2 h-4 w-4"}),"Upload"]})]})]})})}function ZJ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function JJ({url:e}){const[t,n]=S.useState(!1),r=async()=>{await navigator.clipboard.writeText(e),n(!0),jt.success("URL copied to clipboard"),setTimeout(()=>n(!1),2e3)};return c.jsx(Ce,{onClick:r,size:"sm",variant:"outline",children:t?c.jsx(ai,{className:"h-3 w-3 text-green-500"}):c.jsx("span",{className:"text-xs",children:"Copy"})})}function eee(){return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(De,{className:"mb-2 h-8 w-36"}),c.jsx(De,{className:"h-4 w-48"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(De,{className:"h-9 w-9"}),c.jsx(De,{className:"h-9 w-24"})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(De,{className:"h-9 min-w-[200px] flex-1"}),c.jsx(De,{className:"h-9 w-40"}),c.jsx(De,{className:"h-9 w-20"})]}),c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:[1,2,3,4,5,6,7,8,9,10,11,12].map(e=>c.jsxs("div",{className:"overflow-hidden rounded-xl bg-muted shadow-sm",children:[c.jsx(De,{className:"aspect-square w-full"}),c.jsxs("div",{className:"space-y-2 p-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(De,{className:"h-4 w-4"}),c.jsx(De,{className:"h-4 flex-1"})]}),c.jsxs("div",{className:"flex items-center gap-2 pl-6",children:[c.jsx(De,{className:"h-4 w-10"}),c.jsx(De,{className:"h-4 w-12"})]})]})]},e))})]})}function tee(){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[c.jsx(If,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h2",{className:"mb-2 font-semibold text-xl",children:"No Storage Configured"}),c.jsxs("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:["Storage infrastructure has not been deployed yet. Run"," ",c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:"wraps storage init"})," ","to get started."]})]})}function nee({onUploadClick:e}){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[c.jsx(v$,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h3",{className:"mb-2 font-semibold text-lg",children:"No Files Yet"}),c.jsx("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:"Upload your first file to get started with your CDN library"}),c.jsxs(Ce,{onClick:e,children:[c.jsx(Gu,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]})}function ree({upload:e,onRemove:t}){return c.jsx("div",{className:"flex items-center gap-3 rounded-lg border bg-muted/30 p-3",children:c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[c.jsx("span",{className:"truncate font-medium text-sm",children:e.filename}),c.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="uploading"&&c.jsx(fa,{className:"h-4 w-4 animate-spin text-primary"}),e.status==="success"&&c.jsx(so,{className:"h-4 w-4 text-green-500"}),e.status==="error"&&c.jsx(lr,{className:"h-4 w-4 text-red-500"}),c.jsx(Ce,{className:"h-6 w-6",onClick:t,size:"icon",variant:"ghost",children:c.jsx(or,{className:"h-3 w-3"})})]})]}),e.status==="uploading"&&c.jsx(tv,{className:"h-1",value:e.progress}),e.status==="success"&&e.cdnUrl&&c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx("span",{className:"truncate text-muted-foreground text-xs",children:e.cdnUrl}),c.jsx(JJ,{url:e.cdnUrl})]}),e.status==="error"&&c.jsx("span",{className:"text-red-500 text-xs",children:e.error})]})})}function aee({uploads:e,onFilesSelected:t,onRemoveUpload:n}){const[r,i]=S.useState(!1),o=S.useRef(null),l=v=>{v.preventDefault(),i(!0)},f=v=>{v.preventDefault(),i(!1)},d=v=>{v.preventDefault(),i(!1),v.dataTransfer.files.length>0&&t(v.dataTransfer.files)},h=v=>{v.target.files&&v.target.files.length>0&&t(v.target.files)};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Upload Files"}),c.jsx(We,{children:"Drag and drop files or click to browse"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:`cursor-pointer rounded-lg border-2 border-dashed p-8 text-center transition-colors ${r?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-primary/50"}`,onClick:()=>o.current?.click(),onDragLeave:f,onDragOver:l,onDrop:d,children:[c.jsx(Gu,{className:"mx-auto mb-4 h-10 w-10 text-muted-foreground"}),c.jsx("p",{className:"mb-1 font-medium text-sm",children:"Drop files here or click to upload"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Images will be optimized before uploading"}),c.jsx("input",{accept:"*/*",className:"hidden",multiple:!0,onChange:h,ref:o,type:"file"})]}),e.length>0&&c.jsx("div",{className:"space-y-2",children:e.map((v,m)=>c.jsx(ree,{onRemove:()=>n(m),upload:v},`${v.filename}-${m}`))})]})]})}function iee(){const[e,t]=S.useState(null),[n,r]=S.useState(!0),[i,o]=S.useState(null),[l,f]=S.useState(()=>{if(typeof window<"u"){const $=localStorage.getItem("cdn-library-view-mode");if($==="grid"||$==="table")return $}return"grid"}),d=S.useCallback($=>{f($),localStorage.setItem("cdn-library-view-mode",$)},[]),[h,v]=S.useState(""),[m,g]=S.useState({starred:!1,formats:[]}),[x,O]=S.useState([]),[j,b]=S.useState(null),[E,_]=S.useState(!1),[A,C]=S.useState([]),[N,M]=S.useState({keys:[],isOpen:!1}),[R,D]=S.useState([]),[L,H]=S.useState(!1),B=S.useCallback(async()=>{try{r(!0),o(null);const $=sessionStorage.getItem("wraps-auth-token"),W=await fetch(`/api/cdn/files?token=${$}`);if(!W.ok){if(W.status===404){t(null);return}throw new Error("Failed to fetch storage files")}const ae=await W.json();t(ae)}catch($){o($ instanceof Error?$.message:"An error occurred")}finally{r(!1)}},[]);S.useEffect(()=>{B()},[B]);const U=S.useCallback(async($,W)=>{const ae=sessionStorage.getItem("wraps-auth-token");try{if(!(await fetch(`/api/cdn/files/${encodeURIComponent($)}/star?token=${ae}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({starred:W})})).ok)throw new Error("Failed to update star status");t(oe=>oe&&{...oe,files:oe.files.map(me=>me.key===$?{...me,starred:W}:me)}),j?.key===$&&b(oe=>oe?{...oe,starred:W}:null),jt.success(W?"File starred":"Star removed")}catch{jt.error("Failed to update star status")}},[j]),Y=S.useCallback(async $=>{const W=sessionStorage.getItem("wraps-auth-token");try{await Promise.all($.map(ae=>fetch(`/api/cdn/files/${encodeURIComponent(ae)}?token=${W}`,{method:"DELETE"}))),jt.success($.length===1?"File deleted":`${$.length} files deleted`),O([]),b(null),B()}catch{jt.error("Failed to delete file(s)")}},[B]),Z=S.useCallback(async($,W,ae)=>{const ce=sessionStorage.getItem("wraps-auth-token"),oe=$ instanceof File,me=ae||(oe?$.name:"file"),ie=$.type||"application/octet-stream";try{C(Re=>Re.map((be,qe)=>qe===W?{...be,status:"uploading",progress:0}:be));const ve=await fetch(`/api/cdn/upload-url?token=${ce}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:me,contentType:ie})});if(!ve.ok)throw new Error("Failed to get upload URL");const{uploadUrl:ye,cdnUrl:le}=await ve.json();await new Promise((Re,be)=>{const qe=new XMLHttpRequest;qe.upload.addEventListener("progress",rt=>{if(rt.lengthComputable){const mt=Math.round(rt.loaded/rt.total*100);C(vn=>vn.map((Mt,fr)=>fr===W?{...Mt,progress:mt}:Mt))}}),qe.addEventListener("load",()=>{qe.status>=200&&qe.status<300?Re():be(new Error(`Upload failed with status ${qe.status}`))}),qe.addEventListener("error",()=>be(new Error("Upload failed"))),qe.open("PUT",ye),qe.setRequestHeader("Content-Type",ie),qe.send($)}),C(Re=>Re.map((be,qe)=>qe===W?{...be,status:"success",progress:100,cdnUrl:le}:be)),jt.success(`Uploaded ${me}`),B()}catch(ve){C(ye=>ye.map((le,Re)=>Re===W?{...le,status:"error",error:ve instanceof Error?ve.message:"Upload failed"}:le)),jt.error(`Failed to upload ${me}`)}},[B]),X=S.useCallback($=>{const W=Array.from($),ae=W.filter(oe=>oe.type.startsWith("image/")),ce=W.filter(oe=>!oe.type.startsWith("image/"));if(ce.length>0){const oe=ce.map(ie=>({file:ie,filename:ie.name,progress:0,status:"pending"}));C(ie=>[...ie,...oe]),_(!0);const me=A.length;ce.forEach((ie,ve)=>{Z(ie,me+ve,ie.name)})}ae.length>0&&(D(ae),H(!0))},[A.length,Z]),k=S.useCallback($=>{if(!$||$.length===0)return;const W=A.length,ae=$.map(ce=>({file:ce.file,filename:ce.cdnFilename,progress:0,status:"pending"}));C(ce=>[...ce,...ae]),_(!0),$.forEach((ce,oe)=>{Z(ce.file,W+oe,ce.cdnFilename)})},[A.length,Z]),q=S.useMemo(()=>e?.files?e.files.filter($=>{if(h&&!$.key.toLowerCase().includes(h.toLowerCase())||m.starred&&!$.starred)return!1;if(m.formats.length>0){const W=$.key.split(".").pop()?.toLowerCase()||"";if(!m.formats.includes(W))return!1}return!0}):[],[e?.files,h,m]),V=S.useCallback($=>{O(W=>W.includes($)?W.filter(ae=>ae!==$):[...W,$])},[]),Q=S.useCallback(()=>{if(!e?.files)return;const $=q.map(W=>W.key);x.length===$.length?O([]):O($)},[e?.files,x.length,q]),ee=S.useCallback(async()=>{await Promise.all(x.map($=>U($,!0))),O([])},[x,U]),z=S.useCallback(()=>{M({keys:x,isOpen:!0})},[x]),G=S.useMemo(()=>{if(!e?.files)return[];const $=new Set;return e.files.forEach(W=>{const ae=W.key.split(".").pop()?.toLowerCase();ae&&$.add(ae)}),Array.from($).sort()},[e?.files]);return n?c.jsx(eee,{}):i?c.jsxs(Un,{variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(ro,{children:"Error"}),c.jsx(Hn,{children:i})]}):e?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold text-2xl",children:"CDN Library"}),c.jsx("p",{className:"text-muted-foreground",children:e.fileCount>0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-foreground",children:e.fileCount})," File",e.fileCount!==1?"s":""," · Total"," ",c.jsx("span",{className:"text-foreground",children:ZJ(e.totalSize)})]}):"Manage and organize your files"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ce,{onClick:B,size:"icon",variant:"outline",children:c.jsx(Lf,{className:"h-4 w-4"})}),c.jsxs(Ce,{onClick:()=>_(!E),children:[c.jsx(Gu,{className:"mr-2 h-4 w-4"}),"Upload"]})]})]}),E&&c.jsx(aee,{onFilesSelected:X,onRemoveUpload:$=>C(W=>W.filter((ae,ce)=>ce!==$)),uploads:A}),e.files.length>0&&c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[x.length>0&&c.jsxs("div",{className:"flex items-center rounded-lg border",children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-r px-2.5 py-1.5 font-medium text-sm",children:[x.length," selected"]}),c.jsx(rv,{className:"rounded-none border-0",label:"Star",onToggle:ee,size:"sm"}),c.jsx(xL,{className:"rounded-none border-0 border-l",label:"Delete",onDelete:z,size:"sm",variant:"ghost"}),c.jsx(Ce,{className:"rounded-l-none border-0 border-l",onClick:()=>O([]),size:"sm",variant:"ghost",children:c.jsx(or,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"relative min-w-[200px] flex-1",children:[c.jsx(Cp,{className:"-translate-y-1/2 absolute top-1/2 left-3 h-4 w-4 text-muted-foreground"}),c.jsx(fs,{className:"pl-9",onChange:$=>v($.target.value),placeholder:"Search files...",type:"search",value:h})]}),c.jsxs("div",{className:"flex items-center rounded-lg border",children:[c.jsxs(Ce,{className:"rounded-r-none border-0",onClick:()=>g({...m,starred:!m.starred}),size:"sm",variant:m.starred?"secondary":"ghost",children:[c.jsx(b$,{className:`mr-1.5 h-4 w-4 ${m.starred?"fill-current":""}`}),"Starred"]}),G.length>0&&c.jsxs(F5,{children:[c.jsx(G5,{asChild:!0,children:c.jsxs(Ce,{className:"rounded-l-none border-0 border-l",size:"sm",variant:"ghost",children:[c.jsx(QH,{className:"mr-1.5 h-4 w-4"}),"Formats",m.formats.length>0&&c.jsx(Be,{className:"ml-1.5 px-1.5 py-0 text-xs",variant:"secondary",children:m.formats.length})]})}),c.jsxs(V5,{align:"end",className:"w-48",children:[c.jsx(Y5,{children:"File Format"}),c.jsx(iS,{}),G.map($=>c.jsx(FK,{checked:m.formats.includes($),onCheckedChange:W=>{g({...m,formats:W?[...m.formats,$]:m.formats.filter(ae=>ae!==$)})},children:$.toUpperCase()},$))]})]})]}),c.jsxs(MX,{className:"rounded-lg border",onValueChange:$=>$&&d($),type:"single",value:l,children:[c.jsx(QC,{"aria-label":"Grid view",className:"rounded-r-none border-0",value:"grid",children:c.jsx(ZH,{className:"h-4 w-4"})}),c.jsx(QC,{"aria-label":"Table view",className:"rounded-l-none border-0 border-l",value:"table",children:c.jsx(eF,{className:"h-4 w-4"})})]})]}),e.files.length===0?c.jsx(nee,{onUploadClick:()=>_(!0)}):q.length===0?c.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"No files match your search or filters"}):l==="grid"?c.jsx(iZ,{files:q,onFileClick:b,onSelectFile:V,onToggleStar:U,selectedFiles:x}):c.jsx(SZ,{files:q,onFileClick:b,onSelectAll:Q,onSelectFile:V,onToggleStar:U,selectedFiles:x}),j&&c.jsx(ZQ,{file:j,onClose:()=>b(null),onDelete:$=>{M({keys:[$],isOpen:!0})},onToggleStar:U}),c.jsx(dm,{onOpenChange:$=>M(W=>({...W,isOpen:$})),open:N.isOpen,children:c.jsxs(hm,{children:[c.jsxs(mm,{children:[c.jsxs(vm,{children:["Delete File",N.keys.length>1?"s":""]}),c.jsxs(gm,{children:["Are you sure you want to delete"," ",N.keys.length===1?c.jsx("strong",{children:N.keys[0].split("/").pop()}):c.jsxs("strong",{children:[N.keys.length," files"]}),"? This action cannot be undone."]})]}),c.jsxs(pm,{children:[c.jsx(xm,{children:"Cancel"}),c.jsx(ym,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{Y(N.keys),M({keys:[],isOpen:!1})},children:"Delete"})]})]})}),c.jsx(QJ,{files:R,onClose:()=>{H(!1),D([])},onComplete:k,open:L})]}):c.jsx(tee,{})}var Lx,oT;function Vn(){if(oT)return Lx;oT=1;var e=Array.isArray;return Lx=e,Lx}var zx,sT;function U3(){if(sT)return zx;sT=1;var e=typeof gh=="object"&&gh&&gh.Object===Object&&gh;return zx=e,zx}var Bx,lT;function Aa(){if(lT)return Bx;lT=1;var e=U3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Bx=n,Bx}var qx,cT;function Wf(){if(cT)return qx;cT=1;var e=Aa(),t=e.Symbol;return qx=t,qx}var Ux,uT;function oee(){if(uT)return Ux;uT=1;var e=Wf(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function o(l){var f=n.call(l,i),d=l[i];try{l[i]=void 0;var h=!0}catch{}var v=r.call(l);return h&&(f?l[i]=d:delete l[i]),v}return Ux=o,Ux}var Hx,fT;function see(){if(fT)return Hx;fT=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Hx=n,Hx}var Fx,dT;function pi(){if(dT)return Fx;dT=1;var e=Wf(),t=oee(),n=see(),r="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function l(f){return f==null?f===void 0?i:r:o&&o in Object(f)?t(f):n(f)}return Fx=l,Fx}var Gx,hT;function vi(){if(hT)return Gx;hT=1;function e(t){return t!=null&&typeof t=="object"}return Gx=e,Gx}var Vx,mT;function gc(){if(mT)return Vx;mT=1;var e=pi(),t=vi(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return Vx=r,Vx}var Yx,pT;function BO(){if(pT)return Yx;pT=1;var e=Vn(),t=gc(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,l){if(e(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||l!=null&&o in Object(l)}return Yx=i,Yx}var Wx,vT;function ho(){if(vT)return Wx;vT=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Wx=e,Wx}var Kx,gT;function qO(){if(gT)return Kx;gT=1;var e=pi(),t=ho(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function l(f){if(!t(f))return!1;var d=e(f);return d==r||d==i||d==n||d==o}return Kx=l,Kx}var Xx,yT;function lee(){if(yT)return Xx;yT=1;var e=Aa(),t=e["__core-js_shared__"];return Xx=t,Xx}var Qx,xT;function cee(){if(xT)return Qx;xT=1;var e=lee(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return Qx=n,Qx}var Zx,bT;function H3(){if(bT)return Zx;bT=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Zx=n,Zx}var Jx,wT;function uee(){if(wT)return Jx;wT=1;var e=qO(),t=cee(),n=ho(),r=H3(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,l=Function.prototype,f=Object.prototype,d=l.toString,h=f.hasOwnProperty,v=RegExp("^"+d.call(h).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(g){if(!n(g)||t(g))return!1;var x=e(g)?v:o;return x.test(r(g))}return Jx=m,Jx}var eb,ST;function fee(){if(ST)return eb;ST=1;function e(t,n){return t?.[n]}return eb=e,eb}var tb,jT;function gs(){if(jT)return tb;jT=1;var e=uee(),t=fee();function n(r,i){var o=t(r,i);return e(o)?o:void 0}return tb=n,tb}var nb,OT;function yv(){if(OT)return nb;OT=1;var e=gs(),t=e(Object,"create");return nb=t,nb}var rb,ET;function dee(){if(ET)return rb;ET=1;var e=yv();function t(){this.__data__=e?e(null):{},this.size=0}return rb=t,rb}var ab,_T;function hee(){if(_T)return ab;_T=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return ab=e,ab}var ib,AT;function mee(){if(AT)return ib;AT=1;var e=yv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var l=this.__data__;if(e){var f=l[o];return f===t?void 0:f}return r.call(l,o)?l[o]:void 0}return ib=i,ib}var ob,NT;function pee(){if(NT)return ob;NT=1;var e=yv(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var o=this.__data__;return e?o[i]!==void 0:n.call(o,i)}return ob=r,ob}var sb,CT;function vee(){if(CT)return sb;CT=1;var e=yv(),t="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&i===void 0?t:i,this}return sb=n,sb}var lb,TT;function gee(){if(TT)return lb;TT=1;var e=dee(),t=hee(),n=mee(),r=pee(),i=vee();function o(l){var f=-1,d=l==null?0:l.length;for(this.clear();++f<d;){var h=l[f];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,lb=o,lb}var cb,MT;function yee(){if(MT)return cb;MT=1;function e(){this.__data__=[],this.size=0}return cb=e,cb}var ub,RT;function UO(){if(RT)return ub;RT=1;function e(t,n){return t===n||t!==t&&n!==n}return ub=e,ub}var fb,DT;function xv(){if(DT)return fb;DT=1;var e=UO();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return fb=t,fb}var db,PT;function xee(){if(PT)return db;PT=1;var e=xv(),t=Array.prototype,n=t.splice;function r(i){var o=this.__data__,l=e(o,i);if(l<0)return!1;var f=o.length-1;return l==f?o.pop():n.call(o,l,1),--this.size,!0}return db=r,db}var hb,kT;function bee(){if(kT)return hb;kT=1;var e=xv();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return hb=t,hb}var mb,$T;function wee(){if($T)return mb;$T=1;var e=xv();function t(n){return e(this.__data__,n)>-1}return mb=t,mb}var pb,IT;function See(){if(IT)return pb;IT=1;var e=xv();function t(n,r){var i=this.__data__,o=e(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return pb=t,pb}var vb,LT;function bv(){if(LT)return vb;LT=1;var e=yee(),t=xee(),n=bee(),r=wee(),i=See();function o(l){var f=-1,d=l==null?0:l.length;for(this.clear();++f<d;){var h=l[f];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,vb=o,vb}var gb,zT;function HO(){if(zT)return gb;zT=1;var e=gs(),t=Aa(),n=e(t,"Map");return gb=n,gb}var yb,BT;function jee(){if(BT)return yb;BT=1;var e=gee(),t=bv(),n=HO();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return yb=r,yb}var xb,qT;function Oee(){if(qT)return xb;qT=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return xb=e,xb}var bb,UT;function wv(){if(UT)return bb;UT=1;var e=Oee();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return bb=t,bb}var wb,HT;function Eee(){if(HT)return wb;HT=1;var e=wv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return wb=t,wb}var Sb,FT;function _ee(){if(FT)return Sb;FT=1;var e=wv();function t(n){return e(this,n).get(n)}return Sb=t,Sb}var jb,GT;function Aee(){if(GT)return jb;GT=1;var e=wv();function t(n){return e(this,n).has(n)}return jb=t,jb}var Ob,VT;function Nee(){if(VT)return Ob;VT=1;var e=wv();function t(n,r){var i=e(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Ob=t,Ob}var Eb,YT;function FO(){if(YT)return Eb;YT=1;var e=jee(),t=Eee(),n=_ee(),r=Aee(),i=Nee();function o(l){var f=-1,d=l==null?0:l.length;for(this.clear();++f<d;){var h=l[f];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Eb=o,Eb}var _b,WT;function F3(){if(WT)return _b;WT=1;var e=FO(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var o=function(){var l=arguments,f=i?i.apply(this,l):l[0],d=o.cache;if(d.has(f))return d.get(f);var h=r.apply(this,l);return o.cache=d.set(f,h)||d,h};return o.cache=new(n.Cache||e),o}return n.Cache=e,_b=n,_b}var Ab,KT;function Cee(){if(KT)return Ab;KT=1;var e=F3(),t=500;function n(r){var i=e(r,function(l){return o.size===t&&o.clear(),l}),o=i.cache;return i}return Ab=n,Ab}var Nb,XT;function Tee(){if(XT)return Nb;XT=1;var e=Cee(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(t,function(l,f,d,h){o.push(d?h.replace(n,"$1"):f||l)}),o});return Nb=r,Nb}var Cb,QT;function GO(){if(QT)return Cb;QT=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,o=Array(i);++r<i;)o[r]=n(t[r],r,t);return o}return Cb=e,Cb}var Tb,ZT;function Mee(){if(ZT)return Tb;ZT=1;var e=Wf(),t=GO(),n=Vn(),r=gc(),i=e?e.prototype:void 0,o=i?i.toString:void 0;function l(f){if(typeof f=="string")return f;if(n(f))return t(f,l)+"";if(r(f))return o?o.call(f):"";var d=f+"";return d=="0"&&1/f==-1/0?"-0":d}return Tb=l,Tb}var Mb,JT;function G3(){if(JT)return Mb;JT=1;var e=Mee();function t(n){return n==null?"":e(n)}return Mb=t,Mb}var Rb,eM;function V3(){if(eM)return Rb;eM=1;var e=Vn(),t=BO(),n=Tee(),r=G3();function i(o,l){return e(o)?o:t(o,l)?[o]:n(r(o))}return Rb=i,Rb}var Db,tM;function Sv(){if(tM)return Db;tM=1;var e=gc();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Db=t,Db}var Pb,nM;function VO(){if(nM)return Pb;nM=1;var e=V3(),t=Sv();function n(r,i){i=e(i,r);for(var o=0,l=i.length;r!=null&&o<l;)r=r[t(i[o++])];return o&&o==l?r:void 0}return Pb=n,Pb}var kb,rM;function Y3(){if(rM)return kb;rM=1;var e=VO();function t(n,r,i){var o=n==null?void 0:e(n,r);return o===void 0?i:o}return kb=t,kb}var Ree=Y3();const Mr=xt(Ree);var $b,aM;function Dee(){if(aM)return $b;aM=1;function e(t){return t==null}return $b=e,$b}var Pee=Dee();const Qe=xt(Pee);var Ib,iM;function kee(){if(iM)return Ib;iM=1;var e=pi(),t=Vn(),n=vi(),r="[object String]";function i(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return Ib=i,Ib}var $ee=kee();const as=xt($ee);var Iee=qO();const Ye=xt(Iee);var Lee=ho();const yc=xt(Lee);var Lb={exports:{}},lt={};var oM;function zee(){if(oM)return lt;oM=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),f=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),O;O=Symbol.for("react.module.reference");function j(b){if(typeof b=="object"&&b!==null){var E=b.$$typeof;switch(E){case e:switch(b=b.type,b){case n:case i:case r:case h:case v:return b;default:switch(b=b&&b.$$typeof,b){case f:case l:case d:case g:case m:case o:return b;default:return E}}case t:return E}}}return lt.ContextConsumer=l,lt.ContextProvider=o,lt.Element=e,lt.ForwardRef=d,lt.Fragment=n,lt.Lazy=g,lt.Memo=m,lt.Portal=t,lt.Profiler=i,lt.StrictMode=r,lt.Suspense=h,lt.SuspenseList=v,lt.isAsyncMode=function(){return!1},lt.isConcurrentMode=function(){return!1},lt.isContextConsumer=function(b){return j(b)===l},lt.isContextProvider=function(b){return j(b)===o},lt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},lt.isForwardRef=function(b){return j(b)===d},lt.isFragment=function(b){return j(b)===n},lt.isLazy=function(b){return j(b)===g},lt.isMemo=function(b){return j(b)===m},lt.isPortal=function(b){return j(b)===t},lt.isProfiler=function(b){return j(b)===i},lt.isStrictMode=function(b){return j(b)===r},lt.isSuspense=function(b){return j(b)===h},lt.isSuspenseList=function(b){return j(b)===v},lt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===h||b===v||b===x||typeof b=="object"&&b!==null&&(b.$$typeof===g||b.$$typeof===m||b.$$typeof===o||b.$$typeof===l||b.$$typeof===d||b.$$typeof===O||b.getModuleId!==void 0)},lt.typeOf=j,lt}var sM;function Bee(){return sM||(sM=1,Lb.exports=zee()),Lb.exports}var qee=Bee(),zb,lM;function W3(){if(lM)return zb;lM=1;var e=pi(),t=vi(),n="[object Number]";function r(i){return typeof i=="number"||t(i)&&e(i)==n}return zb=r,zb}var Bb,cM;function Uee(){if(cM)return Bb;cM=1;var e=W3();function t(n){return e(n)&&n!=+n}return Bb=t,Bb}var Hee=Uee();const Kf=xt(Hee);var Fee=W3();const Gee=xt(Fee);var Yr=function(t){return t===0?0:t>0?1:-1},Vo=function(t){return as(t)&&t.indexOf("%")===t.length-1},xe=function(t){return Gee(t)&&!Kf(t)},Vee=function(t){return Qe(t)},Jt=function(t){return xe(t)||as(t)},Yee=0,Xf=function(t){var n=++Yee;return"".concat(t||"").concat(n)},is=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!xe(t)&&!as(t))return r;var o;if(Vo(t)){var l=t.indexOf("%");o=n*parseFloat(t.slice(0,l))/100}else o=+t;return Kf(o)&&(o=r),i&&o>n&&(o=n),o},Ki=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},Wee=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},Gr=function(t,n){return xe(t)&&xe(n)?function(r){return t+r*(n-t)}:function(){return n}};function Nm(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Mr(r,t))===n})}var Kee=function(t,n){return xe(t)&&xe(n)?t-n:as(t)&&as(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function _l(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function gS(e){"@babel/helpers - typeof";return gS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gS(e)}var Xee=["viewBox","children"],Qee=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],uM=["points","pathLength"],qb={svg:Xee,polygon:uM,polyline:uM},YO=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Cm=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(S.isValidElement(t)&&(r=t.props),!yc(r))return null;var i={};return Object.keys(r).forEach(function(o){YO.includes(o)&&(i[o]=n||function(l){return r[o](r,l)})}),i},Zee=function(t,n,r){return function(i){return t(n,r,i),null}},Tm=function(t,n,r){if(!yc(t)||gS(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(o){var l=t[o];YO.includes(o)&&typeof l=="function"&&(i||(i={}),i[o]=Zee(l,n,r))}),i},Jee=["children"],ete=["children"];function fM(e,t){if(e==null)return{};var n=tte(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yS(e){"@babel/helpers - typeof";return yS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yS(e)}var dM={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ei=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},hM=null,Ub=null,WO=function e(t){if(t===hM&&Array.isArray(Ub))return Ub;var n=[];return S.Children.forEach(t,function(r){Qe(r)||(qee.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Ub=n,hM=t,n};function Rr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return ei(i)}):r=[ei(t)],WO(e).forEach(function(i){var o=Mr(i,"type.displayName")||Mr(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function rr(e,t){var n=Rr(e,t);return n&&n[0]}var mM=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!xe(r)||r<=0||!xe(i)||i<=0)},nte=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],rte=function(t){return t&&t.type&&as(t.type)&&nte.indexOf(t.type)>=0},ate=function(t){return t&&yS(t)==="object"&&"clipDot"in t},ite=function(t,n,r,i){var o,l=(o=qb?.[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!Ye(t)&&(i&&l.includes(n)||Qee.includes(n))||r&&YO.includes(n)},nt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(S.isValidElement(t)&&(i=t.props),!yc(i))return null;var o={};return Object.keys(i).forEach(function(l){var f;ite((f=i)===null||f===void 0?void 0:f[l],l,n,r)&&(o[l]=i[l])}),o},xS=function e(t,n){if(t===n)return!0;var r=S.Children.count(t);if(r!==S.Children.count(n))return!1;if(r===0)return!0;if(r===1)return pM(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var o=t[i],l=n[i];if(Array.isArray(o)||Array.isArray(l)){if(!e(o,l))return!1}else if(!pM(o,l))return!1}return!0},pM=function(t,n){if(Qe(t)&&Qe(n))return!0;if(!Qe(t)&&!Qe(n)){var r=t.props||{},i=r.children,o=fM(r,Jee),l=n.props||{},f=l.children,d=fM(l,ete);return i&&f?_l(o,d)&&xS(i,f):!i&&!f?_l(o,d):!1}return!1},vM=function(t,n){var r=[],i={};return WO(t).forEach(function(o,l){if(rte(o))r.push(o);else if(o){var f=ei(o.type),d=n[f]||{},h=d.handler,v=d.once;if(h&&(!v||!i[f])){var m=h(o,f,l);r.push(m),i[f]=!0}}}),r},ote=function(t){var n=t&&t.type;return n&&dM[n]?dM[n]:null},ste=function(t,n){return WO(n).indexOf(t)},lte=["children","width","height","viewBox","className","style","title","desc"];function bS(){return bS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bS.apply(this,arguments)}function cte(e,t){if(e==null)return{};var n=ute(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ute(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function wS(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,l=e.style,f=e.title,d=e.desc,h=cte(e,lte),v=i||{width:n,height:r,x:0,y:0},m=et("recharts-surface",o);return I.createElement("svg",bS({},nt(h,!0,"svg"),{className:m,width:n,height:r,style:l,viewBox:"".concat(v.x," ").concat(v.y," ").concat(v.width," ").concat(v.height)}),I.createElement("title",null,f),I.createElement("desc",null,d),t)}var fte=["children","className"];function SS(){return SS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SS.apply(this,arguments)}function dte(e,t){if(e==null)return{};var n=hte(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Bt=I.forwardRef(function(e,t){var n=e.children,r=e.className,i=dte(e,fte),o=et("recharts-layer",r);return I.createElement("g",SS({className:o},nt(i,!0),{ref:t}),n)}),ti=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o]},Hb,gM;function mte(){if(gM)return Hb;gM=1;function e(t,n,r){var i=-1,o=t.length;n<0&&(n=-n>o?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(o);++i<o;)l[i]=t[i+n];return l}return Hb=e,Hb}var Fb,yM;function pte(){if(yM)return Fb;yM=1;var e=mte();function t(n,r,i){var o=n.length;return i=i===void 0?o:i,!r&&i>=o?n:e(n,r,i)}return Fb=t,Fb}var Gb,xM;function K3(){if(xM)return Gb;xM=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,o="\\ufe0e\\ufe0f",l="\\u200d",f=RegExp("["+l+e+i+o+"]");function d(h){return f.test(h)}return Gb=d,Gb}var Vb,bM;function vte(){if(bM)return Vb;bM=1;function e(t){return t.split("")}return Vb=e,Vb}var Yb,wM;function gte(){if(wM)return Yb;wM=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,o="\\ufe0e\\ufe0f",l="["+e+"]",f="["+i+"]",d="\\ud83c[\\udffb-\\udfff]",h="(?:"+f+"|"+d+")",v="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",O=h+"?",j="["+o+"]?",b="(?:"+x+"(?:"+[v,m,g].join("|")+")"+j+O+")*",E=j+O+b,_="(?:"+[v+f+"?",f,m,g,l].join("|")+")",A=RegExp(d+"(?="+d+")|"+_+E,"g");function C(N){return N.match(A)||[]}return Yb=C,Yb}var Wb,SM;function yte(){if(SM)return Wb;SM=1;var e=vte(),t=K3(),n=gte();function r(i){return t(i)?n(i):e(i)}return Wb=r,Wb}var Kb,jM;function xte(){if(jM)return Kb;jM=1;var e=pte(),t=K3(),n=yte(),r=G3();function i(o){return function(l){l=r(l);var f=t(l)?n(l):void 0,d=f?f[0]:l.charAt(0),h=f?e(f,1).join(""):l.slice(1);return d[o]()+h}}return Kb=i,Kb}var Xb,OM;function bte(){if(OM)return Xb;OM=1;var e=xte(),t=e("toUpperCase");return Xb=t,Xb}var wte=bte();const jv=xt(wte);function St(e){return function(){return e}}const X3=Math.cos,Mm=Math.sin,ea=Math.sqrt,Rm=Math.PI,Ov=2*Rm,jS=Math.PI,OS=2*jS,Fo=1e-6,Ste=OS-Fo;function Q3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function jte(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Q3;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Ote{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Q3:jte(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+l}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let l=this._x1,f=this._y1,d=r-t,h=i-n,v=l-t,m=f-n,g=v*v+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Fo)if(!(Math.abs(m*d-h*v)>Fo)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-l,O=i-f,j=d*d+h*h,b=x*x+O*O,E=Math.sqrt(j),_=Math.sqrt(g),A=o*Math.tan((jS-Math.acos((j+g-b)/(2*E*_)))/2),C=A/_,N=A/E;Math.abs(C-1)>Fo&&this._append`L${t+C*v},${n+C*m}`,this._append`A${o},${o},0,0,${+(m*x>v*O)},${this._x1=t+N*d},${this._y1=n+N*h}`}}arc(t,n,r,i,o,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let f=r*Math.cos(i),d=r*Math.sin(i),h=t+f,v=n+d,m=1^l,g=l?i-o:o-i;this._x1===null?this._append`M${h},${v}`:(Math.abs(this._x1-h)>Fo||Math.abs(this._y1-v)>Fo)&&this._append`L${h},${v}`,r&&(g<0&&(g=g%OS+OS),g>Ste?this._append`A${r},${r},0,1,${m},${t-f},${n-d}A${r},${r},0,1,${m},${this._x1=h},${this._y1=v}`:g>Fo&&this._append`A${r},${r},0,${+(g>=jS)},${m},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function KO(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Ote(t)}function XO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Z3(e){this._context=e}Z3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ev(e){return new Z3(e)}function J3(e){return e[0]}function ez(e){return e[1]}function tz(e,t){var n=St(!0),r=null,i=Ev,o=null,l=KO(f);e=typeof e=="function"?e:e===void 0?J3:St(e),t=typeof t=="function"?t:t===void 0?ez:St(t);function f(d){var h,v=(d=XO(d)).length,m,g=!1,x;for(r==null&&(o=i(x=l())),h=0;h<=v;++h)!(h<v&&n(m=d[h],h,d))===g&&((g=!g)?o.lineStart():o.lineEnd()),g&&o.point(+e(m,h,d),+t(m,h,d));if(x)return o=null,x+""||null}return f.x=function(d){return arguments.length?(e=typeof d=="function"?d:St(+d),f):e},f.y=function(d){return arguments.length?(t=typeof d=="function"?d:St(+d),f):t},f.defined=function(d){return arguments.length?(n=typeof d=="function"?d:St(!!d),f):n},f.curve=function(d){return arguments.length?(i=d,r!=null&&(o=i(r)),f):i},f.context=function(d){return arguments.length?(d==null?r=o=null:o=i(r=d),f):r},f}function Mh(e,t,n){var r=null,i=St(!0),o=null,l=Ev,f=null,d=KO(h);e=typeof e=="function"?e:e===void 0?J3:St(+e),t=typeof t=="function"?t:St(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?ez:St(+n);function h(m){var g,x,O,j=(m=XO(m)).length,b,E=!1,_,A=new Array(j),C=new Array(j);for(o==null&&(f=l(_=d())),g=0;g<=j;++g){if(!(g<j&&i(b=m[g],g,m))===E)if(E=!E)x=g,f.areaStart(),f.lineStart();else{for(f.lineEnd(),f.lineStart(),O=g-1;O>=x;--O)f.point(A[O],C[O]);f.lineEnd(),f.areaEnd()}E&&(A[g]=+e(b,g,m),C[g]=+t(b,g,m),f.point(r?+r(b,g,m):A[g],n?+n(b,g,m):C[g]))}if(_)return f=null,_+""||null}function v(){return tz().defined(i).curve(l).context(o)}return h.x=function(m){return arguments.length?(e=typeof m=="function"?m:St(+m),r=null,h):e},h.x0=function(m){return arguments.length?(e=typeof m=="function"?m:St(+m),h):e},h.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:St(+m),h):r},h.y=function(m){return arguments.length?(t=typeof m=="function"?m:St(+m),n=null,h):t},h.y0=function(m){return arguments.length?(t=typeof m=="function"?m:St(+m),h):t},h.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:St(+m),h):n},h.lineX0=h.lineY0=function(){return v().x(e).y(t)},h.lineY1=function(){return v().x(e).y(n)},h.lineX1=function(){return v().x(r).y(t)},h.defined=function(m){return arguments.length?(i=typeof m=="function"?m:St(!!m),h):i},h.curve=function(m){return arguments.length?(l=m,o!=null&&(f=l(o)),h):l},h.context=function(m){return arguments.length?(m==null?o=f=null:f=l(o=m),h):o},h}class nz{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Ete(e){return new nz(e,!0)}function _te(e){return new nz(e,!1)}const QO={draw(e,t){const n=ea(t/Rm);e.moveTo(n,0),e.arc(0,0,n,0,Ov)}},Ate={draw(e,t){const n=ea(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},rz=ea(1/3),Nte=rz*2,Cte={draw(e,t){const n=ea(t/Nte),r=n*rz;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Tte={draw(e,t){const n=ea(t),r=-n/2;e.rect(r,r,n,n)}},Mte=.8908130915292852,az=Mm(Rm/10)/Mm(7*Rm/10),Rte=Mm(Ov/10)*az,Dte=-X3(Ov/10)*az,Pte={draw(e,t){const n=ea(t*Mte),r=Rte*n,i=Dte*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const l=Ov*o/5,f=X3(l),d=Mm(l);e.lineTo(d*n,-f*n),e.lineTo(f*r-d*i,d*r+f*i)}e.closePath()}},Qb=ea(3),kte={draw(e,t){const n=-ea(t/(Qb*3));e.moveTo(0,n*2),e.lineTo(-Qb*n,-n),e.lineTo(Qb*n,-n),e.closePath()}},jr=-.5,Or=ea(3)/2,ES=1/ea(12),$te=(ES/2+1)*3,Ite={draw(e,t){const n=ea(t/$te),r=n/2,i=n*ES,o=r,l=n*ES+n,f=-o,d=l;e.moveTo(r,i),e.lineTo(o,l),e.lineTo(f,d),e.lineTo(jr*r-Or*i,Or*r+jr*i),e.lineTo(jr*o-Or*l,Or*o+jr*l),e.lineTo(jr*f-Or*d,Or*f+jr*d),e.lineTo(jr*r+Or*i,jr*i-Or*r),e.lineTo(jr*o+Or*l,jr*l-Or*o),e.lineTo(jr*f+Or*d,jr*d-Or*f),e.closePath()}};function Lte(e,t){let n=null,r=KO(i);e=typeof e=="function"?e:St(e||QO),t=typeof t=="function"?t:St(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:St(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:St(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Dm(){}function Pm(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function iz(e){this._context=e}iz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Pm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zte(e){return new iz(e)}function oz(e){this._context=e}oz.prototype={areaStart:Dm,areaEnd:Dm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bte(e){return new oz(e)}function sz(e){this._context=e}sz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qte(e){return new sz(e)}function lz(e){this._context=e}lz.prototype={areaStart:Dm,areaEnd:Dm,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Ute(e){return new lz(e)}function EM(e){return e<0?-1:1}function _M(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),f=(o*i+l*r)/(r+i);return(EM(o)+EM(l))*Math.min(Math.abs(o),Math.abs(l),.5*Math.abs(f))||0}function AM(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Zb(e,t,n){var r=e._x0,i=e._y0,o=e._x1,l=e._y1,f=(o-r)/3;e._context.bezierCurveTo(r+f,i+f*t,o-f,l-f*n,o,l)}function km(e){this._context=e}km.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Zb(this,this._t0,AM(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Zb(this,AM(this,n=_M(this,e,t)),n);break;default:Zb(this,this._t0,n=_M(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function cz(e){this._context=new uz(e)}(cz.prototype=Object.create(km.prototype)).point=function(e,t){km.prototype.point.call(this,t,e)};function uz(e){this._context=e}uz.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function Hte(e){return new km(e)}function Fte(e){return new cz(e)}function fz(e){this._context=e}fz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=NM(e),i=NM(t),o=0,l=1;l<n;++o,++l)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function NM(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),l=new Array(n);for(i[0]=0,o[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function Gte(e){return new fz(e)}function _v(e,t){this._context=e,this._t=t}_v.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Vte(e){return new _v(e,.5)}function Yte(e){return new _v(e,0)}function Wte(e){return new _v(e,1)}function kl(e,t){if((l=e.length)>1)for(var n=1,r,i,o=e[t[0]],l,f=o.length;n<l;++n)for(i=o,o=e[t[n]],r=0;r<f;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function _S(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Kte(e,t){return e[t]}function Xte(e){const t=[];return t.key=e,t}function Qte(){var e=St([]),t=_S,n=kl,r=Kte;function i(o){var l=Array.from(e.apply(this,arguments),Xte),f,d=l.length,h=-1,v;for(const m of o)for(f=0,++h;f<d;++f)(l[f][h]=[0,+r(m,l[f].key,h,o)]).data=m;for(f=0,v=XO(t(l));f<d;++f)l[v[f]].index=f;return n(l,v),l}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:St(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:St(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?_S:typeof o=="function"?o:St(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??kl,i):n},i}function Zte(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,l;i<o;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}kl(e,t)}}function Jte(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var l=0,f=0;l<i;++l)f+=e[l][n][1]||0;r[n][1]+=r[n][0]=-f/2}kl(e,t)}}function ene(e,t){if(!(!((l=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,l;r<o;++r){for(var f=0,d=0,h=0;f<l;++f){for(var v=e[t[f]],m=v[r][1]||0,g=v[r-1][1]||0,x=(m-g)/2,O=0;O<f;++O){var j=e[t[O]],b=j[r][1]||0,E=j[r-1][1]||0;x+=b-E}d+=m,h+=x*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=h/d)}i[r-1][1]+=i[r-1][0]=n,kl(e,t)}}function Ju(e){"@babel/helpers - typeof";return Ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ju(e)}var tne=["type","size","sizeType"];function AS(){return AS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AS.apply(this,arguments)}function CM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function TM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CM(Object(n),!0).forEach(function(r){nne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nne(e,t,n){return t=rne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rne(e){var t=ane(e,"string");return Ju(t)=="symbol"?t:t+""}function ane(e,t){if(Ju(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ju(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ine(e,t){if(e==null)return{};var n=one(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function one(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var dz={symbolCircle:QO,symbolCross:Ate,symbolDiamond:Cte,symbolSquare:Tte,symbolStar:Pte,symbolTriangle:kte,symbolWye:Ite},sne=Math.PI/180,lne=function(t){var n="symbol".concat(jv(t));return dz[n]||QO},cne=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*sne;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},une=function(t,n){dz["symbol".concat(jv(t))]=n},ZO=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,l=t.sizeType,f=l===void 0?"area":l,d=ine(t,tne),h=TM(TM({},d),{},{type:r,size:o,sizeType:f}),v=function(){var b=lne(r),E=Lte().type(b).size(cne(o,f,r));return E()},m=h.className,g=h.cx,x=h.cy,O=nt(h,!0);return g===+g&&x===+x&&o===+o?I.createElement("path",AS({},O,{className:et("recharts-symbols",m),transform:"translate(".concat(g,", ").concat(x,")"),d:v()})):null};ZO.registerSymbol=une;function $l(e){"@babel/helpers - typeof";return $l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$l(e)}function NS(){return NS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NS.apply(this,arguments)}function MM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MM(Object(n),!0).forEach(function(r){ef(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mz(r.key),r)}}function mne(e,t,n){return t&&hne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pne(e,t,n){return t=$m(t),vne(e,hz()?Reflect.construct(t,n||[],$m(e).constructor):t.apply(e,n))}function vne(e,t){if(t&&($l(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gne(e)}function gne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hz=function(){return!!e})()}function $m(e){return $m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$m(e)}function yne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&CS(e,t)}function CS(e,t){return CS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},CS(e,t)}function ef(e,t,n){return t=mz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mz(e){var t=xne(e,"string");return $l(t)=="symbol"?t:t+""}function xne(e,t){if($l(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($l(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Er=32,JO=(function(e){function t(){return dne(this,t),pne(this,t,arguments)}return yne(t,e),mne(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,o=Er/2,l=Er/6,f=Er/3,d=r.inactive?i:r.color;if(r.type==="plainline")return I.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:Er,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return I.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(o,"h").concat(f,`
|
|
66
|
+
Defaulting to \`null\`.`}var SX=oL,jX=lL;function tv({className:e,value:t,indicatorClassName:n,...r}){return c.jsx(SX,{className:pe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),"data-slot":"progress",...r,children:c.jsx(jX,{className:pe("h-full w-full flex-1 bg-primary transition-all",n),"data-slot":"progress-indicator",style:{transform:`translateX(-${100-(t||0)}%)`}})})}var uL="Toggle",fL=S.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[l,f]=An({prop:n,onChange:i,defaultProp:r??!1,caller:uL});return c.jsx(Ae.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:ge(e.onClick,()=>{e.disabled||f(!l)})})});fL.displayName=uL;var co="ToggleGroup",[dL]=jn(co,[mc]),hL=mc(),TO=I.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const i=r;return c.jsx(OX,{...i,ref:t})}if(n==="multiple"){const i=r;return c.jsx(EX,{...i,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${co}\``)});TO.displayName=co;var[mL,pL]=dL(co),OX=I.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[l,f]=An({prop:n,defaultProp:r??"",onChange:i,caller:co});return c.jsx(mL,{scope:e.__scopeToggleGroup,type:"single",value:I.useMemo(()=>l?[l]:[],[l]),onItemActivate:f,onItemDeactivate:I.useCallback(()=>f(""),[f]),children:c.jsx(vL,{...o,ref:t})})}),EX=I.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[l,f]=An({prop:n,defaultProp:r??[],onChange:i,caller:co}),d=I.useCallback(v=>f((m=[])=>[...m,v]),[f]),h=I.useCallback(v=>f((m=[])=>m.filter(g=>g!==v)),[f]);return c.jsx(mL,{scope:e.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:d,onItemDeactivate:h,children:c.jsx(vL,{...o,ref:t})})});TO.displayName=co;var[_X,AX]=dL(co),vL=I.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:o,dir:l,loop:f=!0,...d}=e,h=hL(n),v=hc(l),m={role:"group",dir:v,...d};return c.jsx(_X,{scope:n,rovingFocus:i,disabled:r,children:i?c.jsx(xO,{asChild:!0,...h,orientation:o,dir:v,loop:f,children:c.jsx(Ae.div,{...m,ref:t})}):c.jsx(Ae.div,{...m,ref:t})})}),wm="ToggleGroupItem",gL=I.forwardRef((e,t)=>{const n=pL(wm,e.__scopeToggleGroup),r=AX(wm,e.__scopeToggleGroup),i=hL(e.__scopeToggleGroup),o=n.value.includes(e.value),l=r.disabled||e.disabled,f={...e,pressed:o,disabled:l},d=I.useRef(null);return r.rovingFocus?c.jsx(bO,{asChild:!0,...i,focusable:!l,active:o,ref:d,children:c.jsx(XC,{...f,ref:t})}):c.jsx(XC,{...f,ref:t})});gL.displayName=wm;var XC=I.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,o=pL(wm,n),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},f=o.type==="single"?l:void 0;return c.jsx(fL,{...f,...i,ref:t,onPressedChange:d=>{d?o.onItemActivate(r):o.onItemDeactivate(r)}})}),NX=TO,CX=gL;const TX=ic("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}}),yL=S.createContext({size:"default",variant:"default",spacing:0});function MX({className:e,variant:t,size:n,spacing:r=0,children:i,...o}){return c.jsx(NX,{className:pe("group/toggle-group flex w-fit items-center gap-[var(--gap)] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",e),"data-size":n,"data-slot":"toggle-group","data-spacing":r,"data-variant":t,style:{"--gap":r},...o,children:c.jsx(yL.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function QC({className:e,children:t,variant:n,size:r,...i}){const o=S.useContext(yL);return c.jsx(CX,{className:pe(TX({variant:o.variant||n,size:o.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:first:border-l data-[spacing=0]:first:rounded-l-md",e),"data-size":o.size||r,"data-slot":"toggle-group-item","data-spacing":o.spacing,"data-variant":o.variant||n,...i,children:t})}function ha(...e){return u$(et(e))}function ma({value:e,className:t,variant:n="outline",size:r="icon",label:i}){const[o,l]=S.useState("idle"),f=async d=>{d.stopPropagation(),l("copying");try{await Promise.all([navigator.clipboard.writeText(e),new Promise(h=>setTimeout(h,150))]),l("copied"),jt.success("Copied to clipboard"),setTimeout(()=>l("idle"),2e3)}catch{l("idle"),jt.error("Failed to copy to clipboard")}};return c.jsxs(Ce,{className:ha("transition-all",o==="copied"&&"text-green-500",t),disabled:o==="copying",onClick:f,size:r,variant:n,children:[o==="copying"?c.jsx(fa,{className:ha("animate-spin",i?"mr-2 h-4 w-4":"h-4 w-4")}):o==="copied"?c.jsx(ai,{className:ha(i?"mr-2 h-4 w-4":"h-4 w-4")}):c.jsx(zj,{className:ha(i?"mr-2 h-4 w-4":"h-4 w-4")}),i]})}function xL({onDelete:e,className:t,variant:n="outline",size:r="icon",label:i}){const[o,l]=S.useState(!1),f=async d=>{d.stopPropagation(),l(!0);try{await Promise.all([e(),new Promise(h=>setTimeout(h,150))])}finally{l(!1)}};return c.jsxs(Ce,{className:ha("text-destructive transition-all hover:text-destructive",t),disabled:o,onClick:f,size:r,variant:n,children:[o?c.jsx(fa,{className:ha("animate-spin",i?"mr-1.5 h-4 w-4":"h-4 w-4")}):c.jsx(oF,{className:ha(i?"mr-1.5 h-4 w-4":"h-4 w-4")}),i]})}function MO({...e}){return c.jsx(Wj,{"data-slot":"dialog",...e})}function RX({...e}){return c.jsx(Kj,{"data-slot":"dialog-portal",...e})}function DX({className:e,...t}){return c.jsx(Xj,{className:pe("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"dialog-overlay",...t})}function RO({className:e,children:t,showCloseButton:n=!0,...r}){return c.jsxs(RX,{"data-slot":"dialog-portal",children:[c.jsx(DX,{}),c.jsxs(Qj,{className:pe("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",e),"data-slot":"dialog-content",...r,children:[t,n&&c.jsxs(Pp,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0","data-slot":"dialog-close",children:[c.jsx(or,{}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function bL({className:e,...t}){return c.jsx("div",{className:pe("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"dialog-header",...t})}function wL({className:e,...t}){return c.jsx("div",{className:pe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...t})}function SL({className:e,...t}){return c.jsx(Zj,{className:pe("font-semibold text-lg leading-none",e),"data-slot":"dialog-title",...t})}function PX({className:e,...t}){return c.jsx(Jj,{className:pe("text-muted-foreground text-sm",e),"data-slot":"dialog-description",...t})}const jL=6048e5,kX=864e5,Nh=43200,ZC=1440,JC=Symbol.for("constructDateFrom");function li(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&JC in e?e[JC](t):e instanceof Date?new e.constructor(t):new Date(t)}function sn(e,t){return li(t||e,e)}let $X={};function Yf(){return $X}function Zu(e,t){const n=Yf(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=sn(e,t?.in),o=i.getDay(),l=(o<r?7:0)+o-r;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function Sm(e,t){return Zu(e,{...t,weekStartsOn:1})}function OL(e,t){const n=sn(e,t?.in),r=n.getFullYear(),i=li(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=Sm(i),l=li(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const f=Sm(l);return n.getTime()>=o.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function jm(e){const t=sn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function nv(e,...t){const n=li.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function eT(e,t){const n=sn(e,t?.in);return n.setHours(0,0,0,0),n}function IX(e,t,n){const[r,i]=nv(n?.in,e,t),o=eT(r),l=eT(i),f=+o-jm(o),d=+l-jm(l);return Math.round((f-d)/kX)}function LX(e,t){const n=OL(e,t),r=li(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Sm(r)}function Qh(e,t){const n=+sn(e)-+sn(t);return n<0?-1:n>0?1:n}function zX(e){return li(e,Date.now())}function BX(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function qX(e){return!(!BX(e)&&typeof e!="number"||isNaN(+sn(e)))}function UX(e,t,n){const[r,i]=nv(n?.in,e,t),o=r.getFullYear()-i.getFullYear(),l=r.getMonth()-i.getMonth();return o*12+l}function HX(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function FX(e,t){return+sn(e)-+sn(t)}function GX(e,t){const n=sn(e,t?.in);return n.setHours(23,59,59,999),n}function VX(e,t){const n=sn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function YX(e,t){const n=sn(e,t?.in);return+GX(n,t)==+VX(n,t)}function WX(e,t,n){const[r,i,o]=nv(n?.in,e,e,t),l=Qh(i,o),f=Math.abs(UX(i,o));if(f<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-l*f);let d=Qh(i,o)===-l;YX(r)&&f===1&&Qh(r,o)===1&&(d=!1);const h=l*(f-+d);return h===0?0:h}function KX(e,t,n){const r=FX(e,t)/1e3;return HX(n?.roundingMethod)(r)}function XX(e,t){const n=sn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const QX={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ZX=(e,t,n)=>{let r;const i=QX[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function kx(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const JX={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},eQ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},tQ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nQ={date:kx({formats:JX,defaultWidth:"full"}),time:kx({formats:eQ,defaultWidth:"full"}),dateTime:kx({formats:tQ,defaultWidth:"full"})},rQ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},aQ=(e,t,n,r)=>rQ[e];function bu(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,f=n?.width?String(n.width):l;i=e.formattingValues[f]||e.formattingValues[l]}else{const l=e.defaultWidth,f=n?.width?String(n.width):e.defaultWidth;i=e.values[f]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const iQ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},oQ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},sQ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},lQ={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},cQ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},uQ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},fQ=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},dQ={ordinalNumber:fQ,era:bu({values:iQ,defaultWidth:"wide"}),quarter:bu({values:oQ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:bu({values:sQ,defaultWidth:"wide"}),day:bu({values:lQ,defaultWidth:"wide"}),dayPeriod:bu({values:cQ,defaultWidth:"wide",formattingValues:uQ,defaultFormattingWidth:"wide"})};function wu(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const l=o[0],f=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(f)?mQ(f,m=>m.test(l)):hQ(f,m=>m.test(l));let h;h=e.valueCallback?e.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const v=t.slice(l.length);return{value:h,rest:v}}}function hQ(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function mQ(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function pQ(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const f=t.slice(i.length);return{value:l,rest:f}}}const vQ=/^(\d+)(th|st|nd|rd)?/i,gQ=/\d+/i,yQ={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},xQ={any:[/^b/i,/^(a|c)/i]},bQ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wQ={any:[/1/i,/2/i,/3/i,/4/i]},SQ={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},jQ={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},OQ={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},EQ={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},_Q={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},AQ={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},NQ={ordinalNumber:pQ({matchPattern:vQ,parsePattern:gQ,valueCallback:e=>parseInt(e,10)}),era:wu({matchPatterns:yQ,defaultMatchWidth:"wide",parsePatterns:xQ,defaultParseWidth:"any"}),quarter:wu({matchPatterns:bQ,defaultMatchWidth:"wide",parsePatterns:wQ,defaultParseWidth:"any",valueCallback:e=>e+1}),month:wu({matchPatterns:SQ,defaultMatchWidth:"wide",parsePatterns:jQ,defaultParseWidth:"any"}),day:wu({matchPatterns:OQ,defaultMatchWidth:"wide",parsePatterns:EQ,defaultParseWidth:"any"}),dayPeriod:wu({matchPatterns:_Q,defaultMatchWidth:"any",parsePatterns:AQ,defaultParseWidth:"any"})},EL={code:"en-US",formatDistance:ZX,formatLong:nQ,formatRelative:aQ,localize:dQ,match:NQ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function CQ(e,t){const n=sn(e,t?.in);return IX(n,XX(n))+1}function TQ(e,t){const n=sn(e,t?.in),r=+Sm(n)-+LX(n);return Math.round(r/jL)+1}function _L(e,t){const n=sn(e,t?.in),r=n.getFullYear(),i=Yf(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,l=li(t?.in||e,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const f=Zu(l,t),d=li(t?.in||e,0);d.setFullYear(r,0,o),d.setHours(0,0,0,0);const h=Zu(d,t);return+n>=+f?r+1:+n>=+h?r:r-1}function MQ(e,t){const n=Yf(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=_L(e,t),o=li(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Zu(o,t)}function RQ(e,t){const n=sn(e,t?.in),r=+Zu(n,t)-+MQ(n,t);return Math.round(r/jL)+1}function dt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Vi={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return dt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):dt(n+1,2)},d(e,t){return dt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return dt(e.getHours()%12||12,t.length)},H(e,t){return dt(e.getHours(),t.length)},m(e,t){return dt(e.getMinutes(),t.length)},s(e,t){return dt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return dt(i,t.length)}},hl={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tT={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Vi.y(e,t)},Y:function(e,t,n,r){const i=_L(e,r),o=i>0?i:1-i;if(t==="YY"){const l=o%100;return dt(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):dt(o,t.length)},R:function(e,t){const n=OL(e);return dt(n,t.length)},u:function(e,t){const n=e.getFullYear();return dt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return dt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return dt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Vi.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return dt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=RQ(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):dt(i,t.length)},I:function(e,t,n){const r=TQ(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):dt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Vi.d(e,t)},D:function(e,t,n){const r=CQ(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):dt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return dt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return dt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return dt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=hl.noon:r===0?i=hl.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=hl.evening:r>=12?i=hl.afternoon:r>=4?i=hl.morning:i=hl.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Vi.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Vi.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):dt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):dt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Vi.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Vi.s(e,t)},S:function(e,t){return Vi.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return rT(r);case"XXXX":case"XX":return Uo(r);case"XXXXX":case"XXX":default:return Uo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return rT(r);case"xxxx":case"xx":return Uo(r);case"xxxxx":case"xxx":default:return Uo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nT(r,":");case"OOOO":default:return"GMT"+Uo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nT(r,":");case"zzzz":default:return"GMT"+Uo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return dt(r,t.length)},T:function(e,t,n){return dt(+e,t.length)}};function nT(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+dt(o,2)}function rT(e,t){return e%60===0?(e>0?"-":"+")+dt(Math.abs(e)/60,2):Uo(e,t)}function Uo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=dt(Math.trunc(r/60),2),o=dt(r%60,2);return n+i+t+o}const aT=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},AL=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},DQ=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return aT(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",aT(r,t)).replace("{{time}}",AL(i,t))},PQ={p:AL,P:DQ},kQ=/^D+$/,$Q=/^Y+$/,IQ=["D","DD","YY","YYYY"];function LQ(e){return kQ.test(e)}function zQ(e){return $Q.test(e)}function BQ(e,t,n){const r=qQ(e,t,n);if(console.warn(r),IQ.includes(e))throw new RangeError(r)}function qQ(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const UQ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,HQ=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FQ=/^'([^]*?)'?$/,GQ=/''/g,VQ=/[a-zA-Z]/;function oS(e,t,n){const r=Yf(),i=r.locale??EL,o=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,f=sn(e,n?.in);if(!qX(f))throw new RangeError("Invalid time value");let d=t.match(HQ).map(v=>{const m=v[0];if(m==="p"||m==="P"){const g=PQ[m];return g(v,i.formatLong)}return v}).join("").match(UQ).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const m=v[0];if(m==="'")return{isToken:!1,value:YQ(v)};if(tT[m])return{isToken:!0,value:v};if(m.match(VQ))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:v}});i.localize.preprocessor&&(d=i.localize.preprocessor(f,d));const h={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return d.map(v=>{if(!v.isToken)return v.value;const m=v.value;(zQ(m)||LQ(m))&&BQ(m,t,String(e));const g=tT[m[0]];return g(f,m,i.localize,h)}).join("")}function YQ(e){const t=e.match(FQ);return t?t[1].replace(GQ,"'"):e}function WQ(e,t,n){const r=Yf(),i=n?.locale??r.locale??EL,o=2520,l=Qh(e,t);if(isNaN(l))throw new RangeError("Invalid time value");const f=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:l}),[d,h]=nv(n?.in,...l>0?[t,e]:[e,t]),v=KX(h,d),m=(jm(h)-jm(d))/1e3,g=Math.round((v-m)/60);let x;if(g<2)return n?.includeSeconds?v<5?i.formatDistance("lessThanXSeconds",5,f):v<10?i.formatDistance("lessThanXSeconds",10,f):v<20?i.formatDistance("lessThanXSeconds",20,f):v<40?i.formatDistance("halfAMinute",0,f):v<60?i.formatDistance("lessThanXMinutes",1,f):i.formatDistance("xMinutes",1,f):g===0?i.formatDistance("lessThanXMinutes",1,f):i.formatDistance("xMinutes",g,f);if(g<45)return i.formatDistance("xMinutes",g,f);if(g<90)return i.formatDistance("aboutXHours",1,f);if(g<ZC){const O=Math.round(g/60);return i.formatDistance("aboutXHours",O,f)}else{if(g<o)return i.formatDistance("xDays",1,f);if(g<Nh){const O=Math.round(g/ZC);return i.formatDistance("xDays",O,f)}else if(g<Nh*2)return x=Math.round(g/Nh),i.formatDistance("aboutXMonths",x,f)}if(x=WX(h,d),x<12){const O=Math.round(g/Nh);return i.formatDistance("xMonths",O,f)}else{const O=x%12,j=Math.trunc(x/12);return O<3?i.formatDistance("aboutXYears",j,f):O<9?i.formatDistance("overXYears",j,f):i.formatDistance("almostXYears",j+1,f)}}function KQ(e,t){return WQ(e,zX(e),t)}function rv({starred:e,onToggle:t,className:n,variant:r="ghost",size:i="icon",label:o}){const[l,f]=S.useState(!1),d=async h=>{h.stopPropagation(),f(!0);try{await Promise.all([t(),new Promise(v=>setTimeout(v,150))])}finally{f(!1)}};return c.jsxs(Ce,{className:ha("transition-all",n),disabled:l,onClick:d,size:i,variant:r,children:[l?c.jsx(fa,{className:ha("animate-spin",o?"mr-1.5 h-4 w-4":"h-4 w-4")}):c.jsx(b$,{className:ha("transition-colors",o?"mr-1.5 h-4 w-4":"h-4 w-4",e?"fill-yellow-500 text-yellow-500":"text-muted-foreground")}),o,!o&&c.jsx("span",{className:"sr-only",children:e?"Unstar":"Star"})]})}function XQ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function NL(e){return e.split(".").pop()?.toLowerCase()||""}function QQ(e,t){if(e?.startsWith("image/"))return!0;const n=t?NL(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function ZQ({file:e,onClose:t,onToggleStar:n,onDelete:r}){const i=e.key.split("/").pop()||e.key,o=NL(i),l=QQ(e.contentType,i),f=()=>{const d=document.createElement("a");d.href=e.url,d.download=i,d.target="_blank",d.click()};return c.jsx(MO,{onOpenChange:d=>!d&&t(),open:!0,children:c.jsx(RO,{className:"max-h-[90vh] max-w-4xl overflow-y-auto [&>button]:hidden",children:c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("h2",{className:"font-bold text-2xl",children:i}),e.key!==i&&c.jsx("p",{className:"mt-1 text-muted-foreground text-sm",children:e.key})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(rv,{onToggle:()=>n(e.key,!e.starred),starred:e.starred,variant:"outline"}),c.jsx(xL,{onDelete:()=>r(e.key)}),c.jsx(Ce,{onClick:t,size:"icon",variant:"outline",children:c.jsx(or,{className:"h-4 w-4"})})]})]}),c.jsx("div",{className:"aspect-video overflow-hidden rounded-lg bg-muted",children:l&&e.url.startsWith("https://")?c.jsx("img",{alt:i,className:"h-full w-full object-contain",src:e.url}):c.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2",children:[l?c.jsx(Bj,{className:"h-16 w-16 text-muted-foreground/50"}):c.jsx(qj,{className:"h-16 w-16 text-muted-foreground/50"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Preview not available"})]})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(ma,{className:"flex-1",label:"Copy CDN URL",size:"default",value:e.url,variant:"default"}),c.jsxs(Ce,{className:"flex-1 gap-2 bg-transparent",onClick:()=>window.open(e.url,"_blank"),variant:"outline",children:[c.jsx(Hu,{className:"h-4 w-4"}),"Open in New Tab"]}),c.jsxs(Ce,{className:"flex-1 gap-2 bg-transparent",onClick:f,variant:"outline",children:[c.jsx(XH,{className:"h-4 w-4"}),"Download"]})]}),c.jsx(Vt,{}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"File Information"}),c.jsxs("dl",{className:"space-y-2 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Format"}),c.jsx("dd",{className:"font-medium",children:c.jsx(Be,{variant:"secondary",children:o.toUpperCase()})})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Size"}),c.jsx("dd",{className:"font-medium",children:XQ(e.size)})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Content Type"}),c.jsx("dd",{className:"font-medium",children:e.contentType||"Unknown"})]})]})]})}),c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"Metadata"}),c.jsxs("dl",{className:"space-y-2 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Last Modified"}),c.jsx("dd",{className:"font-medium",children:oS(new Date(e.lastModified),"MMM d, yyyy 'at' h:mm a")})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Starred"}),c.jsx("dd",{className:"font-medium",children:e.starred?"Yes":"No"})]}),e.tags.length>0&&c.jsxs("div",{children:[c.jsx("dt",{className:"mb-1 text-muted-foreground",children:"Tags"}),c.jsx("dd",{className:"flex flex-wrap gap-1",children:e.tags.filter(d=>d.key!=="starred").map(d=>c.jsxs(Be,{variant:"secondary",children:[d.key,": ",d.value]},d.key))})]})]})]})})]}),c.jsx(Vt,{}),c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"CDN URL"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("code",{className:"flex-1 break-all rounded bg-muted px-3 py-2 text-sm",children:e.url}),c.jsx(ma,{size:"sm",value:e.url})]})]})]})})})}function av(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var iv="Checkbox",[JQ]=jn(iv),[eZ,DO]=JQ(iv);function tZ(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:l,name:f,onCheckedChange:d,required:h,value:v="on",internal_do_not_use_render:m}=e,[g,x]=An({prop:n,defaultProp:i??!1,onChange:d,caller:iv}),[O,j]=S.useState(null),[b,E]=S.useState(null),_=S.useRef(!1),A=O?!!l||!!O.closest("form"):!0,C={checked:g,disabled:o,setChecked:x,control:O,setControl:j,name:f,form:l,value:v,hasConsumerStoppedPropagationRef:_,required:h,defaultChecked:Qi(i)?!1:i,isFormControl:A,bubbleInput:b,setBubbleInput:E};return c.jsx(eZ,{scope:t,...C,children:nZ(m)?m(C):r})}var CL="CheckboxTrigger",TL=S.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:l,disabled:f,checked:d,required:h,setControl:v,setChecked:m,hasConsumerStoppedPropagationRef:g,isFormControl:x,bubbleInput:O}=DO(CL,e),j=Ue(i,v),b=S.useRef(d);return S.useEffect(()=>{const E=o?.form;if(E){const _=()=>m(b.current);return E.addEventListener("reset",_),()=>E.removeEventListener("reset",_)}},[o,m]),c.jsx(Ae.button,{type:"button",role:"checkbox","aria-checked":Qi(d)?"mixed":d,"aria-required":h,"data-state":$L(d),"data-disabled":f?"":void 0,disabled:f,value:l,...r,ref:j,onKeyDown:ge(t,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:ge(n,E=>{m(_=>Qi(_)?!0:!_),O&&x&&(g.current=E.isPropagationStopped(),g.current||E.stopPropagation())})})});TL.displayName=CL;var ML=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:l,disabled:f,value:d,onCheckedChange:h,form:v,...m}=e;return c.jsx(tZ,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:f,required:l,onCheckedChange:h,name:r,form:v,value:d,internal_do_not_use_render:({isFormControl:g})=>c.jsxs(c.Fragment,{children:[c.jsx(TL,{...m,ref:t,__scopeCheckbox:n}),g&&c.jsx(kL,{__scopeCheckbox:n})]})})});ML.displayName=iv;var RL="CheckboxIndicator",DL=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=DO(RL,n);return c.jsx(Nn,{present:r||Qi(o.checked)||o.checked===!0,children:c.jsx(Ae.span,{"data-state":$L(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});DL.displayName=RL;var PL="CheckboxBubbleInput",kL=S.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:l,required:f,disabled:d,name:h,value:v,form:m,bubbleInput:g,setBubbleInput:x}=DO(PL,e),O=Ue(n,x),j=av(o),b=zp(r);S.useEffect(()=>{const _=g;if(!_)return;const A=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(A,"checked").set,M=!i.current;if(j!==o&&N){const R=new Event("click",{bubbles:M});_.indeterminate=Qi(o),N.call(_,Qi(o)?!1:o),_.dispatchEvent(R)}},[g,j,o,i]);const E=S.useRef(Qi(o)?!1:o);return c.jsx(Ae.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??E.current,required:f,disabled:d,name:h,value:v,form:m,...t,tabIndex:-1,ref:O,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});kL.displayName=PL;function nZ(e){return typeof e=="function"}function Qi(e){return e==="indeterminate"}function $L(e){return Qi(e)?"indeterminate":e?"checked":"unchecked"}function sS({className:e,...t}){return c.jsx(ML,{className:pe("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:data-[state=checked]:bg-primary dark:aria-invalid:ring-destructive/40",e),"data-slot":"checkbox",...t,children:c.jsx(DL,{className:"grid place-content-center text-current transition-none","data-slot":"checkbox-indicator",children:c.jsx(ai,{className:"size-3.5"})})})}function rZ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function IL(e){return e.split(".").pop()?.toLowerCase()||""}function aZ(e,t){if(e?.startsWith("image/"))return!0;const n=t?IL(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function iZ({files:e,selectedFiles:t,onSelectFile:n,onToggleStar:r,onFileClick:i}){const o=(l,f)=>{l.stopPropagation(),window.open(f,"_blank")};return c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:e.map(l=>{const f=l.key.split("/").pop()||l.key,d=IL(f),h=aZ(l.contentType,f),v=t.includes(l.key);return c.jsxs("div",{className:"group relative cursor-pointer overflow-hidden rounded-xl bg-muted shadow-sm transition-shadow hover:shadow-md",onClick:()=>i(l),children:[c.jsx("div",{className:"flex aspect-square items-center justify-center",children:h&&l.url.startsWith("https://")?c.jsx("img",{alt:f,className:"h-full w-full object-cover",src:l.url}):c.jsx("div",{className:"flex h-full w-full items-center justify-center",children:h?c.jsx(Bj,{className:"h-12 w-12 text-muted-foreground/50"}):c.jsx(qj,{className:"h-12 w-12 text-muted-foreground/50"})})}),c.jsx(rv,{className:"absolute top-2 right-2 rounded-full bg-background/80 hover:bg-background/90",onToggle:()=>r(l.key,!l.starred),starred:l.starred}),c.jsxs(Te,{className:"gap-2 rounded-t-none border-none py-3 shadow-none",children:[c.jsxs(Me,{className:"gap-1 px-3 py-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{onClick:m=>m.stopPropagation(),children:c.jsx(sS,{checked:v,onCheckedChange:()=>n(l.key)})}),c.jsx(Le,{className:"min-w-0 flex-1 truncate text-sm",children:f})]}),c.jsxs(We,{className:"flex items-center gap-2 pl-6",children:[c.jsx(Be,{className:"rounded-sm text-[10px]",variant:"outline",children:d.toUpperCase()}),c.jsx("span",{className:"text-xs",children:rZ(l.size)})]})]}),c.jsxs(pX,{className:"justify-end gap-1 px-3 py-0 opacity-0 transition-opacity group-hover:opacity-100",children:[c.jsx(ma,{className:"h-7 px-2",label:"Copy",size:"sm",value:l.url,variant:"ghost"}),c.jsxs(Ce,{className:"h-7 px-2",onClick:m=>o(m,l.url),size:"sm",variant:"ghost",children:[c.jsx(Hu,{className:"mr-1 h-3 w-3"}),"Open"]})]})]})]},l.key)})})}var $x,ov="HoverCard",[LL]=jn(ov,[lo]),sv=lo(),[oZ,lv]=LL(ov),zL=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:l=700,closeDelay:f=300}=e,d=sv(t),h=S.useRef(0),v=S.useRef(0),m=S.useRef(!1),g=S.useRef(!1),[x,O]=An({prop:r,defaultProp:i??!1,onChange:o,caller:ov}),j=S.useCallback(()=>{clearTimeout(v.current),h.current=window.setTimeout(()=>O(!0),l)},[l,O]),b=S.useCallback(()=>{clearTimeout(h.current),!m.current&&!g.current&&(v.current=window.setTimeout(()=>O(!1),f))},[f,O]),E=S.useCallback(()=>O(!1),[O]);return S.useEffect(()=>()=>{clearTimeout(h.current),clearTimeout(v.current)},[]),c.jsx(oZ,{scope:t,open:x,onOpenChange:O,onOpen:j,onClose:b,onDismiss:E,hasSelectionRef:m,isPointerDownOnContentRef:g,children:c.jsx(Bp,{...d,children:n})})};zL.displayName=ov;var BL="HoverCardTrigger",qL=S.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=lv(BL,n),o=sv(n);return c.jsx(qp,{asChild:!0,...o,children:c.jsx(Ae.a,{"data-state":i.open?"open":"closed",...r,ref:t,onPointerEnter:ge(e.onPointerEnter,Em(i.onOpen)),onPointerLeave:ge(e.onPointerLeave,Em(i.onClose)),onFocus:ge(e.onFocus,i.onOpen),onBlur:ge(e.onBlur,i.onClose),onTouchStart:ge(e.onTouchStart,l=>l.preventDefault())})})});qL.displayName=BL;var PO="HoverCardPortal",[sZ,lZ]=LL(PO,{forceMount:void 0}),UL=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,o=lv(PO,t);return c.jsx(sZ,{scope:t,forceMount:n,children:c.jsx(Nn,{present:n||o.open,children:c.jsx(sc,{asChild:!0,container:i,children:r})})})};UL.displayName=PO;var Om="HoverCardContent",HL=S.forwardRef((e,t)=>{const n=lZ(Om,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=lv(Om,e.__scopeHoverCard);return c.jsx(Nn,{present:r||o.open,children:c.jsx(cZ,{"data-state":o.open?"open":"closed",...i,onPointerEnter:ge(e.onPointerEnter,Em(o.onOpen)),onPointerLeave:ge(e.onPointerLeave,Em(o.onClose)),ref:t})})});HL.displayName=Om;var cZ=S.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,...f}=e,d=lv(Om,n),h=sv(n),v=S.useRef(null),m=Ue(t,v),[g,x]=S.useState(!1);return S.useEffect(()=>{if(g){const O=document.body;return $x=O.style.userSelect||O.style.webkitUserSelect,O.style.userSelect="none",O.style.webkitUserSelect="none",()=>{O.style.userSelect=$x,O.style.webkitUserSelect=$x}}},[g]),S.useEffect(()=>{if(v.current){const O=()=>{x(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",O),()=>{document.removeEventListener("pointerup",O),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),S.useEffect(()=>{v.current&&dZ(v.current).forEach(j=>j.setAttribute("tabindex","-1"))}),c.jsx(oc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:ge(o,O=>{O.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(Up,{...h,...f,onPointerDown:ge(f.onPointerDown,O=>{O.currentTarget.contains(O.target)&&x(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:m,style:{...f.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),uZ="HoverCardArrow",fZ=S.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=sv(n);return c.jsx(Hp,{...i,...r,ref:t})});fZ.displayName=uZ;function Em(e){return t=>t.pointerType==="touch"?void 0:e()}function dZ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var hZ=zL,mZ=qL,pZ=UL,vZ=HL;function gZ({...e}){return c.jsx(hZ,{"data-slot":"hover-card",...e})}function yZ({...e}){return c.jsx(mZ,{"data-slot":"hover-card-trigger",...e})}function xZ({className:e,align:t="center",sideOffset:n=4,...r}){return c.jsx(pZ,{"data-slot":"hover-card-portal",children:c.jsx(vZ,{align:t,className:pe("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 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"hover-card-content",sideOffset:n,...r})})}function cv({className:e,...t}){return c.jsx("div",{className:"relative w-full overflow-x-auto","data-slot":"table-container",children:c.jsx("table",{className:pe("w-full caption-bottom text-sm",e),"data-slot":"table",...t})})}function uv({className:e,...t}){return c.jsx("thead",{className:pe("[&_tr]:border-b",e),"data-slot":"table-header",...t})}function fv({className:e,...t}){return c.jsx("tbody",{className:pe("[&_tr:last-child]:border-0",e),"data-slot":"table-body",...t})}function Fn({className:e,...t}){return c.jsx("tr",{className:pe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),"data-slot":"table-row",...t})}function Pt({className:e,...t}){return c.jsx("th",{className:pe("h-10 whitespace-nowrap px-2 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),"data-slot":"table-head",...t})}function ht({className:e,...t}){return c.jsx("td",{className:pe("whitespace-nowrap p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),"data-slot":"table-cell",...t})}function bZ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function FL(e){return e.split(".").pop()?.toLowerCase()||""}function wZ(e,t){if(e?.startsWith("image/"))return!0;const n=t?FL(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function SZ({files:e,selectedFiles:t,onSelectFile:n,onSelectAll:r,onToggleStar:i,onFileClick:o}){const l=(f,d)=>{f.stopPropagation(),window.open(d,"_blank")};return c.jsx("div",{className:"overflow-hidden rounded-lg border border-border",children:c.jsxs(cv,{children:[c.jsx(uv,{children:c.jsxs(Fn,{className:"bg-muted/50",children:[c.jsx(Pt,{className:"w-12",children:c.jsx(sS,{checked:t.length===e.length&&e.length>0,onCheckedChange:r})}),c.jsx(Pt,{className:"w-12"}),c.jsx(Pt,{children:"Name"}),c.jsx(Pt,{children:"Format"}),c.jsx(Pt,{children:"Size"}),c.jsx(Pt,{children:"Modified"}),c.jsx(Pt,{className:"w-24",children:"Actions"})]})}),c.jsx(fv,{children:e.map(f=>{const d=f.key.split("/").pop()||f.key,h=FL(d),v=wZ(f.contentType,d);return c.jsxs(Fn,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>o(f),children:[c.jsx(ht,{onClick:m=>m.stopPropagation(),children:c.jsx(sS,{checked:t.includes(f.key),onCheckedChange:()=>n(f.key)})}),c.jsx(ht,{onClick:m=>m.stopPropagation(),children:c.jsx(rv,{className:"h-8 w-8",onToggle:()=>i(f.key,!f.starred),starred:f.starred})}),c.jsx(ht,{children:c.jsxs("div",{className:"flex items-center gap-3",children:[v&&f.url.startsWith("https://")?c.jsxs(gZ,{closeDelay:200,openDelay:100,children:[c.jsx(yZ,{asChild:!0,children:c.jsx("div",{className:"h-10 w-14 shrink-0 cursor-pointer overflow-hidden rounded border bg-muted",children:c.jsx("img",{alt:d,className:"h-full w-full object-cover",src:f.url})})}),c.jsxs(xZ,{align:"start",className:"w-auto p-3",side:"right",children:[c.jsx("img",{alt:d,className:"max-h-[min(400px,40vh)] max-w-[min(400px,25vw)] rounded object-contain",src:f.url}),c.jsx("p",{className:"mt-2 max-w-[min(400px,25vw)] truncate text-center text-muted-foreground text-sm",children:d})]})]}):c.jsx("div",{className:"flex h-10 w-14 shrink-0 items-center justify-center overflow-hidden rounded border bg-muted",children:v?c.jsx(Bj,{className:"h-4 w-4 text-muted-foreground"}):c.jsx(qj,{className:"h-4 w-4 text-muted-foreground"})}),c.jsx("span",{className:"truncate font-medium",children:d})]})}),c.jsx(ht,{children:c.jsx(Be,{variant:"secondary",children:h.toUpperCase()})}),c.jsx(ht,{className:"text-muted-foreground",children:bZ(f.size)}),c.jsx(ht,{className:"text-muted-foreground text-xs",children:KQ(new Date(f.lastModified),{addSuffix:!0})}),c.jsx(ht,{onClick:m=>m.stopPropagation(),children:c.jsxs("div",{className:"flex gap-1",children:[c.jsx(ma,{className:"h-8 w-8",size:"icon",value:f.url,variant:"ghost"}),c.jsx(Ce,{className:"h-8 w-8",onClick:m=>l(m,f.url),size:"icon",variant:"ghost",children:c.jsx(Hu,{className:"h-3.5 w-3.5"})})]})})]},f.key)})})]})})}var dv="Collapsible",[jZ]=jn(dv),[OZ,kO]=jZ(dv),GL=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...f}=e,[d,h]=An({prop:r,defaultProp:i??!1,onChange:l,caller:dv});return c.jsx(OZ,{scope:n,disabled:o,contentId:Cr(),open:d,onOpenToggle:S.useCallback(()=>h(v=>!v),[h]),children:c.jsx(Ae.div,{"data-state":IO(d),"data-disabled":o?"":void 0,...f,ref:t})})});GL.displayName=dv;var VL="CollapsibleTrigger",YL=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=kO(VL,n);return c.jsx(Ae.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":IO(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:ge(e.onClick,i.onOpenToggle)})});YL.displayName=VL;var $O="CollapsibleContent",WL=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=kO($O,e.__scopeCollapsible);return c.jsx(Nn,{present:n||i.open,children:({present:o})=>c.jsx(EZ,{...r,ref:t,present:o})})});WL.displayName=$O;var EZ=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,l=kO($O,n),[f,d]=S.useState(r),h=S.useRef(null),v=Ue(t,h),m=S.useRef(0),g=m.current,x=S.useRef(0),O=x.current,j=l.open||f,b=S.useRef(j),E=S.useRef(void 0);return S.useEffect(()=>{const _=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(_)},[]),Wt(()=>{const _=h.current;if(_){E.current=E.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const A=_.getBoundingClientRect();m.current=A.height,x.current=A.width,b.current||(_.style.transitionDuration=E.current.transitionDuration,_.style.animationName=E.current.animationName),d(r)}},[l.open,r]),c.jsx(Ae.div,{"data-state":IO(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!j,...o,ref:v,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":O?`${O}px`:void 0,...e.style},children:j&&i})});function IO(e){return e?"open":"closed"}var _Z=GL;function ms({...e}){return c.jsx(_Z,{"data-slot":"collapsible",...e})}function ps({...e}){return c.jsx(YL,{"data-slot":"collapsible-trigger",...e})}function vs({...e}){return c.jsx(WL,{"data-slot":"collapsible-content",...e})}var AZ="Label",KL=S.forwardRef((e,t)=>c.jsx(us.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));KL.displayName=AZ;var NZ=KL;function Ho({className:e,...t}){return c.jsx(NZ,{className:pe("flex select-none items-center gap-2 font-medium text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",e),"data-slot":"label",...t})}function _m(e,[t,n]){return Math.min(n,Math.max(t,e))}var CZ=[" ","Enter","ArrowUp","ArrowDown"],TZ=[" ","Enter"],ns="Select",[hv,mv,MZ]=Qp(ns),[pc]=jn(ns,[MZ,lo]),pv=lo(),[RZ,uo]=pc(ns),[DZ,PZ]=pc(ns),XL=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:f,onValueChange:d,dir:h,name:v,autoComplete:m,disabled:g,required:x,form:O}=e,j=pv(t),[b,E]=S.useState(null),[_,A]=S.useState(null),[C,N]=S.useState(!1),M=hc(h),[R,D]=An({prop:r,defaultProp:i??!1,onChange:o,caller:ns}),[L,H]=An({prop:l,defaultProp:f,onChange:d,caller:ns}),B=S.useRef(null),U=b?O||!!b.closest("form"):!0,[Y,Z]=S.useState(new Set),X=Array.from(Y).map(k=>k.props.value).join(";");return c.jsx(Bp,{...j,children:c.jsxs(RZ,{required:x,scope:t,trigger:b,onTriggerChange:E,valueNode:_,onValueNodeChange:A,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:Cr(),value:L,onValueChange:H,open:R,onOpenChange:D,dir:M,triggerPointerDownPosRef:B,disabled:g,children:[c.jsx(hv.Provider,{scope:t,children:c.jsx(DZ,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(k=>{Z(q=>new Set(q).add(k))},[]),onNativeOptionRemove:S.useCallback(k=>{Z(q=>{const V=new Set(q);return V.delete(k),V})},[]),children:n})}),U?c.jsxs(y3,{"aria-hidden":!0,required:x,tabIndex:-1,name:v,autoComplete:m,value:L,onChange:k=>H(k.target.value),disabled:g,form:O,children:[L===void 0?c.jsx("option",{value:""}):null,Array.from(Y)]},X):null]})})};XL.displayName=ns;var QL="SelectTrigger",ZL=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=pv(n),l=uo(QL,n),f=l.disabled||r,d=Ue(t,l.onTriggerChange),h=mv(n),v=S.useRef("touch"),[m,g,x]=b3(j=>{const b=h().filter(A=>!A.disabled),E=b.find(A=>A.value===l.value),_=w3(b,j,E);_!==void 0&&l.onValueChange(_.value)}),O=j=>{f||(l.onOpenChange(!0),x()),j&&(l.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})};return c.jsx(qp,{asChild:!0,...o,children:c.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":x3(l.value)?"":void 0,...i,ref:d,onClick:ge(i.onClick,j=>{j.currentTarget.focus(),v.current!=="mouse"&&O(j)}),onPointerDown:ge(i.onPointerDown,j=>{v.current=j.pointerType;const b=j.target;b.hasPointerCapture(j.pointerId)&&b.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(O(j),j.preventDefault())}),onKeyDown:ge(i.onKeyDown,j=>{const b=m.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&g(j.key),!(b&&j.key===" ")&&CZ.includes(j.key)&&(O(),j.preventDefault())})})})});ZL.displayName=QL;var JL="SelectValue",e3=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...f}=e,d=uo(JL,n),{onValueNodeHasChildrenChange:h}=d,v=o!==void 0,m=Ue(t,d.onValueNodeChange);return Wt(()=>{h(v)},[h,v]),c.jsx(Ae.span,{...f,ref:m,style:{pointerEvents:"none"},children:x3(d.value)?c.jsx(c.Fragment,{children:l}):o})});e3.displayName=JL;var kZ="SelectIcon",t3=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(Ae.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});t3.displayName=kZ;var $Z="SelectPortal",n3=e=>c.jsx(sc,{asChild:!0,...e});n3.displayName=$Z;var rs="SelectContent",r3=S.forwardRef((e,t)=>{const n=uo(rs,e.__scopeSelect),[r,i]=S.useState();if(Wt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?$f.createPortal(c.jsx(a3,{scope:e.__scopeSelect,children:c.jsx(hv.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(i3,{...e,ref:t})});r3.displayName=rs;var Ur=10,[a3,fo]=pc(rs),IZ="SelectContentImpl",LZ=Rl("SelectContent.RemoveScroll"),i3=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:f,sideOffset:d,align:h,alignOffset:v,arrowPadding:m,collisionBoundary:g,collisionPadding:x,sticky:O,hideWhenDetached:j,avoidCollisions:b,...E}=e,_=uo(rs,n),[A,C]=S.useState(null),[N,M]=S.useState(null),R=Ue(t,oe=>C(oe)),[D,L]=S.useState(null),[H,B]=S.useState(null),U=mv(n),[Y,Z]=S.useState(!1),X=S.useRef(!1);S.useEffect(()=>{if(A)return Fj(A)},[A]),Hj();const k=S.useCallback(oe=>{const[me,...ie]=U().map(le=>le.ref.current),[ve]=ie.slice(-1),ye=document.activeElement;for(const le of oe)if(le===ye||(le?.scrollIntoView({block:"nearest"}),le===me&&N&&(N.scrollTop=0),le===ve&&N&&(N.scrollTop=N.scrollHeight),le?.focus(),document.activeElement!==ye))return},[U,N]),q=S.useCallback(()=>k([D,A]),[k,D,A]);S.useEffect(()=>{Y&&q()},[Y,q]);const{onOpenChange:V,triggerPointerDownPosRef:Q}=_;S.useEffect(()=>{if(A){let oe={x:0,y:0};const me=ve=>{oe={x:Math.abs(Math.round(ve.pageX)-(Q.current?.x??0)),y:Math.abs(Math.round(ve.pageY)-(Q.current?.y??0))}},ie=ve=>{oe.x<=10&&oe.y<=10?ve.preventDefault():A.contains(ve.target)||V(!1),document.removeEventListener("pointermove",me),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",ie,{capture:!0})}}},[A,V,Q]),S.useEffect(()=>{const oe=()=>V(!1);return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[V]);const[ee,z]=b3(oe=>{const me=U().filter(ye=>!ye.disabled),ie=me.find(ye=>ye.ref.current===document.activeElement),ve=w3(me,oe,ie);ve&&setTimeout(()=>ve.ref.current.focus())}),G=S.useCallback((oe,me,ie)=>{const ve=!X.current&&!ie;(_.value!==void 0&&_.value===me||ve)&&(L(oe),ve&&(X.current=!0))},[_.value]),$=S.useCallback(()=>A?.focus(),[A]),W=S.useCallback((oe,me,ie)=>{const ve=!X.current&&!ie;(_.value!==void 0&&_.value===me||ve)&&B(oe)},[_.value]),ae=r==="popper"?lS:o3,ce=ae===lS?{side:f,sideOffset:d,align:h,alignOffset:v,arrowPadding:m,collisionBoundary:g,collisionPadding:x,sticky:O,hideWhenDetached:j,avoidCollisions:b}:{};return c.jsx(a3,{scope:n,content:A,viewport:N,onViewportChange:M,itemRefCallback:G,selectedItem:D,onItemLeave:$,itemTextRefCallback:W,focusSelectedItem:q,selectedItemText:H,position:r,isPositioned:Y,searchRef:ee,children:c.jsx(Rp,{as:LZ,allowPinchZoom:!0,children:c.jsx(Tp,{asChild:!0,trapped:_.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:ge(i,oe=>{_.trigger?.focus({preventScroll:!0}),oe.preventDefault()}),children:c.jsx(oc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:c.jsx(ae,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:oe=>oe.preventDefault(),...E,...ce,onPlaced:()=>Z(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:ge(E.onKeyDown,oe=>{const me=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!me&&oe.key.length===1&&z(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let ve=U().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const ye=oe.target,le=ve.indexOf(ye);ve=ve.slice(le+1)}setTimeout(()=>k(ve)),oe.preventDefault()}})})})})})})});i3.displayName=IZ;var zZ="SelectItemAlignedPosition",o3=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=uo(rs,n),l=fo(rs,n),[f,d]=S.useState(null),[h,v]=S.useState(null),m=Ue(t,R=>v(R)),g=mv(n),x=S.useRef(!1),O=S.useRef(!0),{viewport:j,selectedItem:b,selectedItemText:E,focusSelectedItem:_}=l,A=S.useCallback(()=>{if(o.trigger&&o.valueNode&&f&&h&&j&&b&&E){const R=o.trigger.getBoundingClientRect(),D=h.getBoundingClientRect(),L=o.valueNode.getBoundingClientRect(),H=E.getBoundingClientRect();if(o.dir!=="rtl"){const ye=H.left-D.left,le=L.left-ye,Re=R.left-le,be=R.width+Re,qe=Math.max(be,D.width),rt=window.innerWidth-Ur,mt=_m(le,[Ur,Math.max(Ur,rt-qe)]);f.style.minWidth=be+"px",f.style.left=mt+"px"}else{const ye=D.right-H.right,le=window.innerWidth-L.right-ye,Re=window.innerWidth-R.right-le,be=R.width+Re,qe=Math.max(be,D.width),rt=window.innerWidth-Ur,mt=_m(le,[Ur,Math.max(Ur,rt-qe)]);f.style.minWidth=be+"px",f.style.right=mt+"px"}const B=g(),U=window.innerHeight-Ur*2,Y=j.scrollHeight,Z=window.getComputedStyle(h),X=parseInt(Z.borderTopWidth,10),k=parseInt(Z.paddingTop,10),q=parseInt(Z.borderBottomWidth,10),V=parseInt(Z.paddingBottom,10),Q=X+k+Y+V+q,ee=Math.min(b.offsetHeight*5,Q),z=window.getComputedStyle(j),G=parseInt(z.paddingTop,10),$=parseInt(z.paddingBottom,10),W=R.top+R.height/2-Ur,ae=U-W,ce=b.offsetHeight/2,oe=b.offsetTop+ce,me=X+k+oe,ie=Q-me;if(me<=W){const ye=B.length>0&&b===B[B.length-1].ref.current;f.style.bottom="0px";const le=h.clientHeight-j.offsetTop-j.offsetHeight,Re=Math.max(ae,ce+(ye?$:0)+le+q),be=me+Re;f.style.height=be+"px"}else{const ye=B.length>0&&b===B[0].ref.current;f.style.top="0px";const Re=Math.max(W,X+j.offsetTop+(ye?G:0)+ce)+ie;f.style.height=Re+"px",j.scrollTop=me-W+j.offsetTop}f.style.margin=`${Ur}px 0`,f.style.minHeight=ee+"px",f.style.maxHeight=U+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,o.trigger,o.valueNode,f,h,j,b,E,o.dir,r]);Wt(()=>A(),[A]);const[C,N]=S.useState();Wt(()=>{h&&N(window.getComputedStyle(h).zIndex)},[h]);const M=S.useCallback(R=>{R&&O.current===!0&&(A(),_?.(),O.current=!1)},[A,_]);return c.jsx(qZ,{scope:n,contentWrapper:f,shouldExpandOnScrollRef:x,onScrollButtonChange:M,children:c.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(Ae.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});o3.displayName=zZ;var BZ="SelectPopperPosition",lS=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ur,...o}=e,l=pv(n);return c.jsx(Up,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});lS.displayName=BZ;var[qZ,LO]=pc(rs,{}),cS="SelectViewport",s3=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=fo(cS,n),l=LO(cS,n),f=Ue(t,o.onViewportChange),d=S.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(hv.Slot,{scope:n,children:c.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ge(i.onScroll,h=>{const v=h.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=l;if(g?.current&&m){const x=Math.abs(d.current-v.scrollTop);if(x>0){const O=window.innerHeight-Ur*2,j=parseFloat(m.style.minHeight),b=parseFloat(m.style.height),E=Math.max(j,b);if(E<O){const _=E+x,A=Math.min(O,_),C=_-A;m.style.height=A+"px",m.style.bottom==="0px"&&(v.scrollTop=C>0?C:0,m.style.justifyContent="flex-end")}}}d.current=v.scrollTop})})})]})});s3.displayName=cS;var l3="SelectGroup",[UZ,HZ]=pc(l3),FZ=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Cr();return c.jsx(UZ,{scope:n,id:i,children:c.jsx(Ae.div,{role:"group","aria-labelledby":i,...r,ref:t})})});FZ.displayName=l3;var c3="SelectLabel",GZ=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=HZ(c3,n);return c.jsx(Ae.div,{id:i.id,...r,ref:t})});GZ.displayName=c3;var Am="SelectItem",[VZ,u3]=pc(Am),f3=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,f=uo(Am,n),d=fo(Am,n),h=f.value===r,[v,m]=S.useState(o??""),[g,x]=S.useState(!1),O=Ue(t,_=>d.itemRefCallback?.(_,r,i)),j=Cr(),b=S.useRef("touch"),E=()=>{i||(f.onValueChange(r),f.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(VZ,{scope:n,value:r,disabled:i,textId:j,isSelected:h,onItemTextChange:S.useCallback(_=>{m(A=>A||(_?.textContent??"").trim())},[]),children:c.jsx(hv.ItemSlot,{scope:n,value:r,disabled:i,textValue:v,children:c.jsx(Ae.div,{role:"option","aria-labelledby":j,"data-highlighted":g?"":void 0,"aria-selected":h&&g,"data-state":h?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:O,onFocus:ge(l.onFocus,()=>x(!0)),onBlur:ge(l.onBlur,()=>x(!1)),onClick:ge(l.onClick,()=>{b.current!=="mouse"&&E()}),onPointerUp:ge(l.onPointerUp,()=>{b.current==="mouse"&&E()}),onPointerDown:ge(l.onPointerDown,_=>{b.current=_.pointerType}),onPointerMove:ge(l.onPointerMove,_=>{b.current=_.pointerType,i?d.onItemLeave?.():b.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ge(l.onPointerLeave,_=>{_.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:ge(l.onKeyDown,_=>{d.searchRef?.current!==""&&_.key===" "||(TZ.includes(_.key)&&E(),_.key===" "&&_.preventDefault())})})})})});f3.displayName=Am;var Ru="SelectItemText",d3=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=uo(Ru,n),f=fo(Ru,n),d=u3(Ru,n),h=PZ(Ru,n),[v,m]=S.useState(null),g=Ue(t,E=>m(E),d.onItemTextChange,E=>f.itemTextRefCallback?.(E,d.value,d.disabled)),x=v?.textContent,O=S.useMemo(()=>c.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:j,onNativeOptionRemove:b}=h;return Wt(()=>(j(O),()=>b(O)),[j,b,O]),c.jsxs(c.Fragment,{children:[c.jsx(Ae.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?$f.createPortal(o.children,l.valueNode):null]})});d3.displayName=Ru;var h3="SelectItemIndicator",m3=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u3(h3,n).isSelected?c.jsx(Ae.span,{"aria-hidden":!0,...r,ref:t}):null});m3.displayName=h3;var uS="SelectScrollUpButton",p3=S.forwardRef((e,t)=>{const n=fo(uS,e.__scopeSelect),r=LO(uS,e.__scopeSelect),[i,o]=S.useState(!1),l=Ue(t,r.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let f=function(){const h=d.scrollTop>0;o(h)};const d=n.viewport;return f(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),i?c.jsx(g3,{...e,ref:l,onAutoScroll:()=>{const{viewport:f,selectedItem:d}=n;f&&d&&(f.scrollTop=f.scrollTop-d.offsetHeight)}}):null});p3.displayName=uS;var fS="SelectScrollDownButton",v3=S.forwardRef((e,t)=>{const n=fo(fS,e.__scopeSelect),r=LO(fS,e.__scopeSelect),[i,o]=S.useState(!1),l=Ue(t,r.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let f=function(){const h=d.scrollHeight-d.clientHeight,v=Math.ceil(d.scrollTop)<h;o(v)};const d=n.viewport;return f(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),i?c.jsx(g3,{...e,ref:l,onAutoScroll:()=>{const{viewport:f,selectedItem:d}=n;f&&d&&(f.scrollTop=f.scrollTop+d.offsetHeight)}}):null});v3.displayName=fS;var g3=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=fo("SelectScrollButton",n),l=S.useRef(null),f=mv(n),d=S.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return S.useEffect(()=>()=>d(),[d]),Wt(()=>{f().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),c.jsx(Ae.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ge(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ge(i.onPointerMove,()=>{o.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ge(i.onPointerLeave,()=>{d()})})}),YZ="SelectSeparator",WZ=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ae.div,{"aria-hidden":!0,...r,ref:t})});WZ.displayName=YZ;var dS="SelectArrow",KZ=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pv(n),o=uo(dS,n),l=fo(dS,n);return o.open&&l.position==="popper"?c.jsx(Hp,{...i,...r,ref:t}):null});KZ.displayName=dS;var XZ="SelectBubbleInput",y3=S.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=S.useRef(null),o=Ue(r,i),l=av(t);return S.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&v){const m=new Event("change",{bubbles:!0});v.call(f,t),f.dispatchEvent(m)}},[l,t]),c.jsx(Ae.select,{...n,style:{...xI,...n.style},ref:o,defaultValue:t})});y3.displayName=XZ;function x3(e){return e===""||e===void 0}function b3(e){const t=Wr(e),n=S.useRef(""),r=S.useRef(0),i=S.useCallback(l=>{const f=n.current+l;t(f),(function d(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(f)},[t]),o=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function w3(e,t,n){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=QZ(e,Math.max(o,0));i.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.textValue.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function QZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ZZ=XL,JZ=ZL,eJ=e3,tJ=t3,nJ=n3,rJ=r3,aJ=s3,iJ=f3,oJ=d3,sJ=m3,lJ=p3,cJ=v3;function ga({...e}){return c.jsx(ZZ,{"data-slot":"select",...e})}function ya({...e}){return c.jsx(eJ,{"data-slot":"select-value",...e})}function xa({className:e,size:t="default",children:n,...r}){return c.jsxs(JZ,{className:pe("flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-size":t,"data-slot":"select-trigger",...r,children:[n,c.jsx(tJ,{asChild:!0,children:c.jsx(oo,{className:"size-4 opacity-50"})})]})}function ba({className:e,children:t,position:n="popper",align:r="center",...i}){return c.jsx(nJ,{children:c.jsxs(rJ,{align:r,className:pe("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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",n==="popper"&&"data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1",e),"data-slot":"select-content",position:n,...i,children:[c.jsx(uJ,{}),c.jsx(aJ,{className:pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),c.jsx(fJ,{})]})})}function Fe({className:e,children:t,...n}){return c.jsxs(iJ,{className:pe("relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),"data-slot":"select-item",...n,children:[c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(sJ,{children:c.jsx(ai,{className:"size-4"})})}),c.jsx(oJ,{children:t})]})}function uJ({className:e,...t}){return c.jsx(lJ,{className:pe("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...t,children:c.jsx(ac,{className:"size-4"})})}function fJ({className:e,...t}){return c.jsx(cJ,{className:pe("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...t,children:c.jsx(oo,{className:"size-4"})})}var S3=["PageUp","PageDown"],j3=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],O3={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},vc="Slider",[hS,dJ,hJ]=Qp(vc),[E3]=jn(vc,[hJ]),[mJ,vv]=E3(vc),_3=S.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:f=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[r],value:v,onValueChange:m=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:O,...j}=e,b=S.useRef(new Set),E=S.useRef(0),A=l==="horizontal"?pJ:vJ,[C=[],N]=An({prop:v,defaultProp:h,onChange:B=>{[...b.current][E.current]?.focus(),m(B)}}),M=S.useRef(C);function R(B){const U=wJ(C,B);H(B,U)}function D(B){H(B,E.current)}function L(){const B=M.current[E.current];C[E.current]!==B&&g(C)}function H(B,U,{commit:Y}={commit:!1}){const Z=EJ(o),X=_J(Math.round((B-r)/o)*o+r,Z),k=_m(X,[r,i]);N((q=[])=>{const V=xJ(q,k,U);if(OJ(V,d*o)){E.current=V.indexOf(k);const Q=String(V)!==String(q);return Q&&Y&&g(V),Q?V:q}else return q})}return c.jsx(mJ,{scope:e.__scopeSlider,name:n,disabled:f,min:r,max:i,valueIndexToChangeRef:E,thumbs:b.current,values:C,orientation:l,form:O,children:c.jsx(hS.Provider,{scope:e.__scopeSlider,children:c.jsx(hS.Slot,{scope:e.__scopeSlider,children:c.jsx(A,{"aria-disabled":f,"data-disabled":f?"":void 0,...j,ref:t,onPointerDown:ge(j.onPointerDown,()=>{f||(M.current=C)}),min:r,max:i,inverted:x,onSlideStart:f?void 0:R,onSlideMove:f?void 0:D,onSlideEnd:f?void 0:L,onHomeKeyDown:()=>!f&&H(r,0,{commit:!0}),onEndKeyDown:()=>!f&&H(i,C.length-1,{commit:!0}),onStepKeyDown:({event:B,direction:U})=>{if(!f){const X=S3.includes(B.key)||B.shiftKey&&j3.includes(B.key)?10:1,k=E.current,q=C[k],V=o*X*U;H(q+V,k,{commit:!0})}}})})})})});_3.displayName=vc;var[A3,N3]=E3(vc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),pJ=S.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:f,onSlideEnd:d,onStepKeyDown:h,...v}=e,[m,g]=S.useState(null),x=Ue(t,A=>g(A)),O=S.useRef(void 0),j=hc(i),b=j==="ltr",E=b&&!o||!b&&o;function _(A){const C=O.current||m.getBoundingClientRect(),N=[0,C.width],R=zO(N,E?[n,r]:[r,n]);return O.current=C,R(A-C.left)}return c.jsx(A3,{scope:e.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:c.jsx(C3,{dir:j,"data-orientation":"horizontal",...v,ref:x,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:A=>{const C=_(A.clientX);l?.(C)},onSlideMove:A=>{const C=_(A.clientX);f?.(C)},onSlideEnd:()=>{O.current=void 0,d?.()},onStepKeyDown:A=>{const N=O3[E?"from-left":"from-right"].includes(A.key);h?.({event:A,direction:N?-1:1})}})})}),vJ=S.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:f,onStepKeyDown:d,...h}=e,v=S.useRef(null),m=Ue(t,v),g=S.useRef(void 0),x=!i;function O(j){const b=g.current||v.current.getBoundingClientRect(),E=[0,b.height],A=zO(E,x?[r,n]:[n,r]);return g.current=b,A(j-b.top)}return c.jsx(A3,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:c.jsx(C3,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:j=>{const b=O(j.clientY);o?.(b)},onSlideMove:j=>{const b=O(j.clientY);l?.(b)},onSlideEnd:()=>{g.current=void 0,f?.()},onStepKeyDown:j=>{const E=O3[x?"from-bottom":"from-top"].includes(j.key);d?.({event:j,direction:E?-1:1})}})})}),C3=S.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:f,onStepKeyDown:d,...h}=e,v=vv(vc,n);return c.jsx(Ae.span,{...h,ref:t,onKeyDown:ge(e.onKeyDown,m=>{m.key==="Home"?(l(m),m.preventDefault()):m.key==="End"?(f(m),m.preventDefault()):S3.concat(j3).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:ge(e.onPointerDown,m=>{const g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),v.thumbs.has(g)?g.focus():r(m)}),onPointerMove:ge(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:ge(e.onPointerUp,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),o(m))})})}),T3="SliderTrack",M3=S.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=vv(T3,n);return c.jsx(Ae.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});M3.displayName=T3;var mS="SliderRange",R3=S.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=vv(mS,n),o=N3(mS,n),l=S.useRef(null),f=Ue(t,l),d=i.values.length,h=i.values.map(g=>k3(g,i.min,i.max)),v=d>1?Math.min(...h):0,m=100-Math.max(...h);return c.jsx(Ae.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:f,style:{...e.style,[o.startEdge]:v+"%",[o.endEdge]:m+"%"}})});R3.displayName=mS;var pS="SliderThumb",D3=S.forwardRef((e,t)=>{const n=dJ(e.__scopeSlider),[r,i]=S.useState(null),o=Ue(t,f=>i(f)),l=S.useMemo(()=>r?n().findIndex(f=>f.ref.current===r):-1,[n,r]);return c.jsx(gJ,{...e,ref:o,index:l})}),gJ=S.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=vv(pS,n),f=N3(pS,n),[d,h]=S.useState(null),v=Ue(t,_=>h(_)),m=d?l.form||!!d.closest("form"):!0,g=zp(d),x=l.values[r],O=x===void 0?0:k3(x,l.min,l.max),j=bJ(r,l.values.length),b=g?.[f.size],E=b?SJ(b,O,f.direction):0;return S.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${O}% + ${E}px)`},children:[c.jsx(hS.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(Ae.span,{role:"slider","aria-label":e["aria-label"]||j,"aria-valuemin":l.min,"aria-valuenow":x,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:v,style:x===void 0?{display:"none"}:e.style,onFocus:ge(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),m&&c.jsx(P3,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:x},r)]})});D3.displayName=pS;var yJ="RadioBubbleInput",P3=S.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=S.useRef(null),o=Ue(i,r),l=av(t);return S.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&v){const m=new Event("input",{bubbles:!0});v.call(f,t),f.dispatchEvent(m)}},[l,t]),c.jsx(Ae.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});P3.displayName=yJ;function xJ(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function k3(e,t,n){const o=100/(n-t)*(e-t);return _m(o,[0,100])}function bJ(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function wJ(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function SJ(e,t,n){const r=e/2,o=zO([0,50],[0,r]);return(r-o(t)*n)*n}function jJ(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function OJ(e,t){if(t>0){const n=jJ(e);return Math.min(...n)>=t}return!0}function zO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function EJ(e){return(String(e).split(".")[1]||"").length}function _J(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var AJ=_3,NJ=M3,CJ=R3,TJ=D3;function MJ({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...o}){const l=S.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,i],[n,t,r,i]);return c.jsxs(AJ,{className:pe("relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",e),"data-slot":"slider",defaultValue:t,max:i,min:r,value:n,...o,children:[c.jsx(NJ,{className:pe("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5"),"data-slot":"slider-track",children:c.jsx(CJ,{className:pe("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"),"data-slot":"slider-range"})}),Array.from({length:l.length},(f,d)=>c.jsx(TJ,{className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50","data-slot":"slider-thumb"},`thumb-${d}`))]})}var gv="Switch",[RJ]=jn(gv),[DJ,PJ]=RJ(gv),$3=S.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:l,disabled:f,value:d="on",onCheckedChange:h,form:v,...m}=e,[g,x]=S.useState(null),O=Ue(t,A=>x(A)),j=S.useRef(!1),b=g?v||!!g.closest("form"):!0,[E,_]=An({prop:i,defaultProp:o??!1,onChange:h,caller:gv});return c.jsxs(DJ,{scope:n,checked:E,disabled:f,children:[c.jsx(Ae.button,{type:"button",role:"switch","aria-checked":E,"aria-required":l,"data-state":B3(E),"data-disabled":f?"":void 0,disabled:f,value:d,...m,ref:O,onClick:ge(e.onClick,A=>{_(C=>!C),b&&(j.current=A.isPropagationStopped(),j.current||A.stopPropagation())})}),b&&c.jsx(z3,{control:g,bubbles:!j.current,name:r,value:d,checked:E,required:l,disabled:f,form:v,style:{transform:"translateX(-100%)"}})]})});$3.displayName=gv;var I3="SwitchThumb",L3=S.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=PJ(I3,n);return c.jsx(Ae.span,{"data-state":B3(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});L3.displayName=I3;var kJ="SwitchBubbleInput",z3=S.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const l=S.useRef(null),f=Ue(l,o),d=av(n),h=zp(t);return S.useEffect(()=>{const v=l.current;if(!v)return;const m=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(m,"checked").set;if(d!==n&&x){const O=new Event("click",{bubbles:r});x.call(v,n),v.dispatchEvent(O)}},[d,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:f,style:{...i.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});z3.displayName=kJ;function B3(e){return e?"checked":"unchecked"}var $J=$3,IJ=L3;function LJ({className:e,...t}){return c.jsx($J,{className:pe("peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",e),"data-slot":"switch",...t,children:c.jsx(IJ,{className:pe("pointer-events-none block size-4 rounded-full bg-background ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground"),"data-slot":"switch-thumb"})})}async function iT(e){try{const t=document.createElement("canvas");return t.width=1,t.height=1,t.toDataURL(e).startsWith(`data:${e}`)}catch{return!1}}async function zJ(){const[e,t]=await Promise.all([iT("image/webp"),iT("image/avif")]);return{webp:e,avif:t,offscreenCanvas:typeof OffscreenCanvas<"u",webWorker:typeof Worker<"u",wasm:typeof WebAssembly<"u"}}let Ch=null;async function BJ(){return Ch||(Ch=await zJ(),Ch)}async function qJ(e){if(e.type!=="image/gif")return{isAnimated:!1,frameCount:1,size:e.size};try{const t=await e.arrayBuffer(),n=new Uint8Array(t);let r=0;for(let i=0;i<n.length-2;i++)n[i]===33&&n[i+1]===249&&r++;return{isAnimated:r>1,frameCount:Math.max(1,r),size:e.size}}catch{return{isAnimated:!1,frameCount:1,size:e.size}}}function UJ(e){return e.type==="image/gif"}function HJ(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(new Error("Failed to read blob")),r.readAsDataURL(e)})}function q3(e){return HJ(e)}function Th(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/t**r).toFixed(1))} ${n[r]}`}function FJ(e){return new Promise((t,n)=>{const r=new Image,i=URL.createObjectURL(e);r.onload=()=>{URL.revokeObjectURL(i),t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=()=>{URL.revokeObjectURL(i),n(new Error("Failed to load image"))},r.src=i})}class GJ{worker=null;pending=new Map;getWorker(){return this.worker||(this.worker=new Worker(new URL("/assets/optimizer.worker-DZcD7Kza.js",import.meta.url),{type:"module"}),this.worker.onmessage=this.handleMessage.bind(this),this.worker.onerror=this.handleError.bind(this)),this.worker}handleMessage(t){const{id:n,result:r,error:i,progress:o}=t.data,l=this.pending.get(n);if(l){if(o!==void 0&&o<100&&l.onProgress){l.onProgress(o);return}if(i){l.reject(new Error(i)),this.pending.delete(n);return}r&&(l.resolve(r),this.pending.delete(n))}}handleError(t){console.error("Image optimizer worker error:",t);for(const[n,r]of this.pending)r.reject(new Error(`Worker error: ${t.message}`)),this.pending.delete(n);this.terminate()}generateId(){return crypto.randomUUID()}async optimize(t,n,r){const i=this.generateId();return new Promise((o,l)=>{this.pending.set(i,{resolve:o,reject:l,onProgress:r}),this.getWorker().postMessage({id:i,type:"optimize",file:t,options:n})})}async preview(t,n,r){const i=await q3(t);return{...await this.optimize(t,n,r),originalDataUrl:i}}cancelAll(){for(const[t,n]of this.pending)n.reject(new Error("Operation cancelled")),this.pending.delete(t)}terminate(){this.cancelAll(),this.worker&&(this.worker.terminate(),this.worker=null)}get isActive(){return this.worker!==null}get pendingCount(){return this.pending.size}}const VJ=new GJ;async function YJ(e,t,n){return VJ.preview(e,t,n)}const WJ=[{value:"webp",label:"WebP",description:"Best balance of size and quality"},{value:"avif",label:"AVIF",description:"Best compression"},{value:"jpeg",label:"JPEG",description:"Universal compatibility"},{value:"png",label:"PNG",description:"Lossless, supports transparency"},{value:"original",label:"Original",description:"Keep original format"}],KJ=[{value:1,label:"1x",description:"Standard displays"},{value:2,label:"2x",description:"Retina / HiDPI (recommended)"},{value:3,label:"3x",description:"iPhone Pro / flagship phones"}];function vS(e){const t=e/1024,n=t/1024;return n>2?{level:"error",message:"This image will cause delivery issues (>2MB)",suggestion:"Reduce dimensions or increase compression to under 1MB"}:n>1?{level:"warning",message:"Most email clients struggle with images >1MB",suggestion:"Consider reducing to under 500KB for best deliverability"}:t>500?{level:"info",message:"Larger than recommended for email (>500KB)",suggestion:"This may slow load times on mobile devices"}:null}function Ix(e){const t=vS(e);if(!t)return{label:"Good",color:"text-green-600"};switch(t.level){case"info":return{label:"OK",color:"text-yellow-600"};case"warning":return{label:"Large",color:"text-orange-600"};case"error":return{label:"Too Large",color:"text-red-600"};default:return{label:"Unknown",color:"text-muted-foreground"}}}const XJ=[{value:"none",label:"Original size",description:"Keep original dimensions"},{value:"600",label:"Email (600px)",description:"Standard email width"},{value:"800",label:"Medium (800px)",description:"Blog posts, cards"},{value:"1200",label:"Large (1200px)",description:"Full-width content"},{value:"1440",label:"Hero (1440px)",description:"Banner images"},{value:"1920",label:"Full HD (1920px)",description:"Desktop screens"}];function QJ({files:e,onComplete:t,onClose:n,open:r}){const[i,o]=S.useState([]),[l,f]=S.useState(null),[d,h]=S.useState(!1),v=i.reduce(($,W)=>$+W.file.size,0),m=i.reduce(($,W)=>$+(W.preview?.optimizedSize??W.file.size),0),g=v>0?Math.round((1-m/v)*100):0,x=i.length>0&&i.every($=>$.status==="ready"||$.status==="done"||$.isAnimatedGif),O=i.some($=>$.status==="pending"&&!$.isAnimatedGif),j=i.some($=>$.status==="processing"),[b,E]=S.useState(!0),[_,A]=S.useState(!1),[C,N]=S.useState({format:"webp",quality:85}),[M,R]=S.useState(85),[D,L]=S.useState("none"),[H,B]=S.useState(2),[U,Y]=S.useState(!0);S.useEffect(()=>{BJ().then($=>{Y($.wasm&&$.webWorker&&$.offscreenCanvas)})},[]),S.useEffect(()=>{if(!r||e.length===0)return;const $=e.map((W,ae)=>({id:`${W.name}-${ae}-${Date.now()}`,file:W,status:"pending"}));o($),f($[0]?.id??null),A(!1),h(!1);for(const W of $)q3(W.file).then(ae=>{o(ce=>ce.map(oe=>oe.id===W.id?{...oe,thumbnailUrl:ae}:oe))}),UJ(W.file)&&qJ(W.file).then(ae=>{ae.isAnimated&&o(ce=>ce.map(oe=>oe.id===W.id?{...oe,isAnimatedGif:!0,status:"ready"}:oe))})},[r,e]);const Z=S.useCallback(async()=>{const $=i.filter(W=>W.status==="pending"&&!W.isAnimatedGif);if($.length===0){h(!1);return}for(const W of $){o(ae=>ae.map(ce=>ce.id===W.id?{...ce,status:"processing"}:ce));try{let ae;if(D==="none"){if(H>1){const me=await FJ(W.file);ae=Math.round(me.width/H)}}else ae=Number(D)*H;const ce={...C,maxWidth:ae},oe=await YJ(W.file,ce);o(me=>me.map(ie=>ie.id===W.id?{...ie,status:"ready",preview:oe}:ie))}catch{o(ae=>ae.map(ce=>ce.id===W.id?{...ce,status:"ready"}:ce))}}h(!1)},[i,C,D,H]),X=`${C.format}-${C.quality}-${D}-${H}`,k=S.useRef(X);S.useEffect(()=>{k.current!==X&&(k.current=X,o($=>$.map(W=>W.isAnimatedGif?W:{...W,status:"pending",preview:void 0})),h(!1))},[X]);const q=$=>{const W=$.name.replace(/\.[^/.]+$/,""),ae=C.format==="original"?$.name.split(".").pop():C.format;return`${W}.${ae}`},V=()=>{h(!0),Z()},Q=()=>{const $=i.map(W=>!b||W.isAnimatedGif||!W.preview?{file:W.file,cdnFilename:W.file.name}:{file:W.preview.blob,cdnFilename:q(W.file)});t($),n()},ee=()=>{const $=i.map(W=>({file:W.file,cdnFilename:W.file.name}));t($),n()};if(!r)return null;const z=i.length===1,G=z?i[0]:null;return c.jsx(MO,{onOpenChange:$=>!$&&n(),open:r,children:c.jsxs(RO,{className:"max-w-lg",children:[c.jsx(bL,{children:c.jsx(SL,{className:"flex items-center gap-2",children:z?c.jsxs(c.Fragment,{children:[c.jsx(vx,{className:"h-5 w-5 text-muted-foreground"}),c.jsx("span",{className:"truncate",children:G?.file.name})]}):c.jsxs(c.Fragment,{children:[c.jsx(vx,{className:"h-5 w-5 text-muted-foreground"}),i.length," images selected"]})})}),c.jsxs("div",{className:"space-y-4",children:[!z&&c.jsxs("div",{className:"grid grid-cols-6 gap-2",children:[i.slice(0,11).map($=>c.jsxs(Vp,{children:[c.jsx(Yp,{asChild:!0,children:c.jsxs("div",{className:`relative aspect-square overflow-hidden rounded-md border bg-muted ${$.id===l?"ring-2 ring-primary":""}`,children:[$.thumbnailUrl?c.jsx("img",{alt:$.file.name,className:"h-full w-full object-cover",src:$.thumbnailUrl}):c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(vx,{className:"h-4 w-4 text-muted-foreground"})}),$.status==="processing"&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50",children:c.jsx(fa,{className:"h-3 w-3 animate-spin"})}),$.status==="ready"&&$.preview&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-green-500/20",children:c.jsx(ai,{className:"h-4 w-4 text-green-600"})}),$.isAnimatedGif&&c.jsx(Be,{className:"absolute right-0.5 bottom-0.5 h-4 px-1 text-[10px]",children:"GIF"})]})}),c.jsxs(Wp,{side:"bottom",children:[c.jsx("p",{className:"font-medium text-xs",children:$.file.name}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:[Th($.file.size),$.preview&&` → ${Th($.preview.optimizedSize)}`]})]})]},$.id)),i.length>11&&c.jsxs("div",{className:"flex aspect-square items-center justify-center rounded-md border bg-muted text-muted-foreground text-xs",children:["+",i.length-11]})]}),z&&G&&c.jsxs("div",{className:"relative aspect-video overflow-hidden rounded-lg border bg-muted",children:[G.thumbnailUrl?c.jsx("img",{alt:G.file.name,className:"h-full w-full object-contain",src:G.thumbnailUrl}):c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(fa,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),G.status==="processing"&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50",children:c.jsx(fa,{className:"h-6 w-6 animate-spin"})}),G.status==="ready"&&G.preview&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-green-500/10",children:c.jsx(ai,{className:"h-8 w-8 text-green-600"})})]}),c.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"text-muted-foreground text-sm",children:[c.jsx("span",{className:Ix(v).color,children:Th(v)}),b&&x&&g>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"mx-2",children:"→"}),c.jsx("span",{className:`font-medium ${Ix(m).color}`,children:Th(m)})]})]}),j&&c.jsx("p",{className:"text-muted-foreground text-xs",children:"Optimizing..."}),!j&&vS(x?m:v)&&c.jsx("p",{className:`text-xs ${Ix(x?m:v).color}`,children:vS(x?m:v)?.suggestion})]}),b&&x&&g>0&&c.jsxs(Be,{className:"bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300",variant:"secondary",children:[c.jsx(aF,{className:"mr-1 h-3 w-3"}),"Save ",g,"%"]})]}),j&&c.jsx(tv,{className:"mt-3 h-1",value:i.filter($=>$.status==="ready"||$.isAnimatedGif).length/i.length*100})]}),U&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Ho,{className:"cursor-pointer",htmlFor:"optimize-toggle",children:"Optimize before uploading"}),c.jsx(LJ,{checked:b,id:"optimize-toggle",onCheckedChange:E})]}),b&&U&&c.jsxs(ms,{onOpenChange:A,open:_,children:[c.jsx(ps,{asChild:!0,children:c.jsxs(Ce,{className:"w-full justify-start text-muted-foreground",size:"sm",variant:"ghost",children:[_?c.jsx(oo,{className:"mr-2 h-4 w-4"}):c.jsx(VH,{className:"mr-2 h-4 w-4"}),"Options"]})}),c.jsxs(vs,{className:"space-y-4 pt-2",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ho,{className:"text-muted-foreground text-xs",children:"Format"}),c.jsxs(ga,{onValueChange:$=>N({...C,format:$}),value:C.format||"webp",children:[c.jsx(xa,{className:"h-9",children:c.jsx(ya,{})}),c.jsx(ba,{children:WJ.map($=>c.jsx(Fe,{value:$.value,children:$.label},$.value))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Ho,{className:"text-muted-foreground text-xs",children:"Quality"}),c.jsxs("span",{className:"text-muted-foreground text-xs",children:[M,"%"]})]}),c.jsx(MJ,{className:"mt-2",max:100,min:50,onValueChange:([$])=>R($),onValueCommit:([$])=>N({...C,quality:$}),step:5,value:[M]})]})]}),c.jsxs("div",{className:"space-y-3 rounded-lg border bg-muted/20 p-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Ho,{className:"font-medium text-xs",children:"Resize Image"}),c.jsx("span",{className:"text-muted-foreground text-xs",children:"Maintains aspect ratio"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ho,{className:"text-muted-foreground text-xs",children:"Max Width"}),c.jsxs(ga,{onValueChange:L,value:D,children:[c.jsx(xa,{className:"h-9",children:c.jsx(ya,{})}),c.jsx(ba,{children:XJ.map($=>c.jsx(Fe,{value:$.value,children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{children:$.label}),c.jsx("span",{className:"text-muted-foreground text-xs",children:$.description})]})},$.value))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ho,{className:"text-muted-foreground text-xs",children:"Pixel Density"}),c.jsxs(ga,{onValueChange:$=>B(Number($)),value:String(H),children:[c.jsx(xa,{className:"h-9",children:c.jsx(ya,{})}),c.jsx(ba,{children:KJ.map($=>c.jsx(Fe,{value:String($.value),children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{children:$.label}),c.jsx("span",{className:"text-muted-foreground text-xs",children:$.description})]})},$.value))})]})]})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:D==="none"?H===1?"Original dimensions preserved":`Scales to 1/${H} original size`:`Output: ${Number(D)*H}px actual width`})]})]})]})]}),c.jsxs(wL,{className:"gap-2 sm:gap-0",children:[c.jsx(Ce,{onClick:n,variant:"ghost",children:"Cancel"}),b&&U?c.jsxs(c.Fragment,{children:[c.jsx(Ce,{onClick:ee,variant:"outline",children:"Upload originals"}),x?c.jsxs(Ce,{onClick:Q,children:[c.jsx(Gu,{className:"mr-2 h-4 w-4"}),"Upload",g>0&&` (save ${g}%)`]}):c.jsxs(Ce,{disabled:d||!O,onClick:V,children:[d?c.jsx(fa,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(cF,{className:"mr-2 h-4 w-4"}),d?"Optimizing...":"Optimize"]})]}):c.jsxs(Ce,{onClick:ee,children:[c.jsx(Gu,{className:"mr-2 h-4 w-4"}),"Upload"]})]})]})})}function ZJ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function JJ({url:e}){const[t,n]=S.useState(!1),r=async()=>{await navigator.clipboard.writeText(e),n(!0),jt.success("URL copied to clipboard"),setTimeout(()=>n(!1),2e3)};return c.jsx(Ce,{onClick:r,size:"sm",variant:"outline",children:t?c.jsx(ai,{className:"h-3 w-3 text-green-500"}):c.jsx("span",{className:"text-xs",children:"Copy"})})}function eee(){return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(De,{className:"mb-2 h-8 w-36"}),c.jsx(De,{className:"h-4 w-48"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(De,{className:"h-9 w-9"}),c.jsx(De,{className:"h-9 w-24"})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(De,{className:"h-9 min-w-[200px] flex-1"}),c.jsx(De,{className:"h-9 w-40"}),c.jsx(De,{className:"h-9 w-20"})]}),c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:[1,2,3,4,5,6,7,8,9,10,11,12].map(e=>c.jsxs("div",{className:"overflow-hidden rounded-xl bg-muted shadow-sm",children:[c.jsx(De,{className:"aspect-square w-full"}),c.jsxs("div",{className:"space-y-2 p-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(De,{className:"h-4 w-4"}),c.jsx(De,{className:"h-4 flex-1"})]}),c.jsxs("div",{className:"flex items-center gap-2 pl-6",children:[c.jsx(De,{className:"h-4 w-10"}),c.jsx(De,{className:"h-4 w-12"})]})]})]},e))})]})}function tee(){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[c.jsx(If,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h2",{className:"mb-2 font-semibold text-xl",children:"No Storage Configured"}),c.jsxs("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:["Storage infrastructure has not been deployed yet. Run"," ",c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:"wraps storage init"})," ","to get started."]})]})}function nee({onUploadClick:e}){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[c.jsx(v$,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h3",{className:"mb-2 font-semibold text-lg",children:"No Files Yet"}),c.jsx("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:"Upload your first file to get started with your CDN library"}),c.jsxs(Ce,{onClick:e,children:[c.jsx(Gu,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]})}function ree({upload:e,onRemove:t}){return c.jsx("div",{className:"flex items-center gap-3 rounded-lg border bg-muted/30 p-3",children:c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[c.jsx("span",{className:"truncate font-medium text-sm",children:e.filename}),c.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="uploading"&&c.jsx(fa,{className:"h-4 w-4 animate-spin text-primary"}),e.status==="success"&&c.jsx(so,{className:"h-4 w-4 text-green-500"}),e.status==="error"&&c.jsx(lr,{className:"h-4 w-4 text-red-500"}),c.jsx(Ce,{className:"h-6 w-6",onClick:t,size:"icon",variant:"ghost",children:c.jsx(or,{className:"h-3 w-3"})})]})]}),e.status==="uploading"&&c.jsx(tv,{className:"h-1",value:e.progress}),e.status==="success"&&e.cdnUrl&&c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx("span",{className:"truncate text-muted-foreground text-xs",children:e.cdnUrl}),c.jsx(JJ,{url:e.cdnUrl})]}),e.status==="error"&&c.jsx("span",{className:"text-red-500 text-xs",children:e.error})]})})}function aee({uploads:e,onFilesSelected:t,onRemoveUpload:n}){const[r,i]=S.useState(!1),o=S.useRef(null),l=v=>{v.preventDefault(),i(!0)},f=v=>{v.preventDefault(),i(!1)},d=v=>{v.preventDefault(),i(!1),v.dataTransfer.files.length>0&&t(v.dataTransfer.files)},h=v=>{v.target.files&&v.target.files.length>0&&t(v.target.files)};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Upload Files"}),c.jsx(We,{children:"Drag and drop files or click to browse"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:`cursor-pointer rounded-lg border-2 border-dashed p-8 text-center transition-colors ${r?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-primary/50"}`,onClick:()=>o.current?.click(),onDragLeave:f,onDragOver:l,onDrop:d,children:[c.jsx(Gu,{className:"mx-auto mb-4 h-10 w-10 text-muted-foreground"}),c.jsx("p",{className:"mb-1 font-medium text-sm",children:"Drop files here or click to upload"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Images will be optimized before uploading"}),c.jsx("input",{accept:"*/*",className:"hidden",multiple:!0,onChange:h,ref:o,type:"file"})]}),e.length>0&&c.jsx("div",{className:"space-y-2",children:e.map((v,m)=>c.jsx(ree,{onRemove:()=>n(m),upload:v},`${v.filename}-${m}`))})]})]})}function iee(){const[e,t]=S.useState(null),[n,r]=S.useState(!0),[i,o]=S.useState(null),[l,f]=S.useState(()=>{if(typeof window<"u"){const $=localStorage.getItem("cdn-library-view-mode");if($==="grid"||$==="table")return $}return"grid"}),d=S.useCallback($=>{f($),localStorage.setItem("cdn-library-view-mode",$)},[]),[h,v]=S.useState(""),[m,g]=S.useState({starred:!1,formats:[]}),[x,O]=S.useState([]),[j,b]=S.useState(null),[E,_]=S.useState(!1),[A,C]=S.useState([]),[N,M]=S.useState({keys:[],isOpen:!1}),[R,D]=S.useState([]),[L,H]=S.useState(!1),B=S.useCallback(async()=>{try{r(!0),o(null);const $=sessionStorage.getItem("wraps-auth-token"),W=await fetch(`/api/cdn/files?token=${$}`);if(!W.ok){if(W.status===404){t(null);return}throw new Error("Failed to fetch storage files")}const ae=await W.json();t(ae)}catch($){o($ instanceof Error?$.message:"An error occurred")}finally{r(!1)}},[]);S.useEffect(()=>{B()},[B]);const U=S.useCallback(async($,W)=>{const ae=sessionStorage.getItem("wraps-auth-token");try{if(!(await fetch(`/api/cdn/files/${encodeURIComponent($)}/star?token=${ae}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({starred:W})})).ok)throw new Error("Failed to update star status");t(oe=>oe&&{...oe,files:oe.files.map(me=>me.key===$?{...me,starred:W}:me)}),j?.key===$&&b(oe=>oe?{...oe,starred:W}:null),jt.success(W?"File starred":"Star removed")}catch{jt.error("Failed to update star status")}},[j]),Y=S.useCallback(async $=>{const W=sessionStorage.getItem("wraps-auth-token");try{await Promise.all($.map(ae=>fetch(`/api/cdn/files/${encodeURIComponent(ae)}?token=${W}`,{method:"DELETE"}))),jt.success($.length===1?"File deleted":`${$.length} files deleted`),O([]),b(null),B()}catch{jt.error("Failed to delete file(s)")}},[B]),Z=S.useCallback(async($,W,ae)=>{const ce=sessionStorage.getItem("wraps-auth-token"),oe=$ instanceof File,me=ae||(oe?$.name:"file"),ie=$.type||"application/octet-stream";try{C(Re=>Re.map((be,qe)=>qe===W?{...be,status:"uploading",progress:0}:be));const ve=await fetch(`/api/cdn/upload-url?token=${ce}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:me,contentType:ie})});if(!ve.ok)throw new Error("Failed to get upload URL");const{uploadUrl:ye,cdnUrl:le}=await ve.json();await new Promise((Re,be)=>{const qe=new XMLHttpRequest;qe.upload.addEventListener("progress",rt=>{if(rt.lengthComputable){const mt=Math.round(rt.loaded/rt.total*100);C(vn=>vn.map((Mt,fr)=>fr===W?{...Mt,progress:mt}:Mt))}}),qe.addEventListener("load",()=>{qe.status>=200&&qe.status<300?Re():be(new Error(`Upload failed with status ${qe.status}`))}),qe.addEventListener("error",()=>be(new Error("Upload failed"))),qe.open("PUT",ye),qe.setRequestHeader("Content-Type",ie),qe.send($)}),C(Re=>Re.map((be,qe)=>qe===W?{...be,status:"success",progress:100,cdnUrl:le}:be)),jt.success(`Uploaded ${me}`),B()}catch(ve){C(ye=>ye.map((le,Re)=>Re===W?{...le,status:"error",error:ve instanceof Error?ve.message:"Upload failed"}:le)),jt.error(`Failed to upload ${me}`)}},[B]),X=S.useCallback($=>{const W=Array.from($),ae=W.filter(oe=>oe.type.startsWith("image/")),ce=W.filter(oe=>!oe.type.startsWith("image/"));if(ce.length>0){const oe=ce.map(ie=>({file:ie,filename:ie.name,progress:0,status:"pending"}));C(ie=>[...ie,...oe]),_(!0);const me=A.length;ce.forEach((ie,ve)=>{Z(ie,me+ve,ie.name)})}ae.length>0&&(D(ae),H(!0))},[A.length,Z]),k=S.useCallback($=>{if(!$||$.length===0)return;const W=A.length,ae=$.map(ce=>({file:ce.file,filename:ce.cdnFilename,progress:0,status:"pending"}));C(ce=>[...ce,...ae]),_(!0),$.forEach((ce,oe)=>{Z(ce.file,W+oe,ce.cdnFilename)})},[A.length,Z]),q=S.useMemo(()=>e?.files?e.files.filter($=>{if(h&&!$.key.toLowerCase().includes(h.toLowerCase())||m.starred&&!$.starred)return!1;if(m.formats.length>0){const W=$.key.split(".").pop()?.toLowerCase()||"";if(!m.formats.includes(W))return!1}return!0}):[],[e?.files,h,m]),V=S.useCallback($=>{O(W=>W.includes($)?W.filter(ae=>ae!==$):[...W,$])},[]),Q=S.useCallback(()=>{if(!e?.files)return;const $=q.map(W=>W.key);x.length===$.length?O([]):O($)},[e?.files,x.length,q]),ee=S.useCallback(async()=>{await Promise.all(x.map($=>U($,!0))),O([])},[x,U]),z=S.useCallback(()=>{M({keys:x,isOpen:!0})},[x]),G=S.useMemo(()=>{if(!e?.files)return[];const $=new Set;return e.files.forEach(W=>{const ae=W.key.split(".").pop()?.toLowerCase();ae&&$.add(ae)}),Array.from($).sort()},[e?.files]);return n?c.jsx(eee,{}):i?c.jsxs(Un,{variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(ro,{children:"Error"}),c.jsx(Hn,{children:i})]}):e?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold text-2xl",children:"CDN Library"}),c.jsx("p",{className:"text-muted-foreground",children:e.fileCount>0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-foreground",children:e.fileCount})," File",e.fileCount!==1?"s":""," · Total"," ",c.jsx("span",{className:"text-foreground",children:ZJ(e.totalSize)})]}):"Manage and organize your files"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ce,{onClick:B,size:"icon",variant:"outline",children:c.jsx(Lf,{className:"h-4 w-4"})}),c.jsxs(Ce,{onClick:()=>_(!E),children:[c.jsx(Gu,{className:"mr-2 h-4 w-4"}),"Upload"]})]})]}),E&&c.jsx(aee,{onFilesSelected:X,onRemoveUpload:$=>C(W=>W.filter((ae,ce)=>ce!==$)),uploads:A}),e.files.length>0&&c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[x.length>0&&c.jsxs("div",{className:"flex items-center rounded-lg border",children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-r px-2.5 py-1.5 font-medium text-sm",children:[x.length," selected"]}),c.jsx(rv,{className:"rounded-none border-0",label:"Star",onToggle:ee,size:"sm"}),c.jsx(xL,{className:"rounded-none border-0 border-l",label:"Delete",onDelete:z,size:"sm",variant:"ghost"}),c.jsx(Ce,{className:"rounded-l-none border-0 border-l",onClick:()=>O([]),size:"sm",variant:"ghost",children:c.jsx(or,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"relative min-w-[200px] flex-1",children:[c.jsx(Cp,{className:"-translate-y-1/2 absolute top-1/2 left-3 h-4 w-4 text-muted-foreground"}),c.jsx(fs,{className:"pl-9",onChange:$=>v($.target.value),placeholder:"Search files...",type:"search",value:h})]}),c.jsxs("div",{className:"flex items-center rounded-lg border",children:[c.jsxs(Ce,{className:"rounded-r-none border-0",onClick:()=>g({...m,starred:!m.starred}),size:"sm",variant:m.starred?"secondary":"ghost",children:[c.jsx(b$,{className:`mr-1.5 h-4 w-4 ${m.starred?"fill-current":""}`}),"Starred"]}),G.length>0&&c.jsxs(F5,{children:[c.jsx(G5,{asChild:!0,children:c.jsxs(Ce,{className:"rounded-l-none border-0 border-l",size:"sm",variant:"ghost",children:[c.jsx(QH,{className:"mr-1.5 h-4 w-4"}),"Formats",m.formats.length>0&&c.jsx(Be,{className:"ml-1.5 px-1.5 py-0 text-xs",variant:"secondary",children:m.formats.length})]})}),c.jsxs(V5,{align:"end",className:"w-48",children:[c.jsx(Y5,{children:"File Format"}),c.jsx(iS,{}),G.map($=>c.jsx(FK,{checked:m.formats.includes($),onCheckedChange:W=>{g({...m,formats:W?[...m.formats,$]:m.formats.filter(ae=>ae!==$)})},children:$.toUpperCase()},$))]})]})]}),c.jsxs(MX,{className:"rounded-lg border",onValueChange:$=>$&&d($),type:"single",value:l,children:[c.jsx(QC,{"aria-label":"Grid view",className:"rounded-r-none border-0",value:"grid",children:c.jsx(ZH,{className:"h-4 w-4"})}),c.jsx(QC,{"aria-label":"Table view",className:"rounded-l-none border-0 border-l",value:"table",children:c.jsx(eF,{className:"h-4 w-4"})})]})]}),e.files.length===0?c.jsx(nee,{onUploadClick:()=>_(!0)}):q.length===0?c.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"No files match your search or filters"}):l==="grid"?c.jsx(iZ,{files:q,onFileClick:b,onSelectFile:V,onToggleStar:U,selectedFiles:x}):c.jsx(SZ,{files:q,onFileClick:b,onSelectAll:Q,onSelectFile:V,onToggleStar:U,selectedFiles:x}),j&&c.jsx(ZQ,{file:j,onClose:()=>b(null),onDelete:$=>{M({keys:[$],isOpen:!0})},onToggleStar:U}),c.jsx(dm,{onOpenChange:$=>M(W=>({...W,isOpen:$})),open:N.isOpen,children:c.jsxs(hm,{children:[c.jsxs(mm,{children:[c.jsxs(vm,{children:["Delete File",N.keys.length>1?"s":""]}),c.jsxs(gm,{children:["Are you sure you want to delete"," ",N.keys.length===1?c.jsx("strong",{children:N.keys[0].split("/").pop()}):c.jsxs("strong",{children:[N.keys.length," files"]}),"? This action cannot be undone."]})]}),c.jsxs(pm,{children:[c.jsx(xm,{children:"Cancel"}),c.jsx(ym,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{Y(N.keys),M({keys:[],isOpen:!1})},children:"Delete"})]})]})}),c.jsx(QJ,{files:R,onClose:()=>{H(!1),D([])},onComplete:k,open:L})]}):c.jsx(tee,{})}var Lx,oT;function Vn(){if(oT)return Lx;oT=1;var e=Array.isArray;return Lx=e,Lx}var zx,sT;function U3(){if(sT)return zx;sT=1;var e=typeof gh=="object"&&gh&&gh.Object===Object&&gh;return zx=e,zx}var Bx,lT;function Aa(){if(lT)return Bx;lT=1;var e=U3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Bx=n,Bx}var qx,cT;function Wf(){if(cT)return qx;cT=1;var e=Aa(),t=e.Symbol;return qx=t,qx}var Ux,uT;function oee(){if(uT)return Ux;uT=1;var e=Wf(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function o(l){var f=n.call(l,i),d=l[i];try{l[i]=void 0;var h=!0}catch{}var v=r.call(l);return h&&(f?l[i]=d:delete l[i]),v}return Ux=o,Ux}var Hx,fT;function see(){if(fT)return Hx;fT=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Hx=n,Hx}var Fx,dT;function pi(){if(dT)return Fx;dT=1;var e=Wf(),t=oee(),n=see(),r="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function l(f){return f==null?f===void 0?i:r:o&&o in Object(f)?t(f):n(f)}return Fx=l,Fx}var Gx,hT;function vi(){if(hT)return Gx;hT=1;function e(t){return t!=null&&typeof t=="object"}return Gx=e,Gx}var Vx,mT;function gc(){if(mT)return Vx;mT=1;var e=pi(),t=vi(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return Vx=r,Vx}var Yx,pT;function BO(){if(pT)return Yx;pT=1;var e=Vn(),t=gc(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,l){if(e(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||l!=null&&o in Object(l)}return Yx=i,Yx}var Wx,vT;function ho(){if(vT)return Wx;vT=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Wx=e,Wx}var Kx,gT;function qO(){if(gT)return Kx;gT=1;var e=pi(),t=ho(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function l(f){if(!t(f))return!1;var d=e(f);return d==r||d==i||d==n||d==o}return Kx=l,Kx}var Xx,yT;function lee(){if(yT)return Xx;yT=1;var e=Aa(),t=e["__core-js_shared__"];return Xx=t,Xx}var Qx,xT;function cee(){if(xT)return Qx;xT=1;var e=lee(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return Qx=n,Qx}var Zx,bT;function H3(){if(bT)return Zx;bT=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Zx=n,Zx}var Jx,wT;function uee(){if(wT)return Jx;wT=1;var e=qO(),t=cee(),n=ho(),r=H3(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,l=Function.prototype,f=Object.prototype,d=l.toString,h=f.hasOwnProperty,v=RegExp("^"+d.call(h).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(g){if(!n(g)||t(g))return!1;var x=e(g)?v:o;return x.test(r(g))}return Jx=m,Jx}var eb,ST;function fee(){if(ST)return eb;ST=1;function e(t,n){return t?.[n]}return eb=e,eb}var tb,jT;function gs(){if(jT)return tb;jT=1;var e=uee(),t=fee();function n(r,i){var o=t(r,i);return e(o)?o:void 0}return tb=n,tb}var nb,OT;function yv(){if(OT)return nb;OT=1;var e=gs(),t=e(Object,"create");return nb=t,nb}var rb,ET;function dee(){if(ET)return rb;ET=1;var e=yv();function t(){this.__data__=e?e(null):{},this.size=0}return rb=t,rb}var ab,_T;function hee(){if(_T)return ab;_T=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return ab=e,ab}var ib,AT;function mee(){if(AT)return ib;AT=1;var e=yv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var l=this.__data__;if(e){var f=l[o];return f===t?void 0:f}return r.call(l,o)?l[o]:void 0}return ib=i,ib}var ob,NT;function pee(){if(NT)return ob;NT=1;var e=yv(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var o=this.__data__;return e?o[i]!==void 0:n.call(o,i)}return ob=r,ob}var sb,CT;function vee(){if(CT)return sb;CT=1;var e=yv(),t="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&i===void 0?t:i,this}return sb=n,sb}var lb,TT;function gee(){if(TT)return lb;TT=1;var e=dee(),t=hee(),n=mee(),r=pee(),i=vee();function o(l){var f=-1,d=l==null?0:l.length;for(this.clear();++f<d;){var h=l[f];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,lb=o,lb}var cb,MT;function yee(){if(MT)return cb;MT=1;function e(){this.__data__=[],this.size=0}return cb=e,cb}var ub,RT;function UO(){if(RT)return ub;RT=1;function e(t,n){return t===n||t!==t&&n!==n}return ub=e,ub}var fb,DT;function xv(){if(DT)return fb;DT=1;var e=UO();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return fb=t,fb}var db,PT;function xee(){if(PT)return db;PT=1;var e=xv(),t=Array.prototype,n=t.splice;function r(i){var o=this.__data__,l=e(o,i);if(l<0)return!1;var f=o.length-1;return l==f?o.pop():n.call(o,l,1),--this.size,!0}return db=r,db}var hb,kT;function bee(){if(kT)return hb;kT=1;var e=xv();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return hb=t,hb}var mb,$T;function wee(){if($T)return mb;$T=1;var e=xv();function t(n){return e(this.__data__,n)>-1}return mb=t,mb}var pb,IT;function See(){if(IT)return pb;IT=1;var e=xv();function t(n,r){var i=this.__data__,o=e(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return pb=t,pb}var vb,LT;function bv(){if(LT)return vb;LT=1;var e=yee(),t=xee(),n=bee(),r=wee(),i=See();function o(l){var f=-1,d=l==null?0:l.length;for(this.clear();++f<d;){var h=l[f];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,vb=o,vb}var gb,zT;function HO(){if(zT)return gb;zT=1;var e=gs(),t=Aa(),n=e(t,"Map");return gb=n,gb}var yb,BT;function jee(){if(BT)return yb;BT=1;var e=gee(),t=bv(),n=HO();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return yb=r,yb}var xb,qT;function Oee(){if(qT)return xb;qT=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return xb=e,xb}var bb,UT;function wv(){if(UT)return bb;UT=1;var e=Oee();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return bb=t,bb}var wb,HT;function Eee(){if(HT)return wb;HT=1;var e=wv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return wb=t,wb}var Sb,FT;function _ee(){if(FT)return Sb;FT=1;var e=wv();function t(n){return e(this,n).get(n)}return Sb=t,Sb}var jb,GT;function Aee(){if(GT)return jb;GT=1;var e=wv();function t(n){return e(this,n).has(n)}return jb=t,jb}var Ob,VT;function Nee(){if(VT)return Ob;VT=1;var e=wv();function t(n,r){var i=e(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Ob=t,Ob}var Eb,YT;function FO(){if(YT)return Eb;YT=1;var e=jee(),t=Eee(),n=_ee(),r=Aee(),i=Nee();function o(l){var f=-1,d=l==null?0:l.length;for(this.clear();++f<d;){var h=l[f];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Eb=o,Eb}var _b,WT;function F3(){if(WT)return _b;WT=1;var e=FO(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var o=function(){var l=arguments,f=i?i.apply(this,l):l[0],d=o.cache;if(d.has(f))return d.get(f);var h=r.apply(this,l);return o.cache=d.set(f,h)||d,h};return o.cache=new(n.Cache||e),o}return n.Cache=e,_b=n,_b}var Ab,KT;function Cee(){if(KT)return Ab;KT=1;var e=F3(),t=500;function n(r){var i=e(r,function(l){return o.size===t&&o.clear(),l}),o=i.cache;return i}return Ab=n,Ab}var Nb,XT;function Tee(){if(XT)return Nb;XT=1;var e=Cee(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(t,function(l,f,d,h){o.push(d?h.replace(n,"$1"):f||l)}),o});return Nb=r,Nb}var Cb,QT;function GO(){if(QT)return Cb;QT=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,o=Array(i);++r<i;)o[r]=n(t[r],r,t);return o}return Cb=e,Cb}var Tb,ZT;function Mee(){if(ZT)return Tb;ZT=1;var e=Wf(),t=GO(),n=Vn(),r=gc(),i=e?e.prototype:void 0,o=i?i.toString:void 0;function l(f){if(typeof f=="string")return f;if(n(f))return t(f,l)+"";if(r(f))return o?o.call(f):"";var d=f+"";return d=="0"&&1/f==-1/0?"-0":d}return Tb=l,Tb}var Mb,JT;function G3(){if(JT)return Mb;JT=1;var e=Mee();function t(n){return n==null?"":e(n)}return Mb=t,Mb}var Rb,eM;function V3(){if(eM)return Rb;eM=1;var e=Vn(),t=BO(),n=Tee(),r=G3();function i(o,l){return e(o)?o:t(o,l)?[o]:n(r(o))}return Rb=i,Rb}var Db,tM;function Sv(){if(tM)return Db;tM=1;var e=gc();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Db=t,Db}var Pb,nM;function VO(){if(nM)return Pb;nM=1;var e=V3(),t=Sv();function n(r,i){i=e(i,r);for(var o=0,l=i.length;r!=null&&o<l;)r=r[t(i[o++])];return o&&o==l?r:void 0}return Pb=n,Pb}var kb,rM;function Y3(){if(rM)return kb;rM=1;var e=VO();function t(n,r,i){var o=n==null?void 0:e(n,r);return o===void 0?i:o}return kb=t,kb}var Ree=Y3();const Mr=xt(Ree);var $b,aM;function Dee(){if(aM)return $b;aM=1;function e(t){return t==null}return $b=e,$b}var Pee=Dee();const Qe=xt(Pee);var Ib,iM;function kee(){if(iM)return Ib;iM=1;var e=pi(),t=Vn(),n=vi(),r="[object String]";function i(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return Ib=i,Ib}var $ee=kee();const as=xt($ee);var Iee=qO();const Ye=xt(Iee);var Lee=ho();const yc=xt(Lee);var Lb={exports:{}},lt={};var oM;function zee(){if(oM)return lt;oM=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),f=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),O;O=Symbol.for("react.module.reference");function j(b){if(typeof b=="object"&&b!==null){var E=b.$$typeof;switch(E){case e:switch(b=b.type,b){case n:case i:case r:case h:case v:return b;default:switch(b=b&&b.$$typeof,b){case f:case l:case d:case g:case m:case o:return b;default:return E}}case t:return E}}}return lt.ContextConsumer=l,lt.ContextProvider=o,lt.Element=e,lt.ForwardRef=d,lt.Fragment=n,lt.Lazy=g,lt.Memo=m,lt.Portal=t,lt.Profiler=i,lt.StrictMode=r,lt.Suspense=h,lt.SuspenseList=v,lt.isAsyncMode=function(){return!1},lt.isConcurrentMode=function(){return!1},lt.isContextConsumer=function(b){return j(b)===l},lt.isContextProvider=function(b){return j(b)===o},lt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},lt.isForwardRef=function(b){return j(b)===d},lt.isFragment=function(b){return j(b)===n},lt.isLazy=function(b){return j(b)===g},lt.isMemo=function(b){return j(b)===m},lt.isPortal=function(b){return j(b)===t},lt.isProfiler=function(b){return j(b)===i},lt.isStrictMode=function(b){return j(b)===r},lt.isSuspense=function(b){return j(b)===h},lt.isSuspenseList=function(b){return j(b)===v},lt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===h||b===v||b===x||typeof b=="object"&&b!==null&&(b.$$typeof===g||b.$$typeof===m||b.$$typeof===o||b.$$typeof===l||b.$$typeof===d||b.$$typeof===O||b.getModuleId!==void 0)},lt.typeOf=j,lt}var sM;function Bee(){return sM||(sM=1,Lb.exports=zee()),Lb.exports}var qee=Bee(),zb,lM;function W3(){if(lM)return zb;lM=1;var e=pi(),t=vi(),n="[object Number]";function r(i){return typeof i=="number"||t(i)&&e(i)==n}return zb=r,zb}var Bb,cM;function Uee(){if(cM)return Bb;cM=1;var e=W3();function t(n){return e(n)&&n!=+n}return Bb=t,Bb}var Hee=Uee();const Kf=xt(Hee);var Fee=W3();const Gee=xt(Fee);var Yr=function(t){return t===0?0:t>0?1:-1},Vo=function(t){return as(t)&&t.indexOf("%")===t.length-1},xe=function(t){return Gee(t)&&!Kf(t)},Vee=function(t){return Qe(t)},Jt=function(t){return xe(t)||as(t)},Yee=0,Xf=function(t){var n=++Yee;return"".concat(t||"").concat(n)},is=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!xe(t)&&!as(t))return r;var o;if(Vo(t)){var l=t.indexOf("%");o=n*parseFloat(t.slice(0,l))/100}else o=+t;return Kf(o)&&(o=r),i&&o>n&&(o=n),o},Ki=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},Wee=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},Gr=function(t,n){return xe(t)&&xe(n)?function(r){return t+r*(n-t)}:function(){return n}};function Nm(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Mr(r,t))===n})}var Kee=function(t,n){return xe(t)&&xe(n)?t-n:as(t)&&as(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function _l(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function gS(e){"@babel/helpers - typeof";return gS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gS(e)}var Xee=["viewBox","children"],Qee=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],uM=["points","pathLength"],qb={svg:Xee,polygon:uM,polyline:uM},YO=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Cm=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(S.isValidElement(t)&&(r=t.props),!yc(r))return null;var i={};return Object.keys(r).forEach(function(o){YO.includes(o)&&(i[o]=n||function(l){return r[o](r,l)})}),i},Zee=function(t,n,r){return function(i){return t(n,r,i),null}},Tm=function(t,n,r){if(!yc(t)||gS(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(o){var l=t[o];YO.includes(o)&&typeof l=="function"&&(i||(i={}),i[o]=Zee(l,n,r))}),i},Jee=["children"],ete=["children"];function fM(e,t){if(e==null)return{};var n=tte(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yS(e){"@babel/helpers - typeof";return yS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yS(e)}var dM={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ei=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},hM=null,Ub=null,WO=function e(t){if(t===hM&&Array.isArray(Ub))return Ub;var n=[];return S.Children.forEach(t,function(r){Qe(r)||(qee.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Ub=n,hM=t,n};function Rr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return ei(i)}):r=[ei(t)],WO(e).forEach(function(i){var o=Mr(i,"type.displayName")||Mr(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function rr(e,t){var n=Rr(e,t);return n&&n[0]}var mM=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!xe(r)||r<=0||!xe(i)||i<=0)},nte=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],rte=function(t){return t&&t.type&&as(t.type)&&nte.indexOf(t.type)>=0},ate=function(t){return t&&yS(t)==="object"&&"clipDot"in t},ite=function(t,n,r,i){var o,l=(o=qb?.[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!Ye(t)&&(i&&l.includes(n)||Qee.includes(n))||r&&YO.includes(n)},nt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(S.isValidElement(t)&&(i=t.props),!yc(i))return null;var o={};return Object.keys(i).forEach(function(l){var f;ite((f=i)===null||f===void 0?void 0:f[l],l,n,r)&&(o[l]=i[l])}),o},xS=function e(t,n){if(t===n)return!0;var r=S.Children.count(t);if(r!==S.Children.count(n))return!1;if(r===0)return!0;if(r===1)return pM(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var o=t[i],l=n[i];if(Array.isArray(o)||Array.isArray(l)){if(!e(o,l))return!1}else if(!pM(o,l))return!1}return!0},pM=function(t,n){if(Qe(t)&&Qe(n))return!0;if(!Qe(t)&&!Qe(n)){var r=t.props||{},i=r.children,o=fM(r,Jee),l=n.props||{},f=l.children,d=fM(l,ete);return i&&f?_l(o,d)&&xS(i,f):!i&&!f?_l(o,d):!1}return!1},vM=function(t,n){var r=[],i={};return WO(t).forEach(function(o,l){if(rte(o))r.push(o);else if(o){var f=ei(o.type),d=n[f]||{},h=d.handler,v=d.once;if(h&&(!v||!i[f])){var m=h(o,f,l);r.push(m),i[f]=!0}}}),r},ote=function(t){var n=t&&t.type;return n&&dM[n]?dM[n]:null},ste=function(t,n){return WO(n).indexOf(t)},lte=["children","width","height","viewBox","className","style","title","desc"];function bS(){return bS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bS.apply(this,arguments)}function cte(e,t){if(e==null)return{};var n=ute(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ute(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function wS(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,l=e.style,f=e.title,d=e.desc,h=cte(e,lte),v=i||{width:n,height:r,x:0,y:0},m=et("recharts-surface",o);return I.createElement("svg",bS({},nt(h,!0,"svg"),{className:m,width:n,height:r,style:l,viewBox:"".concat(v.x," ").concat(v.y," ").concat(v.width," ").concat(v.height)}),I.createElement("title",null,f),I.createElement("desc",null,d),t)}var fte=["children","className"];function SS(){return SS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SS.apply(this,arguments)}function dte(e,t){if(e==null)return{};var n=hte(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Bt=I.forwardRef(function(e,t){var n=e.children,r=e.className,i=dte(e,fte),o=et("recharts-layer",r);return I.createElement("g",SS({className:o},nt(i,!0),{ref:t}),n)}),ti=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o]},Hb,gM;function mte(){if(gM)return Hb;gM=1;function e(t,n,r){var i=-1,o=t.length;n<0&&(n=-n>o?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(o);++i<o;)l[i]=t[i+n];return l}return Hb=e,Hb}var Fb,yM;function pte(){if(yM)return Fb;yM=1;var e=mte();function t(n,r,i){var o=n.length;return i=i===void 0?o:i,!r&&i>=o?n:e(n,r,i)}return Fb=t,Fb}var Gb,xM;function K3(){if(xM)return Gb;xM=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,o="\\ufe0e\\ufe0f",l="\\u200d",f=RegExp("["+l+e+i+o+"]");function d(h){return f.test(h)}return Gb=d,Gb}var Vb,bM;function vte(){if(bM)return Vb;bM=1;function e(t){return t.split("")}return Vb=e,Vb}var Yb,wM;function gte(){if(wM)return Yb;wM=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,o="\\ufe0e\\ufe0f",l="["+e+"]",f="["+i+"]",d="\\ud83c[\\udffb-\\udfff]",h="(?:"+f+"|"+d+")",v="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",O=h+"?",j="["+o+"]?",b="(?:"+x+"(?:"+[v,m,g].join("|")+")"+j+O+")*",E=j+O+b,_="(?:"+[v+f+"?",f,m,g,l].join("|")+")",A=RegExp(d+"(?="+d+")|"+_+E,"g");function C(N){return N.match(A)||[]}return Yb=C,Yb}var Wb,SM;function yte(){if(SM)return Wb;SM=1;var e=vte(),t=K3(),n=gte();function r(i){return t(i)?n(i):e(i)}return Wb=r,Wb}var Kb,jM;function xte(){if(jM)return Kb;jM=1;var e=pte(),t=K3(),n=yte(),r=G3();function i(o){return function(l){l=r(l);var f=t(l)?n(l):void 0,d=f?f[0]:l.charAt(0),h=f?e(f,1).join(""):l.slice(1);return d[o]()+h}}return Kb=i,Kb}var Xb,OM;function bte(){if(OM)return Xb;OM=1;var e=xte(),t=e("toUpperCase");return Xb=t,Xb}var wte=bte();const jv=xt(wte);function St(e){return function(){return e}}const X3=Math.cos,Mm=Math.sin,ea=Math.sqrt,Rm=Math.PI,Ov=2*Rm,jS=Math.PI,OS=2*jS,Fo=1e-6,Ste=OS-Fo;function Q3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function jte(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Q3;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Ote{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Q3:jte(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+l}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let l=this._x1,f=this._y1,d=r-t,h=i-n,v=l-t,m=f-n,g=v*v+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Fo)if(!(Math.abs(m*d-h*v)>Fo)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-l,O=i-f,j=d*d+h*h,b=x*x+O*O,E=Math.sqrt(j),_=Math.sqrt(g),A=o*Math.tan((jS-Math.acos((j+g-b)/(2*E*_)))/2),C=A/_,N=A/E;Math.abs(C-1)>Fo&&this._append`L${t+C*v},${n+C*m}`,this._append`A${o},${o},0,0,${+(m*x>v*O)},${this._x1=t+N*d},${this._y1=n+N*h}`}}arc(t,n,r,i,o,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let f=r*Math.cos(i),d=r*Math.sin(i),h=t+f,v=n+d,m=1^l,g=l?i-o:o-i;this._x1===null?this._append`M${h},${v}`:(Math.abs(this._x1-h)>Fo||Math.abs(this._y1-v)>Fo)&&this._append`L${h},${v}`,r&&(g<0&&(g=g%OS+OS),g>Ste?this._append`A${r},${r},0,1,${m},${t-f},${n-d}A${r},${r},0,1,${m},${this._x1=h},${this._y1=v}`:g>Fo&&this._append`A${r},${r},0,${+(g>=jS)},${m},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function KO(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Ote(t)}function XO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Z3(e){this._context=e}Z3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ev(e){return new Z3(e)}function J3(e){return e[0]}function ez(e){return e[1]}function tz(e,t){var n=St(!0),r=null,i=Ev,o=null,l=KO(f);e=typeof e=="function"?e:e===void 0?J3:St(e),t=typeof t=="function"?t:t===void 0?ez:St(t);function f(d){var h,v=(d=XO(d)).length,m,g=!1,x;for(r==null&&(o=i(x=l())),h=0;h<=v;++h)!(h<v&&n(m=d[h],h,d))===g&&((g=!g)?o.lineStart():o.lineEnd()),g&&o.point(+e(m,h,d),+t(m,h,d));if(x)return o=null,x+""||null}return f.x=function(d){return arguments.length?(e=typeof d=="function"?d:St(+d),f):e},f.y=function(d){return arguments.length?(t=typeof d=="function"?d:St(+d),f):t},f.defined=function(d){return arguments.length?(n=typeof d=="function"?d:St(!!d),f):n},f.curve=function(d){return arguments.length?(i=d,r!=null&&(o=i(r)),f):i},f.context=function(d){return arguments.length?(d==null?r=o=null:o=i(r=d),f):r},f}function Mh(e,t,n){var r=null,i=St(!0),o=null,l=Ev,f=null,d=KO(h);e=typeof e=="function"?e:e===void 0?J3:St(+e),t=typeof t=="function"?t:St(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?ez:St(+n);function h(m){var g,x,O,j=(m=XO(m)).length,b,E=!1,_,A=new Array(j),C=new Array(j);for(o==null&&(f=l(_=d())),g=0;g<=j;++g){if(!(g<j&&i(b=m[g],g,m))===E)if(E=!E)x=g,f.areaStart(),f.lineStart();else{for(f.lineEnd(),f.lineStart(),O=g-1;O>=x;--O)f.point(A[O],C[O]);f.lineEnd(),f.areaEnd()}E&&(A[g]=+e(b,g,m),C[g]=+t(b,g,m),f.point(r?+r(b,g,m):A[g],n?+n(b,g,m):C[g]))}if(_)return f=null,_+""||null}function v(){return tz().defined(i).curve(l).context(o)}return h.x=function(m){return arguments.length?(e=typeof m=="function"?m:St(+m),r=null,h):e},h.x0=function(m){return arguments.length?(e=typeof m=="function"?m:St(+m),h):e},h.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:St(+m),h):r},h.y=function(m){return arguments.length?(t=typeof m=="function"?m:St(+m),n=null,h):t},h.y0=function(m){return arguments.length?(t=typeof m=="function"?m:St(+m),h):t},h.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:St(+m),h):n},h.lineX0=h.lineY0=function(){return v().x(e).y(t)},h.lineY1=function(){return v().x(e).y(n)},h.lineX1=function(){return v().x(r).y(t)},h.defined=function(m){return arguments.length?(i=typeof m=="function"?m:St(!!m),h):i},h.curve=function(m){return arguments.length?(l=m,o!=null&&(f=l(o)),h):l},h.context=function(m){return arguments.length?(m==null?o=f=null:f=l(o=m),h):o},h}class nz{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Ete(e){return new nz(e,!0)}function _te(e){return new nz(e,!1)}const QO={draw(e,t){const n=ea(t/Rm);e.moveTo(n,0),e.arc(0,0,n,0,Ov)}},Ate={draw(e,t){const n=ea(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},rz=ea(1/3),Nte=rz*2,Cte={draw(e,t){const n=ea(t/Nte),r=n*rz;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Tte={draw(e,t){const n=ea(t),r=-n/2;e.rect(r,r,n,n)}},Mte=.8908130915292852,az=Mm(Rm/10)/Mm(7*Rm/10),Rte=Mm(Ov/10)*az,Dte=-X3(Ov/10)*az,Pte={draw(e,t){const n=ea(t*Mte),r=Rte*n,i=Dte*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const l=Ov*o/5,f=X3(l),d=Mm(l);e.lineTo(d*n,-f*n),e.lineTo(f*r-d*i,d*r+f*i)}e.closePath()}},Qb=ea(3),kte={draw(e,t){const n=-ea(t/(Qb*3));e.moveTo(0,n*2),e.lineTo(-Qb*n,-n),e.lineTo(Qb*n,-n),e.closePath()}},jr=-.5,Or=ea(3)/2,ES=1/ea(12),$te=(ES/2+1)*3,Ite={draw(e,t){const n=ea(t/$te),r=n/2,i=n*ES,o=r,l=n*ES+n,f=-o,d=l;e.moveTo(r,i),e.lineTo(o,l),e.lineTo(f,d),e.lineTo(jr*r-Or*i,Or*r+jr*i),e.lineTo(jr*o-Or*l,Or*o+jr*l),e.lineTo(jr*f-Or*d,Or*f+jr*d),e.lineTo(jr*r+Or*i,jr*i-Or*r),e.lineTo(jr*o+Or*l,jr*l-Or*o),e.lineTo(jr*f+Or*d,jr*d-Or*f),e.closePath()}};function Lte(e,t){let n=null,r=KO(i);e=typeof e=="function"?e:St(e||QO),t=typeof t=="function"?t:St(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:St(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:St(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Dm(){}function Pm(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function iz(e){this._context=e}iz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Pm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zte(e){return new iz(e)}function oz(e){this._context=e}oz.prototype={areaStart:Dm,areaEnd:Dm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bte(e){return new oz(e)}function sz(e){this._context=e}sz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qte(e){return new sz(e)}function lz(e){this._context=e}lz.prototype={areaStart:Dm,areaEnd:Dm,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Ute(e){return new lz(e)}function EM(e){return e<0?-1:1}function _M(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),f=(o*i+l*r)/(r+i);return(EM(o)+EM(l))*Math.min(Math.abs(o),Math.abs(l),.5*Math.abs(f))||0}function AM(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Zb(e,t,n){var r=e._x0,i=e._y0,o=e._x1,l=e._y1,f=(o-r)/3;e._context.bezierCurveTo(r+f,i+f*t,o-f,l-f*n,o,l)}function km(e){this._context=e}km.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Zb(this,this._t0,AM(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Zb(this,AM(this,n=_M(this,e,t)),n);break;default:Zb(this,this._t0,n=_M(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function cz(e){this._context=new uz(e)}(cz.prototype=Object.create(km.prototype)).point=function(e,t){km.prototype.point.call(this,t,e)};function uz(e){this._context=e}uz.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function Hte(e){return new km(e)}function Fte(e){return new cz(e)}function fz(e){this._context=e}fz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=NM(e),i=NM(t),o=0,l=1;l<n;++o,++l)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function NM(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),l=new Array(n);for(i[0]=0,o[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function Gte(e){return new fz(e)}function _v(e,t){this._context=e,this._t=t}_v.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Vte(e){return new _v(e,.5)}function Yte(e){return new _v(e,0)}function Wte(e){return new _v(e,1)}function kl(e,t){if((l=e.length)>1)for(var n=1,r,i,o=e[t[0]],l,f=o.length;n<l;++n)for(i=o,o=e[t[n]],r=0;r<f;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function _S(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Kte(e,t){return e[t]}function Xte(e){const t=[];return t.key=e,t}function Qte(){var e=St([]),t=_S,n=kl,r=Kte;function i(o){var l=Array.from(e.apply(this,arguments),Xte),f,d=l.length,h=-1,v;for(const m of o)for(f=0,++h;f<d;++f)(l[f][h]=[0,+r(m,l[f].key,h,o)]).data=m;for(f=0,v=XO(t(l));f<d;++f)l[v[f]].index=f;return n(l,v),l}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:St(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:St(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?_S:typeof o=="function"?o:St(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??kl,i):n},i}function Zte(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,l;i<o;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}kl(e,t)}}function Jte(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var l=0,f=0;l<i;++l)f+=e[l][n][1]||0;r[n][1]+=r[n][0]=-f/2}kl(e,t)}}function ene(e,t){if(!(!((l=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,l;r<o;++r){for(var f=0,d=0,h=0;f<l;++f){for(var v=e[t[f]],m=v[r][1]||0,g=v[r-1][1]||0,x=(m-g)/2,O=0;O<f;++O){var j=e[t[O]],b=j[r][1]||0,E=j[r-1][1]||0;x+=b-E}d+=m,h+=x*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=h/d)}i[r-1][1]+=i[r-1][0]=n,kl(e,t)}}function Ju(e){"@babel/helpers - typeof";return Ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ju(e)}var tne=["type","size","sizeType"];function AS(){return AS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AS.apply(this,arguments)}function CM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function TM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CM(Object(n),!0).forEach(function(r){nne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nne(e,t,n){return t=rne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rne(e){var t=ane(e,"string");return Ju(t)=="symbol"?t:t+""}function ane(e,t){if(Ju(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ju(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ine(e,t){if(e==null)return{};var n=one(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function one(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var dz={symbolCircle:QO,symbolCross:Ate,symbolDiamond:Cte,symbolSquare:Tte,symbolStar:Pte,symbolTriangle:kte,symbolWye:Ite},sne=Math.PI/180,lne=function(t){var n="symbol".concat(jv(t));return dz[n]||QO},cne=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*sne;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},une=function(t,n){dz["symbol".concat(jv(t))]=n},ZO=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,l=t.sizeType,f=l===void 0?"area":l,d=ine(t,tne),h=TM(TM({},d),{},{type:r,size:o,sizeType:f}),v=function(){var b=lne(r),E=Lte().type(b).size(cne(o,f,r));return E()},m=h.className,g=h.cx,x=h.cy,O=nt(h,!0);return g===+g&&x===+x&&o===+o?I.createElement("path",AS({},O,{className:et("recharts-symbols",m),transform:"translate(".concat(g,", ").concat(x,")"),d:v()})):null};ZO.registerSymbol=une;function $l(e){"@babel/helpers - typeof";return $l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$l(e)}function NS(){return NS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NS.apply(this,arguments)}function MM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MM(Object(n),!0).forEach(function(r){ef(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mz(r.key),r)}}function mne(e,t,n){return t&&hne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pne(e,t,n){return t=$m(t),vne(e,hz()?Reflect.construct(t,n||[],$m(e).constructor):t.apply(e,n))}function vne(e,t){if(t&&($l(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gne(e)}function gne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hz=function(){return!!e})()}function $m(e){return $m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$m(e)}function yne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&CS(e,t)}function CS(e,t){return CS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},CS(e,t)}function ef(e,t,n){return t=mz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mz(e){var t=xne(e,"string");return $l(t)=="symbol"?t:t+""}function xne(e,t){if($l(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($l(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Er=32,JO=(function(e){function t(){return dne(this,t),pne(this,t,arguments)}return yne(t,e),mne(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,o=Er/2,l=Er/6,f=Er/3,d=r.inactive?i:r.color;if(r.type==="plainline")return I.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:Er,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return I.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(o,"h").concat(f,`
|
|
67
67
|
A`).concat(l,",").concat(l,",0,1,1,").concat(2*f,",").concat(o,`
|
|
68
68
|
H`).concat(Er,"M").concat(2*f,",").concat(o,`
|
|
69
69
|
A`).concat(l,",").concat(l,",0,1,1,").concat(f,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return I.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(Er/8,"h").concat(Er,"v").concat(Er*3/4,"h").concat(-Er,"z"),className:"recharts-legend-icon"});if(I.isValidElement(r.legendIcon)){var h=fne({},r);return delete h.legendIcon,I.cloneElement(r.legendIcon,h)}return I.createElement(ZO,{fill:d,cx:o,cy:o,size:Er,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,o=i.payload,l=i.iconSize,f=i.layout,d=i.formatter,h=i.inactiveColor,v={x:0,y:0,width:Er,height:Er},m={display:f==="horizontal"?"inline-block":"block",marginRight:10},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(x,O){var j=x.formatter||d,b=et(ef(ef({"recharts-legend-item":!0},"legend-item-".concat(O),!0),"inactive",x.inactive));if(x.type==="none")return null;var E=Ye(x.value)?null:x.value;ti(!Ye(x.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var _=x.inactive?h:x.color;return I.createElement("li",NS({className:b,style:m,key:"legend-item-".concat(O)},Tm(r.props,x,O)),I.createElement(wS,{width:l,height:l,viewBox:v,style:g},r.renderIcon(x)),I.createElement("span",{className:"recharts-legend-item-text",style:{color:_}},j?j(E,x,O):E))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,l=r.align;if(!i||!i.length)return null;var f={padding:0,margin:0,textAlign:o==="horizontal"?l:"left"};return I.createElement("ul",{className:"recharts-default-legend",style:f},this.renderItems())}}])})(S.PureComponent);ef(JO,"displayName","Legend");ef(JO,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Jb,RM;function bne(){if(RM)return Jb;RM=1;var e=bv();function t(){this.__data__=new e,this.size=0}return Jb=t,Jb}var e0,DM;function wne(){if(DM)return e0;DM=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return e0=e,e0}var t0,PM;function Sne(){if(PM)return t0;PM=1;function e(t){return this.__data__.get(t)}return t0=e,t0}var n0,kM;function jne(){if(kM)return n0;kM=1;function e(t){return this.__data__.has(t)}return n0=e,n0}var r0,$M;function One(){if($M)return r0;$M=1;var e=bv(),t=HO(),n=FO(),r=200;function i(o,l){var f=this.__data__;if(f instanceof e){var d=f.__data__;if(!t||d.length<r-1)return d.push([o,l]),this.size=++f.size,this;f=this.__data__=new n(d)}return f.set(o,l),this.size=f.size,this}return r0=i,r0}var a0,IM;function pz(){if(IM)return a0;IM=1;var e=bv(),t=bne(),n=wne(),r=Sne(),i=jne(),o=One();function l(f){var d=this.__data__=new e(f);this.size=d.size}return l.prototype.clear=t,l.prototype.delete=n,l.prototype.get=r,l.prototype.has=i,l.prototype.set=o,a0=l,a0}var i0,LM;function Ene(){if(LM)return i0;LM=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return i0=t,i0}var o0,zM;function _ne(){if(zM)return o0;zM=1;function e(t){return this.__data__.has(t)}return o0=e,o0}var s0,BM;function vz(){if(BM)return s0;BM=1;var e=FO(),t=Ene(),n=_ne();function r(i){var o=-1,l=i==null?0:i.length;for(this.__data__=new e;++o<l;)this.add(i[o])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,s0=r,s0}var l0,qM;function gz(){if(qM)return l0;qM=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(t[r],r,t))return!0;return!1}return l0=e,l0}var c0,UM;function yz(){if(UM)return c0;UM=1;function e(t,n){return t.has(n)}return c0=e,c0}var u0,HM;function xz(){if(HM)return u0;HM=1;var e=vz(),t=gz(),n=yz(),r=1,i=2;function o(l,f,d,h,v,m){var g=d&r,x=l.length,O=f.length;if(x!=O&&!(g&&O>x))return!1;var j=m.get(l),b=m.get(f);if(j&&b)return j==f&&b==l;var E=-1,_=!0,A=d&i?new e:void 0;for(m.set(l,f),m.set(f,l);++E<x;){var C=l[E],N=f[E];if(h)var M=g?h(N,C,E,f,l,m):h(C,N,E,l,f,m);if(M!==void 0){if(M)continue;_=!1;break}if(A){if(!t(f,function(R,D){if(!n(A,D)&&(C===R||v(C,R,d,h,m)))return A.push(D)})){_=!1;break}}else if(!(C===N||v(C,N,d,h,m))){_=!1;break}}return m.delete(l),m.delete(f),_}return u0=o,u0}var f0,FM;function Ane(){if(FM)return f0;FM=1;var e=Aa(),t=e.Uint8Array;return f0=t,f0}var d0,GM;function Nne(){if(GM)return d0;GM=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i,o){r[++n]=[o,i]}),r}return d0=e,d0}var h0,VM;function eE(){if(VM)return h0;VM=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i){r[++n]=i}),r}return h0=e,h0}var m0,YM;function Cne(){if(YM)return m0;YM=1;var e=Wf(),t=Ane(),n=UO(),r=xz(),i=Nne(),o=eE(),l=1,f=2,d="[object Boolean]",h="[object Date]",v="[object Error]",m="[object Map]",g="[object Number]",x="[object RegExp]",O="[object Set]",j="[object String]",b="[object Symbol]",E="[object ArrayBuffer]",_="[object DataView]",A=e?e.prototype:void 0,C=A?A.valueOf:void 0;function N(M,R,D,L,H,B,U){switch(D){case _:if(M.byteLength!=R.byteLength||M.byteOffset!=R.byteOffset)return!1;M=M.buffer,R=R.buffer;case E:return!(M.byteLength!=R.byteLength||!B(new t(M),new t(R)));case d:case h:case g:return n(+M,+R);case v:return M.name==R.name&&M.message==R.message;case x:case j:return M==R+"";case m:var Y=i;case O:var Z=L&l;if(Y||(Y=o),M.size!=R.size&&!Z)return!1;var X=U.get(M);if(X)return X==R;L|=f,U.set(M,R);var k=r(Y(M),Y(R),L,H,B,U);return U.delete(M),k;case b:if(C)return C.call(M)==C.call(R)}return!1}return m0=N,m0}var p0,WM;function bz(){if(WM)return p0;WM=1;function e(t,n){for(var r=-1,i=n.length,o=t.length;++r<i;)t[o+r]=n[r];return t}return p0=e,p0}var v0,KM;function Tne(){if(KM)return v0;KM=1;var e=bz(),t=Vn();function n(r,i,o){var l=i(r);return t(r)?l:e(l,o(r))}return v0=n,v0}var g0,XM;function Mne(){if(XM)return g0;XM=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,o=0,l=[];++r<i;){var f=t[r];n(f,r,t)&&(l[o++]=f)}return l}return g0=e,g0}var y0,QM;function Rne(){if(QM)return y0;QM=1;function e(){return[]}return y0=e,y0}var x0,ZM;function Dne(){if(ZM)return x0;ZM=1;var e=Mne(),t=Rne(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(l){return l==null?[]:(l=Object(l),e(i(l),function(f){return r.call(l,f)}))}:t;return x0=o,x0}var b0,JM;function Pne(){if(JM)return b0;JM=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return b0=e,b0}var w0,eR;function kne(){if(eR)return w0;eR=1;var e=pi(),t=vi(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return w0=r,w0}var S0,tR;function tE(){if(tR)return S0;tR=1;var e=kne(),t=vi(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(l){return t(l)&&r.call(l,"callee")&&!i.call(l,"callee")};return S0=o,S0}var Du={exports:{}},j0,nR;function $ne(){if(nR)return j0;nR=1;function e(){return!1}return j0=e,j0}Du.exports;var rR;function wz(){return rR||(rR=1,(function(e,t){var n=Aa(),r=$ne(),i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,l=o&&o.exports===i,f=l?n.Buffer:void 0,d=f?f.isBuffer:void 0,h=d||r;e.exports=h})(Du,Du.exports)),Du.exports}var O0,aR;function nE(){if(aR)return O0;aR=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var o=typeof r;return i=i??e,!!i&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return O0=n,O0}var E0,iR;function rE(){if(iR)return E0;iR=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return E0=t,E0}var _0,oR;function Ine(){if(oR)return _0;oR=1;var e=pi(),t=rE(),n=vi(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",l="[object Date]",f="[object Error]",d="[object Function]",h="[object Map]",v="[object Number]",m="[object Object]",g="[object RegExp]",x="[object Set]",O="[object String]",j="[object WeakMap]",b="[object ArrayBuffer]",E="[object DataView]",_="[object Float32Array]",A="[object Float64Array]",C="[object Int8Array]",N="[object Int16Array]",M="[object Int32Array]",R="[object Uint8Array]",D="[object Uint8ClampedArray]",L="[object Uint16Array]",H="[object Uint32Array]",B={};B[_]=B[A]=B[C]=B[N]=B[M]=B[R]=B[D]=B[L]=B[H]=!0,B[r]=B[i]=B[b]=B[o]=B[E]=B[l]=B[f]=B[d]=B[h]=B[v]=B[m]=B[g]=B[x]=B[O]=B[j]=!1;function U(Y){return n(Y)&&t(Y.length)&&!!B[e(Y)]}return _0=U,_0}var A0,sR;function Sz(){if(sR)return A0;sR=1;function e(t){return function(n){return t(n)}}return A0=e,A0}var Pu={exports:{}};Pu.exports;var lR;function Lne(){return lR||(lR=1,(function(e,t){var n=U3(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,l=o&&n.process,f=(function(){try{var d=i&&i.require&&i.require("util").types;return d||l&&l.binding&&l.binding("util")}catch{}})();e.exports=f})(Pu,Pu.exports)),Pu.exports}var N0,cR;function jz(){if(cR)return N0;cR=1;var e=Ine(),t=Sz(),n=Lne(),r=n&&n.isTypedArray,i=r?t(r):e;return N0=i,N0}var C0,uR;function zne(){if(uR)return C0;uR=1;var e=Pne(),t=tE(),n=Vn(),r=wz(),i=nE(),o=jz(),l=Object.prototype,f=l.hasOwnProperty;function d(h,v){var m=n(h),g=!m&&t(h),x=!m&&!g&&r(h),O=!m&&!g&&!x&&o(h),j=m||g||x||O,b=j?e(h.length,String):[],E=b.length;for(var _ in h)(v||f.call(h,_))&&!(j&&(_=="length"||x&&(_=="offset"||_=="parent")||O&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||i(_,E)))&&b.push(_);return b}return C0=d,C0}var T0,fR;function Bne(){if(fR)return T0;fR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return T0=t,T0}var M0,dR;function Oz(){if(dR)return M0;dR=1;function e(t,n){return function(r){return t(n(r))}}return M0=e,M0}var R0,hR;function qne(){if(hR)return R0;hR=1;var e=Oz(),t=e(Object.keys,Object);return R0=t,R0}var D0,mR;function Une(){if(mR)return D0;mR=1;var e=Bne(),t=qne(),n=Object.prototype,r=n.hasOwnProperty;function i(o){if(!e(o))return t(o);var l=[];for(var f in Object(o))r.call(o,f)&&f!="constructor"&&l.push(f);return l}return D0=i,D0}var P0,pR;function Qf(){if(pR)return P0;pR=1;var e=qO(),t=rE();function n(r){return r!=null&&t(r.length)&&!e(r)}return P0=n,P0}var k0,vR;function Av(){if(vR)return k0;vR=1;var e=zne(),t=Une(),n=Qf();function r(i){return n(i)?e(i):t(i)}return k0=r,k0}var $0,gR;function Hne(){if(gR)return $0;gR=1;var e=Tne(),t=Dne(),n=Av();function r(i){return e(i,n,t)}return $0=r,$0}var I0,yR;function Fne(){if(yR)return I0;yR=1;var e=Hne(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(o,l,f,d,h,v){var m=f&t,g=e(o),x=g.length,O=e(l),j=O.length;if(x!=j&&!m)return!1;for(var b=x;b--;){var E=g[b];if(!(m?E in l:r.call(l,E)))return!1}var _=v.get(o),A=v.get(l);if(_&&A)return _==l&&A==o;var C=!0;v.set(o,l),v.set(l,o);for(var N=m;++b<x;){E=g[b];var M=o[E],R=l[E];if(d)var D=m?d(R,M,E,l,o,v):d(M,R,E,o,l,v);if(!(D===void 0?M===R||h(M,R,f,d,v):D)){C=!1;break}N||(N=E=="constructor")}if(C&&!N){var L=o.constructor,H=l.constructor;L!=H&&"constructor"in o&&"constructor"in l&&!(typeof L=="function"&&L instanceof L&&typeof H=="function"&&H instanceof H)&&(C=!1)}return v.delete(o),v.delete(l),C}return I0=i,I0}var L0,xR;function Gne(){if(xR)return L0;xR=1;var e=gs(),t=Aa(),n=e(t,"DataView");return L0=n,L0}var z0,bR;function Vne(){if(bR)return z0;bR=1;var e=gs(),t=Aa(),n=e(t,"Promise");return z0=n,z0}var B0,wR;function Ez(){if(wR)return B0;wR=1;var e=gs(),t=Aa(),n=e(t,"Set");return B0=n,B0}var q0,SR;function Yne(){if(SR)return q0;SR=1;var e=gs(),t=Aa(),n=e(t,"WeakMap");return q0=n,q0}var U0,jR;function Wne(){if(jR)return U0;jR=1;var e=Gne(),t=HO(),n=Vne(),r=Ez(),i=Yne(),o=pi(),l=H3(),f="[object Map]",d="[object Object]",h="[object Promise]",v="[object Set]",m="[object WeakMap]",g="[object DataView]",x=l(e),O=l(t),j=l(n),b=l(r),E=l(i),_=o;return(e&&_(new e(new ArrayBuffer(1)))!=g||t&&_(new t)!=f||n&&_(n.resolve())!=h||r&&_(new r)!=v||i&&_(new i)!=m)&&(_=function(A){var C=o(A),N=C==d?A.constructor:void 0,M=N?l(N):"";if(M)switch(M){case x:return g;case O:return f;case j:return h;case b:return v;case E:return m}return C}),U0=_,U0}var H0,OR;function Kne(){if(OR)return H0;OR=1;var e=pz(),t=xz(),n=Cne(),r=Fne(),i=Wne(),o=Vn(),l=wz(),f=jz(),d=1,h="[object Arguments]",v="[object Array]",m="[object Object]",g=Object.prototype,x=g.hasOwnProperty;function O(j,b,E,_,A,C){var N=o(j),M=o(b),R=N?v:i(j),D=M?v:i(b);R=R==h?m:R,D=D==h?m:D;var L=R==m,H=D==m,B=R==D;if(B&&l(j)){if(!l(b))return!1;N=!0,L=!1}if(B&&!L)return C||(C=new e),N||f(j)?t(j,b,E,_,A,C):n(j,b,R,E,_,A,C);if(!(E&d)){var U=L&&x.call(j,"__wrapped__"),Y=H&&x.call(b,"__wrapped__");if(U||Y){var Z=U?j.value():j,X=Y?b.value():b;return C||(C=new e),A(Z,X,E,_,C)}}return B?(C||(C=new e),r(j,b,E,_,A,C)):!1}return H0=O,H0}var F0,ER;function aE(){if(ER)return F0;ER=1;var e=Kne(),t=vi();function n(r,i,o,l,f){return r===i?!0:r==null||i==null||!t(r)&&!t(i)?r!==r&&i!==i:e(r,i,o,l,n,f)}return F0=n,F0}var G0,_R;function Xne(){if(_R)return G0;_R=1;var e=pz(),t=aE(),n=1,r=2;function i(o,l,f,d){var h=f.length,v=h,m=!d;if(o==null)return!v;for(o=Object(o);h--;){var g=f[h];if(m&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++h<v;){g=f[h];var x=g[0],O=o[x],j=g[1];if(m&&g[2]){if(O===void 0&&!(x in o))return!1}else{var b=new e;if(d)var E=d(O,j,x,o,l,b);if(!(E===void 0?t(j,O,n|r,d,b):E))return!1}}return!0}return G0=i,G0}var V0,AR;function _z(){if(AR)return V0;AR=1;var e=ho();function t(n){return n===n&&!e(n)}return V0=t,V0}var Y0,NR;function Qne(){if(NR)return Y0;NR=1;var e=_z(),t=Av();function n(r){for(var i=t(r),o=i.length;o--;){var l=i[o],f=r[l];i[o]=[l,f,e(f)]}return i}return Y0=n,Y0}var W0,CR;function Az(){if(CR)return W0;CR=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return W0=e,W0}var K0,TR;function Zne(){if(TR)return K0;TR=1;var e=Xne(),t=Qne(),n=Az();function r(i){var o=t(i);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(l){return l===i||e(l,i,o)}}return K0=r,K0}var X0,MR;function Jne(){if(MR)return X0;MR=1;function e(t,n){return t!=null&&n in Object(t)}return X0=e,X0}var Q0,RR;function ere(){if(RR)return Q0;RR=1;var e=V3(),t=tE(),n=Vn(),r=nE(),i=rE(),o=Sv();function l(f,d,h){d=e(d,f);for(var v=-1,m=d.length,g=!1;++v<m;){var x=o(d[v]);if(!(g=f!=null&&h(f,x)))break;f=f[x]}return g||++v!=m?g:(m=f==null?0:f.length,!!m&&i(m)&&r(x,m)&&(n(f)||t(f)))}return Q0=l,Q0}var Z0,DR;function tre(){if(DR)return Z0;DR=1;var e=Jne(),t=ere();function n(r,i){return r!=null&&t(r,i,e)}return Z0=n,Z0}var J0,PR;function nre(){if(PR)return J0;PR=1;var e=aE(),t=Y3(),n=tre(),r=BO(),i=_z(),o=Az(),l=Sv(),f=1,d=2;function h(v,m){return r(v)&&i(m)?o(l(v),m):function(g){var x=t(g,v);return x===void 0&&x===m?n(g,v):e(m,x,f|d)}}return J0=h,J0}var ew,kR;function xc(){if(kR)return ew;kR=1;function e(t){return t}return ew=e,ew}var tw,$R;function rre(){if($R)return tw;$R=1;function e(t){return function(n){return n?.[t]}}return tw=e,tw}var nw,IR;function are(){if(IR)return nw;IR=1;var e=VO();function t(n){return function(r){return e(r,n)}}return nw=t,nw}var rw,LR;function ire(){if(LR)return rw;LR=1;var e=rre(),t=are(),n=BO(),r=Sv();function i(o){return n(o)?e(r(o)):t(o)}return rw=i,rw}var aw,zR;function mo(){if(zR)return aw;zR=1;var e=Zne(),t=nre(),n=xc(),r=Vn(),i=ire();function o(l){return typeof l=="function"?l:l==null?n:typeof l=="object"?r(l)?t(l[0],l[1]):e(l):i(l)}return aw=o,aw}var iw,BR;function Nz(){if(BR)return iw;BR=1;function e(t,n,r,i){for(var o=t.length,l=r+(i?1:-1);i?l--:++l<o;)if(n(t[l],l,t))return l;return-1}return iw=e,iw}var ow,qR;function ore(){if(qR)return ow;qR=1;function e(t){return t!==t}return ow=e,ow}var sw,UR;function sre(){if(UR)return sw;UR=1;function e(t,n,r){for(var i=r-1,o=t.length;++i<o;)if(t[i]===n)return i;return-1}return sw=e,sw}var lw,HR;function lre(){if(HR)return lw;HR=1;var e=Nz(),t=ore(),n=sre();function r(i,o,l){return o===o?n(i,o,l):e(i,t,l)}return lw=r,lw}var cw,FR;function cre(){if(FR)return cw;FR=1;var e=lre();function t(n,r){var i=n==null?0:n.length;return!!i&&e(n,r,0)>-1}return cw=t,cw}var uw,GR;function ure(){if(GR)return uw;GR=1;function e(t,n,r){for(var i=-1,o=t==null?0:t.length;++i<o;)if(r(n,t[i]))return!0;return!1}return uw=e,uw}var fw,VR;function fre(){if(VR)return fw;VR=1;function e(){}return fw=e,fw}var dw,YR;function dre(){if(YR)return dw;YR=1;var e=Ez(),t=fre(),n=eE(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return dw=i,dw}var hw,WR;function hre(){if(WR)return hw;WR=1;var e=vz(),t=cre(),n=ure(),r=yz(),i=dre(),o=eE(),l=200;function f(d,h,v){var m=-1,g=t,x=d.length,O=!0,j=[],b=j;if(v)O=!1,g=n;else if(x>=l){var E=h?null:i(d);if(E)return o(E);O=!1,g=r,b=new e}else b=h?[]:j;e:for(;++m<x;){var _=d[m],A=h?h(_):_;if(_=v||_!==0?_:0,O&&A===A){for(var C=b.length;C--;)if(b[C]===A)continue e;h&&b.push(A),j.push(_)}else g(b,A,v)||(b!==j&&b.push(A),j.push(_))}return j}return hw=f,hw}var mw,KR;function mre(){if(KR)return mw;KR=1;var e=mo(),t=hre();function n(r,i){return r&&r.length?t(r,e(i,2)):[]}return mw=n,mw}var pre=mre();const XR=xt(pre);function Cz(e,t,n){return t===!0?XR(e,n):Ye(t)?XR(e,t):e}function Il(e){"@babel/helpers - typeof";return Il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Il(e)}var vre=["ref"];function QR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QR(Object(n),!0).forEach(function(r){Nv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mz(r.key),r)}}function yre(e,t,n){return t&&ZR(e.prototype,t),n&&ZR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xre(e,t,n){return t=Im(t),bre(e,Tz()?Reflect.construct(t,n||[],Im(e).constructor):t.apply(e,n))}function bre(e,t){if(t&&(Il(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wre(e)}function wre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tz=function(){return!!e})()}function Im(e){return Im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Im(e)}function Sre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&TS(e,t)}function TS(e,t){return TS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},TS(e,t)}function Nv(e,t,n){return t=Mz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mz(e){var t=jre(e,"string");return Il(t)=="symbol"?t:t+""}function jre(e,t){if(Il(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Il(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ore(e,t){if(e==null)return{};var n=Ere(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ere(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _re(e){return e.value}function Are(e,t){if(I.isValidElement(e))return I.cloneElement(e,t);if(typeof e=="function")return I.createElement(e,t);t.ref;var n=Ore(t,vre);return I.createElement(JO,n)}var JR=1,ni=(function(e){function t(){var n;gre(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=xre(this,t,[].concat(i)),Nv(n,"lastBoundingBox",{width:-1,height:-1}),n}return Sre(t,e),yre(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>JR||Math.abs(i.height-this.lastBoundingBox.height)>JR)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Wa({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,l=i.align,f=i.verticalAlign,d=i.margin,h=i.chartWidth,v=i.chartHeight,m,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(l==="center"&&o==="vertical"){var x=this.getBBoxSnapshot();m={left:((h||0)-x.width)/2}}else m=l==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(f==="middle"){var O=this.getBBoxSnapshot();g={top:((v||0)-O.height)/2}}else g=f==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Wa(Wa({},m),g)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,l=i.width,f=i.height,d=i.wrapperStyle,h=i.payloadUniqBy,v=i.payload,m=Wa(Wa({position:"absolute",width:l||"auto",height:f||"auto"},this.getDefaultPosition(d)),d);return I.createElement("div",{className:"recharts-legend-wrapper",style:m,ref:function(x){r.wrapperNode=x}},Are(o,Wa(Wa({},this.props),{},{payload:Cz(v,h,_re)})))}}],[{key:"getWithHeight",value:function(r,i){var o=Wa(Wa({},this.defaultProps),r.props),l=o.layout;return l==="vertical"&&xe(r.props.height)?{height:r.props.height}:l==="horizontal"?{width:r.props.width||i}:null}}])})(S.PureComponent);Nv(ni,"displayName","Legend");Nv(ni,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var pw,eD;function Nre(){if(eD)return pw;eD=1;var e=Wf(),t=tE(),n=Vn(),r=e?e.isConcatSpreadable:void 0;function i(o){return n(o)||t(o)||!!(r&&o&&o[r])}return pw=i,pw}var vw,tD;function Rz(){if(tD)return vw;tD=1;var e=bz(),t=Nre();function n(r,i,o,l,f){var d=-1,h=r.length;for(o||(o=t),f||(f=[]);++d<h;){var v=r[d];i>0&&o(v)?i>1?n(v,i-1,o,l,f):e(f,v):l||(f[f.length]=v)}return f}return vw=n,vw}var gw,nD;function Cre(){if(nD)return gw;nD=1;function e(t){return function(n,r,i){for(var o=-1,l=Object(n),f=i(n),d=f.length;d--;){var h=f[t?d:++o];if(r(l[h],h,l)===!1)break}return n}}return gw=e,gw}var yw,rD;function Tre(){if(rD)return yw;rD=1;var e=Cre(),t=e();return yw=t,yw}var xw,aD;function Dz(){if(aD)return xw;aD=1;var e=Tre(),t=Av();function n(r,i){return r&&e(r,i,t)}return xw=n,xw}var bw,iD;function Mre(){if(iD)return bw;iD=1;var e=Qf();function t(n,r){return function(i,o){if(i==null)return i;if(!e(i))return n(i,o);for(var l=i.length,f=r?l:-1,d=Object(i);(r?f--:++f<l)&&o(d[f],f,d)!==!1;);return i}}return bw=t,bw}var ww,oD;function iE(){if(oD)return ww;oD=1;var e=Dz(),t=Mre(),n=t(e);return ww=n,ww}var Sw,sD;function Pz(){if(sD)return Sw;sD=1;var e=iE(),t=Qf();function n(r,i){var o=-1,l=t(r)?Array(r.length):[];return e(r,function(f,d,h){l[++o]=i(f,d,h)}),l}return Sw=n,Sw}var jw,lD;function Rre(){if(lD)return jw;lD=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return jw=e,jw}var Ow,cD;function Dre(){if(cD)return Ow;cD=1;var e=gc();function t(n,r){if(n!==r){var i=n!==void 0,o=n===null,l=n===n,f=e(n),d=r!==void 0,h=r===null,v=r===r,m=e(r);if(!h&&!m&&!f&&n>r||f&&d&&v&&!h&&!m||o&&d&&v||!i&&v||!l)return 1;if(!o&&!f&&!m&&n<r||m&&i&&l&&!o&&!f||h&&i&&l||!d&&l||!v)return-1}return 0}return Ow=t,Ow}var Ew,uD;function Pre(){if(uD)return Ew;uD=1;var e=Dre();function t(n,r,i){for(var o=-1,l=n.criteria,f=r.criteria,d=l.length,h=i.length;++o<d;){var v=e(l[o],f[o]);if(v){if(o>=h)return v;var m=i[o];return v*(m=="desc"?-1:1)}}return n.index-r.index}return Ew=t,Ew}var _w,fD;function kre(){if(fD)return _w;fD=1;var e=GO(),t=VO(),n=mo(),r=Pz(),i=Rre(),o=Sz(),l=Pre(),f=xc(),d=Vn();function h(v,m,g){m.length?m=e(m,function(j){return d(j)?function(b){return t(b,j.length===1?j[0]:j)}:j}):m=[f];var x=-1;m=e(m,o(n));var O=r(v,function(j,b,E){var _=e(m,function(A){return A(j)});return{criteria:_,index:++x,value:j}});return i(O,function(j,b){return l(j,b,g)})}return _w=h,_w}var Aw,dD;function $re(){if(dD)return Aw;dD=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return Aw=e,Aw}var Nw,hD;function Ire(){if(hD)return Nw;hD=1;var e=$re(),t=Math.max;function n(r,i,o){return i=t(i===void 0?r.length-1:i,0),function(){for(var l=arguments,f=-1,d=t(l.length-i,0),h=Array(d);++f<d;)h[f]=l[i+f];f=-1;for(var v=Array(i+1);++f<i;)v[f]=l[f];return v[i]=o(h),e(r,this,v)}}return Nw=n,Nw}var Cw,mD;function Lre(){if(mD)return Cw;mD=1;function e(t){return function(){return t}}return Cw=e,Cw}var Tw,pD;function kz(){if(pD)return Tw;pD=1;var e=gs(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Tw=t,Tw}var Mw,vD;function zre(){if(vD)return Mw;vD=1;var e=Lre(),t=kz(),n=xc(),r=t?function(i,o){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:n;return Mw=r,Mw}var Rw,gD;function Bre(){if(gD)return Rw;gD=1;var e=800,t=16,n=Date.now;function r(i){var o=0,l=0;return function(){var f=n(),d=t-(f-l);if(l=f,d>0){if(++o>=e)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return Rw=r,Rw}var Dw,yD;function qre(){if(yD)return Dw;yD=1;var e=zre(),t=Bre(),n=t(e);return Dw=n,Dw}var Pw,xD;function Ure(){if(xD)return Pw;xD=1;var e=xc(),t=Ire(),n=qre();function r(i,o){return n(t(i,o,e),i+"")}return Pw=r,Pw}var kw,bD;function Cv(){if(bD)return kw;bD=1;var e=UO(),t=Qf(),n=nE(),r=ho();function i(o,l,f){if(!r(f))return!1;var d=typeof l;return(d=="number"?t(f)&&n(l,f.length):d=="string"&&l in f)?e(f[l],o):!1}return kw=i,kw}var $w,wD;function Hre(){if(wD)return $w;wD=1;var e=Rz(),t=kre(),n=Ure(),r=Cv(),i=n(function(o,l){if(o==null)return[];var f=l.length;return f>1&&r(o,l[0],l[1])?l=[]:f>2&&r(l[0],l[1],l[2])&&(l=[l[0]]),t(o,e(l,1),[])});return $w=i,$w}var Fre=Hre();const oE=xt(Fre);function tf(e){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tf(e)}function MS(){return MS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MS.apply(this,arguments)}function Gre(e,t){return Kre(e)||Wre(e,t)||Yre(e,t)||Vre()}function Vre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|