@nqlib/nqui 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALLATION.md +215 -0
- package/README.md +2 -1
- package/dist/command-palette-BuYcxPCc.cjs +5 -0
- package/dist/command-palette-dEJ9aEk4.js +694 -0
- package/dist/command.cjs.js +1 -1
- package/dist/command.es.js +1 -1
- package/dist/components/custom/enhanced-badge.d.ts +1 -1
- package/dist/components/custom/enhanced-button.d.ts +6 -1
- package/dist/components/custom/enhanced-button.d.ts.map +1 -1
- package/dist/components/custom/enhanced-checkbox.d.ts +11 -0
- package/dist/components/custom/enhanced-checkbox.d.ts.map +1 -1
- package/dist/components/custom/enhanced-radio-group.d.ts +13 -4
- package/dist/components/custom/enhanced-radio-group.d.ts.map +1 -1
- package/dist/components/custom/enhanced-sonner.d.ts +5 -6
- package/dist/components/custom/enhanced-sonner.d.ts.map +1 -1
- package/dist/components/custom/enhanced-tabs.d.ts.map +1 -1
- package/dist/components/error-boundary.d.ts +20 -0
- package/dist/components/error-boundary.d.ts.map +1 -0
- package/dist/components/index.d.ts +102 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts +4 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.d.ts +3 -1
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/debug-panel-AjzBdMMz.js +9198 -0
- package/dist/debug-panel-NaOmD68t.cjs +171 -0
- package/dist/debug.cjs.js +1 -0
- package/dist/debug.es.js +7 -0
- package/dist/drawer-Cqq0Ozb2.cjs +1 -0
- package/dist/{drawer-CU4lkcz7.js → drawer-pUXPg3lF.js} +2 -2
- package/dist/drawer.cjs.js +1 -1
- package/dist/drawer.es.js +1 -1
- package/dist/entries/debug.d.ts +14 -0
- package/dist/entries/debug.d.ts.map +1 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-scroll-spy.d.ts.map +1 -1
- package/dist/index-CI756mSv.cjs +41 -0
- package/dist/index-CgfzsUO6.js +1069 -0
- package/dist/index.d.ts +2 -98
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/nqui.cjs.js +42 -212
- package/dist/nqui.es.js +8589 -17780
- package/dist/sonner-BtzU00r3.js +248 -0
- package/dist/sonner-Dfk26eds.cjs +54 -0
- package/dist/sonner.cjs.js +1 -1
- package/dist/sonner.es.js +1 -1
- package/dist/styles.css +3 -0
- package/docs/components/README.md +99 -1
- package/docs/components/nqui-card.md +7 -0
- package/docs/components/nqui-checkbox.md +23 -1
- package/docs/components/nqui-radio-group.md +45 -2
- package/docs/components/nqui-tabs.md +11 -1
- package/docs/nqui-skills/SKILL.md +95 -0
- package/docs/nqui-skills/design-system.md +130 -0
- package/docs/nqui-skills/rules/composition.md +183 -0
- package/docs/nqui-skills/rules/forms.md +190 -0
- package/docs/nqui-skills/rules/icons.md +158 -0
- package/docs/nqui-skills/rules/styling.md +192 -0
- package/package.json +23 -10
- package/scripts/cli.js +1 -0
- package/scripts/download-skills.js +91 -0
- package/scripts/examples/nextjs-layout-sidebar.tsx +100 -0
- package/scripts/examples/nextjs-page-sidebar.tsx +81 -0
- package/scripts/examples/vite-app.tsx +135 -0
- package/scripts/examples/vite-main.tsx +17 -0
- package/scripts/examples.js +92 -6
- package/scripts/generate-docs.js +169 -0
- package/scripts/init-css.js +34 -14
- package/scripts/init-cursor.js +8 -0
- package/scripts/post-install.js +41 -9
- package/scripts/resolve-target-dir.js +20 -1
- package/scripts/wizard.js +12 -7
- package/dist/command-palette-UHk8zZOg.cjs +0 -45
- package/dist/command-palette-d-TrdBsM.js +0 -1778
- package/dist/drawer-BcIxWRN8.cjs +0 -1
- package/dist/sonner-Co6YpYVs.js +0 -546
- package/dist/sonner-DbQhVp8m.cjs +0 -330
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),pe=require("react"),z=require("@hugeicons/react"),B=require("@hugeicons/core-free-icons"),Ye=require("./keyboard-BapbM2wb.cjs"),X=require("./utils-IjLH3w2e.cjs"),ci=require("react-dom"),Ke=require("@radix-ui/react-slot"),ro=require("class-variance-authority"),C=require("./index-CI756mSv.cjs"),di=require("./button-CYFTFDKe.cjs");function rr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=rr(pe),so=rr(ci);var sr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ui="VisuallyHidden",ar=l.forwardRef((e,t)=>o.jsx(C.Primitive.span,{...e,ref:t,style:{...sr,...e.style}}));ar.displayName=ui;var ir=ar;function Zt(e){const t=e+"CollectionProvider",[n,r]=C.createContextScope(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=x=>{const{scope:m,children:v}=x,b=pe.useRef(null),w=pe.useRef(new Map).current;return o.jsx(s,{scope:m,itemMap:w,collectionRef:b,children:v})};i.displayName=t;const c=e+"CollectionSlot",d=Ke.createSlot(c),f=pe.forwardRef((x,m)=>{const{scope:v,children:b}=x,w=a(c,v),S=C.useComposedRefs(m,w.collectionRef);return o.jsx(d,{ref:S,children:b})});f.displayName=c;const u=e+"CollectionItemSlot",p="data-radix-collection-item",h=Ke.createSlot(u),g=pe.forwardRef((x,m)=>{const{scope:v,children:b,...w}=x,S=pe.useRef(null),E=C.useComposedRefs(m,S),j=a(u,v);return pe.useEffect(()=>(j.itemMap.set(S,{ref:S,...w}),()=>{j.itemMap.delete(S)})),o.jsx(h,{[p]:"",ref:E,children:b})});g.displayName=u;function y(x){const m=a(e+"CollectionConsumer",x);return pe.useCallback(()=>{const b=m.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${p}]`));return Array.from(m.itemMap.values()).sort((j,P)=>w.indexOf(j.ref.current)-w.indexOf(P.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:i,Slot:f,ItemSlot:g},y,r]}var Qt="Collapsible",[fi,pi]=C.createContextScope(Qt),[mi,ao]=fi(Qt),lr=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:a,onOpenChange:i,...c}=e,[d,f]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:i,caller:Qt});return o.jsx(mi,{scope:n,disabled:a,contentId:C.useId(),open:d,onOpenToggle:l.useCallback(()=>f(u=>!u),[f]),children:o.jsx(C.Primitive.div,{"data-state":uo(d),"data-disabled":a?"":void 0,...c,ref:t})})});lr.displayName=Qt;var cr="CollapsibleTrigger",io=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=ao(cr,n);return o.jsx(C.Primitive.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":uo(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:C.composeEventHandlers(e.onClick,s.onOpenToggle)})});io.displayName=cr;var lo="CollapsibleContent",co=l.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ao(lo,e.__scopeCollapsible);return o.jsx(C.Presence,{present:n||s.open,children:({present:a})=>o.jsx(hi,{...r,ref:t,present:a})})});co.displayName=lo;var hi=l.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...a}=e,i=ao(lo,n),[c,d]=l.useState(r),f=l.useRef(null),u=C.useComposedRefs(t,f),p=l.useRef(0),h=p.current,g=l.useRef(0),y=g.current,x=i.open||c,m=l.useRef(x),v=l.useRef(void 0);return l.useEffect(()=>{const b=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(b)},[]),C.useLayoutEffect2(()=>{const b=f.current;if(b){v.current=v.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();p.current=w.height,g.current=w.width,m.current||(b.style.transitionDuration=v.current.transitionDuration,b.style.animationName=v.current.animationName),d(r)}},[i.open,r]),o.jsx(C.Primitive.div,{"data-state":uo(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!x,...a,ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:x&&s})});function uo(e){return e?"open":"closed"}var dr=lr,xi=io,gi=co,vi=l.createContext(void 0);function St(e){const t=l.useContext(vi);return e||t||"ltr"}function en(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function tn(e){const[t,n]=l.useState(void 0);return C.useLayoutEffect2(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let i,c;if("borderBoxSize"in a){const d=a.borderBoxSize,f=Array.isArray(d)?d[0]:d;i=f.inlineSize,c=f.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const bi=["top","right","bottom","left"],De=Math.min,ve=Math.max,Bt=Math.round,It=Math.floor,Pe=e=>({x:e,y:e}),wi={left:"right",right:"left",bottom:"top",top:"bottom"},yi={start:"end",end:"start"};function Dn(e,t,n){return ve(e,De(t,n))}function $e(e,t){return typeof e=="function"?e(t):e}function _e(e){return e.split("-")[0]}function lt(e){return e.split("-")[1]}function fo(e){return e==="x"?"y":"x"}function po(e){return e==="y"?"height":"width"}const Ci=new Set(["top","bottom"]);function Re(e){return Ci.has(_e(e))?"y":"x"}function mo(e){return fo(Re(e))}function Si(e,t,n){n===void 0&&(n=!1);const r=lt(e),s=mo(e),a=po(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Vt(i)),[i,Vt(i)]}function ji(e){const t=Vt(e);return[Hn(e),t,Hn(t)]}function Hn(e){return e.replace(/start|end/g,t=>yi[t])}const zo=["left","right"],Bo=["right","left"],Ni=["top","bottom"],Ei=["bottom","top"];function Ri(e,t,n){switch(e){case"top":case"bottom":return n?t?Bo:zo:t?zo:Bo;case"left":case"right":return t?Ni:Ei;default:return[]}}function Pi(e,t,n,r){const s=lt(e);let a=Ri(_e(e),n==="start",r);return s&&(a=a.map(i=>i+"-"+s),t&&(a=a.concat(a.map(Hn)))),a}function Vt(e){return e.replace(/left|right|bottom|top/g,t=>wi[t])}function ki(e){return{top:0,right:0,bottom:0,left:0,...e}}function ur(e){return typeof e!="number"?ki(e):{top:e,right:e,bottom:e,left:e}}function Wt(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Vo(e,t,n){let{reference:r,floating:s}=e;const a=Re(t),i=mo(t),c=po(i),d=_e(t),f=a==="y",u=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,h=r[c]/2-s[c]/2;let g;switch(d){case"top":g={x:u,y:r.y-s.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-s.width,y:p};break;default:g={x:r.x,y:r.y}}switch(lt(t)){case"start":g[i]-=h*(n&&f?-1:1);break;case"end":g[i]+=h*(n&&f?-1:1);break}return g}const Ti=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:i}=n,c=a.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(t));let f=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:p}=Vo(f,r,d),h=r,g={},y=0;for(let x=0;x<c.length;x++){const{name:m,fn:v}=c[x],{x:b,y:w,data:S,reset:E}=await v({x:u,y:p,initialPlacement:r,placement:h,strategy:s,middlewareData:g,rects:f,platform:i,elements:{reference:e,floating:t}});u=b??u,p=w??p,g={...g,[m]:{...g[m],...S}},E&&y<=50&&(y++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(f=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:u,y:p}=Vo(f,h,d)),x=-1)}return{x:u,y:p,placement:h,strategy:s,middlewareData:g}};async function bt(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:i,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:h=!1,padding:g=0}=$e(t,e),y=ur(g),m=c[h?p==="floating"?"reference":"floating":p],v=Wt(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(m)))==null||n?m:m.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:d})),b=p==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),S=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Wt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:w,strategy:d}):b);return{top:(v.top-E.top+y.top)/S.y,bottom:(E.bottom-v.bottom+y.bottom)/S.y,left:(v.left-E.left+y.left)/S.x,right:(E.right-v.right+y.right)/S.x}}const Ii=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:i,elements:c,middlewareData:d}=t,{element:f,padding:u=0}=$e(e,t)||{};if(f==null)return{};const p=ur(u),h={x:n,y:r},g=mo(s),y=po(g),x=await i.getDimensions(f),m=g==="y",v=m?"top":"left",b=m?"bottom":"right",w=m?"clientHeight":"clientWidth",S=a.reference[y]+a.reference[g]-h[g]-a.floating[y],E=h[g]-a.reference[g],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let P=j?j[w]:0;(!P||!await(i.isElement==null?void 0:i.isElement(j)))&&(P=c.floating[w]||a.floating[y]);const R=S/2-E/2,A=P/2-x[y]/2-1,L=De(p[v],A),M=De(p[b],A),D=L,W=P-x[y]-M,H=P/2-x[y]/2+R,U=Dn(D,H,W),V=!d.arrow&<(s)!=null&&H!==U&&a.reference[y]/2-(H<D?L:M)-x[y]/2<0,Y=V?H<D?H-D:H-W:0;return{[g]:h[g]+Y,data:{[g]:U,centerOffset:H-U-Y,...V&&{alignmentOffset:Y}},reset:V}}}),Mi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:i,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...m}=$e(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=_e(s),b=Re(c),w=_e(c)===c,S=await(d.isRTL==null?void 0:d.isRTL(f.floating)),E=h||(w||!x?[Vt(c)]:ji(c)),j=y!=="none";!h&&j&&E.push(...Pi(c,x,y,S));const P=[c,...E],R=await bt(t,m),A=[];let L=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&A.push(R[v]),p){const H=Si(s,i,S);A.push(R[H[0]],R[H[1]])}if(L=[...L,{placement:s,overflows:A}],!A.every(H=>H<=0)){var M,D;const H=(((M=a.flip)==null?void 0:M.index)||0)+1,U=P[H];if(U&&(!(p==="alignment"?b!==Re(U):!1)||L.every(F=>Re(F.placement)===b?F.overflows[0]>0:!0)))return{data:{index:H,overflows:L},reset:{placement:U}};let V=(D=L.filter(Y=>Y.overflows[0]<=0).sort((Y,F)=>Y.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!V)switch(g){case"bestFit":{var W;const Y=(W=L.filter(F=>{if(j){const J=Re(F.placement);return J===b||J==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(J=>J>0).reduce((J,se)=>J+se,0)]).sort((F,J)=>F[1]-J[1])[0])==null?void 0:W[0];Y&&(V=Y);break}case"initialPlacement":V=c;break}if(s!==V)return{reset:{placement:V}}}return{}}}};function Wo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Uo(e){return bi.some(t=>e[t]>=0)}const Ai=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=$e(e,t);switch(r){case"referenceHidden":{const a=await bt(t,{...s,elementContext:"reference"}),i=Wo(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Uo(i)}}}case"escaped":{const a=await bt(t,{...s,altBoundary:!0}),i=Wo(a,n.floating);return{data:{escapedOffsets:i,escaped:Uo(i)}}}default:return{}}}}},fr=new Set(["left","top"]);async function $i(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=_e(n),c=lt(n),d=Re(n)==="y",f=fr.has(i)?-1:1,u=a&&d?-1:1,p=$e(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:y}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof y=="number"&&(g=c==="end"?y*-1:y),d?{x:g*u,y:h*f}:{x:h*f,y:g*u}}const _i=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:i,middlewareData:c}=t,d=await $i(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:a+d.y,data:{...d,placement:i}}}}},Li=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:c={fn:m=>{let{x:v,y:b}=m;return{x:v,y:b}}},...d}=$e(e,t),f={x:n,y:r},u=await bt(t,d),p=Re(_e(s)),h=fo(p);let g=f[h],y=f[p];if(a){const m=h==="y"?"top":"left",v=h==="y"?"bottom":"right",b=g+u[m],w=g-u[v];g=Dn(b,g,w)}if(i){const m=p==="y"?"top":"left",v=p==="y"?"bottom":"right",b=y+u[m],w=y-u[v];y=Dn(b,y,w)}const x=c.fn({...t,[h]:g,[p]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[h]:a,[p]:i}}}}}},Oi=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:i}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=$e(e,t),u={x:n,y:r},p=Re(s),h=fo(p);let g=u[h],y=u[p];const x=$e(c,t),m=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(d){const w=h==="y"?"height":"width",S=a.reference[h]-a.floating[w]+m.mainAxis,E=a.reference[h]+a.reference[w]-m.mainAxis;g<S?g=S:g>E&&(g=E)}if(f){var v,b;const w=h==="y"?"width":"height",S=fr.has(_e(s)),E=a.reference[p]-a.floating[w]+(S&&((v=i.offset)==null?void 0:v[p])||0)+(S?0:m.crossAxis),j=a.reference[p]+a.reference[w]+(S?0:((b=i.offset)==null?void 0:b[p])||0)-(S?m.crossAxis:0);y<E?y=E:y>j&&(y=j)}return{[h]:g,[p]:y}}}},Di=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:i,elements:c}=t,{apply:d=()=>{},...f}=$e(e,t),u=await bt(t,f),p=_e(s),h=lt(s),g=Re(s)==="y",{width:y,height:x}=a.floating;let m,v;p==="top"||p==="bottom"?(m=p,v=h===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(v=p,m=h==="end"?"top":"bottom");const b=x-u.top-u.bottom,w=y-u.left-u.right,S=De(x-u[m],b),E=De(y-u[v],w),j=!t.middlewareData.shift;let P=S,R=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=b),j&&!h){const L=ve(u.left,0),M=ve(u.right,0),D=ve(u.top,0),W=ve(u.bottom,0);g?R=y-2*(L!==0||M!==0?L+M:ve(u.left,u.right)):P=x-2*(D!==0||W!==0?D+W:ve(u.top,u.bottom))}await d({...t,availableWidth:R,availableHeight:P});const A=await i.getDimensions(c.floating);return y!==A.width||x!==A.height?{reset:{rects:!0}}:{}}}};function nn(){return typeof window<"u"}function ct(e){return pr(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(pr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pr(e){return nn()?e instanceof Node||e instanceof be(e).Node:!1}function je(e){return nn()?e instanceof Element||e instanceof be(e).Element:!1}function ke(e){return nn()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function Yo(e){return!nn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}const Hi=new Set(["inline","contents"]);function jt(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Hi.has(s)}const Fi=new Set(["table","td","th"]);function zi(e){return Fi.has(ct(e))}const Bi=[":popover-open",":modal"];function on(e){return Bi.some(t=>{try{return e.matches(t)}catch{return!1}})}const Vi=["transform","translate","scale","rotate","perspective"],Wi=["transform","translate","scale","rotate","perspective","filter"],Ui=["paint","layout","strict","content"];function ho(e){const t=xo(),n=je(e)?Ne(e):e;return Vi.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Wi.some(r=>(n.willChange||"").includes(r))||Ui.some(r=>(n.contain||"").includes(r))}function Yi(e){let t=He(e);for(;ke(t)&&!st(t);){if(ho(t))return t;if(on(t))return null;t=He(t)}return null}function xo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Xi=new Set(["html","body","#document"]);function st(e){return Xi.has(ct(e))}function Ne(e){return be(e).getComputedStyle(e)}function rn(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function He(e){if(ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yo(e)&&e.host||Ie(e);return Yo(t)?t.host:t}function mr(e){const t=He(e);return st(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&jt(t)?t:mr(t)}function wt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=mr(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),i=be(s);if(a){const c=Fn(i);return t.concat(i,i.visualViewport||[],jt(s)?s:[],c&&n?wt(c):[])}return t.concat(s,wt(s,[],n))}function Fn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hr(e){const t=Ne(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=ke(e),a=s?e.offsetWidth:n,i=s?e.offsetHeight:r,c=Bt(n)!==a||Bt(r)!==i;return c&&(n=a,r=i),{width:n,height:r,$:c}}function go(e){return je(e)?e:e.contextElement}function rt(e){const t=go(e);if(!ke(t))return Pe(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=hr(t);let i=(a?Bt(n.width):n.width)/r,c=(a?Bt(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Ki=Pe(0);function xr(e){const t=be(e);return!xo()||!t.visualViewport?Ki:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==be(e)?!1:t}function qe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=go(e);let i=Pe(1);t&&(r?je(r)&&(i=rt(r)):i=rt(e));const c=qi(a,n,r)?xr(a):Pe(0);let d=(s.left+c.x)/i.x,f=(s.top+c.y)/i.y,u=s.width/i.x,p=s.height/i.y;if(a){const h=be(a),g=r&&je(r)?be(r):r;let y=h,x=Fn(y);for(;x&&r&&g!==y;){const m=rt(x),v=x.getBoundingClientRect(),b=Ne(x),w=v.left+(x.clientLeft+parseFloat(b.paddingLeft))*m.x,S=v.top+(x.clientTop+parseFloat(b.paddingTop))*m.y;d*=m.x,f*=m.y,u*=m.x,p*=m.y,d+=w,f+=S,y=be(x),x=Fn(y)}}return Wt({width:u,height:p,x:d,y:f})}function sn(e,t){const n=rn(e).scrollLeft;return t?t.left+n:qe(Ie(e)).left+n}function gr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-sn(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function Gi(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",i=Ie(r),c=t?on(t.floating):!1;if(r===i||c&&a)return n;let d={scrollLeft:0,scrollTop:0},f=Pe(1);const u=Pe(0),p=ke(r);if((p||!p&&!a)&&((ct(r)!=="body"||jt(i))&&(d=rn(r)),ke(r))){const g=qe(r);f=rt(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=i&&!p&&!a?gr(i,d):Pe(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-d.scrollTop*f.y+u.y+h.y}}function Ji(e){return Array.from(e.getClientRects())}function Zi(e){const t=Ie(e),n=rn(e),r=e.ownerDocument.body,s=ve(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ve(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+sn(e);const c=-n.scrollTop;return Ne(r).direction==="rtl"&&(i+=ve(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:i,y:c}}const Xo=25;function Qi(e,t){const n=be(e),r=Ie(e),s=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,c=0,d=0;if(s){a=s.width,i=s.height;const u=xo();(!u||u&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const f=sn(r);if(f<=0){const u=r.ownerDocument,p=u.body,h=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(r.clientWidth-p.clientWidth-g);y<=Xo&&(a-=y)}else f<=Xo&&(a+=f);return{width:a,height:i,x:c,y:d}}const el=new Set(["absolute","fixed"]);function tl(e,t){const n=qe(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=ke(e)?rt(e):Pe(1),i=e.clientWidth*a.x,c=e.clientHeight*a.y,d=s*a.x,f=r*a.y;return{width:i,height:c,x:d,y:f}}function Ko(e,t,n){let r;if(t==="viewport")r=Qi(e,n);else if(t==="document")r=Zi(Ie(e));else if(je(t))r=tl(t,n);else{const s=xr(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Wt(r)}function vr(e,t){const n=He(e);return n===t||!je(n)||st(n)?!1:Ne(n).position==="fixed"||vr(n,t)}function nl(e,t){const n=t.get(e);if(n)return n;let r=wt(e,[],!1).filter(c=>je(c)&&ct(c)!=="body"),s=null;const a=Ne(e).position==="fixed";let i=a?He(e):e;for(;je(i)&&!st(i);){const c=Ne(i),d=ho(i);!d&&c.position==="fixed"&&(s=null),(a?!d&&!s:!d&&c.position==="static"&&!!s&&el.has(s.position)||jt(i)&&!d&&vr(e,i))?r=r.filter(u=>u!==i):s=c,i=He(i)}return t.set(e,r),r}function ol(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?on(t)?[]:nl(t,this._c):[].concat(n),r],c=i[0],d=i.reduce((f,u)=>{const p=Ko(t,u,s);return f.top=ve(p.top,f.top),f.right=De(p.right,f.right),f.bottom=De(p.bottom,f.bottom),f.left=ve(p.left,f.left),f},Ko(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function rl(e){const{width:t,height:n}=hr(e);return{width:t,height:n}}function sl(e,t,n){const r=ke(t),s=Ie(t),a=n==="fixed",i=qe(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=Pe(0);function f(){d.x=sn(s)}if(r||!r&&!a)if((ct(t)!=="body"||jt(s))&&(c=rn(t)),r){const g=qe(t,!0,a,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else s&&f();a&&!r&&s&&f();const u=s&&!r&&!a?gr(s,c):Pe(0),p=i.left+c.scrollLeft-d.x-u.x,h=i.top+c.scrollTop-d.y-u.y;return{x:p,y:h,width:i.width,height:i.height}}function In(e){return Ne(e).position==="static"}function qo(e,t){if(!ke(e)||Ne(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ie(e)===n&&(n=n.ownerDocument.body),n}function br(e,t){const n=be(e);if(on(e))return n;if(!ke(e)){let s=He(e);for(;s&&!st(s);){if(je(s)&&!In(s))return s;s=He(s)}return n}let r=qo(e,t);for(;r&&zi(r)&&In(r);)r=qo(r,t);return r&&st(r)&&In(r)&&!ho(r)?n:r||Yi(e)||n}const al=async function(e){const t=this.getOffsetParent||br,n=this.getDimensions,r=await n(e.floating);return{reference:sl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function il(e){return Ne(e).direction==="rtl"}const ll={convertOffsetParentRelativeRectToViewportRelativeRect:Gi,getDocumentElement:Ie,getClippingRect:ol,getOffsetParent:br,getElementRects:al,getClientRects:Ji,getDimensions:rl,getScale:rt,isElement:je,isRTL:il};function wr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cl(e,t){let n=null,r;const s=Ie(e);function a(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();const f=e.getBoundingClientRect(),{left:u,top:p,width:h,height:g}=f;if(c||t(),!h||!g)return;const y=It(p),x=It(s.clientWidth-(u+h)),m=It(s.clientHeight-(p+g)),v=It(u),w={rootMargin:-y+"px "+-x+"px "+-m+"px "+-v+"px",threshold:ve(0,De(1,d))||1};let S=!0;function E(j){const P=j[0].intersectionRatio;if(P!==d){if(!S)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!wr(f,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(E,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,w)}n.observe(e)}return i(!0),a}function dl(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=go(e),u=s||a?[...f?wt(f):[],...wt(t)]:[];u.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const p=f&&c?cl(f,n):null;let h=-1,g=null;i&&(g=new ResizeObserver(v=>{let[b]=v;b&&b.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),f&&!d&&g.observe(f),g.observe(t));let y,x=d?qe(e):null;d&&m();function m(){const v=qe(e);x&&!wr(x,v)&&n(),x=v,y=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(b=>{s&&b.removeEventListener("scroll",n),a&&b.removeEventListener("resize",n)}),p?.(),(v=g)==null||v.disconnect(),g=null,d&&cancelAnimationFrame(y)}}const ul=_i,fl=Li,pl=Mi,ml=Di,hl=Ai,Go=Ii,xl=Oi,gl=(e,t,n)=>{const r=new Map,s={platform:ll,...n},a={...s.platform,_c:r};return Ti(e,t,{...s,platform:a})};var vl=typeof document<"u",bl=function(){},_t=vl?pe.useLayoutEffect:bl;function Ut(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ut(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!Ut(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function yr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jo(e,t){const n=yr(e);return Math.round(t*n)/n}function Mn(e){const t=l.useRef(e);return _t(()=>{t.current=e}),t}function wl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:i}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[u,p]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=l.useState(r);Ut(h,r)||g(r);const[y,x]=l.useState(null),[m,v]=l.useState(null),b=l.useCallback(F=>{F!==j.current&&(j.current=F,x(F))},[]),w=l.useCallback(F=>{F!==P.current&&(P.current=F,v(F))},[]),S=a||y,E=i||m,j=l.useRef(null),P=l.useRef(null),R=l.useRef(u),A=d!=null,L=Mn(d),M=Mn(s),D=Mn(f),W=l.useCallback(()=>{if(!j.current||!P.current)return;const F={placement:t,strategy:n,middleware:h};M.current&&(F.platform=M.current),gl(j.current,P.current,F).then(J=>{const se={...J,isPositioned:D.current!==!1};H.current&&!Ut(R.current,se)&&(R.current=se,so.flushSync(()=>{p(se)}))})},[h,t,n,M,D]);_t(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(F=>({...F,isPositioned:!1})))},[f]);const H=l.useRef(!1);_t(()=>(H.current=!0,()=>{H.current=!1}),[]),_t(()=>{if(S&&(j.current=S),E&&(P.current=E),S&&E){if(L.current)return L.current(S,E,W);W()}},[S,E,W,L,A]);const U=l.useMemo(()=>({reference:j,floating:P,setReference:b,setFloating:w}),[b,w]),V=l.useMemo(()=>({reference:S,floating:E}),[S,E]),Y=l.useMemo(()=>{const F={position:n,left:0,top:0};if(!V.floating)return F;const J=Jo(V.floating,u.x),se=Jo(V.floating,u.y);return c?{...F,transform:"translate("+J+"px, "+se+"px)",...yr(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:se}},[n,c,V.floating,u.x,u.y]);return l.useMemo(()=>({...u,update:W,refs:U,elements:V,floatingStyles:Y}),[u,W,U,V,Y])}const yl=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Go({element:r.current,padding:s}).fn(n):{}:r?Go({element:r,padding:s}).fn(n):{}}}},Cl=(e,t)=>({...ul(e),options:[e,t]}),Sl=(e,t)=>({...fl(e),options:[e,t]}),jl=(e,t)=>({...xl(e),options:[e,t]}),Nl=(e,t)=>({...pl(e),options:[e,t]}),El=(e,t)=>({...ml(e),options:[e,t]}),Rl=(e,t)=>({...hl(e),options:[e,t]}),Pl=(e,t)=>({...yl(e),options:[e,t]});var kl="Arrow",Cr=l.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return o.jsx(C.Primitive.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});Cr.displayName=kl;var Tl=Cr,vo="Popper",[Sr,Ze]=C.createContextScope(vo),[Il,jr]=Sr(vo),Nr=e=>{const{__scopePopper:t,children:n}=e,[r,s]=l.useState(null);return o.jsx(Il,{scope:t,anchor:r,onAnchorChange:s,children:n})};Nr.displayName=vo;var Er="PopperAnchor",Rr=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=jr(Er,n),i=l.useRef(null),c=C.useComposedRefs(t,i),d=l.useRef(null);return l.useEffect(()=>{const f=d.current;d.current=r?.current||i.current,f!==d.current&&a.onAnchorChange(d.current)}),r?null:o.jsx(C.Primitive.div,{...s,ref:c})});Rr.displayName=Er;var bo="PopperContent",[Ml,Al]=Sr(bo),Pr=l.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:y,...x}=e,m=jr(bo,n),[v,b]=l.useState(null),w=C.useComposedRefs(t,$=>b($)),[S,E]=l.useState(null),j=tn(S),P=j?.width??0,R=j?.height??0,A=r+(a!=="center"?"-"+a:""),L=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},M=Array.isArray(f)?f:[f],D=M.length>0,W={padding:L,boundary:M.filter(_l),altBoundary:D},{refs:H,floatingStyles:U,placement:V,isPositioned:Y,middlewareData:F}=wl({strategy:"fixed",placement:A,whileElementsMounted:(...$)=>dl(...$,{animationFrame:g==="always"}),elements:{reference:m.anchor},middleware:[Cl({mainAxis:s+R,alignmentAxis:i}),d&&Sl({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?jl():void 0,...W}),d&&Nl({...W}),El({...W,apply:({elements:$,rects:Q,availableWidth:K,availableHeight:oe})=>{const{width:Z,height:N}=Q.reference,k=$.floating.style;k.setProperty("--radix-popper-available-width",`${K}px`),k.setProperty("--radix-popper-available-height",`${oe}px`),k.setProperty("--radix-popper-anchor-width",`${Z}px`),k.setProperty("--radix-popper-anchor-height",`${N}px`)}}),S&&Pl({element:S,padding:c}),Ll({arrowWidth:P,arrowHeight:R}),h&&Rl({strategy:"referenceHidden",...W})]}),[J,se]=Ir(V),ce=C.useCallbackRef(y);C.useLayoutEffect2(()=>{Y&&ce?.()},[Y,ce]);const he=F.arrow?.x,de=F.arrow?.y,ne=F.arrow?.centerOffset!==0,[we,ue]=l.useState();return C.useLayoutEffect2(()=>{v&&ue(window.getComputedStyle(v).zIndex)},[v]),o.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:Y?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(Ml,{scope:n,placedSide:J,onArrowChange:E,arrowX:he,arrowY:de,shouldHideArrow:ne,children:o.jsx(C.Primitive.div,{"data-side":J,"data-align":se,...x,ref:w,style:{...x.style,animation:Y?void 0:"none"}})})})});Pr.displayName=bo;var kr="PopperArrow",$l={top:"bottom",right:"left",bottom:"top",left:"right"},Tr=l.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=Al(kr,r),i=$l[a.placedSide];return o.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:o.jsx(Tl,{...s,ref:n,style:{...s.style,display:"block"}})})});Tr.displayName=kr;function _l(e){return e!==null}var Ll=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,i=s.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,d=i?0:e.arrowHeight,[f,u]=Ir(n),p={start:"0%",center:"50%",end:"100%"}[u],h=(s.arrow?.x??0)+c/2,g=(s.arrow?.y??0)+d/2;let y="",x="";return f==="bottom"?(y=i?p:`${h}px`,x=`${-d}px`):f==="top"?(y=i?p:`${h}px`,x=`${r.floating.height+d}px`):f==="right"?(y=`${-d}px`,x=i?p:`${g}px`):f==="left"&&(y=`${r.floating.width+d}px`,x=i?p:`${g}px`),{data:{x:y,y:x}}}});function Ir(e){const[t,n="center"]=e.split("-");return[t,n]}var an=Nr,Nt=Rr,ln=Pr,cn=Tr,An="rovingFocusGroup.onEntryFocus",Ol={bubbles:!1,cancelable:!0},Et="RovingFocusGroup",[zn,Mr,Dl]=Zt(Et),[Hl,wo]=C.createContextScope(Et,[Dl]),[Fl,zl]=Hl(Et),Ar=l.forwardRef((e,t)=>o.jsx(zn.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(zn.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Bl,{...e,ref:t})})}));Ar.displayName=Et;var Bl=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:u=!1,...p}=e,h=l.useRef(null),g=C.useComposedRefs(t,h),y=St(a),[x,m]=C.useControllableState({prop:i,defaultProp:c??null,onChange:d,caller:Et}),[v,b]=l.useState(!1),w=C.useCallbackRef(f),S=Mr(n),E=l.useRef(!1),[j,P]=l.useState(0);return l.useEffect(()=>{const R=h.current;if(R)return R.addEventListener(An,w),()=>R.removeEventListener(An,w)},[w]),o.jsx(Fl,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:x,onItemFocus:l.useCallback(R=>m(R),[m]),onItemShiftTab:l.useCallback(()=>b(!0),[]),onFocusableItemAdd:l.useCallback(()=>P(R=>R+1),[]),onFocusableItemRemove:l.useCallback(()=>P(R=>R-1),[]),children:o.jsx(C.Primitive.div,{tabIndex:v||j===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:C.composeEventHandlers(e.onMouseDown,()=>{E.current=!0}),onFocus:C.composeEventHandlers(e.onFocus,R=>{const A=!E.current;if(R.target===R.currentTarget&&A&&!v){const L=new CustomEvent(An,Ol);if(R.currentTarget.dispatchEvent(L),!L.defaultPrevented){const M=S().filter(V=>V.focusable),D=M.find(V=>V.active),W=M.find(V=>V.id===x),U=[D,W,...M].filter(Boolean).map(V=>V.ref.current);Lr(U,u)}}E.current=!1}),onBlur:C.composeEventHandlers(e.onBlur,()=>b(!1))})})}),$r="RovingFocusGroupItem",_r=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:i,...c}=e,d=C.useId(),f=a||d,u=zl($r,n),p=u.currentTabStopId===f,h=Mr(n),{onFocusableItemAdd:g,onFocusableItemRemove:y,currentTabStopId:x}=u;return l.useEffect(()=>{if(r)return g(),()=>y()},[r,g,y]),o.jsx(zn.ItemSlot,{scope:n,id:f,focusable:r,active:s,children:o.jsx(C.Primitive.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...c,ref:t,onMouseDown:C.composeEventHandlers(e.onMouseDown,m=>{r?u.onItemFocus(f):m.preventDefault()}),onFocus:C.composeEventHandlers(e.onFocus,()=>u.onItemFocus(f)),onKeyDown:C.composeEventHandlers(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=Ul(m,u.orientation,u.dir);if(v!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let w=h().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const S=w.indexOf(m.currentTarget);w=u.loop?Yl(w,S+1):w.slice(S+1)}setTimeout(()=>Lr(w))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:x!=null}):i})})});_r.displayName=$r;var Vl={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Wl(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ul(e,t,n){const r=Wl(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Vl[r]}function Lr(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Yl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Or=Ar,Dr=_r;function yt(e,[t,n]){return Math.min(n,Math.max(t,e))}var dn="Popover",[Hr]=C.createContextScope(dn,[Ze]),Rt=Ze(),[Xl,ze]=Hr(dn),Fr=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:i=!1}=e,c=Rt(t),d=l.useRef(null),[f,u]=l.useState(!1),[p,h]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:a,caller:dn});return o.jsx(an,{...c,children:o.jsx(Xl,{scope:t,contentId:C.useId(),triggerRef:d,open:p,onOpenChange:h,onOpenToggle:l.useCallback(()=>h(g=>!g),[h]),hasCustomAnchor:f,onCustomAnchorAdd:l.useCallback(()=>u(!0),[]),onCustomAnchorRemove:l.useCallback(()=>u(!1),[]),modal:i,children:n})})};Fr.displayName=dn;var zr="PopoverAnchor",Br=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ze(zr,n),a=Rt(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=s;return l.useEffect(()=>(i(),()=>c()),[i,c]),o.jsx(Nt,{...a,...r,ref:t})});Br.displayName=zr;var Vr="PopoverTrigger",Wr=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ze(Vr,n),a=Rt(n),i=C.useComposedRefs(t,s.triggerRef),c=o.jsx(C.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":qr(s.open),...r,ref:i,onClick:C.composeEventHandlers(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:o.jsx(Nt,{asChild:!0,...a,children:c})});Wr.displayName=Vr;var yo="PopoverPortal",[Kl,ql]=Hr(yo,{forceMount:void 0}),Ur=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=ze(yo,t);return o.jsx(Kl,{scope:t,forceMount:n,children:o.jsx(C.Presence,{present:n||a.open,children:o.jsx(C.Portal,{asChild:!0,container:s,children:r})})})};Ur.displayName=yo;var at="PopoverContent",Yr=l.forwardRef((e,t)=>{const n=ql(at,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=ze(at,e.__scopePopover);return o.jsx(C.Presence,{present:r||a.open,children:a.modal?o.jsx(Jl,{...s,ref:t}):o.jsx(Zl,{...s,ref:t})})});Yr.displayName=at;var Gl=Ke.createSlot("PopoverContent.RemoveScroll"),Jl=l.forwardRef((e,t)=>{const n=ze(at,e.__scopePopover),r=l.useRef(null),s=C.useComposedRefs(t,r),a=l.useRef(!1);return l.useEffect(()=>{const i=r.current;if(i)return C.hideOthers(i)},[]),o.jsx(C.ReactRemoveScroll,{as:Gl,allowPinchZoom:!0,children:o.jsx(Xr,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:C.composeEventHandlers(e.onCloseAutoFocus,i=>{i.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:C.composeEventHandlers(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;a.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:C.composeEventHandlers(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Zl=l.forwardRef((e,t)=>{const n=ze(at,e.__scopePopover),r=l.useRef(!1),s=l.useRef(!1);return o.jsx(Xr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),Xr=l.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:u,...p}=e,h=ze(at,n),g=Rt(n);return C.useFocusGuards(),o.jsx(C.FocusScope,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:o.jsx(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>h.onOpenChange(!1),children:o.jsx(ln,{"data-state":qr(h.open),role:"dialog",id:h.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Kr="PopoverClose",Ql=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ze(Kr,n);return o.jsx(C.Primitive.button,{type:"button",...r,ref:t,onClick:C.composeEventHandlers(e.onClick,()=>s.onOpenChange(!1))})});Ql.displayName=Kr;var ec="PopoverArrow",tc=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Rt(n);return o.jsx(cn,{...s,...r,ref:t})});tc.displayName=ec;function qr(e){return e?"open":"closed"}var nc=Fr,oc=Br,rc=Wr,sc=Ur,ac=Yr,ic=[" ","Enter","ArrowUp","ArrowDown"],lc=[" ","Enter"],Ge="Select",[un,fn,cc]=Zt(Ge),[dt]=C.createContextScope(Ge,[cc,Ze]),pn=Ze(),[dc,Be]=dt(Ge),[uc,fc]=dt(Ge),Gr=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:i,defaultValue:c,onValueChange:d,dir:f,name:u,autoComplete:p,disabled:h,required:g,form:y}=e,x=pn(t),[m,v]=l.useState(null),[b,w]=l.useState(null),[S,E]=l.useState(!1),j=St(f),[P,R]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:a,caller:Ge}),[A,L]=C.useControllableState({prop:i,defaultProp:c,onChange:d,caller:Ge}),M=l.useRef(null),D=m?y||!!m.closest("form"):!0,[W,H]=l.useState(new Set),U=Array.from(W).map(V=>V.props.value).join(";");return o.jsx(an,{...x,children:o.jsxs(dc,{required:g,scope:t,trigger:m,onTriggerChange:v,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:C.useId(),value:A,onValueChange:L,open:P,onOpenChange:R,dir:j,triggerPointerDownPosRef:M,disabled:h,children:[o.jsx(un.Provider,{scope:t,children:o.jsx(uc,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(V=>{H(Y=>new Set(Y).add(V))},[]),onNativeOptionRemove:l.useCallback(V=>{H(Y=>{const F=new Set(Y);return F.delete(V),F})},[]),children:n})}),D?o.jsxs(ys,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:A,onChange:V=>L(V.target.value),disabled:h,form:y,children:[A===void 0?o.jsx("option",{value:""}):null,Array.from(W)]},U):null]})})};Gr.displayName=Ge;var Jr="SelectTrigger",Zr=l.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=pn(n),i=Be(Jr,n),c=i.disabled||r,d=C.useComposedRefs(t,i.onTriggerChange),f=fn(n),u=l.useRef("touch"),[p,h,g]=Ss(x=>{const m=f().filter(w=>!w.disabled),v=m.find(w=>w.value===i.value),b=js(m,x,v);b!==void 0&&i.onValueChange(b.value)}),y=x=>{c||(i.onOpenChange(!0),g()),x&&(i.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return o.jsx(Nt,{asChild:!0,...a,children:o.jsx(C.Primitive.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Cs(i.value)?"":void 0,...s,ref:d,onClick:C.composeEventHandlers(s.onClick,x=>{x.currentTarget.focus(),u.current!=="mouse"&&y(x)}),onPointerDown:C.composeEventHandlers(s.onPointerDown,x=>{u.current=x.pointerType;const m=x.target;m.hasPointerCapture(x.pointerId)&&m.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(y(x),x.preventDefault())}),onKeyDown:C.composeEventHandlers(s.onKeyDown,x=>{const m=p.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&h(x.key),!(m&&x.key===" ")&&ic.includes(x.key)&&(y(),x.preventDefault())})})})});Zr.displayName=Jr;var Qr="SelectValue",es=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:i="",...c}=e,d=Be(Qr,n),{onValueNodeHasChildrenChange:f}=d,u=a!==void 0,p=C.useComposedRefs(t,d.onValueNodeChange);return C.useLayoutEffect2(()=>{f(u)},[f,u]),o.jsx(C.Primitive.span,{...c,ref:p,style:{pointerEvents:"none"},children:Cs(d.value)?o.jsx(o.Fragment,{children:i}):a})});es.displayName=Qr;var pc="SelectIcon",ts=l.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(C.Primitive.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});ts.displayName=pc;var mc="SelectPortal",ns=e=>o.jsx(C.Portal,{asChild:!0,...e});ns.displayName=mc;var Je="SelectContent",os=l.forwardRef((e,t)=>{const n=Be(Je,e.__scopeSelect),[r,s]=l.useState();if(C.useLayoutEffect2(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?so.createPortal(o.jsx(rs,{scope:e.__scopeSelect,children:o.jsx(un.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),a):null}return o.jsx(ss,{...e,ref:t})});os.displayName=Je;var ye=10,[rs,Ve]=dt(Je),hc="SelectContentImpl",xc=Ke.createSlot("SelectContent.RemoveScroll"),ss=l.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:i,side:c,sideOffset:d,align:f,alignOffset:u,arrowPadding:p,collisionBoundary:h,collisionPadding:g,sticky:y,hideWhenDetached:x,avoidCollisions:m,...v}=e,b=Be(Je,n),[w,S]=l.useState(null),[E,j]=l.useState(null),P=C.useComposedRefs(t,$=>S($)),[R,A]=l.useState(null),[L,M]=l.useState(null),D=fn(n),[W,H]=l.useState(!1),U=l.useRef(!1);l.useEffect(()=>{if(w)return C.hideOthers(w)},[w]),C.useFocusGuards();const V=l.useCallback($=>{const[Q,...K]=D().map(N=>N.ref.current),[oe]=K.slice(-1),Z=document.activeElement;for(const N of $)if(N===Z||(N?.scrollIntoView({block:"nearest"}),N===Q&&E&&(E.scrollTop=0),N===oe&&E&&(E.scrollTop=E.scrollHeight),N?.focus(),document.activeElement!==Z))return},[D,E]),Y=l.useCallback(()=>V([R,w]),[V,R,w]);l.useEffect(()=>{W&&Y()},[W,Y]);const{onOpenChange:F,triggerPointerDownPosRef:J}=b;l.useEffect(()=>{if(w){let $={x:0,y:0};const Q=oe=>{$={x:Math.abs(Math.round(oe.pageX)-(J.current?.x??0)),y:Math.abs(Math.round(oe.pageY)-(J.current?.y??0))}},K=oe=>{$.x<=10&&$.y<=10?oe.preventDefault():w.contains(oe.target)||F(!1),document.removeEventListener("pointermove",Q),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",K,{capture:!0})}}},[w,F,J]),l.useEffect(()=>{const $=()=>F(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[F]);const[se,ce]=Ss($=>{const Q=D().filter(Z=>!Z.disabled),K=Q.find(Z=>Z.ref.current===document.activeElement),oe=js(Q,$,K);oe&&setTimeout(()=>oe.ref.current.focus())}),he=l.useCallback(($,Q,K)=>{const oe=!U.current&&!K;(b.value!==void 0&&b.value===Q||oe)&&(A($),oe&&(U.current=!0))},[b.value]),de=l.useCallback(()=>w?.focus(),[w]),ne=l.useCallback(($,Q,K)=>{const oe=!U.current&&!K;(b.value!==void 0&&b.value===Q||oe)&&M($)},[b.value]),we=r==="popper"?Bn:as,ue=we===Bn?{side:c,sideOffset:d,align:f,alignOffset:u,arrowPadding:p,collisionBoundary:h,collisionPadding:g,sticky:y,hideWhenDetached:x,avoidCollisions:m}:{};return o.jsx(rs,{scope:n,content:w,viewport:E,onViewportChange:j,itemRefCallback:he,selectedItem:R,onItemLeave:de,itemTextRefCallback:ne,focusSelectedItem:Y,selectedItemText:L,position:r,isPositioned:W,searchRef:se,children:o.jsx(C.ReactRemoveScroll,{as:xc,allowPinchZoom:!0,children:o.jsx(C.FocusScope,{asChild:!0,trapped:b.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:C.composeEventHandlers(s,$=>{b.trigger?.focus({preventScroll:!0}),$.preventDefault()}),children:o.jsx(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:o.jsx(we,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:$=>$.preventDefault(),...v,...ue,onPlaced:()=>H(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:C.composeEventHandlers(v.onKeyDown,$=>{const Q=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!Q&&$.key.length===1&&ce($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let oe=D().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);if(["ArrowUp","End"].includes($.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Z=$.target,N=oe.indexOf(Z);oe=oe.slice(N+1)}setTimeout(()=>V(oe)),$.preventDefault()}})})})})})})});ss.displayName=hc;var gc="SelectItemAlignedPosition",as=l.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=Be(Je,n),i=Ve(Je,n),[c,d]=l.useState(null),[f,u]=l.useState(null),p=C.useComposedRefs(t,P=>u(P)),h=fn(n),g=l.useRef(!1),y=l.useRef(!0),{viewport:x,selectedItem:m,selectedItemText:v,focusSelectedItem:b}=i,w=l.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&f&&x&&m&&v){const P=a.trigger.getBoundingClientRect(),R=f.getBoundingClientRect(),A=a.valueNode.getBoundingClientRect(),L=v.getBoundingClientRect();if(a.dir!=="rtl"){const Z=L.left-R.left,N=A.left-Z,k=P.left-N,T=P.width+k,re=Math.max(T,R.width),ae=window.innerWidth-ye,te=yt(N,[ye,Math.max(ye,ae-re)]);c.style.minWidth=T+"px",c.style.left=te+"px"}else{const Z=R.right-L.right,N=window.innerWidth-A.right-Z,k=window.innerWidth-P.right-N,T=P.width+k,re=Math.max(T,R.width),ae=window.innerWidth-ye,te=yt(N,[ye,Math.max(ye,ae-re)]);c.style.minWidth=T+"px",c.style.right=te+"px"}const M=h(),D=window.innerHeight-ye*2,W=x.scrollHeight,H=window.getComputedStyle(f),U=parseInt(H.borderTopWidth,10),V=parseInt(H.paddingTop,10),Y=parseInt(H.borderBottomWidth,10),F=parseInt(H.paddingBottom,10),J=U+V+W+F+Y,se=Math.min(m.offsetHeight*5,J),ce=window.getComputedStyle(x),he=parseInt(ce.paddingTop,10),de=parseInt(ce.paddingBottom,10),ne=P.top+P.height/2-ye,we=D-ne,ue=m.offsetHeight/2,$=m.offsetTop+ue,Q=U+V+$,K=J-Q;if(Q<=ne){const Z=M.length>0&&m===M[M.length-1].ref.current;c.style.bottom="0px";const N=f.clientHeight-x.offsetTop-x.offsetHeight,k=Math.max(we,ue+(Z?de:0)+N+Y),T=Q+k;c.style.height=T+"px"}else{const Z=M.length>0&&m===M[0].ref.current;c.style.top="0px";const k=Math.max(ne,U+x.offsetTop+(Z?he:0)+ue)+K;c.style.height=k+"px",x.scrollTop=Q-ne+x.offsetTop}c.style.margin=`${ye}px 0`,c.style.minHeight=se+"px",c.style.maxHeight=D+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[h,a.trigger,a.valueNode,c,f,x,m,v,a.dir,r]);C.useLayoutEffect2(()=>w(),[w]);const[S,E]=l.useState();C.useLayoutEffect2(()=>{f&&E(window.getComputedStyle(f).zIndex)},[f]);const j=l.useCallback(P=>{P&&y.current===!0&&(w(),b?.(),y.current=!1)},[w,b]);return o.jsx(bc,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:j,children:o.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:o.jsx(C.Primitive.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});as.displayName=gc;var vc="SelectPopperPosition",Bn=l.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ye,...a}=e,i=pn(n);return o.jsx(ln,{...i,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Bn.displayName=vc;var[bc,Co]=dt(Je,{}),Vn="SelectViewport",is=l.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=Ve(Vn,n),i=Co(Vn,n),c=C.useComposedRefs(t,a.onViewportChange),d=l.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(un.Slot,{scope:n,children:o.jsx(C.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:C.composeEventHandlers(s.onScroll,f=>{const u=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=i;if(h?.current&&p){const g=Math.abs(d.current-u.scrollTop);if(g>0){const y=window.innerHeight-ye*2,x=parseFloat(p.style.minHeight),m=parseFloat(p.style.height),v=Math.max(x,m);if(v<y){const b=v+g,w=Math.min(y,b),S=b-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}d.current=u.scrollTop})})})]})});is.displayName=Vn;var ls="SelectGroup",[wc,yc]=dt(ls),cs=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=C.useId();return o.jsx(wc,{scope:n,id:s,children:o.jsx(C.Primitive.div,{role:"group","aria-labelledby":s,...r,ref:t})})});cs.displayName=ls;var ds="SelectLabel",us=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=yc(ds,n);return o.jsx(C.Primitive.div,{id:s.id,...r,ref:t})});us.displayName=ds;var Yt="SelectItem",[Cc,fs]=dt(Yt),ps=l.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...i}=e,c=Be(Yt,n),d=Ve(Yt,n),f=c.value===r,[u,p]=l.useState(a??""),[h,g]=l.useState(!1),y=C.useComposedRefs(t,b=>d.itemRefCallback?.(b,r,s)),x=C.useId(),m=l.useRef("touch"),v=()=>{s||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(Cc,{scope:n,value:r,disabled:s,textId:x,isSelected:f,onItemTextChange:l.useCallback(b=>{p(w=>w||(b?.textContent??"").trim())},[]),children:o.jsx(un.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:o.jsx(C.Primitive.div,{role:"option","aria-labelledby":x,"data-highlighted":h?"":void 0,"aria-selected":f&&h,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:y,onFocus:C.composeEventHandlers(i.onFocus,()=>g(!0)),onBlur:C.composeEventHandlers(i.onBlur,()=>g(!1)),onClick:C.composeEventHandlers(i.onClick,()=>{m.current!=="mouse"&&v()}),onPointerUp:C.composeEventHandlers(i.onPointerUp,()=>{m.current==="mouse"&&v()}),onPointerDown:C.composeEventHandlers(i.onPointerDown,b=>{m.current=b.pointerType}),onPointerMove:C.composeEventHandlers(i.onPointerMove,b=>{m.current=b.pointerType,s?d.onItemLeave?.():m.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:C.composeEventHandlers(i.onPointerLeave,b=>{b.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:C.composeEventHandlers(i.onKeyDown,b=>{d.searchRef?.current!==""&&b.key===" "||(lc.includes(b.key)&&v(),b.key===" "&&b.preventDefault())})})})})});ps.displayName=Yt;var gt="SelectItemText",ms=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,i=Be(gt,n),c=Ve(gt,n),d=fs(gt,n),f=fc(gt,n),[u,p]=l.useState(null),h=C.useComposedRefs(t,v=>p(v),d.onItemTextChange,v=>c.itemTextRefCallback?.(v,d.value,d.disabled)),g=u?.textContent,y=l.useMemo(()=>o.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:m}=f;return C.useLayoutEffect2(()=>(x(y),()=>m(y)),[x,m,y]),o.jsxs(o.Fragment,{children:[o.jsx(C.Primitive.span,{id:d.textId,...a,ref:h}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?so.createPortal(a.children,i.valueNode):null]})});ms.displayName=gt;var hs="SelectItemIndicator",xs=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fs(hs,n).isSelected?o.jsx(C.Primitive.span,{"aria-hidden":!0,...r,ref:t}):null});xs.displayName=hs;var Wn="SelectScrollUpButton",gs=l.forwardRef((e,t)=>{const n=Ve(Wn,e.__scopeSelect),r=Co(Wn,e.__scopeSelect),[s,a]=l.useState(!1),i=C.useComposedRefs(t,r.onScrollButtonChange);return C.useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;a(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?o.jsx(bs,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});gs.displayName=Wn;var Un="SelectScrollDownButton",vs=l.forwardRef((e,t)=>{const n=Ve(Un,e.__scopeSelect),r=Co(Un,e.__scopeSelect),[s,a]=l.useState(!1),i=C.useComposedRefs(t,r.onScrollButtonChange);return C.useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,u=Math.ceil(d.scrollTop)<f;a(u)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?o.jsx(bs,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});vs.displayName=Un;var bs=l.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=Ve("SelectScrollButton",n),i=l.useRef(null),c=fn(n),d=l.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return l.useEffect(()=>()=>d(),[d]),C.useLayoutEffect2(()=>{c().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),o.jsx(C.Primitive.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:C.composeEventHandlers(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:C.composeEventHandlers(s.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:C.composeEventHandlers(s.onPointerLeave,()=>{d()})})}),Sc="SelectSeparator",ws=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(C.Primitive.div,{"aria-hidden":!0,...r,ref:t})});ws.displayName=Sc;var Yn="SelectArrow",jc=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=pn(n),a=Be(Yn,n),i=Ve(Yn,n);return a.open&&i.position==="popper"?o.jsx(cn,{...s,...r,ref:t}):null});jc.displayName=Yn;var Nc="SelectBubbleInput",ys=l.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=l.useRef(null),a=C.useComposedRefs(r,s),i=en(t);return l.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&u){const p=new Event("change",{bubbles:!0});u.call(c,t),c.dispatchEvent(p)}},[i,t]),o.jsx(C.Primitive.select,{...n,style:{...sr,...n.style},ref:a,defaultValue:t})});ys.displayName=Nc;function Cs(e){return e===""||e===void 0}function Ss(e){const t=C.useCallbackRef(e),n=l.useRef(""),r=l.useRef(0),s=l.useCallback(i=>{const c=n.current+i;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),a=l.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function js(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=Ec(e,Math.max(a,0));s.length===1&&(i=i.filter(f=>f!==n));const d=i.find(f=>f.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function Ec(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ns=Gr,Es=Zr,Rc=es,Rs=ts,Ps=ns,ks=os,Ts=is,Pc=cs,kc=us,Tc=ps,Ic=ms,Mc=xs,Ac=gs,$c=vs,_c=ws,Is=["PageUp","PageDown"],Ms=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],As={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ut="Slider",[Xn,Lc,Oc]=Zt(ut),[$s]=C.createContextScope(ut,[Oc]),[Dc,mn]=$s(ut),_s=l.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:a=1,orientation:i="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:u,onValueChange:p=()=>{},onValueCommit:h=()=>{},inverted:g=!1,form:y,...x}=e,m=l.useRef(new Set),v=l.useRef(0),w=i==="horizontal"?Hc:Fc,[S=[],E]=C.useControllableState({prop:u,defaultProp:f,onChange:M=>{[...m.current][v.current]?.focus(),p(M)}}),j=l.useRef(S);function P(M){const D=Uc(S,M);L(M,D)}function R(M){L(M,v.current)}function A(){const M=j.current[v.current];S[v.current]!==M&&h(S)}function L(M,D,{commit:W}={commit:!1}){const H=qc(a),U=Gc(Math.round((M-r)/a)*a+r,H),V=yt(U,[r,s]);E((Y=[])=>{const F=Vc(Y,V,D);if(Kc(F,d*a)){v.current=F.indexOf(V);const J=String(F)!==String(Y);return J&&W&&h(F),J?F:Y}else return Y})}return o.jsx(Dc,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:s,valueIndexToChangeRef:v,thumbs:m.current,values:S,orientation:i,form:y,children:o.jsx(Xn.Provider,{scope:e.__scopeSlider,children:o.jsx(Xn.Slot,{scope:e.__scopeSlider,children:o.jsx(w,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:t,onPointerDown:C.composeEventHandlers(x.onPointerDown,()=>{c||(j.current=S)}),min:r,max:s,inverted:g,onSlideStart:c?void 0:P,onSlideMove:c?void 0:R,onSlideEnd:c?void 0:A,onHomeKeyDown:()=>!c&&L(r,0,{commit:!0}),onEndKeyDown:()=>!c&&L(s,S.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:D})=>{if(!c){const U=Is.includes(M.key)||M.shiftKey&&Ms.includes(M.key)?10:1,V=v.current,Y=S[V],F=a*U*D;L(Y+F,V,{commit:!0})}}})})})})});_s.displayName=ut;var[Ls,Os]=$s(ut,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Hc=l.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:a,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...u}=e,[p,h]=l.useState(null),g=C.useComposedRefs(t,w=>h(w)),y=l.useRef(void 0),x=St(s),m=x==="ltr",v=m&&!a||!m&&a;function b(w){const S=y.current||p.getBoundingClientRect(),E=[0,S.width],P=So(E,v?[n,r]:[r,n]);return y.current=S,P(w-S.left)}return o.jsx(Ls,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:o.jsx(Ds,{dir:x,"data-orientation":"horizontal",...u,ref:g,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=b(w.clientX);i?.(S)},onSlideMove:w=>{const S=b(w.clientX);c?.(S)},onSlideEnd:()=>{y.current=void 0,d?.()},onStepKeyDown:w=>{const E=As[v?"from-left":"from-right"].includes(w.key);f?.({event:w,direction:E?-1:1})}})})}),Fc=l.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:a,onSlideMove:i,onSlideEnd:c,onStepKeyDown:d,...f}=e,u=l.useRef(null),p=C.useComposedRefs(t,u),h=l.useRef(void 0),g=!s;function y(x){const m=h.current||u.current.getBoundingClientRect(),v=[0,m.height],w=So(v,g?[r,n]:[n,r]);return h.current=m,w(x-m.top)}return o.jsx(Ls,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:o.jsx(Ds,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const m=y(x.clientY);a?.(m)},onSlideMove:x=>{const m=y(x.clientY);i?.(m)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:x=>{const v=As[g?"from-bottom":"from-top"].includes(x.key);d?.({event:x,direction:v?-1:1})}})})}),Ds=l.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:a,onHomeKeyDown:i,onEndKeyDown:c,onStepKeyDown:d,...f}=e,u=mn(ut,n);return o.jsx(C.Primitive.span,{...f,ref:t,onKeyDown:C.composeEventHandlers(e.onKeyDown,p=>{p.key==="Home"?(i(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):Is.concat(Ms).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:C.composeEventHandlers(e.onPointerDown,p=>{const h=p.target;h.setPointerCapture(p.pointerId),p.preventDefault(),u.thumbs.has(h)?h.focus():r(p)}),onPointerMove:C.composeEventHandlers(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&s(p)}),onPointerUp:C.composeEventHandlers(e.onPointerUp,p=>{const h=p.target;h.hasPointerCapture(p.pointerId)&&(h.releasePointerCapture(p.pointerId),a(p))})})}),Hs="SliderTrack",Fs=l.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=mn(Hs,n);return o.jsx(C.Primitive.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});Fs.displayName=Hs;var Kn="SliderRange",zs=l.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=mn(Kn,n),a=Os(Kn,n),i=l.useRef(null),c=C.useComposedRefs(t,i),d=s.values.length,f=s.values.map(h=>Ws(h,s.min,s.max)),u=d>1?Math.min(...f):0,p=100-Math.max(...f);return o.jsx(C.Primitive.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:c,style:{...e.style,[a.startEdge]:u+"%",[a.endEdge]:p+"%"}})});zs.displayName=Kn;var qn="SliderThumb",Bs=l.forwardRef((e,t)=>{const n=Lc(e.__scopeSlider),[r,s]=l.useState(null),a=C.useComposedRefs(t,c=>s(c)),i=l.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return o.jsx(zc,{...e,ref:a,index:i})}),zc=l.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...a}=e,i=mn(qn,n),c=Os(qn,n),[d,f]=l.useState(null),u=C.useComposedRefs(t,b=>f(b)),p=d?i.form||!!d.closest("form"):!0,h=tn(d),g=i.values[r],y=g===void 0?0:Ws(g,i.min,i.max),x=Wc(r,i.values.length),m=h?.[c.size],v=m?Yc(m,y,c.direction):0;return l.useEffect(()=>{if(d)return i.thumbs.add(d),()=>{i.thumbs.delete(d)}},[d,i.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${y}% + ${v}px)`},children:[o.jsx(Xn.ItemSlot,{scope:e.__scopeSlider,children:o.jsx(C.Primitive.span,{role:"slider","aria-label":e["aria-label"]||x,"aria-valuemin":i.min,"aria-valuenow":g,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...a,ref:u,style:g===void 0?{display:"none"}:e.style,onFocus:C.composeEventHandlers(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),p&&o.jsx(Vs,{name:s??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:g},r)]})});Bs.displayName=qn;var Bc="RadioBubbleInput",Vs=l.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=l.useRef(null),a=C.useComposedRefs(s,r),i=en(t);return l.useEffect(()=>{const c=s.current;if(!c)return;const d=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&u){const p=new Event("input",{bubbles:!0});u.call(c,t),c.dispatchEvent(p)}},[i,t]),o.jsx(C.Primitive.input,{style:{display:"none"},...n,ref:a,defaultValue:t})});Vs.displayName=Bc;function Vc(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,a)=>s-a)}function Ws(e,t,n){const a=100/(n-t)*(e-t);return yt(a,[0,100])}function Wc(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Uc(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function Yc(e,t,n){const r=e/2,a=So([0,50],[0,r]);return(r-a(t)*n)*n}function Xc(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Kc(e,t){if(t>0){const n=Xc(e);return Math.min(...n)>=t}return!0}function So(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function qc(e){return(String(e).split(".")[1]||"").length}function Gc(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Jc=_s,Zc=Fs,Qc=zs,ed=Bs,hn="Switch",[td]=C.createContextScope(hn),[nd,od]=td(hn),Us=l.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:i,disabled:c,value:d="on",onCheckedChange:f,form:u,...p}=e,[h,g]=l.useState(null),y=C.useComposedRefs(t,w=>g(w)),x=l.useRef(!1),m=h?u||!!h.closest("form"):!0,[v,b]=C.useControllableState({prop:s,defaultProp:a??!1,onChange:f,caller:hn});return o.jsxs(nd,{scope:n,checked:v,disabled:c,children:[o.jsx(C.Primitive.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":qs(v),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:y,onClick:C.composeEventHandlers(e.onClick,w=>{b(S=>!S),m&&(x.current=w.isPropagationStopped(),x.current||w.stopPropagation())})}),m&&o.jsx(Ks,{control:h,bubbles:!x.current,name:r,value:d,checked:v,required:i,disabled:c,form:u,style:{transform:"translateX(-100%)"}})]})});Us.displayName=hn;var Ys="SwitchThumb",Xs=l.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=od(Ys,n);return o.jsx(C.Primitive.span,{"data-state":qs(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});Xs.displayName=Ys;var rd="SwitchBubbleInput",Ks=l.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},a)=>{const i=l.useRef(null),c=C.useComposedRefs(i,a),d=en(n),f=tn(t);return l.useEffect(()=>{const u=i.current;if(!u)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&g){const y=new Event("click",{bubbles:r});g.call(u,n),u.dispatchEvent(y)}},[d,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ks.displayName=rd;function qs(e){return e?"checked":"unchecked"}var Gs=Us,sd=Xs,xn="Tabs",[ad]=C.createContextScope(xn,[wo]),Js=wo(),[id,jo]=ad(xn),Zs=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:a,orientation:i="horizontal",dir:c,activationMode:d="automatic",...f}=e,u=St(c),[p,h]=C.useControllableState({prop:r,onChange:s,defaultProp:a??"",caller:xn});return o.jsx(id,{scope:n,baseId:C.useId(),value:p,onValueChange:h,orientation:i,dir:u,activationMode:d,children:o.jsx(C.Primitive.div,{dir:u,"data-orientation":i,...f,ref:t})})});Zs.displayName=xn;var Qs="TabsList",ea=l.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,a=jo(Qs,n),i=Js(n);return o.jsx(Or,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:r,children:o.jsx(C.Primitive.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});ea.displayName=Qs;var ta="TabsTrigger",na=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...a}=e,i=jo(ta,n),c=Js(n),d=sa(i.baseId,r),f=aa(i.baseId,r),u=r===i.value;return o.jsx(Dr,{asChild:!0,...c,focusable:!s,active:u,children:o.jsx(C.Primitive.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":f,"data-state":u?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...a,ref:t,onMouseDown:C.composeEventHandlers(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?i.onValueChange(r):p.preventDefault()}),onKeyDown:C.composeEventHandlers(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(r)}),onFocus:C.composeEventHandlers(e.onFocus,()=>{const p=i.activationMode!=="manual";!u&&!s&&p&&i.onValueChange(r)})})})});na.displayName=ta;var oa="TabsContent",ra=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:a,...i}=e,c=jo(oa,n),d=sa(c.baseId,r),f=aa(c.baseId,r),u=r===c.value,p=l.useRef(u);return l.useEffect(()=>{const h=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(h)},[]),o.jsx(C.Presence,{present:s||u,children:({present:h})=>o.jsx(C.Primitive.div,{"data-state":u?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!h,id:f,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:h&&a})})});ra.displayName=oa;function sa(e,t){return`${e}-trigger-${t}`}function aa(e,t){return`${e}-content-${t}`}var ld=Zs,cd=ea,dd=na,ud=ra,[gn]=C.createContextScope("Tooltip",[Ze]),vn=Ze(),ia="TooltipProvider",fd=700,Gn="tooltip.open",[pd,No]=gn(ia),la=e=>{const{__scopeTooltip:t,delayDuration:n=fd,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,i=l.useRef(!0),c=l.useRef(!1),d=l.useRef(0);return l.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),o.jsx(pd,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(d.current),i.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:a})};la.displayName=ia;var Ct="Tooltip",[md,Pt]=gn(Ct),ca=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:i,delayDuration:c}=e,d=No(Ct,e.__scopeTooltip),f=vn(t),[u,p]=l.useState(null),h=C.useId(),g=l.useRef(0),y=i??d.disableHoverableContent,x=c??d.delayDuration,m=l.useRef(!1),[v,b]=C.useControllableState({prop:r,defaultProp:s??!1,onChange:P=>{P?(d.onOpen(),document.dispatchEvent(new CustomEvent(Gn))):d.onClose(),a?.(P)},caller:Ct}),w=l.useMemo(()=>v?m.current?"delayed-open":"instant-open":"closed",[v]),S=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,m.current=!1,b(!0)},[b]),E=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,b(!1)},[b]),j=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{m.current=!0,b(!0),g.current=0},x)},[x,b]);return l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),o.jsx(an,{...f,children:o.jsx(md,{scope:t,contentId:h,open:v,stateAttribute:w,trigger:u,onTriggerChange:p,onTriggerEnter:l.useCallback(()=>{d.isOpenDelayedRef.current?j():S()},[d.isOpenDelayedRef,j,S]),onTriggerLeave:l.useCallback(()=>{y?E():(window.clearTimeout(g.current),g.current=0)},[E,y]),onOpen:S,onClose:E,disableHoverableContent:y,children:n})})};ca.displayName=Ct;var Jn="TooltipTrigger",da=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Pt(Jn,n),a=No(Jn,n),i=vn(n),c=l.useRef(null),d=C.useComposedRefs(t,c,s.onTriggerChange),f=l.useRef(!1),u=l.useRef(!1),p=l.useCallback(()=>f.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),o.jsx(Nt,{asChild:!0,...i,children:o.jsx(C.Primitive.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:C.composeEventHandlers(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:C.composeEventHandlers(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:C.composeEventHandlers(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:C.composeEventHandlers(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:C.composeEventHandlers(e.onBlur,s.onClose),onClick:C.composeEventHandlers(e.onClick,s.onClose)})})});da.displayName=Jn;var Eo="TooltipPortal",[hd,xd]=gn(Eo,{forceMount:void 0}),ua=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,a=Pt(Eo,t);return o.jsx(hd,{scope:t,forceMount:n,children:o.jsx(C.Presence,{present:n||a.open,children:o.jsx(C.Portal,{asChild:!0,container:s,children:r})})})};ua.displayName=Eo;var it="TooltipContent",fa=l.forwardRef((e,t)=>{const n=xd(it,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,i=Pt(it,e.__scopeTooltip);return o.jsx(C.Presence,{present:r||i.open,children:i.disableHoverableContent?o.jsx(pa,{side:s,...a,ref:t}):o.jsx(gd,{side:s,...a,ref:t})})}),gd=l.forwardRef((e,t)=>{const n=Pt(it,e.__scopeTooltip),r=No(it,e.__scopeTooltip),s=l.useRef(null),a=C.useComposedRefs(t,s),[i,c]=l.useState(null),{trigger:d,onClose:f}=n,u=s.current,{onPointerInTransitChange:p}=r,h=l.useCallback(()=>{c(null),p(!1)},[p]),g=l.useCallback((y,x)=>{const m=y.currentTarget,v={x:y.clientX,y:y.clientY},b=Cd(v,m.getBoundingClientRect()),w=Sd(v,b),S=jd(x.getBoundingClientRect()),E=Ed([...w,...S]);c(E),p(!0)},[p]);return l.useEffect(()=>()=>h(),[h]),l.useEffect(()=>{if(d&&u){const y=m=>g(m,u),x=m=>g(m,d);return d.addEventListener("pointerleave",y),u.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",x)}}},[d,u,g,h]),l.useEffect(()=>{if(i){const y=x=>{const m=x.target,v={x:x.clientX,y:x.clientY},b=d?.contains(m)||u?.contains(m),w=!Nd(v,i);b?h():w&&(h(),f())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[d,u,i,f,h]),o.jsx(pa,{...e,ref:a})}),[vd,bd]=gn(Ct,{isInside:!1}),wd=Ke.createSlottable("TooltipContent"),pa=l.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:i,...c}=e,d=Pt(it,n),f=vn(n),{onClose:u}=d;return l.useEffect(()=>(document.addEventListener(Gn,u),()=>document.removeEventListener(Gn,u)),[u]),l.useEffect(()=>{if(d.trigger){const p=h=>{h.target?.contains(d.trigger)&&u()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,u]),o.jsx(C.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:u,children:o.jsxs(ln,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(wd,{children:r}),o.jsx(vd,{scope:n,isInside:!0,children:o.jsx(ir,{id:d.contentId,role:"tooltip",children:s||r})})]})})});fa.displayName=it;var ma="TooltipArrow",yd=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=vn(n);return bd(ma,n).isInside?null:o.jsx(cn,{...s,...r,ref:t})});yd.displayName=ma;function Cd(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Sd(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function jd(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function Nd(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const c=t[a],d=t[i],f=c.x,u=c.y,p=d.x,h=d.y;u>r!=h>r&&n<(p-f)*(r-u)/(h-u)+f&&(s=!s)}return s}function Ed(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Rd(t)}function Rd(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(s.y-i.y)>=(a.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(s.y-i.y)>=(a.y-i.y)*(s.x-i.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Pd=la,kd=ca,Td=da,Id=ua,ha=fa;const xa=ro.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium leading-normal text-center cursor-pointer select-none touch-manipulation transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-in-out focus:outline-0 focus-visible:outline-0 disabled:pointer-events-none disabled:opacity-65 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:["bg-primary text-primary-foreground border border-primary","nqui-button-gradient nqui-button-shadow","opacity-90 hover:opacity-100","hover:bg-primary/90 hover:border-primary/90","focus:bg-primary/80 focus:border-primary/80","active:bg-primary/75 active:border-primary/75 active:shadow-[inset_0_3px_5px_rgba(0,0,0,0.125)] active:scale-95","disabled:bg-transparent disabled:shadow-none disabled:opacity-65"],destructive:["bg-destructive text-destructive-foreground border border-destructive","nqui-button-gradient nqui-button-shadow","opacity-90 hover:opacity-100","hover:bg-destructive/90 hover:border-destructive/90","focus:bg-destructive/80 focus:border-destructive/80","active:bg-destructive/75 active:border-destructive/75 active:shadow-[inset_0_3px_5px_rgba(0,0,0,0.125)] active:scale-95","disabled:bg-transparent disabled:shadow-none disabled:opacity-65"],secondary:["bg-secondary text-secondary-foreground border border-border","nqui-button-gradient nqui-button-shadow","opacity-90 hover:opacity-100","hover:bg-secondary/90 hover:border-border","focus:bg-secondary/80 focus:border-border","active:bg-secondary/75 active:border-border active:shadow-[inset_0_3px_5px_rgba(0,0,0,0.125)] active:scale-95","disabled:bg-transparent disabled:shadow-none disabled:opacity-65"],success:["bg-success text-success-foreground border border-success","nqui-button-gradient nqui-button-shadow","opacity-90 hover:opacity-100","hover:bg-success/90 hover:border-success/90","focus:bg-success/80 focus:border-success/80","active:bg-success/75 active:border-success/75 active:shadow-[inset_0_3px_5px_rgba(0,0,0,0.125)] active:scale-95","disabled:bg-transparent disabled:shadow-none disabled:opacity-65"],warning:["bg-warning text-warning-foreground border border-warning","nqui-button-gradient nqui-button-shadow","opacity-90 hover:opacity-100","hover:bg-warning/90 hover:border-warning/90","focus:bg-warning/80 focus:border-warning/80","active:bg-warning/75 active:border-warning/75 active:shadow-[inset_0_3px_5px_rgba(0,0,0,0.125)] active:scale-95","disabled:bg-transparent disabled:shadow-none disabled:opacity-65"],info:["bg-info text-info-foreground border border-info","nqui-button-gradient nqui-button-shadow","opacity-90 hover:opacity-100","hover:bg-info/90 hover:border-info/90","focus:bg-info/80 focus:border-info/80","active:bg-info/75 active:border-info/75 active:shadow-[inset_0_3px_5px_rgba(0,0,0,0.125)] active:scale-95","disabled:bg-transparent disabled:shadow-none disabled:opacity-65"],outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 min-w-7 px-3 rounded-md",sm:"h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-2 text-xs",lg:"h-8 min-w-8 px-4 rounded-md",icon:"h-7 w-7 p-0"}},defaultVariants:{variant:"default",size:"default"}}),ee=l.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},a)=>{if(!(t&&["default","destructive","secondary","success","warning","info"].includes(t))&&t){const u=t==="outline"||t==="ghost"||t==="link"?t:"default";return o.jsx(di.Button,{ref:a,variant:u,size:n,className:e,asChild:r,...s})}const d=r?Ke.Slot:"button",f=X.cn(xa({variant:t,size:n,className:e}));return o.jsx(d,{className:f,style:s.style,ref:a,...s})});ee.displayName="EnhancedButton";const ga=Pd,Zn=kd,Qn=Td,Xt=l.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx(Id,{children:o.jsx(ha,{ref:r,sideOffset:t,className:X.cn("z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));Xt.displayName=ha.displayName;const vt=l.forwardRef(({className:e,trackColor:t,rangeColor:n,thumbColor:r,thumbFillColor:s,thumbOutlineColor:a,gradientBackground:i,sliderType:c="custom",currentHue:d,currentChroma:f,...u},p)=>{const h=l.useRef(null),g=l.useCallback(v=>{h.current=v,typeof p=="function"?p(v):p&&(p.current=v)},[p]),y=(v,b)=>{if(u.disabled||!u.onValueChange||!u.value)return;const w=E=>{if(!h.current)return;const j=h.current.getBoundingClientRect(),P=Math.max(0,Math.min(1,(E.clientX-j.left)/j.width)),R=u.min||0,A=u.max||100,L=u.step||1,M=R+P*(A-R),D=Math.round(M/L)*L,H=[...u.value||[]];H[b]=D,u.onValueChange?.(H)},S=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",S)},m=c!=="custom"?(()=>{if(i)return i;switch(c){case"hue":return"linear-gradient(to right, hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%), hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%), hsl(360,100%,50%))";case"saturation":const v=d!==void 0?d:u.value?.[0]||0;return`linear-gradient(to right, hsl(${v}, 0%, 50%), hsl(${v}, 100%, 50%))`;case"lightness":const b=d!==void 0?d:u.value?.[0]||0;return`linear-gradient(to right, hsl(${b}, 100%, 0%), hsl(${b}, 100%, 100%))`;default:return n||"oklch(var(--primary))"}})():void 0;return o.jsxs("div",{ref:g,className:X.cn("relative flex touch-none select-none items-center",e),children:[o.jsx("div",{className:"relative grow overflow-hidden rounded-full cursor-pointer",style:{backgroundColor:t||"oklch(var(--secondary))",background:m,height:"0.5rem"},onClick:v=>{if(u.disabled||!u.onValueChange||!u.value||!h.current)return;const b=h.current.getBoundingClientRect(),w=Math.max(0,Math.min(1,(v.clientX-b.left)/b.width)),S=u.min||0,E=u.max||100,j=u.step||1,P=S+w*(E-S),R=Math.round(P/j)*j,A=[...u.value];A[0]=R,u.onValueChange(A)},children:o.jsx("div",{className:"absolute h-full bg-primary",style:{backgroundColor:c==="custom"?n:"transparent"}})}),(u.value||[0]).map((v,b)=>{const w=u.min||0,S=u.max||100,E=(v-w)/(S-w)*100;return o.jsx("div",{className:"absolute block h-5 w-5 rounded-full border-2 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 top-1/2",style:{left:`${Math.max(0,Math.min(100,E))}%`,transform:"translateX(-50%) translateY(-50%)",borderColor:a||r||"oklch(var(--primary))",backgroundColor:s||(r?`${r}20`:"oklch(var(--background))")},tabIndex:u.disabled?-1:0,role:"slider","aria-valuemin":w,"aria-valuemax":S,"aria-valuenow":v,"aria-disabled":u.disabled,onMouseDown:j=>{j.preventDefault(),y(j,b)}},b)})]})});vt.displayName="ColorSlider";function Md(e,t,n){if(!isFinite(e)||e<0||e>1)return"#000000";if(t<.001){const m=Math.max(0,Math.min(1,e)),v=b=>{const w=Math.round(b*255).toString(16);return w.length===1?"0"+w:w};return`#${v(m)}${v(m)}${v(m)}`}const r=n/360*2*Math.PI,s=t*Math.cos(r),a=t*Math.sin(r),i=e+.3963377774*s+.2158037573*a,c=e-.1055613458*s-.0638541728*a,d=e-.0894841775*s-1.291485548*a,f=Math.max(0,Math.min(1,Math.sign(i)*Math.pow(Math.abs(i)*.999999998*2-1,1/3))),u=Math.max(0,Math.min(1,Math.sign(c)*Math.pow(Math.abs(c)*.999999998*2-1,1/3))),p=Math.max(0,Math.min(1,Math.sign(d)*Math.pow(Math.abs(d)*.999999998*2-1,1/3))),h=m=>{const v=Math.round(m*255).toString(16);return v.length===1?"0"+v:v},g=h(f),y=h(u),x=h(p);return g==="NaN"||y==="NaN"||x==="NaN"?"#000000":`#${g}${y}${x}`}function $n(e){const t=e.match(/oklch\(([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\)/);return t?{L:parseFloat(t[1]),C:parseFloat(t[2]),H:parseFloat(t[3])}:{L:.5,C:.15,H:240}}function Ad(e,t,n){e=e/255,t=t/255,n=n/255,e=e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4),t=t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),n=n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);const r=.4122214708*e+.5363325363*t+.0514459929*n,s=.2119034982*e+.6806995451*t+.1073969566*n,a=.0883024619*e+.2817188376*t+.6299787005*n,i=Math.pow(Math.abs(r)*.999999998,1/3)*Math.sign(r)*.5+.5,c=r-s,d=(r+s-2*a)/2,f=Math.sqrt(c*c+d*d);let u=Math.atan2(d,c)*(180/Math.PI);return u<0&&(u+=360),{L:i,C:f,H:u}}function Qe({value:e="oklch(0.5 0.15 240)",onChange:t,className:n,disabled:r,variant:s="popover"}){const[a,i]=l.useState(!1),[c,d]=l.useState(()=>$n(e)),[f,u]=l.useState(null);l.useEffect(()=>{d($n(e))},[e]);const p=(S,E,j)=>{if(E<.001||!isFinite(E))return{h:0,s:0,l:Math.max(0,Math.min(100,S*100))};const P=j/360*2*Math.PI,R=E*Math.cos(P),A=E*Math.sin(P),L=S+.3963377774*R+.2158037573*A,M=S-.1055613458*R-.0638541728*A,D=S-.0894841775*R-1.291485548*A,W=Math.max(0,Math.min(1,Math.sign(L)*Math.pow(Math.abs(L)*.999999998*2-1,1/3))),H=Math.max(0,Math.min(1,Math.sign(M)*Math.pow(Math.abs(M)*.999999998*2-1,1/3))),U=Math.max(0,Math.min(1,Math.sign(D)*Math.pow(Math.abs(D)*.999999998*2-1,1/3))),V=ue=>isFinite(ue)?ue<=.0031308?12.92*ue:1.055*Math.pow(ue,1/2.4)-.055:0,Y=Math.max(0,Math.min(1,V(W))),F=Math.max(0,Math.min(1,V(H))),J=Math.max(0,Math.min(1,V(U))),se=Math.max(Y,F,J),ce=Math.min(Y,F,J),he=se-ce;let de=0;he!==0&&(se===Y?de=(F-J)/he%6:se===F?de=(J-Y)/he+2:de=(Y-F)/he+4,de=Math.round(de*60),de<0&&(de+=360));const ne=(se+ce)/2,we=se===0||ce===1?0:(se-ce)/(1-Math.abs(2*ne-1));return{h:de,s:Math.max(0,Math.min(100,we*100)),l:Math.max(0,Math.min(100,ne*100))}},h=async(S,E)=>{try{await navigator.clipboard.writeText(S),u(E),setTimeout(()=>u(null),2e3)}catch(j){console.error("Failed to copy:",j)}},g=(S,E)=>{const j={...c,[S]:E};d(j),t?.(`oklch(${j.L} ${j.C} ${j.H})`)},y=S=>{const E=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(S);if(E){const j=parseInt(E[1],16),P=parseInt(E[2],16),R=parseInt(E[3],16),A=Ad(j,P,R);d(A),t?.(`oklch(${A.L} ${A.C} ${A.H})`)}},x=Md(c.L,c.C,c.H),m=`oklch(${c.L.toFixed(2)} ${c.C.toFixed(2)} ${c.H})`,v=p(c.L,c.C,c.H),b=`hsl(${Math.round(v.h)} ${Math.round(v.s)}% ${Math.round(v.l)}%)`,w=o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"h-16 w-16 rounded border border-border flex-shrink-0",style:{backgroundColor:`oklch(${c.L} ${c.C} ${c.H})`}}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-semibold mb-1",children:"OKLCH"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{type:"text",value:m,readOnly:!0,className:"text-[10px] font-mono w-full px-2 py-1 border border-border rounded bg-muted"}),o.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>h(m,"oklch"),children:f==="oklch"?o.jsx(z.HugeiconsIcon,{icon:B.Tick02Icon,size:12,className:"w-3 h-3 text-success-foreground"}):o.jsx(z.HugeiconsIcon,{icon:B.Copy01Icon,size:12,className:"w-3 h-3"})})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-semibold mb-1",children:"HEX"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{type:"text",value:x,onChange:S=>y(S.target.value),className:"text-[10px] font-mono w-full px-2 py-1 border border-border rounded bg-background"}),o.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>h(x,"hex"),children:f==="hex"?o.jsx(z.HugeiconsIcon,{icon:B.Tick02Icon,size:12,className:"w-3 h-3 text-success-foreground"}):o.jsx(z.HugeiconsIcon,{icon:B.Copy01Icon,size:12,className:"w-3 h-3"})})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-semibold mb-1",children:"HSL"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{type:"text",value:b,readOnly:!0,className:"text-[10px] font-mono w-full px-2 py-1 border border-border rounded bg-muted"}),o.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>h(b,"hsl"),children:f==="hsl"?o.jsx(z.HugeiconsIcon,{icon:B.Tick02Icon,size:12,className:"w-3 h-3 text-success-foreground"}):o.jsx(z.HugeiconsIcon,{icon:B.Copy01Icon,size:12,className:"w-3 h-3"})})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{className:"text-xs font-medium",children:"Hue"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[Math.round(c.H),"°"]})]}),o.jsx(vt,{value:[c.H],onValueChange:([S])=>g("H",S),min:0,max:360,step:1,sliderType:"hue",thumbColor:`oklch(${c.L} ${c.C} ${c.H})`})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{className:"text-xs font-medium",children:"Chroma"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[(c.C*100).toFixed(0),"%"]})]}),o.jsx(vt,{value:[c.C*100],onValueChange:([S])=>g("C",S/100),min:0,max:50,step:1,sliderType:"saturation",currentHue:c.H,thumbColor:`oklch(${c.L} ${c.C} ${c.H})`})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{className:"text-xs font-medium",children:"Lightness"}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[(c.L*100).toFixed(0),"%"]})]}),o.jsx(vt,{value:[c.L*100],onValueChange:([S])=>g("L",S/100),min:0,max:100,step:1,sliderType:"lightness",currentHue:c.H,thumbColor:`oklch(${c.L} ${c.C} ${c.H})`})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-medium mb-2",children:"Quick Colors"}),o.jsx("div",{className:"grid grid-cols-8 gap-1",children:[{name:"Red",oklch:"oklch(0.55 0.22 25)"},{name:"Orange",oklch:"oklch(0.65 0.20 60)"},{name:"Yellow",oklch:"oklch(0.75 0.15 100)"},{name:"Lime",oklch:"oklch(0.70 0.18 140)"},{name:"Green",oklch:"oklch(0.60 0.20 160)"},{name:"Cyan",oklch:"oklch(0.65 0.15 200)"},{name:"Blue",oklch:"oklch(0.60 0.25 240)"},{name:"Purple",oklch:"oklch(0.55 0.22 280)"}].map(S=>{const E=$n(S.oklch);return o.jsx("button",{onClick:()=>{d(E),t?.(S.oklch)},className:"h-8 w-full rounded border border-border transition-all hover:scale-110",style:{backgroundColor:S.oklch},title:S.name},S.name)})})]})]});return s==="inline"?o.jsx("div",{className:X.cn("w-full",n),children:w}):o.jsxs(Ia,{open:a,onOpenChange:i,children:[o.jsx(Ma,{asChild:!0,children:o.jsx(ee,{variant:"outline",disabled:r,className:X.cn("h-8 w-8 p-0 border-2",n),style:{backgroundColor:`oklch(${c.L} ${c.C} ${c.H})`},children:o.jsx("span",{className:"sr-only",children:"Pick a color"})})}),o.jsx(Aa,{className:"w-80 p-4 border-border shadow-lg z-[var(--z-popover)]",children:w})]})}function $d({...e}){return o.jsx(Ns,{"data-slot":"select",...e})}function va({className:e,...t}){return o.jsx(Pc,{"data-slot":"select-group",className:X.cn("scroll-my-1 p-1",e),...t})}function ba({...e}){return o.jsx(Rc,{"data-slot":"select-value",...e})}function _d({className:e,size:t="default",children:n,...r}){return o.jsxs(Es,{"data-slot":"select-trigger","data-size":t,className:X.cn("border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,o.jsx(Rs,{asChild:!0,children:o.jsx(z.HugeiconsIcon,{icon:B.UnfoldMoreIcon,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function Ld({className:e,children:t,position:n="item-aligned",align:r="center",...s}){return o.jsx(Ps,{children:o.jsxs(ks,{"data-slot":"select-content",className:X.cn("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative z-[var(--z-popover)] max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...s,children:[o.jsx(Ro,{}),o.jsx(Ts,{"data-position":n,className:X.cn("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]",n==="popper"&&""),children:t}),o.jsx(Po,{})]})})}function wa({className:e,...t}){return o.jsx(kc,{"data-slot":"select-label",className:X.cn("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function ya({className:e,children:t,...n}){return o.jsxs(Tc,{"data-slot":"select-item",className:X.cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[o.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center",children:o.jsx(Mc,{children:o.jsx(z.HugeiconsIcon,{icon:B.Tick02Icon,strokeWidth:2,className:"pointer-events-none"})})}),o.jsx(Ic,{children:t})]})}function Ca({className:e,...t}){return o.jsx(_c,{"data-slot":"select-separator",className:X.cn("bg-border/50 -mx-1 my-1 h-px pointer-events-none",e),...t})}function Ro({className:e,...t}){return o.jsx(Ac,{"data-slot":"select-scroll-up-button",className:X.cn("bg-popover z-[var(--z-popover)] flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...t,children:o.jsx(z.HugeiconsIcon,{icon:B.ArrowUp01Icon,strokeWidth:2})})}function Po({className:e,...t}){return o.jsx($c,{"data-slot":"select-scroll-down-button",className:X.cn("bg-popover z-[var(--z-popover)] flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...t,children:o.jsx(z.HugeiconsIcon,{icon:B.ArrowDown01Icon,strokeWidth:2})})}function Sa({blur:e=16,borderRadius:t=0,className:n}){const s=`frostyGlassMask-${l.useId().replace(/:/g,"-")}`;l.useEffect(()=>{fetch("http://127.0.0.1:7242/ingest/4df26b36-056f-4f25-87e5-cdd927efe4db",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"frosted-glass.tsx:39",message:"FrostedGlass rendered",data:{blur:e,borderRadius:t,useSvgMask:t>0},timestamp:Date.now(),sessionId:"debug-session",runId:"run1",hypothesisId:"A"})}).catch(()=>{})},[e,t]);const a=t>0;return o.jsxs(o.Fragment,{children:[a&&o.jsx("svg",{className:"absolute inset-0 pointer-events-none",width:"100%",height:"100%",preserveAspectRatio:"none","aria-hidden":"true",children:o.jsx("mask",{id:s,children:o.jsx("rect",{width:"100%",height:"100%",fill:"white",rx:t,ry:t})})}),o.jsx("div",{className:X.cn("absolute inset-0 pointer-events-none","h-[200%]","bg-background/3",n),style:{"--blur":`${e}px`,backdropFilter:`blur(${e}px)`,WebkitBackdropFilter:`blur(${e}px)`,maskImage:a?`url(#${s})`:"linear-gradient(to bottom, black 0% 50%, transparent 50% 100%)",WebkitMaskImage:a?`url(#${s})`:"linear-gradient(to bottom, black 0% 50%, transparent 50% 100%)"}})]})}function Lt({...e}){return o.jsx(Ns,{"data-slot":"select",...e})}function Od({className:e,...t}){return o.jsx(va,{className:e,...t})}function Ot({...e}){return o.jsx(ba,{...e})}function Dt({className:e,size:t="default",children:n,minWidth:r="120px",...s}){return l.useEffect(()=>{const a="enhanced-select-styles";if(document.getElementById(a))return;const i=document.createElement("style");i.id=a,i.textContent=`
|
|
2
|
+
/* Enhanced Select Trigger - Layered shadow with semi-transparent border */
|
|
3
|
+
[data-slot="select-trigger"].enhanced-select-trigger {
|
|
4
|
+
border: 1px solid color-mix(in oklch, var(--input) 50%, transparent) !important;
|
|
5
|
+
box-shadow:
|
|
6
|
+
/* First layer: Darker border effect on bottom where shadow overlaps */
|
|
7
|
+
0 1px 0 0 color-mix(in oklch, var(--input) 40%, transparent),
|
|
8
|
+
/* Second layer: Main shadow for depth */
|
|
9
|
+
0 1px 2px 0 oklch(0.15 0 0 / 0.05),
|
|
10
|
+
/* Third layer: Additional depth */
|
|
11
|
+
0 2px 4px -1px oklch(0.15 0 0 / 0.03) !important;
|
|
12
|
+
border-top-color: color-mix(in oklch, var(--input) 92%, oklch(1 0 0) 8%) !important;
|
|
13
|
+
border-left-color: color-mix(in oklch, var(--input) 92%, oklch(1 0 0) 8%) !important;
|
|
14
|
+
border-bottom-color: color-mix(in oklch, var(--input) 92%, oklch(0 0 0) 8%) !important;
|
|
15
|
+
border-right-color: color-mix(in oklch, var(--input) 92%, oklch(0 0 0) 8%) !important;
|
|
16
|
+
transition: all 150ms ease-in-out !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dark [data-slot="select-trigger"].enhanced-select-trigger {
|
|
20
|
+
border: 1px solid color-mix(in oklch, var(--input) 50%, transparent) !important;
|
|
21
|
+
box-shadow:
|
|
22
|
+
/* First layer: Darker border effect on bottom where shadow overlaps */
|
|
23
|
+
0 1px 0 0 color-mix(in oklch, var(--input) 40%, transparent),
|
|
24
|
+
/* Second layer: Main shadow for depth (darker for dark mode) */
|
|
25
|
+
0 1px 2px 0 oklch(0 0 0 / 0.3),
|
|
26
|
+
/* Third layer: Additional depth */
|
|
27
|
+
0 2px 4px -1px oklch(0 0 0 / 0.2) !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[data-slot="select-trigger"].enhanced-select-trigger:hover {
|
|
31
|
+
box-shadow:
|
|
32
|
+
/* First layer: Darker border effect on bottom */
|
|
33
|
+
0 1px 0 0 color-mix(in oklch, var(--input) 40%, transparent),
|
|
34
|
+
/* Second layer: Enhanced shadow on hover */
|
|
35
|
+
0 1px 3px 0 oklch(0.15 0 0 / 0.08),
|
|
36
|
+
/* Third layer: Additional depth */
|
|
37
|
+
0 2px 6px -1px oklch(0.15 0 0 / 0.04),
|
|
38
|
+
/* Fourth layer: Subtle outer glow */
|
|
39
|
+
0 4px 8px -2px oklch(0.15 0 0 / 0.02) !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.dark [data-slot="select-trigger"].enhanced-select-trigger:hover {
|
|
43
|
+
box-shadow:
|
|
44
|
+
/* First layer: Darker border effect on bottom */
|
|
45
|
+
0 1px 0 0 color-mix(in oklch, var(--input) 40%, transparent),
|
|
46
|
+
/* Second layer: Enhanced shadow on hover */
|
|
47
|
+
0 1px 3px 0 oklch(0 0 0 / 0.4),
|
|
48
|
+
/* Third layer: Additional depth */
|
|
49
|
+
0 2px 6px -1px oklch(0 0 0 / 0.3),
|
|
50
|
+
/* Fourth layer: Subtle outer glow */
|
|
51
|
+
0 4px 8px -2px oklch(0 0 0 / 0.2) !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[data-slot="select-trigger"].enhanced-select-trigger[data-state="open"] {
|
|
55
|
+
box-shadow:
|
|
56
|
+
/* First layer: Darker border effect on bottom */
|
|
57
|
+
0 1px 0 0 color-mix(in oklch, var(--input) 40%, transparent),
|
|
58
|
+
/* Second layer: Main shadow */
|
|
59
|
+
0 1px 2px 0 oklch(0.15 0 0 / 0.05),
|
|
60
|
+
/* Third layer: Additional depth */
|
|
61
|
+
0 2px 4px -1px oklch(0.15 0 0 / 0.03) !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.dark [data-slot="select-trigger"].enhanced-select-trigger[data-state="open"] {
|
|
65
|
+
box-shadow:
|
|
66
|
+
/* First layer: Darker border effect on bottom */
|
|
67
|
+
0 1px 0 0 color-mix(in oklch, var(--input) 40%, transparent),
|
|
68
|
+
/* Second layer: Main shadow */
|
|
69
|
+
0 1px 2px 0 oklch(0 0 0 / 0.3),
|
|
70
|
+
/* Third layer: Additional depth */
|
|
71
|
+
0 2px 4px -1px oklch(0 0 0 / 0.2) !important;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[data-slot="select-trigger"].enhanced-select-trigger:focus-visible {
|
|
75
|
+
box-shadow:
|
|
76
|
+
/* First layer: Darker border effect on bottom */
|
|
77
|
+
0 1px 0 0 color-mix(in oklch, var(--input) 40%, transparent),
|
|
78
|
+
/* Second layer: Main shadow */
|
|
79
|
+
0 1px 2px 0 oklch(0.15 0 0 / 0.05),
|
|
80
|
+
/* Third layer: Additional depth */
|
|
81
|
+
0 2px 4px -1px oklch(0.15 0 0 / 0.03),
|
|
82
|
+
/* Focus ring */
|
|
83
|
+
0 0 0 2px var(--ring) !important;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.dark [data-slot="select-trigger"].enhanced-select-trigger:focus-visible {
|
|
87
|
+
box-shadow:
|
|
88
|
+
/* First layer: Darker border effect on bottom */
|
|
89
|
+
0 1px 0 0 color-mix(in oklch, var(--input) 40%, transparent),
|
|
90
|
+
/* Second layer: Main shadow */
|
|
91
|
+
0 1px 2px 0 oklch(0 0 0 / 0.3),
|
|
92
|
+
/* Third layer: Additional depth */
|
|
93
|
+
0 2px 4px -1px oklch(0 0 0 / 0.2),
|
|
94
|
+
/* Focus ring */
|
|
95
|
+
0 0 0 2px var(--ring) !important;
|
|
96
|
+
}
|
|
97
|
+
`,document.head.appendChild(i)},[]),o.jsxs(Es,{"data-slot":"select-trigger","data-size":t,className:X.cn("enhanced-select-trigger","border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",r!=="fit"&&(r==="120px"?"min-w-[120px]":`min-w-[${r}]`),e),...s,children:[n,o.jsx(Rs,{asChild:!0,children:o.jsx(z.HugeiconsIcon,{icon:B.UnfoldMoreIcon,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function Ht({className:e,children:t,position:n="item-aligned",align:r="center",...s}){return o.jsx(Ps,{children:o.jsxs(ks,{"data-slot":"select-content",className:X.cn("text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 rounded-lg shadow-md ring-1 duration-100 relative z-[var(--z-popover)] max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-hidden",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...s,children:[o.jsx(Sa,{blur:16,borderRadius:8,className:"z-[var(--z-background)]"}),o.jsxs("div",{className:"relative z-[var(--z-content)] bg-popover/10 rounded-lg overflow-y-auto overflow-x-hidden max-h-[var(--radix-select-content-available-height)]",children:[o.jsx(Ro,{}),o.jsx(Ts,{"data-position":n,className:X.cn("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]",n==="popper"&&""),children:t}),o.jsx(Po,{})]})]})})}function Dd({className:e,...t}){return o.jsx(wa,{className:e,...t})}function Me({className:e,...t}){return o.jsx(ya,{className:e,...t})}function Hd({className:e,...t}){return o.jsx(Ca,{className:e,...t})}function ja({className:e,orientation:t="horizontal",...n}){return o.jsx(ld,{"data-slot":"tabs","data-orientation":t,className:X.cn("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const Fd=ro.cva("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Na({className:e,variant:t="default",...n}){return o.jsx(cd,{"data-slot":"tabs-list","data-variant":t,className:X.cn(Fd({variant:t}),e),...n})}function Ea({className:e,...t}){return o.jsx(dd,{"data-slot":"tabs-trigger",className:X.cn("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Ra({className:e,...t}){return o.jsx(ud,{"data-slot":"tabs-content",className:X.cn("text-xs flex-1 outline-none",e),...t})}const ko=pe.createContext(void 0),To=l.forwardRef(({className:e,value:t,defaultValue:n,onValueChange:r,orientation:s="horizontal",...a},i)=>{typeof fetch=="function"&&fetch("http://127.0.0.1:7253/ingest/dd1618ba-f7a7-49bb-8fc3-5befed63a2f3",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"fde4d0"},body:JSON.stringify({sessionId:"fde4d0",location:"enhanced-tabs.tsx:24",message:"EnhancedTabs orientation prop",data:{orientation:s,fromProps:s!=="horizontal"},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{});const[c,d]=pe.useState(n||""),f=t!==void 0,u=f?t:c,p=h=>{f||d(h),r?.(h)};return o.jsx(ko.Provider,{value:{value:u,onValueChange:p,orientation:s},children:o.jsx(ja,{ref:i,className:e,value:u,defaultValue:n,onValueChange:p,orientation:s,...a})})});To.displayName="EnhancedTabs";const Io=l.forwardRef(({className:e,orientation:t,children:n,...r},s)=>{const a=pe.useContext(ko),i=t||a?.orientation||"horizontal",c=X.cn(i==="vertical"&&"flex-col",e);typeof fetch=="function"&&fetch("http://127.0.0.1:7253/ingest/dd1618ba-f7a7-49bb-8fc3-5befed63a2f3",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"fde4d0"},body:JSON.stringify({sessionId:"fde4d0",location:"enhanced-tabs.tsx:EnhancedTabsList",message:"Applied orientation and list className",data:{appliedOrientation:i,contextOrientation:a?.orientation,addsFlexCol:i==="vertical",listClassNameSlice:c.slice(0,100)},timestamp:Date.now(),hypothesisId:"H6"})}).catch(()=>{});const d=pe.useRef(null),[f,u]=pe.useState({}),[p,h]=pe.useState(!1),g=l.useCallback(()=>{if(!d.current||!a?.value){h(!1);return}const x=d.current.querySelector('button[data-state="active"]');if(!x){h(!1);return}const m=d.current.getBoundingClientRect(),v=x.getBoundingClientRect(),b={left:`${v.left-m.left}px`,top:`${v.top-m.top}px`,width:`${v.width}px`,height:`${v.height}px`};u(b),h(!0)},[a?.value,i]);pe.useEffect(()=>{g();const x=requestAnimationFrame(()=>{requestAnimationFrame(g)}),m=new ResizeObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(g)})}),v=new MutationObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(g)})});return d.current&&(m.observe(d.current),v.observe(d.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state","class"]})),()=>{cancelAnimationFrame(x),m.disconnect(),v.disconnect()}},[g]);const y=l.useCallback(x=>{d.current=x,typeof s=="function"?s(x):s&&(s.current=x)},[s]);return o.jsxs("div",{ref:y,className:"sliding-indicator-container relative",children:[p&&o.jsx("div",{className:X.cn("sliding-indicator rounded-md","bg-background dark:bg-input/30","border border-input","shadow-sm dark:shadow-sm","text-foreground"),style:f,"aria-hidden":"true"}),o.jsx(Na,{variant:"default",className:c,...r,children:l.Children.map(n,x=>{if(l.isValidElement(x)){const m=x.props;return l.cloneElement(x,{...m,className:X.cn(m.className,"sliding-indicator-target")})}return x})})]})});Io.displayName="EnhancedTabsList";const Kt=l.forwardRef(({className:e,...t},n)=>{const r=pe.useContext(ko);if(!r)throw new Error("EnhancedTabsTrigger must be used within EnhancedTabs");const s=r?.orientation||"horizontal";return o.jsx(Ea,{ref:n,"data-orientation":s,className:X.cn(e),...t})});Kt.displayName="EnhancedTabsTrigger";const qt=l.forwardRef(({className:e,...t},n)=>o.jsx(Ra,{ref:n,className:X.cn("transition-all duration-200 ease-in-out",e),...t}));qt.displayName="EnhancedTabsContent";var zd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pa=zd.reduce((e,t)=>{const n=Ke.createSlot(`Primitive.${t}`),r=l.forwardRef((s,a)=>{const{asChild:i,...c}=s,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});const et=dr,tt=io,nt=co;var Bd="Label",ka=l.forwardRef((e,t)=>o.jsx(Pa.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));ka.displayName=Bd;var Ta=ka;const Vd=ro.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),G=l.forwardRef(({className:e,...t},n)=>o.jsx(Ta,{ref:n,className:X.cn(Vd(),e),...t}));G.displayName=Ta.displayName;const Xe=l.forwardRef(({className:e,type:t,...n},r)=>o.jsx("input",{type:t,className:X.cn("flex h-7 w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Xe.displayName="Input";function Ia({...e}){return o.jsx(nc,{"data-slot":"popover",...e})}function Ma({...e}){return o.jsx(rc,{"data-slot":"popover-trigger",...e})}function Aa({className:e,align:t="center",sideOffset:n=4,...r}){return o.jsx(sc,{children:o.jsx(ac,{"data-slot":"popover-content",align:t,sideOffset:n,className:X.cn("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 flex flex-col gap-4 rounded-lg p-2.5 text-xs shadow-md ring-1 duration-100 z-[var(--z-popover)] w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",e),...r})})}function Wd({...e}){return o.jsx(oc,{"data-slot":"popover-anchor",...e})}function Ce({className:e,defaultValue:t,value:n,min:r=0,max:s=100,...a}){const i=l.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,s],[n,t,r,s]);return o.jsxs(Jc,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:s,className:X.cn("data-[orientation=vertical]:min-h-40 relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...a,children:[o.jsx(Zc,{"data-slot":"slider-track",className:"bg-muted rounded-md data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-3 relative grow overflow-hidden",children:o.jsx(Qc,{"data-slot":"slider-range",className:"bg-primary absolute select-none data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})}),Array.from({length:i.length},(c,d)=>o.jsx(ed,{"data-slot":"slider-thumb",className:"border-primary ring-ring/30 size-4 rounded-md border bg-white shadow-sm transition-colors hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden block shrink-0 select-none disabled:pointer-events-none disabled:opacity-50"},d))]})}const Se=l.forwardRef(({className:e,...t},n)=>o.jsx(Gs,{className:X.cn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:o.jsx(sd,{className:X.cn("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Se.displayName=Gs.displayName;function eo({className:e,...t}){return o.jsx("textarea",{"data-slot":"textarea",className:X.cn("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-md border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function me(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Te(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function to({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Mo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function $a(e,t,n="/"){return Ud(e,t,n,!1)}function Ud(e,t,n,r){let s=typeof t=="string"?Mo(t):t,a=Fe(s.pathname||"/",n);if(a==null)return null;let i=_a(e);Yd(i);let c=null;for(let d=0;c==null&&d<i.length;++d){let f=ou(a);c=tu(i[d],f,r)}return c}function _a(e,t=[],n=[],r="",s=!1){let a=(i,c,d=s,f)=>{let u={relativePath:f===void 0?i.path||"":f,caseSensitive:i.caseSensitive===!0,childrenIndex:c,route:i};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(r)&&d)return;me(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length)}let p=Ae([r,u.relativePath]),h=n.concat(u);i.children&&i.children.length>0&&(me(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),_a(i.children,t,h,p,d)),!(i.path==null&&!i.index)&&t.push({path:p,score:Qd(p,i.index),routesMeta:h})};return e.forEach((i,c)=>{if(i.path===""||!i.path?.includes("?"))a(i,c);else for(let d of La(i.path))a(i,c,!0,d)}),t}function La(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let i=La(r.join("/")),c=[];return c.push(...i.map(d=>d===""?a:[a,d].join("/"))),s&&c.push(...i),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function Yd(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:eu(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Xd=/^:[\w-]+$/,Kd=3,qd=2,Gd=1,Jd=10,Zd=-2,Zo=e=>e==="*";function Qd(e,t){let n=e.split("/"),r=n.length;return n.some(Zo)&&(r+=Zd),t&&(r+=qd),n.filter(s=>!Zo(s)).reduce((s,a)=>s+(Xd.test(a)?Kd:a===""?Gd:Jd),r)}function eu(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function tu(e,t,n=!1){let{routesMeta:r}=e,s={},a="/",i=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,u=a==="/"?t:t.slice(a.length)||"/",p=Gt({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},u),h=d.route;if(!p&&f&&n&&!r[r.length-1].route.index&&(p=Gt({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},u)),!p)return null;Object.assign(s,p.params),i.push({params:s,pathname:Ae([a,p.pathname]),pathnameBase:iu(Ae([a,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(a=Ae([a,p.pathnameBase]))}return i}function Gt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=nu(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],i=a.replace(/(.)\/+$/,"$1"),c=s.slice(1);return{params:r.reduce((f,{paramName:u,isOptional:p},h)=>{if(u==="*"){let y=c[h]||"";i=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const g=c[h];return p&&!g?f[u]=void 0:f[u]=(g||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:i,pattern:e}}function nu(e,t=!1,n=!0){Te(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function ou(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Te(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Fe(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var Oa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ru=e=>Oa.test(e);function su(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Mo(e):e,a;if(n)if(ru(n))a=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),Te(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?a=Qo(n.substring(1),"/"):a=Qo(n,t)}else a=t;return{pathname:a,search:lu(r),hash:cu(s)}}function Qo(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function _n(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function au(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Da(e){let t=au(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Ha(e,t,n,r=!1){let s;typeof e=="string"?s=Mo(e):(s={...e},me(!s.pathname||!s.pathname.includes("?"),_n("?","pathname","search",s)),me(!s.pathname||!s.pathname.includes("#"),_n("#","pathname","hash",s)),me(!s.search||!s.search.includes("#"),_n("#","search","hash",s)));let a=e===""||s.pathname==="",i=a?"/":s.pathname,c;if(i==null)c=n;else{let p=t.length-1;if(!r&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),p-=1;s.pathname=h.join("/")}c=p>=0?t[p]:"/"}let d=su(s,c),f=i&&i!=="/"&&i.endsWith("/"),u=(a||i===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||u)&&(d.pathname+="/"),d}var Ae=e=>e.join("/").replace(/\/\/+/g,"/"),iu=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),lu=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cu=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,du=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function uu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function fu(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Fa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function za(e,t){let n=e;if(typeof n!="string"||!Oa.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(Fa)try{let a=new URL(window.location.href),i=n.startsWith("//")?new URL(a.protocol+n):new URL(n),c=Fe(i.pathname,t);i.origin===a.origin&&c!=null?n=c+i.search+i.hash:s=!0}catch{Te(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ba=["POST","PUT","PATCH","DELETE"];new Set(Ba);var pu=["GET",...Ba];new Set(pu);var ft=l.createContext(null);ft.displayName="DataRouter";var bn=l.createContext(null);bn.displayName="DataRouterState";var mu=l.createContext(!1),Va=l.createContext({isTransitioning:!1});Va.displayName="ViewTransition";var hu=l.createContext(new Map);hu.displayName="Fetchers";var xu=l.createContext(null);xu.displayName="Await";var Ee=l.createContext(null);Ee.displayName="Navigation";var Ao=l.createContext(null);Ao.displayName="Location";var Le=l.createContext({outlet:null,matches:[],isDataRoute:!1});Le.displayName="Route";var $o=l.createContext(null);$o.displayName="RouteError";var Wa="REACT_ROUTER_ERROR",gu="REDIRECT",vu="ROUTE_ERROR_RESPONSE";function bu(e){if(e.startsWith(`${Wa}:${gu}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function wu(e){if(e.startsWith(`${Wa}:${vu}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new du(t.status,t.statusText,t.data)}catch{}}function yu(e,{relative:t}={}){me(wn(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=l.useContext(Ee),{hash:s,pathname:a,search:i}=kt(e,{relative:t}),c=a;return n!=="/"&&(c=a==="/"?n:Ae([n,a])),r.createHref({pathname:c,search:i,hash:s})}function wn(){return l.useContext(Ao)!=null}function We(){return me(wn(),"useLocation() may be used only in the context of a <Router> component."),l.useContext(Ao).location}var Ua="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ya(e){l.useContext(Ee).static||l.useLayoutEffect(e)}function Cu(){let{isDataRoute:e}=l.useContext(Le);return e?_u():Su()}function Su(){me(wn(),"useNavigate() may be used only in the context of a <Router> component.");let e=l.useContext(ft),{basename:t,navigator:n}=l.useContext(Ee),{matches:r}=l.useContext(Le),{pathname:s}=We(),a=JSON.stringify(Da(r)),i=l.useRef(!1);return Ya(()=>{i.current=!0}),l.useCallback((d,f={})=>{if(Te(i.current,Ua),!i.current)return;if(typeof d=="number"){n.go(d);return}let u=Ha(d,JSON.parse(a),s,f.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Ae([t,u.pathname])),(f.replace?n.replace:n.push)(u,f.state,f)},[t,n,a,s,e])}l.createContext(null);function kt(e,{relative:t}={}){let{matches:n}=l.useContext(Le),{pathname:r}=We(),s=JSON.stringify(Da(n));return l.useMemo(()=>Ha(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function ju(e,t,n,r,s){me(wn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=l.useContext(Ee),{matches:i}=l.useContext(Le),c=i[i.length-1],d=c?c.params:{},f=c?c.pathname:"/",u=c?c.pathnameBase:"/",p=c&&c.route;{let b=p&&p.path||"";Ka(f,!p||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
98
|
+
|
|
99
|
+
Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let h=We(),g;g=h;let y=g.pathname||"/",x=y;if(u!=="/"){let b=u.replace(/^\//,"").split("/");x="/"+y.replace(/^\//,"").split("/").slice(b.length).join("/")}let m=$a(e,{pathname:x});return Te(p||m!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Te(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),ku(m&&m.map(b=>Object.assign({},b,{params:Object.assign({},d,b.params),pathname:Ae([u,a.encodeLocation?a.encodeLocation(b.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?u:Ae([u,a.encodeLocation?a.encodeLocation(b.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),i,n,r,s)}function Nu(){let e=$u(),t=uu(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=l.createElement(l.Fragment,null,l.createElement("p",null,"💿 Hey developer 👋"),l.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",l.createElement("code",{style:a},"ErrorBoundary")," or"," ",l.createElement("code",{style:a},"errorElement")," prop on your route.")),l.createElement(l.Fragment,null,l.createElement("h2",null,"Unexpected Application Error!"),l.createElement("h3",{style:{fontStyle:"italic"}},t),n?l.createElement("pre",{style:s},n):null,i)}var Eu=l.createElement(Nu,null),Xa=class extends l.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=wu(e.digest);n&&(e=n)}let t=e!==void 0?l.createElement(Le.Provider,{value:this.props.routeContext},l.createElement($o.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?l.createElement(Ru,{error:e},t):t}};Xa.contextType=mu;var Ln=new WeakMap;function Ru({children:e,error:t}){let{basename:n}=l.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=bu(t.digest);if(r){let s=Ln.get(t);if(s)throw s;let a=za(r.location,n);if(Fa&&!Ln.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw Ln.set(t,i),i}return l.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Pu({routeContext:e,match:t,children:n}){let r=l.useContext(ft);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),l.createElement(Le.Provider,{value:e},n)}function ku(e,t=[],n=null,r=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=n?.errors;if(i!=null){let u=a.findIndex(p=>p.route.id&&i?.[p.route.id]!==void 0);me(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,u+1))}let c=!1,d=-1;if(n)for(let u=0;u<a.length;u++){let p=a[u];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(d=u),p.route.id){let{loaderData:h,errors:g}=n,y=p.route.loader&&!h.hasOwnProperty(p.route.id)&&(!g||g[p.route.id]===void 0);if(p.route.lazy||y){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}let f=n&&r?(u,p)=>{r(u,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:fu(n.matches),errorInfo:p})}:void 0;return a.reduceRight((u,p,h)=>{let g,y=!1,x=null,m=null;n&&(g=i&&p.route.id?i[p.route.id]:void 0,x=p.route.errorElement||Eu,c&&(d<0&&h===0?(Ka("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,m=null):d===h&&(y=!0,m=p.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,h+1)),b=()=>{let w;return g?w=x:y?w=m:p.route.Component?w=l.createElement(p.route.Component,null):p.route.element?w=p.route.element:w=u,l.createElement(Pu,{match:p,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:w})};return n&&(p.route.ErrorBoundary||p.route.errorElement||h===0)?l.createElement(Xa,{location:n.location,revalidation:n.revalidation,component:x,error:g,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:f}):b()},null)}function _o(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tu(e){let t=l.useContext(ft);return me(t,_o(e)),t}function Iu(e){let t=l.useContext(bn);return me(t,_o(e)),t}function Mu(e){let t=l.useContext(Le);return me(t,_o(e)),t}function Lo(e){let t=Mu(e),n=t.matches[t.matches.length-1];return me(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Au(){return Lo("useRouteId")}function $u(){let e=l.useContext($o),t=Iu("useRouteError"),n=Lo("useRouteError");return e!==void 0?e:t.errors?.[n]}function _u(){let{router:e}=Tu("useNavigate"),t=Lo("useNavigate"),n=l.useRef(!1);return Ya(()=>{n.current=!0}),l.useCallback(async(s,a={})=>{Te(n.current,Ua),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...a}))},[e,t])}var er={};function Ka(e,t,n){!t&&!er[e]&&(er[e]=!0,Te(!1,n))}l.memo(Lu);function Lu({routes:e,future:t,state:n,onError:r}){return ju(e,void 0,n,r,t)}var Ft="get",zt="application/x-www-form-urlencoded";function yn(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Ou(e){return yn(e)&&e.tagName.toLowerCase()==="button"}function Du(e){return yn(e)&&e.tagName.toLowerCase()==="form"}function Hu(e){return yn(e)&&e.tagName.toLowerCase()==="input"}function Fu(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zu(e,t){return e.button===0&&(!t||t==="_self")&&!Fu(e)}var Mt=null;function Bu(){if(Mt===null)try{new FormData(document.createElement("form"),0),Mt=!1}catch{Mt=!0}return Mt}var Vu=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function On(e){return e!=null&&!Vu.has(e)?(Te(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${zt}"`),null):e}function Wu(e,t){let n,r,s,a,i;if(Du(e)){let c=e.getAttribute("action");r=c?Fe(c,t):null,n=e.getAttribute("method")||Ft,s=On(e.getAttribute("enctype"))||zt,a=new FormData(e)}else if(Ou(e)||Hu(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||c.getAttribute("action");if(r=d?Fe(d,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Ft,s=On(e.getAttribute("formenctype"))||On(c.getAttribute("enctype"))||zt,a=new FormData(c,e),!Bu()){let{name:f,type:u,value:p}=e;if(u==="image"){let h=f?`${f}.`:"";a.append(`${h}x`,"0"),a.append(`${h}y`,"0")}else f&&a.append(f,p)}}else{if(yn(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ft,r=null,s=zt,i=e}return a&&s==="text/plain"&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Oo(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Uu(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&Fe(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function Yu(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Xu(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Ku(e,t,n){let r=await Promise.all(e.map(async s=>{let a=t.routes[s.route.id];if(a){let i=await Yu(a,n);return i.links?i.links():[]}return[]}));return Zu(r.flat(1).filter(Xu).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function tr(e,t,n,r,s,a){let i=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,c=(d,f)=>n[f].pathname!==d.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==d.params["*"];return a==="assets"?t.filter((d,f)=>i(d,f)||c(d,f)):a==="data"?t.filter((d,f)=>{let u=r.routes[d.route.id];if(!u||!u.hasLoader)return!1;if(i(d,f)||c(d,f))return!0;if(d.route.shouldRevalidate){let p=d.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function qu(e,t,{includeHydrateFallback:n}={}){return Gu(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let a=[s.module];return s.clientActionModule&&(a=a.concat(s.clientActionModule)),s.clientLoaderModule&&(a=a.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(a=a.concat(s.hydrateFallbackModule)),s.imports&&(a=a.concat(s.imports)),a}).flat(1))}function Gu(e){return[...new Set(e)]}function Ju(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Zu(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let a=JSON.stringify(Ju(s));return n.has(a)||(n.add(a),r.push({key:a,link:s})),r},[])}function qa(){let e=l.useContext(ft);return Oo(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Qu(){let e=l.useContext(bn);return Oo(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Do=l.createContext(void 0);Do.displayName="FrameworkContext";function Ga(){let e=l.useContext(Do);return Oo(e,"You must render this element inside a <HydratedRouter> element"),e}function ef(e,t){let n=l.useContext(Do),[r,s]=l.useState(!1),[a,i]=l.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:f,onMouseLeave:u,onTouchStart:p}=t,h=l.useRef(null);l.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let x=v=>{v.forEach(b=>{i(b.isIntersecting)})},m=new IntersectionObserver(x,{threshold:.5});return h.current&&m.observe(h.current),()=>{m.disconnect()}}},[e]),l.useEffect(()=>{if(r){let x=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(x)}}},[r]);let g=()=>{s(!0)},y=()=>{s(!1),i(!1)};return n?e!=="intent"?[a,h,{}]:[a,h,{onFocus:ht(c,g),onBlur:ht(d,y),onMouseEnter:ht(f,g),onMouseLeave:ht(u,y),onTouchStart:ht(p,g)}]:[!1,h,{}]}function ht(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function tf({page:e,...t}){let{router:n}=qa(),r=l.useMemo(()=>$a(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?l.createElement(of,{page:e,matches:r,...t}):null}function nf(e){let{manifest:t,routeModules:n}=Ga(),[r,s]=l.useState([]);return l.useEffect(()=>{let a=!1;return Ku(e,t,n).then(i=>{a||s(i)}),()=>{a=!0}},[e,t,n]),r}function of({page:e,matches:t,...n}){let r=We(),{future:s,manifest:a,routeModules:i}=Ga(),{basename:c}=qa(),{loaderData:d,matches:f}=Qu(),u=l.useMemo(()=>tr(e,t,f,a,r,"data"),[e,t,f,a,r]),p=l.useMemo(()=>tr(e,t,f,a,r,"assets"),[e,t,f,a,r]),h=l.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,m=!1;if(t.forEach(b=>{let w=a.routes[b.route.id];!w||!w.hasLoader||(!u.some(S=>S.route.id===b.route.id)&&b.route.id in d&&i[b.route.id]?.shouldRevalidate||w.hasClientLoader?m=!0:x.add(b.route.id))}),x.size===0)return[];let v=Uu(e,c,s.unstable_trailingSlashAwareDataRequests,"data");return m&&x.size>0&&v.searchParams.set("_routes",t.filter(b=>x.has(b.route.id)).map(b=>b.route.id).join(",")),[v.pathname+v.search]},[c,s.unstable_trailingSlashAwareDataRequests,d,r,a,u,t,e,i]),g=l.useMemo(()=>qu(p,a),[p,a]),y=nf(p);return l.createElement(l.Fragment,null,h.map(x=>l.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),g.map(x=>l.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),y.map(({key:x,link:m})=>l.createElement("link",{key:x,nonce:n.nonce,...m})))}function rf(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var sf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{sf&&(window.__reactRouterVersion="7.12.0")}catch{}var Ja=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Za=l.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:a,replace:i,state:c,target:d,to:f,preventScrollReset:u,viewTransition:p,unstable_defaultShouldRevalidate:h,...g},y){let{basename:x,unstable_useTransitions:m}=l.useContext(Ee),v=typeof f=="string"&&Ja.test(f),b=za(f,x);f=b.to;let w=yu(f,{relative:s}),[S,E,j]=ef(r,g),P=df(f,{replace:i,state:c,target:d,preventScrollReset:u,relative:s,viewTransition:p,unstable_defaultShouldRevalidate:h,unstable_useTransitions:m});function R(L){t&&t(L),L.defaultPrevented||P(L)}let A=l.createElement("a",{...g,...j,href:b.absoluteURL||w,onClick:b.isExternal||a?t:R,ref:rf(y,E),target:d,"data-discover":!v&&n==="render"?"true":void 0});return S&&!v?l.createElement(l.Fragment,null,A,l.createElement(tf,{page:w})):A});Za.displayName="Link";var af=l.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:a,to:i,viewTransition:c,children:d,...f},u){let p=kt(i,{relative:f.relative}),h=We(),g=l.useContext(bn),{navigator:y,basename:x}=l.useContext(Ee),m=g!=null&&hf(p)&&c===!0,v=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,b=h.pathname,w=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(b=b.toLowerCase(),w=w?w.toLowerCase():null,v=v.toLowerCase()),w&&x&&(w=Fe(w,x)||w);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let E=b===v||!s&&b.startsWith(v)&&b.charAt(S)==="/",j=w!=null&&(w===v||!s&&w.startsWith(v)&&w.charAt(v.length)==="/"),P={isActive:E,isPending:j,isTransitioning:m},R=E?t:void 0,A;typeof r=="function"?A=r(P):A=[r,E?"active":null,j?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let L=typeof a=="function"?a(P):a;return l.createElement(Za,{...f,"aria-current":R,className:A,ref:u,style:L,to:i,viewTransition:c},typeof d=="function"?d(P):d)});af.displayName="NavLink";var lf=l.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:a,method:i=Ft,action:c,onSubmit:d,relative:f,preventScrollReset:u,viewTransition:p,unstable_defaultShouldRevalidate:h,...g},y)=>{let{unstable_useTransitions:x}=l.useContext(Ee),m=pf(),v=mf(c,{relative:f}),b=i.toLowerCase()==="get"?"get":"post",w=typeof c=="string"&&Ja.test(c),S=E=>{if(d&&d(E),E.defaultPrevented)return;E.preventDefault();let j=E.nativeEvent.submitter,P=j?.getAttribute("formmethod")||i,R=()=>m(j||E.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:s,state:a,relative:f,preventScrollReset:u,viewTransition:p,unstable_defaultShouldRevalidate:h});x&&n!==!1?l.startTransition(()=>R()):R()};return l.createElement("form",{ref:y,method:b,action:v,onSubmit:r?d:S,...g,"data-discover":!w&&e==="render"?"true":void 0})});lf.displayName="Form";function cf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qa(e){let t=l.useContext(ft);return me(t,cf(e)),t}function df(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:c,unstable_useTransitions:d}={}){let f=Cu(),u=We(),p=kt(e,{relative:a});return l.useCallback(h=>{if(zu(h,t)){h.preventDefault();let g=n!==void 0?n:to(u)===to(p),y=()=>f(e,{replace:g,state:r,preventScrollReset:s,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:c});d?l.startTransition(()=>y()):y()}},[u,f,p,n,r,t,e,s,a,i,c,d])}var uf=0,ff=()=>`__${String(++uf)}__`;function pf(){let{router:e}=Qa("useSubmit"),{basename:t}=l.useContext(Ee),n=Au(),r=e.fetch,s=e.navigate;return l.useCallback(async(a,i={})=>{let{action:c,method:d,encType:f,formData:u,body:p}=Wu(a,t);if(i.navigate===!1){let h=i.fetcherKey||ff();await r(h,n,i.action||c,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:u,body:p,formMethod:i.method||d,formEncType:i.encType||f,flushSync:i.flushSync})}else await s(i.action||c,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:u,body:p,formMethod:i.method||d,formEncType:i.encType||f,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[r,s,t,n])}function mf(e,{relative:t}={}){let{basename:n}=l.useContext(Ee),r=l.useContext(Le);me(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),a={...kt(e||".",{relative:t})},i=We();if(e==null){a.search=i.search;let c=new URLSearchParams(a.search),d=c.getAll("index");if(d.some(u=>u==="")){c.delete("index"),d.filter(p=>p).forEach(p=>c.append("index",p));let u=c.toString();a.search=u?`?${u}`:""}}return(!e||e===".")&&s.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:Ae([n,a.pathname])),to(a)}function hf(e,{relative:t}={}){let n=l.useContext(Va);me(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Qa("useViewTransitionState"),s=kt(e,{relative:t});if(!n.isTransitioning)return!1;let a=Fe(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Fe(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Gt(s.pathname,i)!=null||Gt(s.pathname,a)!=null}function ei({enabled:e,zoom:t=3,size:n=200,lockedElement:r,onElementChange:s}){const a=We(),[i,c]=l.useState({x:0,y:0}),[d,f]=l.useState(!1),[u,p]=l.useState(null),[h,g]=l.useState(!1),y=l.useRef(null),x=l.useRef(null),m=l.useRef(null);l.useEffect(()=>{if(!e||!d||!x.current){m.current&&m.current.parentNode&&(m.current.parentNode.removeChild(m.current),m.current=null);return}return m.current&&m.current.parentNode&&(m.current.parentNode.removeChild(m.current),m.current=null),requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(()=>{if(!x.current||typeof document>"u")return;const E=document.body,j=E.cloneNode(!0),P=j.querySelector('[data-magnifier-container="true"]');P&&P.remove();const R=j.querySelector('[data-magnifier-viewport="true"]');R&&R.remove(),j.style.position="absolute",j.style.left="0",j.style.top="0",j.style.width=`${document.documentElement.scrollWidth}px`,j.style.height=`${document.documentElement.scrollHeight}px`,j.style.pointerEvents="none",j.style.background="transparent",j.style.transformOrigin="0 0",j.style.willChange="transform",x.current.appendChild(j);const A=M=>M.hasAttribute?.("data-magnifier-container")||M.hasAttribute?.("data-magnifier-viewport"),L=(M,D)=>{M instanceof HTMLElement&&D instanceof HTMLElement&&(M.scrollHeight>M.clientHeight||M.scrollWidth>M.clientWidth)&&(D.scrollLeft=M.scrollLeft,D.scrollTop=M.scrollTop);const W=Array.from(M.children).filter(U=>!A(U)),H=Array.from(D.children);for(let U=0;U<W.length&&U<H.length;U++)L(W[U],H[U])};L(E,j),m.current=j},10)})})}),()=>{m.current&&m.current.parentNode&&(m.current.parentNode.removeChild(m.current),m.current=null)}},[e,d,u,h,a.pathname]),l.useEffect(()=>{if(!e){f(!1);return}const E=P=>{const R=document.querySelector("[data-debug-panel]")!==null;R!==h&&g(R);const A=document.elementFromPoint(P.clientX,P.clientY),L=A?.closest("[data-debug-panel]")!==null,M=A?.closest('button[title="Debug Tools"]')!==null||A?.getAttribute("title")==="Debug Tools",D=L||M;requestAnimationFrame(()=>{c({x:P.clientX,y:P.clientY}),f(!D)}),r||s?.(A||null)},j=P=>{document.elementFromPoint(P.clientX,P.clientY)?.tagName!=="IFRAME"&&(f(!1),s?.(null))};return document.addEventListener("mousemove",E),document.addEventListener("mouseleave",j),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseleave",j)}},[e,s,h,r]),l.useEffect(()=>{if(!e)return;const E=new MutationObserver(P=>{P.forEach(R=>{if(R.type==="attributes"&&R.attributeName==="data-state"){const L=R.target.getAttribute("data-state");u!==L&&p(L)}})}),j=document.querySelector("[data-state]");if(j){const P=j.getAttribute("data-state");u!==P&&p(P),E.observe(j,{attributes:!0,attributeFilter:["data-state"]})}return()=>E.disconnect()},[e,u]),l.useEffect(()=>{if(!e)return;const E=()=>{const R=document.querySelector("[data-debug-panel]")!==null;R!==h&&g(R)},j=new MutationObserver(R=>{let A=!1;R.forEach(L=>{if(L.type==="childList"){const M=Array.from(L.addedNodes),D=Array.from(L.removedNodes),W=H=>{if(H.nodeType===Node.ELEMENT_NODE){const U=H;return U.hasAttribute?.("data-debug-panel")||U.querySelector?.("[data-debug-panel]")!==null||U.closest?.("[data-debug-panel]")!==null}return!1};(M.some(W)||D.some(W))&&(A=!0)}}),A&&setTimeout(E,0)});j.observe(document.body,{childList:!0,subtree:!0}),E();const P=setInterval(E,100);return()=>{j.disconnect(),clearInterval(P)}},[e,h]);const[v,b]=l.useState(0),w=l.useCallback(()=>{if(!m.current)return;const E=P=>P.hasAttribute?.("data-magnifier-container")||P.hasAttribute?.("data-magnifier-viewport"),j=(P,R)=>{P instanceof HTMLElement&&R instanceof HTMLElement&&(P.scrollHeight>P.clientHeight||P.scrollWidth>P.clientWidth)&&(R.scrollLeft=P.scrollLeft,R.scrollTop=P.scrollTop);const A=Array.from(P.children).filter(M=>!E(M)),L=Array.from(R.children);for(let M=0;M<A.length&&M<L.length;M++)j(A[M],L[M])};j(document.body,m.current)},[]);if(l.useEffect(()=>{if(!e||!d)return;const E=()=>b(A=>A+1),j=document.querySelectorAll('[data-main-scroll="true"], [class*="overflow-y-auto"], [class*="overflow-auto"], [class*="overflow-x-auto"]');j.forEach(A=>A.addEventListener("scroll",E,{passive:!0})),window.addEventListener("scroll",E,{passive:!0}),document.addEventListener("wheel",E,{passive:!0});let P;const R=()=>{b(A=>A+1),P=requestAnimationFrame(R)};return P=requestAnimationFrame(R),()=>{cancelAnimationFrame(P),j.forEach(A=>A.removeEventListener("scroll",E)),window.removeEventListener("scroll",E),document.removeEventListener("wheel",E)}},[e,d]),l.useEffect(()=>{if(!e||!d||!x.current||!m.current)return;w();const E=window.scrollX||window.pageXOffset||0,j=window.scrollY||window.pageYOffset||0,P=document.querySelector('[data-main-scroll="true"]'),R=P?i.x:i.x+E,A=P?i.y:i.y+j,L=i.x-R*t,M=i.y-A*t;if(x.current){const D=`circle(${n/2}px at ${i.x}px ${i.y}px)`;x.current.style.clipPath=D,x.current.style.transform="none";const W=`translate(${L}px, ${M}px) scale(${t})`;m.current.style.transform=W,m.current.style.transformOrigin="0 0"}},[i,e,d,t,n,v,w]),!e||!d)return null;const S=n;return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:x,className:"magnifier-viewport",style:{position:"fixed",left:0,top:0,width:"100vw",height:"100vh",pointerEvents:"none",zIndex:9998,willChange:"transform",overflow:"hidden"},"data-magnifier-viewport":"true"}),o.jsx("div",{ref:y,className:"fixed pointer-events-none z-[var(--z-debug)]",style:{left:`${i.x}px`,top:`${i.y}px`,transform:"translate(-50%, -50%)",width:`${S}px`,height:`${S}px`},"data-magnifier-container":"true",children:o.jsx("div",{className:"rounded-full border-2 border-border shadow-2xl",style:{width:"100%",height:"100%",background:"transparent",pointerEvents:"none"}})}),o.jsx("style",{children:`
|
|
100
|
+
/* Hide the magnifier container from being visible in the viewport */
|
|
101
|
+
[data-magnifier-viewport="true"] [data-magnifier-container="true"],
|
|
102
|
+
[data-magnifier-container="true"] {
|
|
103
|
+
visibility: hidden !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Make sure the viewport doesn't interfere with page interaction */
|
|
107
|
+
.magnifier-viewport * {
|
|
108
|
+
pointer-events: none !important;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Ensure the viewport and clone are visible */
|
|
112
|
+
.magnifier-viewport {
|
|
113
|
+
visibility: visible !important;
|
|
114
|
+
opacity: 1 !important;
|
|
115
|
+
/* Temporary: add a subtle background to verify viewport is visible */
|
|
116
|
+
/* background: rgba(255, 0, 0, 0.1) !important; */
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.magnifier-viewport > * {
|
|
120
|
+
visibility: visible !important;
|
|
121
|
+
opacity: 1 !important;
|
|
122
|
+
/* Ensure clone content is visible */
|
|
123
|
+
display: block !important;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Ensure all content inside clone is visible */
|
|
127
|
+
.magnifier-viewport * {
|
|
128
|
+
visibility: visible !important;
|
|
129
|
+
opacity: 1 !important;
|
|
130
|
+
}
|
|
131
|
+
`})]})}function ti({enabled:e}){const[t,n]=l.useState({x:0,y:0});return l.useEffect(()=>{if(!e)return;const r=s=>{n({x:s.clientX,y:s.clientY})};return document.addEventListener("mousemove",r),()=>document.removeEventListener("mousemove",r)},[e]),e?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed pointer-events-none z-[var(--z-debug)]",style:{left:0,top:`${t.y}px`,width:"100vw",height:"1px",backgroundColor:"rgba(255, 0, 0, 0.5)",boxShadow:"0 0 2px rgba(255, 0, 0, 0.8)"}}),o.jsx("div",{className:"fixed pointer-events-none z-[var(--z-debug)]",style:{left:`${t.x}px`,top:0,width:"1px",height:"100vh",backgroundColor:"rgba(255, 0, 0, 0.5)",boxShadow:"0 0 2px rgba(255, 0, 0, 0.8)"}})]}):null}function xf(){if(typeof window>"u"||typeof document>"u")return[];const e=document.documentElement,t=getComputedStyle(e),n=[],s=e.style.cssText.matchAll(/--([^:]+):\s*([^;]+)/g);for(const d of s){const f=`--${d[1].trim()}`,u=d[2].trim();n.push({name:f,value:u,category:At(f)})}const a=new Set,i=["primary","secondary","accent","background","foreground","card","popover","muted","border","input","ring","destructive","success","warning","info","sidebar","chart"];for(const d of i){const f=`--${d}`,u=t.getPropertyValue(f).trim();u&&(a.add(f),n.push({name:f,value:u,category:At(f)}));const p=`--${d}-foreground`,h=t.getPropertyValue(p).trim();h&&(a.add(p),n.push({name:p,value:h,category:At(p)}));for(let g=100;g<=600;g+=100){const y=`--${d}-${g}`,x=t.getPropertyValue(y).trim();x&&(a.add(y),n.push({name:y,value:x,category:At(y)}))}}const c=new Map;for(const d of n)c.has(d.name)||c.set(d.name,d);return Array.from(c.values())}function gf(){return xf().filter(t=>vf(t.name)).map(t=>({...t,computedValue:ot(t.name),swatchColor:ni(t.name,t.value)})).sort((t,n)=>{const r={primary:0,semantic:1,system:2,other:3},s=r[t.category||"other"],a=r[n.category||"other"];return s!==a?s-a:t.name.localeCompare(n.name)})}function ot(e){if(typeof window>"u"||typeof document>"u")return e;try{const t=document.documentElement,n=getComputedStyle(t).getPropertyValue(e.replace(/^--/,"")).trim();return n||(e.startsWith("var(")?e:`var(${e})`)}catch{return e}}function At(e){return e.includes("primary")?"primary":e.includes("destructive")||e.includes("danger")||e.includes("success")||e.includes("warning")||e.includes("info")?"semantic":e.includes("background")||e.includes("foreground")||e.includes("card")||e.includes("popover")||e.includes("muted")||e.includes("border")||e.includes("input")||e.includes("ring")||e.includes("sidebar")?"system":"other"}function vf(e){return["primary","secondary","accent","background","foreground","card","popover","muted","border","input","ring","destructive","danger","success","warning","info","sidebar","chart","color"].some(n=>e.includes(n))}function ni(e,t){if(t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl"))return t;if(t.startsWith("var(")){const n=ot(t);if(n!==t)return ni(e,n)}return t}const no="ui-tester-preview-styles",Jt="data-ui-tester-preview";function bf(){if(typeof document>"u")return null;let e=document.getElementById(no);return e||(e=document.createElement("style"),e.id=no,document.head.appendChild(e)),e}function wf(e){return e?`[${Jt}="true"]`:""}function yf(e){const t=[],n=[];if(e.boxShadow&&n.push(e.boxShadow),e.glow){const{color:r,blur:s,spread:a}=e.glow,i=`0 0 ${s}px ${a}px ${r}`;n.push(i)}if(n.length>0&&t.push(`box-shadow: ${n.join(", ")} !important;`),e.glow&&t.push(`outline: 1px solid ${e.glow.color} !important;`),e.textShadow&&t.push(`text-shadow: ${e.textShadow} !important;`),e.backgroundColor&&t.push(`background-color: ${e.backgroundColor} !important;`),e.backgroundImage&&t.push(`background-image: ${e.backgroundImage} !important;`),e.border){const{color:r,width:s,style:a}=e.border;t.push(`border: ${s} ${a} ${r} !important;`)}return e.customCss&&t.push(e.customCss),t.join(`
|
|
132
|
+
`)}function Cf(e,t){if(typeof document>"u"||(oo(),!e))return;e.setAttribute(Jt,"true");const n=wf(e);if(!n)return;const r=yf(t);if(!r.trim())return;const s=bf();s&&(s.textContent=`
|
|
133
|
+
${n} {
|
|
134
|
+
${r}
|
|
135
|
+
}
|
|
136
|
+
`)}function Sf(e,t){Cf(e,t)}function oo(){if(typeof document>"u")return;document.querySelectorAll(`[${Jt}="true"]`).forEach(n=>{n.removeAttribute(Jt)});const t=document.getElementById(no);t&&t.remove()}function nr(e){return e?e.closest("[data-debug-panel]")!==null||e.closest('button[title="Debug Tools"]')!==null||e.getAttribute("title")==="Debug Tools"||e.closest('[data-magnifier-container="true"]')!==null||e.closest('[data-magnifier-viewport="true"]')!==null||e.hasAttribute("data-ui-tester-preview"):!1}function jf(e){if(!e||e==="none")return[];const t=e.split(",").map(r=>r.trim()),n=[];for(const r of t){const s=r.match(/^(-?\d+(?:\.\d+)?(?:px|em|rem)?)\s+(-?\d+(?:\.\d+)?(?:px|em|rem)?)\s+(-?\d+(?:\.\d+)?(?:px|em|rem)?)\s+(-?\d+(?:\.\d+)?(?:px|em|rem)?)?\s*(.+)$/);if(s){const a=parseFloat(s[1])||0,i=parseFloat(s[2])||0,c=parseFloat(s[3])||0,d=s[4]?parseFloat(s[4]):0,f=(s[5]||s[4]||"rgba(0, 0, 0, 0)").trim();n.push({offsetX:a,offsetY:i,blur:c,spread:d,color:f})}else{const a=r.match(/^(-?\d+(?:\.\d+)?(?:px|em|rem)?)\s+(-?\d+(?:\.\d+)?(?:px|em|rem)?)\s+(-?\d+(?:\.\d+)?(?:px|em|rem)?)\s+(.+)$/);if(a){const i=parseFloat(a[1])||0,c=parseFloat(a[2])||0,d=parseFloat(a[3])||0,f=a[4].trim();n.push({offsetX:i,offsetY:c,blur:d,spread:0,color:f})}}}return n}function Nf(e){if(!e||e==="none")return[];const t=e.split(",").map(r=>r.trim()),n=[];for(const r of t){const s=r.match(/^(-?\d+(?:\.\d+)?(?:px|em|rem)?)\s+(-?\d+(?:\.\d+)?(?:px|em|rem)?)\s+(-?\d+(?:\.\d+)?(?:px|em|rem)?)?\s*(.+)$/);if(s){const a=parseFloat(s[1])||0,i=parseFloat(s[2])||0,c=s[3]?parseFloat(s[3]):0,d=(s[4]||"rgba(0, 0, 0, 0)").trim();n.push({offsetX:a,offsetY:i,blur:c,color:d})}else{const a=r.match(/^(-?\d+(?:\.\d+)?(?:px|em|rem)?)\s+(-?\d+(?:\.\d+)?(?:px|em|rem)?)\s+(.+)$/);if(a){const i=parseFloat(a[1])||0,c=parseFloat(a[2])||0,d=a[3].trim();n.push({offsetX:i,offsetY:c,blur:0,color:d})}}}return n}function or(e,t,n,r){if(e&&e!=="none"&&e!=="0px none rgb(0, 0, 0)"){const s=e.match(/^(\d+(?:\.\d+)?(?:px|em|rem)?)\s+(\w+)\s+(.+)$/);if(s)return{width:s[1],style:s[2],color:s[3].trim()}}return t&&n&&r&&t!=="0px"&&n!=="none"&&r!=="rgb(0, 0, 0)"?{width:t,style:n,color:r}:null}function Ef(e){if(!e||typeof window>"u")return{boxShadows:[],textShadows:[],backgroundColor:null,backgroundImage:null,border:null,outline:null};const t=window.getComputedStyle(e),n=t.boxShadow,r=jf(n),s=t.textShadow,a=Nf(s),i=t.backgroundColor&&t.backgroundColor!=="rgba(0, 0, 0, 0)"&&t.backgroundColor!=="transparent"?t.backgroundColor:null;let c=null;if(t.backgroundImage&&t.backgroundImage!=="none"){const u=t.backgroundImage.replace(/url\([^)]+\)/g,"").trim();if(u&&(u.includes("gradient")||u.includes("linear-gradient")||u.includes("radial-gradient")))c=u;else if(t.backgroundImage.includes("gradient")){const p=t.backgroundImage.match(/(linear-gradient|radial-gradient|conic-gradient)\([^)]+\)/g);p&&p.length>0&&(c=p.join(", "))}}const d=or(t.border,t.borderWidth,t.borderStyle,t.borderColor),f=or(t.outline,t.outlineWidth,t.outlineStyle,t.outlineColor);return{boxShadows:r,textShadows:a,backgroundColor:i,backgroundImage:c,border:d,outline:f}}function Rf({value:e,onChange:t,label:n,placeholder:r,min:s=0,max:a=1e3,step:i=1,unit:c="px",className:d}){const f=l.useRef(null),[u,p]=l.useState(!1),[h,g]=l.useState(e),y=R=>{if(!R||R.trim()==="")return{num:0,unit:c};const A=R.match(/^([\d.]+)(.*)$/);if(A){const L=parseFloat(A[1]),M=A[2].trim()||c;return{num:isNaN(L)?0:L,unit:M}}return{num:0,unit:c}},{num:x,unit:m}=y(e),v=()=>{const R=Math.min(a,x+i);t(`${R}${m}`),g(`${R}${m}`)},b=()=>{const R=Math.max(s,x-i);t(`${R}${m}`),g(`${R}${m}`)},w=R=>{R.key===Ye.Keys.ArrowUp?(R.preventDefault(),v()):R.key===Ye.Keys.ArrowDown?(R.preventDefault(),b()):R.key===Ye.Keys.Enter&&R.currentTarget.blur()},S=R=>{g(R.target.value),t(R.target.value)},E=()=>{p(!0)},j=()=>{p(!1);const{num:R,unit:A}=y(h);(R!==x||A!==m)&&t(`${R}${A}`),g(e)};l.useEffect(()=>{u||g(e)},[e,u]);const P=u?h:e;return o.jsxs("div",{className:X.cn("space-y-0.5",d),children:[n&&o.jsx(G,{className:"text-[10px] text-muted-foreground",children:n}),o.jsxs("div",{className:"flex items-center gap-0.5",children:[o.jsx(Xe,{ref:f,type:"text",value:P,onChange:S,onKeyDown:w,onFocus:E,onBlur:j,placeholder:r,className:"h-6 text-xs flex-1"}),o.jsxs("div",{className:"flex flex-col h-6",children:[o.jsx(ee,{type:"button",variant:"ghost",size:"sm",className:"h-3 w-5 p-0 rounded-b-none border-b border-border hover:bg-muted",onClick:v,disabled:x>=a,children:o.jsx(z.HugeiconsIcon,{icon:B.ArrowUp01Icon,className:"h-2.5 w-2.5"})}),o.jsx(ee,{type:"button",variant:"ghost",size:"sm",className:"h-3 w-5 p-0 rounded-t-none hover:bg-muted",onClick:b,disabled:x<=s,children:o.jsx(z.HugeiconsIcon,{icon:B.ArrowDown01Icon,className:"h-2.5 w-2.5"})})]})]})]})}function xt(e){const t=e.match(/oklab\(([\d.]+)\s+([\d.\-]+)\s+([\d.\-]+)(?:\s*\/\s*([\d.]+))?\)/);if(t){const s=parseFloat(t[1]),a=parseFloat(t[2]),i=parseFloat(t[3]),c=Math.sqrt(a*a+i*i);let d=Math.atan2(i,a)*(180/Math.PI);return d<0&&(d+=360),`oklch(${s.toFixed(2)} ${c.toFixed(2)} ${d.toFixed(0)})`}const n=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(n){const s=parseInt(n[1],10),a=parseInt(n[2],10),i=parseInt(n[3],10),c=s/255,d=a/255,f=i/255,u=c<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4),p=d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4),h=f<=.04045?f/12.92:Math.pow((f+.055)/1.055,2.4),g=.4122214708*u+.5363325363*p+.0514459929*h,y=.2119034982*u+.6806995451*p+.1073969566*h,x=.0883024619*u+.2817188376*p+.6299787005*h,m=Math.pow(Math.abs(g)*.999999998,1/3)*Math.sign(g)*.5+.5,v=g-y,b=(g+y-2*x)/2,w=Math.sqrt(v*v+b*b);let S=Math.atan2(b,v)*(180/Math.PI);return S<0&&(S+=360),`oklch(${m.toFixed(2)} ${w.toFixed(2)} ${S.toFixed(0)})`}const r=e.match(/#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?/i);if(r){const s=parseInt(r[1],16),a=parseInt(r[2],16),i=parseInt(r[3],16),c=s/255,d=a/255,f=i/255,u=c<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4),p=d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4),h=f<=.04045?f/12.92:Math.pow((f+.055)/1.055,2.4),g=.4122214708*u+.5363325363*p+.0514459929*h,y=.2119034982*u+.6806995451*p+.1073969566*h,x=.0883024619*u+.2817188376*p+.6299787005*h,m=Math.pow(Math.abs(g)*.999999998,1/3)*Math.sign(g)*.5+.5,v=g-y,b=(g+y-2*x)/2,w=Math.sqrt(v*v+b*b);let S=Math.atan2(b,v)*(180/Math.PI);return S<0&&(S+=360),`oklch(${m.toFixed(2)} ${w.toFixed(2)} ${S.toFixed(0)})`}return e.startsWith("oklch(")?e:"oklch(0.5 0.15 240)"}function $t(e){if(e.startsWith("rgba(")||e.startsWith("rgb(")||e.startsWith("#"))return e;const t=e.match(/oklch\(([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\)/);if(!t)return e;const n=parseFloat(t[1]),r=parseFloat(t[2]),a=parseFloat(t[3])/360*2*Math.PI,i=r*Math.cos(a),c=r*Math.sin(a),d=n+.3963377774*i+.2158037573*c,f=n-.1055613458*i-.0638541728*c,u=n-.0894841775*i-1.291485548*c,p=Math.max(0,Math.min(1,Math.sign(d)*Math.pow(Math.abs(d)*.999999998*2-1,1/3))),h=Math.max(0,Math.min(1,Math.sign(f)*Math.pow(Math.abs(f)*.999999998*2-1,1/3))),g=Math.max(0,Math.min(1,Math.sign(u)*Math.pow(Math.abs(u)*.999999998*2-1,1/3)));return`rgba(${Math.round(p*255)}, ${Math.round(h*255)}, ${Math.round(g*255)}, 1)`}function oi({enabled:e,selectedElement:t,onElementSelect:n,onElementHover:r,lockedElement:s,setLockedElement:a,lockedElementRef:i,className:c}){const[d,f]=l.useState(!0),[u,p]=l.useState([]),[h,g]=l.useState([]),[y,x]=l.useState([]),[m,v]=l.useState([]),[b,w]=l.useState([]),[S,E]=l.useState([]),[j,P]=l.useState(""),[R,A]=l.useState(null),L=l.useRef(null),M=s!==void 0?s:R,D=a||A,W=i||L,H=l.useCallback(N=>{const k=Ef(N);if(k.boxShadows.length>0){const ae=k.boxShadows.map(te=>({id:Math.random().toString(36).substr(2,9),offsetX:te.offsetX,offsetY:te.offsetY,blur:te.blur,spread:te.spread,color:te.color}));g(ae)}else g([]);if(k.textShadows.length>0){const ae=k.textShadows.map(te=>({id:Math.random().toString(36).substr(2,9),offsetX:te.offsetX,offsetY:te.offsetY,blur:te.blur,color:te.color}));x(ae)}else x([]);const T=[];if(k.backgroundColor){let ae=k.backgroundColor,te="custom";if(k.backgroundColor.startsWith("var(")){const xe=ot(k.backgroundColor);xe&&!xe.startsWith("var(")?(ae=xe,te="custom"):te="variable"}T.push({id:Math.random().toString(36).substr(2,9),type:"color",value:ae,colorType:te})}k.backgroundImage&&T.push({id:Math.random().toString(36).substr(2,9),type:"gradient",value:k.backgroundImage}),w(T);const re=[];if(k.border){let ae=k.border.color;if(ae.startsWith("var(")){const te=ot(ae);te&&!te.startsWith("var(")&&(ae=te)}re.push({id:Math.random().toString(36).substr(2,9),type:"border",color:ae,width:k.border.width,style:k.border.style})}k.outline&&re.push({id:Math.random().toString(36).substr(2,9),type:"outline",color:k.outline.color,width:k.outline.width,style:k.outline.style}),E(re)},[]);l.useEffect(()=>{if(s!==void 0){t&&t!==W.current&&(W.current=t,H(t));return}t&&t!==W.current?(D(t),W.current=t,H(t)):t||(D(null),W.current=null)},[t,H,s]);const U=M||t,[V,Y]=l.useState(!0),[F,J]=l.useState(!1),[se,ce]=l.useState(!1),[he,de]=l.useState(!1),[ne,we]=l.useState(!1);l.useEffect(()=>{if(e){const N=gf();p(N)}},[e]),l.useEffect(()=>{if(!e||!d||!U){oo();return}const N=[];h.forEach(_=>{N.push(`${_.offsetX}px ${_.offsetY}px ${_.blur}px ${_.spread}px ${_.color}`)}),m.forEach(_=>{_.color&&N.push(`0 0 ${_.blur}px ${_.spread}px ${_.color}`)});const k=y.filter(_=>_.color).map(_=>`${_.offsetX}px ${_.offsetY}px ${_.blur}px ${_.color}`).join(", "),T=[],re=[];b.forEach(_=>{if(_.type==="color"&&_.value){const fe=_.colorType==="variable"?ot(_.value):_.value;T.push(fe)}else _.type==="gradient"&&_.value&&re.push(_.value)});const ae=S.find(_=>_.type==="border"&&_.color),te=S.filter(_=>_.type==="outline"&&_.color),xe={boxShadow:N.length>0?N.join(", "):void 0,textShadow:k||void 0,glow:m.length>0&&m[0].color?{color:m[0].color,blur:m[0].blur,spread:m[0].spread}:void 0,backgroundColor:T.length>0?T[0]:void 0,backgroundImage:re.length>0?re.join(", "):void 0,border:ae?{color:ae.color,width:ae.width,style:ae.style}:void 0,customCss:j||void 0};if(te.length>0){const _=te.map(fe=>`outline: ${fe.width} ${fe.style} ${fe.color} !important;`).join(`
|
|
137
|
+
`);xe.customCss=xe.customCss?`${xe.customCss}
|
|
138
|
+
${_}`:_}Sf(U,xe)},[e,d,U,M,h,y,m,b,S,j]),l.useEffect(()=>()=>{oo()},[]),l.useEffect(()=>{if(!e||!r)return;const N=T=>{const re=document.elementFromPoint(T.clientX,T.clientY);if(nr(re)){r(null);return}if(re?.closest("[data-debug-panel]")){r(null);return}r(re||null)},k=()=>{r(null)};return e&&(document.addEventListener("mousemove",N),document.addEventListener("mouseleave",k)),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseleave",k)}},[e,r]),l.useEffect(()=>{if(!e||!n)return;const N=k=>{const T=k.target;nr(T)||T.closest("[data-debug-panel]")||M||(k.preventDefault(),k.stopPropagation(),n(T))};return e&&document.addEventListener("click",N,!0),()=>{document.removeEventListener("click",N,!0)}},[e,n,t,M]);const ue=()=>{g([...h,{id:Math.random().toString(36).substr(2,9),offsetX:0,offsetY:2,blur:4,spread:0,color:"rgba(0, 0, 0, 0.1)"}])},$=N=>{g(h.filter(k=>k.id!==N))},Q=(N,k)=>{g(h.map(T=>T.id===N?{...T,...k}:T))},K=()=>{g([]),x([]),v([]),w([]),E([]),P("")},oe=()=>{const N=[],k=[];if(h.forEach(_=>{k.push(`${_.offsetX}px ${_.offsetY}px ${_.blur}px ${_.spread}px ${_.color}`)}),m.forEach(_=>{_.color&&k.push(`0 0 ${_.blur}px ${_.spread}px ${_.color}`)}),k.length>0&&N.push(`box-shadow: ${k.join(", ")};`),y.length>0){const _=y.filter(fe=>fe.color).map(fe=>`${fe.offsetX}px ${fe.offsetY}px ${fe.blur}px ${fe.color}`).join(", ");_&&N.push(`text-shadow: ${_};`)}const T=[],re=[];b.forEach(_=>{if(_.type==="color"&&_.value){const fe=_.colorType==="variable"?ot(_.value):_.value;T.push(fe)}else _.type==="gradient"&&_.value&&re.push(_.value)}),T.length>0&&N.push(`background-color: ${T[0]};`),re.length>0&&N.push(`background-image: ${re.join(", ")};`);const ae=S.find(_=>_.type==="border"&&_.color);ae&&N.push(`border: ${ae.width} ${ae.style} ${ae.color};`),S.filter(_=>_.type==="outline"&&_.color).forEach(_=>{N.push(`outline: ${_.width} ${_.style} ${_.color};`)}),j&&N.push(j);const xe=N.join(`
|
|
139
|
+
`);navigator.clipboard.writeText(xe).catch(console.error)},Z=l.useMemo(()=>{const N={};for(const k of u){const T=k.category||"other";N[T]||(N[T]=[]),N[T].push(k)}return N},[u]);return e?o.jsxs("div",{className:X.cn("flex flex-col",c),children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.PaintBoardIcon,size:16,className:X.cn("h-4 w-4",d?"text-primary":"text-muted-foreground")}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx(G,{className:"text-sm font-semibold",children:"Preview"}),o.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Show live style changes"})]})]}),o.jsx(Se,{checked:d,onCheckedChange:f})]}),U?o.jsxs("div",{className:"text-xs text-muted-foreground p-1.5 bg-muted rounded mb-2 space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:["Selected: ",o.jsx("span",{className:"font-mono text-foreground",children:U.tagName.toLowerCase()}),M&&o.jsx("span",{className:"ml-2 text-[10px] text-primary",children:"(Locked)"})]}),M&&o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(ee,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs",onClick:()=>H(U),title:"Reload current styles from element",children:[o.jsx(z.HugeiconsIcon,{icon:B.LayoutIcon,className:"h-3 w-3 mr-0.5"}),"Reload"]}),o.jsx(ee,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs",onClick:()=>{D(null),W.current=null,n?.(null)},title:"Unlock and select new element",children:"Unlock"})]})]}),o.jsx("div",{className:"text-[10px] text-muted-foreground italic",children:"Current styles loaded. Edit below or add new layers."})]}):o.jsx("div",{className:"text-xs text-muted-foreground p-1.5 bg-muted rounded italic mb-2",children:"Click on an element to select it"}),o.jsxs("div",{className:"space-y-1.5 max-h-[400px] overflow-y-auto pr-1",children:[o.jsxs(et,{open:V,onOpenChange:Y,children:[o.jsxs(tt,{className:"w-full flex items-center justify-between p-1.5 rounded hover:bg-muted/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.LayoutIcon,className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx(G,{className:"text-xs font-medium cursor-pointer",children:"Shadows"})]}),V?o.jsx(z.HugeiconsIcon,{icon:B.ArrowUp01Icon,className:"h-3.5 w-3.5"}):o.jsx(z.HugeiconsIcon,{icon:B.ArrowDown01Icon,className:"h-3.5 w-3.5"})]}),o.jsxs(nt,{className:"space-y-2 pt-1.5 px-2 pb-2 rounded-md bg-background border border-input shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)] dark:shadow-[inset_0_2px_4px_rgba(0,0,0,0.3)]",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(G,{className:"text-xs text-muted-foreground",children:"Box Shadow"}),o.jsxs(ee,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs",onClick:ue,children:[o.jsx(z.HugeiconsIcon,{icon:B.Add01Icon,className:"h-3 w-3 mr-0.5"}),"Add"]})]}),h.map(N=>o.jsxs("div",{className:"space-y-1.5 p-1.5 border border-border rounded bg-muted/30",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Layer ",h.indexOf(N)+1]}),o.jsx(ee,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0",onClick:()=>$(N.id),children:o.jsx(z.HugeiconsIcon,{icon:B.Cancel01Icon,className:"h-2.5 w-2.5"})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"X"}),o.jsx(Ce,{value:[N.offsetX],onValueChange:([k])=>Q(N.id,{offsetX:k}),min:-20,max:20,step:1,className:"h-1"}),o.jsxs("div",{className:"text-[10px] font-mono text-foreground",children:[N.offsetX,"px"]})]}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Y"}),o.jsx(Ce,{value:[N.offsetY],onValueChange:([k])=>Q(N.id,{offsetY:k}),min:-20,max:20,step:1,className:"h-1"}),o.jsxs("div",{className:"text-[10px] font-mono text-foreground",children:[N.offsetY,"px"]})]}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Blur"}),o.jsx(Ce,{value:[N.blur],onValueChange:([k])=>Q(N.id,{blur:k}),min:0,max:50,step:1,className:"h-1"}),o.jsxs("div",{className:"text-[10px] font-mono text-foreground",children:[N.blur,"px"]})]}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Spread"}),o.jsx(Ce,{value:[N.spread],onValueChange:([k])=>Q(N.id,{spread:k}),min:-10,max:10,step:1,className:"h-1"}),o.jsxs("div",{className:"text-[10px] font-mono text-foreground",children:[N.spread,"px"]})]})]}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Color"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Qe,{value:N.color?xt(N.color):"oklch(0.5 0.15 240)",onChange:k=>Q(N.id,{color:$t(k)}),className:"h-6 w-6"}),o.jsx(Xe,{value:N.color,onChange:k=>Q(N.id,{color:k.target.value}),placeholder:"rgba(0,0,0,0.1)",className:"h-6 text-xs flex-1"})]})]})]},N.id))]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(G,{className:"text-xs text-muted-foreground",children:"Text Shadow"}),o.jsxs(ee,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs",onClick:()=>{x([...y,{id:Math.random().toString(36).substr(2,9),offsetX:0,offsetY:2,blur:4,color:"rgba(0, 0, 0, 0.5)"}])},children:[o.jsx(z.HugeiconsIcon,{icon:B.Add01Icon,className:"h-3 w-3 mr-0.5"}),"Add"]})]}),y.map(N=>o.jsxs("div",{className:"space-y-1.5 p-1.5 border border-border rounded bg-muted/30",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Layer ",y.indexOf(N)+1]}),o.jsx(ee,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0",onClick:()=>x(y.filter(k=>k.id!==N.id)),children:o.jsx(z.HugeiconsIcon,{icon:B.Cancel01Icon,className:"h-2.5 w-2.5"})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"X"}),o.jsx(Ce,{value:[N.offsetX],onValueChange:([k])=>x(y.map(T=>T.id===N.id?{...T,offsetX:k}:T)),min:-10,max:10,step:1,className:"h-1"}),o.jsxs("div",{className:"text-[10px] font-mono text-foreground",children:[N.offsetX,"px"]})]}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Y"}),o.jsx(Ce,{value:[N.offsetY],onValueChange:([k])=>x(y.map(T=>T.id===N.id?{...T,offsetY:k}:T)),min:-10,max:10,step:1,className:"h-1"}),o.jsxs("div",{className:"text-[10px] font-mono text-foreground",children:[N.offsetY,"px"]})]}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Blur"}),o.jsx(Ce,{value:[N.blur],onValueChange:([k])=>x(y.map(T=>T.id===N.id?{...T,blur:k}:T)),min:0,max:20,step:1,className:"h-1"}),o.jsxs("div",{className:"text-[10px] font-mono text-foreground",children:[N.blur,"px"]})]}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Color"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Qe,{value:N.color?xt(N.color):"oklch(0.5 0.15 240)",onChange:k=>x(y.map(T=>T.id===N.id?{...T,color:$t(k)}:T)),className:"h-6 w-6"}),o.jsx(Xe,{value:N.color,onChange:k=>x(y.map(T=>T.id===N.id?{...T,color:k.target.value}:T)),placeholder:"rgba(0,0,0,0.5)",className:"h-6 text-xs flex-1"})]})]})]})]},N.id))]})]})]}),o.jsxs(et,{open:F,onOpenChange:J,children:[o.jsxs(tt,{className:"w-full flex items-center justify-between p-1.5 rounded hover:bg-muted/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.LayoutIcon,className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx(G,{className:"text-xs font-medium cursor-pointer",children:"Effects"})]}),F?o.jsx(z.HugeiconsIcon,{icon:B.ArrowUp01Icon,className:"h-3.5 w-3.5"}):o.jsx(z.HugeiconsIcon,{icon:B.ArrowDown01Icon,className:"h-3.5 w-3.5"})]}),o.jsx(nt,{className:"space-y-1.5 pt-1.5 px-2 pb-2 rounded-md bg-background border border-input shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)] dark:shadow-[inset_0_2px_4px_rgba(0,0,0,0.3)]",children:o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(G,{className:"text-xs text-muted-foreground",children:"Glow"}),o.jsxs(ee,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs",onClick:()=>{v([...m,{id:Math.random().toString(36).substr(2,9),color:"rgba(59, 130, 246, 0.5)",blur:20,spread:0}])},children:[o.jsx(z.HugeiconsIcon,{icon:B.Add01Icon,className:"h-3 w-3 mr-0.5"}),"Add"]})]}),m.map(N=>o.jsxs("div",{className:"space-y-1.5 p-1.5 border border-border rounded bg-muted/30",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Layer ",m.indexOf(N)+1]}),o.jsx(ee,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0",onClick:()=>v(m.filter(k=>k.id!==N.id)),children:o.jsx(z.HugeiconsIcon,{icon:B.Cancel01Icon,className:"h-2.5 w-2.5"})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Blur"}),o.jsx(Ce,{value:[N.blur],onValueChange:([k])=>v(m.map(T=>T.id===N.id?{...T,blur:k}:T)),min:0,max:50,step:1,className:"h-1"}),o.jsxs("div",{className:"text-[10px] font-mono text-foreground",children:[N.blur,"px"]})]}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Spread"}),o.jsx(Ce,{value:[N.spread],onValueChange:([k])=>v(m.map(T=>T.id===N.id?{...T,spread:k}:T)),min:-10,max:20,step:1,className:"h-1"}),o.jsxs("div",{className:"text-[10px] font-mono text-foreground",children:[N.spread,"px"]})]})]}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Color"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Qe,{value:N.color?xt(N.color):"oklch(0.5 0.15 240)",onChange:k=>v(m.map(T=>T.id===N.id?{...T,color:$t(k)}:T)),className:"h-6 w-6"}),o.jsx(Xe,{value:N.color,onChange:k=>v(m.map(T=>T.id===N.id?{...T,color:k.target.value}:T)),placeholder:"rgba(59, 130, 246, 0.5)",className:"h-6 text-xs flex-1"})]})]})]},N.id))]})})]}),o.jsxs(et,{open:se,onOpenChange:ce,children:[o.jsxs(tt,{className:"w-full flex items-center justify-between p-1.5 rounded hover:bg-muted/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.PaintBoardIcon,className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx(G,{className:"text-xs font-medium cursor-pointer",children:"Colors"})]}),se?o.jsx(z.HugeiconsIcon,{icon:B.ArrowUp01Icon,className:"h-3.5 w-3.5"}):o.jsx(z.HugeiconsIcon,{icon:B.ArrowDown01Icon,className:"h-3.5 w-3.5"})]}),o.jsx(nt,{className:"space-y-1.5 pt-1.5 px-2 pb-2 rounded-md bg-background border border-input shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)] dark:shadow-[inset_0_2px_4px_rgba(0,0,0,0.3)]",children:o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(G,{className:"text-xs text-muted-foreground",children:"Background"}),o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(ee,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs",onClick:()=>{w([...b,{id:Math.random().toString(36).substr(2,9),type:"color",value:"",colorType:"custom"}])},title:"Add color layer",children:[o.jsx(z.HugeiconsIcon,{icon:B.Add01Icon,className:"h-3 w-3 mr-0.5"}),"Color"]}),o.jsxs(ee,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs",onClick:()=>{w([...b,{id:Math.random().toString(36).substr(2,9),type:"gradient",value:""}])},title:"Add gradient layer",children:[o.jsx(z.HugeiconsIcon,{icon:B.Add01Icon,className:"h-3 w-3 mr-0.5"}),"Gradient"]})]})]}),b.map(N=>o.jsxs("div",{className:"space-y-1.5 p-1.5 border border-border rounded bg-muted/30",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Layer ",b.indexOf(N)+1," (",N.type,")"]}),o.jsx(ee,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0",onClick:()=>w(b.filter(k=>k.id!==N.id)),children:o.jsx(z.HugeiconsIcon,{icon:B.Cancel01Icon,className:"h-2.5 w-2.5"})})]}),N.type==="color"?o.jsxs(o.Fragment,{children:[o.jsxs(Lt,{value:N.colorType||"custom",onValueChange:k=>w(b.map(T=>T.id===N.id?{...T,colorType:k}:T)),children:[o.jsx(Dt,{className:"h-6 text-xs",children:o.jsx(Ot,{})}),o.jsxs(Ht,{className:"z-[var(--z-debug)]",position:"popper",children:[o.jsx(Me,{value:"variable",children:"CSS Variable"}),o.jsx(Me,{value:"custom",children:"Custom"})]})]}),N.colorType==="variable"?o.jsxs(Lt,{value:N.value,onValueChange:k=>w(b.map(T=>T.id===N.id?{...T,value:k}:T)),children:[o.jsx(Dt,{className:"h-6 text-xs",children:o.jsx(Ot,{placeholder:"Select color variable"})}),o.jsx(Ht,{className:"z-[var(--z-debug)] max-h-[200px]",position:"popper",children:Object.entries(Z).map(([k,T])=>o.jsxs("div",{children:[o.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:k.charAt(0).toUpperCase()+k.slice(1)}),T.map(re=>o.jsx(Me,{value:re.name,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-4 h-4 rounded border border-border",style:{backgroundColor:re.swatchColor||re.value}}),o.jsx("span",{className:"font-mono text-xs",children:re.name})]})},re.name))]},k))})]}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Qe,{value:N.value?N.value.startsWith("oklch(")?N.value:xt(N.value):"oklch(0.5 0.15 240)",onChange:k=>w(b.map(T=>T.id===N.id?{...T,value:k}:T)),className:"h-6 w-6"}),o.jsx(Xe,{value:N.value,onChange:k=>w(b.map(T=>T.id===N.id?{...T,value:k.target.value}:T)),placeholder:"oklch(0.5 0.2 240) or #3b82f6",className:"h-6 text-xs flex-1"})]})]}):o.jsx(eo,{value:N.value,onChange:k=>w(b.map(T=>T.id===N.id?{...T,value:k.target.value}:T)),placeholder:"linear-gradient(to right, #ff0000, #0000ff)",className:"h-12 text-xs font-mono"})]},N.id))]})})]}),o.jsxs(et,{open:he,onOpenChange:de,children:[o.jsxs(tt,{className:"w-full flex items-center justify-between p-1.5 rounded hover:bg-muted/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.LayoutIcon,className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx(G,{className:"text-xs font-medium cursor-pointer",children:"Border"})]}),he?o.jsx(z.HugeiconsIcon,{icon:B.ArrowUp01Icon,className:"h-3.5 w-3.5"}):o.jsx(z.HugeiconsIcon,{icon:B.ArrowDown01Icon,className:"h-3.5 w-3.5"})]}),o.jsx(nt,{className:"space-y-1.5 pt-1.5 px-2 pb-2 rounded-md bg-background border border-input shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)] dark:shadow-[inset_0_2px_4px_rgba(0,0,0,0.3)]",children:o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(G,{className:"text-xs text-muted-foreground",children:"Border"}),o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(ee,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs",onClick:()=>{E([...S,{id:Math.random().toString(36).substr(2,9),type:"border",color:"",width:"1px",style:"solid"}])},title:"Add border layer",children:[o.jsx(z.HugeiconsIcon,{icon:B.Add01Icon,className:"h-3 w-3 mr-0.5"}),"Border"]}),o.jsxs(ee,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs",onClick:()=>{E([...S,{id:Math.random().toString(36).substr(2,9),type:"outline",color:"",width:"1px",style:"solid"}])},title:"Add outline layer",children:[o.jsx(z.HugeiconsIcon,{icon:B.Add01Icon,className:"h-3 w-3 mr-0.5"}),"Outline"]})]})]}),S.map(N=>o.jsxs("div",{className:"space-y-1.5 p-1.5 border border-border rounded bg-muted/30",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Layer ",S.indexOf(N)+1," (",N.type,")"]}),o.jsx(ee,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0",onClick:()=>E(S.filter(k=>k.id!==N.id)),children:o.jsx(z.HugeiconsIcon,{icon:B.Cancel01Icon,className:"h-2.5 w-2.5"})})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-1.5 items-start",children:[o.jsx(Rf,{label:"Width",value:N.width,onChange:k=>E(S.map(T=>T.id===N.id?{...T,width:k}:T)),placeholder:"1px",min:0,max:100,step:1,unit:"px"}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Style"}),o.jsxs(Lt,{value:N.style,onValueChange:k=>E(S.map(T=>T.id===N.id?{...T,style:k}:T)),children:[o.jsx(Dt,{className:"h-6 text-xs w-full",size:"sm",children:o.jsx(Ot,{})}),o.jsxs(Ht,{className:"z-[var(--z-debug)]",position:"popper",children:[o.jsx(Me,{value:"solid",children:"Solid"}),o.jsx(Me,{value:"dashed",children:"Dashed"}),o.jsx(Me,{value:"dotted",children:"Dotted"}),o.jsx(Me,{value:"double",children:"Double"}),o.jsx(Me,{value:"none",children:"None"})]})]})]}),o.jsxs("div",{className:"space-y-0.5 flex flex-col",children:[o.jsx(G,{className:"text-[10px] text-muted-foreground",children:"Color"}),o.jsx("div",{className:"flex items-center h-6",children:o.jsx(Qe,{value:N.color?xt(N.color):"oklch(0.5 0.15 240)",onChange:k=>E(S.map(T=>T.id===N.id?{...T,color:$t(k)}:T)),className:"h-6 w-6"})})]})]})]},N.id))]})})]}),o.jsxs(et,{open:ne,onOpenChange:we,children:[o.jsxs(tt,{className:"w-full flex items-center justify-between p-1.5 rounded hover:bg-muted/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.CodeIcon,className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx(G,{className:"text-xs font-medium cursor-pointer",children:"Advanced"})]}),ne?o.jsx(z.HugeiconsIcon,{icon:B.ArrowUp01Icon,className:"h-3.5 w-3.5"}):o.jsx(z.HugeiconsIcon,{icon:B.ArrowDown01Icon,className:"h-3.5 w-3.5"})]}),o.jsx(nt,{className:"space-y-1.5 pt-1.5 px-2 pb-2 rounded-md bg-background border border-input shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)] dark:shadow-[inset_0_2px_4px_rgba(0,0,0,0.3)]",children:o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(G,{className:"text-xs text-muted-foreground",children:"Custom CSS"}),o.jsx(eo,{value:j,onChange:N=>P(N.target.value),placeholder:"Enter custom CSS properties...",className:"h-16 text-xs font-mono"})]})})]})]}),o.jsxs("div",{className:"flex gap-1.5 pt-2 mt-2 border-t border-border",children:[o.jsxs(ee,{variant:"outline",size:"sm",className:"flex-1 text-xs h-7",onClick:K,children:[o.jsx(z.HugeiconsIcon,{icon:B.LayoutIcon,className:"h-3 w-3 mr-1"}),"Reset"]}),o.jsxs(ee,{variant:"outline",size:"sm",className:"flex-1 text-xs h-7",onClick:oe,children:[o.jsx(z.HugeiconsIcon,{icon:B.CodeIcon,className:"h-3 w-3 mr-1"}),"Export CSS"]})]})]}):null}function Pf({className:e}){const[t,n]=l.useState(!1),[r,s]=l.useState(!1),[a,i]=l.useState(!1),[c,d]=l.useState(!1),[f,u]=l.useState(!1),[p,h]=l.useState(3),[g,y]=l.useState(!1),[x,m]=l.useState(!1),[v,b]=l.useState(!1),[w,S]=l.useState(null),E=l.useRef(null),[j,P]=l.useState([]),[R,A]=l.useState(!1),[L,M]=l.useState(null),[D,W]=l.useState(null),[H,U]=l.useState(!1),[V,Y]=l.useState(null);l.useEffect(()=>{},[V]);const[F,J]=l.useState(null),[se,ce]=l.useState(!1),[he,de]=l.useState("tools"),ne=l.useRef(null);l.useEffect(()=>{f&&H&&D&&Y(D)},[f,H,D]),l.useEffect(()=>{(f||H)&&de("inspector")},[f,H]),l.useEffect(()=>{f&&(r||a||c||g||R||H)&&(ne.current&&(clearTimeout(ne.current),ne.current=null),ce(!0))},[f,r,a,c,g,R,H]),l.useEffect(()=>()=>{ne.current&&clearTimeout(ne.current)},[]);const we=()=>{f&&(ne.current&&(clearTimeout(ne.current),ne.current=null),ne.current=setTimeout(()=>{ce(!0),ne.current=null},200))},ue=()=>{f&&(ne.current&&(clearTimeout(ne.current),ne.current=null),ne.current=setTimeout(()=>{ce(!1),ne.current=null},200))},[$,Q]=l.useState(null),[K,oe]=l.useState(null),[Z,N]=l.useState(()=>({x:960,y:20}));l.useEffect(()=>{if(typeof window<"u"){const I=localStorage.getItem("nqui-debug-button-position");if(I)try{const O=JSON.parse(I),q=Math.max(20,Math.min(window.innerWidth-20,O.x)),le=Math.max(16,Math.min(window.innerHeight-20,O.y));N({x:q,y:le})}catch{N({x:window.innerWidth/2,y:20})}else N({x:window.innerWidth/2,y:20})}},[]);const[k,T]=l.useState(!1),[re,ae]=l.useState(!1),[te,xe]=l.useState(null),[_,fe]=l.useState(null),[Cn,Sn]=l.useState(!1),[Ho,jn]=l.useState(!1),Fo=l.useRef(null),Nn=l.useRef(null),[ge,pt]=l.useState(null);l.useEffect(()=>{if(typeof window<"u"){const I=localStorage.getItem("nqui-debug-panel-position");if(I)try{const O=JSON.parse(I);pt(O)}catch{}}},[]),l.useEffect(()=>{typeof window<"u"&&localStorage.setItem("nqui-debug-button-position",JSON.stringify(Z))},[Z]),l.useEffect(()=>{typeof window<"u"&&ge&&localStorage.setItem("nqui-debug-panel-position",JSON.stringify(ge))},[ge]),l.useEffect(()=>{const I=()=>{const le=window.innerWidth-20,ie=40/2,Oe=window.innerHeight-40/2;if(N(Ue=>({x:Math.max(20,Math.min(le,Ue.x)),y:Math.max(ie,Math.min(Oe,Ue.y))})),ge){const Tt=window.innerWidth-160,kn=0,Tn=window.innerHeight-400;pt(mt=>mt?{x:Math.max(160,Math.min(Tt,mt.x)),y:Math.max(kn,Math.min(Tn,mt.y))}:null)}};return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[ge]),l.useEffect(()=>{if(!t)return;const I=O=>{const q=O.target,le=document.querySelector("[data-debug-panel]"),ie=Fo.current;le&&!le.contains(q)&&ie&&!ie.contains(q)&&n(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[t]),l.useEffect(()=>{const I=w||(f?D:F||V);if(!I||v){!I&&!v&&Q(null);return}const O=window.getComputedStyle(I),q=I.getBoundingClientRect();Q({tag:I.tagName.toLowerCase(),classes:Array.from(I.classList),styles:{border:O.border||O.borderWidth?`${O.borderWidth} ${O.borderStyle} ${O.borderColor}`:void 0,boxShadow:O.boxShadow!=="none"?O.boxShadow:void 0,borderRadius:O.borderRadius,padding:O.padding,margin:O.margin,backgroundColor:O.backgroundColor,color:O.color},dimensions:{width:q.width,height:q.height,top:q.top,left:q.left}})},[D,V,F,f,v,w]);const En=l.useCallback(()=>{if(w)S(null),E.current=null,b(!1),oe(null);else{const I=f?D:F||V;I&&(S(I),E.current=I,$&&(oe($),b(!0)))}},[w,f,D,F,V,$]);l.useEffect(()=>{if(!f&&!H&&!t)return;const I=O=>{if(O.key===Ye.Keys.Space&&(f||H)){if(Ye.shouldIgnoreKeyboardShortcut(O.target))return;O.preventDefault(),En()}if(O.key===Ye.Keys.Escape&&t){if(Ye.shouldIgnoreKeyboardShortcut(O.target))return;n(!1)}};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[f,H,t,En]),l.useEffect(()=>{if(!R)return;const I=O=>{const q=O.target;q.closest("[data-debug-panel]")||q.closest('button[title="Debug Tools"]')||(j.length<2?P([...j,{x:O.clientX,y:O.clientY}]):P([{x:O.clientX,y:O.clientY}]))};return document.addEventListener("click",I),()=>document.removeEventListener("click",I)},[R,j]),l.useEffect(()=>{if(!f||!D)return;const I=async O=>{const q=O.target;if(!(q.closest("[data-debug-panel]")||q.closest('button[title="Debug Tools"]'))&&O.altKey&&D){O.preventDefault();const ie=window.getComputedStyle(D).backgroundColor;ie&&ie!=="rgba(0, 0, 0, 0)"&&ie!=="transparent"&&M(ie)}};return document.addEventListener("click",I,!0),()=>document.removeEventListener("click",I,!0)},[f,D]),l.useEffect(()=>{if(!k||!te)return;const I=q=>{const le=Math.abs(q.clientX-te.x),ie=Math.abs(q.clientY-te.y);if((le>5||ie>5)&&Sn(!0),Cn||le>5||ie>5){const Rn=window.innerWidth-20,Pn=40/2,Tt=window.innerHeight-40/2;N({x:Math.max(20,Math.min(Rn,q.clientX)),y:Math.max(Pn,Math.min(Tt,q.clientY))})}},O=()=>{T(!1),xe(null),setTimeout(()=>Sn(!1),100)};return document.addEventListener("mousemove",I),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",O)}},[k,te,Cn]),l.useEffect(()=>{if(!re||!_||!Nn.current)return;let I=null,O=null;const q=ie=>{const Oe=Math.abs(ie.clientX-_.x),Ue=Math.abs(ie.clientY-_.y);if((Oe>5||Ue>5)&&jn(!0),Ho||Oe>5||Ue>5){const kn=window.innerWidth-160,Tn=0,mt=window.innerHeight-400,ii=ie.clientX-_.offsetX,li=ie.clientY-_.offsetY;O={x:Math.max(160,Math.min(kn,ii)),y:Math.max(Tn,Math.min(mt,li))},I===null&&(I=requestAnimationFrame(()=>{O&&(pt(O),O=null),I=null}))}},le=()=>{ae(!1),fe(null),setTimeout(()=>jn(!1),100),O&&(pt(O),O=null),I!==null&&(cancelAnimationFrame(I),I=null)};return document.addEventListener("mousemove",q),document.addEventListener("mouseup",le),()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",le),I!==null&&cancelAnimationFrame(I)}},[re,_,Ho]);const ri=I=>{I.preventDefault(),xe({x:I.clientX,y:I.clientY}),T(!0),Sn(!1)},si=I=>{Cn||(n(!0),ge||pt({x:Math.max(160,Math.min(window.innerWidth-160,Z.x)),y:Math.max(16,Math.min(window.innerHeight-400,Z.y+50))}))},ai=I=>{if(!Nn.current)return;I.preventDefault(),I.stopPropagation();const O=ge?.x??Math.max(160,Math.min(window.innerWidth-160,Z.x)),q=ge?.y??Math.max(16,Math.min(window.innerHeight-400,Z.y+50)),le=I.clientX-O,ie=I.clientY-q;fe({x:I.clientX,y:I.clientY,offsetX:le,offsetY:ie}),ae(!0),jn(!1)};return l.useEffect(()=>{const I="debug-styles";let O=document.getElementById(I);O||(O=document.createElement("style"),O.id=I,document.head.appendChild(O));let q="";return r&&(q+=`
|
|
140
|
+
* {
|
|
141
|
+
outline: 1px solid rgba(255, 0, 0, 0.2) !important;
|
|
142
|
+
}
|
|
143
|
+
*:hover {
|
|
144
|
+
outline: 1px solid rgba(255, 0, 0, 0.5) !important;
|
|
145
|
+
}
|
|
146
|
+
`),a&&(q+=`
|
|
147
|
+
* {
|
|
148
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 255, 0.3) !important;
|
|
149
|
+
}
|
|
150
|
+
*:hover {
|
|
151
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 255, 0.6) !important;
|
|
152
|
+
}
|
|
153
|
+
`),c&&(q+=`
|
|
154
|
+
body::before {
|
|
155
|
+
content: '';
|
|
156
|
+
position: fixed;
|
|
157
|
+
top: 0;
|
|
158
|
+
left: 0;
|
|
159
|
+
right: 0;
|
|
160
|
+
bottom: 0;
|
|
161
|
+
background-image:
|
|
162
|
+
linear-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
|
|
163
|
+
linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
|
|
164
|
+
background-size: 8px 8px;
|
|
165
|
+
pointer-events: none;
|
|
166
|
+
z-index: 9998;
|
|
167
|
+
}
|
|
168
|
+
`),O.textContent=q,()=>{O&&!r&&!a&&!c&&(O.textContent="")}},[r,a,c]),o.jsxs(o.Fragment,{children:[!t&&o.jsx(ee,{ref:Fo,variant:"outline",size:"icon",className:X.cn("fixed z-[var(--z-debug)] rounded-full shadow-lg cursor-move","bg-background/80 backdrop-blur-sm border-2","hover:bg-background/90 transition-colors",k&&"ring-2 ring-primary ring-offset-2",e),style:{left:`${Z.x}px`,top:`${Z.y}px`,transform:"translate(-50%, 0)"},onMouseDown:ri,onClick:si,title:"Debug Tools",children:o.jsx(z.HugeiconsIcon,{icon:B.SettingsIcon,className:"h-5 w-5"})}),t&&o.jsxs("div",{ref:Nn,"data-debug-panel":!0,className:X.cn("fixed z-[var(--z-debug)] w-80 rounded-lg shadow-xl p-4","nqui-debug-panel",re&&"ring-2 ring-primary ring-offset-2",e),style:{left:ge?`${ge.x}px`:`${Math.max(160,Math.min(window.innerWidth-160,Z.x))}px`,top:ge?`${ge.y}px`:`${Math.max(16,Math.min(window.innerHeight-400,Z.y+50))}px`,transform:"translate(-50%, 0)"},children:[o.jsxs("div",{className:"flex items-center justify-between mb-4 cursor-move select-none",onMouseDown:ai,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.SettingsIcon,className:"h-5 w-5 text-primary"}),o.jsx("h3",{className:"font-semibold text-sm",children:"Debug Tools"})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(z.HugeiconsIcon,{icon:B.LayoutIcon,className:"h-4 w-4 text-muted-foreground","aria-label":"Drag to move panel"}),o.jsx(ee,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:I=>{I.stopPropagation(),n(!1)},children:o.jsx(z.HugeiconsIcon,{icon:B.Cancel01Icon,className:"h-4 w-4"})})]})]}),o.jsxs(To,{value:he,onValueChange:de,className:"w-full",children:[o.jsxs(Io,{className:"w-full mb-4 [&]:!inline-flex [&]:!h-9 [&]:!p-1",children:[o.jsx(Kt,{value:"tools",className:"flex-1",children:"Tools"}),o.jsx(Kt,{value:"inspector",className:"flex-1",children:"Inspector"})]}),o.jsxs(qt,{value:"tools",className:"space-y-4 mt-0",children:[o.jsx("div",{className:"space-y-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.LayoutIcon,className:X.cn("h-4 w-4",f?"text-primary":"text-muted-foreground")}),o.jsx(G,{htmlFor:"magnifier",className:"text-sm cursor-pointer",children:"Magnifier"})]}),o.jsx(Se,{id:"magnifier",checked:f,onCheckedChange:u})]})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.PaintBoardIcon,className:X.cn("h-4 w-4",H?"text-primary":"text-muted-foreground")}),o.jsx(G,{htmlFor:"ui-tester",className:"text-sm cursor-pointer",children:"UI Tester"})]}),o.jsx(Se,{id:"ui-tester",checked:H,onCheckedChange:I=>{U(I),I||Y(null)}})]}),o.jsxs("div",{className:"pt-2 border-t border-border",onMouseEnter:we,onMouseLeave:ue,children:[o.jsxs("div",{className:"flex items-center justify-between w-full text-sm text-muted-foreground cursor-pointer",onClick:()=>ce(!se),children:[o.jsx("span",{children:"Other Tools"}),se?o.jsx(z.HugeiconsIcon,{icon:B.ArrowUp01Icon,className:"h-4 w-4"}):o.jsx(z.HugeiconsIcon,{icon:B.ArrowDown01Icon,className:"h-4 w-4"})]}),se&&o.jsxs("div",{className:"space-y-3 mt-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[r?o.jsx(z.HugeiconsIcon,{icon:B.EyeIcon,className:"h-4 w-4 text-primary"}):o.jsx(z.HugeiconsIcon,{icon:B.Cancel01Icon,className:"h-4 w-4 text-muted-foreground opacity-50"}),o.jsx(G,{htmlFor:"show-borders",className:"text-sm cursor-pointer",children:"Show Borders"})]}),o.jsx(Se,{id:"show-borders",checked:r,onCheckedChange:s})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[a?o.jsx(z.HugeiconsIcon,{icon:B.EyeIcon,className:"h-4 w-4 text-primary"}):o.jsx(z.HugeiconsIcon,{icon:B.Cancel01Icon,className:"h-4 w-4 text-muted-foreground opacity-50"}),o.jsx(G,{htmlFor:"show-shadows",className:"text-sm cursor-pointer",children:"Show Shadows"})]}),o.jsx(Se,{id:"show-shadows",checked:a,onCheckedChange:i})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.LayoutIcon,className:X.cn("h-4 w-4",c?"text-primary":"text-muted-foreground")}),o.jsx(G,{htmlFor:"show-grid",className:"text-sm cursor-pointer",children:"Show Grid"})]}),o.jsx(Se,{id:"show-grid",checked:c,onCheckedChange:d})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.CodeIcon,size:16,className:X.cn("h-4 w-4",g?"text-primary":"text-muted-foreground")}),o.jsx(G,{htmlFor:"show-crosshair",className:"text-sm cursor-pointer",children:"Crosshair"})]}),o.jsx(Se,{id:"show-crosshair",checked:g,onCheckedChange:y})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.File01Icon,size:16,className:X.cn("h-4 w-4",R?"text-primary":"text-muted-foreground")}),o.jsx(G,{htmlFor:"measure-tool",className:"text-sm cursor-pointer",children:"Measure Tool"})]}),o.jsx(Se,{id:"measure-tool",checked:R,onCheckedChange:I=>{A(I),I||P([])}})]})]})]}),R&&j.length>0&&o.jsxs("div",{className:"pt-2 border-t border-border",children:[o.jsx("div",{className:"text-xs font-semibold text-foreground mb-2",children:"Measurement"}),j.length===1&&o.jsx("div",{className:"text-xs text-muted-foreground",children:"Click again to set end point"}),j.length===2&&o.jsxs("div",{className:"space-y-1 text-xs",children:[o.jsxs("div",{className:"font-mono text-foreground",children:["Distance: ",Math.round(Math.sqrt(Math.pow(j[1].x-j[0].x,2)+Math.pow(j[1].y-j[0].y,2))),"px"]}),o.jsxs("div",{className:"font-mono text-foreground",children:["X: ",Math.round(Math.abs(j[1].x-j[0].x)),"px"]}),o.jsxs("div",{className:"font-mono text-foreground",children:["Y: ",Math.round(Math.abs(j[1].y-j[0].y)),"px"]}),o.jsx(ee,{variant:"outline",size:"sm",className:"mt-2 w-full text-xs",onClick:()=>P([]),children:"Clear"})]})]}),L&&o.jsxs("div",{className:"pt-2 border-t border-border",children:[o.jsx("div",{className:"text-xs font-semibold text-foreground mb-2",children:"Picked Color"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-8 h-8 rounded border border-border",style:{backgroundColor:L}}),o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsx("div",{className:"font-mono text-xs text-foreground",children:L}),o.jsxs(ee,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:async()=>{try{await navigator.clipboard.writeText(L)}catch(I){console.error("Failed to copy color:",I)}},children:[o.jsx(z.HugeiconsIcon,{icon:B.CodeIcon,className:"h-3 w-3 mr-1"}),"Copy"]})]})]})]}),o.jsx("div",{className:"pt-2 border-t border-border",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ee,{variant:"outline",size:"sm",className:"flex-1 text-xs",onClick:()=>{s(!1),i(!1),d(!1),u(!1),y(!1),m(!1),A(!1),P([]),M(null),U(!1),Y(null)},children:"Reset All"}),o.jsx(ee,{variant:"outline",size:"sm",className:"flex-1 text-xs",onClick:()=>{s(!0),i(!0),d(!1),u(!0)},children:"Inspect Mode"})]})}),o.jsxs("div",{className:"pt-2 border-t border-border",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.KeyboardIcon,className:"h-4 w-4 text-muted-foreground"}),o.jsx("div",{className:"text-xs font-semibold text-foreground",children:"Shortcuts"})]}),o.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[f&&o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{children:"Space"}),o.jsx("span",{className:"text-foreground",children:"Toggle snapshot"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{children:"Esc"}),o.jsx("span",{className:"text-foreground",children:"Close panel"})]})]})]})]}),o.jsxs(qt,{value:"inspector",className:"space-y-4 mt-0",children:[(f||H)&&o.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(z.HugeiconsIcon,{icon:B.LayoutIcon,className:X.cn("h-4 w-4",x?"text-primary":"text-muted-foreground")}),o.jsx(G,{htmlFor:"show-highlight",className:"text-sm cursor-pointer",children:"Element Highlight"})]}),o.jsx(Se,{id:"show-highlight",checked:x,onCheckedChange:m})]}),f&&o.jsxs("div",{className:"space-y-2 pb-2 border-b border-border",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(G,{htmlFor:"magnifier-zoom",className:"text-sm text-muted-foreground",children:"Magnifier Intensity"}),o.jsxs("span",{className:"text-xs font-mono text-foreground",children:[p,"x"]})]}),o.jsx(Ce,{id:"magnifier-zoom",min:1,max:10,step:.5,value:[p],onValueChange:I=>h(I[0]),className:"w-full"})]}),(f||H)&&x&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"text-xs font-semibold text-foreground",children:"Element Details"}),(v?K:$)&&o.jsxs("div",{className:"text-xs text-muted-foreground",children:["Tag: ",o.jsx("span",{className:"font-mono text-foreground",children:(v?K:$).tag})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[w&&o.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[o.jsx(z.HugeiconsIcon,{icon:B.File01Icon,className:"h-3 w-3 text-primary"}),o.jsx("span",{className:"text-primary font-medium",children:"Locked"})]}),o.jsxs(ee,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:En,disabled:!$&&!w,title:w?"Unlock element (Space)":"Lock element (Space)",children:[o.jsx(z.HugeiconsIcon,{icon:B.File01Icon,className:"h-3 w-3 mr-1"}),w?"Unlock":"Lock"]})]})]}),(v?K:$)?o.jsxs("div",{className:"space-y-3 text-xs max-h-[400px] overflow-y-auto",children:[w&&o.jsx("div",{className:"text-xs text-muted-foreground italic mb-2 p-2 bg-muted rounded",children:"Element is locked. Press Space to unlock."}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground font-medium mb-1",children:"Dimensions"}),o.jsxs("div",{className:"font-mono text-xs space-y-0.5 text-foreground",children:[o.jsxs("div",{children:["W: ",Math.round((v?K:$).dimensions.width),"px"]}),o.jsxs("div",{children:["H: ",Math.round((v?K:$).dimensions.height),"px"]}),o.jsxs("div",{children:["X: ",Math.round((v?K:$).dimensions.left),"px"]}),o.jsxs("div",{children:["Y: ",Math.round((v?K:$).dimensions.top),"px"]})]})]}),(v?K:$).classes.length>0?o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground font-medium mb-1",children:"Classes"}),o.jsxs("div",{className:"font-mono text-xs space-y-0.5 max-h-20 overflow-y-auto",children:[(v?K:$).classes.slice(0,10).map((I,O)=>o.jsxs("div",{className:"text-foreground",children:[".",I]},O)),(v?K:$).classes.length>10&&o.jsxs("div",{className:"text-muted-foreground",children:["+",(v?K:$).classes.length-10," more"]})]})]}):o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground font-medium mb-1",children:"Classes"}),o.jsx("div",{className:"text-xs text-muted-foreground italic",children:"No classes"})]})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-1",children:[o.jsx("div",{className:"text-muted-foreground font-medium",children:"Styles"}),o.jsxs(ee,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:async()=>{const I=v?K:$;if(!I)return;const O=Object.entries(I.styles).filter(([le,ie])=>ie!==void 0).map(([le,ie])=>` ${le.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${ie};`).join(`
|
|
169
|
+
`),q=`.${I.tag} {
|
|
170
|
+
${O}
|
|
171
|
+
}`;try{await navigator.clipboard.writeText(q)}catch(le){console.error("Failed to copy CSS:",le)}},children:[o.jsx(z.HugeiconsIcon,{icon:B.CodeIcon,className:"h-3 w-3 mr-1"}),"Copy CSS"]})]}),o.jsx(ga,{children:o.jsxs("div",{className:"font-mono text-xs space-y-0.5 text-foreground",children:[(v?K:$).styles.border&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-muted-foreground",children:"border:"})," ",o.jsx("span",{className:"text-foreground",children:(v?K:$).styles.border})]}),(v?K:$).styles.boxShadow&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-muted-foreground",children:"shadow:"})," ",o.jsx("span",{className:"text-foreground truncate",children:(v?K:$).styles.boxShadow})]}),(v?K:$).styles.borderRadius&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-muted-foreground",children:"radius:"})," ",o.jsx("span",{className:"text-foreground",children:(v?K:$).styles.borderRadius})]}),(v?K:$).styles.padding&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-muted-foreground",children:"padding:"})," ",o.jsx("span",{className:"text-foreground",children:(v?K:$).styles.padding})]}),(v?K:$).styles.margin&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-muted-foreground",children:"margin:"})," ",o.jsx("span",{className:"text-foreground",children:(v?K:$).styles.margin})]}),(v?K:$).styles.backgroundColor&&(()=>{const I=(v?K:$).styles.backgroundColor;return o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-muted-foreground",children:"bg:"})," ",o.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[o.jsxs(Zn,{children:[o.jsx(Qn,{asChild:!0,children:o.jsx("div",{className:"h-3 w-3 rounded border border-border flex-shrink-0",style:{backgroundColor:I||"transparent"}})}),o.jsx(Xt,{className:"z-[var(--z-debug)]",children:o.jsx("div",{className:"font-mono text-xs",children:I})})]}),o.jsx("span",{className:"text-foreground truncate",children:I})]})]})})(),(v?K:$).styles.color&&(()=>{const I=(v?K:$).styles.color;return o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-muted-foreground",children:"color:"})," ",o.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[o.jsxs(Zn,{children:[o.jsx(Qn,{asChild:!0,children:o.jsx("div",{className:"h-3 w-3 rounded border border-border flex-shrink-0",style:{backgroundColor:I||"transparent"}})}),o.jsx(Xt,{className:"z-[var(--z-debug)]",children:o.jsx("div",{className:"font-mono text-xs",children:I})})]}),o.jsx("span",{className:"text-foreground truncate",children:I})]})]})})()]})})]}),(()=>{const I=w||(f?D:F||V);return I?o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground font-medium mb-1",children:"Element Path"}),o.jsx("div",{className:"font-mono text-xs space-y-0.5 max-h-20 overflow-y-auto",children:(()=>{const O=[];let q=I;for(;q&&q!==document.body;){const le=q.tagName.toLowerCase(),ie=q.id?`#${q.id}`:"",Oe=q.className&&typeof q.className=="string"?`.${q.className.split(" ").filter(Boolean).join(".")}`:"";O.unshift(`${le}${ie}${Oe}`),q=q.parentElement}return O.map((le,ie)=>o.jsxs("div",{className:"text-foreground",children:[ie>0&&o.jsx("span",{className:"text-muted-foreground",children:" → "}),le]},ie))})()})]}):null})()]}):o.jsx("div",{className:"text-xs text-muted-foreground italic",children:v?"No snapshot captured":"Hover over an element to see details"})]}),H&&o.jsx("div",{children:o.jsx(oi,{enabled:H,selectedElement:V,onElementSelect:Y,onElementHover:J,lockedElement:w,setLockedElement:S,lockedElementRef:E})}),!f&&!H&&o.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:o.jsx("p",{children:"Enable Magnifier or UI Tester to see inspection tools"})})]})]})]}),o.jsx(ei,{enabled:f,zoom:p,size:200,lockedElement:w,onElementChange:W}),o.jsx(ti,{enabled:g}),x&&(()=>{const I=w||(f?D:F||V);if(!I||typeof document>"u")return null;const O=I.getBoundingClientRect();return o.jsx("div",{className:"fixed pointer-events-none z-[var(--z-debug)] border-2 border-primary transition-all duration-100",style:{left:`${O.left}px`,top:`${O.top}px`,width:`${O.width}px`,height:`${O.height}px`,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.1)"}},`highlight-${I.tagName}-${O.left}-${O.top}`)})(),R&&j.length>0&&o.jsxs(o.Fragment,{children:[j.map((I,O)=>o.jsx("div",{className:"fixed pointer-events-none z-[var(--z-debug)]",style:{left:`${I.x-4}px`,top:`${I.y-4}px`,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"rgba(255, 0, 0, 0.8)",border:"2px solid white",boxShadow:"0 0 4px rgba(0, 0, 0, 0.5)"}},O)),j.length===2&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed pointer-events-none z-[var(--z-debug)]",style:{left:`${Math.min(j[0].x,j[1].x)}px`,top:`${Math.min(j[0].y,j[1].y)}px`,width:`${Math.abs(j[1].x-j[0].x)}px`,height:`${Math.abs(j[1].y-j[0].y)}px`,border:"1px dashed rgba(255, 0, 0, 0.6)",pointerEvents:"none"}}),o.jsxs("div",{className:"fixed pointer-events-none z-[var(--z-debug)] bg-primary text-primary-foreground px-2 py-1 rounded text-xs font-mono",style:{left:`${(j[0].x+j[1].x)/2}px`,top:`${(j[0].y+j[1].y)/2-20}px`,transform:"translate(-50%, -50%)"},children:[Math.round(Math.sqrt(Math.pow(j[1].x-j[0].x,2)+Math.pow(j[1].y-j[0].y,2))),"px"]})]})]})]})}exports.Anchor=Nt;exports.Arrow=cn;exports.Collapsible=et;exports.CollapsibleContent=nt;exports.CollapsibleTrigger=tt;exports.ColorPicker=Qe;exports.ColorSlider=vt;exports.Content=gi;exports.Content$1=ln;exports.Crosshair=ti;exports.DebugPanel=Pf;exports.EnhancedButton=ee;exports.EnhancedTabs=To;exports.EnhancedTabsContent=qt;exports.EnhancedTabsList=Io;exports.EnhancedTabsTrigger=Kt;exports.FrostedGlass=Sa;exports.Input=Xe;exports.Item=Dr;exports.Label=G;exports.Magnifier=ei;exports.Popover=Ia;exports.PopoverAnchor=Wd;exports.PopoverContent=Aa;exports.PopoverTrigger=Ma;exports.Primitive=Pa;exports.Root=dr;exports.Root$1=Or;exports.Root$2=ir;exports.Root2=an;exports.Select=Lt;exports.Select$1=$d;exports.SelectContent=Ht;exports.SelectContent$1=Ld;exports.SelectGroup=Od;exports.SelectGroup$1=va;exports.SelectItem=Me;exports.SelectItem$1=ya;exports.SelectLabel=Dd;exports.SelectLabel$1=wa;exports.SelectScrollDownButton=Po;exports.SelectScrollUpButton=Ro;exports.SelectSeparator=Hd;exports.SelectSeparator$1=Ca;exports.SelectTrigger=Dt;exports.SelectTrigger$1=_d;exports.SelectValue=Ot;exports.SelectValue$1=ba;exports.Slider=Ce;exports.Switch=Se;exports.Tabs=ja;exports.TabsContent=Ra;exports.TabsList=Na;exports.TabsTrigger=Ea;exports.Textarea=eo;exports.Tooltip=Zn;exports.TooltipContent=Xt;exports.TooltipProvider=ga;exports.TooltipTrigger=Qn;exports.Trigger=xi;exports.UITester=oi;exports.clamp=yt;exports.createCollapsibleScope=pi;exports.createCollection=Zt;exports.createPopperScope=Ze;exports.createRovingFocusGroupScope=wo;exports.enhancedButtonVariants=xa;exports.useDirection=St;exports.usePrevious=en;exports.useSize=tn;
|