@tanstack/cta-ui 0.32.2 → 0.33.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.
@@ -195,7 +195,7 @@ Error generating stack: `+f.message+`
195
195
 
196
196
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
197
197
 
198
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return C.useEffect(()=>{n&&(document.getElementById(n)||console.error(t))},[t,n]),null},EN="DialogDescriptionWarning",_N=({contentRef:n,descriptionId:e})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${OT(EN).contentName}}.`;return C.useEffect(()=>{const r=n.current?.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(i))},[i,n,e]),null},DN=rT,jN=aT,NN=lT,ZN=cT,XN=fT,LN=dT,zN=mT;function jo({...n}){return S.jsx(DN,{"data-slot":"dialog",...n})}function qN({...n}){return S.jsx(jN,{"data-slot":"dialog-portal",...n})}function BN({className:n,...e}){return S.jsx(NN,{"data-slot":"dialog-overlay",className:Ie("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...e})}function No({className:n,children:e,hideCloseButton:t,...i}){return S.jsxs(qN,{"data-slot":"dialog-portal",children:[S.jsx(BN,{}),S.jsxs(ZN,{"data-slot":"dialog-content",className:Ie("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 p-6 shadow-lg duration-200 sm:max-w-lg bg-opacity-70 backdrop-blur-md border-3 border-white/20",n),...i,children:[e,!t&&S.jsxs(zN,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[S.jsx(VD,{}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yl({className:n,...e}){return S.jsx("div",{"data-slot":"dialog-header",className:Ie("flex flex-col gap-2 text-center sm:text-left",n),...e})}function $u({className:n,...e}){return S.jsx("div",{"data-slot":"dialog-footer",className:Ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...e})}function vl({className:n,...e}){return S.jsx(XN,{"data-slot":"dialog-title",className:Ie("text-lg leading-none font-semibold",n),...e})}function VN({className:n,...e}){return S.jsx(LN,{"data-slot":"dialog-description",className:Ie("text-muted-foreground text-sm",n),...e})}function YN(){const[n,e]=C.useState(""),[t,i]=C.useState(!1),r=Mu(),{toggleAddOn:s}=Au();async function a(){const c=await q_(n);"error"in c?Py.error("Failed to load add-on",{description:c.error}):(eD(c),c.modes.includes(r)&&s(c.id),i(!1))}return S.jsxs("div",{children:[S.jsxs(Oi,{variant:"secondary",className:"w-full",onClick:()=>{e(""),i(!0)},children:[S.jsx(LD,{className:"w-4 h-4"}),"Import Custom Add-On"]}),S.jsx(jo,{modal:!0,open:t,onOpenChange:i,children:S.jsxs(No,{className:"sm:min-w-[425px] sm:max-w-fit",children:[S.jsx(yl,{children:S.jsx(vl,{children:"Import Custom Add-On"})}),S.jsx("div",{children:S.jsx(Ay,{value:n,onChange:c=>e(c.target.value),placeholder:"https://github.com/myorg/myproject/add-on.json",className:"min-w-lg w-full",onKeyDown:c=>{c.key==="Enter"&&a()}})}),S.jsx($u,{children:S.jsx(Oi,{onClick:a,children:"Import"})})]})})]})}function UN({addOn:n,onClose:e}){return S.jsx(jo,{modal:!0,open:!!n,onOpenChange:e,children:S.jsx(No,{className:"sm:min-w-[425px] sm:max-w-fit",children:S.jsxs("div",{className:"flex flex-row",children:[n?.smallLogo&&S.jsx("img",{src:`data:image/svg+xml,${encodeURIComponent(n.smallLogo)}`,alt:n.name,className:"w-15"}),S.jsxs("div",{className:"flex flex-col ml-4 gap-4",children:[S.jsx("p",{className:"text-lg font-bold",children:n?.name}),S.jsx("p",{className:"text-sm text-gray-500",children:n?.description}),S.jsxs("a",{href:n?.link,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-500 underline",children:["More information on ",n?.name]})]})]})})})}function Ny(n){const e=n+"CollectionProvider",[t,i]=Ni(e),[r,s]=t(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:w,children:k}=x,T=ee.useRef(null),A=ee.useRef(new Map).current;return S.jsx(r,{scope:w,itemMap:A,collectionRef:T,children:k})};a.displayName=e;const c=n+"CollectionSlot",u=el(c),h=ee.forwardRef((x,w)=>{const{scope:k,children:T}=x,A=s(c,k),$=Rt(w,A.collectionRef);return S.jsx(u,{ref:$,children:T})});h.displayName=c;const p=n+"CollectionItemSlot",m="data-radix-collection-item",O=el(p),v=ee.forwardRef((x,w)=>{const{scope:k,children:T,...A}=x,$=ee.useRef(null),R=Rt(w,$),_=s(p,k);return ee.useEffect(()=>(_.itemMap.set($,{ref:$,...A}),()=>void _.itemMap.delete($))),S.jsx(O,{[m]:"",ref:R,children:T})});v.displayName=p;function b(x){const w=s(n+"CollectionConsumer",x);return ee.useCallback(()=>{const T=w.collectionRef.current;if(!T)return[];const A=Array.from(T.querySelectorAll(`[${m}]`));return Array.from(w.itemMap.values()).sort((_,D)=>A.indexOf(_.ref.current)-A.indexOf(D.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:h,ItemSlot:v},b,i]}var GN=C.createContext(void 0);function Eu(n){const e=C.useContext(GN);return n||e||"ltr"}const IN=["top","right","bottom","left"],Ns=Math.min,In=Math.max,vd=Math.round,yh=Math.floor,lr=n=>({x:n,y:n}),WN={left:"right",right:"left",bottom:"top",top:"bottom"},HN={start:"end",end:"start"};function o0(n,e,t){return In(n,Ns(e,t))}function Jr(n,e){return typeof n=="function"?n(e):n}function es(n){return n.split("-")[0]}function bl(n){return n.split("-")[1]}function Zy(n){return n==="x"?"y":"x"}function Xy(n){return n==="y"?"height":"width"}function Zs(n){return["top","bottom"].includes(es(n))?"y":"x"}function Ly(n){return Zy(Zs(n))}function FN(n,e,t){t===void 0&&(t=!1);const i=bl(n),r=Ly(n),s=Xy(r);let a=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=bd(a)),[a,bd(a)]}function KN(n){const e=bd(n);return[a0(n),e,a0(e)]}function a0(n){return n.replace(/start|end/g,e=>HN[e])}function JN(n,e,t){const i=["left","right"],r=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(n){case"top":case"bottom":return t?e?r:i:e?i:r;case"left":case"right":return e?s:a;default:return[]}}function e7(n,e,t,i){const r=bl(n);let s=JN(es(n),t==="start",i);return r&&(s=s.map(a=>a+"-"+r),e&&(s=s.concat(s.map(a0)))),s}function bd(n){return n.replace(/left|right|bottom|top/g,e=>WN[e])}function t7(n){return{top:0,right:0,bottom:0,left:0,...n}}function yT(n){return typeof n!="number"?t7(n):{top:n,right:n,bottom:n,left:n}}function xd(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function qw(n,e,t){let{reference:i,floating:r}=n;const s=Zs(e),a=Ly(e),c=Xy(a),u=es(e),h=s==="y",p=i.x+i.width/2-r.width/2,m=i.y+i.height/2-r.height/2,O=i[c]/2-r[c]/2;let v;switch(u){case"top":v={x:p,y:i.y-r.height};break;case"bottom":v={x:p,y:i.y+i.height};break;case"right":v={x:i.x+i.width,y:m};break;case"left":v={x:i.x-r.width,y:m};break;default:v={x:i.x,y:i.y}}switch(bl(e)){case"start":v[a]-=O*(t&&h?-1:1);break;case"end":v[a]+=O*(t&&h?-1:1);break}return v}const n7=async(n,e,t)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:a}=t,c=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(e));let h=await a.getElementRects({reference:n,floating:e,strategy:r}),{x:p,y:m}=qw(h,i,u),O=i,v={},b=0;for(let x=0;x<c.length;x++){const{name:w,fn:k}=c[x],{x:T,y:A,data:$,reset:R}=await k({x:p,y:m,initialPlacement:i,placement:O,strategy:r,middlewareData:v,rects:h,platform:a,elements:{reference:n,floating:e}});p=T??p,m=A??m,v={...v,[w]:{...v[w],...$}},R&&b<=50&&(b++,typeof R=="object"&&(R.placement&&(O=R.placement),R.rects&&(h=R.rects===!0?await a.getElementRects({reference:n,floating:e,strategy:r}):R.rects),{x:p,y:m}=qw(h,O,u)),x=-1)}return{x:p,y:m,placement:O,strategy:r,middlewareData:v}};async function nu(n,e){var t;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:a,elements:c,strategy:u}=n,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:O=!1,padding:v=0}=Jr(e,n),b=yT(v),w=c[O?m==="floating"?"reference":"floating":m],k=xd(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(w)))==null||t?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:h,rootBoundary:p,strategy:u})),T=m==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),$=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},R=xd(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:T,offsetParent:A,strategy:u}):T);return{top:(k.top-R.top+b.top)/$.y,bottom:(R.bottom-k.bottom+b.bottom)/$.y,left:(k.left-R.left+b.left)/$.x,right:(R.right-k.right+b.right)/$.x}}const i7=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:i,placement:r,rects:s,platform:a,elements:c,middlewareData:u}=e,{element:h,padding:p=0}=Jr(n,e)||{};if(h==null)return{};const m=yT(p),O={x:t,y:i},v=Ly(r),b=Xy(v),x=await a.getDimensions(h),w=v==="y",k=w?"top":"left",T=w?"bottom":"right",A=w?"clientHeight":"clientWidth",$=s.reference[b]+s.reference[v]-O[v]-s.floating[b],R=O[v]-s.reference[v],_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(h));let D=_?_[A]:0;(!D||!await(a.isElement==null?void 0:a.isElement(_)))&&(D=c.floating[A]||s.floating[b]);const j=$/2-R/2,Y=D/2-x[b]/2-1,J=Ns(m[k],Y),I=Ns(m[T],Y),W=J,ae=D-x[b]-I,le=D/2-x[b]/2+j,ce=o0(W,le,ae),Z=!u.arrow&&bl(r)!=null&&le!==ce&&s.reference[b]/2-(le<W?J:I)-x[b]/2<0,U=Z?le<W?le-W:le-ae:0;return{[v]:O[v]+U,data:{[v]:ce,centerOffset:le-ce-U,...Z&&{alignmentOffset:U}},reset:Z}}}),r7=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:r,middlewareData:s,rects:a,initialPlacement:c,platform:u,elements:h}=e,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:O,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...w}=Jr(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const k=es(r),T=Zs(c),A=es(c)===c,$=await(u.isRTL==null?void 0:u.isRTL(h.floating)),R=O||(A||!x?[bd(c)]:KN(c)),_=b!=="none";!O&&_&&R.push(...e7(c,x,b,$));const D=[c,...R],j=await nu(e,w),Y=[];let J=((i=s.flip)==null?void 0:i.overflows)||[];if(p&&Y.push(j[k]),m){const le=FN(r,a,$);Y.push(j[le[0]],j[le[1]])}if(J=[...J,{placement:r,overflows:Y}],!Y.every(le=>le<=0)){var I,W;const le=(((I=s.flip)==null?void 0:I.index)||0)+1,ce=D[le];if(ce)return{data:{index:le,overflows:J},reset:{placement:ce}};let Z=(W=J.filter(U=>U.overflows[0]<=0).sort((U,z)=>U.overflows[1]-z.overflows[1])[0])==null?void 0:W.placement;if(!Z)switch(v){case"bestFit":{var ae;const U=(ae=J.filter(z=>{if(_){const K=Zs(z.placement);return K===T||K==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(K=>K>0).reduce((K,E)=>K+E,0)]).sort((z,K)=>z[1]-K[1])[0])==null?void 0:ae[0];U&&(Z=U);break}case"initialPlacement":Z=c;break}if(r!==Z)return{reset:{placement:Z}}}return{}}}};function Bw(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function Vw(n){return IN.some(e=>n[e]>=0)}const s7=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:i="referenceHidden",...r}=Jr(n,e);switch(i){case"referenceHidden":{const s=await nu(e,{...r,elementContext:"reference"}),a=Bw(s,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Vw(a)}}}case"escaped":{const s=await nu(e,{...r,altBoundary:!0}),a=Bw(s,t.floating);return{data:{escapedOffsets:a,escaped:Vw(a)}}}default:return{}}}}};async function o7(n,e){const{placement:t,platform:i,elements:r}=n,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=es(t),c=bl(t),u=Zs(t)==="y",h=["left","top"].includes(a)?-1:1,p=s&&u?-1:1,m=Jr(e,n);let{mainAxis:O,crossAxis:v,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof b=="number"&&(v=c==="end"?b*-1:b),u?{x:v*p,y:O*h}:{x:O*h,y:v*p}}const a7=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:r,y:s,placement:a,middlewareData:c}=e,u=await o7(e,n);return a===((t=c.offset)==null?void 0:t.placement)&&(i=c.arrow)!=null&&i.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:a}}}}},l7=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:r}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:w=>{let{x:k,y:T}=w;return{x:k,y:T}}},...u}=Jr(n,e),h={x:t,y:i},p=await nu(e,u),m=Zs(es(r)),O=Zy(m);let v=h[O],b=h[m];if(s){const w=O==="y"?"top":"left",k=O==="y"?"bottom":"right",T=v+p[w],A=v-p[k];v=o0(T,v,A)}if(a){const w=m==="y"?"top":"left",k=m==="y"?"bottom":"right",T=b+p[w],A=b-p[k];b=o0(T,b,A)}const x=c.fn({...e,[O]:v,[m]:b});return{...x,data:{x:x.x-t,y:x.y-i,enabled:{[O]:s,[m]:a}}}}}},c7=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:i,placement:r,rects:s,middlewareData:a}=e,{offset:c=0,mainAxis:u=!0,crossAxis:h=!0}=Jr(n,e),p={x:t,y:i},m=Zs(r),O=Zy(m);let v=p[O],b=p[m];const x=Jr(c,e),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const A=O==="y"?"height":"width",$=s.reference[O]-s.floating[A]+w.mainAxis,R=s.reference[O]+s.reference[A]-w.mainAxis;v<$?v=$:v>R&&(v=R)}if(h){var k,T;const A=O==="y"?"width":"height",$=["top","left"].includes(es(r)),R=s.reference[m]-s.floating[A]+($&&((k=a.offset)==null?void 0:k[m])||0)+($?0:w.crossAxis),_=s.reference[m]+s.reference[A]+($?0:((T=a.offset)==null?void 0:T[m])||0)-($?w.crossAxis:0);b<R?b=R:b>_&&(b=_)}return{[O]:v,[m]:b}}}},u7=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,i;const{placement:r,rects:s,platform:a,elements:c}=e,{apply:u=()=>{},...h}=Jr(n,e),p=await nu(e,h),m=es(r),O=bl(r),v=Zs(r)==="y",{width:b,height:x}=s.floating;let w,k;m==="top"||m==="bottom"?(w=m,k=O===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(k=m,w=O==="end"?"top":"bottom");const T=x-p.top-p.bottom,A=b-p.left-p.right,$=Ns(x-p[w],T),R=Ns(b-p[k],A),_=!e.middlewareData.shift;let D=$,j=R;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(j=A),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(D=T),_&&!O){const J=In(p.left,0),I=In(p.right,0),W=In(p.top,0),ae=In(p.bottom,0);v?j=b-2*(J!==0||I!==0?J+I:In(p.left,p.right)):D=x-2*(W!==0||ae!==0?W+ae:In(p.top,p.bottom))}await u({...e,availableWidth:j,availableHeight:D});const Y=await a.getDimensions(c.floating);return b!==Y.width||x!==Y.height?{reset:{rects:!0}}:{}}}};function cp(){return typeof window<"u"}function xl(n){return vT(n)?(n.nodeName||"").toLowerCase():"#document"}function Hn(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function vr(n){var e;return(e=(vT(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function vT(n){return cp()?n instanceof Node||n instanceof Hn(n).Node:!1}function Ei(n){return cp()?n instanceof Element||n instanceof Hn(n).Element:!1}function hr(n){return cp()?n instanceof HTMLElement||n instanceof Hn(n).HTMLElement:!1}function Yw(n){return!cp()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Hn(n).ShadowRoot}function _u(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=_i(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(r)}function f7(n){return["table","td","th"].includes(xl(n))}function up(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function zy(n){const e=qy(),t=Ei(n)?_i(n):n;return["transform","translate","scale","rotate","perspective"].some(i=>t[i]?t[i]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(i=>(t.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(t.contain||"").includes(i))}function h7(n){let e=Xs(n);for(;hr(e)&&!tl(e);){if(zy(e))return e;if(up(e))return null;e=Xs(e)}return null}function qy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function tl(n){return["html","body","#document"].includes(xl(n))}function _i(n){return Hn(n).getComputedStyle(n)}function fp(n){return Ei(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Xs(n){if(xl(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Yw(n)&&n.host||vr(n);return Yw(e)?e.host:e}function bT(n){const e=Xs(n);return tl(e)?n.ownerDocument?n.ownerDocument.body:n.body:hr(e)&&_u(e)?e:bT(e)}function iu(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=bT(n),s=r===((i=n.ownerDocument)==null?void 0:i.body),a=Hn(r);if(s){const c=l0(a);return e.concat(a,a.visualViewport||[],_u(r)?r:[],c&&t?iu(c):[])}return e.concat(r,iu(r,[],t))}function l0(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function xT(n){const e=_i(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=hr(n),s=r?n.offsetWidth:t,a=r?n.offsetHeight:i,c=vd(t)!==s||vd(i)!==a;return c&&(t=s,i=a),{width:t,height:i,$:c}}function By(n){return Ei(n)?n:n.contextElement}function Va(n){const e=By(n);if(!hr(e))return lr(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:s}=xT(e);let a=(s?vd(t.width):t.width)/i,c=(s?vd(t.height):t.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const d7=lr(0);function ST(n){const e=Hn(n);return!qy()||!e.visualViewport?d7:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function p7(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Hn(n)?!1:e}function Co(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),s=By(n);let a=lr(1);e&&(i?Ei(i)&&(a=Va(i)):a=Va(n));const c=p7(s,t,i)?ST(s):lr(0);let u=(r.left+c.x)/a.x,h=(r.top+c.y)/a.y,p=r.width/a.x,m=r.height/a.y;if(s){const O=Hn(s),v=i&&Ei(i)?Hn(i):i;let b=O,x=l0(b);for(;x&&i&&v!==b;){const w=Va(x),k=x.getBoundingClientRect(),T=_i(x),A=k.left+(x.clientLeft+parseFloat(T.paddingLeft))*w.x,$=k.top+(x.clientTop+parseFloat(T.paddingTop))*w.y;u*=w.x,h*=w.y,p*=w.x,m*=w.y,u+=A,h+=$,b=Hn(x),x=l0(b)}}return xd({width:p,height:m,x:u,y:h})}function Vy(n,e){const t=fp(n).scrollLeft;return e?e.left+t:Co(vr(n)).left+t}function wT(n,e,t){t===void 0&&(t=!1);const i=n.getBoundingClientRect(),r=i.left+e.scrollLeft-(t?0:Vy(n,i)),s=i.top+e.scrollTop;return{x:r,y:s}}function m7(n){let{elements:e,rect:t,offsetParent:i,strategy:r}=n;const s=r==="fixed",a=vr(i),c=e?up(e.floating):!1;if(i===a||c&&s)return t;let u={scrollLeft:0,scrollTop:0},h=lr(1);const p=lr(0),m=hr(i);if((m||!m&&!s)&&((xl(i)!=="body"||_u(a))&&(u=fp(i)),hr(i))){const v=Co(i);h=Va(i),p.x=v.x+i.clientLeft,p.y=v.y+i.clientTop}const O=a&&!m&&!s?wT(a,u,!0):lr(0);return{width:t.width*h.x,height:t.height*h.y,x:t.x*h.x-u.scrollLeft*h.x+p.x+O.x,y:t.y*h.y-u.scrollTop*h.y+p.y+O.y}}function g7(n){return Array.from(n.getClientRects())}function O7(n){const e=vr(n),t=fp(n),i=n.ownerDocument.body,r=In(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=In(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-t.scrollLeft+Vy(n);const c=-t.scrollTop;return _i(i).direction==="rtl"&&(a+=In(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:a,y:c}}function y7(n,e){const t=Hn(n),i=vr(n),r=t.visualViewport;let s=i.clientWidth,a=i.clientHeight,c=0,u=0;if(r){s=r.width,a=r.height;const h=qy();(!h||h&&e==="fixed")&&(c=r.offsetLeft,u=r.offsetTop)}return{width:s,height:a,x:c,y:u}}function v7(n,e){const t=Co(n,!0,e==="fixed"),i=t.top+n.clientTop,r=t.left+n.clientLeft,s=hr(n)?Va(n):lr(1),a=n.clientWidth*s.x,c=n.clientHeight*s.y,u=r*s.x,h=i*s.y;return{width:a,height:c,x:u,y:h}}function Uw(n,e,t){let i;if(e==="viewport")i=y7(n,t);else if(e==="document")i=O7(vr(n));else if(Ei(e))i=v7(e,t);else{const r=ST(n);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return xd(i)}function kT(n,e){const t=Xs(n);return t===e||!Ei(t)||tl(t)?!1:_i(t).position==="fixed"||kT(t,e)}function b7(n,e){const t=e.get(n);if(t)return t;let i=iu(n,[],!1).filter(c=>Ei(c)&&xl(c)!=="body"),r=null;const s=_i(n).position==="fixed";let a=s?Xs(n):n;for(;Ei(a)&&!tl(a);){const c=_i(a),u=zy(a);!u&&c.position==="fixed"&&(r=null),(s?!u&&!r:!u&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||_u(a)&&!u&&kT(n,a))?i=i.filter(p=>p!==a):r=c,a=Xs(a)}return e.set(n,i),i}function x7(n){let{element:e,boundary:t,rootBoundary:i,strategy:r}=n;const a=[...t==="clippingAncestors"?up(e)?[]:b7(e,this._c):[].concat(t),i],c=a[0],u=a.reduce((h,p)=>{const m=Uw(e,p,r);return h.top=In(m.top,h.top),h.right=Ns(m.right,h.right),h.bottom=Ns(m.bottom,h.bottom),h.left=In(m.left,h.left),h},Uw(e,c,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function S7(n){const{width:e,height:t}=xT(n);return{width:e,height:t}}function w7(n,e,t){const i=hr(e),r=vr(e),s=t==="fixed",a=Co(n,!0,s,e);let c={scrollLeft:0,scrollTop:0};const u=lr(0);if(i||!i&&!s)if((xl(e)!=="body"||_u(r))&&(c=fp(e)),i){const O=Co(e,!0,s,e);u.x=O.x+e.clientLeft,u.y=O.y+e.clientTop}else r&&(u.x=Vy(r));const h=r&&!i&&!s?wT(r,c):lr(0),p=a.left+c.scrollLeft-u.x-h.x,m=a.top+c.scrollTop-u.y-h.y;return{x:p,y:m,width:a.width,height:a.height}}function eO(n){return _i(n).position==="static"}function Gw(n,e){if(!hr(n)||_i(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return vr(n)===t&&(t=t.ownerDocument.body),t}function QT(n,e){const t=Hn(n);if(up(n))return t;if(!hr(n)){let r=Xs(n);for(;r&&!tl(r);){if(Ei(r)&&!eO(r))return r;r=Xs(r)}return t}let i=Gw(n,e);for(;i&&f7(i)&&eO(i);)i=Gw(i,e);return i&&tl(i)&&eO(i)&&!zy(i)?t:i||h7(n)||t}const k7=async function(n){const e=this.getOffsetParent||QT,t=this.getDimensions,i=await t(n.floating);return{reference:w7(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Q7(n){return _i(n).direction==="rtl"}const C7={convertOffsetParentRelativeRectToViewportRelativeRect:m7,getDocumentElement:vr,getClippingRect:x7,getOffsetParent:QT,getElementRects:k7,getClientRects:g7,getDimensions:S7,getScale:Va,isElement:Ei,isRTL:Q7};function CT(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function T7(n,e){let t=null,i;const r=vr(n);function s(){var c;clearTimeout(i),(c=t)==null||c.disconnect(),t=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const h=n.getBoundingClientRect(),{left:p,top:m,width:O,height:v}=h;if(c||e(),!O||!v)return;const b=yh(m),x=yh(r.clientWidth-(p+O)),w=yh(r.clientHeight-(m+v)),k=yh(p),A={rootMargin:-b+"px "+-x+"px "+-w+"px "+-k+"px",threshold:In(0,Ns(1,u))||1};let $=!0;function R(_){const D=_[0].intersectionRatio;if(D!==u){if(!$)return a();D?a(!1,D):i=setTimeout(()=>{a(!1,1e-7)},1e3)}D===1&&!CT(h,n.getBoundingClientRect())&&a(),$=!1}try{t=new IntersectionObserver(R,{...A,root:r.ownerDocument})}catch{t=new IntersectionObserver(R,A)}t.observe(n)}return a(!0),s}function P7(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,h=By(n),p=r||s?[...h?iu(h):[],...iu(e)]:[];p.forEach(k=>{r&&k.addEventListener("scroll",t,{passive:!0}),s&&k.addEventListener("resize",t)});const m=h&&c?T7(h,t):null;let O=-1,v=null;a&&(v=new ResizeObserver(k=>{let[T]=k;T&&T.target===h&&v&&(v.unobserve(e),cancelAnimationFrame(O),O=requestAnimationFrame(()=>{var A;(A=v)==null||A.observe(e)})),t()}),h&&!u&&v.observe(h),v.observe(e));let b,x=u?Co(n):null;u&&w();function w(){const k=Co(n);x&&!CT(x,k)&&t(),x=k,b=requestAnimationFrame(w)}return t(),()=>{var k;p.forEach(T=>{r&&T.removeEventListener("scroll",t),s&&T.removeEventListener("resize",t)}),m?.(),(k=v)==null||k.disconnect(),v=null,u&&cancelAnimationFrame(b)}}const A7=a7,M7=l7,R7=r7,$7=u7,E7=s7,Iw=i7,_7=c7,D7=(n,e,t)=>{const i=new Map,r={platform:C7,...t},s={...r.platform,_c:i};return n7(n,e,{...r,platform:s})};var Jh=typeof document<"u"?C.useLayoutEffect:C.useEffect;function Sd(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,i,r;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(i=t;i--!==0;)if(!Sd(n[i],e[i]))return!1;return!0}if(r=Object.keys(n),t=r.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=t;i--!==0;){const s=r[i];if(!(s==="_owner"&&n.$$typeof)&&!Sd(n[s],e[s]))return!1}return!0}return n!==n&&e!==e}function TT(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ww(n,e){const t=TT(n);return Math.round(e*t)/t}function tO(n){const e=C.useRef(n);return Jh(()=>{e.current=n}),e}function j7(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:u,open:h}=n,[p,m]=C.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[O,v]=C.useState(i);Sd(O,i)||v(i);const[b,x]=C.useState(null),[w,k]=C.useState(null),T=C.useCallback(z=>{z!==_.current&&(_.current=z,x(z))},[]),A=C.useCallback(z=>{z!==D.current&&(D.current=z,k(z))},[]),$=s||b,R=a||w,_=C.useRef(null),D=C.useRef(null),j=C.useRef(p),Y=u!=null,J=tO(u),I=tO(r),W=tO(h),ae=C.useCallback(()=>{if(!_.current||!D.current)return;const z={placement:e,strategy:t,middleware:O};I.current&&(z.platform=I.current),D7(_.current,D.current,z).then(K=>{const E={...K,isPositioned:W.current!==!1};le.current&&!Sd(j.current,E)&&(j.current=E,Cy.flushSync(()=>{m(E)}))})},[O,e,t,I,W]);Jh(()=>{h===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,m(z=>({...z,isPositioned:!1})))},[h]);const le=C.useRef(!1);Jh(()=>(le.current=!0,()=>{le.current=!1}),[]),Jh(()=>{if($&&(_.current=$),R&&(D.current=R),$&&R){if(J.current)return J.current($,R,ae);ae()}},[$,R,ae,J,Y]);const ce=C.useMemo(()=>({reference:_,floating:D,setReference:T,setFloating:A}),[T,A]),Z=C.useMemo(()=>({reference:$,floating:R}),[$,R]),U=C.useMemo(()=>{const z={position:t,left:0,top:0};if(!Z.floating)return z;const K=Ww(Z.floating,p.x),E=Ww(Z.floating,p.y);return c?{...z,transform:"translate("+K+"px, "+E+"px)",...TT(Z.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:K,top:E}},[t,c,Z.floating,p.x,p.y]);return C.useMemo(()=>({...p,update:ae,refs:ce,elements:Z,floatingStyles:U}),[p,ae,ce,Z,U])}const N7=n=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:i,padding:r}=typeof n=="function"?n(t):n;return i&&e(i)?i.current!=null?Iw({element:i.current,padding:r}).fn(t):{}:i?Iw({element:i,padding:r}).fn(t):{}}}},Z7=(n,e)=>({...A7(n),options:[n,e]}),X7=(n,e)=>({...M7(n),options:[n,e]}),L7=(n,e)=>({..._7(n),options:[n,e]}),z7=(n,e)=>({...R7(n),options:[n,e]}),q7=(n,e)=>({...$7(n),options:[n,e]}),B7=(n,e)=>({...E7(n),options:[n,e]}),V7=(n,e)=>({...N7(n),options:[n,e]});var Y7="Arrow",PT=C.forwardRef((n,e)=>{const{children:t,width:i=10,height:r=5,...s}=n;return S.jsx(ze.svg,{...s,ref:e,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?t:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});PT.displayName=Y7;var U7=PT,Yy="Popper",[AT,MT]=Ni(Yy),[G7,RT]=AT(Yy),$T=n=>{const{__scopePopper:e,children:t}=n,[i,r]=C.useState(null);return S.jsx(G7,{scope:e,anchor:i,onAnchorChange:r,children:t})};$T.displayName=Yy;var ET="PopperAnchor",_T=C.forwardRef((n,e)=>{const{__scopePopper:t,virtualRef:i,...r}=n,s=RT(ET,t),a=C.useRef(null),c=Rt(e,a);return C.useEffect(()=>{s.onAnchorChange(i?.current||a.current)}),i?null:S.jsx(ze.div,{...r,ref:c})});_T.displayName=ET;var Uy="PopperContent",[I7,W7]=AT(Uy),DT=C.forwardRef((n,e)=>{const{__scopePopper:t,side:i="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:O=!1,updatePositionStrategy:v="optimized",onPlaced:b,...x}=n,w=RT(Uy,t),[k,T]=C.useState(null),A=Rt(e,de=>T(de)),[$,R]=C.useState(null),_=SC($),D=_?.width??0,j=_?.height??0,Y=i+(s!=="center"?"-"+s:""),J=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},I=Array.isArray(h)?h:[h],W=I.length>0,ae={padding:J,boundary:I.filter(F7),altBoundary:W},{refs:le,floatingStyles:ce,placement:Z,isPositioned:U,middlewareData:z}=j7({strategy:"fixed",placement:Y,whileElementsMounted:(...de)=>P7(...de,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[Z7({mainAxis:r+j,alignmentAxis:a}),u&&X7({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?L7():void 0,...ae}),u&&z7({...ae}),q7({...ae,apply:({elements:de,rects:ke,availableWidth:Ue,availableHeight:We})=>{const{width:Le,height:me}=ke.reference,je=de.floating.style;je.setProperty("--radix-popper-available-width",`${Ue}px`),je.setProperty("--radix-popper-available-height",`${We}px`),je.setProperty("--radix-popper-anchor-width",`${Le}px`),je.setProperty("--radix-popper-anchor-height",`${me}px`)}}),$&&V7({element:$,padding:c}),K7({arrowWidth:D,arrowHeight:j}),O&&B7({strategy:"referenceHidden",...ae})]}),[K,E]=ZT(Z),q=Kr(b);Fr(()=>{U&&q?.()},[U,q]);const te=z.arrow?.x,F=z.arrow?.y,oe=z.arrow?.centerOffset!==0,[xe,ue]=C.useState();return Fr(()=>{k&&ue(window.getComputedStyle(k).zIndex)},[k]),S.jsx("div",{ref:le.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:U?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:S.jsx(I7,{scope:t,placedSide:K,onArrowChange:R,arrowX:te,arrowY:F,shouldHideArrow:oe,children:S.jsx(ze.div,{"data-side":K,"data-align":E,...x,ref:A,style:{...x.style,animation:U?void 0:"none"}})})})});DT.displayName=Uy;var jT="PopperArrow",H7={top:"bottom",right:"left",bottom:"top",left:"right"},NT=C.forwardRef(function(e,t){const{__scopePopper:i,...r}=e,s=W7(jT,i),a=H7[s.placedSide];return S.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:S.jsx(U7,{...r,ref:t,style:{...r.style,display:"block"}})})});NT.displayName=jT;function F7(n){return n!==null}var K7=n=>({name:"transformOrigin",options:n,fn(e){const{placement:t,rects:i,middlewareData:r}=e,a=r.arrow?.centerOffset!==0,c=a?0:n.arrowWidth,u=a?0:n.arrowHeight,[h,p]=ZT(t),m={start:"0%",center:"50%",end:"100%"}[p],O=(r.arrow?.x??0)+c/2,v=(r.arrow?.y??0)+u/2;let b="",x="";return h==="bottom"?(b=a?m:`${O}px`,x=`${-u}px`):h==="top"?(b=a?m:`${O}px`,x=`${i.floating.height+u}px`):h==="right"?(b=`${-u}px`,x=a?m:`${v}px`):h==="left"&&(b=`${i.floating.width+u}px`,x=a?m:`${v}px`),{data:{x:b,y:x}}}});function ZT(n){const[e,t="center"]=n.split("-");return[e,t]}var J7=$T,eZ=_T,tZ=DT,nZ=NT,nO="rovingFocusGroup.onEntryFocus",iZ={bubbles:!1,cancelable:!0},Du="RovingFocusGroup",[c0,XT,rZ]=Ny(Du),[sZ,Sl]=Ni(Du,[rZ]),[oZ,aZ]=sZ(Du),LT=C.forwardRef((n,e)=>S.jsx(c0.Provider,{scope:n.__scopeRovingFocusGroup,children:S.jsx(c0.Slot,{scope:n.__scopeRovingFocusGroup,children:S.jsx(lZ,{...n,ref:e})})}));LT.displayName=Du;var lZ=C.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:i,loop:r=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...m}=n,O=C.useRef(null),v=Rt(e,O),b=Eu(s),[x,w]=Zi({prop:a,defaultProp:c??null,onChange:u,caller:Du}),[k,T]=C.useState(!1),A=Kr(h),$=XT(t),R=C.useRef(!1),[_,D]=C.useState(0);return C.useEffect(()=>{const j=O.current;if(j)return j.addEventListener(nO,A),()=>j.removeEventListener(nO,A)},[A]),S.jsx(oZ,{scope:t,orientation:i,dir:b,loop:r,currentTabStopId:x,onItemFocus:C.useCallback(j=>w(j),[w]),onItemShiftTab:C.useCallback(()=>T(!0),[]),onFocusableItemAdd:C.useCallback(()=>D(j=>j+1),[]),onFocusableItemRemove:C.useCallback(()=>D(j=>j-1),[]),children:S.jsx(ze.div,{tabIndex:k||_===0?-1:0,"data-orientation":i,...m,ref:v,style:{outline:"none",...n.style},onMouseDown:Ae(n.onMouseDown,()=>{R.current=!0}),onFocus:Ae(n.onFocus,j=>{const Y=!R.current;if(j.target===j.currentTarget&&Y&&!k){const J=new CustomEvent(nO,iZ);if(j.currentTarget.dispatchEvent(J),!J.defaultPrevented){const I=$().filter(Z=>Z.focusable),W=I.find(Z=>Z.active),ae=I.find(Z=>Z.id===x),ce=[W,ae,...I].filter(Boolean).map(Z=>Z.ref.current);BT(ce,p)}}R.current=!1}),onBlur:Ae(n.onBlur,()=>T(!1))})})}),zT="RovingFocusGroupItem",qT=C.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:i=!0,active:r=!1,tabStopId:s,children:a,...c}=n,u=Ir(),h=s||u,p=aZ(zT,t),m=p.currentTabStopId===h,O=XT(t),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:x}=p;return C.useEffect(()=>{if(i)return v(),()=>b()},[i,v,b]),S.jsx(c0.ItemSlot,{scope:t,id:h,focusable:i,active:r,children:S.jsx(ze.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...c,ref:e,onMouseDown:Ae(n.onMouseDown,w=>{i?p.onItemFocus(h):w.preventDefault()}),onFocus:Ae(n.onFocus,()=>p.onItemFocus(h)),onKeyDown:Ae(n.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){p.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const k=fZ(w,p.orientation,p.dir);if(k!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let A=O().filter($=>$.focusable).map($=>$.ref.current);if(k==="last")A.reverse();else if(k==="prev"||k==="next"){k==="prev"&&A.reverse();const $=A.indexOf(w.currentTarget);A=p.loop?hZ(A,$+1):A.slice($+1)}setTimeout(()=>BT(A))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:x!=null}):a})})});qT.displayName=zT;var cZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uZ(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function fZ(n,e,t){const i=uZ(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return cZ[i]}function BT(n,e=!1){const t=document.activeElement;for(const i of n)if(i===t||(i.focus({preventScroll:e}),document.activeElement!==t))return}function hZ(n,e){return n.map((t,i)=>n[(e+i)%n.length])}var Gy=LT,Iy=qT,u0=["Enter"," "],dZ=["ArrowDown","PageUp","Home"],VT=["ArrowUp","PageDown","End"],pZ=[...dZ,...VT],mZ={ltr:[...u0,"ArrowRight"],rtl:[...u0,"ArrowLeft"]},gZ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ju="Menu",[ru,OZ,yZ]=Ny(ju),[Zo,YT]=Ni(ju,[yZ,MT,Sl]),hp=MT(),UT=Sl(),[vZ,Xo]=Zo(ju),[bZ,Nu]=Zo(ju),GT=n=>{const{__scopeMenu:e,open:t=!1,children:i,dir:r,onOpenChange:s,modal:a=!0}=n,c=hp(e),[u,h]=C.useState(null),p=C.useRef(!1),m=Kr(s),O=Eu(r);return C.useEffect(()=>{const v=()=>{p.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>p.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),S.jsx(J7,{...c,children:S.jsx(vZ,{scope:e,open:t,onOpenChange:m,content:u,onContentChange:h,children:S.jsx(bZ,{scope:e,onClose:C.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:O,modal:a,children:i})})})};GT.displayName=ju;var xZ="MenuAnchor",Wy=C.forwardRef((n,e)=>{const{__scopeMenu:t,...i}=n,r=hp(t);return S.jsx(eZ,{...r,...i,ref:e})});Wy.displayName=xZ;var Hy="MenuPortal",[SZ,IT]=Zo(Hy,{forceMount:void 0}),WT=n=>{const{__scopeMenu:e,forceMount:t,children:i,container:r}=n,s=Xo(Hy,e);return S.jsx(SZ,{scope:e,forceMount:t,children:S.jsx(yr,{present:t||s.open,children:S.jsx($y,{asChild:!0,container:r,children:i})})})};WT.displayName=Hy;var yi="MenuContent",[wZ,Fy]=Zo(yi),HT=C.forwardRef((n,e)=>{const t=IT(yi,n.__scopeMenu),{forceMount:i=t.forceMount,...r}=n,s=Xo(yi,n.__scopeMenu),a=Nu(yi,n.__scopeMenu);return S.jsx(ru.Provider,{scope:n.__scopeMenu,children:S.jsx(yr,{present:i||s.open,children:S.jsx(ru.Slot,{scope:n.__scopeMenu,children:a.modal?S.jsx(kZ,{...r,ref:e}):S.jsx(QZ,{...r,ref:e})})})})}),kZ=C.forwardRef((n,e)=>{const t=Xo(yi,n.__scopeMenu),i=C.useRef(null),r=Rt(e,i);return C.useEffect(()=>{const s=i.current;if(s)return nT(s)},[]),S.jsx(Ky,{...n,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:Ae(n.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),QZ=C.forwardRef((n,e)=>{const t=Xo(yi,n.__scopeMenu);return S.jsx(Ky,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),CZ=el("MenuContent.ScrollLock"),Ky=C.forwardRef((n,e)=>{const{__scopeMenu:t,loop:i=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:O,onDismiss:v,disableOutsideScroll:b,...x}=n,w=Xo(yi,t),k=Nu(yi,t),T=hp(t),A=UT(t),$=OZ(t),[R,_]=C.useState(null),D=C.useRef(null),j=Rt(e,D,w.onContentChange),Y=C.useRef(0),J=C.useRef(""),I=C.useRef(0),W=C.useRef(null),ae=C.useRef("right"),le=C.useRef(0),ce=b?Ey:C.Fragment,Z=b?{as:CZ,allowPinchZoom:!0}:void 0,U=K=>{const E=J.current+K,q=$().filter(de=>!de.disabled),te=document.activeElement,F=q.find(de=>de.ref.current===te)?.textValue,oe=q.map(de=>de.textValue),xe=ZZ(oe,E,F),ue=q.find(de=>de.textValue===xe)?.ref.current;(function de(ke){J.current=ke,window.clearTimeout(Y.current),ke!==""&&(Y.current=window.setTimeout(()=>de(""),1e3))})(E),ue&&setTimeout(()=>ue.focus())};C.useEffect(()=>()=>window.clearTimeout(Y.current),[]),GC();const z=C.useCallback(K=>ae.current===W.current?.side&&LZ(K,W.current?.area),[]);return S.jsx(wZ,{scope:t,searchRef:J,onItemEnter:C.useCallback(K=>{z(K)&&K.preventDefault()},[z]),onItemLeave:C.useCallback(K=>{z(K)||(D.current?.focus(),_(null))},[z]),onTriggerLeave:C.useCallback(K=>{z(K)&&K.preventDefault()},[z]),pointerGraceTimerRef:I,onPointerGraceIntentChange:C.useCallback(K=>{W.current=K},[]),children:S.jsx(ce,{...Z,children:S.jsx(Ry,{asChild:!0,trapped:r,onMountAutoFocus:Ae(s,K=>{K.preventDefault(),D.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:S.jsx(My,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:O,onDismiss:v,children:S.jsx(Gy,{asChild:!0,...A,dir:k.dir,orientation:"vertical",loop:i,currentTabStopId:R,onCurrentTabStopIdChange:_,onEntryFocus:Ae(u,K=>{k.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:S.jsx(tZ,{role:"menu","aria-orientation":"vertical","data-state":hP(w.open),"data-radix-menu-content":"",dir:k.dir,...T,...x,ref:j,style:{outline:"none",...x.style},onKeyDown:Ae(x.onKeyDown,K=>{const q=K.target.closest("[data-radix-menu-content]")===K.currentTarget,te=K.ctrlKey||K.altKey||K.metaKey,F=K.key.length===1;q&&(K.key==="Tab"&&K.preventDefault(),!te&&F&&U(K.key));const oe=D.current;if(K.target!==oe||!pZ.includes(K.key))return;K.preventDefault();const ue=$().filter(de=>!de.disabled).map(de=>de.ref.current);VT.includes(K.key)&&ue.reverse(),jZ(ue)}),onBlur:Ae(n.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(Y.current),J.current="")}),onPointerMove:Ae(n.onPointerMove,su(K=>{const E=K.target,q=le.current!==K.clientX;if(K.currentTarget.contains(E)&&q){const te=K.clientX>le.current?"right":"left";ae.current=te,le.current=K.clientX}}))})})})})})})});HT.displayName=yi;var TZ="MenuGroup",Jy=C.forwardRef((n,e)=>{const{__scopeMenu:t,...i}=n;return S.jsx(ze.div,{role:"group",...i,ref:e})});Jy.displayName=TZ;var PZ="MenuLabel",FT=C.forwardRef((n,e)=>{const{__scopeMenu:t,...i}=n;return S.jsx(ze.div,{...i,ref:e})});FT.displayName=PZ;var wd="MenuItem",Hw="menu.itemSelect",dp=C.forwardRef((n,e)=>{const{disabled:t=!1,onSelect:i,...r}=n,s=C.useRef(null),a=Nu(wd,n.__scopeMenu),c=Fy(wd,n.__scopeMenu),u=Rt(e,s),h=C.useRef(!1),p=()=>{const m=s.current;if(!t&&m){const O=new CustomEvent(Hw,{bubbles:!0,cancelable:!0});m.addEventListener(Hw,v=>i?.(v),{once:!0}),kC(m,O),O.defaultPrevented?h.current=!1:a.onClose()}};return S.jsx(KT,{...r,ref:u,disabled:t,onClick:Ae(n.onClick,p),onPointerDown:m=>{n.onPointerDown?.(m),h.current=!0},onPointerUp:Ae(n.onPointerUp,m=>{h.current||m.currentTarget?.click()}),onKeyDown:Ae(n.onKeyDown,m=>{const O=c.searchRef.current!=="";t||O&&m.key===" "||u0.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});dp.displayName=wd;var KT=C.forwardRef((n,e)=>{const{__scopeMenu:t,disabled:i=!1,textValue:r,...s}=n,a=Fy(wd,t),c=UT(t),u=C.useRef(null),h=Rt(e,u),[p,m]=C.useState(!1),[O,v]=C.useState("");return C.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[s.children]),S.jsx(ru.ItemSlot,{scope:t,disabled:i,textValue:r??O,children:S.jsx(Iy,{asChild:!0,...c,focusable:!i,children:S.jsx(ze.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...s,ref:h,onPointerMove:Ae(n.onPointerMove,su(b=>{i?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(n.onPointerLeave,su(b=>a.onItemLeave(b))),onFocus:Ae(n.onFocus,()=>m(!0)),onBlur:Ae(n.onBlur,()=>m(!1))})})})}),AZ="MenuCheckboxItem",JT=C.forwardRef((n,e)=>{const{checked:t=!1,onCheckedChange:i,...r}=n;return S.jsx(rP,{scope:n.__scopeMenu,checked:t,children:S.jsx(dp,{role:"menuitemcheckbox","aria-checked":kd(t)?"mixed":t,...r,ref:e,"data-state":tv(t),onSelect:Ae(r.onSelect,()=>i?.(kd(t)?!0:!t),{checkForDefaultPrevented:!1})})})});JT.displayName=AZ;var eP="MenuRadioGroup",[MZ,RZ]=Zo(eP,{value:void 0,onValueChange:()=>{}}),tP=C.forwardRef((n,e)=>{const{value:t,onValueChange:i,...r}=n,s=Kr(i);return S.jsx(MZ,{scope:n.__scopeMenu,value:t,onValueChange:s,children:S.jsx(Jy,{...r,ref:e})})});tP.displayName=eP;var nP="MenuRadioItem",iP=C.forwardRef((n,e)=>{const{value:t,...i}=n,r=RZ(nP,n.__scopeMenu),s=t===r.value;return S.jsx(rP,{scope:n.__scopeMenu,checked:s,children:S.jsx(dp,{role:"menuitemradio","aria-checked":s,...i,ref:e,"data-state":tv(s),onSelect:Ae(i.onSelect,()=>r.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});iP.displayName=nP;var ev="MenuItemIndicator",[rP,$Z]=Zo(ev,{checked:!1}),sP=C.forwardRef((n,e)=>{const{__scopeMenu:t,forceMount:i,...r}=n,s=$Z(ev,t);return S.jsx(yr,{present:i||kd(s.checked)||s.checked===!0,children:S.jsx(ze.span,{...r,ref:e,"data-state":tv(s.checked)})})});sP.displayName=ev;var EZ="MenuSeparator",oP=C.forwardRef((n,e)=>{const{__scopeMenu:t,...i}=n;return S.jsx(ze.div,{role:"separator","aria-orientation":"horizontal",...i,ref:e})});oP.displayName=EZ;var _Z="MenuArrow",aP=C.forwardRef((n,e)=>{const{__scopeMenu:t,...i}=n,r=hp(t);return S.jsx(nZ,{...r,...i,ref:e})});aP.displayName=_Z;var DZ="MenuSub",[XW,lP]=Zo(DZ),Dc="MenuSubTrigger",cP=C.forwardRef((n,e)=>{const t=Xo(Dc,n.__scopeMenu),i=Nu(Dc,n.__scopeMenu),r=lP(Dc,n.__scopeMenu),s=Fy(Dc,n.__scopeMenu),a=C.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,h={__scopeMenu:n.__scopeMenu},p=C.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return C.useEffect(()=>p,[p]),C.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]),S.jsx(Wy,{asChild:!0,...h,children:S.jsx(KT,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":hP(t.open),...n,ref:sp(e,r.onTriggerChange),onClick:m=>{n.onClick?.(m),!(n.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:Ae(n.onPointerMove,su(m=>{s.onItemEnter(m),!m.defaultPrevented&&!n.disabled&&!t.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{t.onOpenChange(!0),p()},100))})),onPointerLeave:Ae(n.onPointerLeave,su(m=>{p();const O=t.content?.getBoundingClientRect();if(O){const v=t.content?.dataset.side,b=v==="right",x=b?-5:5,w=O[b?"left":"right"],k=O[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:w,y:O.top},{x:k,y:O.top},{x:k,y:O.bottom},{x:w,y:O.bottom}],side:v}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(m),m.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(n.onKeyDown,m=>{const O=s.searchRef.current!=="";n.disabled||O&&m.key===" "||mZ[i.dir].includes(m.key)&&(t.onOpenChange(!0),t.content?.focus(),m.preventDefault())})})})});cP.displayName=Dc;var uP="MenuSubContent",fP=C.forwardRef((n,e)=>{const t=IT(yi,n.__scopeMenu),{forceMount:i=t.forceMount,...r}=n,s=Xo(yi,n.__scopeMenu),a=Nu(yi,n.__scopeMenu),c=lP(uP,n.__scopeMenu),u=C.useRef(null),h=Rt(e,u);return S.jsx(ru.Provider,{scope:n.__scopeMenu,children:S.jsx(yr,{present:i||s.open,children:S.jsx(ru.Slot,{scope:n.__scopeMenu,children:S.jsx(Ky,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:h,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{a.isUsingKeyboardRef.current&&u.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Ae(n.onFocusOutside,p=>{p.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ae(n.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:Ae(n.onKeyDown,p=>{const m=p.currentTarget.contains(p.target),O=gZ[a.dir].includes(p.key);m&&O&&(s.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});fP.displayName=uP;function hP(n){return n?"open":"closed"}function kd(n){return n==="indeterminate"}function tv(n){return kd(n)?"indeterminate":n?"checked":"unchecked"}function jZ(n){const e=document.activeElement;for(const t of n)if(t===e||(t.focus(),document.activeElement!==e))return}function NZ(n,e){return n.map((t,i)=>n[(e+i)%n.length])}function ZZ(n,e,t){const r=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let a=NZ(n,Math.max(s,0));r.length===1&&(a=a.filter(h=>h!==t));const u=a.find(h=>h.toLowerCase().startsWith(r.toLowerCase()));return u!==t?u:void 0}function XZ(n,e){const{x:t,y:i}=n;let r=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const c=e[s],u=e[a],h=c.x,p=c.y,m=u.x,O=u.y;p>i!=O>i&&t<(m-h)*(i-p)/(O-p)+h&&(r=!r)}return r}function LZ(n,e){if(!e)return!1;const t={x:n.clientX,y:n.clientY};return XZ(t,e)}function su(n){return e=>e.pointerType==="mouse"?n(e):void 0}var zZ=GT,qZ=Wy,BZ=WT,VZ=HT,YZ=Jy,UZ=FT,GZ=dp,IZ=JT,WZ=tP,HZ=iP,FZ=sP,KZ=oP,JZ=aP,e6=cP,t6=fP,pp="DropdownMenu",[n6,LW]=Ni(pp,[YT]),xn=YT(),[i6,dP]=n6(pp),pP=n=>{const{__scopeDropdownMenu:e,children:t,dir:i,open:r,defaultOpen:s,onOpenChange:a,modal:c=!0}=n,u=xn(e),h=C.useRef(null),[p,m]=Zi({prop:r,defaultProp:s??!1,onChange:a,caller:pp});return S.jsx(i6,{scope:e,triggerId:Ir(),triggerRef:h,contentId:Ir(),open:p,onOpenChange:m,onOpenToggle:C.useCallback(()=>m(O=>!O),[m]),modal:c,children:S.jsx(zZ,{...u,open:p,onOpenChange:m,dir:i,modal:c,children:t})})};pP.displayName=pp;var mP="DropdownMenuTrigger",gP=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,disabled:i=!1,...r}=n,s=dP(mP,t),a=xn(t);return S.jsx(qZ,{asChild:!0,...a,children:S.jsx(ze.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...r,ref:sp(e,s.triggerRef),onPointerDown:Ae(n.onPointerDown,c=>{!i&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:Ae(n.onKeyDown,c=>{i||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});gP.displayName=mP;var r6="DropdownMenuPortal",OP=n=>{const{__scopeDropdownMenu:e,...t}=n,i=xn(e);return S.jsx(BZ,{...i,...t})};OP.displayName=r6;var yP="DropdownMenuContent",vP=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=dP(yP,t),s=xn(t),a=C.useRef(!1);return S.jsx(VZ,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...i,ref:e,onCloseAutoFocus:Ae(n.onCloseAutoFocus,c=>{a.current||r.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:Ae(n.onInteractOutside,c=>{const u=c.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,p=u.button===2||h;(!r.modal||p)&&(a.current=!0)}),style:{...n.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)"}})});vP.displayName=yP;var s6="DropdownMenuGroup",o6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(YZ,{...r,...i,ref:e})});o6.displayName=s6;var a6="DropdownMenuLabel",l6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(UZ,{...r,...i,ref:e})});l6.displayName=a6;var c6="DropdownMenuItem",bP=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(GZ,{...r,...i,ref:e})});bP.displayName=c6;var u6="DropdownMenuCheckboxItem",f6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(IZ,{...r,...i,ref:e})});f6.displayName=u6;var h6="DropdownMenuRadioGroup",d6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(WZ,{...r,...i,ref:e})});d6.displayName=h6;var p6="DropdownMenuRadioItem",m6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(HZ,{...r,...i,ref:e})});m6.displayName=p6;var g6="DropdownMenuItemIndicator",O6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(FZ,{...r,...i,ref:e})});O6.displayName=g6;var y6="DropdownMenuSeparator",v6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(KZ,{...r,...i,ref:e})});v6.displayName=y6;var b6="DropdownMenuArrow",x6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(JZ,{...r,...i,ref:e})});x6.displayName=b6;var S6="DropdownMenuSubTrigger",w6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(e6,{...r,...i,ref:e})});w6.displayName=S6;var k6="DropdownMenuSubContent",Q6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(t6,{...r,...i,ref:e,style:{...n.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)"}})});Q6.displayName=k6;var C6=pP,T6=gP,P6=OP,A6=vP,M6=bP;function R6({...n}){return S.jsx(C6,{"data-slot":"dropdown-menu",...n})}function $6({...n}){return S.jsx(T6,{"data-slot":"dropdown-menu-trigger",...n})}function E6({className:n,sideOffset:e=4,...t}){return S.jsx(P6,{children:S.jsx(A6,{"data-slot":"dropdown-menu-content",sideOffset:e,className:Ie("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),...t})})}function _6({className:n,inset:e,variant:t="default",...i}){return S.jsx(M6,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":t,className:Ie("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...i})}function D6({option:n,value:e,onChange:t,disabled:i=!1}){const r=n.options.find(s=>s.value===e);return S.jsxs("div",{className:"space-y-2",children:[S.jsx(Ji,{className:"text-sm font-medium text-gray-300",children:n.label}),n.description&&S.jsx("p",{className:"text-xs text-gray-500",children:n.description}),S.jsxs(R6,{children:[S.jsx($6,{asChild:!0,children:S.jsxs(Oi,{variant:"outline",className:"w-full justify-between",disabled:i,children:[S.jsx("span",{children:r?.label||"Select option..."}),S.jsx(yC,{className:"h-4 w-4"})]})}),S.jsx(E6,{className:"w-full min-w-[200px]",children:n.options.map(s=>S.jsx(_6,{onClick:()=>t(s.value),className:e===s.value?"bg-accent":"",children:s.label},s.value))})]})]})}function j6({addOn:n,selectedOptions:e,onOptionChange:t,disabled:i=!1}){return!n.options||Object.keys(n.options).length===0?null:S.jsx("div",{className:"space-y-3",children:Object.entries(n.options).map(([r,s])=>s&&typeof s=="object"&&"type"in s&&s.type==="select"?S.jsx(D6,{option:s,value:e[r]||s.default,onChange:a=>t(r,a),disabled:i},r):null)})}function N6({addOn:n,selectedOptions:e,onOptionChange:t,onClose:i,disabled:r=!1}){return n?S.jsx(jo,{open:!!n,onOpenChange:s=>!s&&i(),children:S.jsxs(No,{className:"sm:max-w-md",children:[S.jsxs(yl,{children:[S.jsxs(vl,{children:["Configure ",n.name]}),S.jsx(VN,{children:"Customize the configuration options for this add-on."})]}),S.jsx("div",{className:"py-4",children:S.jsx(j6,{addOn:n,selectedOptions:e,onOptionChange:t,disabled:r})})]})}):null}const Fw={toolchain:"Toolchain","add-on":"Add-on",host:"Hosting Provider",example:"Example"};function Z6(){const{availableAddOns:n,addOnState:e,toggleAddOn:t,setAddOnOption:i}=Au(),r=dn(p=>p.addOnOptions),s=C.useMemo(()=>n.sort((p,m)=>p.name.localeCompare(m.name)),[n]),[a,c]=C.useState(),[u,h]=C.useState();return S.jsxs(S.Fragment,{children:[S.jsx(UN,{addOn:a,onClose:()=>c(void 0)}),S.jsx(N6,{addOn:u,selectedOptions:u?r[u.id]||{}:{},onOptionChange:(p,m)=>{u&&i(u.id,p,m)},onClose:()=>h(void 0),disabled:u?!e[u.id]?.enabled:!1}),S.jsx("div",{className:"max-h-[60vh] overflow-y-auto space-y-2",children:Object.keys(Fw).map(p=>S.jsx(C.Fragment,{children:s.filter(m=>m.type===p).length>0&&S.jsxs("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active",children:[S.jsx("h3",{className:"font-medium",children:Fw[p]}),S.jsx("div",{className:"space-y-3",children:S.jsx("div",{className:"flex flex-row flex-wrap",children:s.filter(m=>m.type===p).map(m=>S.jsx("div",{className:"w-1/2",children:S.jsxs("div",{className:"flex flex-row items-center justify-between",children:[S.jsxs("div",{className:"p-1 flex flex-row items-center",children:[S.jsx(Ur,{id:m.id,checked:e[m.id].selected,disabled:!e[m.id].enabled,onCheckedChange:()=>{t(m.id)}}),S.jsxs(Ji,{htmlFor:m.id,className:"pl-2 font-semibold text-gray-300 flex items-center gap-2",children:[m.smallLogo&&S.jsx("img",{src:`data:image/svg+xml,${encodeURIComponent(m.smallLogo)}`,alt:m.name,className:"w-5"}),m.name]})]}),S.jsxs("div",{className:"flex items-center gap-1",children:[e[m.id].selected&&m.options&&Object.keys(m.options).length>0&&S.jsx(Oi,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-gray-600 hover:text-gray-400",onClick:()=>h(m),disabled:!e[m.id].enabled,children:S.jsx(_D,{className:"w-4 h-4"})}),S.jsx(xC,{className:"w-4 text-gray-600 cursor-pointer hover:text-gray-400",onClick:()=>c(m)})]})]})},m.id))})})]},`${p}-add-ons`)},p))}),S.jsx("div",{className:"mt-4",children:S.jsx(YN,{})})]})}const X6={file:jD,command:ZD,"package-manager":$D,info:xC,other:MD};function xP(){const[n,e]=C.useState([]),[t,i]=C.useState(!1),r=C.useCallback(async s=>{i(!1);const a=s.body?.getReader(),c=new TextDecoder;let u="";for(;;){const h=await a?.read();if(h?.done)break;u+=c.decode(h?.value);let p;const m=[];for(const O of u.split(`
198
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return C.useEffect(()=>{n&&(document.getElementById(n)||console.error(t))},[t,n]),null},EN="DialogDescriptionWarning",_N=({contentRef:n,descriptionId:e})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${OT(EN).contentName}}.`;return C.useEffect(()=>{const r=n.current?.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(i))},[i,n,e]),null},DN=rT,jN=aT,NN=lT,ZN=cT,XN=fT,LN=dT,zN=mT;function jo({...n}){return S.jsx(DN,{"data-slot":"dialog",...n})}function qN({...n}){return S.jsx(jN,{"data-slot":"dialog-portal",...n})}function BN({className:n,...e}){return S.jsx(NN,{"data-slot":"dialog-overlay",className:Ie("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...e})}function No({className:n,children:e,hideCloseButton:t,...i}){return S.jsxs(qN,{"data-slot":"dialog-portal",children:[S.jsx(BN,{}),S.jsxs(ZN,{"data-slot":"dialog-content",className:Ie("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 p-6 shadow-lg duration-200 sm:max-w-lg bg-opacity-70 backdrop-blur-md border-3 border-white/20",n),...i,children:[e,!t&&S.jsxs(zN,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[S.jsx(VD,{}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yl({className:n,...e}){return S.jsx("div",{"data-slot":"dialog-header",className:Ie("flex flex-col gap-2 text-center sm:text-left",n),...e})}function $u({className:n,...e}){return S.jsx("div",{"data-slot":"dialog-footer",className:Ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...e})}function vl({className:n,...e}){return S.jsx(XN,{"data-slot":"dialog-title",className:Ie("text-lg leading-none font-semibold",n),...e})}function VN({className:n,...e}){return S.jsx(LN,{"data-slot":"dialog-description",className:Ie("text-muted-foreground text-sm",n),...e})}function YN(){const[n,e]=C.useState(""),[t,i]=C.useState(!1),r=Mu(),{toggleAddOn:s}=Au();async function a(){const c=await q_(n);"error"in c?Py.error("Failed to load add-on",{description:c.error}):(eD(c),c.modes.includes(r)&&s(c.id),i(!1))}return S.jsxs("div",{children:[S.jsxs(Oi,{variant:"secondary",className:"w-full",onClick:()=>{e(""),i(!0)},children:[S.jsx(LD,{className:"w-4 h-4"}),"Import Custom Add-On"]}),S.jsx(jo,{modal:!0,open:t,onOpenChange:i,children:S.jsxs(No,{className:"sm:min-w-[425px] sm:max-w-fit",children:[S.jsx(yl,{children:S.jsx(vl,{children:"Import Custom Add-On"})}),S.jsx("div",{children:S.jsx(Ay,{value:n,onChange:c=>e(c.target.value),placeholder:"https://github.com/myorg/myproject/add-on.json",className:"min-w-lg w-full",onKeyDown:c=>{c.key==="Enter"&&a()}})}),S.jsx($u,{children:S.jsx(Oi,{onClick:a,children:"Import"})})]})})]})}function UN({addOn:n,onClose:e}){return S.jsx(jo,{modal:!0,open:!!n,onOpenChange:e,children:S.jsx(No,{className:"sm:min-w-[425px] sm:max-w-fit",children:S.jsxs("div",{className:"flex flex-row",children:[n?.smallLogo&&S.jsx("img",{src:`data:image/svg+xml,${encodeURIComponent(n.smallLogo)}`,alt:n.name,className:"w-15"}),S.jsxs("div",{className:"flex flex-col ml-4 gap-4",children:[S.jsx("p",{className:"text-lg font-bold",children:n?.name}),S.jsx("p",{className:"text-sm text-gray-500",children:n?.description}),S.jsxs("a",{href:n?.link,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-500 underline",children:["More information on ",n?.name]})]})]})})})}function Ny(n){const e=n+"CollectionProvider",[t,i]=Ni(e),[r,s]=t(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:w,children:k}=x,T=ee.useRef(null),A=ee.useRef(new Map).current;return S.jsx(r,{scope:w,itemMap:A,collectionRef:T,children:k})};a.displayName=e;const c=n+"CollectionSlot",u=el(c),h=ee.forwardRef((x,w)=>{const{scope:k,children:T}=x,A=s(c,k),$=Rt(w,A.collectionRef);return S.jsx(u,{ref:$,children:T})});h.displayName=c;const p=n+"CollectionItemSlot",m="data-radix-collection-item",O=el(p),v=ee.forwardRef((x,w)=>{const{scope:k,children:T,...A}=x,$=ee.useRef(null),R=Rt(w,$),_=s(p,k);return ee.useEffect(()=>(_.itemMap.set($,{ref:$,...A}),()=>void _.itemMap.delete($))),S.jsx(O,{[m]:"",ref:R,children:T})});v.displayName=p;function b(x){const w=s(n+"CollectionConsumer",x);return ee.useCallback(()=>{const T=w.collectionRef.current;if(!T)return[];const A=Array.from(T.querySelectorAll(`[${m}]`));return Array.from(w.itemMap.values()).sort((_,D)=>A.indexOf(_.ref.current)-A.indexOf(D.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:h,ItemSlot:v},b,i]}var GN=C.createContext(void 0);function Eu(n){const e=C.useContext(GN);return n||e||"ltr"}const IN=["top","right","bottom","left"],Ns=Math.min,In=Math.max,vd=Math.round,yh=Math.floor,lr=n=>({x:n,y:n}),WN={left:"right",right:"left",bottom:"top",top:"bottom"},HN={start:"end",end:"start"};function o0(n,e,t){return In(n,Ns(e,t))}function Jr(n,e){return typeof n=="function"?n(e):n}function es(n){return n.split("-")[0]}function bl(n){return n.split("-")[1]}function Zy(n){return n==="x"?"y":"x"}function Xy(n){return n==="y"?"height":"width"}function Zs(n){return["top","bottom"].includes(es(n))?"y":"x"}function Ly(n){return Zy(Zs(n))}function FN(n,e,t){t===void 0&&(t=!1);const i=bl(n),r=Ly(n),s=Xy(r);let a=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=bd(a)),[a,bd(a)]}function KN(n){const e=bd(n);return[a0(n),e,a0(e)]}function a0(n){return n.replace(/start|end/g,e=>HN[e])}function JN(n,e,t){const i=["left","right"],r=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(n){case"top":case"bottom":return t?e?r:i:e?i:r;case"left":case"right":return e?s:a;default:return[]}}function e7(n,e,t,i){const r=bl(n);let s=JN(es(n),t==="start",i);return r&&(s=s.map(a=>a+"-"+r),e&&(s=s.concat(s.map(a0)))),s}function bd(n){return n.replace(/left|right|bottom|top/g,e=>WN[e])}function t7(n){return{top:0,right:0,bottom:0,left:0,...n}}function yT(n){return typeof n!="number"?t7(n):{top:n,right:n,bottom:n,left:n}}function xd(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function qw(n,e,t){let{reference:i,floating:r}=n;const s=Zs(e),a=Ly(e),c=Xy(a),u=es(e),h=s==="y",p=i.x+i.width/2-r.width/2,m=i.y+i.height/2-r.height/2,O=i[c]/2-r[c]/2;let v;switch(u){case"top":v={x:p,y:i.y-r.height};break;case"bottom":v={x:p,y:i.y+i.height};break;case"right":v={x:i.x+i.width,y:m};break;case"left":v={x:i.x-r.width,y:m};break;default:v={x:i.x,y:i.y}}switch(bl(e)){case"start":v[a]-=O*(t&&h?-1:1);break;case"end":v[a]+=O*(t&&h?-1:1);break}return v}const n7=async(n,e,t)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:a}=t,c=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(e));let h=await a.getElementRects({reference:n,floating:e,strategy:r}),{x:p,y:m}=qw(h,i,u),O=i,v={},b=0;for(let x=0;x<c.length;x++){const{name:w,fn:k}=c[x],{x:T,y:A,data:$,reset:R}=await k({x:p,y:m,initialPlacement:i,placement:O,strategy:r,middlewareData:v,rects:h,platform:a,elements:{reference:n,floating:e}});p=T??p,m=A??m,v={...v,[w]:{...v[w],...$}},R&&b<=50&&(b++,typeof R=="object"&&(R.placement&&(O=R.placement),R.rects&&(h=R.rects===!0?await a.getElementRects({reference:n,floating:e,strategy:r}):R.rects),{x:p,y:m}=qw(h,O,u)),x=-1)}return{x:p,y:m,placement:O,strategy:r,middlewareData:v}};async function nu(n,e){var t;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:a,elements:c,strategy:u}=n,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:O=!1,padding:v=0}=Jr(e,n),b=yT(v),w=c[O?m==="floating"?"reference":"floating":m],k=xd(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(w)))==null||t?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:h,rootBoundary:p,strategy:u})),T=m==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),$=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},R=xd(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:T,offsetParent:A,strategy:u}):T);return{top:(k.top-R.top+b.top)/$.y,bottom:(R.bottom-k.bottom+b.bottom)/$.y,left:(k.left-R.left+b.left)/$.x,right:(R.right-k.right+b.right)/$.x}}const i7=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:i,placement:r,rects:s,platform:a,elements:c,middlewareData:u}=e,{element:h,padding:p=0}=Jr(n,e)||{};if(h==null)return{};const m=yT(p),O={x:t,y:i},v=Ly(r),b=Xy(v),x=await a.getDimensions(h),w=v==="y",k=w?"top":"left",T=w?"bottom":"right",A=w?"clientHeight":"clientWidth",$=s.reference[b]+s.reference[v]-O[v]-s.floating[b],R=O[v]-s.reference[v],_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(h));let D=_?_[A]:0;(!D||!await(a.isElement==null?void 0:a.isElement(_)))&&(D=c.floating[A]||s.floating[b]);const j=$/2-R/2,Y=D/2-x[b]/2-1,J=Ns(m[k],Y),I=Ns(m[T],Y),W=J,ae=D-x[b]-I,le=D/2-x[b]/2+j,ce=o0(W,le,ae),Z=!u.arrow&&bl(r)!=null&&le!==ce&&s.reference[b]/2-(le<W?J:I)-x[b]/2<0,U=Z?le<W?le-W:le-ae:0;return{[v]:O[v]+U,data:{[v]:ce,centerOffset:le-ce-U,...Z&&{alignmentOffset:U}},reset:Z}}}),r7=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:r,middlewareData:s,rects:a,initialPlacement:c,platform:u,elements:h}=e,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:O,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...w}=Jr(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const k=es(r),T=Zs(c),A=es(c)===c,$=await(u.isRTL==null?void 0:u.isRTL(h.floating)),R=O||(A||!x?[bd(c)]:KN(c)),_=b!=="none";!O&&_&&R.push(...e7(c,x,b,$));const D=[c,...R],j=await nu(e,w),Y=[];let J=((i=s.flip)==null?void 0:i.overflows)||[];if(p&&Y.push(j[k]),m){const le=FN(r,a,$);Y.push(j[le[0]],j[le[1]])}if(J=[...J,{placement:r,overflows:Y}],!Y.every(le=>le<=0)){var I,W;const le=(((I=s.flip)==null?void 0:I.index)||0)+1,ce=D[le];if(ce)return{data:{index:le,overflows:J},reset:{placement:ce}};let Z=(W=J.filter(U=>U.overflows[0]<=0).sort((U,z)=>U.overflows[1]-z.overflows[1])[0])==null?void 0:W.placement;if(!Z)switch(v){case"bestFit":{var ae;const U=(ae=J.filter(z=>{if(_){const K=Zs(z.placement);return K===T||K==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(K=>K>0).reduce((K,E)=>K+E,0)]).sort((z,K)=>z[1]-K[1])[0])==null?void 0:ae[0];U&&(Z=U);break}case"initialPlacement":Z=c;break}if(r!==Z)return{reset:{placement:Z}}}return{}}}};function Bw(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function Vw(n){return IN.some(e=>n[e]>=0)}const s7=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:i="referenceHidden",...r}=Jr(n,e);switch(i){case"referenceHidden":{const s=await nu(e,{...r,elementContext:"reference"}),a=Bw(s,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Vw(a)}}}case"escaped":{const s=await nu(e,{...r,altBoundary:!0}),a=Bw(s,t.floating);return{data:{escapedOffsets:a,escaped:Vw(a)}}}default:return{}}}}};async function o7(n,e){const{placement:t,platform:i,elements:r}=n,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=es(t),c=bl(t),u=Zs(t)==="y",h=["left","top"].includes(a)?-1:1,p=s&&u?-1:1,m=Jr(e,n);let{mainAxis:O,crossAxis:v,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof b=="number"&&(v=c==="end"?b*-1:b),u?{x:v*p,y:O*h}:{x:O*h,y:v*p}}const a7=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:r,y:s,placement:a,middlewareData:c}=e,u=await o7(e,n);return a===((t=c.offset)==null?void 0:t.placement)&&(i=c.arrow)!=null&&i.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:a}}}}},l7=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:r}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:w=>{let{x:k,y:T}=w;return{x:k,y:T}}},...u}=Jr(n,e),h={x:t,y:i},p=await nu(e,u),m=Zs(es(r)),O=Zy(m);let v=h[O],b=h[m];if(s){const w=O==="y"?"top":"left",k=O==="y"?"bottom":"right",T=v+p[w],A=v-p[k];v=o0(T,v,A)}if(a){const w=m==="y"?"top":"left",k=m==="y"?"bottom":"right",T=b+p[w],A=b-p[k];b=o0(T,b,A)}const x=c.fn({...e,[O]:v,[m]:b});return{...x,data:{x:x.x-t,y:x.y-i,enabled:{[O]:s,[m]:a}}}}}},c7=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:i,placement:r,rects:s,middlewareData:a}=e,{offset:c=0,mainAxis:u=!0,crossAxis:h=!0}=Jr(n,e),p={x:t,y:i},m=Zs(r),O=Zy(m);let v=p[O],b=p[m];const x=Jr(c,e),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const A=O==="y"?"height":"width",$=s.reference[O]-s.floating[A]+w.mainAxis,R=s.reference[O]+s.reference[A]-w.mainAxis;v<$?v=$:v>R&&(v=R)}if(h){var k,T;const A=O==="y"?"width":"height",$=["top","left"].includes(es(r)),R=s.reference[m]-s.floating[A]+($&&((k=a.offset)==null?void 0:k[m])||0)+($?0:w.crossAxis),_=s.reference[m]+s.reference[A]+($?0:((T=a.offset)==null?void 0:T[m])||0)-($?w.crossAxis:0);b<R?b=R:b>_&&(b=_)}return{[O]:v,[m]:b}}}},u7=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,i;const{placement:r,rects:s,platform:a,elements:c}=e,{apply:u=()=>{},...h}=Jr(n,e),p=await nu(e,h),m=es(r),O=bl(r),v=Zs(r)==="y",{width:b,height:x}=s.floating;let w,k;m==="top"||m==="bottom"?(w=m,k=O===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(k=m,w=O==="end"?"top":"bottom");const T=x-p.top-p.bottom,A=b-p.left-p.right,$=Ns(x-p[w],T),R=Ns(b-p[k],A),_=!e.middlewareData.shift;let D=$,j=R;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(j=A),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(D=T),_&&!O){const J=In(p.left,0),I=In(p.right,0),W=In(p.top,0),ae=In(p.bottom,0);v?j=b-2*(J!==0||I!==0?J+I:In(p.left,p.right)):D=x-2*(W!==0||ae!==0?W+ae:In(p.top,p.bottom))}await u({...e,availableWidth:j,availableHeight:D});const Y=await a.getDimensions(c.floating);return b!==Y.width||x!==Y.height?{reset:{rects:!0}}:{}}}};function cp(){return typeof window<"u"}function xl(n){return vT(n)?(n.nodeName||"").toLowerCase():"#document"}function Hn(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function vr(n){var e;return(e=(vT(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function vT(n){return cp()?n instanceof Node||n instanceof Hn(n).Node:!1}function Ei(n){return cp()?n instanceof Element||n instanceof Hn(n).Element:!1}function hr(n){return cp()?n instanceof HTMLElement||n instanceof Hn(n).HTMLElement:!1}function Yw(n){return!cp()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Hn(n).ShadowRoot}function _u(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=_i(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(r)}function f7(n){return["table","td","th"].includes(xl(n))}function up(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function zy(n){const e=qy(),t=Ei(n)?_i(n):n;return["transform","translate","scale","rotate","perspective"].some(i=>t[i]?t[i]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(i=>(t.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(t.contain||"").includes(i))}function h7(n){let e=Xs(n);for(;hr(e)&&!tl(e);){if(zy(e))return e;if(up(e))return null;e=Xs(e)}return null}function qy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function tl(n){return["html","body","#document"].includes(xl(n))}function _i(n){return Hn(n).getComputedStyle(n)}function fp(n){return Ei(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Xs(n){if(xl(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Yw(n)&&n.host||vr(n);return Yw(e)?e.host:e}function bT(n){const e=Xs(n);return tl(e)?n.ownerDocument?n.ownerDocument.body:n.body:hr(e)&&_u(e)?e:bT(e)}function iu(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=bT(n),s=r===((i=n.ownerDocument)==null?void 0:i.body),a=Hn(r);if(s){const c=l0(a);return e.concat(a,a.visualViewport||[],_u(r)?r:[],c&&t?iu(c):[])}return e.concat(r,iu(r,[],t))}function l0(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function xT(n){const e=_i(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=hr(n),s=r?n.offsetWidth:t,a=r?n.offsetHeight:i,c=vd(t)!==s||vd(i)!==a;return c&&(t=s,i=a),{width:t,height:i,$:c}}function By(n){return Ei(n)?n:n.contextElement}function Va(n){const e=By(n);if(!hr(e))return lr(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:s}=xT(e);let a=(s?vd(t.width):t.width)/i,c=(s?vd(t.height):t.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const d7=lr(0);function ST(n){const e=Hn(n);return!qy()||!e.visualViewport?d7:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function p7(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Hn(n)?!1:e}function Co(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),s=By(n);let a=lr(1);e&&(i?Ei(i)&&(a=Va(i)):a=Va(n));const c=p7(s,t,i)?ST(s):lr(0);let u=(r.left+c.x)/a.x,h=(r.top+c.y)/a.y,p=r.width/a.x,m=r.height/a.y;if(s){const O=Hn(s),v=i&&Ei(i)?Hn(i):i;let b=O,x=l0(b);for(;x&&i&&v!==b;){const w=Va(x),k=x.getBoundingClientRect(),T=_i(x),A=k.left+(x.clientLeft+parseFloat(T.paddingLeft))*w.x,$=k.top+(x.clientTop+parseFloat(T.paddingTop))*w.y;u*=w.x,h*=w.y,p*=w.x,m*=w.y,u+=A,h+=$,b=Hn(x),x=l0(b)}}return xd({width:p,height:m,x:u,y:h})}function Vy(n,e){const t=fp(n).scrollLeft;return e?e.left+t:Co(vr(n)).left+t}function wT(n,e,t){t===void 0&&(t=!1);const i=n.getBoundingClientRect(),r=i.left+e.scrollLeft-(t?0:Vy(n,i)),s=i.top+e.scrollTop;return{x:r,y:s}}function m7(n){let{elements:e,rect:t,offsetParent:i,strategy:r}=n;const s=r==="fixed",a=vr(i),c=e?up(e.floating):!1;if(i===a||c&&s)return t;let u={scrollLeft:0,scrollTop:0},h=lr(1);const p=lr(0),m=hr(i);if((m||!m&&!s)&&((xl(i)!=="body"||_u(a))&&(u=fp(i)),hr(i))){const v=Co(i);h=Va(i),p.x=v.x+i.clientLeft,p.y=v.y+i.clientTop}const O=a&&!m&&!s?wT(a,u,!0):lr(0);return{width:t.width*h.x,height:t.height*h.y,x:t.x*h.x-u.scrollLeft*h.x+p.x+O.x,y:t.y*h.y-u.scrollTop*h.y+p.y+O.y}}function g7(n){return Array.from(n.getClientRects())}function O7(n){const e=vr(n),t=fp(n),i=n.ownerDocument.body,r=In(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=In(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-t.scrollLeft+Vy(n);const c=-t.scrollTop;return _i(i).direction==="rtl"&&(a+=In(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:a,y:c}}function y7(n,e){const t=Hn(n),i=vr(n),r=t.visualViewport;let s=i.clientWidth,a=i.clientHeight,c=0,u=0;if(r){s=r.width,a=r.height;const h=qy();(!h||h&&e==="fixed")&&(c=r.offsetLeft,u=r.offsetTop)}return{width:s,height:a,x:c,y:u}}function v7(n,e){const t=Co(n,!0,e==="fixed"),i=t.top+n.clientTop,r=t.left+n.clientLeft,s=hr(n)?Va(n):lr(1),a=n.clientWidth*s.x,c=n.clientHeight*s.y,u=r*s.x,h=i*s.y;return{width:a,height:c,x:u,y:h}}function Uw(n,e,t){let i;if(e==="viewport")i=y7(n,t);else if(e==="document")i=O7(vr(n));else if(Ei(e))i=v7(e,t);else{const r=ST(n);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return xd(i)}function kT(n,e){const t=Xs(n);return t===e||!Ei(t)||tl(t)?!1:_i(t).position==="fixed"||kT(t,e)}function b7(n,e){const t=e.get(n);if(t)return t;let i=iu(n,[],!1).filter(c=>Ei(c)&&xl(c)!=="body"),r=null;const s=_i(n).position==="fixed";let a=s?Xs(n):n;for(;Ei(a)&&!tl(a);){const c=_i(a),u=zy(a);!u&&c.position==="fixed"&&(r=null),(s?!u&&!r:!u&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||_u(a)&&!u&&kT(n,a))?i=i.filter(p=>p!==a):r=c,a=Xs(a)}return e.set(n,i),i}function x7(n){let{element:e,boundary:t,rootBoundary:i,strategy:r}=n;const a=[...t==="clippingAncestors"?up(e)?[]:b7(e,this._c):[].concat(t),i],c=a[0],u=a.reduce((h,p)=>{const m=Uw(e,p,r);return h.top=In(m.top,h.top),h.right=Ns(m.right,h.right),h.bottom=Ns(m.bottom,h.bottom),h.left=In(m.left,h.left),h},Uw(e,c,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function S7(n){const{width:e,height:t}=xT(n);return{width:e,height:t}}function w7(n,e,t){const i=hr(e),r=vr(e),s=t==="fixed",a=Co(n,!0,s,e);let c={scrollLeft:0,scrollTop:0};const u=lr(0);if(i||!i&&!s)if((xl(e)!=="body"||_u(r))&&(c=fp(e)),i){const O=Co(e,!0,s,e);u.x=O.x+e.clientLeft,u.y=O.y+e.clientTop}else r&&(u.x=Vy(r));const h=r&&!i&&!s?wT(r,c):lr(0),p=a.left+c.scrollLeft-u.x-h.x,m=a.top+c.scrollTop-u.y-h.y;return{x:p,y:m,width:a.width,height:a.height}}function eO(n){return _i(n).position==="static"}function Gw(n,e){if(!hr(n)||_i(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return vr(n)===t&&(t=t.ownerDocument.body),t}function QT(n,e){const t=Hn(n);if(up(n))return t;if(!hr(n)){let r=Xs(n);for(;r&&!tl(r);){if(Ei(r)&&!eO(r))return r;r=Xs(r)}return t}let i=Gw(n,e);for(;i&&f7(i)&&eO(i);)i=Gw(i,e);return i&&tl(i)&&eO(i)&&!zy(i)?t:i||h7(n)||t}const k7=async function(n){const e=this.getOffsetParent||QT,t=this.getDimensions,i=await t(n.floating);return{reference:w7(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Q7(n){return _i(n).direction==="rtl"}const C7={convertOffsetParentRelativeRectToViewportRelativeRect:m7,getDocumentElement:vr,getClippingRect:x7,getOffsetParent:QT,getElementRects:k7,getClientRects:g7,getDimensions:S7,getScale:Va,isElement:Ei,isRTL:Q7};function CT(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function T7(n,e){let t=null,i;const r=vr(n);function s(){var c;clearTimeout(i),(c=t)==null||c.disconnect(),t=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const h=n.getBoundingClientRect(),{left:p,top:m,width:O,height:v}=h;if(c||e(),!O||!v)return;const b=yh(m),x=yh(r.clientWidth-(p+O)),w=yh(r.clientHeight-(m+v)),k=yh(p),A={rootMargin:-b+"px "+-x+"px "+-w+"px "+-k+"px",threshold:In(0,Ns(1,u))||1};let $=!0;function R(_){const D=_[0].intersectionRatio;if(D!==u){if(!$)return a();D?a(!1,D):i=setTimeout(()=>{a(!1,1e-7)},1e3)}D===1&&!CT(h,n.getBoundingClientRect())&&a(),$=!1}try{t=new IntersectionObserver(R,{...A,root:r.ownerDocument})}catch{t=new IntersectionObserver(R,A)}t.observe(n)}return a(!0),s}function P7(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,h=By(n),p=r||s?[...h?iu(h):[],...iu(e)]:[];p.forEach(k=>{r&&k.addEventListener("scroll",t,{passive:!0}),s&&k.addEventListener("resize",t)});const m=h&&c?T7(h,t):null;let O=-1,v=null;a&&(v=new ResizeObserver(k=>{let[T]=k;T&&T.target===h&&v&&(v.unobserve(e),cancelAnimationFrame(O),O=requestAnimationFrame(()=>{var A;(A=v)==null||A.observe(e)})),t()}),h&&!u&&v.observe(h),v.observe(e));let b,x=u?Co(n):null;u&&w();function w(){const k=Co(n);x&&!CT(x,k)&&t(),x=k,b=requestAnimationFrame(w)}return t(),()=>{var k;p.forEach(T=>{r&&T.removeEventListener("scroll",t),s&&T.removeEventListener("resize",t)}),m?.(),(k=v)==null||k.disconnect(),v=null,u&&cancelAnimationFrame(b)}}const A7=a7,M7=l7,R7=r7,$7=u7,E7=s7,Iw=i7,_7=c7,D7=(n,e,t)=>{const i=new Map,r={platform:C7,...t},s={...r.platform,_c:i};return n7(n,e,{...r,platform:s})};var Jh=typeof document<"u"?C.useLayoutEffect:C.useEffect;function Sd(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,i,r;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(i=t;i--!==0;)if(!Sd(n[i],e[i]))return!1;return!0}if(r=Object.keys(n),t=r.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=t;i--!==0;){const s=r[i];if(!(s==="_owner"&&n.$$typeof)&&!Sd(n[s],e[s]))return!1}return!0}return n!==n&&e!==e}function TT(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ww(n,e){const t=TT(n);return Math.round(e*t)/t}function tO(n){const e=C.useRef(n);return Jh(()=>{e.current=n}),e}function j7(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:u,open:h}=n,[p,m]=C.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[O,v]=C.useState(i);Sd(O,i)||v(i);const[b,x]=C.useState(null),[w,k]=C.useState(null),T=C.useCallback(z=>{z!==_.current&&(_.current=z,x(z))},[]),A=C.useCallback(z=>{z!==D.current&&(D.current=z,k(z))},[]),$=s||b,R=a||w,_=C.useRef(null),D=C.useRef(null),j=C.useRef(p),Y=u!=null,J=tO(u),I=tO(r),W=tO(h),ae=C.useCallback(()=>{if(!_.current||!D.current)return;const z={placement:e,strategy:t,middleware:O};I.current&&(z.platform=I.current),D7(_.current,D.current,z).then(K=>{const E={...K,isPositioned:W.current!==!1};le.current&&!Sd(j.current,E)&&(j.current=E,Cy.flushSync(()=>{m(E)}))})},[O,e,t,I,W]);Jh(()=>{h===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,m(z=>({...z,isPositioned:!1})))},[h]);const le=C.useRef(!1);Jh(()=>(le.current=!0,()=>{le.current=!1}),[]),Jh(()=>{if($&&(_.current=$),R&&(D.current=R),$&&R){if(J.current)return J.current($,R,ae);ae()}},[$,R,ae,J,Y]);const ce=C.useMemo(()=>({reference:_,floating:D,setReference:T,setFloating:A}),[T,A]),Z=C.useMemo(()=>({reference:$,floating:R}),[$,R]),U=C.useMemo(()=>{const z={position:t,left:0,top:0};if(!Z.floating)return z;const K=Ww(Z.floating,p.x),E=Ww(Z.floating,p.y);return c?{...z,transform:"translate("+K+"px, "+E+"px)",...TT(Z.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:K,top:E}},[t,c,Z.floating,p.x,p.y]);return C.useMemo(()=>({...p,update:ae,refs:ce,elements:Z,floatingStyles:U}),[p,ae,ce,Z,U])}const N7=n=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:i,padding:r}=typeof n=="function"?n(t):n;return i&&e(i)?i.current!=null?Iw({element:i.current,padding:r}).fn(t):{}:i?Iw({element:i,padding:r}).fn(t):{}}}},Z7=(n,e)=>({...A7(n),options:[n,e]}),X7=(n,e)=>({...M7(n),options:[n,e]}),L7=(n,e)=>({..._7(n),options:[n,e]}),z7=(n,e)=>({...R7(n),options:[n,e]}),q7=(n,e)=>({...$7(n),options:[n,e]}),B7=(n,e)=>({...E7(n),options:[n,e]}),V7=(n,e)=>({...N7(n),options:[n,e]});var Y7="Arrow",PT=C.forwardRef((n,e)=>{const{children:t,width:i=10,height:r=5,...s}=n;return S.jsx(ze.svg,{...s,ref:e,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?t:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});PT.displayName=Y7;var U7=PT,Yy="Popper",[AT,MT]=Ni(Yy),[G7,RT]=AT(Yy),$T=n=>{const{__scopePopper:e,children:t}=n,[i,r]=C.useState(null);return S.jsx(G7,{scope:e,anchor:i,onAnchorChange:r,children:t})};$T.displayName=Yy;var ET="PopperAnchor",_T=C.forwardRef((n,e)=>{const{__scopePopper:t,virtualRef:i,...r}=n,s=RT(ET,t),a=C.useRef(null),c=Rt(e,a);return C.useEffect(()=>{s.onAnchorChange(i?.current||a.current)}),i?null:S.jsx(ze.div,{...r,ref:c})});_T.displayName=ET;var Uy="PopperContent",[I7,W7]=AT(Uy),DT=C.forwardRef((n,e)=>{const{__scopePopper:t,side:i="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:O=!1,updatePositionStrategy:v="optimized",onPlaced:b,...x}=n,w=RT(Uy,t),[k,T]=C.useState(null),A=Rt(e,de=>T(de)),[$,R]=C.useState(null),_=SC($),D=_?.width??0,j=_?.height??0,Y=i+(s!=="center"?"-"+s:""),J=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},I=Array.isArray(h)?h:[h],W=I.length>0,ae={padding:J,boundary:I.filter(F7),altBoundary:W},{refs:le,floatingStyles:ce,placement:Z,isPositioned:U,middlewareData:z}=j7({strategy:"fixed",placement:Y,whileElementsMounted:(...de)=>P7(...de,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[Z7({mainAxis:r+j,alignmentAxis:a}),u&&X7({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?L7():void 0,...ae}),u&&z7({...ae}),q7({...ae,apply:({elements:de,rects:ke,availableWidth:Ue,availableHeight:We})=>{const{width:Le,height:me}=ke.reference,je=de.floating.style;je.setProperty("--radix-popper-available-width",`${Ue}px`),je.setProperty("--radix-popper-available-height",`${We}px`),je.setProperty("--radix-popper-anchor-width",`${Le}px`),je.setProperty("--radix-popper-anchor-height",`${me}px`)}}),$&&V7({element:$,padding:c}),K7({arrowWidth:D,arrowHeight:j}),O&&B7({strategy:"referenceHidden",...ae})]}),[K,E]=ZT(Z),q=Kr(b);Fr(()=>{U&&q?.()},[U,q]);const te=z.arrow?.x,F=z.arrow?.y,oe=z.arrow?.centerOffset!==0,[xe,ue]=C.useState();return Fr(()=>{k&&ue(window.getComputedStyle(k).zIndex)},[k]),S.jsx("div",{ref:le.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:U?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:S.jsx(I7,{scope:t,placedSide:K,onArrowChange:R,arrowX:te,arrowY:F,shouldHideArrow:oe,children:S.jsx(ze.div,{"data-side":K,"data-align":E,...x,ref:A,style:{...x.style,animation:U?void 0:"none"}})})})});DT.displayName=Uy;var jT="PopperArrow",H7={top:"bottom",right:"left",bottom:"top",left:"right"},NT=C.forwardRef(function(e,t){const{__scopePopper:i,...r}=e,s=W7(jT,i),a=H7[s.placedSide];return S.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:S.jsx(U7,{...r,ref:t,style:{...r.style,display:"block"}})})});NT.displayName=jT;function F7(n){return n!==null}var K7=n=>({name:"transformOrigin",options:n,fn(e){const{placement:t,rects:i,middlewareData:r}=e,a=r.arrow?.centerOffset!==0,c=a?0:n.arrowWidth,u=a?0:n.arrowHeight,[h,p]=ZT(t),m={start:"0%",center:"50%",end:"100%"}[p],O=(r.arrow?.x??0)+c/2,v=(r.arrow?.y??0)+u/2;let b="",x="";return h==="bottom"?(b=a?m:`${O}px`,x=`${-u}px`):h==="top"?(b=a?m:`${O}px`,x=`${i.floating.height+u}px`):h==="right"?(b=`${-u}px`,x=a?m:`${v}px`):h==="left"&&(b=`${i.floating.width+u}px`,x=a?m:`${v}px`),{data:{x:b,y:x}}}});function ZT(n){const[e,t="center"]=n.split("-");return[e,t]}var J7=$T,eZ=_T,tZ=DT,nZ=NT,nO="rovingFocusGroup.onEntryFocus",iZ={bubbles:!1,cancelable:!0},Du="RovingFocusGroup",[c0,XT,rZ]=Ny(Du),[sZ,Sl]=Ni(Du,[rZ]),[oZ,aZ]=sZ(Du),LT=C.forwardRef((n,e)=>S.jsx(c0.Provider,{scope:n.__scopeRovingFocusGroup,children:S.jsx(c0.Slot,{scope:n.__scopeRovingFocusGroup,children:S.jsx(lZ,{...n,ref:e})})}));LT.displayName=Du;var lZ=C.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:i,loop:r=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...m}=n,O=C.useRef(null),v=Rt(e,O),b=Eu(s),[x,w]=Zi({prop:a,defaultProp:c??null,onChange:u,caller:Du}),[k,T]=C.useState(!1),A=Kr(h),$=XT(t),R=C.useRef(!1),[_,D]=C.useState(0);return C.useEffect(()=>{const j=O.current;if(j)return j.addEventListener(nO,A),()=>j.removeEventListener(nO,A)},[A]),S.jsx(oZ,{scope:t,orientation:i,dir:b,loop:r,currentTabStopId:x,onItemFocus:C.useCallback(j=>w(j),[w]),onItemShiftTab:C.useCallback(()=>T(!0),[]),onFocusableItemAdd:C.useCallback(()=>D(j=>j+1),[]),onFocusableItemRemove:C.useCallback(()=>D(j=>j-1),[]),children:S.jsx(ze.div,{tabIndex:k||_===0?-1:0,"data-orientation":i,...m,ref:v,style:{outline:"none",...n.style},onMouseDown:Ae(n.onMouseDown,()=>{R.current=!0}),onFocus:Ae(n.onFocus,j=>{const Y=!R.current;if(j.target===j.currentTarget&&Y&&!k){const J=new CustomEvent(nO,iZ);if(j.currentTarget.dispatchEvent(J),!J.defaultPrevented){const I=$().filter(Z=>Z.focusable),W=I.find(Z=>Z.active),ae=I.find(Z=>Z.id===x),ce=[W,ae,...I].filter(Boolean).map(Z=>Z.ref.current);BT(ce,p)}}R.current=!1}),onBlur:Ae(n.onBlur,()=>T(!1))})})}),zT="RovingFocusGroupItem",qT=C.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:i=!0,active:r=!1,tabStopId:s,children:a,...c}=n,u=Ir(),h=s||u,p=aZ(zT,t),m=p.currentTabStopId===h,O=XT(t),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:x}=p;return C.useEffect(()=>{if(i)return v(),()=>b()},[i,v,b]),S.jsx(c0.ItemSlot,{scope:t,id:h,focusable:i,active:r,children:S.jsx(ze.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...c,ref:e,onMouseDown:Ae(n.onMouseDown,w=>{i?p.onItemFocus(h):w.preventDefault()}),onFocus:Ae(n.onFocus,()=>p.onItemFocus(h)),onKeyDown:Ae(n.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){p.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const k=fZ(w,p.orientation,p.dir);if(k!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let A=O().filter($=>$.focusable).map($=>$.ref.current);if(k==="last")A.reverse();else if(k==="prev"||k==="next"){k==="prev"&&A.reverse();const $=A.indexOf(w.currentTarget);A=p.loop?hZ(A,$+1):A.slice($+1)}setTimeout(()=>BT(A))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:x!=null}):a})})});qT.displayName=zT;var cZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uZ(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function fZ(n,e,t){const i=uZ(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return cZ[i]}function BT(n,e=!1){const t=document.activeElement;for(const i of n)if(i===t||(i.focus({preventScroll:e}),document.activeElement!==t))return}function hZ(n,e){return n.map((t,i)=>n[(e+i)%n.length])}var Gy=LT,Iy=qT,u0=["Enter"," "],dZ=["ArrowDown","PageUp","Home"],VT=["ArrowUp","PageDown","End"],pZ=[...dZ,...VT],mZ={ltr:[...u0,"ArrowRight"],rtl:[...u0,"ArrowLeft"]},gZ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ju="Menu",[ru,OZ,yZ]=Ny(ju),[Zo,YT]=Ni(ju,[yZ,MT,Sl]),hp=MT(),UT=Sl(),[vZ,Xo]=Zo(ju),[bZ,Nu]=Zo(ju),GT=n=>{const{__scopeMenu:e,open:t=!1,children:i,dir:r,onOpenChange:s,modal:a=!0}=n,c=hp(e),[u,h]=C.useState(null),p=C.useRef(!1),m=Kr(s),O=Eu(r);return C.useEffect(()=>{const v=()=>{p.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>p.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),S.jsx(J7,{...c,children:S.jsx(vZ,{scope:e,open:t,onOpenChange:m,content:u,onContentChange:h,children:S.jsx(bZ,{scope:e,onClose:C.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:p,dir:O,modal:a,children:i})})})};GT.displayName=ju;var xZ="MenuAnchor",Wy=C.forwardRef((n,e)=>{const{__scopeMenu:t,...i}=n,r=hp(t);return S.jsx(eZ,{...r,...i,ref:e})});Wy.displayName=xZ;var Hy="MenuPortal",[SZ,IT]=Zo(Hy,{forceMount:void 0}),WT=n=>{const{__scopeMenu:e,forceMount:t,children:i,container:r}=n,s=Xo(Hy,e);return S.jsx(SZ,{scope:e,forceMount:t,children:S.jsx(yr,{present:t||s.open,children:S.jsx($y,{asChild:!0,container:r,children:i})})})};WT.displayName=Hy;var yi="MenuContent",[wZ,Fy]=Zo(yi),HT=C.forwardRef((n,e)=>{const t=IT(yi,n.__scopeMenu),{forceMount:i=t.forceMount,...r}=n,s=Xo(yi,n.__scopeMenu),a=Nu(yi,n.__scopeMenu);return S.jsx(ru.Provider,{scope:n.__scopeMenu,children:S.jsx(yr,{present:i||s.open,children:S.jsx(ru.Slot,{scope:n.__scopeMenu,children:a.modal?S.jsx(kZ,{...r,ref:e}):S.jsx(QZ,{...r,ref:e})})})})}),kZ=C.forwardRef((n,e)=>{const t=Xo(yi,n.__scopeMenu),i=C.useRef(null),r=Rt(e,i);return C.useEffect(()=>{const s=i.current;if(s)return nT(s)},[]),S.jsx(Ky,{...n,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:Ae(n.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),QZ=C.forwardRef((n,e)=>{const t=Xo(yi,n.__scopeMenu);return S.jsx(Ky,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),CZ=el("MenuContent.ScrollLock"),Ky=C.forwardRef((n,e)=>{const{__scopeMenu:t,loop:i=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:O,onDismiss:v,disableOutsideScroll:b,...x}=n,w=Xo(yi,t),k=Nu(yi,t),T=hp(t),A=UT(t),$=OZ(t),[R,_]=C.useState(null),D=C.useRef(null),j=Rt(e,D,w.onContentChange),Y=C.useRef(0),J=C.useRef(""),I=C.useRef(0),W=C.useRef(null),ae=C.useRef("right"),le=C.useRef(0),ce=b?Ey:C.Fragment,Z=b?{as:CZ,allowPinchZoom:!0}:void 0,U=K=>{const E=J.current+K,q=$().filter(de=>!de.disabled),te=document.activeElement,F=q.find(de=>de.ref.current===te)?.textValue,oe=q.map(de=>de.textValue),xe=ZZ(oe,E,F),ue=q.find(de=>de.textValue===xe)?.ref.current;(function de(ke){J.current=ke,window.clearTimeout(Y.current),ke!==""&&(Y.current=window.setTimeout(()=>de(""),1e3))})(E),ue&&setTimeout(()=>ue.focus())};C.useEffect(()=>()=>window.clearTimeout(Y.current),[]),GC();const z=C.useCallback(K=>ae.current===W.current?.side&&LZ(K,W.current?.area),[]);return S.jsx(wZ,{scope:t,searchRef:J,onItemEnter:C.useCallback(K=>{z(K)&&K.preventDefault()},[z]),onItemLeave:C.useCallback(K=>{z(K)||(D.current?.focus(),_(null))},[z]),onTriggerLeave:C.useCallback(K=>{z(K)&&K.preventDefault()},[z]),pointerGraceTimerRef:I,onPointerGraceIntentChange:C.useCallback(K=>{W.current=K},[]),children:S.jsx(ce,{...Z,children:S.jsx(Ry,{asChild:!0,trapped:r,onMountAutoFocus:Ae(s,K=>{K.preventDefault(),D.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:S.jsx(My,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:O,onDismiss:v,children:S.jsx(Gy,{asChild:!0,...A,dir:k.dir,orientation:"vertical",loop:i,currentTabStopId:R,onCurrentTabStopIdChange:_,onEntryFocus:Ae(u,K=>{k.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:S.jsx(tZ,{role:"menu","aria-orientation":"vertical","data-state":hP(w.open),"data-radix-menu-content":"",dir:k.dir,...T,...x,ref:j,style:{outline:"none",...x.style},onKeyDown:Ae(x.onKeyDown,K=>{const q=K.target.closest("[data-radix-menu-content]")===K.currentTarget,te=K.ctrlKey||K.altKey||K.metaKey,F=K.key.length===1;q&&(K.key==="Tab"&&K.preventDefault(),!te&&F&&U(K.key));const oe=D.current;if(K.target!==oe||!pZ.includes(K.key))return;K.preventDefault();const ue=$().filter(de=>!de.disabled).map(de=>de.ref.current);VT.includes(K.key)&&ue.reverse(),jZ(ue)}),onBlur:Ae(n.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(Y.current),J.current="")}),onPointerMove:Ae(n.onPointerMove,su(K=>{const E=K.target,q=le.current!==K.clientX;if(K.currentTarget.contains(E)&&q){const te=K.clientX>le.current?"right":"left";ae.current=te,le.current=K.clientX}}))})})})})})})});HT.displayName=yi;var TZ="MenuGroup",Jy=C.forwardRef((n,e)=>{const{__scopeMenu:t,...i}=n;return S.jsx(ze.div,{role:"group",...i,ref:e})});Jy.displayName=TZ;var PZ="MenuLabel",FT=C.forwardRef((n,e)=>{const{__scopeMenu:t,...i}=n;return S.jsx(ze.div,{...i,ref:e})});FT.displayName=PZ;var wd="MenuItem",Hw="menu.itemSelect",dp=C.forwardRef((n,e)=>{const{disabled:t=!1,onSelect:i,...r}=n,s=C.useRef(null),a=Nu(wd,n.__scopeMenu),c=Fy(wd,n.__scopeMenu),u=Rt(e,s),h=C.useRef(!1),p=()=>{const m=s.current;if(!t&&m){const O=new CustomEvent(Hw,{bubbles:!0,cancelable:!0});m.addEventListener(Hw,v=>i?.(v),{once:!0}),kC(m,O),O.defaultPrevented?h.current=!1:a.onClose()}};return S.jsx(KT,{...r,ref:u,disabled:t,onClick:Ae(n.onClick,p),onPointerDown:m=>{n.onPointerDown?.(m),h.current=!0},onPointerUp:Ae(n.onPointerUp,m=>{h.current||m.currentTarget?.click()}),onKeyDown:Ae(n.onKeyDown,m=>{const O=c.searchRef.current!=="";t||O&&m.key===" "||u0.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});dp.displayName=wd;var KT=C.forwardRef((n,e)=>{const{__scopeMenu:t,disabled:i=!1,textValue:r,...s}=n,a=Fy(wd,t),c=UT(t),u=C.useRef(null),h=Rt(e,u),[p,m]=C.useState(!1),[O,v]=C.useState("");return C.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[s.children]),S.jsx(ru.ItemSlot,{scope:t,disabled:i,textValue:r??O,children:S.jsx(Iy,{asChild:!0,...c,focusable:!i,children:S.jsx(ze.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...s,ref:h,onPointerMove:Ae(n.onPointerMove,su(b=>{i?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(n.onPointerLeave,su(b=>a.onItemLeave(b))),onFocus:Ae(n.onFocus,()=>m(!0)),onBlur:Ae(n.onBlur,()=>m(!1))})})})}),AZ="MenuCheckboxItem",JT=C.forwardRef((n,e)=>{const{checked:t=!1,onCheckedChange:i,...r}=n;return S.jsx(rP,{scope:n.__scopeMenu,checked:t,children:S.jsx(dp,{role:"menuitemcheckbox","aria-checked":kd(t)?"mixed":t,...r,ref:e,"data-state":tv(t),onSelect:Ae(r.onSelect,()=>i?.(kd(t)?!0:!t),{checkForDefaultPrevented:!1})})})});JT.displayName=AZ;var eP="MenuRadioGroup",[MZ,RZ]=Zo(eP,{value:void 0,onValueChange:()=>{}}),tP=C.forwardRef((n,e)=>{const{value:t,onValueChange:i,...r}=n,s=Kr(i);return S.jsx(MZ,{scope:n.__scopeMenu,value:t,onValueChange:s,children:S.jsx(Jy,{...r,ref:e})})});tP.displayName=eP;var nP="MenuRadioItem",iP=C.forwardRef((n,e)=>{const{value:t,...i}=n,r=RZ(nP,n.__scopeMenu),s=t===r.value;return S.jsx(rP,{scope:n.__scopeMenu,checked:s,children:S.jsx(dp,{role:"menuitemradio","aria-checked":s,...i,ref:e,"data-state":tv(s),onSelect:Ae(i.onSelect,()=>r.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});iP.displayName=nP;var ev="MenuItemIndicator",[rP,$Z]=Zo(ev,{checked:!1}),sP=C.forwardRef((n,e)=>{const{__scopeMenu:t,forceMount:i,...r}=n,s=$Z(ev,t);return S.jsx(yr,{present:i||kd(s.checked)||s.checked===!0,children:S.jsx(ze.span,{...r,ref:e,"data-state":tv(s.checked)})})});sP.displayName=ev;var EZ="MenuSeparator",oP=C.forwardRef((n,e)=>{const{__scopeMenu:t,...i}=n;return S.jsx(ze.div,{role:"separator","aria-orientation":"horizontal",...i,ref:e})});oP.displayName=EZ;var _Z="MenuArrow",aP=C.forwardRef((n,e)=>{const{__scopeMenu:t,...i}=n,r=hp(t);return S.jsx(nZ,{...r,...i,ref:e})});aP.displayName=_Z;var DZ="MenuSub",[XW,lP]=Zo(DZ),Dc="MenuSubTrigger",cP=C.forwardRef((n,e)=>{const t=Xo(Dc,n.__scopeMenu),i=Nu(Dc,n.__scopeMenu),r=lP(Dc,n.__scopeMenu),s=Fy(Dc,n.__scopeMenu),a=C.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,h={__scopeMenu:n.__scopeMenu},p=C.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return C.useEffect(()=>p,[p]),C.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]),S.jsx(Wy,{asChild:!0,...h,children:S.jsx(KT,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":hP(t.open),...n,ref:sp(e,r.onTriggerChange),onClick:m=>{n.onClick?.(m),!(n.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:Ae(n.onPointerMove,su(m=>{s.onItemEnter(m),!m.defaultPrevented&&!n.disabled&&!t.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{t.onOpenChange(!0),p()},100))})),onPointerLeave:Ae(n.onPointerLeave,su(m=>{p();const O=t.content?.getBoundingClientRect();if(O){const v=t.content?.dataset.side,b=v==="right",x=b?-5:5,w=O[b?"left":"right"],k=O[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:w,y:O.top},{x:k,y:O.top},{x:k,y:O.bottom},{x:w,y:O.bottom}],side:v}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(m),m.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(n.onKeyDown,m=>{const O=s.searchRef.current!=="";n.disabled||O&&m.key===" "||mZ[i.dir].includes(m.key)&&(t.onOpenChange(!0),t.content?.focus(),m.preventDefault())})})})});cP.displayName=Dc;var uP="MenuSubContent",fP=C.forwardRef((n,e)=>{const t=IT(yi,n.__scopeMenu),{forceMount:i=t.forceMount,...r}=n,s=Xo(yi,n.__scopeMenu),a=Nu(yi,n.__scopeMenu),c=lP(uP,n.__scopeMenu),u=C.useRef(null),h=Rt(e,u);return S.jsx(ru.Provider,{scope:n.__scopeMenu,children:S.jsx(yr,{present:i||s.open,children:S.jsx(ru.Slot,{scope:n.__scopeMenu,children:S.jsx(Ky,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:h,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{a.isUsingKeyboardRef.current&&u.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Ae(n.onFocusOutside,p=>{p.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ae(n.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:Ae(n.onKeyDown,p=>{const m=p.currentTarget.contains(p.target),O=gZ[a.dir].includes(p.key);m&&O&&(s.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});fP.displayName=uP;function hP(n){return n?"open":"closed"}function kd(n){return n==="indeterminate"}function tv(n){return kd(n)?"indeterminate":n?"checked":"unchecked"}function jZ(n){const e=document.activeElement;for(const t of n)if(t===e||(t.focus(),document.activeElement!==e))return}function NZ(n,e){return n.map((t,i)=>n[(e+i)%n.length])}function ZZ(n,e,t){const r=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let a=NZ(n,Math.max(s,0));r.length===1&&(a=a.filter(h=>h!==t));const u=a.find(h=>h.toLowerCase().startsWith(r.toLowerCase()));return u!==t?u:void 0}function XZ(n,e){const{x:t,y:i}=n;let r=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const c=e[s],u=e[a],h=c.x,p=c.y,m=u.x,O=u.y;p>i!=O>i&&t<(m-h)*(i-p)/(O-p)+h&&(r=!r)}return r}function LZ(n,e){if(!e)return!1;const t={x:n.clientX,y:n.clientY};return XZ(t,e)}function su(n){return e=>e.pointerType==="mouse"?n(e):void 0}var zZ=GT,qZ=Wy,BZ=WT,VZ=HT,YZ=Jy,UZ=FT,GZ=dp,IZ=JT,WZ=tP,HZ=iP,FZ=sP,KZ=oP,JZ=aP,e6=cP,t6=fP,pp="DropdownMenu",[n6,LW]=Ni(pp,[YT]),xn=YT(),[i6,dP]=n6(pp),pP=n=>{const{__scopeDropdownMenu:e,children:t,dir:i,open:r,defaultOpen:s,onOpenChange:a,modal:c=!0}=n,u=xn(e),h=C.useRef(null),[p,m]=Zi({prop:r,defaultProp:s??!1,onChange:a,caller:pp});return S.jsx(i6,{scope:e,triggerId:Ir(),triggerRef:h,contentId:Ir(),open:p,onOpenChange:m,onOpenToggle:C.useCallback(()=>m(O=>!O),[m]),modal:c,children:S.jsx(zZ,{...u,open:p,onOpenChange:m,dir:i,modal:c,children:t})})};pP.displayName=pp;var mP="DropdownMenuTrigger",gP=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,disabled:i=!1,...r}=n,s=dP(mP,t),a=xn(t);return S.jsx(qZ,{asChild:!0,...a,children:S.jsx(ze.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...r,ref:sp(e,s.triggerRef),onPointerDown:Ae(n.onPointerDown,c=>{!i&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:Ae(n.onKeyDown,c=>{i||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});gP.displayName=mP;var r6="DropdownMenuPortal",OP=n=>{const{__scopeDropdownMenu:e,...t}=n,i=xn(e);return S.jsx(BZ,{...i,...t})};OP.displayName=r6;var yP="DropdownMenuContent",vP=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=dP(yP,t),s=xn(t),a=C.useRef(!1);return S.jsx(VZ,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...i,ref:e,onCloseAutoFocus:Ae(n.onCloseAutoFocus,c=>{a.current||r.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:Ae(n.onInteractOutside,c=>{const u=c.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,p=u.button===2||h;(!r.modal||p)&&(a.current=!0)}),style:{...n.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)"}})});vP.displayName=yP;var s6="DropdownMenuGroup",o6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(YZ,{...r,...i,ref:e})});o6.displayName=s6;var a6="DropdownMenuLabel",l6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(UZ,{...r,...i,ref:e})});l6.displayName=a6;var c6="DropdownMenuItem",bP=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(GZ,{...r,...i,ref:e})});bP.displayName=c6;var u6="DropdownMenuCheckboxItem",f6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(IZ,{...r,...i,ref:e})});f6.displayName=u6;var h6="DropdownMenuRadioGroup",d6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(WZ,{...r,...i,ref:e})});d6.displayName=h6;var p6="DropdownMenuRadioItem",m6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(HZ,{...r,...i,ref:e})});m6.displayName=p6;var g6="DropdownMenuItemIndicator",O6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(FZ,{...r,...i,ref:e})});O6.displayName=g6;var y6="DropdownMenuSeparator",v6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(KZ,{...r,...i,ref:e})});v6.displayName=y6;var b6="DropdownMenuArrow",x6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(JZ,{...r,...i,ref:e})});x6.displayName=b6;var S6="DropdownMenuSubTrigger",w6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(e6,{...r,...i,ref:e})});w6.displayName=S6;var k6="DropdownMenuSubContent",Q6=C.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...i}=n,r=xn(t);return S.jsx(t6,{...r,...i,ref:e,style:{...n.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)"}})});Q6.displayName=k6;var C6=pP,T6=gP,P6=OP,A6=vP,M6=bP;function R6({...n}){return S.jsx(C6,{"data-slot":"dropdown-menu",...n})}function $6({...n}){return S.jsx(T6,{"data-slot":"dropdown-menu-trigger",...n})}function E6({className:n,sideOffset:e=4,...t}){return S.jsx(P6,{children:S.jsx(A6,{"data-slot":"dropdown-menu-content",sideOffset:e,className:Ie("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),...t})})}function _6({className:n,inset:e,variant:t="default",...i}){return S.jsx(M6,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":t,className:Ie("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...i})}function D6({option:n,value:e,onChange:t,disabled:i=!1}){const r=n.options.find(s=>s.value===e);return S.jsxs("div",{className:"space-y-2",children:[S.jsx(Ji,{className:"text-sm font-medium text-gray-300",children:n.label}),n.description&&S.jsx("p",{className:"text-xs text-gray-500",children:n.description}),S.jsxs(R6,{children:[S.jsx($6,{asChild:!0,children:S.jsxs(Oi,{variant:"outline",className:"w-full justify-between",disabled:i,children:[S.jsx("span",{children:r?.label||"Select option..."}),S.jsx(yC,{className:"h-4 w-4"})]})}),S.jsx(E6,{className:"w-full min-w-[200px]",children:n.options.map(s=>S.jsx(_6,{onClick:()=>t(s.value),className:e===s.value?"bg-accent":"",children:s.label},s.value))})]})]})}function j6({addOn:n,selectedOptions:e,onOptionChange:t,disabled:i=!1}){return!n.options||Object.keys(n.options).length===0?null:S.jsx("div",{className:"space-y-3",children:Object.entries(n.options).map(([r,s])=>s&&typeof s=="object"&&"type"in s&&s.type==="select"?S.jsx(D6,{option:s,value:e[r]||s.default,onChange:a=>t(r,a),disabled:i},r):null)})}function N6({addOn:n,selectedOptions:e,onOptionChange:t,onClose:i,disabled:r=!1}){return n?S.jsx(jo,{open:!!n,onOpenChange:s=>!s&&i(),children:S.jsxs(No,{className:"sm:max-w-md",children:[S.jsxs(yl,{children:[S.jsxs(vl,{children:["Configure ",n.name]}),S.jsx(VN,{children:"Customize the configuration options for this add-on."})]}),S.jsx("div",{className:"py-4",children:S.jsx(j6,{addOn:n,selectedOptions:e,onOptionChange:t,disabled:r})})]})}):null}const Fw={toolchain:"Toolchain","add-on":"Add-on",host:"Hosting Provider",example:"Example"};function Z6(){const{availableAddOns:n,addOnState:e,toggleAddOn:t,setAddOnOption:i}=Au(),r=dn(p=>p.addOnOptions),s=C.useMemo(()=>n.sort((p,m)=>{const O=p.priority??0,v=m.priority??0;return v!==O?v-O:p.name.localeCompare(m.name)}),[n]),[a,c]=C.useState(),[u,h]=C.useState();return S.jsxs(S.Fragment,{children:[S.jsx(UN,{addOn:a,onClose:()=>c(void 0)}),S.jsx(N6,{addOn:u,selectedOptions:u?r[u.id]||{}:{},onOptionChange:(p,m)=>{u&&i(u.id,p,m)},onClose:()=>h(void 0),disabled:u?!e[u.id]?.enabled:!1}),S.jsx("div",{className:"max-h-[60vh] overflow-y-auto space-y-2",children:Object.keys(Fw).map(p=>S.jsx(C.Fragment,{children:s.filter(m=>m.type===p).length>0&&S.jsxs("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active",children:[S.jsx("h3",{className:"font-medium",children:Fw[p]}),S.jsx("div",{className:"space-y-3",children:S.jsx("div",{className:"flex flex-row flex-wrap",children:s.filter(m=>m.type===p).map(m=>S.jsx("div",{className:"w-1/2",children:S.jsxs("div",{className:"flex flex-row items-center justify-between",children:[S.jsxs("div",{className:"p-1 flex flex-row items-center",children:[S.jsx(Ur,{id:m.id,checked:e[m.id].selected,disabled:!e[m.id].enabled,onCheckedChange:()=>{t(m.id)}}),S.jsxs(Ji,{htmlFor:m.id,className:"pl-2 font-semibold text-gray-300 flex items-center gap-2",children:[m.smallLogo&&S.jsx("img",{src:`data:image/svg+xml,${encodeURIComponent(m.smallLogo)}`,alt:m.name,className:"w-5"}),m.name]})]}),S.jsxs("div",{className:"flex items-center gap-1",children:[e[m.id].selected&&m.options&&Object.keys(m.options).length>0&&S.jsx(Oi,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-gray-600 hover:text-gray-400",onClick:()=>h(m),disabled:!e[m.id].enabled,children:S.jsx(_D,{className:"w-4 h-4"})}),S.jsx(xC,{className:"w-4 text-gray-600 cursor-pointer hover:text-gray-400",onClick:()=>c(m)})]})]})},m.id))})})]},`${p}-add-ons`)},p))}),S.jsx("div",{className:"mt-4",children:S.jsx(YN,{})})]})}const X6={file:jD,command:ZD,"package-manager":$D,info:xC,other:MD};function xP(){const[n,e]=C.useState([]),[t,i]=C.useState(!1),r=C.useCallback(async s=>{i(!1);const a=s.body?.getReader(),c=new TextDecoder;let u="";for(;;){const h=await a?.read();if(h?.done)break;u+=c.decode(h?.value);let p;const m=[];for(const O of u.split(`
199
199
  `))if(O.startsWith("{")&&O.endsWith("}")){const v=JSON.parse(O);v.msgType==="start"?p===v.id?m[m.length-1].message=v.message:(p=v.id,m.push({id:p,icon:X6[v.type],message:v.message})):(m.length>0&&(m[m.length-1].message=v.message),p=void 0)}e(m)}return i(!0),u},[]);return{finished:t,streamItems:n,monitorStream:r}}function SP({streamItems:n,finished:e}){return S.jsx("div",{className:"flex flex-col gap-2",children:n.map((t,i)=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(t.icon,{className:`w-4 h-4 ${i===n.length-1&&!e?"text-green-500 animate-spin":""}`}),t.message]},t.id))})}function L6(){const{chosenAddOns:n}=Au(),[e,t]=C.useState(!1),{streamItems:i,monitorStream:r,finished:s}=xP();if(Or()!=="add")return null;async function c(){t(!0),r(await z_(n))}return S.jsxs("div",{children:[S.jsx(jo,{open:e,children:S.jsxs(No,{className:"sm:min-w-[425px] sm:max-w-fit",hideCloseButton:!0,children:[S.jsx(yl,{children:S.jsx(vl,{children:"Adding Add-Ons"})}),S.jsx(SP,{streamItems:i,finished:s}),S.jsx($u,{children:S.jsx(Oi,{variant:"default",onClick:async()=>{await hC(),window.close()},disabled:!s,children:"Exit This Application"})})]})}),S.jsx("div",{className:"flex flex-col gap-2",children:S.jsx(Oi,{variant:"default",onClick:c,disabled:n.length===0||e,className:"w-full",children:"Add These Add-Ons To Your App"})})]})}function z6(){const[n,e]=C.useState(!1),{streamItems:t,monitorStream:i,finished:r}=xP(),s=Or(),a=dn(),{chosenAddOns:c}=Au(),{projectStarter:u}=ml();if(s!=="setup")return null;async function h(){e(!0),i(await L_(a,c,u))}return S.jsxs("div",{children:[S.jsx(jo,{open:n,children:S.jsxs(No,{className:"sm:min-w-[425px] sm:max-w-fit",hideCloseButton:!0,children:[S.jsx(yl,{children:S.jsx(vl,{children:"Creating Your Application"})}),S.jsx(SP,{streamItems:t,finished:r}),S.jsx($u,{children:S.jsx(Oi,{variant:"default",onClick:async()=>{await hC(),window.close()},disabled:!r,children:"Exit This Application"})})]})}),S.jsx("div",{className:"flex flex-col gap-2",children:S.jsxs(Oi,{variant:"default",onClick:h,disabled:n,className:"w-full",children:[S.jsx(TD,{className:"w-4 h-4"}),"Build Your App"]})})]})}function nv({children:n}){return S.jsx("div",{className:"block p-4 bg-gray-500/10 hover:bg-gray-500/20 rounded-lg transition-colors space-y-4 active @container sidebar-container",children:n})}function q6(){const n=rD();return Or()!=="setup"?null:S.jsx(nv,{children:S.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[S.jsx("h3",{className:"font-medium whitespace-nowrap",children:"Project Name"}),S.jsx(Ay,{value:n,placeholder:"my-app",onChange:t=>aD(t.target.value),className:"w-full bg-gray-500/10 rounded-md px-2 py-1 min-w-[200px] text-sm"})]})})}var wP="Toggle",kP=C.forwardRef((n,e)=>{const{pressed:t,defaultPressed:i,onPressedChange:r,...s}=n,[a,c]=Zi({prop:t,onChange:r,defaultProp:i??!1,caller:wP});return S.jsx(ze.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":n.disabled?"":void 0,...s,ref:e,onClick:Ae(n.onClick,()=>{n.disabled||c(!a)})})});kP.displayName=wP;var Ys="ToggleGroup",[QP,zW]=Ni(Ys,[Sl]),CP=Sl(),iv=ee.forwardRef((n,e)=>{const{type:t,...i}=n;if(t==="single"){const r=i;return S.jsx(B6,{...r,ref:e})}if(t==="multiple"){const r=i;return S.jsx(V6,{...r,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Ys}\``)});iv.displayName=Ys;var[TP,PP]=QP(Ys),B6=ee.forwardRef((n,e)=>{const{value:t,defaultValue:i,onValueChange:r=()=>{},...s}=n,[a,c]=Zi({prop:t,defaultProp:i??"",onChange:r,caller:Ys});return S.jsx(TP,{scope:n.__scopeToggleGroup,type:"single",value:ee.useMemo(()=>a?[a]:[],[a]),onItemActivate:c,onItemDeactivate:ee.useCallback(()=>c(""),[c]),children:S.jsx(AP,{...s,ref:e})})}),V6=ee.forwardRef((n,e)=>{const{value:t,defaultValue:i,onValueChange:r=()=>{},...s}=n,[a,c]=Zi({prop:t,defaultProp:i??[],onChange:r,caller:Ys}),u=ee.useCallback(p=>c((m=[])=>[...m,p]),[c]),h=ee.useCallback(p=>c((m=[])=>m.filter(O=>O!==p)),[c]);return S.jsx(TP,{scope:n.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:u,onItemDeactivate:h,children:S.jsx(AP,{...s,ref:e})})});iv.displayName=Ys;var[Y6,U6]=QP(Ys),AP=ee.forwardRef((n,e)=>{const{__scopeToggleGroup:t,disabled:i=!1,rovingFocus:r=!0,orientation:s,dir:a,loop:c=!0,...u}=n,h=CP(t),p=Eu(a),m={role:"group",dir:p,...u};return S.jsx(Y6,{scope:t,rovingFocus:r,disabled:i,children:r?S.jsx(Gy,{asChild:!0,...h,orientation:s,dir:p,loop:c,children:S.jsx(ze.div,{...m,ref:e})}):S.jsx(ze.div,{...m,ref:e})})}),Qd="ToggleGroupItem",MP=ee.forwardRef((n,e)=>{const t=PP(Qd,n.__scopeToggleGroup),i=U6(Qd,n.__scopeToggleGroup),r=CP(n.__scopeToggleGroup),s=t.value.includes(n.value),a=i.disabled||n.disabled,c={...n,pressed:s,disabled:a},u=ee.useRef(null);return i.rovingFocus?S.jsx(Iy,{asChild:!0,...r,focusable:!a,active:s,ref:u,children:S.jsx(Kw,{...c,ref:e})}):S.jsx(Kw,{...c,ref:e})});MP.displayName=Qd;var Kw=ee.forwardRef((n,e)=>{const{__scopeToggleGroup:t,value:i,...r}=n,s=PP(Qd,t),a={role:"radio","aria-checked":n.pressed,"aria-pressed":void 0},c=s.type==="single"?a:void 0;return S.jsx(kP,{...c,...r,ref:e,onPressedChange:u=>{u?s.onItemActivate(i):s.onItemDeactivate(i)}})}),G6=iv,I6=MP;const W6=Ru("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),RP=C.createContext({size:"default",variant:"default"});function H6({className:n,variant:e,size:t,children:i,...r}){return S.jsx(G6,{"data-slot":"toggle-group","data-variant":e,"data-size":t,className:Ie("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),...r,children:S.jsx(RP.Provider,{value:{variant:e,size:t},children:i})})}function F6({className:n,children:e,variant:t,size:i,...r}){const s=C.useContext(RP);return S.jsx(I6,{"data-slot":"toggle-group-item","data-variant":s.variant||t,"data-size":s.size||i,className:Ie(W6({variant:s.variant||t,size:s.size||i}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),...r,children:e})}function K6(){const n=Or(),e=tD(),t=Mu(),i=J_();return n!=="setup"||Object.keys(i??{}).length<2?null:S.jsx(nv,{children:S.jsxs("div",{className:"flex flex-col @md:flex-row @md:items-center gap-2 items-start",children:[S.jsx("h3",{className:"font-medium whitespace-nowrap",children:"Router Mode"}),S.jsx("div",{className:"flex flex-row justify-center items-center",children:S.jsx(H6,{type:"single",value:t,onValueChange:r=>{r&&lD(r)},className:"rounded-md border-2 border-gray-500/10",children:Object.keys(i??{}).map(r=>S.jsxs(F6,{value:r,className:"px-4",disabled:!e,children:[S.jsx(xD,{className:"w-4 h-4"}),i?.[r].displayName]},r))})})]})})}function J6({className:n}){return S.jsxs("svg",{viewBox:"0 0 256 256",width:"256",height:"256",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",className:Ie("w-10 h-10",n),children:[S.jsx("path",{d:"M20 0h216c11.046 0 20 8.954 20 20v216c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20V20C0 8.954 8.954 0 20 0Z",fill:"#3178C6"}),S.jsx("path",{d:"M150.518 200.475v27.62c4.492 2.302 9.805 4.028 15.938 5.179 6.133 1.151 12.597 1.726 19.393 1.726 6.622 0 12.914-.633 18.874-1.899 5.96-1.266 11.187-3.352 15.678-6.257 4.492-2.906 8.048-6.704 10.669-11.394 2.62-4.689 3.93-10.486 3.93-17.391 0-5.006-.749-9.394-2.246-13.163a30.748 30.748 0 0 0-6.479-10.055c-2.821-2.935-6.205-5.567-10.149-7.898-3.945-2.33-8.394-4.531-13.347-6.602-3.628-1.497-6.881-2.949-9.761-4.359-2.879-1.41-5.327-2.848-7.342-4.316-2.016-1.467-3.571-3.021-4.665-4.661-1.094-1.64-1.641-3.495-1.641-5.567 0-1.899.489-3.61 1.468-5.135s2.362-2.834 4.147-3.927c1.785-1.094 3.973-1.942 6.565-2.547 2.591-.604 5.471-.906 8.638-.906 2.304 0 4.737.173 7.299.518 2.563.345 5.14.877 7.732 1.597a53.669 53.669 0 0 1 7.558 2.719 41.7 41.7 0 0 1 6.781 3.797v-25.807c-4.204-1.611-8.797-2.805-13.778-3.582-4.981-.777-10.697-1.165-17.147-1.165-6.565 0-12.784.705-18.658 2.115-5.874 1.409-11.043 3.61-15.506 6.602-4.463 2.993-7.99 6.805-10.582 11.437-2.591 4.632-3.887 10.17-3.887 16.615 0 8.228 2.375 15.248 7.127 21.06 4.751 5.811 11.963 10.731 21.638 14.759a291.458 291.458 0 0 1 10.625 4.575c3.283 1.496 6.119 3.049 8.509 4.66 2.39 1.611 4.276 3.366 5.658 5.265 1.382 1.899 2.073 4.057 2.073 6.474a9.901 9.901 0 0 1-1.296 4.963c-.863 1.524-2.174 2.848-3.93 3.97-1.756 1.122-3.945 1.999-6.565 2.632-2.62.633-5.687.95-9.2.95-5.989 0-11.92-1.05-17.794-3.151-5.875-2.1-11.317-5.25-16.327-9.451Zm-46.036-68.733H140V109H41v22.742h35.345V233h28.137V131.742Z",fill:"#FFF"})]})}function eX({className:n}){return S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 54 33",className:Ie("w-10 h-10",n),children:[S.jsx("g",{"clip-path":"url(#a)",children:S.jsx("path",{fill:"#38bdf8","fill-rule":"evenodd",d:"M27 0c-7.2 0-11.7 3.6-13.5 10.8 2.7-3.6 5.85-4.95 9.45-4.05 2.054.513 3.522 2.004 5.147 3.653C30.744 13.09 33.808 16.2 40.5 16.2c7.2 0 11.7-3.6 13.5-10.8-2.7 3.6-5.85 4.95-9.45 4.05-2.054-.513-3.522-2.004-5.147-3.653C36.756 3.11 33.692 0 27 0zM13.5 16.2C6.3 16.2 1.8 19.8 0 27c2.7-3.6 5.85-4.95 9.45-4.05 2.054.514 3.522 2.004 5.147 3.653C17.244 29.29 20.308 32.4 27 32.4c7.2 0 11.7-3.6 13.5-10.8-2.7 3.6-5.85 4.95-9.45 4.05-2.054-.513-3.522-2.004-5.147-3.653C23.256 19.31 20.192 16.2 13.5 16.2z","clip-rule":"evenodd"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"a",children:S.jsx("path",{fill:"#fff",d:"M0 0h54v32.4H0z"})})})]})}function tX(){const n=dn(s=>s.typescript),e=dn(s=>s.tailwind),t=Or(),i=iD(),r=nD();return t!=="setup"?null:S.jsx(nv,{children:S.jsxs("div",{className:"flex",children:[S.jsxs("div",{className:"w-1/2 flex flex-row items-center justify-center",children:[S.jsx(Ur,{id:"typescript-switch",checked:n,onCheckedChange:s=>cD(s),disabled:!r}),S.jsxs(Ji,{htmlFor:"typescript-switch",className:"ml-2",children:[S.jsx(J6,{className:"w-5"}),"TypeScript"]})]}),S.jsxs("div",{className:"w-1/2 flex flex-row items-center justify-center",children:[S.jsx(Ur,{id:"tailwind-switch",checked:e,onCheckedChange:s=>uD(s),disabled:!i}),S.jsxs(Ji,{htmlFor:"tailwind-switch",className:"ml-2",children:[S.jsx(eX,{className:"w-5"}),"Tailwind"]})]})]})})}function nX(n){return Object.prototype.toString.call(n)==="[object Object]"}function Jw(n){return nX(n)||Array.isArray(n)}function iX(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function rv(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;const r=JSON.stringify(Object.keys(n.breakpoints||{})),s=JSON.stringify(Object.keys(e.breakpoints||{}));return r!==s?!1:t.every(a=>{const c=n[a],u=e[a];return typeof c=="function"?`${c}`==`${u}`:!Jw(c)||!Jw(u)?c===u:rv(c,u)})}function ek(n){return n.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function rX(n,e){if(n.length!==e.length)return!1;const t=ek(n),i=ek(e);return t.every((r,s)=>{const a=i[s];return rv(r,a)})}function sv(n){return typeof n=="number"}function f0(n){return typeof n=="string"}function mp(n){return typeof n=="boolean"}function tk(n){return Object.prototype.toString.call(n)==="[object Object]"}function yt(n){return Math.abs(n)}function ov(n){return Math.sign(n)}function Uc(n,e){return yt(n-e)}function sX(n,e){if(n===0||e===0||yt(n)<=yt(e))return 0;const t=Uc(yt(n),yt(e));return yt(t/n)}function oX(n){return Math.round(n*100)/100}function ou(n){return au(n).map(Number)}function $i(n){return n[Zu(n)]}function Zu(n){return Math.max(0,n.length-1)}function av(n,e){return e===Zu(n)}function nk(n,e=0){return Array.from(Array(n),(t,i)=>e+i)}function au(n){return Object.keys(n)}function $P(n,e){return[n,e].reduce((t,i)=>(au(i).forEach(r=>{const s=t[r],a=i[r],c=tk(s)&&tk(a);t[r]=c?$P(s,a):a}),t),{})}function h0(n,e){return typeof e.MouseEvent<"u"&&n instanceof e.MouseEvent}function aX(n,e){const t={start:i,center:r,end:s};function i(){return 0}function r(u){return s(u)/2}function s(u){return e-u}function a(u,h){return f0(n)?t[n](u):n(e,u,h)}return{measure:a}}function lu(){let n=[];function e(r,s,a,c={passive:!0}){let u;if("addEventListener"in r)r.addEventListener(s,a,c),u=()=>r.removeEventListener(s,a,c);else{const h=r;h.addListener(a),u=()=>h.removeListener(a)}return n.push(u),i}function t(){n=n.filter(r=>r())}const i={add:e,clear:t};return i}function lX(n,e,t,i){const r=lu(),s=1e3/60;let a=null,c=0,u=0;function h(){r.add(n,"visibilitychange",()=>{n.hidden&&b()})}function p(){v(),r.clear()}function m(w){if(!u)return;a||(a=w,t(),t());const k=w-a;for(a=w,c+=k;c>=s;)t(),c-=s;const T=c/s;i(T),u&&(u=e.requestAnimationFrame(m))}function O(){u||(u=e.requestAnimationFrame(m))}function v(){e.cancelAnimationFrame(u),a=null,c=0,u=0}function b(){a=null,c=0}return{init:h,destroy:p,start:O,stop:v,update:t,render:i}}function cX(n,e){const t=e==="rtl",i=n==="y",r=i?"y":"x",s=i?"x":"y",a=!i&&t?-1:1,c=p(),u=m();function h(b){const{height:x,width:w}=b;return i?x:w}function p(){return i?"top":t?"right":"left"}function m(){return i?"bottom":t?"left":"right"}function O(b){return b*a}return{scroll:r,cross:s,startEdge:c,endEdge:u,measureSize:h,direction:O}}function To(n=0,e=0){const t=yt(n-e);function i(h){return h<n}function r(h){return h>e}function s(h){return i(h)||r(h)}function a(h){return s(h)?i(h)?n:e:h}function c(h){return t?h-t*Math.ceil((h-e)/t):h}return{length:t,max:e,min:n,constrain:a,reachedAny:s,reachedMax:r,reachedMin:i,removeOffset:c}}function EP(n,e,t){const{constrain:i}=To(0,n),r=n+1;let s=a(e);function a(O){return t?yt((r+O)%r):i(O)}function c(){return s}function u(O){return s=a(O),m}function h(O){return p().set(c()+O)}function p(){return EP(n,c(),t)}const m={get:c,set:u,add:h,clone:p};return m}function uX(n,e,t,i,r,s,a,c,u,h,p,m,O,v,b,x,w,k,T){const{cross:A,direction:$}=n,R=["INPUT","SELECT","TEXTAREA"],_={passive:!1},D=lu(),j=lu(),Y=To(50,225).constrain(v.measure(20)),J={mouse:300,touch:400},I={mouse:500,touch:600},W=b?43:25;let ae=!1,le=0,ce=0,Z=!1,U=!1,z=!1,K=!1;function E(me){if(!T)return;function je(Xt){(mp(T)||T(me,Xt))&&ue(Xt)}const Ke=e;D.add(Ke,"dragstart",Xt=>Xt.preventDefault(),_).add(Ke,"touchmove",()=>{},_).add(Ke,"touchend",()=>{}).add(Ke,"touchstart",je).add(Ke,"mousedown",je).add(Ke,"touchcancel",ke).add(Ke,"contextmenu",ke).add(Ke,"click",Ue,!0)}function q(){D.clear(),j.clear()}function te(){const me=K?t:e;j.add(me,"touchmove",de,_).add(me,"touchend",ke).add(me,"mousemove",de,_).add(me,"mouseup",ke)}function F(me){const je=me.nodeName||"";return R.includes(je)}function oe(){return(b?I:J)[K?"mouse":"touch"]}function xe(me,je){const Ke=m.add(ov(me)*-1),Xt=p.byDistance(me,!b).distance;return b||yt(me)<Y?Xt:w&&je?Xt*.5:p.byIndex(Ke.get(),0).distance}function ue(me){const je=h0(me,i);K=je,z=b&&je&&!me.buttons&&ae,ae=Uc(r.get(),a.get())>=2,!(je&&me.button!==0)&&(F(me.target)||(Z=!0,s.pointerDown(me),h.useFriction(0).useDuration(0),r.set(a),te(),le=s.readPoint(me),ce=s.readPoint(me,A),O.emit("pointerDown")))}function de(me){if(!h0(me,i)&&me.touches.length>=2)return ke(me);const Ke=s.readPoint(me),Xt=s.readPoint(me,A),mn=Uc(Ke,le),at=Uc(Xt,ce);if(!U&&!K&&(!me.cancelable||(U=mn>at,!U)))return ke(me);const Fn=s.pointerMove(me);mn>x&&(z=!0),h.useFriction(.3).useDuration(.75),c.start(),r.add($(Fn)),me.preventDefault()}function ke(me){const Ke=p.byDistance(0,!1).index!==m.get(),Xt=s.pointerUp(me)*oe(),mn=xe($(Xt),Ke),at=sX(Xt,mn),Fn=W-10*at,kt=k+at/50;U=!1,Z=!1,j.clear(),h.useDuration(Fn).useFriction(kt),u.distance(mn,!b),K=!1,O.emit("pointerUp")}function Ue(me){z&&(me.stopPropagation(),me.preventDefault(),z=!1)}function We(){return Z}return{init:E,destroy:q,pointerDown:We}}function fX(n,e){let i,r;function s(m){return m.timeStamp}function a(m,O){const b=`client${(O||n.scroll)==="x"?"X":"Y"}`;return(h0(m,e)?m:m.touches[0])[b]}function c(m){return i=m,r=m,a(m)}function u(m){const O=a(m)-a(r),v=s(m)-s(i)>170;return r=m,v&&(i=m),O}function h(m){if(!i||!r)return 0;const O=a(r)-a(i),v=s(m)-s(i),b=s(m)-s(r)>170,x=O/v;return v&&!b&&yt(x)>.1?x:0}return{pointerDown:c,pointerMove:u,pointerUp:h,readPoint:a}}function hX(){function n(t){const{offsetTop:i,offsetLeft:r,offsetWidth:s,offsetHeight:a}=t;return{top:i,right:r+s,bottom:i+a,left:r,width:s,height:a}}return{measure:n}}function dX(n){function e(i){return n*(i/100)}return{measure:e}}function pX(n,e,t,i,r,s,a){const c=[n].concat(i);let u,h,p=[],m=!1;function O(w){return r.measureSize(a.measure(w))}function v(w){if(!s)return;h=O(n),p=i.map(O);function k(T){for(const A of T){if(m)return;const $=A.target===n,R=i.indexOf(A.target),_=$?h:p[R],D=O($?n:i[R]);if(yt(D-_)>=.5){w.reInit(),e.emit("resize");break}}}u=new ResizeObserver(T=>{(mp(s)||s(w,T))&&k(T)}),t.requestAnimationFrame(()=>{c.forEach(T=>u.observe(T))})}function b(){m=!0,u&&u.disconnect()}return{init:v,destroy:b}}function mX(n,e,t,i,r,s){let a=0,c=0,u=r,h=s,p=n.get(),m=0;function O(){const _=i.get()-n.get(),D=!u;let j=0;return D?(a=0,t.set(i),n.set(i),j=_):(t.set(n),a+=_/u,a*=h,p+=a,n.add(a),j=p-m),c=ov(j),m=p,R}function v(){const _=i.get()-e.get();return yt(_)<.001}function b(){return u}function x(){return c}function w(){return a}function k(){return A(r)}function T(){return $(s)}function A(_){return u=_,R}function $(_){return h=_,R}const R={direction:x,duration:b,velocity:w,seek:O,settled:v,useBaseFriction:T,useBaseDuration:k,useFriction:$,useDuration:A};return R}function gX(n,e,t,i,r){const s=r.measure(10),a=r.measure(50),c=To(.1,.99);let u=!1;function h(){return!(u||!n.reachedAny(t.get())||!n.reachedAny(e.get()))}function p(v){if(!h())return;const b=n.reachedMin(e.get())?"min":"max",x=yt(n[b]-e.get()),w=t.get()-e.get(),k=c.constrain(x/a);t.subtract(w*k),!v&&yt(w)<s&&(t.set(n.constrain(t.get())),i.useDuration(25).useBaseFriction())}function m(v){u=!v}return{shouldConstrain:h,constrain:p,toggleActive:m}}function OX(n,e,t,i,r){const s=To(-e+n,0),a=m(),c=p(),u=O();function h(b,x){return Uc(b,x)<=1}function p(){const b=a[0],x=$i(a),w=a.lastIndexOf(b),k=a.indexOf(x)+1;return To(w,k)}function m(){return t.map((b,x)=>{const{min:w,max:k}=s,T=s.constrain(b),A=!x,$=av(t,x);return A?k:$||h(w,T)?w:h(k,T)?k:T}).map(b=>parseFloat(b.toFixed(3)))}function O(){if(e<=n+r)return[s.max];if(i==="keepSnaps")return a;const{min:b,max:x}=c;return a.slice(b,x)}return{snapsContained:u,scrollContainLimit:c}}function yX(n,e,t){const i=e[0],r=t?i-n:$i(e);return{limit:To(r,i)}}function vX(n,e,t,i){const s=e.min+.1,a=e.max+.1,{reachedMin:c,reachedMax:u}=To(s,a);function h(O){return O===1?u(t.get()):O===-1?c(t.get()):!1}function p(O){if(!h(O))return;const v=n*(O*-1);i.forEach(b=>b.add(v))}return{loop:p}}function bX(n){const{max:e,length:t}=n;function i(s){const a=s-e;return t?a/-t:0}return{get:i}}function xX(n,e,t,i,r){const{startEdge:s,endEdge:a}=n,{groupSlides:c}=r,u=m().map(e.measure),h=O(),p=v();function m(){return c(i).map(x=>$i(x)[a]-x[0][s]).map(yt)}function O(){return i.map(x=>t[s]-x[s]).map(x=>-yt(x))}function v(){return c(h).map(x=>x[0]).map((x,w)=>x+u[w])}return{snaps:h,snapsAligned:p}}function SX(n,e,t,i,r,s){const{groupSlides:a}=r,{min:c,max:u}=i,h=p();function p(){const O=a(s),v=!n||e==="keepSnaps";return t.length===1?[s]:v?O:O.slice(c,u).map((b,x,w)=>{const k=!x,T=av(w,x);if(k){const A=$i(w[0])+1;return nk(A)}if(T){const A=Zu(s)-$i(w)[0]+1;return nk(A,$i(w)[0])}return b})}return{slideRegistry:h}}function wX(n,e,t,i,r){const{reachedAny:s,removeOffset:a,constrain:c}=i;function u(b){return b.concat().sort((x,w)=>yt(x)-yt(w))[0]}function h(b){const x=n?a(b):c(b),w=e.map((T,A)=>({diff:p(T-x,0),index:A})).sort((T,A)=>yt(T.diff)-yt(A.diff)),{index:k}=w[0];return{index:k,distance:x}}function p(b,x){const w=[b,b+t,b-t];if(!n)return b;if(!x)return u(w);const k=w.filter(T=>ov(T)===x);return k.length?u(k):$i(w)-t}function m(b,x){const w=e[b]-r.get(),k=p(w,x);return{index:b,distance:k}}function O(b,x){const w=r.get()+b,{index:k,distance:T}=h(w),A=!n&&s(w);if(!x||A)return{index:k,distance:b};const $=e[k]-T,R=b+p($,0);return{index:k,distance:R}}return{byDistance:O,byIndex:m,shortcut:p}}function kX(n,e,t,i,r,s,a){function c(m){const O=m.distance,v=m.index!==e.get();s.add(O),O&&(i.duration()?n.start():(n.update(),n.render(1),n.update())),v&&(t.set(e.get()),e.set(m.index),a.emit("select"))}function u(m,O){const v=r.byDistance(m,O);c(v)}function h(m,O){const v=e.clone().set(m),b=r.byIndex(v.get(),O);c(b)}return{distance:u,index:h}}function QX(n,e,t,i,r,s,a,c){const u={passive:!0,capture:!0};let h=0;function p(v){if(!c)return;function b(x){if(new Date().getTime()-h>10)return;a.emit("slideFocusStart"),n.scrollLeft=0;const T=t.findIndex(A=>A.includes(x));sv(T)&&(r.useDuration(0),i.index(T,0),a.emit("slideFocus"))}s.add(document,"keydown",m,!1),e.forEach((x,w)=>{s.add(x,"focus",k=>{(mp(c)||c(v,k))&&b(w)},u)})}function m(v){v.code==="Tab"&&(h=new Date().getTime())}return{init:p}}function jc(n){let e=n;function t(){return e}function i(u){e=a(u)}function r(u){e+=a(u)}function s(u){e-=a(u)}function a(u){return sv(u)?u:u.get()}return{get:t,set:i,add:r,subtract:s}}function _P(n,e){const t=n.scroll==="x"?a:c,i=e.style;let r=null,s=!1;function a(O){return`translate3d(${O}px,0px,0px)`}function c(O){return`translate3d(0px,${O}px,0px)`}function u(O){if(s)return;const v=oX(n.direction(O));v!==r&&(i.transform=t(v),r=v)}function h(O){s=!O}function p(){s||(i.transform="",e.getAttribute("style")||e.removeAttribute("style"))}return{clear:p,to:u,toggleActive:h}}function CX(n,e,t,i,r,s,a,c,u){const p=ou(r),m=ou(r).reverse(),O=k().concat(T());function v(D,j){return D.reduce((Y,J)=>Y-r[J],j)}function b(D,j){return D.reduce((Y,J)=>v(Y,j)>0?Y.concat([J]):Y,[])}function x(D){return s.map((j,Y)=>({start:j-i[Y]+.5+D,end:j+e-.5+D}))}function w(D,j,Y){const J=x(j);return D.map(I=>{const W=Y?0:-t,ae=Y?t:0,le=Y?"end":"start",ce=J[I][le];return{index:I,loopPoint:ce,slideLocation:jc(-1),translate:_P(n,u[I]),target:()=>c.get()>ce?W:ae}})}function k(){const D=a[0],j=b(m,D);return w(j,t,!1)}function T(){const D=e-a[0]-1,j=b(p,D);return w(j,-t,!0)}function A(){return O.every(({index:D})=>{const j=p.filter(Y=>Y!==D);return v(j,e)<=.1})}function $(){O.forEach(D=>{const{target:j,translate:Y,slideLocation:J}=D,I=j();I!==J.get()&&(Y.to(I),J.set(I))})}function R(){O.forEach(D=>D.translate.clear())}return{canLoop:A,clear:R,loop:$,loopPoints:O}}function TX(n,e,t){let i,r=!1;function s(u){if(!t)return;function h(p){for(const m of p)if(m.type==="childList"){u.reInit(),e.emit("slidesChanged");break}}i=new MutationObserver(p=>{r||(mp(t)||t(u,p))&&h(p)}),i.observe(n,{childList:!0})}function a(){i&&i.disconnect(),r=!0}return{init:s,destroy:a}}function PX(n,e,t,i){const r={};let s=null,a=null,c,u=!1;function h(){c=new IntersectionObserver(b=>{u||(b.forEach(x=>{const w=e.indexOf(x.target);r[w]=x}),s=null,a=null,t.emit("slidesInView"))},{root:n.parentElement,threshold:i}),e.forEach(b=>c.observe(b))}function p(){c&&c.disconnect(),u=!0}function m(b){return au(r).reduce((x,w)=>{const k=parseInt(w),{isIntersecting:T}=r[k];return(b&&T||!b&&!T)&&x.push(k),x},[])}function O(b=!0){if(b&&s)return s;if(!b&&a)return a;const x=m(b);return b&&(s=x),b||(a=x),x}return{init:h,destroy:p,get:O}}function AX(n,e,t,i,r,s){const{measureSize:a,startEdge:c,endEdge:u}=n,h=t[0]&&r,p=b(),m=x(),O=t.map(a),v=w();function b(){if(!h)return 0;const T=t[0];return yt(e[c]-T[c])}function x(){if(!h)return 0;const T=s.getComputedStyle($i(i));return parseFloat(T.getPropertyValue(`margin-${u}`))}function w(){return t.map((T,A,$)=>{const R=!A,_=av($,A);return R?O[A]+p:_?O[A]+m:$[A+1][c]-T[c]}).map(yt)}return{slideSizes:O,slideSizesWithGaps:v,startGap:p,endGap:m}}function MX(n,e,t,i,r,s,a,c,u){const{startEdge:h,endEdge:p,direction:m}=n,O=sv(t);function v(k,T){return ou(k).filter(A=>A%T===0).map(A=>k.slice(A,A+T))}function b(k){return k.length?ou(k).reduce((T,A,$)=>{const R=$i(T)||0,_=R===0,D=A===Zu(k),j=r[h]-s[R][h],Y=r[h]-s[A][p],J=!i&&_?m(a):0,I=!i&&D?m(c):0,W=yt(Y-I-(j+J));return $&&W>e+u&&T.push(A),D&&T.push(k.length),T},[]).map((T,A,$)=>{const R=Math.max($[A-1]||0);return k.slice(R,T)}):[]}function x(k){return O?v(k,t):b(k)}return{groupSlides:x}}function RX(n,e,t,i,r,s,a){const{align:c,axis:u,direction:h,startIndex:p,loop:m,duration:O,dragFree:v,dragThreshold:b,inViewThreshold:x,slidesToScroll:w,skipSnaps:k,containScroll:T,watchResize:A,watchSlides:$,watchDrag:R,watchFocus:_}=s,D=2,j=hX(),Y=j.measure(e),J=t.map(j.measure),I=cX(u,h),W=I.measureSize(Y),ae=dX(W),le=aX(c,W),ce=!m&&!!T,Z=m||!!T,{slideSizes:U,slideSizesWithGaps:z,startGap:K,endGap:E}=AX(I,Y,J,t,Z,r),q=MX(I,W,w,m,Y,J,K,E,D),{snaps:te,snapsAligned:F}=xX(I,le,Y,J,q),oe=-$i(te)+$i(z),{snapsContained:xe,scrollContainLimit:ue}=OX(W,oe,F,T,D),de=ce?xe:F,{limit:ke}=yX(oe,de,m),Ue=EP(Zu(de),p,m),We=Ue.clone(),Le=ou(t),me=({dragHandler:gn,scrollBody:is,scrollBounds:ti,options:{loop:Qi}})=>{Qi||ti.constrain(gn.pointerDown()),is.seek()},je=({scrollBody:gn,translate:is,location:ti,offsetLocation:Qi,previousLocation:rs,scrollLooper:ni,slideLooper:kr,dragHandler:Qr,animation:Gs,eventHandler:Sn,scrollBounds:qo,options:{loop:ss}},Ci)=>{const Is=gn.settled(),Me=!qo.shouldConstrain(),dt=ss?Is:Is&&Me,gt=dt&&!Qr.pointerDown();gt&&Gs.stop();const zt=ti.get()*Ci+rs.get()*(1-Ci);Qi.set(zt),ss&&(ni.loop(gn.direction()),kr.loop()),is.to(Qi.get()),gt&&Sn.emit("settle"),dt||Sn.emit("scroll")},Ke=lX(i,r,()=>me(Qt),gn=>je(Qt,gn)),Xt=.68,mn=de[Ue.get()],at=jc(mn),Fn=jc(mn),kt=jc(mn),Kn=jc(mn),Jn=mX(at,kt,Fn,Kn,O,Xt),Lt=wX(m,de,oe,ke,Kn),Dn=kX(Ke,Ue,We,Jn,Lt,Kn,a),Lo=bX(ke),zo=lu(),ei=PX(e,t,a,x),{slideRegistry:Ut}=SX(ce,T,de,ue,q,Le),jn=QX(n,t,Ut,Dn,Jn,zo,a,_),Qt={ownerDocument:i,ownerWindow:r,eventHandler:a,containerRect:Y,slideRects:J,animation:Ke,axis:I,dragHandler:uX(I,n,i,r,Kn,fX(I,r),at,Ke,Dn,Jn,Lt,Ue,a,ae,v,b,k,Xt,R),eventStore:zo,percentOfView:ae,index:Ue,indexPrevious:We,limit:ke,location:at,offsetLocation:kt,previousLocation:Fn,options:s,resizeHandler:pX(e,a,r,t,I,A,j),scrollBody:Jn,scrollBounds:gX(ke,kt,Kn,Jn,ae),scrollLooper:vX(oe,ke,kt,[at,kt,Fn,Kn]),scrollProgress:Lo,scrollSnapList:de.map(Lo.get),scrollSnaps:de,scrollTarget:Lt,scrollTo:Dn,slideLooper:CX(I,W,oe,U,z,te,de,kt,t),slideFocus:jn,slidesHandler:TX(e,a,$),slidesInView:ei,slideIndexes:Le,slideRegistry:Ut,slidesToScroll:q,target:Kn,translate:_P(I,e)};return Qt}function $X(){let n={},e;function t(h){e=h}function i(h){return n[h]||[]}function r(h){return i(h).forEach(p=>p(e,h)),u}function s(h,p){return n[h]=i(h).concat([p]),u}function a(h,p){return n[h]=i(h).filter(m=>m!==p),u}function c(){n={}}const u={init:t,emit:r,off:a,on:s,clear:c};return u}const EX={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function _X(n){function e(s,a){return $P(s,a||{})}function t(s){const a=s.breakpoints||{},c=au(a).filter(u=>n.matchMedia(u).matches).map(u=>a[u]).reduce((u,h)=>e(u,h),{});return e(s,c)}function i(s){return s.map(a=>au(a.breakpoints||{})).reduce((a,c)=>a.concat(c),[]).map(n.matchMedia)}return{mergeOptions:e,optionsAtMedia:t,optionsMediaQueries:i}}function DX(n){let e=[];function t(s,a){return e=a.filter(({options:c})=>n.optionsAtMedia(c).active!==!1),e.forEach(c=>c.init(s,n)),a.reduce((c,u)=>Object.assign(c,{[u.name]:u}),{})}function i(){e=e.filter(s=>s.destroy())}return{init:t,destroy:i}}function Cd(n,e,t){const i=n.ownerDocument,r=i.defaultView,s=_X(r),a=DX(s),c=lu(),u=$X(),{mergeOptions:h,optionsAtMedia:p,optionsMediaQueries:m}=s,{on:O,off:v,emit:b}=u,x=I;let w=!1,k,T=h(EX,Cd.globalOptions),A=h(T),$=[],R,_,D;function j(){const{container:Le,slides:me}=A;_=(f0(Le)?n.querySelector(Le):Le)||n.children[0];const Ke=f0(me)?_.querySelectorAll(me):me;D=[].slice.call(Ke||_.children)}function Y(Le){const me=RX(n,_,D,i,r,Le,u);if(Le.loop&&!me.slideLooper.canLoop()){const je=Object.assign({},Le,{loop:!1});return Y(je)}return me}function J(Le,me){w||(T=h(T,Le),A=p(T),$=me||$,j(),k=Y(A),m([T,...$.map(({options:je})=>je)]).forEach(je=>c.add(je,"change",I)),A.active&&(k.translate.to(k.location.get()),k.animation.init(),k.slidesInView.init(),k.slideFocus.init(We),k.eventHandler.init(We),k.resizeHandler.init(We),k.slidesHandler.init(We),k.options.loop&&k.slideLooper.loop(),_.offsetParent&&D.length&&k.dragHandler.init(We),R=a.init(We,$)))}function I(Le,me){const je=q();W(),J(h({startIndex:je},Le),me),u.emit("reInit")}function W(){k.dragHandler.destroy(),k.eventStore.clear(),k.translate.clear(),k.slideLooper.clear(),k.resizeHandler.destroy(),k.slidesHandler.destroy(),k.slidesInView.destroy(),k.animation.destroy(),a.destroy(),c.clear()}function ae(){w||(w=!0,c.clear(),W(),u.emit("destroy"),u.clear())}function le(Le,me,je){!A.active||w||(k.scrollBody.useBaseFriction().useDuration(me===!0?0:A.duration),k.scrollTo.index(Le,je||0))}function ce(Le){const me=k.index.add(1).get();le(me,Le,-1)}function Z(Le){const me=k.index.add(-1).get();le(me,Le,1)}function U(){return k.index.add(1).get()!==q()}function z(){return k.index.add(-1).get()!==q()}function K(){return k.scrollSnapList}function E(){return k.scrollProgress.get(k.offsetLocation.get())}function q(){return k.index.get()}function te(){return k.indexPrevious.get()}function F(){return k.slidesInView.get()}function oe(){return k.slidesInView.get(!1)}function xe(){return R}function ue(){return k}function de(){return n}function ke(){return _}function Ue(){return D}const We={canScrollNext:U,canScrollPrev:z,containerNode:ke,internalEngine:ue,destroy:ae,off:v,on:O,emit:b,plugins:xe,previousScrollSnap:te,reInit:x,rootNode:de,scrollNext:ce,scrollPrev:Z,scrollProgress:E,scrollSnapList:K,scrollTo:le,selectedScrollSnap:q,slideNodes:Ue,slidesInView:F,slidesNotInView:oe};return J(e,t),setTimeout(()=>u.emit("init"),0),We}Cd.globalOptions=void 0;function lv(n={},e=[]){const t=C.useRef(n),i=C.useRef(e),[r,s]=C.useState(),[a,c]=C.useState(),u=C.useCallback(()=>{r&&r.reInit(t.current,i.current)},[r]);return C.useEffect(()=>{rv(t.current,n)||(t.current=n,u())},[n,u]),C.useEffect(()=>{rX(i.current,e)||(i.current=e,u())},[e,u]),C.useEffect(()=>{if(iX()&&a){Cd.globalOptions=lv.globalOptions;const h=Cd(a,t.current,i.current);return s(h),()=>h.destroy()}else s(void 0)},[a,s]),[c,r]}lv.globalOptions=void 0;const DP=C.createContext(null);function jP(){const n=C.useContext(DP);if(!n)throw new Error("useCarousel must be used within a <Carousel />");return n}function jX({orientation:n="horizontal",opts:e,setApi:t,plugins:i,className:r,children:s,...a}){const[c,u]=lv({...e,axis:n==="horizontal"?"x":"y"},i),[h,p]=C.useState(!1),[m,O]=C.useState(!1),v=C.useCallback(k=>{k&&(p(k.canScrollPrev()),O(k.canScrollNext()))},[]),b=C.useCallback(()=>{u?.scrollPrev()},[u]),x=C.useCallback(()=>{u?.scrollNext()},[u]),w=C.useCallback(k=>{k.key==="ArrowLeft"?(k.preventDefault(),b()):k.key==="ArrowRight"&&(k.preventDefault(),x())},[b,x]);return C.useEffect(()=>{!u||!t||t(u)},[u,t]),C.useEffect(()=>{if(u)return v(u),u.on("reInit",v),u.on("select",v),()=>{u?.off("select",v)}},[u,v]),S.jsx(DP.Provider,{value:{carouselRef:c,api:u,opts:e,orientation:n||(e?.axis==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:x,canScrollPrev:h,canScrollNext:m},children:S.jsx("div",{onKeyDownCapture:w,className:Ie("relative",r),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...a,children:s})})}function NX({className:n,...e}){const{carouselRef:t,orientation:i}=jP();return S.jsx("div",{ref:t,className:"overflow-hidden","data-slot":"carousel-content",children:S.jsx("div",{className:Ie("flex",i==="horizontal"?"-ml-4":"-mt-4 flex-col",n),...e})})}function ZX({className:n,...e}){const{orientation:t}=jP();return S.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:Ie("min-w-0 shrink-0 grow-0 basis-full",t==="horizontal"?"pl-4":"pt-4",n),...e})}function NP({onImport:n}){const e=ky();return e?S.jsx("div",{children:S.jsx(jX,{children:S.jsx(NX,{children:e.starters.map(t=>S.jsx(ZX,{className:"basis-1/3",children:S.jsxs("div",{className:"p-2 flex flex-col items-center hover:cursor-pointer hover:bg-gray-700/50 hover:text-white rounded-lg",onClick:()=>{n(t.url)},children:[S.jsx("img",{src:t.banner,alt:t.name,className:"w-100 max-w-full"}),S.jsx("div",{className:"text-md font-bold",children:t.name})]})},t.url))})})}):null}function XX(){const[n,e]=C.useState(""),[t,i]=C.useState(!1),r=Or(),{projectStarter:s}=ml();if(r!=="setup")return null;async function a(u){const h=await dC(u||n);"error"in h?Py.error("Failed to load starter",{description:h.error}):(JO(h),i(!1))}const c=ky();return S.jsxs(S.Fragment,{children:[s?.banner&&S.jsx("div",{className:"flex justify-center mb-4",children:S.jsx("div",{className:"p-2 bg-gray-300 rounded-lg shadow-xl shadow-gray-800",children:S.jsx("img",{src:s.banner,alt:"Starter Banner",className:"w-40 max-w-full"})})}),s?.name&&S.jsxs("div",{className:"text-md mb-4",children:[S.jsx(Oi,{variant:"outline",size:"sm",className:"mr-2",onClick:()=>{JO(void 0)},children:S.jsx(qD,{className:"w-4 h-4"})}),S.jsx("span",{className:"font-bold",children:"Starter: "}),s.name]}),S.jsxs("div",{children:[S.jsxs(Oi,{variant:"secondary",className:"w-full",onClick:()=>{e(""),i(!0)},children:[S.jsx(wD,{className:"w-4 h-4"}),"Set Project Starter"]}),S.jsx(jo,{modal:!0,open:t,onOpenChange:i,children:S.jsxs(No,{className:"sm:min-w-[425px] sm:max-w-fit",children:[S.jsx(yl,{children:S.jsx(vl,{children:"Project Starter URL"})}),c?.starters&&S.jsx("div",{children:S.jsx(NP,{onImport:u=>a(u)})}),S.jsx("div",{children:S.jsx(Ay,{value:n,onChange:u=>e(u.target.value),placeholder:"https://github.com/myorg/myproject/starter.json",className:"min-w-lg w-full",onKeyDown:u=>{u.key==="Enter"&&a()}})}),S.jsx($u,{children:S.jsx(Oi,{onClick:()=>a(),children:"Load"})})]})})]})]})}function iO({children:n}){return S.jsx("div",{className:"bg-white dark:bg-black/40 shadow-xl p-4 space-y-2 rounded-lg sidebar-group",children:n})}const LX=()=>S.jsxs("div",{className:"mt-5",children:[S.jsx(L6,{}),S.jsx(z6,{})]}),zX={actions:S.jsx(LX,{})};function qX(n){const e=gr(),t=Or(),i=Object.assign({},zX,n.slots);return S.jsxs("div",{className:"flex flex-col gap-2",children:[e&&S.jsxs(S.Fragment,{children:[t==="setup"&&S.jsxs(iO,{children:[S.jsx(q6,{}),S.jsx(K6,{}),S.jsx(tX,{})]}),S.jsx(iO,{children:S.jsx(Z6,{})}),t==="setup"&&S.jsx(iO,{children:S.jsx(XX,{})})]}),i.actions]})}function BX({className:n}){return S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 633 633",className:Ie("w-10 h-10",n),children:[S.jsxs("defs",{children:[S.jsxs("linearGradient",{id:"b",x1:"50%",x2:"50%",y1:"0%",y2:"71.65%",children:[S.jsx("stop",{offset:"0%",stopColor:"#6BDAFF"}),S.jsx("stop",{offset:"31.922%",stopColor:"#F9FFB5"}),S.jsx("stop",{offset:"70.627%",stopColor:"#FFA770"}),S.jsx("stop",{offset:"100%",stopColor:"#FF7373"})]}),S.jsxs("linearGradient",{id:"d",x1:"43.996%",x2:"53.441%",y1:"8.54%",y2:"93.872%",children:[S.jsx("stop",{offset:"0%",stopColor:"#673800"}),S.jsx("stop",{offset:"100%",stopColor:"#B65E00"})]}),S.jsxs("linearGradient",{id:"e",x1:"50%",x2:"50%",y1:"0%",y2:"100%",children:[S.jsx("stop",{offset:"0%",stopColor:"#2F8A00"}),S.jsx("stop",{offset:"100%",stopColor:"#90FF57"})]}),S.jsxs("linearGradient",{id:"f",x1:"50%",x2:"50%",y1:"0%",y2:"100%",children:[S.jsx("stop",{offset:"0%",stopColor:"#2F8A00"}),S.jsx("stop",{offset:"100%",stopColor:"#90FF57"})]}),S.jsxs("linearGradient",{id:"g",x1:"50%",x2:"50%",y1:"0%",y2:"100%",children:[S.jsx("stop",{offset:"0%",stopColor:"#2F8A00"}),S.jsx("stop",{offset:"100%",stopColor:"#90FF57"})]}),S.jsxs("linearGradient",{id:"h",x1:"50%",x2:"50%",y1:"0%",y2:"100%",children:[S.jsx("stop",{offset:"0%",stopColor:"#2F8A00"}),S.jsx("stop",{offset:"100%",stopColor:"#90FF57"})]}),S.jsxs("linearGradient",{id:"i",x1:"50%",x2:"50%",y1:"0%",y2:"100%",children:[S.jsx("stop",{offset:"0%",stopColor:"#2F8A00"}),S.jsx("stop",{offset:"100%",stopColor:"#90FF57"})]}),S.jsxs("linearGradient",{id:"j",x1:"50%",x2:"50%",y1:"0%",y2:"100%",children:[S.jsx("stop",{offset:"0%",stopColor:"#2F8A00"}),S.jsx("stop",{offset:"100%",stopColor:"#90FF57"})]}),S.jsxs("linearGradient",{id:"k",x1:"92.9%",x2:"8.641%",y1:"45.768%",y2:"54.892%",children:[S.jsx("stop",{offset:"0%",stopColor:"#EE2700"}),S.jsx("stop",{offset:"100%",stopColor:"#FF008E"})]}),S.jsxs("linearGradient",{id:"l",x1:"61.109%",x2:"43.717%",y1:"3.633%",y2:"43.072%",children:[S.jsx("stop",{offset:"0%",stopColor:"#FFF400"}),S.jsx("stop",{offset:"100%",stopColor:"#3C8700"})]}),S.jsxs("linearGradient",{id:"m",x1:"50%",x2:"50%",y1:"0%",y2:"100%",children:[S.jsx("stop",{offset:"0%",stopColor:"#FFDF00"}),S.jsx("stop",{offset:"100%",stopColor:"#FF9D00"})]}),S.jsxs("linearGradient",{id:"n",x1:"127.279%",x2:"0%",y1:"49.778%",y2:"50.222%",children:[S.jsx("stop",{offset:"0%",stopColor:"#FFA400"}),S.jsx("stop",{offset:"100%",stopColor:"#FF5E00"})]}),S.jsxs("linearGradient",{id:"o",x1:"127.279%",x2:"0%",y1:"47.531%",y2:"52.469%",children:[S.jsx("stop",{offset:"0%",stopColor:"#FFA400"}),S.jsx("stop",{offset:"100%",stopColor:"#FF5E00"})]}),S.jsxs("linearGradient",{id:"p",x1:"127.279%",x2:"0%",y1:"46.195%",y2:"53.805%",children:[S.jsx("stop",{offset:"0%",stopColor:"#FFA400"}),S.jsx("stop",{offset:"100%",stopColor:"#FF5E00"})]}),S.jsxs("linearGradient",{id:"q",x1:"127.279%",x2:"0%",y1:"35.33%",y2:"64.67%",children:[S.jsx("stop",{offset:"0%",stopColor:"#FFA400"}),S.jsx("stop",{offset:"100%",stopColor:"#FF5E00"})]}),S.jsxs("linearGradient",{id:"r",x1:"127.279%",x2:"0%",y1:"4.875%",y2:"95.125%",children:[S.jsx("stop",{offset:"0%",stopColor:"#FFA400"}),S.jsx("stop",{offset:"100%",stopColor:"#FF5E00"})]}),S.jsxs("linearGradient",{id:"s",x1:"78.334%",x2:"31.668%",y1:"0%",y2:"100%",children:[S.jsx("stop",{offset:"0%",stopColor:"#FFA400"}),S.jsx("stop",{offset:"100%",stopColor:"#FF5E00"})]}),S.jsxs("linearGradient",{id:"t",x1:"57.913%",x2:"44.88%",y1:"0%",y2:"100%",children:[S.jsx("stop",{offset:"0%",stopColor:"#FFA400"}),S.jsx("stop",{offset:"100%",stopColor:"#FF5E00"})]}),S.jsxs("linearGradient",{id:"u",x1:"50.495%",x2:"49.68%",y1:"0%",y2:"100%",children:[S.jsx("stop",{offset:"0%",stopColor:"#FFA400"}),S.jsx("stop",{offset:"100%",stopColor:"#FF5E00"})]}),S.jsx("circle",{id:"a",cx:"308.5",cy:"308.5",r:"308.5"}),S.jsx("circle",{id:"v",cx:"307.5",cy:"308.5",r:"316.5"})]}),S.jsxs("g",{fill:"none",fillRule:"evenodd",transform:"translate(9 8)",children:[S.jsx("mask",{id:"c",fill:"#fff",children:S.jsx("use",{xlinkHref:"#a"})}),S.jsx("use",{xlinkHref:"#a",fill:"url(#b)"}),S.jsx("ellipse",{cx:"81.5",cy:"602.5",fill:"#015064",stroke:"#00CFE2",strokeWidth:"25",mask:"url(#c)",rx:"214.5",ry:"185.968"}),S.jsx("ellipse",{cx:"535.5",cy:"602.5",fill:"#015064",stroke:"#00CFE2",strokeWidth:"25",mask:"url(#c)",rx:"214.5",ry:"185.968"}),S.jsx("ellipse",{cx:"81.5",cy:"640.5",fill:"#015064",stroke:"#00A8B8",strokeWidth:"25",mask:"url(#c)",rx:"214.5",ry:"185.968"}),S.jsx("ellipse",{cx:"535.5",cy:"640.5",fill:"#015064",stroke:"#00A8B8",strokeWidth:"25",mask:"url(#c)",rx:"214.5",ry:"185.968"}),S.jsx("ellipse",{cx:"81.5",cy:"676.5",fill:"#015064",stroke:"#007782",strokeWidth:"25",mask:"url(#c)",rx:"214.5",ry:"185.968"}),S.jsx("ellipse",{cx:"535.5",cy:"676.5",fill:"#015064",stroke:"#007782",strokeWidth:"25",mask:"url(#c)",rx:"214.5",ry:"185.968"}),S.jsxs("g",{mask:"url(#c)",children:[S.jsx("path",{fill:"url(#d)",stroke:"#6E3A00",strokeWidth:"6.088",d:"M98.318 88.007c7.691 37.104 16.643 72.442 26.856 106.013 10.212 33.571 25.57 68.934 46.07 106.088l-51.903 11.67c-10.057-60.01-17.232-99.172-21.525-117.487-4.293-18.315-10.989-51.434-20.089-99.357l20.591-6.927",transform:"scale(-1 1) rotate(25 -300.37 -553.013)"}),S.jsxs("g",{stroke:"#2F8A00",children:[S.jsx("path",{fill:"url(#e)",strokeWidth:"9.343",d:"M108.544 66.538s-13.54-21.305-37.417-27.785c-15.917-4.321-33.933.31-54.048 13.892C33.464 65.975 47.24 73.52 58.405 75.28c16.749 2.64 50.14-8.74 50.14-8.74Z",transform:"rotate(1 -6061.691 5926.397)"}),S.jsx("path",{fill:"url(#f)",strokeWidth:"9.343",d:"M108.544 67.138s-47.187-5.997-81.077 19.936C4.873 104.362-3.782 137.794 1.502 187.369c28.42-29.22 48.758-50.836 61.016-64.846 18.387-21.016 46.026-55.385 46.026-55.385Z",transform:"rotate(1 -6061.691 5926.397)"}),S.jsx("path",{fill:"url(#g)",strokeWidth:"9.343",d:"M108.544 66.538c-1.96-21.705 3.98-38.018 17.82-48.94C140.203 6.674 154.85.808 170.303 0c-4.865 21.527-12.373 36.314-22.524 44.361-10.151 8.048-23.23 15.44-39.236 22.177Z",transform:"rotate(1 -6061.691 5926.397)"}),S.jsx("path",{fill:"url(#h)",strokeWidth:"9.343",d:"M108.544 67.138c29.838-31.486 61.061-42.776 93.669-33.869C234.82 42.176 253.749 60.785 259 89.096c-34.898-3.657-59.974-6.343-75.228-8.058-15.254-1.716-40.33-6.349-75.228-13.9Z",transform:"rotate(1 -6061.691 5926.397)"}),S.jsx("path",{fill:"url(#i)",strokeWidth:"9.343",d:"M108.544 67.138c34.868-9.381 64.503-3.658 88.905 17.17 24.402 20.829 39.656 46.686 45.762 77.571-39.626-7.574-68.4-20.115-86.322-37.624a395.051 395.051 0 0 1-48.345-57.117Z",transform:"rotate(1 -6061.691 5926.397)"}),S.jsx("path",{fill:"url(#j)",strokeWidth:"9.343",d:"M108.544 67.138C76.206 82.6 57.608 105.366 52.75 135.436c-4.858 30.07-.292 62.89 13.698 98.462 24.873-41.418 38.905-71.368 42.096-89.849 3.191-18.48 3.191-44.118 0-76.91Z",transform:"rotate(1 -6061.691 5926.397)"}),S.jsx("path",{strokeLinecap:"round",strokeWidth:"5.91",d:"M211.284 173.477c-13.851 21.992-23.291 42.022-28.32 60.093-5.03 18.071-8.175 33.143-9.436 45.216"}),S.jsx("path",{strokeLinecap:"round",strokeWidth:"5.91",d:"M209.814 176.884c-23.982 2.565-42.792 10.469-56.428 23.714-13.639 13.245-23.483 26.136-29.536 38.674M219.045 167.299c29.028-7.723 50.972-10.173 65.831-7.352 14.859 2.822 26.807 7.659 35.842 14.51M211.31 172.618c20.29 9.106 38.353 19.052 54.186 29.837 15.833 10.786 27.714 20.99 35.643 30.617"})]}),S.jsx("path",{stroke:"#830305",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:"6.937",d:"m409.379 398.157-23.176 18.556M328.04 375.516l-22.313 28.398M312.904 353.698l53.18 59.816"}),S.jsx("path",{fill:"url(#k)",d:"M67.585 27.463H5.68C1.893 28.148 0 30.38 0 34.16c0 3.78 1.893 6.211 5.68 7.293h67.17l41.751-30.356c2.488-2.646 2.794-5.315.92-8.006s-4.6-3.626-8.177-2.803l-39.76 27.174Z",transform:"scale(-1 1) rotate(-9 2092.128 2856.854)"}),S.jsx("path",{fill:"#D8D8D8",stroke:"#FFF",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:"4.414",d:"m402.861 391.51.471-4.088M382.21 388.752l.472-4.087M361.546 385.404l.485-3.845M337.59 371.883l2.56-2.498M324.276 359.567l2.56-2.497"})]}),S.jsx("ellipse",{cx:"308.5",cy:"720.5",fill:"url(#l)",mask:"url(#c)",rx:"266",ry:"316.5"}),S.jsx("ellipse",{cx:"308.5",cy:"720.5",stroke:"#6DA300",strokeOpacity:".502",strokeWidth:"26",mask:"url(#c)",rx:"253",ry:"303.5"}),S.jsx("g",{mask:"url(#c)",children:S.jsxs("g",{transform:"translate(389 -32)",children:[S.jsx("circle",{cx:"168.5",cy:"113.5",r:"113.5",fill:"url(#m)"}),S.jsx("circle",{cx:"168.5",cy:"113.5",r:"106",stroke:"#FFC900",strokeOpacity:".529",strokeWidth:"15"}),S.jsx("path",{stroke:"url(#n)",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:"12",d:"M30 113H0"}),S.jsx("path",{stroke:"url(#o)",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:"12",d:"M33.5 79.5 7 74"}),S.jsx("path",{stroke:"url(#p)",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:"12",d:"m34 146-29 8"}),S.jsx("path",{stroke:"url(#q)",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:"12",d:"m45 177-24 13"}),S.jsx("path",{stroke:"url(#r)",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:"12",d:"m67 204-20 19"}),S.jsx("path",{stroke:"url(#s)",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:"12",d:"m94.373 227-13.834 22.847"}),S.jsx("path",{stroke:"url(#t)",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:"12",d:"M127.5 243.5 120 268"}),S.jsx("path",{stroke:"url(#u)",strokeLinecap:"round",strokeLinejoin:"bevel",strokeWidth:"12",d:"m167.5 252.5.5 24.5"})]})}),S.jsx("circle",{cx:"307.5",cy:"308.5",r:"304",stroke:"#000",strokeWidth:"25"})]})]})}function VX(){return S.jsxs("div",{className:"bg-white dark:bg-black/50 rounded-lg p-2 sm:p-4 flex items-center gap-2 text-lg sm:text-xl shadow-xl",children:[S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(BX,{}),S.jsx("div",{className:"font-black text-xl uppercase",children:"TanStack"})]}),S.jsx("svg",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",viewBox:"0 0 256 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:S.jsx("path",{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"})}),S.jsxs("div",{className:"hover:text-blue-500 flex items-center gap-2",children:["Create TanStack App"," ",S.jsx("span",{className:"bg-gradient-to-r from-blue-500 to-cyan-500 text-white text-xs font-bold px-2 py-0.5 rounded",children:"ALPHA"})]})]})}function YX(){const[n,e]=C.useState(!1);return C.useEffect(()=>{e(!0)},[]),n}const UX=()=>{const[n,e]=C.useState(null);return C.useEffect(()=>{const t=window.matchMedia("(prefers-reduced-motion: reduce)");e(t.matches);const i=r=>{e(r.matches)};return t.addEventListener("change",i),()=>{t.removeEventListener("change",i)}},[]),n};function GX(){const n=C.useRef(null),e=UX(),t=YX();return C.useEffect(()=>{if(e!==!1)return;const i=n.current;let r=2e3;const s=1e3*60*2,a=IX(.645,.045,.355,1);if(i){let w=function(){return k([{color:{h:10,s:100,l:50}},{color:{h:40,s:100,l:50}},{color:{h:150,s:100,l:50}},{color:{h:200,s:100,l:50}}]).map(j=>({...j,x:Math.random()*i.width,y:Math.random()*i.height,r:Math.random()*500+700,colorH:j.color.h,colorS:j.color.s,colorL:j.color.l}))},k=function(j){for(let Y=j.length-1;Y>0;Y--){const J=Math.floor(Math.random()*(Y+1));[j[Y],j[J]]=[j[J],j[Y]]}return j},R=function(){const j=document.createElement("canvas");j.width=i.width,j.height=i.height,j.getContext("2d").drawImage(i,0,0),i.width=window.innerWidth,i.height=window.innerHeight,O.drawImage(j,0,0,i.width,i.height)},_=function(){b&&clearTimeout(b),v&&cancelAnimationFrame(v),T=JSON.parse(JSON.stringify(A)),$=w(),x=performance.now(),D()},D=function(){O.clearRect(0,0,i.width,i.height);const Y=(performance.now()-x)/r,J=a(Y);T.forEach((I,W)=>{const ae=$[W];A[W].x=Cc(I.x,ae.x,J),A[W].y=Cc(I.y,ae.y,J);const le=O.createRadialGradient(A[W].x,A[W].y,0,A[W].x,A[W].y,A[W].r);A[W].colorH=Cc(I.colorH,ae.colorH,J),A[W].colorS=Cc(I.colorS,ae.colorS,J),A[W].colorL=Cc(I.colorL,ae.colorL,J),le.addColorStop(0,`hsla(${A[W].colorH}, ${A[W].colorS}%, ${A[W].colorL}%, 1)`),le.addColorStop(1,`hsla(${A[W].colorH}, ${A[W].colorS}%, ${A[W].colorL}%, 0)`),O.fillStyle=le,O.beginPath(),O.arc(A[W].x,A[W].y,A[W].r,0,Math.PI*2),O.fill()}),Y<1?v=requestAnimationFrame(D):b=setTimeout(()=>{r=4e3,_()},s)};var c=w,u=k,h=R,p=_,m=D;const O=i.getContext("2d");let v=null,b=null,x=performance.now(),T=w(),A=T,$=[];return R(),_(),window.addEventListener("resize",R),()=>{v&&cancelAnimationFrame(v),b&&clearTimeout(b),window.removeEventListener("resize",R)}}},[e]),S.jsx("div",{className:qC("fixed inset-0 z-0 opacity-20 pointer-events-none","transition-opacity duration-[2s] ease-linear","[&+*]:relative",t?"opacity-10 dark:opacity-20":"opacity-0"),children:S.jsx("canvas",{ref:n})})}function IX(n,e,t,i){return function(r){const s=3*e,a=3*(i-e)-s;return(((1-s-a)*r+a)*r+s)*r}}function Cc(n,e,t){return n+(e-n)*t}const Da={unchanged:"text-gray-500",added:"text-green-500 font-bold",modified:"text-blue-500 italic",deleted:"text-red-500 line-through",overwritten:"text-red-700 underline"},WX=(n,e,t,i,r)=>i[n]?r.includes(n)?{fileClass:"deleted",originalFile:i[n]}:e[n]&&i[n]!==e[n]?t[n]&&i[n]!==t[n]?{fileClass:"overwritten",originalFile:i[n],modifiedFile:e[n]}:{fileClass:"modified",originalFile:i[n],modifiedFile:e[n]}:{fileClass:"unchanged",modifiedFile:i[n]}:{fileClass:"added",modifiedFile:e[n]};function it(){return it=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},it.apply(null,arguments)}function nl(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}let d0=[],ZP=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?ZP:d0).push(t=t+n[e])})();function HX(n){if(n<768)return!1;for(let e=0,t=d0.length;;){let i=e+t>>1;if(n<d0[i])t=i;else if(n>=ZP[i])e=i+1;else return!0;if(e==t)return!1}}function ik(n){return n>=127462&&n<=127487}const rk=8205;function FX(n,e,t=!0,i=!0){return(t?XP:KX)(n,e,i)}function XP(n,e,t){if(e==n.length)return e;e&&LP(n.charCodeAt(e))&&zP(n.charCodeAt(e-1))&&e--;let i=rO(n,e);for(e+=sk(i);e<n.length;){let r=rO(n,e);if(i==rk||r==rk||t&&HX(r))e+=sk(r),i=r;else if(ik(r)){let s=0,a=e-2;for(;a>=0&&ik(rO(n,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function KX(n,e,t){for(;e>0;){let i=XP(n,e-2,t);if(i<e)return i;e--}return 0}function rO(n,e){let t=n.charCodeAt(e);if(!zP(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return LP(i)?(t-55296<<10)+(i-56320)+65536:t}function LP(n){return n>=56320&&n<57344}function zP(n){return n>=55296&&n<56320}function sk(n){return n<65536?1:2}class Ve{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=il(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),tr.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=il(this,e,t);let i=[];return this.decompose(e,t,i,0),tr.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new Gc(this),s=new Gc(e);for(let a=t,c=t;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(c+=r.value.length,r.done||c>=i)return!0}}iter(e=1){return new Gc(this,e)}iterRange(e,t=this.length){return new qP(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new BP(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Ve.empty:e.length<=32?new Mt(e):tr.from(Mt.split(e,[]))}}class Mt extends Ve{constructor(e,t=JX(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let a=this.text[s],c=r+a.length;if((t?i:c)>=e)return new e8(r,c,i,a);r=c+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new Mt(ok(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let a=i.pop(),c=ed(s.text,a.text.slice(),0,s.length);if(c.length<=32)i.push(new Mt(c,a.length+s.length));else{let u=c.length>>1;i.push(new Mt(c.slice(0,u)),new Mt(c.slice(u)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof Mt))return super.replace(e,t,i);[e,t]=il(this,e,t);let r=ed(this.text,ed(i.text,ok(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new Mt(r,s):tr.from(Mt.split(r,[]),s)}sliceString(e,t=this.length,i=`
200
200
  `){[e,t]=il(this,e,t);let r="";for(let s=0,a=0;s<=t&&a<this.text.length;a++){let c=this.text[a],u=s+c.length;s>e&&a&&(r+=i),e<u&&t>s&&(r+=c.slice(Math.max(0,e-s),t-s)),s=u+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(t.push(new Mt(i,r)),i=[],r=-1);return r>-1&&t.push(new Mt(i,r)),t}}class tr extends Ve{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let s=0;;s++){let a=this.children[s],c=r+a.length,u=i+a.lines-1;if((t?u:c)>=e)return a.lineInner(e,t,i,r);r=c+1,i=u+1}}decompose(e,t,i,r){for(let s=0,a=0;a<=t&&s<this.children.length;s++){let c=this.children[s],u=a+c.length;if(e<=u&&t>=a){let h=r&((a<=e?1:0)|(u>=t?2:0));a>=e&&u<=t&&!h?i.push(c):c.decompose(e-a,t-a,i,h)}a=u+1}}replace(e,t,i){if([e,t]=il(this,e,t),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let a=this.children[r],c=s+a.length;if(e>=s&&t<=c){let u=a.replace(e-s,t-s,i),h=this.lines-a.lines+u.lines;if(u.lines<h>>4&&u.lines>h>>6){let p=this.children.slice();return p[r]=u,new tr(p,this.length-(t-e)+i.length)}return super.replace(s,c,u)}s=c+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
201
201
  `){[e,t]=il(this,e,t);let r="";for(let s=0,a=0;s<this.children.length&&a<=t;s++){let c=this.children[s],u=a+c.length;a>e&&s&&(r+=i),e<u&&t>a&&(r+=c.sliceString(e-a,t-a,i)),a=u+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof tr))return 0;let i=0,[r,s,a,c]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==a||s==c)return i;let u=this.children[r],h=e.children[s];if(u!=h)return i+u.scanIdentical(h,t);i+=u.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let v of e)i+=v.lines;if(i<32){let v=[];for(let b of e)b.flatten(v);return new Mt(v,t)}let r=Math.max(32,i>>5),s=r<<1,a=r>>1,c=[],u=0,h=-1,p=[];function m(v){let b;if(v.lines>s&&v instanceof tr)for(let x of v.children)m(x);else v.lines>a&&(u>a||!u)?(O(),c.push(v)):v instanceof Mt&&u&&(b=p[p.length-1])instanceof Mt&&v.lines+b.lines<=32?(u+=v.lines,h+=v.length+1,p[p.length-1]=new Mt(b.text.concat(v.text),b.length+1+v.length)):(u+v.lines>r&&O(),u+=v.lines,h+=v.length+1,p.push(v))}function O(){u!=0&&(c.push(p.length==1?p[0]:tr.from(p,h)),h=-1,u=p.length=0)}for(let v of e)m(v);return O(),c.length==1?c[0]:new tr(c,t)}}Ve.empty=new Mt([""],0);function JX(n){let e=-1;for(let t of n)e+=t.length+1;return e}function ed(n,e,t=0,i=1e9){for(let r=0,s=0,a=!0;s<n.length&&r<=i;s++){let c=n[s],u=r+c.length;u>=t&&(u>i&&(c=c.slice(0,i-r)),r<t&&(c=c.slice(t-r)),a?(e[e.length-1]+=c,a=!1):e.push(c)),r=u+1}return e}function ok(n,e,t){return ed(n,[""],e,t)}class Gc{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Mt?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],a=s>>1,c=r instanceof Mt?r.text.length:r.children.length;if(a==(t>0?c:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
@@ -330,4 +330,4 @@ function alsShim(): PluginOption {
330
330
  }
331
331
  `;function fW(n,e){let t=e;return n==="vite.config.ts"&&(t+=uW,t=t.replace("plugins: [",`${lW}plugins: [alsShim(),`)),t}console.log(">>> startup");const IQ=n=>{let e=n;return e=e.replace(/\u001b\[[0-9;]*[a-zA-Z]/g,""),e=e.replace(/\u001b\][0-9;]*;[^\u0007]*\u0007/g,""),e=e.replace(/\u001b[=>]/g,""),e=e.replace(/\r/g,""),e=e.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/g,""),e=e.replace(/[⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]/g,""),e=e.replace(/[▀▁▂▃▄▅▆▇█▉▊▋▌▍▎▏]/g,""),e=e.replace(/[░▒▓]/g,""),e=e.trim(),e.length>0?e:""};let YO=null;function hW(n){return YO||(YO=Yr.boot()),eC((t,i)=>({webContainer:YO,ready:!1,setupStep:"mounting",statusMessage:"",terminalOutput:[],previewUrl:null,error:null,devProcess:null,projectFiles:[],isInstalling:!1,teardown:()=>{t({webContainer:null,ready:!1})},addTerminalOutput:r=>{t(({terminalOutput:s})=>({terminalOutput:[...s,r]}))},setTerminalOutput:r=>{t({terminalOutput:r})},startDevServer:async()=>{const{devProcess:r,webContainer:s,addTerminalOutput:a}=i();if(!s)throw new Error("WebContainer not found");try{const c=await s;if(!c)throw new Error("WebContainer not found");r&&(console.log("Killing existing dev process..."),r.kill(),t({devProcess:null})),t({setupStep:"starting",statusMessage:"Starting development server..."}),a("🚀 Starting dev server..."),c.on("server-ready",(p,m)=>{console.log("Server ready on port",p,"at",m);const O=i();t({previewUrl:m,setupStep:"ready",statusMessage:"Development server running",terminalOutput:[...O.terminalOutput,`✅ Server ready at ${m}`]})});const u=await c.spawn("pnpm",["dev"]);t({devProcess:u}),u.output.pipeTo(new WritableStream({write(p){const m=IQ(p);if(m&&m.length>3){console.log("[DEV]",m);const O=i();t({terminalOutput:[...O.terminalOutput,m]})}}}));const h=await u.exit;h!==0&&(a(`❌ Dev server exited with code ${h}`),t({error:`Dev server exited with code ${h}`}))}catch(c){console.error("Dev server start error:",c),a(`❌ Dev server error: ${c.message}`),t({error:c.message,setupStep:"error"})}},updateProjectFiles:async r=>{const{projectFiles:s,addTerminalOutput:a,installDependencies:c,webContainer:u}=i();if(!u)throw console.error("WebContainer not found in updateProjectFiles"),new Error("WebContainer not found");try{const O=await u;if(!O)throw console.error("WebContainer resolved to null"),new Error("WebContainer not found");console.log("WebContainer booted successfully!",O)}catch(O){throw console.error("WebContainer boot failed:",O),t({error:`WebContainer boot failed: ${O.message}`,setupStep:"error"}),O}const h=await u;let p=!1;const m={};if(s.length===0){const O={};for(const{path:v,content:b}of r){const x=v.replace(/^\.?\//,""),w=x.split("/");let k=O;for(let $=0;$<w.length-1;$++){const R=w[$];k[R]||(k[R]={directory:{}}),k=k[R].directory}const T=w[w.length-1],A=fW(T,b);if(A.startsWith("base64::")){const $=A.replace("base64::","");try{const R=$.replace(/\s/g,""),_=atob(R),D=new Uint8Array(_.length);for(let j=0;j<_.length;j++)D[j]=_.charCodeAt(j)&255;m[x]=D}catch(R){console.error(`[BINARY ERROR] Failed to convert ${x}:`,R)}}else k[T]={file:{contents:String(A)}}}await h.mount(O);for(const[v,b]of Object.entries(m))await h.fs.writeFile(v,b);p=!0}else{const O=new Map;for(const{path:w,content:k}of s)O.set(w,k);const v=new Map;for(const{path:w,content:k}of r)v.set(w,k);const b=[];for(const{path:w,content:k}of r)O.has(w)?O.get(w)!==k&&b.push({path:w,content:k}):b.push({path:w,content:k});const x=[];for(const{path:w}of s)v.has(w)||x.push(w);if(b.length>0||x.length>0){const{devProcess:w}=i();w&&(console.log("Stopping dev server before file update..."),a("⏸️ Stopping dev server before updating files..."),w.kill(),t({devProcess:null,previewUrl:null}));for(const{path:k,content:T}of b)await h.fs.writeFile(k,T);for(const k of x)await h.fs.rm(k);a("📁 Files updated successfully"),b.some(({path:k})=>k==="./package.json")&&(p=!0)}}t({projectFiles:r}),p&&(a("📦 Package.json changed, reinstalling dependencies..."),await c())},installDependencies:async()=>{const{webContainer:r,addTerminalOutput:s,startDevServer:a,isInstalling:c}=i();if(c){console.log("Install already in progress, skipping");return}if(!r)throw new Error("WebContainer not found");t({isInstalling:!0});try{const u=await r;if(!u)throw t({isInstalling:!1}),new Error("WebContainer not found");t({setupStep:"installing",statusMessage:"Installing dependencies..."}),console.log("Starting pnpm install..."),s("📦 Running pnpm install..."),s("⏳ This may take a minute...");let h;try{h=await u.spawn("pnpm",["install"]),console.log("pnpm install process spawned successfully")}catch(x){throw console.error("Failed to spawn pnpm install:",x),x}let p=0,m=Date.now(),O=[],v=setInterval(()=>{const x=Math.floor((Date.now()-m)/1e3);console.log(`[INSTALL] Still running... (${x}s, ${p} output chunks)`)},5e3);h.output.pipeTo(new WritableStream({write(x){p++,O.push(x);const w=IQ(x);if(w&&w.length>3){const k=w.includes("added")||w.includes("removed")||w.includes("changed")||w.includes("audited")||w.includes("packages")||w.includes("error")||w.includes("warn")||w.includes("ERR")||w.includes("FAIL");k&&(console.log("[INSTALL]",w),s(w),k&&v&&(clearInterval(v),v=void 0))}}})),console.log("Waiting for install to complete...");const b=await h.exit;if(v&&clearInterval(v),console.log("Install exit code:",b),console.log("Total output lines:",p),b!==0){console.error("[INSTALL ERROR] All output:",O.join(`
332
332
  `));const x=`pnpm install failed with exit code ${b}`;throw s(`❌ ${x}`),s("💡 Check console for detailed error output"),t({error:x,setupStep:"error"}),new Error(x)}s("✅ Dependencies installed successfully"),await a()}catch(u){throw console.error("Install error:",u),s(`❌ Install error: ${u.message}`),t({error:u.message,setupStep:"error"}),u}finally{t({isInstalling:!1})}}}))}const CE=C.createContext(null);function dW({children:n,projectFiles:e}){console.log("WebContainerProvider rendering with",e.length,"files");const[t]=C.useState(()=>hW()),i=Ki(t,r=>r.updateProjectFiles);return C.useEffect(()=>{console.log("WebContainerProvider useEffect triggered with",e.length,"files"),i(e)},[i,e]),S.jsx(CE.Provider,{value:t,children:n})}function pW(){const n=C.useContext(CE);if(!n)throw new Error("WebContainerContext not found");const e=Ki(n,b=>b.webContainer),t=Ki(n,b=>b.setupStep),i=Ki(n,b=>b.statusMessage),r=Ki(n,b=>b.terminalOutput),s=Ki(n,b=>b.error),a=Ki(n,b=>b.previewUrl),c=Ki(n,b=>b.startDevServer),u=Ki(n,b=>b.setTerminalOutput),[h,p]=C.useState(!1),m=C.useRef(null);C.useEffect(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight)},[r]);const O=b=>{switch(b){case"mounting":return"📁";case"installing":return"📦";case"starting":return"🚀";case"ready":return"✅";case"error":return"❌"}},v=b=>{switch(b){case"error":return"text-red-500";case"ready":return"text-green-500";default:return"text-blue-500"}};return!e||t==="error"||t!=="ready"||!a?S.jsx("div",{className:"flex items-center justify-center h-full bg-gray-50 dark:bg-gray-900",children:S.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl p-8 max-w-2xl w-full mx-4 border-2 border-blue-500",children:[S.jsx("h2",{className:"text-2xl font-bold mb-6 text-center",children:t==="error"?"Setup Failed":"Preparing Preview"}),t==="error"?S.jsxs("div",{className:"text-center",children:[S.jsx("div",{className:"text-4xl mb-4",children:"❌"}),S.jsx("div",{className:"text-lg font-medium text-red-600 mb-2",children:"An error occurred"}),S.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:s}),S.jsx("button",{onClick:c,className:"px-4 py-2 text-sm bg-orange-500 text-white rounded hover:bg-orange-600 transition-colors",children:"🔄 Retry"})]}):S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"space-y-4 mb-6",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("div",{className:`text-2xl ${t==="mounting"?"animate-pulse":""}`,children:O("mounting")}),S.jsx("div",{className:`flex-1 ${v(t==="mounting"?"mounting":t==="installing"||t==="starting"||t==="ready"?"ready":"mounting")}`,children:"Mount Files"}),(t==="installing"||t==="starting"||t==="ready")&&"✓"]}),S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("div",{className:`text-2xl ${t==="installing"?"animate-spin":""}`,children:O("installing")}),S.jsx("div",{className:`flex-1 ${v(t==="installing"?"installing":t==="starting"||t==="ready"?"ready":"mounting")}`,children:"Install Dependencies"}),(t==="starting"||t==="ready")&&"✓"]}),S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("div",{className:`text-2xl ${t==="starting"?"animate-bounce":""}`,children:O("starting")}),S.jsx("div",{className:`flex-1 ${v(t==="starting"?"starting":t==="ready"?"ready":"mounting")}`,children:"Start Server"}),t==="ready"&&"✓"]})]}),S.jsx("div",{className:"text-center text-sm text-gray-600 dark:text-gray-400",children:i||"Preparing your application..."})]})]})}):S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsx("div",{className:"flex-1",children:a?S.jsx("iframe",{src:a,className:"w-full h-full border-0",title:"Application Preview",onLoad:()=>console.log("Iframe loaded successfully"),onError:b=>console.error("Iframe load error:",b)}):S.jsx("div",{className:"flex items-center justify-center h-full bg-gray-100 dark:bg-gray-800",children:S.jsxs("div",{className:"text-center",children:[S.jsx("div",{className:"text-2xl mb-2",children:"🔄"}),S.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Preview not available"})]})})}),S.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 bg-black text-green-400 flex flex-col flex-shrink-0",children:[S.jsxs("div",{className:"p-2 border-b border-gray-700 bg-gray-900 flex items-center justify-between cursor-pointer hover:bg-gray-800 transition-colors",onClick:()=>p(!h),children:[S.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[S.jsx("button",{className:"text-gray-400 hover:text-gray-200",children:h?S.jsx(yC,{className:"w-4 h-4"}):S.jsx(vD,{className:"w-4 h-4"})}),S.jsx("div",{className:"text-xs font-medium text-gray-300",children:"Terminal Output"}),t==="ready"&&a&&S.jsx("div",{className:"text-xs text-green-500",children:"● Server Running"})]}),S.jsxs("div",{className:"flex items-center gap-2",onClick:b=>b.stopPropagation(),children:[a&&S.jsx("button",{onClick:()=>window.open(a,"_blank"),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 transition-colors",children:"Open in New Tab"}),S.jsx("button",{onClick:c,disabled:!e,className:"px-2 py-1 text-xs bg-orange-500 text-white rounded hover:bg-orange-600 transition-colors disabled:opacity-50",children:"🔄 Restart"}),S.jsx("button",{onClick:()=>u([]),className:"text-xs text-gray-400 hover:text-gray-200 transition-colors",children:"Clear"})]})]}),h&&S.jsx("div",{ref:m,className:"font-mono text-xs p-2 overflow-y-auto overflow-x-hidden",style:{maxHeight:"200px"},children:r.length>0?r.map((b,x)=>S.jsx("div",{className:"mb-1 leading-tight whitespace-pre-wrap break-words",children:b},x)):S.jsx("div",{className:"text-gray-500",children:"No output yet..."})})]})]})}var Mp="Tabs",[mW,UW]=Ni(Mp,[Sl]),TE=Sl(),[gW,hb]=mW(Mp),PE=C.forwardRef((n,e)=>{const{__scopeTabs:t,value:i,onValueChange:r,defaultValue:s,orientation:a="horizontal",dir:c,activationMode:u="automatic",...h}=n,p=Eu(c),[m,O]=Zi({prop:i,onChange:r,defaultProp:s??"",caller:Mp});return S.jsx(gW,{scope:t,baseId:Ir(),value:m,onValueChange:O,orientation:a,dir:p,activationMode:u,children:S.jsx(ze.div,{dir:p,"data-orientation":a,...h,ref:e})})});PE.displayName=Mp;var AE="TabsList",ME=C.forwardRef((n,e)=>{const{__scopeTabs:t,loop:i=!0,...r}=n,s=hb(AE,t),a=TE(t);return S.jsx(Gy,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:i,children:S.jsx(ze.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:e})})});ME.displayName=AE;var RE="TabsTrigger",$E=C.forwardRef((n,e)=>{const{__scopeTabs:t,value:i,disabled:r=!1,...s}=n,a=hb(RE,t),c=TE(t),u=DE(a.baseId,i),h=jE(a.baseId,i),p=i===a.value;return S.jsx(Iy,{asChild:!0,...c,focusable:!r,active:p,children:S.jsx(ze.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":h,"data-state":p?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...s,ref:e,onMouseDown:Ae(n.onMouseDown,m=>{!r&&m.button===0&&m.ctrlKey===!1?a.onValueChange(i):m.preventDefault()}),onKeyDown:Ae(n.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(i)}),onFocus:Ae(n.onFocus,()=>{const m=a.activationMode!=="manual";!p&&!r&&m&&a.onValueChange(i)})})})});$E.displayName=RE;var EE="TabsContent",_E=C.forwardRef((n,e)=>{const{__scopeTabs:t,value:i,forceMount:r,children:s,...a}=n,c=hb(EE,t),u=DE(c.baseId,i),h=jE(c.baseId,i),p=i===c.value,m=C.useRef(p);return C.useEffect(()=>{const O=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(O)},[]),S.jsx(yr,{present:r||p,children:({present:O})=>S.jsx(ze.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!O,id:h,tabIndex:0,...a,ref:e,style:{...n.style,animationDuration:m.current?"0s":void 0},children:O&&s})})});_E.displayName=EE;function DE(n,e){return`${n}-trigger-${e}`}function jE(n,e){return`${n}-content-${e}`}var OW=PE,yW=ME,vW=$E,bW=_E;function xW({className:n,...e}){return S.jsx(OW,{"data-slot":"tabs",className:Ie("flex flex-col gap-2",n),...e})}function SW({className:n,...e}){return S.jsx(yW,{"data-slot":"tabs-list",className:Ie("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",n),...e})}function WQ({className:n,...e}){return S.jsx(vW,{"data-slot":"tabs-trigger",className:Ie("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...e})}function HQ({className:n,...e}){return S.jsx(bW,{"data-slot":"tabs-content",className:Ie("flex-1 outline-none",n),...e})}function wW(){const{includedFiles:n,toggleFilter:e}=gC();return S.jsxs("div",{className:"bg-white dark:bg-black/40 shadow-xl p-4 rounded-lg flex flex-row items-center gap-4 mb-2",children:[S.jsx("h3",{className:"font-medium whitespace-nowrap",children:"File Filters"}),S.jsxs("div",{className:"flex flex-row items-center",children:[S.jsx(Ur,{id:"unchanged",checked:n.includes("unchanged"),onCheckedChange:()=>e("unchanged"),className:"mr-2"}),S.jsx(Ji,{htmlFor:"unchanged",className:Da.unchanged,children:"Unchanged"})]}),S.jsxs("div",{className:"flex flex-row items-center",children:[S.jsx(Ur,{id:"added",checked:n.includes("added"),onCheckedChange:()=>e("added"),className:"mr-2"}),S.jsx(Ji,{htmlFor:"added",className:Da.added,children:"Added"})]}),S.jsxs("div",{className:"flex flex-row items-center",children:[S.jsx(Ur,{id:"modified",checked:n.includes("modified"),onCheckedChange:()=>e("modified"),className:"mr-2"}),S.jsx(Ji,{htmlFor:"modified",className:Da.modified,children:"Modified"})]}),S.jsxs("div",{className:"flex flex-row items-center",children:[S.jsx(Ur,{id:"deleted",checked:n.includes("deleted"),onCheckedChange:()=>e("deleted"),className:"mr-2"}),S.jsx(Ji,{htmlFor:"deleted",className:Da.deleted,children:"Deleted"})]}),S.jsxs("div",{className:"flex flex-row items-center",children:[S.jsx(Ur,{id:"overwritten",checked:n.includes("overwritten"),onCheckedChange:()=>e("overwritten"),className:"mr-2"}),S.jsx(Ji,{htmlFor:"overwritten",className:Da.overwritten,children:"Overwritten"})]})]})}function kW(){const[n,e]=C.useState("./package.json"),t=H_(),i=W_(),r=sD(),s=Or(),a=r.files,c=s==="setup"?r.files:t?.files,u=r.deletedFiles,[h,p]=C.useState(),[m,O]=C.useState(),{includedFiles:v}=gC(),b=C.useMemo(()=>{const k=[];return!c||!i||Array.from(new Set([...Object.keys(a),...Object.keys(i),...Object.keys(c)])).sort().forEach(A=>{const $=A.replace("./",""),R=$.split("/");let _=k;R.forEach((D,j)=>{const Y=_.find(J=>J.name===D);if(Y)_=Y.children||[];else{const J=WX(A,a,c,i,u);if(j===R.length-1&&!v.includes(J.fileClass))return;j===R.length-1&&A===n&&(O(J.modifiedFile),p(J.originalFile));const I={id:R.slice(0,j+1).join("/"),name:D,fullPath:$,children:j<R.length-1?[]:void 0,icon:j<R.length-1?()=>S.jsx(bC,{className:"w-4 h-4 mr-2"}):()=>S.jsx(vC,{className:"w-4 h-4 mr-2"}),onClick:j===R.length-1?()=>{e(A),O(J.modifiedFile),p(J.originalFile)}:void 0,className:Da[J.fileClass],...J,contents:a[A]||i[A]||c[A]};_.push(I),_=I.children}})}),k},[a,c,i,v]),x=gr(),w=C.useMemo(()=>{if(console.log("Preparing WebContainer files, tree:",a),!a)return console.log("Tree is empty, returning empty array"),[];const k=Object.entries(a).map(([T,A])=>({path:T,content:A}));return console.log("WebContainer files prepared:",k.length,"files"),k},[a]);return x?S.jsx(dW,{projectFiles:w,children:S.jsxs("div",{className:"bg-white dark:bg-black/50 rounded-lg p-2 sm:p-4",children:[s==="add"&&S.jsx(wW,{}),S.jsxs(xW,{defaultValue:"files",className:"w-full",children:[S.jsxs(SW,{className:"mb-1 h-7 p-0.5 bg-transparent border border-gray-300 dark:border-gray-700",children:[S.jsx(WQ,{value:"files",className:"text-xs h-6 px-3 py-0 data-[state=active]:bg-gray-200 dark:data-[state=active]:bg-gray-800",children:"Files"}),S.jsx(WQ,{value:"preview",className:"text-xs h-6 px-3 py-0 data-[state=active]:bg-gray-200 dark:data-[state=active]:bg-gray-800",children:"Preview"})]}),S.jsx(HQ,{value:"files",className:"mt-0",children:S.jsxs("div",{className:"flex flex-row @container",children:[S.jsx("div",{className:"w-1/3 @6xl:w-1/4 bg-gray-500/10 rounded-l-lg",children:S.jsx(EI,{selectedFile:n,tree:b})}),S.jsx("div",{className:"w-2/3 @6xl:w-3/4",children:n&&m?S.jsx(dI,{filePath:n,originalFile:h,modifiedFile:m}):null})]})}),S.jsx(HQ,{value:"preview",className:"mt-0",children:S.jsx("div",{className:"h-[800px]",children:S.jsx(pW,{})})})]})]})}):null}function QW(){const n=Or(),e=ky(),{open:t,setOpen:i,dontShowAgain:r,setDontShowAgain:s}=oD();if(n!=="setup"||!e||e?.starters?.length===0)return null;async function a(c){const u=await dC(c);"error"in u?Py.error("Failed to load starter",{description:u.error}):(JO(u),i(!1))}return S.jsx(jo,{modal:!0,open:t,onOpenChange:i,children:S.jsxs(No,{className:"sm:min-w-[425px] sm:max-w-fit",children:[S.jsx(yl,{children:S.jsx(vl,{className:"text-center text-2xl font-bold",children:"Would you like to use a starter project?"})}),S.jsx("div",{children:S.jsx(NP,{onImport:a})}),S.jsxs($u,{className:"flex sm:justify-between w-full",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ur,{id:"show-startup-dialog",checked:r,onCheckedChange:s}),S.jsx(Ji,{htmlFor:"show-startup-dialog",children:"Don't show this again"})]}),S.jsx(Oi,{onClick:()=>i(!1),children:"No, I want to start from scratch"})]})]})})}var CW=(n,e,t,i,r,s,a,c)=>{let u=document.documentElement,h=["light","dark"];function p(v){(Array.isArray(n)?n:[n]).forEach(b=>{let x=b==="class",w=x&&s?r.map(k=>s[k]||k):r;x?(u.classList.remove(...w),u.classList.add(s&&s[v]?s[v]:v)):u.setAttribute(b,v)}),m(v)}function m(v){c&&h.includes(v)&&(u.style.colorScheme=v)}function O(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)p(i);else try{let v=localStorage.getItem(e)||t,b=a&&v==="system"?O():v;p(b)}catch{}},TW=C.createContext(void 0),PW={setTheme:n=>{},themes:[]},AW=()=>{var n;return(n=C.useContext(TW))!=null?n:PW};C.memo(({forcedTheme:n,storageKey:e,attribute:t,enableSystem:i,enableColorScheme:r,defaultTheme:s,value:a,themes:c,nonce:u,scriptProps:h})=>{let p=JSON.stringify([t,e,s,n,c,a,i,r]).slice(1,-1);return C.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${CW.toString()})(${p})`}})});const MW=({...n})=>{const{theme:e="system"}=AW();return S.jsx(yj,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...n})};function RW({children:n}){const[e]=C.useState(()=>new S_);return S.jsx(T_,{client:e,children:n})}function $W({children:n}){return fD(),S.jsxs(S.Fragment,{children:[n,S.jsx(MW,{})]})}function EW({children:n}){return S.jsx(RW,{children:S.jsx($W,{children:n})})}const _W={header:S.jsx(VX,{}),sidebar:S.jsx(qX,{}),fileNavigator:S.jsx(kW,{}),startupDialog:S.jsx(QW,{})};function DW(n){const e=Object.assign({},_W,n.slots);return S.jsx(EW,{children:S.jsxs("main",{className:"min-w-[1280px]",children:[S.jsx(GX,{}),S.jsxs("div",{className:"min-h-dvh p-2 sm:p-4 space-y-2 sm:space-y-4 @container",children:[e.header,S.jsxs("div",{className:"flex flex-row",children:[S.jsx("div",{className:"w-1/3 @8xl:w-1/4 pr-2",children:e.sidebar}),S.jsx("div",{className:"w-2/3 @8xl:w-3/4 pl-2",children:e.fileNavigator})]})]}),e.startupDialog]})})}const FQ=document.getElementById("root");FQ&&t_.createRoot(FQ).render(S.jsx(DW,{}));
333
- //# sourceMappingURL=index-BMNLJ_vl.js.map
333
+ //# sourceMappingURL=index-Dw3IdVvR.js.map