randmarcomps 1.60.0 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -115,7 +115,7 @@ export declare interface InputProps extends Omit<React_2.ComponentProps<"input">
115
115
 
116
116
  export declare function Label({ className, ...props }: React_2.ComponentProps<typeof LabelPrimitive.Root>): JSX.Element;
117
117
 
118
- export declare function Layout({ children, rightMenu, routes, footer, handleValidSearch, dashboardTitle, onSignOut, }: LayoutProps): JSX.Element;
118
+ export declare function Layout({ children, rightMenu, routes, footer, handleValidSearch, dashboardTitle, onSignOut, searchPlaceholder }: LayoutProps): JSX.Element;
119
119
 
120
120
  declare interface LayoutProps {
121
121
  children: React.ReactNode;
@@ -125,6 +125,7 @@ declare interface LayoutProps {
125
125
  handleValidSearch: (q: string) => void;
126
126
  dashboardTitle?: string;
127
127
  onSignOut?: () => void;
128
+ searchPlaceholder?: string;
128
129
  }
129
130
 
130
131
  declare type MaskType = "phone" | "postal-code-ca" | "zip-code-us";
@@ -375,12 +376,13 @@ export declare const TooltipProvider: React_2.FC<TooltipPrimitive.TooltipProvide
375
376
 
376
377
  export declare const TooltipTrigger: React_2.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React_2.RefAttributes<HTMLButtonElement>>;
377
378
 
378
- export declare function Topbar({ onSignOut, handleValidSearch, rightMenu }: TopbarProps): JSX.Element;
379
+ export declare function Topbar({ onSignOut, handleValidSearch, rightMenu, searchPlaceholder }: TopbarProps): JSX.Element;
379
380
 
380
381
  declare interface TopbarProps {
381
382
  onSignOut?: () => void;
382
383
  rightMenu?: React.ReactNode;
383
384
  handleValidSearch: (q: string) => void;
385
+ searchPlaceholder?: string;
384
386
  }
385
387
 
386
388
  export declare function useIsMobile(): boolean;
@@ -7680,16 +7680,16 @@ function pf() {
7680
7680
  /* @__PURE__ */ c(fi, {})
7681
7681
  ] });
7682
7682
  }
7683
- function mf({ onSignOut: e, handleValidSearch: t, rightMenu: n }) {
7684
- const [r, o] = ke(""), a = Ei(), { toast: i } = vi();
7683
+ function mf({ onSignOut: e, handleValidSearch: t, rightMenu: n, searchPlaceholder: r }) {
7684
+ const [o, a] = ke(""), i = Ei(), { toast: l } = vi();
7685
7685
  Ft(() => {
7686
- const f = new URLSearchParams(a.search).get("q");
7687
- f && o(f);
7688
- }, [a.search]);
7689
- const l = () => {
7690
- const d = r.trim();
7691
- if (!d || d.length < 2) {
7692
- i({
7686
+ const m = new URLSearchParams(i.search).get("q");
7687
+ m && a(m);
7688
+ }, [i.search]);
7689
+ const u = () => {
7690
+ const f = o.trim();
7691
+ if (!f || f.length < 2) {
7692
+ l({
7693
7693
  title: "Enter more characters to search",
7694
7694
  description: "At least 2 characters are needed to search products.",
7695
7695
  variant: "destructive",
@@ -7697,7 +7697,7 @@ function mf({ onSignOut: e, handleValidSearch: t, rightMenu: n }) {
7697
7697
  });
7698
7698
  return;
7699
7699
  }
7700
- t(d);
7700
+ t(f);
7701
7701
  };
7702
7702
  return /* @__PURE__ */ E("header", { className: "flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border", children: [
7703
7703
  /* @__PURE__ */ c(Wa, { className: "lg:hidden", children: /* @__PURE__ */ c(ts, { className: "h-6 w-6" }) }),
@@ -7707,7 +7707,7 @@ function mf({ onSignOut: e, handleValidSearch: t, rightMenu: n }) {
7707
7707
  {
7708
7708
  type: "button",
7709
7709
  className: "absolute left-2 top-1/2 -translate-y-1/2",
7710
- onClick: l,
7710
+ onClick: u,
7711
7711
  "aria-label": "Search",
7712
7712
  children: /* @__PURE__ */ c(cs, { className: "h-4 w-4 text-muted-foreground" })
7713
7713
  }
@@ -7715,12 +7715,12 @@ function mf({ onSignOut: e, handleValidSearch: t, rightMenu: n }) {
7715
7715
  /* @__PURE__ */ c(
7716
7716
  dr,
7717
7717
  {
7718
- placeholder: "Search...",
7718
+ placeholder: r ?? "Search...",
7719
7719
  className: "w-full pl-8 bg-white text-black",
7720
- value: r,
7721
- onChange: (d) => o(d.target.value),
7722
- onKeyDown: (d) => {
7723
- d.key === "Enter" && l();
7720
+ value: o,
7721
+ onChange: (f) => a(f.target.value),
7722
+ onKeyDown: (f) => {
7723
+ f.key === "Enter" && u();
7724
7724
  }
7725
7725
  },
7726
7726
  "topbar-search"
@@ -7764,7 +7764,8 @@ function zf({
7764
7764
  footer: r,
7765
7765
  handleValidSearch: o,
7766
7766
  dashboardTitle: a,
7767
- onSignOut: i
7767
+ onSignOut: i,
7768
+ searchPlaceholder: l
7768
7769
  }) {
7769
7770
  return /* @__PURE__ */ c(ee, { children: /* @__PURE__ */ c($a, { children: /* @__PURE__ */ E("div", { className: "flex grow", children: [
7770
7771
  /* @__PURE__ */ c(
@@ -7781,7 +7782,8 @@ function zf({
7781
7782
  {
7782
7783
  onSignOut: i,
7783
7784
  rightMenu: t,
7784
- handleValidSearch: o
7785
+ handleValidSearch: o,
7786
+ searchPlaceholder: l
7785
7787
  }
7786
7788
  ),
7787
7789
  /* @__PURE__ */ c("main", { className: "flex-1 overflow-auto mt-16", children: e }),
@@ -156,6 +156,6 @@
156
156
 
157
157
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
158
158
 
159
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Lc="DialogDescriptionWarning",Fc=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Jo(Lc).contentName}}.`;return l.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Ir=Bo,ea=Vo,ta=jo,_t=Uo,It=Go,Lt=Yo,Ft=qo,$t=Zo;const zt=({modal:e=!1,...t})=>s.jsx(Ir,{modal:e,...t});zt.displayName=Ir.displayName;const ra=ea,na=ta,Lr=$t,Fr=l.forwardRef(({className:e,...t},r)=>s.jsx(_t,{ref:r,className:D("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Fr.displayName=_t.displayName;const Bt=l.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(na,{children:[s.jsx(Fr,{}),s.jsxs(It,{ref:n,className:D("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,s.jsxs($t,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[s.jsx(fr,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bt.displayName=It.displayName;const $r=({className:e,...t})=>s.jsx("div",{className:D("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$r.displayName="DialogHeader";const zr=({className:e,...t})=>s.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zr.displayName="DialogFooter";const Br=l.forwardRef(({className:e,...t},r)=>s.jsx(Lt,{ref:r,className:D("text-lg font-semibold leading-none tracking-tight",e),...t}));Br.displayName=Lt.displayName;const Wr=l.forwardRef(({className:e,...t},r)=>s.jsx(Ft,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));Wr.displayName=Ft.displayName;const oa=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,aa=qn,dt=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return aa(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(d=>{const f=r==null?void 0:r[d],h=a==null?void 0:a[d];if(f===null)return null;const v=oa(f)||oa(h);return o[d][v]}),c=r&&Object.entries(r).reduce((d,f)=>{let[h,v]=f;return v===void 0||(d[h]=v),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,f)=>{let{class:h,className:v,...g}=f;return Object.entries(g).every(y=>{let[p,m]=y;return Array.isArray(m)?m.includes({...a,...c}[p]):{...a,...c}[p]===m})?[...d,h,v]:d},[]);return aa(e,i,u,r==null?void 0:r.class,r==null?void 0:r.className)},Vr=dt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",defaultOutline:"border border-red-600/30 text-red-600 bg-background shadow-xs hover:bg-red-600/5 ",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",blue:"bg-randmar-blue text-gray-100 shadow-sm hover:bg-randmar-blue/90",red:"bg-randmar-red text-gray-100 shadow-sm hover:bg-randmar-red/90",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ee=l.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,confirmationDialog:o,onClick:a,...i},c)=>{const u=n?pe:"button";if(!o)return s.jsx(u,{className:D(Vr({variant:t,size:r,className:e})),ref:c,onClick:a,...i});a&&console.warn("Button: You provided both onClick and confirmationDialog props. The onClick prop will be ignored. Use the onConfirm callback in confirmationDialog instead.");const{title:d,content:f,onConfirm:h,confirmText:v="Confirm",cancelText:g="Cancel"}=o,y=()=>{h()};return s.jsxs(zt,{children:[s.jsx(ra,{asChild:!0,children:s.jsx(u,{className:D(Vr({variant:t,size:r,className:e})),ref:c,...i})}),s.jsxs(Bt,{children:[s.jsxs($r,{children:[s.jsx(Br,{children:d}),s.jsx(Wr,{children:f})]}),s.jsxs(zr,{className:"flex justify-end gap-2 pt-4",children:[s.jsx(Lr,{asChild:!0,children:s.jsx(ee,{variant:"outline",children:g})}),s.jsx(Lr,{asChild:!0,children:s.jsx(ee,{onClick:y,children:v})})]})]})]})});ee.displayName="Button";const $c=["top","right","bottom","left"],Me=Math.min,le=Math.max,Wt=Math.round,Vt=Math.floor,ye=e=>({x:e,y:e}),zc={left:"right",right:"left",bottom:"top",top:"bottom"},Bc={start:"end",end:"start"};function Hr(e,t,r){return le(e,Me(t,r))}function Se(e,t){return typeof e=="function"?e(t):e}function Ee(e){return e.split("-")[0]}function Je(e){return e.split("-")[1]}function jr(e){return e==="x"?"y":"x"}function Ur(e){return e==="y"?"height":"width"}function ke(e){return["top","bottom"].includes(Ee(e))?"y":"x"}function Gr(e){return jr(ke(e))}function Wc(e,t,r){r===void 0&&(r=!1);const n=Je(e),o=Gr(e),a=Ur(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Ht(i)),[i,Ht(i)]}function Vc(e){const t=Ht(e);return[Kr(e),t,Kr(t)]}function Kr(e){return e.replace(/start|end/g,t=>Bc[t])}function Hc(e,t,r){const n=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?a:i;default:return[]}}function jc(e,t,r,n){const o=Je(e);let a=Hc(Ee(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(Kr)))),a}function Ht(e){return e.replace(/left|right|bottom|top/g,t=>zc[t])}function Uc(e){return{top:0,right:0,bottom:0,left:0,...e}}function sa(e){return typeof e!="number"?Uc(e):{top:e,right:e,bottom:e,left:e}}function jt(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ia(e,t,r){let{reference:n,floating:o}=e;const a=ke(t),i=Gr(t),c=Ur(i),u=Ee(t),d=a==="y",f=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,v=n[c]/2-o[c]/2;let g;switch(u){case"top":g={x:f,y:n.y-o.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:h};break;case"left":g={x:n.x-o.width,y:h};break;default:g={x:n.x,y:n.y}}switch(Je(t)){case"start":g[i]-=v*(r&&d?-1:1);break;case"end":g[i]+=v*(r&&d?-1:1);break}return g}const Gc=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,c=a.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=ia(d,n,u),v=n,g={},y=0;for(let p=0;p<c.length;p++){const{name:m,fn:b}=c[p],{x:w,y:x,data:N,reset:S}=await b({x:f,y:h,initialPlacement:n,placement:v,strategy:o,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});f=w??f,h=x??h,g={...g,[m]:{...g[m],...N}},S&&y<=50&&(y++,typeof S=="object"&&(S.placement&&(v=S.placement),S.rects&&(d=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:f,y:h}=ia(d,v,u)),p=-1)}return{x:f,y:h,placement:v,strategy:o,middlewareData:g}};async function ut(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:i,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:v=!1,padding:g=0}=Se(t,e),y=sa(g),m=c[v?h==="floating"?"reference":"floating":h],b=jt(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(m)))==null||r?m:m.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:d,rootBoundary:f,strategy:u})),w=h==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),N=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},S=jt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:x,strategy:u}):w);return{top:(b.top-S.top+y.top)/N.y,bottom:(S.bottom-b.bottom+y.bottom)/N.y,left:(b.left-S.left+y.left)/N.x,right:(S.right-b.right+y.right)/N.x}}const Kc=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:c,middlewareData:u}=t,{element:d,padding:f=0}=Se(e,t)||{};if(d==null)return{};const h=sa(f),v={x:r,y:n},g=Gr(o),y=Ur(g),p=await i.getDimensions(d),m=g==="y",b=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",N=a.reference[y]+a.reference[g]-v[g]-a.floating[y],S=v[g]-a.reference[g],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let T=C?C[x]:0;(!T||!await(i.isElement==null?void 0:i.isElement(C)))&&(T=c.floating[x]||a.floating[y]);const W=N/2-S/2,L=T/2-p[y]/2-1,$=Me(h[b],L),j=Me(h[w],L),z=$,_=T-p[y]-j,A=T/2-p[y]/2+W,V=Hr(z,A,_),k=!u.arrow&&Je(o)!=null&&A!==V&&a.reference[y]/2-(A<z?$:j)-p[y]/2<0,U=k?A<z?A-z:A-_:0;return{[g]:v[g]+U,data:{[g]:V,centerOffset:A-V-U,...k&&{alignmentOffset:U}},reset:k}}}),Yc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:p=!0,...m}=Se(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const b=Ee(o),w=ke(c),x=Ee(c)===c,N=await(u.isRTL==null?void 0:u.isRTL(d.floating)),S=v||(x||!p?[Ht(c)]:Vc(c)),C=y!=="none";!v&&C&&S.push(...jc(c,p,y,N));const T=[c,...S],W=await ut(t,m),L=[];let $=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&L.push(W[b]),h){const A=Wc(o,i,N);L.push(W[A[0]],W[A[1]])}if($=[...$,{placement:o,overflows:L}],!L.every(A=>A<=0)){var j,z;const A=(((j=a.flip)==null?void 0:j.index)||0)+1,V=T[A];if(V)return{data:{index:A,overflows:$},reset:{placement:V}};let k=(z=$.filter(U=>U.overflows[0]<=0).sort((U,P)=>U.overflows[1]-P.overflows[1])[0])==null?void 0:z.placement;if(!k)switch(g){case"bestFit":{var _;const U=(_=$.filter(P=>{if(C){const I=ke(P.placement);return I===w||I==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(I=>I>0).reduce((I,q)=>I+q,0)]).sort((P,I)=>P[1]-I[1])[0])==null?void 0:_[0];U&&(k=U);break}case"initialPlacement":k=c;break}if(o!==k)return{reset:{placement:k}}}return{}}}};function la(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ca(e){return $c.some(t=>e[t]>=0)}const Rc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Se(e,t);switch(n){case"referenceHidden":{const a=await ut(t,{...o,elementContext:"reference"}),i=la(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ca(i)}}}case"escaped":{const a=await ut(t,{...o,altBoundary:!0}),i=la(a,r.floating);return{data:{escapedOffsets:i,escaped:ca(i)}}}default:return{}}}}};async function qc(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Ee(r),c=Je(r),u=ke(r)==="y",d=["left","top"].includes(i)?-1:1,f=a&&u?-1:1,h=Se(t,e);let{mainAxis:v,crossAxis:g,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof y=="number"&&(g=c==="end"?y*-1:y),u?{x:g*f,y:v*d}:{x:v*d,y:g*f}}const Xc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:c}=t,u=await qc(t,e);return i===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:i}}}}},Zc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:c={fn:m=>{let{x:b,y:w}=m;return{x:b,y:w}}},...u}=Se(e,t),d={x:r,y:n},f=await ut(t,u),h=ke(Ee(o)),v=jr(h);let g=d[v],y=d[h];if(a){const m=v==="y"?"top":"left",b=v==="y"?"bottom":"right",w=g+f[m],x=g-f[b];g=Hr(w,g,x)}if(i){const m=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=y+f[m],x=y-f[b];y=Hr(w,y,x)}const p=c.fn({...t,[v]:g,[h]:y});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[v]:a,[h]:i}}}}}},Qc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Se(e,t),f={x:r,y:n},h=ke(o),v=jr(h);let g=f[v],y=f[h];const p=Se(c,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(u){const x=v==="y"?"height":"width",N=a.reference[v]-a.floating[x]+m.mainAxis,S=a.reference[v]+a.reference[x]-m.mainAxis;g<N?g=N:g>S&&(g=S)}if(d){var b,w;const x=v==="y"?"width":"height",N=["top","left"].includes(Ee(o)),S=a.reference[h]-a.floating[x]+(N&&((b=i.offset)==null?void 0:b[h])||0)+(N?0:m.crossAxis),C=a.reference[h]+a.reference[x]+(N?0:((w=i.offset)==null?void 0:w[h])||0)-(N?m.crossAxis:0);y<S?y=S:y>C&&(y=C)}return{[v]:g,[h]:y}}}},Jc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:c}=t,{apply:u=()=>{},...d}=Se(e,t),f=await ut(t,d),h=Ee(o),v=Je(o),g=ke(o)==="y",{width:y,height:p}=a.floating;let m,b;h==="top"||h==="bottom"?(m=h,b=v===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(b=h,m=v==="end"?"top":"bottom");const w=p-f.top-f.bottom,x=y-f.left-f.right,N=Me(p-f[m],w),S=Me(y-f[b],x),C=!t.middlewareData.shift;let T=N,W=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(W=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=w),C&&!v){const $=le(f.left,0),j=le(f.right,0),z=le(f.top,0),_=le(f.bottom,0);g?W=y-2*($!==0||j!==0?$+j:le(f.left,f.right)):T=p-2*(z!==0||_!==0?z+_:le(f.top,f.bottom))}await u({...t,availableWidth:W,availableHeight:T});const L=await i.getDimensions(c.floating);return y!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function Ut(){return typeof window<"u"}function et(e){return da(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function we(e){var t;return(t=(da(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function da(e){return Ut()?e instanceof Node||e instanceof ce(e).Node:!1}function ge(e){return Ut()?e instanceof Element||e instanceof ce(e).Element:!1}function xe(e){return Ut()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function ua(e){return!Ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function ft(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=me(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function ed(e){return["table","td","th"].includes(et(e))}function Gt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Yr(e){const t=Rr(),r=ge(e)?me(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function td(e){let t=De(e);for(;xe(t)&&!tt(t);){if(Yr(t))return t;if(Gt(t))return null;t=De(t)}return null}function Rr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function tt(e){return["html","body","#document"].includes(et(e))}function me(e){return ce(e).getComputedStyle(e)}function Kt(e){return ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function De(e){if(et(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ua(e)&&e.host||we(e);return ua(t)?t.host:t}function fa(e){const t=De(e);return tt(t)?e.ownerDocument?e.ownerDocument.body:e.body:xe(t)&&ft(t)?t:fa(t)}function pt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=fa(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=ce(o);if(a){const c=qr(i);return t.concat(i,i.visualViewport||[],ft(o)?o:[],c&&r?pt(c):[])}return t.concat(o,pt(o,[],r))}function qr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pa(e){const t=me(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=xe(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,c=Wt(r)!==a||Wt(n)!==i;return c&&(r=a,n=i),{width:r,height:n,$:c}}function Xr(e){return ge(e)?e:e.contextElement}function rt(e){const t=Xr(e);if(!xe(t))return ye(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=pa(t);let i=(a?Wt(r.width):r.width)/n,c=(a?Wt(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const rd=ye(0);function ha(e){const t=ce(e);return!Rr()||!t.visualViewport?rd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nd(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ce(e)?!1:t}function We(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=Xr(e);let i=ye(1);t&&(n?ge(n)&&(i=rt(n)):i=rt(e));const c=nd(a,r,n)?ha(a):ye(0);let u=(o.left+c.x)/i.x,d=(o.top+c.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(a){const v=ce(a),g=n&&ge(n)?ce(n):n;let y=v,p=qr(y);for(;p&&n&&g!==y;){const m=rt(p),b=p.getBoundingClientRect(),w=me(p),x=b.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,N=b.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;u*=m.x,d*=m.y,f*=m.x,h*=m.y,u+=x,d+=N,y=ce(p),p=qr(y)}}return jt({width:f,height:h,x:u,y:d})}function Zr(e,t){const r=Kt(e).scrollLeft;return t?t.left+r:We(we(e)).left+r}function ga(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:Zr(e,n)),a=n.top+t.scrollTop;return{x:o,y:a}}function od(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",i=we(n),c=t?Gt(t.floating):!1;if(n===i||c&&a)return r;let u={scrollLeft:0,scrollTop:0},d=ye(1);const f=ye(0),h=xe(n);if((h||!h&&!a)&&((et(n)!=="body"||ft(i))&&(u=Kt(n)),xe(n))){const g=We(n);d=rt(n),f.x=g.x+n.clientLeft,f.y=g.y+n.clientTop}const v=i&&!h&&!a?ga(i,u,!0):ye(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+f.x+v.x,y:r.y*d.y-u.scrollTop*d.y+f.y+v.y}}function ad(e){return Array.from(e.getClientRects())}function sd(e){const t=we(e),r=Kt(e),n=e.ownerDocument.body,o=le(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=le(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Zr(e);const c=-r.scrollTop;return me(n).direction==="rtl"&&(i+=le(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:c}}function id(e,t){const r=ce(e),n=we(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,c=0,u=0;if(o){a=o.width,i=o.height;const d=Rr();(!d||d&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}return{width:a,height:i,x:c,y:u}}function ld(e,t){const r=We(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=xe(e)?rt(e):ye(1),i=e.clientWidth*a.x,c=e.clientHeight*a.y,u=o*a.x,d=n*a.y;return{width:i,height:c,x:u,y:d}}function ma(e,t,r){let n;if(t==="viewport")n=id(e,r);else if(t==="document")n=sd(we(e));else if(ge(t))n=ld(t,r);else{const o=ha(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return jt(n)}function va(e,t){const r=De(e);return r===t||!ge(r)||tt(r)?!1:me(r).position==="fixed"||va(r,t)}function cd(e,t){const r=t.get(e);if(r)return r;let n=pt(e,[],!1).filter(c=>ge(c)&&et(c)!=="body"),o=null;const a=me(e).position==="fixed";let i=a?De(e):e;for(;ge(i)&&!tt(i);){const c=me(i),u=Yr(i);!u&&c.position==="fixed"&&(o=null),(a?!u&&!o:!u&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ft(i)&&!u&&va(e,i))?n=n.filter(f=>f!==i):o=c,i=De(i)}return t.set(e,n),n}function dd(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?Gt(t)?[]:cd(t,this._c):[].concat(r),n],c=i[0],u=i.reduce((d,f)=>{const h=ma(t,f,o);return d.top=le(h.top,d.top),d.right=Me(h.right,d.right),d.bottom=Me(h.bottom,d.bottom),d.left=le(h.left,d.left),d},ma(t,c,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function ud(e){const{width:t,height:r}=pa(e);return{width:t,height:r}}function fd(e,t,r){const n=xe(t),o=we(t),a=r==="fixed",i=We(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const u=ye(0);if(n||!n&&!a)if((et(t)!=="body"||ft(o))&&(c=Kt(t)),n){const v=We(t,!0,a,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else o&&(u.x=Zr(o));const d=o&&!n&&!a?ga(o,c):ye(0),f=i.left+c.scrollLeft-u.x-d.x,h=i.top+c.scrollTop-u.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function Qr(e){return me(e).position==="static"}function ba(e,t){if(!xe(e)||me(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return we(e)===r&&(r=r.ownerDocument.body),r}function ya(e,t){const r=ce(e);if(Gt(e))return r;if(!xe(e)){let o=De(e);for(;o&&!tt(o);){if(ge(o)&&!Qr(o))return o;o=De(o)}return r}let n=ba(e,t);for(;n&&ed(n)&&Qr(n);)n=ba(n,t);return n&&tt(n)&&Qr(n)&&!Yr(n)?r:n||td(e)||r}const pd=async function(e){const t=this.getOffsetParent||ya,r=this.getDimensions,n=await r(e.floating);return{reference:fd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function hd(e){return me(e).direction==="rtl"}const gd={convertOffsetParentRelativeRectToViewportRelativeRect:od,getDocumentElement:we,getClippingRect:dd,getOffsetParent:ya,getElementRects:pd,getClientRects:ad,getDimensions:ud,getScale:rt,isElement:ge,isRTL:hd};function wa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function md(e,t){let r=null,n;const o=we(e);function a(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),a();const d=e.getBoundingClientRect(),{left:f,top:h,width:v,height:g}=d;if(c||t(),!v||!g)return;const y=Vt(h),p=Vt(o.clientWidth-(f+v)),m=Vt(o.clientHeight-(h+g)),b=Vt(f),x={rootMargin:-y+"px "+-p+"px "+-m+"px "+-b+"px",threshold:le(0,Me(1,u))||1};let N=!0;function S(C){const T=C[0].intersectionRatio;if(T!==u){if(!N)return i();T?i(!1,T):n=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!wa(d,e.getBoundingClientRect())&&i(),N=!1}try{r=new IntersectionObserver(S,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(S,x)}r.observe(e)}return i(!0),a}function vd(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=Xr(e),f=o||a?[...d?pt(d):[],...pt(t)]:[];f.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),a&&b.addEventListener("resize",r)});const h=d&&c?md(d,r):null;let v=-1,g=null;i&&(g=new ResizeObserver(b=>{let[w]=b;w&&w.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),r()}),d&&!u&&g.observe(d),g.observe(t));let y,p=u?We(e):null;u&&m();function m(){const b=We(e);p&&!wa(p,b)&&r(),p=b,y=requestAnimationFrame(m)}return r(),()=>{var b;f.forEach(w=>{o&&w.removeEventListener("scroll",r),a&&w.removeEventListener("resize",r)}),h==null||h(),(b=g)==null||b.disconnect(),g=null,u&&cancelAnimationFrame(y)}}const bd=Xc,yd=Zc,wd=Yc,xd=Jc,Nd=Rc,xa=Kc,Cd=Qc,Sd=(e,t,r)=>{const n=new Map,o={platform:gd,...r},a={...o.platform,_c:n};return Gc(e,t,{...o,platform:a})};var Yt=typeof document<"u"?K.useLayoutEffect:K.useEffect;function Rt(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 r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Rt(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!Rt(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Na(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ca(e,t){const r=Na(e);return Math.round(t*r)/r}function Jr(e){const t=l.useRef(e);return Yt(()=>{t.current=e}),t}function Ed(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,h]=l.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,g]=l.useState(n);Rt(v,n)||g(n);const[y,p]=l.useState(null),[m,b]=l.useState(null),w=l.useCallback(P=>{P!==C.current&&(C.current=P,p(P))},[]),x=l.useCallback(P=>{P!==T.current&&(T.current=P,b(P))},[]),N=a||y,S=i||m,C=l.useRef(null),T=l.useRef(null),W=l.useRef(f),L=u!=null,$=Jr(u),j=Jr(o),z=Jr(d),_=l.useCallback(()=>{if(!C.current||!T.current)return;const P={placement:t,strategy:r,middleware:v};j.current&&(P.platform=j.current),Sd(C.current,T.current,P).then(I=>{const q={...I,isPositioned:z.current!==!1};A.current&&!Rt(W.current,q)&&(W.current=q,ur.flushSync(()=>{h(q)}))})},[v,t,r,j,z]);Yt(()=>{d===!1&&W.current.isPositioned&&(W.current.isPositioned=!1,h(P=>({...P,isPositioned:!1})))},[d]);const A=l.useRef(!1);Yt(()=>(A.current=!0,()=>{A.current=!1}),[]),Yt(()=>{if(N&&(C.current=N),S&&(T.current=S),N&&S){if($.current)return $.current(N,S,_);_()}},[N,S,_,$,L]);const V=l.useMemo(()=>({reference:C,floating:T,setReference:w,setFloating:x}),[w,x]),k=l.useMemo(()=>({reference:N,floating:S}),[N,S]),U=l.useMemo(()=>{const P={position:r,left:0,top:0};if(!k.floating)return P;const I=Ca(k.floating,f.x),q=Ca(k.floating,f.y);return c?{...P,transform:"translate("+I+"px, "+q+"px)",...Na(k.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:I,top:q}},[r,c,k.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:_,refs:V,elements:k,floatingStyles:U}),[f,_,V,k,U])}const Td=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?xa({element:n.current,padding:o}).fn(r):{}:n?xa({element:n,padding:o}).fn(r):{}}}},Pd=(e,t)=>({...bd(e),options:[e,t]}),Ad=(e,t)=>({...yd(e),options:[e,t]}),Od=(e,t)=>({...Cd(e),options:[e,t]}),Md=(e,t)=>({...wd(e),options:[e,t]}),kd=(e,t)=>({...xd(e),options:[e,t]}),Dd=(e,t)=>({...Nd(e),options:[e,t]}),_d=(e,t)=>({...Td(e),options:[e,t]});var Id="Arrow",Sa=l.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return s.jsx(X.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});Sa.displayName=Id;var Ld=Sa;function Fd(e){const[t,r]=l.useState(void 0);return Ae(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,c;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;r({width:i,height:c})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var en="Popper",[Ea,Ta]=ct(en),[$d,Pa]=Ea(en),Aa=e=>{const{__scopePopper:t,children:r}=e,[n,o]=l.useState(null);return s.jsx($d,{scope:t,anchor:n,onAnchorChange:o,children:r})};Aa.displayName=en;var Oa="PopperAnchor",Ma=l.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=Pa(Oa,r),i=l.useRef(null),c=ne(t,i);return l.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:s.jsx(X.div,{...o,ref:c})});Ma.displayName=Oa;var tn="PopperContent",[zd,Bd]=Ea(tn),ka=l.forwardRef((e,t)=>{var Ce,vt,ir,bt,lr,it;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:g="optimized",onPlaced:y,...p}=e,m=Pa(tn,r),[b,w]=l.useState(null),x=ne(t,He=>w(He)),[N,S]=l.useState(null),C=Fd(N),T=(C==null?void 0:C.width)??0,W=(C==null?void 0:C.height)??0,L=n+(a!=="center"?"-"+a:""),$=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(d)?d:[d],z=j.length>0,_={padding:$,boundary:j.filter(Vd),altBoundary:z},{refs:A,floatingStyles:V,placement:k,isPositioned:U,middlewareData:P}=Ed({strategy:"fixed",placement:L,whileElementsMounted:(...He)=>vd(...He,{animationFrame:g==="always"}),elements:{reference:m.anchor},middleware:[Pd({mainAxis:o+W,alignmentAxis:i}),u&&Ad({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Od():void 0,..._}),u&&Md({..._}),kd({..._,apply:({elements:He,rects:F,availableWidth:B,availableHeight:J})=>{const{width:se,height:ie}=F.reference,G=He.floating.style;G.setProperty("--radix-popper-available-width",`${B}px`),G.setProperty("--radix-popper-available-height",`${J}px`),G.setProperty("--radix-popper-anchor-width",`${se}px`),G.setProperty("--radix-popper-anchor-height",`${ie}px`)}}),N&&_d({element:N,padding:c}),Hd({arrowWidth:T,arrowHeight:W}),v&&Dd({strategy:"referenceHidden",..._})]}),[I,q]=Ia(k),Q=fe(y);Ae(()=>{U&&(Q==null||Q())},[U,Q]);const ae=(Ce=P.arrow)==null?void 0:Ce.x,te=(vt=P.arrow)==null?void 0:vt.y,oe=((ir=P.arrow)==null?void 0:ir.centerOffset)!==0,[de,_e]=l.useState();return Ae(()=>{b&&_e(window.getComputedStyle(b).zIndex)},[b]),s.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(bt=P.transformOrigin)==null?void 0:bt.x,(lr=P.transformOrigin)==null?void 0:lr.y].join(" "),...((it=P.hide)==null?void 0:it.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(zd,{scope:r,placedSide:I,onArrowChange:S,arrowX:ae,arrowY:te,shouldHideArrow:oe,children:s.jsx(X.div,{"data-side":I,"data-align":q,...p,ref:x,style:{...p.style,animation:U?void 0:"none"}})})})});ka.displayName=tn;var Da="PopperArrow",Wd={top:"bottom",right:"left",bottom:"top",left:"right"},_a=l.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=Bd(Da,n),i=Wd[a.placedSide];return s.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:s.jsx(Ld,{...o,ref:r,style:{...o.style,display:"block"}})})});_a.displayName=Da;function Vd(e){return e!==null}var Hd=e=>({name:"transformOrigin",options:e,fn(t){var m,b,w;const{placement:r,rects:n,middlewareData:o}=t,i=((m=o.arrow)==null?void 0:m.centerOffset)!==0,c=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,f]=Ia(r),h={start:"0%",center:"50%",end:"100%"}[f],v=(((b=o.arrow)==null?void 0:b.x)??0)+c/2,g=(((w=o.arrow)==null?void 0:w.y)??0)+u/2;let y="",p="";return d==="bottom"?(y=i?h:`${v}px`,p=`${-u}px`):d==="top"?(y=i?h:`${v}px`,p=`${n.floating.height+u}px`):d==="right"?(y=`${-u}px`,p=i?h:`${g}px`):d==="left"&&(y=`${n.floating.width+u}px`,p=i?h:`${g}px`),{data:{x:y,y:p}}}});function Ia(e){const[t,r="center"]=e.split("-");return[t,r]}var jd=Aa,Ud=Ma,Gd=ka,Kd=_a,Yd="VisuallyHidden",qt=l.forwardRef((e,t)=>s.jsx(X.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));qt.displayName=Yd;var Rd=qt,[Xt,Af]=ct("Tooltip",[Ta]),Zt=Ta(),La="TooltipProvider",qd=700,rn="tooltip.open",[Xd,nn]=Xt(La),Fa=e=>{const{__scopeTooltip:t,delayDuration:r=qd,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,[i,c]=l.useState(!0),u=l.useRef(!1),d=l.useRef(0);return l.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),s.jsx(Xd,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(d.current),c(!1)},[]),onClose:l.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>c(!0),n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:l.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:a})};Fa.displayName=La;var Qt="Tooltip",[Zd,ht]=Xt(Qt),$a=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o=!1,onOpenChange:a,disableHoverableContent:i,delayDuration:c}=e,u=nn(Qt,e.__scopeTooltip),d=Zt(t),[f,h]=l.useState(null),v=xt(),g=l.useRef(0),y=i??u.disableHoverableContent,p=c??u.delayDuration,m=l.useRef(!1),[b=!1,w]=yr({prop:n,defaultProp:o,onChange:T=>{T?(u.onOpen(),document.dispatchEvent(new CustomEvent(rn))):u.onClose(),a==null||a(T)}}),x=l.useMemo(()=>b?m.current?"delayed-open":"instant-open":"closed",[b]),N=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,m.current=!1,w(!0)},[w]),S=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w(!1)},[w]),C=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{m.current=!0,w(!0),g.current=0},p)},[p,w]);return l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),s.jsx(jd,{...d,children:s.jsx(Zd,{scope:t,contentId:v,open:b,stateAttribute:x,trigger:f,onTriggerChange:h,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayed?C():N()},[u.isOpenDelayed,C,N]),onTriggerLeave:l.useCallback(()=>{y?S():(window.clearTimeout(g.current),g.current=0)},[S,y]),onOpen:N,onClose:S,disableHoverableContent:y,children:r})})};$a.displayName=Qt;var on="TooltipTrigger",za=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=ht(on,r),a=nn(on,r),i=Zt(r),c=l.useRef(null),u=ne(t,c,o.onTriggerChange),d=l.useRef(!1),f=l.useRef(!1),h=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(Ud,{asChild:!0,...i,children:s.jsx(X.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:u,onPointerMove:R(e.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:R(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:R(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:R(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:R(e.onBlur,o.onClose),onClick:R(e.onClick,o.onClose)})})});za.displayName=on;var an="TooltipPortal",[Qd,Jd]=Xt(an,{forceMount:void 0}),Ba=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=ht(an,t);return s.jsx(Qd,{scope:t,forceMount:r,children:s.jsx(ze,{present:r||a.open,children:s.jsx(Ct,{asChild:!0,container:o,children:n})})})};Ba.displayName=an;var nt="TooltipContent",Wa=l.forwardRef((e,t)=>{const r=Jd(nt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,i=ht(nt,e.__scopeTooltip);return s.jsx(ze,{present:n||i.open,children:i.disableHoverableContent?s.jsx(Va,{side:o,...a,ref:t}):s.jsx(eu,{side:o,...a,ref:t})})}),eu=l.forwardRef((e,t)=>{const r=ht(nt,e.__scopeTooltip),n=nn(nt,e.__scopeTooltip),o=l.useRef(null),a=ne(t,o),[i,c]=l.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:h}=n,v=l.useCallback(()=>{c(null),h(!1)},[h]),g=l.useCallback((y,p)=>{const m=y.currentTarget,b={x:y.clientX,y:y.clientY},w=ou(b,m.getBoundingClientRect()),x=au(b,w),N=su(p.getBoundingClientRect()),S=lu([...x,...N]);c(S),h(!0)},[h]);return l.useEffect(()=>()=>v(),[v]),l.useEffect(()=>{if(u&&f){const y=m=>g(m,f),p=m=>g(m,u);return u.addEventListener("pointerleave",y),f.addEventListener("pointerleave",p),()=>{u.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",p)}}},[u,f,g,v]),l.useEffect(()=>{if(i){const y=p=>{const m=p.target,b={x:p.clientX,y:p.clientY},w=(u==null?void 0:u.contains(m))||(f==null?void 0:f.contains(m)),x=!iu(b,i);w?v():x&&(v(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,f,i,d,v]),s.jsx(Va,{...e,ref:a})}),[tu,ru]=Xt(Qt,{isInside:!1}),Va=l.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...c}=e,u=ht(nt,r),d=Zt(r),{onClose:f}=u;return l.useEffect(()=>(document.addEventListener(rn,f),()=>document.removeEventListener(rn,f)),[f]),l.useEffect(()=>{if(u.trigger){const h=v=>{const g=v.target;g!=null&&g.contains(u.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,f]),s.jsx(Nt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:s.jsxs(Gd,{"data-state":u.stateAttribute,...d,...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:[s.jsx(co,{children:n}),s.jsx(tu,{scope:r,isInside:!0,children:s.jsx(Rd,{id:u.contentId,role:"tooltip",children:o||n})})]})})});Wa.displayName=nt;var Ha="TooltipArrow",nu=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Zt(r);return ru(Ha,r).isInside?null:s.jsx(Kd,{...o,...n,ref:t})});nu.displayName=Ha;function ou(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function au(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function su(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function iu(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const c=t[a].x,u=t[a].y,d=t[i].x,f=t[i].y;u>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(o=!o)}return o}function lu(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),cu(t)}function cu(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var du=Fa,uu=$a,fu=za,pu=Ba,ja=Wa;const ot=du,at=uu,st=fu,Ve=l.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(pu,{children:s.jsx(ja,{ref:n,sideOffset:t,className:D("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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",e),...r})}));Ve.displayName=ja.displayName;const Jt=l.forwardRef(({className:e,type:t,mask:r,onChange:n,placeholder:o,...a},i)=>{const[c,u]=l.useState(!1),d=l.useRef(null),h=o||(r==="phone"?"(999) 999-9999":r==="postal-code-ca"?"A9A 9A9":r==="zip-code-us"?"99999":""),v=()=>r==="phone"?"Only enter numbers. Formatting will be added automatically.":r==="postal-code-ca"?"Enter letters and numbers only. Spacing will be applied automatically.":r==="zip-code-us"?"Only enter numbers. Formatting will be added automatically.":"",g=()=>{u(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(!1)},3e3)};l.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const y=p=>{if(r){const m=p.target.value;let b=m;if(m.length>0){const w=m[m.length-1];/[^a-zA-Z0-9]/.test(w)&&(console.log("Non-alphanumeric detected:",w),g())}if(r==="phone"){const w=m.replace(/\D/g,"");w.length<=3?b=w:w.length<=6?b=`(${w.slice(0,3)}) ${w.slice(3)}`:b=`(${w.slice(0,3)}) ${w.slice(3,6)}-${w.slice(6,10)}`}else if(r==="postal-code-ca"){const w=m.replace(/[^a-zA-Z0-9]/g,"").toUpperCase();let x="";for(let N=0;N<Math.min(w.length,6);N++){const S=w[N];N===0||N===2||N===4?/[A-Z]/.test(S)&&(x+=S):(N===1||N===3||N===5)&&/[0-9]/.test(S)&&(x+=S)}x.length<=3?b=x:b=`${x.slice(0,3)} ${x.slice(3,6)}`}else if(r==="zip-code-us"){const w=m.replace(/\D/g,"");w.length<=5?b=w:b=`${w.slice(0,5)}-${w.slice(5,9)}`}p.target.value=b}n==null||n(p)};return s.jsx(ot,{children:s.jsxs(at,{open:c&&!!r,children:[s.jsx(st,{asChild:!0,children:s.jsx("input",{type:t,className:D("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),onChange:y,placeholder:h,ref:i,...a})}),s.jsx(Ve,{side:"top",className:"bg-sidebar text-sidebar-foreground",children:v()})]})})});Jt.displayName="Input";var hu="Separator",Ua="horizontal",gu=["horizontal","vertical"],Ga=l.forwardRef((e,t)=>{const{decorative:r,orientation:n=Ua,...o}=e,a=mu(n)?n:Ua,c=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return s.jsx(X.div,{"data-orientation":a,...c,...o,ref:t})});Ga.displayName=hu;function mu(e){return gu.includes(e)}var Ka=Ga;const sn=l.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},o)=>s.jsx(Ka,{ref:o,decorative:r,orientation:t,className:D("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));sn.displayName=Ka.displayName;const Ya=Ir,vu=ea,bu=$t,Ra=ta,ln=l.forwardRef(({className:e,...t},r)=>s.jsx(_t,{className:D("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));ln.displayName=_t.displayName;const yu=dt("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),cn=l.forwardRef(({side:e="right",className:t,children:r,...n},o)=>s.jsxs(Ra,{children:[s.jsx(ln,{}),s.jsxs(It,{ref:o,className:D(yu({side:e}),t),...n,children:[s.jsxs($t,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(fr,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));cn.displayName=It.displayName;const qa=({className:e,...t})=>s.jsx("div",{className:D("flex flex-col space-y-2 text-center sm:text-left",e),...t});qa.displayName="SheetHeader";const Xa=({className:e,...t})=>s.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xa.displayName="SheetFooter";const Za=l.forwardRef(({className:e,...t},r)=>s.jsx(Lt,{ref:r,className:D("text-lg font-semibold text-foreground",e),...t}));Za.displayName=Lt.displayName;const Qa=l.forwardRef(({className:e,...t},r)=>s.jsx(Ft,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));Qa.displayName=Ft.displayName;function wu({onClick:e,publicName:t,applicationName:r,partnerId:n}){const o=`https://api.randmar.io/v4/Partner/${n}/Account/Logo?height=72&width=72`,[a,i]=K.useState(!1),c=()=>{i(!0)};return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-muted "+(e!==void 0?"cursor-pointer":""),children:a?s.jsx(ee,{asChild:!0,size:"icon",onClick:e,children:s.jsx(Ni,{className:"h-5 w-5 text-muted-foreground !bg-sidebar"})}):s.jsx(ee,{asChild:!0,size:"icon",onClick:e,children:s.jsx("img",{src:o,alt:"Partner logo",className:"h-9 w-9 object-cover !bg-sidebar",onError:c})})}),s.jsxs("div",{className:"flex flex-1 flex-col",children:[s.jsx("span",{className:"text-sm font-medium",children:t||"Partner"}),s.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}var xu="Label",Ja=l.forwardRef((e,t)=>s.jsx(X.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Ja.displayName=xu;var Nu=Ja;function Cu({className:e,...t}){return s.jsx(Nu,{"data-slot":"label",className:D("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const dn=1024;function es(){const[e,t]=l.useState(void 0);return l.useEffect(()=>{const r=window.matchMedia(`(max-width: ${dn-1}px)`),n=()=>{t(window.innerWidth<dn)};return r.addEventListener("change",n),t(window.innerWidth<dn),()=>r.removeEventListener("change",n)},[]),!!e}function Y({className:e,...t}){return s.jsx("div",{className:D("animate-pulse rounded-md bg-primary/20",e),...t})}const Su="sidebar:state",Eu=60*60*24*7,Tu="16rem",Pu="18rem",Au="3rem",Ou="b",ts=l.createContext(null);function gt(){const e=l.useContext(ts);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const un=l.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:o,children:a,...i},c)=>{const u=es(),[d,f]=l.useState(!1),[h,v]=l.useState(e),g=t??h,y=l.useCallback(w=>{const x=typeof w=="function"?w(g):w;r?r(x):v(x),document.cookie=`${Su}=${x}; path=/; max-age=${Eu}`},[r,g]),p=l.useCallback(()=>u?f(w=>!w):y(w=>!w),[u,y,f]);l.useEffect(()=>{const w=x=>{x.key===Ou&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),p())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[p]);const m=g?"expanded":"collapsed",b=l.useMemo(()=>({state:m,open:g,setOpen:y,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:p}),[m,g,y,u,d,f,p]);return s.jsx(ts.Provider,{value:b,children:s.jsx(ot,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":Tu,"--sidebar-width-icon":Au,...o},className:D("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",n),ref:c,...i,children:a})})})});un.displayName="SidebarProvider";const fn=l.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:o,...a},i)=>{const{isMobile:c,state:u,openMobile:d,setOpenMobile:f}=gt();return r==="none"?s.jsx("div",{className:D("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),ref:i,...a,children:o}):c?s.jsx(Ya,{open:d,onOpenChange:f,...a,children:s.jsx(cn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Pu},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:o})})}):s.jsxs("div",{ref:i,className:"group peer hidden md:block text-sidebar-foreground","data-state":u,"data-collapsible":u==="collapsed"?r:"","data-variant":t,"data-side":e,children:[s.jsx("div",{className:D("duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),s.jsx("div",{className:D("duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...a,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:o})})]})});fn.displayName="Sidebar";const pn=l.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:o}=gt();return s.jsxs(ee,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:D("h-7 w-7 text-sidebar-foreground",e),onClick:a=>{t==null||t(a),o()},...r,children:[s.jsx(yi,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});pn.displayName="SidebarTrigger";const rs=l.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=gt();return s.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:D("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});rs.displayName="SidebarRail";const ns=l.forwardRef(({className:e,...t},r)=>s.jsx("main",{ref:r,className:D("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",e),...t}));ns.displayName="SidebarInset";const os=l.forwardRef(({className:e,...t},r)=>s.jsx(Jt,{ref:r,"data-sidebar":"input",className:D("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));os.displayName="SidebarInput";const hn=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"header",className:D("flex flex-col gap-2 p-2",e),...t}));hn.displayName="SidebarHeader";const gn=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"footer",className:D("flex flex-col gap-2 p-2",e),...t}));gn.displayName="SidebarFooter";const as=l.forwardRef(({className:e,...t},r)=>s.jsx(sn,{ref:r,"data-sidebar":"separator",className:D("mx-2 w-auto bg-sidebar-border",e),...t}));as.displayName="SidebarSeparator";const mn=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"content",className:D("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));mn.displayName="SidebarContent";const ss=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"group",className:D("relative flex w-full min-w-0 flex-col p-2",e),...t}));ss.displayName="SidebarGroup";const is=l.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const o=t?pe:"div";return s.jsx(o,{ref:n,"data-sidebar":"group-label",className:D("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});is.displayName="SidebarGroupLabel";const ls=l.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const o=t?pe:"button";return s.jsx(o,{ref:n,"data-sidebar":"group-action",className:D("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...r})});ls.displayName="SidebarGroupAction";const cs=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"group-content",className:D("w-full text-sm",e),...t}));cs.displayName="SidebarGroupContent";const vn=l.forwardRef(({className:e,...t},r)=>s.jsx("ul",{ref:r,"data-sidebar":"menu",className:D("flex w-full min-w-0 flex-col gap-1",e),...t}));vn.displayName="SidebarMenu";const bn=l.forwardRef(({className:e,...t},r)=>s.jsx("li",{ref:r,"data-sidebar":"menu-item",className:D("group/menu-item relative",e),...t}));bn.displayName="SidebarMenuItem";const Mu=dt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),yn=l.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:o,className:a,...i},c)=>{const u=e?pe:"button",{isMobile:d,state:f}=gt(),h=s.jsx(u,{ref:c,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:D(Mu({variant:r,size:n}),a),...i});return o?(typeof o=="string"&&(o={children:o}),s.jsxs(at,{children:[s.jsx(st,{asChild:!0,children:h}),s.jsx(Ve,{side:"right",align:"center",hidden:f!=="collapsed"||d,...o})]})):h});yn.displayName="SidebarMenuButton";const ds=l.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},o)=>{const a=t?pe:"button";return s.jsx(a,{ref:o,"data-sidebar":"menu-action",className:D("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});ds.displayName="SidebarMenuAction";const us=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:D("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));us.displayName="SidebarMenuBadge";const fs=l.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const o=l.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:D("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&s.jsx(Y,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(Y,{className:"h-4 flex-1 max-w-(--skeleton-width)","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});fs.displayName="SidebarMenuSkeleton";const ps=l.forwardRef(({className:e,...t},r)=>s.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:D("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));ps.displayName="SidebarMenuSub";const hs=l.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));hs.displayName="SidebarMenuSubItem";const gs=l.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...o},a)=>{const i=e?pe:"a";return s.jsx(i,{ref:a,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:D("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...o})});gs.displayName="SidebarMenuSubButton";function ku(e){const t=e+"CollectionProvider",[r,n]=ct(t),[o,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:y,children:p}=g,m=K.useRef(null),b=K.useRef(new Map).current;return s.jsx(o,{scope:y,itemMap:b,collectionRef:m,children:p})};i.displayName=t;const c=e+"CollectionSlot",u=K.forwardRef((g,y)=>{const{scope:p,children:m}=g,b=a(c,p),w=ne(y,b.collectionRef);return s.jsx(pe,{ref:w,children:m})});u.displayName=c;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=K.forwardRef((g,y)=>{const{scope:p,children:m,...b}=g,w=K.useRef(null),x=ne(y,w),N=a(d,p);return K.useEffect(()=>(N.itemMap.set(w,{ref:w,...b}),()=>void N.itemMap.delete(w))),s.jsx(pe,{[f]:"",ref:x,children:m})});h.displayName=d;function v(g){const y=a(e+"CollectionConsumer",g);return K.useCallback(()=>{const m=y.collectionRef.current;if(!m)return[];const b=Array.from(m.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((N,S)=>b.indexOf(N.ref.current)-b.indexOf(S.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},v,n]}var wn="ToastProvider",[xn,Du,_u]=ku("Toast"),[ms,Of]=ct("Toast",[_u]),[Iu,er]=ms(wn),vs=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:i}=e,[c,u]=l.useState(null),[d,f]=l.useState(0),h=l.useRef(!1),v=l.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${wn}\`. Expected non-empty \`string\`.`),s.jsx(xn.Provider,{scope:t,children:s.jsx(Iu,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:a,toastCount:d,viewport:c,onViewportChange:u,onToastAdd:l.useCallback(()=>f(g=>g+1),[]),onToastRemove:l.useCallback(()=>f(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:v,children:i})})};vs.displayName=wn;var bs="ToastViewport",Lu=["F8"],Nn="toast.viewportPause",Cn="toast.viewportResume",ys=l.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=Lu,label:o="Notifications ({hotkey})",...a}=e,i=er(bs,r),c=Du(r),u=l.useRef(null),d=l.useRef(null),f=l.useRef(null),h=l.useRef(null),v=ne(t,h,i.onViewportChange),g=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=i.toastCount>0;l.useEffect(()=>{const m=b=>{var x;n.length!==0&&n.every(N=>b[N]||b.code===N)&&((x=h.current)==null||x.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[n]),l.useEffect(()=>{const m=u.current,b=h.current;if(y&&m&&b){const w=()=>{if(!i.isClosePausedRef.current){const C=new CustomEvent(Nn);b.dispatchEvent(C),i.isClosePausedRef.current=!0}},x=()=>{if(i.isClosePausedRef.current){const C=new CustomEvent(Cn);b.dispatchEvent(C),i.isClosePausedRef.current=!1}},N=C=>{!m.contains(C.relatedTarget)&&x()},S=()=>{m.contains(document.activeElement)||x()};return m.addEventListener("focusin",w),m.addEventListener("focusout",N),m.addEventListener("pointermove",w),m.addEventListener("pointerleave",S),window.addEventListener("blur",w),window.addEventListener("focus",x),()=>{m.removeEventListener("focusin",w),m.removeEventListener("focusout",N),m.removeEventListener("pointermove",w),m.removeEventListener("pointerleave",S),window.removeEventListener("blur",w),window.removeEventListener("focus",x)}}},[y,i.isClosePausedRef]);const p=l.useCallback(({tabbingDirection:m})=>{const w=c().map(x=>{const N=x.ref.current,S=[N,...Ru(N)];return m==="forwards"?S:S.reverse()});return(m==="forwards"?w.reverse():w).flat()},[c]);return l.useEffect(()=>{const m=h.current;if(m){const b=w=>{var S,C,T;const x=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!x){const W=document.activeElement,L=w.shiftKey;if(w.target===m&&L){(S=d.current)==null||S.focus();return}const z=p({tabbingDirection:L?"backwards":"forwards"}),_=z.findIndex(A=>A===W);Tn(z.slice(_+1))?w.preventDefault():L?(C=d.current)==null||C.focus():(T=f.current)==null||T.focus()}};return m.addEventListener("keydown",b),()=>m.removeEventListener("keydown",b)}},[c,p]),s.jsxs(Ml,{ref:u,role:"region","aria-label":o.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&s.jsx(Sn,{ref:d,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"forwards"});Tn(m)}}),s.jsx(xn.Slot,{scope:r,children:s.jsx(X.ol,{tabIndex:-1,...a,ref:v})}),y&&s.jsx(Sn,{ref:f,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"backwards"});Tn(m)}})]})});ys.displayName=bs;var ws="ToastFocusProxy",Sn=l.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,a=er(ws,r);return s.jsx(qt,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var d;const c=i.relatedTarget;!((d=a.viewport)!=null&&d.contains(c))&&n()}})});Sn.displayName=ws;var tr="Toast",Fu="toast.swipeStart",$u="toast.swipeMove",zu="toast.swipeCancel",Bu="toast.swipeEnd",xs=l.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:o,onOpenChange:a,...i}=e,[c=!0,u]=yr({prop:n,defaultProp:o,onChange:a});return s.jsx(ze,{present:r||c,children:s.jsx(Hu,{open:c,...i,ref:t,onClose:()=>u(!1),onPause:fe(e.onPause),onResume:fe(e.onResume),onSwipeStart:R(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:R(e.onSwipeMove,d=>{const{x:f,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:R(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:R(e.onSwipeEnd,d=>{const{x:f,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),u(!1)})})})});xs.displayName=tr;var[Wu,Vu]=ms(tr,{onClose(){}}),Hu=l.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:o,open:a,onClose:i,onEscapeKeyDown:c,onPause:u,onResume:d,onSwipeStart:f,onSwipeMove:h,onSwipeCancel:v,onSwipeEnd:g,...y}=e,p=er(tr,r),[m,b]=l.useState(null),w=ne(t,A=>b(A)),x=l.useRef(null),N=l.useRef(null),S=o||p.duration,C=l.useRef(0),T=l.useRef(S),W=l.useRef(0),{onToastAdd:L,onToastRemove:$}=p,j=fe(()=>{var V;(m==null?void 0:m.contains(document.activeElement))&&((V=p.viewport)==null||V.focus()),i()}),z=l.useCallback(A=>{!A||A===1/0||(window.clearTimeout(W.current),C.current=new Date().getTime(),W.current=window.setTimeout(j,A))},[j]);l.useEffect(()=>{const A=p.viewport;if(A){const V=()=>{z(T.current),d==null||d()},k=()=>{const U=new Date().getTime()-C.current;T.current=T.current-U,window.clearTimeout(W.current),u==null||u()};return A.addEventListener(Nn,k),A.addEventListener(Cn,V),()=>{A.removeEventListener(Nn,k),A.removeEventListener(Cn,V)}}},[p.viewport,S,u,d,z]),l.useEffect(()=>{a&&!p.isClosePausedRef.current&&z(S)},[a,S,p.isClosePausedRef,z]),l.useEffect(()=>(L(),()=>$()),[L,$]);const _=l.useMemo(()=>m?As(m):null,[m]);return p.viewport?s.jsxs(s.Fragment,{children:[_&&s.jsx(ju,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:_}),s.jsx(Wu,{scope:r,onClose:j,children:ur.createPortal(s.jsx(xn.ItemSlot,{scope:r,children:s.jsx(Ol,{asChild:!0,onEscapeKeyDown:R(c,()=>{p.isFocusedToastEscapeKeyDownRef.current||j(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(X.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":p.swipeDirection,...y,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:R(e.onKeyDown,A=>{A.key==="Escape"&&(c==null||c(A.nativeEvent),A.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:R(e.onPointerDown,A=>{A.button===0&&(x.current={x:A.clientX,y:A.clientY})}),onPointerMove:R(e.onPointerMove,A=>{if(!x.current)return;const V=A.clientX-x.current.x,k=A.clientY-x.current.y,U=!!N.current,P=["left","right"].includes(p.swipeDirection),I=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,q=P?I(0,V):0,Q=P?0:I(0,k),ae=A.pointerType==="touch"?10:2,te={x:q,y:Q},oe={originalEvent:A,delta:te};U?(N.current=te,rr($u,h,oe,{discrete:!1})):Os(te,p.swipeDirection,ae)?(N.current=te,rr(Fu,f,oe,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(V)>ae||Math.abs(k)>ae)&&(x.current=null)}),onPointerUp:R(e.onPointerUp,A=>{const V=N.current,k=A.target;if(k.hasPointerCapture(A.pointerId)&&k.releasePointerCapture(A.pointerId),N.current=null,x.current=null,V){const U=A.currentTarget,P={originalEvent:A,delta:V};Os(V,p.swipeDirection,p.swipeThreshold)?rr(Bu,g,P,{discrete:!0}):rr(zu,v,P,{discrete:!0}),U.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),ju=e=>{const{__scopeToast:t,children:r,...n}=e,o=er(tr,t),[a,i]=l.useState(!1),[c,u]=l.useState(!1);return Ku(()=>i(!0)),l.useEffect(()=>{const d=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(d)},[]),c?null:s.jsx(Ct,{asChild:!0,children:s.jsx(qt,{...n,children:a&&s.jsxs(s.Fragment,{children:[o.label," ",r]})})})},Uu="ToastTitle",Ns=l.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(X.div,{...n,ref:t})});Ns.displayName=Uu;var Gu="ToastDescription",Cs=l.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(X.div,{...n,ref:t})});Cs.displayName=Gu;var Ss="ToastAction",Es=l.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?s.jsx(Ps,{altText:r,asChild:!0,children:s.jsx(En,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ss}\`. Expected non-empty \`string\`.`),null)});Es.displayName=Ss;var Ts="ToastClose",En=l.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,o=Vu(Ts,r);return s.jsx(Ps,{asChild:!0,children:s.jsx(X.button,{type:"button",...n,ref:t,onClick:R(e.onClick,o.onClose)})})});En.displayName=Ts;var Ps=l.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...o}=e;return s.jsx(X.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function As(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),Yu(n)){const o=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!o)if(a){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...As(n))}}),t}function rr(e,t,r,{discrete:n}){const o=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?uo(o,a):o.dispatchEvent(a)}var Os=(e,t,r=0)=>{const n=Math.abs(e.x),o=Math.abs(e.y),a=n>o;return t==="left"||t==="right"?a&&n>r:!a&&o>r};function Ku(e=()=>{}){const t=fe(e);Ae(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function Yu(e){return e.nodeType===e.ELEMENT_NODE}function Ru(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Tn(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var qu=vs,Ms=ys,ks=xs,Ds=Ns,_s=Cs,Is=Es,Ls=En;const Fs=qu,Pn=l.forwardRef(({className:e,...t},r)=>s.jsx(Ms,{ref:r,className:D("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Pn.displayName=Ms.displayName;const Xu=dt("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-600 bg-green-600 text-white",warning:"border-yellow-500 bg-yellow-500 text-white",info:"border-blue-500 bg-blue-500 text-white",secondary:"border-secondary bg-secondary text-secondary-foreground",outline:"border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),An=l.forwardRef(({className:e,variant:t,...r},n)=>s.jsx(ks,{ref:n,className:D(Xu({variant:t}),e),...r}));An.displayName=ks.displayName;const $s=l.forwardRef(({className:e,...t},r)=>s.jsx(Is,{ref:r,className:D("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",e),...t}));$s.displayName=Is.displayName;const On=l.forwardRef(({className:e,...t},r)=>s.jsx(Ls,{ref:r,className:D("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(fr,{className:"h-4 w-4"})}));On.displayName=Ls.displayName;const Mn=l.forwardRef(({className:e,...t},r)=>s.jsx(Ds,{ref:r,className:D("text-sm font-semibold [&+div]:text-xs",e),...t}));Mn.displayName=Ds.displayName;const kn=l.forwardRef(({className:e,...t},r)=>s.jsx(_s,{ref:r,className:D("text-sm opacity-90",e),...t}));kn.displayName=_s.displayName;const Zu=1,Qu=1e6;let Dn=0;function Ju(){return Dn=(Dn+1)%Number.MAX_SAFE_INTEGER,Dn.toString()}const _n=new Map,zs=e=>{if(_n.has(e))return;const t=setTimeout(()=>{_n.delete(e),mt({type:"REMOVE_TOAST",toastId:e})},Qu);_n.set(e,t)},ef=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Zu)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?zs(r):e.toasts.forEach(n=>zs(n.id)),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return{...e,toasts:t.toastId?e.toasts.filter(r=>r.id!==t.toastId):[]}}},nr=[];let or={toasts:[]};function mt(e){or=ef(or,e),nr.forEach(t=>t(or))}function Bs({...e}){const t=Ju(),r=o=>mt({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>mt({type:"DISMISS_TOAST",toastId:t});return mt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}function In(){const[e,t]=l.useState(or);return l.useEffect(()=>(nr.push(t),()=>{const r=nr.indexOf(t);r>-1&&nr.splice(r,1)}),[]),{...e,toast:Bs,dismiss:r=>mt({type:"DISMISS_TOAST",toastId:r})}}function Ws(){const{toasts:e}=In();return s.jsxs(Fs,{children:[e.map(function({id:t,title:r,description:n,action:o,...a}){return s.jsxs(An,{...a,children:[s.jsxs("div",{className:"grid gap-1",children:[r&&s.jsx(Mn,{children:r}),n&&s.jsx(kn,{children:n})]}),o,s.jsx(On,{})]},t)}),s.jsx(Pn,{})]})}function Vs({onSignOut:e,handleValidSearch:t,rightMenu:r}){const[n,o]=K.useState(""),a=dr.useLocation(),{toast:i}=In();K.useEffect(()=>{const f=new URLSearchParams(a.search).get("q");f&&o(f)},[a.search]);const c=()=>{const d=n.trim();if(!d||d.length<2){i({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}t(d)},u=d=>{d.key==="Enter"&&c()};return s.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[s.jsx(pn,{className:"lg:hidden",children:s.jsx(vi,{className:"h-6 w-6"})}),s.jsx("div",{className:"flex flex-1 items-center gap-4",children:s.jsx("div",{className:"relative w-full max-w-sm",children:s.jsxs("div",{children:[s.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:c,"aria-label":"Search",children:s.jsx(xi,{className:"h-4 w-4 text-muted-foreground"})}),s.jsx(Jt,{placeholder:"Search...",className:"w-full pl-8 bg-white text-black",value:n,onChange:d=>o(d.target.value),onKeyDown:u},"topbar-search")]})})}),r||s.jsx(s.Fragment,{}),e&&s.jsx("div",{className:"flex items-center gap-4",children:s.jsxs(ee,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[s.jsx(mi,{className:"h-4 w-4 text-sidebar-foreground"}),s.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})}function Hs({routes:e,footer:t,dashboardTitle:r}){const{appID:n}=dr.useParams(),o=e.filter(a=>a.showInNav);return s.jsxs(fn,{className:"border-r border-sidebar-border",children:[s.jsx(hn,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center justify-center",children:s.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),s.jsx("span",{className:"font-semibold text-lg",children:r})]})}),s.jsx(mn,{className:"py-4 bg-sidebar text-sidebar-foreground",children:s.jsx(vn,{children:o.map(a=>{const i=a.icon,c=`/${a.path.replace(":appID",n)}`;return s.jsx(bn,{children:s.jsx(yn,{asChild:!0,children:s.jsxs(dr.Link,{to:c,className:"transition-colors hover:bg-muted px-6",children:[i&&s.jsx(i,{className:"h-4 w-4"}),s.jsx("span",{children:a.label})]})})},a.key)})})}),s.jsx(gn,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:t})]})}function tf({children:e,rightMenu:t,routes:r,footer:n,handleValidSearch:o,dashboardTitle:a,onSignOut:i}){return s.jsx(s.Fragment,{children:s.jsx(un,{children:s.jsxs("div",{className:"flex grow",children:[s.jsx(Hs,{routes:r,footer:n,dashboardTitle:a}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(Vs,{onSignOut:i,rightMenu:t,handleValidSearch:o}),s.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),s.jsx(Ws,{})]})]})})})}const rf={sm:100,md:200,lg:300,xl:400};function js({randmarSKU:e,size:t="md",alt:r,secondaryContent:n}){const[o,a]=l.useState(!1),[i,c]=l.useState(!1),[u,d]=l.useState(!1),[f,h]=l.useState(!1),v=`https://api.randmar.io/Product/${e}/Video`;l.useEffect(()=>{(async()=>{try{const x=await(await fetch(v+"/Exists")).json();c(x)}catch(w){console.error("Error checking for video:",w),c(!1)}})()},[e,v]);async function g(){if(i){h(!0);try{const w=await(await fetch(v)).blob(),x=window.URL.createObjectURL(w),N=document.createElement("a");N.href=x,N.download=`${e||"product"}-video.mp4`,document.body.appendChild(N),N.click(),document.body.removeChild(N),window.URL.revokeObjectURL(x)}catch(b){console.error("Error downloading video:",b)}finally{h(!1)}}}function y(){navigator.clipboard.writeText(v),d(!0),setTimeout(()=>{d(!1)},2e3)}function p(){a(!0)}const m=rf[t||"xl"];return s.jsxs(s.Fragment,{children:[s.jsx(zt,{open:o,onOpenChange:a,children:s.jsx(Bt,{className:"max-w-4xl p-0 overflow-hidden",children:n?s.jsxs("div",{className:"flex flex-row",children:[s.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[s.jsx("source",{src:v,type:"video/mp4"}),"Your browser does not support the video tag."]}),s.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):s.jsxs("div",{className:"w-full relative",children:[s.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[s.jsx("source",{src:v,type:"video/mp4"}),"Your browser does not support the video tag."]}),s.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[s.jsx(ot,{children:s.jsxs(at,{children:[s.jsx(st,{asChild:!0,children:s.jsx(ee,{variant:"secondary",size:"icon",onClick:y,children:u?s.jsx(fi,{className:"h-4 w-4"}):s.jsx(pi,{className:"h-4 w-4"})})}),s.jsx(Ve,{children:s.jsx("p",{children:"Copy video link"})})]})}),s.jsx(ot,{children:s.jsxs(at,{children:[s.jsx(st,{asChild:!0,children:s.jsx(ee,{variant:"secondary",size:"icon",onClick:g,disabled:f,children:s.jsx(hi,{className:"h-4 w-4"})})}),s.jsx(Ve,{children:s.jsx("p",{children:"Download video"})})]})})]})]})})}),s.jsxs("div",{className:"relative w-max h-max",children:[s.jsx("img",{alt:r||`Product ${e}`,className:`rounded-md ${i?"cursor-pointer":""}`,onClick:i?p:void 0,src:`https://api.randmar.io/Product/${e}/Image?width=${m*1.5}&height=${m*1.5}`,width:m,height:m}),i&&s.jsx(ot,{children:s.jsxs(at,{children:[s.jsx(st,{asChild:!0,children:s.jsx(ee,{variant:"secondary",size:"icon",className:"absolute top-2 right-2",onClick:p,children:s.jsx(wi,{className:"h-4 w-4"})})}),s.jsx(Ve,{children:s.jsx("p",{children:"Play video"})})]})})]})]})}const ar=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("rounded-md border bg-card text-card-foreground shadow-sm",e),...t}));ar.displayName="Card";const Us=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("flex flex-col space-y-1.5 p-6",e),...t}));Us.displayName="CardHeader";const Gs=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("font-semibold leading-none tracking-tight",e),...t}));Gs.displayName="CardTitle";const Ks=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("text-sm text-muted-foreground",e),...t}));Ks.displayName="CardDescription";const sr=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("p-6 pt-0",e),...t}));sr.displayName="CardContent";const Ys=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("flex items-center p-6 pt-0",e),...t}));Ys.displayName="CardFooter";const nf=dt("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input hover:bg-accent hover:text-accent-foreground",success:"bg-green-600 text-white hover:bg-green-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",ghost:"bg-background hover:bg-accent hover:text-accent-foreground",randmarRed:"bg-randmar-red text-white hover:bg-randmar-red/80",randmarBlue:"bg-randmar-blue text-white hover:bg-randmar-blue/80",randmarPurple:"bg-randmar-purple text-white hover:bg-randmar-purple/80",randmarGreen:"bg-randmar-green text-black hover:bg-randmar-green/80",randmarBlack:"bg-randmar-black text-white hover:bg-randmar-black/80",randmarYellow:"bg-randmar-yellow text-black hover:bg-randmar-yellow/80"},size:{default:"h-6",sm:"h-5 text-[10px]",lg:"h-7 px-3"}},defaultVariants:{variant:"default",size:"default"}}),Ne=l.forwardRef(({className:e,variant:t,size:r,icon:n,children:o,...a},i)=>s.jsxs("div",{ref:i,className:D(nf({variant:t,size:r}),e),...a,children:[n&&s.jsx("span",{className:"mr-1",children:n}),o]}));Ne.displayName="Badge";function of({product:e,addToCart:t=!1,syncToShopify:r=!1,viewProductAction:n,addToCartAction:o,syncToShopifyAction:a,isActionLoading:i=!1}){var $,j,z,_,A,V,k,U;const[c,u]=K.useState(1),[d,f]=K.useState(null),[h,v]=K.useState(0),g=(($=e==null?void 0:e.Distribution)==null?void 0:$.RegularPrice)||0,y=((j=e==null?void 0:e.Distribution)==null?void 0:j.Price)||0,[p,m]=K.useState(null),[b,w]=K.useState(!1);if(K.useEffect(()=>{const P=async()=>{if(e!=null&&e.ManufacturerId){w(!0);try{const I=await fetch(`https://api.randmar.io/V4/Partner/${e.ManufacturerId}/Account/Logo?width=60&height=40`);if(I.ok){const q=await I.blob();m(URL.createObjectURL(q))}}catch(I){console.error("Failed to load logo:",I)}finally{w(!1)}}};e!=null&&e.ManufacturerId&&P()},[e==null?void 0:e.ManufacturerId]),K.useEffect(()=>{if(!e)return;const P=d?d.Price:y;v(g>0?Math.round((g-P)/g*100):0)},[e,d,y,g]),!e)return s.jsx(ar,{className:"hover:shadow-lg transition-shadow",children:s.jsxs(sr,{className:"p-6",children:[s.jsxs("div",{className:"flex justify-between items-start mb-3",children:[s.jsx(Y,{className:"h-7 w-3/4"}),s.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:s.jsx(Y,{className:"h-10 w-24 rounded-md"})})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[s.jsx(Y,{className:"h-6 w-20 rounded-full"}),s.jsx(Y,{className:"h-6 w-24 rounded-full"}),s.jsx(Y,{className:"h-6 w-28 rounded-full"})]}),s.jsxs("div",{className:"flex gap-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[s.jsxs("div",{children:[s.jsx(Y,{className:"h-4 w-12 mb-1"}),s.jsx(Y,{className:"h-5 w-20"})]}),s.jsxs("div",{children:[s.jsx(Y,{className:"h-4 w-12 mb-1"}),s.jsx(Y,{className:"h-5 w-24"})]}),s.jsxs("div",{children:[s.jsx(Y,{className:"h-4 w-20 mb-1"}),s.jsx(Y,{className:"h-5 w-16"})]}),s.jsxs("div",{children:[s.jsx(Y,{className:"h-4 w-12 mb-1"}),s.jsx(Y,{className:"h-5 w-20"})]})]}),s.jsx("div",{className:"flex flex-col",children:s.jsx("div",{className:"w-60 h-40",children:s.jsx(Y,{className:"w-full h-full rounded-lg"})})})]}),s.jsxs("div",{className:"flex gap-6 mt-4",children:[s.jsx("div",{className:"flex flex-1",children:s.jsxs("div",{className:"w-full",children:[s.jsx(Y,{className:"h-4 w-24 mb-3"}),s.jsx(Y,{className:"h-16 w-full rounded-md"})]})}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(Y,{className:"h-10 w-32 rounded-md"}),s.jsx(Y,{className:"h-5 w-24 mt-4"})]})]}),s.jsxs("div",{className:"flex gap-6 mt-4",children:[s.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[s.jsx(Y,{className:"h-8 w-32"}),s.jsx(Y,{className:"h-6 w-24"})]}),s.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[s.jsx(Y,{className:"h-10 w-24 rounded-md"}),s.jsx(Y,{className:"h-10 flex-1 rounded-md"})]})]})]})});const x=e.Opportunities||[],N=x.length>0,S=()=>{c>1&&u(c-1)},C=()=>{u(c+1)},T=((_=(z=e.Distribution)==null?void 0:z.Inventory)==null?void 0:_.reduce((P,I)=>P+(I.AvailableQuantity||0),0))||0,W=P=>{try{return new Date(P).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(I){return console.error(I),P.split("T")[0]||"N/A"}},L=()=>{o&&o({quantity:c,bidNumber:(d==null?void 0:d.BidNumber)??null})};return s.jsx(ar,{className:"hover:shadow-lg transition-shadow",children:s.jsxs(sr,{className:"p-6",children:[s.jsxs("div",{className:"flex justify-between items-start mb-3",children:[s.jsx("h3",{className:"font-semibold text-xl",children:e.Title||e.RandmarTitle}),s.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:b?s.jsx(Y,{className:"h-10 w-24 rounded-md"}):p&&s.jsx("img",{src:p,alt:e.ManufacturerName,className:"max-h-10 max-w-24 object-contain"})})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.AvailableToBuy&&s.jsxs(Ne,{variant:"outline",className:"bg-purple-50 text-purple-700 hover:bg-purple-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Active"]}),e.SerialNumber&&s.jsxs(Ne,{variant:"outline",className:"bg-blue-50 text-blue-700 hover:bg-blue-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Serialized"]}),e.TransparencyCode&&s.jsxs(Ne,{variant:"outline",className:"bg-teal-50 text-teal-700 hover:bg-teal-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Transparency Code"]}),((A=e.ManufacturerCategory)==null?void 0:A.QualificationRequired)&&s.jsxs(Ne,{variant:"outline",className:"bg-yellow-50 text-yellow-700 hover:bg-yellow-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Qualified"]}),e.AutoUpdate&&s.jsxs(Ne,{variant:"outline",className:"bg-orange-50 text-orange-700 hover:bg-orange-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Manually Reorders"]}),e.ShopifyProduct&&Object.keys(e.ShopifyProduct||{}).length>0&&s.jsxs(Ne,{variant:"outline",className:"bg-green-50 text-green-700 hover:bg-green-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Shopify Ready"]})]}),s.jsxs("div",{className:"flex gap-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),s.jsx("div",{className:"font-medium",children:e.MPN||"N/A"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),s.jsx("div",{className:"font-medium",children:e.UPC||"N/A"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),s.jsx("div",{className:"font-medium",children:e.UnitWeight?`${e.UnitWeight} lbs`:"N/A"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"MAP"}),s.jsx("div",{className:"font-medium",children:e.MAP?"$"+e.MAP.toFixed(2):"N/A"})]})]}),s.jsx("div",{className:"flex flex-col",children:s.jsx(js,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""})})]}),s.jsxs("div",{className:"flex gap-6 mt-4",children:[s.jsx("div",{className:"flex flex-1",children:e.Distribution&&s.jsxs("div",{className:"w-full",children:[s.jsx("div",{className:"text-sm text-muted-foreground flex items-center",children:"Opportunities"}),N?s.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto pr-1 mt-1",children:x.map((P,I)=>s.jsxs("div",{className:`flex justify-between items-center border border-gray-100 rounded transition-colors py-2 px-4
159
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Lc="DialogDescriptionWarning",Fc=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Jo(Lc).contentName}}.`;return l.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Ir=Bo,ea=Vo,ta=jo,_t=Uo,It=Go,Lt=Yo,Ft=qo,$t=Zo;const zt=({modal:e=!1,...t})=>s.jsx(Ir,{modal:e,...t});zt.displayName=Ir.displayName;const ra=ea,na=ta,Lr=$t,Fr=l.forwardRef(({className:e,...t},r)=>s.jsx(_t,{ref:r,className:D("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Fr.displayName=_t.displayName;const Bt=l.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(na,{children:[s.jsx(Fr,{}),s.jsxs(It,{ref:n,className:D("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,s.jsxs($t,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[s.jsx(fr,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bt.displayName=It.displayName;const $r=({className:e,...t})=>s.jsx("div",{className:D("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$r.displayName="DialogHeader";const zr=({className:e,...t})=>s.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zr.displayName="DialogFooter";const Br=l.forwardRef(({className:e,...t},r)=>s.jsx(Lt,{ref:r,className:D("text-lg font-semibold leading-none tracking-tight",e),...t}));Br.displayName=Lt.displayName;const Wr=l.forwardRef(({className:e,...t},r)=>s.jsx(Ft,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));Wr.displayName=Ft.displayName;const oa=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,aa=qn,dt=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return aa(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(d=>{const f=r==null?void 0:r[d],h=a==null?void 0:a[d];if(f===null)return null;const v=oa(f)||oa(h);return o[d][v]}),c=r&&Object.entries(r).reduce((d,f)=>{let[h,v]=f;return v===void 0||(d[h]=v),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,f)=>{let{class:h,className:v,...g}=f;return Object.entries(g).every(y=>{let[p,m]=y;return Array.isArray(m)?m.includes({...a,...c}[p]):{...a,...c}[p]===m})?[...d,h,v]:d},[]);return aa(e,i,u,r==null?void 0:r.class,r==null?void 0:r.className)},Vr=dt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",defaultOutline:"border border-red-600/30 text-red-600 bg-background shadow-xs hover:bg-red-600/5 ",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",blue:"bg-randmar-blue text-gray-100 shadow-sm hover:bg-randmar-blue/90",red:"bg-randmar-red text-gray-100 shadow-sm hover:bg-randmar-red/90",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ee=l.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,confirmationDialog:o,onClick:a,...i},c)=>{const u=n?pe:"button";if(!o)return s.jsx(u,{className:D(Vr({variant:t,size:r,className:e})),ref:c,onClick:a,...i});a&&console.warn("Button: You provided both onClick and confirmationDialog props. The onClick prop will be ignored. Use the onConfirm callback in confirmationDialog instead.");const{title:d,content:f,onConfirm:h,confirmText:v="Confirm",cancelText:g="Cancel"}=o,y=()=>{h()};return s.jsxs(zt,{children:[s.jsx(ra,{asChild:!0,children:s.jsx(u,{className:D(Vr({variant:t,size:r,className:e})),ref:c,...i})}),s.jsxs(Bt,{children:[s.jsxs($r,{children:[s.jsx(Br,{children:d}),s.jsx(Wr,{children:f})]}),s.jsxs(zr,{className:"flex justify-end gap-2 pt-4",children:[s.jsx(Lr,{asChild:!0,children:s.jsx(ee,{variant:"outline",children:g})}),s.jsx(Lr,{asChild:!0,children:s.jsx(ee,{onClick:y,children:v})})]})]})]})});ee.displayName="Button";const $c=["top","right","bottom","left"],Me=Math.min,le=Math.max,Wt=Math.round,Vt=Math.floor,ye=e=>({x:e,y:e}),zc={left:"right",right:"left",bottom:"top",top:"bottom"},Bc={start:"end",end:"start"};function Hr(e,t,r){return le(e,Me(t,r))}function Se(e,t){return typeof e=="function"?e(t):e}function Ee(e){return e.split("-")[0]}function Je(e){return e.split("-")[1]}function jr(e){return e==="x"?"y":"x"}function Ur(e){return e==="y"?"height":"width"}function ke(e){return["top","bottom"].includes(Ee(e))?"y":"x"}function Gr(e){return jr(ke(e))}function Wc(e,t,r){r===void 0&&(r=!1);const n=Je(e),o=Gr(e),a=Ur(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Ht(i)),[i,Ht(i)]}function Vc(e){const t=Ht(e);return[Kr(e),t,Kr(t)]}function Kr(e){return e.replace(/start|end/g,t=>Bc[t])}function Hc(e,t,r){const n=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?a:i;default:return[]}}function jc(e,t,r,n){const o=Je(e);let a=Hc(Ee(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(Kr)))),a}function Ht(e){return e.replace(/left|right|bottom|top/g,t=>zc[t])}function Uc(e){return{top:0,right:0,bottom:0,left:0,...e}}function sa(e){return typeof e!="number"?Uc(e):{top:e,right:e,bottom:e,left:e}}function jt(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ia(e,t,r){let{reference:n,floating:o}=e;const a=ke(t),i=Gr(t),c=Ur(i),u=Ee(t),d=a==="y",f=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,v=n[c]/2-o[c]/2;let g;switch(u){case"top":g={x:f,y:n.y-o.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:h};break;case"left":g={x:n.x-o.width,y:h};break;default:g={x:n.x,y:n.y}}switch(Je(t)){case"start":g[i]-=v*(r&&d?-1:1);break;case"end":g[i]+=v*(r&&d?-1:1);break}return g}const Gc=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,c=a.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=ia(d,n,u),v=n,g={},y=0;for(let p=0;p<c.length;p++){const{name:m,fn:b}=c[p],{x:w,y:x,data:N,reset:S}=await b({x:f,y:h,initialPlacement:n,placement:v,strategy:o,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});f=w??f,h=x??h,g={...g,[m]:{...g[m],...N}},S&&y<=50&&(y++,typeof S=="object"&&(S.placement&&(v=S.placement),S.rects&&(d=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:f,y:h}=ia(d,v,u)),p=-1)}return{x:f,y:h,placement:v,strategy:o,middlewareData:g}};async function ut(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:i,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:v=!1,padding:g=0}=Se(t,e),y=sa(g),m=c[v?h==="floating"?"reference":"floating":h],b=jt(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(m)))==null||r?m:m.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:d,rootBoundary:f,strategy:u})),w=h==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),N=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},S=jt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:x,strategy:u}):w);return{top:(b.top-S.top+y.top)/N.y,bottom:(S.bottom-b.bottom+y.bottom)/N.y,left:(b.left-S.left+y.left)/N.x,right:(S.right-b.right+y.right)/N.x}}const Kc=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:c,middlewareData:u}=t,{element:d,padding:f=0}=Se(e,t)||{};if(d==null)return{};const h=sa(f),v={x:r,y:n},g=Gr(o),y=Ur(g),p=await i.getDimensions(d),m=g==="y",b=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",N=a.reference[y]+a.reference[g]-v[g]-a.floating[y],S=v[g]-a.reference[g],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let T=C?C[x]:0;(!T||!await(i.isElement==null?void 0:i.isElement(C)))&&(T=c.floating[x]||a.floating[y]);const W=N/2-S/2,L=T/2-p[y]/2-1,$=Me(h[b],L),j=Me(h[w],L),z=$,_=T-p[y]-j,A=T/2-p[y]/2+W,V=Hr(z,A,_),k=!u.arrow&&Je(o)!=null&&A!==V&&a.reference[y]/2-(A<z?$:j)-p[y]/2<0,U=k?A<z?A-z:A-_:0;return{[g]:v[g]+U,data:{[g]:V,centerOffset:A-V-U,...k&&{alignmentOffset:U}},reset:k}}}),Yc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:p=!0,...m}=Se(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const b=Ee(o),w=ke(c),x=Ee(c)===c,N=await(u.isRTL==null?void 0:u.isRTL(d.floating)),S=v||(x||!p?[Ht(c)]:Vc(c)),C=y!=="none";!v&&C&&S.push(...jc(c,p,y,N));const T=[c,...S],W=await ut(t,m),L=[];let $=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&L.push(W[b]),h){const A=Wc(o,i,N);L.push(W[A[0]],W[A[1]])}if($=[...$,{placement:o,overflows:L}],!L.every(A=>A<=0)){var j,z;const A=(((j=a.flip)==null?void 0:j.index)||0)+1,V=T[A];if(V)return{data:{index:A,overflows:$},reset:{placement:V}};let k=(z=$.filter(U=>U.overflows[0]<=0).sort((U,P)=>U.overflows[1]-P.overflows[1])[0])==null?void 0:z.placement;if(!k)switch(g){case"bestFit":{var _;const U=(_=$.filter(P=>{if(C){const I=ke(P.placement);return I===w||I==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(I=>I>0).reduce((I,q)=>I+q,0)]).sort((P,I)=>P[1]-I[1])[0])==null?void 0:_[0];U&&(k=U);break}case"initialPlacement":k=c;break}if(o!==k)return{reset:{placement:k}}}return{}}}};function la(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ca(e){return $c.some(t=>e[t]>=0)}const Rc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Se(e,t);switch(n){case"referenceHidden":{const a=await ut(t,{...o,elementContext:"reference"}),i=la(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ca(i)}}}case"escaped":{const a=await ut(t,{...o,altBoundary:!0}),i=la(a,r.floating);return{data:{escapedOffsets:i,escaped:ca(i)}}}default:return{}}}}};async function qc(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Ee(r),c=Je(r),u=ke(r)==="y",d=["left","top"].includes(i)?-1:1,f=a&&u?-1:1,h=Se(t,e);let{mainAxis:v,crossAxis:g,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof y=="number"&&(g=c==="end"?y*-1:y),u?{x:g*f,y:v*d}:{x:v*d,y:g*f}}const Xc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:c}=t,u=await qc(t,e);return i===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:i}}}}},Zc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:c={fn:m=>{let{x:b,y:w}=m;return{x:b,y:w}}},...u}=Se(e,t),d={x:r,y:n},f=await ut(t,u),h=ke(Ee(o)),v=jr(h);let g=d[v],y=d[h];if(a){const m=v==="y"?"top":"left",b=v==="y"?"bottom":"right",w=g+f[m],x=g-f[b];g=Hr(w,g,x)}if(i){const m=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=y+f[m],x=y-f[b];y=Hr(w,y,x)}const p=c.fn({...t,[v]:g,[h]:y});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[v]:a,[h]:i}}}}}},Qc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Se(e,t),f={x:r,y:n},h=ke(o),v=jr(h);let g=f[v],y=f[h];const p=Se(c,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(u){const x=v==="y"?"height":"width",N=a.reference[v]-a.floating[x]+m.mainAxis,S=a.reference[v]+a.reference[x]-m.mainAxis;g<N?g=N:g>S&&(g=S)}if(d){var b,w;const x=v==="y"?"width":"height",N=["top","left"].includes(Ee(o)),S=a.reference[h]-a.floating[x]+(N&&((b=i.offset)==null?void 0:b[h])||0)+(N?0:m.crossAxis),C=a.reference[h]+a.reference[x]+(N?0:((w=i.offset)==null?void 0:w[h])||0)-(N?m.crossAxis:0);y<S?y=S:y>C&&(y=C)}return{[v]:g,[h]:y}}}},Jc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:c}=t,{apply:u=()=>{},...d}=Se(e,t),f=await ut(t,d),h=Ee(o),v=Je(o),g=ke(o)==="y",{width:y,height:p}=a.floating;let m,b;h==="top"||h==="bottom"?(m=h,b=v===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(b=h,m=v==="end"?"top":"bottom");const w=p-f.top-f.bottom,x=y-f.left-f.right,N=Me(p-f[m],w),S=Me(y-f[b],x),C=!t.middlewareData.shift;let T=N,W=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(W=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=w),C&&!v){const $=le(f.left,0),j=le(f.right,0),z=le(f.top,0),_=le(f.bottom,0);g?W=y-2*($!==0||j!==0?$+j:le(f.left,f.right)):T=p-2*(z!==0||_!==0?z+_:le(f.top,f.bottom))}await u({...t,availableWidth:W,availableHeight:T});const L=await i.getDimensions(c.floating);return y!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function Ut(){return typeof window<"u"}function et(e){return da(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function we(e){var t;return(t=(da(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function da(e){return Ut()?e instanceof Node||e instanceof ce(e).Node:!1}function ge(e){return Ut()?e instanceof Element||e instanceof ce(e).Element:!1}function xe(e){return Ut()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function ua(e){return!Ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function ft(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=me(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function ed(e){return["table","td","th"].includes(et(e))}function Gt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Yr(e){const t=Rr(),r=ge(e)?me(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function td(e){let t=De(e);for(;xe(t)&&!tt(t);){if(Yr(t))return t;if(Gt(t))return null;t=De(t)}return null}function Rr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function tt(e){return["html","body","#document"].includes(et(e))}function me(e){return ce(e).getComputedStyle(e)}function Kt(e){return ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function De(e){if(et(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ua(e)&&e.host||we(e);return ua(t)?t.host:t}function fa(e){const t=De(e);return tt(t)?e.ownerDocument?e.ownerDocument.body:e.body:xe(t)&&ft(t)?t:fa(t)}function pt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=fa(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=ce(o);if(a){const c=qr(i);return t.concat(i,i.visualViewport||[],ft(o)?o:[],c&&r?pt(c):[])}return t.concat(o,pt(o,[],r))}function qr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pa(e){const t=me(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=xe(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,c=Wt(r)!==a||Wt(n)!==i;return c&&(r=a,n=i),{width:r,height:n,$:c}}function Xr(e){return ge(e)?e:e.contextElement}function rt(e){const t=Xr(e);if(!xe(t))return ye(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=pa(t);let i=(a?Wt(r.width):r.width)/n,c=(a?Wt(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const rd=ye(0);function ha(e){const t=ce(e);return!Rr()||!t.visualViewport?rd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nd(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ce(e)?!1:t}function We(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=Xr(e);let i=ye(1);t&&(n?ge(n)&&(i=rt(n)):i=rt(e));const c=nd(a,r,n)?ha(a):ye(0);let u=(o.left+c.x)/i.x,d=(o.top+c.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(a){const v=ce(a),g=n&&ge(n)?ce(n):n;let y=v,p=qr(y);for(;p&&n&&g!==y;){const m=rt(p),b=p.getBoundingClientRect(),w=me(p),x=b.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,N=b.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;u*=m.x,d*=m.y,f*=m.x,h*=m.y,u+=x,d+=N,y=ce(p),p=qr(y)}}return jt({width:f,height:h,x:u,y:d})}function Zr(e,t){const r=Kt(e).scrollLeft;return t?t.left+r:We(we(e)).left+r}function ga(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:Zr(e,n)),a=n.top+t.scrollTop;return{x:o,y:a}}function od(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",i=we(n),c=t?Gt(t.floating):!1;if(n===i||c&&a)return r;let u={scrollLeft:0,scrollTop:0},d=ye(1);const f=ye(0),h=xe(n);if((h||!h&&!a)&&((et(n)!=="body"||ft(i))&&(u=Kt(n)),xe(n))){const g=We(n);d=rt(n),f.x=g.x+n.clientLeft,f.y=g.y+n.clientTop}const v=i&&!h&&!a?ga(i,u,!0):ye(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+f.x+v.x,y:r.y*d.y-u.scrollTop*d.y+f.y+v.y}}function ad(e){return Array.from(e.getClientRects())}function sd(e){const t=we(e),r=Kt(e),n=e.ownerDocument.body,o=le(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=le(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Zr(e);const c=-r.scrollTop;return me(n).direction==="rtl"&&(i+=le(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:c}}function id(e,t){const r=ce(e),n=we(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,c=0,u=0;if(o){a=o.width,i=o.height;const d=Rr();(!d||d&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}return{width:a,height:i,x:c,y:u}}function ld(e,t){const r=We(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=xe(e)?rt(e):ye(1),i=e.clientWidth*a.x,c=e.clientHeight*a.y,u=o*a.x,d=n*a.y;return{width:i,height:c,x:u,y:d}}function ma(e,t,r){let n;if(t==="viewport")n=id(e,r);else if(t==="document")n=sd(we(e));else if(ge(t))n=ld(t,r);else{const o=ha(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return jt(n)}function va(e,t){const r=De(e);return r===t||!ge(r)||tt(r)?!1:me(r).position==="fixed"||va(r,t)}function cd(e,t){const r=t.get(e);if(r)return r;let n=pt(e,[],!1).filter(c=>ge(c)&&et(c)!=="body"),o=null;const a=me(e).position==="fixed";let i=a?De(e):e;for(;ge(i)&&!tt(i);){const c=me(i),u=Yr(i);!u&&c.position==="fixed"&&(o=null),(a?!u&&!o:!u&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ft(i)&&!u&&va(e,i))?n=n.filter(f=>f!==i):o=c,i=De(i)}return t.set(e,n),n}function dd(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?Gt(t)?[]:cd(t,this._c):[].concat(r),n],c=i[0],u=i.reduce((d,f)=>{const h=ma(t,f,o);return d.top=le(h.top,d.top),d.right=Me(h.right,d.right),d.bottom=Me(h.bottom,d.bottom),d.left=le(h.left,d.left),d},ma(t,c,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function ud(e){const{width:t,height:r}=pa(e);return{width:t,height:r}}function fd(e,t,r){const n=xe(t),o=we(t),a=r==="fixed",i=We(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const u=ye(0);if(n||!n&&!a)if((et(t)!=="body"||ft(o))&&(c=Kt(t)),n){const v=We(t,!0,a,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else o&&(u.x=Zr(o));const d=o&&!n&&!a?ga(o,c):ye(0),f=i.left+c.scrollLeft-u.x-d.x,h=i.top+c.scrollTop-u.y-d.y;return{x:f,y:h,width:i.width,height:i.height}}function Qr(e){return me(e).position==="static"}function ba(e,t){if(!xe(e)||me(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return we(e)===r&&(r=r.ownerDocument.body),r}function ya(e,t){const r=ce(e);if(Gt(e))return r;if(!xe(e)){let o=De(e);for(;o&&!tt(o);){if(ge(o)&&!Qr(o))return o;o=De(o)}return r}let n=ba(e,t);for(;n&&ed(n)&&Qr(n);)n=ba(n,t);return n&&tt(n)&&Qr(n)&&!Yr(n)?r:n||td(e)||r}const pd=async function(e){const t=this.getOffsetParent||ya,r=this.getDimensions,n=await r(e.floating);return{reference:fd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function hd(e){return me(e).direction==="rtl"}const gd={convertOffsetParentRelativeRectToViewportRelativeRect:od,getDocumentElement:we,getClippingRect:dd,getOffsetParent:ya,getElementRects:pd,getClientRects:ad,getDimensions:ud,getScale:rt,isElement:ge,isRTL:hd};function wa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function md(e,t){let r=null,n;const o=we(e);function a(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),a();const d=e.getBoundingClientRect(),{left:f,top:h,width:v,height:g}=d;if(c||t(),!v||!g)return;const y=Vt(h),p=Vt(o.clientWidth-(f+v)),m=Vt(o.clientHeight-(h+g)),b=Vt(f),x={rootMargin:-y+"px "+-p+"px "+-m+"px "+-b+"px",threshold:le(0,Me(1,u))||1};let N=!0;function S(C){const T=C[0].intersectionRatio;if(T!==u){if(!N)return i();T?i(!1,T):n=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!wa(d,e.getBoundingClientRect())&&i(),N=!1}try{r=new IntersectionObserver(S,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(S,x)}r.observe(e)}return i(!0),a}function vd(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=Xr(e),f=o||a?[...d?pt(d):[],...pt(t)]:[];f.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),a&&b.addEventListener("resize",r)});const h=d&&c?md(d,r):null;let v=-1,g=null;i&&(g=new ResizeObserver(b=>{let[w]=b;w&&w.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),r()}),d&&!u&&g.observe(d),g.observe(t));let y,p=u?We(e):null;u&&m();function m(){const b=We(e);p&&!wa(p,b)&&r(),p=b,y=requestAnimationFrame(m)}return r(),()=>{var b;f.forEach(w=>{o&&w.removeEventListener("scroll",r),a&&w.removeEventListener("resize",r)}),h==null||h(),(b=g)==null||b.disconnect(),g=null,u&&cancelAnimationFrame(y)}}const bd=Xc,yd=Zc,wd=Yc,xd=Jc,Nd=Rc,xa=Kc,Cd=Qc,Sd=(e,t,r)=>{const n=new Map,o={platform:gd,...r},a={...o.platform,_c:n};return Gc(e,t,{...o,platform:a})};var Yt=typeof document<"u"?K.useLayoutEffect:K.useEffect;function Rt(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 r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Rt(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!Rt(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Na(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ca(e,t){const r=Na(e);return Math.round(t*r)/r}function Jr(e){const t=l.useRef(e);return Yt(()=>{t.current=e}),t}function Ed(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,h]=l.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,g]=l.useState(n);Rt(v,n)||g(n);const[y,p]=l.useState(null),[m,b]=l.useState(null),w=l.useCallback(P=>{P!==C.current&&(C.current=P,p(P))},[]),x=l.useCallback(P=>{P!==T.current&&(T.current=P,b(P))},[]),N=a||y,S=i||m,C=l.useRef(null),T=l.useRef(null),W=l.useRef(f),L=u!=null,$=Jr(u),j=Jr(o),z=Jr(d),_=l.useCallback(()=>{if(!C.current||!T.current)return;const P={placement:t,strategy:r,middleware:v};j.current&&(P.platform=j.current),Sd(C.current,T.current,P).then(I=>{const q={...I,isPositioned:z.current!==!1};A.current&&!Rt(W.current,q)&&(W.current=q,ur.flushSync(()=>{h(q)}))})},[v,t,r,j,z]);Yt(()=>{d===!1&&W.current.isPositioned&&(W.current.isPositioned=!1,h(P=>({...P,isPositioned:!1})))},[d]);const A=l.useRef(!1);Yt(()=>(A.current=!0,()=>{A.current=!1}),[]),Yt(()=>{if(N&&(C.current=N),S&&(T.current=S),N&&S){if($.current)return $.current(N,S,_);_()}},[N,S,_,$,L]);const V=l.useMemo(()=>({reference:C,floating:T,setReference:w,setFloating:x}),[w,x]),k=l.useMemo(()=>({reference:N,floating:S}),[N,S]),U=l.useMemo(()=>{const P={position:r,left:0,top:0};if(!k.floating)return P;const I=Ca(k.floating,f.x),q=Ca(k.floating,f.y);return c?{...P,transform:"translate("+I+"px, "+q+"px)",...Na(k.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:I,top:q}},[r,c,k.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:_,refs:V,elements:k,floatingStyles:U}),[f,_,V,k,U])}const Td=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?xa({element:n.current,padding:o}).fn(r):{}:n?xa({element:n,padding:o}).fn(r):{}}}},Pd=(e,t)=>({...bd(e),options:[e,t]}),Ad=(e,t)=>({...yd(e),options:[e,t]}),Od=(e,t)=>({...Cd(e),options:[e,t]}),Md=(e,t)=>({...wd(e),options:[e,t]}),kd=(e,t)=>({...xd(e),options:[e,t]}),Dd=(e,t)=>({...Nd(e),options:[e,t]}),_d=(e,t)=>({...Td(e),options:[e,t]});var Id="Arrow",Sa=l.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return s.jsx(X.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});Sa.displayName=Id;var Ld=Sa;function Fd(e){const[t,r]=l.useState(void 0);return Ae(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,c;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;r({width:i,height:c})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var en="Popper",[Ea,Ta]=ct(en),[$d,Pa]=Ea(en),Aa=e=>{const{__scopePopper:t,children:r}=e,[n,o]=l.useState(null);return s.jsx($d,{scope:t,anchor:n,onAnchorChange:o,children:r})};Aa.displayName=en;var Oa="PopperAnchor",Ma=l.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=Pa(Oa,r),i=l.useRef(null),c=ne(t,i);return l.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:s.jsx(X.div,{...o,ref:c})});Ma.displayName=Oa;var tn="PopperContent",[zd,Bd]=Ea(tn),ka=l.forwardRef((e,t)=>{var Ce,vt,ir,bt,lr,it;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:g="optimized",onPlaced:y,...p}=e,m=Pa(tn,r),[b,w]=l.useState(null),x=ne(t,He=>w(He)),[N,S]=l.useState(null),C=Fd(N),T=(C==null?void 0:C.width)??0,W=(C==null?void 0:C.height)??0,L=n+(a!=="center"?"-"+a:""),$=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(d)?d:[d],z=j.length>0,_={padding:$,boundary:j.filter(Vd),altBoundary:z},{refs:A,floatingStyles:V,placement:k,isPositioned:U,middlewareData:P}=Ed({strategy:"fixed",placement:L,whileElementsMounted:(...He)=>vd(...He,{animationFrame:g==="always"}),elements:{reference:m.anchor},middleware:[Pd({mainAxis:o+W,alignmentAxis:i}),u&&Ad({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Od():void 0,..._}),u&&Md({..._}),kd({..._,apply:({elements:He,rects:F,availableWidth:B,availableHeight:J})=>{const{width:se,height:ie}=F.reference,G=He.floating.style;G.setProperty("--radix-popper-available-width",`${B}px`),G.setProperty("--radix-popper-available-height",`${J}px`),G.setProperty("--radix-popper-anchor-width",`${se}px`),G.setProperty("--radix-popper-anchor-height",`${ie}px`)}}),N&&_d({element:N,padding:c}),Hd({arrowWidth:T,arrowHeight:W}),v&&Dd({strategy:"referenceHidden",..._})]}),[I,q]=Ia(k),Q=fe(y);Ae(()=>{U&&(Q==null||Q())},[U,Q]);const ae=(Ce=P.arrow)==null?void 0:Ce.x,te=(vt=P.arrow)==null?void 0:vt.y,oe=((ir=P.arrow)==null?void 0:ir.centerOffset)!==0,[de,_e]=l.useState();return Ae(()=>{b&&_e(window.getComputedStyle(b).zIndex)},[b]),s.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(bt=P.transformOrigin)==null?void 0:bt.x,(lr=P.transformOrigin)==null?void 0:lr.y].join(" "),...((it=P.hide)==null?void 0:it.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(zd,{scope:r,placedSide:I,onArrowChange:S,arrowX:ae,arrowY:te,shouldHideArrow:oe,children:s.jsx(X.div,{"data-side":I,"data-align":q,...p,ref:x,style:{...p.style,animation:U?void 0:"none"}})})})});ka.displayName=tn;var Da="PopperArrow",Wd={top:"bottom",right:"left",bottom:"top",left:"right"},_a=l.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=Bd(Da,n),i=Wd[a.placedSide];return s.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:s.jsx(Ld,{...o,ref:r,style:{...o.style,display:"block"}})})});_a.displayName=Da;function Vd(e){return e!==null}var Hd=e=>({name:"transformOrigin",options:e,fn(t){var m,b,w;const{placement:r,rects:n,middlewareData:o}=t,i=((m=o.arrow)==null?void 0:m.centerOffset)!==0,c=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,f]=Ia(r),h={start:"0%",center:"50%",end:"100%"}[f],v=(((b=o.arrow)==null?void 0:b.x)??0)+c/2,g=(((w=o.arrow)==null?void 0:w.y)??0)+u/2;let y="",p="";return d==="bottom"?(y=i?h:`${v}px`,p=`${-u}px`):d==="top"?(y=i?h:`${v}px`,p=`${n.floating.height+u}px`):d==="right"?(y=`${-u}px`,p=i?h:`${g}px`):d==="left"&&(y=`${n.floating.width+u}px`,p=i?h:`${g}px`),{data:{x:y,y:p}}}});function Ia(e){const[t,r="center"]=e.split("-");return[t,r]}var jd=Aa,Ud=Ma,Gd=ka,Kd=_a,Yd="VisuallyHidden",qt=l.forwardRef((e,t)=>s.jsx(X.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));qt.displayName=Yd;var Rd=qt,[Xt,Af]=ct("Tooltip",[Ta]),Zt=Ta(),La="TooltipProvider",qd=700,rn="tooltip.open",[Xd,nn]=Xt(La),Fa=e=>{const{__scopeTooltip:t,delayDuration:r=qd,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,[i,c]=l.useState(!0),u=l.useRef(!1),d=l.useRef(0);return l.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),s.jsx(Xd,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(d.current),c(!1)},[]),onClose:l.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>c(!0),n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:l.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:a})};Fa.displayName=La;var Qt="Tooltip",[Zd,ht]=Xt(Qt),$a=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o=!1,onOpenChange:a,disableHoverableContent:i,delayDuration:c}=e,u=nn(Qt,e.__scopeTooltip),d=Zt(t),[f,h]=l.useState(null),v=xt(),g=l.useRef(0),y=i??u.disableHoverableContent,p=c??u.delayDuration,m=l.useRef(!1),[b=!1,w]=yr({prop:n,defaultProp:o,onChange:T=>{T?(u.onOpen(),document.dispatchEvent(new CustomEvent(rn))):u.onClose(),a==null||a(T)}}),x=l.useMemo(()=>b?m.current?"delayed-open":"instant-open":"closed",[b]),N=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,m.current=!1,w(!0)},[w]),S=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w(!1)},[w]),C=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{m.current=!0,w(!0),g.current=0},p)},[p,w]);return l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),s.jsx(jd,{...d,children:s.jsx(Zd,{scope:t,contentId:v,open:b,stateAttribute:x,trigger:f,onTriggerChange:h,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayed?C():N()},[u.isOpenDelayed,C,N]),onTriggerLeave:l.useCallback(()=>{y?S():(window.clearTimeout(g.current),g.current=0)},[S,y]),onOpen:N,onClose:S,disableHoverableContent:y,children:r})})};$a.displayName=Qt;var on="TooltipTrigger",za=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=ht(on,r),a=nn(on,r),i=Zt(r),c=l.useRef(null),u=ne(t,c,o.onTriggerChange),d=l.useRef(!1),f=l.useRef(!1),h=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(Ud,{asChild:!0,...i,children:s.jsx(X.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:u,onPointerMove:R(e.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:R(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:R(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:R(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:R(e.onBlur,o.onClose),onClick:R(e.onClick,o.onClose)})})});za.displayName=on;var an="TooltipPortal",[Qd,Jd]=Xt(an,{forceMount:void 0}),Ba=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=ht(an,t);return s.jsx(Qd,{scope:t,forceMount:r,children:s.jsx(ze,{present:r||a.open,children:s.jsx(Ct,{asChild:!0,container:o,children:n})})})};Ba.displayName=an;var nt="TooltipContent",Wa=l.forwardRef((e,t)=>{const r=Jd(nt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,i=ht(nt,e.__scopeTooltip);return s.jsx(ze,{present:n||i.open,children:i.disableHoverableContent?s.jsx(Va,{side:o,...a,ref:t}):s.jsx(eu,{side:o,...a,ref:t})})}),eu=l.forwardRef((e,t)=>{const r=ht(nt,e.__scopeTooltip),n=nn(nt,e.__scopeTooltip),o=l.useRef(null),a=ne(t,o),[i,c]=l.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:h}=n,v=l.useCallback(()=>{c(null),h(!1)},[h]),g=l.useCallback((y,p)=>{const m=y.currentTarget,b={x:y.clientX,y:y.clientY},w=ou(b,m.getBoundingClientRect()),x=au(b,w),N=su(p.getBoundingClientRect()),S=lu([...x,...N]);c(S),h(!0)},[h]);return l.useEffect(()=>()=>v(),[v]),l.useEffect(()=>{if(u&&f){const y=m=>g(m,f),p=m=>g(m,u);return u.addEventListener("pointerleave",y),f.addEventListener("pointerleave",p),()=>{u.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",p)}}},[u,f,g,v]),l.useEffect(()=>{if(i){const y=p=>{const m=p.target,b={x:p.clientX,y:p.clientY},w=(u==null?void 0:u.contains(m))||(f==null?void 0:f.contains(m)),x=!iu(b,i);w?v():x&&(v(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,f,i,d,v]),s.jsx(Va,{...e,ref:a})}),[tu,ru]=Xt(Qt,{isInside:!1}),Va=l.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...c}=e,u=ht(nt,r),d=Zt(r),{onClose:f}=u;return l.useEffect(()=>(document.addEventListener(rn,f),()=>document.removeEventListener(rn,f)),[f]),l.useEffect(()=>{if(u.trigger){const h=v=>{const g=v.target;g!=null&&g.contains(u.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,f]),s.jsx(Nt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:s.jsxs(Gd,{"data-state":u.stateAttribute,...d,...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:[s.jsx(co,{children:n}),s.jsx(tu,{scope:r,isInside:!0,children:s.jsx(Rd,{id:u.contentId,role:"tooltip",children:o||n})})]})})});Wa.displayName=nt;var Ha="TooltipArrow",nu=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Zt(r);return ru(Ha,r).isInside?null:s.jsx(Kd,{...o,...n,ref:t})});nu.displayName=Ha;function ou(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function au(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function su(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function iu(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const c=t[a].x,u=t[a].y,d=t[i].x,f=t[i].y;u>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(o=!o)}return o}function lu(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),cu(t)}function cu(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var du=Fa,uu=$a,fu=za,pu=Ba,ja=Wa;const ot=du,at=uu,st=fu,Ve=l.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(pu,{children:s.jsx(ja,{ref:n,sideOffset:t,className:D("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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",e),...r})}));Ve.displayName=ja.displayName;const Jt=l.forwardRef(({className:e,type:t,mask:r,onChange:n,placeholder:o,...a},i)=>{const[c,u]=l.useState(!1),d=l.useRef(null),h=o||(r==="phone"?"(999) 999-9999":r==="postal-code-ca"?"A9A 9A9":r==="zip-code-us"?"99999":""),v=()=>r==="phone"?"Only enter numbers. Formatting will be added automatically.":r==="postal-code-ca"?"Enter letters and numbers only. Spacing will be applied automatically.":r==="zip-code-us"?"Only enter numbers. Formatting will be added automatically.":"",g=()=>{u(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(!1)},3e3)};l.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const y=p=>{if(r){const m=p.target.value;let b=m;if(m.length>0){const w=m[m.length-1];/[^a-zA-Z0-9]/.test(w)&&(console.log("Non-alphanumeric detected:",w),g())}if(r==="phone"){const w=m.replace(/\D/g,"");w.length<=3?b=w:w.length<=6?b=`(${w.slice(0,3)}) ${w.slice(3)}`:b=`(${w.slice(0,3)}) ${w.slice(3,6)}-${w.slice(6,10)}`}else if(r==="postal-code-ca"){const w=m.replace(/[^a-zA-Z0-9]/g,"").toUpperCase();let x="";for(let N=0;N<Math.min(w.length,6);N++){const S=w[N];N===0||N===2||N===4?/[A-Z]/.test(S)&&(x+=S):(N===1||N===3||N===5)&&/[0-9]/.test(S)&&(x+=S)}x.length<=3?b=x:b=`${x.slice(0,3)} ${x.slice(3,6)}`}else if(r==="zip-code-us"){const w=m.replace(/\D/g,"");w.length<=5?b=w:b=`${w.slice(0,5)}-${w.slice(5,9)}`}p.target.value=b}n==null||n(p)};return s.jsx(ot,{children:s.jsxs(at,{open:c&&!!r,children:[s.jsx(st,{asChild:!0,children:s.jsx("input",{type:t,className:D("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),onChange:y,placeholder:h,ref:i,...a})}),s.jsx(Ve,{side:"top",className:"bg-sidebar text-sidebar-foreground",children:v()})]})})});Jt.displayName="Input";var hu="Separator",Ua="horizontal",gu=["horizontal","vertical"],Ga=l.forwardRef((e,t)=>{const{decorative:r,orientation:n=Ua,...o}=e,a=mu(n)?n:Ua,c=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return s.jsx(X.div,{"data-orientation":a,...c,...o,ref:t})});Ga.displayName=hu;function mu(e){return gu.includes(e)}var Ka=Ga;const sn=l.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},o)=>s.jsx(Ka,{ref:o,decorative:r,orientation:t,className:D("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));sn.displayName=Ka.displayName;const Ya=Ir,vu=ea,bu=$t,Ra=ta,ln=l.forwardRef(({className:e,...t},r)=>s.jsx(_t,{className:D("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));ln.displayName=_t.displayName;const yu=dt("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),cn=l.forwardRef(({side:e="right",className:t,children:r,...n},o)=>s.jsxs(Ra,{children:[s.jsx(ln,{}),s.jsxs(It,{ref:o,className:D(yu({side:e}),t),...n,children:[s.jsxs($t,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(fr,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));cn.displayName=It.displayName;const qa=({className:e,...t})=>s.jsx("div",{className:D("flex flex-col space-y-2 text-center sm:text-left",e),...t});qa.displayName="SheetHeader";const Xa=({className:e,...t})=>s.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xa.displayName="SheetFooter";const Za=l.forwardRef(({className:e,...t},r)=>s.jsx(Lt,{ref:r,className:D("text-lg font-semibold text-foreground",e),...t}));Za.displayName=Lt.displayName;const Qa=l.forwardRef(({className:e,...t},r)=>s.jsx(Ft,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));Qa.displayName=Ft.displayName;function wu({onClick:e,publicName:t,applicationName:r,partnerId:n}){const o=`https://api.randmar.io/v4/Partner/${n}/Account/Logo?height=72&width=72`,[a,i]=K.useState(!1),c=()=>{i(!0)};return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-muted "+(e!==void 0?"cursor-pointer":""),children:a?s.jsx(ee,{asChild:!0,size:"icon",onClick:e,children:s.jsx(Ni,{className:"h-5 w-5 text-muted-foreground !bg-sidebar"})}):s.jsx(ee,{asChild:!0,size:"icon",onClick:e,children:s.jsx("img",{src:o,alt:"Partner logo",className:"h-9 w-9 object-cover !bg-sidebar",onError:c})})}),s.jsxs("div",{className:"flex flex-1 flex-col",children:[s.jsx("span",{className:"text-sm font-medium",children:t||"Partner"}),s.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}var xu="Label",Ja=l.forwardRef((e,t)=>s.jsx(X.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Ja.displayName=xu;var Nu=Ja;function Cu({className:e,...t}){return s.jsx(Nu,{"data-slot":"label",className:D("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const dn=1024;function es(){const[e,t]=l.useState(void 0);return l.useEffect(()=>{const r=window.matchMedia(`(max-width: ${dn-1}px)`),n=()=>{t(window.innerWidth<dn)};return r.addEventListener("change",n),t(window.innerWidth<dn),()=>r.removeEventListener("change",n)},[]),!!e}function Y({className:e,...t}){return s.jsx("div",{className:D("animate-pulse rounded-md bg-primary/20",e),...t})}const Su="sidebar:state",Eu=60*60*24*7,Tu="16rem",Pu="18rem",Au="3rem",Ou="b",ts=l.createContext(null);function gt(){const e=l.useContext(ts);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const un=l.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:o,children:a,...i},c)=>{const u=es(),[d,f]=l.useState(!1),[h,v]=l.useState(e),g=t??h,y=l.useCallback(w=>{const x=typeof w=="function"?w(g):w;r?r(x):v(x),document.cookie=`${Su}=${x}; path=/; max-age=${Eu}`},[r,g]),p=l.useCallback(()=>u?f(w=>!w):y(w=>!w),[u,y,f]);l.useEffect(()=>{const w=x=>{x.key===Ou&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),p())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[p]);const m=g?"expanded":"collapsed",b=l.useMemo(()=>({state:m,open:g,setOpen:y,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:p}),[m,g,y,u,d,f,p]);return s.jsx(ts.Provider,{value:b,children:s.jsx(ot,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":Tu,"--sidebar-width-icon":Au,...o},className:D("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",n),ref:c,...i,children:a})})})});un.displayName="SidebarProvider";const fn=l.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:o,...a},i)=>{const{isMobile:c,state:u,openMobile:d,setOpenMobile:f}=gt();return r==="none"?s.jsx("div",{className:D("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),ref:i,...a,children:o}):c?s.jsx(Ya,{open:d,onOpenChange:f,...a,children:s.jsx(cn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Pu},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:o})})}):s.jsxs("div",{ref:i,className:"group peer hidden md:block text-sidebar-foreground","data-state":u,"data-collapsible":u==="collapsed"?r:"","data-variant":t,"data-side":e,children:[s.jsx("div",{className:D("duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),s.jsx("div",{className:D("duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...a,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:o})})]})});fn.displayName="Sidebar";const pn=l.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:o}=gt();return s.jsxs(ee,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:D("h-7 w-7 text-sidebar-foreground",e),onClick:a=>{t==null||t(a),o()},...r,children:[s.jsx(yi,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});pn.displayName="SidebarTrigger";const rs=l.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=gt();return s.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:D("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});rs.displayName="SidebarRail";const ns=l.forwardRef(({className:e,...t},r)=>s.jsx("main",{ref:r,className:D("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",e),...t}));ns.displayName="SidebarInset";const os=l.forwardRef(({className:e,...t},r)=>s.jsx(Jt,{ref:r,"data-sidebar":"input",className:D("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));os.displayName="SidebarInput";const hn=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"header",className:D("flex flex-col gap-2 p-2",e),...t}));hn.displayName="SidebarHeader";const gn=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"footer",className:D("flex flex-col gap-2 p-2",e),...t}));gn.displayName="SidebarFooter";const as=l.forwardRef(({className:e,...t},r)=>s.jsx(sn,{ref:r,"data-sidebar":"separator",className:D("mx-2 w-auto bg-sidebar-border",e),...t}));as.displayName="SidebarSeparator";const mn=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"content",className:D("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));mn.displayName="SidebarContent";const ss=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"group",className:D("relative flex w-full min-w-0 flex-col p-2",e),...t}));ss.displayName="SidebarGroup";const is=l.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const o=t?pe:"div";return s.jsx(o,{ref:n,"data-sidebar":"group-label",className:D("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});is.displayName="SidebarGroupLabel";const ls=l.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const o=t?pe:"button";return s.jsx(o,{ref:n,"data-sidebar":"group-action",className:D("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...r})});ls.displayName="SidebarGroupAction";const cs=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"group-content",className:D("w-full text-sm",e),...t}));cs.displayName="SidebarGroupContent";const vn=l.forwardRef(({className:e,...t},r)=>s.jsx("ul",{ref:r,"data-sidebar":"menu",className:D("flex w-full min-w-0 flex-col gap-1",e),...t}));vn.displayName="SidebarMenu";const bn=l.forwardRef(({className:e,...t},r)=>s.jsx("li",{ref:r,"data-sidebar":"menu-item",className:D("group/menu-item relative",e),...t}));bn.displayName="SidebarMenuItem";const Mu=dt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),yn=l.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:o,className:a,...i},c)=>{const u=e?pe:"button",{isMobile:d,state:f}=gt(),h=s.jsx(u,{ref:c,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:D(Mu({variant:r,size:n}),a),...i});return o?(typeof o=="string"&&(o={children:o}),s.jsxs(at,{children:[s.jsx(st,{asChild:!0,children:h}),s.jsx(Ve,{side:"right",align:"center",hidden:f!=="collapsed"||d,...o})]})):h});yn.displayName="SidebarMenuButton";const ds=l.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},o)=>{const a=t?pe:"button";return s.jsx(a,{ref:o,"data-sidebar":"menu-action",className:D("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});ds.displayName="SidebarMenuAction";const us=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:D("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));us.displayName="SidebarMenuBadge";const fs=l.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const o=l.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:D("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&s.jsx(Y,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(Y,{className:"h-4 flex-1 max-w-(--skeleton-width)","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});fs.displayName="SidebarMenuSkeleton";const ps=l.forwardRef(({className:e,...t},r)=>s.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:D("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));ps.displayName="SidebarMenuSub";const hs=l.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));hs.displayName="SidebarMenuSubItem";const gs=l.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...o},a)=>{const i=e?pe:"a";return s.jsx(i,{ref:a,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:D("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...o})});gs.displayName="SidebarMenuSubButton";function ku(e){const t=e+"CollectionProvider",[r,n]=ct(t),[o,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:y,children:p}=g,m=K.useRef(null),b=K.useRef(new Map).current;return s.jsx(o,{scope:y,itemMap:b,collectionRef:m,children:p})};i.displayName=t;const c=e+"CollectionSlot",u=K.forwardRef((g,y)=>{const{scope:p,children:m}=g,b=a(c,p),w=ne(y,b.collectionRef);return s.jsx(pe,{ref:w,children:m})});u.displayName=c;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=K.forwardRef((g,y)=>{const{scope:p,children:m,...b}=g,w=K.useRef(null),x=ne(y,w),N=a(d,p);return K.useEffect(()=>(N.itemMap.set(w,{ref:w,...b}),()=>void N.itemMap.delete(w))),s.jsx(pe,{[f]:"",ref:x,children:m})});h.displayName=d;function v(g){const y=a(e+"CollectionConsumer",g);return K.useCallback(()=>{const m=y.collectionRef.current;if(!m)return[];const b=Array.from(m.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((N,S)=>b.indexOf(N.ref.current)-b.indexOf(S.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},v,n]}var wn="ToastProvider",[xn,Du,_u]=ku("Toast"),[ms,Of]=ct("Toast",[_u]),[Iu,er]=ms(wn),vs=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:i}=e,[c,u]=l.useState(null),[d,f]=l.useState(0),h=l.useRef(!1),v=l.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${wn}\`. Expected non-empty \`string\`.`),s.jsx(xn.Provider,{scope:t,children:s.jsx(Iu,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:a,toastCount:d,viewport:c,onViewportChange:u,onToastAdd:l.useCallback(()=>f(g=>g+1),[]),onToastRemove:l.useCallback(()=>f(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:v,children:i})})};vs.displayName=wn;var bs="ToastViewport",Lu=["F8"],Nn="toast.viewportPause",Cn="toast.viewportResume",ys=l.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=Lu,label:o="Notifications ({hotkey})",...a}=e,i=er(bs,r),c=Du(r),u=l.useRef(null),d=l.useRef(null),f=l.useRef(null),h=l.useRef(null),v=ne(t,h,i.onViewportChange),g=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=i.toastCount>0;l.useEffect(()=>{const m=b=>{var x;n.length!==0&&n.every(N=>b[N]||b.code===N)&&((x=h.current)==null||x.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[n]),l.useEffect(()=>{const m=u.current,b=h.current;if(y&&m&&b){const w=()=>{if(!i.isClosePausedRef.current){const C=new CustomEvent(Nn);b.dispatchEvent(C),i.isClosePausedRef.current=!0}},x=()=>{if(i.isClosePausedRef.current){const C=new CustomEvent(Cn);b.dispatchEvent(C),i.isClosePausedRef.current=!1}},N=C=>{!m.contains(C.relatedTarget)&&x()},S=()=>{m.contains(document.activeElement)||x()};return m.addEventListener("focusin",w),m.addEventListener("focusout",N),m.addEventListener("pointermove",w),m.addEventListener("pointerleave",S),window.addEventListener("blur",w),window.addEventListener("focus",x),()=>{m.removeEventListener("focusin",w),m.removeEventListener("focusout",N),m.removeEventListener("pointermove",w),m.removeEventListener("pointerleave",S),window.removeEventListener("blur",w),window.removeEventListener("focus",x)}}},[y,i.isClosePausedRef]);const p=l.useCallback(({tabbingDirection:m})=>{const w=c().map(x=>{const N=x.ref.current,S=[N,...Ru(N)];return m==="forwards"?S:S.reverse()});return(m==="forwards"?w.reverse():w).flat()},[c]);return l.useEffect(()=>{const m=h.current;if(m){const b=w=>{var S,C,T;const x=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!x){const W=document.activeElement,L=w.shiftKey;if(w.target===m&&L){(S=d.current)==null||S.focus();return}const z=p({tabbingDirection:L?"backwards":"forwards"}),_=z.findIndex(A=>A===W);Tn(z.slice(_+1))?w.preventDefault():L?(C=d.current)==null||C.focus():(T=f.current)==null||T.focus()}};return m.addEventListener("keydown",b),()=>m.removeEventListener("keydown",b)}},[c,p]),s.jsxs(Ml,{ref:u,role:"region","aria-label":o.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&s.jsx(Sn,{ref:d,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"forwards"});Tn(m)}}),s.jsx(xn.Slot,{scope:r,children:s.jsx(X.ol,{tabIndex:-1,...a,ref:v})}),y&&s.jsx(Sn,{ref:f,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"backwards"});Tn(m)}})]})});ys.displayName=bs;var ws="ToastFocusProxy",Sn=l.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,a=er(ws,r);return s.jsx(qt,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var d;const c=i.relatedTarget;!((d=a.viewport)!=null&&d.contains(c))&&n()}})});Sn.displayName=ws;var tr="Toast",Fu="toast.swipeStart",$u="toast.swipeMove",zu="toast.swipeCancel",Bu="toast.swipeEnd",xs=l.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:o,onOpenChange:a,...i}=e,[c=!0,u]=yr({prop:n,defaultProp:o,onChange:a});return s.jsx(ze,{present:r||c,children:s.jsx(Hu,{open:c,...i,ref:t,onClose:()=>u(!1),onPause:fe(e.onPause),onResume:fe(e.onResume),onSwipeStart:R(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:R(e.onSwipeMove,d=>{const{x:f,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:R(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:R(e.onSwipeEnd,d=>{const{x:f,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),u(!1)})})})});xs.displayName=tr;var[Wu,Vu]=ms(tr,{onClose(){}}),Hu=l.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:o,open:a,onClose:i,onEscapeKeyDown:c,onPause:u,onResume:d,onSwipeStart:f,onSwipeMove:h,onSwipeCancel:v,onSwipeEnd:g,...y}=e,p=er(tr,r),[m,b]=l.useState(null),w=ne(t,A=>b(A)),x=l.useRef(null),N=l.useRef(null),S=o||p.duration,C=l.useRef(0),T=l.useRef(S),W=l.useRef(0),{onToastAdd:L,onToastRemove:$}=p,j=fe(()=>{var V;(m==null?void 0:m.contains(document.activeElement))&&((V=p.viewport)==null||V.focus()),i()}),z=l.useCallback(A=>{!A||A===1/0||(window.clearTimeout(W.current),C.current=new Date().getTime(),W.current=window.setTimeout(j,A))},[j]);l.useEffect(()=>{const A=p.viewport;if(A){const V=()=>{z(T.current),d==null||d()},k=()=>{const U=new Date().getTime()-C.current;T.current=T.current-U,window.clearTimeout(W.current),u==null||u()};return A.addEventListener(Nn,k),A.addEventListener(Cn,V),()=>{A.removeEventListener(Nn,k),A.removeEventListener(Cn,V)}}},[p.viewport,S,u,d,z]),l.useEffect(()=>{a&&!p.isClosePausedRef.current&&z(S)},[a,S,p.isClosePausedRef,z]),l.useEffect(()=>(L(),()=>$()),[L,$]);const _=l.useMemo(()=>m?As(m):null,[m]);return p.viewport?s.jsxs(s.Fragment,{children:[_&&s.jsx(ju,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:_}),s.jsx(Wu,{scope:r,onClose:j,children:ur.createPortal(s.jsx(xn.ItemSlot,{scope:r,children:s.jsx(Ol,{asChild:!0,onEscapeKeyDown:R(c,()=>{p.isFocusedToastEscapeKeyDownRef.current||j(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(X.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":p.swipeDirection,...y,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:R(e.onKeyDown,A=>{A.key==="Escape"&&(c==null||c(A.nativeEvent),A.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:R(e.onPointerDown,A=>{A.button===0&&(x.current={x:A.clientX,y:A.clientY})}),onPointerMove:R(e.onPointerMove,A=>{if(!x.current)return;const V=A.clientX-x.current.x,k=A.clientY-x.current.y,U=!!N.current,P=["left","right"].includes(p.swipeDirection),I=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,q=P?I(0,V):0,Q=P?0:I(0,k),ae=A.pointerType==="touch"?10:2,te={x:q,y:Q},oe={originalEvent:A,delta:te};U?(N.current=te,rr($u,h,oe,{discrete:!1})):Os(te,p.swipeDirection,ae)?(N.current=te,rr(Fu,f,oe,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(V)>ae||Math.abs(k)>ae)&&(x.current=null)}),onPointerUp:R(e.onPointerUp,A=>{const V=N.current,k=A.target;if(k.hasPointerCapture(A.pointerId)&&k.releasePointerCapture(A.pointerId),N.current=null,x.current=null,V){const U=A.currentTarget,P={originalEvent:A,delta:V};Os(V,p.swipeDirection,p.swipeThreshold)?rr(Bu,g,P,{discrete:!0}):rr(zu,v,P,{discrete:!0}),U.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),ju=e=>{const{__scopeToast:t,children:r,...n}=e,o=er(tr,t),[a,i]=l.useState(!1),[c,u]=l.useState(!1);return Ku(()=>i(!0)),l.useEffect(()=>{const d=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(d)},[]),c?null:s.jsx(Ct,{asChild:!0,children:s.jsx(qt,{...n,children:a&&s.jsxs(s.Fragment,{children:[o.label," ",r]})})})},Uu="ToastTitle",Ns=l.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(X.div,{...n,ref:t})});Ns.displayName=Uu;var Gu="ToastDescription",Cs=l.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(X.div,{...n,ref:t})});Cs.displayName=Gu;var Ss="ToastAction",Es=l.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?s.jsx(Ps,{altText:r,asChild:!0,children:s.jsx(En,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ss}\`. Expected non-empty \`string\`.`),null)});Es.displayName=Ss;var Ts="ToastClose",En=l.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,o=Vu(Ts,r);return s.jsx(Ps,{asChild:!0,children:s.jsx(X.button,{type:"button",...n,ref:t,onClick:R(e.onClick,o.onClose)})})});En.displayName=Ts;var Ps=l.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...o}=e;return s.jsx(X.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function As(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),Yu(n)){const o=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!o)if(a){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...As(n))}}),t}function rr(e,t,r,{discrete:n}){const o=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?uo(o,a):o.dispatchEvent(a)}var Os=(e,t,r=0)=>{const n=Math.abs(e.x),o=Math.abs(e.y),a=n>o;return t==="left"||t==="right"?a&&n>r:!a&&o>r};function Ku(e=()=>{}){const t=fe(e);Ae(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function Yu(e){return e.nodeType===e.ELEMENT_NODE}function Ru(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Tn(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var qu=vs,Ms=ys,ks=xs,Ds=Ns,_s=Cs,Is=Es,Ls=En;const Fs=qu,Pn=l.forwardRef(({className:e,...t},r)=>s.jsx(Ms,{ref:r,className:D("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Pn.displayName=Ms.displayName;const Xu=dt("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-600 bg-green-600 text-white",warning:"border-yellow-500 bg-yellow-500 text-white",info:"border-blue-500 bg-blue-500 text-white",secondary:"border-secondary bg-secondary text-secondary-foreground",outline:"border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),An=l.forwardRef(({className:e,variant:t,...r},n)=>s.jsx(ks,{ref:n,className:D(Xu({variant:t}),e),...r}));An.displayName=ks.displayName;const $s=l.forwardRef(({className:e,...t},r)=>s.jsx(Is,{ref:r,className:D("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",e),...t}));$s.displayName=Is.displayName;const On=l.forwardRef(({className:e,...t},r)=>s.jsx(Ls,{ref:r,className:D("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(fr,{className:"h-4 w-4"})}));On.displayName=Ls.displayName;const Mn=l.forwardRef(({className:e,...t},r)=>s.jsx(Ds,{ref:r,className:D("text-sm font-semibold [&+div]:text-xs",e),...t}));Mn.displayName=Ds.displayName;const kn=l.forwardRef(({className:e,...t},r)=>s.jsx(_s,{ref:r,className:D("text-sm opacity-90",e),...t}));kn.displayName=_s.displayName;const Zu=1,Qu=1e6;let Dn=0;function Ju(){return Dn=(Dn+1)%Number.MAX_SAFE_INTEGER,Dn.toString()}const _n=new Map,zs=e=>{if(_n.has(e))return;const t=setTimeout(()=>{_n.delete(e),mt({type:"REMOVE_TOAST",toastId:e})},Qu);_n.set(e,t)},ef=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Zu)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?zs(r):e.toasts.forEach(n=>zs(n.id)),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return{...e,toasts:t.toastId?e.toasts.filter(r=>r.id!==t.toastId):[]}}},nr=[];let or={toasts:[]};function mt(e){or=ef(or,e),nr.forEach(t=>t(or))}function Bs({...e}){const t=Ju(),r=o=>mt({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>mt({type:"DISMISS_TOAST",toastId:t});return mt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}function In(){const[e,t]=l.useState(or);return l.useEffect(()=>(nr.push(t),()=>{const r=nr.indexOf(t);r>-1&&nr.splice(r,1)}),[]),{...e,toast:Bs,dismiss:r=>mt({type:"DISMISS_TOAST",toastId:r})}}function Ws(){const{toasts:e}=In();return s.jsxs(Fs,{children:[e.map(function({id:t,title:r,description:n,action:o,...a}){return s.jsxs(An,{...a,children:[s.jsxs("div",{className:"grid gap-1",children:[r&&s.jsx(Mn,{children:r}),n&&s.jsx(kn,{children:n})]}),o,s.jsx(On,{})]},t)}),s.jsx(Pn,{})]})}function Vs({onSignOut:e,handleValidSearch:t,rightMenu:r,searchPlaceholder:n}){const[o,a]=K.useState(""),i=dr.useLocation(),{toast:c}=In();K.useEffect(()=>{const h=new URLSearchParams(i.search).get("q");h&&a(h)},[i.search]);const u=()=>{const f=o.trim();if(!f||f.length<2){c({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}t(f)},d=f=>{f.key==="Enter"&&u()};return s.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[s.jsx(pn,{className:"lg:hidden",children:s.jsx(vi,{className:"h-6 w-6"})}),s.jsx("div",{className:"flex flex-1 items-center gap-4",children:s.jsx("div",{className:"relative w-full max-w-sm",children:s.jsxs("div",{children:[s.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:u,"aria-label":"Search",children:s.jsx(xi,{className:"h-4 w-4 text-muted-foreground"})}),s.jsx(Jt,{placeholder:n??"Search...",className:"w-full pl-8 bg-white text-black",value:o,onChange:f=>a(f.target.value),onKeyDown:d},"topbar-search")]})})}),r||s.jsx(s.Fragment,{}),e&&s.jsx("div",{className:"flex items-center gap-4",children:s.jsxs(ee,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[s.jsx(mi,{className:"h-4 w-4 text-sidebar-foreground"}),s.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})}function Hs({routes:e,footer:t,dashboardTitle:r}){const{appID:n}=dr.useParams(),o=e.filter(a=>a.showInNav);return s.jsxs(fn,{className:"border-r border-sidebar-border",children:[s.jsx(hn,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center justify-center",children:s.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),s.jsx("span",{className:"font-semibold text-lg",children:r})]})}),s.jsx(mn,{className:"py-4 bg-sidebar text-sidebar-foreground",children:s.jsx(vn,{children:o.map(a=>{const i=a.icon,c=`/${a.path.replace(":appID",n)}`;return s.jsx(bn,{children:s.jsx(yn,{asChild:!0,children:s.jsxs(dr.Link,{to:c,className:"transition-colors hover:bg-muted px-6",children:[i&&s.jsx(i,{className:"h-4 w-4"}),s.jsx("span",{children:a.label})]})})},a.key)})})}),s.jsx(gn,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:t})]})}function tf({children:e,rightMenu:t,routes:r,footer:n,handleValidSearch:o,dashboardTitle:a,onSignOut:i,searchPlaceholder:c}){return s.jsx(s.Fragment,{children:s.jsx(un,{children:s.jsxs("div",{className:"flex grow",children:[s.jsx(Hs,{routes:r,footer:n,dashboardTitle:a}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(Vs,{onSignOut:i,rightMenu:t,handleValidSearch:o,searchPlaceholder:c}),s.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),s.jsx(Ws,{})]})]})})})}const rf={sm:100,md:200,lg:300,xl:400};function js({randmarSKU:e,size:t="md",alt:r,secondaryContent:n}){const[o,a]=l.useState(!1),[i,c]=l.useState(!1),[u,d]=l.useState(!1),[f,h]=l.useState(!1),v=`https://api.randmar.io/Product/${e}/Video`;l.useEffect(()=>{(async()=>{try{const x=await(await fetch(v+"/Exists")).json();c(x)}catch(w){console.error("Error checking for video:",w),c(!1)}})()},[e,v]);async function g(){if(i){h(!0);try{const w=await(await fetch(v)).blob(),x=window.URL.createObjectURL(w),N=document.createElement("a");N.href=x,N.download=`${e||"product"}-video.mp4`,document.body.appendChild(N),N.click(),document.body.removeChild(N),window.URL.revokeObjectURL(x)}catch(b){console.error("Error downloading video:",b)}finally{h(!1)}}}function y(){navigator.clipboard.writeText(v),d(!0),setTimeout(()=>{d(!1)},2e3)}function p(){a(!0)}const m=rf[t||"xl"];return s.jsxs(s.Fragment,{children:[s.jsx(zt,{open:o,onOpenChange:a,children:s.jsx(Bt,{className:"max-w-4xl p-0 overflow-hidden",children:n?s.jsxs("div",{className:"flex flex-row",children:[s.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[s.jsx("source",{src:v,type:"video/mp4"}),"Your browser does not support the video tag."]}),s.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):s.jsxs("div",{className:"w-full relative",children:[s.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[s.jsx("source",{src:v,type:"video/mp4"}),"Your browser does not support the video tag."]}),s.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[s.jsx(ot,{children:s.jsxs(at,{children:[s.jsx(st,{asChild:!0,children:s.jsx(ee,{variant:"secondary",size:"icon",onClick:y,children:u?s.jsx(fi,{className:"h-4 w-4"}):s.jsx(pi,{className:"h-4 w-4"})})}),s.jsx(Ve,{children:s.jsx("p",{children:"Copy video link"})})]})}),s.jsx(ot,{children:s.jsxs(at,{children:[s.jsx(st,{asChild:!0,children:s.jsx(ee,{variant:"secondary",size:"icon",onClick:g,disabled:f,children:s.jsx(hi,{className:"h-4 w-4"})})}),s.jsx(Ve,{children:s.jsx("p",{children:"Download video"})})]})})]})]})})}),s.jsxs("div",{className:"relative w-max h-max",children:[s.jsx("img",{alt:r||`Product ${e}`,className:`rounded-md ${i?"cursor-pointer":""}`,onClick:i?p:void 0,src:`https://api.randmar.io/Product/${e}/Image?width=${m*1.5}&height=${m*1.5}`,width:m,height:m}),i&&s.jsx(ot,{children:s.jsxs(at,{children:[s.jsx(st,{asChild:!0,children:s.jsx(ee,{variant:"secondary",size:"icon",className:"absolute top-2 right-2",onClick:p,children:s.jsx(wi,{className:"h-4 w-4"})})}),s.jsx(Ve,{children:s.jsx("p",{children:"Play video"})})]})})]})]})}const ar=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("rounded-md border bg-card text-card-foreground shadow-sm",e),...t}));ar.displayName="Card";const Us=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("flex flex-col space-y-1.5 p-6",e),...t}));Us.displayName="CardHeader";const Gs=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("font-semibold leading-none tracking-tight",e),...t}));Gs.displayName="CardTitle";const Ks=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("text-sm text-muted-foreground",e),...t}));Ks.displayName="CardDescription";const sr=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("p-6 pt-0",e),...t}));sr.displayName="CardContent";const Ys=l.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:D("flex items-center p-6 pt-0",e),...t}));Ys.displayName="CardFooter";const nf=dt("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input hover:bg-accent hover:text-accent-foreground",success:"bg-green-600 text-white hover:bg-green-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",ghost:"bg-background hover:bg-accent hover:text-accent-foreground",randmarRed:"bg-randmar-red text-white hover:bg-randmar-red/80",randmarBlue:"bg-randmar-blue text-white hover:bg-randmar-blue/80",randmarPurple:"bg-randmar-purple text-white hover:bg-randmar-purple/80",randmarGreen:"bg-randmar-green text-black hover:bg-randmar-green/80",randmarBlack:"bg-randmar-black text-white hover:bg-randmar-black/80",randmarYellow:"bg-randmar-yellow text-black hover:bg-randmar-yellow/80"},size:{default:"h-6",sm:"h-5 text-[10px]",lg:"h-7 px-3"}},defaultVariants:{variant:"default",size:"default"}}),Ne=l.forwardRef(({className:e,variant:t,size:r,icon:n,children:o,...a},i)=>s.jsxs("div",{ref:i,className:D(nf({variant:t,size:r}),e),...a,children:[n&&s.jsx("span",{className:"mr-1",children:n}),o]}));Ne.displayName="Badge";function of({product:e,addToCart:t=!1,syncToShopify:r=!1,viewProductAction:n,addToCartAction:o,syncToShopifyAction:a,isActionLoading:i=!1}){var $,j,z,_,A,V,k,U;const[c,u]=K.useState(1),[d,f]=K.useState(null),[h,v]=K.useState(0),g=(($=e==null?void 0:e.Distribution)==null?void 0:$.RegularPrice)||0,y=((j=e==null?void 0:e.Distribution)==null?void 0:j.Price)||0,[p,m]=K.useState(null),[b,w]=K.useState(!1);if(K.useEffect(()=>{const P=async()=>{if(e!=null&&e.ManufacturerId){w(!0);try{const I=await fetch(`https://api.randmar.io/V4/Partner/${e.ManufacturerId}/Account/Logo?width=60&height=40`);if(I.ok){const q=await I.blob();m(URL.createObjectURL(q))}}catch(I){console.error("Failed to load logo:",I)}finally{w(!1)}}};e!=null&&e.ManufacturerId&&P()},[e==null?void 0:e.ManufacturerId]),K.useEffect(()=>{if(!e)return;const P=d?d.Price:y;v(g>0?Math.round((g-P)/g*100):0)},[e,d,y,g]),!e)return s.jsx(ar,{className:"hover:shadow-lg transition-shadow",children:s.jsxs(sr,{className:"p-6",children:[s.jsxs("div",{className:"flex justify-between items-start mb-3",children:[s.jsx(Y,{className:"h-7 w-3/4"}),s.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:s.jsx(Y,{className:"h-10 w-24 rounded-md"})})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[s.jsx(Y,{className:"h-6 w-20 rounded-full"}),s.jsx(Y,{className:"h-6 w-24 rounded-full"}),s.jsx(Y,{className:"h-6 w-28 rounded-full"})]}),s.jsxs("div",{className:"flex gap-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[s.jsxs("div",{children:[s.jsx(Y,{className:"h-4 w-12 mb-1"}),s.jsx(Y,{className:"h-5 w-20"})]}),s.jsxs("div",{children:[s.jsx(Y,{className:"h-4 w-12 mb-1"}),s.jsx(Y,{className:"h-5 w-24"})]}),s.jsxs("div",{children:[s.jsx(Y,{className:"h-4 w-20 mb-1"}),s.jsx(Y,{className:"h-5 w-16"})]}),s.jsxs("div",{children:[s.jsx(Y,{className:"h-4 w-12 mb-1"}),s.jsx(Y,{className:"h-5 w-20"})]})]}),s.jsx("div",{className:"flex flex-col",children:s.jsx("div",{className:"w-60 h-40",children:s.jsx(Y,{className:"w-full h-full rounded-lg"})})})]}),s.jsxs("div",{className:"flex gap-6 mt-4",children:[s.jsx("div",{className:"flex flex-1",children:s.jsxs("div",{className:"w-full",children:[s.jsx(Y,{className:"h-4 w-24 mb-3"}),s.jsx(Y,{className:"h-16 w-full rounded-md"})]})}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(Y,{className:"h-10 w-32 rounded-md"}),s.jsx(Y,{className:"h-5 w-24 mt-4"})]})]}),s.jsxs("div",{className:"flex gap-6 mt-4",children:[s.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[s.jsx(Y,{className:"h-8 w-32"}),s.jsx(Y,{className:"h-6 w-24"})]}),s.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[s.jsx(Y,{className:"h-10 w-24 rounded-md"}),s.jsx(Y,{className:"h-10 flex-1 rounded-md"})]})]})]})});const x=e.Opportunities||[],N=x.length>0,S=()=>{c>1&&u(c-1)},C=()=>{u(c+1)},T=((_=(z=e.Distribution)==null?void 0:z.Inventory)==null?void 0:_.reduce((P,I)=>P+(I.AvailableQuantity||0),0))||0,W=P=>{try{return new Date(P).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(I){return console.error(I),P.split("T")[0]||"N/A"}},L=()=>{o&&o({quantity:c,bidNumber:(d==null?void 0:d.BidNumber)??null})};return s.jsx(ar,{className:"hover:shadow-lg transition-shadow",children:s.jsxs(sr,{className:"p-6",children:[s.jsxs("div",{className:"flex justify-between items-start mb-3",children:[s.jsx("h3",{className:"font-semibold text-xl",children:e.Title||e.RandmarTitle}),s.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:b?s.jsx(Y,{className:"h-10 w-24 rounded-md"}):p&&s.jsx("img",{src:p,alt:e.ManufacturerName,className:"max-h-10 max-w-24 object-contain"})})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.AvailableToBuy&&s.jsxs(Ne,{variant:"outline",className:"bg-purple-50 text-purple-700 hover:bg-purple-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Active"]}),e.SerialNumber&&s.jsxs(Ne,{variant:"outline",className:"bg-blue-50 text-blue-700 hover:bg-blue-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Serialized"]}),e.TransparencyCode&&s.jsxs(Ne,{variant:"outline",className:"bg-teal-50 text-teal-700 hover:bg-teal-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Transparency Code"]}),((A=e.ManufacturerCategory)==null?void 0:A.QualificationRequired)&&s.jsxs(Ne,{variant:"outline",className:"bg-yellow-50 text-yellow-700 hover:bg-yellow-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Qualified"]}),e.AutoUpdate&&s.jsxs(Ne,{variant:"outline",className:"bg-orange-50 text-orange-700 hover:bg-orange-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Manually Reorders"]}),e.ShopifyProduct&&Object.keys(e.ShopifyProduct||{}).length>0&&s.jsxs(Ne,{variant:"outline",className:"bg-green-50 text-green-700 hover:bg-green-50 rounded-full px-3",children:[s.jsx("span",{className:"mr-1.5",children:"●"})," Shopify Ready"]})]}),s.jsxs("div",{className:"flex gap-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),s.jsx("div",{className:"font-medium",children:e.MPN||"N/A"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),s.jsx("div",{className:"font-medium",children:e.UPC||"N/A"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),s.jsx("div",{className:"font-medium",children:e.UnitWeight?`${e.UnitWeight} lbs`:"N/A"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"MAP"}),s.jsx("div",{className:"font-medium",children:e.MAP?"$"+e.MAP.toFixed(2):"N/A"})]})]}),s.jsx("div",{className:"flex flex-col",children:s.jsx(js,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""})})]}),s.jsxs("div",{className:"flex gap-6 mt-4",children:[s.jsx("div",{className:"flex flex-1",children:e.Distribution&&s.jsxs("div",{className:"w-full",children:[s.jsx("div",{className:"text-sm text-muted-foreground flex items-center",children:"Opportunities"}),N?s.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto pr-1 mt-1",children:x.map((P,I)=>s.jsxs("div",{className:`flex justify-between items-center border border-gray-100 rounded transition-colors py-2 px-4
160
160
  ${P.BidNumber==(d==null?void 0:d.BidNumber)?"bg-primary/10 cursor-pointer":P.Active?"hover:bg-primary/5 cursor-pointer":""}
161
161
  `,onClick:()=>f(P.BidNumber!=(d==null?void 0:d.BidNumber)?P:null),children:[s.jsx("div",{className:"flex items-center",children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"font-medium text-sm",children:P.Opportunity}),s.jsx("span",{className:"text-xs text-gray-500",children:P.BidNumber})]})}),s.jsxs("div",{className:"flex flex-col items-end",children:[s.jsxs("span",{className:"font-semibold",children:["$",P.Price.toFixed(2)]}),P.Rebate>0&&s.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: $",P.Rebate.toFixed(2)]}),P.EndDate&&s.jsxs("span",{className:"text-xs text-gray-500",children:["Ends: ",W(P.EndDate)]}),!P.Active&&s.jsx(Ne,{variant:"outline",className:"text-xs px-2 py-0 h-5 mt-1 bg-gray-100",children:"Inactive"})]})]},I))}):s.jsx("div",{className:"w-full flex flex-col items-start justify-center py-2",children:s.jsx("p",{className:"font-medium",children:"No opportunities available"})})]})}),s.jsxs("div",{className:"flex flex-col items-center",children:[n&&s.jsxs(ee,{variant:"secondary",onClick:n,disabled:i,children:[s.jsx(gi,{className:"mr-2"}),"View Product"]}),e.Distribution&&s.jsx("div",{className:`flex items-center text-sm mt-4 ${T>0?"text-green-700":"text-red-700"}`,children:T>0?s.jsxs(s.Fragment,{children:[s.jsx(Yn,{size:"16",className:"mr-2"}),T," in stock"]}):s.jsxs(s.Fragment,{children:[s.jsx(Yn,{size:"16",className:"mr-2"}),"Out of stock"]})})]})]}),e.Distribution&&s.jsxs("div",{className:"flex gap-6 mt-4",children:[s.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsxs("span",{className:"text-2xl font-bold",children:[s.jsx("span",{children:"$"}),d?(k=(V=e.Opportunities)==null?void 0:V.find(P=>P.BidNumber==d.BidNumber))==null?void 0:k.Price:y.toFixed(2),s.jsx("span",{children:" CAD"})]}),h>0&&s.jsxs("span",{className:"text-muted-foreground line-through ml-2",children:["$",g.toFixed(2)]})]}),h>0&&s.jsx("div",{className:"flex items-center",children:s.jsxs(Ne,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3",children:[s.jsxs("span",{children:[h,"% OFF"]}),((U=e.InstantRebate)==null?void 0:U.EndDate)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",e.InstantRebate.EndDate.split("T")[0]]}),(d==null?void 0:d.EndDate)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",d.EndDate.split("T")[0]]})]})})]}),s.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t&&s.jsxs("div",{className:"flex items-center border rounded-md",children:[s.jsx(ee,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:S,disabled:T<=0||c<=1||i||!o,children:"-"}),s.jsx("div",{className:`px-4 ${T<=0||i||!o?"text-gray-400":""}`,children:c}),s.jsx(ee,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:C,disabled:T<=0||i||!o,children:"+"})]}),t&&s.jsx(ee,{className:"gap-2 flex-1",onClick:L,disabled:T<=0||i||!o,children:i?s.jsxs(s.Fragment,{children:[s.jsx(Gn,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Kn,{className:"mr-2"}),"Add to Cart"]})}),r&&s.jsx(ee,{className:"gap-2 flex-1 bg-green-600 hover:bg-green-700",onClick:a,disabled:T<=0||i||!a,children:i?s.jsxs(s.Fragment,{children:[s.jsx(Gn,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Kn,{className:"mr-2"}),"Sync to Shopify"]})})]})]})]})})}E.AvatarFooter=wu,E.Badge=Ne,E.Button=ee,E.Card=ar,E.CardContent=sr,E.CardDescription=Ks,E.CardFooter=Ys,E.CardHeader=Us,E.CardTitle=Gs,E.Dialog=zt,E.DialogClose=Lr,E.DialogContent=Bt,E.DialogDescription=Wr,E.DialogFooter=zr,E.DialogHeader=$r,E.DialogOverlay=Fr,E.DialogPortal=na,E.DialogTitle=Br,E.DialogTrigger=ra,E.Input=Jt,E.InputOTP=cl,E.InputOTPGroup=dl,E.InputOTPSeparator=fl,E.InputOTPSlot=ul,E.Label=Cu,E.Layout=tf,E.Navbar=Hs,E.ProductCard=of,E.ProductImage=js,E.Separator=sn,E.Sheet=Ya,E.SheetClose=bu,E.SheetContent=cn,E.SheetDescription=Qa,E.SheetFooter=Xa,E.SheetHeader=qa,E.SheetOverlay=ln,E.SheetPortal=Ra,E.SheetTitle=Za,E.SheetTrigger=vu,E.Sidebar=fn,E.SidebarContent=mn,E.SidebarFooter=gn,E.SidebarGroup=ss,E.SidebarGroupAction=ls,E.SidebarGroupContent=cs,E.SidebarGroupLabel=is,E.SidebarHeader=hn,E.SidebarInput=os,E.SidebarInset=ns,E.SidebarMenu=vn,E.SidebarMenuAction=ds,E.SidebarMenuBadge=us,E.SidebarMenuButton=yn,E.SidebarMenuItem=bn,E.SidebarMenuSkeleton=fs,E.SidebarMenuSub=ps,E.SidebarMenuSubButton=gs,E.SidebarMenuSubItem=hs,E.SidebarProvider=un,E.SidebarRail=rs,E.SidebarSeparator=as,E.SidebarTrigger=pn,E.Skeleton=Y,E.Toast=An,E.ToastAction=$s,E.ToastClose=On,E.ToastDescription=kn,E.ToastProvider=Fs,E.ToastTitle=Mn,E.ToastViewport=Pn,E.Toaster=Ws,E.Tooltip=at,E.TooltipContent=Ve,E.TooltipProvider=ot,E.TooltipTrigger=st,E.Topbar=Vs,E.buttonVariants=Vr,E.toast=Bs,E.useIsMobile=es,E.useSidebar=gt,E.useToast=In,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "randmarcomps",
3
3
  "private": false,
4
- "version": "1.60.0",
4
+ "version": "1.61.0",
5
5
  "description": "The UI library enabling speed and consistency in Randmar frontends.",
6
6
  "type": "module",
7
7
  "files": [