@tapflowio/relay 0.28.1 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RelayServer.d.ts +75 -0
- package/dist/RelayServer.d.ts.map +1 -1
- package/dist/RelayServer.js +496 -49
- package/dist/RelayServer.js.map +1 -1
- package/dist/SessionManager.d.ts +41 -2
- package/dist/SessionManager.d.ts.map +1 -1
- package/dist/SessionManager.js +31 -1
- package/dist/SessionManager.js.map +1 -1
- package/dist/admission/HostBootGate.d.ts +181 -0
- package/dist/admission/HostBootGate.d.ts.map +1 -0
- package/dist/admission/HostBootGate.js +388 -0
- package/dist/admission/HostBootGate.js.map +1 -0
- package/dist/admission/capacity.d.ts +51 -0
- package/dist/admission/capacity.d.ts.map +1 -0
- package/dist/admission/capacity.js +49 -0
- package/dist/admission/capacity.js.map +1 -0
- package/dist/admission/classifyBoot.d.ts +17 -0
- package/dist/admission/classifyBoot.d.ts.map +1 -0
- package/dist/admission/classifyBoot.js +23 -0
- package/dist/admission/classifyBoot.js.map +1 -0
- package/dist/admission/hostKey.d.ts +10 -0
- package/dist/admission/hostKey.d.ts.map +1 -0
- package/dist/admission/hostKey.js +13 -0
- package/dist/admission/hostKey.js.map +1 -0
- package/dist/admission/leaseChoice.d.ts +38 -0
- package/dist/admission/leaseChoice.d.ts.map +1 -0
- package/dist/admission/leaseChoice.js +40 -0
- package/dist/admission/leaseChoice.js.map +1 -0
- package/dist/admission/settle.d.ts +35 -0
- package/dist/admission/settle.d.ts.map +1 -0
- package/dist/admission/settle.js +41 -0
- package/dist/admission/settle.js.map +1 -0
- package/dist/api/runs.d.ts +21 -2
- package/dist/api/runs.d.ts.map +1 -1
- package/dist/api/runs.js +181 -26
- package/dist/api/runs.js.map +1 -1
- package/dist/migrations/017_flow_run_skipped.sql +34 -0
- package/dist/migrations/018_flow_run_service_tier.sql +6 -0
- package/dist/migrations/019_flow_run_device_reset.sql +7 -0
- package/package.json +4 -4
- package/public/assets/{AISessionWatch-C2h4NZ_I.js → AISessionWatch-BSBkpTom.js} +7 -7
- package/public/assets/AISessionWatch-BSBkpTom.js.br +0 -0
- package/public/assets/AISessionWatch-BSBkpTom.js.gz +0 -0
- package/public/assets/{AppCenter-S1y-8_7l.js → AppCenter-DD_6LQx-.js} +6 -6
- package/public/assets/AppCenter-DD_6LQx-.js.br +0 -0
- package/public/assets/AppCenter-DD_6LQx-.js.gz +0 -0
- package/public/assets/{Default-C-l1O-g9.js → Default-CQ3Ae2mK.js} +1 -1
- package/public/assets/Default-CQ3Ae2mK.js.br +0 -0
- package/public/assets/Default-CQ3Ae2mK.js.gz +0 -0
- package/public/assets/{Invite-BCndVxaO.js → Invite-D1uNMm0-.js} +1 -1
- package/public/assets/Invite-D1uNMm0-.js.br +0 -0
- package/public/assets/Invite-D1uNMm0-.js.gz +0 -0
- package/public/assets/{MacResources-41cFDgE1.js → MacResources-D2UeRbKL.js} +1 -1
- package/public/assets/MacResources-D2UeRbKL.js.br +0 -0
- package/public/assets/MacResources-D2UeRbKL.js.gz +0 -0
- package/public/assets/QASession-d0eOjXXo.js +81 -0
- package/public/assets/QASession-d0eOjXXo.js.br +0 -0
- package/public/assets/QASession-d0eOjXXo.js.gz +0 -0
- package/public/assets/{ResetPassword-8rj7ASt1.js → ResetPassword-B-4Uyfwr.js} +1 -1
- package/public/assets/ResetPassword-B-4Uyfwr.js.br +0 -0
- package/public/assets/ResetPassword-B-4Uyfwr.js.gz +0 -0
- package/public/assets/RunDetail-C50RjsuM.js +16 -0
- package/public/assets/RunDetail-C50RjsuM.js.br +0 -0
- package/public/assets/RunDetail-C50RjsuM.js.gz +0 -0
- package/public/assets/Runs-A7RcDLgO.js +6 -0
- package/public/assets/Runs-A7RcDLgO.js.br +0 -0
- package/public/assets/Runs-A7RcDLgO.js.gz +0 -0
- package/public/assets/{Setup-DZrhA_7b.js → Setup-DK6TZbwh.js} +1 -1
- package/public/assets/Setup-DK6TZbwh.js.br +0 -0
- package/public/assets/Setup-DK6TZbwh.js.gz +0 -0
- package/public/assets/{Team-CJThCjd3.js → Team-VoGput2p.js} +2 -2
- package/public/assets/Team-VoGput2p.js.br +0 -0
- package/public/assets/Team-VoGput2p.js.gz +0 -0
- package/public/assets/{Tokens-DGURtHWi.js → Tokens-qkcJgunR.js} +1 -1
- package/public/assets/Tokens-qkcJgunR.js.br +0 -0
- package/public/assets/Tokens-qkcJgunR.js.gz +0 -0
- package/public/assets/{aiSession-BW09Jhqz.js → aiSession-U7UqgdSb.js} +6 -6
- package/public/assets/aiSession-U7UqgdSb.js.br +0 -0
- package/public/assets/aiSession-U7UqgdSb.js.gz +0 -0
- package/public/assets/{alert-dialog-t5vlOabq.js → alert-dialog-C0mRms8g.js} +1 -1
- package/public/assets/{alert-dialog-t5vlOabq.js.br → alert-dialog-C0mRms8g.js.br} +0 -0
- package/public/assets/alert-dialog-C0mRms8g.js.gz +0 -0
- package/public/assets/{badge-DrDCTAQQ.js → badge-BjEnOmb0.js} +1 -1
- package/public/assets/badge-BjEnOmb0.js.br +0 -0
- package/public/assets/badge-BjEnOmb0.js.gz +0 -0
- package/public/assets/{dialog-BOFZkCES.js → dialog-Cugbp1C4.js} +1 -1
- package/public/assets/dialog-Cugbp1C4.js.br +0 -0
- package/public/assets/dialog-Cugbp1C4.js.gz +0 -0
- package/public/assets/{field-hint-B9fPUgi7.js → field-hint-qmBa0qqN.js} +1 -1
- package/public/assets/field-hint-qmBa0qqN.js.br +0 -0
- package/public/assets/field-hint-qmBa0qqN.js.gz +0 -0
- package/public/assets/{index-Bixhy5MB.js → index-C_3Q51YJ.js} +39 -39
- package/public/assets/index-C_3Q51YJ.js.br +0 -0
- package/public/assets/index-C_3Q51YJ.js.gz +0 -0
- package/public/assets/{list-view-BpOY1e-d.js → list-view-CyM0QUaH.js} +1 -1
- package/public/assets/list-view-CyM0QUaH.js.br +0 -0
- package/public/assets/list-view-CyM0QUaH.js.gz +0 -0
- package/public/assets/{pencil-ZlrAsWuU.js → pencil-DUZRZB3S.js} +2 -2
- package/public/assets/pencil-DUZRZB3S.js.br +0 -0
- package/public/assets/pencil-DUZRZB3S.js.gz +0 -0
- package/public/assets/{play-4CsGZdQU.js → play-Z1L2Eb91.js} +2 -2
- package/public/assets/play-Z1L2Eb91.js.br +0 -0
- package/public/assets/play-Z1L2Eb91.js.gz +0 -0
- package/public/assets/{runs-CInQb6v1.js → runs-CFQ6M4rx.js} +1 -1
- package/public/assets/runs-CFQ6M4rx.js.br +0 -0
- package/public/assets/runs-CFQ6M4rx.js.gz +0 -0
- package/public/assets/{search-input-G_QpBvPM.js → search-input-B0s9mzRt.js} +2 -2
- package/public/assets/search-input-B0s9mzRt.js.br +0 -0
- package/public/assets/search-input-B0s9mzRt.js.gz +0 -0
- package/public/assets/{select-DDzv2YfY.js → select-CHbE6M4S.js} +3 -3
- package/public/assets/select-CHbE6M4S.js.br +0 -0
- package/public/assets/select-CHbE6M4S.js.gz +0 -0
- package/public/assets/{slider-DE7lQdK4.js → slider-tyb3JvL2.js} +1 -1
- package/public/assets/slider-tyb3JvL2.js.br +0 -0
- package/public/assets/slider-tyb3JvL2.js.gz +0 -0
- package/public/assets/{tabs-Co1N3x_X.js → tabs-Bf7ou-eS.js} +1 -1
- package/public/assets/tabs-Bf7ou-eS.js.br +0 -0
- package/public/assets/tabs-Bf7ou-eS.js.gz +0 -0
- package/public/assets/{tech-label-BMvuJmUf.js → tech-label-KAwM5qZ_.js} +1 -1
- package/public/assets/tech-label-KAwM5qZ_.js.br +0 -0
- package/public/assets/tech-label-KAwM5qZ_.js.gz +0 -0
- package/public/assets/{trash-Cwj2dbgB.js → trash-HEJmY7DQ.js} +3 -3
- package/public/assets/trash-HEJmY7DQ.js.br +0 -0
- package/public/assets/trash-HEJmY7DQ.js.gz +0 -0
- package/public/assets/{video-swsaHrfi.js → video-DdHH0Q0l.js} +2 -2
- package/public/assets/video-DdHH0Q0l.js.br +0 -0
- package/public/assets/video-DdHH0Q0l.js.gz +0 -0
- package/public/index.html +1 -1
- package/public/index.html.br +0 -0
- package/public/index.html.gz +0 -0
- package/public/assets/AISessionWatch-C2h4NZ_I.js.br +0 -0
- package/public/assets/AISessionWatch-C2h4NZ_I.js.gz +0 -0
- package/public/assets/AppCenter-S1y-8_7l.js.br +0 -0
- package/public/assets/AppCenter-S1y-8_7l.js.gz +0 -0
- package/public/assets/Default-C-l1O-g9.js.br +0 -0
- package/public/assets/Default-C-l1O-g9.js.gz +0 -0
- package/public/assets/Invite-BCndVxaO.js.br +0 -0
- package/public/assets/Invite-BCndVxaO.js.gz +0 -0
- package/public/assets/MacResources-41cFDgE1.js.br +0 -0
- package/public/assets/MacResources-41cFDgE1.js.gz +0 -0
- package/public/assets/QASession-B67RsIPm.js +0 -81
- package/public/assets/QASession-B67RsIPm.js.br +0 -0
- package/public/assets/QASession-B67RsIPm.js.gz +0 -0
- package/public/assets/ResetPassword-8rj7ASt1.js.br +0 -0
- package/public/assets/ResetPassword-8rj7ASt1.js.gz +0 -0
- package/public/assets/RunDetail-BIgq9gJ0.js +0 -16
- package/public/assets/RunDetail-BIgq9gJ0.js.br +0 -0
- package/public/assets/RunDetail-BIgq9gJ0.js.gz +0 -0
- package/public/assets/Runs-DpK5aoBr.js +0 -6
- package/public/assets/Runs-DpK5aoBr.js.br +0 -0
- package/public/assets/Runs-DpK5aoBr.js.gz +0 -0
- package/public/assets/Setup-DZrhA_7b.js.br +0 -0
- package/public/assets/Setup-DZrhA_7b.js.gz +0 -0
- package/public/assets/Team-CJThCjd3.js.br +0 -0
- package/public/assets/Team-CJThCjd3.js.gz +0 -0
- package/public/assets/Tokens-DGURtHWi.js.br +0 -0
- package/public/assets/Tokens-DGURtHWi.js.gz +0 -0
- package/public/assets/aiSession-BW09Jhqz.js.br +0 -0
- package/public/assets/aiSession-BW09Jhqz.js.gz +0 -0
- package/public/assets/alert-dialog-t5vlOabq.js.gz +0 -0
- package/public/assets/badge-DrDCTAQQ.js.br +0 -0
- package/public/assets/badge-DrDCTAQQ.js.gz +0 -0
- package/public/assets/dialog-BOFZkCES.js.br +0 -0
- package/public/assets/dialog-BOFZkCES.js.gz +0 -0
- package/public/assets/field-hint-B9fPUgi7.js.br +0 -0
- package/public/assets/field-hint-B9fPUgi7.js.gz +0 -0
- package/public/assets/index-Bixhy5MB.js.br +0 -0
- package/public/assets/index-Bixhy5MB.js.gz +0 -0
- package/public/assets/list-view-BpOY1e-d.js.br +0 -0
- package/public/assets/list-view-BpOY1e-d.js.gz +0 -0
- package/public/assets/pencil-ZlrAsWuU.js.br +0 -0
- package/public/assets/pencil-ZlrAsWuU.js.gz +0 -0
- package/public/assets/play-4CsGZdQU.js.br +0 -0
- package/public/assets/play-4CsGZdQU.js.gz +0 -0
- package/public/assets/runs-CInQb6v1.js.br +0 -0
- package/public/assets/runs-CInQb6v1.js.gz +0 -0
- package/public/assets/search-input-G_QpBvPM.js.br +0 -0
- package/public/assets/search-input-G_QpBvPM.js.gz +0 -0
- package/public/assets/select-DDzv2YfY.js.br +0 -0
- package/public/assets/select-DDzv2YfY.js.gz +0 -0
- package/public/assets/slider-DE7lQdK4.js.br +0 -0
- package/public/assets/slider-DE7lQdK4.js.gz +0 -0
- package/public/assets/tabs-Co1N3x_X.js.br +0 -0
- package/public/assets/tabs-Co1N3x_X.js.gz +0 -0
- package/public/assets/tech-label-BMvuJmUf.js.br +0 -0
- package/public/assets/tech-label-BMvuJmUf.js.gz +0 -0
- package/public/assets/trash-Cwj2dbgB.js.br +0 -0
- package/public/assets/trash-Cwj2dbgB.js.gz +0 -0
- package/public/assets/video-swsaHrfi.js.br +0 -0
- package/public/assets/video-swsaHrfi.js.gz +0 -0
|
@@ -1,155 +1,155 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-
|
|
2
|
-
var nc=e=>{throw TypeError(e)};var ks=(e,t,n)=>t.has(e)||nc("Cannot "+n);var S=(e,t,n)=>(ks(e,t,"read from private field"),n?n.call(e):t.get(e)),ie=(e,t,n)=>t.has(e)?nc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),G=(e,t,n,r)=>(ks(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pe=(e,t,n)=>(ks(e,t,"access private method"),n);var po=(e,t,n,r)=>({set _(o){G(e,t,o,n)},get _(){return S(e,t,r)}});import{r as h,j as m,R as I,a as Tp,c as ee,b as Bn,d as ru,u as Ip,o as Ap,s as Np,f as Dp,e as Mp,h as jp,i as $p,l as zp,k as Fp,m as Lp}from"./vendor-react-DTSdA8m-.js";import{u as ou,a as su,L as mo,N as Gi,O as Vp,R as st,B as Up,b as Zp}from"./vendor-router-B1pQim9Z.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var Bp=(e,t,n,r,o,s,i,a)=>{let c=document.documentElement,u=["light","dark"];function d(p){(Array.isArray(e)?e:[e]).forEach(v=>{let g=v==="class",w=g&&s?o.map(b=>s[b]||b):o;g?(c.classList.remove(...w),c.classList.add(s&&s[p]?s[p]:p)):c.setAttribute(v,p)}),l(p)}function l(p){a&&u.includes(p)&&(c.style.colorScheme=p)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)d(r);else try{let p=localStorage.getItem(t)||n,v=i&&p==="system"?f():p;d(v)}catch{}},rc=["light","dark"],iu="(prefers-color-scheme: dark)",Hp=typeof window>"u",qi=h.createContext(void 0),Wp={setTheme:e=>{},themes:[]},ss=()=>{var e;return(e=h.useContext(qi))!=null?e:Wp},Kp=e=>h.useContext(qi)?h.createElement(h.Fragment,null,e.children):h.createElement(qp,{...e}),Gp=["light","dark"],qp=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:s=Gp,defaultTheme:i=n?"system":"light",attribute:a="data-theme",value:c,children:u,nonce:d,scriptProps:l})=>{let[f,p]=h.useState(()=>Yp(o,i)),[v,g]=h.useState(()=>f==="system"?Os():f),w=c?Object.values(c):s,b=h.useCallback(E=>{let P=E;if(!P)return;E==="system"&&n&&(P=Os());let R=c?c[P]:P,T=t?Jp(d):null,A=document.documentElement,j=F=>{F==="class"?(A.classList.remove(...w),R&&A.classList.add(R)):F.startsWith("data-")&&(R?A.setAttribute(F,R):A.removeAttribute(F))};if(Array.isArray(a)?a.forEach(j):j(a),r){let F=rc.includes(i)?i:null,z=rc.includes(P)?P:F;A.style.colorScheme=z}T==null||T()},[d]),x=h.useCallback(E=>{let P=typeof E=="function"?E(f):E;p(P);try{localStorage.setItem(o,P)}catch{}},[f]),_=h.useCallback(E=>{let P=Os(E);g(P),f==="system"&&n&&!e&&b("system")},[f,e]);h.useEffect(()=>{let E=window.matchMedia(iu);return E.addListener(_),_(E),()=>E.removeListener(_)},[_]),h.useEffect(()=>{let E=P=>{P.key===o&&(P.newValue?p(P.newValue):x(i))};return window.addEventListener("storage",E),()=>window.removeEventListener("storage",E)},[x]),h.useEffect(()=>{b(e??f)},[e,f]);let C=h.useMemo(()=>({theme:f,setTheme:x,forcedTheme:e,resolvedTheme:f==="system"?v:f,themes:n?[...s,"system"]:s,systemTheme:n?v:void 0}),[f,x,e,v,n,s]);return h.createElement(qi.Provider,{value:C},h.createElement(Qp,{forcedTheme:e,storageKey:o,attribute:a,enableSystem:n,enableColorScheme:r,defaultTheme:i,value:c,themes:s,nonce:d,scriptProps:l}),u)},Qp=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,themes:a,nonce:c,scriptProps:u})=>{if(typeof window<"u")return null;let d=JSON.stringify([n,t,s,e,a,i,r,o]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${Bp.toString()})(${d})`}})}),Yp=(e,t)=>{if(Hp)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Jp=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Os=e=>(e||(e=window.matchMedia(iu)),e.matches?"dark":"light");const Xp="modulepreload",em=function(e){return"/"+e},oc={},Et=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=i(n.map(u=>{if(u=em(u),u in oc)return;oc[u]=!0;const d=u.endsWith(".css"),l=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${l}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Xp,d||(f.as="script"),f.crossOrigin="",f.href=u,c&&f.setAttribute("nonce",c),document.head.appendChild(f),d)return new Promise((p,v)=>{f.addEventListener("load",p),f.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},au=h.createContext(void 0),Qi=e=>{const t=h.useContext(au);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tm=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(au.Provider,{value:e,children:t})),nm={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var gn,Ki,Kl,rm=(Kl=class{constructor(){ie(this,gn,nm);ie(this,Ki,!1)}setTimeoutProvider(e){G(this,gn,e)}setTimeout(e,t){return S(this,gn).setTimeout(e,t)}clearTimeout(e){S(this,gn).clearTimeout(e)}setInterval(e,t){return S(this,gn).setInterval(e,t)}clearInterval(e){S(this,gn).clearInterval(e)}},gn=new WeakMap,Ki=new WeakMap,Kl);const In=new rm;function om(e){setTimeout(e,0)}const sm=typeof window>"u"||"Deno"in globalThis;function vt(){}function im(e,t){return typeof e=="function"?e(t):e}function cu(e){return typeof e=="number"&&e>=0&&e!==1/0}function lu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ie(e,t){return typeof e=="function"?e(t):e}function sc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Yi(i,t.options))return!1}else if(!vr(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function ic(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Wr(t.options.mutationKey)!==Wr(s))return!1}else if(!vr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Yi(e,t){return((t==null?void 0:t.queryKeyHashFn)||Wr)(e)}function Wr(e){return JSON.stringify(e,(t,n)=>Qs(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function vr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(!vr(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!vr(e[r],t[r]))return!1;return!0}return!1}const am=Object.prototype.hasOwnProperty;function uu(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=ac(e)&&ac(t);if(!r&&!(Qs(e)&&Qs(t)))return t;const o=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),i=s.length,a=r?new Array(i):{};let c=0;for(let u=0;u<i;u++){const d=r?u:s[u],l=e[d],f=t[d];if(l===f){a[d]=l,(r?u<o:am.call(e,d))&&c++;continue}if(l===null||f===null||typeof l!="object"||typeof f!="object"){a[d]=f;continue}const p=uu(l,f,n+1);a[d]=p,p===l&&c++}return o===i&&c===o?e:a}function Ps(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function ac(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qs(e){if(!cc(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!cc(r)||!r.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function cc(e){return Object.prototype.toString.call(e)==="[object Object]"}function cm(e){return new Promise(t=>{In.setTimeout(t,e)})}function Ys(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?uu(e,t):t}function S2(e){return e}function lm(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function um(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const Ji=Symbol();function du(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ji?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fu(e,t){return typeof e=="function"?e(...t):!!e}function dm(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}let fm=()=>sm;const Xi=()=>fm();var oo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},An,vn,or,Gl,hm=(Gl=class extends oo{constructor(){super();ie(this,An);ie(this,vn);ie(this,or);G(this,or,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,vn)||this.setEventListener(S(this,or))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,vn))==null||t.call(this),G(this,vn,void 0))}setEventListener(t){var n;G(this,or,t),(n=S(this,vn))==null||n.call(this),G(this,vn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){S(this,An)!==t&&(G(this,An,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof S(this,An)=="boolean"?S(this,An):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},An=new WeakMap,vn=new WeakMap,or=new WeakMap,Gl);const ea=new hm,pm=om;function mm(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=pm;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}const tt=mm();var sr,yn,ir,ql,gm=(ql=class extends oo{constructor(){super();ie(this,sr,!0);ie(this,yn);ie(this,ir);G(this,ir,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){S(this,yn)||this.setEventListener(S(this,ir))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,yn))==null||t.call(this),G(this,yn,void 0))}setEventListener(t){var n;G(this,ir,t),(n=S(this,yn))==null||n.call(this),G(this,yn,t(this.setOnline.bind(this)))}setOnline(t){S(this,sr)!==t&&(G(this,sr,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return S(this,sr)}},sr=new WeakMap,yn=new WeakMap,ir=new WeakMap,ql);const Ho=new gm;function vm(e){return Math.min(1e3*2**e,3e4)}function hu(e){return(e??"online")==="online"?Ho.isOnline():!0}var Js=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pu(e){let t=!1,n=0,r,o="pending",s,i;const a=new Promise((x,_)=>{s=x,i=_});a.catch(vt);const c=()=>o!=="pending",u=x=>{var _;if(!c()){const C=new Js(x);g(C),(_=e.onCancel)==null||_.call(e,C)}},d=()=>{t=!0},l=()=>{t=!1},f=()=>ea.isFocused()&&(e.networkMode==="always"||Ho.isOnline())&&e.canRun(),p=()=>hu(e.networkMode)&&e.canRun(),v=x=>{c()||(r==null||r(),o="resolved",s(x))},g=x=>{c()||(r==null||r(),o="rejected",i(x))},w=x=>new Promise(_=>{var C;r=E=>{(c()||x())&&_(E)},(C=e.onPause)==null||C.call(e)}).then(()=>{var _;r=void 0,c()||(_=e.onContinue)==null||_.call(e)}),b=()=>{if(c())return;let x;const _=n===0?e.initialPromise:void 0;try{x=_??e.fn()}catch(C){x=Promise.reject(C)}Promise.resolve(x).then(v).catch(C=>{var A;if(c())return;const E=e.retry??(Xi()?0:3),P=e.retryDelay??vm,R=typeof P=="function"?P(n,C):P,T=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,C);if(t||!T){g(C);return}n++,(A=e.onFail)==null||A.call(e,n,C),cm(R).then(()=>f()?void 0:w(f)).then(()=>{t?g(C):b()})})};return{promise:a,status:()=>o,cancel:u,continue:()=>(r==null||r(),a),cancelRetry:d,continueRetry:l,canStart:p,start:()=>(p()?b():w(p).then(b),a)}}var Nn,Ql,mu=(Ql=class{constructor(){ie(this,Nn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cu(this.gcTime)&&G(this,Nn,In.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xi()?1/0:3e5))}clearGcTimeout(){S(this,Nn)!==void 0&&(In.clearTimeout(S(this,Nn)),G(this,Nn,void 0))}},Nn=new WeakMap,Ql);function ym(e){return{onFetch:(t,n)=>{var d,l,f,p,v;const r=t.options,o=(f=(l=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:l.fetchMore)==null?void 0:f.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((v=t.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const w=_=>{dm(_,()=>t.signal,()=>g=!0)},b=du(t.options,t.fetchOptions),x=async(_,C,E)=>{if(g)return Promise.reject(t.signal.reason);if(C==null&&_.pages.length)return Promise.resolve(_);const R=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};return w(F),F})(),T=await b(R),{maxPages:A}=t.options,j=E?um:lm;return{pages:j(_.pages,T,A),pageParams:j(_.pageParams,C,A)}};if(o&&s.length){const _=o==="backward",C=_?bm:lc,E={pages:s,pageParams:i};a=await x(E,C(r,E),_)}else{const _=e??s.length;do{const C=c===0?i[0]??r.initialPageParam:lc(r,a);if(c>0&&C==null)break;a=await x(a,C),c++}while(c<_)}return a};t.options.persister?t.fetchFn=()=>{var g,w;return(w=(g=t.options).persister)==null?void 0:w.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function lc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function bm(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ar,Dn,cr,Ot,Mn,qe,Xr,jn,Nt,Kt,Yl,wm=(Yl=class extends mu{constructor(t){super();ie(this,Nt);ie(this,ar);ie(this,Dn);ie(this,cr);ie(this,Ot);ie(this,Mn);ie(this,qe);ie(this,Xr);ie(this,jn);G(this,jn,!1),G(this,Xr,t.defaultOptions),this.setOptions(t.options),this.observers=[],G(this,Mn,t.client),G(this,Ot,S(this,Mn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,G(this,Dn,dc(this.options)),this.state=t.state??S(this,Dn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return S(this,ar)}get promise(){var t;return(t=S(this,qe))==null?void 0:t.promise}setOptions(t){if(this.options={...S(this,Xr),...t},t!=null&&t._type&&G(this,ar,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=dc(this.options);n.data!==void 0&&(this.setState(uc(n.data,n.dataUpdatedAt)),G(this,Dn,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,Ot).remove(this)}setData(t,n){const r=Ys(this.state.data,t,this.options);return pe(this,Nt,Kt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){pe(this,Nt,Kt).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=S(this,qe))==null?void 0:r.promise;return(o=S(this,qe))==null||o.cancel(t),n?n.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return S(this,Dn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ie(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ji||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ie(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!lu(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=S(this,qe))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=S(this,qe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),S(this,Ot).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(S(this,qe)&&(S(this,jn)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?S(this,qe).cancel({revert:!0}):S(this,qe).cancelRetry()),this.scheduleGc()),S(this,Ot).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pe(this,Nt,Kt).call(this,{type:"invalidate"})}async fetch(t,n){var u,d,l,f,p,v,g,w,b,x,_,C;if(this.state.fetchStatus!=="idle"&&((u=S(this,qe))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(S(this,qe))return S(this,qe).continueRetry(),S(this,qe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(P=>P.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,o=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(G(this,jn,!0),r.signal)})},s=()=>{const E=du(this.options,n),R=(()=>{const T={client:S(this,Mn),queryKey:this.queryKey,meta:this.meta};return o(T),T})();return G(this,jn,!1),this.options.persister?this.options.persister(E,R,this):E(R)},a=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:S(this,Mn),state:this.state,fetchFn:s};return o(E),E})();(d=S(this,ar)==="infinite"?ym(this.options.pages):this.options.behavior)==null||d.onFetch(a,this),G(this,cr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=a.fetchOptions)==null?void 0:l.meta))&&pe(this,Nt,Kt).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const c=G(this,qe,pu({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:E=>{E instanceof Js&&E.revert&&this.setState({...S(this,cr),fetchStatus:"idle"}),r.abort()},onFail:(E,P)=>{pe(this,Nt,Kt).call(this,{type:"failed",failureCount:E,error:P})},onPause:()=>{pe(this,Nt,Kt).call(this,{type:"pause"})},onContinue:()=>{pe(this,Nt,Kt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const E=await c.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(v=(p=S(this,Ot).config).onSuccess)==null||v.call(p,E,this),(w=(g=S(this,Ot).config).onSettled)==null||w.call(g,E,this.state.error,this),E}catch(E){if(E instanceof Js){if(E.silent)return S(this,qe).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw pe(this,Nt,Kt).call(this,{type:"error",error:E}),(x=(b=S(this,Ot).config).onError)==null||x.call(b,E,this),(C=(_=S(this,Ot).config).onSettled)==null||C.call(_,this.state.data,E,this),E}finally{S(this,qe)===c&&G(this,qe,void 0),this.scheduleGc()}}},ar=new WeakMap,Dn=new WeakMap,cr=new WeakMap,Ot=new WeakMap,Mn=new WeakMap,qe=new WeakMap,Xr=new WeakMap,jn=new WeakMap,Nt=new WeakSet,Kt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...gu(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...uc(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return G(this,cr,t.manual?o:void 0),o;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),tt.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),S(this,Ot).notify({query:this,type:"updated",action:t})})},Yl);function gu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hu(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var dt,ge,eo,ft,$n,lr,Qt,to,ur,dr,zn,Fn,bn,fr,Se,Fr,Xs,ei,ti,ni,ri,oi,si,ii,Jl,_m=(Jl=class extends oo{constructor(t,n){super();ie(this,Se);ie(this,dt);ie(this,ge);ie(this,eo);ie(this,ft);ie(this,$n);ie(this,lr);ie(this,Qt);ie(this,to);ie(this,ur);ie(this,dr);ie(this,zn);ie(this,Fn);ie(this,bn);ie(this,fr,new Set);this.options=n,G(this,dt,t),G(this,Qt,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(S(this,ge).addObserver(this),fc(S(this,ge),this.options)?pe(this,Se,Fr).call(this):this.updateResult(),pe(this,Se,ri).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ai(S(this,ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ai(S(this,ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pe(this,Se,oi).call(this),pe(this,Se,si).call(this),S(this,ge).removeObserver(this)}setOptions(t){const n=this.options,r=S(this,ge);if(this.options=S(this,dt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ie(this.options.enabled,S(this,ge))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pe(this,Se,ii).call(this),S(this,ge).setOptions(this.options),n._defaulted&&!Ps(this.options,n)&&S(this,dt).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,ge),observer:this});const o=this.hasListeners();o&&hc(S(this,ge),r,this.options,n)&&pe(this,Se,Fr).call(this),this.updateResult(),o&&(S(this,ge)!==r||Ie(this.options.enabled,S(this,ge))!==Ie(n.enabled,S(this,ge))||Ie(this.options.staleTime,S(this,ge))!==Ie(n.staleTime,S(this,ge)))&&pe(this,Se,ei).call(this);const s=pe(this,Se,ti).call(this);o&&(S(this,ge)!==r||Ie(this.options.enabled,S(this,ge))!==Ie(n.enabled,S(this,ge))||s!==S(this,bn))&&pe(this,Se,ni).call(this,s)}getOptimisticResult(t){const n=S(this,dt).getQueryCache().build(S(this,dt),t),r=this.createResult(n,t);return Ps(this.getCurrentResult(),r)||(G(this,ft,r),G(this,lr,this.options),G(this,$n,S(this,ge).state)),r}getCurrentResult(){return S(this,ft)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){S(this,fr).add(t)}getCurrentQuery(){return S(this,ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=S(this,dt).defaultQueryOptions(t),r=S(this,dt).getQueryCache().build(S(this,dt),n);let o=()=>{},s;const i=new Promise(a=>{s=a,o=S(this,dt).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(o(),a(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const a=this.createResult(r,n);return s==null||s(a),a}).finally(()=>{o()}),i])}fetch(t){return pe(this,Se,Fr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,ft)))}createResult(t,n){var P;const r=S(this,ge),o=this.options,s=S(this,ft),i=S(this,$n),a=S(this,lr),c=t!==r?t.state:S(this,eo),{state:u}=t;let d={...u},l=!1,f;if(n._optimisticResults){const R=this.hasListeners(),T=!R&&fc(t,n),A=R&&hc(t,r,n,o);(T||A)&&(d={...d,...gu(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:v,status:g}=d;f=d.data;let w=!1;if(n.placeholderData!==void 0&&f===void 0&&g==="pending"){let R;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(R=s.data,w=!0):R=typeof n.placeholderData=="function"?n.placeholderData((P=S(this,dr))==null?void 0:P.state.data,S(this,dr)):n.placeholderData,R!==void 0&&(g="success",f=Ys(s==null?void 0:s.data,R,n),l=!0)}if(n.select&&f!==void 0&&!w)if(s&&f===(i==null?void 0:i.data)&&n.select===S(this,to))f=S(this,ur);else try{G(this,to,n.select),f=n.select(f),f=Ys(s==null?void 0:s.data,f,n),G(this,ur,f),G(this,Qt,null)}catch(R){G(this,Qt,R)}else f===void 0&&G(this,Qt,null);S(this,Qt)&&(p=S(this,Qt),f=S(this,ur),v=Date.now(),g="error",l=!1);const b=d.fetchStatus==="fetching",x=g==="pending",_=g==="error",C=x&&b,E=f!==void 0;return{status:g,fetchStatus:d.fetchStatus,isPending:x,isSuccess:g==="success",isError:_,isInitialLoading:C,isLoading:C,data:f,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:_&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:l,isRefetchError:_&&E,isStale:ta(t,n),refetch:this.refetch,isEnabled:Ie(n.enabled,t)!==!1}}updateResult(){const t=S(this,ft),n=this.createResult(S(this,ge),this.options);if(G(this,$n,S(this,ge).state),G(this,lr,this.options),S(this,$n).data!==void 0&&G(this,dr,S(this,ge)),Ps(n,t))return;G(this,ft,n);const o=(()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!S(this,fr).size)return!0;const a=new Set(i??S(this,fr));return this.options.throwOnError&&a.add("error"),Object.keys(S(this,ft)).some(c=>{const u=c;return S(this,ft)[u]!==t[u]&&a.has(u)})})();tt.batch(()=>{o&&this.listeners.forEach(s=>{s(S(this,ft))}),S(this,dt).getQueryCache().notify({query:S(this,ge),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pe(this,Se,ri).call(this)}},dt=new WeakMap,ge=new WeakMap,eo=new WeakMap,ft=new WeakMap,$n=new WeakMap,lr=new WeakMap,Qt=new WeakMap,to=new WeakMap,ur=new WeakMap,dr=new WeakMap,zn=new WeakMap,Fn=new WeakMap,bn=new WeakMap,fr=new WeakMap,Se=new WeakSet,Fr=function(t){pe(this,Se,ii).call(this);let n=S(this,ge).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vt)),n},Xs=function(t){return!Xi()&&Ie(this.options.enabled,S(this,ge))!==!1&&cu(t)},ei=function(){pe(this,Se,oi).call(this);const t=Ie(this.options.staleTime,S(this,ge));if(S(this,ft).isStale||!pe(this,Se,Xs).call(this,t))return;const n=lu(S(this,ft).dataUpdatedAt,t)+1;G(this,zn,In.setTimeout(()=>{S(this,ft).isStale||this.updateResult()},n))},ti=function(){return Ie(this.options.refetchInterval,S(this,ge))??!1},ni=function(t){pe(this,Se,si).call(this),G(this,bn,t),!(S(this,bn)===0||!pe(this,Se,Xs).call(this,S(this,bn)))&&G(this,Fn,In.setInterval(()=>{(this.options.refetchIntervalInBackground||ea.isFocused())&&pe(this,Se,Fr).call(this)},S(this,bn)))},ri=function(){pe(this,Se,ei).call(this),pe(this,Se,ni).call(this,pe(this,Se,ti).call(this))},oi=function(){S(this,zn)!==void 0&&(In.clearTimeout(S(this,zn)),G(this,zn,void 0))},si=function(){S(this,Fn)!==void 0&&(In.clearInterval(S(this,Fn)),G(this,Fn,void 0))},ii=function(){const t=S(this,dt).getQueryCache().build(S(this,dt),this.options);if(t===S(this,ge))return;const n=S(this,ge);G(this,ge,t),G(this,eo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Jl);function xm(e,t){return Ie(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ie(t.retryOnMount,e)===!1)}function fc(e,t){return xm(e,t)||e.state.data!==void 0&&ai(e,t,t.refetchOnMount)}function ai(e,t,n){if(Ie(t.enabled,e)!==!1&&Ie(t.staleTime,e)!=="static"){const r=Ie(n,e);return r==="always"||r!==!1&&ta(e,t)}return!1}function hc(e,t,n,r){return(e!==t||Ie(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ta(e,n)}function ta(e,t){return Ie(t.enabled,e)!==!1&&e.isStaleByTime(Ie(t.staleTime,e))}var no,Ft,it,Ln,Lt,hn,Xl,Sm=(Xl=class extends mu{constructor(t){super();ie(this,Lt);ie(this,no);ie(this,Ft);ie(this,it);ie(this,Ln);G(this,no,t.client),this.mutationId=t.mutationId,G(this,it,t.mutationCache),G(this,Ft,[]),this.state=t.state||Em(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){S(this,Ft).includes(t)||(S(this,Ft).push(t),this.clearGcTimeout(),S(this,it).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){G(this,Ft,S(this,Ft).filter(n=>n!==t)),this.scheduleGc(),S(this,it).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){S(this,Ft).length||(this.state.status==="pending"?this.scheduleGc():S(this,it).remove(this))}continue(){var t;return((t=S(this,Ln))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var a,c,u,d,l,f,p,v,g,w,b,x,_,C,E,P,R,T;const n=()=>{pe(this,Lt,hn).call(this,{type:"continue"})},r={client:S(this,no),meta:this.options.meta,mutationKey:this.options.mutationKey},o=G(this,Ln,pu({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,j)=>{pe(this,Lt,hn).call(this,{type:"failed",failureCount:A,error:j})},onPause:()=>{pe(this,Lt,hn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,it).canRun(this)})),s=this.state.status==="pending",i=!o.canStart();try{if(s)n();else{pe(this,Lt,hn).call(this,{type:"pending",variables:t,isPaused:i}),S(this,it).config.onMutate&&await S(this,it).config.onMutate(t,this,r);const j=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t,r));j!==this.state.context&&pe(this,Lt,hn).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const A=await o.start();return await((d=(u=S(this,it).config).onSuccess)==null?void 0:d.call(u,A,t,this.state.context,this,r)),await((f=(l=this.options).onSuccess)==null?void 0:f.call(l,A,t,this.state.context,r)),await((v=(p=S(this,it).config).onSettled)==null?void 0:v.call(p,A,null,this.state.variables,this.state.context,this,r)),await((w=(g=this.options).onSettled)==null?void 0:w.call(g,A,null,t,this.state.context,r)),pe(this,Lt,hn).call(this,{type:"success",data:A}),A}catch(A){try{await((x=(b=S(this,it).config).onError)==null?void 0:x.call(b,A,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((C=(_=this.options).onError)==null?void 0:C.call(_,A,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((P=(E=S(this,it).config).onSettled)==null?void 0:P.call(E,void 0,A,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((T=(R=this.options).onSettled)==null?void 0:T.call(R,void 0,A,t,this.state.context,r))}catch(j){Promise.reject(j)}throw pe(this,Lt,hn).call(this,{type:"error",error:A}),A}finally{S(this,Ln)===o&&G(this,Ln,void 0),S(this,it).runNext(this)}}},no=new WeakMap,Ft=new WeakMap,it=new WeakMap,Ln=new WeakMap,Lt=new WeakSet,hn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),tt.batch(()=>{S(this,Ft).forEach(r=>{r.onMutationUpdate(t)}),S(this,it).notify({mutation:this,type:"updated",action:t})})},Xl);function Em(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yt,Dt,ro,eu,Cm=(eu=class extends oo{constructor(t={}){super();ie(this,Yt);ie(this,Dt);ie(this,ro);this.config=t,G(this,Yt,new Set),G(this,Dt,new Map),G(this,ro,0)}build(t,n,r){const o=new Sm({client:t,mutationCache:this,mutationId:++po(this,ro)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){S(this,Yt).add(t);const n=go(t);if(typeof n=="string"){const r=S(this,Dt).get(n);r?r.push(t):S(this,Dt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(S(this,Yt).delete(t)){const n=go(t);if(typeof n=="string"){const r=S(this,Dt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&S(this,Dt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=go(t);if(typeof n=="string"){const o=(r=S(this,Dt).get(n))==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r,o;const n=go(t);return typeof n=="string"?((o=(r=S(this,Dt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused))==null?void 0:o.continue())??Promise.resolve():Promise.resolve()}clear(){tt.batch(()=>{S(this,Yt).forEach(t=>{this.notify({type:"removed",mutation:t})}),S(this,Yt).clear(),S(this,Dt).clear()})}getAll(){return Array.from(S(this,Yt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ic(n,r))}findAll(t={}){return this.getAll().filter(n=>ic(t,n))}notify(t){tt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return tt.batch(()=>Promise.all(t.map(n=>n.continue().catch(vt))))}},Yt=new WeakMap,Dt=new WeakMap,ro=new WeakMap,eu);function go(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Vt,tu,km=(tu=class extends oo{constructor(t={}){super();ie(this,Vt);this.config=t,G(this,Vt,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Yi(o,n);let i=this.get(s);return i||(i=new wm({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){S(this,Vt).has(t.queryHash)||(S(this,Vt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){S(this,Vt).get(t.queryHash)===t&&(t.destroy(),S(this,Vt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){tt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return S(this,Vt).get(t)}getAll(){return[...S(this,Vt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>sc(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>sc(t,r)):n}notify(t){tt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){tt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){tt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vt=new WeakMap,tu),De,wn,_n,hr,pr,xn,mr,gr,nu,Om=(nu=class{constructor(e={}){ie(this,De);ie(this,wn);ie(this,_n);ie(this,hr);ie(this,pr);ie(this,xn);ie(this,mr);ie(this,gr);G(this,De,e.queryCache||new km),G(this,wn,e.mutationCache||new Cm),G(this,_n,e.defaultOptions||{}),G(this,hr,new Map),G(this,pr,new Map),G(this,xn,0)}mount(){po(this,xn)._++,S(this,xn)===1&&(G(this,mr,ea.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,De).onFocus())})),G(this,gr,Ho.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,De).onOnline())})))}unmount(){var e,t;po(this,xn)._--,S(this,xn)===0&&((e=S(this,mr))==null||e.call(this),G(this,mr,void 0),(t=S(this,gr))==null||t.call(this),G(this,gr,void 0))}isFetching(e){return S(this,De).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return S(this,wn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,De).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=S(this,De).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ie(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return S(this,De).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var i;const r=this.defaultQueryOptions({queryKey:e}),o=(i=S(this,De).get(r.queryHash))==null?void 0:i.state.data,s=im(t,o);if(s!==void 0)return S(this,De).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return tt.batch(()=>S(this,De).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,De).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=S(this,De);tt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=S(this,De);return tt.batch(()=>{const r=n.findAll(e),o=new Set(r);return r.forEach(s=>{s.reset()}),this.refetchQueries({type:"active",predicate:s=>o.has(s)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=tt.batch(()=>S(this,De).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(vt).catch(vt)}invalidateQueries(e,t={}){return tt.batch(()=>(S(this,De).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=tt.batch(()=>S(this,De).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(vt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vt)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(this,De).build(this,t),r=n.isStaleByTime(Ie(t.staleTime,n))?await n.fetch(t):n.state.data,o=t.select;return o?o(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(this,De).build(this,t);return n.isStaleByTime(Ie(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vt).catch(vt)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vt).catch(vt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ho.isOnline()?S(this,wn).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,De)}getMutationCache(){return S(this,wn)}getDefaultOptions(){return S(this,_n)}setDefaultOptions(e){G(this,_n,e)}setQueryDefaults(e,t){S(this,hr).set(Wr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...S(this,hr).values()],n={};return t.forEach(r=>{vr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){S(this,pr).set(Wr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...S(this,pr).values()],n={};return t.forEach(r=>{vr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...S(this,_n).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Yi(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ji&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...S(this,_n).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){S(this,De).clear(),S(this,wn).clear()}},De=new WeakMap,wn=new WeakMap,_n=new WeakMap,hr=new WeakMap,pr=new WeakMap,xn=new WeakMap,mr=new WeakMap,gr=new WeakMap,nu);const vu=h.createContext(!1),Pm=()=>h.useContext(vu);vu.Provider;function Rm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Tm=h.createContext(Rm()),Im=()=>h.useContext(Tm),Am=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?fu(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Nm=e=>{h.useEffect(()=>{e.clearReset()},[e])},Dm=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||fu(n,[e.error,r])),Mm=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},jm=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,$m=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zm(e,t,n){const r=Pm(),o=Im(),s=Qi(),i=s.defaultQueryOptions(e),a=s.getQueryCache().get(i.queryHash),c=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Mm(i),Am(i,o,a),Nm(o);const[u]=h.useState(()=>new t(s,i)),d=u.getOptimisticResult(i),l=!r&&c;if(h.useSyncExternalStore(h.useCallback(f=>{const p=l?u.subscribe(tt.batchCalls(f)):vt;return u.updateResult(),p},[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),h.useEffect(()=>{u.setOptions(i)},[i,u]),jm(i,d))throw $m(i,u,o);if(Dm({result:d,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw d.error;return i.notifyOnChangeProps?d:u.trackResult(d)}function Wo(e,t){return zm(e,_m)}/**
|
|
3
|
-
* @license lucide-react v1.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-DK6TZbwh.js","assets/vendor-react-DTSdA8m-.js","assets/field-hint-qmBa0qqN.js","assets/vendor-router-B1pQim9Z.js","assets/Invite-D1uNMm0-.js","assets/pencil-DUZRZB3S.js","assets/ResetPassword-B-4Uyfwr.js","assets/AppCenter-DD_6LQx-.js","assets/search-input-B0s9mzRt.js","assets/select-CHbE6M4S.js","assets/index-D17hSi50.js","assets/dialog-Cugbp1C4.js","assets/tech-label-KAwM5qZ_.js","assets/trash-HEJmY7DQ.js","assets/badge-BjEnOmb0.js","assets/alert-dialog-C0mRms8g.js","assets/build-format-ofd2iIzf.js","assets/play-Z1L2Eb91.js","assets/useFocusAfterSwap-BdItkQCu.js","assets/useShownAfter-By1Yxysz.js","assets/QASession-d0eOjXXo.js","assets/useRelay-CES3I1Mt.js","assets/AndroidDeviceScreen-C55msKfh.js","assets/aiSession-U7UqgdSb.js","assets/video-DdHH0Q0l.js","assets/tabs-Bf7ou-eS.js","assets/publicLink-D6zKS_wu.js","assets/resource-health-oWJ8hy9X.js","assets/Runs-A7RcDLgO.js","assets/list-view-CyM0QUaH.js","assets/runs-CFQ6M4rx.js","assets/RunDetail-C50RjsuM.js","assets/slider-tyb3JvL2.js","assets/WatchedDevice-CpaKHa1x.js","assets/AISessionWatch-BSBkpTom.js","assets/MacResources-D2UeRbKL.js","assets/vendor-charts-BE7R_8yA.js","assets/Default-CQ3Ae2mK.js","assets/Team-VoGput2p.js","assets/Tokens-qkcJgunR.js","assets/NotFound-DVq_rCKc.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var nc=e=>{throw TypeError(e)};var ks=(e,t,n)=>t.has(e)||nc("Cannot "+n);var E=(e,t,n)=>(ks(e,t,"read from private field"),n?n.call(e):t.get(e)),ie=(e,t,n)=>t.has(e)?nc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),G=(e,t,n,r)=>(ks(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pe=(e,t,n)=>(ks(e,t,"access private method"),n);var po=(e,t,n,r)=>({set _(o){G(e,t,o,n)},get _(){return E(e,t,r)}});import{r as h,j as m,R as I,a as Tp,c as ee,b as Bn,d as ru,u as Ip,o as Ap,s as Np,f as Dp,e as Mp,h as jp,i as $p,l as zp,k as Fp,m as Lp}from"./vendor-react-DTSdA8m-.js";import{u as ou,a as su,L as mo,N as Gi,O as Vp,R as st,B as Up,b as Zp}from"./vendor-router-B1pQim9Z.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var Bp=(e,t,n,r,o,s,i,a)=>{let c=document.documentElement,u=["light","dark"];function d(p){(Array.isArray(e)?e:[e]).forEach(v=>{let g=v==="class",w=g&&s?o.map(b=>s[b]||b):o;g?(c.classList.remove(...w),c.classList.add(s&&s[p]?s[p]:p)):c.setAttribute(v,p)}),l(p)}function l(p){a&&u.includes(p)&&(c.style.colorScheme=p)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)d(r);else try{let p=localStorage.getItem(t)||n,v=i&&p==="system"?f():p;d(v)}catch{}},rc=["light","dark"],iu="(prefers-color-scheme: dark)",Hp=typeof window>"u",qi=h.createContext(void 0),Wp={setTheme:e=>{},themes:[]},ss=()=>{var e;return(e=h.useContext(qi))!=null?e:Wp},Kp=e=>h.useContext(qi)?h.createElement(h.Fragment,null,e.children):h.createElement(qp,{...e}),Gp=["light","dark"],qp=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:s=Gp,defaultTheme:i=n?"system":"light",attribute:a="data-theme",value:c,children:u,nonce:d,scriptProps:l})=>{let[f,p]=h.useState(()=>Yp(o,i)),[v,g]=h.useState(()=>f==="system"?Os():f),w=c?Object.values(c):s,b=h.useCallback(S=>{let P=S;if(!P)return;S==="system"&&n&&(P=Os());let R=c?c[P]:P,T=t?Jp(d):null,A=document.documentElement,j=F=>{F==="class"?(A.classList.remove(...w),R&&A.classList.add(R)):F.startsWith("data-")&&(R?A.setAttribute(F,R):A.removeAttribute(F))};if(Array.isArray(a)?a.forEach(j):j(a),r){let F=rc.includes(i)?i:null,z=rc.includes(P)?P:F;A.style.colorScheme=z}T==null||T()},[d]),x=h.useCallback(S=>{let P=typeof S=="function"?S(f):S;p(P);try{localStorage.setItem(o,P)}catch{}},[f]),_=h.useCallback(S=>{let P=Os(S);g(P),f==="system"&&n&&!e&&b("system")},[f,e]);h.useEffect(()=>{let S=window.matchMedia(iu);return S.addListener(_),_(S),()=>S.removeListener(_)},[_]),h.useEffect(()=>{let S=P=>{P.key===o&&(P.newValue?p(P.newValue):x(i))};return window.addEventListener("storage",S),()=>window.removeEventListener("storage",S)},[x]),h.useEffect(()=>{b(e??f)},[e,f]);let C=h.useMemo(()=>({theme:f,setTheme:x,forcedTheme:e,resolvedTheme:f==="system"?v:f,themes:n?[...s,"system"]:s,systemTheme:n?v:void 0}),[f,x,e,v,n,s]);return h.createElement(qi.Provider,{value:C},h.createElement(Qp,{forcedTheme:e,storageKey:o,attribute:a,enableSystem:n,enableColorScheme:r,defaultTheme:i,value:c,themes:s,nonce:d,scriptProps:l}),u)},Qp=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,themes:a,nonce:c,scriptProps:u})=>{if(typeof window<"u")return null;let d=JSON.stringify([n,t,s,e,a,i,r,o]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${Bp.toString()})(${d})`}})}),Yp=(e,t)=>{if(Hp)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Jp=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Os=e=>(e||(e=window.matchMedia(iu)),e.matches?"dark":"light");const Xp="modulepreload",em=function(e){return"/"+e},oc={},Et=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=i(n.map(u=>{if(u=em(u),u in oc)return;oc[u]=!0;const d=u.endsWith(".css"),l=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${l}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Xp,d||(f.as="script"),f.crossOrigin="",f.href=u,c&&f.setAttribute("nonce",c),document.head.appendChild(f),d)return new Promise((p,v)=>{f.addEventListener("load",p),f.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},au=h.createContext(void 0),Qi=e=>{const t=h.useContext(au);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tm=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(au.Provider,{value:e,children:t})),nm={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var mn,Ki,Kl,rm=(Kl=class{constructor(){ie(this,mn,nm);ie(this,Ki,!1)}setTimeoutProvider(e){G(this,mn,e)}setTimeout(e,t){return E(this,mn).setTimeout(e,t)}clearTimeout(e){E(this,mn).clearTimeout(e)}setInterval(e,t){return E(this,mn).setInterval(e,t)}clearInterval(e){E(this,mn).clearInterval(e)}},mn=new WeakMap,Ki=new WeakMap,Kl);const In=new rm;function om(e){setTimeout(e,0)}const sm=typeof window>"u"||"Deno"in globalThis;function vt(){}function im(e,t){return typeof e=="function"?e(t):e}function cu(e){return typeof e=="number"&&e>=0&&e!==1/0}function lu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ie(e,t){return typeof e=="function"?e(t):e}function sc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Yi(i,t.options))return!1}else if(!vr(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function ic(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Wr(t.options.mutationKey)!==Wr(s))return!1}else if(!vr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Yi(e,t){return((t==null?void 0:t.queryKeyHashFn)||Wr)(e)}function Wr(e){return JSON.stringify(e,(t,n)=>Qs(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function vr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(!vr(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!vr(e[r],t[r]))return!1;return!0}return!1}const am=Object.prototype.hasOwnProperty;function uu(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=ac(e)&&ac(t);if(!r&&!(Qs(e)&&Qs(t)))return t;const o=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),i=s.length,a=r?new Array(i):{};let c=0;for(let u=0;u<i;u++){const d=r?u:s[u],l=e[d],f=t[d];if(l===f){a[d]=l,(r?u<o:am.call(e,d))&&c++;continue}if(l===null||f===null||typeof l!="object"||typeof f!="object"){a[d]=f;continue}const p=uu(l,f,n+1);a[d]=p,p===l&&c++}return o===i&&c===o?e:a}function Ps(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function ac(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qs(e){if(!cc(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!cc(r)||!r.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function cc(e){return Object.prototype.toString.call(e)==="[object Object]"}function cm(e){return new Promise(t=>{In.setTimeout(t,e)})}function Ys(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?uu(e,t):t}function S2(e){return e}function lm(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function um(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const Ji=Symbol();function du(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ji?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fu(e,t){return typeof e=="function"?e(...t):!!e}function dm(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}let fm=()=>sm;const Xi=()=>fm();var oo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},An,gn,or,Gl,hm=(Gl=class extends oo{constructor(){super();ie(this,An);ie(this,gn);ie(this,or);G(this,or,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){E(this,gn)||this.setEventListener(E(this,or))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,gn))==null||t.call(this),G(this,gn,void 0))}setEventListener(t){var n;G(this,or,t),(n=E(this,gn))==null||n.call(this),G(this,gn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){E(this,An)!==t&&(G(this,An,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof E(this,An)=="boolean"?E(this,An):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},An=new WeakMap,gn=new WeakMap,or=new WeakMap,Gl);const ea=new hm,pm=om;function mm(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=pm;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}const tt=mm();var sr,vn,ir,ql,gm=(ql=class extends oo{constructor(){super();ie(this,sr,!0);ie(this,vn);ie(this,ir);G(this,ir,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){E(this,vn)||this.setEventListener(E(this,ir))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,vn))==null||t.call(this),G(this,vn,void 0))}setEventListener(t){var n;G(this,ir,t),(n=E(this,vn))==null||n.call(this),G(this,vn,t(this.setOnline.bind(this)))}setOnline(t){E(this,sr)!==t&&(G(this,sr,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return E(this,sr)}},sr=new WeakMap,vn=new WeakMap,ir=new WeakMap,ql);const Ho=new gm;function vm(e){return Math.min(1e3*2**e,3e4)}function hu(e){return(e??"online")==="online"?Ho.isOnline():!0}var Js=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pu(e){let t=!1,n=0,r,o="pending",s,i;const a=new Promise((x,_)=>{s=x,i=_});a.catch(vt);const c=()=>o!=="pending",u=x=>{var _;if(!c()){const C=new Js(x);g(C),(_=e.onCancel)==null||_.call(e,C)}},d=()=>{t=!0},l=()=>{t=!1},f=()=>ea.isFocused()&&(e.networkMode==="always"||Ho.isOnline())&&e.canRun(),p=()=>hu(e.networkMode)&&e.canRun(),v=x=>{c()||(r==null||r(),o="resolved",s(x))},g=x=>{c()||(r==null||r(),o="rejected",i(x))},w=x=>new Promise(_=>{var C;r=S=>{(c()||x())&&_(S)},(C=e.onPause)==null||C.call(e)}).then(()=>{var _;r=void 0,c()||(_=e.onContinue)==null||_.call(e)}),b=()=>{if(c())return;let x;const _=n===0?e.initialPromise:void 0;try{x=_??e.fn()}catch(C){x=Promise.reject(C)}Promise.resolve(x).then(v).catch(C=>{var A;if(c())return;const S=e.retry??(Xi()?0:3),P=e.retryDelay??vm,R=typeof P=="function"?P(n,C):P,T=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,C);if(t||!T){g(C);return}n++,(A=e.onFail)==null||A.call(e,n,C),cm(R).then(()=>f()?void 0:w(f)).then(()=>{t?g(C):b()})})};return{promise:a,status:()=>o,cancel:u,continue:()=>(r==null||r(),a),cancelRetry:d,continueRetry:l,canStart:p,start:()=>(p()?b():w(p).then(b),a)}}var Nn,Ql,mu=(Ql=class{constructor(){ie(this,Nn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cu(this.gcTime)&&G(this,Nn,In.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xi()?1/0:3e5))}clearGcTimeout(){E(this,Nn)!==void 0&&(In.clearTimeout(E(this,Nn)),G(this,Nn,void 0))}},Nn=new WeakMap,Ql);function ym(e){return{onFetch:(t,n)=>{var d,l,f,p,v;const r=t.options,o=(f=(l=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:l.fetchMore)==null?void 0:f.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((v=t.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const w=_=>{dm(_,()=>t.signal,()=>g=!0)},b=du(t.options,t.fetchOptions),x=async(_,C,S)=>{if(g)return Promise.reject(t.signal.reason);if(C==null&&_.pages.length)return Promise.resolve(_);const R=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:C,direction:S?"backward":"forward",meta:t.options.meta};return w(F),F})(),T=await b(R),{maxPages:A}=t.options,j=S?um:lm;return{pages:j(_.pages,T,A),pageParams:j(_.pageParams,C,A)}};if(o&&s.length){const _=o==="backward",C=_?bm:lc,S={pages:s,pageParams:i};a=await x(S,C(r,S),_)}else{const _=e??s.length;do{const C=c===0?i[0]===void 0?r.initialPageParam:i[0]:lc(r,a);if(c>0&&C==null)break;a=await x(a,C),c++}while(c<_)}return a};t.options.persister?t.fetchFn=()=>{var g,w;return(w=(g=t.options).persister)==null?void 0:w.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function lc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function bm(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ar,Dn,cr,Ot,Mn,qe,Xr,jn,Nt,Kt,Yl,wm=(Yl=class extends mu{constructor(t){super();ie(this,Nt);ie(this,ar);ie(this,Dn);ie(this,cr);ie(this,Ot);ie(this,Mn);ie(this,qe);ie(this,Xr);ie(this,jn);G(this,jn,!1),G(this,Xr,t.defaultOptions),this.setOptions(t.options),this.observers=[],G(this,Mn,t.client),G(this,Ot,E(this,Mn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,G(this,Dn,dc(this.options)),this.state=t.state??E(this,Dn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return E(this,ar)}get promise(){var t;return(t=E(this,qe))==null?void 0:t.promise}setOptions(t){if(this.options={...E(this,Xr),...t},t!=null&&t._type&&G(this,ar,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=dc(this.options);n.data!==void 0&&(this.setState(uc(n.data,n.dataUpdatedAt)),G(this,Dn,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,Ot).remove(this)}setData(t,n){const r=Ys(this.state.data,t,this.options);return pe(this,Nt,Kt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){pe(this,Nt,Kt).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=E(this,qe))==null?void 0:r.promise;return(o=E(this,qe))==null||o.cancel(t),n?n.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return E(this,Dn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ie(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ji||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ie(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!lu(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=E(this,qe))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=E(this,qe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,Ot).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(E(this,qe)&&(E(this,jn)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?E(this,qe).cancel({revert:!0}):E(this,qe).cancelRetry()),this.scheduleGc()),E(this,Ot).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pe(this,Nt,Kt).call(this,{type:"invalidate"})}async fetch(t,n){var u,d,l,f,p,v,g,w,b,x,_,C;if(this.state.fetchStatus!=="idle"&&((u=E(this,qe))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(E(this,qe))return E(this,qe).continueRetry(),E(this,qe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(P=>P.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(G(this,jn,!0),r.signal)})},s=()=>{const S=du(this.options,n),R=(()=>{const T={client:E(this,Mn),queryKey:this.queryKey,meta:this.meta};return o(T),T})();return G(this,jn,!1),this.options.persister?this.options.persister(S,R,this):S(R)},a=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:E(this,Mn),state:this.state,fetchFn:s};return o(S),S})();(d=E(this,ar)==="infinite"?ym(this.options.pages):this.options.behavior)==null||d.onFetch(a,this),G(this,cr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=a.fetchOptions)==null?void 0:l.meta))&&pe(this,Nt,Kt).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const c=G(this,qe,pu({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof Js&&S.revert&&this.setState({...E(this,cr),fetchStatus:"idle"}),r.abort()},onFail:(S,P)=>{pe(this,Nt,Kt).call(this,{type:"failed",failureCount:S,error:P})},onPause:()=>{pe(this,Nt,Kt).call(this,{type:"pause"})},onContinue:()=>{pe(this,Nt,Kt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await c.start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(v=(p=E(this,Ot).config).onSuccess)==null||v.call(p,S,this),(w=(g=E(this,Ot).config).onSettled)==null||w.call(g,S,this.state.error,this),S}catch(S){if(S instanceof Js){if(S.silent)return E(this,qe).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw pe(this,Nt,Kt).call(this,{type:"error",error:S}),(x=(b=E(this,Ot).config).onError)==null||x.call(b,S,this),(C=(_=E(this,Ot).config).onSettled)==null||C.call(_,this.state.data,S,this),S}finally{E(this,qe)===c&&G(this,qe,void 0),this.scheduleGc()}}},ar=new WeakMap,Dn=new WeakMap,cr=new WeakMap,Ot=new WeakMap,Mn=new WeakMap,qe=new WeakMap,Xr=new WeakMap,jn=new WeakMap,Nt=new WeakSet,Kt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...gu(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...uc(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return G(this,cr,t.manual?o:void 0),o;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),tt.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),E(this,Ot).notify({query:this,type:"updated",action:t})})},Yl);function gu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hu(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var dt,ge,eo,ft,$n,lr,Qt,to,ur,dr,zn,Fn,yn,fr,Se,Fr,Xs,ei,ti,ni,ri,oi,si,ii,Jl,_m=(Jl=class extends oo{constructor(t,n){super();ie(this,Se);ie(this,dt);ie(this,ge);ie(this,eo);ie(this,ft);ie(this,$n);ie(this,lr);ie(this,Qt);ie(this,to);ie(this,ur);ie(this,dr);ie(this,zn);ie(this,Fn);ie(this,yn);ie(this,fr,new Set);this.options=n,G(this,dt,t),G(this,Qt,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,ge).addObserver(this),fc(E(this,ge),this.options)?pe(this,Se,Fr).call(this):this.updateResult(),pe(this,Se,ri).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ai(E(this,ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ai(E(this,ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pe(this,Se,oi).call(this),pe(this,Se,si).call(this),E(this,ge).removeObserver(this)}setOptions(t){const n=this.options,r=E(this,ge);if(this.options=E(this,dt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ie(this.options.enabled,E(this,ge))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pe(this,Se,ii).call(this),E(this,ge).setOptions(this.options),n._defaulted&&!Ps(this.options,n)&&E(this,dt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,ge),observer:this});const o=this.hasListeners();o&&hc(E(this,ge),r,this.options,n)&&pe(this,Se,Fr).call(this),this.updateResult(),o&&(E(this,ge)!==r||Ie(this.options.enabled,E(this,ge))!==Ie(n.enabled,E(this,ge))||Ie(this.options.staleTime,E(this,ge))!==Ie(n.staleTime,E(this,ge)))&&pe(this,Se,ei).call(this);const s=pe(this,Se,ti).call(this);o&&(E(this,ge)!==r||Ie(this.options.enabled,E(this,ge))!==Ie(n.enabled,E(this,ge))||s!==E(this,yn))&&pe(this,Se,ni).call(this,s)}getOptimisticResult(t){const n=E(this,dt).getQueryCache().build(E(this,dt),t),r=this.createResult(n,t);return Ps(this.getCurrentResult(),r)||(G(this,ft,r),G(this,lr,this.options),G(this,$n,E(this,ge).state)),r}getCurrentResult(){return E(this,ft)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){E(this,fr).add(t)}getCurrentQuery(){return E(this,ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=E(this,dt).defaultQueryOptions(t),r=E(this,dt).getQueryCache().build(E(this,dt),n);let o=()=>{},s;const i=new Promise(a=>{s=a,o=E(this,dt).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(o(),a(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const a=this.createResult(r,n);return s==null||s(a),a}).finally(()=>{o()}),i])}fetch(t){return pe(this,Se,Fr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,ft)))}createResult(t,n){var P;const r=E(this,ge),o=this.options,s=E(this,ft),i=E(this,$n),a=E(this,lr),c=t!==r?t.state:E(this,eo),{state:u}=t;let d={...u},l=!1,f;if(n._optimisticResults){const R=this.hasListeners(),T=!R&&fc(t,n),A=R&&hc(t,r,n,o);(T||A)&&(d={...d,...gu(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:v,status:g}=d;f=d.data;let w=!1;if(n.placeholderData!==void 0&&f===void 0&&g==="pending"){let R;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(R=s.data,w=!0):R=typeof n.placeholderData=="function"?n.placeholderData((P=E(this,dr))==null?void 0:P.state.data,E(this,dr)):n.placeholderData,R!==void 0&&(g="success",f=Ys(s==null?void 0:s.data,R,n),l=!0)}if(n.select&&f!==void 0&&!w)if(s&&f===(i==null?void 0:i.data)&&n.select===E(this,to))f=E(this,ur);else try{G(this,to,n.select),f=n.select(f),f=Ys(s==null?void 0:s.data,f,n),G(this,ur,f),G(this,Qt,null)}catch(R){G(this,Qt,R)}else f===void 0&&G(this,Qt,null);E(this,Qt)&&(p=E(this,Qt),f=E(this,ur),v=Date.now(),g="error",l=!1);const b=d.fetchStatus==="fetching",x=g==="pending",_=g==="error",C=x&&b,S=f!==void 0;return{status:g,fetchStatus:d.fetchStatus,isPending:x,isSuccess:g==="success",isError:_,isInitialLoading:C,isLoading:C,data:f,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:_&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:l,isRefetchError:_&&S,isStale:ta(t,n),refetch:this.refetch,isEnabled:Ie(n.enabled,t)!==!1}}updateResult(){const t=E(this,ft),n=this.createResult(E(this,ge),this.options);if(G(this,$n,E(this,ge).state),G(this,lr,this.options),E(this,$n).data!==void 0&&G(this,dr,E(this,ge)),Ps(n,t))return;G(this,ft,n);const o=(()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!E(this,fr).size)return!0;const a=new Set(i??E(this,fr));return this.options.throwOnError&&a.add("error"),Object.keys(E(this,ft)).some(c=>{const u=c;return E(this,ft)[u]!==t[u]&&a.has(u)})})();tt.batch(()=>{o&&this.listeners.forEach(s=>{s(E(this,ft))}),E(this,dt).getQueryCache().notify({query:E(this,ge),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pe(this,Se,ri).call(this)}},dt=new WeakMap,ge=new WeakMap,eo=new WeakMap,ft=new WeakMap,$n=new WeakMap,lr=new WeakMap,Qt=new WeakMap,to=new WeakMap,ur=new WeakMap,dr=new WeakMap,zn=new WeakMap,Fn=new WeakMap,yn=new WeakMap,fr=new WeakMap,Se=new WeakSet,Fr=function(t){pe(this,Se,ii).call(this);let n=E(this,ge).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vt)),n},Xs=function(t){return!Xi()&&Ie(this.options.enabled,E(this,ge))!==!1&&cu(t)},ei=function(){pe(this,Se,oi).call(this);const t=Ie(this.options.staleTime,E(this,ge));if(E(this,ft).isStale||!pe(this,Se,Xs).call(this,t))return;const n=lu(E(this,ft).dataUpdatedAt,t)+1;G(this,zn,In.setTimeout(()=>{E(this,ft).isStale||this.updateResult()},n))},ti=function(){return Ie(this.options.refetchInterval,E(this,ge))??!1},ni=function(t){pe(this,Se,si).call(this),G(this,yn,t),!(E(this,yn)===0||!pe(this,Se,Xs).call(this,E(this,yn)))&&G(this,Fn,In.setInterval(()=>{(this.options.refetchIntervalInBackground||ea.isFocused())&&pe(this,Se,Fr).call(this)},E(this,yn)))},ri=function(){pe(this,Se,ei).call(this),pe(this,Se,ni).call(this,pe(this,Se,ti).call(this))},oi=function(){E(this,zn)!==void 0&&(In.clearTimeout(E(this,zn)),G(this,zn,void 0))},si=function(){E(this,Fn)!==void 0&&(In.clearInterval(E(this,Fn)),G(this,Fn,void 0))},ii=function(){const t=E(this,dt).getQueryCache().build(E(this,dt),this.options);if(t===E(this,ge))return;const n=E(this,ge);G(this,ge,t),G(this,eo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Jl);function xm(e,t){return Ie(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ie(t.retryOnMount,e)===!1)}function fc(e,t){return xm(e,t)||e.state.data!==void 0&&ai(e,t,t.refetchOnMount)}function ai(e,t,n){if(Ie(t.enabled,e)!==!1&&Ie(t.staleTime,e)!=="static"){const r=Ie(n,e);return r==="always"||r!==!1&&ta(e,t)}return!1}function hc(e,t,n,r){return(e!==t||Ie(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ta(e,n)}function ta(e,t){return Ie(t.enabled,e)!==!1&&e.isStaleByTime(Ie(t.staleTime,e))}var no,Ft,it,Ln,Lt,fn,Xl,Sm=(Xl=class extends mu{constructor(t){super();ie(this,Lt);ie(this,no);ie(this,Ft);ie(this,it);ie(this,Ln);G(this,no,t.client),this.mutationId=t.mutationId,G(this,it,t.mutationCache),G(this,Ft,[]),this.state=t.state||Em(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,Ft).includes(t)||(E(this,Ft).push(t),this.clearGcTimeout(),E(this,it).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){G(this,Ft,E(this,Ft).filter(n=>n!==t)),this.scheduleGc(),E(this,it).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,Ft).length||(this.state.status==="pending"?this.scheduleGc():E(this,it).remove(this))}continue(){var t;return((t=E(this,Ln))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var a,c,u,d,l,f,p,v,g,w,b,x,_,C,S,P,R,T;const n=()=>{pe(this,Lt,fn).call(this,{type:"continue"})},r={client:E(this,no),meta:this.options.meta,mutationKey:this.options.mutationKey},o=G(this,Ln,pu({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,j)=>{pe(this,Lt,fn).call(this,{type:"failed",failureCount:A,error:j})},onPause:()=>{pe(this,Lt,fn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,it).canRun(this)})),s=this.state.status==="pending",i=!o.canStart();try{if(s)n();else{pe(this,Lt,fn).call(this,{type:"pending",variables:t,isPaused:i}),E(this,it).config.onMutate&&await E(this,it).config.onMutate(t,this,r);const j=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t,r));j!==this.state.context&&pe(this,Lt,fn).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const A=await o.start();return await((d=(u=E(this,it).config).onSuccess)==null?void 0:d.call(u,A,t,this.state.context,this,r)),await((f=(l=this.options).onSuccess)==null?void 0:f.call(l,A,t,this.state.context,r)),await((v=(p=E(this,it).config).onSettled)==null?void 0:v.call(p,A,null,this.state.variables,this.state.context,this,r)),await((w=(g=this.options).onSettled)==null?void 0:w.call(g,A,null,t,this.state.context,r)),pe(this,Lt,fn).call(this,{type:"success",data:A}),A}catch(A){try{await((x=(b=E(this,it).config).onError)==null?void 0:x.call(b,A,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((C=(_=this.options).onError)==null?void 0:C.call(_,A,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((P=(S=E(this,it).config).onSettled)==null?void 0:P.call(S,void 0,A,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((T=(R=this.options).onSettled)==null?void 0:T.call(R,void 0,A,t,this.state.context,r))}catch(j){Promise.reject(j)}throw pe(this,Lt,fn).call(this,{type:"error",error:A}),A}finally{E(this,Ln)===o&&G(this,Ln,void 0),E(this,it).runNext(this)}}},no=new WeakMap,Ft=new WeakMap,it=new WeakMap,Ln=new WeakMap,Lt=new WeakSet,fn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),tt.batch(()=>{E(this,Ft).forEach(r=>{r.onMutationUpdate(t)}),E(this,it).notify({mutation:this,type:"updated",action:t})})},Xl);function Em(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bn,Dt,ro,eu,Cm=(eu=class extends oo{constructor(t={}){super();ie(this,bn);ie(this,Dt);ie(this,ro);this.config=t,G(this,bn,new Set),G(this,Dt,new Map),G(this,ro,0)}build(t,n,r){const o=new Sm({client:t,mutationCache:this,mutationId:++po(this,ro)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){E(this,bn).add(t);const n=go(t);if(typeof n=="string"){const r=E(this,Dt).get(n);r?r.push(t):E(this,Dt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,bn).delete(t)){const n=go(t);if(typeof n=="string"){const r=E(this,Dt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&E(this,Dt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=go(t);if(typeof n=="string"){const o=(r=E(this,Dt).get(n))==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r,o;const n=go(t);return typeof n=="string"?((o=(r=E(this,Dt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused))==null?void 0:o.continue())??Promise.resolve():Promise.resolve()}clear(){tt.batch(()=>{const t=this.getAll();E(this,bn).clear(),E(this,Dt).clear(),t.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(E(this,bn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ic(n,r))}findAll(t={}){return this.getAll().filter(n=>ic(t,n))}notify(t){tt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return tt.batch(()=>Promise.all(t.map(n=>n.continue().catch(vt))))}},bn=new WeakMap,Dt=new WeakMap,ro=new WeakMap,eu);function go(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Vt,tu,km=(tu=class extends oo{constructor(t={}){super();ie(this,Vt);this.config=t,G(this,Vt,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Yi(o,n);let i=this.get(s);return i||(i=new wm({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){E(this,Vt).has(t.queryHash)||(E(this,Vt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){E(this,Vt).get(t.queryHash)===t&&(t.destroy(),E(this,Vt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){tt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,Vt).get(t)}getAll(){return[...E(this,Vt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>sc(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>sc(t,r)):n}notify(t){tt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){tt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){tt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vt=new WeakMap,tu),De,wn,_n,hr,pr,xn,mr,gr,nu,Om=(nu=class{constructor(e={}){ie(this,De);ie(this,wn);ie(this,_n);ie(this,hr);ie(this,pr);ie(this,xn);ie(this,mr);ie(this,gr);G(this,De,e.queryCache||new km),G(this,wn,e.mutationCache||new Cm),G(this,_n,e.defaultOptions||{}),G(this,hr,new Map),G(this,pr,new Map),G(this,xn,0)}mount(){po(this,xn)._++,E(this,xn)===1&&(G(this,mr,ea.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,De).onFocus())})),G(this,gr,Ho.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,De).onOnline())})))}unmount(){var e,t;po(this,xn)._--,E(this,xn)===0&&((e=E(this,mr))==null||e.call(this),G(this,mr,void 0),(t=E(this,gr))==null||t.call(this),G(this,gr,void 0))}isFetching(e){return E(this,De).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return E(this,wn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=E(this,De).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=E(this,De).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ie(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return E(this,De).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var i;const r=this.defaultQueryOptions({queryKey:e}),o=(i=E(this,De).get(r.queryHash))==null?void 0:i.state.data,s=im(t,o);if(s!==void 0)return E(this,De).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return tt.batch(()=>E(this,De).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=E(this,De).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=E(this,De);tt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=E(this,De);return tt.batch(()=>{const r=n.findAll(e),o=new Set(r);return r.forEach(s=>{s.reset()}),this.refetchQueries({type:"active",predicate:s=>o.has(s)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=tt.batch(()=>E(this,De).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(vt).catch(vt)}invalidateQueries(e,t={}){return tt.batch(()=>(E(this,De).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=tt.batch(()=>E(this,De).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(vt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vt)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=E(this,De).build(this,t),r=n.isStaleByTime(Ie(t.staleTime,n))?await n.fetch(t):n.state.data,o=t.select;return o?o(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=E(this,De).build(this,t);return n.isStaleByTime(Ie(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vt).catch(vt)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vt).catch(vt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ho.isOnline()?E(this,wn).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,De)}getMutationCache(){return E(this,wn)}getDefaultOptions(){return E(this,_n)}setDefaultOptions(e){G(this,_n,e)}setQueryDefaults(e,t){E(this,hr).set(Wr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...E(this,hr).values()],n={};return t.forEach(r=>{vr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){E(this,pr).set(Wr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...E(this,pr).values()],n={};return t.forEach(r=>{vr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...E(this,_n).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Yi(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ji&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...E(this,_n).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){E(this,De).clear(),E(this,wn).clear()}},De=new WeakMap,wn=new WeakMap,_n=new WeakMap,hr=new WeakMap,pr=new WeakMap,xn=new WeakMap,mr=new WeakMap,gr=new WeakMap,nu);const vu=h.createContext(!1),Pm=()=>h.useContext(vu);vu.Provider;function Rm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Tm=h.createContext(Rm()),Im=()=>h.useContext(Tm),Am=(e,t,n)=>{const r=(n==null?void 0:n.state.status)==="error"&&typeof e.throwOnError=="function"?fu(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Nm=e=>{h.useEffect(()=>{e.clearReset()},[e])},Dm=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||fu(n,[e.error,r])),Mm=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},jm=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,$m=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zm(e,t,n){const r=Pm(),o=Im(),s=Qi(),i=s.defaultQueryOptions(e),a=s.getQueryCache().get(i.queryHash),c=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Mm(i),Am(i,o,a),Nm(o);const[u]=h.useState(()=>new t(s,i)),d=u.getOptimisticResult(i),l=!r&&c;if(h.useSyncExternalStore(h.useCallback(f=>{const p=l?u.subscribe(tt.batchCalls(f)):vt;return u.updateResult(),p},[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),h.useEffect(()=>{u.setOptions(i)},[i,u]),jm(i,d))throw $m(i,u,o);if(Dm({result:d,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw d.error;return i.notifyOnChangeProps?d:u.trackResult(d)}function Wo(e,t){return zm(e,_m)}/**
|
|
3
|
+
* @license lucide-react v1.59.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/const Fm=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
8
|
-
* @license lucide-react v1.
|
|
8
|
+
* @license lucide-react v1.59.0 - ISC
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/function Lm(e,t,n=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Fm(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}/**
|
|
13
|
-
* @license lucide-react v1.
|
|
13
|
+
* @license lucide-react v1.59.0 - ISC
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|
|
16
16
|
* See the LICENSE file in the root directory of this source tree.
|
|
17
17
|
*/const Vm=e=>{let t="",n=!1;for(const r of e){if(r==="-"||r==="_"||r<=" "){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t};/**
|
|
18
|
-
* @license lucide-react v1.
|
|
18
|
+
* @license lucide-react v1.59.0 - ISC
|
|
19
19
|
*
|
|
20
20
|
* This source code is licensed under the ISC license.
|
|
21
21
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
22
|
*/const Um=e=>{const t=Vm(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
23
|
-
* @license lucide-react v1.
|
|
23
|
+
* @license lucide-react v1.59.0 - ISC
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/const ci=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
28
|
-
* @license lucide-react v1.
|
|
28
|
+
* @license lucide-react v1.59.0 - ISC
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the ISC license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
32
|
*/const Tn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
33
|
-
* @license lucide-react v1.
|
|
33
|
+
* @license lucide-react v1.59.0 - ISC
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the ISC license.
|
|
36
36
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
37
|
*/function Rs(e){return e!=null}function Zm(e,t={}){var f,p;const n=t.attributeNames??{},r=v=>n[v]??v,o=e.size??e.width??Tn.width,s=e.size??e.height??Tn.height,i=((f=e.aliases)==null?void 0:f.filter(v=>typeof v=="string"&&v.trim()!=="").map(v=>`lucide-${v}`))??[],a=[...e.name?[`lucide-${e.name}`]:[],...i],c=((p=t.className)==null?void 0:p.split(" ").filter(Boolean))??[],u=t.includeDefaultClasses===!1?ci(...c):ci("lucide",...a,...c),d=t.absoluteStrokeWidth?Number(t.strokeWidth??Tn["stroke-width"])*Number(e.size??e.width??Tn.width)/Number(t.size??t.width??Tn.width):t.strokeWidth??Tn["stroke-width"];return["svg",{...Object.entries(Tn).reduce((v,[g,w])=>(v[r(g)]=w,v),{}),..."color"in t&&t.color&&{[r("stroke")]:t.color},..."size"in t&&Rs(t.size)&&{[r("width")]:t.size,[r("height")]:t.size},..."width"in t&&Rs(t.width)&&{[r("width")]:t.width},..."height"in t&&Rs(t.height)&&{[r("height")]:t.height},[r("stroke-width")]:d,...u&&{[r("class")]:u},[r("viewBox")]:`0 0 ${o} ${s}`,...t.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(v=>{const[g,w,b]=v,x=t.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...w}:w;return b?[g,x,b]:[g,x]})]}/**
|
|
38
|
-
* @license lucide-react v1.
|
|
38
|
+
* @license lucide-react v1.59.0 - ISC
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the ISC license.
|
|
41
41
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
42
|
*/function Bm(e,t={}){return Zm(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
43
|
-
* @license lucide-react v1.
|
|
43
|
+
* @license lucide-react v1.59.0 - ISC
|
|
44
44
|
*
|
|
45
45
|
* This source code is licensed under the ISC license.
|
|
46
46
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const Hm=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Wm=h.createContext({}),Km=()=>h.useContext(Wm),Gm=h.forwardRef(({color:e,size:t,width:n,height:r,strokeWidth:o,absoluteStrokeWidth:s,nonScalingStroke:i,className:a="",children:c,iconNode:u=[],icon:d={node:u,aliases:[],size:24},...l},f)=>{const{size:p=24,strokeWidth:v=2,absoluteStrokeWidth:g=!1,nonScalingStroke:w=!1,color:b="currentColor",className:x=""}=Km()??{},_=!!c||Hm(l),[C,
|
|
48
|
-
* @license lucide-react v1.
|
|
47
|
+
*/const Hm=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Wm=h.createContext({}),Km=()=>h.useContext(Wm),Gm=h.forwardRef(({color:e,size:t,width:n,height:r,strokeWidth:o,absoluteStrokeWidth:s,nonScalingStroke:i,className:a="",children:c,iconNode:u=[],icon:d={node:u,aliases:[],size:24},...l},f)=>{const{size:p=24,strokeWidth:v=2,absoluteStrokeWidth:g=!1,nonScalingStroke:w=!1,color:b="currentColor",className:x=""}=Km()??{},_=!!c||Hm(l),[C,S,P=[]]=Bm(d,{color:e??b,width:n??t??p,height:r??t??p,strokeWidth:o??v,absoluteStrokeWidth:s??g,nonScalingStroke:i??w,className:ci(x,a),hasA11yProp:_,attributes:l});return h.createElement(C,{ref:f,...S},[...P.map(([R,T])=>h.createElement(R,T)),...Array.isArray(c)?c:[c]])});/**
|
|
48
|
+
* @license lucide-react v1.59.0 - ISC
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the ISC license.
|
|
51
51
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/function Ge(e,t=[],n=[]){const r=typeof e=="string"?Lm(e,t,n):e,o=h.forwardRef(({className:s,...i},a)=>h.createElement(Gm,{ref:a,icon:r,className:s,...i}));return r.name&&(o.displayName=Um(r.name)),o}/**
|
|
53
|
-
* @license lucide-react v1.
|
|
53
|
+
* @license lucide-react v1.59.0 - ISC
|
|
54
54
|
*
|
|
55
55
|
* This source code is licensed under the ISC license.
|
|
56
56
|
* See the LICENSE file in the root directory of this source tree.
|
|
57
57
|
*/const yu={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};yu.node;const qm=Ge(yu);/**
|
|
58
|
-
* @license lucide-react v1.
|
|
58
|
+
* @license lucide-react v1.59.0 - ISC
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
62
|
*/const bu={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};bu.node;const Qm=Ge(bu);/**
|
|
63
|
-
* @license lucide-react v1.
|
|
63
|
+
* @license lucide-react v1.59.0 - ISC
|
|
64
64
|
*
|
|
65
65
|
* This source code is licensed under the ISC license.
|
|
66
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
67
|
*/const wu={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};wu.node;const Ym=Ge(wu);/**
|
|
68
|
-
* @license lucide-react v1.
|
|
68
|
+
* @license lucide-react v1.59.0 - ISC
|
|
69
69
|
*
|
|
70
70
|
* This source code is licensed under the ISC license.
|
|
71
71
|
* See the LICENSE file in the root directory of this source tree.
|
|
72
72
|
*/const _u={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};_u.node;const Jm=Ge(_u);/**
|
|
73
|
-
* @license lucide-react v1.
|
|
73
|
+
* @license lucide-react v1.59.0 - ISC
|
|
74
74
|
*
|
|
75
75
|
* This source code is licensed under the ISC license.
|
|
76
76
|
* See the LICENSE file in the root directory of this source tree.
|
|
77
77
|
*/const xu={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};xu.node;const Xm=Ge(xu);/**
|
|
78
|
-
* @license lucide-react v1.
|
|
78
|
+
* @license lucide-react v1.59.0 - ISC
|
|
79
79
|
*
|
|
80
80
|
* This source code is licensed under the ISC license.
|
|
81
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
82
|
*/const Su={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};Su.node;const eg=Ge(Su);/**
|
|
83
|
-
* @license lucide-react v1.
|
|
83
|
+
* @license lucide-react v1.59.0 - ISC
|
|
84
84
|
*
|
|
85
85
|
* This source code is licensed under the ISC license.
|
|
86
86
|
* See the LICENSE file in the root directory of this source tree.
|
|
87
87
|
*/const Eu={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};Eu.node;const tg=Ge(Eu);/**
|
|
88
|
-
* @license lucide-react v1.
|
|
88
|
+
* @license lucide-react v1.59.0 - ISC
|
|
89
89
|
*
|
|
90
90
|
* This source code is licensed under the ISC license.
|
|
91
91
|
* See the LICENSE file in the root directory of this source tree.
|
|
92
92
|
*/const Cu={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};Cu.node;const ng=Ge(Cu);/**
|
|
93
|
-
* @license lucide-react v1.
|
|
93
|
+
* @license lucide-react v1.59.0 - ISC
|
|
94
94
|
*
|
|
95
95
|
* This source code is licensed under the ISC license.
|
|
96
96
|
* See the LICENSE file in the root directory of this source tree.
|
|
97
97
|
*/const ku={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};ku.node;const rg=Ge(ku);/**
|
|
98
|
-
* @license lucide-react v1.
|
|
98
|
+
* @license lucide-react v1.59.0 - ISC
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the ISC license.
|
|
101
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
102
|
*/const Ou={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};Ou.node;const og=Ge(Ou);/**
|
|
103
|
-
* @license lucide-react v1.
|
|
103
|
+
* @license lucide-react v1.59.0 - ISC
|
|
104
104
|
*
|
|
105
105
|
* This source code is licensed under the ISC license.
|
|
106
106
|
* See the LICENSE file in the root directory of this source tree.
|
|
107
107
|
*/const Pu={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};Pu.node;const sg=Ge(Pu);/**
|
|
108
|
-
* @license lucide-react v1.
|
|
108
|
+
* @license lucide-react v1.59.0 - ISC
|
|
109
109
|
*
|
|
110
110
|
* This source code is licensed under the ISC license.
|
|
111
111
|
* See the LICENSE file in the root directory of this source tree.
|
|
112
112
|
*/const Ru={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};Ru.node;const ig=Ge(Ru);/**
|
|
113
|
-
* @license lucide-react v1.
|
|
113
|
+
* @license lucide-react v1.59.0 - ISC
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
117
|
*/const Tu={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};Tu.node;const ag=Ge(Tu);/**
|
|
118
|
-
* @license lucide-react v1.
|
|
118
|
+
* @license lucide-react v1.59.0 - ISC
|
|
119
119
|
*
|
|
120
120
|
* This source code is licensed under the ISC license.
|
|
121
121
|
* See the LICENSE file in the root directory of this source tree.
|
|
122
122
|
*/const Iu={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};Iu.node;const cg=Ge(Iu);/**
|
|
123
|
-
* @license lucide-react v1.
|
|
123
|
+
* @license lucide-react v1.59.0 - ISC
|
|
124
124
|
*
|
|
125
125
|
* This source code is licensed under the ISC license.
|
|
126
126
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
127
|
*/const Au={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Au.node;const Nu=Ge(Au);/**
|
|
128
|
-
* @license lucide-react v1.
|
|
128
|
+
* @license lucide-react v1.59.0 - ISC
|
|
129
129
|
*
|
|
130
130
|
* This source code is licensed under the ISC license.
|
|
131
131
|
* See the LICENSE file in the root directory of this source tree.
|
|
132
132
|
*/const Du={name:"square-play",size:24,node:[["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}]],aliases:["play-square"]};Du.node;const lg=Ge(Du);/**
|
|
133
|
-
* @license lucide-react v1.
|
|
133
|
+
* @license lucide-react v1.59.0 - ISC
|
|
134
134
|
*
|
|
135
135
|
* This source code is licensed under the ISC license.
|
|
136
136
|
* See the LICENSE file in the root directory of this source tree.
|
|
137
137
|
*/const Mu={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};Mu.node;const ug=Ge(Mu);/**
|
|
138
|
-
* @license lucide-react v1.
|
|
138
|
+
* @license lucide-react v1.59.0 - ISC
|
|
139
139
|
*
|
|
140
140
|
* This source code is licensed under the ISC license.
|
|
141
141
|
* See the LICENSE file in the root directory of this source tree.
|
|
142
142
|
*/const ju={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};ju.node;const dg=Ge(ju);/**
|
|
143
|
-
* @license lucide-react v1.
|
|
143
|
+
* @license lucide-react v1.59.0 - ISC
|
|
144
144
|
*
|
|
145
145
|
* This source code is licensed under the ISC license.
|
|
146
146
|
* See the LICENSE file in the root directory of this source tree.
|
|
147
147
|
*/const $u={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};$u.node;const fg=Ge($u);/**
|
|
148
|
-
* @license lucide-react v1.
|
|
148
|
+
* @license lucide-react v1.59.0 - ISC
|
|
149
149
|
*
|
|
150
150
|
* This source code is licensed under the ISC license.
|
|
151
151
|
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const zu={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};zu.node;const hg=Ge(zu);function pg(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const mg=e=>{switch(e){case"success":return yg;case"info":return wg;case"warning":return bg;case"error":return _g;default:return null}},gg=Array(12).fill(0),vg=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},gg.map((n,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),yg=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),bg=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),wg=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),_g=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),xg=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Sg=()=>{const[e,t]=I.useState(document.hidden);return I.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e};let Eg=1;const Cg=100,pc=e=>{var t;return typeof(e==null?void 0:e.id)=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:Eg++};class kg{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(n=>t(n)),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-Cg;t<=0||(this.toasts=this.toasts.filter(n=>t>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),t--,!1):!0))},this.create=t=>{const{message:n,...r}=t,o=pc(t),s=this.pendingDismissals.get(o);s!==void 0&&(cancelAnimationFrame(s),this.pendingDismissals.delete(o),this.dismissedToasts.delete(o));const i=this.dismissedToasts.has(o),a=t.dismissible===void 0?!0:t.dismissible;return i&&(this.dismissedToasts.delete(o),this.toasts=this.toasts.filter(u=>u.id!==o)),(i?void 0:this.toasts.find(u=>u.id===o))?this.toasts=this.toasts.map(u=>u.id===o?(this.publish({...u,...t,id:o,title:n}),{...u,...t,id:o,dismissible:a,title:n}):u):this.addToast({title:n,...r,dismissible:a,id:o}),o},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const n=this.pendingDismissals.get(t);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(r=>r({id:t,dismiss:!0}))})),t},this.message=(t,n)=>this.create({...n,message:t,type:void 0}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,i;const a=o.then(async u=>{if(i=["resolve",u],I.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(Pg(u)&&!u.ok){s=!1;const l=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,v=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:f,...v})}else if(u instanceof Error){s=!1;const l=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,v=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:f,...v})}else if(n.success!==void 0){s=!1;const l=typeof n.success=="function"?await n.success(u):n.success,f=typeof n.description=="function"?await n.description(u):n.description,v=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"success",description:f,...v})}}).catch(async u=>{if(i=["reject",u],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(u):n.error,l=typeof n.description=="function"?await n.description(u):n.description,p=typeof d=="object"&&!I.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:l,...p})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,d)=>a.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=pc(n);return this.create({...n,jsx:t(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const gt=new kg,Og=(e,t)=>gt.message(e,t),Pg=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Rg=Og,Tg=()=>gt.toasts,Ig=()=>gt.getActiveToasts(),E2=Object.assign(Rg,{success:gt.success,info:gt.info,warning:gt.warning,error:gt.error,custom:gt.custom,message:gt.message,promise:gt.promise,dismiss:gt.dismiss,loading:gt.loading},{getHistory:Tg,getToasts:Ig});pg("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function vo(e){return e.label!==void 0}const Ag=3,Ng="24px",Dg="16px",mc=4e3,Mg=356,jg=14,$g=45,zg=200;function $t(...e){return e.filter(Boolean).join(" ")}function Fg(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Lg=e=>{var t,n,r,o,s,i,a,c,u;const{invert:d,toast:l,unstyled:f,interacting:p,setHeights:v,visibleToasts:g,heights:w,index:b,toasts:x,expanded:_,removeToast:C,defaultRichColors:E,closeButton:P,style:R,cancelButtonStyle:T,actionButtonStyle:A,className:j="",descriptionClassName:F="",duration:z,position:Y,gap:Z,expandByDefault:K,classNames:H,icons:J,closeButtonAriaLabel:ne="Close toast"}=e,[te,X]=I.useState(null),[q,me]=I.useState(null),[he,ae]=I.useState(!1),[re,B]=I.useState(!1),[se,ye]=I.useState(!1),[le,Pe]=I.useState(!1),[je,Ee]=I.useState(!1),[$e,We]=I.useState(0),[kt,lt]=I.useState(0),Le=I.useRef(l.duration||z||mc),qn=I.useRef(null),pt=I.useRef(null),Rn=b===0,sn=b+1<=g,ze=l.type,Tr=ze??"default",an=l.dismissible!==!1,Ir=l.className||"",fo=l.descriptionClassName||"",cn=I.useMemo(()=>w.findIndex(D=>D.toastId===l.id)||0,[w,l.id]),Ar=I.useMemo(()=>{var D;return(D=l.closeButton)!=null?D:P},[l.closeButton,P]),ho=I.useMemo(()=>l.duration||z||mc,[l.duration,z]),Qn=I.useRef(0),ln=I.useRef(0),Nr=I.useRef(0),Ht=I.useRef(null),[xs,Ss]=Y.split("-"),Es=I.useMemo(()=>w.reduce((D,V,Q)=>Q>=cn?D:D+V.height,0),[w,cn]),Cs=Sg(),wt=I.useMemo(()=>{var D;return(D=e.swipeDirections)!=null?D:Fg(Y)},[e.swipeDirections,Y]),y=l.invert||d,O=ze==="loading";ln.current=I.useMemo(()=>cn*Z+Es,[cn,Es]),I.useEffect(()=>{Le.current=ho},[ho]),I.useEffect(()=>{ae(!0)},[]),I.useEffect(()=>{const D=pt.current;if(D){const V=D.getBoundingClientRect().height;return lt(V),v(Q=>[{toastId:l.id,height:V,position:l.position},...Q]),()=>v(Q=>Q.filter(ue=>ue.toastId!==l.id))}},[v,l.id]),I.useLayoutEffect(()=>{if(!he)return;const D=pt.current,V=D.style.height;D.style.height="auto";const Q=D.getBoundingClientRect().height;D.style.height=V,lt(Q),v(ue=>ue.find(we=>we.toastId===l.id)?ue.map(we=>we.toastId===l.id?{...we,height:Q}:we):[{toastId:l.id,height:Q,position:l.position},...ue])},[he,l.title,l.description,v,l.id,l.jsx,l.action,l.cancel]);const k=I.useCallback(()=>{B(!0),We(ln.current),v(D=>D.filter(V=>V.toastId!==l.id)),setTimeout(()=>{C(l)},zg)},[l,C,v,ln]);I.useEffect(()=>{if(l.promise&&ze==="loading"||l.duration===1/0||l.type==="loading")return;let D;return _||p||Cs?(()=>{if(Nr.current<Qn.current){const ue=new Date().getTime()-Qn.current;Le.current=Le.current-ue}Nr.current=new Date().getTime()})():(()=>{Le.current!==1/0&&(Qn.current=new Date().getTime(),D=setTimeout(()=>{l.onAutoClose==null||l.onAutoClose.call(l,l),k()},Le.current))})(),()=>clearTimeout(D)},[_,p,l,ze,Cs,k]),I.useEffect(()=>{l.delete&&(k(),l.onDismiss==null||l.onDismiss.call(l,l))},[k,l.delete]);function N(){var D;if(J!=null&&J.loading){var V;return I.createElement("div",{className:$t(H==null?void 0:H.loader,l==null||(V=l.classNames)==null?void 0:V.loader,"sonner-loader"),"data-visible":ze==="loading"},J.loading)}return I.createElement(vg,{className:$t(H==null?void 0:H.loader,l==null||(D=l.classNames)==null?void 0:D.loader),visible:ze==="loading"})}const $=l.icon||(J==null?void 0:J[ze])||mg(ze);var W,L;return I.createElement("li",{tabIndex:0,ref:pt,className:$t(j,Ir,H==null?void 0:H.toast,l==null||(t=l.classNames)==null?void 0:t.toast,H==null?void 0:H[Tr],l==null||(n=l.classNames)==null?void 0:n[Tr]),"data-sonner-toast":"","data-rich-colors":(W=l.richColors)!=null?W:E,"data-styled":!(l.jsx||l.unstyled||f),"data-mounted":he,"data-promise":!!l.promise,"data-swiped":je,"data-removed":re,"data-visible":sn,"data-y-position":xs,"data-x-position":Ss,"data-index":b,"data-front":Rn,"data-swiping":se,"data-dismissible":an,"data-type":ze,"data-invert":y,"data-swipe-out":le,"data-swipe-direction":q,"data-expanded":!!(_||K&&he),"data-testid":l.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${re?$e:ln.current}px`,"--initial-height":K?"auto":`${kt}px`,...R,...l.style},onDragEnd:()=>{ye(!1),X(null),Ht.current=null},onPointerDown:D=>{D.button!==2&&(O||!an||(qn.current=new Date,We(ln.current),D.target.setPointerCapture(D.pointerId),D.target.tagName!=="BUTTON"&&(ye(!0),Ht.current={x:D.clientX,y:D.clientY})))},onPointerUp:()=>{var D,V,Q;if(le||!an)return;Ht.current=null;const ue=Number(((D=pt.current)==null?void 0:D.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),be=Number(((V=pt.current)==null?void 0:V.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),we=new Date().getTime()-((Q=qn.current)==null?void 0:Q.getTime()),ke=te==="x"?ue:be,mt=Math.abs(ke)/we;if((te==="x"?wt.includes(ue>0?"right":"left"):wt.includes(be>0?"bottom":"top"))&&(Math.abs(ke)>=$g||mt>.11)){We(ln.current),l.onDismiss==null||l.onDismiss.call(l,l),me(te==="x"?ue>0?"right":"left":be>0?"down":"up"),k(),Pe(!0);return}else{var _t,Dr;(_t=pt.current)==null||_t.style.setProperty("--swipe-amount-x","0px"),(Dr=pt.current)==null||Dr.style.setProperty("--swipe-amount-y","0px")}Ee(!1),ye(!1),X(null)},onPointerMove:D=>{var V,Q,ue;if(!Ht.current||!an||((V=window.getSelection())==null?void 0:V.toString().length)>0)return;const we=D.clientY-Ht.current.y,ke=D.clientX-Ht.current.x;!te&&(Math.abs(ke)>1||Math.abs(we)>1)&&X(Math.abs(ke)>Math.abs(we)?"x":"y");let mt={x:0,y:0};const un=_t=>1/(1.5+Math.abs(_t)/20);if(te==="y"){if(wt.includes("top")||wt.includes("bottom"))if(wt.includes("top")&&we<0||wt.includes("bottom")&&we>0)mt.y=we;else{const _t=we*un(we);mt.y=Math.abs(_t)<Math.abs(we)?_t:we}}else if(te==="x"&&(wt.includes("left")||wt.includes("right")))if(wt.includes("left")&&ke<0||wt.includes("right")&&ke>0)mt.x=ke;else{const _t=ke*un(ke);mt.x=Math.abs(_t)<Math.abs(ke)?_t:ke}(Math.abs(mt.x)>0||Math.abs(mt.y)>0)&&Ee(!0),(Q=pt.current)==null||Q.style.setProperty("--swipe-amount-x",`${mt.x}px`),(ue=pt.current)==null||ue.style.setProperty("--swipe-amount-y",`${mt.y}px`)}},Ar&&!l.jsx&&ze!=="loading"?I.createElement("button",{"aria-label":ne,"data-disabled":O,"data-close-button":!0,onClick:O||!an?()=>{}:()=>{k(),l.onDismiss==null||l.onDismiss.call(l,l)},className:$t(H==null?void 0:H.closeButton,l==null||(r=l.classNames)==null?void 0:r.closeButton)},(L=J==null?void 0:J.close)!=null?L:xg):null,(ze||l.icon||l.promise)&&l.icon!==null&&((J==null?void 0:J[ze])!==null||l.icon)?I.createElement("div",{"data-icon":"",className:$t(H==null?void 0:H.icon,l==null||(o=l.classNames)==null?void 0:o.icon)},ze==="loading"?l.icon||N():l.promise?N():null,ze!=="loading"?$:null):null,I.createElement("div",{"data-content":"",className:$t(H==null?void 0:H.content,l==null||(s=l.classNames)==null?void 0:s.content)},I.createElement("div",{"data-title":"",className:$t(H==null?void 0:H.title,l==null||(i=l.classNames)==null?void 0:i.title)},l.jsx?l.jsx:typeof l.title=="function"?l.title():l.title),l.description?I.createElement("div",{"data-description":"",className:$t(F,fo,H==null?void 0:H.description,l==null||(a=l.classNames)==null?void 0:a.description)},typeof l.description=="function"?l.description():l.description):null),I.isValidElement(l.cancel)?l.cancel:l.cancel&&vo(l.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:l.cancelButtonStyle||T,onClick:D=>{vo(l.cancel)&&an&&(l.cancel.onClick==null||l.cancel.onClick.call(l.cancel,D),k())},className:$t(H==null?void 0:H.cancelButton,l==null||(c=l.classNames)==null?void 0:c.cancelButton)},l.cancel.label):null,I.isValidElement(l.action)?l.action:l.action&&vo(l.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:l.actionButtonStyle||A,onClick:D=>{vo(l.action)&&(l.action.onClick==null||l.action.onClick.call(l.action,D),!D.defaultPrevented&&k())},className:$t(H==null?void 0:H.actionButton,l==null||(u=l.classNames)==null?void 0:u.actionButton)},l.action.label):null)};function gc(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Vg(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",a=s?Dg:Ng;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${i}-${u}`]=a:n[`${i}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(a)}),n}const Ug=I.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:c,className:u,offset:d,mobileOffset:l,theme:f="light",richColors:p,duration:v,style:g,visibleToasts:w=Ag,toastOptions:b,dir:x=gc(),gap:_=jg,icons:C,customAriaLabel:E,containerAriaLabel:P="Notifications"}=t,[R,T]=I.useState([]),A=I.useMemo(()=>r?R.filter(ae=>ae.toasterId===r):R.filter(ae=>!ae.toasterId),[R,r]),j=I.useMemo(()=>Array.from(new Set([s].concat(A.filter(ae=>ae.position).map(ae=>ae.position)))),[A,s]),[F,z]=I.useState([]),[Y,Z]=I.useState(!1),[K,H]=I.useState(!1),[J,ne]=I.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),te=I.useRef(null),X=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=I.useRef(null),me=I.useRef(!1),he=I.useCallback(ae=>{T(re=>{var B;return(B=re.find(se=>se.id===ae.id))!=null&&B.delete||gt.dismiss(ae.id),re.filter(({id:se})=>se!==ae.id)})},[]);return I.useEffect(()=>gt.subscribe(ae=>{if(ae.dismiss){requestAnimationFrame(()=>{T(re=>re.map(B=>B.id===ae.id?{...B,delete:!0}:B))});return}setTimeout(()=>{Tp.flushSync(()=>{T(re=>{const B=re.findIndex(se=>se.id===ae.id);return B!==-1?[...re.slice(0,B),{...re[B],...ae},...re.slice(B+1)]:[ae,...re]})})})}),[]),I.useEffect(()=>{if(f!=="system"){ne(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ne("dark"):ne("light")),typeof window>"u")return;const ae=window.matchMedia("(prefers-color-scheme: dark)");try{ae.addEventListener("change",({matches:re})=>{ne(re?"dark":"light")})}catch{ae.addListener(({matches:B})=>{try{ne(B?"dark":"light")}catch(se){console.error(se)}})}},[f]),I.useEffect(()=>{R.length<=1&&Z(!1)},[R]),I.useEffect(()=>{const ae=re=>{var B;if(i.length>0&&i.every(le=>re[le]||re.code===le)){var ye;Z(!0),(ye=te.current)==null||ye.focus()}re.code==="Escape"&&(document.activeElement===te.current||(B=te.current)!=null&&B.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[i]),I.useEffect(()=>{if(te.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,me.current=!1)}},[te.current]),I.createElement("section",{ref:n,"aria-label":E??`${P} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},j.map((ae,re)=>{var B;const[se,ye]=ae.split("-");return A.length?I.createElement("ol",{key:ae,dir:x==="auto"?gc():x,tabIndex:-1,ref:te,className:u,"data-sonner-toaster":!0,"data-sonner-theme":J,"data-y-position":se,"data-x-position":ye,style:{"--front-toast-height":`${((B=F[0])==null?void 0:B.height)||0}px`,"--width":`${Mg}px`,"--gap":`${_}px`,...g,...Vg(d,l)},onBlur:le=>{me.current&&!le.currentTarget.contains(le.relatedTarget)&&(me.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||me.current||(me.current=!0,q.current=le.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{K||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},A.filter(le=>!le.position&&re===0||le.position===ae).map((le,Pe)=>{var je,Ee;return I.createElement(Lg,{key:le.id,icons:C,index:Pe,toast:le,defaultRichColors:p,duration:(je=b==null?void 0:b.duration)!=null?je:v,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:o,visibleToasts:w,closeButton:(Ee=b==null?void 0:b.closeButton)!=null?Ee:c,interacting:K,position:ae,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:he,toasts:A.filter($e=>$e.position==le.position),heights:F.filter($e=>$e.position==le.position),setHeights:z,expandByDefault:a,gap:_,expanded:Y,swipeDirections:t.swipeDirections})})):null}))}),Zg=e=>{const t=ee.c(7);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];const{theme:r}=ss(),s=r===void 0?"system":r;let i,a;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={success:m.jsx(Jm,{className:"size-4"}),info:m.jsx(eg,{className:"size-4"}),warning:m.jsx(dg,{className:"size-4"}),error:m.jsx(ag,{className:"size-4"}),loading:m.jsx(rg,{className:"size-4 animate-spin"})},a={"--normal-bg":"hsl(var(--popover))","--normal-text":"hsl(var(--popover-foreground))","--normal-border":"hsl(var(--border))","--border-radius":"var(--radius)",fontFamily:"inherit"},t[2]=i,t[3]=a):(i=t[2],a=t[3]);let c;return t[4]!==n||t[5]!==s?(c=m.jsx(Ug,{theme:s,className:"toaster group",icons:i,style:a,...n}),t[4]=n,t[5]=s,t[6]=c):c=t[6],c};var Bg=Object.defineProperty,na=(e,t)=>Bg(e,"name",{value:t,configurable:!0});function li(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}na(li,"setRef");function Fu(...e){return t=>{let n=!1;const r=e.map(o=>{const s=li(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():li(e[o],null)}}}}na(Fu,"composeRefs");function Te(...e){return h.useCallback(Fu(...e),e)}na(Te,"useComposedRefs");var Hg=Object.defineProperty,Ct=(e,t)=>Hg(e,"name",{value:t,configurable:!0});function Xt(e){const t=h.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const c=[];o=Wu(o),h.Children.forEach(o,f=>{var p;if(Bu(f)){a=!0;const v=f;let g="child"in v.props?v.props.child:v.props.children;for(;ra(g)&&typeof Ko=="function";)g=Ko(g._payload);i=Wg(v,g),c.push((p=i==null?void 0:i.props)==null?void 0:p.children)}else c.push(f)}),i?i=h.cloneElement(i,void 0,c):!a&&h.Children.count(o)===1&&h.isValidElement(o)&&(i=o);const u=i?Zu(i):void 0,d=Te(r,u);if(!i){if(o||o===0)throw new Error(a?qg(e):Gg(e));return o}const l=Uu(s,i.props??{});return i.type!==h.Fragment&&(l.ref=r?d:u),h.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}Ct(Xt,"createSlot");var xr=Xt("Slot"),Lu=Symbol.for("radix.slottable");function Vu(e){const t=Ct(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Lu,t}Ct(Vu,"createSlottable");var Wg=Ct((e,t)=>"child"in e.props?h.isValidElement(t)?h.cloneElement(t,void 0,e.props.children(t.props.children)):null:h.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function Uu(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"?n[r]=[o,s].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=Ku(s,o))}return{...e,...n}}Ct(Uu,"mergeProps");function Zu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ct(Zu,"getElementRef");function Bu(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lu}Ct(Bu,"isSlottable");var Kg=Symbol.for("react.lazy");function ra(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Kg&&"_payload"in e&&Hu(e._payload)}Ct(ra,"isLazyComponent");function Hu(e){return typeof e=="object"&&e!==null&&"then"in e}Ct(Hu,"isPromiseLike");function Wu(e){let t=e;for(;ra(t)&&typeof Ko=="function";)t=Ko(t._payload);return t}Ct(Wu,"useUnwrappedLazy");function Ku(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Ct(Ku,"concatAriaDescribedby");var Gg=Ct(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),qg=Ct(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Ko=Bn[" use ".trim().toString()];function Gu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Gu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function qu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Gu(e))&&(r&&(r+=" "),r+=t);return r}const vc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yc=qu,so=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yc(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],l=s==null?void 0:s[u];if(d===null)return null;const f=vc(d)||vc(l);return o[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[l,f]=d;return f===void 0||(u[l]=f),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:l,className:f,...p}=d;return Object.entries(p).every(v=>{let[g,w]=v;return Array.isArray(w)?w.includes({...s,...a}[g]):{...s,...a}[g]===w})?[...u,l,f]:u},[]);return yc(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Qg=768,Qu=`(max-width: ${Qg-1}px)`;function Yg(e){const t=window.matchMedia(Qu);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function Jg(){return h.useSyncExternalStore(Yg,ev,Xg)}function Xg(){return!1}function ev(){return window.matchMedia(Qu).matches}const oa="-",tv=e=>{const t=rv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(oa);return a[0]===""&&a.length!==1&&a.shift(),Yu(a,t)||nv(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},Yu=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Yu(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(oa);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},bc=/^\[(.+)\]$/,nv=e=>{if(bc.test(e)){const t=bc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rv=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return sv(Object.entries(e.classGroups),n).forEach(([s,i])=>{ui(i,r,s,t)}),r},ui=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:wc(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(ov(o)){ui(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{ui(i,wc(t,s),n,r)})})},wc=(e,t)=>{let n=e;return t.split(oa).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ov=e=>e.isThemeGetter,sv=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,iv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Ju="!",av=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const c=[];let u=0,d=0,l;for(let w=0;w<a.length;w++){let b=a[w];if(u===0){if(b===o&&(r||a.slice(w,w+s)===t)){c.push(a.slice(d,w)),d=w+s;continue}if(b==="/"){l=w;continue}}b==="["?u++:b==="]"&&u--}const f=c.length===0?a:a.substring(d),p=f.startsWith(Ju),v=p?f.substring(1):f,g=l&&l>d?l-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},cv=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},lv=e=>({cache:iv(e.cacheSize),parseClassName:av(e),...tv(e)}),uv=/\s+/,dv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(uv);let a="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{modifiers:d,hasImportantModifier:l,baseClassName:f,maybePostfixModifierPosition:p}=n(u);let v=!!p,g=r(v?f.substring(0,p):f);if(!g){if(!v){a=u+(a.length>0?" "+a:a);continue}if(g=r(f),!g){a=u+(a.length>0?" "+a:a);continue}v=!1}const w=cv(d).join(":"),b=l?w+Ju:w,x=b+g;if(s.includes(x))continue;s.push(x);const _=o(g,v);for(let C=0;C<_.length;++C){const E=_[C];s.push(b+E)}a=u+(a.length>0?" "+a:a)}return a};function fv(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Xu(t))&&(r&&(r+=" "),r+=n);return r}const Xu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Xu(e[r]))&&(n&&(n+=" "),n+=t);return n};function hv(e,...t){let n,r,o,s=i;function i(c){const u=t.reduce((d,l)=>l(d),e());return n=lv(u),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const u=r(c);if(u)return u;const d=dv(c,n);return o(c,d),d}return function(){return s(fv.apply(null,arguments))}}const Re=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ed=/^\[(?:([a-z-]+):)?(.+)\]$/i,pv=/^\d+\/\d+$/,mv=new Set(["px","full","screen"]),gv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wt=e=>nr(e)||mv.has(e)||pv.test(e),dn=e=>Sr(e,"length",Pv),nr=e=>!!e&&!Number.isNaN(Number(e)),Ts=e=>Sr(e,"number",nr),Mr=e=>!!e&&Number.isInteger(Number(e)),_v=e=>e.endsWith("%")&&nr(e.slice(0,-1)),fe=e=>ed.test(e),fn=e=>gv.test(e),xv=new Set(["length","size","percentage"]),Sv=e=>Sr(e,xv,td),Ev=e=>Sr(e,"position",td),Cv=new Set(["image","url"]),kv=e=>Sr(e,Cv,Tv),Ov=e=>Sr(e,"",Rv),jr=()=>!0,Sr=(e,t,n)=>{const r=ed.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Pv=e=>vv.test(e)&&!yv.test(e),td=()=>!1,Rv=e=>bv.test(e),Tv=e=>wv.test(e),Iv=()=>{const e=Re("colors"),t=Re("spacing"),n=Re("blur"),r=Re("brightness"),o=Re("borderColor"),s=Re("borderRadius"),i=Re("borderSpacing"),a=Re("borderWidth"),c=Re("contrast"),u=Re("grayscale"),d=Re("hueRotate"),l=Re("invert"),f=Re("gap"),p=Re("gradientColorStops"),v=Re("gradientColorStopPositions"),g=Re("inset"),w=Re("margin"),b=Re("opacity"),x=Re("padding"),_=Re("saturate"),C=Re("scale"),E=Re("sepia"),P=Re("skew"),R=Re("space"),T=Re("translate"),A=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",fe,t],z=()=>[fe,t],Y=()=>["",Wt,dn],Z=()=>["auto",nr,fe],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],te=()=>["","0",fe],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[nr,fe];return{cacheSize:500,separator:":",theme:{colors:[jr],spacing:[Wt,dn],blur:["none","",fn,fe],brightness:q(),borderColor:[e],borderRadius:["none","","full",fn,fe],borderSpacing:z(),borderWidth:Y(),contrast:q(),grayscale:te(),hueRotate:q(),invert:te(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[_v,dn],inset:F(),margin:F(),opacity:q(),padding:z(),saturate:q(),scale:q(),sepia:te(),skew:q(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",fe]}],container:["container"],columns:[{columns:[fn]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),fe]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Mr,fe]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",fe]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:["first","last","none",Mr,fe]}],"grid-cols":[{"grid-cols":[jr]}],"col-start-end":[{col:["auto",{span:["full",Mr,fe]},fe]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[jr]}],"row-start-end":[{row:["auto",{span:[Mr,fe]},fe]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",fe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",fe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",fe,t]}],"min-w":[{"min-w":[fe,t,"min","max","fit"]}],"max-w":[{"max-w":[fe,t,"none","full","min","max","fit","prose",{screen:[fn]},fn]}],h:[{h:[fe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[fe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[fe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[fe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fn,dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ts]}],"font-family":[{font:[jr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",fe]}],"line-clamp":[{"line-clamp":["none",nr,Ts]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wt,fe]}],"list-image":[{"list-image":["none",fe]}],"list-style-type":[{list:["none","disc","decimal",fe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wt,dn]}],"underline-offset":[{"underline-offset":["auto",Wt,fe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),Ev]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Sv]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},kv]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:H()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Wt,fe]}],"outline-w":[{outline:[Wt,dn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Wt,dn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fn,Ov]}],"shadow-color":[{shadow:[jr]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",fn,fe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[l]}],saturate:[{saturate:[_]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[l]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",fe]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",fe]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",fe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Mr,fe]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",fe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wt,dn,Ts]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Av=hv(Iv);function ce(...e){return Av(qu(e))}const Nv=so("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8","icon-sm":"h-9 w-9",icon:"h-10 w-10",pill:"h-12 px-6 rounded-pill",nav:"h-7 px-3 text-xs"}},defaultVariants:{variant:"default",size:"default"}}),is=h.forwardRef((e,t)=>{const n=ee.c(15);let r,o,s,i,a;n[0]!==e?({className:r,variant:a,size:s,asChild:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5]);const u=(i===void 0?!1:i)?xr:"button";let d;n[6]!==r||n[7]!==s||n[8]!==a?(d=ce(Nv({variant:a,size:s,className:r})),n[6]=r,n[7]=s,n[8]=a,n[9]=d):d=n[9];let l;return n[10]!==u||n[11]!==o||n[12]!==t||n[13]!==d?(l=m.jsx(u,{className:d,ref:t,...o}),n[10]=u,n[11]=o,n[12]=t,n[13]=d,n[14]=l):l=n[14],l});is.displayName="Button";const Go=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,type:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==r?(i=ce("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),n[4]=r,n[5]=i):i=n[5];let a;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==s?(a=m.jsx("input",{type:s,className:i,ref:t,...o}),n[6]=o,n[7]=t,n[8]=i,n[9]=s,n[10]=a):a=n[10],a});Go.displayName="Input";var Dv=Object.defineProperty,Mv=(e,t)=>Dv(e,"name",{value:t,configurable:!0}),jv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=jv.reduce((e,t)=>{const n=Xt(`Primitive.${t}`),r=h.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sa(e,t){e&&ru.flushSync(()=>e.dispatchEvent(t))}Mv(sa,"dispatchDiscreteCustomEvent");var $v=Object.defineProperty,nd=(e,t)=>$v(e,"name",{value:t,configurable:!0}),ia={Horizontal:"horizontal",Vertical:"vertical"},_c=ia.Horizontal,zv=Object.values(ia),rd=h.forwardRef(nd(function(t,n){const{decorative:r,orientation:o=_c,...s}=t,i=od(o)?o:_c,a=i===ia.Vertical?i:void 0,c=r?{role:"none"}:{"aria-orientation":a,role:"separator"};return m.jsx(Ze.div,{"data-orientation":i,...c,...s,ref:n})},"Separator"));function od(e){return zv.includes(e)}nd(od,"isValidOrientation");const qo=h.forwardRef((e,t)=>{const n=ee.c(14);let r,o,s,i;n[0]!==e?({className:r,orientation:s,decorative:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s===void 0?"horizontal":s,c=i===void 0?!0:i,u=a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]";let d;n[5]!==r||n[6]!==u?(d=ce("shrink-0 bg-border",u,r),n[5]=r,n[6]=u,n[7]=d):d=n[7];let l;return n[8]!==c||n[9]!==a||n[10]!==o||n[11]!==t||n[12]!==d?(l=m.jsx(rd,{ref:t,decorative:c,orientation:a,className:d,...o}),n[8]=c,n[9]=a,n[10]=o,n[11]=t,n[12]=d,n[13]=l):l=n[13],l});qo.displayName=rd.displayName;var Fv=Object.defineProperty,Er=(e,t)=>Fv(e,"name",{value:t,configurable:!0}),sd=!!(typeof window<"u"&&window.document&&window.document.createElement);function de(e,t,{checkForDefaultPrevented:n=!0}={}){return Er(function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)},"handleEvent")}Er(de,"composeEventHandlers");function Lv(e){var t;if(!sd)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Er(Lv,"getOwnerWindow");function di(e){if(!sd)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Er(di,"getOwnerDocument");function id(e,t=!1){const{activeElement:n}=di(e);if(!(n!=null&&n.nodeName))return null;if(ad(n)&&n.contentDocument)return id(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=di(n).getElementById(r);if(o)return o}}return n}Er(id,"getActiveElement");function ad(e){return e.tagName==="IFRAME"}Er(ad,"isFrame");var Vv=Object.defineProperty,Pt=(e,t)=>Vv(e,"name",{value:t,configurable:!0});function Uv(e,t){const n=h.createContext(t);n.displayName=e+"Context";const r=Pt(s=>{const{children:i,...a}=s,c=h.useMemo(()=>a,Object.values(a));return m.jsx(n.Provider,{value:c,children:i})},"Provider");r.displayName=e+"Provider";function o(s,i={}){const{optional:a=!1}=i,c=h.useContext(n);if(c)return c;if(t!==void 0)return t;if(!a)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Pt(o,"useContext"),[r,o]}Pt(Uv,"createContext");function rn(e,t=[]){let n=[];function r(s,i){const a=h.createContext(i);a.displayName=s+"Context";const c=n.length;n=[...n,i];const u=Pt(l=>{var b;const{scope:f,children:p,...v}=l,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||a,w=h.useMemo(()=>v,Object.values(v));return m.jsx(g.Provider,{value:w,children:p})},"Provider");u.displayName=s+"Provider";function d(l,f,p={}){var b;const{optional:v=!1}=p,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||a,w=h.useContext(g);if(w)return w;if(i!==void 0)return i;if(!v)throw new Error(`\`${l}\` must be used within \`${s}\``)}return Pt(d,"useContext"),[u,d]}Pt(r,"createContext");const o=Pt(()=>{const s=n.map(i=>h.createContext(i));return Pt(function(a){const c=(a==null?void 0:a[e])||s;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])},"useScope")},"createScope");return o.scopeName=e,[r,cd(o,...t)]}Pt(rn,"createContextScope");function cd(...e){const t=e[0];if(e.length===1)return t;const n=Pt(()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return Pt(function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const l=c(s)[`__scope${u}`];return{...a,...l}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Pt(cd,"composeContextScopes");var ct=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Zv=Object.defineProperty,Bv=(e,t)=>Zv(e,"name",{value:t,configurable:!0}),Hv=Bn[" useId ".trim().toString()]||(()=>{}),Wv=0;function En(e){const[t,n]=h.useState(Hv());return ct(()=>{e||n(r=>r??String(Wv++))},[e]),e||(t?`radix-${t}`:"")}Bv(En,"useId");var Kv=Object.defineProperty,Gv=(e,t)=>Kv(e,"name",{value:t,configurable:!0}),xc=Bn[" useEffectEvent ".trim().toString()],Sc=Bn[" useInsertionEffect ".trim().toString()];function ld(e){if(typeof xc=="function")return xc(e);const t=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Sc=="function"?Sc(()=>{t.current=e}):ct(()=>{t.current=e}),h.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Gv(ld,"useEffectEvent");var qv=Object.defineProperty,io=(e,t)=>qv(e,"name",{value:t,configurable:!0}),Qv=Bn[" useInsertionEffect ".trim().toString()]||ct;function ao({prop:e,defaultProp:t,onChange:n=io(()=>{},"onChange"),caller:r}){const[o,s,i]=ud({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o,u=h.useCallback(d=>{var l;if(a){const f=dd(d)?d(e):d;f!==e&&((l=i.current)==null||l.call(i,f))}else s(d)},[a,e,s,i]);return[c,u]}io(ao,"useControllableState");function ud({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),s=h.useRef(t);return Qv(()=>{s.current=t},[t]),h.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}io(ud,"useUncontrolledState");function dd(e){return typeof e=="function"}io(dd,"isFunction");var Ec=Symbol("RADIX:SYNC_STATE");function Yv(e,t,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=t,c=o!==void 0,u=ld(i),d=[{...n,state:s}];r&&d.push(r);const[l,f]=h.useReducer((w,b)=>{if(b.type===Ec)return{...w,state:b.state};const x=e(w,b);return c&&!Object.is(x.state,w.state)&&u(x.state),x},...d),p=l.state,v=h.useRef(p);h.useEffect(()=>{v.current!==p&&(v.current=p,c||u(p))},[p,v,c]);const g=h.useMemo(()=>o!==void 0?{...l,state:o}:l,[l,o]);return h.useEffect(()=>{c&&!Object.is(o,l.state)&&f({type:Ec,state:o})},[o,l.state,c]),[g,f]}io(Yv,"useControllableStateReducer");var Jv=Object.defineProperty,Xv=(e,t)=>Jv(e,"name",{value:t,configurable:!0}),Cc=Bn[" useInsertionEffect ".trim().toString()];function en(e){const t=h.useRef(e);return typeof Cc=="function"?Cc(()=>{t.current=e}):ct(()=>{t.current=e}),h.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Xv(en,"useCallbackRef");var ey=Object.defineProperty,et=(e,t)=>ey(e,"name",{value:t,configurable:!0}),fi="dismissableLayer.update",ty="dismissableLayer.pointerDownOutside",ny="dismissableLayer.focusOutside",kc,fd=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),aa=h.forwardRef(et(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...d}=t,l=h.useContext(fd),[f,p]=h.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=h.useState({}),w=Te(n,p),b=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=x?b.indexOf(x):-1,C=f?b.indexOf(f):-1,E=l.layersWithOutsidePointerEventsDisabled.size>0,P=C>=_,R=h.useRef(!1),T=pd(z=>{i==null||i(z),c==null||c(z),z.defaultPrevented||u==null||u()},{ownerDocument:v,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:R,dismissableSurfaces:l.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(z=>{if(!(z instanceof Node))return!1;const Y=[...l.branches].some(Z=>Z.contains(z));return P&&!Y},[l.branches,P])}),A=md(z=>{if(o&&R.current)return;const Y=z.target;[...l.branches].some(K=>K.contains(Y))||(a==null||a(z),c==null||c(z),z.defaultPrevented||u==null||u())},v),j=f?C===b.length-1:!1,F=en(z=>{z.key==="Escape"&&(s==null||s(z),!z.defaultPrevented&&u&&(z.preventDefault(),u()))});return h.useEffect(()=>{if(j)return v.addEventListener("keydown",F,{capture:!0}),()=>v.removeEventListener("keydown",F,{capture:!0})},[v,j,F]),h.useEffect(()=>{if(f)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(kc=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),hi(),()=>{r&&(l.layersWithOutsidePointerEventsDisabled.delete(f),l.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=kc))}},[f,v,r,l]),h.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),hi())},[f,l]),h.useEffect(()=>{const z=et(()=>g({}),"handleUpdate");return document.addEventListener(fi,z),()=>document.removeEventListener(fi,z)},[]),m.jsx(Ze.div,{...d,ref:w,style:{pointerEvents:E?P?"auto":"none":void 0,...t.style},onFocusCapture:de(t.onFocusCapture,A.onFocusCapture),onBlurCapture:de(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:de(t.onPointerDownCapture,T.onPointerDownCapture)})},"DismissableLayer"));function hd(){const e=h.useContext(fd),[t,n]=h.useState(null);return h.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}et(hd,"useDismissableLayerSurface");var ry=et(()=>!0,"IS_TRUE");function pd(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=ry}=t,a=en(e),c=h.useRef(!1),u=h.useRef(!1),d=h.useRef(new Map),l=h.useRef(()=>{});return h.useEffect(()=>{function f(){u.current=!1,o.current=!1,d.current.clear()}et(f,"resetOutsideInteraction");function p(){return Array.from(d.current.values()).some(Boolean)}et(p,"isOutsideInteractionIntercepted");function v(_){if(!u.current)return;const C=_.target;C instanceof Node&&[...s].some(P=>P.contains(C))||d.current.set(_.type,!0),_.type==="click"&&window.setTimeout(()=>{u.current&&l.current()},0)}et(v,"handleInteractionCapture");function g(_){u.current&&d.current.set(_.type,!1)}et(g,"handleInteractionBubble");const w=et(_=>{if(_.target&&!c.current){let C=function(){n.removeEventListener("click",l.current);const P=p();f(),P||ca(ty,a,E,{discrete:!0})};if(et(C,"handleAndDispatchPointerDownOutsideEvent"),!i(_.target)){n.removeEventListener("click",l.current),f(),c.current=!1;return}const E={originalEvent:_};u.current=!0,o.current=r&&_.button===0,d.current.clear(),!r||_.button!==0?C():(n.removeEventListener("click",l.current),l.current=C,n.addEventListener("click",l.current,{once:!0}))}else n.removeEventListener("click",l.current),f();c.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const _ of b)n.addEventListener(_,v,!0),n.addEventListener(_,g);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",w),n.removeEventListener("click",l.current);for(const _ of b)n.removeEventListener(_,v,!0),n.removeEventListener(_,g)}},[n,a,r,o,s,i]),{onPointerDownCapture:et(()=>c.current=!0,"onPointerDownCapture")}}et(pd,"usePointerDownOutside");function md(e,t=globalThis==null?void 0:globalThis.document){const n=en(e),r=h.useRef(!1);return h.useEffect(()=>{const o=et(s=>{s.target&&!r.current&&ca(ny,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:et(()=>r.current=!0,"onFocusCapture"),onBlurCapture:et(()=>r.current=!1,"onBlurCapture")}}et(md,"useFocusOutside");function hi(){const e=new CustomEvent(fi);document.dispatchEvent(e)}et(hi,"dispatchUpdate");function ca(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?sa(o,s):o.dispatchEvent(s)}et(ca,"handleAndDispatchCustomEvent");var oy=Object.defineProperty,Ke=(e,t)=>oy(e,"name",{value:t,configurable:!0}),Is="focusScope.autoFocusOnMount",As="focusScope.autoFocusOnUnmount",Oc={bubbles:!1,cancelable:!0},gd=h.forwardRef(Ke(function(t,n){const{loop:r=!1,trapped:o=!1,branches:s,onMountAutoFocus:i,onUnmountAutoFocus:a,...c}=t,[u,d]=h.useState(null),l=en(i),f=en(a),p=h.useRef(null),v=Te(n,d),g=h.useRef(s);h.useEffect(()=>{g.current=s});const w=h.useCallback(_=>{var C;return _?u!=null&&u.contains(_)?!0:!!((C=g.current)!=null&&C.some(E=>E.contains(_))):!1},[u]),b=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let _=function(R){if(b.paused||!u)return;const T=R.target;w(T)?p.current=T:qt(p.current,{select:!0})},C=function(R){if(b.paused||!u)return;const T=R.relatedTarget;T!==null&&(w(T)||qt(p.current,{select:!0}))},E=function(R){if(document.activeElement===document.body)for(const A of R)A.removedNodes.length>0&&qt(u)};Ke(_,"handleFocusIn"),Ke(C,"handleFocusOut"),Ke(E,"handleMutations"),document.addEventListener("focusin",_),document.addEventListener("focusout",C);const P=new MutationObserver(E);return u&&P.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",C),P.disconnect()}}},[o,u,b.paused,w]),h.useEffect(()=>{if(u){Pc.add(b);const _=document.activeElement;if(!u.contains(_)){const E=new CustomEvent(Is,Oc);u.addEventListener(Is,l),u.dispatchEvent(E),E.defaultPrevented||(yd(Sd(fa(u)),{select:!0}),document.activeElement===_&&qt(u))}return()=>{u.removeEventListener(Is,l);const E=u.ownerDocument,P=CustomEvent;setTimeout(()=>{const R=new P(As,Oc);u.addEventListener(As,f),u.dispatchEvent(R),R.defaultPrevented||qt(_??E.body,{select:!0}),u.removeEventListener(As,f),Pc.remove(b)},0)}}},[u,l,f,b]);const x=h.useCallback(_=>{if(!r&&!o||b.paused)return;const C=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,E=document.activeElement;if(C&&E){const P=_.currentTarget,[R,T]=bd(P);R&&T?!_.shiftKey&&E===T?(_.preventDefault(),r&&qt(R,{select:!0})):_.shiftKey&&E===R&&(_.preventDefault(),r&&qt(T,{select:!0})):E===P&&_.preventDefault()}},[r,o,b.paused]);return m.jsx(Ze.div,{tabIndex:-1,...c,ref:v,onKeyDown:x})},"FocusScope")),vd=h.createContext(null);function la({registry:e,children:t}){return e?m.jsx(vd.Provider,{value:e,children:t}):t}Ke(la,"FocusScopeBranchProvider");function ua(){const[e,t]=h.useState([]),n=h.useMemo(()=>({add:Ke(r=>t(o=>o.includes(r)?o:[...o,r]),"add"),remove:Ke(r=>t(o=>o.filter(s=>s!==r)),"remove")}),[]);return{nodes:e,registry:n}}Ke(ua,"useFocusScopeBranchRegistry");function da(e){const t=h.useContext(vd);h.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}Ke(da,"useFocusScopeBranch");function yd(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qt(r,{select:t}),document.activeElement!==n)return}Ke(yd,"focusFirst");function bd(e){const t=fa(e),n=pi(t,e),r=pi(t.reverse(),e);return[n,r]}Ke(bd,"getTabbableEdges");function fa(e){const t=[],r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ke(o=>{const s=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||s?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}Ke(fa,"getTabbableCandidates");function pi(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):wd(r,{upTo:t})))return r}Ke(pi,"findVisible");function wd(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Ke(wd,"isHidden");function _d(e){return e.tagName==="INPUT"&&typeof e.select=="function"}Ke(_d,"isSelectableInput");function qt(e,{select:t=!1}={}){if(e&&e.focus){const r=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==r&&_d(e)&&t&&e.select()}}Ke(qt,"focus");var Pc=xd();function xd(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=mi(e,t),e.unshift(t)},remove(t){var n;e=mi(e,t),(n=e[0])==null||n.resume()}}}Ke(xd,"createFocusScopesStack");function mi(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ke(mi,"arrayRemove");function Sd(e){return e.filter(t=>t.tagName!=="A")}Ke(Sd,"removeLinks");var sy=Object.defineProperty,iy=(e,t)=>sy(e,"name",{value:t,configurable:!0}),ha=h.forwardRef(iy(function(t,n){var c;const{container:r,...o}=t,[s,i]=h.useState(!1);ct(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?ru.createPortal(m.jsx(Ze.div,{...o,ref:n}),a):null},"Portal")),ay=Object.defineProperty,tn=(e,t)=>ay(e,"name",{value:t,configurable:!0});function Ed(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}tn(Ed,"useStateMachine");var on=tn(e=>{const{present:t,children:n}=e,r=Cd(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),s=kd(r.ref,Od(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:s}):null},"Presence");function Cd(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),s=h.useRef("none"),i=h.useRef(void 0),a=e?"mounted":"unmounted",[c,u]=Ed(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{c==="mounted"?(s.current=i.current??tr(r.current),i.current=void 0):s.current="none"},[c]),ct(()=>{const d=r.current,l=o.current;if(l!==e){const p=s.current,v=tr(d);e?(i.current=v,u("MOUNT")):v==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(l&&p!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ct(()=>{if(t){let d;const l=t.ownerDocument.defaultView??window,f=tn(v=>{const w=tr(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(u("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},"handleAnimationEnd"),p=tn(v=>{v.target===t&&(s.current=tr(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{l.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:h.useCallback(d=>{if(d){const l=getComputedStyle(d);r.current=l,i.current=tr(l)}else r.current=null;n(d)},[])}}tn(Cd,"usePresence");function gi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}tn(gi,"setRef");function kd(...e){const t=h.useRef(e);return t.current=e,h.useCallback(n=>{const r=t.current;let o=!1;const s=r.map(i=>{const a=gi(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():gi(r[i],null)}}},[])}tn(kd,"useStableComposedRefs");function tr(e){return(e==null?void 0:e.animationName)||"none"}tn(tr,"getAnimationName");function Od(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}tn(Od,"getElementRef");var cy=Object.defineProperty,pa=(e,t)=>cy(e,"name",{value:t,configurable:!0}),yo=0,zt=null;function ly(e){return as(),e.children}pa(ly,"FocusGuards");function as(){h.useEffect(()=>{zt||(zt={start:vi(),end:vi()});const{start:e,end:t}=zt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),yo++,()=>{yo===1&&(zt==null||zt.start.remove(),zt==null||zt.end.remove(),zt=null),yo=Math.max(0,yo-1)}},[])}pa(as,"useFocusGuards");function vi(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}pa(vi,"createFocusGuard");var Ut=function(){return Ut=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ut.apply(this,arguments)};function Pd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function uy(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var No="right-scroll-bar-position",Do="width-before-scroll-bar",dy="with-scroll-bars-hidden",fy="--removed-body-scroll-bar-size";function Ns(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function hy(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var py=typeof window<"u"?h.useLayoutEffect:h.useEffect,Rc=new WeakMap;function my(e,t){var n=hy(null,function(r){return e.forEach(function(o){return Ns(o,r)})});return py(function(){var r=Rc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ns(a,null)}),s.forEach(function(a){o.has(a)||Ns(a,i)})}Rc.set(n,e)},[e]),n}function gy(e){return e}function vy(e,t){t===void 0&&(t=gy);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function yy(e){e===void 0&&(e={});var t=vy(null);return t.options=Ut({async:!0,ssr:!1},e),t}var Rd=function(e){var t=e.sideCar,n=Pd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Ut({},n))};Rd.isSideCarExport=!0;function by(e,t){return e.useMedium(t),Rd}var Td=yy(),Ds=function(){},cs=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Ds,onWheelCapture:Ds,onTouchMoveCapture:Ds}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,l=e.shards,f=e.sideCar,p=e.noRelative,v=e.noIsolation,g=e.inert,w=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,_=e.gapMode,C=Pd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,P=my([n,t]),R=Ut(Ut({},C),o);return h.createElement(h.Fragment,null,d&&h.createElement(E,{sideCar:Td,removeScrollBar:u,shards:l,noRelative:p,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:_}),i?h.cloneElement(h.Children.only(a),Ut(Ut({},R),{ref:P})):h.createElement(x,Ut({},R,{className:c,ref:P}),a))});cs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cs.classNames={fullWidth:Do,zeroRight:No};var wy=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _y(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wy();return t&&e.setAttribute("nonce",t),e}function xy(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Sy(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ey=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_y())&&(xy(t,n),Sy(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Cy=function(){var e=Ey();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Id=function(){var e=Cy(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ky={left:0,top:0,right:0,gap:0},Ms=function(e){return parseInt(e||"",10)||0},Oy=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ms(n),Ms(r),Ms(o)]},Py=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ky;var t=Oy(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ry=Id(),rr="data-scroll-locked",Ty=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
152
|
+
*/const zu={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};zu.node;const hg=Ge(zu);function pg(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const mg=e=>{switch(e){case"success":return yg;case"info":return wg;case"warning":return bg;case"error":return _g;default:return null}},gg=Array(12).fill(0),vg=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},gg.map((n,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),yg=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),bg=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),wg=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),_g=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),xg=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Sg=()=>{const[e,t]=I.useState(document.hidden);return I.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e};let Eg=1;const Cg=100,pc=e=>{var t;return typeof(e==null?void 0:e.id)=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:Eg++};class kg{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(n=>t(n)),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-Cg;t<=0||(this.toasts=this.toasts.filter(n=>t>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),t--,!1):!0))},this.create=t=>{const{message:n,...r}=t,o=pc(t),s=this.pendingDismissals.get(o);s!==void 0&&(cancelAnimationFrame(s),this.pendingDismissals.delete(o),this.dismissedToasts.delete(o));const i=this.dismissedToasts.has(o),a=t.dismissible===void 0?!0:t.dismissible;return i&&(this.dismissedToasts.delete(o),this.toasts=this.toasts.filter(u=>u.id!==o)),(i?void 0:this.toasts.find(u=>u.id===o))?this.toasts=this.toasts.map(u=>u.id===o?(this.publish({...u,...t,id:o,title:n}),{...u,...t,id:o,dismissible:a,title:n}):u):this.addToast({title:n,...r,dismissible:a,id:o}),o},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const n=this.pendingDismissals.get(t);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(r=>r({id:t,dismiss:!0}))})),t},this.message=(t,n)=>this.create({...n,message:t,type:void 0}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,i;const a=o.then(async u=>{if(i=["resolve",u],I.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(Pg(u)&&!u.ok){s=!1;const l=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,v=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:f,...v})}else if(u instanceof Error){s=!1;const l=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,v=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:f,...v})}else if(n.success!==void 0){s=!1;const l=typeof n.success=="function"?await n.success(u):n.success,f=typeof n.description=="function"?await n.description(u):n.description,v=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"success",description:f,...v})}}).catch(async u=>{if(i=["reject",u],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(u):n.error,l=typeof n.description=="function"?await n.description(u):n.description,p=typeof d=="object"&&!I.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:l,...p})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,d)=>a.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=pc(n);return this.create({...n,jsx:t(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const gt=new kg,Og=(e,t)=>gt.message(e,t),Pg=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Rg=Og,Tg=()=>gt.toasts,Ig=()=>gt.getActiveToasts(),E2=Object.assign(Rg,{success:gt.success,info:gt.info,warning:gt.warning,error:gt.error,custom:gt.custom,message:gt.message,promise:gt.promise,dismiss:gt.dismiss,loading:gt.loading},{getHistory:Tg,getToasts:Ig});pg("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function vo(e){return e.label!==void 0}const Ag=3,Ng="24px",Dg="16px",mc=4e3,Mg=356,jg=14,$g=45,zg=200;function $t(...e){return e.filter(Boolean).join(" ")}function Fg(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Lg=e=>{var t,n,r,o,s,i,a,c,u;const{invert:d,toast:l,unstyled:f,interacting:p,setHeights:v,visibleToasts:g,heights:w,index:b,toasts:x,expanded:_,removeToast:C,defaultRichColors:S,closeButton:P,style:R,cancelButtonStyle:T,actionButtonStyle:A,className:j="",descriptionClassName:F="",duration:z,position:Y,gap:Z,expandByDefault:K,classNames:H,icons:J,closeButtonAriaLabel:ne="Close toast"}=e,[te,X]=I.useState(null),[q,me]=I.useState(null),[he,ae]=I.useState(!1),[re,B]=I.useState(!1),[se,ye]=I.useState(!1),[le,Pe]=I.useState(!1),[je,Ee]=I.useState(!1),[$e,We]=I.useState(0),[kt,lt]=I.useState(0),Le=I.useRef(l.duration||z||mc),qn=I.useRef(null),pt=I.useRef(null),Rn=b===0,on=b+1<=g,ze=l.type,Tr=ze??"default",sn=l.dismissible!==!1,Ir=l.className||"",fo=l.descriptionClassName||"",an=I.useMemo(()=>w.findIndex(D=>D.toastId===l.id)||0,[w,l.id]),Ar=I.useMemo(()=>{var D;return(D=l.closeButton)!=null?D:P},[l.closeButton,P]),ho=I.useMemo(()=>l.duration||z||mc,[l.duration,z]),Qn=I.useRef(0),cn=I.useRef(0),Nr=I.useRef(0),Ht=I.useRef(null),[xs,Ss]=Y.split("-"),Es=I.useMemo(()=>w.reduce((D,V,Q)=>Q>=an?D:D+V.height,0),[w,an]),Cs=Sg(),wt=I.useMemo(()=>{var D;return(D=e.swipeDirections)!=null?D:Fg(Y)},[e.swipeDirections,Y]),y=l.invert||d,O=ze==="loading";cn.current=I.useMemo(()=>an*Z+Es,[an,Es]),I.useEffect(()=>{Le.current=ho},[ho]),I.useEffect(()=>{ae(!0)},[]),I.useEffect(()=>{const D=pt.current;if(D){const V=D.getBoundingClientRect().height;return lt(V),v(Q=>[{toastId:l.id,height:V,position:l.position},...Q]),()=>v(Q=>Q.filter(ue=>ue.toastId!==l.id))}},[v,l.id]),I.useLayoutEffect(()=>{if(!he)return;const D=pt.current,V=D.style.height;D.style.height="auto";const Q=D.getBoundingClientRect().height;D.style.height=V,lt(Q),v(ue=>ue.find(we=>we.toastId===l.id)?ue.map(we=>we.toastId===l.id?{...we,height:Q}:we):[{toastId:l.id,height:Q,position:l.position},...ue])},[he,l.title,l.description,v,l.id,l.jsx,l.action,l.cancel]);const k=I.useCallback(()=>{B(!0),We(cn.current),v(D=>D.filter(V=>V.toastId!==l.id)),setTimeout(()=>{C(l)},zg)},[l,C,v,cn]);I.useEffect(()=>{if(l.promise&&ze==="loading"||l.duration===1/0||l.type==="loading")return;let D;return _||p||Cs?(()=>{if(Nr.current<Qn.current){const ue=new Date().getTime()-Qn.current;Le.current=Le.current-ue}Nr.current=new Date().getTime()})():(()=>{Le.current!==1/0&&(Qn.current=new Date().getTime(),D=setTimeout(()=>{l.onAutoClose==null||l.onAutoClose.call(l,l),k()},Le.current))})(),()=>clearTimeout(D)},[_,p,l,ze,Cs,k]),I.useEffect(()=>{l.delete&&(k(),l.onDismiss==null||l.onDismiss.call(l,l))},[k,l.delete]);function N(){var D;if(J!=null&&J.loading){var V;return I.createElement("div",{className:$t(H==null?void 0:H.loader,l==null||(V=l.classNames)==null?void 0:V.loader,"sonner-loader"),"data-visible":ze==="loading"},J.loading)}return I.createElement(vg,{className:$t(H==null?void 0:H.loader,l==null||(D=l.classNames)==null?void 0:D.loader),visible:ze==="loading"})}const $=l.icon||(J==null?void 0:J[ze])||mg(ze);var W,L;return I.createElement("li",{tabIndex:0,ref:pt,className:$t(j,Ir,H==null?void 0:H.toast,l==null||(t=l.classNames)==null?void 0:t.toast,H==null?void 0:H[Tr],l==null||(n=l.classNames)==null?void 0:n[Tr]),"data-sonner-toast":"","data-rich-colors":(W=l.richColors)!=null?W:S,"data-styled":!(l.jsx||l.unstyled||f),"data-mounted":he,"data-promise":!!l.promise,"data-swiped":je,"data-removed":re,"data-visible":on,"data-y-position":xs,"data-x-position":Ss,"data-index":b,"data-front":Rn,"data-swiping":se,"data-dismissible":sn,"data-type":ze,"data-invert":y,"data-swipe-out":le,"data-swipe-direction":q,"data-expanded":!!(_||K&&he),"data-testid":l.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${re?$e:cn.current}px`,"--initial-height":K?"auto":`${kt}px`,...R,...l.style},onDragEnd:()=>{ye(!1),X(null),Ht.current=null},onPointerDown:D=>{D.button!==2&&(O||!sn||(qn.current=new Date,We(cn.current),D.target.setPointerCapture(D.pointerId),D.target.tagName!=="BUTTON"&&(ye(!0),Ht.current={x:D.clientX,y:D.clientY})))},onPointerUp:()=>{var D,V,Q;if(le||!sn)return;Ht.current=null;const ue=Number(((D=pt.current)==null?void 0:D.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),be=Number(((V=pt.current)==null?void 0:V.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),we=new Date().getTime()-((Q=qn.current)==null?void 0:Q.getTime()),ke=te==="x"?ue:be,mt=Math.abs(ke)/we;if((te==="x"?wt.includes(ue>0?"right":"left"):wt.includes(be>0?"bottom":"top"))&&(Math.abs(ke)>=$g||mt>.11)){We(cn.current),l.onDismiss==null||l.onDismiss.call(l,l),me(te==="x"?ue>0?"right":"left":be>0?"down":"up"),k(),Pe(!0);return}else{var _t,Dr;(_t=pt.current)==null||_t.style.setProperty("--swipe-amount-x","0px"),(Dr=pt.current)==null||Dr.style.setProperty("--swipe-amount-y","0px")}Ee(!1),ye(!1),X(null)},onPointerMove:D=>{var V,Q,ue;if(!Ht.current||!sn||((V=window.getSelection())==null?void 0:V.toString().length)>0)return;const we=D.clientY-Ht.current.y,ke=D.clientX-Ht.current.x;!te&&(Math.abs(ke)>1||Math.abs(we)>1)&&X(Math.abs(ke)>Math.abs(we)?"x":"y");let mt={x:0,y:0};const ln=_t=>1/(1.5+Math.abs(_t)/20);if(te==="y"){if(wt.includes("top")||wt.includes("bottom"))if(wt.includes("top")&&we<0||wt.includes("bottom")&&we>0)mt.y=we;else{const _t=we*ln(we);mt.y=Math.abs(_t)<Math.abs(we)?_t:we}}else if(te==="x"&&(wt.includes("left")||wt.includes("right")))if(wt.includes("left")&&ke<0||wt.includes("right")&&ke>0)mt.x=ke;else{const _t=ke*ln(ke);mt.x=Math.abs(_t)<Math.abs(ke)?_t:ke}(Math.abs(mt.x)>0||Math.abs(mt.y)>0)&&Ee(!0),(Q=pt.current)==null||Q.style.setProperty("--swipe-amount-x",`${mt.x}px`),(ue=pt.current)==null||ue.style.setProperty("--swipe-amount-y",`${mt.y}px`)}},Ar&&!l.jsx&&ze!=="loading"?I.createElement("button",{"aria-label":ne,"data-disabled":O,"data-close-button":!0,onClick:O||!sn?()=>{}:()=>{k(),l.onDismiss==null||l.onDismiss.call(l,l)},className:$t(H==null?void 0:H.closeButton,l==null||(r=l.classNames)==null?void 0:r.closeButton)},(L=J==null?void 0:J.close)!=null?L:xg):null,(ze||l.icon||l.promise)&&l.icon!==null&&((J==null?void 0:J[ze])!==null||l.icon)?I.createElement("div",{"data-icon":"",className:$t(H==null?void 0:H.icon,l==null||(o=l.classNames)==null?void 0:o.icon)},ze==="loading"?l.icon||N():l.promise?N():null,ze!=="loading"?$:null):null,I.createElement("div",{"data-content":"",className:$t(H==null?void 0:H.content,l==null||(s=l.classNames)==null?void 0:s.content)},I.createElement("div",{"data-title":"",className:$t(H==null?void 0:H.title,l==null||(i=l.classNames)==null?void 0:i.title)},l.jsx?l.jsx:typeof l.title=="function"?l.title():l.title),l.description?I.createElement("div",{"data-description":"",className:$t(F,fo,H==null?void 0:H.description,l==null||(a=l.classNames)==null?void 0:a.description)},typeof l.description=="function"?l.description():l.description):null),I.isValidElement(l.cancel)?l.cancel:l.cancel&&vo(l.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:l.cancelButtonStyle||T,onClick:D=>{vo(l.cancel)&&sn&&(l.cancel.onClick==null||l.cancel.onClick.call(l.cancel,D),k())},className:$t(H==null?void 0:H.cancelButton,l==null||(c=l.classNames)==null?void 0:c.cancelButton)},l.cancel.label):null,I.isValidElement(l.action)?l.action:l.action&&vo(l.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:l.actionButtonStyle||A,onClick:D=>{vo(l.action)&&(l.action.onClick==null||l.action.onClick.call(l.action,D),!D.defaultPrevented&&k())},className:$t(H==null?void 0:H.actionButton,l==null||(u=l.classNames)==null?void 0:u.actionButton)},l.action.label):null)};function gc(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Vg(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",a=s?Dg:Ng;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${i}-${u}`]=a:n[`${i}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(a)}),n}const Ug=I.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:c,className:u,offset:d,mobileOffset:l,theme:f="light",richColors:p,duration:v,style:g,visibleToasts:w=Ag,toastOptions:b,dir:x=gc(),gap:_=jg,icons:C,customAriaLabel:S,containerAriaLabel:P="Notifications"}=t,[R,T]=I.useState([]),A=I.useMemo(()=>r?R.filter(ae=>ae.toasterId===r):R.filter(ae=>!ae.toasterId),[R,r]),j=I.useMemo(()=>Array.from(new Set([s].concat(A.filter(ae=>ae.position).map(ae=>ae.position)))),[A,s]),[F,z]=I.useState([]),[Y,Z]=I.useState(!1),[K,H]=I.useState(!1),[J,ne]=I.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),te=I.useRef(null),X=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=I.useRef(null),me=I.useRef(!1),he=I.useCallback(ae=>{T(re=>{var B;return(B=re.find(se=>se.id===ae.id))!=null&&B.delete||gt.dismiss(ae.id),re.filter(({id:se})=>se!==ae.id)})},[]);return I.useEffect(()=>gt.subscribe(ae=>{if(ae.dismiss){requestAnimationFrame(()=>{T(re=>re.map(B=>B.id===ae.id?{...B,delete:!0}:B))});return}setTimeout(()=>{Tp.flushSync(()=>{T(re=>{const B=re.findIndex(se=>se.id===ae.id);return B!==-1?[...re.slice(0,B),{...re[B],...ae},...re.slice(B+1)]:[ae,...re]})})})}),[]),I.useEffect(()=>{if(f!=="system"){ne(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ne("dark"):ne("light")),typeof window>"u")return;const ae=window.matchMedia("(prefers-color-scheme: dark)");try{ae.addEventListener("change",({matches:re})=>{ne(re?"dark":"light")})}catch{ae.addListener(({matches:B})=>{try{ne(B?"dark":"light")}catch(se){console.error(se)}})}},[f]),I.useEffect(()=>{R.length<=1&&Z(!1)},[R]),I.useEffect(()=>{const ae=re=>{var B;if(i.length>0&&i.every(le=>re[le]||re.code===le)){var ye;Z(!0),(ye=te.current)==null||ye.focus()}re.code==="Escape"&&(document.activeElement===te.current||(B=te.current)!=null&&B.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[i]),I.useEffect(()=>{if(te.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,me.current=!1)}},[te.current]),I.createElement("section",{ref:n,"aria-label":S??`${P} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},j.map((ae,re)=>{var B;const[se,ye]=ae.split("-");return A.length?I.createElement("ol",{key:ae,dir:x==="auto"?gc():x,tabIndex:-1,ref:te,className:u,"data-sonner-toaster":!0,"data-sonner-theme":J,"data-y-position":se,"data-x-position":ye,style:{"--front-toast-height":`${((B=F[0])==null?void 0:B.height)||0}px`,"--width":`${Mg}px`,"--gap":`${_}px`,...g,...Vg(d,l)},onBlur:le=>{me.current&&!le.currentTarget.contains(le.relatedTarget)&&(me.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||me.current||(me.current=!0,q.current=le.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{K||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},A.filter(le=>!le.position&&re===0||le.position===ae).map((le,Pe)=>{var je,Ee;return I.createElement(Lg,{key:le.id,icons:C,index:Pe,toast:le,defaultRichColors:p,duration:(je=b==null?void 0:b.duration)!=null?je:v,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:o,visibleToasts:w,closeButton:(Ee=b==null?void 0:b.closeButton)!=null?Ee:c,interacting:K,position:ae,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:he,toasts:A.filter($e=>$e.position==le.position),heights:F.filter($e=>$e.position==le.position),setHeights:z,expandByDefault:a,gap:_,expanded:Y,swipeDirections:t.swipeDirections})})):null}))}),Zg=e=>{const t=ee.c(7);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];const{theme:r}=ss(),s=r===void 0?"system":r;let i,a;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={success:m.jsx(Jm,{className:"size-4"}),info:m.jsx(eg,{className:"size-4"}),warning:m.jsx(dg,{className:"size-4"}),error:m.jsx(ag,{className:"size-4"}),loading:m.jsx(rg,{className:"size-4 animate-spin"})},a={"--normal-bg":"hsl(var(--popover))","--normal-text":"hsl(var(--popover-foreground))","--normal-border":"hsl(var(--border))","--border-radius":"var(--radius)",fontFamily:"inherit"},t[2]=i,t[3]=a):(i=t[2],a=t[3]);let c;return t[4]!==n||t[5]!==s?(c=m.jsx(Ug,{theme:s,className:"toaster group",icons:i,style:a,...n}),t[4]=n,t[5]=s,t[6]=c):c=t[6],c};var Bg=Object.defineProperty,na=(e,t)=>Bg(e,"name",{value:t,configurable:!0});function li(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}na(li,"setRef");function Fu(...e){return t=>{let n=!1;const r=e.map(o=>{const s=li(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():li(e[o],null)}}}}na(Fu,"composeRefs");function Te(...e){return h.useCallback(Fu(...e),e)}na(Te,"useComposedRefs");var Hg=Object.defineProperty,Ct=(e,t)=>Hg(e,"name",{value:t,configurable:!0});function Jt(e){const t=h.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const c=[];o=Wu(o),h.Children.forEach(o,f=>{var p;if(Bu(f)){a=!0;const v=f;let g="child"in v.props?v.props.child:v.props.children;for(;ra(g)&&typeof Ko=="function";)g=Ko(g._payload);i=Wg(v,g),c.push((p=i==null?void 0:i.props)==null?void 0:p.children)}else c.push(f)}),i?i=h.cloneElement(i,void 0,c):!a&&h.Children.count(o)===1&&h.isValidElement(o)&&(i=o);const u=i?Zu(i):void 0,d=Te(r,u);if(!i){if(o||o===0)throw new Error(a?qg(e):Gg(e));return o}const l=Uu(s,i.props??{});return i.type!==h.Fragment&&(l.ref=r?d:u),h.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}Ct(Jt,"createSlot");var xr=Jt("Slot"),Lu=Symbol.for("radix.slottable");function Vu(e){const t=Ct(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Lu,t}Ct(Vu,"createSlottable");var Wg=Ct((e,t)=>"child"in e.props?h.isValidElement(t)?h.cloneElement(t,void 0,e.props.children(t.props.children)):null:h.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function Uu(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"?n[r]=[o,s].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=Ku(s,o))}return{...e,...n}}Ct(Uu,"mergeProps");function Zu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ct(Zu,"getElementRef");function Bu(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lu}Ct(Bu,"isSlottable");var Kg=Symbol.for("react.lazy");function ra(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Kg&&"_payload"in e&&Hu(e._payload)}Ct(ra,"isLazyComponent");function Hu(e){return typeof e=="object"&&e!==null&&"then"in e}Ct(Hu,"isPromiseLike");function Wu(e){let t=e;for(;ra(t)&&typeof Ko=="function";)t=Ko(t._payload);return t}Ct(Wu,"useUnwrappedLazy");function Ku(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Ct(Ku,"concatAriaDescribedby");var Gg=Ct(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),qg=Ct(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Ko=Bn[" use ".trim().toString()];function Gu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Gu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function qu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Gu(e))&&(r&&(r+=" "),r+=t);return r}const vc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yc=qu,so=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yc(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],l=s==null?void 0:s[u];if(d===null)return null;const f=vc(d)||vc(l);return o[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[l,f]=d;return f===void 0||(u[l]=f),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:l,className:f,...p}=d;return Object.entries(p).every(v=>{let[g,w]=v;return Array.isArray(w)?w.includes({...s,...a}[g]):{...s,...a}[g]===w})?[...u,l,f]:u},[]);return yc(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Qg=768,Qu=`(max-width: ${Qg-1}px)`;function Yg(e){const t=window.matchMedia(Qu);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function Jg(){return h.useSyncExternalStore(Yg,ev,Xg)}function Xg(){return!1}function ev(){return window.matchMedia(Qu).matches}const oa="-",tv=e=>{const t=rv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(oa);return a[0]===""&&a.length!==1&&a.shift(),Yu(a,t)||nv(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},Yu=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Yu(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(oa);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},bc=/^\[(.+)\]$/,nv=e=>{if(bc.test(e)){const t=bc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},rv=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return sv(Object.entries(e.classGroups),n).forEach(([s,i])=>{ui(i,r,s,t)}),r},ui=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:wc(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(ov(o)){ui(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{ui(i,wc(t,s),n,r)})})},wc=(e,t)=>{let n=e;return t.split(oa).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ov=e=>e.isThemeGetter,sv=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,iv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Ju="!",av=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const c=[];let u=0,d=0,l;for(let w=0;w<a.length;w++){let b=a[w];if(u===0){if(b===o&&(r||a.slice(w,w+s)===t)){c.push(a.slice(d,w)),d=w+s;continue}if(b==="/"){l=w;continue}}b==="["?u++:b==="]"&&u--}const f=c.length===0?a:a.substring(d),p=f.startsWith(Ju),v=p?f.substring(1):f,g=l&&l>d?l-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},cv=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},lv=e=>({cache:iv(e.cacheSize),parseClassName:av(e),...tv(e)}),uv=/\s+/,dv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(uv);let a="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{modifiers:d,hasImportantModifier:l,baseClassName:f,maybePostfixModifierPosition:p}=n(u);let v=!!p,g=r(v?f.substring(0,p):f);if(!g){if(!v){a=u+(a.length>0?" "+a:a);continue}if(g=r(f),!g){a=u+(a.length>0?" "+a:a);continue}v=!1}const w=cv(d).join(":"),b=l?w+Ju:w,x=b+g;if(s.includes(x))continue;s.push(x);const _=o(g,v);for(let C=0;C<_.length;++C){const S=_[C];s.push(b+S)}a=u+(a.length>0?" "+a:a)}return a};function fv(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Xu(t))&&(r&&(r+=" "),r+=n);return r}const Xu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Xu(e[r]))&&(n&&(n+=" "),n+=t);return n};function hv(e,...t){let n,r,o,s=i;function i(c){const u=t.reduce((d,l)=>l(d),e());return n=lv(u),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const u=r(c);if(u)return u;const d=dv(c,n);return o(c,d),d}return function(){return s(fv.apply(null,arguments))}}const Re=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ed=/^\[(?:([a-z-]+):)?(.+)\]$/i,pv=/^\d+\/\d+$/,mv=new Set(["px","full","screen"]),gv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wt=e=>nr(e)||mv.has(e)||pv.test(e),un=e=>Sr(e,"length",Pv),nr=e=>!!e&&!Number.isNaN(Number(e)),Ts=e=>Sr(e,"number",nr),Mr=e=>!!e&&Number.isInteger(Number(e)),_v=e=>e.endsWith("%")&&nr(e.slice(0,-1)),fe=e=>ed.test(e),dn=e=>gv.test(e),xv=new Set(["length","size","percentage"]),Sv=e=>Sr(e,xv,td),Ev=e=>Sr(e,"position",td),Cv=new Set(["image","url"]),kv=e=>Sr(e,Cv,Tv),Ov=e=>Sr(e,"",Rv),jr=()=>!0,Sr=(e,t,n)=>{const r=ed.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Pv=e=>vv.test(e)&&!yv.test(e),td=()=>!1,Rv=e=>bv.test(e),Tv=e=>wv.test(e),Iv=()=>{const e=Re("colors"),t=Re("spacing"),n=Re("blur"),r=Re("brightness"),o=Re("borderColor"),s=Re("borderRadius"),i=Re("borderSpacing"),a=Re("borderWidth"),c=Re("contrast"),u=Re("grayscale"),d=Re("hueRotate"),l=Re("invert"),f=Re("gap"),p=Re("gradientColorStops"),v=Re("gradientColorStopPositions"),g=Re("inset"),w=Re("margin"),b=Re("opacity"),x=Re("padding"),_=Re("saturate"),C=Re("scale"),S=Re("sepia"),P=Re("skew"),R=Re("space"),T=Re("translate"),A=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",fe,t],z=()=>[fe,t],Y=()=>["",Wt,un],Z=()=>["auto",nr,fe],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],te=()=>["","0",fe],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[nr,fe];return{cacheSize:500,separator:":",theme:{colors:[jr],spacing:[Wt,un],blur:["none","",dn,fe],brightness:q(),borderColor:[e],borderRadius:["none","","full",dn,fe],borderSpacing:z(),borderWidth:Y(),contrast:q(),grayscale:te(),hueRotate:q(),invert:te(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[_v,un],inset:F(),margin:F(),opacity:q(),padding:z(),saturate:q(),scale:q(),sepia:te(),skew:q(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",fe]}],container:["container"],columns:[{columns:[dn]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),fe]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Mr,fe]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",fe]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:["first","last","none",Mr,fe]}],"grid-cols":[{"grid-cols":[jr]}],"col-start-end":[{col:["auto",{span:["full",Mr,fe]},fe]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[jr]}],"row-start-end":[{row:["auto",{span:[Mr,fe]},fe]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",fe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",fe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",fe,t]}],"min-w":[{"min-w":[fe,t,"min","max","fit"]}],"max-w":[{"max-w":[fe,t,"none","full","min","max","fit","prose",{screen:[dn]},dn]}],h:[{h:[fe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[fe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[fe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[fe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",dn,un]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ts]}],"font-family":[{font:[jr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",fe]}],"line-clamp":[{"line-clamp":["none",nr,Ts]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wt,fe]}],"list-image":[{"list-image":["none",fe]}],"list-style-type":[{list:["none","disc","decimal",fe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wt,un]}],"underline-offset":[{"underline-offset":["auto",Wt,fe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),Ev]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Sv]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},kv]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:H()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Wt,fe]}],"outline-w":[{outline:[Wt,un]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Wt,un]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",dn,Ov]}],"shadow-color":[{shadow:[jr]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",dn,fe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[l]}],saturate:[{saturate:[_]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[l]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",fe]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",fe]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",fe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Mr,fe]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",fe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wt,un,Ts]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Av=hv(Iv);function ce(...e){return Av(qu(e))}const Nv=so("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8","icon-sm":"h-9 w-9",icon:"h-10 w-10",pill:"h-12 px-6 rounded-pill",nav:"h-7 px-3 text-xs"}},defaultVariants:{variant:"default",size:"default"}}),is=h.forwardRef((e,t)=>{const n=ee.c(15);let r,o,s,i,a;n[0]!==e?({className:r,variant:a,size:s,asChild:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5]);const u=(i===void 0?!1:i)?xr:"button";let d;n[6]!==r||n[7]!==s||n[8]!==a?(d=ce(Nv({variant:a,size:s,className:r})),n[6]=r,n[7]=s,n[8]=a,n[9]=d):d=n[9];let l;return n[10]!==u||n[11]!==o||n[12]!==t||n[13]!==d?(l=m.jsx(u,{className:d,ref:t,...o}),n[10]=u,n[11]=o,n[12]=t,n[13]=d,n[14]=l):l=n[14],l});is.displayName="Button";const Go=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,type:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==r?(i=ce("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),n[4]=r,n[5]=i):i=n[5];let a;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==s?(a=m.jsx("input",{type:s,className:i,ref:t,...o}),n[6]=o,n[7]=t,n[8]=i,n[9]=s,n[10]=a):a=n[10],a});Go.displayName="Input";var Dv=Object.defineProperty,Mv=(e,t)=>Dv(e,"name",{value:t,configurable:!0}),jv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=jv.reduce((e,t)=>{const n=Jt(`Primitive.${t}`),r=h.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sa(e,t){e&&ru.flushSync(()=>e.dispatchEvent(t))}Mv(sa,"dispatchDiscreteCustomEvent");var $v=Object.defineProperty,nd=(e,t)=>$v(e,"name",{value:t,configurable:!0}),ia={Horizontal:"horizontal",Vertical:"vertical"},_c=ia.Horizontal,zv=Object.values(ia),rd=h.forwardRef(nd(function(t,n){const{decorative:r,orientation:o=_c,...s}=t,i=od(o)?o:_c,a=i===ia.Vertical?i:void 0,c=r?{role:"none"}:{"aria-orientation":a,role:"separator"};return m.jsx(Ze.div,{"data-orientation":i,...c,...s,ref:n})},"Separator"));function od(e){return zv.includes(e)}nd(od,"isValidOrientation");const qo=h.forwardRef((e,t)=>{const n=ee.c(14);let r,o,s,i;n[0]!==e?({className:r,orientation:s,decorative:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s===void 0?"horizontal":s,c=i===void 0?!0:i,u=a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]";let d;n[5]!==r||n[6]!==u?(d=ce("shrink-0 bg-border",u,r),n[5]=r,n[6]=u,n[7]=d):d=n[7];let l;return n[8]!==c||n[9]!==a||n[10]!==o||n[11]!==t||n[12]!==d?(l=m.jsx(rd,{ref:t,decorative:c,orientation:a,className:d,...o}),n[8]=c,n[9]=a,n[10]=o,n[11]=t,n[12]=d,n[13]=l):l=n[13],l});qo.displayName=rd.displayName;var Fv=Object.defineProperty,Er=(e,t)=>Fv(e,"name",{value:t,configurable:!0}),sd=!!(typeof window<"u"&&window.document&&window.document.createElement);function de(e,t,{checkForDefaultPrevented:n=!0}={}){return Er(function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)},"handleEvent")}Er(de,"composeEventHandlers");function Lv(e){var t;if(!sd)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Er(Lv,"getOwnerWindow");function di(e){if(!sd)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Er(di,"getOwnerDocument");function id(e,t=!1){const{activeElement:n}=di(e);if(!(n!=null&&n.nodeName))return null;if(ad(n)&&n.contentDocument)return id(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=di(n).getElementById(r);if(o)return o}}return n}Er(id,"getActiveElement");function ad(e){return e.tagName==="IFRAME"}Er(ad,"isFrame");var Vv=Object.defineProperty,Pt=(e,t)=>Vv(e,"name",{value:t,configurable:!0});function Uv(e,t){const n=h.createContext(t);n.displayName=e+"Context";const r=Pt(s=>{const{children:i,...a}=s,c=h.useMemo(()=>a,Object.values(a));return m.jsx(n.Provider,{value:c,children:i})},"Provider");r.displayName=e+"Provider";function o(s,i={}){const{optional:a=!1}=i,c=h.useContext(n);if(c)return c;if(t!==void 0)return t;if(!a)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Pt(o,"useContext"),[r,o]}Pt(Uv,"createContext");function nn(e,t=[]){let n=[];function r(s,i){const a=h.createContext(i);a.displayName=s+"Context";const c=n.length;n=[...n,i];const u=Pt(l=>{var b;const{scope:f,children:p,...v}=l,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||a,w=h.useMemo(()=>v,Object.values(v));return m.jsx(g.Provider,{value:w,children:p})},"Provider");u.displayName=s+"Provider";function d(l,f,p={}){var b;const{optional:v=!1}=p,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||a,w=h.useContext(g);if(w)return w;if(i!==void 0)return i;if(!v)throw new Error(`\`${l}\` must be used within \`${s}\``)}return Pt(d,"useContext"),[u,d]}Pt(r,"createContext");const o=Pt(()=>{const s=n.map(i=>h.createContext(i));return Pt(function(a){const c=(a==null?void 0:a[e])||s;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])},"useScope")},"createScope");return o.scopeName=e,[r,cd(o,...t)]}Pt(nn,"createContextScope");function cd(...e){const t=e[0];if(e.length===1)return t;const n=Pt(()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return Pt(function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const l=c(s)[`__scope${u}`];return{...a,...l}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Pt(cd,"composeContextScopes");var ct=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Zv=Object.defineProperty,Bv=(e,t)=>Zv(e,"name",{value:t,configurable:!0}),Hv=Bn[" useId ".trim().toString()]||(()=>{}),Wv=0;function En(e){const[t,n]=h.useState(Hv());return ct(()=>{e||n(r=>r??String(Wv++))},[e]),e||(t?`radix-${t}`:"")}Bv(En,"useId");var Kv=Object.defineProperty,Gv=(e,t)=>Kv(e,"name",{value:t,configurable:!0}),xc=Bn[" useEffectEvent ".trim().toString()],Sc=Bn[" useInsertionEffect ".trim().toString()];function ld(e){if(typeof xc=="function")return xc(e);const t=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Sc=="function"?Sc(()=>{t.current=e}):ct(()=>{t.current=e}),h.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Gv(ld,"useEffectEvent");var qv=Object.defineProperty,io=(e,t)=>qv(e,"name",{value:t,configurable:!0}),Qv=Bn[" useInsertionEffect ".trim().toString()]||ct;function ao({prop:e,defaultProp:t,onChange:n=io(()=>{},"onChange"),caller:r}){const[o,s,i]=ud({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o,u=h.useCallback(d=>{var l;if(a){const f=dd(d)?d(e):d;f!==e&&((l=i.current)==null||l.call(i,f))}else s(d)},[a,e,s,i]);return[c,u]}io(ao,"useControllableState");function ud({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),s=h.useRef(t);return Qv(()=>{s.current=t},[t]),h.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}io(ud,"useUncontrolledState");function dd(e){return typeof e=="function"}io(dd,"isFunction");var Ec=Symbol("RADIX:SYNC_STATE");function Yv(e,t,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=t,c=o!==void 0,u=ld(i),d=[{...n,state:s}];r&&d.push(r);const[l,f]=h.useReducer((w,b)=>{if(b.type===Ec)return{...w,state:b.state};const x=e(w,b);return c&&!Object.is(x.state,w.state)&&u(x.state),x},...d),p=l.state,v=h.useRef(p);h.useEffect(()=>{v.current!==p&&(v.current=p,c||u(p))},[p,v,c]);const g=h.useMemo(()=>o!==void 0?{...l,state:o}:l,[l,o]);return h.useEffect(()=>{c&&!Object.is(o,l.state)&&f({type:Ec,state:o})},[o,l.state,c]),[g,f]}io(Yv,"useControllableStateReducer");var Jv=Object.defineProperty,Xv=(e,t)=>Jv(e,"name",{value:t,configurable:!0}),Cc=Bn[" useInsertionEffect ".trim().toString()];function Xt(e){const t=h.useRef(e);return typeof Cc=="function"?Cc(()=>{t.current=e}):ct(()=>{t.current=e}),h.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Xv(Xt,"useCallbackRef");var ey=Object.defineProperty,et=(e,t)=>ey(e,"name",{value:t,configurable:!0}),fi="dismissableLayer.update",ty="dismissableLayer.pointerDownOutside",ny="dismissableLayer.focusOutside",kc,fd=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),aa=h.forwardRef(et(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...d}=t,l=h.useContext(fd),[f,p]=h.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=h.useState({}),w=Te(n,p),b=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=x?b.indexOf(x):-1,C=f?b.indexOf(f):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,P=C>=_,R=h.useRef(!1),T=pd(z=>{i==null||i(z),c==null||c(z),z.defaultPrevented||u==null||u()},{ownerDocument:v,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:R,dismissableSurfaces:l.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(z=>{if(!(z instanceof Node))return!1;const Y=[...l.branches].some(Z=>Z.contains(z));return P&&!Y},[l.branches,P])}),A=md(z=>{if(o&&R.current)return;const Y=z.target;[...l.branches].some(K=>K.contains(Y))||(a==null||a(z),c==null||c(z),z.defaultPrevented||u==null||u())},v),j=f?C===b.length-1:!1,F=Xt(z=>{z.key==="Escape"&&(s==null||s(z),!z.defaultPrevented&&u&&(z.preventDefault(),u()))});return h.useEffect(()=>{if(j)return v.addEventListener("keydown",F,{capture:!0}),()=>v.removeEventListener("keydown",F,{capture:!0})},[v,j,F]),h.useEffect(()=>{if(f)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(kc=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),hi(),()=>{r&&(l.layersWithOutsidePointerEventsDisabled.delete(f),l.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=kc))}},[f,v,r,l]),h.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),hi())},[f,l]),h.useEffect(()=>{const z=et(()=>g({}),"handleUpdate");return document.addEventListener(fi,z),()=>document.removeEventListener(fi,z)},[]),m.jsx(Ze.div,{...d,ref:w,style:{pointerEvents:S?P?"auto":"none":void 0,...t.style},onFocusCapture:de(t.onFocusCapture,A.onFocusCapture),onBlurCapture:de(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:de(t.onPointerDownCapture,T.onPointerDownCapture)})},"DismissableLayer"));function hd(){const e=h.useContext(fd),[t,n]=h.useState(null);return h.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}et(hd,"useDismissableLayerSurface");var ry=et(()=>!0,"IS_TRUE");function pd(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=ry}=t,a=Xt(e),c=h.useRef(!1),u=h.useRef(!1),d=h.useRef(new Map),l=h.useRef(()=>{});return h.useEffect(()=>{function f(){u.current=!1,o.current=!1,d.current.clear()}et(f,"resetOutsideInteraction");function p(){return Array.from(d.current.values()).some(Boolean)}et(p,"isOutsideInteractionIntercepted");function v(_){if(!u.current)return;const C=_.target;C instanceof Node&&[...s].some(P=>P.contains(C))||d.current.set(_.type,!0),_.type==="click"&&window.setTimeout(()=>{u.current&&l.current()},0)}et(v,"handleInteractionCapture");function g(_){u.current&&d.current.set(_.type,!1)}et(g,"handleInteractionBubble");const w=et(_=>{if(_.target&&!c.current){let C=function(){n.removeEventListener("click",l.current);const P=p();f(),P||ca(ty,a,S,{discrete:!0})};if(et(C,"handleAndDispatchPointerDownOutsideEvent"),!i(_.target)){n.removeEventListener("click",l.current),f(),c.current=!1;return}const S={originalEvent:_};u.current=!0,o.current=r&&_.button===0,d.current.clear(),!r||_.button!==0?C():(n.removeEventListener("click",l.current),l.current=C,n.addEventListener("click",l.current,{once:!0}))}else n.removeEventListener("click",l.current),f();c.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const _ of b)n.addEventListener(_,v,!0),n.addEventListener(_,g);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",w),n.removeEventListener("click",l.current);for(const _ of b)n.removeEventListener(_,v,!0),n.removeEventListener(_,g)}},[n,a,r,o,s,i]),{onPointerDownCapture:et(()=>c.current=!0,"onPointerDownCapture")}}et(pd,"usePointerDownOutside");function md(e,t=globalThis==null?void 0:globalThis.document){const n=Xt(e),r=h.useRef(!1);return h.useEffect(()=>{const o=et(s=>{s.target&&!r.current&&ca(ny,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:et(()=>r.current=!0,"onFocusCapture"),onBlurCapture:et(()=>r.current=!1,"onBlurCapture")}}et(md,"useFocusOutside");function hi(){const e=new CustomEvent(fi);document.dispatchEvent(e)}et(hi,"dispatchUpdate");function ca(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?sa(o,s):o.dispatchEvent(s)}et(ca,"handleAndDispatchCustomEvent");var oy=Object.defineProperty,Ke=(e,t)=>oy(e,"name",{value:t,configurable:!0}),Is="focusScope.autoFocusOnMount",As="focusScope.autoFocusOnUnmount",Oc={bubbles:!1,cancelable:!0},gd=h.forwardRef(Ke(function(t,n){const{loop:r=!1,trapped:o=!1,branches:s,onMountAutoFocus:i,onUnmountAutoFocus:a,...c}=t,[u,d]=h.useState(null),l=Xt(i),f=Xt(a),p=h.useRef(null),v=Te(n,d),g=h.useRef(s);h.useEffect(()=>{g.current=s});const w=h.useCallback(_=>{var C;return _?u!=null&&u.contains(_)?!0:!!((C=g.current)!=null&&C.some(S=>S.contains(_))):!1},[u]),b=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let _=function(R){if(b.paused||!u)return;const T=R.target;w(T)?p.current=T:qt(p.current,{select:!0})},C=function(R){if(b.paused||!u)return;const T=R.relatedTarget;T!==null&&(w(T)||qt(p.current,{select:!0}))},S=function(R){if(document.activeElement===document.body)for(const A of R)A.removedNodes.length>0&&qt(u)};Ke(_,"handleFocusIn"),Ke(C,"handleFocusOut"),Ke(S,"handleMutations"),document.addEventListener("focusin",_),document.addEventListener("focusout",C);const P=new MutationObserver(S);return u&&P.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",C),P.disconnect()}}},[o,u,b.paused,w]),h.useEffect(()=>{if(u){Pc.add(b);const _=document.activeElement;if(!u.contains(_)){const S=new CustomEvent(Is,Oc);u.addEventListener(Is,l),u.dispatchEvent(S),S.defaultPrevented||(yd(Sd(fa(u)),{select:!0}),document.activeElement===_&&qt(u))}return()=>{u.removeEventListener(Is,l);const S=u.ownerDocument,P=CustomEvent;setTimeout(()=>{const R=new P(As,Oc);u.addEventListener(As,f),u.dispatchEvent(R),R.defaultPrevented||qt(_??S.body,{select:!0}),u.removeEventListener(As,f),Pc.remove(b)},0)}}},[u,l,f,b]);const x=h.useCallback(_=>{if(!r&&!o||b.paused)return;const C=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,S=document.activeElement;if(C&&S){const P=_.currentTarget,[R,T]=bd(P);R&&T?!_.shiftKey&&S===T?(_.preventDefault(),r&&qt(R,{select:!0})):_.shiftKey&&S===R&&(_.preventDefault(),r&&qt(T,{select:!0})):S===P&&_.preventDefault()}},[r,o,b.paused]);return m.jsx(Ze.div,{tabIndex:-1,...c,ref:v,onKeyDown:x})},"FocusScope")),vd=h.createContext(null);function la({registry:e,children:t}){return e?m.jsx(vd.Provider,{value:e,children:t}):t}Ke(la,"FocusScopeBranchProvider");function ua(){const[e,t]=h.useState([]),n=h.useMemo(()=>({add:Ke(r=>t(o=>o.includes(r)?o:[...o,r]),"add"),remove:Ke(r=>t(o=>o.filter(s=>s!==r)),"remove")}),[]);return{nodes:e,registry:n}}Ke(ua,"useFocusScopeBranchRegistry");function da(e){const t=h.useContext(vd);h.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}Ke(da,"useFocusScopeBranch");function yd(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qt(r,{select:t}),document.activeElement!==n)return}Ke(yd,"focusFirst");function bd(e){const t=fa(e),n=pi(t,e),r=pi(t.reverse(),e);return[n,r]}Ke(bd,"getTabbableEdges");function fa(e){const t=[],r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ke(o=>{const s=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||s?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}Ke(fa,"getTabbableCandidates");function pi(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):wd(r,{upTo:t})))return r}Ke(pi,"findVisible");function wd(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Ke(wd,"isHidden");function _d(e){return e.tagName==="INPUT"&&typeof e.select=="function"}Ke(_d,"isSelectableInput");function qt(e,{select:t=!1}={}){if(e&&e.focus){const r=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==r&&_d(e)&&t&&e.select()}}Ke(qt,"focus");var Pc=xd();function xd(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=mi(e,t),e.unshift(t)},remove(t){var n;e=mi(e,t),(n=e[0])==null||n.resume()}}}Ke(xd,"createFocusScopesStack");function mi(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ke(mi,"arrayRemove");function Sd(e){return e.filter(t=>t.tagName!=="A")}Ke(Sd,"removeLinks");var sy=Object.defineProperty,iy=(e,t)=>sy(e,"name",{value:t,configurable:!0}),ha=h.forwardRef(iy(function(t,n){var c;const{container:r,...o}=t,[s,i]=h.useState(!1);ct(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?ru.createPortal(m.jsx(Ze.div,{...o,ref:n}),a):null},"Portal")),ay=Object.defineProperty,en=(e,t)=>ay(e,"name",{value:t,configurable:!0});function Ed(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}en(Ed,"useStateMachine");var rn=en(e=>{const{present:t,children:n}=e,r=Cd(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),s=kd(r.ref,Od(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:s}):null},"Presence");function Cd(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),s=h.useRef("none"),i=h.useRef(void 0),a=e?"mounted":"unmounted",[c,u]=Ed(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{c==="mounted"?(s.current=i.current??tr(r.current),i.current=void 0):s.current="none"},[c]),ct(()=>{const d=r.current,l=o.current;if(l!==e){const p=s.current,v=tr(d);e?(i.current=v,u("MOUNT")):v==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(l&&p!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ct(()=>{if(t){let d;const l=t.ownerDocument.defaultView??window,f=en(v=>{const w=tr(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(u("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},"handleAnimationEnd"),p=en(v=>{v.target===t&&(s.current=tr(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{l.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:h.useCallback(d=>{if(d){const l=getComputedStyle(d);r.current=l,i.current=tr(l)}else r.current=null;n(d)},[])}}en(Cd,"usePresence");function gi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}en(gi,"setRef");function kd(...e){const t=h.useRef(e);return t.current=e,h.useCallback(n=>{const r=t.current;let o=!1;const s=r.map(i=>{const a=gi(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():gi(r[i],null)}}},[])}en(kd,"useStableComposedRefs");function tr(e){return(e==null?void 0:e.animationName)||"none"}en(tr,"getAnimationName");function Od(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}en(Od,"getElementRef");var cy=Object.defineProperty,pa=(e,t)=>cy(e,"name",{value:t,configurable:!0}),yo=0,zt=null;function ly(e){return as(),e.children}pa(ly,"FocusGuards");function as(){h.useEffect(()=>{zt||(zt={start:vi(),end:vi()});const{start:e,end:t}=zt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),yo++,()=>{yo===1&&(zt==null||zt.start.remove(),zt==null||zt.end.remove(),zt=null),yo=Math.max(0,yo-1)}},[])}pa(as,"useFocusGuards");function vi(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}pa(vi,"createFocusGuard");var Ut=function(){return Ut=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ut.apply(this,arguments)};function Pd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function uy(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var No="right-scroll-bar-position",Do="width-before-scroll-bar",dy="with-scroll-bars-hidden",fy="--removed-body-scroll-bar-size";function Ns(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function hy(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var py=typeof window<"u"?h.useLayoutEffect:h.useEffect,Rc=new WeakMap;function my(e,t){var n=hy(null,function(r){return e.forEach(function(o){return Ns(o,r)})});return py(function(){var r=Rc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ns(a,null)}),s.forEach(function(a){o.has(a)||Ns(a,i)})}Rc.set(n,e)},[e]),n}function gy(e){return e}function vy(e,t){t===void 0&&(t=gy);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function yy(e){e===void 0&&(e={});var t=vy(null);return t.options=Ut({async:!0,ssr:!1},e),t}var Rd=function(e){var t=e.sideCar,n=Pd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Ut({},n))};Rd.isSideCarExport=!0;function by(e,t){return e.useMedium(t),Rd}var Td=yy(),Ds=function(){},cs=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Ds,onWheelCapture:Ds,onTouchMoveCapture:Ds}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,l=e.shards,f=e.sideCar,p=e.noRelative,v=e.noIsolation,g=e.inert,w=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,_=e.gapMode,C=Pd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,P=my([n,t]),R=Ut(Ut({},C),o);return h.createElement(h.Fragment,null,d&&h.createElement(S,{sideCar:Td,removeScrollBar:u,shards:l,noRelative:p,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:_}),i?h.cloneElement(h.Children.only(a),Ut(Ut({},R),{ref:P})):h.createElement(x,Ut({},R,{className:c,ref:P}),a))});cs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cs.classNames={fullWidth:Do,zeroRight:No};var wy=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _y(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wy();return t&&e.setAttribute("nonce",t),e}function xy(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Sy(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ey=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_y())&&(xy(t,n),Sy(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Cy=function(){var e=Ey();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Id=function(){var e=Cy(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ky={left:0,top:0,right:0,gap:0},Ms=function(e){return parseInt(e||"",10)||0},Oy=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ms(n),Ms(r),Ms(o)]},Py=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ky;var t=Oy(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ry=Id(),rr="data-scroll-locked",Ty=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
153
153
|
.`.concat(dy,` {
|
|
154
154
|
overflow: hidden `).concat(r,`;
|
|
155
155
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -189,11 +189,11 @@ var nc=e=>{throw TypeError(e)};var ks=(e,t,n)=>t.has(e)||nc("Cannot "+n);var S=(
|
|
|
189
189
|
`)},Tc=function(){var e=parseInt(document.body.getAttribute(rr)||"0",10);return isFinite(e)?e:0},Iy=function(){h.useEffect(function(){return document.body.setAttribute(rr,(Tc()+1).toString()),function(){var e=Tc()-1;e<=0?document.body.removeAttribute(rr):document.body.setAttribute(rr,e.toString())}},[])},Ay=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Iy();var s=h.useMemo(function(){return Py(o)},[o]);return h.createElement(Ry,{styles:Ty(s,!t,o,n?"":"!important")})},yi=!1;if(typeof window<"u")try{var bo=Object.defineProperty({},"passive",{get:function(){return yi=!0,!0}});window.addEventListener("test",bo,bo),window.removeEventListener("test",bo,bo)}catch{yi=!1}var Yn=yi?{passive:!1}:!1,Ny=function(e){return e.tagName==="TEXTAREA"},Ad=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ny(e)&&n[t]==="visible")},Dy=function(e){return Ad(e,"overflowY")},My=function(e){return Ad(e,"overflowX")},Ic=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Nd(e,r);if(o){var s=Dd(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jy=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$y=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Nd=function(e,t){return e==="v"?Dy(t):My(t)},Dd=function(e,t){return e==="v"?jy(t):$y(t)},zy=function(e,t){return e==="h"&&t==="rtl"?-1:1},Fy=function(e,t,n,r,o){var s=zy(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),u=!1,d=i>0,l=0,f=0;do{if(!a)break;var p=Dd(e,a),v=p[0],g=p[1],w=p[2],b=g-w-s*v;(v||b)&&Nd(e,a)&&(l+=b,f+=v);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(l)<1||!d&&Math.abs(f)<1)&&(u=!0),u},wo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ac=function(e){return[e.deltaX,e.deltaY]},Nc=function(e){return e&&"current"in e?e.current:e},Ly=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vy=function(e){return`
|
|
190
190
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
191
191
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
192
|
-
`)},Uy=0,Jn=[];function Zy(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(Uy++)[0],s=h.useState(Id)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=uy([e.lockRef.current],(e.shards||[]).map(Nc),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var b=wo(g),x=n.current,_="deltaX"in g?g.deltaX:x[0]-b[0],C="deltaY"in g?g.deltaY:x[1]-b[1],E,P=g.target,R=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in g&&R==="h"&&P.type==="range")return!1;var T=window.getSelection(),A=T&&T.anchorNode,j=A?A===P||A.contains(P):!1;if(j)return!1;var F=Ic(R,P);if(!F)return!0;if(F?E=R:(E=R==="v"?"h":"v",F=Ic(R,P)),!F)return!1;if(!r.current&&"changedTouches"in g&&(_||C)&&(r.current=E),!E)return!0;var z=r.current||E;return Fy(z,w,g,z==="h"?_:C)},[]),c=h.useCallback(function(g){var w=g;if(!(!Jn.length||Jn[Jn.length-1]!==s)){var b="deltaY"in w?Ac(w):wo(w),x=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Ly(E.delta,b)})[0];if(x&&x.should){w.cancelable&&w.preventDefault();return}if(!x){var _=(i.current.shards||[]).map(Nc).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=_.length>0?a(w,_[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),u=h.useCallback(function(g,w,b,x){var _={name:g,delta:w,target:b,should:x,shadowParent:By(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),d=h.useCallback(function(g){n.current=wo(g),r.current=void 0},[]),l=h.useCallback(function(g){u(g.type,Ac(g),g.target,a(g,e.lockRef.current))},[]),f=h.useCallback(function(g){u(g.type,wo(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return Jn.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Yn),document.addEventListener("touchmove",c,Yn),document.addEventListener("touchstart",d,Yn),function(){Jn=Jn.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,Yn),document.removeEventListener("touchmove",c,Yn),document.removeEventListener("touchstart",d,Yn)}},[]);var p=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(s,{styles:Vy(o)}):null,p?h.createElement(Ay,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function By(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Hy=by(Td,Zy);var ma=h.forwardRef(function(e,t){return h.createElement(cs,Ut({},e,{ref:t,sideCar:Hy}))});ma.classNames=cs.classNames;var Wy=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xn=new WeakMap,_o=new WeakMap,xo={},js=0,Md=function(e){return e&&(e.host||Md(e.parentNode))},Ky=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Md(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Gy=function(e,t,n,r){var o=Ky(t,Array.isArray(e)?e:[e]);xo[n]||(xo[n]=new WeakMap);var s=xo[n],i=[],a=new Set,c=new Set(o),u=function(l){!l||a.has(l)||(a.add(l),u(l.parentNode))};o.forEach(u);var d=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(f){if(a.has(f))d(f);else try{var p=f.getAttribute(r),v=p!==null&&p!=="false",g=(Xn.get(f)||0)+1,w=(s.get(f)||0)+1;Xn.set(f,g),s.set(f,w),i.push(f),g===1&&v&&_o.set(f,!0),w===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),a.clear(),js++,function(){i.forEach(function(l){var f=Xn.get(l)-1,p=s.get(l)-1;Xn.set(l,f),s.set(l,p),f||(_o.has(l)||l.removeAttribute(r),_o.delete(l)),p||l.removeAttribute(n)}),js--,js||(Xn=new WeakMap,Xn=new WeakMap,_o=new WeakMap,xo={})}},jd=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Wy(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Gy(r,o,n,"aria-hidden")):function(){return null}},qy=Object.defineProperty,bt=(e,t)=>qy(e,"name",{value:t,configurable:!0}),ga="Dialog",[$d,C2]=rn(ga),[Qy,jt]=$d(ga),Yy=bt(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=h.useRef(null),c=h.useRef(null),{nodes:u,registry:d}=ua(),[l,f]=ao({prop:r,defaultProp:o??!1,onChange:s,caller:ga}),[p,v]=h.useState(0),[g,w]=h.useState(0);return m.jsx(Qy,{scope:t,triggerRef:a,contentRef:c,contentId:En(),titleId:En(),descriptionId:En(),titlePresent:p>0,descriptionPresent:g>0,setTitleCount:v,setDescriptionCount:w,open:l,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(b=>!b),[f]),modal:i,branchNodes:u,branchRegistry:d,children:n})},"Dialog"),Jy="DialogTrigger",k2=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(Jy,r),i=Te(n,s.triggerRef);return m.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":ls(s.open),...o,ref:i,onClick:de(t.onClick,s.onOpenToggle)})},"DialogTrigger")),zd="DialogPortal",[Xy,Fd]=$d(zd,{forceMount:void 0}),eb=bt(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=jt(zd,t);return m.jsx(Xy,{scope:t,forceMount:n,children:h.Children.map(r,i=>m.jsx(on,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),bi="DialogOverlay",Ld=h.forwardRef(bt(function(t,n){const r=Fd(bi,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=jt(bi,t.__scopeDialog);return i.modal?m.jsx(on,{present:o||i.open,children:m.jsx(nb,{...s,ref:n})}):null},"DialogOverlay")),tb=Xt("DialogOverlay.RemoveScroll"),nb=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(bi,r),i=hd(),a=Te(n,i);return m.jsx(ma,{as:tb,allowPinchZoom:!0,shards:h.useMemo(()=>[s.contentRef,...s.branchNodes.map(c=>({current:c}))],[s.contentRef,s.branchNodes]),children:m.jsx(Ze.div,{"data-state":ls(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Kr="DialogContent",Vd=h.forwardRef(bt(function(t,n){const r=Fd(Kr,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=jt(Kr,t.__scopeDialog);return m.jsx(on,{present:o||i.open,children:i.modal?m.jsx(rb,{...s,ref:n}):m.jsx(ob,{...s,ref:n})})},"DialogContent")),rb=h.forwardRef(bt(function(t,n){const r=jt(Kr,t.__scopeDialog),o=h.useRef(null),s=Te(n,r.contentRef,o);return h.useEffect(()=>{const i=o.current;if(i)return jd(i)},[]),m.jsx(Ud,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:de(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:de(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:de(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),ob=h.forwardRef(bt(function(t,n){const r=jt(Kr,t.__scopeDialog),o=h.useRef(!1),s=h.useRef(!1);return m.jsx(Ud,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Ud=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,"aria-describedby":a,children:c,...u}=t,d=jt(Kr,r);return as(),m.jsx(la,{registry:d.branchRegistry,children:m.jsx(gd,{asChild:!0,loop:!0,trapped:o,branches:d.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:i,children:m.jsx(aa,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?Hd(a,d.descriptionId):a,"data-state":ls(d.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:c})})})},"DialogContentImpl")),Zd=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt("DialogTitle",r),{setTitleCount:i}=s;return ct(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Ze.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),Bd=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt("DialogDescription",r),{setDescriptionCount:i}=s;return ct(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Ze.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),sb="DialogClose",ib=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(sb,r);return m.jsx(Ze.button,{type:"button",...o,ref:n,onClick:de(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Hd(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}bt(Hd,"concatAriaDescribedby");function ls(e){return e?"open":"closed"}bt(ls,"getState");const ab=Yy,cb=eb,Wd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("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",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Ld,{className:s,...o,ref:t}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Wd.displayName=Ld.displayName;const lb=so("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{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"}}),Kd=h.forwardRef((e,t)=>{const n=ee.c(15);let r,o,s,i;n[0]!==e?({side:i,className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=i===void 0?"right":i;let c;n[5]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(Wd,{}),n[5]=c):c=n[5];let u;n[6]!==o||n[7]!==a?(u=ce(lb({side:a}),o),n[6]=o,n[7]=a,n[8]=u):u=n[8];let d;n[9]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsxs(ib,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[m.jsx(hg,{className:"h-4 w-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]}),n[9]=d):d=n[9];let l;return n[10]!==r||n[11]!==s||n[12]!==t||n[13]!==u?(l=m.jsxs(cb,{children:[c,m.jsxs(Vd,{ref:t,className:u,...s,children:[r,d]})]}),n[10]=r,n[11]=s,n[12]=t,n[13]=u,n[14]=l):l=n[14],l});Kd.displayName=Vd.displayName;const Gd=e=>{const t=ee.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=ce("flex flex-col space-y-2 text-center sm:text-left",n),t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==r||t[6]!==o?(s=m.jsx("div",{className:o,...r}),t[5]=r,t[6]=o,t[7]=s):s=t[7],s};Gd.displayName="SheetHeader";const qd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-lg font-semibold text-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Zd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});qd.displayName=Zd.displayName;const Qd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Bd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Qd.displayName=Bd.displayName;function Dc(e){const t=ee.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=ce("animate-pulse rounded-md bg-muted",n),t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==r||t[6]!==o?(s=m.jsx("div",{className:o,...r}),t[5]=r,t[6]=o,t[7]=s):s=t[7],s}var ub=Object.defineProperty,db=(e,t)=>ub(e,"name",{value:t,configurable:!0});function Yd(e){const[t,n]=h.useState(void 0);return ct(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let r=0;const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let a,c;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,c=d.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})})});return o.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}else n(void 0)},[e]),t}db(Yd,"useSize");var fb=Object.defineProperty,Cn=(e,t)=>fb(e,"name",{value:t,configurable:!0}),Mc={Partial:"partial"},jc={Optimized:"optimized",Always:"always"},Jd="Popper",[Xd,us]=rn(Jd),[hb,ef]=Xd(Jd),tf=Cn(e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null),[s,i]=h.useState(void 0);return m.jsx(hb,{scope:t,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),pb="PopperAnchor",nf=h.forwardRef(Cn(function(t,n){const{__scopePopper:r,virtualRef:o,...s}=t,i=ef(pb,r),a=h.useRef(null),c=i.onAnchorChange,u=h.useCallback(g=>{a.current=g,g&&c(g)},[c]),d=Te(n,u),l=h.useRef(null);h.useEffect(()=>{if(!o)return;const g=l.current;l.current=o.current,g!==l.current&&c(l.current)});const f=i.placementState&&ds(i.placementState),p=f==null?void 0:f[0],v=f==null?void 0:f[1];return o?null:m.jsx(Ze.div,{"data-radix-popper-side":p,"data-radix-popper-align":v,...s,ref:d})},"PopperAnchor")),rf="PopperContent",[mb,O2]=Xd(rf),of=h.forwardRef(Cn(function(t,n){var le,Pe,je,Ee,$e,We,kt;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:l=0,sticky:f=Mc.Partial,hideWhenDetached:p=!1,updatePositionStrategy:v=jc.Optimized,onPlaced:g,...w}=t,b=ef(rf,r),[x,_]=h.useState(null),C=Te(n,_),[E,P]=h.useState(null),R=Yd(E),T=(R==null?void 0:R.width)??0,A=(R==null?void 0:R.height)??0,j=o+(i!=="center"?"-"+i:""),F=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},z=Array.isArray(d)?d:[d],Y=z.length>0,Z={padding:F,boundary:z.filter(sf),altBoundary:Y},{refs:K,floatingStyles:H,placement:J,isPositioned:ne,middlewareData:te}=Ip({strategy:"fixed",placement:j,whileElementsMounted:Cn((...lt)=>Fp(...lt,{animationFrame:v===jc.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[Ap({mainAxis:s+A,alignmentAxis:a}),u&&Np({mainAxis:!0,crossAxis:!1,...f===Mc.Partial?{limiter:zp()}:{},...Z}),u&&Dp({...Z}),Mp({...Z,apply:Cn(({elements:lt,rects:Le,availableWidth:qn,availableHeight:pt})=>{const{width:Rn,height:sn}=Le.reference,ze=lt.floating.style;ze.setProperty("--radix-popper-available-width",`${qn}px`),ze.setProperty("--radix-popper-available-height",`${pt}px`),ze.setProperty("--radix-popper-anchor-width",`${Rn}px`),ze.setProperty("--radix-popper-anchor-height",`${sn}px`)},"apply")}),E&&jp({element:E,padding:c}),gb({arrowWidth:T,arrowHeight:A}),p&&$p(Y?{strategy:"referenceHidden",...Z}:{strategy:"referenceHidden",padding:Z.padding,altBoundary:Z.altBoundary})]}),X=b.setPlacementState;ct(()=>(X(J),()=>{X(void 0)}),[J,X]);const[q,me]=ds(J),he=en(g);ct(()=>{ne&&(he==null||he())},[ne,he]);const ae=(le=te.arrow)==null?void 0:le.x,re=(Pe=te.arrow)==null?void 0:Pe.y,B=((je=te.arrow)==null?void 0:je.centerOffset)!==0,[se,ye]=h.useState();return ct(()=>{x&&ye(window.getComputedStyle(x).zIndex)},[x]),m.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ne?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Ee=te.transformOrigin)==null?void 0:Ee.x,($e=te.transformOrigin)==null?void 0:$e.y].join(" "),...((We=te.hide)==null?void 0:We.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(mb,{scope:r,placedSide:q,placedAlign:me,onArrowChange:P,arrowX:ae,arrowY:re,shouldHideArrow:B,children:m.jsx(Ze.div,{"data-side":q,"data-align":me,...w,ref:C,style:{...w.style,animation:ne?(kt=w.style)==null?void 0:kt.animation:"none"}})})})},"PopperContent"));function sf(e){return e!==null}Cn(sf,"isNotNull");var gb=Cn(e=>({name:"transformOrigin",options:e,fn(t){var w,b,x;const{placement:n,rects:r,middlewareData:o}=t,i=((w=o.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=ds(n),l={start:"0%",center:"50%",end:"100%"}[d],f=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+c/2;let v="",g="";return u==="bottom"?(v=i?l:`${f}px`,g=`${-c}px`):u==="top"?(v=i?l:`${f}px`,g=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,g=i?l:`${p}px`):u==="left"&&(v=`${r.floating.width+c}px`,g=i?l:`${p}px`),{data:{x:v,y:g}}}}),"transformOrigin");function ds(e){const[t,n="center"]=e.split("-");return[t,n]}Cn(ds,"getSideAndAlignFromPlacement");var vb=Object.defineProperty,yb=(e,t)=>vb(e,"name",{value:t,configurable:!0}),bb=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wb=h.forwardRef(yb(function(t,n){return m.jsx(Ze.span,{...t,ref:n,style:{...bb,...t.style}})},"VisuallyHidden")),_b=Object.defineProperty,Ye=(e,t)=>_b(e,"name",{value:t,configurable:!0}),[va,P2]=rn("Tooltip",[us]),ya=us(),xb="TooltipProvider",Sb=700,wi="tooltip.open",[Eb,ba]=va(xb),Cb=Ye(e=>{const{__scopeTooltip:t,delayDuration:n=Sb,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=h.useRef(!0),a=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.jsx(Eb,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:h.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),_i="Tooltip",[kb,co]=va(_i),Ob=Ye(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=ba(_i,e.__scopeTooltip),u=ya(t),[d,l]=h.useState(null),[f,p]=h.useState(void 0),v=En(),g=h.useRef(0),w=i??c.disableHoverableContent,b=a??c.delayDuration,x=h.useRef(!1),[_,C]=ao({prop:r,defaultProp:o??!1,onChange:Ye(j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(wi))):c.onClose(),s==null||s(j)},"onChange"),caller:_i}),E=h.useMemo(()=>_?x.current?"delayed-open":"instant-open":"closed",[_]),P=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,C(!0)},[C]),R=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),T=h.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,C(!0),g.current=0},b)},[b,C]);h.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const A=f??v;return m.jsx(tf,{...u,children:m.jsx(kb,{scope:t,contentId:A,setContentId:p,open:_,stateAttribute:E,trigger:d,onTriggerChange:l,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?T():P()},[c.isOpenDelayedRef,T,P]),onTriggerLeave:h.useCallback(()=>{w?R():(window.clearTimeout(g.current),g.current=0)},[R,w]),onOpen:P,onClose:R,disableHoverableContent:w,children:n})})},"Tooltip"),$c="TooltipTrigger",Pb=h.forwardRef(Ye(function(t,n){const{__scopeTooltip:r,"aria-describedby":o,...s}=t,i=co($c,r),a=ba($c,r),c=ya(r),u=h.useRef(null),d=Te(n,u,i.onTriggerChange),l=h.useRef(!1),f=h.useRef(!1),p=h.useCallback(()=>l.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),m.jsx(nf,{asChild:!0,...c,children:m.jsx(Ze.button,{"aria-describedby":i.open?gf(o,i.contentId):o,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:de(t.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:de(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:de(t.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:de(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:de(t.onBlur,i.onClose),onClick:de(t.onClick,i.onClose)})})},"TooltipTrigger")),af="TooltipPortal",[Rb,Tb]=va(af,{forceMount:void 0}),Ib=Ye(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=co(af,t);return m.jsx(Rb,{scope:t,forceMount:n,children:m.jsx(on,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Gr="TooltipContent",cf=h.forwardRef(Ye(function(t,n){const r=Tb(Gr,t.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=t,a=co(Gr,t.__scopeTooltip);return m.jsx(on,{present:o||a.open,children:a.disableHoverableContent?m.jsx(lf,{side:s,...i,ref:n}):m.jsx(Ab,{side:s,...i,ref:n})})},"TooltipContent")),Ab=h.forwardRef(Ye(function(t,n){const r=co(Gr,t.__scopeTooltip),o=ba(Gr,t.__scopeTooltip),s=h.useRef(null),i=Te(n,s),[a,c]=h.useState(null),{trigger:u,onClose:d}=r,l=s.current,{onPointerInTransitChange:f}=o,p=h.useCallback(()=>{c(null),f(!1)},[f]),v=h.useCallback((g,w)=>{const b=g.currentTarget,x={x:g.clientX,y:g.clientY},_=uf(x,b.getBoundingClientRect()),C=df(x,_),E=ff(w.getBoundingClientRect()),P=pf([...C,...E]);c(P),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(u&&l){const g=Ye(b=>v(b,l),"handleTriggerLeave"),w=Ye(b=>v(b,u),"handleContentLeave");return u.addEventListener("pointerleave",g),l.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",g),l.removeEventListener("pointerleave",w)}}},[u,l,v,p]),h.useEffect(()=>{if(a){const g=Ye(w=>{const b=w.target,x={x:w.clientX,y:w.clientY},_=(u==null?void 0:u.contains(b))||(l==null?void 0:l.contains(b)),C=!hf(x,a);_?p():C&&(p(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,l,a,d,p]),m.jsx(lf,{...t,ref:i})},"TooltipContentHoverable")),Nb=Vu("TooltipContent"),lf=h.forwardRef(Ye(function(t,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=t,d=co(Gr,r),l=ya(r),{onClose:f}=d,[p,v]=h.useState(null),g=Te(n,v);da(p),h.useEffect(()=>(document.addEventListener(wi,f),()=>document.removeEventListener(wi,f)),[f]),h.useEffect(()=>{if(d.trigger){const b=Ye(x=>{x.target instanceof Node&&x.target.contains(d.trigger)&&f()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[d.trigger,f]);const{setContentId:w}=d;return ct(()=>(w(i),()=>{w(void 0)}),[i,w]),m.jsx(aa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:b=>b.preventDefault(),onDismiss:f,children:m.jsxs(of,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...l,...u,ref:g,style:{...u.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:[m.jsx(Nb,{children:o}),s?m.jsx(wb,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function uf(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Ye(uf,"getExitSideFromRect");function df(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}Ye(df,"getPaddedExitPoints");function ff(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}Ye(ff,"getPointsFromRect");function hf(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}Ye(hf,"isPointInPolygon");function pf(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),mf(t)}Ye(pf,"getHull");function mf(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ye(mf,"getHullPresorted");function gf(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Ye(gf,"concatAriaDescribedby");const Db=Cb,Mb=Ob,jb=Pb,vf=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,sideOffset:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?4:s;let a;n[4]!==r?(a=ce("z-[50] overflow-hidden rounded-lg bg-foreground/85 px-[7px] py-1.5 text-[11px] text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==a?(c=m.jsx(Ib,{children:m.jsx(cf,{ref:t,sideOffset:i,"data-slot":"tooltip-content",className:a,...o})}),n[6]=o,n[7]=t,n[8]=i,n[9]=a,n[10]=c):c=n[10],c});vf.displayName=cf.displayName;const $b="sidebar_state",zb=3600*24*7,Fb="16rem",Lb="18rem",Vb="3rem",Ub="b",yf=h.createContext(null);function lo(){const e=h.useContext(yf);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const bf=h.forwardRef((e,t)=>{const n=ee.c(37);let r,o,s,i,a,c,u;n[0]!==e?({defaultOpen:u,open:s,onOpenChange:a,className:o,style:c,children:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c,n[7]=u):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6],u=n[7]);const d=u===void 0?!0:u,l=Jg(),[f,p]=h.useState(!1),[v,g]=h.useState(d),w=s??v;let b;n[8]!==w||n[9]!==a?(b=K=>{const H=typeof K=="function"?K(w):K;a?a(H):g(H),document.cookie=`${$b}=${H}; path=/; max-age=${zb}`},n[8]=w,n[9]=a,n[10]=b):b=n[10];const x=b;let _;n[11]!==l||n[12]!==x?(_=()=>l?p(ew):x(tw),n[11]=l,n[12]=x,n[13]=_):_=n[13];const C=_;let E,P;n[14]!==C?(E=()=>{const K=H=>{H.key===Ub&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),C())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},P=[C],n[14]=C,n[15]=E,n[16]=P):(E=n[15],P=n[16]),h.useEffect(E,P);const R=w?"expanded":"collapsed";let T;n[17]!==l||n[18]!==w||n[19]!==f||n[20]!==x||n[21]!==R||n[22]!==C?(T={state:R,open:w,setOpen:x,isMobile:l,openMobile:f,setOpenMobile:p,toggleSidebar:C},n[17]=l,n[18]=w,n[19]=f,n[20]=x,n[21]=R,n[22]=C,n[23]=T):T=n[23];const A=T;let j;n[24]!==c?(j={"--sidebar-width":Fb,"--sidebar-width-icon":Vb,...c},n[24]=c,n[25]=j):j=n[25];const F=j;let z;n[26]!==o?(z=ce("group/sidebar-wrapper flex h-svh w-full has-[[data-variant=inset]]:bg-sidebar",o),n[26]=o,n[27]=z):z=n[27];let Y;n[28]!==r||n[29]!==i||n[30]!==t||n[31]!==F||n[32]!==z?(Y=m.jsx(Db,{delayDuration:0,children:m.jsx("div",{style:F,className:z,ref:t,...i,children:r})}),n[28]=r,n[29]=i,n[30]=t,n[31]=F,n[32]=z,n[33]=Y):Y=n[33];let Z;return n[34]!==A||n[35]!==Y?(Z=m.jsx(yf.Provider,{value:A,children:Y}),n[34]=A,n[35]=Y,n[36]=Z):Z=n[36],Z});bf.displayName="SidebarProvider";const wf=h.forwardRef((e,t)=>{const n=ee.c(48);let r,o,s,i,a,c;n[0]!==e?({side:i,variant:a,collapsible:c,className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6]);const u=i===void 0?"left":i,d=a===void 0?"sidebar":a,l=c===void 0?"offcanvas":c,{isMobile:f,state:p,openMobile:v,setOpenMobile:g}=lo();if(l==="none"){let j;n[7]!==o?(j=ce("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),n[7]=o,n[8]=j):j=n[8];let F;return n[9]!==r||n[10]!==s||n[11]!==t||n[12]!==j?(F=m.jsx("div",{className:j,ref:t,...s,children:r}),n[9]=r,n[10]=s,n[11]=t,n[12]=j,n[13]=F):F=n[13],F}if(f){let j;n[14]===Symbol.for("react.memo_cache_sentinel")?(j={"--sidebar-width":Lb},n[14]=j):j=n[14];let F;n[15]===Symbol.for("react.memo_cache_sentinel")?(F=m.jsxs(Gd,{className:"sr-only",children:[m.jsx(qd,{children:"Sidebar"}),m.jsx(Qd,{children:"Displays the mobile sidebar."})]}),n[15]=F):F=n[15];let z;n[16]!==r?(z=m.jsx("div",{className:"flex h-full w-full flex-col",children:r}),n[16]=r,n[17]=z):z=n[17];let Y;n[18]!==u||n[19]!==z?(Y=m.jsxs(Kd,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:j,side:u,children:[F,z]}),n[18]=u,n[19]=z,n[20]=Y):Y=n[20];let Z;return n[21]!==v||n[22]!==s||n[23]!==g||n[24]!==Y?(Z=m.jsx(ab,{open:v,onOpenChange:g,...s,children:Y}),n[21]=v,n[22]=s,n[23]=g,n[24]=Y,n[25]=Z):Z=n[25],Z}const w=p==="collapsed"?l:"",b=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]";let x;n[26]!==b?(x=ce("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",b),n[26]=b,n[27]=x):x=n[27];let _;n[28]!==x?(_=m.jsx("div",{className:x}),n[28]=x,n[29]=_):_=n[29];const C=u==="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)]",E=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l";let P;n[30]!==o||n[31]!==C||n[32]!==E?(P=ce("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",C,E,o),n[30]=o,n[31]=C,n[32]=E,n[33]=P):P=n[33];let R;n[34]!==r?(R=m.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",children:r}),n[34]=r,n[35]=R):R=n[35];let T;n[36]!==s||n[37]!==P||n[38]!==R?(T=m.jsx("div",{className:P,...s,children:R}),n[36]=s,n[37]=P,n[38]=R,n[39]=T):T=n[39];let A;return n[40]!==t||n[41]!==u||n[42]!==p||n[43]!==T||n[44]!==w||n[45]!==_||n[46]!==d?(A=m.jsxs("div",{ref:t,className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":w,"data-variant":d,"data-side":u,children:[_,T]}),n[40]=t,n[41]=u,n[42]=p,n[43]=T,n[44]=w,n[45]=_,n[46]=d,n[47]=A):A=n[47],A});wf.displayName="Sidebar";const _f=h.forwardRef((e,t)=>{const n=ee.c(16);let r,o,s;n[0]!==e?({className:r,onClick:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const{toggleSidebar:i}=lo();let a;n[4]!==r?(a=ce("h-7 w-7",r),n[4]=r,n[5]=a):a=n[5];let c;n[6]!==o||n[7]!==i?(c=f=>{o==null||o(f),i()},n[6]=o,n[7]=i,n[8]=c):c=n[8];let u,d;n[9]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(cg,{}),d=m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),n[9]=u,n[10]=d):(u=n[9],d=n[10]);let l;return n[11]!==s||n[12]!==t||n[13]!==a||n[14]!==c?(l=m.jsxs(is,{ref:t,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:a,onClick:c,...s,children:[u,d]}),n[11]=s,n[12]=t,n[13]=a,n[14]=c,n[15]=l):l=n[15],l});_f.displayName="SidebarTrigger";const Zb=h.forwardRef((e,t)=>{const n=ee.c(10);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const{toggleSidebar:s}=lo();let i;n[3]!==r?(i=ce("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","[[data-side=left]_&]:cursor-w-resize [[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 group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",r),n[3]=r,n[4]=i):i=n[4];let a;return n[5]!==o||n[6]!==t||n[7]!==i||n[8]!==s?(a=m.jsx("button",{ref:t,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:i,...o}),n[5]=o,n[6]=t,n[7]=i,n[8]=s,n[9]=a):a=n[9],a});Zb.displayName="SidebarRail";const xf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("main",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});xf.displayName="SidebarInset";const Bb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Go,{ref:t,"data-sidebar":"input",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Bb.displayName="SidebarInput";const Sf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col gap-2 p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"header",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Sf.displayName="SidebarHeader";const Ef=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col gap-2 p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"footer",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Ef.displayName="SidebarFooter";const Hb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("mx-2 w-auto bg-sidebar-border",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(qo,{ref:t,"data-sidebar":"separator",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Hb.displayName="SidebarSeparator";const Cf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"content",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Cf.displayName="SidebarContent";const Mo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("relative flex w-full min-w-0 flex-col p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"group",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Mo.displayName="SidebarGroup";const xi=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,asChild:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const a=(s===void 0?!1:s)?xr:"div";let c;n[4]!==r?(c=ce("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",r),n[4]=r,n[5]=c):c=n[5];let u;return n[6]!==a||n[7]!==o||n[8]!==t||n[9]!==c?(u=m.jsx(a,{ref:t,"data-sidebar":"group-label",className:c,...o}),n[6]=a,n[7]=o,n[8]=t,n[9]=c,n[10]=u):u=n[10],u});xi.displayName="SidebarGroupLabel";const Wb=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,asChild:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const a=(s===void 0?!1:s)?xr:"button";let c;n[4]!==r?(c=ce("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none 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 after:md:hidden","group-data-[collapsible=icon]:hidden",r),n[4]=r,n[5]=c):c=n[5];let u;return n[6]!==a||n[7]!==o||n[8]!==t||n[9]!==c?(u=m.jsx(a,{ref:t,"data-sidebar":"group-action",className:c,...o}),n[6]=a,n[7]=o,n[8]=t,n[9]=c,n[10]=u):u=n[10],u});Wb.displayName="SidebarGroupAction";const jo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("w-full text-sm",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"group-content",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});jo.displayName="SidebarGroupContent";const $o=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex w-full min-w-0 flex-col gap-1",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("ul",{ref:t,"data-sidebar":"menu",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});$o.displayName="SidebarMenu";const zo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("group/menu-item relative",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("li",{ref:t,"data-sidebar":"menu-item",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});zo.displayName="SidebarMenuItem";const Kb=so("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none 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"}}),Fo=h.forwardRef((e,t)=>{const n=ee.c(29);let r,o,s,i,a,c,u;n[0]!==e?({asChild:s,isActive:i,variant:a,size:c,tooltip:u,className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c,n[7]=u):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6],u=n[7]);const d=s===void 0?!1:s,l=i===void 0?!1:i,f=a===void 0?"default":a,p=c===void 0?"default":c,v=d?xr:"button",{isMobile:g,state:w}=lo();let b;n[8]!==r||n[9]!==p||n[10]!==f?(b=ce(Kb({variant:f,size:p}),r),n[8]=r,n[9]=p,n[10]=f,n[11]=b):b=n[11];let x;n[12]!==v||n[13]!==l||n[14]!==o||n[15]!==t||n[16]!==p||n[17]!==b?(x=m.jsx(v,{ref:t,"data-sidebar":"menu-button","data-size":p,"data-active":l,className:b,...o}),n[12]=v,n[13]=l,n[14]=o,n[15]=t,n[16]=p,n[17]=b,n[18]=x):x=n[18];const _=x;if(!u)return _;if(typeof u=="string"){let T;n[19]!==u?(T={children:u},n[19]=u,n[20]=T):T=n[20],u=T}let C;n[21]!==_?(C=m.jsx(jb,{asChild:!0,children:_}),n[21]=_,n[22]=C):C=n[22];const E=w!=="collapsed"||g;let P;n[23]!==E||n[24]!==u?(P=m.jsx(vf,{side:"right",align:"center",hidden:E,...u}),n[23]=E,n[24]=u,n[25]=P):P=n[25];let R;return n[26]!==C||n[27]!==P?(R=m.jsxs(Mb,{children:[C,P]}),n[26]=C,n[27]=P,n[28]=R):R=n[28],R});Fo.displayName="SidebarMenuButton";const Gb=h.forwardRef((e,t)=>{const n=ee.c(13);let r,o,s,i;n[0]!==e?({className:r,asChild:s,showOnHover:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s===void 0?!1:s,c=i===void 0?!1:i,u=a?xr:"button",d=c&&"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";let l;n[5]!==r||n[6]!==d?(l=ce("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none 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 after:md: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",d,r),n[5]=r,n[6]=d,n[7]=l):l=n[7];let f;return n[8]!==u||n[9]!==o||n[10]!==t||n[11]!==l?(f=m.jsx(u,{ref:t,"data-sidebar":"menu-action",className:l,...o}),n[8]=u,n[9]=o,n[10]=t,n[11]=l,n[12]=f):f=n[12],f});Gb.displayName="SidebarMenuAction";const qb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","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",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"menu-badge",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});qb.displayName="SidebarMenuBadge";const Qb=h.forwardRef((e,t)=>{const n=ee.c(15);let r,o,s;n[0]!==e?({className:r,showIcon:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?!1:s,a=`${Math.floor(Math.random()*40)+50}%`;let c;n[4]!==r?(c=ce("flex h-8 items-center gap-2 rounded-md px-2",r),n[4]=r,n[5]=c):c=n[5];let u;n[6]!==i?(u=i&&m.jsx(Dc,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),n[6]=i,n[7]=u):u=n[7];let d;n[8]===Symbol.for("react.memo_cache_sentinel")?(d={"--skeleton-width":a},n[8]=d):d=n[8];let l;n[9]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(Dc,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:d}),n[9]=l):l=n[9];let f;return n[10]!==o||n[11]!==t||n[12]!==c||n[13]!==u?(f=m.jsxs("div",{ref:t,"data-sidebar":"menu-skeleton",className:c,...o,children:[u,l]}),n[10]=o,n[11]=t,n[12]=c,n[13]=u,n[14]=f):f=n[14],f});Qb.displayName="SidebarMenuSkeleton";const Yb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("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",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("ul",{ref:t,"data-sidebar":"menu-sub",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Yb.displayName="SidebarMenuSub";const Jb=h.forwardRef((e,t)=>{const n=ee.c(5);let r;n[0]!==e?({...r}=e,n[0]=e,n[1]=r):r=n[1];let o;return n[2]!==r||n[3]!==t?(o=m.jsx("li",{ref:t,...r}),n[2]=r,n[3]=t,n[4]=o):o=n[4],o});Jb.displayName="SidebarMenuSubItem";const Xb=h.forwardRef((e,t)=>{const n=ee.c(17);let r,o,s,i,a;n[0]!==e?({asChild:i,size:a,isActive:o,className:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5]);const c=i===void 0?!1:i,u=a===void 0?"md":a,d=c?xr:"a",l=u==="sm"&&"text-xs",f=u==="md"&&"text-sm";let p;n[6]!==r||n[7]!==l||n[8]!==f?(p=ce("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none 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",l,f,"group-data-[collapsible=icon]:hidden",r),n[6]=r,n[7]=l,n[8]=f,n[9]=p):p=n[9];let v;return n[10]!==d||n[11]!==o||n[12]!==s||n[13]!==t||n[14]!==u||n[15]!==p?(v=m.jsx(d,{ref:t,"data-sidebar":"menu-sub-button","data-size":u,"data-active":o,className:p,...s}),n[10]=d,n[11]=o,n[12]=s,n[13]=t,n[14]=u,n[15]=p,n[16]=v):v=n[16],v});Xb.displayName="SidebarMenuSubButton";function ew(e){return!e}function tw(e){return!e}var nw=Object.defineProperty,Qe=(e,t)=>nw(e,"name",{value:t,configurable:!0});function wa(e){const t=e+"CollectionProvider",[n,r]=rn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=Qe(g=>{const{scope:w,children:b}=g,x=h.useRef(null),_=h.useRef(new Map).current;return m.jsx(o,{scope:w,itemMap:_,collectionRef:x,children:b})},"CollectionProvider");i.displayName=t;const a=e+"CollectionSlot",c=Xt(a),u=h.forwardRef((g,w)=>{const{scope:b,children:x}=g,_=s(a,b),C=Te(w,_.collectionRef);return m.jsx(c,{ref:C,children:x})});u.displayName=a;const d=e+"CollectionItemSlot",l="data-radix-collection-item",f=Xt(d),p=h.forwardRef((g,w)=>{const{scope:b,children:x,..._}=g,C=h.useRef(null),E=Te(w,C),P=s(d,b);return h.useEffect(()=>(P.itemMap.set(C,{ref:C,..._}),()=>void P.itemMap.delete(C))),m.jsx(f,{[l]:"",ref:E,children:x})});p.displayName=d;function v(g){const w=s(e+"CollectionConsumer",g);return h.useCallback(()=>{const x=w.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${l}]`));return Array.from(w.itemMap.values()).sort((P,R)=>_.indexOf(P.ref.current)-_.indexOf(R.ref.current))},[w.collectionRef,w.itemMap])}return Qe(v,"useCollection"),[{Provider:i,Slot:u,ItemSlot:p},v,r]}Qe(wa,"createCollection");var zc=new WeakMap,Ue,xt,So=(xt=class extends Map{constructor(n){super(n);ie(this,Ue);G(this,Ue,[...super.keys()]),zc.set(this,!0)}set(n,r){return zc.get(this)&&!this.has(n)&&S(this,Ue).push(n),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=s?this.size:this.size+1,a=_a(n),c=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(s?S(this,Ue).indexOf(r)===c:c===this.size)return this.set(r,o),this;const u=S(this,Ue).filter(l=>l!==r);u.splice(c,0,r);const d=u.map(l=>[l,l===r?o:this.get(l)]);this.clear();for(const[l,f]of d)this.set(l,f);return this}with(n,r,o){const s=new xt(this);return s.insert(n,r,o),s}before(n){const r=S(this,Ue).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=S(this,Ue).indexOf(n);if(s===-1)return this;const i=S(this,Ue).indexOf(r),a=i!==-1&&i<s?s-1:s;return this.insert(a,r,o)}after(n){let r=S(this,Ue).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=S(this,Ue).indexOf(n);if(s===-1)return this;const i=S(this,Ue).indexOf(r),a=i!==-1&&i<=s?s:s+1;return this.insert(a,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return G(this,Ue,[]),super.clear()}delete(n){const r=super.delete(n);return r&&S(this,Ue).splice(S(this,Ue).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Lo(S(this,Ue),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Lo(S(this,Ue),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return S(this,Ue).indexOf(n)}keyAt(n){return Lo(S(this,Ue),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new xt(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new xt(o)}reduce(...n){const[r,o]=n,s=n.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=0,a=o;for(const c of this)i===0&&!s?a=c:a=Reflect.apply(r,this,[a,c,i,this]),i++;return a}reduceRight(...n){const[r,o]=n,s=n.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=o;for(let a=this.size-1;a>=0;a--){const c=this.entryAt(a);a===this.size-1&&!s?i=c:i=Reflect.apply(r,this,[i,c,a,this])}return i}sort(n){if(typeof n!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(n);this.clear();for(const[o,s]of r)this.set(o,s);return this}toSorted(n){if(typeof n!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(n);return new xt(r)}toReversed(){const n=new xt;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new xt(r)}slice(n,r){const o=new xt;for(const s of S(this,Ue).slice(n,r))o.set(s,this.get(s));return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},Ue=new WeakMap,Qe(xt,"OrderedDict"),xt);function Lo(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=kf(e,t);return n===-1?void 0:e[n]}Qe(Lo,"at");function kf(e,t){const n=e.length,r=_a(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Qe(kf,"toSafeIndex");function _a(e){return e!==e||e===0?0:Math.trunc(e)}Qe(_a,"toSafeInteger");function rw(e){const t=e+"CollectionProvider",[n,r]=rn(t),[o,s]=n(t);o.displayName=e+"CollectionStableContextProvider";const[i,a]=n(t);i.displayName=e+"CollectionStatefulContextProvider";const c=Qe(({state:P,...R})=>P?m.jsx(d,{...R,state:P}):m.jsx(u,{...R}),"CollectionProvider");c.displayName=t;const u=Qe(P=>{const R=x();return m.jsx(d,{...P,state:R})},"CollectionInit");u.displayName=e+"CollectionInit";const d=Qe(P=>{const{scope:R,children:T,state:A}=P,j=h.useRef(null),[F,z]=h.useState(null),Y=Te(j,z),[Z,K]=A,H=h.useRef(new So),J=h.useCallback(()=>{const ne=H.current;return Rf(ne)||ne.sort(Vo),ne},[]);return h.useEffect(()=>{if(!F)return;const ne=Tf(()=>{K(te=>{const X=te.toSorted(Vo);return X.some(([me],he)=>te.keyAt(he)!==me)?X:te})});return ne.observe(F,{childList:!0,subtree:!0}),()=>{ne.disconnect()}},[F,K]),m.jsx(o,{scope:R,collectionElementRef:Y,collectionElementRefObject:j,getCollection:J,setCollection:K,registryRef:H,children:m.jsx(i,{scope:R,collectionElement:F,collection:Z,children:T})})},"CollectionProviderImpl");d.displayName=e+"CollectionProviderImpl";const l=e+"CollectionSlot",f=Xt(l),p=h.forwardRef((P,R)=>{const{scope:T,children:A}=P,j=s(l,T),F=Te(R,j.collectionElementRef);return m.jsx(f,{ref:F,children:A})});p.displayName=l;const v=e+"CollectionItemSlot",g="data-radix-collection-item",w=Xt(v),b=h.forwardRef((P,R)=>{const{scope:T,children:A,...j}=P,F=h.useRef(null),z=s(v,T),{setCollection:Y,registryRef:Z}=z,K=h.useRef(j);Of(K.current,j)||(K.current=j);const H=K.current,J=h.useCallback(X=>{const q=Z.current;X?q.set(X,{...K.current,element:X}):F.current&&q.delete(F.current)},[Z]),ne=Te(R,J,F);ct(()=>{const X=F.current,q=Z.current;X&&q.has(X)&&q.set(X,{...H,element:X})},[H,Z]);const te=h.useRef(null);return h.useEffect(()=>{const X=F.current,q=te.current;((q==null?void 0:q.element)??null)===X&&(!X||(q==null?void 0:q.itemData)===H)||(te.current=X?{element:X,itemData:H}:null,Y(me=>{const he=new So(me);return q&&q.element!==X&&he.delete(q.element),X&&he.set(X,{...H,element:X}),he.sort(Vo)}))}),h.useEffect(()=>()=>{const X=te.current;te.current=null,X&&Y(q=>{if(!q.has(X.element))return q;const me=new So(q);return me.delete(X.element),me})},[Y]),m.jsx(w,{[g]:"",ref:ne,children:A})});b.displayName=v;function x(){return h.useState(new So)}Qe(x,"useInitCollection");function _(P){const{collection:R}=a(e+"CollectionConsumer",P);return R}Qe(_,"useCollection");function C(P){const{getCollection:R}=s(e+"CollectionConsumer",P);return R}return Qe(C,"useGetCollection"),[{Provider:c,Slot:p,ItemSlot:b},{createCollectionScope:r,useCollection:_,useGetCollection:C,useInitCollection:x}]}Qe(rw,"createCollection");function Of(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}Qe(Of,"shallowEqual");function Pf(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Qe(Pf,"isElementPreceding");function Rf(e){let t;for(const n of e.keys()){if(t){const r=t.compareDocumentPosition(n);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Qe(Rf,"isInDocumentOrder");function Vo(e,t){return!e[1].element||!t[1].element?0:Pf(e[1].element,t[1].element)?-1:1}Qe(Vo,"sortByDocumentPosition");function Tf(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Qe(Tf,"getChildListObserver");var ow=Object.defineProperty,sw=(e,t)=>ow(e,"name",{value:t,configurable:!0}),iw={LTR:"ltr"},aw=h.createContext(void 0);function xa(e){const t=h.useContext(aw);return e||t||iw.LTR}sw(xa,"useDirection");var cw=Object.defineProperty,Sa=(e,t)=>cw(e,"name",{value:t,configurable:!0}),$s=!1;function If(){const[e,t]=h.useState($s);return h.useEffect(()=>{$s||($s=!0,t(!0))},[]),e}Sa(If,"useIsHydrated");var Af=Bn[" useSyncExternalStore ".trim().toString()];function Nf(){return()=>{}}Sa(Nf,"subscribe");function Df(){return Af(Nf,()=>!0,()=>!1)}Sa(Df,"useIsHydratedModern");var lw=typeof Af=="function"?Df:If,uw=Object.defineProperty,Hn=(e,t)=>uw(e,"name",{value:t,configurable:!0}),zs="rovingFocusGroup.onEntryFocus",dw={bubbles:!1,cancelable:!0},fs="RovingFocusGroup",[Si,Mf,fw]=wa(fs),[hw,jf]=rn(fs,[fw]),Fc={Vertical:"vertical",Horizontal:"horizontal"},pw={RTL:"rtl"},[mw,gw]=hw(fs),vw=h.forwardRef(Hn(function(t,n){return m.jsx(Si.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Si.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(yw,{...t,ref:n})})})},"RovingFocusGroup")),yw=h.forwardRef(Hn(function(t,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:l=!1,...f}=t,p=h.useRef(null),v=Te(n,p),g=xa(i),[w,b]=ao({prop:a,defaultProp:c??null,onChange:u,caller:fs}),[x,_]=h.useState(!1),C=en(d),E=Mf(r),P=h.useRef(!1),[R,T]=h.useState(0);return h.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(zs,C),()=>A.removeEventListener(zs,C)},[C]),m.jsx(mw,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:w,onItemFocus:h.useCallback(A=>b(A),[b]),onItemShiftTab:h.useCallback(()=>_(!0),[]),onFocusableItemAdd:h.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:h.useCallback(()=>T(A=>A-1),[]),children:m.jsx(Ze.div,{tabIndex:x||R===0?-1:0,"data-orientation":o,...f,ref:v,style:{outline:"none",...t.style},onMouseDown:de(t.onMouseDown,()=>{P.current=!0}),onFocus:de(t.onFocus,A=>{const j=!P.current;if(A.target===A.currentTarget&&j&&!x){const F=new CustomEvent(zs,dw);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const z=E().filter(J=>J.focusable),Y=z.find(J=>J.active),Z=z.find(J=>J.id===w),H=[Y,Z,...z].filter(Boolean).map(J=>J.ref.current);Ea(H,l)}}P.current=!1}),onBlur:de(t.onBlur,()=>_(!1))})})},"RovingFocusGroupImpl")),bw="RovingFocusGroupItem",ww=h.forwardRef(Hn(function(t,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=t,u=En(),d=i||u,l=gw(bw,r),f=l.currentTabStopId===d,p=Mf(r),{onFocusableItemAdd:v,onFocusableItemRemove:g,currentTabStopId:w}=l,b=lw();return ct(()=>{if(!(!b||!o))return v(),()=>g()},[b,o,v,g]),h.useEffect(()=>{if(!(b||!o))return v(),()=>g()},[b,o,v,g]),m.jsx(Si.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:m.jsx(Ze.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...c,ref:n,onMouseDown:de(t.onMouseDown,x=>{o?l.onItemFocus(d):x.preventDefault()}),onFocus:de(t.onFocus,()=>l.onItemFocus(d)),onKeyDown:de(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){l.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const _=zf(x,l.orientation,l.dir);if(_!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let E=p().filter(P=>P.focusable).map(P=>P.ref.current);if(_==="last")E.reverse();else if(_==="prev"||_==="next"){_==="prev"&&E.reverse();const P=E.indexOf(x.currentTarget);E=l.loop?Ff(E,P+1):E.slice(P+1)}setTimeout(()=>Ea(E))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:w!=null}):a})})},"RovingFocusGroupItem")),_w={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $f(e,t){return t!==pw.RTL?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Hn($f,"getDirectionAwareKey");function zf(e,t,n){const r=$f(e.key,n);if(!(t===Fc.Vertical&&["ArrowLeft","ArrowRight"].includes(r))&&!(t===Fc.Horizontal&&["ArrowUp","ArrowDown"].includes(r)))return _w[r]}Hn(zf,"getFocusIntent");function Ea(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Hn(Ea,"focusFirst");function Ff(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Hn(Ff,"wrapArray");var xw=Object.defineProperty,xe=(e,t)=>xw(e,"name",{value:t,configurable:!0}),Sw={RTL:"rtl"},Ei=["Enter"," "],Ew=["ArrowDown","PageUp","Home"],Lf=["ArrowUp","PageDown","End"],Cw=[...Ew,...Lf],kw={ltr:[...Ei,"ArrowRight"],rtl:[...Ei,"ArrowLeft"]},Ow={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hs="Menu",[qr,Pw,Rw]=wa(hs),[Wn,Vf]=rn(hs,[Rw,us,jf]),Ca=us(),Uf=jf(),[Tw,Kn]=Wn(hs),[Iw,uo]=Wn(hs),Aw=xe(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Ca(t),[c,u]=h.useState(null),d=h.useRef(!1),l=en(s),f=xa(o);return h.useEffect(()=>{const p=xe(()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},"handleKeyDown"),v=xe(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),h.useEffect(()=>{if(!n)return;const p=xe(()=>l(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,l]),m.jsx(tf,{...a,children:m.jsx(Tw,{scope:t,open:n,onOpenChange:l,content:c,onContentChange:u,children:m.jsx(Iw,{scope:t,onClose:h.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:f,modal:i,children:r})})})},"Menu"),Zf=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t,s=Ca(r);return m.jsx(nf,{...s,...o,ref:n})},"MenuAnchor")),Bf="MenuPortal",[Nw,Hf]=Wn(Bf,{forceMount:void 0}),Dw=xe(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Kn(Bf,t);return m.jsx(Nw,{scope:t,forceMount:n,children:m.jsx(on,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Mt="MenuContent",[Mw,ka]=Wn(Mt),jw=h.forwardRef(xe(function(t,n){const r=Hf(Mt,t.__scopeMenu),{forceMount:o=r.forceMount,...s}=t,i=Kn(Mt,t.__scopeMenu),a=uo(Mt,t.__scopeMenu);return m.jsx(qr.Provider,{scope:t.__scopeMenu,children:m.jsx(on,{present:o||i.open,children:m.jsx(qr.Slot,{scope:t.__scopeMenu,children:a.modal?m.jsx($w,{...s,ref:n}):m.jsx(zw,{...s,ref:n})})})})},"MenuContent")),$w=h.forwardRef(xe(function(t,n){const r=Kn(Mt,t.__scopeMenu),o=h.useRef(null),s=Te(n,o);return h.useEffect(()=>{const i=o.current;if(i)return jd(i)},[]),m.jsx(Oa,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:de(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),zw=h.forwardRef(xe(function(t,n){const r=Kn(Mt,t.__scopeMenu);return m.jsx(Oa,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Fw=Xt("MenuContent.ScrollLock"),Oa=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:v,disableOutsideScroll:g,...w}=t,b=Kn(Mt,r),x=uo(Mt,r),_=Ca(r),C=Uf(r),E=Pw(r),[P,R]=h.useState(null),T=h.useRef(null),[A,j]=h.useState(null);da(A);const{nodes:F,registry:z}=ua(),Y=!!(s||g),Z=Te(n,T,b.onContentChange,j),K=h.useRef(0),H=h.useRef(""),J=h.useRef(0),ne=h.useRef(null),te=h.useRef("right"),X=h.useRef(0),q=h.useMemo(()=>g?[T,...F.map(B=>({current:B}))]:[],[T,F,g]),me=g?ma:h.Fragment,he=g?{as:Fw,allowPinchZoom:!0,shards:q}:void 0,ae=xe(B=>{var kt,lt;const se=H.current+B,ye=E().filter(Le=>!Le.disabled),le=document.activeElement,Pe=(kt=ye.find(Le=>Le.ref.current===le))==null?void 0:kt.textValue,je=ye.map(Le=>Le.textValue),Ee=Jf(je,se,Pe),$e=(lt=ye.find(Le=>Le.textValue===Ee))==null?void 0:lt.ref.current;function We(Le){H.current=Le,window.clearTimeout(K.current),Le!==""&&(K.current=window.setTimeout(()=>We(""),1e3))}xe(We,"updateSearch"),We(se),$e&&setTimeout(()=>$e.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(K.current),[]),as();const re=h.useCallback(B=>{var ye,le;return te.current===((ye=ne.current)==null?void 0:ye.side)&&eh(B,(le=ne.current)==null?void 0:le.area)},[]);return m.jsx(Mw,{scope:r,searchRef:H,onItemEnter:h.useCallback(B=>{re(B)&&B.preventDefault()},[re]),onItemLeave:h.useCallback(B=>{var se;re(B)||((se=T.current)==null||se.focus(),R(null))},[re]),onTriggerLeave:h.useCallback(B=>{re(B)&&B.preventDefault()},[re]),pointerGraceTimerRef:J,onPointerGraceIntentChange:h.useCallback(B=>{ne.current=B},[]),children:m.jsx(la,{registry:Y?z:null,children:m.jsx(me,{...he,children:m.jsx(gd,{asChild:!0,trapped:s,branches:F,onMountAutoFocus:de(i,B=>{var se;B.preventDefault(),(se=T.current)==null||se.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:m.jsx(aa,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:v,children:m.jsx(vw,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:P,onCurrentTabStopIdChange:R,onEntryFocus:de(u,B=>{x.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(of,{role:"menu","aria-orientation":"vertical","data-state":Ra(b.open),"data-radix-menu-content":"",dir:x.dir,..._,...w,ref:Z,style:{outline:"none",...w.style},onKeyDown:de(w.onKeyDown,B=>{const ye=B.target.closest("[data-radix-menu-content]")===B.currentTarget,le=B.ctrlKey||B.altKey||B.metaKey,Pe=B.key.length===1;ye&&(B.key==="Tab"&&B.preventDefault(),!le&&Pe&&ae(B.key));const je=T.current;if(B.target!==je||!Cw.includes(B.key))return;B.preventDefault();const $e=E().filter(We=>!We.disabled).map(We=>We.ref.current);Lf.includes(B.key)&&$e.reverse(),Qf($e)}),onBlur:de(t.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(K.current),H.current="")}),onPointerMove:de(t.onPointerMove,yr(B=>{const se=B.target,ye=X.current!==B.clientX;if(B.currentTarget.contains(se)&&ye){const le=B.clientX>X.current?"right":"left";te.current=le,X.current=B.clientX}}))})})})})})})})},"MenuContentImpl")),Lw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Ze.div,{...o,ref:n})},"MenuLabel")),Ci="MenuItem",Lc="menu.itemSelect",Pa=h.forwardRef(xe(function(t,n){const{disabled:r=!1,onSelect:o,...s}=t,i=h.useRef(null),a=uo(Ci,t.__scopeMenu),c=ka(Ci,t.__scopeMenu),u=Te(n,i),d=h.useRef(!1),l=xe(()=>{const f=i.current;if(!r&&f){const p=new CustomEvent(Lc,{bubbles:!0,cancelable:!0});f.addEventListener(Lc,v=>o==null?void 0:o(v),{once:!0}),sa(f,p),p.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return m.jsx(Wf,{...s,ref:u,disabled:r,onClick:de(t.onClick,l),onPointerDown:f=>{var p;(p=t.onPointerDown)==null||p.call(t,f),d.current=!0},onPointerUp:de(t.onPointerUp,f=>{var p;d.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:de(t.onKeyDown,f=>{r||f.target!==f.currentTarget||c.searchRef.current!==""&&f.key===" "||Ei.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})},"MenuItem")),Wf=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=t,a=ka(Ci,r),c=Uf(r),u=h.useRef(null),d=Te(n,u),[l,f]=h.useState(!1),[p,v]=h.useState("");return h.useEffect(()=>{const g=u.current;g&&v((g.textContent??"").trim())},[i.children]),m.jsx(qr.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:m.jsx(ww,{asChild:!0,...c,focusable:!o,children:m.jsx(Ze.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:de(t.onPointerMove,yr(g=>{o?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:de(t.onPointerLeave,yr(g=>a.onItemLeave(g))),onFocus:de(t.onFocus,()=>f(!0)),onBlur:de(t.onBlur,()=>f(!1))})})})},"MenuItemImpl")),Vw=h.forwardRef(xe(function(t,n){const{checked:r=!1,onCheckedChange:o,...s}=t;return m.jsx(Gf,{scope:t.__scopeMenu,checked:r,children:m.jsx(Pa,{role:"menuitemcheckbox","aria-checked":Qr(r)?"mixed":r,...s,ref:n,"data-state":ps(r),onSelect:de(s.onSelect,()=>o==null?void 0:o(Qr(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Uw="MenuRadioGroup",[R2,Zw]=Wn(Uw,{value:void 0,onValueChange:xe(()=>{},"onValueChange")}),Bw="MenuRadioItem",Hw=h.forwardRef(xe(function(t,n){const{value:r,...o}=t,s=Zw(Bw,t.__scopeMenu),i=r===s.value;return m.jsx(Gf,{scope:t.__scopeMenu,checked:i,children:m.jsx(Pa,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":ps(i),onSelect:de(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Kf="MenuItemIndicator",[Gf,Ww]=Wn(Kf,{checked:!1}),Kw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,forceMount:o,...s}=t,i=Ww(Kf,r);return m.jsx(on,{present:o||Qr(i.checked)||i.checked===!0,children:m.jsx(Ze.span,{...s,ref:n,"data-state":ps(i.checked)})})},"MenuItemIndicator")),Gw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),qw="MenuSub",[T2,qf]=Wn(qw),Eo="MenuSubTrigger",Qw=h.forwardRef(xe(function(t,n){const r=Kn(Eo,t.__scopeMenu),o=uo(Eo,t.__scopeMenu),s=qf(Eo,t.__scopeMenu),i=ka(Eo,t.__scopeMenu),a=h.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:t.__scopeMenu},l=h.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);h.useEffect(()=>l,[l]),h.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]);const f=Te(n,s.onTriggerChange);return m.jsx(Zf,{asChild:!0,...d,children:m.jsx(Wf,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":Ra(r.open),...t,ref:f,onClick:p=>{var v;(v=t.onClick)==null||v.call(t,p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:de(t.onPointerMove,yr(p=>{i.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),l()},100))})),onPointerLeave:de(t.onPointerLeave,yr(p=>{var g,w;l();const v=(g=r.content)==null?void 0:g.getBoundingClientRect();if(v){const b=(w=r.content)==null?void 0:w.dataset.side,x=b==="right",_=x?-5:5,C=v[x?"left":"right"],E=v[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+_,y:p.clientY},{x:C,y:v.top},{x:E,y:v.top},{x:E,y:v.bottom},{x:C,y:v.bottom}],side:b}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:de(t.onKeyDown,p=>{var g;t.disabled||p.target!==p.currentTarget||i.searchRef.current!==""&&p.key===" "||kw[o.dir].includes(p.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),p.preventDefault())})})})},"MenuSubTrigger")),Yw="MenuSubContent",Jw=h.forwardRef(xe(function(t,n){const r=Hf(Mt,t.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=t,a=Kn(Mt,t.__scopeMenu),c=uo(Mt,t.__scopeMenu),u=qf(Yw,t.__scopeMenu),d=h.useRef(null),l=Te(n,d);return m.jsx(qr.Provider,{scope:t.__scopeMenu,children:m.jsx(on,{present:o||a.open,children:m.jsx(qr.Slot,{scope:t.__scopeMenu,children:m.jsx(Oa,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:l,align:s,side:c.dir===Sw.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;c.isUsingKeyboardRef.current&&((p=d.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:de(t.onFocusOutside,f=>{f.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:de(t.onEscapeKeyDown,f=>{c.onClose(),f.preventDefault()}),onKeyDown:de(t.onKeyDown,f=>{var g;const p=f.currentTarget.contains(f.target),v=Ow[c.dir].includes(f.key);p&&v&&(a.onOpenChange(!1),(g=u.trigger)==null||g.focus(),f.preventDefault())})})})})})},"MenuSubContent"));function Ra(e){return e?"open":"closed"}xe(Ra,"getOpenState");function Qr(e){return e==="indeterminate"}xe(Qr,"isIndeterminate");function ps(e){return Qr(e)?"indeterminate":e?"checked":"unchecked"}xe(ps,"getCheckedState");function Qf(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}xe(Qf,"focusFirst");function Yf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}xe(Yf,"wrapArray");function Jf(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Yf(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}xe(Jf,"getNextMatch");function Xf(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}xe(Xf,"isPointInPolygon");function eh(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Xf(n,t)}xe(eh,"isPointerInGraceArea");function yr(e){return t=>t.pointerType==="mouse"?e(t):void 0}xe(yr,"whenMouse");var Xw=Object.defineProperty,Tt=(e,t)=>Xw(e,"name",{value:t,configurable:!0}),Ta="DropdownMenu",[e0,I2]=rn(Ta,[Vf]),It=Vf(),[t0,th]=e0(Ta),n0=Tt(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=It(t),u=h.useRef(null),[d,l]=ao({prop:o,defaultProp:s??!1,onChange:i,caller:Ta});return m.jsx(t0,{scope:t,triggerId:En(),triggerRef:u,contentId:En(),open:d,onOpenChange:l,onOpenToggle:h.useCallback(()=>l(f=>!f),[l]),modal:a,children:m.jsx(Aw,{...c,open:d,onOpenChange:l,dir:r,modal:a,children:n})})},"DropdownMenu"),r0="DropdownMenuTrigger",o0=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=t,i=th(r0,r),a=It(r),c=Te(n,i.triggerRef);return m.jsx(Zf,{asChild:!0,...a,children:m.jsx(Ze.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:de(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:de(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),s0=Tt(e=>{const{__scopeDropdownMenu:t,...n}=e,r=It(t);return m.jsx(Dw,{...r,...n})},"DropdownMenuPortal"),i0="DropdownMenuContent",nh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=th(i0,r),i=It(r),a=h.useRef(!1);return m.jsx(jw,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:de(t.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:de(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,l=u.button===2||d;(!s.modal||l)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),rh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Lw,{...s,...o,ref:n})},"DropdownMenuLabel")),oh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Pa,{...s,...o,ref:n})},"DropdownMenuItem")),sh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Vw,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),ih=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Hw,{...s,...o,ref:n})},"DropdownMenuRadioItem")),ah=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Kw,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),ch=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Gw,{...s,...o,ref:n})},"DropdownMenuSeparator")),lh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Qw,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),uh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Jw,{...s,...o,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent"));const a0=n0,c0=o0,l0=h.forwardRef((e,t)=>{const n=ee.c(14);let r,o,s,i;n[0]!==e?({className:o,inset:s,children:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s&&"pl-8";let c;n[5]!==o||n[6]!==a?(c=ce("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a,o),n[5]=o,n[6]=a,n[7]=c):c=n[7];let u;n[8]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Ym,{className:"ml-auto"}),n[8]=u):u=n[8];let d;return n[9]!==r||n[10]!==i||n[11]!==t||n[12]!==c?(d=m.jsxs(lh,{ref:t,className:c,...i,children:[r,u]}),n[9]=r,n[10]=i,n[11]=t,n[12]=c,n[13]=d):d=n[13],d});l0.displayName=lh.displayName;const u0=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(uh,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});u0.displayName=uh.displayName;const dh=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,sideOffset:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?4:s;let a;n[4]!==r?(a=ce("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==a?(c=m.jsx(s0,{children:m.jsx(nh,{ref:t,sideOffset:i,className:a,...o})}),n[6]=o,n[7]=t,n[8]=i,n[9]=a,n[10]=c):c=n[10],c});dh.displayName=nh.displayName;const ki=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,inset:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=o&&"pl-8";let a;n[4]!==r||n[5]!==i?(a=ce("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",i,r),n[4]=r,n[5]=i,n[6]=a):a=n[6];let c;return n[7]!==s||n[8]!==t||n[9]!==a?(c=m.jsx(oh,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});ki.displayName=oh.displayName;const d0=h.forwardRef((e,t)=>{const n=ee.c(14);let r,o,s,i;n[0]!==e?({className:s,children:o,checked:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);let a;n[5]!==s?(a=ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),n[5]=s,n[6]=a):a=n[6];let c;n[7]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(ah,{children:m.jsx(Qm,{className:"h-4 w-4"})})}),n[7]=c):c=n[7];let u;return n[8]!==r||n[9]!==o||n[10]!==i||n[11]!==t||n[12]!==a?(u=m.jsxs(sh,{ref:t,className:a,checked:r,...i,children:[c,o]}),n[8]=r,n[9]=o,n[10]=i,n[11]=t,n[12]=a,n[13]=u):u=n[13],u});d0.displayName=sh.displayName;const f0=h.forwardRef((e,t)=>{const n=ee.c(12);let r,o,s;n[0]!==e?({className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==o?(i=ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o),n[4]=o,n[5]=i):i=n[5];let a;n[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(ah,{children:m.jsx(Xm,{className:"h-2 w-2 fill-current"})})}),n[6]=a):a=n[6];let c;return n[7]!==r||n[8]!==s||n[9]!==t||n[10]!==i?(c=m.jsxs(ih,{ref:t,className:i,...s,children:[a,r]}),n[7]=r,n[8]=s,n[9]=t,n[10]=i,n[11]=c):c=n[11],c});f0.displayName=ih.displayName;const h0=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,inset:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=o&&"pl-8";let a;n[4]!==r||n[5]!==i?(a=ce("px-2 py-1.5 text-sm font-semibold",i,r),n[4]=r,n[5]=i,n[6]=a):a=n[6];let c;return n[7]!==s||n[8]!==t||n[9]!==a?(c=m.jsx(rh,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});h0.displayName=rh.displayName;const fh=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("-mx-1 my-1 h-px bg-muted",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(ch,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});fh.displayName=ch.displayName;const p0=1,m0=1,g0=2,Vc=9;function v0(e,t){const n=new DataView(e),r=[];let o=0;for(;o+Vc<=e.byteLength;){const s=n.getUint8(o),i=n.getUint32(o+1),a=n.getUint32(o+5),c=o+Vc;if(c+a>e.byteLength)break;if(s===m0)r.push({kind:"frame",ms:i,chunk:t,data:e.slice(c,c+a)});else if(s===g0)try{r.push({kind:"event",ms:i,chunk:t,event:JSON.parse(new TextDecoder().decode(new Uint8Array(e,c,a)))})}catch{}o=c+a}return r}function A2(e,t){const n=[...e.chunks].sort((f,p)=>f.seq-p.seq),r=[],o=[];n.forEach((f,p)=>{o.push(r.length),f.offset+f.length<=t.byteLength&&r.push(...v0(t.slice(f.offset,f.offset+f.length),p))});const s=r.length>0?r[r.length-1].ms:0,i=[],a=new Set(e.gaps);n.forEach((f,p)=>{const v=n[p+1];if(v&&v.seq!==f.seq+1){const g=r[(o[p+1]??r.length)-1];i.push({fromMs:(g==null?void 0:g.ms)??f.startMs,toMs:v.startMs})}}),n.length>0&&[...a].some(f=>f<n[0].seq)&&i.unshift({fromMs:0,toMs:n[0].startMs});const c=n.length>0?n[n.length-1].seq:-1;[...a].some(f=>f>c)&&i.push({fromMs:s,toMs:s});const d=r.flatMap(f=>f.kind==="event"&&f.event.type==="step"&&f.event.phase==="start"?[{index:f.event.index,name:f.event.name,ms:f.ms}]:[]),l=new Map(r.flatMap(f=>f.kind==="event"&&f.event.type==="step"&&f.event.phase==="end"?[[f.event.index,f.event.status]]:[]));return{meta:e.meta,records:r,chunkStarts:o,chunks:n,durationMs:s,gaps:i,steps:d.map(f=>{const p=l.get(f.index);return p?{...f,status:p}:f})}}function N2(e,t){const n=e.chunks;let r=-1;n.forEach((o,s)=>{o.startMs<=t&&(r=s)});for(let o=r;o>=0;o--){if(n[o].keyframe)return o;if(o>0&&n[o].seq!==n[o-1].seq+1)break}return n.findIndex((o,s)=>s>r&&o.keyframe)}function D2(e,t){let n;for(const r of e.records)if(!(r.kind!=="event"||r.event.type!=="chrome")){if(r.ms>t&&n!==void 0)break;n=r.event.payload}return n??null}function M2(e,t){const n=Math.max(150,e.durationMs*.02);let r=null;for(const o of e.steps){const s=Math.abs(o.ms-t);s<=n&&(!r||s<r.d)&&(r={ms:o.ms,d:s})}return r?r.ms:t}function j2(e){const t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function $2(e){return e.notRecorded==="jpeg"?"No video: this device streamed JPEG, which is not kept. The agent sends H.264 unless TAPFLOW_IOS_CODEC=jpeg is set.":e.notRecorded==="no-keyframe"?"No video: the device's stream gave no frame a video could start from.":e.notRecorded?"No video for this flow.":e.evicted?"Video no longer kept: removed by the retention policy, or to make room when video storage was full.":null}function z2(e){switch(e){case"size-limit":return"The video stops early: it reached the 100 MB limit for one flow.";case"storage-full":return"The video stops early: the relay's storage for videos was full.";case"cancelled":return"The run was cancelled here.";case"runner-lost":return"The video stops where the runner disconnected.";case"truncated":return"The end of this video did not reach the relay.";default:return null}}const Oi="";async function Co(e,t,n,r){const o=await fetch(`${Oi}${t}`,{method:e,credentials:"include",headers:{"Content-Type":"application/json",...r},body:n!=null?JSON.stringify(n):void 0});if(o.status===204)return{data:null,status:204};const s=await o.json().catch(()=>null);return o.ok?{data:s,status:o.status}:{data:null,status:o.status,error:(s==null?void 0:s.error)??"Request failed"}}const hh={get:e=>Co("GET",e),post:(e,t)=>Co("POST",e,t),patch:(e,t)=>Co("PATCH",e,t),delete:e=>Co("DELETE",e),upload:async(e,t)=>{const n=await fetch(`${Oi}${e}`,{method:"POST",credentials:"include",body:t});if(n.status===204)return{data:null,status:204};const r=await n.json().catch(()=>null);return n.ok?{data:r,status:n.status}:{data:null,status:n.status,error:(r==null?void 0:r.error)??"Upload failed"}},uploadPatch:async(e,t)=>{const n=await fetch(`${Oi}${e}`,{method:"PATCH",credentials:"include",body:t});if(n.status===204)return{data:null,status:204};const r=await n.json().catch(()=>null);return n.ok?{data:r,status:n.status}:{data:null,status:n.status,error:(r==null?void 0:r.error)??"Upload failed"}}},Qo={authStatus:["auth","status"],me:["auth","me"],inviteToken:e=>["invitations","verify",e],resetToken:e=>["auth","reset-password",e],apps:["apps"],settings:["settings"],tokens:["tokens"],teamMembers:["team","members"],comments:e=>["comments",e],allRecordings:["recordings"],recordings:e=>["recordings",e],agents:["agents"],resourceHistory:(e,t)=>["agents",e,"resources",t],runs:e=>["runs","list",e],run:e=>["runs","detail",e],runVideo:(e,t)=>["runs","video",e,t],anyRun:["runs","any"]};async function y0(){const e=await fetch("/api/v1/auth/status");if(!e.ok)throw new Error(`GET /api/v1/auth/status failed with ${e.status}`);return e.json()}async function b0(){const{data:e,status:t}=await hh.get("/api/v1/auth/me");if(t===401)return null;if(!e)throw new Error(`GET /api/v1/auth/me failed with ${t}`);return e}async function F2(e){const t=await fetch(`/api/v1/invitations/verify?token=${e}`);if(!t.ok)throw new Error(`invitation refused with ${t.status}`);return t.json()}async function Cr(e){const t=await fetch(e,{credentials:"include"});if(!t.ok)throw new Error(`GET ${e} failed with ${t.status}`);return t.json()}const w0=()=>Cr("/api/v1/settings"),L2=()=>Cr("/api/v1/tokens"),V2=()=>Cr("/api/v1/team/members"),U2=e=>Cr(`/api/v1/comments?build_id=${e}`),Z2=e=>Cr(`/api/v1/recordings?buildId=${e}`),B2=()=>Cr("/api/v1/agents");async function H2(e,t,n){const r=await fetch(`/api/v1/agents/${encodeURIComponent(e)}/resources?range=${t}`,{credentials:"include",signal:n});if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}async function W2(e){const t=await fetch(`/api/v1/auth/reset-password/verify?token=${e}`);if(!t.ok)throw new Error(`reset token refused with ${t.status}`);return!0}async function K2(){const e=await fetch("/api/v1/apps",{credentials:"include"});if(!e.ok)throw new Error(`GET /api/v1/apps failed with ${e.status}`);return(await e.json()).items}async function G2({appId:e,search:t,statusFilter:n}){const r=new URLSearchParams({app_id:String(e),limit:"100",sort:"uploaded_at",dir:"desc"});t&&r.set("q",t),n&&n!=="all"&&r.set("status",n);const o=await fetch(`/api/v1/builds?${r}`,{credentials:"include"});if(!o.ok)throw new Error(`GET /api/v1/builds failed with ${o.status}`);return(await o.json()).items}async function q2(e){const t=await fetch("/api/v1/apps",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return t.status===409?{error:"App with this bundle ID already exists"}:t.ok?t.json():null}class _0 extends Error{}async function Ia(e){if(e.status!==403)return;const t=await e.json().catch(()=>null);throw new _0((t==null?void 0:t.error)??"You do not have permission to do this")}async function Q2(e,t){const n=await fetch(`/api/v1/builds/${e}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status_label:t})});if(await Ia(n),!n.ok)throw new Error(`PATCH /api/v1/builds/${e} failed with ${n.status}`)}async function Y2(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"POST",credentials:"include"});if(await Ia(t),!t.ok)throw new Error(`Failed to schedule deletion (${t.status})`);return(await t.json()).delete_after}async function J2(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"DELETE",credentials:"include"});if(await Ia(t),!t.ok)throw new Error(`Failed to cancel scheduled deletion (${t.status})`)}async function X2(e){const t=await fetch(`/api/v1/builds/${e}`,{credentials:"include"});return t.ok?t.json():null}function ek(e){const t=new Map;for(const n of e){const r=n.version_name??"Unversioned";t.has(r)||t.set(r,[]),t.get(r).push(n)}return Array.from(t.entries()).map(([n,r])=>({versionName:n,builds:r}))}const x0=1e4;function Aa(e){const t=new AbortController,n=setTimeout(()=>t.abort(new DOMException("timed out","TimeoutError")),x0);return t.signal.addEventListener("abort",()=>clearTimeout(n),{once:!0}),e&&(e.aborted?t.abort(e.reason):e.addEventListener("abort",()=>t.abort(e.reason),{once:!0})),t.signal}const S0=25;async function E0(e){const t=await fetch("/api/v1/runs?limit=1",{credentials:"include",signal:Aa(e)});if(!t.ok)throw new Error(`GET /api/v1/runs failed with ${t.status}`);return(await t.json()).items.length>0}async function tk(e,t,n){const r=new URLSearchParams;e.ci!==void 0&&r.set("ci",e.ci?"1":"0"),e.status&&r.set("status",e.status),e.flow&&r.set("flow",e.flow),e.build!==void 0&&r.set("build",String(e.build)),t.before&&r.set("before",t.before),t.after&&r.set("after",t.after),r.set("limit",String(S0));const o=`/api/v1/runs${r.size?`?${r}`:""}`,s=await fetch(o,{credentials:"include",signal:Aa(n)});if(!s.ok)throw new Error(`GET /api/v1/runs failed with ${s.status}`);return s.json()}async function nk(e,t){const n=await fetch(`/api/v1/runs/${encodeURIComponent(e)}`,{credentials:"include",signal:Aa(t)});if(n.status===404)return null;if(!n.ok)throw new Error(`GET /api/v1/runs/${e} failed with ${n.status}`);return n.json()}async function rk(e,t,n){const r=await fetch(C0(e,t),{credentials:"include",signal:n});if(r.status===404||r.status===410)return{kind:"gone"};if(!r.ok)throw new Error(`video index ${r.status}`);const o=await r.json();if(o.evicted)return{kind:"gone"};if(o.meta.formatVersion!==p0)return{kind:"unsupported"};const s=await fetch(k0(e,t),{credentials:"include",signal:n});if(s.status===404||s.status===410)return{kind:"gone"};if(!s.ok)throw new Error(`video ${s.status}`);return{kind:"ready",index:o,file:await s.arrayBuffer()}}function C0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video/index`}function k0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video`}function ok(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/screenshot`}function ph(){const e=ee.c(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:Qo.me,queryFn:b0},e[0]=t):t=e[0];const n=Wo(t),r=n.data??null,o=n.data===void 0;let s;return e[1]!==r||e[2]!==o?(s={user:r,loading:o},e[1]=r,e[2]=o,e[3]=s):s=e[3],s}const O0={"/settings/team":["Admin"],"/settings/tokens":["Admin","Developer","QA"]};function mh(e,t){const n=Object.entries(O0).find(([r])=>e.startsWith(r));return!n||t!==void 0&&n[1].includes(t)}const P0=6;function R0(e){let t=0;for(const n of e)t=t*31+n.charCodeAt(0)&4294967295;return Math.abs(t)}function T0(e){const t=R0(e)%P0+1;return{bg:`hsl(var(--avatar-${t}-bg))`,fg:`hsl(var(--avatar-${t}-fg))`}}function I0(e){const t=ee.c(20),{name:n,avatarUrl:r,size:o}=e,s=o===void 0?28:o,i=(n==null?void 0:n[0])??"?";let a;t[0]!==i?(a=i.toUpperCase(),t[0]=i,t[1]=a):a=t[1];const c=a;let u;t[2]!==s?(u={width:s,height:s,borderRadius:"50%",flexShrink:0},t[2]=s,t[3]=u):u=t[3];const d=u;if(r){let b;t[4]!==d?(b={...d,objectFit:"cover"},t[4]=d,t[5]=b):b=t[5];let x;return t[6]!==r||t[7]!==n||t[8]!==b?(x=m.jsx("img",{src:r,alt:n,style:b}),t[6]=r,t[7]=n,t[8]=b,t[9]=x):x=t[9],x}let l;t[10]!==n?(l=T0(n),t[10]=n,t[11]=l):l=t[11];const{bg:f,fg:p}=l,v=s*.42;let g;t[12]!==f||t[13]!==p||t[14]!==d||t[15]!==v?(g={...d,background:f,display:"inline-flex",alignItems:"center",justifyContent:"center",color:p,fontSize:v,fontWeight:600,userSelect:"none"},t[12]=f,t[13]=p,t[14]=d,t[15]=v,t[16]=g):g=t[16];let w;return t[17]!==c||t[18]!==g?(w=m.jsx("span",{style:g,children:c}),t[17]=c,t[18]=g,t[19]=w):w=t[19],w}const Pi="/automation/runs",A0=[{label:"App Center",href:"/app-center",icon:ng},{label:"Flow Runs",href:Pi,icon:lg},{label:"Mac Resources",href:"/mac-resources",icon:sg}],N0=[{label:"Default",href:"/settings/default",icon:Nu},{label:"Team",href:"/settings/team",icon:fg},{label:"Tokens",href:"/settings/tokens",icon:tg}],D0=[{label:"Docs",href:"https://www.tapflow.dev/get-started/teammates",icon:qm}];function M0(){const e=ee.c(87),{pathname:t}=ou(),n=su(),{user:r}=ph(),{resolvedTheme:o}=ss(),s=o==="dark"?"/logo-dark.svg":"/logo.svg";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={queryKey:Qo.settings,queryFn:w0},e[0]=i):i=e[0];const a=Wo(i).data,c=(a==null?void 0:a.logo_url)??null,u=(a==null?void 0:a.team_name)||"tapflow",d=Qi(),{setOpenMobile:l}=lo();let f;e[1]!==l?(f=()=>l(!1),e[1]=l,e[2]=f):f=e[2];const p=f;let v;e[3]!==l?(v=()=>{l(!1)},e[3]=l,e[4]=v):v=e[4];let g;e[5]!==t||e[6]!==l?(g=[t,l],e[5]=t,e[6]=l,e[7]=g):g=e[7],h.useEffect(v,g);let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w={queryKey:Qo.anyRun,queryFn:j0},e[8]=w):w=e[8];const b=Wo(w);let x;e[9]!==b.data||e[10]!==b.isError||e[11]!==t?(x=b.data===!0||b.isError||t.startsWith(Pi),e[9]=b.data,e[10]=b.isError,e[11]=t,e[12]=x):x=e[12];const _=x;let C,E,P,R,T,A,j,F,z;if(e[13]!==p||e[14]!==s||e[15]!==c||e[16]!==n||e[17]!==t||e[18]!==d||e[19]!==_||e[20]!==u){let re;e[30]!==_?(re=Ee=>Ee.href!==Pi||_,e[30]=_,e[31]=re):re=e[31];const B=A0.filter(re);let se;e[32]!==n||e[33]!==d?(se=async function(){await fetch("/api/v1/auth/logout",{method:"POST",credentials:"include"}),d.clear(),n("/login",{replace:!0})},e[32]=n,e[33]=d,e[34]=se):se=e[34],A=se,T=wf,F="icon";const ye=c??s;let le;e[35]!==ye?(le=m.jsx("img",{src:ye,alt:"tapflow",className:"w-6 h-6 min-w-6 shrink-0"}),e[35]=ye,e[36]=le):le=e[36];let Pe;e[37]!==u?(Pe=m.jsx("span",{className:"text-base font-semibold tracking-tight truncate text-sidebar-accent-foreground group-data-[collapsible=icon]:hidden",children:u}),e[37]=u,e[38]=Pe):Pe=e[38],e[39]!==p||e[40]!==le||e[41]!==Pe?(z=m.jsx(Sf,{className:"p-2",children:m.jsxs(mo,{to:"/app-center",onClick:p,className:"flex items-center gap-2 p-1",children:[le,Pe]})}),e[39]=p,e[40]=le,e[41]=Pe,e[42]=z):z=e[42],R=Cf,P=Mo,E=jo,C=$o;let je;e[43]!==p||e[44]!==t?(je=Ee=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,isActive:t.startsWith(Ee.href),tooltip:Ee.label,children:m.jsxs(mo,{to:Ee.href,onClick:p,children:[m.jsx(Ee.icon,{}),m.jsx("span",{children:Ee.label})]})})},Ee.href),e[43]=p,e[44]=t,e[45]=je):je=e[45],j=B.map(je),e[13]=p,e[14]=s,e[15]=c,e[16]=n,e[17]=t,e[18]=d,e[19]=_,e[20]=u,e[21]=C,e[22]=E,e[23]=P,e[24]=R,e[25]=T,e[26]=A,e[27]=j,e[28]=F,e[29]=z}else C=e[21],E=e[22],P=e[23],R=e[24],T=e[25],A=e[26],j=e[27],F=e[28],z=e[29];let Y;e[46]!==C||e[47]!==j?(Y=m.jsx(C,{children:j}),e[46]=C,e[47]=j,e[48]=Y):Y=e[48];let Z;e[49]!==E||e[50]!==Y?(Z=m.jsx(E,{children:Y}),e[49]=E,e[50]=Y,e[51]=Z):Z=e[51];let K;e[52]!==P||e[53]!==Z?(K=m.jsx(P,{children:Z}),e[52]=P,e[53]=Z,e[54]=K):K=e[54];let H;e[55]===Symbol.for("react.memo_cache_sentinel")?(H=m.jsx(xi,{children:"Settings"}),e[55]=H):H=e[55];let J;if(e[56]!==p||e[57]!==t||e[58]!==(r==null?void 0:r.role)){let re;e[60]!==(r==null?void 0:r.role)?(re=se=>mh(se.href,r==null?void 0:r.role),e[60]=r==null?void 0:r.role,e[61]=re):re=e[61];let B;e[62]!==p||e[63]!==t?(B=se=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,isActive:t===se.href,tooltip:se.label,children:m.jsxs(mo,{to:se.href,onClick:p,children:[m.jsx(se.icon,{}),m.jsx("span",{children:se.label})]})})},se.href),e[62]=p,e[63]=t,e[64]=B):B=e[64],J=N0.filter(re).map(B),e[56]=p,e[57]=t,e[58]=r==null?void 0:r.role,e[59]=J}else J=e[59];let ne;e[65]!==J?(ne=m.jsxs(Mo,{children:[H,m.jsx(jo,{children:m.jsx($o,{children:J})})]}),e[65]=J,e[66]=ne):ne=e[66];let te;e[67]===Symbol.for("react.memo_cache_sentinel")?(te=m.jsx(xi,{children:"Reference"}),e[67]=te):te=e[67];let X;e[68]!==p?(X=D0.map(re=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,tooltip:re.label,children:m.jsxs("a",{href:re.href,target:"_blank",rel:"noopener noreferrer",onClick:p,children:[m.jsx(re.icon,{}),m.jsx("span",{children:re.label})]})})},re.href)),e[68]=p,e[69]=X):X=e[69];let q;e[70]!==X?(q=m.jsxs(Mo,{children:[te,m.jsx(jo,{children:m.jsx($o,{children:X})})]}),e[70]=X,e[71]=q):q=e[71];let me;e[72]!==R||e[73]!==K||e[74]!==ne||e[75]!==q?(me=m.jsxs(R,{children:[K,ne,q]}),e[72]=R,e[73]=K,e[74]=ne,e[75]=q,e[76]=me):me=e[76];let he;e[77]!==p||e[78]!==A||e[79]!==r?(he=r&&m.jsx(Ef,{className:"px-3 py-3",children:m.jsxs(a0,{children:[m.jsx(c0,{asChild:!0,children:m.jsxs("button",{className:"flex w-full items-center gap-2.5 rounded-md px-1 py-1 text-left hover:bg-sidebar-accent transition-colors group-data-[collapsible=icon]:justify-center",children:[m.jsx(I0,{name:r.displayName??"",avatarUrl:r.avatarUrl,size:28}),m.jsxs("div",{className:"flex flex-col min-w-0 flex-1 group-data-[collapsible=icon]:sr-only",children:[m.jsx("span",{className:"text-sm font-medium truncate",children:r.displayName}),m.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r.email})]})]})}),m.jsxs(dh,{side:"top",align:"start",className:"w-56",children:[m.jsx(ki,{asChild:!0,children:m.jsxs(mo,{to:"/settings/default",onClick:p,children:[m.jsx(Nu,{className:"mr-2 h-4 w-4"}),"Settings"]})}),m.jsx(fh,{}),m.jsxs(ki,{onClick:A,className:"text-destructive focus:text-destructive",children:[m.jsx(og,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})}),e[77]=p,e[78]=A,e[79]=r,e[80]=he):he=e[80];let ae;return e[81]!==T||e[82]!==me||e[83]!==he||e[84]!==F||e[85]!==z?(ae=m.jsxs(T,{collapsible:F,children:[z,me,he]}),e[81]=T,e[82]=me,e[83]=he,e[84]=F,e[85]=z,e[86]=ae):ae=e[86],ae}function j0(e){const{signal:t}=e;return E0(t)}function $0(){const e=ee.c(7),{theme:t,setTheme:n}=ss();let r;e[0]!==n||e[1]!==t?(r=()=>n(t==="dark"?"light":"dark"),e[0]=n,e[1]=t,e[2]=r):r=e[2];let o,s;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(ug,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s=m.jsx(ig,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),e[3]=o,e[4]=s):(o=e[3],s=e[4]);let i;return e[5]!==r?(i=m.jsxs(is,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Toggle theme",children:[o,s]}),e[5]=r,e[6]=i):i=e[6],i}const gh=h.createContext({node:null,setNode:()=>{}});function z0(e){const t=ee.c(5),{children:n}=e,[r,o]=h.useState(null);let s;t[0]!==r?(s={node:r,setNode:o},t[0]=r,t[1]=s):s=t[1];const i=s;let a;return t[2]!==n||t[3]!==i?(a=m.jsx(gh.Provider,{value:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function F0(){return h.useContext(gh)}function L0(){const e=ee.c(8),{node:t}=F0();let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(_f,{className:"-ml-1"}),r=m.jsx(qo,{orientation:"vertical",className:"h-4"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let o,s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"flex-1"}),s=m.jsx($0,{}),i=m.jsx(qo,{orientation:"vertical",className:"h-4"}),e[2]=o,e[3]=s,e[4]=i):(o=e[2],s=e[3],i=e[4]);let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("a",{href:"https://github.com/jo-duchan/tapflow",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-accent transition-colors","aria-label":"GitHub",children:m.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 fill-current","aria-hidden":"true",children:m.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),e[5]=a):a=e[5];let c;return e[6]!==t?(c=m.jsxs("header",{className:"flex h-16 items-center gap-2 border-b px-4",children:[n,r,t,o,s,i,a]}),e[6]=t,e[7]=c):c=e[7],c}function V0(){const e=ee.c(5),{user:t,loading:n}=ph(),r=ou();if(n)return null;if(!t){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(Gi,{to:"/login",replace:!0}),e[0]=a):a=e[0],a}if(!mh(r.pathname,t.role)){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex h-screen items-center justify-center",children:m.jsxs("div",{className:"text-center space-y-2",children:[m.jsx("p",{className:"text-lg font-semibold",children:"Access Denied"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Your role does not have access to this page."})]})}),e[1]=a):a=e[1],a}let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(M0,{}),e[2]=o):o=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(L0,{}),e[3]=s):s=e[3];let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(z0,{children:m.jsxs(bf,{children:[o,m.jsxs(xf,{children:[s,m.jsx("main",{className:"relative flex-1 min-h-0 overflow-auto",children:m.jsx(h.Suspense,{fallback:m.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),children:m.jsx(Vp,{})})})]})]})}),e[4]=i):i=e[4],i}var kr=e=>e.type==="checkbox",ms=e=>e.type==="file",Sn=e=>e instanceof Date,Xe=e=>e==null;const Na=e=>typeof e=="object";var Ae=e=>!Xe(e)&&!Array.isArray(e)&&Na(e)&&!Sn(e),Ri=e=>Ae(e)&&e.target?kr(e.target)?e.target.checked:ms(e.target)?e.target.files:e.target.value:e;const U0=/[.[\]'"]/;var Un=e=>e.split(U0).filter(Boolean);function Z0(e,t){const n=Un(t);let r=e._formValues,o=e._defaultValues;for(let s=0;s<n.length-1;s++){const i=n[s];if(r=r==null?r:r[i],o=o==null?o:o[i],r===null||o===null)return null}}var vh=(e,t)=>t.split(".").some((n,r,o)=>!isNaN(Number(n))&&e.has(o.slice(0,r).join("."))),gs=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Oe(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);const t=typeof Blob<"u"&&e instanceof Blob,n=typeof FileList<"u"&&e instanceof FileList;if(gs&&(t||n))return e;const r=Array.isArray(e),o=Object.getPrototypeOf(e);if(!r&&o&&e.constructor!==Object)return e;const s=r?new Array(e.length):Object.create(o);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[i]=Oe(e[i]));return s}const mn={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Rt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Je={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},B0=[Je.required,Je.min,Je.max,Je.minLength,Je.maxLength,Je.pattern,Je.validate],Lr="form",yh="root",Da=["__proto__","constructor","prototype"],H0=/^\w*$/;var br=e=>H0.test(e),ve=e=>e===void 0,U=(e,t,n)=>{if(!t||!Ae(e))return n;const r=br(t)?[t]:Un(t);if(r.some(s=>Da.includes(s)))return n;const o=r.reduce((s,i)=>Xe(s)?void 0:s[i],e);return ve(o)||o===e?ve(e[t])?n:e[t]:o},yt=e=>typeof e=="boolean",nt=e=>typeof e=="function",_e=(e,t,n)=>{let r=-1;const o=br(t)?[t]:Un(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let c=n;if(r!==i){const u=e[a];c=Ae(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}if(Da.includes(a))return;e[a]=c,e=e[a]}};const bh=I.createContext(null);bh.displayName="HookFormControlContext";const Ma=()=>I.useContext(bh);var wh=(e,t,n,r=!0)=>{const o={};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Rt.all&&(t._proxyFormState[i]=!r||Rt.all),n&&(n[i]=!0),e[i]}});return o};const ja=gs?I.useLayoutEffect:I.useEffect;var W0=e=>{const t=e.constructor&&e.constructor.prototype;return Ae(t)&&t.hasOwnProperty("isPrototypeOf")},Ti=e=>Xe(e)||!Na(e);const Uc=(e,t)=>t.length===0&&!Array.isArray(e)&&!W0(e);function at(e,t,n=!1,r=new WeakMap){if(e===t)return!0;if(Ti(e)||Ti(t))return Object.is(e,t);if(Sn(e)&&Sn(t))return Object.is(e.getTime(),t.getTime());const o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;if(Uc(e,o)||Uc(t,s))return Object.is(e,t);if(!o.length&&Array.isArray(e)!==Array.isArray(t))return!1;const i=r.get(e);if(i&&i.has(t))return!0;if(i)i.add(t);else{const a=new WeakSet;a.add(t),r.set(e,a)}for(const a of o){const c=e[a];if(!(a in t))return!1;if(!n||a!=="ref"){const u=t[a];if(Sn(c)&&Sn(u)||(Ae(c)||Array.isArray(c))&&(Ae(u)||Array.isArray(u))?!at(c,u,n,r):!Object.is(c,u))return!1}}return!0}function $a(e){const t=I.useRef(!1),n=I.useRef(!1),r=I.useRef(void 0),o=I.useRef(0);o.current++,!n.current&&e&&(n.current=!0,r.current=Oe(e()));const s=I.useCallback((a,c,u)=>{if(a&&(t.current||n.current&&o.current>1)){const d=c();at(r.current,d)||u(d)}t.current=!0},[]),i=I.useCallback((a,c)=>{a&&(r.current=Oe(c()))},[]);return{resyncIfNeeded:s,snapshot:i}}function K0(e){const t=Ma(),{control:n=t,disabled:r,name:o,exact:s}=e||{},i=()=>({...n._formState,defaultValues:n._defaultValues}),[a,c]=I.useState(i),u=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:d,snapshot:l}=$a(i);return ja(()=>{d(!r,i,c);const f=n._subscribe({name:o,formState:u.current,exact:s,callback:p=>{!r&&c({...n._formState,...p,defaultValues:n._defaultValues})}});return()=>{f(),l(!r,i)}},[n,o,r,s,d,l]),I.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),I.useMemo(()=>wh(a,n,u.current,!1),[a,n])}var rt=e=>typeof e=="string",Ii=(e,t,n,r,o)=>rt(e)?(r&&t.watch.add(e),U(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),U(n,s,U(o,s)))):(r&&(t.watchAll=!0),n);function G0(e){const t=Ma(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:i,compute:a}=e||{},c=I.useRef(o),u=I.useRef(a),d=I.useRef(n),l=I.useRef(r);u.current=a;const f=()=>{const A=n._getWatch(r,c.current);return u.current?u.current(A):A},[p,v]=I.useState(f),g=I.useRef(p),w=I.useCallback(A=>{const j=Ii(r,n._names,A||n._formValues,!1,c.current);return u.current?u.current(j):j},[n._formValues,n._names,r]),b=I.useCallback(A=>{if(!s){const j=Ii(r,n._names,A||n._formValues,!1,c.current);if(u.current){const F=u.current(j);at(F,g.current)||(v(F),g.current=F)}else v(j)}},[n._formValues,n._names,s,r]),{resyncIfNeeded:x,snapshot:_}=$a(f),C=I.useRef(b);C.current=b;const E=I.useRef(w);E.current=w,ja(()=>{d.current!==n||!at(l.current,r)?(d.current=n,l.current=r,C.current()):x(!s,()=>E.current(),j=>{const F=Oe(j);v(F),g.current=F});const A=n._subscribe({name:r,formState:{values:!0},exact:i,callback:j=>{C.current(j.values)}});return()=>{A(),_(!s,()=>E.current())}},[n,i,r,s,x,_]),I.useEffect(()=>n._removeUnmounted());const P=d.current!==n,R=l.current;return I.useMemo(()=>{if(s)return!1;const A=!P&&!at(R,r);return P||A},[s,P,r,R])?w():p}function q0(e){const t=Ma(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:i,exact:a=!0}=e,c=vh(o._names.array,n),u=I.useMemo(()=>{const C=U(o._formValues,n,U(o._defaultValues,n,i));return ve(C)?Z0(o,n):C},[o,n,i]),d=G0({control:o,name:n,defaultValue:u,exact:a}),l=K0({control:o,name:n,exact:a}),f=I.useRef(e),p=I.useRef(null),v=I.useRef(o.register(n,{...e.rules,value:d,...yt(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const g=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!U(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!U(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!U(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!U(l.validatingFields,n)},error:{enumerable:!0,get:()=>U(l.errors,n)}}),[l,n]),w=I.useCallback(C=>{const E=Ri(C);return U(o._fields,n)||(v.current=o.register(n,{...f.current.rules,value:E})),v.current.onChange({target:{value:Ri(C),name:n},type:mn.CHANGE})},[n,o]),b=I.useCallback(()=>{const C=U(o._formValues,n);return U(o._fields,n)||(v.current=o.register(n,{...f.current.rules,value:C})),v.current.onBlur({target:{value:C,name:n},type:mn.BLUR})},[n,o]),x=I.useCallback(C=>{C&&(p.current={focus:()=>nt(C.focus)&&C.focus(),select:()=>nt(C.select)&&C.select(),setCustomValidity:P=>nt(C.setCustomValidity)&&C.setCustomValidity(P),reportValidity:()=>nt(C.reportValidity)&&C.reportValidity()});const E=U(o._fields,n);E&&E._f&&C&&(E._f.ref=p.current,E._f._c=!0)},[o._fields,n]),_=I.useMemo(()=>({name:n,value:d,...yt(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:w,onBlur:b,ref:x}),[n,r,l.disabled,w,b,x,d]);return I.useEffect(()=>{const C=o._options.shouldUnregister||s;v.current=o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}});const E=(P,R)=>{const T=U(o._fields,P);T&&T._f&&(T._f.mount=R,T._f._c=R)};if(E(n,!0),C){const P=Oe(U(s?o._defaultValues:o._options.values||o._defaultValues,n,U(o._options.defaultValues,n,f.current.defaultValue)));_e(o._defaultValues,n,P),ve(U(o._formValues,n))&&_e(o._formValues,n,P)}if(!c&&o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}}),p.current){const P=U(o._fields,n);P&&P._f&&(P._f.ref=p.current)}return()=>{(c?C&&!o._state.action:C)?o.unregister(n):E(n,!1)}},[n,o,c,s]),I.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),I.useMemo(()=>({field:_,formState:l,fieldState:g}),[_,l,g])}const sk=e=>e.render(q0(e));var ko=e=>({isOnSubmit:!e||e===Rt.onSubmit,isOnBlur:e===Rt.onBlur,isOnChange:e===Rt.onChange,isOnAll:e===Rt.all,isOnTouch:e===Rt.onTouched}),Fs=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(const r of t.watch)if(e.startsWith(r)&&e.charAt(r.length)===".")return!0;return!1};const Zr=(e,t,n)=>{for(const r of n||Object.keys(e)){if(r==="_f")continue;const o=n?U(e,r):e[r];if(o){const{_f:s}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],s.name))return!0;if(s.ref&&t(s.ref,s.name))return!0;if(Zr(o,t))return!0}else if((Ae(o)||Array.isArray(o))&&Zr(o,t))return!0}}};var Zc=(e,t,n)=>{const r=U(e,n),o=Array.isArray(r)?r:[];return _e(o,yh,t[n]),_e(e,n,o),e},Ve=e=>Ae(e)&&!Object.keys(e).length,Yo=e=>{if(!gs)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},vs=e=>e.type==="radio",Jo=e=>e instanceof RegExp,za=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{};const Bc={value:!1,isValid:!1},Hc={value:!0,isValid:!0};var _h=e=>{if(!Array.isArray(e))return Bc;if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}const t=e[0];return!t||!t.checked||t.disabled?Bc:!t.attributes||!("value"in t.attributes)||ve(t.value)||t.value===""?Hc:{value:t.value,isValid:!0}};const Wc={isValid:!1,value:null};var xh=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Wc):Wc;function Kc(e,t,n="validate"){if(rt(e)||Array.isArray(e)&&e.every(rt)||yt(e)&&!e)return{type:n,message:rt(e)?e:"",ref:t}}var er=e=>Ae(e)&&!Jo(e)?e:{value:e,message:""},Gc=async(e,t,n,r,o,s)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:d,min:l,max:f,pattern:p,validate:v,name:g,valueAsNumber:w,mount:b,_c:x}=e._f,_=U(n,g);if(!b||t.has(g))return{};const C=a?a[0]:i,E=Z=>{if(o&&C.reportValidity){const K=yt(Z)?"":Z||"";a?a.forEach(H=>nt(H.setCustomValidity)&&H.setCustomValidity(K)):C.setCustomValidity(K),C.reportValidity()}},P={},R=vs(i),T=kr(i),A=R||T,j=(w||ms(i))&&ve(i.value)&&ve(_)||Yo(i)&&i.value===""&&!x||_===""||Array.isArray(_)&&!_.length,F=za.bind(null,g,r,P),z=(Z,K,H,J=Je.maxLength,ne=Je.minLength)=>{const te=Z?K:H;P[g]={type:Z?J:ne,message:te,ref:i,...F(Z?J:ne,te)}};if(s?!Array.isArray(_)||!_.length:c&&(!A&&(j||Xe(_))||yt(_)&&!_||T&&!_h(a).isValid||R&&!xh(a).isValid)){const{value:Z,message:K}=rt(c)?{value:!!c,message:c}:er(c);if(Z&&(P[g]={type:Je.required,message:K,ref:C,...F(Je.required,K)},!r))return E(K),P}if(!j&&(!Xe(l)||!Xe(f))){let Z,K;const H=er(f),J=er(l);if(!Xe(_)&&!Sn(_)&&!isNaN(_)){const ne=i.valueAsNumber||_&&+_;Xe(H.value)||(Z=ne>H.value),Xe(J.value)||(K=ne<J.value)}else{const ne=i.valueAsDate||new Date(_),te=me=>new Date(new Date().toDateString()+" "+me),X=i.type=="time",q=i.type=="week";rt(H.value)&&_&&(Z=X?te(_)>te(H.value):q?_>H.value:ne>new Date(H.value)),rt(J.value)&&_&&(K=X?te(_)<te(J.value):q?_<J.value:ne<new Date(J.value))}if((Z||K)&&(z(!!Z,H.message,J.message,Je.max,Je.min),!r))return E(P[g].message),P}if((u||d)&&!j&&(rt(_)||s&&Array.isArray(_))){const Z=er(u),K=er(d),H=!Xe(Z.value)&&_.length>+Z.value,J=!Xe(K.value)&&_.length<+K.value;if((H||J)&&(z(H,Z.message,K.message),!r))return E(P[g].message),P}if(p&&!j&&rt(_)){const{value:Z,message:K}=er(p);if(Jo(Z)&&!_.match(Z)&&(P[g]={type:Je.pattern,message:K,ref:i,...F(Je.pattern,K)},!r))return E(K),P}if(v){if(nt(v)){const Z=await v(_,n),K=Kc(Z,C);if(K&&(P[g]={...K,...F(Je.validate,K.message)},!r))return E(K.message),P}else if(Ae(v)){let Z={};for(const K in v){if(!Ve(Z)&&!r)break;const H=Kc(await v[K](_,n),C,K);H&&(Z={...H,...F(K,H.message)},r||E(H.message),r&&(P[g]=Z))}if(!Ve(Z)&&(P[g]={ref:C,...Z},!r))return P}}const Y=P[g];return E(Y?Y.message:!0),P},Ls=e=>Array.isArray(e)?e:[e],Sh=e=>Array.isArray(e)?e.filter(Boolean):[];function Q0(e,t){const n=t.length-1;let r=0;for(;r<n;){if(Xe(e)){e=void 0;break}e=e[t[r]],r++}return e}function Y0(e){for(const t in e)if(e.hasOwnProperty(t)&&!ve(e[t]))return!1;return!0}function Fe(e,t){if(rt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:br(t)?[t]:Un(t);if(n.some(i=>Da.includes(String(i))))return e;const r=n.length===1?e:Q0(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Ae(r)&&Ve(r)||Array.isArray(r)&&Y0(r))&&Fe(e,n.slice(0,-1)),e}const J0=I.createContext(null);J0.displayName="HookFormContext";var qc=()=>{let e=new Set,t=0;return{get observers(){return Array.from(e)},next:s=>{const i=e;t++;for(const a of i)a.next&&a.next(s);i===e&&t--},subscribe:s=>(e.add(s),{unsubscribe:()=>{t&&(e=new Set(e),t=0),e.delete(s)}}),unsubscribe:()=>{e=new Set,t=0}}};function Eh(e,t){const n=Array.isArray(e)?[]:{};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=e[r],s=t[r];o&&(Ae(o)||Array.isArray(o))&&s?n[r]=Eh(o,s):e[r]&&(n[r]=s)}return n}const Qc=(e,t)=>e!==null&&Na(e)&&Object.prototype.hasOwnProperty.call(e,t);var Yc=(e,t)=>{if(!t)return!1;let n=e;for(const r of br(t)?[t]:Un(t)){if(!Qc(n,r))return Qc(e,t);n=n[r]}return!0},X0=e=>kr(e)?e.checked!==e.defaultChecked:!vs(e)&&"defaultValue"in e&&e.value!==e.defaultValue,Ch=e=>e.type==="select-multiple",e_=e=>vs(e)||kr(e),Vs=e=>Yo(e)&&e.isConnected;function Jc(e){return Array.isArray(e)||Ae(e)}function kh(e,t,n="",r=[]){for(const o in e){const s=n?`${n}.${o}`:o,i=e[o];Jc(i)&&Jc(U(t,s))?kh(i,t,s,r):r.push(s)}return r}var t_=e=>{for(const t in e)if(nt(e[t]))return!0;return!1};function Oh(e){return Array.isArray(e)||Ae(e)&&!t_(e)}function Ph(e){return!!(e&&"_f"in e)}function Rh(e){return Array.isArray(e)?!e.some(t=>!ve(t)):!Object.keys(e).length}function Ai(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function Ni(e,t={},n){for(const r in e){const o=e[r],s=n&&n[r];Oh(o)&&(!Array.isArray(o)||!Ph(s))?(t[r]=Array.isArray(o)?[]:{},Ni(o,t[r],s),Rh(t[r])&&Ai(t,r)):ve(o)||(t[r]=!0)}return t}function Gt(e,t,n,r){n||(n=Ni(t,Array.isArray(t)?[]:{},r));for(const o in e){const s=e[o],i=r&&r[o];Oh(s)&&(!Array.isArray(s)||!Ph(i))?(ve(t)||Ti(n[o])?n[o]=Ni(s,Array.isArray(s)?[]:{},i):Gt(s,Xe(t)?{}:t[o],n[o],i),Rh(n[o])&&Ai(n,o)):at(s,t[o])?Ai(n,o):n[o]=!0}return n}var n_=(e,t)=>{const n=t.split("."),r=[];let o=n[0];for(let s=1;s<n.length;o+="."+n[s++])!isNaN(+n[s])&&e.has(o)&&r.push(`${o}.${n[s]}`);return r},Di=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ve(e)?e:t?e===""?NaN:e&&+e:n&&rt(e)?new Date(e):r?r(e):e;function Xc(e){const t=e.ref;return ms(t)?t.files:vs(t)?xh(e.refs).value:Ch(t)?[...t.selectedOptions].map(({value:n})=>n):kr(t)?_h(e.refs).value:Di(t.value,e)}var r_=(e,t,n,r)=>{const o={};for(const s of e){const i=U(t,s);i&&_e(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},$r=e=>ve(e)?e:Jo(e)?e.source:Ae(e)?Jo(e.value)?e.value.source:e.value:e;const el="AsyncFunction";var o_=e=>{if(!e||!e.validate)return!1;if(nt(e.validate))return e.validate.constructor.name===el;if(Ae(e.validate)){for(const t in e.validate)if(e.validate[t].constructor.name===el)return!0}return!1},s_=e=>e.mount&&(e.required||!ve(e.required)&&e.required!==!1||!ve(e.min)||!ve(e.max)||!ve(e.maxLength)||!ve(e.minLength)||e.pattern||e.validate);function tl(e,t,n){const r=U(e,n);if(r&&(r.type||r.message)||Array.isArray(r))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=U(t,s),a=U(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:n}}var i_=(e,t,n)=>{const r=Object.keys(e).filter(o=>o!=="name");return!r.length||n&&r.length>=Object.keys(t).length||r.find(o=>t[o]===(!n||Rt.all))};const nl=(e,t,n)=>n?e===t||e.startsWith(t+"."):e.startsWith(t)||t.startsWith(e);var rl=(e,t,n)=>{if(!e||!t||e===t)return!0;if(!Array.isArray(e))return nl(e,t,n);for(const r of e)if(r&&nl(r,t,n))return!0;return!1},a_=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,c_=(e,t)=>{const n=U(e,t);!Sh(n).length&&!(n&&n.root)&&Fe(e,t)};const Uo={mode:Rt.onSubmit,reValidateMode:Rt.onChange,shouldFocusError:!0},l_=(e,t)=>{for(const n in e)delete e[n];Object.assign(e,t)},Th={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function u_(e={}){let t={...Uo,...e},n={...Oe(Th),isLoading:nt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},o=Ae(t.defaultValues)||Ae(t.values)?Oe(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Oe(o),i={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},a=!1,c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const u={},d={},l=new Set;let f=ko(t.mode),p=ko(t.reValidateMode);const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...v},w={},b=(...y)=>y.some(O=>g[O]||w[O]),x=y=>{for(const O of l)if(rl(O.name,y,O.exact))return!0;return!1},_={array:qc(),state:qc()};let C=0,E=0,P=t.criteriaMode===Rt.all;const R=(y,O)=>k=>{clearTimeout(d[y]),d[y]=setTimeout(O,k)},T=y=>{clearTimeout(d[y]),delete d[y],delete u[y]},A=y=>{T(y);const O=`${y}.`;for(const k of Object.keys(u))k.startsWith(O)&&T(k)},j=async y=>{if(!i.keepIsValid&&!t.disabled&&(b("isValid")||y)){const O=++C;let k;t.resolver?(k=Ve((await q()).errors),O===C&&F()):k=await ae({fields:r,onlyCheckValid:!0,eventType:mn.VALID}),O===C&&k!==n.isValid&&_.state.next({isValid:k})}},F=(y,O)=>{!t.disabled&&b("isValidating","validatingFields")&&((y||c.mount).forEach(k=>{k&&(O?_e(n.validatingFields,k,O):Fe(n.validatingFields,k))}),_.state.next({validatingFields:n.validatingFields,isValidating:!Ve(n.validatingFields)}))},z=()=>{n.dirtyFields=Gt(o,s,void 0,r)},Y=(y,O=[],k,N,$=!0,W=!0)=>{if(N&&k&&!t.disabled){i.action=!0;const L=U(r,y);if(i.actionArrayLengths.has(y)||i.actionArrayLengths.set(y,Array.isArray(L)?L.length:0),W&&Array.isArray(L)){const be=k(L,N.argA,N.argB);$&&_e(r,y,be)}const D=U(n.errors,y);if(W&&Array.isArray(D)){const be=D.root,we=k(D,N.argA,N.argB)||D;be&&(we.root=be),$&&_e(n.errors,y,we),c_(n.errors,y),n.errors={...n.errors}}const V=U(n.touchedFields,y),Q=W&&Array.isArray(V);if(Q){const be=k(V,N.argA,N.argB);$&&_e(n.touchedFields,y,be)}const ue=U(n.dirtyFields,y);if(W&&Array.isArray(ue)){const be=k(ue,N.argA,N.argB)||ue;$&&_e(n.dirtyFields,y,be)}b("dirtyFields")?z():a=!0,_.state.next({name:y,isDirty:B(y,O),dirtyFields:n.dirtyFields,...Q&&{touchedFields:n.touchedFields},errors:n.errors,isValid:n.isValid})}else _e(s,y,O)},Z=(y,O)=>{_e(n.errors,y,O),n.errors={...n.errors},_.state.next({errors:n.errors})},K=y=>{Object.keys(u).forEach(T);const O=!Ve(y);n.errors=y,_.state.next({errors:n.errors,...O?{isValid:!1}:{}}),!O&&i.mount&&j()},H=y=>{const O=br(y)?[y]:Un(y);let k=s,N=o;for(let $=0;$<O.length-1;$++){const W=O[$];if(k=Xe(k)?k:k[W],N=Xe(N)?N:N[W],k===null&&N!==null)return!0}return!1},J=y=>{if(!i.actionArrayLengths.size)return!1;const O=br(y)?[y]:Un(y);let k=s,N="",$=-1,W=0;for(let L=0;L<O.length;L++){if(Xe(k))return!1;const D=O[L];if(N=N?`${N}.${D}`:D,Array.isArray(k)&&+D>=k.length)return $===-1?!1:L===$?+D<W:!0;if(i.actionArrayLengths.has(N)&&($=L+1,W=i.actionArrayLengths.get(N)),k=k[D],ve(k)&&$!==-1&&L>$&&+O[$]<W)return!0}return!1},ne=(y,O,k,N)=>{const $=U(r,y);if($){if(H(y)||J(y))return;const W=ve(U(s,y)),L=U(s,y,ve(k)?U(o,y):k),D=!!N&&!n.isReady&&X0(N);if(ve(L)||N&&N.defaultChecked||D||O){const V=O?L:Xc($._f);b("dirtyFields")&&!at(U(s,y),V)&&(a=!0),_e(s,y,V),D&&te(y,V)}else le(y,L);i.mount&&!i.action&&(t.resolver&&b("isValidating","validatingFields")?Promise.resolve().then(()=>j()):j(),W&&n.isDirty&&b("isDirty")&&(B()||(n.isDirty=!1,_.state.next({...n}))),t.shouldUnregister&&W&&!ve(U(s,y))&&Fs(y,c)&&(i.watch=!0))}},te=(y,O,k,N,$)=>{let W=!1,L=!1;const D={name:y};if(!t.disabled||N===!0){if(!k||N){const V=at(U(o,y),O);if(b("isDirty")&&(L=n.isDirty,n.isDirty=D.isDirty=!V||B(),W=L!==D.isDirty),L=!!U(n.dirtyFields,y),V)Fe(n.dirtyFields,y);else{const ue=U(o,y),be=U(r,y),we=!(be&&be._f)&&(Ae(ue)||Array.isArray(ue))?Gt(ue,O,void 0,be):!0;_e(n.dirtyFields,y,we)}let Q=!1;if(a||V&&(b("isDirty")?n.isDirty:B())){a=!1;const ue=Gt(o,s,void 0,r);at(n.dirtyFields,ue)||(Q=!0,l_(n.dirtyFields,ue))}D.dirtyFields=n.dirtyFields,W=W||b("dirtyFields")&&(Q||L!==!V)}if(k){const V=Yc(n.touchedFields,y)?U(n.touchedFields,y):void 0;V||(_e(n.touchedFields,y,k),D.touchedFields=n.touchedFields,W=W||b("touchedFields")&&V!==k)}W&&$&&_.state.next(D)}return W?D:{}},X=(y,O,k,N)=>{const $=U(n.errors,y),W=b("isValid")&&yt(O)&&n.isValid!==O;if(t.delayError&&k?(u[y]=R(y,()=>Z(y,k)),u[y](t.delayError)):(T(y),k?_e(n.errors,y,k):Fe(n.errors,y),n.errors={...n.errors}),(k?!at($,k,!0):$)||!Ve(N)||W){const L={...N,...W&&yt(O)?{isValid:O}:{},errors:n.errors,name:y};_.state.next(L)}},q=async y=>(F(y,!0),await t.resolver(s,t.context,r_(y||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),me=async y=>{const O=E,{errors:k}=await q(y);if(O!==E)return k;if(F(y),y){for(const N of y){const $=U(k,N);A(N);const W=c.array.has(N)&&Ae($)&&!Object.keys($).some(V=>!Number.isNaN(Number(V))),L=U(r,N),D=Ae(L)&&Object.keys(L).some(V=>V!=="_f");W?Zc(n.errors,{[N]:$},N):$&&($.type||$.message)||Array.isArray($)||Ae($)&&D?_e(n.errors,N,$):Fe(n.errors,N)}n.errors={...n.errors}}else Object.keys(u).forEach(T),n.errors=k;return k},he=async({name:y,eventType:O})=>{if(t.validate){const k=E,N=await t.validate({formValues:s,formState:n,name:y,eventType:O});if(k!==E)return!0;if(Ae(N)){let $=!0;Rn(Lr);for(const W in N){const L=N[W];L&&($=!1,sn(`${Lr}.${W}`,{message:rt(L.message)?L.message:"",type:L.type||Je.validate}))}return $}else return rt(N)||!N?(sn(Lr,{message:N||"",type:Je.validate}),!1):(Rn(Lr),!0)}return!0},ae=async({fields:y,onlyCheckValid:O,name:k,eventType:N,context:$={valid:!0,runRootValidation:!1}})=>{const W=E;if(t.validate&&!$.runRootValidation&&($.runRootValidation=!0,!await he({name:k,eventType:N})&&($.valid=!1,O)))return $.valid;for(const L in y){const D=y[L];if(D){const{_f:V,...Q}=D;if(V){const ue=c.array.has(V.name),be=D._f&&o_(D._f),we=b("isValidating","validatingFields");be&&we&&F([V.name],!0);const ke=await Gc(D,c.disabled,s,P,t.shouldUseNativeValidation&&!O,ue);if(W!==E)return $.valid;if(be&&we&&F([V.name]),ke[V.name]&&($.valid=!1,O)||(O||(T(V.name),U(ke,V.name)?ue?Zc(n.errors,ke,V.name):_e(n.errors,V.name,ke[V.name]):Fe(n.errors,V.name)),t.shouldUseNativeValidation&&ke[V.name]))break}!Ve(Q)&&await ae({context:$,onlyCheckValid:O,fields:Q,name:L,eventType:N})}}return $.valid},re=()=>{for(const y of c.unMount){const O=U(r,y);O&&(O._f.refs?O._f.refs.every(k=>!Vs(k)):!Vs(O._f.ref))&&Ir(y)}c.unMount=new Set},B=(y,O)=>(y&&O&&_e(s,y,O),!at(i.mount?s:o,o)),se=(y,O,k)=>{const N=i.mount?s:ve(O)||!ve(y)?o:O;return Ii(y,c,ve(y)?{...N}:N,k,O)},ye=y=>Sh(U(i.mount?s:o,y,t.shouldUnregister?U(o,y,[]):[])),le=(y,O,k={},N=!1,$=!1,W=!1)=>{const L=U(r,y);let D=O;if(L){const V=L._f;V&&(!V.disabled&&_e(s,y,Di(O,V)),D=Yo(V.ref)&&Xe(O)?"":O,Ch(V.ref)?[...V.ref.options].forEach(Q=>Q.selected=D.includes(Q.value)):V.refs?kr(V.ref)?V.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(D)?Q.checked=!!D.find(ue=>ue===Q.value):Q.checked=D===Q.value||!!D)}):V.refs.forEach(Q=>Q.checked=Q.value===D):ms(V.ref)?V.ref.value="":(V.ref.value=D,!V.ref.type&&!$&&!W&&_.state.next({name:y,values:N?s:x(y)?Oe(s):void 0})))}(k.shouldDirty||k.shouldTouch)&&te(y,L&&L._f&&!L._f.disabled&&(L._f.valueAsNumber||L._f.valueAsDate||L._f.setValueAs)?Di(O,L._f):D,k.shouldTouch,k.shouldDirty,!$),k.shouldValidate&<(y,{delayError:k.delayError}),k.shouldValidate&&L&&L._f&&L._f.deps&&(!Array.isArray(L._f.deps)||L._f.deps.length>0)&<(L._f.deps)},Pe=(y,O,k,N=!1,$=!1,W=!1)=>{c.array.has(y)&&_.array.next({name:y,values:N?s:Oe(s)});for(const L in O){if(!O.hasOwnProperty(L))continue;const D=O[L],V=y+"."+L,Q=U(r,V);(c.array.has(y)||Ae(D)||Q&&!Q._f)&&!Sn(D)?Pe(V,D,k,N,$,W):le(V,D,k,N,$,W)}},je=(y,O,k,N,$=!1)=>{const W=U(r,y),L=c.array.has(y),D=N?O:Oe(O),V=U(s,y),Q=at(V,D);if(Q||_e(s,y,D),L)_.array.next({name:y,values:N?s:Oe(s)}),b("isDirty","dirtyFields")&&k.shouldDirty&&(z(),$||_.state.next({name:y,dirtyFields:n.dirtyFields,isDirty:B(y,D)})),k.shouldValidate&<(y,{delayError:k.delayError});else{const ue=Array.isArray(D)&&!D.length||Ve(D),be=!Q&&!$;!W||W._f||Xe(D)||ue?le(y,D,k,N,$,be):Pe(y,D,k,N,$,be)}if(!Q&&!$){const ue=Fs(y,c),be=i.mount||ue?y:void 0,we=L?[]:n_(c.array,y),ke=N?s:x(be)||we.some(x)?Oe(s):void 0;_.state.next({...ue&&n,name:be,values:ke});for(const mt of we)_.state.next({name:mt,values:ke})}},Ee=(y,O,k={})=>je(y,O,k,!1),$e=(y,O={})=>{const k=nt(y)?y(s):y;if(!at(s,k)){s={...s,...k};for(const N of c.mount)Yc(k,N)&&je(N,U(k,N),O,!0,!0);_.state.next({...n,name:void 0,type:void 0,...l.size?{values:s}:{}}),O.shouldValidate&&j()}},We=async y=>{i.mount=!0;const O=y.target;let k=O.name,N=!0;const $=U(r,k),W=L=>{N=Number.isNaN(L)||Sn(L)&&isNaN(L.getTime())||at(L,U(s,k,L))};if($){let L,D;const V=O.type?Xc($._f):Ri(y),Q=y.type===mn.BLUR||y.type===mn.FOCUS_OUT,ue=!s_($._f)&&!t.validate&&!t.resolver&&!U(n.errors,k)&&!$._f.deps,be=ue||a_(Q,U(n.touchedFields,k),n.isSubmitted,p,f),we=Fs(k,c,Q);_e(s,k,Oe(V)),Q?(!O||!O.readOnly)&&($._f.onBlur&&$._f.onBlur(y),Object.prototype.hasOwnProperty.call(u,k)&&u[k](0)):$._f.onChange&&$._f.onChange(y);const ke=te(k,V,Q),mt=!Ve(ke)||we;if(!Q&&_.state.next({name:k,type:y.type,...x(k)?{values:Oe(s)}:{}}),be)return(!ue||!n.isValid)&&b("isValid")&&(t.mode==="onBlur"?Q&&j():Q||j()),mt&&_.state.next({name:k,...we?{}:ke});if(!t.resolver&&t.validate&&await he({name:k,eventType:y.type}),!Q&&we&&_.state.next({...n}),t.resolver){const un=E,{errors:_t}=await q([k]);if(un!==E)return;if(F([k]),W(V),!N){!Ve(ke)&&_.state.next(ke);return}const Dr=tl(n.errors,r,k),tc=tl(_t,r,Dr.name||k);L=tc.error,k=tc.name,D=Ve(_t)}else{const un=E;if(F([k],!0),L=(await Gc($,c.disabled,s,P,t.shouldUseNativeValidation))[k],un!==E)return;if(F([k]),W(V),N){if(L)D=!1;else if(b("isValid")&&(D=await ae({fields:r,onlyCheckValid:!0,name:k,eventType:y.type}),un!==E))return}}N&&($._f.deps&&(!Array.isArray($._f.deps)||$._f.deps.length>0)&<($._f.deps),X(k,D,L,ke))}},kt=(y,O)=>{if(U(n.errors,O)&&y.focus)return y.focus(),1},lt=async(y,O={})=>{let k,N;const $=Ls(y);if(t.resolver){const W=E,L=await me(ve(y)?y:$);if(k=Ve(L),N=y?!$.some(D=>U(L,D)):k,W!==E)return N}else y?(N=(await Promise.all($.map(async W=>{const L=U(r,W);return await ae({fields:L&&L._f?{[W]:L}:L,eventType:mn.TRIGGER})}))).every(Boolean),!(!N&&!n.isValid)&&j()):N=k=await ae({fields:r,name:y,eventType:mn.TRIGGER});if(O.delayError&&t.delayError&&rt(y)){const W=U(n.errors,y);W?(Fe(n.errors,y),u[y]=R(y,()=>Z(y,W)),u[y](t.delayError)):T(y)}if(O.shouldTouch)for(const W of y?$:c.mount)!c.array.has(W)&&_e(n.touchedFields,W,!0);return n.errors={...n.errors},_.state.next({...!rt(y)||b("isValid")&&k!==n.isValid?{}:{name:y},...t.resolver||!y?{isValid:k}:{},...O.shouldTouch&&b("touchedFields")?{touchedFields:n.touchedFields}:{},errors:n.errors}),O.shouldFocus&&!N&&Zr(r,kt,y?$:c.mount),N},Le=(y,O)=>{let k={...i.mount?s:o};return O&&(k=Eh(O.dirtyFields?n.dirtyFields:n.touchedFields,k)),ve(y)?k:rt(y)?U(k,y):y.map(N=>U(k,N))},qn=y=>ve(y)?{...n.errors}:rt(y)?U(n.errors,y):y.map(O=>U(n.errors,O)),pt=(y,O)=>{const k=O||n,N=U(k.errors,y);return{invalid:!!N,isDirty:!!U(k.dirtyFields,y),error:N,isValidating:!!U(k.validatingFields,y),isTouched:!!U(k.touchedFields,y)}},Rn=y=>{const O=y?Ls(y):void 0;O?O.forEach(k=>{A(k),Fe(n.errors,k),n.errors={...n.errors},_.state.next({name:k,errors:n.errors})}):(Object.keys(u).forEach(T),n.errors={},_.state.next({errors:n.errors}))},sn=(y,O,k)=>{A(y);const N=(U(r,y,{_f:{}})._f||{}).ref,$=U(n.errors,y)||{},{ref:W,message:L,type:D,types:V,...Q}=$;_e(n.errors,y,{...Q,...O,ref:N}),n.errors={...n.errors},_.state.next({name:y,errors:n.errors,isValid:!1}),k&&k.shouldFocus&&N&&N.focus&&N.focus()},ze=(y,O)=>{if(nt(y)){const k={};l.add(k);const{unsubscribe:N}=_.state.subscribe({next:$=>"values"in $&&y($.values||se(void 0,O),$)});return{unsubscribe:()=>{l.delete(k),N()}}}return se(y,O,!0)},Tr=y=>{const O={name:y.name,exact:y.exact};y.formState&&y.formState.values&&l.add(O);const{unsubscribe:k}=_.state.subscribe({next:N=>{if(rl(y.name,N.name,y.exact)&&i_(N,y.formState||g,y.reRenderRoot)){const $=N.values||{...s};y.callback({...n,...N,values:$,defaultValues:o})}}});return()=>{l.delete(O),k()}},an=y=>{i.mount=!0;const O=Object.keys(y.formState||{}).filter(N=>y.formState&&y.formState[N]);for(const N of O)w[N]=(w[N]||0)+1;const k=Tr({...y,formState:{...v,...y.formState}});return()=>{for(const N of O.splice(0))w[N]--;k()}},Ir=(y,O={})=>{for(const k of y?Ls(y):c.mount)c.mount.delete(k),c.array.delete(k),c.disabled.delete(k),O.keepValue||(Fe(r,k),Fe(s,k)),O.keepError||(A(k),Fe(n.errors,k)),!O.keepDirty&&Fe(n.dirtyFields,k),!O.keepTouched&&Fe(n.touchedFields,k),!O.keepIsValidating&&Fe(n.validatingFields,k),!t.shouldUnregister&&!O.keepDefaultValue&&Fe(o,k);O.keepError||(n.errors={...n.errors}),l.size&&_.state.next({values:Oe(s)}),_.state.next({...n,...O.keepDirty?{}:{isDirty:B()},...O.keepIsValidating?{}:{isValidating:!Ve(n.validatingFields)}}),!O.keepIsValid&&j()},fo=({disabled:y,name:O})=>{if(yt(y)&&i.mount||y||c.disabled.has(O)){const $=c.disabled.has(O)!==!!y;y?c.disabled.add(O):c.disabled.delete(O),$&&i.mount&&!i.action&&j()}},cn=(y,O={})=>{let k=U(r,y);const N=yt(O.disabled)||yt(t.disabled),$=!c.registerName.has(y)&&k&&k._f&&!k._f.mount;if(_e(r,y,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:y}},name:y,mount:!0,...O}}),c.mount.add(y),k&&k._f){const W=U(r,y);for(const L of B0)L in O||delete W._f[L]}return k&&!$?fo({disabled:yt(O.disabled)?O.disabled:t.disabled,name:y}):ne(y,!0,O.value),{...N?{disabled:O.disabled||t.disabled}:{},...t.progressive?{required:!!O.required,min:$r(O.min),max:$r(O.max),minLength:$r(O.minLength),maxLength:$r(O.maxLength),pattern:$r(O.pattern)}:{},name:y,onChange:We,onBlur:We,ref:W=>{if(W){c.registerName.add(y),cn(y,O),c.registerName.delete(y),k=U(r,y);const L=ve(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,D=e_(L),V=k._f.refs||[];if(D?V.find(ue=>ue===L):L===k._f.ref)return;const Q={...k._f};D?(Q.refs=[...V.filter(Vs),L,...Array.isArray(U(o,y))?[{}]:[]],Q.ref={type:L.type,name:y}):(Q.ref=L,delete Q.refs),_e(r,y,{_f:Q}),ne(y,!1,void 0,L)}else k=U(r,y,{}),k._f&&(k._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(vh(c.array,y)&&i.action)&&c.unMount.add(y)}}},Ar=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Zr(r,kt,c.mount),ho=y=>{yt(y)&&(_.state.next({disabled:y}),Zr(r,(O,k)=>{const N=U(r,k);N&&(O.disabled=N._f.disabled||y,Array.isArray(N._f.refs)&&N._f.refs.forEach($=>{$.disabled=N._f.disabled||y}))},0))},Qn=(y,O)=>async k=>{let N,$;k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let W=Oe(s);if(_.state.next({isSubmitting:!0}),t.resolver){const L=E,{errors:D,values:V}=await q();if(L!==E)return;F(),Object.keys(u).forEach(T),n.errors=D,W=Oe(V)}else{const L=E;if(await ae({fields:r,eventType:mn.SUBMIT}),L!==E)return;Fe(n.errors,yh),n.errors={...n.errors}}if(c.disabled.size)for(const L of c.disabled)Fe(W,L);if(Ve(n.errors)){_.state.next({errors:{}});try{N=await y(W,k)}catch(L){$=L}}else O&&await O({...n.errors},k),Ar(),setTimeout(Ar);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ve(n.errors)&&!$,submitCount:n.submitCount+1,errors:n.errors}),$)throw $;return N},ln=(y,O={})=>{U(r,y)&&(Fe(n.validatingFields,y),ve(O.defaultValue)?Ee(y,Oe(U(o,y))):(Ee(y,O.defaultValue),_e(o,y,Oe(O.defaultValue))),O.keepTouched||Fe(n.touchedFields,y),O.keepDirty||(Fe(n.dirtyFields,y),n.isDirty=O.defaultValue?B(y,Oe(U(o,y))):B()),O.keepError||(A(y),Fe(n.errors,y),n.errors={...n.errors},j()),_.state.next({...n,isValidating:!Ve(n.validatingFields)}))},Nr=(y,O={})=>{E++;const k=y?Oe(y):o,N=Oe(k),$=Ve(y),W=N,L=r;if(Object.keys(u).forEach(T),O.keepDefaultValues||(o=k),!O.keepValues){if(O.keepDirtyValues){const D=new Set([...c.mount,...kh(Gt(o,s,void 0,L),n.dirtyFields)]);for(const V of D){const Q=U(n.dirtyFields,V),ue=U(s,V),be=U(W,V);Q&&!ve(ue)?_e(W,V,ue):!Q&&!ve(be)&&Ee(V,be)}}else{if(gs&&ve(y))for(const D of c.mount){const V=U(r,D);if(V&&V._f){const Q=Array.isArray(V._f.refs)?V._f.refs[0]:V._f.ref;if(Yo(Q)){const ue=Q.closest("form");if(ue){ue.reset();break}}}}if(O.keepFieldsRef)for(const D of c.mount)Ee(D,U(W,D));else r={}}if(t.shouldUnregister){if(s=O.keepDefaultValues?Oe(o):{},O.keepFieldsRef)for(const D of c.mount)_e(s,D,U(W,D))}else s=Oe(W);_.array.next({values:{...W}}),_.state.next({name:void 0,type:void 0,values:{...W}})}c={mount:O.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!g.isValid||!!O.keepIsValid||!!O.keepDirtyValues||!t.shouldUnregister&&!Ve(W),i.watch=!!t.shouldUnregister,i.keepIsValid=!!O.keepIsValid,i.action=!1,i.actionArrayLengths.clear(),a=!1,O.keepErrors||(n.errors={}),_.state.next({submitCount:O.keepSubmitCount?n.submitCount:0,isDirty:$?!1:O.keepDirty?n.isDirty:O.keepValues?B():!!(O.keepDefaultValues&&y&&!at(y,o)),isSubmitted:O.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:$?{}:O.keepDirtyValues?O.keepDefaultValues&&s?Gt(o,s,void 0,L):n.dirtyFields:O.keepDefaultValues&&y?Gt(o,y,void 0,L):O.keepDirty?n.dirtyFields:O.keepValues?Gt(o,s,void 0,L):{},touchedFields:O.keepTouched?n.touchedFields:{},...!O.keepIsValidating&&(n.isValidating||!Ve(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:O.keepErrors?n.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ht=(y,O)=>Nr(nt(y)?y(s):y,{...t.resetOptions,...O}),xs=(y,O={})=>{const k=U(r,y),N=k&&k._f;if(N){const $=N.refs?N.refs[0]:N.ref;$.focus&&setTimeout(()=>{$.focus(),O.shouldSelect&&nt($.select)&&$.select()})}},Ss=y=>{const{name:O,type:k,values:N,...$}=y;Object.keys($).length&&(n={...n,...$})};_.state.subscribe({next:Ss});const wt={control:{register:cn,unregister:Ir,getFieldState:pt,handleSubmit:Qn,setError:sn,_subscribe:Tr,_runSchema:q,_updateIsValidating:F,_focusError:Ar,_getWatch:se,_getDirty:B,_setValid:j,_setFieldArray:Y,_setDisabledField:fo,_setErrors:K,_getFieldArray:ye,_reset:Nr,_resetDefaultValues:()=>nt(t.defaultValues)&&t.defaultValues().then(y=>{Ht(y,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:re,_disableForm:ho,_subjects:_,_proxyFormState:g,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(y){i=y},get _defaultValues(){return o},get _names(){return c},set _names(y){c=y},get _formState(){return n},get _options(){return t},set _options(y){t={...t,...y},f=ko(t.mode),p=ko(t.reValidateMode),P=t.criteriaMode===Rt.all}},subscribe:an,trigger:lt,register:cn,handleSubmit:Qn,watch:ze,setValue:Ee,setValues:$e,getValues:Le,getErrors:qn,reset:Ht,resetField:ln,resetDefaultValues:(y,O={})=>{if(o=Oe(y),!O.keepDirty){const k=Gt(o,s,void 0,r);n.dirtyFields=k,n.isDirty=!Ve(k)}O.keepIsValid||j(),_.state.next({...n,defaultValues:o})},clearErrors:Rn,unregister:Ir,setError:sn,setFocus:xs,getFieldState:pt};return{...wt,formControl:wt}}const ol={mode:Uo.mode,reValidateMode:Uo.reValidateMode,shouldFocusError:Uo.shouldFocusError,resolver:void 0,criteriaMode:void 0,delayError:void 0,shouldUnregister:void 0,shouldUseNativeValidation:void 0,context:void 0};function d_(e={}){const t=I.useRef(void 0),n=I.useRef(void 0),r=I.useRef(e.formControl),o=I.useRef(!!e.validate),[s,i]=I.useState(()=>({...Oe(Th),isLoading:nt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:nt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl)if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!nt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:p,...v}=u_(e);t.current={...v,formState:s}}const a=t.current.control,c=a._options,u={};for(const p in ol)p in c&&!(p in e)&&(u[p]=ol[p]);a._options={...u,...e,validate:e.validate};const d=()=>({...a._formState,defaultValues:a._defaultValues}),{resyncIfNeeded:l,snapshot:f}=$a(d);return ja(()=>{l(!0,d,i);const p=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return i(v=>({...v,isReady:!0})),a._formState.isReady=!0,()=>{p(),f(!0,d)}},[a,l,f]),I.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),I.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),I.useEffect(()=>{o.current&&!e.validate&&t.current&&t.current.clearErrors(Lr),o.current=!!e.validate},[e.validate]),I.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),I.useEffect(()=>{if(a._proxyFormState.isDirty){const p=a._getDirty();p!==s.isDirty&&a._subjects.state.next({isDirty:p})}},[a,s.isDirty]),I.useEffect(()=>{e.values&&!at(e.values,n.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),a._options.resetOptions&&a._options.resetOptions.keepIsValid||a._setValid(),n.current=e.values,i(p=>({...p}))):a._resetDefaultValues()},[a,e.values]),I.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=I.useMemo(()=>wh(s,a),[a,s]),t.current}const sl=(e,t,n)=>{if(e&&"reportValidity"in e){const r=U(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Mi=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?sl(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>sl(o,n,e))}},il=(e,t)=>{t.shouldUseNativeValidation&&Mi(e,t);const n={};for(const r in e){const o=U(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.refs?o.refs[0]:o&&o.ref});if(f_(t.names||Object.keys(e),r)){const i=Object.assign({},U(n,r));_e(i,"root",s),_e(n,r,i)}else _e(n,r,s)}return n},f_=(e,t)=>{const n=al(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(r=>al(r).match(`^${n}\\.\\d+`))};function al(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function ji(){return ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ji.apply(null,arguments)}function cl(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function h_(e,t){for(var n=Object.create(null);e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a,c,u=r.unionErrors.reduce(function(f,p){return p.errors.length<f.errors.length?p:f}).errors[0];n[i]={message:(a=u==null?void 0:u.message)!=null?a:s,type:(c=u==null?void 0:u.code)!=null?c:o}}else n[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return e.push(p)})}),t){var d=n[i].types,l=d&&d[r.code];n[i]=za(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function p_(e,t){for(var n=Object.create(null),r=function(){var o=e[0],s=o.code,i=o.message,a=o.path.join(".");if(!n[a])if(o.code==="invalid_union"&&o.errors.length>0){var c,u,d=o.errors.reduce(function(p,v){return v.length<p.length?v:p})[0];n[a]={message:(c=d==null?void 0:d.message)!=null?c:i,type:(u=d==null?void 0:d.code)!=null?u:s}}else n[a]={message:i,type:s};if(o.code==="invalid_union"&&o.errors.forEach(function(p){return p.forEach(function(v){return e.push(ji({},v,{path:[].concat(o.path,v.path)}))})}),t){var l=n[a].types,f=l&&l[o.code];n[a]=za(a,t,n,s,f?[].concat(f,o.message):o.message)}e.shift()};e.length;)r();return n}function m_(e,t,n){if(n===void 0&&(n={}),(function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(cl(function(){function i(c){return s.shouldUseNativeValidation&&Mi({},s),{errors:{},values:n.raw?Object.assign({},r):c}}var a=e;return n.mode==="sync"?i(a.parse(r,t)):Promise.resolve(a.parseAsync(r,t)).then(i)},function(i){if((function(a){var c;return!(a==null||(c=a._zod)==null||(c=c.traits)==null||!c.has("$ZodError"))})(i))return{values:{},errors:il(p_(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_def"in r&&typeof r._def=="object"})(e))return function(r,o,s){try{return Promise.resolve(cl(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return s.shouldUseNativeValidation&&Mi({},s),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a==null?void 0:a.issues)})(i))return{values:{},errors:il(h_(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}function $i(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ll(e,t="|"){return e.map(n=>jh(n)).join(t)}function zi(e,t){return typeof t=="bigint"?t.toString():t}class g_{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Fa(e){return new g_(e)}function v_(e){return e==null}function La(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function y_(e,t){const n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}function Gn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ih(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t!=null&&t.get?t.get.raw:t==null?void 0:t.value}function nn(e){return Ih(e._zod.def)??e._zod.def.shape}function Ah(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return Gn(this,t,r),r},enumerable:!0,configurable:!0})}function Nh(e,t,n){t in e?Gn(e,t,n):e[t]=n}function Zn(e,t,n,r){const o=nn(t);for(const s of n){const i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?Ah(e,s,()=>{const a=t._zod.def.shape[s];return r?r(a,s):a}):Nh(e,s,r?r(i.value,s):i.value))}}function b_(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ah(e,n,()=>t[n]):Nh(e,n,r.value))}}function St(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function w_(e){return JSON.stringify(e)}function __(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Dh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const x_=Fa(()=>{var e;if(Bt.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Yr(e){if(Xo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Xo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Mh(e){return Yr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const S_=new Set(["string","number","symbol"]);function ys(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function On(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function oe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jh(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function E_(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const $h={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},C_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function k_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s={};return Zn(s,e,bs(e,t)),On(e,St(n,{shape:s,checks:[]}))}function bs(e,t){var o;const n=nn(e),r=[];for(const s of Reflect.ownKeys(t)){if(!((o=Object.getOwnPropertyDescriptor(n,s))!=null&&o.enumerable))throw new Error(`Unrecognized key: "${String(s)}"`);t[s]&&r.push(s)}return r}function O_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=new Set(bs(e,t)),i={};return Zn(i,e,Reflect.ownKeys(nn(e)).filter(a=>!s.has(a))),On(e,St(n,{shape:i,checks:[]}))}function P_(e,t){if(!Yr(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=nn(e);for(const s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return On(e,St(e._zod.def,{shape:zh(e,t)}))}function zh(e,t){const n={};return Zn(n,e,Reflect.ownKeys(nn(e))),b_(n,t),n}function R_(e,t){if(!Yr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return On(e,St(e._zod.def,{shape:zh(e,t)}))}function T_(e,t){var o,s;if(!((o=t==null?void 0:t._zod)!=null&&o.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((s=e._zod.def.checks)!=null&&s.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};Zn(n,e,Reflect.ownKeys(nn(e))),Zn(n,t,Reflect.ownKeys(nn(t)));const r=St(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return On(e,r)}function ul(e,t,n,r="partial"){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const a=n?new Set(bs(t,n)):void 0,c={};return Zn(c,t,Reflect.ownKeys(nn(t)),e&&((u,d)=>a&&!a.has(d)?u:new e({type:"optional",innerType:u}))),On(t,St(t._zod.def,{shape:c,checks:[]}))}function I_(e,t,n){const r=n?new Set(bs(t,n)):void 0,o={};return Zn(o,t,Reflect.ownKeys(nn(t)),(s,i)=>r&&!r.has(i)?s:new e({type:"nonoptional",innerType:s})),On(t,St(t._zod.def,{shape:o}))}function Jt(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function A_(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Va(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function zr(e){return typeof e=="string"?e:e==null?void 0:e.message}function dl(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const o=r.maximum??r.length??r.size;o>=0&&t.push([o,n])}return t}function Fi(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function Or(e,t,n){var c,u,d,l,f,p,v,g,w,b;var r;const o=(u=(c=e.inst)==null?void 0:c._zod)==null?void 0:u.traits;o!=null&&o.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const s=e.schema!==e.inst?(l=(d=e.schema)==null?void 0:d._zod.def)==null?void 0:l.error:void 0,i=e.message?e.message:zr((v=(p=(f=e.inst)==null?void 0:f._zod.def)==null?void 0:p.error)==null?void 0:v.call(p,e))??zr(s==null?void 0:s(e))??zr((g=t==null?void 0:t.error)==null?void 0:g.call(t,e))??zr((w=n.customError)==null?void 0:w.call(n,e))??zr((b=n.localeError)==null?void 0:b.call(n,e))??"Invalid input",a={};for(const x of Object.keys(e))x==="inst"||x==="schema"||x==="continue"||x==="input"||x==="__proto__"||(a[x]=e[x]);return a.path??(a.path=[]),a.message=i,t!=null&&t.reportInput&&(a.input=e.input),a}const N_=/[\uD800-\uDBFF]/;function Ua(e){const t=e.length;if(!N_.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function Za(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function D_(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Jr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function M_(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):j_(e,n,r.value)}}function kn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ba(e,t,n){return kn(e,t,n,!1)}function Fh(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return kn(this,n,r(this))},set(o){kn(this,n,o)}})}return t}function j_(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:kn(this,t,n.bind(this))},set(r){kn(this,t,r)}})}function $_(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}let Us,pn=!1;const z_={configurable:!0,get(){pn=!0}};function Ce(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&Us!==e._zod){Us=void 0;return}Us=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,z_);const o=pn;pn=!1;try{const s=n(this);return pn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),pn=pn||o,s}catch(s){throw delete this[t],pn=pn||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function F_(e,t,n,r){const o=$_(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){const s={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:s})}})}const L_="~constantCatch";function V_(e){const t=()=>e;return t[L_]=!0,t}var fl;const Zs={value:void 0,enumerable:!1};let hl="captureStackTrace"in Error?Error:null;function U_(e){const t=hl;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return hl=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function M(e,t,n,r){const o={};function s(f){this.def=f,this.constr=l,this.traits=new Set}s.prototype=o;const i=n,a=i&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(e))return}else{Zs.value=new s(p);try{Object.defineProperty(f,"_zod",Zs)}finally{Zs.value=void 0}}if(f._zod.traits.add(e),t(f,p),a){const g=Object.getPrototypeOf(f),w=f._zod.constr.prototype;let b=g;for(;b&&b!==w;)b=Object.getPrototypeOf(b);const x=b??g;a.has(x)||(a.add(x),M_(x,i))}const v=l.prototype;for(const g in v)Object.prototype.hasOwnProperty.call(v,g)&&(g in f||(f[g]=v[g].bind(f)))}const u=(r==null?void 0:r.Parent)??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function l(f){var w;const p=r!=null&&r.Parent?U_(d):this;c(p,f);const v=p._zod.deferred;if(v){for(const b of v)b();p._zod.deferred=void 0}const g=(w=globalThis.__zod_globalConfig)==null?void 0:w.postProcessor;return g&&g(p),p}return Object.defineProperty(l,"init",{value:c}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>{var p,v;return r!=null&&r.Parent&&f instanceof r.Parent?!0:(v=(p=f==null?void 0:f._zod)==null?void 0:p.traits)==null?void 0:v.has(e)}}),Object.defineProperty(l,"name",{value:e}),l}class Vn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lh extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(fl=globalThis).__zod_globalConfig??(fl.__zod_globalConfig={});const Bt=globalThis.__zod_globalConfig;function Pn(e){return e&&Object.assign(Bt,e),Bt}function Z_(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,zi,2)),e.message}function B_(e){this._zod.message=e}const H_={get:Z_,set:B_,enumerable:!0,configurable:!0},Bs={value:void 0,enumerable:!1},pl=new WeakSet([Object.prototype,Error.prototype]),W_=(e,t)=>{e.name="$ZodError",Bs.value=t,Object.defineProperty(e,"issues",Bs),Bs.value=void 0,Object.defineProperty(e,"message",H_);const n=Object.getPrototypeOf(e);pl.has(n)||(pl.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},K_=M("$ZodError",W_);function G_(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function q_(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?G_(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Q_(e,t=n=>n.message){const n={_errors:[]},r=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{const a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,u=0;for(;u<a.length;){const d=a[u],l=u===a.length-1;if(d==="_errors"){l&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,d)||Object.defineProperty(c,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const f=c[d];l&&f._errors.push(t(i)),c=f,u++}}}};return r(e),n}function ws(e,t){return{callee:(t==null?void 0:t.callee)??e,Err:t==null?void 0:t.Err}}const Ha=e=>{const t=(n,r,o,s)=>{const i=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Vn;if(a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Or(u,i,Pn())));throw Dh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Wa=e=>{const t=async(n,r,o,s)=>{const i=o?{...o,async:!0}:{async:!0};let a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Or(u,i,Pn())));throw Dh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Ka=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Vn;return s.issues.length?Vh(e,s.issues,o):{success:!0,data:s.value}};function Vh(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(o=>Or(o,n,Pn()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0}}}const Ga=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?Vh(e,s.issues,o):{success:!0,data:s.value}},Y_=Symbol.for("zod.compile.invalid"),J_=Symbol.for("zod.compile.fallback"),X_=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Y_)return!0;if(r.definite===!0&&n===void 0)return!1}return e1(e,t,n)});function e1(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;let s;if(o?(r[J_]=!0,s=o({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new Vn;return s.issues.length===0}const t1=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length===0},n1=e=>{const t=Ha(e),n=(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return t(r,o,a,ws(n,i))};return n},r1=e=>{const t=Ha(e),n=(r,o,s,i)=>t(r,o,s,ws(n,i));return n},o1=e=>{const t=Wa(e),n=async(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(r,o,a,ws(n,i))};return n},s1=e=>{const t=Wa(e),n=async(r,o,s,i)=>await t(r,o,s,ws(n,i));return n},i1=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ka(e)(t,n,o)},a1=e=>(t,n,r)=>Ka(e)(t,n,r),c1=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ga(e)(t,n,o)},l1=e=>async(t,n,r)=>Ga(e)(t,n,r),u1=/^[cC][0-9a-z]{6,}$/,d1=/^[0-9a-z]+$/,f1=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,h1=/^[0-9a-vA-V]{20}$/,p1=/^[A-Za-z0-9]{27}$/,m1=/^[a-zA-Z0-9_-]{21}$/;function g1(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const v1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,y1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ml=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,b1=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,w1="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function _1(){return new RegExp(w1,"u")}const x1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,S1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,E1=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,C1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,k1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,O1=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,P1=/^https?$/,R1=/^\+[1-9]\d{6,14}$/,Uh="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function T1(e){return new RegExp(`^${e}$`)}const I1=T1(Uh);function Li(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function A1(e){return new RegExp(`^${Li(e)}$`)}function N1(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${Li({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Li({precision:e.precision})}`:n;return new RegExp(`^${Uh}T(?:${r})$`)}const D1=/^[\s\S]{0,}$/,M1=/^-?\d+(?:\.\d+)?$/,j1=/^(?:true|false)$/i,$1=/^[^A-Z]*$/,z1=/^[^a-z]*$/,ht=M("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qa=e=>{const t=e.value;return!v_(t)&&t.length!==void 0},es={number:"number",bigint:"bigint",object:"date"},Zh=M("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);const n=es[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:es[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bh=M("$ZodCheckGreaterThan",(e,t)=>{ht.init(e,t);const n=es[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:es[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),F1=M("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):y_(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),L1=M("$ZodCheckNumberFormat",(e,t)=>{var i;ht.init(e,t),t.format=t.format||"float64";const n=(i=t.format)==null?void 0:i.includes("int"),r=n?"int":"number",[o,s]=$h[t.format];e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),V1=M("$ZodCheckMaxLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>t.maximum?Ua(o):s)<=t.maximum)return;const a=Za(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),U1=M("$ZodCheckMinLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?Ua(o):s)>=t.minimum)return;const a=Za(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Z1=M("$ZodCheckLengthEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?Ua(o):s;if(i===t.length)return;const a=Za(o),c=i>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),_s=M("$ZodCheckStringFormat",(e,t)=>{var n,r;ht.init(e,t),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),B1=M("$ZodCheckRegex",(e,t)=>{_s.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),H1=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$1),_s.init(e,t)}),W1=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=z1),_s.init(e,t)}),K1=M("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);const n=ys(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),G1=M("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);const n=new RegExp(`^${ys(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),q1=M("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);const n=new RegExp(`.*${ys(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function gl(e,t,n){e.issues.length&&t.issues.push(...Va(n,e.issues))}const Q1=M("$ZodCheckProperties",(e,t)=>{ht.init(e,t),Ba(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(i=>[i,t.shape[i]]));const o=r.value;let s;for(const[i,a]of n){const c=a._zod.run({value:o[i],issues:[]},{});c instanceof Promise?(s??(s=[]),s.push(c.then(u=>gl(u,r,i)))):gl(c,r,i)}if(s)return Promise.all(s).then(()=>{})}}),Y1=M("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class J1{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
192
|
+
`)},Uy=0,Jn=[];function Zy(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(Uy++)[0],s=h.useState(Id)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=uy([e.lockRef.current],(e.shards||[]).map(Nc),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var b=wo(g),x=n.current,_="deltaX"in g?g.deltaX:x[0]-b[0],C="deltaY"in g?g.deltaY:x[1]-b[1],S,P=g.target,R=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in g&&R==="h"&&P.type==="range")return!1;var T=window.getSelection(),A=T&&T.anchorNode,j=A?A===P||A.contains(P):!1;if(j)return!1;var F=Ic(R,P);if(!F)return!0;if(F?S=R:(S=R==="v"?"h":"v",F=Ic(R,P)),!F)return!1;if(!r.current&&"changedTouches"in g&&(_||C)&&(r.current=S),!S)return!0;var z=r.current||S;return Fy(z,w,g,z==="h"?_:C)},[]),c=h.useCallback(function(g){var w=g;if(!(!Jn.length||Jn[Jn.length-1]!==s)){var b="deltaY"in w?Ac(w):wo(w),x=t.current.filter(function(S){return S.name===w.type&&(S.target===w.target||w.target===S.shadowParent)&&Ly(S.delta,b)})[0];if(x&&x.should){w.cancelable&&w.preventDefault();return}if(!x){var _=(i.current.shards||[]).map(Nc).filter(Boolean).filter(function(S){return S.contains(w.target)}),C=_.length>0?a(w,_[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),u=h.useCallback(function(g,w,b,x){var _={name:g,delta:w,target:b,should:x,shadowParent:By(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),d=h.useCallback(function(g){n.current=wo(g),r.current=void 0},[]),l=h.useCallback(function(g){u(g.type,Ac(g),g.target,a(g,e.lockRef.current))},[]),f=h.useCallback(function(g){u(g.type,wo(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return Jn.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Yn),document.addEventListener("touchmove",c,Yn),document.addEventListener("touchstart",d,Yn),function(){Jn=Jn.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,Yn),document.removeEventListener("touchmove",c,Yn),document.removeEventListener("touchstart",d,Yn)}},[]);var p=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(s,{styles:Vy(o)}):null,p?h.createElement(Ay,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function By(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Hy=by(Td,Zy);var ma=h.forwardRef(function(e,t){return h.createElement(cs,Ut({},e,{ref:t,sideCar:Hy}))});ma.classNames=cs.classNames;var Wy=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xn=new WeakMap,_o=new WeakMap,xo={},js=0,Md=function(e){return e&&(e.host||Md(e.parentNode))},Ky=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Md(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Gy=function(e,t,n,r){var o=Ky(t,Array.isArray(e)?e:[e]);xo[n]||(xo[n]=new WeakMap);var s=xo[n],i=[],a=new Set,c=new Set(o),u=function(l){!l||a.has(l)||(a.add(l),u(l.parentNode))};o.forEach(u);var d=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(f){if(a.has(f))d(f);else try{var p=f.getAttribute(r),v=p!==null&&p!=="false",g=(Xn.get(f)||0)+1,w=(s.get(f)||0)+1;Xn.set(f,g),s.set(f,w),i.push(f),g===1&&v&&_o.set(f,!0),w===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),a.clear(),js++,function(){i.forEach(function(l){var f=Xn.get(l)-1,p=s.get(l)-1;Xn.set(l,f),s.set(l,p),f||(_o.has(l)||l.removeAttribute(r),_o.delete(l)),p||l.removeAttribute(n)}),js--,js||(Xn=new WeakMap,Xn=new WeakMap,_o=new WeakMap,xo={})}},jd=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Wy(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Gy(r,o,n,"aria-hidden")):function(){return null}},qy=Object.defineProperty,bt=(e,t)=>qy(e,"name",{value:t,configurable:!0}),ga="Dialog",[$d,C2]=nn(ga),[Qy,jt]=$d(ga),Yy=bt(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=h.useRef(null),c=h.useRef(null),{nodes:u,registry:d}=ua(),[l,f]=ao({prop:r,defaultProp:o??!1,onChange:s,caller:ga}),[p,v]=h.useState(0),[g,w]=h.useState(0);return m.jsx(Qy,{scope:t,triggerRef:a,contentRef:c,contentId:En(),titleId:En(),descriptionId:En(),titlePresent:p>0,descriptionPresent:g>0,setTitleCount:v,setDescriptionCount:w,open:l,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(b=>!b),[f]),modal:i,branchNodes:u,branchRegistry:d,children:n})},"Dialog"),Jy="DialogTrigger",k2=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(Jy,r),i=Te(n,s.triggerRef);return m.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":ls(s.open),...o,ref:i,onClick:de(t.onClick,s.onOpenToggle)})},"DialogTrigger")),zd="DialogPortal",[Xy,Fd]=$d(zd,{forceMount:void 0}),eb=bt(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=jt(zd,t);return m.jsx(Xy,{scope:t,forceMount:n,children:h.Children.map(r,i=>m.jsx(rn,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),bi="DialogOverlay",Ld=h.forwardRef(bt(function(t,n){const r=Fd(bi,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=jt(bi,t.__scopeDialog);return i.modal?m.jsx(rn,{present:o||i.open,children:m.jsx(nb,{...s,ref:n})}):null},"DialogOverlay")),tb=Jt("DialogOverlay.RemoveScroll"),nb=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(bi,r),i=hd(),a=Te(n,i);return m.jsx(ma,{as:tb,allowPinchZoom:!0,shards:h.useMemo(()=>[s.contentRef,...s.branchNodes.map(c=>({current:c}))],[s.contentRef,s.branchNodes]),children:m.jsx(Ze.div,{"data-state":ls(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Kr="DialogContent",Vd=h.forwardRef(bt(function(t,n){const r=Fd(Kr,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=jt(Kr,t.__scopeDialog);return m.jsx(rn,{present:o||i.open,children:i.modal?m.jsx(rb,{...s,ref:n}):m.jsx(ob,{...s,ref:n})})},"DialogContent")),rb=h.forwardRef(bt(function(t,n){const r=jt(Kr,t.__scopeDialog),o=h.useRef(null),s=Te(n,r.contentRef,o);return h.useEffect(()=>{const i=o.current;if(i)return jd(i)},[]),m.jsx(Ud,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:de(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:de(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:de(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),ob=h.forwardRef(bt(function(t,n){const r=jt(Kr,t.__scopeDialog),o=h.useRef(!1),s=h.useRef(!1);return m.jsx(Ud,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Ud=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,"aria-describedby":a,children:c,...u}=t,d=jt(Kr,r);return as(),m.jsx(la,{registry:d.branchRegistry,children:m.jsx(gd,{asChild:!0,loop:!0,trapped:o,branches:d.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:i,children:m.jsx(aa,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?Hd(a,d.descriptionId):a,"data-state":ls(d.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:c})})})},"DialogContentImpl")),Zd=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt("DialogTitle",r),{setTitleCount:i}=s;return ct(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Ze.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),Bd=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt("DialogDescription",r),{setDescriptionCount:i}=s;return ct(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Ze.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),sb="DialogClose",ib=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(sb,r);return m.jsx(Ze.button,{type:"button",...o,ref:n,onClick:de(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Hd(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}bt(Hd,"concatAriaDescribedby");function ls(e){return e?"open":"closed"}bt(ls,"getState");const ab=Yy,cb=eb,Wd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("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",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Ld,{className:s,...o,ref:t}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Wd.displayName=Ld.displayName;const lb=so("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{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"}}),Kd=h.forwardRef((e,t)=>{const n=ee.c(15);let r,o,s,i;n[0]!==e?({side:i,className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=i===void 0?"right":i;let c;n[5]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(Wd,{}),n[5]=c):c=n[5];let u;n[6]!==o||n[7]!==a?(u=ce(lb({side:a}),o),n[6]=o,n[7]=a,n[8]=u):u=n[8];let d;n[9]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsxs(ib,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[m.jsx(hg,{className:"h-4 w-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]}),n[9]=d):d=n[9];let l;return n[10]!==r||n[11]!==s||n[12]!==t||n[13]!==u?(l=m.jsxs(cb,{children:[c,m.jsxs(Vd,{ref:t,className:u,...s,children:[r,d]})]}),n[10]=r,n[11]=s,n[12]=t,n[13]=u,n[14]=l):l=n[14],l});Kd.displayName=Vd.displayName;const Gd=e=>{const t=ee.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=ce("flex flex-col space-y-2 text-center sm:text-left",n),t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==r||t[6]!==o?(s=m.jsx("div",{className:o,...r}),t[5]=r,t[6]=o,t[7]=s):s=t[7],s};Gd.displayName="SheetHeader";const qd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-lg font-semibold text-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Zd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});qd.displayName=Zd.displayName;const Qd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Bd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Qd.displayName=Bd.displayName;function Dc(e){const t=ee.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=ce("animate-pulse rounded-md bg-muted",n),t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==r||t[6]!==o?(s=m.jsx("div",{className:o,...r}),t[5]=r,t[6]=o,t[7]=s):s=t[7],s}var ub=Object.defineProperty,db=(e,t)=>ub(e,"name",{value:t,configurable:!0});function Yd(e){const[t,n]=h.useState(void 0);return ct(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let r=0;const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let a,c;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,c=d.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})})});return o.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}else n(void 0)},[e]),t}db(Yd,"useSize");var fb=Object.defineProperty,Cn=(e,t)=>fb(e,"name",{value:t,configurable:!0}),Mc={Partial:"partial"},jc={Optimized:"optimized",Always:"always"},Jd="Popper",[Xd,us]=nn(Jd),[hb,ef]=Xd(Jd),tf=Cn(e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null),[s,i]=h.useState(void 0);return m.jsx(hb,{scope:t,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),pb="PopperAnchor",nf=h.forwardRef(Cn(function(t,n){const{__scopePopper:r,virtualRef:o,...s}=t,i=ef(pb,r),a=h.useRef(null),c=i.onAnchorChange,u=h.useCallback(g=>{a.current=g,g&&c(g)},[c]),d=Te(n,u),l=h.useRef(null);h.useEffect(()=>{if(!o)return;const g=l.current;l.current=o.current,g!==l.current&&c(l.current)});const f=i.placementState&&ds(i.placementState),p=f==null?void 0:f[0],v=f==null?void 0:f[1];return o?null:m.jsx(Ze.div,{"data-radix-popper-side":p,"data-radix-popper-align":v,...s,ref:d})},"PopperAnchor")),rf="PopperContent",[mb,O2]=Xd(rf),of=h.forwardRef(Cn(function(t,n){var le,Pe,je,Ee,$e,We,kt;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:l=0,sticky:f=Mc.Partial,hideWhenDetached:p=!1,updatePositionStrategy:v=jc.Optimized,onPlaced:g,...w}=t,b=ef(rf,r),[x,_]=h.useState(null),C=Te(n,_),[S,P]=h.useState(null),R=Yd(S),T=(R==null?void 0:R.width)??0,A=(R==null?void 0:R.height)??0,j=o+(i!=="center"?"-"+i:""),F=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},z=Array.isArray(d)?d:[d],Y=z.length>0,Z={padding:F,boundary:z.filter(sf),altBoundary:Y},{refs:K,floatingStyles:H,placement:J,isPositioned:ne,middlewareData:te}=Ip({strategy:"fixed",placement:j,whileElementsMounted:Cn((...lt)=>Fp(...lt,{animationFrame:v===jc.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[Ap({mainAxis:s+A,alignmentAxis:a}),u&&Np({mainAxis:!0,crossAxis:!1,...f===Mc.Partial?{limiter:zp()}:{},...Z}),u&&Dp({...Z}),Mp({...Z,apply:Cn(({elements:lt,rects:Le,availableWidth:qn,availableHeight:pt})=>{const{width:Rn,height:on}=Le.reference,ze=lt.floating.style;ze.setProperty("--radix-popper-available-width",`${qn}px`),ze.setProperty("--radix-popper-available-height",`${pt}px`),ze.setProperty("--radix-popper-anchor-width",`${Rn}px`),ze.setProperty("--radix-popper-anchor-height",`${on}px`)},"apply")}),S&&jp({element:S,padding:c}),gb({arrowWidth:T,arrowHeight:A}),p&&$p(Y?{strategy:"referenceHidden",...Z}:{strategy:"referenceHidden",padding:Z.padding,altBoundary:Z.altBoundary})]}),X=b.setPlacementState;ct(()=>(X(J),()=>{X(void 0)}),[J,X]);const[q,me]=ds(J),he=Xt(g);ct(()=>{ne&&(he==null||he())},[ne,he]);const ae=(le=te.arrow)==null?void 0:le.x,re=(Pe=te.arrow)==null?void 0:Pe.y,B=((je=te.arrow)==null?void 0:je.centerOffset)!==0,[se,ye]=h.useState();return ct(()=>{x&&ye(window.getComputedStyle(x).zIndex)},[x]),m.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ne?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Ee=te.transformOrigin)==null?void 0:Ee.x,($e=te.transformOrigin)==null?void 0:$e.y].join(" "),...((We=te.hide)==null?void 0:We.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(mb,{scope:r,placedSide:q,placedAlign:me,onArrowChange:P,arrowX:ae,arrowY:re,shouldHideArrow:B,children:m.jsx(Ze.div,{"data-side":q,"data-align":me,...w,ref:C,style:{...w.style,animation:ne?(kt=w.style)==null?void 0:kt.animation:"none"}})})})},"PopperContent"));function sf(e){return e!==null}Cn(sf,"isNotNull");var gb=Cn(e=>({name:"transformOrigin",options:e,fn(t){var w,b,x;const{placement:n,rects:r,middlewareData:o}=t,i=((w=o.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=ds(n),l={start:"0%",center:"50%",end:"100%"}[d],f=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+c/2;let v="",g="";return u==="bottom"?(v=i?l:`${f}px`,g=`${-c}px`):u==="top"?(v=i?l:`${f}px`,g=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,g=i?l:`${p}px`):u==="left"&&(v=`${r.floating.width+c}px`,g=i?l:`${p}px`),{data:{x:v,y:g}}}}),"transformOrigin");function ds(e){const[t,n="center"]=e.split("-");return[t,n]}Cn(ds,"getSideAndAlignFromPlacement");var vb=Object.defineProperty,yb=(e,t)=>vb(e,"name",{value:t,configurable:!0}),bb=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wb=h.forwardRef(yb(function(t,n){return m.jsx(Ze.span,{...t,ref:n,style:{...bb,...t.style}})},"VisuallyHidden")),_b=Object.defineProperty,Ye=(e,t)=>_b(e,"name",{value:t,configurable:!0}),[va,P2]=nn("Tooltip",[us]),ya=us(),xb="TooltipProvider",Sb=700,wi="tooltip.open",[Eb,ba]=va(xb),Cb=Ye(e=>{const{__scopeTooltip:t,delayDuration:n=Sb,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=h.useRef(!0),a=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.jsx(Eb,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:h.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),_i="Tooltip",[kb,co]=va(_i),Ob=Ye(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=ba(_i,e.__scopeTooltip),u=ya(t),[d,l]=h.useState(null),[f,p]=h.useState(void 0),v=En(),g=h.useRef(0),w=i??c.disableHoverableContent,b=a??c.delayDuration,x=h.useRef(!1),[_,C]=ao({prop:r,defaultProp:o??!1,onChange:Ye(j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(wi))):c.onClose(),s==null||s(j)},"onChange"),caller:_i}),S=h.useMemo(()=>_?x.current?"delayed-open":"instant-open":"closed",[_]),P=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,C(!0)},[C]),R=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),T=h.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,C(!0),g.current=0},b)},[b,C]);h.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const A=f??v;return m.jsx(tf,{...u,children:m.jsx(kb,{scope:t,contentId:A,setContentId:p,open:_,stateAttribute:S,trigger:d,onTriggerChange:l,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?T():P()},[c.isOpenDelayedRef,T,P]),onTriggerLeave:h.useCallback(()=>{w?R():(window.clearTimeout(g.current),g.current=0)},[R,w]),onOpen:P,onClose:R,disableHoverableContent:w,children:n})})},"Tooltip"),$c="TooltipTrigger",Pb=h.forwardRef(Ye(function(t,n){const{__scopeTooltip:r,"aria-describedby":o,...s}=t,i=co($c,r),a=ba($c,r),c=ya(r),u=h.useRef(null),d=Te(n,u,i.onTriggerChange),l=h.useRef(!1),f=h.useRef(!1),p=h.useCallback(()=>l.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),m.jsx(nf,{asChild:!0,...c,children:m.jsx(Ze.button,{"aria-describedby":i.open?gf(o,i.contentId):o,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:de(t.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:de(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:de(t.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:de(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:de(t.onBlur,i.onClose),onClick:de(t.onClick,i.onClose)})})},"TooltipTrigger")),af="TooltipPortal",[Rb,Tb]=va(af,{forceMount:void 0}),Ib=Ye(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=co(af,t);return m.jsx(Rb,{scope:t,forceMount:n,children:m.jsx(rn,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Gr="TooltipContent",cf=h.forwardRef(Ye(function(t,n){const r=Tb(Gr,t.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=t,a=co(Gr,t.__scopeTooltip);return m.jsx(rn,{present:o||a.open,children:a.disableHoverableContent?m.jsx(lf,{side:s,...i,ref:n}):m.jsx(Ab,{side:s,...i,ref:n})})},"TooltipContent")),Ab=h.forwardRef(Ye(function(t,n){const r=co(Gr,t.__scopeTooltip),o=ba(Gr,t.__scopeTooltip),s=h.useRef(null),i=Te(n,s),[a,c]=h.useState(null),{trigger:u,onClose:d}=r,l=s.current,{onPointerInTransitChange:f}=o,p=h.useCallback(()=>{c(null),f(!1)},[f]),v=h.useCallback((g,w)=>{const b=g.currentTarget,x={x:g.clientX,y:g.clientY},_=uf(x,b.getBoundingClientRect()),C=df(x,_),S=ff(w.getBoundingClientRect()),P=pf([...C,...S]);c(P),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(u&&l){const g=Ye(b=>v(b,l),"handleTriggerLeave"),w=Ye(b=>v(b,u),"handleContentLeave");return u.addEventListener("pointerleave",g),l.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",g),l.removeEventListener("pointerleave",w)}}},[u,l,v,p]),h.useEffect(()=>{if(a){const g=Ye(w=>{const b=w.target,x={x:w.clientX,y:w.clientY},_=(u==null?void 0:u.contains(b))||(l==null?void 0:l.contains(b)),C=!hf(x,a);_?p():C&&(p(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,l,a,d,p]),m.jsx(lf,{...t,ref:i})},"TooltipContentHoverable")),Nb=Vu("TooltipContent"),lf=h.forwardRef(Ye(function(t,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=t,d=co(Gr,r),l=ya(r),{onClose:f}=d,[p,v]=h.useState(null),g=Te(n,v);da(p),h.useEffect(()=>(document.addEventListener(wi,f),()=>document.removeEventListener(wi,f)),[f]),h.useEffect(()=>{if(d.trigger){const b=Ye(x=>{x.target instanceof Node&&x.target.contains(d.trigger)&&f()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[d.trigger,f]);const{setContentId:w}=d;return ct(()=>(w(i),()=>{w(void 0)}),[i,w]),m.jsx(aa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:b=>b.preventDefault(),onDismiss:f,children:m.jsxs(of,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...l,...u,ref:g,style:{...u.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:[m.jsx(Nb,{children:o}),s?m.jsx(wb,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function uf(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Ye(uf,"getExitSideFromRect");function df(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}Ye(df,"getPaddedExitPoints");function ff(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}Ye(ff,"getPointsFromRect");function hf(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}Ye(hf,"isPointInPolygon");function pf(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),mf(t)}Ye(pf,"getHull");function mf(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ye(mf,"getHullPresorted");function gf(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Ye(gf,"concatAriaDescribedby");const Db=Cb,Mb=Ob,jb=Pb,vf=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,sideOffset:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?4:s;let a;n[4]!==r?(a=ce("z-[50] overflow-hidden rounded-lg bg-foreground/85 px-[7px] py-1.5 text-[11px] text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==a?(c=m.jsx(Ib,{children:m.jsx(cf,{ref:t,sideOffset:i,"data-slot":"tooltip-content",className:a,...o})}),n[6]=o,n[7]=t,n[8]=i,n[9]=a,n[10]=c):c=n[10],c});vf.displayName=cf.displayName;const $b="sidebar_state",zb=3600*24*7,Fb="16rem",Lb="18rem",Vb="3rem",Ub="b",yf=h.createContext(null);function lo(){const e=h.useContext(yf);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const bf=h.forwardRef((e,t)=>{const n=ee.c(37);let r,o,s,i,a,c,u;n[0]!==e?({defaultOpen:u,open:s,onOpenChange:a,className:o,style:c,children:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c,n[7]=u):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6],u=n[7]);const d=u===void 0?!0:u,l=Jg(),[f,p]=h.useState(!1),[v,g]=h.useState(d),w=s??v;let b;n[8]!==w||n[9]!==a?(b=K=>{const H=typeof K=="function"?K(w):K;a?a(H):g(H),document.cookie=`${$b}=${H}; path=/; max-age=${zb}`},n[8]=w,n[9]=a,n[10]=b):b=n[10];const x=b;let _;n[11]!==l||n[12]!==x?(_=()=>l?p(ew):x(tw),n[11]=l,n[12]=x,n[13]=_):_=n[13];const C=_;let S,P;n[14]!==C?(S=()=>{const K=H=>{H.key===Ub&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),C())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},P=[C],n[14]=C,n[15]=S,n[16]=P):(S=n[15],P=n[16]),h.useEffect(S,P);const R=w?"expanded":"collapsed";let T;n[17]!==l||n[18]!==w||n[19]!==f||n[20]!==x||n[21]!==R||n[22]!==C?(T={state:R,open:w,setOpen:x,isMobile:l,openMobile:f,setOpenMobile:p,toggleSidebar:C},n[17]=l,n[18]=w,n[19]=f,n[20]=x,n[21]=R,n[22]=C,n[23]=T):T=n[23];const A=T;let j;n[24]!==c?(j={"--sidebar-width":Fb,"--sidebar-width-icon":Vb,...c},n[24]=c,n[25]=j):j=n[25];const F=j;let z;n[26]!==o?(z=ce("group/sidebar-wrapper flex h-svh w-full has-[[data-variant=inset]]:bg-sidebar",o),n[26]=o,n[27]=z):z=n[27];let Y;n[28]!==r||n[29]!==i||n[30]!==t||n[31]!==F||n[32]!==z?(Y=m.jsx(Db,{delayDuration:0,children:m.jsx("div",{style:F,className:z,ref:t,...i,children:r})}),n[28]=r,n[29]=i,n[30]=t,n[31]=F,n[32]=z,n[33]=Y):Y=n[33];let Z;return n[34]!==A||n[35]!==Y?(Z=m.jsx(yf.Provider,{value:A,children:Y}),n[34]=A,n[35]=Y,n[36]=Z):Z=n[36],Z});bf.displayName="SidebarProvider";const wf=h.forwardRef((e,t)=>{const n=ee.c(48);let r,o,s,i,a,c;n[0]!==e?({side:i,variant:a,collapsible:c,className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6]);const u=i===void 0?"left":i,d=a===void 0?"sidebar":a,l=c===void 0?"offcanvas":c,{isMobile:f,state:p,openMobile:v,setOpenMobile:g}=lo();if(l==="none"){let j;n[7]!==o?(j=ce("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),n[7]=o,n[8]=j):j=n[8];let F;return n[9]!==r||n[10]!==s||n[11]!==t||n[12]!==j?(F=m.jsx("div",{className:j,ref:t,...s,children:r}),n[9]=r,n[10]=s,n[11]=t,n[12]=j,n[13]=F):F=n[13],F}if(f){let j;n[14]===Symbol.for("react.memo_cache_sentinel")?(j={"--sidebar-width":Lb},n[14]=j):j=n[14];let F;n[15]===Symbol.for("react.memo_cache_sentinel")?(F=m.jsxs(Gd,{className:"sr-only",children:[m.jsx(qd,{children:"Sidebar"}),m.jsx(Qd,{children:"Displays the mobile sidebar."})]}),n[15]=F):F=n[15];let z;n[16]!==r?(z=m.jsx("div",{className:"flex h-full w-full flex-col",children:r}),n[16]=r,n[17]=z):z=n[17];let Y;n[18]!==u||n[19]!==z?(Y=m.jsxs(Kd,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:j,side:u,children:[F,z]}),n[18]=u,n[19]=z,n[20]=Y):Y=n[20];let Z;return n[21]!==v||n[22]!==s||n[23]!==g||n[24]!==Y?(Z=m.jsx(ab,{open:v,onOpenChange:g,...s,children:Y}),n[21]=v,n[22]=s,n[23]=g,n[24]=Y,n[25]=Z):Z=n[25],Z}const w=p==="collapsed"?l:"",b=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]";let x;n[26]!==b?(x=ce("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",b),n[26]=b,n[27]=x):x=n[27];let _;n[28]!==x?(_=m.jsx("div",{className:x}),n[28]=x,n[29]=_):_=n[29];const C=u==="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)]",S=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l";let P;n[30]!==o||n[31]!==C||n[32]!==S?(P=ce("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",C,S,o),n[30]=o,n[31]=C,n[32]=S,n[33]=P):P=n[33];let R;n[34]!==r?(R=m.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",children:r}),n[34]=r,n[35]=R):R=n[35];let T;n[36]!==s||n[37]!==P||n[38]!==R?(T=m.jsx("div",{className:P,...s,children:R}),n[36]=s,n[37]=P,n[38]=R,n[39]=T):T=n[39];let A;return n[40]!==t||n[41]!==u||n[42]!==p||n[43]!==T||n[44]!==w||n[45]!==_||n[46]!==d?(A=m.jsxs("div",{ref:t,className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":w,"data-variant":d,"data-side":u,children:[_,T]}),n[40]=t,n[41]=u,n[42]=p,n[43]=T,n[44]=w,n[45]=_,n[46]=d,n[47]=A):A=n[47],A});wf.displayName="Sidebar";const _f=h.forwardRef((e,t)=>{const n=ee.c(16);let r,o,s;n[0]!==e?({className:r,onClick:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const{toggleSidebar:i}=lo();let a;n[4]!==r?(a=ce("h-7 w-7",r),n[4]=r,n[5]=a):a=n[5];let c;n[6]!==o||n[7]!==i?(c=f=>{o==null||o(f),i()},n[6]=o,n[7]=i,n[8]=c):c=n[8];let u,d;n[9]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(cg,{}),d=m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),n[9]=u,n[10]=d):(u=n[9],d=n[10]);let l;return n[11]!==s||n[12]!==t||n[13]!==a||n[14]!==c?(l=m.jsxs(is,{ref:t,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:a,onClick:c,...s,children:[u,d]}),n[11]=s,n[12]=t,n[13]=a,n[14]=c,n[15]=l):l=n[15],l});_f.displayName="SidebarTrigger";const Zb=h.forwardRef((e,t)=>{const n=ee.c(10);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const{toggleSidebar:s}=lo();let i;n[3]!==r?(i=ce("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","[[data-side=left]_&]:cursor-w-resize [[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 group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",r),n[3]=r,n[4]=i):i=n[4];let a;return n[5]!==o||n[6]!==t||n[7]!==i||n[8]!==s?(a=m.jsx("button",{ref:t,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:i,...o}),n[5]=o,n[6]=t,n[7]=i,n[8]=s,n[9]=a):a=n[9],a});Zb.displayName="SidebarRail";const xf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("main",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});xf.displayName="SidebarInset";const Bb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Go,{ref:t,"data-sidebar":"input",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Bb.displayName="SidebarInput";const Sf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col gap-2 p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"header",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Sf.displayName="SidebarHeader";const Ef=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col gap-2 p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"footer",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Ef.displayName="SidebarFooter";const Hb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("mx-2 w-auto bg-sidebar-border",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(qo,{ref:t,"data-sidebar":"separator",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Hb.displayName="SidebarSeparator";const Cf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"content",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Cf.displayName="SidebarContent";const Mo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("relative flex w-full min-w-0 flex-col p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"group",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Mo.displayName="SidebarGroup";const xi=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,asChild:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const a=(s===void 0?!1:s)?xr:"div";let c;n[4]!==r?(c=ce("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",r),n[4]=r,n[5]=c):c=n[5];let u;return n[6]!==a||n[7]!==o||n[8]!==t||n[9]!==c?(u=m.jsx(a,{ref:t,"data-sidebar":"group-label",className:c,...o}),n[6]=a,n[7]=o,n[8]=t,n[9]=c,n[10]=u):u=n[10],u});xi.displayName="SidebarGroupLabel";const Wb=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,asChild:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const a=(s===void 0?!1:s)?xr:"button";let c;n[4]!==r?(c=ce("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none 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 after:md:hidden","group-data-[collapsible=icon]:hidden",r),n[4]=r,n[5]=c):c=n[5];let u;return n[6]!==a||n[7]!==o||n[8]!==t||n[9]!==c?(u=m.jsx(a,{ref:t,"data-sidebar":"group-action",className:c,...o}),n[6]=a,n[7]=o,n[8]=t,n[9]=c,n[10]=u):u=n[10],u});Wb.displayName="SidebarGroupAction";const jo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("w-full text-sm",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"group-content",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});jo.displayName="SidebarGroupContent";const $o=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex w-full min-w-0 flex-col gap-1",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("ul",{ref:t,"data-sidebar":"menu",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});$o.displayName="SidebarMenu";const zo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("group/menu-item relative",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("li",{ref:t,"data-sidebar":"menu-item",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});zo.displayName="SidebarMenuItem";const Kb=so("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none 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"}}),Fo=h.forwardRef((e,t)=>{const n=ee.c(29);let r,o,s,i,a,c,u;n[0]!==e?({asChild:s,isActive:i,variant:a,size:c,tooltip:u,className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c,n[7]=u):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6],u=n[7]);const d=s===void 0?!1:s,l=i===void 0?!1:i,f=a===void 0?"default":a,p=c===void 0?"default":c,v=d?xr:"button",{isMobile:g,state:w}=lo();let b;n[8]!==r||n[9]!==p||n[10]!==f?(b=ce(Kb({variant:f,size:p}),r),n[8]=r,n[9]=p,n[10]=f,n[11]=b):b=n[11];let x;n[12]!==v||n[13]!==l||n[14]!==o||n[15]!==t||n[16]!==p||n[17]!==b?(x=m.jsx(v,{ref:t,"data-sidebar":"menu-button","data-size":p,"data-active":l,className:b,...o}),n[12]=v,n[13]=l,n[14]=o,n[15]=t,n[16]=p,n[17]=b,n[18]=x):x=n[18];const _=x;if(!u)return _;if(typeof u=="string"){let T;n[19]!==u?(T={children:u},n[19]=u,n[20]=T):T=n[20],u=T}let C;n[21]!==_?(C=m.jsx(jb,{asChild:!0,children:_}),n[21]=_,n[22]=C):C=n[22];const S=w!=="collapsed"||g;let P;n[23]!==S||n[24]!==u?(P=m.jsx(vf,{side:"right",align:"center",hidden:S,...u}),n[23]=S,n[24]=u,n[25]=P):P=n[25];let R;return n[26]!==C||n[27]!==P?(R=m.jsxs(Mb,{children:[C,P]}),n[26]=C,n[27]=P,n[28]=R):R=n[28],R});Fo.displayName="SidebarMenuButton";const Gb=h.forwardRef((e,t)=>{const n=ee.c(13);let r,o,s,i;n[0]!==e?({className:r,asChild:s,showOnHover:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s===void 0?!1:s,c=i===void 0?!1:i,u=a?xr:"button",d=c&&"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";let l;n[5]!==r||n[6]!==d?(l=ce("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none 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 after:md: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",d,r),n[5]=r,n[6]=d,n[7]=l):l=n[7];let f;return n[8]!==u||n[9]!==o||n[10]!==t||n[11]!==l?(f=m.jsx(u,{ref:t,"data-sidebar":"menu-action",className:l,...o}),n[8]=u,n[9]=o,n[10]=t,n[11]=l,n[12]=f):f=n[12],f});Gb.displayName="SidebarMenuAction";const qb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","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",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"menu-badge",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});qb.displayName="SidebarMenuBadge";const Qb=h.forwardRef((e,t)=>{const n=ee.c(15);let r,o,s;n[0]!==e?({className:r,showIcon:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?!1:s,a=`${Math.floor(Math.random()*40)+50}%`;let c;n[4]!==r?(c=ce("flex h-8 items-center gap-2 rounded-md px-2",r),n[4]=r,n[5]=c):c=n[5];let u;n[6]!==i?(u=i&&m.jsx(Dc,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),n[6]=i,n[7]=u):u=n[7];let d;n[8]===Symbol.for("react.memo_cache_sentinel")?(d={"--skeleton-width":a},n[8]=d):d=n[8];let l;n[9]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(Dc,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:d}),n[9]=l):l=n[9];let f;return n[10]!==o||n[11]!==t||n[12]!==c||n[13]!==u?(f=m.jsxs("div",{ref:t,"data-sidebar":"menu-skeleton",className:c,...o,children:[u,l]}),n[10]=o,n[11]=t,n[12]=c,n[13]=u,n[14]=f):f=n[14],f});Qb.displayName="SidebarMenuSkeleton";const Yb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("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",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("ul",{ref:t,"data-sidebar":"menu-sub",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Yb.displayName="SidebarMenuSub";const Jb=h.forwardRef((e,t)=>{const n=ee.c(5);let r;n[0]!==e?({...r}=e,n[0]=e,n[1]=r):r=n[1];let o;return n[2]!==r||n[3]!==t?(o=m.jsx("li",{ref:t,...r}),n[2]=r,n[3]=t,n[4]=o):o=n[4],o});Jb.displayName="SidebarMenuSubItem";const Xb=h.forwardRef((e,t)=>{const n=ee.c(17);let r,o,s,i,a;n[0]!==e?({asChild:i,size:a,isActive:o,className:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5]);const c=i===void 0?!1:i,u=a===void 0?"md":a,d=c?xr:"a",l=u==="sm"&&"text-xs",f=u==="md"&&"text-sm";let p;n[6]!==r||n[7]!==l||n[8]!==f?(p=ce("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none 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",l,f,"group-data-[collapsible=icon]:hidden",r),n[6]=r,n[7]=l,n[8]=f,n[9]=p):p=n[9];let v;return n[10]!==d||n[11]!==o||n[12]!==s||n[13]!==t||n[14]!==u||n[15]!==p?(v=m.jsx(d,{ref:t,"data-sidebar":"menu-sub-button","data-size":u,"data-active":o,className:p,...s}),n[10]=d,n[11]=o,n[12]=s,n[13]=t,n[14]=u,n[15]=p,n[16]=v):v=n[16],v});Xb.displayName="SidebarMenuSubButton";function ew(e){return!e}function tw(e){return!e}var nw=Object.defineProperty,Qe=(e,t)=>nw(e,"name",{value:t,configurable:!0});function wa(e){const t=e+"CollectionProvider",[n,r]=nn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=Qe(g=>{const{scope:w,children:b}=g,x=h.useRef(null),_=h.useRef(new Map).current;return m.jsx(o,{scope:w,itemMap:_,collectionRef:x,children:b})},"CollectionProvider");i.displayName=t;const a=e+"CollectionSlot",c=Jt(a),u=h.forwardRef((g,w)=>{const{scope:b,children:x}=g,_=s(a,b),C=Te(w,_.collectionRef);return m.jsx(c,{ref:C,children:x})});u.displayName=a;const d=e+"CollectionItemSlot",l="data-radix-collection-item",f=Jt(d),p=h.forwardRef((g,w)=>{const{scope:b,children:x,..._}=g,C=h.useRef(null),S=Te(w,C),P=s(d,b);return h.useEffect(()=>(P.itemMap.set(C,{ref:C,..._}),()=>void P.itemMap.delete(C))),m.jsx(f,{[l]:"",ref:S,children:x})});p.displayName=d;function v(g){const w=s(e+"CollectionConsumer",g);return h.useCallback(()=>{const x=w.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${l}]`));return Array.from(w.itemMap.values()).sort((P,R)=>_.indexOf(P.ref.current)-_.indexOf(R.ref.current))},[w.collectionRef,w.itemMap])}return Qe(v,"useCollection"),[{Provider:i,Slot:u,ItemSlot:p},v,r]}Qe(wa,"createCollection");var zc=new WeakMap,Ue,xt,So=(xt=class extends Map{constructor(n){super(n);ie(this,Ue);G(this,Ue,[...super.keys()]),zc.set(this,!0)}set(n,r){return zc.get(this)&&!this.has(n)&&E(this,Ue).push(n),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=s?this.size:this.size+1,a=_a(n),c=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(s?E(this,Ue).indexOf(r)===c:c===this.size)return this.set(r,o),this;const u=E(this,Ue).filter(l=>l!==r);u.splice(c,0,r);const d=u.map(l=>[l,l===r?o:this.get(l)]);this.clear();for(const[l,f]of d)this.set(l,f);return this}with(n,r,o){const s=new xt(this);return s.insert(n,r,o),s}before(n){const r=E(this,Ue).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=E(this,Ue).indexOf(n);if(s===-1)return this;const i=E(this,Ue).indexOf(r),a=i!==-1&&i<s?s-1:s;return this.insert(a,r,o)}after(n){let r=E(this,Ue).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=E(this,Ue).indexOf(n);if(s===-1)return this;const i=E(this,Ue).indexOf(r),a=i!==-1&&i<=s?s:s+1;return this.insert(a,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return G(this,Ue,[]),super.clear()}delete(n){const r=super.delete(n);return r&&E(this,Ue).splice(E(this,Ue).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Lo(E(this,Ue),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Lo(E(this,Ue),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return E(this,Ue).indexOf(n)}keyAt(n){return Lo(E(this,Ue),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new xt(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new xt(o)}reduce(...n){const[r,o]=n,s=n.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=0,a=o;for(const c of this)i===0&&!s?a=c:a=Reflect.apply(r,this,[a,c,i,this]),i++;return a}reduceRight(...n){const[r,o]=n,s=n.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=o;for(let a=this.size-1;a>=0;a--){const c=this.entryAt(a);a===this.size-1&&!s?i=c:i=Reflect.apply(r,this,[i,c,a,this])}return i}sort(n){if(typeof n!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(n);this.clear();for(const[o,s]of r)this.set(o,s);return this}toSorted(n){if(typeof n!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(n);return new xt(r)}toReversed(){const n=new xt;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new xt(r)}slice(n,r){const o=new xt;for(const s of E(this,Ue).slice(n,r))o.set(s,this.get(s));return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},Ue=new WeakMap,Qe(xt,"OrderedDict"),xt);function Lo(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=kf(e,t);return n===-1?void 0:e[n]}Qe(Lo,"at");function kf(e,t){const n=e.length,r=_a(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Qe(kf,"toSafeIndex");function _a(e){return e!==e||e===0?0:Math.trunc(e)}Qe(_a,"toSafeInteger");function rw(e){const t=e+"CollectionProvider",[n,r]=nn(t),[o,s]=n(t);o.displayName=e+"CollectionStableContextProvider";const[i,a]=n(t);i.displayName=e+"CollectionStatefulContextProvider";const c=Qe(({state:P,...R})=>P?m.jsx(d,{...R,state:P}):m.jsx(u,{...R}),"CollectionProvider");c.displayName=t;const u=Qe(P=>{const R=x();return m.jsx(d,{...P,state:R})},"CollectionInit");u.displayName=e+"CollectionInit";const d=Qe(P=>{const{scope:R,children:T,state:A}=P,j=h.useRef(null),[F,z]=h.useState(null),Y=Te(j,z),[Z,K]=A,H=h.useRef(new So),J=h.useCallback(()=>{const ne=H.current;return Rf(ne)||ne.sort(Vo),ne},[]);return h.useEffect(()=>{if(!F)return;const ne=Tf(()=>{K(te=>{const X=te.toSorted(Vo);return X.some(([me],he)=>te.keyAt(he)!==me)?X:te})});return ne.observe(F,{childList:!0,subtree:!0}),()=>{ne.disconnect()}},[F,K]),m.jsx(o,{scope:R,collectionElementRef:Y,collectionElementRefObject:j,getCollection:J,setCollection:K,registryRef:H,children:m.jsx(i,{scope:R,collectionElement:F,collection:Z,children:T})})},"CollectionProviderImpl");d.displayName=e+"CollectionProviderImpl";const l=e+"CollectionSlot",f=Jt(l),p=h.forwardRef((P,R)=>{const{scope:T,children:A}=P,j=s(l,T),F=Te(R,j.collectionElementRef);return m.jsx(f,{ref:F,children:A})});p.displayName=l;const v=e+"CollectionItemSlot",g="data-radix-collection-item",w=Jt(v),b=h.forwardRef((P,R)=>{const{scope:T,children:A,...j}=P,F=h.useRef(null),z=s(v,T),{setCollection:Y,registryRef:Z}=z,K=h.useRef(j);Of(K.current,j)||(K.current=j);const H=K.current,J=h.useCallback(X=>{const q=Z.current;X?q.set(X,{...K.current,element:X}):F.current&&q.delete(F.current)},[Z]),ne=Te(R,J,F);ct(()=>{const X=F.current,q=Z.current;X&&q.has(X)&&q.set(X,{...H,element:X})},[H,Z]);const te=h.useRef(null);return h.useEffect(()=>{const X=F.current,q=te.current;((q==null?void 0:q.element)??null)===X&&(!X||(q==null?void 0:q.itemData)===H)||(te.current=X?{element:X,itemData:H}:null,Y(me=>{const he=new So(me);return q&&q.element!==X&&he.delete(q.element),X&&he.set(X,{...H,element:X}),he.sort(Vo)}))}),h.useEffect(()=>()=>{const X=te.current;te.current=null,X&&Y(q=>{if(!q.has(X.element))return q;const me=new So(q);return me.delete(X.element),me})},[Y]),m.jsx(w,{[g]:"",ref:ne,children:A})});b.displayName=v;function x(){return h.useState(new So)}Qe(x,"useInitCollection");function _(P){const{collection:R}=a(e+"CollectionConsumer",P);return R}Qe(_,"useCollection");function C(P){const{getCollection:R}=s(e+"CollectionConsumer",P);return R}return Qe(C,"useGetCollection"),[{Provider:c,Slot:p,ItemSlot:b},{createCollectionScope:r,useCollection:_,useGetCollection:C,useInitCollection:x}]}Qe(rw,"createCollection");function Of(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}Qe(Of,"shallowEqual");function Pf(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Qe(Pf,"isElementPreceding");function Rf(e){let t;for(const n of e.keys()){if(t){const r=t.compareDocumentPosition(n);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Qe(Rf,"isInDocumentOrder");function Vo(e,t){return!e[1].element||!t[1].element?0:Pf(e[1].element,t[1].element)?-1:1}Qe(Vo,"sortByDocumentPosition");function Tf(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Qe(Tf,"getChildListObserver");var ow=Object.defineProperty,sw=(e,t)=>ow(e,"name",{value:t,configurable:!0}),iw={LTR:"ltr"},aw=h.createContext(void 0);function xa(e){const t=h.useContext(aw);return e||t||iw.LTR}sw(xa,"useDirection");var cw=Object.defineProperty,Sa=(e,t)=>cw(e,"name",{value:t,configurable:!0}),$s=!1;function If(){const[e,t]=h.useState($s);return h.useEffect(()=>{$s||($s=!0,t(!0))},[]),e}Sa(If,"useIsHydrated");var Af=Bn[" useSyncExternalStore ".trim().toString()];function Nf(){return()=>{}}Sa(Nf,"subscribe");function Df(){return Af(Nf,()=>!0,()=>!1)}Sa(Df,"useIsHydratedModern");var lw=typeof Af=="function"?Df:If,uw=Object.defineProperty,Hn=(e,t)=>uw(e,"name",{value:t,configurable:!0}),zs="rovingFocusGroup.onEntryFocus",dw={bubbles:!1,cancelable:!0},fs="RovingFocusGroup",[Si,Mf,fw]=wa(fs),[hw,jf]=nn(fs,[fw]),Fc={Vertical:"vertical",Horizontal:"horizontal"},pw={RTL:"rtl"},[mw,gw]=hw(fs),vw=h.forwardRef(Hn(function(t,n){return m.jsx(Si.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Si.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(yw,{...t,ref:n})})})},"RovingFocusGroup")),yw=h.forwardRef(Hn(function(t,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:l=!1,...f}=t,p=h.useRef(null),v=Te(n,p),g=xa(i),[w,b]=ao({prop:a,defaultProp:c??null,onChange:u,caller:fs}),[x,_]=h.useState(!1),C=Xt(d),S=Mf(r),P=h.useRef(!1),[R,T]=h.useState(0);return h.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(zs,C),()=>A.removeEventListener(zs,C)},[C]),m.jsx(mw,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:w,onItemFocus:h.useCallback(A=>b(A),[b]),onItemShiftTab:h.useCallback(()=>_(!0),[]),onFocusableItemAdd:h.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:h.useCallback(()=>T(A=>A-1),[]),children:m.jsx(Ze.div,{tabIndex:x||R===0?-1:0,"data-orientation":o,...f,ref:v,style:{outline:"none",...t.style},onMouseDown:de(t.onMouseDown,()=>{P.current=!0}),onFocus:de(t.onFocus,A=>{const j=!P.current;if(A.target===A.currentTarget&&j&&!x){const F=new CustomEvent(zs,dw);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const z=S().filter(J=>J.focusable),Y=z.find(J=>J.active),Z=z.find(J=>J.id===w),H=[Y,Z,...z].filter(Boolean).map(J=>J.ref.current);Ea(H,l)}}P.current=!1}),onBlur:de(t.onBlur,()=>_(!1))})})},"RovingFocusGroupImpl")),bw="RovingFocusGroupItem",ww=h.forwardRef(Hn(function(t,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=t,u=En(),d=i||u,l=gw(bw,r),f=l.currentTabStopId===d,p=Mf(r),{onFocusableItemAdd:v,onFocusableItemRemove:g,currentTabStopId:w}=l,b=lw();return ct(()=>{if(!(!b||!o))return v(),()=>g()},[b,o,v,g]),h.useEffect(()=>{if(!(b||!o))return v(),()=>g()},[b,o,v,g]),m.jsx(Si.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:m.jsx(Ze.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...c,ref:n,onMouseDown:de(t.onMouseDown,x=>{o?l.onItemFocus(d):x.preventDefault()}),onFocus:de(t.onFocus,()=>l.onItemFocus(d)),onKeyDown:de(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){l.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const _=zf(x,l.orientation,l.dir);if(_!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=p().filter(P=>P.focusable).map(P=>P.ref.current);if(_==="last")S.reverse();else if(_==="prev"||_==="next"){_==="prev"&&S.reverse();const P=S.indexOf(x.currentTarget);S=l.loop?Ff(S,P+1):S.slice(P+1)}setTimeout(()=>Ea(S))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:w!=null}):a})})},"RovingFocusGroupItem")),_w={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $f(e,t){return t!==pw.RTL?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Hn($f,"getDirectionAwareKey");function zf(e,t,n){const r=$f(e.key,n);if(!(t===Fc.Vertical&&["ArrowLeft","ArrowRight"].includes(r))&&!(t===Fc.Horizontal&&["ArrowUp","ArrowDown"].includes(r)))return _w[r]}Hn(zf,"getFocusIntent");function Ea(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Hn(Ea,"focusFirst");function Ff(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Hn(Ff,"wrapArray");var xw=Object.defineProperty,xe=(e,t)=>xw(e,"name",{value:t,configurable:!0}),Sw={RTL:"rtl"},Ei=["Enter"," "],Ew=["ArrowDown","PageUp","Home"],Lf=["ArrowUp","PageDown","End"],Cw=[...Ew,...Lf],kw={ltr:[...Ei,"ArrowRight"],rtl:[...Ei,"ArrowLeft"]},Ow={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hs="Menu",[qr,Pw,Rw]=wa(hs),[Wn,Vf]=nn(hs,[Rw,us,jf]),Ca=us(),Uf=jf(),[Tw,Kn]=Wn(hs),[Iw,uo]=Wn(hs),Aw=xe(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Ca(t),[c,u]=h.useState(null),d=h.useRef(!1),l=Xt(s),f=xa(o);return h.useEffect(()=>{const p=xe(()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},"handleKeyDown"),v=xe(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),h.useEffect(()=>{if(!n)return;const p=xe(()=>l(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,l]),m.jsx(tf,{...a,children:m.jsx(Tw,{scope:t,open:n,onOpenChange:l,content:c,onContentChange:u,children:m.jsx(Iw,{scope:t,onClose:h.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:f,modal:i,children:r})})})},"Menu"),Zf=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t,s=Ca(r);return m.jsx(nf,{...s,...o,ref:n})},"MenuAnchor")),Bf="MenuPortal",[Nw,Hf]=Wn(Bf,{forceMount:void 0}),Dw=xe(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Kn(Bf,t);return m.jsx(Nw,{scope:t,forceMount:n,children:m.jsx(rn,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Mt="MenuContent",[Mw,ka]=Wn(Mt),jw=h.forwardRef(xe(function(t,n){const r=Hf(Mt,t.__scopeMenu),{forceMount:o=r.forceMount,...s}=t,i=Kn(Mt,t.__scopeMenu),a=uo(Mt,t.__scopeMenu);return m.jsx(qr.Provider,{scope:t.__scopeMenu,children:m.jsx(rn,{present:o||i.open,children:m.jsx(qr.Slot,{scope:t.__scopeMenu,children:a.modal?m.jsx($w,{...s,ref:n}):m.jsx(zw,{...s,ref:n})})})})},"MenuContent")),$w=h.forwardRef(xe(function(t,n){const r=Kn(Mt,t.__scopeMenu),o=h.useRef(null),s=Te(n,o);return h.useEffect(()=>{const i=o.current;if(i)return jd(i)},[]),m.jsx(Oa,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:de(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),zw=h.forwardRef(xe(function(t,n){const r=Kn(Mt,t.__scopeMenu);return m.jsx(Oa,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Fw=Jt("MenuContent.ScrollLock"),Oa=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:v,disableOutsideScroll:g,...w}=t,b=Kn(Mt,r),x=uo(Mt,r),_=Ca(r),C=Uf(r),S=Pw(r),[P,R]=h.useState(null),T=h.useRef(null),[A,j]=h.useState(null);da(A);const{nodes:F,registry:z}=ua(),Y=!!(s||g),Z=Te(n,T,b.onContentChange,j),K=h.useRef(0),H=h.useRef(""),J=h.useRef(0),ne=h.useRef(null),te=h.useRef("right"),X=h.useRef(0),q=h.useMemo(()=>g?[T,...F.map(B=>({current:B}))]:[],[T,F,g]),me=g?ma:h.Fragment,he=g?{as:Fw,allowPinchZoom:!0,shards:q}:void 0,ae=xe(B=>{var kt,lt;const se=H.current+B,ye=S().filter(Le=>!Le.disabled),le=document.activeElement,Pe=(kt=ye.find(Le=>Le.ref.current===le))==null?void 0:kt.textValue,je=ye.map(Le=>Le.textValue),Ee=Jf(je,se,Pe),$e=(lt=ye.find(Le=>Le.textValue===Ee))==null?void 0:lt.ref.current;function We(Le){H.current=Le,window.clearTimeout(K.current),Le!==""&&(K.current=window.setTimeout(()=>We(""),1e3))}xe(We,"updateSearch"),We(se),$e&&setTimeout(()=>$e.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(K.current),[]),as();const re=h.useCallback(B=>{var ye,le;return te.current===((ye=ne.current)==null?void 0:ye.side)&&eh(B,(le=ne.current)==null?void 0:le.area)},[]);return m.jsx(Mw,{scope:r,searchRef:H,onItemEnter:h.useCallback(B=>{re(B)&&B.preventDefault()},[re]),onItemLeave:h.useCallback(B=>{var se;re(B)||((se=T.current)==null||se.focus(),R(null))},[re]),onTriggerLeave:h.useCallback(B=>{re(B)&&B.preventDefault()},[re]),pointerGraceTimerRef:J,onPointerGraceIntentChange:h.useCallback(B=>{ne.current=B},[]),children:m.jsx(la,{registry:Y?z:null,children:m.jsx(me,{...he,children:m.jsx(gd,{asChild:!0,trapped:s,branches:F,onMountAutoFocus:de(i,B=>{var se;B.preventDefault(),(se=T.current)==null||se.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:m.jsx(aa,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:v,children:m.jsx(vw,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:P,onCurrentTabStopIdChange:R,onEntryFocus:de(u,B=>{x.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(of,{role:"menu","aria-orientation":"vertical","data-state":Ra(b.open),"data-radix-menu-content":"",dir:x.dir,..._,...w,ref:Z,style:{outline:"none",...w.style},onKeyDown:de(w.onKeyDown,B=>{const ye=B.target.closest("[data-radix-menu-content]")===B.currentTarget,le=B.ctrlKey||B.altKey||B.metaKey,Pe=B.key.length===1;ye&&(B.key==="Tab"&&B.preventDefault(),!le&&Pe&&ae(B.key));const je=T.current;if(B.target!==je||!Cw.includes(B.key))return;B.preventDefault();const $e=S().filter(We=>!We.disabled).map(We=>We.ref.current);Lf.includes(B.key)&&$e.reverse(),Qf($e)}),onBlur:de(t.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(K.current),H.current="")}),onPointerMove:de(t.onPointerMove,yr(B=>{const se=B.target,ye=X.current!==B.clientX;if(B.currentTarget.contains(se)&&ye){const le=B.clientX>X.current?"right":"left";te.current=le,X.current=B.clientX}}))})})})})})})})},"MenuContentImpl")),Lw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Ze.div,{...o,ref:n})},"MenuLabel")),Ci="MenuItem",Lc="menu.itemSelect",Pa=h.forwardRef(xe(function(t,n){const{disabled:r=!1,onSelect:o,...s}=t,i=h.useRef(null),a=uo(Ci,t.__scopeMenu),c=ka(Ci,t.__scopeMenu),u=Te(n,i),d=h.useRef(!1),l=xe(()=>{const f=i.current;if(!r&&f){const p=new CustomEvent(Lc,{bubbles:!0,cancelable:!0});f.addEventListener(Lc,v=>o==null?void 0:o(v),{once:!0}),sa(f,p),p.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return m.jsx(Wf,{...s,ref:u,disabled:r,onClick:de(t.onClick,l),onPointerDown:f=>{var p;(p=t.onPointerDown)==null||p.call(t,f),d.current=!0},onPointerUp:de(t.onPointerUp,f=>{var p;d.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:de(t.onKeyDown,f=>{r||f.target!==f.currentTarget||c.searchRef.current!==""&&f.key===" "||Ei.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})},"MenuItem")),Wf=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=t,a=ka(Ci,r),c=Uf(r),u=h.useRef(null),d=Te(n,u),[l,f]=h.useState(!1),[p,v]=h.useState("");return h.useEffect(()=>{const g=u.current;g&&v((g.textContent??"").trim())},[i.children]),m.jsx(qr.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:m.jsx(ww,{asChild:!0,...c,focusable:!o,children:m.jsx(Ze.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:de(t.onPointerMove,yr(g=>{o?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:de(t.onPointerLeave,yr(g=>a.onItemLeave(g))),onFocus:de(t.onFocus,()=>f(!0)),onBlur:de(t.onBlur,()=>f(!1))})})})},"MenuItemImpl")),Vw=h.forwardRef(xe(function(t,n){const{checked:r=!1,onCheckedChange:o,...s}=t;return m.jsx(Gf,{scope:t.__scopeMenu,checked:r,children:m.jsx(Pa,{role:"menuitemcheckbox","aria-checked":Qr(r)?"mixed":r,...s,ref:n,"data-state":ps(r),onSelect:de(s.onSelect,()=>o==null?void 0:o(Qr(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Uw="MenuRadioGroup",[R2,Zw]=Wn(Uw,{value:void 0,onValueChange:xe(()=>{},"onValueChange")}),Bw="MenuRadioItem",Hw=h.forwardRef(xe(function(t,n){const{value:r,...o}=t,s=Zw(Bw,t.__scopeMenu),i=r===s.value;return m.jsx(Gf,{scope:t.__scopeMenu,checked:i,children:m.jsx(Pa,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":ps(i),onSelect:de(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Kf="MenuItemIndicator",[Gf,Ww]=Wn(Kf,{checked:!1}),Kw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,forceMount:o,...s}=t,i=Ww(Kf,r);return m.jsx(rn,{present:o||Qr(i.checked)||i.checked===!0,children:m.jsx(Ze.span,{...s,ref:n,"data-state":ps(i.checked)})})},"MenuItemIndicator")),Gw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),qw="MenuSub",[T2,qf]=Wn(qw),Eo="MenuSubTrigger",Qw=h.forwardRef(xe(function(t,n){const r=Kn(Eo,t.__scopeMenu),o=uo(Eo,t.__scopeMenu),s=qf(Eo,t.__scopeMenu),i=ka(Eo,t.__scopeMenu),a=h.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:t.__scopeMenu},l=h.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);h.useEffect(()=>l,[l]),h.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]);const f=Te(n,s.onTriggerChange);return m.jsx(Zf,{asChild:!0,...d,children:m.jsx(Wf,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":Ra(r.open),...t,ref:f,onClick:p=>{var v;(v=t.onClick)==null||v.call(t,p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:de(t.onPointerMove,yr(p=>{i.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),l()},100))})),onPointerLeave:de(t.onPointerLeave,yr(p=>{var g,w;l();const v=(g=r.content)==null?void 0:g.getBoundingClientRect();if(v){const b=(w=r.content)==null?void 0:w.dataset.side,x=b==="right",_=x?-5:5,C=v[x?"left":"right"],S=v[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+_,y:p.clientY},{x:C,y:v.top},{x:S,y:v.top},{x:S,y:v.bottom},{x:C,y:v.bottom}],side:b}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:de(t.onKeyDown,p=>{var g;t.disabled||p.target!==p.currentTarget||i.searchRef.current!==""&&p.key===" "||kw[o.dir].includes(p.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),p.preventDefault())})})})},"MenuSubTrigger")),Yw="MenuSubContent",Jw=h.forwardRef(xe(function(t,n){const r=Hf(Mt,t.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=t,a=Kn(Mt,t.__scopeMenu),c=uo(Mt,t.__scopeMenu),u=qf(Yw,t.__scopeMenu),d=h.useRef(null),l=Te(n,d);return m.jsx(qr.Provider,{scope:t.__scopeMenu,children:m.jsx(rn,{present:o||a.open,children:m.jsx(qr.Slot,{scope:t.__scopeMenu,children:m.jsx(Oa,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:l,align:s,side:c.dir===Sw.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;c.isUsingKeyboardRef.current&&((p=d.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:de(t.onFocusOutside,f=>{f.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:de(t.onEscapeKeyDown,f=>{c.onClose(),f.preventDefault()}),onKeyDown:de(t.onKeyDown,f=>{var g;const p=f.currentTarget.contains(f.target),v=Ow[c.dir].includes(f.key);p&&v&&(a.onOpenChange(!1),(g=u.trigger)==null||g.focus(),f.preventDefault())})})})})})},"MenuSubContent"));function Ra(e){return e?"open":"closed"}xe(Ra,"getOpenState");function Qr(e){return e==="indeterminate"}xe(Qr,"isIndeterminate");function ps(e){return Qr(e)?"indeterminate":e?"checked":"unchecked"}xe(ps,"getCheckedState");function Qf(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}xe(Qf,"focusFirst");function Yf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}xe(Yf,"wrapArray");function Jf(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Yf(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}xe(Jf,"getNextMatch");function Xf(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}xe(Xf,"isPointInPolygon");function eh(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Xf(n,t)}xe(eh,"isPointerInGraceArea");function yr(e){return t=>t.pointerType==="mouse"?e(t):void 0}xe(yr,"whenMouse");var Xw=Object.defineProperty,Tt=(e,t)=>Xw(e,"name",{value:t,configurable:!0}),Ta="DropdownMenu",[e0,I2]=nn(Ta,[Vf]),It=Vf(),[t0,th]=e0(Ta),n0=Tt(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=It(t),u=h.useRef(null),[d,l]=ao({prop:o,defaultProp:s??!1,onChange:i,caller:Ta});return m.jsx(t0,{scope:t,triggerId:En(),triggerRef:u,contentId:En(),open:d,onOpenChange:l,onOpenToggle:h.useCallback(()=>l(f=>!f),[l]),modal:a,children:m.jsx(Aw,{...c,open:d,onOpenChange:l,dir:r,modal:a,children:n})})},"DropdownMenu"),r0="DropdownMenuTrigger",o0=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=t,i=th(r0,r),a=It(r),c=Te(n,i.triggerRef);return m.jsx(Zf,{asChild:!0,...a,children:m.jsx(Ze.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:de(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:de(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),s0=Tt(e=>{const{__scopeDropdownMenu:t,...n}=e,r=It(t);return m.jsx(Dw,{...r,...n})},"DropdownMenuPortal"),i0="DropdownMenuContent",nh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=th(i0,r),i=It(r),a=h.useRef(!1);return m.jsx(jw,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:de(t.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:de(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,l=u.button===2||d;(!s.modal||l)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),rh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Lw,{...s,...o,ref:n})},"DropdownMenuLabel")),oh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Pa,{...s,...o,ref:n})},"DropdownMenuItem")),sh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Vw,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),ih=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Hw,{...s,...o,ref:n})},"DropdownMenuRadioItem")),ah=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Kw,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),ch=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Gw,{...s,...o,ref:n})},"DropdownMenuSeparator")),lh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Qw,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),uh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Jw,{...s,...o,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent"));const a0=n0,c0=o0,l0=h.forwardRef((e,t)=>{const n=ee.c(14);let r,o,s,i;n[0]!==e?({className:o,inset:s,children:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s&&"pl-8";let c;n[5]!==o||n[6]!==a?(c=ce("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a,o),n[5]=o,n[6]=a,n[7]=c):c=n[7];let u;n[8]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Ym,{className:"ml-auto"}),n[8]=u):u=n[8];let d;return n[9]!==r||n[10]!==i||n[11]!==t||n[12]!==c?(d=m.jsxs(lh,{ref:t,className:c,...i,children:[r,u]}),n[9]=r,n[10]=i,n[11]=t,n[12]=c,n[13]=d):d=n[13],d});l0.displayName=lh.displayName;const u0=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(uh,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});u0.displayName=uh.displayName;const dh=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,sideOffset:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?4:s;let a;n[4]!==r?(a=ce("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==a?(c=m.jsx(s0,{children:m.jsx(nh,{ref:t,sideOffset:i,className:a,...o})}),n[6]=o,n[7]=t,n[8]=i,n[9]=a,n[10]=c):c=n[10],c});dh.displayName=nh.displayName;const ki=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,inset:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=o&&"pl-8";let a;n[4]!==r||n[5]!==i?(a=ce("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",i,r),n[4]=r,n[5]=i,n[6]=a):a=n[6];let c;return n[7]!==s||n[8]!==t||n[9]!==a?(c=m.jsx(oh,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});ki.displayName=oh.displayName;const d0=h.forwardRef((e,t)=>{const n=ee.c(14);let r,o,s,i;n[0]!==e?({className:s,children:o,checked:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);let a;n[5]!==s?(a=ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),n[5]=s,n[6]=a):a=n[6];let c;n[7]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(ah,{children:m.jsx(Qm,{className:"h-4 w-4"})})}),n[7]=c):c=n[7];let u;return n[8]!==r||n[9]!==o||n[10]!==i||n[11]!==t||n[12]!==a?(u=m.jsxs(sh,{ref:t,className:a,checked:r,...i,children:[c,o]}),n[8]=r,n[9]=o,n[10]=i,n[11]=t,n[12]=a,n[13]=u):u=n[13],u});d0.displayName=sh.displayName;const f0=h.forwardRef((e,t)=>{const n=ee.c(12);let r,o,s;n[0]!==e?({className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==o?(i=ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o),n[4]=o,n[5]=i):i=n[5];let a;n[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(ah,{children:m.jsx(Xm,{className:"h-2 w-2 fill-current"})})}),n[6]=a):a=n[6];let c;return n[7]!==r||n[8]!==s||n[9]!==t||n[10]!==i?(c=m.jsxs(ih,{ref:t,className:i,...s,children:[a,r]}),n[7]=r,n[8]=s,n[9]=t,n[10]=i,n[11]=c):c=n[11],c});f0.displayName=ih.displayName;const h0=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,inset:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=o&&"pl-8";let a;n[4]!==r||n[5]!==i?(a=ce("px-2 py-1.5 text-sm font-semibold",i,r),n[4]=r,n[5]=i,n[6]=a):a=n[6];let c;return n[7]!==s||n[8]!==t||n[9]!==a?(c=m.jsx(rh,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});h0.displayName=rh.displayName;const fh=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("-mx-1 my-1 h-px bg-muted",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(ch,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});fh.displayName=ch.displayName;const p0=1,m0=1,g0=2,Vc=9;function v0(e,t){const n=new DataView(e),r=[];let o=0;for(;o+Vc<=e.byteLength;){const s=n.getUint8(o),i=n.getUint32(o+1),a=n.getUint32(o+5),c=o+Vc;if(c+a>e.byteLength)break;if(s===m0)r.push({kind:"frame",ms:i,chunk:t,data:e.slice(c,c+a)});else if(s===g0)try{r.push({kind:"event",ms:i,chunk:t,event:JSON.parse(new TextDecoder().decode(new Uint8Array(e,c,a)))})}catch{}o=c+a}return r}function A2(e,t){const n=[...e.chunks].sort((f,p)=>f.seq-p.seq),r=[],o=[];n.forEach((f,p)=>{o.push(r.length),f.offset+f.length<=t.byteLength&&r.push(...v0(t.slice(f.offset,f.offset+f.length),p))});const s=r.length>0?r[r.length-1].ms:0,i=[],a=new Set(e.gaps);n.forEach((f,p)=>{const v=n[p+1];if(v&&v.seq!==f.seq+1){const g=r[(o[p+1]??r.length)-1];i.push({fromMs:(g==null?void 0:g.ms)??f.startMs,toMs:v.startMs})}}),n.length>0&&[...a].some(f=>f<n[0].seq)&&i.unshift({fromMs:0,toMs:n[0].startMs});const c=n.length>0?n[n.length-1].seq:-1;[...a].some(f=>f>c)&&i.push({fromMs:s,toMs:s});const d=r.flatMap(f=>f.kind==="event"&&f.event.type==="step"&&f.event.phase==="start"?[{index:f.event.index,name:f.event.name,ms:f.ms}]:[]),l=new Map(r.flatMap(f=>f.kind==="event"&&f.event.type==="step"&&f.event.phase==="end"?[[f.event.index,f.event.status]]:[]));return{meta:e.meta,records:r,chunkStarts:o,chunks:n,durationMs:s,gaps:i,steps:d.map(f=>{const p=l.get(f.index);return p?{...f,status:p}:f})}}function N2(e,t){const n=e.chunks;let r=-1;n.forEach((o,s)=>{o.startMs<=t&&(r=s)});for(let o=r;o>=0;o--){if(n[o].keyframe)return o;if(o>0&&n[o].seq!==n[o-1].seq+1)break}return n.findIndex((o,s)=>s>r&&o.keyframe)}function D2(e,t){let n;for(const r of e.records)if(!(r.kind!=="event"||r.event.type!=="chrome")){if(r.ms>t&&n!==void 0)break;n=r.event.payload}return n??null}function M2(e,t){const n=Math.max(150,e.durationMs*.02);let r=null;for(const o of e.steps){const s=Math.abs(o.ms-t);s<=n&&(!r||s<r.d)&&(r={ms:o.ms,d:s})}return r?r.ms:t}function j2(e){const t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function $2(e){return e.notRecorded==="jpeg"?"No video: this device streamed JPEG, which is not kept. The agent sends H.264 unless TAPFLOW_IOS_CODEC=jpeg is set.":e.notRecorded==="no-keyframe"?"No video: the device's stream gave no frame a video could start from.":e.notRecorded?"No video for this flow.":e.evicted?"Video no longer kept: removed by the retention policy, or to make room when video storage was full.":null}function z2(e){switch(e){case"size-limit":return"The video stops early: it reached the 100 MB limit for one flow.";case"storage-full":return"The video stops early: the relay's storage for videos was full.";case"cancelled":return"The run was cancelled here.";case"runner-lost":return"The video stops where the runner disconnected.";case"truncated":return"The end of this video did not reach the relay.";default:return null}}const Oi="";async function Co(e,t,n,r){const o=await fetch(`${Oi}${t}`,{method:e,credentials:"include",headers:{"Content-Type":"application/json",...r},body:n!=null?JSON.stringify(n):void 0});if(o.status===204)return{data:null,status:204};const s=await o.json().catch(()=>null);return o.ok?{data:s,status:o.status}:{data:null,status:o.status,error:(s==null?void 0:s.error)??"Request failed"}}const hh={get:e=>Co("GET",e),post:(e,t)=>Co("POST",e,t),patch:(e,t)=>Co("PATCH",e,t),delete:e=>Co("DELETE",e),upload:async(e,t)=>{const n=await fetch(`${Oi}${e}`,{method:"POST",credentials:"include",body:t});if(n.status===204)return{data:null,status:204};const r=await n.json().catch(()=>null);return n.ok?{data:r,status:n.status}:{data:null,status:n.status,error:(r==null?void 0:r.error)??"Upload failed"}},uploadPatch:async(e,t)=>{const n=await fetch(`${Oi}${e}`,{method:"PATCH",credentials:"include",body:t});if(n.status===204)return{data:null,status:204};const r=await n.json().catch(()=>null);return n.ok?{data:r,status:n.status}:{data:null,status:n.status,error:(r==null?void 0:r.error)??"Upload failed"}}},Qo={authStatus:["auth","status"],me:["auth","me"],inviteToken:e=>["invitations","verify",e],resetToken:e=>["auth","reset-password",e],apps:["apps"],settings:["settings"],tokens:["tokens"],teamMembers:["team","members"],comments:e=>["comments",e],allRecordings:["recordings"],recordings:e=>["recordings",e],agents:["agents"],resourceHistory:(e,t)=>["agents",e,"resources",t],runs:e=>["runs","list",e],run:e=>["runs","detail",e],runVideo:(e,t)=>["runs","video",e,t],anyRun:["runs","any"]};async function y0(){const e=await fetch("/api/v1/auth/status");if(!e.ok)throw new Error(`GET /api/v1/auth/status failed with ${e.status}`);return e.json()}async function b0(){const{data:e,status:t}=await hh.get("/api/v1/auth/me");if(t===401)return null;if(!e)throw new Error(`GET /api/v1/auth/me failed with ${t}`);return e}async function F2(e){const t=await fetch(`/api/v1/invitations/verify?token=${e}`);if(!t.ok)throw new Error(`invitation refused with ${t.status}`);return t.json()}async function Cr(e){const t=await fetch(e,{credentials:"include"});if(!t.ok)throw new Error(`GET ${e} failed with ${t.status}`);return t.json()}const w0=()=>Cr("/api/v1/settings"),L2=()=>Cr("/api/v1/tokens"),V2=()=>Cr("/api/v1/team/members"),U2=e=>Cr(`/api/v1/comments?build_id=${e}`),Z2=e=>Cr(`/api/v1/recordings?buildId=${e}`),B2=()=>Cr("/api/v1/agents");async function H2(e,t,n){const r=await fetch(`/api/v1/agents/${encodeURIComponent(e)}/resources?range=${t}`,{credentials:"include",signal:n});if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}async function W2(e){const t=await fetch(`/api/v1/auth/reset-password/verify?token=${e}`);if(!t.ok)throw new Error(`reset token refused with ${t.status}`);return!0}async function K2(){const e=await fetch("/api/v1/apps",{credentials:"include"});if(!e.ok)throw new Error(`GET /api/v1/apps failed with ${e.status}`);return(await e.json()).items}async function G2({appId:e,search:t,statusFilter:n}){const r=new URLSearchParams({app_id:String(e),limit:"100",sort:"uploaded_at",dir:"desc"});t&&r.set("q",t),n&&n!=="all"&&r.set("status",n);const o=await fetch(`/api/v1/builds?${r}`,{credentials:"include"});if(!o.ok)throw new Error(`GET /api/v1/builds failed with ${o.status}`);return(await o.json()).items}async function q2(e){const t=await fetch("/api/v1/apps",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return t.status===409?{error:"App with this bundle ID already exists"}:t.ok?t.json():null}class _0 extends Error{}async function Ia(e){if(e.status!==403)return;const t=await e.json().catch(()=>null);throw new _0((t==null?void 0:t.error)??"You do not have permission to do this")}async function Q2(e,t){const n=await fetch(`/api/v1/builds/${e}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status_label:t})});if(await Ia(n),!n.ok)throw new Error(`PATCH /api/v1/builds/${e} failed with ${n.status}`)}async function Y2(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"POST",credentials:"include"});if(await Ia(t),!t.ok)throw new Error(`Failed to schedule deletion (${t.status})`);return(await t.json()).delete_after}async function J2(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"DELETE",credentials:"include"});if(await Ia(t),!t.ok)throw new Error(`Failed to cancel scheduled deletion (${t.status})`)}async function X2(e){const t=await fetch(`/api/v1/builds/${e}`,{credentials:"include"});return t.ok?t.json():null}function ek(e){const t=new Map;for(const n of e){const r=n.version_name??"Unversioned";t.has(r)||t.set(r,[]),t.get(r).push(n)}return Array.from(t.entries()).map(([n,r])=>({versionName:n,builds:r}))}const x0=1e4;function Aa(e){const t=new AbortController,n=setTimeout(()=>t.abort(new DOMException("timed out","TimeoutError")),x0);return t.signal.addEventListener("abort",()=>clearTimeout(n),{once:!0}),e&&(e.aborted?t.abort(e.reason):e.addEventListener("abort",()=>t.abort(e.reason),{once:!0})),t.signal}const S0=25;async function E0(e){const t=await fetch("/api/v1/runs?limit=1",{credentials:"include",signal:Aa(e)});if(!t.ok)throw new Error(`GET /api/v1/runs failed with ${t.status}`);return(await t.json()).items.length>0}async function tk(e,t,n){const r=new URLSearchParams;e.ci!==void 0&&r.set("ci",e.ci?"1":"0"),e.status&&r.set("status",e.status),e.flow&&r.set("flow",e.flow),e.build!==void 0&&r.set("build",String(e.build)),t.before&&r.set("before",t.before),t.after&&r.set("after",t.after),r.set("limit",String(S0));const o=`/api/v1/runs${r.size?`?${r}`:""}`,s=await fetch(o,{credentials:"include",signal:Aa(n)});if(!s.ok)throw new Error(`GET /api/v1/runs failed with ${s.status}`);return s.json()}async function nk(e,t){const n=await fetch(`/api/v1/runs/${encodeURIComponent(e)}`,{credentials:"include",signal:Aa(t)});if(n.status===404)return null;if(!n.ok)throw new Error(`GET /api/v1/runs/${e} failed with ${n.status}`);return n.json()}async function rk(e,t,n){const r=await fetch(C0(e,t),{credentials:"include",signal:n});if(r.status===404||r.status===410)return{kind:"gone"};if(!r.ok)throw new Error(`video index ${r.status}`);const o=await r.json();if(o.evicted)return{kind:"gone"};if(o.meta.formatVersion!==p0)return{kind:"unsupported"};const s=await fetch(k0(e,t),{credentials:"include",signal:n});if(s.status===404||s.status===410)return{kind:"gone"};if(!s.ok)throw new Error(`video ${s.status}`);return{kind:"ready",index:o,file:await s.arrayBuffer()}}function C0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video/index`}function k0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video`}function ok(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/screenshot`}function ph(){const e=ee.c(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:Qo.me,queryFn:b0},e[0]=t):t=e[0];const n=Wo(t),r=n.data??null,o=n.data===void 0;let s;return e[1]!==r||e[2]!==o?(s={user:r,loading:o},e[1]=r,e[2]=o,e[3]=s):s=e[3],s}const O0={"/settings/team":["Admin"],"/settings/tokens":["Admin","Developer","QA"]};function mh(e,t){const n=Object.entries(O0).find(([r])=>e.startsWith(r));return!n||t!==void 0&&n[1].includes(t)}const P0=6;function R0(e){let t=0;for(const n of e)t=t*31+n.charCodeAt(0)&4294967295;return Math.abs(t)}function T0(e){const t=R0(e)%P0+1;return{bg:`hsl(var(--avatar-${t}-bg))`,fg:`hsl(var(--avatar-${t}-fg))`}}function I0(e){const t=ee.c(20),{name:n,avatarUrl:r,size:o}=e,s=o===void 0?28:o,i=(n==null?void 0:n[0])??"?";let a;t[0]!==i?(a=i.toUpperCase(),t[0]=i,t[1]=a):a=t[1];const c=a;let u;t[2]!==s?(u={width:s,height:s,borderRadius:"50%",flexShrink:0},t[2]=s,t[3]=u):u=t[3];const d=u;if(r){let b;t[4]!==d?(b={...d,objectFit:"cover"},t[4]=d,t[5]=b):b=t[5];let x;return t[6]!==r||t[7]!==n||t[8]!==b?(x=m.jsx("img",{src:r,alt:n,style:b}),t[6]=r,t[7]=n,t[8]=b,t[9]=x):x=t[9],x}let l;t[10]!==n?(l=T0(n),t[10]=n,t[11]=l):l=t[11];const{bg:f,fg:p}=l,v=s*.42;let g;t[12]!==f||t[13]!==p||t[14]!==d||t[15]!==v?(g={...d,background:f,display:"inline-flex",alignItems:"center",justifyContent:"center",color:p,fontSize:v,fontWeight:600,userSelect:"none"},t[12]=f,t[13]=p,t[14]=d,t[15]=v,t[16]=g):g=t[16];let w;return t[17]!==c||t[18]!==g?(w=m.jsx("span",{style:g,children:c}),t[17]=c,t[18]=g,t[19]=w):w=t[19],w}const Pi="/automation/runs",A0=[{label:"App Center",href:"/app-center",icon:ng},{label:"Flow Runs",href:Pi,icon:lg},{label:"Mac Resources",href:"/mac-resources",icon:sg}],N0=[{label:"Default",href:"/settings/default",icon:Nu},{label:"Team",href:"/settings/team",icon:fg},{label:"Tokens",href:"/settings/tokens",icon:tg}],D0=[{label:"Docs",href:"https://www.tapflow.dev/get-started/teammates",icon:qm}];function M0(){const e=ee.c(87),{pathname:t}=ou(),n=su(),{user:r}=ph(),{resolvedTheme:o}=ss(),s=o==="dark"?"/logo-dark.svg":"/logo.svg";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={queryKey:Qo.settings,queryFn:w0},e[0]=i):i=e[0];const a=Wo(i).data,c=(a==null?void 0:a.logo_url)??null,u=(a==null?void 0:a.team_name)||"tapflow",d=Qi(),{setOpenMobile:l}=lo();let f;e[1]!==l?(f=()=>l(!1),e[1]=l,e[2]=f):f=e[2];const p=f;let v;e[3]!==l?(v=()=>{l(!1)},e[3]=l,e[4]=v):v=e[4];let g;e[5]!==t||e[6]!==l?(g=[t,l],e[5]=t,e[6]=l,e[7]=g):g=e[7],h.useEffect(v,g);let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w={queryKey:Qo.anyRun,queryFn:j0},e[8]=w):w=e[8];const b=Wo(w);let x;e[9]!==b.data||e[10]!==b.isError||e[11]!==t?(x=b.data===!0||b.isError||t.startsWith(Pi),e[9]=b.data,e[10]=b.isError,e[11]=t,e[12]=x):x=e[12];const _=x;let C,S,P,R,T,A,j,F,z;if(e[13]!==p||e[14]!==s||e[15]!==c||e[16]!==n||e[17]!==t||e[18]!==d||e[19]!==_||e[20]!==u){let re;e[30]!==_?(re=Ee=>Ee.href!==Pi||_,e[30]=_,e[31]=re):re=e[31];const B=A0.filter(re);let se;e[32]!==n||e[33]!==d?(se=async function(){await fetch("/api/v1/auth/logout",{method:"POST",credentials:"include"}),d.clear(),n("/login",{replace:!0})},e[32]=n,e[33]=d,e[34]=se):se=e[34],A=se,T=wf,F="icon";const ye=c??s;let le;e[35]!==ye?(le=m.jsx("img",{src:ye,alt:"tapflow",className:"w-6 h-6 min-w-6 shrink-0"}),e[35]=ye,e[36]=le):le=e[36];let Pe;e[37]!==u?(Pe=m.jsx("span",{className:"text-base font-semibold tracking-tight truncate text-sidebar-accent-foreground group-data-[collapsible=icon]:hidden",children:u}),e[37]=u,e[38]=Pe):Pe=e[38],e[39]!==p||e[40]!==le||e[41]!==Pe?(z=m.jsx(Sf,{className:"p-2",children:m.jsxs(mo,{to:"/app-center",onClick:p,className:"flex items-center gap-2 p-1",children:[le,Pe]})}),e[39]=p,e[40]=le,e[41]=Pe,e[42]=z):z=e[42],R=Cf,P=Mo,S=jo,C=$o;let je;e[43]!==p||e[44]!==t?(je=Ee=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,isActive:t.startsWith(Ee.href),tooltip:Ee.label,children:m.jsxs(mo,{to:Ee.href,onClick:p,children:[m.jsx(Ee.icon,{}),m.jsx("span",{children:Ee.label})]})})},Ee.href),e[43]=p,e[44]=t,e[45]=je):je=e[45],j=B.map(je),e[13]=p,e[14]=s,e[15]=c,e[16]=n,e[17]=t,e[18]=d,e[19]=_,e[20]=u,e[21]=C,e[22]=S,e[23]=P,e[24]=R,e[25]=T,e[26]=A,e[27]=j,e[28]=F,e[29]=z}else C=e[21],S=e[22],P=e[23],R=e[24],T=e[25],A=e[26],j=e[27],F=e[28],z=e[29];let Y;e[46]!==C||e[47]!==j?(Y=m.jsx(C,{children:j}),e[46]=C,e[47]=j,e[48]=Y):Y=e[48];let Z;e[49]!==S||e[50]!==Y?(Z=m.jsx(S,{children:Y}),e[49]=S,e[50]=Y,e[51]=Z):Z=e[51];let K;e[52]!==P||e[53]!==Z?(K=m.jsx(P,{children:Z}),e[52]=P,e[53]=Z,e[54]=K):K=e[54];let H;e[55]===Symbol.for("react.memo_cache_sentinel")?(H=m.jsx(xi,{children:"Settings"}),e[55]=H):H=e[55];let J;if(e[56]!==p||e[57]!==t||e[58]!==(r==null?void 0:r.role)){let re;e[60]!==(r==null?void 0:r.role)?(re=se=>mh(se.href,r==null?void 0:r.role),e[60]=r==null?void 0:r.role,e[61]=re):re=e[61];let B;e[62]!==p||e[63]!==t?(B=se=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,isActive:t===se.href,tooltip:se.label,children:m.jsxs(mo,{to:se.href,onClick:p,children:[m.jsx(se.icon,{}),m.jsx("span",{children:se.label})]})})},se.href),e[62]=p,e[63]=t,e[64]=B):B=e[64],J=N0.filter(re).map(B),e[56]=p,e[57]=t,e[58]=r==null?void 0:r.role,e[59]=J}else J=e[59];let ne;e[65]!==J?(ne=m.jsxs(Mo,{children:[H,m.jsx(jo,{children:m.jsx($o,{children:J})})]}),e[65]=J,e[66]=ne):ne=e[66];let te;e[67]===Symbol.for("react.memo_cache_sentinel")?(te=m.jsx(xi,{children:"Reference"}),e[67]=te):te=e[67];let X;e[68]!==p?(X=D0.map(re=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,tooltip:re.label,children:m.jsxs("a",{href:re.href,target:"_blank",rel:"noopener noreferrer",onClick:p,children:[m.jsx(re.icon,{}),m.jsx("span",{children:re.label})]})})},re.href)),e[68]=p,e[69]=X):X=e[69];let q;e[70]!==X?(q=m.jsxs(Mo,{children:[te,m.jsx(jo,{children:m.jsx($o,{children:X})})]}),e[70]=X,e[71]=q):q=e[71];let me;e[72]!==R||e[73]!==K||e[74]!==ne||e[75]!==q?(me=m.jsxs(R,{children:[K,ne,q]}),e[72]=R,e[73]=K,e[74]=ne,e[75]=q,e[76]=me):me=e[76];let he;e[77]!==p||e[78]!==A||e[79]!==r?(he=r&&m.jsx(Ef,{className:"px-3 py-3",children:m.jsxs(a0,{children:[m.jsx(c0,{asChild:!0,children:m.jsxs("button",{className:"flex w-full items-center gap-2.5 rounded-md px-1 py-1 text-left hover:bg-sidebar-accent transition-colors group-data-[collapsible=icon]:justify-center",children:[m.jsx(I0,{name:r.displayName??"",avatarUrl:r.avatarUrl,size:28}),m.jsxs("div",{className:"flex flex-col min-w-0 flex-1 group-data-[collapsible=icon]:sr-only",children:[m.jsx("span",{className:"text-sm font-medium truncate",children:r.displayName}),m.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r.email})]})]})}),m.jsxs(dh,{side:"top",align:"start",className:"w-56",children:[m.jsx(ki,{asChild:!0,children:m.jsxs(mo,{to:"/settings/default",onClick:p,children:[m.jsx(Nu,{className:"mr-2 h-4 w-4"}),"Settings"]})}),m.jsx(fh,{}),m.jsxs(ki,{onClick:A,className:"text-destructive focus:text-destructive",children:[m.jsx(og,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})}),e[77]=p,e[78]=A,e[79]=r,e[80]=he):he=e[80];let ae;return e[81]!==T||e[82]!==me||e[83]!==he||e[84]!==F||e[85]!==z?(ae=m.jsxs(T,{collapsible:F,children:[z,me,he]}),e[81]=T,e[82]=me,e[83]=he,e[84]=F,e[85]=z,e[86]=ae):ae=e[86],ae}function j0(e){const{signal:t}=e;return E0(t)}function $0(){const e=ee.c(7),{theme:t,setTheme:n}=ss();let r;e[0]!==n||e[1]!==t?(r=()=>n(t==="dark"?"light":"dark"),e[0]=n,e[1]=t,e[2]=r):r=e[2];let o,s;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(ug,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s=m.jsx(ig,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),e[3]=o,e[4]=s):(o=e[3],s=e[4]);let i;return e[5]!==r?(i=m.jsxs(is,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Toggle theme",children:[o,s]}),e[5]=r,e[6]=i):i=e[6],i}const gh=h.createContext({node:null,setNode:()=>{}});function z0(e){const t=ee.c(5),{children:n}=e,[r,o]=h.useState(null);let s;t[0]!==r?(s={node:r,setNode:o},t[0]=r,t[1]=s):s=t[1];const i=s;let a;return t[2]!==n||t[3]!==i?(a=m.jsx(gh.Provider,{value:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function F0(){return h.useContext(gh)}function L0(){const e=ee.c(8),{node:t}=F0();let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(_f,{className:"-ml-1"}),r=m.jsx(qo,{orientation:"vertical",className:"h-4"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let o,s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"flex-1"}),s=m.jsx($0,{}),i=m.jsx(qo,{orientation:"vertical",className:"h-4"}),e[2]=o,e[3]=s,e[4]=i):(o=e[2],s=e[3],i=e[4]);let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("a",{href:"https://github.com/jo-duchan/tapflow",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-accent transition-colors","aria-label":"GitHub",children:m.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 fill-current","aria-hidden":"true",children:m.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),e[5]=a):a=e[5];let c;return e[6]!==t?(c=m.jsxs("header",{className:"flex h-16 items-center gap-2 border-b px-4",children:[n,r,t,o,s,i,a]}),e[6]=t,e[7]=c):c=e[7],c}function V0(){const e=ee.c(5),{user:t,loading:n}=ph(),r=ou();if(n)return null;if(!t){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(Gi,{to:"/login",replace:!0}),e[0]=a):a=e[0],a}if(!mh(r.pathname,t.role)){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex h-screen items-center justify-center",children:m.jsxs("div",{className:"text-center space-y-2",children:[m.jsx("p",{className:"text-lg font-semibold",children:"Access Denied"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Your role does not have access to this page."})]})}),e[1]=a):a=e[1],a}let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(M0,{}),e[2]=o):o=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(L0,{}),e[3]=s):s=e[3];let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(z0,{children:m.jsxs(bf,{children:[o,m.jsxs(xf,{children:[s,m.jsx("main",{className:"relative flex-1 min-h-0 overflow-auto",children:m.jsx(h.Suspense,{fallback:m.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),children:m.jsx(Vp,{})})})]})]})}),e[4]=i):i=e[4],i}var kr=e=>e.type==="checkbox",ms=e=>e.type==="file",Sn=e=>e instanceof Date,Xe=e=>e==null;const Na=e=>typeof e=="object";var Ae=e=>!Xe(e)&&!Array.isArray(e)&&Na(e)&&!Sn(e),Ri=e=>Ae(e)&&e.target?kr(e.target)?e.target.checked:ms(e.target)?e.target.files:e.target.value:e;const U0=/[.[\]'"]/;var Un=e=>e.split(U0).filter(Boolean);function Z0(e,t){const n=Un(t);let r=e._formValues,o=e._defaultValues;for(let s=0;s<n.length-1;s++){const i=n[s];if(r=r==null?r:r[i],o=o==null?o:o[i],r===null||o===null)return null}}var vh=(e,t)=>t.split(".").some((n,r,o)=>!isNaN(Number(n))&&e.has(o.slice(0,r).join("."))),gs=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Oe(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);const t=typeof Blob<"u"&&e instanceof Blob,n=typeof FileList<"u"&&e instanceof FileList;if(gs&&(t||n))return e;const r=Array.isArray(e),o=Object.getPrototypeOf(e);if(!r&&o&&e.constructor!==Object)return e;const s=r?new Array(e.length):Object.create(o);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[i]=Oe(e[i]));return s}const pn={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Rt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Je={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},B0=[Je.required,Je.min,Je.max,Je.minLength,Je.maxLength,Je.pattern,Je.validate],Lr="form",yh="root",Da=["__proto__","constructor","prototype"],H0=/^\w*$/;var br=e=>H0.test(e),ve=e=>e===void 0,U=(e,t,n)=>{if(!t||!Ae(e))return n;const r=br(t)?[t]:Un(t);if(r.some(s=>Da.includes(s)))return n;const o=r.reduce((s,i)=>Xe(s)?void 0:s[i],e);return ve(o)||o===e?ve(e[t])?n:e[t]:o},yt=e=>typeof e=="boolean",nt=e=>typeof e=="function",_e=(e,t,n)=>{let r=-1;const o=br(t)?[t]:Un(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let c=n;if(r!==i){const u=e[a];c=Ae(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}if(Da.includes(a))return;e[a]=c,e=e[a]}};const bh=I.createContext(null);bh.displayName="HookFormControlContext";const Ma=()=>I.useContext(bh);var wh=(e,t,n,r=!0)=>{const o={};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Rt.all&&(t._proxyFormState[i]=!r||Rt.all),n&&(n[i]=!0),e[i]}});return o};const ja=gs?I.useLayoutEffect:I.useEffect;var W0=e=>{const t=e.constructor&&e.constructor.prototype;return Ae(t)&&t.hasOwnProperty("isPrototypeOf")},Ti=e=>Xe(e)||!Na(e);const Uc=(e,t)=>t.length===0&&!Array.isArray(e)&&!W0(e);function at(e,t,n=!1,r=new WeakMap){if(e===t)return!0;if(Ti(e)||Ti(t))return Object.is(e,t);if(Sn(e)&&Sn(t))return Object.is(e.getTime(),t.getTime());const o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;if(Uc(e,o)||Uc(t,s))return Object.is(e,t);if(!o.length&&Array.isArray(e)!==Array.isArray(t))return!1;const i=r.get(e);if(i&&i.has(t))return!0;if(i)i.add(t);else{const a=new WeakSet;a.add(t),r.set(e,a)}for(const a of o){const c=e[a];if(!(a in t))return!1;if(!n||a!=="ref"){const u=t[a];if(Sn(c)&&Sn(u)||(Ae(c)||Array.isArray(c))&&(Ae(u)||Array.isArray(u))?!at(c,u,n,r):!Object.is(c,u))return!1}}return!0}function $a(e){const t=I.useRef(!1),n=I.useRef(!1),r=I.useRef(void 0),o=I.useRef(0);o.current++,!n.current&&e&&(n.current=!0,r.current=Oe(e()));const s=I.useCallback((a,c,u)=>{if(a&&(t.current||n.current&&o.current>1)){const d=c();at(r.current,d)||u(d)}t.current=!0},[]),i=I.useCallback((a,c)=>{a&&(r.current=Oe(c()))},[]);return{resyncIfNeeded:s,snapshot:i}}function K0(e){const t=Ma(),{control:n=t,disabled:r,name:o,exact:s}=e||{},i=()=>({...n._formState,defaultValues:n._defaultValues}),[a,c]=I.useState(i),u=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:d,snapshot:l}=$a(i);return ja(()=>{d(!r,i,c);const f=n._subscribe({name:o,formState:u.current,exact:s,callback:p=>{!r&&c({...n._formState,...p,defaultValues:n._defaultValues})}});return()=>{f(),l(!r,i)}},[n,o,r,s,d,l]),I.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),I.useMemo(()=>wh(a,n,u.current,!1),[a,n])}var rt=e=>typeof e=="string",Ii=(e,t,n,r,o)=>rt(e)?(r&&t.watch.add(e),U(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),U(n,s,U(o,s)))):(r&&(t.watchAll=!0),n);function G0(e){const t=Ma(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:i,compute:a}=e||{},c=I.useRef(o),u=I.useRef(a),d=I.useRef(n),l=I.useRef(r);u.current=a;const f=()=>{const A=n._getWatch(r,c.current);return u.current?u.current(A):A},[p,v]=I.useState(f),g=I.useRef(p),w=I.useCallback(A=>{const j=Ii(r,n._names,A||n._formValues,!1,c.current);return u.current?u.current(j):j},[n._formValues,n._names,r]),b=I.useCallback(A=>{if(!s){const j=Ii(r,n._names,A||n._formValues,!1,c.current);if(u.current){const F=u.current(j);at(F,g.current)||(v(F),g.current=F)}else v(j)}},[n._formValues,n._names,s,r]),{resyncIfNeeded:x,snapshot:_}=$a(f),C=I.useRef(b);C.current=b;const S=I.useRef(w);S.current=w,ja(()=>{d.current!==n||!at(l.current,r)?(d.current=n,l.current=r,C.current()):x(!s,()=>S.current(),j=>{const F=Oe(j);v(F),g.current=F});const A=n._subscribe({name:r,formState:{values:!0},exact:i,callback:j=>{C.current(j.values)}});return()=>{A(),_(!s,()=>S.current())}},[n,i,r,s,x,_]),I.useEffect(()=>n._removeUnmounted());const P=d.current!==n,R=l.current;return I.useMemo(()=>{if(s)return!1;const A=!P&&!at(R,r);return P||A},[s,P,r,R])?w():p}function q0(e){const t=Ma(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:i,exact:a=!0}=e,c=vh(o._names.array,n),u=I.useMemo(()=>{const C=U(o._formValues,n,U(o._defaultValues,n,i));return ve(C)?Z0(o,n):C},[o,n,i]),d=G0({control:o,name:n,defaultValue:u,exact:a}),l=K0({control:o,name:n,exact:a}),f=I.useRef(e),p=I.useRef(null),v=I.useRef(o.register(n,{...e.rules,value:d,...yt(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const g=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!U(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!U(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!U(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!U(l.validatingFields,n)},error:{enumerable:!0,get:()=>U(l.errors,n)}}),[l,n]),w=I.useCallback(C=>{const S=Ri(C);return U(o._fields,n)||(v.current=o.register(n,{...f.current.rules,value:S})),v.current.onChange({target:{value:Ri(C),name:n},type:pn.CHANGE})},[n,o]),b=I.useCallback(()=>{const C=U(o._formValues,n);return U(o._fields,n)||(v.current=o.register(n,{...f.current.rules,value:C})),v.current.onBlur({target:{value:C,name:n},type:pn.BLUR})},[n,o]),x=I.useCallback(C=>{C&&(p.current={focus:()=>nt(C.focus)&&C.focus(),select:()=>nt(C.select)&&C.select(),setCustomValidity:P=>nt(C.setCustomValidity)&&C.setCustomValidity(P),reportValidity:()=>nt(C.reportValidity)&&C.reportValidity()});const S=U(o._fields,n);S&&S._f&&C&&(S._f.ref=p.current,S._f._c=!0)},[o._fields,n]),_=I.useMemo(()=>({name:n,value:d,...yt(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:w,onBlur:b,ref:x}),[n,r,l.disabled,w,b,x,d]);return I.useEffect(()=>{const C=o._options.shouldUnregister||s;v.current=o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}});const S=(P,R)=>{const T=U(o._fields,P);T&&T._f&&(T._f.mount=R,T._f._c=R)};if(S(n,!0),C){const P=Oe(U(s?o._defaultValues:o._options.values||o._defaultValues,n,U(o._options.defaultValues,n,f.current.defaultValue)));_e(o._defaultValues,n,P),ve(U(o._formValues,n))&&_e(o._formValues,n,P)}if(!c&&o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}}),p.current){const P=U(o._fields,n);P&&P._f&&(P._f.ref=p.current)}return()=>{(c?C&&!o._state.action:C)?o.unregister(n):S(n,!1)}},[n,o,c,s]),I.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),I.useMemo(()=>({field:_,formState:l,fieldState:g}),[_,l,g])}const sk=e=>e.render(q0(e));var ko=e=>({isOnSubmit:!e||e===Rt.onSubmit,isOnBlur:e===Rt.onBlur,isOnChange:e===Rt.onChange,isOnAll:e===Rt.all,isOnTouch:e===Rt.onTouched}),Fs=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(const r of t.watch)if(e.startsWith(r)&&e.charAt(r.length)===".")return!0;return!1};const Zr=(e,t,n)=>{for(const r of n||Object.keys(e)){if(r==="_f")continue;const o=n?U(e,r):e[r];if(o){const{_f:s}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],s.name))return!0;if(s.ref&&t(s.ref,s.name))return!0;if(Zr(o,t))return!0}else if((Ae(o)||Array.isArray(o))&&Zr(o,t))return!0}}};var Zc=(e,t,n)=>{const r=U(e,n),o=Array.isArray(r)?r:[];return _e(o,yh,t[n]),_e(e,n,o),e},Ve=e=>Ae(e)&&!Object.keys(e).length,Yo=e=>{if(!gs)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},vs=e=>e.type==="radio",Jo=e=>e instanceof RegExp,za=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{};const Bc={value:!1,isValid:!1},Hc={value:!0,isValid:!0};var _h=e=>{if(!Array.isArray(e))return Bc;if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}const t=e[0];return!t||!t.checked||t.disabled?Bc:!t.attributes||!("value"in t.attributes)||ve(t.value)||t.value===""?Hc:{value:t.value,isValid:!0}};const Wc={isValid:!1,value:null};var xh=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Wc):Wc;function Kc(e,t,n="validate"){if(rt(e)||Array.isArray(e)&&e.every(rt)||yt(e)&&!e)return{type:n,message:rt(e)?e:"",ref:t}}var er=e=>Ae(e)&&!Jo(e)?e:{value:e,message:""},Gc=async(e,t,n,r,o,s)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:d,min:l,max:f,pattern:p,validate:v,name:g,valueAsNumber:w,mount:b,_c:x}=e._f,_=U(n,g);if(!b||t.has(g))return{};const C=a?a[0]:i,S=Z=>{if(o&&C.reportValidity){const K=yt(Z)?"":Z||"";a?a.forEach(H=>nt(H.setCustomValidity)&&H.setCustomValidity(K)):C.setCustomValidity(K),C.reportValidity()}},P={},R=vs(i),T=kr(i),A=R||T,j=(w||ms(i))&&ve(i.value)&&ve(_)||Yo(i)&&i.value===""&&!x||_===""||Array.isArray(_)&&!_.length,F=za.bind(null,g,r,P),z=(Z,K,H,J=Je.maxLength,ne=Je.minLength)=>{const te=Z?K:H;P[g]={type:Z?J:ne,message:te,ref:i,...F(Z?J:ne,te)}};if(s?!Array.isArray(_)||!_.length:c&&(!A&&(j||Xe(_))||yt(_)&&!_||T&&!_h(a).isValid||R&&!xh(a).isValid)){const{value:Z,message:K}=rt(c)?{value:!!c,message:c}:er(c);if(Z&&(P[g]={type:Je.required,message:K,ref:C,...F(Je.required,K)},!r))return S(K),P}if(!j&&(!Xe(l)||!Xe(f))){let Z,K;const H=er(f),J=er(l);if(!Xe(_)&&!Sn(_)&&!isNaN(_)){const ne=i.valueAsNumber||_&&+_;Xe(H.value)||(Z=ne>H.value),Xe(J.value)||(K=ne<J.value)}else{const ne=i.valueAsDate||new Date(_),te=me=>new Date(new Date().toDateString()+" "+me),X=i.type=="time",q=i.type=="week";rt(H.value)&&_&&(Z=X?te(_)>te(H.value):q?_>H.value:ne>new Date(H.value)),rt(J.value)&&_&&(K=X?te(_)<te(J.value):q?_<J.value:ne<new Date(J.value))}if((Z||K)&&(z(!!Z,H.message,J.message,Je.max,Je.min),!r))return S(P[g].message),P}if((u||d)&&!j&&(rt(_)||s&&Array.isArray(_))){const Z=er(u),K=er(d),H=!Xe(Z.value)&&_.length>+Z.value,J=!Xe(K.value)&&_.length<+K.value;if((H||J)&&(z(H,Z.message,K.message),!r))return S(P[g].message),P}if(p&&!j&&rt(_)){const{value:Z,message:K}=er(p);if(Jo(Z)&&!_.match(Z)&&(P[g]={type:Je.pattern,message:K,ref:i,...F(Je.pattern,K)},!r))return S(K),P}if(v){if(nt(v)){const Z=await v(_,n),K=Kc(Z,C);if(K&&(P[g]={...K,...F(Je.validate,K.message)},!r))return S(K.message),P}else if(Ae(v)){let Z={};for(const K in v){if(!Ve(Z)&&!r)break;const H=Kc(await v[K](_,n),C,K);H&&(Z={...H,...F(K,H.message)},r||S(H.message),r&&(P[g]=Z))}if(!Ve(Z)&&(P[g]={ref:C,...Z},!r))return P}}const Y=P[g];return S(Y?Y.message:!0),P},Ls=e=>Array.isArray(e)?e:[e],Sh=e=>Array.isArray(e)?e.filter(Boolean):[];function Q0(e,t){const n=t.length-1;let r=0;for(;r<n;){if(Xe(e)){e=void 0;break}e=e[t[r]],r++}return e}function Y0(e){for(const t in e)if(e.hasOwnProperty(t)&&!ve(e[t]))return!1;return!0}function Fe(e,t){if(rt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:br(t)?[t]:Un(t);if(n.some(i=>Da.includes(String(i))))return e;const r=n.length===1?e:Q0(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Ae(r)&&Ve(r)||Array.isArray(r)&&Y0(r))&&Fe(e,n.slice(0,-1)),e}const J0=I.createContext(null);J0.displayName="HookFormContext";var qc=()=>{let e=new Set,t=0;return{get observers(){return Array.from(e)},next:s=>{const i=e;t++;for(const a of i)a.next&&a.next(s);i===e&&t--},subscribe:s=>(e.add(s),{unsubscribe:()=>{t&&(e=new Set(e),t=0),e.delete(s)}}),unsubscribe:()=>{e=new Set,t=0}}};function Eh(e,t){const n=Array.isArray(e)?[]:{};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=e[r],s=t[r];o&&(Ae(o)||Array.isArray(o))&&s?n[r]=Eh(o,s):e[r]&&(n[r]=s)}return n}const Qc=(e,t)=>e!==null&&Na(e)&&Object.prototype.hasOwnProperty.call(e,t);var Yc=(e,t)=>{if(!t)return!1;let n=e;for(const r of br(t)?[t]:Un(t)){if(!Qc(n,r))return Qc(e,t);n=n[r]}return!0},X0=e=>kr(e)?e.checked!==e.defaultChecked:!vs(e)&&"defaultValue"in e&&e.value!==e.defaultValue,Ch=e=>e.type==="select-multiple",e_=e=>vs(e)||kr(e),Vs=e=>Yo(e)&&e.isConnected;function Jc(e){return Array.isArray(e)||Ae(e)}function kh(e,t,n="",r=[]){for(const o in e){const s=n?`${n}.${o}`:o,i=e[o];Jc(i)&&Jc(U(t,s))?kh(i,t,s,r):r.push(s)}return r}var t_=e=>{for(const t in e)if(nt(e[t]))return!0;return!1};function Oh(e){return Array.isArray(e)||Ae(e)&&!t_(e)}function Ph(e){return!!(e&&"_f"in e)}function Rh(e){return Array.isArray(e)?!e.some(t=>!ve(t)):!Object.keys(e).length}function Ai(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function Ni(e,t={},n){for(const r in e){const o=e[r],s=n&&n[r];Oh(o)&&(!Array.isArray(o)||!Ph(s))?(t[r]=Array.isArray(o)?[]:{},Ni(o,t[r],s),Rh(t[r])&&Ai(t,r)):ve(o)||(t[r]=!0)}return t}function Gt(e,t,n,r){n||(n=Ni(t,Array.isArray(t)?[]:{},r));for(const o in e){const s=e[o],i=r&&r[o];Oh(s)&&(!Array.isArray(s)||!Ph(i))?(ve(t)||Ti(n[o])?n[o]=Ni(s,Array.isArray(s)?[]:{},i):Gt(s,Xe(t)?{}:t[o],n[o],i),Rh(n[o])&&Ai(n,o)):at(s,t[o])?Ai(n,o):n[o]=!0}return n}var n_=(e,t)=>{const n=t.split("."),r=[];let o=n[0];for(let s=1;s<n.length;o+="."+n[s++])!isNaN(+n[s])&&e.has(o)&&r.push(`${o}.${n[s]}`);return r},Di=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ve(e)?e:t?e===""?NaN:e&&+e:n&&rt(e)?new Date(e):r?r(e):e;function Xc(e){const t=e.ref;return ms(t)?t.files:vs(t)?xh(e.refs).value:Ch(t)?[...t.selectedOptions].map(({value:n})=>n):kr(t)?_h(e.refs).value:Di(t.value,e)}var r_=(e,t,n,r)=>{const o={};for(const s of e){const i=U(t,s);i&&_e(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},$r=e=>ve(e)?e:Jo(e)?e.source:Ae(e)?Jo(e.value)?e.value.source:e.value:e;const el="AsyncFunction";var o_=e=>{if(!e||!e.validate)return!1;if(nt(e.validate))return e.validate.constructor.name===el;if(Ae(e.validate)){for(const t in e.validate)if(e.validate[t].constructor.name===el)return!0}return!1},s_=e=>e.mount&&(e.required||!ve(e.required)&&e.required!==!1||!ve(e.min)||!ve(e.max)||!ve(e.maxLength)||!ve(e.minLength)||e.pattern||e.validate);function tl(e,t,n){const r=U(e,n);if(r&&(r.type||r.message)||Array.isArray(r))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=U(t,s),a=U(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:n}}var i_=(e,t,n)=>{const r=Object.keys(e).filter(o=>o!=="name");return!r.length||n&&r.length>=Object.keys(t).length||r.find(o=>t[o]===(!n||Rt.all))};const nl=(e,t,n)=>n?e===t||e.startsWith(t+"."):e.startsWith(t)||t.startsWith(e);var rl=(e,t,n)=>{if(!e||!t||e===t)return!0;if(!Array.isArray(e))return nl(e,t,n);for(const r of e)if(r&&nl(r,t,n))return!0;return!1},a_=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,c_=(e,t)=>{const n=U(e,t);!Sh(n).length&&!(n&&n.root)&&Fe(e,t)};const Uo={mode:Rt.onSubmit,reValidateMode:Rt.onChange,shouldFocusError:!0},l_=(e,t)=>{for(const n in e)delete e[n];Object.assign(e,t)},Th={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function u_(e={}){let t={...Uo,...e},n={...Oe(Th),isLoading:nt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},o=Ae(t.defaultValues)||Ae(t.values)?Oe(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Oe(o),i={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},a=!1,c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const u={},d={},l=new Set;let f=ko(t.mode),p=ko(t.reValidateMode);const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...v},w={},b=(...y)=>y.some(O=>g[O]||w[O]),x=y=>{for(const O of l)if(rl(O.name,y,O.exact))return!0;return!1},_={array:qc(),state:qc()};let C=0,S=0,P=t.criteriaMode===Rt.all;const R=(y,O)=>k=>{clearTimeout(d[y]),d[y]=setTimeout(O,k)},T=y=>{clearTimeout(d[y]),delete d[y],delete u[y]},A=y=>{T(y);const O=`${y}.`;for(const k of Object.keys(u))k.startsWith(O)&&T(k)},j=async y=>{if(!i.keepIsValid&&!t.disabled&&(b("isValid")||y)){const O=++C;let k;t.resolver?(k=Ve((await q()).errors),O===C&&F()):k=await ae({fields:r,onlyCheckValid:!0,eventType:pn.VALID}),O===C&&k!==n.isValid&&_.state.next({isValid:k})}},F=(y,O)=>{!t.disabled&&b("isValidating","validatingFields")&&((y||c.mount).forEach(k=>{k&&(O?_e(n.validatingFields,k,O):Fe(n.validatingFields,k))}),_.state.next({validatingFields:n.validatingFields,isValidating:!Ve(n.validatingFields)}))},z=()=>{n.dirtyFields=Gt(o,s,void 0,r)},Y=(y,O=[],k,N,$=!0,W=!0)=>{if(N&&k&&!t.disabled){i.action=!0;const L=U(r,y);if(i.actionArrayLengths.has(y)||i.actionArrayLengths.set(y,Array.isArray(L)?L.length:0),W&&Array.isArray(L)){const be=k(L,N.argA,N.argB);$&&_e(r,y,be)}const D=U(n.errors,y);if(W&&Array.isArray(D)){const be=D.root,we=k(D,N.argA,N.argB)||D;be&&(we.root=be),$&&_e(n.errors,y,we),c_(n.errors,y),n.errors={...n.errors}}const V=U(n.touchedFields,y),Q=W&&Array.isArray(V);if(Q){const be=k(V,N.argA,N.argB);$&&_e(n.touchedFields,y,be)}const ue=U(n.dirtyFields,y);if(W&&Array.isArray(ue)){const be=k(ue,N.argA,N.argB)||ue;$&&_e(n.dirtyFields,y,be)}b("dirtyFields")?z():a=!0,_.state.next({name:y,isDirty:B(y,O),dirtyFields:n.dirtyFields,...Q&&{touchedFields:n.touchedFields},errors:n.errors,isValid:n.isValid})}else _e(s,y,O)},Z=(y,O)=>{_e(n.errors,y,O),n.errors={...n.errors},_.state.next({errors:n.errors})},K=y=>{Object.keys(u).forEach(T);const O=!Ve(y);n.errors=y,_.state.next({errors:n.errors,...O?{isValid:!1}:{}}),!O&&i.mount&&j()},H=y=>{const O=br(y)?[y]:Un(y);let k=s,N=o;for(let $=0;$<O.length-1;$++){const W=O[$];if(k=Xe(k)?k:k[W],N=Xe(N)?N:N[W],k===null&&N!==null)return!0}return!1},J=y=>{if(!i.actionArrayLengths.size)return!1;const O=br(y)?[y]:Un(y);let k=s,N="",$=-1,W=0;for(let L=0;L<O.length;L++){if(Xe(k))return!1;const D=O[L];if(N=N?`${N}.${D}`:D,Array.isArray(k)&&+D>=k.length)return $===-1?!1:L===$?+D<W:!0;if(i.actionArrayLengths.has(N)&&($=L+1,W=i.actionArrayLengths.get(N)),k=k[D],ve(k)&&$!==-1&&L>$&&+O[$]<W)return!0}return!1},ne=(y,O,k,N)=>{const $=U(r,y);if($){if(H(y)||J(y))return;const W=ve(U(s,y)),L=U(s,y,ve(k)?U(o,y):k),D=!!N&&!n.isReady&&X0(N);if(ve(L)||N&&N.defaultChecked||D||O){const V=O?L:Xc($._f);b("dirtyFields")&&!at(U(s,y),V)&&(a=!0),_e(s,y,V),D&&te(y,V)}else le(y,L);i.mount&&!i.action&&(t.resolver&&b("isValidating","validatingFields")?Promise.resolve().then(()=>j()):j(),W&&n.isDirty&&b("isDirty")&&(B()||(n.isDirty=!1,_.state.next({...n}))),t.shouldUnregister&&W&&!ve(U(s,y))&&Fs(y,c)&&(i.watch=!0))}},te=(y,O,k,N,$)=>{let W=!1,L=!1;const D={name:y};if(!t.disabled||N===!0){if(!k||N){const V=at(U(o,y),O);if(b("isDirty")&&(L=n.isDirty,n.isDirty=D.isDirty=!V||B(),W=L!==D.isDirty),L=!!U(n.dirtyFields,y),V)Fe(n.dirtyFields,y);else{const ue=U(o,y),be=U(r,y),we=!(be&&be._f)&&(Ae(ue)||Array.isArray(ue))?Gt(ue,O,void 0,be):!0;_e(n.dirtyFields,y,we)}let Q=!1;if(a||V&&(b("isDirty")?n.isDirty:B())){a=!1;const ue=Gt(o,s,void 0,r);at(n.dirtyFields,ue)||(Q=!0,l_(n.dirtyFields,ue))}D.dirtyFields=n.dirtyFields,W=W||b("dirtyFields")&&(Q||L!==!V)}if(k){const V=Yc(n.touchedFields,y)?U(n.touchedFields,y):void 0;V||(_e(n.touchedFields,y,k),D.touchedFields=n.touchedFields,W=W||b("touchedFields")&&V!==k)}W&&$&&_.state.next(D)}return W?D:{}},X=(y,O,k,N)=>{const $=U(n.errors,y),W=b("isValid")&&yt(O)&&n.isValid!==O;if(t.delayError&&k?(u[y]=R(y,()=>Z(y,k)),u[y](t.delayError)):(T(y),k?_e(n.errors,y,k):Fe(n.errors,y),n.errors={...n.errors}),(k?!at($,k,!0):$)||!Ve(N)||W){const L={...N,...W&&yt(O)?{isValid:O}:{},errors:n.errors,name:y};_.state.next(L)}},q=async y=>(F(y,!0),await t.resolver(s,t.context,r_(y||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),me=async y=>{const O=S,{errors:k}=await q(y);if(O!==S)return k;if(F(y),y){for(const N of y){const $=U(k,N);A(N);const W=c.array.has(N)&&Ae($)&&!Object.keys($).some(V=>!Number.isNaN(Number(V))),L=U(r,N),D=Ae(L)&&Object.keys(L).some(V=>V!=="_f");W?Zc(n.errors,{[N]:$},N):$&&($.type||$.message)||Array.isArray($)||Ae($)&&D?_e(n.errors,N,$):Fe(n.errors,N)}n.errors={...n.errors}}else Object.keys(u).forEach(T),n.errors=k;return k},he=async({name:y,eventType:O})=>{if(t.validate){const k=S,N=await t.validate({formValues:s,formState:n,name:y,eventType:O});if(k!==S)return!0;if(Ae(N)){let $=!0;Rn(Lr);for(const W in N){const L=N[W];L&&($=!1,on(`${Lr}.${W}`,{message:rt(L.message)?L.message:"",type:L.type||Je.validate}))}return $}else return rt(N)||!N?(on(Lr,{message:N||"",type:Je.validate}),!1):(Rn(Lr),!0)}return!0},ae=async({fields:y,onlyCheckValid:O,name:k,eventType:N,context:$={valid:!0,runRootValidation:!1}})=>{const W=S;if(t.validate&&!$.runRootValidation&&($.runRootValidation=!0,!await he({name:k,eventType:N})&&($.valid=!1,O)))return $.valid;for(const L in y){const D=y[L];if(D){const{_f:V,...Q}=D;if(V){const ue=c.array.has(V.name),be=D._f&&o_(D._f),we=b("isValidating","validatingFields");be&&we&&F([V.name],!0);const ke=await Gc(D,c.disabled,s,P,t.shouldUseNativeValidation&&!O,ue);if(W!==S)return $.valid;if(be&&we&&F([V.name]),ke[V.name]&&($.valid=!1,O)||(O||(T(V.name),U(ke,V.name)?ue?Zc(n.errors,ke,V.name):_e(n.errors,V.name,ke[V.name]):Fe(n.errors,V.name)),t.shouldUseNativeValidation&&ke[V.name]))break}!Ve(Q)&&await ae({context:$,onlyCheckValid:O,fields:Q,name:L,eventType:N})}}return $.valid},re=()=>{for(const y of c.unMount){const O=U(r,y);O&&(O._f.refs?O._f.refs.every(k=>!Vs(k)):!Vs(O._f.ref))&&Ir(y)}c.unMount=new Set},B=(y,O)=>(y&&O&&_e(s,y,O),!at(i.mount?s:o,o)),se=(y,O,k)=>{const N=i.mount?s:ve(O)||!ve(y)?o:O;return Ii(y,c,ve(y)?{...N}:N,k,O)},ye=y=>Sh(U(i.mount?s:o,y,t.shouldUnregister?U(o,y,[]):[])),le=(y,O,k={},N=!1,$=!1,W=!1)=>{const L=U(r,y);let D=O;if(L){const V=L._f;V&&(!V.disabled&&_e(s,y,Di(O,V)),D=Yo(V.ref)&&Xe(O)?"":O,Ch(V.ref)?[...V.ref.options].forEach(Q=>Q.selected=D.includes(Q.value)):V.refs?kr(V.ref)?V.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(D)?Q.checked=!!D.find(ue=>ue===Q.value):Q.checked=D===Q.value||!!D)}):V.refs.forEach(Q=>Q.checked=Q.value===D):ms(V.ref)?V.ref.value="":(V.ref.value=D,!V.ref.type&&!$&&!W&&_.state.next({name:y,values:N?s:x(y)?Oe(s):void 0})))}(k.shouldDirty||k.shouldTouch)&&te(y,L&&L._f&&!L._f.disabled&&(L._f.valueAsNumber||L._f.valueAsDate||L._f.setValueAs)?Di(O,L._f):D,k.shouldTouch,k.shouldDirty,!$),k.shouldValidate&<(y,{delayError:k.delayError}),k.shouldValidate&&L&&L._f&&L._f.deps&&(!Array.isArray(L._f.deps)||L._f.deps.length>0)&<(L._f.deps)},Pe=(y,O,k,N=!1,$=!1,W=!1)=>{c.array.has(y)&&_.array.next({name:y,values:N?s:Oe(s)});for(const L in O){if(!O.hasOwnProperty(L))continue;const D=O[L],V=y+"."+L,Q=U(r,V);(c.array.has(y)||Ae(D)||Q&&!Q._f)&&!Sn(D)?Pe(V,D,k,N,$,W):le(V,D,k,N,$,W)}},je=(y,O,k,N,$=!1)=>{const W=U(r,y),L=c.array.has(y),D=N?O:Oe(O),V=U(s,y),Q=at(V,D);if(Q||_e(s,y,D),L)_.array.next({name:y,values:N?s:Oe(s)}),b("isDirty","dirtyFields")&&k.shouldDirty&&(z(),$||_.state.next({name:y,dirtyFields:n.dirtyFields,isDirty:B(y,D)})),k.shouldValidate&<(y,{delayError:k.delayError});else{const ue=Array.isArray(D)&&!D.length||Ve(D),be=!Q&&!$;!W||W._f||Xe(D)||ue?le(y,D,k,N,$,be):Pe(y,D,k,N,$,be)}if(!Q&&!$){const ue=Fs(y,c),be=i.mount||ue?y:void 0,we=L?[]:n_(c.array,y),ke=N?s:x(be)||we.some(x)?Oe(s):void 0;_.state.next({...ue&&n,name:be,values:ke});for(const mt of we)_.state.next({name:mt,values:ke})}},Ee=(y,O,k={})=>je(y,O,k,!1),$e=(y,O={})=>{const k=nt(y)?y(s):y;if(!at(s,k)){s={...s,...k};for(const N of c.mount)Yc(k,N)&&je(N,U(k,N),O,!0,!0);_.state.next({...n,name:void 0,type:void 0,...l.size?{values:s}:{}}),O.shouldValidate&&j()}},We=async y=>{i.mount=!0;const O=y.target;let k=O.name,N=!0;const $=U(r,k),W=L=>{N=Number.isNaN(L)||Sn(L)&&isNaN(L.getTime())||at(L,U(s,k,L))};if($){let L,D;const V=O.type?Xc($._f):Ri(y),Q=y.type===pn.BLUR||y.type===pn.FOCUS_OUT,ue=!s_($._f)&&!t.validate&&!t.resolver&&!U(n.errors,k)&&!$._f.deps,be=ue||a_(Q,U(n.touchedFields,k),n.isSubmitted,p,f),we=Fs(k,c,Q);_e(s,k,Oe(V)),Q?(!O||!O.readOnly)&&($._f.onBlur&&$._f.onBlur(y),Object.prototype.hasOwnProperty.call(u,k)&&u[k](0)):$._f.onChange&&$._f.onChange(y);const ke=te(k,V,Q),mt=!Ve(ke)||we;if(!Q&&_.state.next({name:k,type:y.type,...x(k)?{values:Oe(s)}:{}}),be)return(!ue||!n.isValid)&&b("isValid")&&(t.mode==="onBlur"?Q&&j():Q||j()),mt&&_.state.next({name:k,...we?{}:ke});if(!t.resolver&&t.validate&&await he({name:k,eventType:y.type}),!Q&&we&&_.state.next({...n}),t.resolver){const ln=S,{errors:_t}=await q([k]);if(ln!==S)return;if(F([k]),W(V),!N){!Ve(ke)&&_.state.next(ke);return}const Dr=tl(n.errors,r,k),tc=tl(_t,r,Dr.name||k);L=tc.error,k=tc.name,D=Ve(_t)}else{const ln=S;if(F([k],!0),L=(await Gc($,c.disabled,s,P,t.shouldUseNativeValidation))[k],ln!==S)return;if(F([k]),W(V),N){if(L)D=!1;else if(b("isValid")&&(D=await ae({fields:r,onlyCheckValid:!0,name:k,eventType:y.type}),ln!==S))return}}N&&($._f.deps&&(!Array.isArray($._f.deps)||$._f.deps.length>0)&<($._f.deps),X(k,D,L,ke))}},kt=(y,O)=>{if(U(n.errors,O)&&y.focus)return y.focus(),1},lt=async(y,O={})=>{let k,N;const $=Ls(y);if(t.resolver){const W=S,L=await me(ve(y)?y:$);if(k=Ve(L),N=y?!$.some(D=>U(L,D)):k,W!==S)return N}else y?(N=(await Promise.all($.map(async W=>{const L=U(r,W);return await ae({fields:L&&L._f?{[W]:L}:L,eventType:pn.TRIGGER})}))).every(Boolean),!(!N&&!n.isValid)&&j()):N=k=await ae({fields:r,name:y,eventType:pn.TRIGGER});if(O.delayError&&t.delayError&&rt(y)){const W=U(n.errors,y);W?(Fe(n.errors,y),u[y]=R(y,()=>Z(y,W)),u[y](t.delayError)):T(y)}if(O.shouldTouch)for(const W of y?$:c.mount)!c.array.has(W)&&_e(n.touchedFields,W,!0);return n.errors={...n.errors},_.state.next({...!rt(y)||b("isValid")&&k!==n.isValid?{}:{name:y},...t.resolver||!y?{isValid:k}:{},...O.shouldTouch&&b("touchedFields")?{touchedFields:n.touchedFields}:{},errors:n.errors}),O.shouldFocus&&!N&&Zr(r,kt,y?$:c.mount),N},Le=(y,O)=>{let k={...i.mount?s:o};return O&&(k=Eh(O.dirtyFields?n.dirtyFields:n.touchedFields,k)),ve(y)?k:rt(y)?U(k,y):y.map(N=>U(k,N))},qn=y=>ve(y)?{...n.errors}:rt(y)?U(n.errors,y):y.map(O=>U(n.errors,O)),pt=(y,O)=>{const k=O||n,N=U(k.errors,y);return{invalid:!!N,isDirty:!!U(k.dirtyFields,y),error:N,isValidating:!!U(k.validatingFields,y),isTouched:!!U(k.touchedFields,y)}},Rn=y=>{const O=y?Ls(y):void 0;O?O.forEach(k=>{A(k),Fe(n.errors,k),n.errors={...n.errors},_.state.next({name:k,errors:n.errors})}):(Object.keys(u).forEach(T),n.errors={},_.state.next({errors:n.errors}))},on=(y,O,k)=>{A(y);const N=(U(r,y,{_f:{}})._f||{}).ref,$=U(n.errors,y)||{},{ref:W,message:L,type:D,types:V,...Q}=$;_e(n.errors,y,{...Q,...O,ref:N}),n.errors={...n.errors},_.state.next({name:y,errors:n.errors,isValid:!1}),k&&k.shouldFocus&&N&&N.focus&&N.focus()},ze=(y,O)=>{if(nt(y)){const k={};l.add(k);const{unsubscribe:N}=_.state.subscribe({next:$=>"values"in $&&y($.values||se(void 0,O),$)});return{unsubscribe:()=>{l.delete(k),N()}}}return se(y,O,!0)},Tr=y=>{const O={name:y.name,exact:y.exact};y.formState&&y.formState.values&&l.add(O);const{unsubscribe:k}=_.state.subscribe({next:N=>{if(rl(y.name,N.name,y.exact)&&i_(N,y.formState||g,y.reRenderRoot)){const $=N.values||{...s};y.callback({...n,...N,values:$,defaultValues:o})}}});return()=>{l.delete(O),k()}},sn=y=>{i.mount=!0;const O=Object.keys(y.formState||{}).filter(N=>y.formState&&y.formState[N]);for(const N of O)w[N]=(w[N]||0)+1;const k=Tr({...y,formState:{...v,...y.formState}});return()=>{for(const N of O.splice(0))w[N]--;k()}},Ir=(y,O={})=>{for(const k of y?Ls(y):c.mount)c.mount.delete(k),c.array.delete(k),c.disabled.delete(k),O.keepValue||(Fe(r,k),Fe(s,k)),O.keepError||(A(k),Fe(n.errors,k)),!O.keepDirty&&Fe(n.dirtyFields,k),!O.keepTouched&&Fe(n.touchedFields,k),!O.keepIsValidating&&Fe(n.validatingFields,k),!t.shouldUnregister&&!O.keepDefaultValue&&Fe(o,k);O.keepError||(n.errors={...n.errors}),l.size&&_.state.next({values:Oe(s)}),_.state.next({...n,...O.keepDirty?{}:{isDirty:B()},...O.keepIsValidating?{}:{isValidating:!Ve(n.validatingFields)}}),!O.keepIsValid&&j()},fo=({disabled:y,name:O})=>{if(yt(y)&&i.mount||y||c.disabled.has(O)){const $=c.disabled.has(O)!==!!y;y?c.disabled.add(O):c.disabled.delete(O),$&&i.mount&&!i.action&&j()}},an=(y,O={})=>{let k=U(r,y);const N=yt(O.disabled)||yt(t.disabled),$=!c.registerName.has(y)&&k&&k._f&&!k._f.mount;if(_e(r,y,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:y}},name:y,mount:!0,...O}}),c.mount.add(y),k&&k._f){const W=U(r,y);for(const L of B0)L in O||delete W._f[L]}return k&&!$?fo({disabled:yt(O.disabled)?O.disabled:t.disabled,name:y}):ne(y,!0,O.value),{...N?{disabled:O.disabled||t.disabled}:{},...t.progressive?{required:!!O.required,min:$r(O.min),max:$r(O.max),minLength:$r(O.minLength),maxLength:$r(O.maxLength),pattern:$r(O.pattern)}:{},name:y,onChange:We,onBlur:We,ref:W=>{if(W){c.registerName.add(y),an(y,O),c.registerName.delete(y),k=U(r,y);const L=ve(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,D=e_(L),V=k._f.refs||[];if(D?V.find(ue=>ue===L):L===k._f.ref)return;const Q={...k._f};D?(Q.refs=[...V.filter(Vs),L,...Array.isArray(U(o,y))?[{}]:[]],Q.ref={type:L.type,name:y}):(Q.ref=L,delete Q.refs),_e(r,y,{_f:Q}),ne(y,!1,void 0,L)}else k=U(r,y,{}),k._f&&(k._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(vh(c.array,y)&&i.action)&&c.unMount.add(y)}}},Ar=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Zr(r,kt,c.mount),ho=y=>{yt(y)&&(_.state.next({disabled:y}),Zr(r,(O,k)=>{const N=U(r,k);N&&(O.disabled=N._f.disabled||y,Array.isArray(N._f.refs)&&N._f.refs.forEach($=>{$.disabled=N._f.disabled||y}))},0))},Qn=(y,O)=>async k=>{let N,$;k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let W=Oe(s);if(_.state.next({isSubmitting:!0}),t.resolver){const L=S,{errors:D,values:V}=await q();if(L!==S)return;F(),Object.keys(u).forEach(T),n.errors=D,W=Oe(V)}else{const L=S;if(await ae({fields:r,eventType:pn.SUBMIT}),L!==S)return;Fe(n.errors,yh),n.errors={...n.errors}}if(c.disabled.size)for(const L of c.disabled)Fe(W,L);if(Ve(n.errors)){_.state.next({errors:{}});try{N=await y(W,k)}catch(L){$=L}}else O&&await O({...n.errors},k),Ar(),setTimeout(Ar);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ve(n.errors)&&!$,submitCount:n.submitCount+1,errors:n.errors}),$)throw $;return N},cn=(y,O={})=>{U(r,y)&&(Fe(n.validatingFields,y),ve(O.defaultValue)?Ee(y,Oe(U(o,y))):(Ee(y,O.defaultValue),_e(o,y,Oe(O.defaultValue))),O.keepTouched||Fe(n.touchedFields,y),O.keepDirty||(Fe(n.dirtyFields,y),n.isDirty=O.defaultValue?B(y,Oe(U(o,y))):B()),O.keepError||(A(y),Fe(n.errors,y),n.errors={...n.errors},j()),_.state.next({...n,isValidating:!Ve(n.validatingFields)}))},Nr=(y,O={})=>{S++;const k=y?Oe(y):o,N=Oe(k),$=Ve(y),W=N,L=r;if(Object.keys(u).forEach(T),O.keepDefaultValues||(o=k),!O.keepValues){if(O.keepDirtyValues){const D=new Set([...c.mount,...kh(Gt(o,s,void 0,L),n.dirtyFields)]);for(const V of D){const Q=U(n.dirtyFields,V),ue=U(s,V),be=U(W,V);Q&&!ve(ue)?_e(W,V,ue):!Q&&!ve(be)&&Ee(V,be)}}else{if(gs&&ve(y))for(const D of c.mount){const V=U(r,D);if(V&&V._f){const Q=Array.isArray(V._f.refs)?V._f.refs[0]:V._f.ref;if(Yo(Q)){const ue=Q.closest("form");if(ue){ue.reset();break}}}}if(O.keepFieldsRef)for(const D of c.mount)Ee(D,U(W,D));else r={}}if(t.shouldUnregister){if(s=O.keepDefaultValues?Oe(o):{},O.keepFieldsRef)for(const D of c.mount)_e(s,D,U(W,D))}else s=Oe(W);_.array.next({values:{...W}}),_.state.next({name:void 0,type:void 0,values:{...W}})}c={mount:O.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!g.isValid||!!O.keepIsValid||!!O.keepDirtyValues||!t.shouldUnregister&&!Ve(W),i.watch=!!t.shouldUnregister,i.keepIsValid=!!O.keepIsValid,i.action=!1,i.actionArrayLengths.clear(),a=!1,O.keepErrors||(n.errors={}),_.state.next({submitCount:O.keepSubmitCount?n.submitCount:0,isDirty:$?!1:O.keepDirty?n.isDirty:O.keepValues?B():!!(O.keepDefaultValues&&y&&!at(y,o)),isSubmitted:O.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:$?{}:O.keepDirtyValues?O.keepDefaultValues&&s?Gt(o,s,void 0,L):n.dirtyFields:O.keepDefaultValues&&y?Gt(o,y,void 0,L):O.keepDirty?n.dirtyFields:O.keepValues?Gt(o,s,void 0,L):{},touchedFields:O.keepTouched?n.touchedFields:{},...!O.keepIsValidating&&(n.isValidating||!Ve(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:O.keepErrors?n.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ht=(y,O)=>Nr(nt(y)?y(s):y,{...t.resetOptions,...O}),xs=(y,O={})=>{const k=U(r,y),N=k&&k._f;if(N){const $=N.refs?N.refs[0]:N.ref;$.focus&&setTimeout(()=>{$.focus(),O.shouldSelect&&nt($.select)&&$.select()})}},Ss=y=>{const{name:O,type:k,values:N,...$}=y;Object.keys($).length&&(n={...n,...$})};_.state.subscribe({next:Ss});const wt={control:{register:an,unregister:Ir,getFieldState:pt,handleSubmit:Qn,setError:on,_subscribe:Tr,_runSchema:q,_updateIsValidating:F,_focusError:Ar,_getWatch:se,_getDirty:B,_setValid:j,_setFieldArray:Y,_setDisabledField:fo,_setErrors:K,_getFieldArray:ye,_reset:Nr,_resetDefaultValues:()=>nt(t.defaultValues)&&t.defaultValues().then(y=>{Ht(y,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:re,_disableForm:ho,_subjects:_,_proxyFormState:g,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(y){i=y},get _defaultValues(){return o},get _names(){return c},set _names(y){c=y},get _formState(){return n},get _options(){return t},set _options(y){t={...t,...y},f=ko(t.mode),p=ko(t.reValidateMode),P=t.criteriaMode===Rt.all}},subscribe:sn,trigger:lt,register:an,handleSubmit:Qn,watch:ze,setValue:Ee,setValues:$e,getValues:Le,getErrors:qn,reset:Ht,resetField:cn,resetDefaultValues:(y,O={})=>{if(o=Oe(y),!O.keepDirty){const k=Gt(o,s,void 0,r);n.dirtyFields=k,n.isDirty=!Ve(k)}O.keepIsValid||j(),_.state.next({...n,defaultValues:o})},clearErrors:Rn,unregister:Ir,setError:on,setFocus:xs,getFieldState:pt};return{...wt,formControl:wt}}const ol={mode:Uo.mode,reValidateMode:Uo.reValidateMode,shouldFocusError:Uo.shouldFocusError,resolver:void 0,criteriaMode:void 0,delayError:void 0,shouldUnregister:void 0,shouldUseNativeValidation:void 0,context:void 0};function d_(e={}){const t=I.useRef(void 0),n=I.useRef(void 0),r=I.useRef(e.formControl),o=I.useRef(!!e.validate),[s,i]=I.useState(()=>({...Oe(Th),isLoading:nt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:nt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl)if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!nt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:p,...v}=u_(e);t.current={...v,formState:s}}const a=t.current.control,c=a._options,u={};for(const p in ol)p in c&&!(p in e)&&(u[p]=ol[p]);a._options={...u,...e,validate:e.validate};const d=()=>({...a._formState,defaultValues:a._defaultValues}),{resyncIfNeeded:l,snapshot:f}=$a(d);return ja(()=>{l(!0,d,i);const p=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return i(v=>({...v,isReady:!0})),a._formState.isReady=!0,()=>{p(),f(!0,d)}},[a,l,f]),I.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),I.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),I.useEffect(()=>{o.current&&!e.validate&&t.current&&t.current.clearErrors(Lr),o.current=!!e.validate},[e.validate]),I.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),I.useEffect(()=>{if(a._proxyFormState.isDirty){const p=a._getDirty();p!==s.isDirty&&a._subjects.state.next({isDirty:p})}},[a,s.isDirty]),I.useEffect(()=>{e.values&&!at(e.values,n.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),a._options.resetOptions&&a._options.resetOptions.keepIsValid||a._setValid(),n.current=e.values,i(p=>({...p}))):a._resetDefaultValues()},[a,e.values]),I.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=I.useMemo(()=>wh(s,a),[a,s]),t.current}const sl=(e,t,n)=>{if(e&&"reportValidity"in e){const r=U(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Mi=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?sl(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>sl(o,n,e))}},il=(e,t)=>{t.shouldUseNativeValidation&&Mi(e,t);const n={};for(const r in e){const o=U(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.refs?o.refs[0]:o&&o.ref});if(f_(t.names||Object.keys(e),r)){const i=Object.assign({},U(n,r));_e(i,"root",s),_e(n,r,i)}else _e(n,r,s)}return n},f_=(e,t)=>{const n=al(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(r=>al(r).match(`^${n}\\.\\d+`))};function al(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function ji(){return ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ji.apply(null,arguments)}function cl(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function h_(e,t){for(var n=Object.create(null);e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a,c,u=r.unionErrors.reduce(function(f,p){return p.errors.length<f.errors.length?p:f}).errors[0];n[i]={message:(a=u==null?void 0:u.message)!=null?a:s,type:(c=u==null?void 0:u.code)!=null?c:o}}else n[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return e.push(p)})}),t){var d=n[i].types,l=d&&d[r.code];n[i]=za(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function p_(e,t){for(var n=Object.create(null),r=function(){var o=e[0],s=o.code,i=o.message,a=o.path.join(".");if(!n[a])if(o.code==="invalid_union"&&o.errors.length>0){var c,u,d=o.errors.reduce(function(p,v){return v.length<p.length?v:p})[0];n[a]={message:(c=d==null?void 0:d.message)!=null?c:i,type:(u=d==null?void 0:d.code)!=null?u:s}}else n[a]={message:i,type:s};if(o.code==="invalid_union"&&o.errors.forEach(function(p){return p.forEach(function(v){return e.push(ji({},v,{path:[].concat(o.path,v.path)}))})}),t){var l=n[a].types,f=l&&l[o.code];n[a]=za(a,t,n,s,f?[].concat(f,o.message):o.message)}e.shift()};e.length;)r();return n}function m_(e,t,n){if(n===void 0&&(n={}),(function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(cl(function(){function i(c){return s.shouldUseNativeValidation&&Mi({},s),{errors:{},values:n.raw?Object.assign({},r):c}}var a=e;return n.mode==="sync"?i(a.parse(r,t)):Promise.resolve(a.parseAsync(r,t)).then(i)},function(i){if((function(a){var c;return!(a==null||(c=a._zod)==null||(c=c.traits)==null||!c.has("$ZodError"))})(i))return{values:{},errors:il(p_(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_def"in r&&typeof r._def=="object"})(e))return function(r,o,s){try{return Promise.resolve(cl(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return s.shouldUseNativeValidation&&Mi({},s),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a==null?void 0:a.issues)})(i))return{values:{},errors:il(h_(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}function $i(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ll(e,t="|"){return e.map(n=>jh(n)).join(t)}function zi(e,t){return typeof t=="bigint"?t.toString():t}class g_{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Fa(e){return new g_(e)}function v_(e){return e==null}function La(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function y_(e,t){const n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}function Gn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ih(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t!=null&&t.get?t.get.raw:t==null?void 0:t.value}function tn(e){return Ih(e._zod.def)??e._zod.def.shape}function Ah(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return Gn(this,t,r),r},enumerable:!0,configurable:!0})}function Nh(e,t,n){t in e?Gn(e,t,n):e[t]=n}function Zn(e,t,n,r){const o=tn(t);for(const s of n){const i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?Ah(e,s,()=>{const a=t._zod.def.shape[s];return r?r(a,s):a}):Nh(e,s,r?r(i.value,s):i.value))}}function b_(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ah(e,n,()=>t[n]):Nh(e,n,r.value))}}function St(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function w_(e){return JSON.stringify(e)}function __(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Dh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const x_=Fa(()=>{var e;if(Bt.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Yr(e){if(Xo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Xo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Mh(e){return Yr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const S_=new Set(["string","number","symbol"]);function ys(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function On(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function oe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jh(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function E_(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const $h={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},C_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function k_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s={};return Zn(s,e,bs(e,t)),On(e,St(n,{shape:s,checks:[]}))}function bs(e,t){var o;const n=tn(e),r=[];for(const s of Reflect.ownKeys(t)){if(!((o=Object.getOwnPropertyDescriptor(n,s))!=null&&o.enumerable))throw new Error(`Unrecognized key: "${String(s)}"`);t[s]&&r.push(s)}return r}function O_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=new Set(bs(e,t)),i={};return Zn(i,e,Reflect.ownKeys(tn(e)).filter(a=>!s.has(a))),On(e,St(n,{shape:i,checks:[]}))}function P_(e,t){if(!Yr(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=tn(e);for(const s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return On(e,St(e._zod.def,{shape:zh(e,t)}))}function zh(e,t){const n={};return Zn(n,e,Reflect.ownKeys(tn(e))),b_(n,t),n}function R_(e,t){if(!Yr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return On(e,St(e._zod.def,{shape:zh(e,t)}))}function T_(e,t){var o,s;if(!((o=t==null?void 0:t._zod)!=null&&o.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((s=e._zod.def.checks)!=null&&s.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};Zn(n,e,Reflect.ownKeys(tn(e))),Zn(n,t,Reflect.ownKeys(tn(t)));const r=St(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return On(e,r)}function ul(e,t,n,r="partial"){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const a=n?new Set(bs(t,n)):void 0,c={};return Zn(c,t,Reflect.ownKeys(tn(t)),e&&((u,d)=>a&&!a.has(d)?u:new e({type:"optional",innerType:u}))),On(t,St(t._zod.def,{shape:c,checks:[]}))}function I_(e,t,n){const r=n?new Set(bs(t,n)):void 0,o={};return Zn(o,t,Reflect.ownKeys(tn(t)),(s,i)=>r&&!r.has(i)?s:new e({type:"nonoptional",innerType:s})),On(t,St(t._zod.def,{shape:o}))}function Yt(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function A_(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Va(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function zr(e){return typeof e=="string"?e:e==null?void 0:e.message}function dl(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const o=r.maximum??r.length??r.size;o>=0&&t.push([o,n])}return t}function Fi(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function Or(e,t,n){var c,u,d,l,f,p,v,g,w,b;var r;const o=(u=(c=e.inst)==null?void 0:c._zod)==null?void 0:u.traits;o!=null&&o.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const s=e.schema!==e.inst?(l=(d=e.schema)==null?void 0:d._zod.def)==null?void 0:l.error:void 0,i=e.message?e.message:zr((v=(p=(f=e.inst)==null?void 0:f._zod.def)==null?void 0:p.error)==null?void 0:v.call(p,e))??zr(s==null?void 0:s(e))??zr((g=t==null?void 0:t.error)==null?void 0:g.call(t,e))??zr((w=n.customError)==null?void 0:w.call(n,e))??zr((b=n.localeError)==null?void 0:b.call(n,e))??"Invalid input",a={};for(const x of Object.keys(e))x==="inst"||x==="schema"||x==="continue"||x==="input"||x==="__proto__"||(a[x]=e[x]);return a.path??(a.path=[]),a.message=i,t!=null&&t.reportInput&&(a.input=e.input),a}const N_=/[\uD800-\uDBFF]/;function Ua(e){const t=e.length;if(!N_.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function Za(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function D_(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Jr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function M_(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):j_(e,n,r.value)}}function kn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ba(e,t,n){return kn(e,t,n,!1)}function Fh(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return kn(this,n,r(this))},set(o){kn(this,n,o)}})}return t}function j_(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:kn(this,t,n.bind(this))},set(r){kn(this,t,r)}})}function $_(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}let Us,hn=!1;const z_={configurable:!0,get(){hn=!0}};function Ce(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&Us!==e._zod){Us=void 0;return}Us=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,z_);const o=hn;hn=!1;try{const s=n(this);return hn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),hn=hn||o,s}catch(s){throw delete this[t],hn=hn||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function F_(e,t,n,r){const o=$_(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){const s={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:s})}})}const L_="~constantCatch";function V_(e){const t=()=>e;return t[L_]=!0,t}var fl;const Zs={value:void 0,enumerable:!1};let hl="captureStackTrace"in Error?Error:null;function U_(e){const t=hl;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return hl=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function M(e,t,n,r){const o={};function s(f){this.def=f,this.constr=l,this.traits=new Set}s.prototype=o;const i=n,a=i&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(e))return}else{Zs.value=new s(p);try{Object.defineProperty(f,"_zod",Zs)}finally{Zs.value=void 0}}if(f._zod.traits.add(e),t(f,p),a){const g=Object.getPrototypeOf(f),w=f._zod.constr.prototype;let b=g;for(;b&&b!==w;)b=Object.getPrototypeOf(b);const x=b??g;a.has(x)||(a.add(x),M_(x,i))}const v=l.prototype;for(const g in v)Object.prototype.hasOwnProperty.call(v,g)&&(g in f||(f[g]=v[g].bind(f)))}const u=(r==null?void 0:r.Parent)??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function l(f){var w;const p=r!=null&&r.Parent?U_(d):this;c(p,f);const v=p._zod.deferred;if(v){for(const b of v)b();p._zod.deferred=void 0}const g=(w=globalThis.__zod_globalConfig)==null?void 0:w.postProcessor;return g&&g(p),p}return Object.defineProperty(l,"init",{value:c}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>{var p,v;return r!=null&&r.Parent&&f instanceof r.Parent?!0:(v=(p=f==null?void 0:f._zod)==null?void 0:p.traits)==null?void 0:v.has(e)}}),Object.defineProperty(l,"name",{value:e}),l}class Vn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lh extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(fl=globalThis).__zod_globalConfig??(fl.__zod_globalConfig={});const Bt=globalThis.__zod_globalConfig;function Pn(e){return e&&Object.assign(Bt,e),Bt}function Z_(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,zi,2)),e.message}function B_(e){this._zod.message=e}const H_={get:Z_,set:B_,enumerable:!0,configurable:!0},Bs={value:void 0,enumerable:!1},pl=new WeakSet([Object.prototype,Error.prototype]),W_=(e,t)=>{e.name="$ZodError",Bs.value=t,Object.defineProperty(e,"issues",Bs),Bs.value=void 0,Object.defineProperty(e,"message",H_);const n=Object.getPrototypeOf(e);pl.has(n)||(pl.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},K_=M("$ZodError",W_);function G_(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function q_(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?G_(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Q_(e,t=n=>n.message){const n={_errors:[]},r=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{const a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,u=0;for(;u<a.length;){const d=a[u],l=u===a.length-1;if(d==="_errors"){l&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,d)||Object.defineProperty(c,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const f=c[d];l&&f._errors.push(t(i)),c=f,u++}}}};return r(e),n}function ws(e,t){return{callee:(t==null?void 0:t.callee)??e,Err:t==null?void 0:t.Err}}const Ha=e=>{const t=(n,r,o,s)=>{const i=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Vn;if(a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Or(u,i,Pn())));throw Dh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Wa=e=>{const t=async(n,r,o,s)=>{const i=o?{...o,async:!0}:{async:!0};let a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Or(u,i,Pn())));throw Dh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Ka=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Vn;return s.issues.length?Vh(e,s.issues,o):{success:!0,data:s.value}};function Vh(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(o=>Or(o,n,Pn()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0}}}const Ga=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?Vh(e,s.issues,o):{success:!0,data:s.value}},Y_=Symbol.for("zod.compile.invalid"),J_=Symbol.for("zod.compile.fallback"),X_=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Y_)return!0;if(r.definite===!0&&n===void 0)return!1}return e1(e,t,n)});function e1(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;let s;if(o?(r[J_]=!0,s=o({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new Vn;return s.issues.length===0}const t1=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length===0},n1=e=>{const t=Ha(e),n=(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return t(r,o,a,ws(n,i))};return n},r1=e=>{const t=Ha(e),n=(r,o,s,i)=>t(r,o,s,ws(n,i));return n},o1=e=>{const t=Wa(e),n=async(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(r,o,a,ws(n,i))};return n},s1=e=>{const t=Wa(e),n=async(r,o,s,i)=>await t(r,o,s,ws(n,i));return n},i1=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ka(e)(t,n,o)},a1=e=>(t,n,r)=>Ka(e)(t,n,r),c1=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ga(e)(t,n,o)},l1=e=>async(t,n,r)=>Ga(e)(t,n,r),u1=/^[cC][0-9a-z]{6,}$/,d1=/^[0-9a-z]+$/,f1=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,h1=/^[0-9a-vA-V]{20}$/,p1=/^[A-Za-z0-9]{27}$/,m1=/^[a-zA-Z0-9_-]{21}$/;function g1(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const v1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,y1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ml=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,b1=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,w1="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function _1(){return new RegExp(w1,"u")}const x1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,S1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,E1=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,C1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,k1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,O1=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,P1=/^https?$/,R1=/^\+[1-9]\d{6,14}$/,Uh="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function T1(e){return new RegExp(`^${e}$`)}const I1=T1(Uh);function Li(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function A1(e){return new RegExp(`^${Li(e)}$`)}function N1(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${Li({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Li({precision:e.precision})}`:n;return new RegExp(`^${Uh}T(?:${r})$`)}const D1=/^[\s\S]{0,}$/,M1=/^-?\d+(?:\.\d+)?$/,j1=/^(?:true|false)$/i,$1=/^[^A-Z]*$/,z1=/^[^a-z]*$/,ht=M("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qa=e=>{const t=e.value;return!v_(t)&&t.length!==void 0},es={number:"number",bigint:"bigint",object:"date"},Zh=M("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);const n=es[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:es[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bh=M("$ZodCheckGreaterThan",(e,t)=>{ht.init(e,t);const n=es[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:es[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),F1=M("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):y_(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),L1=M("$ZodCheckNumberFormat",(e,t)=>{var i;ht.init(e,t),t.format=t.format||"float64";const n=(i=t.format)==null?void 0:i.includes("int"),r=n?"int":"number",[o,s]=$h[t.format];e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),V1=M("$ZodCheckMaxLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>t.maximum?Ua(o):s)<=t.maximum)return;const a=Za(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),U1=M("$ZodCheckMinLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?Ua(o):s)>=t.minimum)return;const a=Za(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Z1=M("$ZodCheckLengthEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?Ua(o):s;if(i===t.length)return;const a=Za(o),c=i>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),_s=M("$ZodCheckStringFormat",(e,t)=>{var n,r;ht.init(e,t),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),B1=M("$ZodCheckRegex",(e,t)=>{_s.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),H1=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$1),_s.init(e,t)}),W1=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=z1),_s.init(e,t)}),K1=M("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);const n=ys(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),G1=M("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);const n=new RegExp(`^${ys(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),q1=M("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);const n=new RegExp(`.*${ys(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function gl(e,t,n){e.issues.length&&t.issues.push(...Va(n,e.issues))}const Q1=M("$ZodCheckProperties",(e,t)=>{ht.init(e,t),Ba(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(i=>[i,t.shape[i]]));const o=r.value;let s;for(const[i,a]of n){const c=a._zod.run({value:o[i],issues:[]},{});c instanceof Promise?(s??(s=[]),s.push(c.then(u=>gl(u,r,i)))):gl(c,r,i)}if(s)return Promise.all(s).then(()=>{})}}),Y1=M("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class J1{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
193
193
|
`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=(this==null?void 0:this.content)??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
194
194
|
${n.join(`
|
|
195
195
|
`)}
|
|
196
|
-
};`)(...Object.values(this.closed))}}const X1={major:4,minor:6,patch:7},Be=M("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=X1;const r=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r!=null&&r.length?[...r]:[];for(const i of o)for(const a of i._zod.onattach)a(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const i=(c,u,d)=>{if(c.memo)return c;let l=Jt(c),f;for(const p of u){if(p._zod.def.when){if(A_(c)||!p._zod.def.when(c))continue}else if(l)continue;const v=c.issues.length,g=p._zod.check(c);if(g instanceof Promise&&(d==null?void 0:d.async)===!1)throw new Vn;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==v&&(Fi(c.issues,v,e),l||(l=Jt(c,v)))});else{if(c.issues.length===v)continue;Fi(c.issues,v,e),l||(l=Jt(c,v))}}return f?f.then(()=>c):c},a=(c,u,d)=>{if(Jt(c))return c.aborted=!0,c;const l=i(u,o,d);if(l instanceof Promise){if(d.async===!1)throw new Vn;return l.then(f=>e._zod.parse(f,d))}return e._zod.parse(l,d)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){const l=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});return l instanceof Promise?l.then(f=>a(f,c,u)):a(l,c,u)}const d=e._zod.parse(c,u);if(d instanceof Promise){if(u.async===!1)throw new Vn;return d.then(l=>i(l,o,u))}return i(d,o,u)}}},{get"~standard"(){return Ba(this,"~standard",Wh(this))},set"~standard"(e){kn(this,"~standard",e)}}),Hh=(e,t)=>e.issues.length?{issues:e.issues.map(n=>Or(n,t,Pn()))}:{value:e.value};async function ex(e,t){const n={async:!0};return Hh(await e._zod.run({value:t,issues:[]},n),n)}function Wh(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Hh(r,n)}catch{}return ex(e,t)},vendor:"zod",version:1}}const Qa=M("$ZodString",(e,t)=>{Be.init(e,t),e._zod.pattern=t.pattern??D1,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ne=M("$ZodStringFormat",(e,t)=>{_s.init(e,t),Qa.init(e,t)}),tx=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=y1),Ne.init(e,t)}),nx=M("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ml(r))}else t.pattern??(t.pattern=ml());Ne.init(e,t)}),rx=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=b1),Ne.init(e,t)}),Kh=1,ts=2;function Gh(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ox(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Gh(e)||ts:sx(e,t)}function sx(e,t){var n;if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===P1.source&&!/^https?:\/\//i.test(e))return Kh;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(e)??ts}return new URL(e)}catch{return ts}}const ix=/[\t\n\r]/g;function vl(e){return e.replace(ix,"")}function ax(e,t){return t.lastIndex=0,t.test(e.hostname)}function cx(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const lx=M("$ZodURL",(e,t)=>{Ne.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=ox(r,t);if(o===Kh){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(o===ts){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(o===!0){n.value=vl(r);return}t.hostname&&!ax(o,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!cx(o,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?o.href:vl(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ux=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=_1()),Ne.init(e,t)}),dx=M("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?m1:g1(t.length)),Ne.init(e,t)}),fx=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=u1),Ne.init(e,t)}),hx=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=d1),Ne.init(e,t)}),px=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=f1),Ne.init(e,t)}),mx=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=h1),Ne.init(e,t)}),gx=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=p1),Ne.init(e,t)}),vx=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=N1(t)),Ne.init(e,t)}),yx=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=I1),Ne.init(e,t)}),bx=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=A1(t)),Ne.init(e,t)}),wx=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=v1),Ne.init(e,t)}),_x=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=x1),Ne.init(e,t)}),xx=/^[0-9a-fA-F:.]+$/;function qh(e){return xx.test(e)?Gh(`http://[${e}]`):!1}const Sx=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=S1),Ne.init(e,t),e._zod.check=n=>{qh(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),Ex=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=E1),Ne.init(e,t)});function Cx(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;if(!r)return!1;const o=Number(r);return`${o}`!==r||o<0||o>128?!1:qh(n)}const kx=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=C1),Ne.init(e,t),e._zod.check=n=>{Cx(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function Qh(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Yh=/^[0-9a-zA-Z+/]*={0,2}$/,Ox=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Yh),Ne.init(e,t),e._zod.check=n=>{Qh(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Ya=/^[A-Za-z0-9_-]*$/;function Px(e){if(!Ya.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Qh(n)}const Rx=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ya),Ne.init(e,t),e._zod.check=n=>{Px(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Tx=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=R1),Ne.init(e,t)});function Ix(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Ax=M("$ZodJWT",(e,t)=>{Ne.init(e,t),e._zod.check=n=>{Ix(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Jh=M("$ZodNumber",(e,t)=>{Be.init(e,t),e._zod.pattern=M1,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),Nx=M("$ZodNumberFormat",(e,t)=>{L1.init(e,t),Jh.init(e,t)}),Dx=M("$ZodBoolean",(e,t)=>{Be.init(e,t),e._zod.pattern=j1,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Mx=M("$ZodUnknown",(e,t)=>{Be.init(e,t),e._zod.parse=n=>n}),jx=M("$ZodNever",(e,t)=>{Be.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function $x(e,t){const n=dl(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(s=>s[0])),o=e._zod.parse;e._zod.parse=(s,i)=>{const a=t(s.value);if(a>r&&!(i!=null&&i.skipChecks)&&(i==null?void 0:i.direction)!=="backward"){for(const[c,u]of dl(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){const d=s.issues.length;return u._zod.check(s),s.issues[d].continue=!1,Fi(s.issues,d,e),s}}return o(s,i)}}const zx=e=>Array.isArray(e)?e.length:-1;function yl(e,t,n){e.issues.length&&t.issues.push(...Va(n,e.issues)),t.value[n]=e.value}const Fx=M("$ZodArray",(e,t)=>{Be.init(e,t);const n=Bt.memoizer;n==null||n.attach(e),e._zod.parse=(r,o)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=n?n.alloc(e,r,Array(s.length),o):Array(s.length);const i=[],a=o==null?void 0:o.abortEarly;for(let c=0;c<s.length;c++){const u=s[c],d=t.element._zod.run({value:u,issues:[]},o);if(d instanceof Promise)i.push(d.then(l=>yl(l,r,c)));else if(yl(d,r,c),a&&d.issues.length!==0&&Jt(d))break}return i.length?Promise.all(i).then(()=>r):r},$x(e,zx)});function ns(e,t,n,r,o,s){const i=n in r,a=s==="optional";if(!(!i&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!i)return;t.issues.push(...Va(n,e.issues))}if(!i&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(i||o==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}const Lx=[];function Xh(e){var i,a,c,u;const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Lx,o=r.length?[...t,...r]:t;for(const d of o)if(!((u=(c=(a=(i=e.shape)==null?void 0:i[d])==null?void 0:a._zod)==null?void 0:c.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${String(d)}": expected a Zod schema`);const s=E_(e.shape);return{...e,allKeys:o,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function ep(e,t,n,r,o,s,i){const a=[],c=o.keySet,u=o.catchall._zod,d=u.def.type,l=u.optin,f=u.optout;let p=0;for(const v in t){if(i&&n.issues.length!==p){if(Jt(n,p))break;p=n.issues.length}if(c.has(v))continue;if(v==="__proto__"){d==="never"&&a.push(v);continue}if(d==="never"){a.push(v);continue}const g=u.run({value:t[v],issues:[]},r);g instanceof Promise?e.push(g.then(w=>ns(w,n,v,t,l,f))):ns(g,n,v,t,l,f)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const Vx=M("$ZodObject",(e,t)=>{Be.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n!=null&&n.get?n.get.raw:t.shape??{};if(r){const u=()=>{const d={...r};return Object.defineProperty(t,"shape",{value:d}),u.raw=d,d};u.raw=r,Object.defineProperty(t,"shape",{get:u})}const o=Fa(()=>Xh(t));Ce(e,"propValues",u=>{const d=u.def.shape,l={};for(const f in d){const p=d[f]._zod;if(p.values){Object.prototype.hasOwnProperty.call(l,f)||Gn(l,f,new Set);for(const v of p.values)l[f].add(v);p.optin!==void 0&&l[f].add(void 0)}}return l});const s=Xo,i=t.catchall;let a;const c=Bt.memoizer;c==null||c.attach(e),e._zod.parse=(u,d)=>{a??(a=o.value);const l=u.value;if(!s(l))return u.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),u;u.value=c?c.alloc(e,u,{},d):{};const f=[],p=a.shape,v=d==null?void 0:d.abortEarly;let g=u.issues.length;for(const w of a.allKeys){if(v&&u.issues.length!==g){if(Jt(u,g))break;g=u.issues.length}if(w==="__proto__")continue;const b=p[w],x=b._zod.optin,_=b._zod.optout,C=b._zod.run({value:l[w],issues:[]},d);C instanceof Promise?f.push(C.then(E=>ns(E,u,w,l,x,_))):ns(C,u,w,l,x,_)}return i?ep(f,l,u,d,o.value,e,v===!0):f.length?Promise.all(f).then(()=>u):u}}),Ux=M("$ZodObjectJIT",(e,t)=>{Vx.init(e,t);const n=e._zod.parse,r=Fa(()=>Xh(t)),o=Bt.memoizer,s=p=>{var E,P;const v=r.value,g=v.symbolKeys,w=new J1(["payload","ctx"],{shape:p,inst:e,memo:o,syms:g}),b=R=>`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`,x=(R,T)=>`
|
|
196
|
+
};`)(...Object.values(this.closed))}}const X1={major:4,minor:6,patch:7},Be=M("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=X1;const r=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r!=null&&r.length?[...r]:[];for(const i of o)for(const a of i._zod.onattach)a(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const i=(c,u,d)=>{if(c.memo)return c;let l=Yt(c),f;for(const p of u){if(p._zod.def.when){if(A_(c)||!p._zod.def.when(c))continue}else if(l)continue;const v=c.issues.length,g=p._zod.check(c);if(g instanceof Promise&&(d==null?void 0:d.async)===!1)throw new Vn;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==v&&(Fi(c.issues,v,e),l||(l=Yt(c,v)))});else{if(c.issues.length===v)continue;Fi(c.issues,v,e),l||(l=Yt(c,v))}}return f?f.then(()=>c):c},a=(c,u,d)=>{if(Yt(c))return c.aborted=!0,c;const l=i(u,o,d);if(l instanceof Promise){if(d.async===!1)throw new Vn;return l.then(f=>e._zod.parse(f,d))}return e._zod.parse(l,d)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){const l=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});return l instanceof Promise?l.then(f=>a(f,c,u)):a(l,c,u)}const d=e._zod.parse(c,u);if(d instanceof Promise){if(u.async===!1)throw new Vn;return d.then(l=>i(l,o,u))}return i(d,o,u)}}},{get"~standard"(){return Ba(this,"~standard",Wh(this))},set"~standard"(e){kn(this,"~standard",e)}}),Hh=(e,t)=>e.issues.length?{issues:e.issues.map(n=>Or(n,t,Pn()))}:{value:e.value};async function ex(e,t){const n={async:!0};return Hh(await e._zod.run({value:t,issues:[]},n),n)}function Wh(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Hh(r,n)}catch{}return ex(e,t)},vendor:"zod",version:1}}const Qa=M("$ZodString",(e,t)=>{Be.init(e,t),e._zod.pattern=t.pattern??D1,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ne=M("$ZodStringFormat",(e,t)=>{_s.init(e,t),Qa.init(e,t)}),tx=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=y1),Ne.init(e,t)}),nx=M("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ml(r))}else t.pattern??(t.pattern=ml());Ne.init(e,t)}),rx=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=b1),Ne.init(e,t)}),Kh=1,ts=2;function Gh(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ox(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Gh(e)||ts:sx(e,t)}function sx(e,t){var n;if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===P1.source&&!/^https?:\/\//i.test(e))return Kh;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(e)??ts}return new URL(e)}catch{return ts}}const ix=/[\t\n\r]/g;function vl(e){return e.replace(ix,"")}function ax(e,t){return t.lastIndex=0,t.test(e.hostname)}function cx(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const lx=M("$ZodURL",(e,t)=>{Ne.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=ox(r,t);if(o===Kh){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(o===ts){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(o===!0){n.value=vl(r);return}t.hostname&&!ax(o,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!cx(o,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?o.href:vl(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ux=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=_1()),Ne.init(e,t)}),dx=M("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?m1:g1(t.length)),Ne.init(e,t)}),fx=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=u1),Ne.init(e,t)}),hx=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=d1),Ne.init(e,t)}),px=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=f1),Ne.init(e,t)}),mx=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=h1),Ne.init(e,t)}),gx=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=p1),Ne.init(e,t)}),vx=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=N1(t)),Ne.init(e,t)}),yx=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=I1),Ne.init(e,t)}),bx=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=A1(t)),Ne.init(e,t)}),wx=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=v1),Ne.init(e,t)}),_x=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=x1),Ne.init(e,t)}),xx=/^[0-9a-fA-F:.]+$/;function qh(e){return xx.test(e)?Gh(`http://[${e}]`):!1}const Sx=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=S1),Ne.init(e,t),e._zod.check=n=>{qh(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),Ex=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=E1),Ne.init(e,t)});function Cx(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;if(!r)return!1;const o=Number(r);return`${o}`!==r||o<0||o>128?!1:qh(n)}const kx=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=C1),Ne.init(e,t),e._zod.check=n=>{Cx(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function Qh(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Yh=/^[0-9a-zA-Z+/]*={0,2}$/,Ox=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Yh),Ne.init(e,t),e._zod.check=n=>{Qh(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Ya=/^[A-Za-z0-9_-]*$/;function Px(e){if(!Ya.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Qh(n)}const Rx=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ya),Ne.init(e,t),e._zod.check=n=>{Px(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Tx=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=R1),Ne.init(e,t)});function Ix(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Ax=M("$ZodJWT",(e,t)=>{Ne.init(e,t),e._zod.check=n=>{Ix(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Jh=M("$ZodNumber",(e,t)=>{Be.init(e,t),e._zod.pattern=M1,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),Nx=M("$ZodNumberFormat",(e,t)=>{L1.init(e,t),Jh.init(e,t)}),Dx=M("$ZodBoolean",(e,t)=>{Be.init(e,t),e._zod.pattern=j1,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Mx=M("$ZodUnknown",(e,t)=>{Be.init(e,t),e._zod.parse=n=>n}),jx=M("$ZodNever",(e,t)=>{Be.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function $x(e,t){const n=dl(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(s=>s[0])),o=e._zod.parse;e._zod.parse=(s,i)=>{const a=t(s.value);if(a>r&&!(i!=null&&i.skipChecks)&&(i==null?void 0:i.direction)!=="backward"){for(const[c,u]of dl(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){const d=s.issues.length;return u._zod.check(s),s.issues[d].continue=!1,Fi(s.issues,d,e),s}}return o(s,i)}}const zx=e=>Array.isArray(e)?e.length:-1;function yl(e,t,n){e.issues.length&&t.issues.push(...Va(n,e.issues)),t.value[n]=e.value}const Fx=M("$ZodArray",(e,t)=>{Be.init(e,t);const n=Bt.memoizer;n==null||n.attach(e),e._zod.parse=(r,o)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=n?n.alloc(e,r,Array(s.length),o):Array(s.length);const i=[],a=o==null?void 0:o.abortEarly;for(let c=0;c<s.length;c++){const u=s[c],d=t.element._zod.run({value:u,issues:[]},o);if(d instanceof Promise)i.push(d.then(l=>yl(l,r,c)));else if(yl(d,r,c),a&&d.issues.length!==0&&Yt(d))break}return i.length?Promise.all(i).then(()=>r):r},$x(e,zx)});function ns(e,t,n,r,o,s){const i=n in r,a=s==="optional";if(!(!i&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!i)return;t.issues.push(...Va(n,e.issues))}if(!i&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(i||o==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}const Lx=[];function Xh(e){var i,a,c,u;const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Lx,o=r.length?[...t,...r]:t;for(const d of o)if(!((u=(c=(a=(i=e.shape)==null?void 0:i[d])==null?void 0:a._zod)==null?void 0:c.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${String(d)}": expected a Zod schema`);const s=E_(e.shape);return{...e,allKeys:o,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function ep(e,t,n,r,o,s,i){const a=[],c=o.keySet,u=o.catchall._zod,d=u.def.type,l=u.optin,f=u.optout;let p=0;for(const v in t){if(i&&n.issues.length!==p){if(Yt(n,p))break;p=n.issues.length}if(c.has(v))continue;if(v==="__proto__"){d==="never"&&a.push(v);continue}if(d==="never"){a.push(v);continue}const g=u.run({value:t[v],issues:[]},r);g instanceof Promise?e.push(g.then(w=>ns(w,n,v,t,l,f))):ns(g,n,v,t,l,f)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const Vx=M("$ZodObject",(e,t)=>{Be.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n!=null&&n.get?n.get.raw:t.shape??{};if(r){const u=()=>{const d={...r};return Object.defineProperty(t,"shape",{value:d}),u.raw=d,d};u.raw=r,Object.defineProperty(t,"shape",{get:u})}const o=Fa(()=>Xh(t));Ce(e,"propValues",u=>{const d=u.def.shape,l={};for(const f in d){const p=d[f]._zod;if(p.values){Object.prototype.hasOwnProperty.call(l,f)||Gn(l,f,new Set);for(const v of p.values)l[f].add(v);p.optin!==void 0&&l[f].add(void 0)}}return l});const s=Xo,i=t.catchall;let a;const c=Bt.memoizer;c==null||c.attach(e),e._zod.parse=(u,d)=>{a??(a=o.value);const l=u.value;if(!s(l))return u.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),u;u.value=c?c.alloc(e,u,{},d):{};const f=[],p=a.shape,v=d==null?void 0:d.abortEarly;let g=u.issues.length;for(const w of a.allKeys){if(v&&u.issues.length!==g){if(Yt(u,g))break;g=u.issues.length}if(w==="__proto__")continue;const b=p[w],x=b._zod.optin,_=b._zod.optout,C=b._zod.run({value:l[w],issues:[]},d);C instanceof Promise?f.push(C.then(S=>ns(S,u,w,l,x,_))):ns(C,u,w,l,x,_)}return i?ep(f,l,u,d,o.value,e,v===!0):f.length?Promise.all(f).then(()=>u):u}}),Ux=M("$ZodObjectJIT",(e,t)=>{Vx.init(e,t);const n=e._zod.parse,r=Fa(()=>Xh(t)),o=Bt.memoizer,s=p=>{var S,P;const v=r.value,g=v.symbolKeys,w=new J1(["payload","ctx"],{shape:p,inst:e,memo:o,syms:g}),b=R=>`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`,x=(R,T)=>`
|
|
197
197
|
let ${R}_ab = false;
|
|
198
198
|
for (let i = 0; i < ${R}.issues.length; i++) {
|
|
199
199
|
const iss = ${R}.issues[i];
|
|
@@ -204,7 +204,7 @@ ${n.join(`
|
|
|
204
204
|
if (${R}_ab && ctx && ctx.abortEarly) {
|
|
205
205
|
payload.value = newResult;
|
|
206
206
|
return payload;
|
|
207
|
-
}`;w.write("const input = payload.value;");const _=Object.create(null);let C=0;for(const R of v.allKeys)_[R]=`key_${C++}`;w.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const R of v.allKeys){if(R==="__proto__")continue;const T=_[R],A=typeof R=="symbol"?`syms[${g.indexOf(R)}]`:w_(R),j=`${A} in input`,F=p[R],z=(
|
|
207
|
+
}`;w.write("const input = payload.value;");const _=Object.create(null);let C=0;for(const R of v.allKeys)_[R]=`key_${C++}`;w.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const R of v.allKeys){if(R==="__proto__")continue;const T=_[R],A=typeof R=="symbol"?`syms[${g.indexOf(R)}]`:w_(R),j=`${A} in input`,F=p[R],z=(S=F==null?void 0:F._zod)==null?void 0:S.optin,Y=z!==void 0,Z=((P=F==null?void 0:F._zod)==null?void 0:P.optout)==="optional";if(w.write(`const ${T} = ${b(A)};`),Y&&Z){const K=z==="optional"?`${T}_present`:`${T}.value !== undefined || ${T}_present`;w.write(`
|
|
208
208
|
const ${T}_present = ${j};
|
|
209
209
|
if (!${T}.issues.length || ${T}_present) {
|
|
210
210
|
if (${T}.issues.length) {${x(T,A)}
|
|
@@ -243,6 +243,6 @@ ${n.join(`
|
|
|
243
243
|
newResult[${A}] = ${T}.value;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
`)}return w.write("payload.value = newResult;"),w.write("return payload;"),w.compile()};let i;const a=Xo,c=!Bt.jitless,d=c&&x_.value,l=t.catchall;let f;e._zod.parse=(p,v)=>{f??(f=r.value);const g=p.value;return a(g)?c&&d&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(i||(i=s(t.shape)),p=i(p,v),l?ep([],g,p,v,f,e,(v==null?void 0:v.abortEarly)===!0):p):n(p,v):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function bl(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Jt(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>Or(i,r,Pn())))}),t)}const Zx=M("$ZodUnion",(e,t)=>{Be.init(e,t),Ce(e,"optin",r=>r.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":r.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),Ce(e,"optout",r=>r.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ce(e,"values",r=>{if(r.def.options.every(o=>o._zod.values))return new Set(r.def.options.flatMap(o=>Array.from(o._zod.values)))}),Ce(e,"pattern",r=>{if(r.def.options.every(o=>o._zod.pattern)){const o=r.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>La(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const i=[];for(const a of t.options){const c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>bl(a,r,e,o)):bl(i,r,e,o)}}),Bx=M("$ZodIntersection",(e,t)=>{Be.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>wl(n,c,u)):wl(n,s,i)}});function Vi(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Yr(e)&&Yr(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const s of r){if(s==="__proto__")continue;const i=Vi(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=Vi(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wl(e,t,n){const r=new Map;let o;const s=new Map,i=(u,d)=>{var f,p;let l;if(u.code==="unrecognized_keys"&&!((f=u.path)!=null&&f.length))o??(o=u),l=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&((p=u.path)==null?void 0:p.length)===1){const v=String(u.path[0]);s.has(v)||s.set(v,u),l=[v]}else return!1;for(const v of l)r.has(v)||r.set(v,{}),r.get(v)[d]=!0;return!0};for(const u of t.issues)i(u,"l")||e.issues.push(u);for(const u of n.issues)i(u,"r")||e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){const u=o?a.filter(d=>o.keys.includes(d)):[];u.length&&e.issues.push({...o,keys:u});for(const d of a)!u.includes(d)&&s.has(d)&&e.issues.push(s.get(d))}const c=Vi(t.value,n.value);if(!c.valid){if(Jt(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const Hx=M("$ZodEnum",(e,t)=>{Be.init(e,t);const n=$i(t.entries),r=new Set(n);e._zod.values=r,Ce(e,"pattern",o=>{const s=$i(o.def.entries).filter(i=>S_.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>ys(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),Wx=M("$ZodTransform",(e,t)=>{var n;Be.init(e,t),e._zod.optin="optional",(n=Bt.memoizer)==null||n.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lh(e.constructor.name);const s=t.transform(r.value,r);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(a=>(r.value=a,r));if(s instanceof Promise)throw new Vn;return r.value=s,r}});function _l(e,t){return e.value=t.issues.length?void 0:t.value,e}const tp=M("$ZodOptional",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Ce(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),Ce(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${La(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>_l(n,s)):_l(n,o)}return t.innerType._zod.run(n,r)}}),Kx=M("$ZodExactOptional",(e,t)=>{tp.init(e,t),Ce(e,"values",n=>n.def.innerType._zod.values),Ce(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Gx=M("$ZodNullable",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin),Ce(e,"optout",n=>n.def.innerType._zod.optout),Ce(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${La(r.source)}|null)$`):void 0}),Ce(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),qx=M("$ZodDefault",(e,t)=>{Be.init(e,t),e._zod.optin="defaulted",Ce(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>xl(s,t)):xl(o,t)}});function xl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Qx=M("$ZodPrefault",(e,t)=>{Be.init(e,t),e._zod.optin="defaulted",Ce(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Yx=M("$ZodNonOptional",(e,t)=>{Be.init(e,t),Ce(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Sl(s,e)):Sl(o,e)}});function Sl(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function El(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Or(o,r,Pn()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Jx=M("$ZodCatch",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Ce(e,"optout",n=>n.def.innerType._zod.optout),Ce(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>El(n,s,t,r)):El(n,o,t,r)}}),Xx=M("$ZodPipe",(e,t)=>{Be.init(e,t),Ce(e,"values",n=>n.def.in._zod.values),Ce(e,"optin",n=>n.def.in._zod.optin),Ce(e,"optout",n=>n.def.out._zod.optout),Ce(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>Oo(i,t.in,r)):Oo(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Oo(s,t.out,r)):Oo(o,t.out,r)}});function Oo(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const eS=M("$ZodReadonly",(e,t)=>{Be.init(e,t),Ce(e,"propValues",n=>n.def.innerType._zod.propValues),Ce(e,"values",n=>n.def.innerType._zod.values),Ce(e,"optin",n=>{var r,o;return(o=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:o.optin}),Ce(e,"optout",n=>{var r,o;return(o=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:o.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Cl):Cl(o)}});function Cl(e){return e.memo||(e.value=Object.freeze(e.value)),e}const tS=M("$ZodCustom",(e,t)=>{ht.init(e,t),Be.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>kl(s,n,r,e));kl(o,n,r,e)}});function kl(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Jr(o))}}class nS extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Ui="~memo",Ol=[];function np(e){return e!==null&&typeof e=="object"}function Hs(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const rp=new WeakMap,Vr=0,Zo=1,Br=2;function Bo(e,t,n){const r=rp.get(e);if(r!==void 0)return r?Br:Vr;if(t.has(e))return Br;t.add(e);let o=Vr;const s=d=>{if(o!==Br&&(d!=null&&d._zod)){const l=Bo(d,t);l>o&&(o=l)}},i=(d,l)=>{var p;let f=Vr;for(const v of Reflect.ownKeys(d)){const g=Object.getOwnPropertyDescriptor(d,v);if(!g.enumerable)continue;const w=g.get?Zo:(p=g.value)!=null&&p._zod?Bo(g.value,t):Vr;w>f&&(f=w)}return f},a=d=>{d>o&&(o=d)},c=e._zod.def;switch(c.type){case"object":{const d=Ih(c);a(d?i(d):Zo),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(const d of c.items)s(d);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(const d of c.options)s(d);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{const d=c._cachedInner??void 0;a(d?Bo(d,t):Zo);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const d in c){const l=Object.getOwnPropertyDescriptor(c,d);if(!l||l.get)continue;const f=l.value;if(!(!f||typeof f!="object")){if(f._zod)s(f);else if(Array.isArray(f))for(const p of f)s(p)}}}return t.delete(e),rS(e,o)}function rS(e,t){return t!==Zo&&rp.set(e,t===Br),t}function oS(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let Po;const Ro=[],sS={alloc(e,t,n){const r=Po;if(!r)return n;Po=void 0;const o={value:n,issues:null};return r.set(t.value,o),Ro.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(o,s)=>{if(s.direction!=="backward"&&aS(s,o.value))throw new nS;return n(o,s)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,o,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const i=e._zod.parse,a=(c,u)=>{if(n===void 0){const b=Bo(e,new Set);if(b===Vr)return e._zod.parse=i,e._zod.run===a&&(e._zod.run=i),i(c,u);b===Br||r?n=!0:r=!0}const d=c.value;if(!np(d))return i(c,u);let l=u[Ui];l||(l={buckets:new WeakMap,backEdges:void 0},u[Ui]=l);let f;o===u?f=s:(f=oS(l,e),o=u,s=f);const p=f.get(d);if(p)return c.value=p.value,p.issues?p.issues.length&&c.issues.push(...Hs(p.issues)):(c.memo=!0,l.backEdges??(l.backEdges=new WeakSet),l.backEdges.add(p.value)),c;Po=f;const v=Ro.length,g=i(c,u);Po=void 0;const w=Ro.length>v?Ro.pop():void 0;return g instanceof Promise?g.then(b=>(w&&(w.issues=b.issues.length?Hs(b.issues):Ol),b)):(w&&(w.issues=g.issues.length?Hs(g.issues):Ol),g)};e._zod.parse=a,e._zod.run===i&&(e._zod.run=a)})}};function iS(){return sS}function aS(e,t){var r;const n=(r=e[Ui])==null?void 0:r.backEdges;return n!==void 0&&np(t)&&n.has(t)}const cS=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(s,i){return s==="number"&&typeof i=="number"&&!Number.isFinite(i)?String(i):r[s]??s}return s=>{switch(s.code){case"invalid_type":{const i=o(s.expected),a=D_(s.input),c=o(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${jh(s.values[0])}`:`Invalid option: expected one of ${ll(s.values,"|")}`;case"too_big":{const i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);return a?`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{const i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);return a?`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`:`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{const i=s;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${n[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${ll(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(a=>`'${a}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function lS(){return{localeError:cS()}}var Pl;class uS{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function dS(){return new uS}(Pl=globalThis).__zod_globalRegistry??(Pl.__zod_globalRegistry=dS());const Ur=globalThis.__zod_globalRegistry;function op(e){return e.checks&&(e.checks=[...e.checks]),e}function fS(e,t){return new e(op({type:"string",...oe(t)}))}function hS(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...oe(t)})}function pS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...oe(t)})}function mS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...oe(t)})}function gS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...oe(t)})}function vS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...oe(t)})}function yS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...oe(t)})}function bS(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...oe(t)})}function wS(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...oe(t)})}function _S(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...oe(t)})}function xS(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...oe(t)})}function SS(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...oe(t)})}function ES(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...oe(t)})}function CS(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...oe(t)})}function kS(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...oe(t)})}function OS(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...oe(t)})}function PS(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...oe(t)})}function RS(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...oe(t)})}function TS(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...oe(t)})}function IS(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...oe(t)})}function AS(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...oe(t)})}function NS(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...oe(t)})}function DS(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...oe(t)})}function MS(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...oe(t)})}function jS(e,t){return new e({type:"string",format:"date",check:"string_format",...oe(t)})}function $S(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...oe(t)})}function zS(e,t){return new e({type:"string",format:"duration",check:"string_format",...oe(t)})}function FS(e,t){return new e(op({type:"number",checks:[],...oe(t)}))}function LS(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...oe(t)})}function VS(e,t){return new e({type:"boolean",...oe(t)})}function US(e){return new e({type:"unknown"})}function ZS(e,t){return new e({type:"never",...oe(t)})}function Rl(e,t){return new Zh({check:"less_than",...oe(t),value:e,inclusive:!1})}function Ws(e,t){return new Zh({check:"less_than",...oe(t),value:e,inclusive:!0})}function Tl(e,t){return new Bh({check:"greater_than",...oe(t),value:e,inclusive:!1})}function Ks(e,t){return new Bh({check:"greater_than",...oe(t),value:e,inclusive:!0})}function Il(e,t){return new F1({check:"multiple_of",...oe(t),value:e})}function sp(e,t){return new V1({check:"max_length",...oe(t),maximum:e})}function rs(e,t){return new U1({check:"min_length",...oe(t),minimum:e})}function ip(e,t){return new Z1({check:"length_equals",...oe(t),length:e})}function BS(e,t){return new B1({check:"string_format",format:"regex",...oe(t),pattern:e})}function HS(e){return new H1({check:"string_format",format:"lowercase",...oe(e)})}function WS(e){return new W1({check:"string_format",format:"uppercase",...oe(e)})}function KS(e,t){return new K1({check:"string_format",format:"includes",...oe(t),includes:e})}function GS(e,t){return new G1({check:"string_format",format:"starts_with",...oe(t),prefix:e})}function qS(e,t){return new q1({check:"string_format",format:"ends_with",...oe(t),suffix:e})}function QS(e,t){return new Q1({check:"properties",shape:e,...oe(t)})}function Pr(e){return new Y1({check:"overwrite",tx:e})}function YS(e){return Pr(t=>t.normalize(e))}function JS(){return Pr(e=>e.trim())}function XS(){return Pr(e=>e.toLowerCase())}function eE(){return Pr(e=>e.toUpperCase())}function tE(){return Pr(e=>__(e))}function nE(e,t,n){return new e({type:"array",element:t,...oe(n)})}function rE(e,t,n){return new e({type:"custom",check:"custom",fn:t,...oe(n)})}function oE(e,t){const n=sE(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Jr(o,r.value,n._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Jr(s))}},e(r.value,r)),t);return n}function sE(e,t){const n=new ht({check:"custom",...oe(t)});return n._zod.check=e,n}function Hr(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Gn(e,r,n[r]);return e}function ap(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Ur,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",intersections:[],deferred:[],external:(e==null?void 0:e.external)??void 0}}function Rr(e,t,n,r,o){const s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(o);return Object.assign(n,s),!0}function ot(e,t,n={path:[],schemaPath:[]}){var d,l;var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const a=(l=(d=e._zod).toJSONSchema)==null?void 0:l.call(d);if(a)i.schema=a;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const v=i.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,v,f)}const p=e._zod.parent;p&&(i.ref||(i.ref=p),ot(p,t,f),t.seen.get(p).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Hr(i.schema,c),t.io==="input"&&ut(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Al(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function cp(e,t){var i,a,c,u;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const d of e.seen.entries()){const l=(i=e.metadataRegistry.get(d[0]))==null?void 0:i.id;if(l){const f=r.get(l);if(f&&f!==d[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(l,d[0])}}const o=d=>{var g;const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const w=(g=e.external.registry.get(d[0]))==null?void 0:g.id,b=e.external.uri??(_=>_);if(w)return{ref:b(w)};const x=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=x,{defId:x,ref:`${b("__shared")}#/${l}/${Al(x)}`}}const f="#",p=`${f}/${l}/`;if(d[1]===n&&!d[1].schema.id)return{ref:f};const v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+Al(v)}},s=d=>{if(d[1].schema.$ref)return;const l=d[1],{ref:f,defId:p}=o(d);l.def={...l.schema},p&&(l.defId=p);const v=l.schema;for(const g in v)delete v[g];v.$ref=f};if(e.cycles==="throw")for(const d of e.seen.entries()){const l=d[1];if(l.cycle)throw new Error(`Cycle detected: #/${(a=l.cycle)==null?void 0:a.join("/")}/<root>
|
|
246
|
+
`)}return w.write("payload.value = newResult;"),w.write("return payload;"),w.compile()};let i;const a=Xo,c=!Bt.jitless,d=c&&x_.value,l=t.catchall;let f;e._zod.parse=(p,v)=>{f??(f=r.value);const g=p.value;return a(g)?c&&d&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(i||(i=s(t.shape)),p=i(p,v),l?ep([],g,p,v,f,e,(v==null?void 0:v.abortEarly)===!0):p):n(p,v):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function bl(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Yt(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>Or(i,r,Pn())))}),t)}const Zx=M("$ZodUnion",(e,t)=>{Be.init(e,t),Ce(e,"optin",r=>r.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":r.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),Ce(e,"optout",r=>r.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ce(e,"values",r=>{if(r.def.options.every(o=>o._zod.values))return new Set(r.def.options.flatMap(o=>Array.from(o._zod.values)))}),Ce(e,"pattern",r=>{if(r.def.options.every(o=>o._zod.pattern)){const o=r.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>La(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const i=[];for(const a of t.options){const c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>bl(a,r,e,o)):bl(i,r,e,o)}}),Bx=M("$ZodIntersection",(e,t)=>{Be.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>wl(n,c,u)):wl(n,s,i)}});function Vi(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Yr(e)&&Yr(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const s of r){if(s==="__proto__")continue;const i=Vi(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=Vi(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wl(e,t,n){const r=new Map;let o;const s=new Map,i=(u,d)=>{var f,p;let l;if(u.code==="unrecognized_keys"&&!((f=u.path)!=null&&f.length))o??(o=u),l=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&((p=u.path)==null?void 0:p.length)===1){const v=String(u.path[0]);s.has(v)||s.set(v,u),l=[v]}else return!1;for(const v of l)r.has(v)||r.set(v,{}),r.get(v)[d]=!0;return!0};for(const u of t.issues)i(u,"l")||e.issues.push(u);for(const u of n.issues)i(u,"r")||e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){const u=o?a.filter(d=>o.keys.includes(d)):[];u.length&&e.issues.push({...o,keys:u});for(const d of a)!u.includes(d)&&s.has(d)&&e.issues.push(s.get(d))}const c=Vi(t.value,n.value);if(!c.valid){if(Yt(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const Hx=M("$ZodEnum",(e,t)=>{Be.init(e,t);const n=$i(t.entries),r=new Set(n);e._zod.values=r,Ce(e,"pattern",o=>{const s=$i(o.def.entries).filter(i=>S_.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>ys(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),Wx=M("$ZodTransform",(e,t)=>{var n;Be.init(e,t),e._zod.optin="optional",(n=Bt.memoizer)==null||n.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lh(e.constructor.name);const s=t.transform(r.value,r);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(a=>(r.value=a,r));if(s instanceof Promise)throw new Vn;return r.value=s,r}});function _l(e,t){return e.value=t.issues.length?void 0:t.value,e}const tp=M("$ZodOptional",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Ce(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),Ce(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${La(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>_l(n,s)):_l(n,o)}return t.innerType._zod.run(n,r)}}),Kx=M("$ZodExactOptional",(e,t)=>{tp.init(e,t),Ce(e,"values",n=>n.def.innerType._zod.values),Ce(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Gx=M("$ZodNullable",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin),Ce(e,"optout",n=>n.def.innerType._zod.optout),Ce(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${La(r.source)}|null)$`):void 0}),Ce(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),qx=M("$ZodDefault",(e,t)=>{Be.init(e,t),e._zod.optin="defaulted",Ce(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>xl(s,t)):xl(o,t)}});function xl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Qx=M("$ZodPrefault",(e,t)=>{Be.init(e,t),e._zod.optin="defaulted",Ce(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Yx=M("$ZodNonOptional",(e,t)=>{Be.init(e,t),Ce(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Sl(s,e)):Sl(o,e)}});function Sl(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function El(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Or(o,r,Pn()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Jx=M("$ZodCatch",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Ce(e,"optout",n=>n.def.innerType._zod.optout),Ce(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>El(n,s,t,r)):El(n,o,t,r)}}),Xx=M("$ZodPipe",(e,t)=>{Be.init(e,t),Ce(e,"values",n=>n.def.in._zod.values),Ce(e,"optin",n=>n.def.in._zod.optin),Ce(e,"optout",n=>n.def.out._zod.optout),Ce(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>Oo(i,t.in,r)):Oo(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Oo(s,t.out,r)):Oo(o,t.out,r)}});function Oo(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const eS=M("$ZodReadonly",(e,t)=>{Be.init(e,t),Ce(e,"propValues",n=>n.def.innerType._zod.propValues),Ce(e,"values",n=>n.def.innerType._zod.values),Ce(e,"optin",n=>{var r,o;return(o=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:o.optin}),Ce(e,"optout",n=>{var r,o;return(o=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:o.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Cl):Cl(o)}});function Cl(e){return e.memo||(e.value=Object.freeze(e.value)),e}const tS=M("$ZodCustom",(e,t)=>{ht.init(e,t),Be.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>kl(s,n,r,e));kl(o,n,r,e)}});function kl(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Jr(o))}}class nS extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Ui="~memo",Ol=[];function np(e){return e!==null&&typeof e=="object"}function Hs(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const rp=new WeakMap,Vr=0,Zo=1,Br=2;function Bo(e,t,n){const r=rp.get(e);if(r!==void 0)return r?Br:Vr;if(t.has(e))return Br;t.add(e);let o=Vr;const s=d=>{if(o!==Br&&(d!=null&&d._zod)){const l=Bo(d,t);l>o&&(o=l)}},i=(d,l)=>{var p;let f=Vr;for(const v of Reflect.ownKeys(d)){const g=Object.getOwnPropertyDescriptor(d,v);if(!g.enumerable)continue;const w=g.get?Zo:(p=g.value)!=null&&p._zod?Bo(g.value,t):Vr;w>f&&(f=w)}return f},a=d=>{d>o&&(o=d)},c=e._zod.def;switch(c.type){case"object":{const d=Ih(c);a(d?i(d):Zo),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(const d of c.items)s(d);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(const d of c.options)s(d);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{const d=c._cachedInner??void 0;a(d?Bo(d,t):Zo);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const d in c){const l=Object.getOwnPropertyDescriptor(c,d);if(!l||l.get)continue;const f=l.value;if(!(!f||typeof f!="object")){if(f._zod)s(f);else if(Array.isArray(f))for(const p of f)s(p)}}}return t.delete(e),rS(e,o)}function rS(e,t){return t!==Zo&&rp.set(e,t===Br),t}function oS(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let Po;const Ro=[],sS={alloc(e,t,n){const r=Po;if(!r)return n;Po=void 0;const o={value:n,issues:null};return r.set(t.value,o),Ro.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(o,s)=>{if(s.direction!=="backward"&&aS(s,o.value))throw new nS;return n(o,s)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,o,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const i=e._zod.parse,a=(c,u)=>{if(n===void 0){const b=Bo(e,new Set);if(b===Vr)return e._zod.parse=i,e._zod.run===a&&(e._zod.run=i),i(c,u);b===Br||r?n=!0:r=!0}const d=c.value;if(!np(d))return i(c,u);let l=u[Ui];l||(l={buckets:new WeakMap,backEdges:void 0},u[Ui]=l);let f;o===u?f=s:(f=oS(l,e),o=u,s=f);const p=f.get(d);if(p)return c.value=p.value,p.issues?p.issues.length&&c.issues.push(...Hs(p.issues)):(c.memo=!0,l.backEdges??(l.backEdges=new WeakSet),l.backEdges.add(p.value)),c;Po=f;const v=Ro.length,g=i(c,u);Po=void 0;const w=Ro.length>v?Ro.pop():void 0;return g instanceof Promise?g.then(b=>(w&&(w.issues=b.issues.length?Hs(b.issues):Ol),b)):(w&&(w.issues=g.issues.length?Hs(g.issues):Ol),g)};e._zod.parse=a,e._zod.run===i&&(e._zod.run=a)})}};function iS(){return sS}function aS(e,t){var r;const n=(r=e[Ui])==null?void 0:r.backEdges;return n!==void 0&&np(t)&&n.has(t)}const cS=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(s,i){return s==="number"&&typeof i=="number"&&!Number.isFinite(i)?String(i):r[s]??s}return s=>{switch(s.code){case"invalid_type":{const i=o(s.expected),a=D_(s.input),c=o(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${jh(s.values[0])}`:`Invalid option: expected one of ${ll(s.values,"|")}`;case"too_big":{const i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);return a?`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{const i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);return a?`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`:`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{const i=s;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${n[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${ll(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(a=>`'${a}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function lS(){return{localeError:cS()}}var Pl;class uS{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function dS(){return new uS}(Pl=globalThis).__zod_globalRegistry??(Pl.__zod_globalRegistry=dS());const Ur=globalThis.__zod_globalRegistry;function op(e){return e.checks&&(e.checks=[...e.checks]),e}function fS(e,t){return new e(op({type:"string",...oe(t)}))}function hS(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...oe(t)})}function pS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...oe(t)})}function mS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...oe(t)})}function gS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...oe(t)})}function vS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...oe(t)})}function yS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...oe(t)})}function bS(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...oe(t)})}function wS(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...oe(t)})}function _S(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...oe(t)})}function xS(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...oe(t)})}function SS(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...oe(t)})}function ES(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...oe(t)})}function CS(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...oe(t)})}function kS(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...oe(t)})}function OS(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...oe(t)})}function PS(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...oe(t)})}function RS(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...oe(t)})}function TS(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...oe(t)})}function IS(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...oe(t)})}function AS(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...oe(t)})}function NS(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...oe(t)})}function DS(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...oe(t)})}function MS(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...oe(t)})}function jS(e,t){return new e({type:"string",format:"date",check:"string_format",...oe(t)})}function $S(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...oe(t)})}function zS(e,t){return new e({type:"string",format:"duration",check:"string_format",...oe(t)})}function FS(e,t){return new e(op({type:"number",checks:[],...oe(t)}))}function LS(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...oe(t)})}function VS(e,t){return new e({type:"boolean",...oe(t)})}function US(e){return new e({type:"unknown"})}function ZS(e,t){return new e({type:"never",...oe(t)})}function Rl(e,t){return new Zh({check:"less_than",...oe(t),value:e,inclusive:!1})}function Ws(e,t){return new Zh({check:"less_than",...oe(t),value:e,inclusive:!0})}function Tl(e,t){return new Bh({check:"greater_than",...oe(t),value:e,inclusive:!1})}function Ks(e,t){return new Bh({check:"greater_than",...oe(t),value:e,inclusive:!0})}function Il(e,t){return new F1({check:"multiple_of",...oe(t),value:e})}function sp(e,t){return new V1({check:"max_length",...oe(t),maximum:e})}function rs(e,t){return new U1({check:"min_length",...oe(t),minimum:e})}function ip(e,t){return new Z1({check:"length_equals",...oe(t),length:e})}function BS(e,t){return new B1({check:"string_format",format:"regex",...oe(t),pattern:e})}function HS(e){return new H1({check:"string_format",format:"lowercase",...oe(e)})}function WS(e){return new W1({check:"string_format",format:"uppercase",...oe(e)})}function KS(e,t){return new K1({check:"string_format",format:"includes",...oe(t),includes:e})}function GS(e,t){return new G1({check:"string_format",format:"starts_with",...oe(t),prefix:e})}function qS(e,t){return new q1({check:"string_format",format:"ends_with",...oe(t),suffix:e})}function QS(e,t){return new Q1({check:"properties",shape:e,...oe(t)})}function Pr(e){return new Y1({check:"overwrite",tx:e})}function YS(e){return Pr(t=>t.normalize(e))}function JS(){return Pr(e=>e.trim())}function XS(){return Pr(e=>e.toLowerCase())}function eE(){return Pr(e=>e.toUpperCase())}function tE(){return Pr(e=>__(e))}function nE(e,t,n){return new e({type:"array",element:t,...oe(n)})}function rE(e,t,n){return new e({type:"custom",check:"custom",fn:t,...oe(n)})}function oE(e,t){const n=sE(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Jr(o,r.value,n._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Jr(s))}},e(r.value,r)),t);return n}function sE(e,t){const n=new ht({check:"custom",...oe(t)});return n._zod.check=e,n}function Hr(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Gn(e,r,n[r]);return e}function ap(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Ur,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",intersections:[],deferred:[],external:(e==null?void 0:e.external)??void 0}}function Rr(e,t,n,r,o){const s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(o);return Object.assign(n,s),!0}function ot(e,t,n={path:[],schemaPath:[]}){var d,l;var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const a=(l=(d=e._zod).toJSONSchema)==null?void 0:l.call(d);if(a)i.schema=a;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const v=i.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,v,f)}const p=e._zod.parent;p&&(i.ref||(i.ref=p),ot(p,t,f),t.seen.get(p).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Hr(i.schema,c),t.io==="input"&&ut(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Al(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function cp(e,t){var i,a,c,u;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const d of e.seen.entries()){const l=(i=e.metadataRegistry.get(d[0]))==null?void 0:i.id;if(l){const f=r.get(l);if(f&&f!==d[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(l,d[0])}}const o=d=>{var g;const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const w=(g=e.external.registry.get(d[0]))==null?void 0:g.id,b=e.external.uri??(_=>_);if(w)return{ref:b(w)};const x=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=x,{defId:x,ref:`${b("__shared")}#/${l}/${Al(x)}`}}const f="#",p=`${f}/${l}/`;if(d[1]===n&&!d[1].schema.id)return{ref:f};const v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+Al(v)}},s=d=>{if(d[1].schema.$ref)return;const l=d[1],{ref:f,defId:p}=o(d);l.def={...l.schema},p&&(l.defId=p);const v=l.schema;for(const g in v)delete v[g];v.$ref=f};if(e.cycles==="throw")for(const d of e.seen.entries()){const l=d[1];if(l.cycle)throw new Error(`Cycle detected: #/${(a=l.cycle)==null?void 0:a.join("/")}/<root>
|
|
247
247
|
|
|
248
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const l=d[1];if(t===d[0]){s(d);continue}if(e.external){const p=(c=e.external.registry.get(d[0]))==null?void 0:c.id;if(t!==d[0]&&p){s(d);continue}}if((u=e.metadataRegistry.get(d[0]))==null?void 0:u.id){s(d);continue}if(l.cycle){s(d);continue}l.count>1&&e.reused==="ref"&&s(d)}e.external&&(e.sharedDefsExtractedFor=e.external)}function lp(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;lp(r);const o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;const s=r.type;for(const i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;n.includes(i)||n.push(i)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const up=new Set(["type","properties","required","additionalProperties"]),Nl=["oneOf","anyOf"];function Dl(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Zi(e){var s;const t=[];for(const i of e){if(typeof i!="object"||i.type!=="object")return null;for(const a in i)if(!up.has(a))return null;t.push(i)}const n={},r=new Set;for(const i of t){for(const a in i.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;const c=[];for(const d of t){const l=((s=d.properties)==null?void 0:s[a])??Dl(d);l!=null&&(c.some(f=>JSON.stringify(f)===JSON.stringify(l))||c.push(l))}const u=c.length===1?c[0]:Zi(c)??{allOf:c};Gn(n,a,u)}for(const a of i.required??[])r.add(a)}const o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{const i=[];for(const a of t){const c=Dl(a);c&&!i.some(u=>JSON.stringify(u)===JSON.stringify(c))&&i.push(c)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function iE(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of up)if(o in e)return;const n=t.filter(o=>Nl.some(s=>Array.isArray(o[s])));let r=null;if(!n.length)r=Zi(t);else{const o=n[0],s=Nl.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;const i=t.filter(c=>c!==o),a=o[s].map(c=>Zi([...i,c]));if(a.some(c=>!c))return;r={[s]:a}}r&&(delete e.allOf,Hr(e,r))}function dp(e,t){var a,c,u,d;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const f=e.seen.get(l);if(f.ref===null)return;const p=f.def??f.schema,v={...p},g=f.ref;if(f.ref=null,g){r(g);const b=e.seen.get(g),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Hr(p,x),Hr(p,v),l._zod.parent===g)for(const C in p)C==="$ref"||C==="allOf"||C in v||delete p[C];if(x.$ref&&b.def)for(const C in p)C==="$ref"||C==="allOf"||C in b.def&&JSON.stringify(p[C])===JSON.stringify(b.def[C])&&delete p[C]}const w=l._zod.parent;if(w&&w!==g){r(w);const b=e.seen.get(w);if(b!=null&&b.schema.$ref&&(p.$ref=b.schema.$ref,b.def))for(const x in p)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(p[x])===JSON.stringify(b.def[x])&&delete p[x]}e.override({zodSchema:l,jsonSchema:p,path:f.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const l of[...e.seen.entries()].reverse())r(l[0]);if(e.target!=="openapi-3.0")for(const l of e.seen.entries())lp(l[1].def??l[1].schema);for(const l of e.deferred)l();if(e.intersections.length){const l=new Map;for(const f of e.seen.values())for(const p of[f.schema,f.def]){const v=p==null?void 0:p.allOf;if(!Array.isArray(v))continue;const g=l.get(v);g?g.push(p):l.set(v,[p])}for(const f of e.intersections)for(const p of l.get(f)??[])iE(p)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const l=(c=e.external.registry.get(t))==null?void 0:c.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Hr(o,n.defId?n.schema:n.def??n.schema);const s=(u=e.metadataRegistry.get(t))==null?void 0:u.id;s!==void 0&&o.id===s&&delete o.id;const i=((d=e.external)==null?void 0:d.defs)??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,Gn(i,f.defId,f.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:os(t,"input",e.processors),output:os(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function ut(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ut(r.element,n);if(r.type==="set")return ut(r.valueType,n);if(r.type==="lazy")return ut(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return ut(r.innerType,n);if(r.type==="intersection")return ut(r.left,n)||ut(r.right,n);if(r.type==="record"||r.type==="map")return ut(r.keyType,n)||ut(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ut(r.in,n)||ut(r.out,n);if(r.type==="object"){for(const o in r.shape)if(ut(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(ut(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(ut(o,n))return!0;return!!(r.rest&&ut(r.rest,n))}return!1}const aE=(e,t={})=>n=>{const r=ap({...n,processors:t});return ot(e,r),cp(r,e),dp(r,e)},os=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=ap({...o??{},target:s,io:t,processors:n});return ot(e,i),cp(i,e),dp(i,e)},wr=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},_r=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ml=(e,t)=>{wr(e,"minimum",t),_r(e,"maximum",t)},fp=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},hp=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},pp=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},mp=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},jl=(e,t)=>wr(e,"minimum",t.minimum),$l=(e,t)=>_r(e,"maximum",t.maximum),zl=e=>(t,n)=>{mp(t,n.format);const[r,o]=e[n.format];wr(t,"minimum",r),_r(t,"maximum",o)},Gs={greater_than:(e,t)=>wr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>_r(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>fp(e,t.value),number_format:zl($h),bigint_format:zl(C_),min_length:jl,max_length:$l,length_equals:(e,t)=>Ml(e,t.length),min_size:jl,max_size:$l,size_equals:(e,t)=>Ml(e,t.size),string_format:(e,t)=>{mp(e,t.format),t.pattern&&hp(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>pp(e,t.mime)};function Zt(e){var s;const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const i of r)(s=Gs[i._zod.def.check])==null||s.call(Gs,t,i._zod.def);const o=e._zod.bag;o.minimum!==void 0&&wr(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&wr(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&_r(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&_r(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&fp(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&pp(t,o.mime);for(const i of o.patterns??[])hp(t,i);return t}const cE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lE=new Map([[Yh,k1],[Ya,O1]]),uE=e=>lE.get(e)??e,dE=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:d}=Zt(e);if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=cE[a]??a,o.format===""&&delete o.format,(a==="time"||d)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c].map(uE);l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},fE=(e,t,n,r)=>{const o=n,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:d}=Zt(e);o.type=d?"integer":"number";const l=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(l?p?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof s=="number"&&(o.minimum=s),f?p?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof i=="number"&&(o.maximum=i),a){const v=new Set;for(const b of a)Number.isFinite(b)&&b!==0?v.add(Math.abs(b)):Rr(e,t,o,r,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);const[g,...w]=v;g!==void 0&&(o.multipleOf=g),w.length&&(o.allOf=[...o.allOf??[],...w.map(b=>({multipleOf:b}))])}},hE=(e,t,n,r)=>{n.type="boolean"},pE=(e,t,n,r)=>{n.not={}},mE=(e,t,n,r)=>{},gE=(e,t,n,r)=>{const o=e._zod.def,s=$i(o.entries);if(s.length===0){n.not={};return}s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},vE=(e,t,n,r)=>{Rr(e,t,n,r,"Custom types cannot be represented in JSON Schema")},yE=(e,t,n,r)=>{Rr(e,t,n,r,"Transforms cannot be represented in JSON Schema")},bE=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=Zt(e);typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=ot(s.element,t,{...r,path:[...r.path,"items"]})};function Bi(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Bi(t.out):t.type==="catch"?Bi(t.innerType):e._zod.optin}const wE=(e,t,n,r)=>{var u;const o=n,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Rr(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const d in i)Gn(o.properties,d,ot(i[d],t,{...r,path:[...r.path,"properties",d]}));const c=[];for(const d of Object.keys(i)){const l=s.shape[d];(t.io==="input"?Bi(l)===void 0:l._zod.optout===void 0)&&c.push(d)}c.length>0&&(o.required=c),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=ot(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},_E=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>ot(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},xE=(e,t,n,r)=>{const o=e._zod.def,s=ot(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=ot(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c,t.intersections.push(c)},SE=(e,t,n,r)=>{const o=e._zod.def,s=ot(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},EE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Ja=Symbol();function gp(e,t,n,r,o){let s=!1;const i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(Rr(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),Ja):JSON.parse(i)}const CE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;const i=gp(o.defaultValue,e,t,n,r);i!==Ja&&(n.default=i)},kE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;const i=gp(o.defaultValue,e,t,n,r);i!==Ja&&(n._prefault=i)},OE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{Rr(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},PE=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;ot(i,t,r);const a=t.seen.get(e);a.ref=i},RE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},vp=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Fl=new WeakSet([Object.prototype,Error.prototype]);function To(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const TE=(e,t)=>{K_.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Fl.has(n)||(Fl.add(n),To(n,"format",r=>o=>Q_(r,o)),To(n,"flatten",r=>o=>q_(r,o)),To(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,zi,2)}),To(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,zi,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},At=M("ZodError",TE,void 0,{Parent:Error}),IE=Ha(At),AE=Wa(At),NE=Ka(At),DE=Ga(At),ME=n1(At),jE=r1(At),$E=o1(At),zE=s1(At),FE=i1(At),LE=a1(At),VE=c1(At),UE=l1(At);function ZE(){Bt.localeError||Pn(lS())}function Xa(){Bt.memoizer||Pn({memoizer:iS()})}const He=M("ZodType",(e,t)=>(ZE(),Be.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(St(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return On(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(VC(e,t))},superRefine(e,t){return this.check(UC(e,t))},overwrite(e){return this.check(Pr(e))},optional(){return Zl(this)},exactOptional(){return RC(this)},nullable(){return Bl(this)},nullish(){return Zl(Bl(this))},nonoptional(e){return MC(this,e)},array(){return bC(this)},or(e){return SC([this,e])},and(e){return CC(this,e)},transform(e){return Hl(this,PC(e))},default(e){return AC(this,e)},prefault(e){return DC(this,e)},catch(e){return $C(this,e)},pipe(e){return Hl(this,e)},readonly(){return LC(this)},describe(e){const t=this.clone();return Ur.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ur.get(this);const t=this.clone();return Ur.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ba(this,"~standard",{...Wh(this),jsonSchema:{input:os(this,"input"),output:os(this,"output")}})},set"~standard"(e){kn(this,"~standard",e)},parse:function e(t,n){return IE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await AE(this,t,n,{callee:e})},safeParse(e,t){return NE(this,e,t)},async safeParseAsync(e,t){return DE(this,e,t)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(e){kn(this,"spa",e)},validate(e,t){return X_(this,e,t)},validateAsync(e,t){return t1(this,e,t)},encode:function e(t,n){return ME(this,t,n,{callee:e})},decode:function e(t,n){return jE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await $E(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await zE(this,t,n,{callee:e})},safeEncode(e,t){return FE(this,e,t)},safeDecode(e,t){return LE(this,e,t)},async safeEncodeAsync(e,t){return VE(this,e,t)},async safeDecodeAsync(e,t){return UE(this,e,t)},toJSONSchema(e){return aE(this,{})(e)},get description(){var e;return(e=Ur.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),yp=M("_ZodString",(e,t)=>{Qa.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dE(e,n,r)},Fh({format:e=>Zt(e).format??null,minLength:e=>Zt(e).minimum??null,maxLength:e=>Zt(e).maximum??null},{regex(...e){return this.check(BS(...e))},includes(...e){return this.check(KS(...e))},startsWith(...e){return this.check(GS(...e))},endsWith(...e){return this.check(qS(...e))},min(...e){return this.check(rs(...e))},max(...e){return this.check(sp(...e))},length(...e){return this.check(ip(...e))},nonempty(...e){return this.check(rs(1,...e))},lowercase(e){return this.check(HS(e))},uppercase(e){return this.check(WS(e))},trim(){return this.check(JS())},normalize(...e){return this.check(YS(...e))},toLowerCase(){return this.check(XS())},toUpperCase(){return this.check(eE())},slugify(){return this.check(tE())}})),BE=M("ZodString",(e,t)=>{Qa.init(e,t),yp.init(e,t)},{email(e){return this.check(hS(qE,e))},url(e){return this.check(bS(YE,e))},jwt(e){return this.check(DS(fC,e))},emoji(e){return this.check(wS(JE,e))},guid(e){return this.check(pS(QE,e))},uuid(e){return this.check(mS(Io,e))},uuidv4(e){return this.check(gS(Io,e))},uuidv6(e){return this.check(vS(Io,e))},uuidv7(e){return this.check(yS(Io,e))},nanoid(e){return this.check(_S(XE,e))},cuid(e){return this.check(xS(eC,e))},cuid2(e){return this.check(SS(tC,e))},ulid(e){return this.check(ES(nC,e))},base64(e){return this.check(IS(lC,e))},base64url(e){return this.check(AS(uC,e))},xid(e){return this.check(CS(rC,e))},ksuid(e){return this.check(kS(oC,e))},ipv4(e){return this.check(OS(sC,e))},ipv6(e){return this.check(PS(iC,e))},cidrv4(e){return this.check(RS(aC,e))},cidrv6(e){return this.check(TS(cC,e))},e164(e){return this.check(NS(dC,e))},datetime(e){return this.check(MS(HE,e))},date(e){return this.check(jS(WE,e))},time(e){return this.check($S(KE,e))},duration(e){return this.check(zS(GE,e))}});function Ll(e){return fS(BE,e)}const Me=M("ZodStringFormat",(e,t)=>{Ne.init(e,t),yp.init(e,t)}),HE=M("ZodISODateTime",(e,t)=>{vx.init(e,t),Me.init(e,t)}),WE=M("ZodISODate",(e,t)=>{yx.init(e,t),Me.init(e,t)}),KE=M("ZodISOTime",(e,t)=>{bx.init(e,t),Me.init(e,t)}),GE=M("ZodISODuration",(e,t)=>{wx.init(e,t),Me.init(e,t)}),qE=M("ZodEmail",(e,t)=>{rx.init(e,t),Me.init(e,t)}),QE=M("ZodGUID",(e,t)=>{tx.init(e,t),Me.init(e,t)}),Io=M("ZodUUID",(e,t)=>{nx.init(e,t),Me.init(e,t)}),YE=M("ZodURL",(e,t)=>{lx.init(e,t),Me.init(e,t)}),JE=M("ZodEmoji",(e,t)=>{ux.init(e,t),Me.init(e,t)}),XE=M("ZodNanoID",(e,t)=>{dx.init(e,t),Me.init(e,t)}),eC=M("ZodCUID",(e,t)=>{fx.init(e,t),Me.init(e,t)}),tC=M("ZodCUID2",(e,t)=>{hx.init(e,t),Me.init(e,t)}),nC=M("ZodULID",(e,t)=>{px.init(e,t),Me.init(e,t)}),rC=M("ZodXID",(e,t)=>{mx.init(e,t),Me.init(e,t)}),oC=M("ZodKSUID",(e,t)=>{gx.init(e,t),Me.init(e,t)}),sC=M("ZodIPv4",(e,t)=>{_x.init(e,t),Me.init(e,t)}),iC=M("ZodIPv6",(e,t)=>{Sx.init(e,t),Me.init(e,t)}),aC=M("ZodCIDRv4",(e,t)=>{Ex.init(e,t),Me.init(e,t)}),cC=M("ZodCIDRv6",(e,t)=>{kx.init(e,t),Me.init(e,t)}),lC=M("ZodBase64",(e,t)=>{Ox.init(e,t),Me.init(e,t)}),uC=M("ZodBase64URL",(e,t)=>{Rx.init(e,t),Me.init(e,t)}),dC=M("ZodE164",(e,t)=>{Tx.init(e,t),Me.init(e,t)}),fC=M("ZodJWT",(e,t)=>{Ax.init(e,t),Me.init(e,t)}),bp=M("ZodNumber",(e,t)=>{Jh.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fE(e,n,r,o),e.isFinite=!0},Fh({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=Zt(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=Zt(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=Zt(e);return!!t||!!(n!=null&&n.some(Number.isSafeInteger))},format:e=>Zt(e).format??null},{gt(e,t){return this.check(Tl(e,t))},gte(e,t){return this.check(Ks(e,t))},min(e,t){return this.check(Ks(e,t))},lt(e,t){return this.check(Rl(e,t))},lte(e,t){return this.check(Ws(e,t))},max(e,t){return this.check(Ws(e,t))},int(e){return this.check(Vl(e))},safe(e){return this.check(Vl(e))},positive(e){return this.check(Tl(0,e))},nonnegative(e){return this.check(Ks(0,e))},negative(e){return this.check(Rl(0,e))},nonpositive(e){return this.check(Ws(0,e))},multipleOf(e,t){return this.check(Il(e,t))},step(e,t){return this.check(Il(e,t))},finite(){return this}}));function ik(e){return FS(bp,e)}const hC=M("ZodNumberFormat",(e,t)=>{Nx.init(e,t),bp.init(e,t)});function Vl(e){return LS(hC,e)}const pC=M("ZodBoolean",(e,t)=>{Dx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hE(e,n,r)});function ak(e){return VS(pC,e)}const mC=M("ZodUnknown",(e,t)=>{Mx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mE()});function Ul(){return US(mC)}const gC=M("ZodNever",(e,t)=>{jx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pE(e,n,r)});function vC(e){return ZS(gC,e)}const yC=M("ZodArray",(e,t)=>{Xa(),Fx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bE(e,n,r,o),e.element=t.element},{min(e,t){return this.check(rs(e,t))},nonempty(e){return this.check(rs(1,e))},max(e,t){return this.check(sp(e,t))},length(e,t){return this.check(ip(e,t))},unwrap(){return this.element}});function bC(e,t){return nE(yC,e,t)}const wC=M("ZodObject",(e,t)=>{Xa(),Ux.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wE(e,n,r,o),F_(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return kC(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(St(this._zod.def,{catchall:e}))},passthrough(){return this.clone(St(this._zod.def,{catchall:Ul()}))},loose(){return this.clone(St(this._zod.def,{catchall:Ul()}))},strict(){return this.clone(St(this._zod.def,{catchall:vC()}))},strip(){return this.clone(St(this._zod.def,{catchall:void 0}))},extend(e){return P_(this,e)},safeExtend(e){return R_(this,e)},merge(e){return T_(this,e)},pick(e){return k_(this,e)},omit(e){return O_(this,e)},partial(...e){return ul(wp,this,e[0])},exactPartial(...e){return ul(_p,this,e[0],"exactPartial")},required(...e){return I_(xp,this,e[0])}});function _C(e,t){const n={type:"object",shape:e??{},...oe(t)};return new wC(n)}const xC=M("ZodUnion",(e,t)=>{Zx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_E(e,n,r,o),e.options=t.options});function SC(e,t){return new xC({type:"union",options:e,...oe(t)})}const EC=M("ZodIntersection",(e,t)=>{Bx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xE(e,n,r,o)});function CC(e,t){return new EC({type:"intersection",left:e,right:t})}const Hi=M("ZodEnum",(e,t)=>{Hx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(r,o,s)=>gE(e,r,o),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Hi({...t,checks:[],...oe(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Hi({...t,checks:[],...oe(o),entries:s})}});function kC(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Hi({type:"enum",entries:n,...oe(t)})}const OC=M("ZodTransform",(e,t)=>{Xa(),Wx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yE(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Lh(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Jr(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Jr(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function PC(e){return new OC({type:"transform",transform:e})}const wp=M("ZodOptional",(e,t)=>{tp.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Zl(e){return new wp({type:"optional",innerType:e})}const _p=M("ZodExactOptional",(e,t)=>{Kx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function RC(e){return new _p({type:"optional",innerType:e})}const TC=M("ZodNullable",(e,t)=>{Gx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>SE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Bl(e){return new TC({type:"nullable",innerType:e})}const IC=M("ZodDefault",(e,t)=>{qx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>CE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function AC(e,t){return new IC({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Mh(t)}})}const NC=M("ZodPrefault",(e,t)=>{Qx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function DC(e,t){return new NC({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Mh(t)}})}const xp=M("ZodNonOptional",(e,t)=>{Yx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>EE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function MC(e,t){return new xp({type:"nonoptional",innerType:e,...oe(t)})}const jC=M("ZodCatch",(e,t)=>{Jx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>OE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $C(e,t){return new jC({type:"catch",innerType:e,catchValue:typeof t=="function"?t:V_(t)})}const zC=M("ZodPipe",(e,t)=>{Xx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>PE(e,n,r,o),e.in=t.in,e.out=t.out});function Hl(e,t){return new zC({type:"pipe",in:e,out:t})}const FC=M("ZodReadonly",(e,t)=>{eS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>RE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function LC(e){return new FC({type:"readonly",innerType:e})}const Sp=M("ZodCustom",(e,t)=>{tS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vE(e,n,r,o)});function VC(e,t={}){return rE(Sp,e,t)}function UC(e,t){return oE(e,t)}const ZC=M("ZodInstanceOf",(e,t)=>{Sp.init(e,t)},{properties(e,t){return this.check(QS(e,t))}});function ck(e,t={}){const n=new ZC({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...oe(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var BC=Object.defineProperty,HC=(e,t)=>BC(e,"name",{value:t,configurable:!0}),Ep=h.forwardRef(HC(function(t,n){return m.jsx(Ze.label,{...t,ref:n,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label"));const WC=so("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wi=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce(WC(),r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Ep,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Wi.displayName=Ep.displayName;function qs(e){const t=ee.c(10),{id:n,message:r,className:o,assertive:s}=e;let i;t[0]!==s?(i=s?{role:"alert"}:{},t[0]=s,t[1]=i):i=t[1];const a=!r&&"absolute";let c;t[2]!==o||t[3]!==a?(c=ce("text-sm text-destructive",a,o),t[2]=o,t[3]=a,t[4]=c):c=t[4];const u=r??"";let d;return t[5]!==n||t[6]!==i||t[7]!==c||t[8]!==u?(d=m.jsx("p",{id:n,...i,className:c,children:u}),t[5]=n,t[6]=i,t[7]=c,t[8]=u,t[9]=d):d=t[9],d}function KC(e){return Object.entries(e).filter(([t,n])=>t!=="root"&&typeof(n==null?void 0:n.message)=="string").length}const Wl=e=>e===1?"1 field needs attention":`${e} fields need attention`,GC=100;function qC(e){var r,o,s,i;const t=(r=e==null?void 0:e.closest("form"))==null?void 0:r.querySelector('[aria-invalid="true"]');if(!t)return"";if(t!==document.activeElement)return t.focus(),"";const n=(o=t.getAttribute("aria-describedby"))==null?void 0:o.split(" ")[0];return n&&((i=(s=document.getElementById(n))==null?void 0:s.textContent)==null?void 0:i.trim())||""}function QC(e,t){return e?`${/[.!?]$/.test(e)?e:`${e}.`} ${Wl(t)}`:Wl(t)}function YC(e){const t=ee.c(5),{errors:n,submitCount:r}=e,o=h.useRef(null),s=KC(n),[i,a]=h.useState(r),[c,u]=h.useState(""),[d,l]=h.useState(null);i!==r?(a(r),u(""),l(s>0?{submit:r,count:s}:null)):s===0&&(c!==""||d!==null)&&(u(""),l(null));let f,p;t[0]!==d?(f=()=>{if(d===null)return;const g=qC(o.current),w=setTimeout(()=>{u(QC(g,d.count)),l(null)},GC);return()=>clearTimeout(w)},p=[d],t[0]=d,t[1]=f,t[2]=p):(f=t[1],p=t[2]),h.useEffect(f,p);let v;return t[3]!==c?(v=m.jsx("p",{ref:o,"aria-live":"polite",className:"sr-only",children:c}),t[3]=c,t[4]=v):v=t[4],v}const ec=8,lk=`Use at least ${ec} characters`,JC=`Password must be at least ${ec} characters`;function uk(e,t,n){return n?t:e}const XC=so("rounded-lg bg-card text-card-foreground",{variants:{level:{0:"",1:"shadow-card-1",2:"shadow-card-2",3:"shadow-card-3",4:"shadow-card-4"}},defaultVariants:{level:2}}),Cp=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,level:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==r||n[5]!==o?(i=ce(XC({level:o}),r),n[4]=r,n[5]=o,n[6]=i):i=n[6];let a;return n[7]!==s||n[8]!==t||n[9]!==i?(a=m.jsx("div",{ref:t,className:i,...s}),n[7]=s,n[8]=t,n[9]=i,n[10]=a):a=n[10],a});Cp.displayName="Card";const kp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col space-y-1.5 p-6",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});kp.displayName="CardHeader";const Op=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-2xl font-semibold leading-none tracking-tight",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Op.displayName="CardTitle";const Pp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Pp.displayName="CardDescription";const Rp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Rp.displayName="CardContent";const e2=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex items-center p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});e2.displayName="CardFooter";const t2=_C({email:Ll().email("Enter a valid email"),password:Ll().min(ec,JC)});function n2(){var le,Pe,je,Ee;const e=ee.c(58),t=su(),{resolvedTheme:n}=ss(),r=n==="dark"?"/logo-dark.svg":"/logo.svg";let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:Qo.authStatus,queryFn:y0,staleTime:1/0},e[0]=o):o=e[0];const s=Wo(o),i=Qi();let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={shouldFocusError:!1,resolver:m_(t2)},e[1]=a):a=e[1];const{register:c,handleSubmit:u,setError:d,formState:l}=d_(a),{errors:f,isSubmitting:p,submitCount:v}=l;let g;e[2]!==t||e[3]!==i||e[4]!==d?(g=async function(We){try{const{status:kt}=await hh.post("/api/v1/auth/login",{email:We.email,password:We.password});if(kt!==200){d("root",{message:"Invalid email or password"});return}i.clear(),t("/app-center",{replace:!0})}catch{d("root",{message:"Network error. Please try again."})}},e[2]=t,e[3]=i,e[4]=d,e[5]=g):g=e[5];const w=g;if(((le=s.data)==null?void 0:le.initialized)===!1){let $e;return e[6]===Symbol.for("react.memo_cache_sentinel")?($e=m.jsx(Gi,{to:"/setup",replace:!0}),e[6]=$e):$e=e[6],$e}let b;e[7]!==r?(b=m.jsx("img",{src:r,alt:"tapflow",className:"w-6 h-6"}),e[7]=r,e[8]=b):b=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("span",{className:"text-base font-semibold tracking-tight",children:"tapflow"}),e[9]=x):x=e[9];let _;e[10]!==b?(_=m.jsxs("div",{className:"flex items-center gap-2",children:[b,x]}),e[10]=b,e[11]=_):_=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsxs(kp,{className:"text-center",children:[m.jsx(Op,{className:"text-2xl tracking-display-md",children:"Welcome back"}),m.jsx(Pp,{children:"Sign in to your team workspace"})]}),e[12]=C):C=e[12];let E;e[13]!==u||e[14]!==w?(E=u(w),e[13]=u,e[14]=w,e[15]=E):E=e[15];let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(Wi,{htmlFor:"email",children:"Email"}),e[16]=P):P=e[16];const R=!!f.email,T=f.email?"email-error":void 0;let A;e[17]!==c?(A=c("email"),e[17]=c,e[18]=A):A=e[18];let j;e[19]!==R||e[20]!==T||e[21]!==A?(j=m.jsx(Go,{id:"email",type:"email",placeholder:"you@company.com",autoComplete:"email","aria-required":"true","aria-invalid":R,"aria-describedby":T,...A}),e[19]=R,e[20]=T,e[21]=A,e[22]=j):j=e[22];const F=(Pe=f.email)==null?void 0:Pe.message;let z;e[23]!==F?(z=m.jsx(qs,{id:"email-error",message:F}),e[23]=F,e[24]=z):z=e[24];let Y;e[25]!==j||e[26]!==z?(Y=m.jsxs("div",{className:"grid gap-2",children:[P,j,z]}),e[25]=j,e[26]=z,e[27]=Y):Y=e[27];let Z;e[28]===Symbol.for("react.memo_cache_sentinel")?(Z=m.jsx(Wi,{htmlFor:"password",children:"Password"}),e[28]=Z):Z=e[28];const K=!!f.password,H=f.password?"password-error":void 0;let J;e[29]!==c?(J=c("password"),e[29]=c,e[30]=J):J=e[30];let ne;e[31]!==K||e[32]!==H||e[33]!==J?(ne=m.jsx(Go,{id:"password",type:"password",autoComplete:"current-password","aria-required":"true","aria-invalid":K,"aria-describedby":H,...J}),e[31]=K,e[32]=H,e[33]=J,e[34]=ne):ne=e[34];const te=(je=f.password)==null?void 0:je.message;let X;e[35]!==te?(X=m.jsx(qs,{id:"password-error",message:te}),e[35]=te,e[36]=X):X=e[36];let q;e[37]!==ne||e[38]!==X?(q=m.jsxs("div",{className:"grid gap-2",children:[Z,ne,X]}),e[37]=ne,e[38]=X,e[39]=q):q=e[39];const me=(Ee=f.root)==null?void 0:Ee.message;let he;e[40]!==me?(he=m.jsx(qs,{assertive:!0,id:"login-error",message:me}),e[40]=me,e[41]=he):he=e[41];const ae=p?"Signing in…":"Sign in";let re;e[42]!==p||e[43]!==ae?(re=m.jsx(is,{type:"submit",size:"lg",disabled:p,className:"w-full mt-1",children:ae}),e[42]=p,e[43]=ae,e[44]=re):re=e[44];let B;e[45]!==f||e[46]!==v?(B=m.jsx(YC,{errors:f,submitCount:v}),e[45]=f,e[46]=v,e[47]=B):B=e[47];let se;e[48]!==Y||e[49]!==q||e[50]!==he||e[51]!==re||e[52]!==B||e[53]!==E?(se=m.jsxs(Cp,{level:4,className:"w-full",children:[C,m.jsx(Rp,{children:m.jsxs("form",{onSubmit:E,className:"flex flex-col gap-4",children:[Y,q,he,re,B]})})]}),e[48]=Y,e[49]=q,e[50]=he,e[51]=re,e[52]=B,e[53]=E,e[54]=se):se=e[54];let ye;return e[55]!==se||e[56]!==_?(ye=m.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:m.jsxs("div",{className:"flex flex-col items-center gap-6 w-full max-w-sm",children:[_,se]})}),e[55]=se,e[56]=_,e[57]=ye):ye=e[57],ye}function r2(){return new Om({defaultOptions:{queries:{retry:0,refetchOnWindowFocus:!0,networkMode:"always"}}})}const o2=h.lazy(()=>Et(()=>import("./Setup-DZrhA_7b.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.Setup}))),s2=h.lazy(()=>Et(()=>import("./Invite-BCndVxaO.js"),__vite__mapDeps([4,1,2,3,5])).then(e=>({default:e.Invite}))),i2=h.lazy(()=>Et(()=>import("./ResetPassword-8rj7ASt1.js"),__vite__mapDeps([6,1,2,3])).then(e=>({default:e.ResetPassword}))),a2=h.lazy(()=>Et(()=>import("./AppCenter-S1y-8_7l.js"),__vite__mapDeps([7,1,8,9,10,11,12,13,14,15,16,17,18,19,3])).then(e=>({default:e.AppCenter}))),c2=h.lazy(()=>Et(()=>import("./QASession-B67RsIPm.js"),__vite__mapDeps([20,1,21,22,3,15,23,24,11,8,17,25,10,26,19,9,14,16,27])).then(e=>({default:e.QASession}))),l2=h.lazy(()=>Et(()=>import("./Runs-DpK5aoBr.js"),__vite__mapDeps([28,1,14,8,12,25,9,10,29,19,18,30,3])).then(e=>({default:e.Runs}))),u2=h.lazy(()=>Et(()=>import("./RunDetail-BIgq9gJ0.js"),__vite__mapDeps([31,1,14,12,30,32,10,9,33,22,17,24,3])).then(e=>({default:e.RunDetail}))),d2=h.lazy(()=>Et(()=>import("./AISessionWatch-C2h4NZ_I.js"),__vite__mapDeps([34,1,21,22,33,23,17,3])).then(e=>({default:e.AISessionWatch}))),f2=h.lazy(()=>Et(()=>import("./MacResources-41cFDgE1.js"),__vite__mapDeps([35,1,21,19,25,27,36,3])).then(e=>({default:e.MacResources}))),h2=h.lazy(()=>Et(()=>import("./Default-C-l1O-g9.js"),__vite__mapDeps([37,1,2,14,16,15,32,10,5,3])).then(e=>({default:e.DefaultSettings}))),p2=h.lazy(()=>Et(()=>import("./Team-CJThCjd3.js"),__vite__mapDeps([38,1,11,15,9,10,29,19,26,18,3])).then(e=>({default:e.TeamSettings}))),m2=h.lazy(()=>Et(()=>import("./Tokens-DGURtHWi.js"),__vite__mapDeps([39,1,14,15,11,9,10,29,19,26,18,13,3])).then(e=>({default:e.TokenSettings}))),g2=h.lazy(()=>Et(()=>import("./NotFound-DVq_rCKc.js"),__vite__mapDeps([40,1])).then(e=>({default:e.NotFound}))),v2=m.jsx("div",{className:"flex h-screen w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),Ao=e=>m.jsx(h.Suspense,{fallback:v2,children:e}),y2=r2();function b2(){const e=ee.c(16);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=m.jsx(st,{path:"/login",element:m.jsx(n2,{})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(st,{path:"/setup",element:Ao(m.jsx(o2,{}))}),e[1]=n):n=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(st,{path:"/invite",element:Ao(m.jsx(s2,{}))}),e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(st,{path:"/reset-password",element:Ao(m.jsx(i2,{}))}),e[3]=o):o=e[3];let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(V0,{}),e[4]=s):s=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(st,{index:!0,element:m.jsx(Gi,{to:"/app-center",replace:!0})}),e[5]=i):i=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(st,{path:"/app-center",element:m.jsx(a2,{})}),e[6]=a):a=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(st,{path:"/app-center/build",element:m.jsx(c2,{})}),e[7]=c):c=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(st,{path:"/automation/runs",element:m.jsx(l2,{})}),e[8]=u):u=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(st,{path:"/automation/runs/:runId",element:m.jsx(u2,{})}),e[9]=d):d=e[9];let l;e[10]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(st,{path:"/automation/sessions/:sessionId",element:m.jsx(d2,{})}),e[10]=l):l=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx(st,{path:"/mac-resources",element:m.jsx(f2,{})}),e[11]=f):f=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(st,{path:"/settings/default",element:m.jsx(h2,{})}),e[12]=p):p=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsx(st,{path:"/settings/team",element:m.jsx(p2,{})}),e[13]=v):v=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsxs(st,{element:s,children:[i,a,c,u,d,l,f,p,v,m.jsx(st,{path:"/settings/tokens",element:m.jsx(m2,{})})]}),e[14]=g):g=e[14];let w;return e[15]===Symbol.for("react.memo_cache_sentinel")?(w=m.jsx(tm,{client:y2,children:m.jsxs(Up,{children:[m.jsxs(Zp,{children:[t,n,r,o,g,m.jsx(st,{path:"*",element:Ao(m.jsx(g2,{}))})]}),m.jsx(Zg,{position:"bottom-right",richColors:!0})]})}),e[15]=w):w=e[15],w}Lp.createRoot(document.getElementById("root")).render(m.jsx(h.StrictMode,{children:m.jsx(Kp,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:m.jsx(b2,{})})}));export{S2 as $,tt as A,is as B,Cp as C,vt as D,fu as E,qs as F,Ge as G,E2 as H,Go as I,q2 as J,Mb as K,Wi as L,jb as M,vf as N,Ym as O,lk as P,Dc as Q,ph as R,qo as S,Db as T,ek as U,J2 as V,Y2 as W,Q2 as X,_0 as Y,K2 as Z,ck as _,m_ as a,ma as a$,G2 as a0,X2 as a1,ce as a2,rg as a3,ng as a4,Te as a5,Ze as a6,Vu as a7,rn as a8,en as a9,H2 as aA,vw as aB,jf as aC,ww as aD,En as aE,ik as aF,Nv as aG,w0 as aH,wa as aI,ak as aJ,V2 as aK,kC as aL,L2 as aM,so as aN,Yy as aO,k2 as aP,eb as aQ,Vd as aR,Zd as aS,Bd as aT,Ld as aU,ib as aV,nf as aW,ha as aX,us as aY,jd as aZ,as as a_,ct as aa,xa as ab,on as ac,de as ad,U2 as ae,I0 as af,Z2 as ag,xr as ah,Yd as ai,ao as aj,F0 as ak,tk as al,hg as am,$2 as an,N2 as ao,D2 as ap,z2 as aq,j2 as ar,M2 as as,rk as at,A2 as au,nk as av,ok as aw,Jm as ax,sg as ay,B2 as az,Qi as b,gd as b0,aa as b1,Xt as b2,of as b3,bb as b4,tf as b5,Qm as b6,C2 as b7,Wo as c,kp as d,Op as e,Rp as f,uk as g,YC as h,ec as i,JC as j,y0 as k,G0 as l,Pp as m,sk as n,_C as o,T0 as p,Qo as q,W2 as r,Ll as s,oo as t,d_ as u,F2 as v,Ps as w,Wr as x,Em as y,ss as z};
|
|
248
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const l=d[1];if(t===d[0]){s(d);continue}if(e.external){const p=(c=e.external.registry.get(d[0]))==null?void 0:c.id;if(t!==d[0]&&p){s(d);continue}}if((u=e.metadataRegistry.get(d[0]))==null?void 0:u.id){s(d);continue}if(l.cycle){s(d);continue}l.count>1&&e.reused==="ref"&&s(d)}e.external&&(e.sharedDefsExtractedFor=e.external)}function lp(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;lp(r);const o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;const s=r.type;for(const i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;n.includes(i)||n.push(i)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const up=new Set(["type","properties","required","additionalProperties"]),Nl=["oneOf","anyOf"];function Dl(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Zi(e){var s;const t=[];for(const i of e){if(typeof i!="object"||i.type!=="object")return null;for(const a in i)if(!up.has(a))return null;t.push(i)}const n={},r=new Set;for(const i of t){for(const a in i.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;const c=[];for(const d of t){const l=((s=d.properties)==null?void 0:s[a])??Dl(d);l!=null&&(c.some(f=>JSON.stringify(f)===JSON.stringify(l))||c.push(l))}const u=c.length===1?c[0]:Zi(c)??{allOf:c};Gn(n,a,u)}for(const a of i.required??[])r.add(a)}const o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{const i=[];for(const a of t){const c=Dl(a);c&&!i.some(u=>JSON.stringify(u)===JSON.stringify(c))&&i.push(c)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function iE(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of up)if(o in e)return;const n=t.filter(o=>Nl.some(s=>Array.isArray(o[s])));let r=null;if(!n.length)r=Zi(t);else{const o=n[0],s=Nl.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;const i=t.filter(c=>c!==o),a=o[s].map(c=>Zi([...i,c]));if(a.some(c=>!c))return;r={[s]:a}}r&&(delete e.allOf,Hr(e,r))}function dp(e,t){var a,c,u,d;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const f=e.seen.get(l);if(f.ref===null)return;const p=f.def??f.schema,v={...p},g=f.ref;if(f.ref=null,g){r(g);const b=e.seen.get(g),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Hr(p,x),Hr(p,v),l._zod.parent===g)for(const C in p)C==="$ref"||C==="allOf"||C in v||delete p[C];if(x.$ref&&b.def)for(const C in p)C==="$ref"||C==="allOf"||C in b.def&&JSON.stringify(p[C])===JSON.stringify(b.def[C])&&delete p[C]}const w=l._zod.parent;if(w&&w!==g){r(w);const b=e.seen.get(w);if(b!=null&&b.schema.$ref&&(p.$ref=b.schema.$ref,b.def))for(const x in p)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(p[x])===JSON.stringify(b.def[x])&&delete p[x]}e.override({zodSchema:l,jsonSchema:p,path:f.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const l of[...e.seen.entries()].reverse())r(l[0]);if(e.target!=="openapi-3.0")for(const l of e.seen.entries())lp(l[1].def??l[1].schema);for(const l of e.deferred)l();if(e.intersections.length){const l=new Map;for(const f of e.seen.values())for(const p of[f.schema,f.def]){const v=p==null?void 0:p.allOf;if(!Array.isArray(v))continue;const g=l.get(v);g?g.push(p):l.set(v,[p])}for(const f of e.intersections)for(const p of l.get(f)??[])iE(p)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const l=(c=e.external.registry.get(t))==null?void 0:c.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Hr(o,n.defId?n.schema:n.def??n.schema);const s=(u=e.metadataRegistry.get(t))==null?void 0:u.id;s!==void 0&&o.id===s&&delete o.id;const i=((d=e.external)==null?void 0:d.defs)??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,Gn(i,f.defId,f.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:os(t,"input",e.processors),output:os(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function ut(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ut(r.element,n);if(r.type==="set")return ut(r.valueType,n);if(r.type==="lazy")return ut(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return ut(r.innerType,n);if(r.type==="intersection")return ut(r.left,n)||ut(r.right,n);if(r.type==="record"||r.type==="map")return ut(r.keyType,n)||ut(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ut(r.in,n)||ut(r.out,n);if(r.type==="object"){for(const o in r.shape)if(ut(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(ut(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(ut(o,n))return!0;return!!(r.rest&&ut(r.rest,n))}return!1}const aE=(e,t={})=>n=>{const r=ap({...n,processors:t});return ot(e,r),cp(r,e),dp(r,e)},os=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=ap({...o??{},target:s,io:t,processors:n});return ot(e,i),cp(i,e),dp(i,e)},wr=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},_r=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ml=(e,t)=>{wr(e,"minimum",t),_r(e,"maximum",t)},fp=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},hp=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},pp=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},mp=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},jl=(e,t)=>wr(e,"minimum",t.minimum),$l=(e,t)=>_r(e,"maximum",t.maximum),zl=e=>(t,n)=>{mp(t,n.format);const[r,o]=e[n.format];wr(t,"minimum",r),_r(t,"maximum",o)},Gs={greater_than:(e,t)=>wr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>_r(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>fp(e,t.value),number_format:zl($h),bigint_format:zl(C_),min_length:jl,max_length:$l,length_equals:(e,t)=>Ml(e,t.length),min_size:jl,max_size:$l,size_equals:(e,t)=>Ml(e,t.size),string_format:(e,t)=>{mp(e,t.format),t.pattern&&hp(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>pp(e,t.mime)};function Zt(e){var s;const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const i of r)(s=Gs[i._zod.def.check])==null||s.call(Gs,t,i._zod.def);const o=e._zod.bag;o.minimum!==void 0&&wr(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&wr(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&_r(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&_r(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&fp(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&pp(t,o.mime);for(const i of o.patterns??[])hp(t,i);return t}const cE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lE=new Map([[Yh,k1],[Ya,O1]]),uE=e=>lE.get(e)??e,dE=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:d}=Zt(e);if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=cE[a]??a,o.format===""&&delete o.format,(a==="time"||d)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c].map(uE);l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},fE=(e,t,n,r)=>{const o=n,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:d}=Zt(e);o.type=d?"integer":"number";const l=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(l?p?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof s=="number"&&(o.minimum=s),f?p?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof i=="number"&&(o.maximum=i),a){const v=new Set;for(const b of a)Number.isFinite(b)&&b!==0?v.add(Math.abs(b)):Rr(e,t,o,r,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);const[g,...w]=v;g!==void 0&&(o.multipleOf=g),w.length&&(o.allOf=[...o.allOf??[],...w.map(b=>({multipleOf:b}))])}},hE=(e,t,n,r)=>{n.type="boolean"},pE=(e,t,n,r)=>{n.not={}},mE=(e,t,n,r)=>{},gE=(e,t,n,r)=>{const o=e._zod.def,s=$i(o.entries);if(s.length===0){n.not={};return}s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},vE=(e,t,n,r)=>{Rr(e,t,n,r,"Custom types cannot be represented in JSON Schema")},yE=(e,t,n,r)=>{Rr(e,t,n,r,"Transforms cannot be represented in JSON Schema")},bE=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=Zt(e);typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=ot(s.element,t,{...r,path:[...r.path,"items"]})};function Bi(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Bi(t.out):t.type==="catch"?Bi(t.innerType):e._zod.optin}const wE=(e,t,n,r)=>{var u;const o=n,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Rr(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const d in i)Gn(o.properties,d,ot(i[d],t,{...r,path:[...r.path,"properties",d]}));const c=[];for(const d of Object.keys(i)){const l=s.shape[d];(t.io==="input"?Bi(l)===void 0:l._zod.optout===void 0)&&c.push(d)}c.length>0&&(o.required=c),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=ot(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},_E=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>ot(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},xE=(e,t,n,r)=>{const o=e._zod.def,s=ot(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=ot(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c,t.intersections.push(c)},SE=(e,t,n,r)=>{const o=e._zod.def,s=ot(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},EE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Ja=Symbol();function gp(e,t,n,r,o){let s=!1;const i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(Rr(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),Ja):JSON.parse(i)}const CE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;const i=gp(o.defaultValue,e,t,n,r);i!==Ja&&(n.default=i)},kE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;const i=gp(o.defaultValue,e,t,n,r);i!==Ja&&(n._prefault=i)},OE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{Rr(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},PE=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;ot(i,t,r);const a=t.seen.get(e);a.ref=i},RE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},vp=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Fl=new WeakSet([Object.prototype,Error.prototype]);function To(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const TE=(e,t)=>{K_.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Fl.has(n)||(Fl.add(n),To(n,"format",r=>o=>Q_(r,o)),To(n,"flatten",r=>o=>q_(r,o)),To(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,zi,2)}),To(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,zi,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},At=M("ZodError",TE,void 0,{Parent:Error}),IE=Ha(At),AE=Wa(At),NE=Ka(At),DE=Ga(At),ME=n1(At),jE=r1(At),$E=o1(At),zE=s1(At),FE=i1(At),LE=a1(At),VE=c1(At),UE=l1(At);function ZE(){Bt.localeError||Pn(lS())}function Xa(){Bt.memoizer||Pn({memoizer:iS()})}const He=M("ZodType",(e,t)=>(ZE(),Be.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(St(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return On(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(VC(e,t))},superRefine(e,t){return this.check(UC(e,t))},overwrite(e){return this.check(Pr(e))},optional(){return Zl(this)},exactOptional(){return RC(this)},nullable(){return Bl(this)},nullish(){return Zl(Bl(this))},nonoptional(e){return MC(this,e)},array(){return bC(this)},or(e){return SC([this,e])},and(e){return CC(this,e)},transform(e){return Hl(this,PC(e))},default(e){return AC(this,e)},prefault(e){return DC(this,e)},catch(e){return $C(this,e)},pipe(e){return Hl(this,e)},readonly(){return LC(this)},describe(e){const t=this.clone();return Ur.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ur.get(this);const t=this.clone();return Ur.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ba(this,"~standard",{...Wh(this),jsonSchema:{input:os(this,"input"),output:os(this,"output")}})},set"~standard"(e){kn(this,"~standard",e)},parse:function e(t,n){return IE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await AE(this,t,n,{callee:e})},safeParse(e,t){return NE(this,e,t)},async safeParseAsync(e,t){return DE(this,e,t)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(e){kn(this,"spa",e)},validate(e,t){return X_(this,e,t)},validateAsync(e,t){return t1(this,e,t)},encode:function e(t,n){return ME(this,t,n,{callee:e})},decode:function e(t,n){return jE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await $E(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await zE(this,t,n,{callee:e})},safeEncode(e,t){return FE(this,e,t)},safeDecode(e,t){return LE(this,e,t)},async safeEncodeAsync(e,t){return VE(this,e,t)},async safeDecodeAsync(e,t){return UE(this,e,t)},toJSONSchema(e){return aE(this,{})(e)},get description(){var e;return(e=Ur.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),yp=M("_ZodString",(e,t)=>{Qa.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dE(e,n,r)},Fh({format:e=>Zt(e).format??null,minLength:e=>Zt(e).minimum??null,maxLength:e=>Zt(e).maximum??null},{regex(...e){return this.check(BS(...e))},includes(...e){return this.check(KS(...e))},startsWith(...e){return this.check(GS(...e))},endsWith(...e){return this.check(qS(...e))},min(...e){return this.check(rs(...e))},max(...e){return this.check(sp(...e))},length(...e){return this.check(ip(...e))},nonempty(...e){return this.check(rs(1,...e))},lowercase(e){return this.check(HS(e))},uppercase(e){return this.check(WS(e))},trim(){return this.check(JS())},normalize(...e){return this.check(YS(...e))},toLowerCase(){return this.check(XS())},toUpperCase(){return this.check(eE())},slugify(){return this.check(tE())}})),BE=M("ZodString",(e,t)=>{Qa.init(e,t),yp.init(e,t)},{email(e){return this.check(hS(qE,e))},url(e){return this.check(bS(YE,e))},jwt(e){return this.check(DS(fC,e))},emoji(e){return this.check(wS(JE,e))},guid(e){return this.check(pS(QE,e))},uuid(e){return this.check(mS(Io,e))},uuidv4(e){return this.check(gS(Io,e))},uuidv6(e){return this.check(vS(Io,e))},uuidv7(e){return this.check(yS(Io,e))},nanoid(e){return this.check(_S(XE,e))},cuid(e){return this.check(xS(eC,e))},cuid2(e){return this.check(SS(tC,e))},ulid(e){return this.check(ES(nC,e))},base64(e){return this.check(IS(lC,e))},base64url(e){return this.check(AS(uC,e))},xid(e){return this.check(CS(rC,e))},ksuid(e){return this.check(kS(oC,e))},ipv4(e){return this.check(OS(sC,e))},ipv6(e){return this.check(PS(iC,e))},cidrv4(e){return this.check(RS(aC,e))},cidrv6(e){return this.check(TS(cC,e))},e164(e){return this.check(NS(dC,e))},datetime(e){return this.check(MS(HE,e))},date(e){return this.check(jS(WE,e))},time(e){return this.check($S(KE,e))},duration(e){return this.check(zS(GE,e))}});function Ll(e){return fS(BE,e)}const Me=M("ZodStringFormat",(e,t)=>{Ne.init(e,t),yp.init(e,t)}),HE=M("ZodISODateTime",(e,t)=>{vx.init(e,t),Me.init(e,t)}),WE=M("ZodISODate",(e,t)=>{yx.init(e,t),Me.init(e,t)}),KE=M("ZodISOTime",(e,t)=>{bx.init(e,t),Me.init(e,t)}),GE=M("ZodISODuration",(e,t)=>{wx.init(e,t),Me.init(e,t)}),qE=M("ZodEmail",(e,t)=>{rx.init(e,t),Me.init(e,t)}),QE=M("ZodGUID",(e,t)=>{tx.init(e,t),Me.init(e,t)}),Io=M("ZodUUID",(e,t)=>{nx.init(e,t),Me.init(e,t)}),YE=M("ZodURL",(e,t)=>{lx.init(e,t),Me.init(e,t)}),JE=M("ZodEmoji",(e,t)=>{ux.init(e,t),Me.init(e,t)}),XE=M("ZodNanoID",(e,t)=>{dx.init(e,t),Me.init(e,t)}),eC=M("ZodCUID",(e,t)=>{fx.init(e,t),Me.init(e,t)}),tC=M("ZodCUID2",(e,t)=>{hx.init(e,t),Me.init(e,t)}),nC=M("ZodULID",(e,t)=>{px.init(e,t),Me.init(e,t)}),rC=M("ZodXID",(e,t)=>{mx.init(e,t),Me.init(e,t)}),oC=M("ZodKSUID",(e,t)=>{gx.init(e,t),Me.init(e,t)}),sC=M("ZodIPv4",(e,t)=>{_x.init(e,t),Me.init(e,t)}),iC=M("ZodIPv6",(e,t)=>{Sx.init(e,t),Me.init(e,t)}),aC=M("ZodCIDRv4",(e,t)=>{Ex.init(e,t),Me.init(e,t)}),cC=M("ZodCIDRv6",(e,t)=>{kx.init(e,t),Me.init(e,t)}),lC=M("ZodBase64",(e,t)=>{Ox.init(e,t),Me.init(e,t)}),uC=M("ZodBase64URL",(e,t)=>{Rx.init(e,t),Me.init(e,t)}),dC=M("ZodE164",(e,t)=>{Tx.init(e,t),Me.init(e,t)}),fC=M("ZodJWT",(e,t)=>{Ax.init(e,t),Me.init(e,t)}),bp=M("ZodNumber",(e,t)=>{Jh.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fE(e,n,r,o),e.isFinite=!0},Fh({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=Zt(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=Zt(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=Zt(e);return!!t||!!(n!=null&&n.some(Number.isSafeInteger))},format:e=>Zt(e).format??null},{gt(e,t){return this.check(Tl(e,t))},gte(e,t){return this.check(Ks(e,t))},min(e,t){return this.check(Ks(e,t))},lt(e,t){return this.check(Rl(e,t))},lte(e,t){return this.check(Ws(e,t))},max(e,t){return this.check(Ws(e,t))},int(e){return this.check(Vl(e))},safe(e){return this.check(Vl(e))},positive(e){return this.check(Tl(0,e))},nonnegative(e){return this.check(Ks(0,e))},negative(e){return this.check(Rl(0,e))},nonpositive(e){return this.check(Ws(0,e))},multipleOf(e,t){return this.check(Il(e,t))},step(e,t){return this.check(Il(e,t))},finite(){return this}}));function ik(e){return FS(bp,e)}const hC=M("ZodNumberFormat",(e,t)=>{Nx.init(e,t),bp.init(e,t)});function Vl(e){return LS(hC,e)}const pC=M("ZodBoolean",(e,t)=>{Dx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hE(e,n,r)});function ak(e){return VS(pC,e)}const mC=M("ZodUnknown",(e,t)=>{Mx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mE()});function Ul(){return US(mC)}const gC=M("ZodNever",(e,t)=>{jx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pE(e,n,r)});function vC(e){return ZS(gC,e)}const yC=M("ZodArray",(e,t)=>{Xa(),Fx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bE(e,n,r,o),e.element=t.element},{min(e,t){return this.check(rs(e,t))},nonempty(e){return this.check(rs(1,e))},max(e,t){return this.check(sp(e,t))},length(e,t){return this.check(ip(e,t))},unwrap(){return this.element}});function bC(e,t){return nE(yC,e,t)}const wC=M("ZodObject",(e,t)=>{Xa(),Ux.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wE(e,n,r,o),F_(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return kC(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(St(this._zod.def,{catchall:e}))},passthrough(){return this.clone(St(this._zod.def,{catchall:Ul()}))},loose(){return this.clone(St(this._zod.def,{catchall:Ul()}))},strict(){return this.clone(St(this._zod.def,{catchall:vC()}))},strip(){return this.clone(St(this._zod.def,{catchall:void 0}))},extend(e){return P_(this,e)},safeExtend(e){return R_(this,e)},merge(e){return T_(this,e)},pick(e){return k_(this,e)},omit(e){return O_(this,e)},partial(...e){return ul(wp,this,e[0])},exactPartial(...e){return ul(_p,this,e[0],"exactPartial")},required(...e){return I_(xp,this,e[0])}});function _C(e,t){const n={type:"object",shape:e??{},...oe(t)};return new wC(n)}const xC=M("ZodUnion",(e,t)=>{Zx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_E(e,n,r,o),e.options=t.options});function SC(e,t){return new xC({type:"union",options:e,...oe(t)})}const EC=M("ZodIntersection",(e,t)=>{Bx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xE(e,n,r,o)});function CC(e,t){return new EC({type:"intersection",left:e,right:t})}const Hi=M("ZodEnum",(e,t)=>{Hx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(r,o,s)=>gE(e,r,o),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Hi({...t,checks:[],...oe(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Hi({...t,checks:[],...oe(o),entries:s})}});function kC(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Hi({type:"enum",entries:n,...oe(t)})}const OC=M("ZodTransform",(e,t)=>{Xa(),Wx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yE(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Lh(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Jr(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Jr(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function PC(e){return new OC({type:"transform",transform:e})}const wp=M("ZodOptional",(e,t)=>{tp.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Zl(e){return new wp({type:"optional",innerType:e})}const _p=M("ZodExactOptional",(e,t)=>{Kx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function RC(e){return new _p({type:"optional",innerType:e})}const TC=M("ZodNullable",(e,t)=>{Gx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>SE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Bl(e){return new TC({type:"nullable",innerType:e})}const IC=M("ZodDefault",(e,t)=>{qx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>CE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function AC(e,t){return new IC({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Mh(t)}})}const NC=M("ZodPrefault",(e,t)=>{Qx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function DC(e,t){return new NC({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Mh(t)}})}const xp=M("ZodNonOptional",(e,t)=>{Yx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>EE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function MC(e,t){return new xp({type:"nonoptional",innerType:e,...oe(t)})}const jC=M("ZodCatch",(e,t)=>{Jx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>OE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $C(e,t){return new jC({type:"catch",innerType:e,catchValue:typeof t=="function"?t:V_(t)})}const zC=M("ZodPipe",(e,t)=>{Xx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>PE(e,n,r,o),e.in=t.in,e.out=t.out});function Hl(e,t){return new zC({type:"pipe",in:e,out:t})}const FC=M("ZodReadonly",(e,t)=>{eS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>RE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function LC(e){return new FC({type:"readonly",innerType:e})}const Sp=M("ZodCustom",(e,t)=>{tS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vE(e,n,r,o)});function VC(e,t={}){return rE(Sp,e,t)}function UC(e,t){return oE(e,t)}const ZC=M("ZodInstanceOf",(e,t)=>{Sp.init(e,t)},{properties(e,t){return this.check(QS(e,t))}});function ck(e,t={}){const n=new ZC({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...oe(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var BC=Object.defineProperty,HC=(e,t)=>BC(e,"name",{value:t,configurable:!0}),Ep=h.forwardRef(HC(function(t,n){return m.jsx(Ze.label,{...t,ref:n,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label"));const WC=so("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wi=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce(WC(),r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Ep,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Wi.displayName=Ep.displayName;function qs(e){const t=ee.c(10),{id:n,message:r,className:o,assertive:s}=e;let i;t[0]!==s?(i=s?{role:"alert"}:{},t[0]=s,t[1]=i):i=t[1];const a=!r&&"absolute";let c;t[2]!==o||t[3]!==a?(c=ce("text-sm text-destructive",a,o),t[2]=o,t[3]=a,t[4]=c):c=t[4];const u=r??"";let d;return t[5]!==n||t[6]!==i||t[7]!==c||t[8]!==u?(d=m.jsx("p",{id:n,...i,className:c,children:u}),t[5]=n,t[6]=i,t[7]=c,t[8]=u,t[9]=d):d=t[9],d}function KC(e){return Object.entries(e).filter(([t,n])=>t!=="root"&&typeof(n==null?void 0:n.message)=="string").length}const Wl=e=>e===1?"1 field needs attention":`${e} fields need attention`,GC=100;function qC(e){var r,o,s,i;const t=(r=e==null?void 0:e.closest("form"))==null?void 0:r.querySelector('[aria-invalid="true"]');if(!t)return"";if(t!==document.activeElement)return t.focus(),"";const n=(o=t.getAttribute("aria-describedby"))==null?void 0:o.split(" ")[0];return n&&((i=(s=document.getElementById(n))==null?void 0:s.textContent)==null?void 0:i.trim())||""}function QC(e,t){return e?`${/[.!?]$/.test(e)?e:`${e}.`} ${Wl(t)}`:Wl(t)}function YC(e){const t=ee.c(5),{errors:n,submitCount:r}=e,o=h.useRef(null),s=KC(n),[i,a]=h.useState(r),[c,u]=h.useState(""),[d,l]=h.useState(null);i!==r?(a(r),u(""),l(s>0?{submit:r,count:s}:null)):s===0&&(c!==""||d!==null)&&(u(""),l(null));let f,p;t[0]!==d?(f=()=>{if(d===null)return;const g=qC(o.current),w=setTimeout(()=>{u(QC(g,d.count)),l(null)},GC);return()=>clearTimeout(w)},p=[d],t[0]=d,t[1]=f,t[2]=p):(f=t[1],p=t[2]),h.useEffect(f,p);let v;return t[3]!==c?(v=m.jsx("p",{ref:o,"aria-live":"polite",className:"sr-only",children:c}),t[3]=c,t[4]=v):v=t[4],v}const ec=8,lk=`Use at least ${ec} characters`,JC=`Password must be at least ${ec} characters`;function uk(e,t,n){return n?t:e}const XC=so("rounded-lg bg-card text-card-foreground",{variants:{level:{0:"",1:"shadow-card-1",2:"shadow-card-2",3:"shadow-card-3",4:"shadow-card-4"}},defaultVariants:{level:2}}),Cp=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,level:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==r||n[5]!==o?(i=ce(XC({level:o}),r),n[4]=r,n[5]=o,n[6]=i):i=n[6];let a;return n[7]!==s||n[8]!==t||n[9]!==i?(a=m.jsx("div",{ref:t,className:i,...s}),n[7]=s,n[8]=t,n[9]=i,n[10]=a):a=n[10],a});Cp.displayName="Card";const kp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col space-y-1.5 p-6",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});kp.displayName="CardHeader";const Op=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-2xl font-semibold leading-none tracking-tight",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Op.displayName="CardTitle";const Pp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Pp.displayName="CardDescription";const Rp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Rp.displayName="CardContent";const e2=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex items-center p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});e2.displayName="CardFooter";const t2=_C({email:Ll().email("Enter a valid email"),password:Ll().min(ec,JC)});function n2(){var le,Pe,je,Ee;const e=ee.c(58),t=su(),{resolvedTheme:n}=ss(),r=n==="dark"?"/logo-dark.svg":"/logo.svg";let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:Qo.authStatus,queryFn:y0,staleTime:1/0},e[0]=o):o=e[0];const s=Wo(o),i=Qi();let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={shouldFocusError:!1,resolver:m_(t2)},e[1]=a):a=e[1];const{register:c,handleSubmit:u,setError:d,formState:l}=d_(a),{errors:f,isSubmitting:p,submitCount:v}=l;let g;e[2]!==t||e[3]!==i||e[4]!==d?(g=async function(We){try{const{status:kt}=await hh.post("/api/v1/auth/login",{email:We.email,password:We.password});if(kt!==200){d("root",{message:"Invalid email or password"});return}i.clear(),t("/app-center",{replace:!0})}catch{d("root",{message:"Network error. Please try again."})}},e[2]=t,e[3]=i,e[4]=d,e[5]=g):g=e[5];const w=g;if(((le=s.data)==null?void 0:le.initialized)===!1){let $e;return e[6]===Symbol.for("react.memo_cache_sentinel")?($e=m.jsx(Gi,{to:"/setup",replace:!0}),e[6]=$e):$e=e[6],$e}let b;e[7]!==r?(b=m.jsx("img",{src:r,alt:"tapflow",className:"w-6 h-6"}),e[7]=r,e[8]=b):b=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("span",{className:"text-base font-semibold tracking-tight",children:"tapflow"}),e[9]=x):x=e[9];let _;e[10]!==b?(_=m.jsxs("div",{className:"flex items-center gap-2",children:[b,x]}),e[10]=b,e[11]=_):_=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsxs(kp,{className:"text-center",children:[m.jsx(Op,{className:"text-2xl tracking-display-md",children:"Welcome back"}),m.jsx(Pp,{children:"Sign in to your team workspace"})]}),e[12]=C):C=e[12];let S;e[13]!==u||e[14]!==w?(S=u(w),e[13]=u,e[14]=w,e[15]=S):S=e[15];let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(Wi,{htmlFor:"email",children:"Email"}),e[16]=P):P=e[16];const R=!!f.email,T=f.email?"email-error":void 0;let A;e[17]!==c?(A=c("email"),e[17]=c,e[18]=A):A=e[18];let j;e[19]!==R||e[20]!==T||e[21]!==A?(j=m.jsx(Go,{id:"email",type:"email",placeholder:"you@company.com",autoComplete:"email","aria-required":"true","aria-invalid":R,"aria-describedby":T,...A}),e[19]=R,e[20]=T,e[21]=A,e[22]=j):j=e[22];const F=(Pe=f.email)==null?void 0:Pe.message;let z;e[23]!==F?(z=m.jsx(qs,{id:"email-error",message:F}),e[23]=F,e[24]=z):z=e[24];let Y;e[25]!==j||e[26]!==z?(Y=m.jsxs("div",{className:"grid gap-2",children:[P,j,z]}),e[25]=j,e[26]=z,e[27]=Y):Y=e[27];let Z;e[28]===Symbol.for("react.memo_cache_sentinel")?(Z=m.jsx(Wi,{htmlFor:"password",children:"Password"}),e[28]=Z):Z=e[28];const K=!!f.password,H=f.password?"password-error":void 0;let J;e[29]!==c?(J=c("password"),e[29]=c,e[30]=J):J=e[30];let ne;e[31]!==K||e[32]!==H||e[33]!==J?(ne=m.jsx(Go,{id:"password",type:"password",autoComplete:"current-password","aria-required":"true","aria-invalid":K,"aria-describedby":H,...J}),e[31]=K,e[32]=H,e[33]=J,e[34]=ne):ne=e[34];const te=(je=f.password)==null?void 0:je.message;let X;e[35]!==te?(X=m.jsx(qs,{id:"password-error",message:te}),e[35]=te,e[36]=X):X=e[36];let q;e[37]!==ne||e[38]!==X?(q=m.jsxs("div",{className:"grid gap-2",children:[Z,ne,X]}),e[37]=ne,e[38]=X,e[39]=q):q=e[39];const me=(Ee=f.root)==null?void 0:Ee.message;let he;e[40]!==me?(he=m.jsx(qs,{assertive:!0,id:"login-error",message:me}),e[40]=me,e[41]=he):he=e[41];const ae=p?"Signing in…":"Sign in";let re;e[42]!==p||e[43]!==ae?(re=m.jsx(is,{type:"submit",size:"lg",disabled:p,className:"w-full mt-1",children:ae}),e[42]=p,e[43]=ae,e[44]=re):re=e[44];let B;e[45]!==f||e[46]!==v?(B=m.jsx(YC,{errors:f,submitCount:v}),e[45]=f,e[46]=v,e[47]=B):B=e[47];let se;e[48]!==Y||e[49]!==q||e[50]!==he||e[51]!==re||e[52]!==B||e[53]!==S?(se=m.jsxs(Cp,{level:4,className:"w-full",children:[C,m.jsx(Rp,{children:m.jsxs("form",{onSubmit:S,className:"flex flex-col gap-4",children:[Y,q,he,re,B]})})]}),e[48]=Y,e[49]=q,e[50]=he,e[51]=re,e[52]=B,e[53]=S,e[54]=se):se=e[54];let ye;return e[55]!==se||e[56]!==_?(ye=m.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:m.jsxs("div",{className:"flex flex-col items-center gap-6 w-full max-w-sm",children:[_,se]})}),e[55]=se,e[56]=_,e[57]=ye):ye=e[57],ye}function r2(){return new Om({defaultOptions:{queries:{retry:0,refetchOnWindowFocus:!0,networkMode:"always"}}})}const o2=h.lazy(()=>Et(()=>import("./Setup-DK6TZbwh.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.Setup}))),s2=h.lazy(()=>Et(()=>import("./Invite-D1uNMm0-.js"),__vite__mapDeps([4,1,2,3,5])).then(e=>({default:e.Invite}))),i2=h.lazy(()=>Et(()=>import("./ResetPassword-B-4Uyfwr.js"),__vite__mapDeps([6,1,2,3])).then(e=>({default:e.ResetPassword}))),a2=h.lazy(()=>Et(()=>import("./AppCenter-DD_6LQx-.js"),__vite__mapDeps([7,1,8,9,10,11,12,13,14,15,16,17,18,19,3])).then(e=>({default:e.AppCenter}))),c2=h.lazy(()=>Et(()=>import("./QASession-d0eOjXXo.js"),__vite__mapDeps([20,1,21,22,3,15,23,24,11,8,17,25,10,26,19,9,14,16,27])).then(e=>({default:e.QASession}))),l2=h.lazy(()=>Et(()=>import("./Runs-A7RcDLgO.js"),__vite__mapDeps([28,1,14,8,12,25,9,10,29,19,18,30,3])).then(e=>({default:e.Runs}))),u2=h.lazy(()=>Et(()=>import("./RunDetail-C50RjsuM.js"),__vite__mapDeps([31,1,14,12,30,32,10,9,33,22,17,24,3])).then(e=>({default:e.RunDetail}))),d2=h.lazy(()=>Et(()=>import("./AISessionWatch-BSBkpTom.js"),__vite__mapDeps([34,1,21,22,33,23,17,3])).then(e=>({default:e.AISessionWatch}))),f2=h.lazy(()=>Et(()=>import("./MacResources-D2UeRbKL.js"),__vite__mapDeps([35,1,21,19,25,27,36,3])).then(e=>({default:e.MacResources}))),h2=h.lazy(()=>Et(()=>import("./Default-CQ3Ae2mK.js"),__vite__mapDeps([37,1,2,14,16,15,32,10,5,3])).then(e=>({default:e.DefaultSettings}))),p2=h.lazy(()=>Et(()=>import("./Team-VoGput2p.js"),__vite__mapDeps([38,1,11,15,9,10,29,19,26,18,3])).then(e=>({default:e.TeamSettings}))),m2=h.lazy(()=>Et(()=>import("./Tokens-qkcJgunR.js"),__vite__mapDeps([39,1,14,15,11,9,10,29,19,26,18,13,3])).then(e=>({default:e.TokenSettings}))),g2=h.lazy(()=>Et(()=>import("./NotFound-DVq_rCKc.js"),__vite__mapDeps([40,1])).then(e=>({default:e.NotFound}))),v2=m.jsx("div",{className:"flex h-screen w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),Ao=e=>m.jsx(h.Suspense,{fallback:v2,children:e}),y2=r2();function b2(){const e=ee.c(16);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=m.jsx(st,{path:"/login",element:m.jsx(n2,{})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(st,{path:"/setup",element:Ao(m.jsx(o2,{}))}),e[1]=n):n=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(st,{path:"/invite",element:Ao(m.jsx(s2,{}))}),e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(st,{path:"/reset-password",element:Ao(m.jsx(i2,{}))}),e[3]=o):o=e[3];let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(V0,{}),e[4]=s):s=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(st,{index:!0,element:m.jsx(Gi,{to:"/app-center",replace:!0})}),e[5]=i):i=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(st,{path:"/app-center",element:m.jsx(a2,{})}),e[6]=a):a=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(st,{path:"/app-center/build",element:m.jsx(c2,{})}),e[7]=c):c=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(st,{path:"/automation/runs",element:m.jsx(l2,{})}),e[8]=u):u=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(st,{path:"/automation/runs/:runId",element:m.jsx(u2,{})}),e[9]=d):d=e[9];let l;e[10]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(st,{path:"/automation/sessions/:sessionId",element:m.jsx(d2,{})}),e[10]=l):l=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx(st,{path:"/mac-resources",element:m.jsx(f2,{})}),e[11]=f):f=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(st,{path:"/settings/default",element:m.jsx(h2,{})}),e[12]=p):p=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsx(st,{path:"/settings/team",element:m.jsx(p2,{})}),e[13]=v):v=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsxs(st,{element:s,children:[i,a,c,u,d,l,f,p,v,m.jsx(st,{path:"/settings/tokens",element:m.jsx(m2,{})})]}),e[14]=g):g=e[14];let w;return e[15]===Symbol.for("react.memo_cache_sentinel")?(w=m.jsx(tm,{client:y2,children:m.jsxs(Up,{children:[m.jsxs(Zp,{children:[t,n,r,o,g,m.jsx(st,{path:"*",element:Ao(m.jsx(g2,{}))})]}),m.jsx(Zg,{position:"bottom-right",richColors:!0})]})}),e[15]=w):w=e[15],w}Lp.createRoot(document.getElementById("root")).render(m.jsx(h.StrictMode,{children:m.jsx(Kp,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:m.jsx(b2,{})})}));export{S2 as $,tt as A,is as B,Cp as C,vt as D,fu as E,qs as F,Ge as G,E2 as H,Go as I,q2 as J,Mb as K,Wi as L,jb as M,vf as N,Ym as O,lk as P,Dc as Q,ph as R,qo as S,Db as T,ek as U,J2 as V,Y2 as W,Q2 as X,_0 as Y,K2 as Z,ck as _,m_ as a,ma as a$,G2 as a0,X2 as a1,ce as a2,rg as a3,ng as a4,Te as a5,Ze as a6,Vu as a7,nn as a8,Xt as a9,H2 as aA,vw as aB,jf as aC,ww as aD,En as aE,ik as aF,Nv as aG,w0 as aH,wa as aI,ak as aJ,V2 as aK,kC as aL,L2 as aM,so as aN,Yy as aO,k2 as aP,eb as aQ,Vd as aR,Zd as aS,Bd as aT,Ld as aU,ib as aV,nf as aW,ha as aX,us as aY,jd as aZ,as as a_,ct as aa,xa as ab,rn as ac,de as ad,U2 as ae,I0 as af,Z2 as ag,xr as ah,Yd as ai,ao as aj,F0 as ak,tk as al,hg as am,$2 as an,N2 as ao,D2 as ap,z2 as aq,j2 as ar,M2 as as,rk as at,A2 as au,nk as av,ok as aw,Jm as ax,sg as ay,B2 as az,Qi as b,gd as b0,aa as b1,Jt as b2,of as b3,bb as b4,tf as b5,Qm as b6,C2 as b7,Wo as c,kp as d,Op as e,Rp as f,uk as g,YC as h,ec as i,JC as j,y0 as k,G0 as l,Pp as m,sk as n,_C as o,T0 as p,Qo as q,W2 as r,Ll as s,oo as t,d_ as u,F2 as v,Ps as w,Wr as x,Em as y,ss as z};
|