import{r as e,j as t}from"./jsx-runtime-BnbLqBWP.js";import{d as r,h as o,i as n,r as s,a,O as i}from"./index-C4j0XBvN.js";import{u as c,P as d,c as l,b as u,B as p,R as f,a as m,d as x,D as v}from"./index-DWAgyr9F.js";import{u as g,c as h,a as w}from"./index-BYVAcnYn.js";import{c as y}from"./index-EkBVNt8q.js";import{c as b}from"./index-DKVgTY5W.js";import{P as T,d as E}from"./index-CE9avnvM.js";import{V as j,R as C}from"./index-C_vjVK8g.js";import{c as N}from"./utils-G3MRPmKb.js";import{X as R}from"./x-DD_tkfxO.js";import{u as P}from"./use-toast-BXW5KyvZ.js";import{c as _,A as k,C as L,a as S}from"./index-SEITMjuJ.js";import{l as D,_ as I,M,m as F,S as A}from"./components-B5_r6Vif.js";import"./_commonjsHelpers-TUi1EdFu.js";import"./router-BXPf1XsM.js";import"./createLucideIcon-5uNZVGyg.js";import"./single-fetch-vTdWVr6V.js"; /** * @remix-run/react v2.15.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */let O="positions";function K({getKey:t,...s}){let{isSpaMode:a}=D(),i=r(),c=o();n({getKey:t,storageKey:O});let d=e.useMemo((()=>{if(!t)return null;let e=t(i,c);return e!==i.key?e:null}),[]);if(a)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},"")}try{let r=JSON.parse(sessionStorage.getItem(e)||"{}")[t||window.history.state.key];"number"==typeof r&&window.scrollTo(0,r)}catch(r){console.error(r),sessionStorage.removeItem(e)}}).toString();return e.createElement("script",I({},s,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${JSON.stringify(O)}, ${JSON.stringify(d)})`}}))}const $=e.createContext(null);function H({children:r}){const[o,n]=e.useState("admin"),s={isAuthenticated:!1,user:null,role:o,login:async e=>{},logout:async()=>{}};return t.jsx($.Provider,{value:s,children:r})}var V="ToastProvider",[z,q,B]=y("Toast"),[U,X]=b("Toast",[B]),[W,Y]=U(V),J=r=>{const{__scopeToast:o,label:n="Notification",duration:s=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:c}=r,[d,l]=e.useState(null),[u,p]=e.useState(0),f=e.useRef(!1),m=e.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${V}\`. Expected non-empty \`string\`.`),t.jsx(z.Provider,{scope:o,children:t.jsx(W,{scope:o,label:n,duration:s,swipeDirection:a,swipeThreshold:i,toastCount:u,viewport:d,onViewportChange:l,onToastAdd:e.useCallback((()=>p((e=>e+1))),[]),onToastRemove:e.useCallback((()=>p((e=>e-1))),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:m,children:c})})};J.displayName=V;var Q="ToastViewport",Z=["F8"],G="toast.viewportPause",ee="toast.viewportResume",te=e.forwardRef(((r,o)=>{const{__scopeToast:n,hotkey:s=Z,label:a="Notifications ({hotkey})",...i}=r,c=Y(Q,n),d=q(n),l=e.useRef(null),u=e.useRef(null),f=e.useRef(null),m=e.useRef(null),x=g(o,m,c.onViewportChange),v=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=c.toastCount>0;e.useEffect((()=>{const e=e=>{0!==s.length&&s.every((t=>e[t]||e.code===t))&&m.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[s]),e.useEffect((()=>{const e=l.current,t=m.current;if(h&&e&&t){const r=()=>{if(!c.isClosePausedRef.current){const e=new CustomEvent(G);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},o=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(ee);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},n=t=>{!e.contains(t.relatedTarget)&&o()},s=()=>{e.contains(document.activeElement)||o()};return e.addEventListener("focusin",r),e.addEventListener("focusout",n),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",o),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",n),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",o)}}}),[h,c.isClosePausedRef]);const w=e.useCallback((({tabbingDirection:e})=>{const t=d().map((t=>{const r=t.ref.current,o=[r,...ye(r)];return"forwards"===e?o:o.reverse()}));return("forwards"===e?t.reverse():t).flat()}),[d]);return e.useEffect((()=>{const e=m.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,o=t.shiftKey;if(t.target===e&&o)return void u.current?.focus();const n=w({tabbingDirection:o?"backwards":"forwards"}),s=n.findIndex((e=>e===r));be(n.slice(s+1))?t.preventDefault():o?u.current?.focus():f.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}}),[d,w]),t.jsxs(p,{ref:l,role:"region","aria-label":a.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&t.jsx(oe,{ref:u,onFocusFromOutsideViewport:()=>{be(w({tabbingDirection:"forwards"}))}}),t.jsx(z.Slot,{scope:n,children:t.jsx(T.ol,{tabIndex:-1,...i,ref:x})}),h&&t.jsx(oe,{ref:f,onFocusFromOutsideViewport:()=>{be(w({tabbingDirection:"backwards"}))}})]})}));te.displayName=Q;var re="ToastFocusProxy",oe=e.forwardRef(((e,r)=>{const{__scopeToast:o,onFocusFromOutsideViewport:n,...s}=e,a=Y(re,o);return t.jsx(j,{"aria-hidden":!0,tabIndex:0,...s,ref:r,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!a.viewport?.contains(t)&&n()}})}));oe.displayName=re;var ne="Toast",se=e.forwardRef(((e,r)=>{const{forceMount:o,open:n,defaultOpen:s,onOpenChange:a,...i}=e,[p=!0,f]=c({prop:n,defaultProp:s,onChange:a});return t.jsx(d,{present:o||p,children:t.jsx(ce,{open:p,...i,ref:r,onClose:()=>f(!1),onPause:u(e.onPause),onResume:u(e.onResume),onSwipeStart:l(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:l(e.onSwipeMove,(e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)})),onSwipeCancel:l(e.onSwipeCancel,(e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")})),onSwipeEnd:l(e.onSwipeEnd,(e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),f(!1)}))})})}));se.displayName=ne;var[ae,ie]=U(ne,{onClose(){}}),ce=e.forwardRef(((r,o)=>{const{__scopeToast:n,type:a="foreground",duration:i,open:c,onClose:d,onEscapeKeyDown:p,onPause:m,onResume:x,onSwipeStart:v,onSwipeMove:h,onSwipeCancel:w,onSwipeEnd:y,...b}=r,E=Y(ne,n),[j,C]=e.useState(null),N=g(o,(e=>C(e))),R=e.useRef(null),P=e.useRef(null),_=i||E.duration,k=e.useRef(0),L=e.useRef(_),S=e.useRef(0),{onToastAdd:D,onToastRemove:I}=E,M=u((()=>{const e=j?.contains(document.activeElement);e&&E.viewport?.focus(),d()})),F=e.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(S.current),k.current=(new Date).getTime(),S.current=window.setTimeout(M,e))}),[M]);e.useEffect((()=>{const e=E.viewport;if(e){const t=()=>{F(L.current),x?.()},r=()=>{const e=(new Date).getTime()-k.current;L.current=L.current-e,window.clearTimeout(S.current),m?.()};return e.addEventListener(G,r),e.addEventListener(ee,t),()=>{e.removeEventListener(G,r),e.removeEventListener(ee,t)}}}),[E.viewport,_,m,x,F]),e.useEffect((()=>{c&&!E.isClosePausedRef.current&&F(_)}),[c,_,E.isClosePausedRef,F]),e.useEffect((()=>(D(),()=>I())),[D,I]);const A=e.useMemo((()=>j?ge(j):null),[j]);return E.viewport?t.jsxs(t.Fragment,{children:[A&&t.jsx(de,{__scopeToast:n,role:"status","aria-live":"foreground"===a?"assertive":"polite","aria-atomic":!0,children:A}),t.jsx(ae,{scope:n,onClose:M,children:s.createPortal(t.jsx(z.ItemSlot,{scope:n,children:t.jsx(f,{asChild:!0,onEscapeKeyDown:l(p,(()=>{E.isFocusedToastEscapeKeyDownRef.current||M(),E.isFocusedToastEscapeKeyDownRef.current=!1})),children:t.jsx(T.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":c?"open":"closed","data-swipe-direction":E.swipeDirection,...b,ref:N,style:{userSelect:"none",touchAction:"none",...r.style},onKeyDown:l(r.onKeyDown,(e=>{"Escape"===e.key&&(p?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(E.isFocusedToastEscapeKeyDownRef.current=!0,M()))})),onPointerDown:l(r.onPointerDown,(e=>{0===e.button&&(R.current={x:e.clientX,y:e.clientY})})),onPointerMove:l(r.onPointerMove,(e=>{if(!R.current)return;const t=e.clientX-R.current.x,r=e.clientY-R.current.y,o=Boolean(P.current),n=["left","right"].includes(E.swipeDirection),s=["left","up"].includes(E.swipeDirection)?Math.min:Math.max,a=n?s(0,t):0,i=n?0:s(0,r),c="touch"===e.pointerType?10:2,d={x:a,y:i},l={originalEvent:e,delta:d};o?(P.current=d,he("toast.swipeMove",h,l,{discrete:!1})):we(d,E.swipeDirection,c)?(P.current=d,he("toast.swipeStart",v,l,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(r)>c)&&(R.current=null)})),onPointerUp:l(r.onPointerUp,(e=>{const t=P.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),P.current=null,R.current=null,t){const r=e.currentTarget,o={originalEvent:e,delta:t};we(t,E.swipeDirection,E.swipeThreshold)?he("toast.swipeEnd",y,o,{discrete:!0}):he("toast.swipeCancel",w,o,{discrete:!0}),r.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),E.viewport)})]}):null})),de=r=>{const{__scopeToast:o,children:n,...s}=r,a=Y(ne,o),[i,c]=e.useState(!1),[d,l]=e.useState(!1);return function(e=()=>{}){const t=u(e);x((()=>{let e=0,r=0;return e=window.requestAnimationFrame((()=>r=window.requestAnimationFrame(t))),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}}),[t])}((()=>c(!0))),e.useEffect((()=>{const e=window.setTimeout((()=>l(!0)),1e3);return()=>window.clearTimeout(e)}),[]),d?null:t.jsx(m,{asChild:!0,children:t.jsx(j,{...s,children:i&&t.jsxs(t.Fragment,{children:[a.label," ",n]})})})},le=e.forwardRef(((e,r)=>{const{__scopeToast:o,...n}=e;return t.jsx(T.div,{...n,ref:r})}));le.displayName="ToastTitle";var ue=e.forwardRef(((e,r)=>{const{__scopeToast:o,...n}=e;return t.jsx(T.div,{...n,ref:r})}));ue.displayName="ToastDescription";var pe="ToastAction",fe=e.forwardRef(((e,r)=>{const{altText:o,...n}=e;return o.trim()?t.jsx(ve,{altText:o,asChild:!0,children:t.jsx(xe,{...n,ref:r})}):(console.error(`Invalid prop \`altText\` supplied to \`${pe}\`. Expected non-empty \`string\`.`),null)}));fe.displayName=pe;var me="ToastClose",xe=e.forwardRef(((e,r)=>{const{__scopeToast:o,...n}=e,s=ie(me,o);return t.jsx(ve,{asChild:!0,children:t.jsx(T.button,{type:"button",...n,ref:r,onClick:l(e.onClick,s.onClose)})})}));xe.displayName=me;var ve=e.forwardRef(((e,r)=>{const{__scopeToast:o,altText:n,...s}=e;return t.jsx(T.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:r})}));function ge(e){const t=[];return Array.from(e.childNodes).forEach((e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const r=e.ariaHidden||e.hidden||"none"===e.style.display,o=""===e.dataset.radixToastAnnounceExclude;if(!r)if(o){const r=e.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...ge(e))}})),t}function he(e,t,r,{discrete:o}){const n=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?E(n,s):n.dispatchEvent(s)}var we=(e,t,r=0)=>{const o=Math.abs(e.x),n=Math.abs(e.y),s=o>n;return"left"===t||"right"===t?s&&o>r:!s&&n>r};function ye(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function be(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var Te=te,Ee=se,je=le,Ce=ue,Ne=fe,Re=xe;const Pe=J,_e=e.forwardRef((({className:e,...r},o)=>t.jsx(Te,{ref:o,className:N("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),...r})));_e.displayName=Te.displayName;const ke=h("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 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 data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"success group border-green-500 bg-green-500 text-white"}},defaultVariants:{variant:"default"}}),Le=e.forwardRef((({className:e,variant:r,duration:o=5e3,...n},s)=>t.jsx(Ee,{ref:s,className:N(ke({variant:r}),e),duration:o,...n})));Le.displayName=Ee.displayName;e.forwardRef((({className:e,...r},o)=>t.jsx(Ne,{ref:o,className:N("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive group-[.success]:border-muted/40 group-[.success]:hover:border-green-600 group-[.success]:hover:bg-green-600 group-[.success]:hover:text-white group-[.success]:focus:ring-green-500",e),...r}))).displayName=Ne.displayName;const Se=e.forwardRef((({className:e,...r},o)=>t.jsx(Re,{ref:o,className:N("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 group-[.success]:text-green-200 group-[.success]:hover:text-white group-[.success]:focus:ring-green-400 group-[.success]:focus:ring-offset-green-600",e),"toast-close":"",...r,children:t.jsx(R,{className:"h-4 w-4"})})));Se.displayName=Re.displayName;const De=e.forwardRef((({className:e,...r},o)=>t.jsx(je,{ref:o,className:N("text-sm font-semibold",e),...r})));De.displayName=je.displayName;const Ie=e.forwardRef((({className:e,...r},o)=>t.jsx(Ce,{ref:o,className:N("text-sm opacity-90",e),...r})));Ie.displayName=Ce.displayName;const Me=e.forwardRef((({className:r,duration:o=5e3,...n},s)=>{const[a,i]=e.useState(o);e.useEffect((()=>{if(o<=0)return;const e=Date.now(),t=setInterval((()=>{const r=Date.now()-e,n=Math.max(0,o-r);i(n),n<=0&&clearInterval(t)}),100);return()=>clearInterval(t)}),[o]);const c=a/o*100;return t.jsx("div",{ref:s,className:N("absolute bottom-0 left-0 h-1 bg-primary transition-all",r),style:{width:`${c}%`},...n})}));function Fe(){const{toasts:e}=P();return t.jsxs(Pe,{children:[e.map((function({id:e,title:r,description:o,action:n,duration:s,...a}){return t.jsxs(Le,{...a,duration:s,children:[t.jsxs("div",{className:"grid gap-1",children:[r&&t.jsx(De,{children:r}),o&&t.jsx(Ie,{children:o})]}),n,t.jsx(Se,{}),s!==1/0&&t.jsx(Me,{duration:s})]},e)})),t.jsx(_e,{})]})}Me.displayName="ToastProgress";var[Ae,Oe]=b("Tooltip",[_]),Ke=_(),$e="TooltipProvider",He=700,Ve="tooltip.open",[ze,qe]=Ae($e),Be=r=>{const{__scopeTooltip:o,delayDuration:n=He,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:i}=r,[c,d]=e.useState(!0),l=e.useRef(!1),u=e.useRef(0);return e.useEffect((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),t.jsx(ze,{scope:o,isOpenDelayed:c,delayDuration:n,onOpen:e.useCallback((()=>{window.clearTimeout(u.current),d(!1)}),[]),onClose:e.useCallback((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>d(!0)),s)}),[s]),isPointerInTransitRef:l,onPointerInTransitChange:e.useCallback((e=>{l.current=e}),[]),disableHoverableContent:a,children:i})};Be.displayName=$e;var Ue="Tooltip",[Xe,We]=Ae(Ue),Ye="TooltipTrigger";e.forwardRef(((r,o)=>{const{__scopeTooltip:n,...s}=r,a=We(Ye,n),i=qe(Ye,n),c=Ke(n),d=e.useRef(null),u=g(o,d,a.onTriggerChange),p=e.useRef(!1),f=e.useRef(!1),m=e.useCallback((()=>p.current=!1),[]);return e.useEffect((()=>()=>document.removeEventListener("pointerup",m)),[m]),t.jsx(k,{asChild:!0,...c,children:t.jsx(T.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:u,onPointerMove:l(r.onPointerMove,(e=>{"touch"!==e.pointerType&&(f.current||i.isPointerInTransitRef.current||(a.onTriggerEnter(),f.current=!0))})),onPointerLeave:l(r.onPointerLeave,(()=>{a.onTriggerLeave(),f.current=!1})),onPointerDown:l(r.onPointerDown,(()=>{p.current=!0,document.addEventListener("pointerup",m,{once:!0})})),onFocus:l(r.onFocus,(()=>{p.current||a.onOpen()})),onBlur:l(r.onBlur,a.onClose),onClick:l(r.onClick,a.onClose)})})})).displayName=Ye;var[Je,Qe]=Ae("TooltipPortal",{forceMount:void 0}),Ze="TooltipContent",Ge=e.forwardRef(((e,r)=>{const o=Qe(Ze,e.__scopeTooltip),{forceMount:n=o.forceMount,side:s="top",...a}=e,i=We(Ze,e.__scopeTooltip);return t.jsx(d,{present:n||i.open,children:i.disableHoverableContent?t.jsx(ot,{side:s,...a,ref:r}):t.jsx(et,{side:s,...a,ref:r})})})),et=e.forwardRef(((r,o)=>{const n=We(Ze,r.__scopeTooltip),s=qe(Ze,r.__scopeTooltip),a=e.useRef(null),i=g(o,a),[c,d]=e.useState(null),{trigger:l,onClose:u}=n,p=a.current,{onPointerInTransitChange:f}=s,m=e.useCallback((()=>{d(null),f(!1)}),[f]),x=e.useCallback(((e,t)=>{const r=e.currentTarget,o={x:e.clientX,y:e.clientY},n=function(e,t,r=5){const o=[];switch(t){case"top":o.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":o.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":o.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":o.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return o}(o,function(e,t){const r=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),n=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,o,n,s)){case s:return"left";case n:return"right";case r:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,r.getBoundingClientRect())),s=function(e){const t=e.slice();return t.sort(((e,t)=>e.xt.x?1:e.yt.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const e=t[t.length-1],o=t[t.length-2];if(!((e.x-o.x)*(r.y-o.y)>=(e.y-o.y)*(r.x-o.x)))break;t.pop()}t.push(r)}t.pop();const r=[];for(let o=e.length-1;o>=0;o--){const t=e[o];for(;r.length>=2;){const e=r[r.length-1],o=r[r.length-2];if(!((e.x-o.x)*(t.y-o.y)>=(e.y-o.y)*(t.x-o.x)))break;r.pop()}r.push(t)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}(t)}([...n,...function(e){const{top:t,right:r,bottom:o,left:n}=e;return[{x:n,y:t},{x:r,y:t},{x:r,y:o},{x:n,y:o}]}(t.getBoundingClientRect())]);d(s),f(!0)}),[f]);return e.useEffect((()=>()=>m()),[m]),e.useEffect((()=>{if(l&&p){const e=e=>x(e,p),t=e=>x(e,l);return l.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{l.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}}),[l,p,x,m]),e.useEffect((()=>{if(c){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},o=l?.contains(t)||p?.contains(t),n=!function(e,t){const{x:r,y:o}=e;let n=!1;for(let s=0,a=t.length-1;so!=d>o&&r<(c-e)*(o-i)/(d-i)+e&&(n=!n)}return n}(r,c);o?m():n&&(m(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[l,p,c,u,m]),t.jsx(ot,{...r,ref:i})})),[tt,rt]=Ae(Ue,{isInside:!1}),ot=e.forwardRef(((r,o)=>{const{__scopeTooltip:n,children:s,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:c,...d}=r,l=We(Ze,n),u=Ke(n),{onClose:p}=l;return e.useEffect((()=>(document.addEventListener(Ve,p),()=>document.removeEventListener(Ve,p))),[p]),e.useEffect((()=>{if(l.trigger){const e=e=>{const t=e.target;t?.contains(l.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[l.trigger,p]),t.jsx(v,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(L,{"data-state":l.stateAttribute,...u,...d,ref:o,style:{...d.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:[t.jsx(w,{children:s}),t.jsx(tt,{scope:n,isInside:!0,children:t.jsx(C,{id:l.contentId,role:"tooltip",children:a||s})})]})})}));Ge.displayName=Ze;var nt="TooltipArrow";e.forwardRef(((e,r)=>{const{__scopeTooltip:o,...n}=e,s=Ke(o);return rt(nt,o).isInside?null:t.jsx(S,{...s,...n,ref:r})})).displayName=nt;var st=Ge;const at=Be;e.forwardRef((({className:e,sideOffset:r=4,...o},n)=>t.jsx(st,{ref:n,sideOffset:r,className:N("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",e),...o}))).displayName=st.displayName;const it=()=>[{rel:"preconnect",href:"https://fonts.googleapis.com"},{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"},{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"}];function ct(){const{toast:o}=P(),n=r(),s=a();return e.useEffect((()=>{if(n.pathname.includes("/qywx/"))return;const e=navigator.userAgent.toLowerCase(),t=e.includes("wxwork")||e.includes("wework");if(console.log("浏览器用户代理: ",e),console.log("是否企业微信内置浏览器: ",t),t){console.log("检测到企业微信内置浏览器环境,准备自动登录");const e=encodeURIComponent(n.pathname+n.search);console.log("当前路径:",n.pathname,"完整重定向URL:",`/qywx/auto-login?redirect=${e}`),s(`/qywx/auto-login?redirect=${e}`)}else console.log("当前不是企业微信内置浏览器环境,不启动自动登录")}),[n.pathname,s]),e.useEffect((()=>{const e=e=>{o(e.detail)},t=document.querySelector("[data-sonner-toaster]");return t&&(t.setAttribute("data-toast-instance","true"),t.addEventListener("toast",e),window.__toastQueue?.length&&(window.__toastQueue.forEach((e=>o(e))),window.__toastQueue=[])),()=>{t&&t.removeEventListener("toast",e)}}),[o]),t.jsxs("html",{lang:"zh-CN",suppressHydrationWarning:!0,className:"hunter-workers-app",children:[t.jsxs("head",{children:[t.jsx("meta",{charSet:"utf-8"}),t.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1, viewport-fit=cover, maximum-scale=1.0, user-scalable=no"}),t.jsx(M,{}),t.jsx(F,{}),t.jsx("style",{dangerouslySetInnerHTML:{__html:'\n @media (max-width: 768px) {\n html {\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n }\n \n body {\n -webkit-user-select: text;\n user-select: text;\n }\n }\n /* 简化防止iOS下拉回弹暴露白色背景,仅使用安全的方法 */\n html {\n background-color: #050A14;\n }\n html, body {\n /* 保持滚动行为正常 */\n overflow-x: hidden;\n width: 100%;\n }\n \n /* 安全的固定背景 */\n body::before {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #050A14;\n z-index: -999; /* 非常低的z-index确保不会干扰交互 */\n }\n \n /* 企业微信特定修复 - 只对应用路由生效 */\n body > div.flex.flex-col.min-h-screen div[class*="_app"],\n body > div.flex.flex-col.min-h-screen div[class*="_app"] > div {\n background-color: white !important;\n }\n \n /* 确保首页保持深色背景 */\n body > div.flex.flex-col.min-h-screen div[class*="_index"],\n body > div.flex.flex-col.min-h-screen div[class*="home-page"] {\n background-color: #050A14 !important; \n }\n \n /* 移除所有可能阻止交互的样式 */\n '}})]}),t.jsxs("body",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsx(at,{children:t.jsx(H,{children:t.jsx(i,{})})}),t.jsx(Fe,{}),t.jsx("div",{id:"bottom-spacer",style:{height:"50px",backgroundColor:"#050A14",width:"100%"}}),t.jsx(K,{}),t.jsx(A,{})]})]})}export{ct as default,it as links};