mastra 1.40.2-alpha.8 → 1.40.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/factory/assets/{AlertDialog.es-Dd0j0SAo.js → AlertDialog.es-Dkf8ZLsq.js} +1 -1
- package/dist/factory/assets/BoardConfigPage-CbGjRoKd.js +1 -0
- package/dist/factory/assets/{BoardIcons-BZwAAPO8.js → BoardIcons-ChSrt-Ky.js} +1 -1
- package/dist/factory/assets/BoardIntakePage-lNVbdWDh.js +1 -0
- package/dist/factory/assets/BoardRulesPage-DWDWpS0z.js +1 -0
- package/dist/factory/assets/{Breadcrumb.es-CVW-e0jJ.js → Breadcrumb.es-DRA_fT-0.js} +1 -1
- package/dist/factory/assets/{Card-C1AF3dS4-gxDCT3SZ.js → Card-C1AF3dS4-D5nc4nsO.js} +1 -1
- package/dist/factory/assets/CodeBlock.es-CSnUNCvE.js +6 -0
- package/dist/factory/assets/{CodeEditor-DKVZX8c1-D3tFx8Wi.js → CodeEditor-DE69mZsU-DhkPbKOd.js} +1 -1
- package/dist/factory/assets/{Command.es-DYk0Ffqt.js → Command.es-CJWc6UXm.js} +1 -1
- package/dist/factory/assets/{CompositeItem-CSfZykYZ.js → CompositeItem-DXJX9-KR.js} +1 -1
- package/dist/factory/assets/{CompositeRoot-BDBckJr1.js → CompositeRoot-COSYbRmu.js} +1 -1
- package/dist/factory/assets/ConditionRows-mhryClJA.js +1 -0
- package/dist/factory/assets/CreateFactoryPage-BJVsA5mX.js +1 -0
- package/dist/factory/assets/{DescriptionMarkdown-CPlbpMmD.js → DescriptionMarkdown-iotpUxXF.js} +1 -1
- package/dist/factory/assets/{FactorySkillPage-KcjxsEs4.js → FactorySkillPage-D9qzT8bU.js} +3 -3
- package/dist/factory/assets/{FactorySkillsPage-7FrLl5uh.js → FactorySkillsPage-PMfXgYDo.js} +1 -1
- package/dist/factory/assets/{Field.es-C1w4lsXS.js → Field.es-BgoAtL-2.js} +1 -1
- package/dist/factory/assets/GithubIcon-CAP9GMMO.css +1 -0
- package/dist/factory/assets/GithubIcon.es-CIm0nGDf.js +55 -0
- package/dist/factory/assets/{HrefLink-y54gg66e.js → HrefLink-1sjfHRy7.js} +1 -1
- package/dist/factory/assets/{IconArrowRotateClockwise.es-DeFmTuQG.js → IconArrowRotateClockwise.es-INXo4MVi.js} +1 -1
- package/dist/factory/assets/{IconFormCircle.es-Dl8N58Cl.js → IconFormCircle.es-DNm0NK7A.js} +1 -1
- package/dist/factory/assets/IconLoadingCircle.es-Cj4Y7rb5.js +1 -0
- package/dist/factory/assets/{IconPencil.es-DqPc7VYz.js → IconPencil.es-DLEsNj2e.js} +1 -1
- package/dist/factory/assets/{IconScript.es-D3hL2fC9.js → IconScript.es-CPO1Fq6Z.js} +1 -1
- package/dist/factory/assets/{IconSettingsSliderHor.es-CWhsvZzL.js → IconSettingsSliderHor.es-VS_Cfpz8.js} +1 -1
- package/dist/factory/assets/{Input-BWp76snh.js → Input-9DXuotFV.js} +1 -1
- package/dist/factory/assets/{InputNumber.es-DuTGd35f.js → InputNumber.es-Bho-MKtp.js} +1 -1
- package/dist/factory/assets/KnowledgePage-CmdlrOqT.js +13 -0
- package/dist/factory/assets/{LoadErrorState-B6WrspsB.js → LoadErrorState-w5i-jqQO.js} +1 -1
- package/dist/factory/assets/{MarkdownRenderer-Dp2g3gxh-CfibLUrr.js → MarkdownRenderer-Ca7UVGTG-D9IuJEv9.js} +1 -1
- package/dist/factory/assets/MastraGatewayBilling-D2xarOnv.js +1 -0
- package/dist/factory/assets/{NewBoardPage-CZSKsKqc.js → NewBoardPage-Co58G3u-.js} +2 -2
- package/dist/factory/assets/{NewPage-B2FRg0re.js → NewPage-B4lBGEFC.js} +1 -1
- package/dist/factory/assets/{OnboardingPage-D3oyT1ph.js → OnboardingPage-D1AJcuIq.js} +1 -1
- package/dist/factory/assets/{ProviderBrandIcon-DG3b_E_A.js → ProviderBrandIcon-CKq3WaGZ.js} +1 -1
- package/dist/factory/assets/{RadioGroup-B980sx1z.js → RadioGroup-CvTRwRir.js} +1 -1
- package/dist/factory/assets/{RadioGroup.es-BfW3ErPZ.js → RadioGroup.es-DQfIiNtD.js} +1 -1
- package/dist/factory/assets/RootGuards-CZvggXIb.js +1 -0
- package/dist/factory/assets/{RulesPage-X6M3Ywua.js → RulesPage-Bu80TWNE.js} +1 -1
- package/dist/factory/assets/{SearchInput.es-B6oIv0hQ.js → SearchInput.es-BRVlUePH.js} +1 -1
- package/dist/factory/assets/SessionLayout-DeleDrJs.js +4 -0
- package/dist/factory/assets/SessionPage-BAz6O4wl.js +1 -0
- package/dist/factory/assets/SessionSharingPopover-CX69d1UJ.js +1 -0
- package/dist/factory/assets/SettingsPage-9wgvYj6_.js +3 -0
- package/dist/factory/assets/{SettingsSubsection-B_X_u0Kt.js → SettingsSubsection-D1Yp4Ujt.js} +1 -1
- package/dist/factory/assets/Sidebar.es-B464rGRm.js +1 -0
- package/dist/factory/assets/{SignInPage-BloSA2lI.js → SignInPage-BBl3lfcN.js} +1 -1
- package/dist/factory/assets/{SkillBadges-IJt3Rano.js → SkillBadges-DuFvl4d8.js} +1 -1
- package/dist/factory/assets/{SlackConnectionPage-CPfQws3c.js → SlackConnectionPage-6H6OccOz.js} +1 -1
- package/dist/factory/assets/{StackedDiffs-BlNEFzj-.js → StackedDiffs-DtoTOL9C.js} +1 -1
- package/dist/factory/assets/{TabsRoot-DNjGHnQQ.js → TabsRoot-MM_4fh4A.js} +1 -1
- package/dist/factory/assets/{ThinkingLevel.es-DUHMUmiq.js → ThinkingLevel.es-Q1cgMAQj.js} +1 -1
- package/dist/factory/assets/{Tree-B90XgTY4-DiRKznbx.js → Tree-B90XgTY4-DvEdNAwi.js} +1 -1
- package/dist/factory/assets/{buttons-group-DA_wORqQ-87uBfszt.js → buttons-group-DA_wORqQ-tI0OhQlr.js} +1 -1
- package/dist/factory/assets/combobox-parts-BVuRAhY6-ClaPtI8E.js +1 -0
- package/dist/factory/assets/{copy-button-BPysC9gu-Ce9_m0Wu.js → copy-button-C3L1ZoAD-DpbBeGOv.js} +1 -1
- package/dist/factory/assets/{esm-KJWZ33y-.js → esm-C7YFnOq6.js} +1 -1
- package/dist/factory/assets/index-Btp5jnxM.js +125 -0
- package/dist/factory/assets/index-CK3K8ZRd.css +1 -0
- package/dist/factory/assets/{input-DqReKX0A-ScC7s6sY.js → input-DqReKX0A-D66C6dWr.js} +3 -3
- package/dist/factory/assets/{input-group-C64rGEu8-tF1AZfiZ.js → input-group-BXqgO3Q2-BNrm-udR.js} +1 -1
- package/dist/factory/assets/{onboardingFlow-DTVR_ThV.js → onboardingFlow-C89nSzO4.js} +1 -1
- package/dist/factory/assets/relative-time.es-2U7OUie-.js +1 -0
- package/dist/factory/assets/{ruleLanes-zac0HQwn.js → ruleLanes-CB6XWPZ9.js} +1 -1
- package/dist/factory/assets/{select-jT0h_BBB-6ji8g_rW.js → select-BPzTS5dZ-BGYcBcgg.js} +1 -1
- package/dist/factory/assets/{settings-C5r2ThW9-D7BpEINa.js → settings-C5r2ThW9-DgHKaQxx.js} +1 -1
- package/dist/factory/assets/{use-keydown.es-Celupa-_.js → use-keydown.es-BFnOTORr.js} +1 -1
- package/dist/factory/assets/{useBoardCatalog-C-gXjA-g.js → useBoardCatalog-DC55UfJd.js} +1 -1
- package/dist/factory/assets/{useBoardEditor-Bn11vS5Q.js → useBoardEditor-DFyQuLCD.js} +1 -1
- package/dist/factory/assets/{useChatSessionContext-CAxNkdHm.js → useChatSessionContext--lCmFMPT.js} +1 -1
- package/dist/factory/assets/useDraftModelGuards-BRcs4Wdl.js +29 -0
- package/dist/factory/assets/{useFactoryDecisions-600qQ62i.js → useFactoryDecisions-O_sajSic.js} +1 -1
- package/dist/factory/assets/{useGlobalSearchControls-CDvuBRkd.js → useGlobalSearchControls-BOmC11Gr.js} +1 -1
- package/dist/factory/assets/{useInfiniteQuery-BqXR1JQ-.js → useInfiniteQuery-D1T5yb8L.js} +1 -1
- package/dist/factory/assets/{useIntakeRoutes-OObHoZos.js → useIntakeRoutes-C2h717K6.js} +1 -1
- package/dist/factory/assets/{useLinearData-Bbyd0L4b.js → useLinearData-D6cSKZs3.js} +1 -1
- package/dist/factory/assets/{useRouteSessionId-0WFT82oQ.js → useRouteSessionId-BYStxtYL.js} +1 -1
- package/dist/factory/assets/{useRowDrag-0taus7Yi.js → useRowDrag-B2rvWAzw.js} +1 -1
- package/dist/factory/assets/{useSessionCard-bQ1xW_Go.js → useSessionCard-mjrTpVMe.js} +1 -1
- package/dist/factory/assets/{useSessionRepository-Bw24ik7O.js → useSessionRepository-CCb1tcZg.js} +1 -1
- package/dist/factory/assets/{useSessionRows-CnLoToLZ.js → useSessionRows-CIakAaqj.js} +1 -1
- package/dist/factory/assets/{useThreadWorkspacePath-BZmjtdux.js → useThreadWorkspacePath-BmtxcrV6.js} +1 -1
- package/dist/factory/assets/workspaces-DYc-hvkC.js +2 -0
- package/dist/factory/index.html +44 -46
- package/dist/index.js +1 -1
- package/dist/studio/assets/{index-CzTSJmoH.js → index-y7atQeWR.js} +2 -2
- package/dist/studio/assets/{main-cRrOk30z.js → main-BhWoo2De.js} +263 -260
- package/dist/studio/assets/style-CLhrNGTk.css +3 -0
- package/dist/studio/index.html +2 -2
- package/package.json +7 -7
- package/dist/factory/assets/BoardConfigPage-CxuB8oe8.js +0 -1
- package/dist/factory/assets/BoardIntakePage-CsKxBduq.js +0 -1
- package/dist/factory/assets/BoardRulesPage-6fKznTV0.js +0 -1
- package/dist/factory/assets/CodeBlock.es-BJ0-aeYG.js +0 -6
- package/dist/factory/assets/ConditionRows-gvlUEEY7.js +0 -1
- package/dist/factory/assets/CreateFactoryPage-CTflXXet.js +0 -1
- package/dist/factory/assets/GithubIcon-C0PmZadW.css +0 -1
- package/dist/factory/assets/GithubIcon.es-BmZS8JQG.js +0 -55
- package/dist/factory/assets/KnowledgePage-B7yyr3vo.js +0 -13
- package/dist/factory/assets/MastraGatewayBilling-CeKTtQZ3.js +0 -1
- package/dist/factory/assets/RootGuards-BNlIx3jH.js +0 -1
- package/dist/factory/assets/SessionLayout-DAfEeZWD.js +0 -4
- package/dist/factory/assets/SessionPage-BXT65bS8.js +0 -1
- package/dist/factory/assets/SessionSharingPopover-DRKk_u9-.js +0 -1
- package/dist/factory/assets/SettingsPage-tkiXsO19.js +0 -3
- package/dist/factory/assets/Sidebar.es-CFLW5bYW.js +0 -1
- package/dist/factory/assets/combobox-parts-DhYtFSRV-BZqyW5dv.js +0 -1
- package/dist/factory/assets/index-B4UKgiu6.css +0 -1
- package/dist/factory/assets/index-C7vLhvAL.js +0 -125
- package/dist/factory/assets/relative-time.es-DP-qvaLv.js +0 -1
- package/dist/factory/assets/spinner-B9ykw74u-DYljVQkq.js +0 -1
- package/dist/factory/assets/spinner-B9ykw74u-zThqnDlE.css +0 -1
- package/dist/factory/assets/useDraftModelGuards-CI7E0Q5e.js +0 -29
- package/dist/factory/assets/usePlatformConnections-C4XGXSRe.js +0 -1
- package/dist/factory/assets/workspaces-DlGQ_R_W.js +0 -2
- package/dist/studio/assets/style-Bk6CooWr.css +0 -3
- /package/dist/factory/assets/{MarkdownRenderer-Dp2g3gxh-C04mQel5.css → MarkdownRenderer-Ca7UVGTG-C04mQel5.css} +0 -0
- /package/dist/factory/assets/{combobox-parts-DhYtFSRV-CYlMQsMB.css → combobox-parts-BVuRAhY6-CYlMQsMB.css} +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{C as n,O as r,S as i,T as a,a as o,b as s,d as c,f as l,g as u,h as d,k as f,l as p,m,o as h,r as g,s as _,t as v,v as y,w as b,x,y as S}from"./IconChevronRightMedium.es-BkPdzxSm.js";var C=e(f(),1),w=r(),T=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,E=b,D=(e,t)=>n=>{if(t?.variants==null)return E(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=T(t)||T(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return E(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},O=D(`spinner inline-block text-foreground`,{variants:{size:{sm:`size-4`,md:`size-6`,lg:`size-8`},variant:{default:``,pulse:``}},defaultVariants:{size:`md`,variant:`default`}});function k({className:e,size:t=`md`,variant:n=`default`,fill:r=!1,"aria-label":i=`Loading`,role:o=`status`,...s}){let c=t??`md`,l=n??`default`,u=(0,w.jsx)(`svg`,{...s,role:o,"aria-label":i,"data-size":c,"data-variant":l,className:a(O({size:c,variant:l}),e),xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,children:l===`pulse`?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`circle`,{className:`spinner-pulse-ring`,cx:`12`,cy:`12`,r:`7`}),(0,w.jsx)(`circle`,{className:`spinner-pulse-core`,cx:`12`,cy:`12`,r:`5`})]}):(0,w.jsx)(`circle`,{className:`spinner-ring`,cx:`12`,cy:`12`,r:`8.5`})});return r?(0,w.jsx)(`div`,{"data-slot":`spinner-fill`,className:`flex h-full items-center-safe justify-center-safe`,children:u}):u}var A=`fixed`,j=`[--field:var(--field-on-surface)] [--field-disabled:var(--field-on-surface)] [--field-hover:var(--field-hover-on-surface)] [--field-open:var(--field-open-on-surface)]`,M=`[--field:var(--field-on-nested)] [--field-disabled:var(--field-on-nested)] [--field-hover:var(--field-hover-on-surface)] [--field-open:var(--field-open-on-surface)]`,N=`[--field:var(--field-on-page)] [--field-disabled:var(--fill-subtle)] [--field-hover:var(--field-hover-on-page)] [--field-open:var(--field-open-on-page)]`,P=`bg-card hover:bg-card active:bg-card shadow-raised `+j,F=`bg-card shadow-overlay `+j,I=`bg-dialog shadow-overlay [--elevation-overlay:var(--elevation-dialog)] `+j,L=`bg-background shadow-raised `+N,R=`bg-background `+N,ee=`state-layer`,z=[],te=void 0;function ne(){return te}function B(e){z.push(e)}function V(e){let t=(t,r)=>{let i=n(ie).current,a;try{te=i;for(let e of z)e.before(i);a=e(t,r);for(let e of z)e.after(i);i.didInitialize=!0}finally{te=void 0}return a};return t.displayName=e.displayName||e.name,t}function re(e){return C.forwardRef(V(e))}function ie(){return{didInitialize:!1}}var H=typeof document<`u`?C.useLayoutEffect:()=>{};function ae(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var U=ae(`https://base-ui.com/production-error`,`Base UI`),W=C.createContext(void 0);function G(e){let t=C.useContext(W);if(t===void 0&&!e)throw Error(U(72));return t}function oe(e){C.useEffect(e,s)}var se=0,ce=class e{static create(){return new e}currentId=se;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=se,t()},e)}isStarted(){return this.currentId!==se}clear=()=>{this.currentId!==se&&(clearTimeout(this.currentId),this.currentId=se)};disposeEffect=()=>this.clear};function K(){let e=n(ce.create).current;return oe(e.disposeEffect),e}function le(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ue,platform:de,maxTouchPoints:fe}=le(),pe=ue.toLowerCase(),me=de.toLowerCase(),he=/^i(os$|p)/.test(me)||me===`macintel`&&fe>1,ge=`android`,_e=me===ge||pe.includes(ge),ve=!he&&me.startsWith(`mac`);me.startsWith(`win`),!_e&&/^(linux|chrome os)/.test(me);var ye=ve||he,be=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),xe=!be&&pe.includes(`firefox`);!be&&pe.includes(`chrom`);var Se=ye,Ce=/jsdom|happydom/.test(pe);function we(e){e.preventDefault(),e.stopPropagation()}function Te(e){return`nativeEvent`in e}function Ee(e){return e.pointerType===``&&e.isTrusted?!0:_e&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function De(e){return Ce?!1:!_e&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(_e||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Oe(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function ke(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Ae(){return typeof window<`u`}function je(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function Me(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ne(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Ae()?e instanceof Node||e instanceof Me(e).Node:!1}function q(e){return Ae()?e instanceof Element||e instanceof Me(e).Element:!1}function Fe(e){return Ae()?e instanceof HTMLElement||e instanceof Me(e).HTMLElement:!1}function Ie(e){return!Ae()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Me(e).ShadowRoot}function Le(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Re(e){return/^(table|td|th)$/.test(je(e))}function ze(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Be=/transform|translate|scale|rotate|perspective|filter/,Ve=/paint|layout|strict|content/,He=e=>!!e&&e!==`none`,Ue;function We(e){let t=q(e)?Je(e):e;return He(t.transform)||He(t.translate)||He(t.scale)||He(t.rotate)||He(t.perspective)||!Ke()&&(He(t.backdropFilter)||He(t.filter))||Be.test(t.willChange||``)||Ve.test(t.contain||``)}function Ge(e){let t=Xe(e);for(;Fe(t)&&!qe(t);){if(We(t))return t;if(ze(t))return null;t=Xe(t)}return null}function Ke(){return Ue??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ue}function qe(e){return/^(html|body|#document)$/.test(je(e))}function Je(e){return Me(e).getComputedStyle(e)}function Ye(e){return q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xe(e){if(je(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ie(e)&&e.host||Ne(e);return Ie(t)?t.host:t}function Ze(e){let t=Xe(e);return qe(t)?(e.ownerDocument||e).body:Fe(t)&&Le(t)?t:Ze(t)}function Qe(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ze(e),i=r===e.ownerDocument?.body,a=Me(r);if(i){let e=$e(a);return t.concat(a,a.visualViewport||[],Le(r)?r:[],e&&n?Qe(e):[])}return t.concat(r,Qe(r,[],n))}function $e(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function et(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function J(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ie(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function tt(e,t){let n=e;for(;n;){if(q(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Ie(n)?n.host:null)}return null}function nt(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var rt=`data-base-ui-focusable`,it=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,at=`ArrowLeft`,ot=`ArrowRight`,st=`ArrowUp`,ct=`ArrowDown`,lt=`data-starting-style`,ut=`data-ending-style`,dt={[lt]:``},ft={[ut]:``},pt={transitionStatus(e){return e===`starting`?dt:e===`ending`?ft:null}},mt=`data-open`,ht=`data-closed`,gt=`data-anchor-hidden`,_t=`data-popup-open`,vt=`data-pressed`,yt={[_t]:``},bt={[_t]:``,[vt]:``},xt={[mt]:``},St={[ht]:``},Ct={[gt]:``},wt={open(e){return e?yt:null}},Tt={open(e){return e?bt:null}},Et={open(e){return e?xt:St},anchorHidden(e){return e?Ct:null}},Dt={...Et,...pt},Ot=`data-trigger-disabled`;function kt(e,t){if(!q(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Ot);for(let[,e]of t.entries())if(J(e,n))return!e.hasAttribute(Ot);return!1}function At(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function jt(e){return e.matches(`html,body`)}function Mt(e){return Fe(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Nt(e){return tt(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${it}`)!=null}function Pt(e){return e?e.getAttribute(`role`)===`combobox`&&Mt(e):!1}function Ft(e){if(!e||Ce)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function It(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Lt(e,t){return t!=null&&!Oe(t)?0:typeof e==`function`?e():e}function Rt(e,t,n){let r=Lt(e,n);return typeof r==`number`?r:r?.[t]}function zt(e){return typeof e==`function`?e():e}function Bt(e,t){return t||e===`click`||e===`mousedown`}function Vt(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Ht(e,t,n,r){let i=!1,a=!1,o=r??x;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Ut(e,t,n){let r=n??x;return{reason:e,event:t??new Event(`base-ui`),...r}}var Wt=`none`,Gt=`trigger-press`,Kt=`trigger-hover`,qt=`trigger-focus`,Jt=`outside-press`,Yt=`item-press`,Xt=`close-press`,Zt=`clear-press`,Qt=`chip-remove-press`,$t=`increment-press`,en=`decrement-press`,tn=`input-change`,nn=`input-clear`,rn=`input-blur`,an=`input-paste`,on=`input-press`,sn=`focus-out`,cn=`escape-key`,ln=`close-watcher`,un=`list-navigation`,dn=`keyboard`,fn=`pointer`,pn=`wheel`,mn=`cancel-open`,hn=`sibling-open`,gn=`disabled`,_n=`missing`,vn=`initial`,yn=`imperative-action`,bn=`swipe`,xn=`window-resize`,Sn=C.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ce,currentIdRef:{current:null},currentContextRef:{current:null}});function Cn(e,t){e.current=t.current}function wn(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=C.useRef(n),a=C.useRef(n),o=C.useRef(null),s=C.useRef(null),c=K();return H(()=>{a.current=n,o.current?i.current={open:Rt(i.current,`open`),close:Rt(n,`close`)}:i.current=n},[n,o,i,a]),(0,w.jsx)(Sn.Provider,{value:C.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Tn(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=C.useContext(Sn),[d,f]=C.useState(!1),p=C.useRef(n);return H(()=>{p.current=n},[n]),H(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),H(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:Rt(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,Ht(Wt))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),H(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,Cn(a,s),u.clear()}},[c,i,a,r,s,u]),C.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function Y(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function En(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Dn(e){let t=n(On,e).current;return t.next=e,H(t.effect),t}function On(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var kn={...C},An=kn.useInsertionEffect,jn=An&&An!==kn.useLayoutEffect?An:e=>e();function X(e){let t=n(Mn).current;return t.next=e,jn(t.effect),t.trampoline}function Mn(){let e={next:void 0,callback:Nn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Nn(){}var Pn=null;globalThis.requestAnimationFrame;var Fn=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},In=class e{static create(){return new e}static request(e){return Fn.request(e)}static cancel(e){return Fn.cancel(e)}currentId=Pn;request(e){this.cancel(),this.currentId=Fn.request(()=>{this.currentId=Pn,e()})}cancel=()=>{this.currentId!==Pn&&(Fn.cancel(this.currentId),this.currentId=Pn)};disposeEffect=()=>this.cancel};function Ln(){let e=n(In.create).current;return oe(e.disposeEffect),e}function Rn(e){return e?.ownerDocument||document}var zn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Bn={...zn,position:`fixed`,margin:0,top:0,left:0},Vn={...zn,position:`absolute`},Hn=C.forwardRef(function(e,t){let[n,r]=C.useState();H(()=>{Se&&be&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,w.jsx)(`span`,{...e,ref:t,style:Bn,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Un=Math.min,Wn=Math.max,Gn=Math.round,Kn=Math.floor,qn=e=>({x:e,y:e}),Jn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Yn(e,t,n){return Wn(e,Un(t,n))}function Xn(e,t){return typeof e==`function`?e(t):e}function Zn(e){return e.split(`-`)[0]}function Qn(e){return e.split(`-`)[1]}function $n(e){return e===`x`?`y`:`x`}function er(e){return e===`y`?`height`:`width`}function tr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function nr(e){return $n(tr(e))}function rr(e,t,n){n===void 0&&(n=!1);let r=Qn(e),i=nr(e),a=er(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=fr(o)),[o,fr(o)]}function ir(e){let t=fr(e);return[ar(e),t,ar(t)]}function ar(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var or=[`left`,`right`],sr=[`right`,`left`],cr=[`top`,`bottom`],lr=[`bottom`,`top`];function ur(e,t,n){switch(e){case`top`:case`bottom`:return n?t?sr:or:t?or:sr;case`left`:case`right`:return t?cr:lr;default:return[]}}function dr(e,t,n,r){let i=Qn(e),a=ur(Zn(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ar)))),a}function fr(e){let t=Zn(e);return Jn[t]+e.slice(t.length)}function pr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function mr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:pr(e)}function hr(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function gr(e,t,n){return Math.floor(e/t)!==n}function _r(e,t){return t<0||t>=e.length}function vr(e,t){return xr(e.current,{disabledIndices:t})}function yr(e,t){return xr(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function br(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>xr(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:_r(e,u)?-1:u,wrapped:d}}function xr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Cr(e,a,r));return a}function Sr(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=tt(e,`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!Cr(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Kn(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!Cr(e,r,s))return r}};d&&we(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=xr(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=xr(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}_r(e,f)&&(f=u)}if(n===`both`){let n=Kn(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&we(t),u%o===o-1?r&&(f=xr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=xr(e,{startingIndex:u,disabledIndices:s}),r&&gr(f,o,n)&&(f=xr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),gr(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&we(t),u%o===0?r&&(f=xr(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=xr(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&gr(f,o,n)&&(f=xr(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),gr(f,o,n)&&(f=u));let c=Kn(l/o)===n;_r(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:xr(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function Cr(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Tr(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function wr(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Tr(e,t=e?Je(e):null){return!e||!e.isConnected||!t||wr(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Er=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Dr(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Ie(n)?n.host:null}function Or(e){for(let t of Array.from(e.children))if(je(t)===`summary`)return t;return null}function kr(e,t){let n=Or(t);return!!n&&(e===n||J(n,e))}function Ar(e){let t=e?je(e):``;return e!=null&&e.matches(Er)&&(t!==`summary`||e.parentElement!=null&&je(e.parentElement)===`details`&&Or(e.parentElement)===e)&&(t!==`details`||Or(e)==null)&&(t!==`input`||e.type!==`hidden`)}function jr(e){if(!Ar(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Dr(t)){let n=t!==e,r=je(t)===`slot`;if(t.hasAttribute(`inert`)||n&&je(t)===`details`&&!t.open&&!kr(e,t)||t.hasAttribute(`hidden`)||!r&&!Mr(t,n))return!1}return!0}function Mr(e,t){let n=Je(e);return t?n.display!==`none`:Tr(e,n)}function Nr(e){let t=e.tabIndex;if(t<0){let t=je(e);if(t===`details`||t===`audio`||t===`video`||Fe(e)&&e.isContentEditable)return 0}return t}function Pr(e){if(je(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Fr(e,t){let n=Pr(e);if(!n)return!0;let r=t.find(e=>{let t=Pr(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Pr(e);return t?.name===n.name&&t.form===n.form})===n}function Ir(e){if(Fe(e)&&je(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Fe(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Lr(e,t){Ir(e).forEach(e=>{Ar(e)&&t.push(e),Lr(e,t)})}function Rr(e,t,n){Ir(e).forEach(e=>{Fe(e)&&e.matches(t)&&n.push(e),Rr(e,t,n)})}function zr(e){return jr(e)&&Nr(e)>=0}function Br(e){let t=[];return Lr(e,t),t.filter(jr)}function Vr(e){let t=Br(e);return t.filter(e=>Nr(e)>=0&&Fr(e,t))}function Hr(e,t){let n=Vr(e),r=n.length;if(r===0)return;let i=et(Rn(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ur(e){return Hr(Rn(e).body,1)||e}function Wr(e){return Hr(Rn(e).body,-1)||e}function Gr(e,t,n){if(!e)return null;let r=[];Lr(Rn(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(jr);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!J(n,o)&&zr(o)&&Fr(o,a))return o}return r[i]}function Kr(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!J(n,r)}function qr(e){Vr(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Jr(e){let t=[];Rr(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Yr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Yr(e,t.id,n)])}function Xr(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Zr(e){return`data-base-ui-${e}`}var Qr=0;function $r(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:a}=t;cancelAnimationFrame(Qr);function o(){(!a||a())&&e?.focus({preventScroll:n})}if(r)return o(),i;let s=requestAnimationFrame(o);return Qr=s,()=>{Qr===s&&(cancelAnimationFrame(s),Qr=0)}}var ei=`data-base-ui-inert`,ti=new WeakMap,ni=new WeakSet,ri=new WeakMap,ii=0;function ai(e){return e?Ie(e)?e.host:ai(e.parentNode):null}var oi=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ai(t);return e.contains(n)?n:null}).filter(e=>e!=null),si=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},ci=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{je(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function li(e,t,n,{mark:r=!0}){let i=oi(t,e),a=r?ci(t,si(i),new Set(i)):[],o=[],s=[];if(n){let e=oi(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);ci(t,si(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(ti.get(e)||0)+1;ti.set(e,r),o.push(e),r===1&&n&&ni.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(ri.get(e)||0)+1;ri.set(e,t),s.push(e),t===1&&e.setAttribute(ei,``)}),ii+=1,()=>{o.forEach(e=>{let t=(ti.get(e)||0)-1;ti.set(e,t),t||(ni.has(e)||e.removeAttribute(`aria-hidden`),ni.delete(e))}),r&&s.forEach(e=>{let t=(ri.get(e)||0)-1;ri.set(e,t),t||e.removeAttribute(ei)}),--ii,ii||(ti=new WeakMap,ni=new WeakSet,ri=new WeakMap)}}function ui(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Rn(e[0]).body;return li(e,i,n,{mark:r})}var di=t((e=>{var t=f();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),fi=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=di()})),pi=e(fi(),1);function mi(){let[,e]=C.useState({});return C.useCallback(()=>{e({})},[])}var hi=0;function gi(e,t=`mui`){let n=C.useRef(void 0),r=mi(),i=e??n.current;return C.useEffect(()=>{n.current??(hi+=1,n.current=`${t}-${hi}`,e??r())},[e,t,r]),i}var _i=kn.useId;function vi(e,t){if(_i!==void 0){let n=_i();return e??(t?`${t}-${n}`:n)}return gi(e,t)}var yi={style:{transition:`none`}},bi=`data-base-ui-click-trigger`,xi=`data-base-ui-swipe-ignore`,Si=`[${xi}]`,Ci={fallbackAxisSide:`none`},wi={fallbackAxisSide:`end`},Ti={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Ei=C.createContext(null),Di=()=>C.useContext(Ei),Oi=Zr(`portal`);function ki(e={}){let{ref:t,container:n,componentProps:r=x,elementProps:i}=e,a=vi(),o=Di()?.portalNode,[s,c]=C.useState(null),[l,u]=C.useState(null),d=X(e=>{e!==null&&u(e)}),f=C.useRef(null);H(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Pe(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=m(`div`,r,{ref:[t,d],props:[{id:a,[Oi]:``},i]}),h=s&&p?pi.createPortal(p,s):null;return{node:l,nodeId:C.isValidElement(p)?p.props.id:void 0,subtree:h}}var Ai=C.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ki({container:o,ref:t,componentProps:e,elementProps:c}),f=C.useRef(null),p=C.useRef(null),m=C.useRef(null),h=C.useRef(null),[g,_]=C.useState(null),v=C.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;C.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Kr(e)&&(e.type===`focusin`?v.current&&=(Jr(l),!1):(qr(l),v.current=!0))}return En(Y(l,`focusin`,e,!0),Y(l,`focusout`,e,!0))},[l,y]),H(()=>{l&&b===!0&&v.current&&(Jr(l),v.current=!1)},[b,l]);let S=C.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,w.jsxs)(C.Fragment,{children:[d,(0,w.jsxs)(Ei.Provider,{value:S,children:[x&&l&&(0,w.jsx)(Hn,{"data-type":`outside`,ref:f,onFocus:e=>{Kr(e,l)?m.current?.focus():Wr(g?g.domReference:null)?.focus()}}),x&&l&&(0,w.jsx)(`span`,{role:s,"aria-owns":u,style:Ti}),l&&pi.createPortal(a,l),x&&l&&(0,w.jsx)(Hn,{"data-type":`outside`,ref:p,onFocus:e=>{Kr(e,l)?h.current?.focus():(Ur(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Ht(`focus-out`,e.nativeEvent)))}})]})]})});function ji(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Mi=class{nodesRef={current:[]};events=ji();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Ni=C.createContext(null),Pi=C.createContext(null),Fi=()=>C.useContext(Ni)?.id||null,Ii=e=>{let t=C.useContext(Pi);return e??t};function Li(e){let t=vi(),n=Ii(e),r=Fi();return H(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Ri(e){let{children:t,id:n}=e,r=Fi();return(0,w.jsx)(Ni.Provider,{value:C.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function zi(e){let{children:t,externalTree:r}=e,i=n(()=>r??new Mi).current;return(0,w.jsx)(Pi.Provider,{value:i,children:t})}function Bi(e){return e==null?e:`current`in e?e.current:e}function Vi(e,t){let n=Me(nt(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Ee(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Hi=20,Ui=[];function Wi(){Ui=Ui.filter(e=>e.deref()?.isConnected)}function Gi(e){Wi(),e&&je(e)!==`body`&&(Ui.push(new WeakRef(e)),Ui.length>Hi&&(Ui=Ui.slice(-20)))}function Ki(){return Wi(),Ui[Ui.length-1]?.deref()}function qi(e){return e?zr(e)?e:Vr(e)[0]||e:null}function Ji(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Br(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return zr(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Yi(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=X(()=>b.current.floatingContext?.nodeId),T=i===!1,E=Pt(_)&&T,D=Dn(i),O=Dn(a),k=Dn(o),A=Dn(u),j=Dn(g),M=Ii(m),N=Di(),P=C.useRef(!1),F=C.useRef(!1),I=C.useRef(!1),L=C.useRef(null),R=C.useRef(``),ee=C.useRef(``),z=C.useRef(null),te=C.useRef(null),ne=S(z,p,N?.beforeInsideRef),B=S(te,N?.afterInsideRef),V=K(),re=K(),ie=Ln(),ae=N!=null,U=It(v),W=X((e=U)=>e?Vr(e):[]),G=X(()=>h?.().filter(e=>e!=null)??[]);C.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&J(U,et(Rn(U)))&&W().length===0&&!E&&we(e)}return Y(Rn(U),`keydown`,e)},[r,U,c,E,W]),C.useEffect(()=>{if(r||!g)return;let e=Rn(U);function t(){I.current=!1}function n(e){let t=nt(e),n=G(),r=J(v,t)||J(_,t)||J(N?.portalNode,t)||n.some(e=>e===t||J(e,t));I.current=!r,ee.current=e.pointerType||`keyboard`,tt(t,`[data-base-ui-click-trigger]`)&&(F.current=!0,re.start(0,()=>{F.current=!1}))}function i(){ee.current=`keyboard`}return En(Y(e,`pointerdown`,n,!0),Y(e,`pointerup`,t,!0),Y(e,`pointercancel`,t,!0),Y(e,`keydown`,i,!0),t)},[r,v,_,U,g,N,re,G]),C.useEffect(()=>{if(r||!l)return;let e=Rn(U);function n(){F.current=!0,re.start(0,()=>{F.current=!1})}function i(e){let t=nt(e);zr(t)&&(L.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=nt(n);c&&r==null&&a!=null&&J(v,a)&&Gi(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=G(),p=r?.hasAttribute(Zr(`focus-guard`))&&[z.current,te.current,N?.beforeInsideRef.current,N?.afterInsideRef.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,Bi(f),Bi(d)].includes(r),m=!(J(_,r)||J(v,r)||J(r,v)||J(N?.portalNode,r)||u.some(e=>e===r||J(e,r))||l.hasMatchingElement(e=>J(e,r))||p||M&&(Yr(M.nodesRef.current,o).find(e=>J(e.context?.elements.floating,r)||J(e.context?.elements.domReference,r))||Xr(M.nodesRef.current,o).find(e=>[e.context?.elements.floating,It(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&U&&Ji(U),s&&i!==_&&!Tr(a)&&et(e)===e.body){if(Fe(U)&&(U.focus(),s===`popup`)){ie.request(()=>{U.focus()});return}let e=W(),t=L.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;Fe(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(E||!c)&&r&&m&&!F.current&&(E||r!==Ki())&&(P.current=!0,t.setOpen(!1,Ht(sn,n)))})}function o(){I.current||(b.current.insideReactTree=!0,V.start(0,()=>{b.current.insideReactTree=!1}))}let u=Fe(_)?_:null;if(v||u)return En(u&&Y(u,`focusout`,a),u&&Y(u,`pointerdown`,n),v&&Y(v,`focusin`,i),v&&Y(v,`focusout`,a),v&&N&&Y(v,`focusout`,o,!0))},[r,_,v,U,c,M,N,t,l,s,W,E,x,b,V,re,ie,d,f,G]),C.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(N?.portalNode?.querySelectorAll(`[${Zr(`portal`)}]`)||[]),t=(M?Xr(M.nodesRef.current,x()):[]).find(e=>Pt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=ui([v,...e,z.current,te.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,...G(),t,Bi(f),Bi(d),E?_:null].filter(e=>e!=null),{ariaHidden:c||E,mark:!1}),i=ui([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,N,E,M,x,d,f,G]),H(()=>{if(!g||r||!Fe(U))return;R.current=``,ee.current=``;let e=Rn(U),t=et(e);queueMicrotask(()=>{let n=D.current,r=typeof n==`function`?n(A.current||``):n;if(r===void 0||r===!1||J(U,t))return;let i=null,a=()=>(i??=W(U),i[0]||U),o;o=r===!0||r===null?a():Bi(r),o||=a();let s=J(U,et(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&Ee(c);$r(o,{sync:l,preventScroll:o===U,shouldFocus(){if(!j.current)return!1;if(s)return!0;let t=et(e);return!(t!==o&&J(U,t))}})})},[r,g,U,W,D,A,j,b]);let oe=C.useRef(null);H(()=>{if(r||!U){oe.current=null;return}oe.current&&=(oe.current.cancelled=!0,null);let e=Rn(U),t=et(e),n=A.current==null;Gi(t);function i(e){if(e.open||(R.current=Vi(e.nativeEvent,ee.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Zr(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(P.current=!0),e.reason===`outside-press`){if(e.nested)P.current=!1;else if(Ee(e.nativeEvent)||De(e.nativeEvent))P.current=!1;else{let e=!1;Rn(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}}y.on(`openchange`,i);function a(e){let r=O.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&je(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Ki()||null,typeof i==`boolean`?s:Bi(i)||s||null}return()=>{y.off(`openchange`,i);let t=et(e),n=G(),r=J(v,t)||n.some(e=>e===t||J(e,t))||M&&Yr(M.nodesRef.current,x(),!1).some(e=>J(e.context?.elements.floating,t)),o=O.current,s=R.current,c=a(s),l={cancelled:!1};oe.current=l,queueMicrotask(()=>{oe.current===l&&(oe.current=null);let n=qi(c),i=k.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!P.current&&Fe(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}P.current=!1})}},[r,v,U,O,k,A,y,M,_,x,G]),H(()=>{if(!be||g||!v)return;let e=et(Rn(v));Fe(e)&&Mt(e)&&J(v,e)&&e.blur()},[g,v]),H(()=>{if(!r&&N)return N.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{N.setFocusManagerState(null)}},[r,N,c,g,t,l,_]),H(()=>{if(!r&&U)return Ji(U),()=>{queueMicrotask(Wi)}},[r,U]);let se=!r&&(!c||!E)&&(ae||c);return(0,w.jsxs)(C.Fragment,{children:[se&&(0,w.jsx)(Hn,{"data-type":`inside`,ref:ne,onFocus:e=>{if(c){let e=W();$r(e[e.length-1])}else N?.portalNode&&(P.current=!1,Kr(e,N.portalNode)?Ur(_)?.focus():Bi(f??N.beforeOutsideRef)?.focus())}}),n,se&&(0,w.jsx)(Hn,{"data-type":`inside`,ref:B,onFocus:e=>{c?$r(W()[0]):N?.portalNode&&(l&&(P.current=!0),Kr(e,N.portalNode)?Wr(_)?.focus():Bi(d??N.afterOutsideRef)?.focus())}})]})}function Xi(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Gt}=t,l=e.context.dataRef,u=C.useRef(void 0),d=Ln(),f=K(),p=C.useMemo(()=>{function t(t,n,r,i){let a=Ht(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Oe(e.pointerType,!0)&&De(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Oe(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=nt(s),p=Mt(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:Oe(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return C.useMemo(()=>n?{reference:p}:x,[n,p])}function Zi(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Qi(e){return e!=null&&e.clientX!=null}function $i(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=C.useRef(!1),l=C.useRef(null),[u,d]=C.useState(),[f,p]=C.useState([]),m=X(t=>{e.set(`positionReference`,t)}),h=X((t,n,i)=>{c.current||(!s.current.openEvent||Qi(s.current.openEvent))&&e.set(`positionReference`,Zi(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=X(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=Oe(u)?a:i;C.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=Me(a);function r(t){let n=nt(t);J(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||Qi(s.current.openEvent)?l.current=Y(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),C.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),C.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),C.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=C.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return C.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function ea(){return!1}function ta(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function na(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ea,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Ii(c),m=X(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=X(()=>a),{escapeKey:v,outsidePress:y}=ta(s),b=C.useRef(!1),x=C.useRef(!1),S=C.useRef(!1),w=C.useRef(!1),T=C.useRef(!1),E=C.useRef(``),D=C.useRef(null),O=K(),k=K(),A=K(),j=X(()=>{k.clear(),d.current.insideReactTree=!1}),M=X(e=>{let t=d.current.floatingContext?.nodeId;return(p?Yr(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=X(t=>At(t,e.select(`floatingElement`))||At(t,e.select(`domReferenceElement`))),P=X(t=>{o()&&e.setOpen(!1,Ht(Gt,t.nativeEvent))}),F=X(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=Te(t)?t.nativeEvent:t;if(T.current||i.isComposing||!v&&M(`__escapeKeyBubbles`))return;let a=Ht(cn,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),I=X(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=X(t=>{if(!l||!n||t.button!==0)return;let r=nt(t.nativeEvent);J(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),R=X(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});C.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),C.useEffect(()=>j,[j]),C.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new ce,i=Rn(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(be?5:0,()=>{T.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function C(e){let t=d.current.floatingContext?.nodeId,n=p&&Yr(p.nodesRef.current,t).some(t=>At(e,t.context?.elements.floating));return N(e)||n}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),S.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=nt(n),i=`[${Zr(`inert`)}]`,a=q(r)?r.getRootNode():null,o=Array.from((Ie(a)?a:Rn(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>J(e,r))))return;let c=q(r)?r:null;for(;c&&!qe(c);){let e=Xe(c);if(qe(e)||!q(e))break;c=e}if(!(o.length&&q(r)&&!jt(r)&&!J(r,e.select(`floatingElement`))&&o.every(e=>!J(c,e)))){if(Fe(r)&&!(`touches`in n)){let e=qe(r),t=Je(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!C(n)){if(f()===`intentional`){if(n.detail!==0&&!Ee(n)&&!w.current)return;if(S.current){t.clear(),S.current=!1;return}}typeof h==`function`&&!h(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,Ht(Jt,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=nt(e);if(!n)return;let r=Y(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function ee(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function z(e){if(e.type===`pointercancel`&&(w.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():C(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,j())))}function te(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function ne(e){L(e,te)}function B(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function V(e){L(e,B)}let re=En(r&&En(Y(i,`keydown`,F),Y(i,`compositionstart`,a),Y(i,`compositionend`,o)),g&&En(Y(i,`click`,ee,!0),Y(i,`pointerdown`,ee,!0),Y(i,`pointerup`,z,!0),Y(i,`pointercancel`,z,!0),Y(i,`mousedown`,ee,!0),Y(i,`mouseup`,z,!0),Y(i,`touchstart`,R,{capture:!0,passive:!0}),Y(i,`touchmove`,ne,{capture:!0,passive:!0}),Y(i,`touchend`,V,{capture:!0,passive:!0})));return()=>{re(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,F,j,_,M,N,p,e,O,A]);let ee=C.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),z=C.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return C.useMemo(()=>n?{reference:ee,floating:z,trigger:ee}:{},[n,ee,z])}var ra=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(U(99,this.componentName,e,this.componentName));t.setOpen(!0,Ht(yn,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,Ht(yn))}};function ia(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),H(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};q(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function aa(e,t=!1,n=!1,r=!1){let[i,a]=C.useState(e&&t?`idle`:void 0),[o,s]=C.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),H(()=>{if(!e&&o&&i!==`ending`&&n){let e=In.request(()=>{a(`ending`)});return()=>{In.cancel(e)}}},[e,o,i,n]),H(()=>{if(!e||t||i===void 0)return;let n=In.request(()=>{a(void 0)});return()=>{In.cancel(n)}},[t,e,i]),H(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=In.request(()=>{a(`idle`)});return()=>{In.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function oa(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var sa=null;function ca(e){if(!sa){let e=[];sa=e,queueMicrotask(()=>{sa=null,pi.flushSync(()=>{for(let t of e)t()})})}sa.push(e)}function la(e,t=!1,n=!1){let r=Ln();return X((a,o=null)=>{r.cancel();let s=Bi(e);if(s==null)return;let c=s,l=()=>{n?ca(()=>{o?.aborted||a()}):pi.flushSync(a)};if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){a();return}function u(){Promise.all(oa(c).map(e=>e.finished.then(i))).then(()=>{o?.aborted||l()},()=>{o?.aborted||(oa(c).some(e=>e.pending||e.playState!==`finished`)?u():l())})}if(t){let e=lt;if(!c.hasAttribute(e)){r.request(u);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),u())});t.observe(c,{attributes:!0,attributeFilter:[e]}),o?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(u)})}function ua(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=X(a),s=la(r,n,i);C.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function da(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=X(i),{mounted:c,setMounted:l,transitionStatus:u}=aa(t,!1,!1,o),d=!t&&r;H(()=>{t&&s(!1)},[t,s]);let f=C.useRef(c),p=C.useRef(!1),m=mi(),h=()=>{f.current=!1,l(!1),a()};H(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=X(()=>{f.current&&(t?(p.current=!0,m()):h())});return ua({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var fa={tabIndex:-1,[rt]:``};function pa(e){return t=>t!==`touch`||e.current}function ma(e,t=!1){let r=vi(),i=Fi()!=null,a=n(()=>e(r,i)).current;return ia({popupStore:a,treatPopupAsFloatingElement:t,floatingRootContext:a.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:a.setOpen}),a}function ha({handle:e,store:t}){return H(()=>e.attachStore(t),[e,t]),null}function ga(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function _a(e,t){let n=C.useRef(null);return X(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),ga(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),ga(t))})}function va(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function ya(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function ba(e,t,n,r={}){let i=n.reason,a=i===Kt,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=ya(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=va(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?pi.flushSync(l):l()}function xa(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=_a(e,n),o=X(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=X(e=>{a(e),e&&o(e)});return H(()=>(s(t.current),()=>s(null)),[s,t,n,e]),H(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Sa(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=C.useRef(null),i=e.useState(`open`);H(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Ht(Wt);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Ca(e,t,r,i){let{mounted:a,transitionStatus:o,forceUnmount:s}=da({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:i,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),r?.(),t.context.onOpenChangeComplete?.(!1)}});return n(()=>(t.set(`mounted`,a),null)),t.useSyncedValues({mounted:a,transitionStatus:o}),{forceUnmount:s,transitionStatus:o}}function wa(e,t){e.useSyncedValues(t),H(()=>()=>{e.update({activeTriggerProps:x,inactiveTriggerProps:x,popupProps:x})},[e])}function Ta(e,t){H(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),H(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ea=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Da=t((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Oa=t(((e,t)=>{t.exports=Da()})),ka=t((e=>{var t=f(),n=Oa();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Aa=t(((e,t)=>{t.exports=ka()})),ja=Oa(),Ma=e(Aa(),1),Na=y(19)?Ia:La;function Pa(e,t,n,r,i){return Na(e,t,n,r,i)}function Fa(e,t,n,r,i){let a=C.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,ja.useSyncExternalStore)(e.subscribe,a,a)}B({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,ja.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ia(e,t,n,r,i){let a=ne();if(!a)return Fa(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function La(e,t,n,r,i){return(0,Ma.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Ra=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Pa(this,e,t,n,r)}},za=class extends Ra{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){C.useDebugValue(e);let n=this;H(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;H(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;H(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){C.useDebugValue(e);let n=this,r=t!==void 0;H(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return C.useDebugValue(e),Pa(this,this.selectors[e],t,n,r)}useContextCallback(e,t){C.useDebugValue(e);let n=X(t??i);this.context[e]=n}useStateSetter(e){let t=C.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Ba={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Va=class extends za{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:ji(),nested:n,triggerElements:i},Ba),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&ke(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Ha(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Va({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:x,inactiveTriggerProps:x,popupProps:x}}var Ua=e=>e.triggerIdProp??e.activeTriggerId,Wa=e=>e.openProp??e.open,Ga=e=>(e.popupElement?.id??e.floatingId)||void 0;function Ka(e,t){return t!==void 0&&Wa(e)&&Ua(e)===t}function qa(e,t){return Ka(e,t)?!0:t!==void 0&&Wa(e)&&Ua(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Ja={open:Wa,mounted:e=>e.mounted,transitionStatus:e=>Wa(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Ua,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Ga,isTriggerActive:(e,t)=>t!==void 0&&Ua(e)===t,isOpenedByTrigger:(e,t)=>Ka(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Ua(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>qa(e,t)?Ga(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Ya(e){let t=C.useCallback(t=>e===void 0?i:e.subscribeStore(t),[e]),n=C.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,ja.useSyncExternalStore)(t,n,()=>e?.serverStore)}var Xa=ve&&be;function Za(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=C.useRef(!1),s=C.useRef(null),c=C.useRef(!0),l=K();C.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Me(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&Fe(t)&&t===et(Rn(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return En(Y(r,`blur`,i),Xa&&Y(r,`keydown`,a,!0),Xa&&Y(r,`pointerdown`,l,!0))},[e,n]),C.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);q(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=C.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=nt(n.nativeEvent);if(q(a)){if(Xa&&!n.relatedTarget){if(!c.current&&!Mt(a))return}else if(!Ft(a))return}let u=kt(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,Ht(qt,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,Ht(qt,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=q(r)&&r.hasAttribute(Zr(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=et(Rn(t));!r&&n===t||J(a.current.floatingContext?.refs.floating.current,n)||J(t,n)||o||kt(r??n,e.context.triggerElements)||e.setOpen(!1,Ht(qt,i))})}}},[a,r,e,l]);return C.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var Qa=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new ce;restTimeout=new ce;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},$a=new WeakMap;function eo(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&$a.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),$a.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function to(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=$a.get(n);a&&a!==e&&eo(a),eo(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,$a.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function no(e){let t=e.context.dataRef.current,r=n(()=>t.hoverInteractionState??Qa.create()).current;return t.hoverInteractionState||=r,oe(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ro(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=Ii(),u=Fi(),d=no(e),f=K(),p=X(()=>Bt(c.current.openEvent?.type,d.interactedInside)),m=X(()=>Vt(c.current.openEvent?.type)),h=X(()=>{eo(d)});H(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),C.useEffect(()=>h,[h]),H(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&q(s)&&o){let e=s,t=o,n=Rn(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??tt(e,`[data-rootownerid]`)??n.body;return to(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),C.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Yr(l.nodesRef.current,u).length>0)}function a(t){let n=Rt(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,Ht(Kt,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=nt(e);Nt(t)?d.interactedInside=tt(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(kt(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&q(o)&&Yr(l.nodesRef.current,r,!1).some(e=>J(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,Ht(Kt,n)),l.events.emit(`floating.closed`,n)})}let y=o;return En(y&&Y(y,`mouseenter`,g),y&&Y(y,`mouseleave`,_),y&&Y(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var io={current:null};function ao(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=io,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=Ii(l),v=no(e),y=C.useRef(!1),b=Dn(i),x=Dn(r),S=Dn(o),w=Dn(n),T=Dn(p),E=Dn(f),D=X(()=>Bt(h.current.openEvent?.type,v.interactedInside)),O=X(()=>T.current?.()!==!1),k=X((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!J(t,n);if(!q(r))return!1;let a=r;return i.hasMatchingElement(e=>J(e,a))&&(!t||!J(t,a))}),A=X(()=>{v.handler&&=(Rn(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),j=X(()=>{eo(v)});return u&&(v.handleCloseOptions=i?.__options),C.useEffect(()=>A,[A]),C.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===Kt,A(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,A]),C.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Rt(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,Ht(Kt,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,Ht(Kt,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!q(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!Oe(v.pointerType))return;let n=zt(S.current),r=Rt(x.current,`open`,v.pointerType),i=nt(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(q(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(J(t,i)){c=t;break}}q(o)&&q(s)&&!e.context.triggerElements.hasElement(o)&&J(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&q(c)&&q(s)&&J(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,Ht(Kt,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,Ht(Kt,t,c))}):g&&O()&&e.setOpen(!0,Ht(Kt,t,c)))}function o(n){if(D()){j();return}A();let r=Rn(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!kt(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else v.pointerType===`touch`&&J(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){J(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?Y(r,`mouseout`,l):void 0;return s?En(Y(r,`mousemove`,i,{once:!0}),Y(r,`mouseenter`,i),Y(r,`mouseleave`,o),f):En(Y(r,`mouseenter`,i),Y(r,`mouseleave`,o),f)},[A,j,h,x,e,n,b,v,u,k,D,a,s,S,c,_,w,d,E,O,m]),C.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!Oe(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;to(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=zt(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,D())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,Ht(Kt,n,r))}v.pointerType===`touch`?pi.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,D,k,a,e,S,O])}var oo=.1,so=oo*oo,co=.5;function lo(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function uo(e,t,n,r,i,a,o,s,c,l){let u=!1;return lo(e,t,n,r,i,a)&&(u=!u),lo(e,t,i,a,o,s)&&(u=!u),lo(e,t,o,s,c,l)&&(u=!u),lo(e,t,c,l,n,r)&&(u=!u),u}function fo(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function po(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function mo(e={}){let{blockPointerEvents:t=!1}=e,n=new ce,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*so;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=nt(r),g=r.type===`mouseleave`,_=J(u,h),v=J(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&q(r.relatedTarget)&&J(u,r.relatedTarget))return;function y(){return!!(s&&Yr(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=po(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=po(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=po(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=po(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!fo(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?co/2:co*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+co+1,o=C||T?S.bottom-co:S.top,s=C?T?S.bottom-co:S.top:S.bottom-co;M=uo(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?co/2:co*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-co,o=C||T?S.top+co:S.bottom,s=C?T?S.top+co:S.bottom:S.top+co;M=uo(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?co/2:co*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+co+1,o=w||E?S.right-co:S.left,s=w?E?S.right-co:S.left:S.right-co;M=uo(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?co/2:co*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-co,o=w||E?S.left+co:S.right,s=w?E?S.left+co:S.right:S.left+co;M=uo(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function ho(e,t,n){let{reference:r,floating:i}=e,a=tr(t),o=nr(t),s=er(o),c=Zn(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Qn(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function go(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Xn(t,e),p=mr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=hr(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=hr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var _o=50,vo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:go},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ho(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<_o&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ho(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},yo=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Xn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Zn(r),_=tr(o),v=Zn(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[fr(o)]:ir(o)),x=p!==`none`;!d&&x&&b.push(...dr(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=rr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===tr(t)||T.every(e=>tr(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=tr(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},bo=new Set([`left`,`top`]);async function xo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Zn(n),s=Qn(n),c=tr(n)===`y`,l=bo.has(o)?-1:1,u=a&&c?-1:1,d=Xn(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var So=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await xo(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Co=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Xn(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=tr(i),p=$n(f),m=u[p],h=u[f],g=(e,t)=>Yn(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},wo=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Xn(e,t),u={x:n,y:r},d=tr(i),f=$n(d),p=u[f],m=u[d],h=Xn(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=bo.has(Zn(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},To=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Xn(e,t),c=await i.detectOverflow(t,s),l=Zn(n),u=Qn(n),d=tr(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Un(p-c[m],g),y=Un(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Wn(c.left,c.right):S=p-2*Wn(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Eo(e){let t=Je(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Fe(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Gn(n)!==a||Gn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Do(e){return q(e)?e:e.contextElement}function Oo(e){let t=Do(e);if(!Fe(t))return qn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Eo(t),o=(a?Gn(n.width):n.width)/r,s=(a?Gn(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var ko=qn(0);function Ao(e){let t=Me(e);return!Ke()||!t.visualViewport?ko:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jo(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Me(e)}function Mo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Do(e),o=qn(1);t&&(r?q(r)&&(o=Oo(r)):o=Oo(e));let s=jo(a,n,r)?Ao(a):qn(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Me(a),t=q(r)?Me(r):r,n=e,i=$e(n);for(;i&&t!==n;){let e=Oo(i),t=i.getBoundingClientRect(),r=Je(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Me(i),i=$e(n)}}return hr({width:u,height:d,x:c,y:l})}function No(e,t){let n=Ye(e).scrollLeft;return t?t.left+n:Mo(Ne(e)).left+n}function Po(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-No(e,n),y:n.top+t.scrollTop}}function Fo(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ne(r),s=t?ze(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=qn(1),u=qn(0),d=Fe(r);if((d||!a)&&((je(r)!==`body`||Le(o))&&(c=Ye(r)),d)){let e=Mo(r);l=Oo(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Po(o,c):qn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Io(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Lo(e){let t=Ye(e),n=e.ownerDocument.body,r=Wn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Wn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+No(e),o=-t.scrollTop;return Je(n).direction===`rtl`&&(a+=Wn(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ro=25;function zo(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Me(e),a=Ne(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ke()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(No(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Ro&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Bo(e,t){let n=Mo(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Oo(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Vo(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=zo(e,n,t);else if(t===`document`)r=Lo(Ne(e));else if(q(t))r=Bo(t,n);else{let n=Ao(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return hr(r)}function Ho(e,t){let n=t.get(e);if(n)return n;let r=Qe(e,[],!1).filter(e=>q(e)&&je(e)!==`body`),i=null,a=Je(e).position===`fixed`,o=a?Xe(e):e;for(;q(o)&&!qe(o);){let e=Je(o),t=We(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Xe(o)}return t.set(e,r),r}function Uo(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ze(t)?[]:Ho(t,this._c):[].concat(n),r],o=Vo(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Vo(t,a[e],i);s=Wn(n.top,s),c=Un(n.right,c),l=Un(n.bottom,l),u=Wn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Wo(e){let{width:t,height:n}=Eo(e);return{width:t,height:n}}function Go(e,t,n){let r=Fe(t),i=Ne(t),a=n===`fixed`,o=Mo(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=qn(0);if((r||!a)&&((je(t)!==`body`||Le(i))&&(s=Ye(t)),r)){let e=Mo(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=No(i));let l=i&&!r&&!a?Po(i,s):qn(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ko(e){return Je(e).position===`static`}function qo(e,t){if(!Fe(e)||Je(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ne(e)===n&&(n=n.ownerDocument.body),n}function Jo(e,t){let n=Me(e);if(ze(e))return n;if(!Fe(e)){let t=Xe(e);for(;t&&!qe(t);){if(q(t)&&!Ko(t))return t;t=Xe(t)}return n}let r=qo(e,t);for(;r&&Re(r)&&Ko(r);)r=qo(r,t);return r&&qe(r)&&Ko(r)&&!We(r)?n:r||Ge(e)||n}var Yo=async function(e){let t=this.getOffsetParent||Jo,n=this.getDimensions,r=await n(e.floating);return{reference:Go(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xo(e){return Je(e).direction===`rtl`}var Zo={convertOffsetParentRelativeRectToViewportRelativeRect:Fo,getDocumentElement:Ne,getClippingRect:Uo,getOffsetParent:Jo,getElementRects:Yo,getClientRects:Io,getDimensions:Wo,getScale:Oo,isElement:q,isRTL:Xo};function Qo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $o(e,t,n){let r=null,i,a=Ne(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Kn(d),h=Kn(a.clientWidth-(u+f)),g=Kn(a.clientHeight-(d+p)),_=Kn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Wn(0,Un(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Qo(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Me(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function es(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Do(e),u=i||a?[...l?Qe(l):[],...t?Qe(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?$o(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Mo(e):null;c&&g();function g(){let t=Mo(e);h&&!Qo(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ts=So,ns=Co,rs=yo,is=To,as=wo,os=(e,t,n)=>{let r=new Map,i=n??{},a={...Zo,...i.platform,_c:r};return vo(e,t,{...i,platform:a})},ss=typeof document<`u`?C.useLayoutEffect:function(){};function cs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!cs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ls(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function us(e,t){let n=ls(e);return Math.round(t*n)/n}function ds(e){let t=C.useRef(e);return ss(()=>{t.current=e}),t}function fs(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=C.useState(r);cs(f,r)||p(r);let[m,h]=C.useState(null),[g,_]=C.useState(null),v=C.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=C.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),b=a||m,x=o||g,S=C.useRef(null),w=C.useRef(null),T=C.useRef(u),E=c!=null,D=ds(c),O=ds(i),k=ds(l),A=C.useCallback(()=>{if(!S.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),os(S.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!cs(T.current,t)&&(T.current=t,pi.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);ss(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=C.useRef(!1);ss(()=>(j.current=!0,()=>{j.current=!1}),[]),ss(()=>{if(b&&(S.current=b),x&&(w.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,E]);let M=C.useMemo(()=>({reference:S,floating:w,setReference:v,setFloating:y}),[v,y]),N=C.useMemo(()=>({reference:b,floating:x}),[b,x]),P=C.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=us(N.floating,u.x),r=us(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ls(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var ps=(e,t)=>{let n=ts(e);return{name:n.name,fn:n.fn,options:[e,t]}},ms=(e,t)=>{let n=ns(e);return{name:n.name,fn:n.fn,options:[e,t]}},hs=(e,t)=>({fn:as(e).fn,options:[e,t]}),gs=(e,t)=>{let n=rs(e);return{name:n.name,fn:n.fn,options:[e,t]}},_s=(e,t)=>{let n=is(e);return{name:n.name,fn:n.fn,options:[e,t]}},vs=class extends za{setState(e){}update(e){}set(e,t){}notifyAll(){}},ys={...Ja,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},bs=class extends za{constructor(e,t,n){let r=new Ea;super(xs(e,r,t,n),Ss(r),ys)}setOpen=(e,t)=>{ba(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Ht(Gt,e))}};function xs(e,t,n,r=!1){return{...Ha(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Ss(e){return{popupRef:C.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Cs=V(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=ma((e,t)=>new bs({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Sa(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=Ca(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),T=p.useState(`lastOpenChangeReason`),E=C.useRef(null);H(()=>{m&&t&&p.setOpen(!1,Ht(gn))},[m,t,p]),H(()=>{b===`ending`&&T===`none`||b!==`ending`&&x?(S!==`delay`&&(E.current=S),p.set(`instantType`,`delay`)):E.current!==null&&(p.set(`instantType`,E.current),E.current=null)},[b,x,T,S,p]),H(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),C.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,Ht(yn))}),[y,p]);let D=h||_||!t&&a!==`none`;return(0,w.jsxs)(W.Provider,{value:p,children:[l&&(0,w.jsx)(ha,{handle:l,store:p}),D&&(0,w.jsx)(ws,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function ws({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=na(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=$i(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=C.useMemo(()=>u(a.reference,i.reference),[a.reference,i.reference]);return wa(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??x}),null}function Ts(e){return vi(e,`base-ui`)}var Es=C.createContext(void 0);function Ds(){return C.useContext(Es)}var Os=`data-base-ui-tooltip-trigger`;function ks(e){let t=nt(e);return q(t)?t:null}var As=re(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=G(!0),h=Ya(a)??p;if(!h)throw Error(U(82));let g=Ts(d),_=h.useState(`isTriggerActive`,g),v=h.useState(`isOpenedByTrigger`,g),y=h.useState(`floatingRootContext`),b=C.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:w}=xa(g,b,h,{payload:o,closeOnClick:l,closeDelay:x}),T=Ds(),{activeIdRef:E,delayRef:D,isInstantPhase:O,hasProvider:k}=Tn(y,{open:v}),A=no(y);h.useSyncedValue(`isInstantPhase`,O);let j=h.useState(`disabled`),M=s??j,N=Dn(M),P=h.useState(`trackCursorAxis`),F=h.useState(`disableHoverablePopup`),I=C.useRef(!1),L=K(),R=C.useRef(void 0);function ee(){return k&&E.current!=null?0:c??T??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=tt(e,`[${Os}]`);return n!==null&&n!==t&&J(t,n)}function te(e){let t=z(e);return I.current=t,t&&(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1,L.clear()),t}let ne=ao(y,{enabled:!M,mouseOnly:!0,move:!1,handleClose:!F&&P!==`both`?mo():null,restMs:ee,delay(){return u==null&&k?{close:Rt(D.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),B=Za(y,{enabled:!M}).reference,V=e=>{let t=I.current,n=ks(e),r=te(n),i=b.current,a=i&&n&&J(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`)h.setOpen(!1,Ht(Kt,e));else if(t&&!r&&a&&!N.current&&!h.select(`open`)&&i&&Oe(R.current)){let t=()=>{I.current||N.current||h.select(`open`)||h.setOpen(!0,Ht(Kt,e,i))},n=ee();n===0?(L.clear(),t()):L.start(n,t)}},re=h.useState(`appliedTriggerProps`,w||P!==`none`);return m(`button`,e,{state:{open:v},ref:[t,S,b],props:[ne,B,re,{onMouseOver(e){V(e.nativeEvent)},onFocus(e){z(ks(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,L.clear(),R.current=void 0},onPointerEnter(e){R.current=e.pointerType},onPointerDown(e){R.current=e.pointerType,h.set(`closeOnClick`,l),l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},id:g,[Ot]:M?``:void 0,[Os]:M?void 0:``},f],stateAttributesMapping:wt})}),js=C.createContext(void 0);function Ms(){let e=C.useContext(js);if(e===void 0)throw Error(U(70));return e}var Ns=C.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=ki({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,w.jsxs)(C.Fragment,{children:[l,c&&pi.createPortal(n,c)]})}),Ps=C.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return G().useState(`mounted`)||n?(0,w.jsx)(js.Provider,{value:n,children:(0,w.jsx)(Ns,{ref:t,...r})}):null}),Fs=C.createContext(void 0);function Is(){let e=C.useContext(Fs);if(e===void 0)throw Error(U(71));return e}function Ls(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=C.useState(null),d=C.useRef(null),f=Ii(n),p=C.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=fs({...e,elements:{...p,...l&&{reference:l}}}),h=C.useCallback(e=>{let t=q(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=C.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=C.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=C.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return H(()=>{o&&(d.current=o)},[o]),H(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),C.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var Rs=C.createContext(void 0);function zs(){return C.useContext(Rs)?.direction??`ltr`}var Bs=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Xn(e,t)||{};if(l==null)return{};let d=mr(u),f={x:n,y:r},p=nr(i),m=er(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Yn(D,k,O),j=!c.arrow&&Qn(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Vs=(e,t)=>{let{name:n,fn:r}=Bs(e);return{name:n,fn:r,options:[e,t]}},Hs={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Us={sideX:`left`,sideY:`top`},Ws=`--available-width`,Gs=`--available-height`,Ks=`--anchor-width`,qs=`--anchor-height`,Js=`--transform-origin`,Ys=Ws,Xs=Gs;function Zs(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Qs(e,t,n){let{rects:r,placement:i}=e;return{side:Zs(t,Zn(i),n),align:Qn(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function $s(e){return ec(e,Ls)}function ec(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,w=_.side||`flip`,T=_.align||`flip`,E=_.fallbackAxisSide||`end`,D=v?.crossAxis??!1,O=v?.rootBoundary,k=typeof n==`function`?n:void 0,A=X(k),j=k?A:n,M=Dn(n),N=Dn(g),P=zs()===`rtl`,[F,I]=C.useState(null);!g&&F!==null&&I(null);let L=x===`placement`,R=F?Zn(F):null,ee=F&&L?Qn(F)||`center`:null,z=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],te=ee||o,ne=te===`center`?z:`${z}-${te}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let V=+(i===`bottom`),re=+(i===`top`),ie=+(i===`right`),ae=+(i===`left`),U={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},W=C.useRef(null),G=Dn(a),oe=Dn(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,K=[];p&&K.push(p),K.push(ps(e=>{let t=Qs(e,i,P),n=typeof G.current==`function`?G.current(t):G.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,P,i]));let le=T===`none`&&w!==`shift`,ue=!le&&(u||D||w===`shift`),de=w===`none`?null:gs({...U,padding:{top:B.top+1+V,right:B.right+1+ae,bottom:B.bottom+1+re,left:B.left+1+ie},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),fe=le?null:ms({...U,rootBoundary:O,mainAxis:T!==`none`,crossAxis:ue,limiter:u||D?void 0:hs(e=>{if(!W.current)return{};let{width:t,height:n}=W.current.getBoundingClientRect(),r=tr(Zn(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[U,u,D,O,B,T]);w===`shift`||T===`shift`||te===`center`?K.push(fe,de):K.push(de,fe),K.push(_s({...U,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(Ys,`${t}px`),i.setProperty(Xs,`${n}px`);let a=Me(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Ks,`${u}px`),i.setProperty(qs,`${d}px`)}}),Vs(e=>({element:W.current||Rn(e.elements.floating).createElement(`div`),padding:W.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Zn(r),u=Qn(r),d=tr(l)===`y`,f=W.current,p=typeof a==`function`?a(Qs(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ue&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Js,d?`${m} ${h}`:`${h} ${m}`),{}}},Hs,b),H(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let pe=C.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:h,open:m?g:void 0,placement:ne,middleware:K,strategy:r,whileElementsMounted:m?void 0:(...e)=>es(...e,pe),nodeId:y,externalTree:S}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||Us,Ee=Se?r:`fixed`,De=C.useMemo(()=>{let e;return e=Se?b?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[Ys]=`100vw`,e[Xs]=`100vh`,Se||(e.opacity=0),e},[b,Ee,we,ge,Te,_e,Ce,Se]),Oe=C.useRef(null);H(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(tc(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[g,me,j,M]),C.useEffect(()=>{if(!g)return;let e=M.current;typeof e!=`function`&&tc(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[g,me,j,M]),C.useEffect(()=>{if(m&&g&&he.reference&&he.floating)return es(he.reference,he.floating,ye,pe)},[m,g,he,ye,pe]);let ke=Zn(be),Ae=Zs(i,ke,P),je=Qn(be)||`center`,Ne=!!ve.hide?.referenceHidden;H(()=>{x&&g&&Se&&(ke!==z||L&&je!==te)&&I(be)},[x,L,g,Se,be,ke,je,z,te]);let Pe=C.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),q=ve.arrow?.centerOffset!==0;return C.useMemo(()=>({positionerStyles:De,arrowStyles:Pe,arrowRef:W,arrowUncentered:q,side:Ae,align:je,physicalSide:ke,anchorHidden:Ne,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Pe,W,q,Ae,je,ke,Ne,me,xe,Se,ye])}function tc(e){return e!=null&&`current`in e}function nc(e){return e===`starting`?yi:x}function rc(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),m(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},nc(r),i],stateAttributesMapping:Et})}var ic=C.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=wi,style:g,..._}=e,v=G(),y=Ms(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),T=v.useState(`disableHoverablePopup`),E=v.useState(`floatingRootContext`),D=v.useState(`instantType`),O=v.useState(`transitionStatus`),k=$s({anchor:i,positionMethod:a,floatingRootContext:E,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),A=rc(e,C.useMemo(()=>({open:b,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:S===`none`?D:`tracking-cursor`}),[b,k.side,k.align,k.anchorHidden,S,D]),{styles:k.positionerStyles,transitionStatus:O,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||T});return(0,w.jsx)(Fs.Provider,{value:k,children:A})}),ac=C.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=G(),{side:s,align:c}=Is(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),h=o.useState(`disabled`),g=o.useState(`closeDelay`);ua({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),ro(p,{enabled:!h,closeDelay:g});let _=o.useStateSetter(`popupElement`);return m(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,_],props:[fa,f,nc(d),a],stateAttributesMapping:Dt})}),oc=C.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=G(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=Is(),f={open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)};return m(`div`,e,{state:f,ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Et})}),sc=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=C.useMemo(()=>({open:t,close:n}),[t,n]);return(0,w.jsx)(Es.Provider,{value:t,children:(0,w.jsx)(wn,{delay:i,timeoutMs:r,children:e.children})})};function cc(e){return y(19)?e:e?`true`:void 0}function lc({delay:e,delayDuration:t,timeout:n,skipDelayDuration:r,...i}){let a=e??t,o=n??r;return(0,w.jsx)(sc,{...a===void 0?{}:{delay:a},...o===void 0?{}:{timeout:o},...i})}var uc=Cs,dc=C.forwardRef(({asChild:e,render:t,children:n,...r},i)=>e&&C.isValidElement(n)?(0,w.jsx)(As,{ref:i,render:n,...r}):(0,w.jsx)(As,{ref:i,render:t,...r,children:n}));dc.displayName=`TooltipTrigger`;var fc=C.forwardRef(({className:e,side:t=`top`,sideOffset:n=8,align:r=`center`,alignOffset:i=0,arrowPadding:o=10,anchor:s,positionMethod:c=A,collisionBoundary:l,collisionPadding:u,sticky:d,disableAnchorTracking:f,collisionAvoidance:p,keepMounted:m,children:h,...g},_)=>{let v={side:t,sideOffset:n,align:r,alignOffset:i,arrowPadding:o,anchor:s,positionMethod:c,collisionBoundary:l,collisionPadding:u,sticky:d,disableAnchorTracking:f,collisionAvoidance:p};return(0,w.jsx)(Ps,{keepMounted:m,children:(0,w.jsx)(ic,{className:`isolate z-100`,...v,children:(0,w.jsxs)(ac,{ref:_,role:`tooltip`,className:a(`relative z-100 flex origin-(--transform-origin) flex-col rounded-lg px-2.5 py-1.5 text-caption text-foreground transition-[transform,scale,opacity] duration-150`,F,`data-[starting-style]:scale-95 data-[starting-style]:opacity-0`,`data-[ending-style]:scale-95 data-[ending-style]:opacity-0`,`data-[instant]:transition-none motion-reduce:transition-none`,e),...g,children:[h,(0,w.jsx)(oc,{className:a(`flex`,`data-[side=top]:bottom-[-7px] data-[side=top]:rotate-180`,`data-[side=bottom]:top-[-7px]`,`data-[side=left]:right-[-9px] data-[side=left]:rotate-90`,`data-[side=right]:left-[-9px] data-[side=right]:-rotate-90`),children:(0,w.jsx)(pc,{})})]})})})});fc.displayName=`TooltipContent`;function pc(){return(0,w.jsxs)(`svg`,{width:`12`,height:`8`,viewBox:`0 0 12 8`,fill:`none`,overflow:`visible`,children:[(0,w.jsx)(`path`,{d:`M0 7L4 2Q6 0 8 2L12 7L12 8L0 8Z`,className:`fill-card`}),(0,w.jsx)(`path`,{d:`M0 7.5L4 2.5Q6 0.5 8 2.5L12 7.5`,className:`fill-none [stroke:var(--surface-rim)]`,strokeWidth:`1`,strokeLinejoin:`round`,strokeLinecap:`round`})]})}var mc={xs:`[&>svg]:size-icon-xs`,sm:`[&>svg]:size-icon-sm`,md:`[&>svg]:size-icon-md`,lg:`[&>svg]:size-icon-lg`},hc=({children:e,className:t,size:n=`md`,...r})=>(0,w.jsx)(`span`,{"data-slot":`icon`,className:a(`block`,mc[n],t),...r,children:e}),gc=a(`[--control-icon:var(--control-icon-rest)] [&_svg]:text-(color:--control-icon)`,`not-disabled:hover:[--control-icon:var(--control-icon-hover)] aria-disabled:[--control-icon:var(--control-icon-rest)]`,`data-[shape=icon]:[--control-icon-hover:var(--foreground)]`),_c=`[--control-icon-hover:var(--foreground)]`,vc=C.createContext(void 0),yc={sm:`h-control-sm`,md:`h-control-md`,lg:`h-control-lg`},bc={sm:`h-control-sm text-label`,md:`h-control-md text-label`,lg:`h-control-lg text-label`},xc={sm:`[--control-px:.9em] [--control-gap:0.3125rem]`,md:`[--control-px:.9em] [--control-gap:0.375rem]`,lg:`[--control-px:1em] [--control-gap:0.375rem]`},Sc={default:`[&[data-popup-open]:where(:not([aria-expanded=false]))]:[--surface-tint:var(--field-open)] [&[data-popup-open]:where(:not([aria-expanded=false]))]:text-foreground`,ghost:`[&[data-popup-open]:where(:not([aria-expanded=false]))]:bg-fill-subtle [&[data-popup-open]:where(:not([aria-expanded=false]))]:text-foreground`};function Cc(e){return e==="default"||e===`ghost`?Sc[e]:void 0}var wc=`disabled:cursor-not-allowed disabled:text-muted-foreground`,Tc=`outline-hidden focus-visible:outline-hidden focus-visible:border-border-focus`,Ec=`focus-visible:outline-hidden focus-visible:[--surface-rim:var(--border-focus)]`,Dc=`focus-visible:outline-hidden focus-visible:[--surface-rim:var(--field-rim-focus)]`,Oc=`aria-invalid:[--field-rim:var(--destructive-indicator)] aria-invalid:[--field-rim-focus:var(--destructive-indicator)]`,kc=`has-[[aria-invalid=true]]:[--field-rim:var(--destructive-indicator)] has-[[aria-invalid=true]]:[--field-rim-focus:var(--destructive-indicator)]`;function Ac(e){return e?{"aria-invalid":!0}:{}}var jc=`aria-invalid:border-destructive-indicator aria-invalid:hover:border-destructive-indicator aria-invalid:focus-visible:border-destructive-indicator`;``+Dc;var Mc=`w-(--field-width,100%) max-w-(--field-max-width,none) shrink-(--field-shrink,1)`,Nc=`bg-field shadow-input text-foreground disabled:bg-field-disabled [&:hover:not(:focus-visible):not(:disabled):not([data-popup-open]:where([aria-expanded=true],[role=group]))]:[--surface-tint:var(--field-hover)] outline-hidden focus-visible:outline-hidden `+Dc,Pc=`bg-field shadow-input text-foreground has-[:disabled]:bg-field-disabled [&:hover:not(:has(:focus-visible)):not(:has(:disabled))]:[--surface-tint:var(--field-hover)] outline-hidden focus-within:outline-hidden has-[:focus-visible]:[--surface-rim:var(--field-rim-focus)]`,Fc=`bg-field shadow-input text-foreground [&:hover:not(:active):not(:disabled):not([data-popup-open]:where([aria-expanded=true],[role=group]))]:[--surface-tint:var(--field-hover)] [&:active:not(:disabled)]:[--surface-tint:var(--fill)] focus-visible:outline-hidden focus-visible:[--surface-rim:var(--border-focus)]`;function Ic(e){return e===`filled`?`default`:e}var Lc=`border-0 bg-transparent outline-hidden focus-visible:outline-hidden`,Rc=C.createContext(void 0);function zc(e=!1){let t=C.useContext(Rc);if(t===void 0&&!e)throw Error(U(16));return t}function Bc(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:C.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Vc(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Me(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Hc(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=C.useRef(null),s=zc(!0),c=a??s!==void 0,{props:l}=Bc({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),f=C.useCallback(()=>{let e=o.current;Uc(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return H(f,[f]),{getButtonProps:C.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...f}=e;return u({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(d(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Uc(r),s=!i&&Wc(r),l=n&&(i?a:!s),u=e.key===`Enter`,f=e.key===` `,p=r.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(n&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Vc(r,e))}else!l||i||!f&&!u?n&&s&&f&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Vc(r,e)))},onKeyUp(e){t||(d(e),a?.(e),e.target===e.currentTarget&&i&&c&&Uc(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),Vc(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,f)},[t,l,c,i]),buttonRef:X(e=>{o.current=e,f()})}}function Uc(e){return Fe(e)&&e.tagName===`BUTTON`}function Wc(e){return Fe(e)&&e.tagName===`A`&&!!e.href}var Gc=C.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Hc({disabled:i,focusableWhenDisabled:a,native:o});return m(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Kc=a(`rounded-full px-[calc(var(--control-px)-var(--control-border,0px))] [--control-icon-inset:2px]`,`has-[>[data-slot=button-icon]]:pl-[calc(var(--control-px)-2px-var(--control-border,0px))]`,`has-[>svg]:pl-[calc(var(--control-px)-2px-var(--control-border,0px))]`,`has-[>[data-slot=button-icon-end]]:pr-[calc(var(--control-px)-2px-var(--control-border,0px))]`),qc=a(`relative size-auto gap-1 rounded-xs px-0 text-label [--control-gap:0.25rem] [--control-icon-inset:0px]`,`before:absolute before:-inset-x-2`,`has-[>[data-slot=button-icon-end]]:pr-0 has-[>[data-slot=button-icon]]:pl-0 has-[>svg]:pl-0`),Jc=a(`relative inline-flex items-center gap-1`,mc.sm,`[&>svg]:shrink-0`,`after:absolute after:inset-x-0 after:bottom-0 after:h-px after:origin-left after:scale-x-0 after:bg-current`,`after:transition-transform after:duration-fast after:ease-out-custom motion-reduce:after:transition-none`),Yc=D(a(`inline-flex cursor-pointer items-center justify-center whitespace-nowrap`,h,wc,`aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:text-muted-foreground`,Tc),{variants:{variant:{default:a(`border-0`,Fc,gc,`[--control-icon-rest:var(--icon)]`,`disabled:bg-fill-subtle aria-disabled:bg-fill-subtle`),primary:a(`border border-transparent bg-fill-inverse text-background [--control-border:1px] not-disabled:hover:bg-fill-inverse-hover not-disabled:active:bg-fill-inverse-active`,p,`focus-visible:border-transparent`,`disabled:bg-fill-inverse-disabled disabled:text-background/75 aria-disabled:bg-fill-inverse-disabled aria-disabled:text-background/75`),destructive:a(`border border-transparent bg-fill-destructive text-fill-destructive-foreground [--control-border:1px] not-disabled:hover:bg-fill-destructive-hover not-disabled:active:bg-fill-destructive-active`,p,`focus-visible:border-transparent`,`disabled:bg-fill-destructive-disabled disabled:text-fill-destructive-disabled-foreground aria-disabled:bg-fill-destructive-disabled aria-disabled:text-fill-destructive-disabled-foreground`),"destructive-ghost":a(`border border-transparent bg-transparent text-destructive-foreground [--control-border:1px] not-disabled:hover:bg-destructive-subtle not-disabled:hover:text-destructive-foreground not-disabled:active:bg-destructive-subtle-active`,`disabled:bg-transparent disabled:text-placeholder aria-disabled:bg-transparent aria-disabled:text-placeholder`),ghost:a(`border border-transparent bg-transparent text-muted-foreground [--control-border:1px] not-disabled:hover:bg-fill-subtle not-disabled:hover:text-foreground not-disabled:active:bg-fill`,gc,`disabled:bg-transparent aria-disabled:bg-transparent`),subtle:a(`border-0 bg-fill-hover text-foreground not-disabled:hover:bg-fill-hover not-disabled:active:bg-fill`,_,`disabled:bg-transparent aria-disabled:bg-transparent`),link:a(`border-0 bg-transparent text-muted-foreground not-disabled:hover:text-foreground`,`not-disabled:hover:[&>[data-slot=button-label]]:after:scale-x-100 not-disabled:hover:[&>[data-slot=button-label]]:after:duration-normal`,p,`disabled:text-placeholder aria-disabled:text-placeholder`)},size:{sm:a(bc.sm,mc.sm,xc.sm,`gap-(--control-gap)`,Kc),md:a(bc.md,mc.md,xc.md,`gap-(--control-gap)`,Kc),lg:a(bc.lg,mc.lg,xc.lg,`gap-(--control-gap)`,Kc),"icon-sm":a(yc.sm,`w-control-sm shrink-0 rounded-full`),"icon-md":a(yc.md,`w-control-md shrink-0 rounded-full`),"icon-lg":a(yc.lg,`w-control-lg shrink-0 rounded-full`)}},compoundVariants:[{variant:`link`,className:qc},{variant:`link`,size:[`sm`,`md`,`icon-sm`,`icon-md`],className:`before:-inset-y-1`},{variant:`link`,size:[`lg`,`icon-lg`],className:`before:-inset-y-1.5`}],defaultVariants:{variant:`default`,size:`md`}});function Xc(e){if(e.type===`a`)return!0;let{href:t,to:n}=e.props;return t!==void 0||n!==void 0}function Zc(e){e.preventDefault(),e.stopPropagation()}var Qc={sm:`sm`,md:`md`,lg:`lg`,"icon-sm":`sm`,"icon-md":`md`,"icon-lg":`lg`};function $c(e,t){return e===`link`?`sm`:Qc[t]}function el({size:e,loading:t,children:n}){return(0,w.jsx)(rl,{slot:`button-icon`,size:Qc[e],loading:t,children:n})}function tl(){return(0,w.jsx)(c,{"aria-hidden":!0,"data-slot":`trigger-chevron`,className:`mx-[-0.125em] shrink-0`})}function nl({size:e}){return(0,w.jsx)(rl,{slot:`button-icon-end`,size:Qc[e],children:(0,w.jsx)(tl,{})})}function rl({slot:e,size:t,loading:n,children:r}){if(r||n)return(0,w.jsxs)(hc,{"data-slot":e,"data-loader-slot":n?il(r):void 0,size:t,children:[r,n&&(0,w.jsx)(al,{})]})}function il(e){return e?`replaced`:`added`}function al(){return(0,w.jsx)(k,{"data-slot":`button-loader`,size:`sm`,role:`presentation`,"aria-hidden":!0})}var ol=/(?:hover|active|aria-disabled):/;function sl(e){let t=e.split(` `).filter(e=>!ol.test(e));return a(t,`cursor-default`)}function cl(e){e.preventDefault(),e.stopPropagation()}function ll(e){e.metaKey||e.ctrlKey||((e.key===`Enter`||e.key===` `)&&cl(e),(e.key===`ArrowDown`||e.key===`ArrowUp`)&&e.stopPropagation())}function ul(e){e.stopPropagation()}var dl={disabled:void 0,"aria-busy":!0,"aria-disabled":!0,"data-button-loading":``,onClickCapture:cl,onAuxClickCapture:cl,onDoubleClickCapture:cl,onPointerDownCapture:ul,onMouseDownCapture:ul,onKeyDownCapture:ll,onKeyUpCapture:ll};function fl({variant:e,children:t}){return e===`link`?(0,w.jsx)(`span`,{"data-slot":`button-label`,className:Jc,children:t}):t}function pl(e){return C.Children.toArray(e).flatMap(e=>C.isValidElement(e)&&e.type===C.Fragment?pl(e.props.children):[e])}function ml(e){let t=pl(e);return t.length>0&&t.every(e=>C.isValidElement(e))}function hl(e){return e?.startsWith(`icon-`)??!1}var gl=C.forwardRef(({className:e,render:t,as:n,href:r,to:i,target:o,prefetch:s,size:c,variant:l=`default`,disabled:u,loading:d=!1,children:f,icon:p,iconEnd:m,tooltip:h,tooltipPosition:g,"aria-label":_,type:v,...y},b)=>{let x=l!==`link`&&hl(c),S=c??`md`,T=l??`default`,E=$c(T,S),D=_??((x||ml(f))&&typeof h==`string`?h:void 0),O=d&&!p&&!!m,k=x?(0,w.jsxs)(hc,{size:Qc[S],"data-loader-slot":d?il(f):void 0,children:[f,d&&(0,w.jsx)(al,{})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(rl,{slot:`button-icon`,size:E,loading:d&&!O,children:p}),(0,w.jsx)(fl,{variant:T,children:f}),(0,w.jsx)(rl,{slot:`button-icon-end`,size:E,loading:O,children:m})]}),A=Yc({variant:l,size:S}),j={disabled:u,type:v,"aria-label":D,"data-variant":l,"data-shape":x?`icon`:void 0,className:a(d?sl(A):A,e),...y,...d?dl:void 0},M=t?void 0:n,N={...r===void 0?null:{href:r},...i===void 0?null:{to:i},...o===void 0?null:{target:o},...s===void 0?null:{prefetch:s}},P=T===`link`,F=r??i,I={...F===void 0?null:{href:F},...o===void 0?null:{target:o}},L=C.isValidElement(t)&&Xc(t)?t:P?C.createElement(`a`,I):void 0,R=L?.props,ee=L?.type!==`a`&&R?.href!==void 0?``:void 0,z=R?.to===void 0?void 0:``,te=u&&!d?{...P?null:{href:ee},...P?null:{to:z},"aria-disabled":!0,onClick:Zc,onAuxClick:Zc,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&Zc(e)}}:void 0,ne=M?(0,w.jsx)(M,{ref:b,...N,...j,children:k}):L?C.cloneElement(L,{ref:b,...j,disabled:void 0,type:void 0,...te,className:a(j.className,L.props.className),children:k}):(0,w.jsx)(Gc,{ref:b,render:t,...j,children:k});return h?(0,w.jsxs)(uc,{children:[(0,w.jsx)(dc,{asChild:!0,children:ne}),(0,w.jsx)(fc,{side:g,children:h})]}):ne});gl.displayName=`Button`;var _l=l(`IconCircleInfo`,()=>(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`path`,{d:`M11 11H12V16M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,w.jsx)(`path`,{d:`M12 7.25C11.5858 7.25 11.25 7.58579 11.25 8C11.25 8.41421 11.5858 8.75 12 8.75C12.4142 8.75 12.75 8.41421 12.75 8C12.75 7.58579 12.4142 7.25 12 7.25Z`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:`0.5`})]})),vl=l(`IconExclamationCircle`,()=>(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeWidth:`2`}),(0,w.jsx)(`path`,{d:`M12 8V12.5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,w.jsx)(`circle`,{cx:`12`,cy:`15.7996`,r:`1.2`,fill:`currentColor`})]})),yl=l(`IconLightBulbSimple`,()=>(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`path`,{d:`M12 3C8.13401 3 5 6.13401 5 10C5 12.5463 6.35958 14.7751 8.39241 16C8.75337 16.2175 9 16.5949 9 17.0163V19C9 20.6569 10.3431 22 12 22C13.6569 22 15 20.6569 15 19V17.0163C15 16.5949 15.2466 16.2175 15.6076 16C17.6404 14.7751 19 12.5463 19 10C19 6.13401 15.866 3 12 3Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinejoin:`round`}),(0,w.jsx)(`path`,{d:`M15 18H9`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`square`,strokeLinejoin:`round`})]})),bl=C.createContext(void 0),xl=e=>{let t=C.useContext(bl);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Sl=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,w.jsx)(bl.Provider,{value:e,children:t})),Cl={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},wl=new class{#e=Cl;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Tl(e){setTimeout(e,0)}var El=typeof window>`u`||`Deno`in globalThis;function Dl(){}function Ol(e,t){return typeof e==`function`?e(t):e}function kl(e){return typeof e==`number`&&e>=0&&e!==1/0}function Al(e,t){return Math.max(e+(t||0)-Date.now(),0)}function jl(e,t){return typeof e==`function`?e(t):e}function Ml(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Pl(o,t.options))return!1}else if(!Il(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Nl(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Fl(t.options.mutationKey)!==Fl(a))return!1}else if(!Il(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Pl(e,t){return(t?.queryKeyHashFn||Fl)(e)}function Fl(e){return JSON.stringify(e,(e,t)=>Vl(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Il(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 n=0;n<t.length;n++)if(!Il(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Il(e[r],t[r]))return!1;return!0}return!1}var Ll=Object.prototype.hasOwnProperty;function Rl(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Bl(e)&&Bl(t);if(!r&&!(Vl(e)&&Vl(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Ll.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Rl(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function zl(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!Ll.call(t,n)||e[n]!==t[n])return!1;return!0}function Bl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Vl(e){if(!Hl(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!Hl(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Hl(e){return Object.prototype.toString.call(e)===`[object Object]`}function Ul(e){return new Promise(t=>{wl.setTimeout(t,e)})}function Wl(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Rl(e,t)}function Gl(e){return e}function Kl(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function ql(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var Jl=Symbol();function Yl(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Jl?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Xl(e,t){return typeof e==`function`?e(...t):!!e}var Zl=Symbol();function Ql(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[Zl]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var $l=()=>El,eu=()=>$l(),tu=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(){}},nu=new class extends tu{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ru=Tl;function iu(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ru,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var au=iu(),ou=new class extends tu{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function su(e){return Math.min(1e3*2**e,3e4)}function cu(e){return(e??`online`)!==`online`||ou.isOnline()}var lu=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function uu(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Dl);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new lu(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>nu.isFocused()&&(e.networkMode===`always`||ou.isOnline())&&e.canRun(),p=()=>cu(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(eu()?0:3),a=e.retryDelay??su,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Ul(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var du=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),kl(this.gcTime)&&(this.#e=wl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(eu()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(wl.clearTimeout(this.#e),this.#e=void 0)}};function fu(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{Ql(e,()=>t.signal,()=>n=!0,l[Zl])},d=Yl(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options,c=i?ql:Kl;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?mu:pu,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:pu(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function pu(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function mu(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function hu(e,t){return t?pu(e,t)!=null:!1}function gu(e,t){return!t||!e.getPreviousPageParam?!1:mu(e,t)!=null}var _u=class extends du{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=bu(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=bu(this.options);e.data!==void 0&&(this.setState(yu(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Wl(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Dl).catch(Dl):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>jl(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Jl||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>jl(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Al(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[Zl]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=Yl(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?fu(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=uu({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof lu&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof lu){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...vu(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...yu(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),au.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function vu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cu(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function yu(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function bu(e){let 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 xu=class extends tu{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Cu(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wu(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wu(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof jl(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!zl(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Tu(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||jl(this.options.enabled,this.#t)!==jl(t.enabled,this.#t)||jl(this.options.staleTime,this.#t)!==jl(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||jl(this.options.enabled,this.#t)!==jl(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return zl(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Dl)),t}#h(e){return!eu()&&jl(this.options.enabled,this.#t)!==!1&&kl(e)}#g(){this.#b();let e=jl(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Al(this.#r.dataUpdatedAt,e)+1;this.#u=wl.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return jl(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=wl.setInterval(()=>{(this.options.refetchIntervalInBackground||nu.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(wl.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(wl.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Cu(e,t),o=i&&Tu(e,n,t,r);(a||o)&&(l={...l,...vu(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Wl(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Wl(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Eu(e,t),refetch:this.refetch,isEnabled:jl(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),zl(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();au.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Su(e,t){return jl(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||jl(t.retryOnMount,e)!==!1)}function Cu(e,t){return Su(e,t)||e.state.data!==void 0&&wu(e,t,t.refetchOnMount)}function wu(e,t,n){if(jl(t.enabled,e)!==!1&&jl(t.staleTime,e)!==`static`){let r=jl(n,e);return r===`always`||r!==!1&&Eu(e,t)}return!1}function Tu(e,t,n,r){return(e!==t||jl(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Eu(e,n)}function Eu(e,t){return jl(t.enabled,e)!==!1&&e.isStaleByTime(jl(t.staleTime,e))}var Du=class extends du{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ou(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=uu({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),au.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ou(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ku=class extends tu{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),zl(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Fl(t.mutationKey)!==Fl(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ou();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){au.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Au=C.createContext(!1),ju=()=>C.useContext(Au);Au.Provider;function Mu(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Nu=C.createContext(Mu()),Pu=()=>C.useContext(Nu),Fu=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?Xl(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Iu=e=>{C.useEffect(()=>{e.clearReset()},[e])},Lu=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Xl(n,[e.error,r])),Ru=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},zu=(e,t)=>e?.suspense&&t.isPending,Bu=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Vu(e,t,n){let r=ju(),i=Pu(),a=xl(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ru(o),Fu(o,i,s),Iu(i);let[l]=C.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);C.useEffect(()=>{l.setOptions(o)},[o,l]);let d=!r&&c;if(C.useSyncExternalStore(C.useCallback(e=>{let t=d?l.subscribe(au.batchCalls(e)):Dl;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),zu(o,u))throw Bu(o,l,i);if(Lu({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Hu(e,t){return Vu(e,xu,t)}function Uu(e){return e}function Wu(e,t){let n=xl(t);return Ku({filters:{...e,status:`pending`}},n).length}function Gu(){let e;return(t,n)=>{let r=[],i;return()=>{let a=t.findAll(n.filters),o=a.flatMap(e=>[e,e.state]);return(!i||o.length!==r.length||o.some((e,t)=>!Object.is(e,r[t])))&&(r=o,i=Rl(e,a.map(e=>n.select?n.select(e):e.state)),e=i),i}}}function Ku(e={},t){let n=xl(t).getMutationCache(),[r]=C.useState(()=>Gu()),i=r(n,e);return C.useSyncExternalStore(C.useCallback(e=>n.subscribe(au.batchCalls(e)),[n]),i,i)}function qu(e,t){let n=xl(t),[r]=C.useState(()=>new ku(n,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);let i=C.useSyncExternalStore(C.useCallback(e=>r.subscribe(au.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=C.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Dl)},[r]);if(i.error&&Xl(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ju=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Yu=/^[\\/]{2}/;function Xu(e,t){return t+e.replace(/\\/g,`/`)}var Zu=`popstate`;function Qu(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function $u(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return rd(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:id(t)}return od(t,n,null,e)}function Z(e,t){if(e===!1||e==null)throw Error(t)}function ed(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function td(){return Math.random().toString(36).substring(2,10)}function nd(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function rd(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?ad(t):t,state:n,key:t&&t.key||r||td(),mask:i}}function id({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function ad(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function od(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Qu(e)?e:rd(h.location,e,t);n&&n(r,e),l=u()+1;let d=nd(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Qu(e)?e:rd(h.location,e,t);n&&n(r,e),l=u();let i=nd(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return sd(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Zu,d),c=e,()=>{i.removeEventListener(Zu,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function sd(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),Z(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:id(t);return i=i.replace(/ $/,`%20`),!n&&Yu.test(i)&&(i=r+i),new URL(i,r)}var cd=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},ld=class extends Error{},ud=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function dd(e){return ud.has(e)}var fd=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function pd(e){return fd.has(e)}function md(e){return e.index===!0}function hd(e){let t={};return e.Component&&Object.assign(t,{element:C.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:C.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:C.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function gd(e,t=hd,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(Z(e.index!==!0||!e.children,`Cannot specify children on an index route`),Z(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),md(e)){let n={...e,id:s};return r[s]=_d(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=_d(n,t(n)),e.children&&(n.children=gd(e.children,t,o,r,i)),n}})}function _d(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function vd(e,t,n=`/`){return yd(e,t,n,!1)}function yd(e,t,n,r,i){let a=Vd((typeof t==`string`?ad(t):t).pathname||`/`,n);if(a==null)return null;let o=i??xd(e),s=null,c=Bd(a);for(let e=0;s==null&&e<o.length;++e)s=Id(o[e],c,r);return s}function bd(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function xd(e){let t=Sd(e);return wd(t),t}function Sd(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Z(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Zd([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Z(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Sd(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Pd(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=zd(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Cd(e.path))a(e,t,!0,n)}),t}function Cd(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Cd(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function wd(e){e.sort((e,t)=>e.score===t.score?Fd(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Td=/^:[\w-]+$/,Ed=/^:[\w-]+/,Dd=3.5,Od=3,kd=2,Ad=1,jd=10,Md=-2,Nd=e=>e===`*`;function Pd(e,t){let n=e.split(`/`),r=n.length;return n.some(Nd)&&(r+=Md),t&&(r+=kd),n.filter(e=>!Nd(e)).reduce((e,t)=>e+(Td.test(t)?Od:Ed.test(t)?Dd:t===``?Ad:jd),r)}function Fd(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Id(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Rd(u,l,s.matcher,s.compiledParams):Ld(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ld({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Zd([a,d.pathname]),pathnameBase:$d(Zd([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Zd([a,d.pathnameBase]))}return o}function Ld(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=zd(e.path,e.caseSensitive,e.end);return Rd(e,t,n,r)}function Rd(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Qd(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Qd(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function zd(e,t=!1,n=!0){ed(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/((?:[^/?()[\]*^\\]|\\.)+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Bd(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return ed(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Vd(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Hd({basename:e,pathname:t}){return t===`/`?e:Zd([e,t])}var Ud=e=>Ju.test(e);function Wd(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ad(e):e,a;return n?(n=Xd(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Gd(n.substring(1),`/`):Gd(n,t)):a=t,{pathname:a,search:ef(r),hash:tf(i)}}function Gd(e,t){let n=Qd(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Kd(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function qd(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Jd(e){let t=qd(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Yd(e,t,n,r=!1){let i;typeof e==`string`?i=ad(e):(i={...e},Z(!i.pathname||!i.pathname.includes(`?`),Kd(`?`,`pathname`,`search`,i)),Z(!i.pathname||!i.pathname.includes(`#`),Kd(`#`,`pathname`,`hash`,i)),Z(!i.search||!i.search.includes(`#`),Kd(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Wd(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Xd=e=>e.replace(/[\\/]{2,}/g,`/`),Zd=e=>Xd(e.join(`/`));function Qd(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var $d=e=>Qd(e).replace(/^\/*/,`/`),ef=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,tf=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,nf=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],rf=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function af(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function of(e){return Zd(e.map(e=>e.route.path).filter(Boolean))||`/`}function sf(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?ad(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var cf=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function lf(e,t){let n=e;if(typeof n!=`string`||!Ju.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(cf)try{let e=new URL(window.location.href),r=Yu.test(n)?new URL(Xu(n,e.protocol)):new URL(n),a=Vd(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{ed(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var uf=Symbol(`Uninstrumented`),df=new WeakMap;function ff(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>vf(await yf(n.lazy,void 0,()=>e(...t),bf))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>vf(await yf(n[`lazy.middleware`],void 0,()=>t(...e),bf))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>vf(await yf(n[`lazy.loader`],void 0,()=>t(...e),bf))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>vf(await yf(n[`lazy.action`],void 0,()=>t(...e),bf))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=mf(t.loader),i=async(...t)=>vf(await yf(n.loader,xf(t[0]),()=>e(...t),bf));e.hydrate===!0&&(i.hydrate=!0),hf(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=mf(t.action),i=async(...t)=>vf(await yf(n.action,xf(t[0]),()=>e(...t),bf));hf(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=mf(e),r=async(...e)=>vf(await yf(n.middleware,xf(e[0]),()=>t(...e),bf));return hf(r,t),r})),r}function pf(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=mf(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?id(i):`.`,...Sf(e,a??{})};return vf(await yf(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=gf(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...bf(e),meta:o})))};hf(r,t),e.navigate=r}if(n.fetch.length>0){let t=mf(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return vf(await yf(n.fetch,{href:o??`.`,fetcherKey:i,...Sf(e,s??{})},async()=>{let n=gf(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...bf(e),meta:c})))};hf(r,t),e.fetch=r}return e}function mf(e){return e[uf]??e}function hf(e,t){e[uf]=t}function gf(e,t){return df.set(e,t),()=>{df.get(e)===t&&df.delete(e)}}function _f(e){let t=df.get(e);return df.delete(e),t}function vf(e){if(e.type===`error`)throw e.value;return e.value}async function yf(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=yf(e,t,n,r,i,a-1),await s,Z(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result||(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t)),i.result}function bf(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function xf(e){let{request:t,context:n,params:r}=e;return{...e,request:Cf(t),params:{...r},context:wf(n)}}function Sf(e,t){return{currentUrl:id(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Cf(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function wf(e){return{get:t=>e.get(t)}}var Tf=class{#e=[];#t=[];#n;#r=0;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=xd(e),this.#r=this.#t.reduce((e,t)=>e+t.routesMeta.length,0)}get matchCost(){return this.#r}match(e,t=!1){return yd(this.#e,e,this.#n,t,this.#t)}},Ef=new URL(`http://localhost`);function Df(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ef)}catch{return Ef}}function Of(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function kf(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Af(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Of(i,n),s=!Of(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!kf(e,i)||!Of(i,a)))throw Error(`External navigation is not allowed`)}var jf=[`POST`,`PUT`,`PATCH`,`DELETE`],Mf=new Set(jf),Nf=[`GET`,...jf],Pf=new Set(Nf),Ff=new Set([301,302,303,307,308]),If=new Set([307,308]),Lf={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Rf={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zf={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Bf=`remix-router-transitions`,Vf=Symbol(`ResetLoaderData`);function Hf(e,t){return e.unstable_routePatternMatching?(Z(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new Tf(t)}var Uf=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}},Wf=new WeakMap;function Gf(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;Z(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...ff(t.map(e=>e.route).filter(Boolean),e)})}let o={...e.future},s=e.basename||`/`;s.startsWith(`/`)||(s=`/${s}`);let c=Hf(o,s),l={},u=new Uf(gd(e.routes,a,void 0,l),c),d=e.dataStrategy||cp,f=null,p=new Set,m=null,h=null,g=null,_=e.hydrationData!=null,v=c.match(e.history.location),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Mp(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=jp(u.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Be(v,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Be(null,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>Xf(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=Zf(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:Lf,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=0,D,O=null,k=!1,A,j=!1,M=new Map,N=null,P=!1,F=!1,I=new Set,L=new Map,R=0,ee=-1,z=new Map,te=new Set,ne=new Map,B=new Map,V=new Set,re=new Map,ie,H=null;function ae(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(ie){ie(),ie=void 0;return}ed(re.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=q({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{ie=e});e.history.go(r*-1),Pe(i,{state:`blocked`,location:n,proceed(){Pe(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,zf),G({blockers:e})}}),O?.resolve(),O=null}else return o.unstable_customRouteDiscovery&&(E+=r||0),le(t,n)}),n){rm(t,M);let e=()=>im(t,M);t.addEventListener(`pagehide`,e),N=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||le(`POP`,w.location,{initialHydration:!0}),C}function U(){f&&f(),N&&N(),p.clear(),A&&A.abort(),w.fetchers.forEach((e,t)=>Ee(w.fetchers,t)),w.blockers.forEach((e,t)=>Ne(t))}function W(e){return p.add(e),()=>p.delete(e)}function G(e,t={}){let n=e.errors??null,r=n?Wf.get(n):void 0;r!==void 0&&(n=r),(e.errors!==void 0||e.initialized)&&(w.errors&&Wf.delete(w.errors),e.errors&&Wf.set(e.errors,n)),e.matches&&=e.matches.map(e=>{let t=l[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let i=[],a=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(V.has(t)?i.push(t):a.push(t))}),V.forEach(e=>{!w.fetchers.has(e)&&!L.has(e)&&i.push(e)}),[...p].forEach(e=>e(w,{deletedFetchers:i,newErrors:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),i.forEach(e=>Ee(w.fetchers,e)),a.forEach(e=>w.fetchers.delete(e))}function oe(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&qp(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?Op(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,s=w.blockers;s.size>0&&!P&&(s=new Map(s),s.forEach((e,t)=>s.set(t,zf)));let c=!P&&ze(t,n.matches||w.matches),l=k===!0||w.navigation.formMethod!=null&&qp(w.navigation.formMethod)&&t.state?._isRedirect!==!0;u.commitHmrRoutes(),P||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`&&!P&&t!==w.location){let e=M.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:M.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(j){let e=M.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),M.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}G({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:Lf,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:d,flushSync:r===!0}),se(),O?.resolve(),O=null,H?.resolve(),H=null}function se(){E=0,T=`POP`,k=!1,j=!1,P=!1,F=z.size>0}async function ce(t,n){if(D&&await D,O?.resolve(),O=null,typeof t==`number`){O||=am();let n=O.promise;return e.history.go(t),n}let r=_f(C),{path:i,submission:a,error:o}=Jf(!1,qf(w.location,w.matches,s,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?ad(n.mask):{...w.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},Yu.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),Af(typeof n.mask==`string`?n.mask:id(n.mask),id(c),e.history.createURL(`/`),`reject`)}let l=w.location,u=rd(l,i,n&&n.state,void 0,c);u={...u,...e.history.encodeLocation(u)},Af(t==null?e.history.createHref(w.location):typeof t==`string`?t:id(t),e.history.createHref(u.mask||u),e.history.createURL(`/`),`reject`);let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`,p=w.location.pathname+w.location.search;d===!0?f=`REPLACE`:d===!1||a!=null&&qp(a.formMethod)&&(a.formAction===p||u.pathname+u.search===p)&&(f=`REPLACE`);let m=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,h=(n&&n.flushSync)===!0,g=q({currentLocation:l,nextLocation:u,historyAction:f});g?Pe(g,{state:`blocked`,location:u,proceed(){Pe(g,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),ce(t,n)},reset(){let e=new Map(w.blockers);e.set(g,zf),G({blockers:e})}}):await le(f,u,{submission:a,pendingError:o,preventScrollReset:m,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:h,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function K(){if(D)return D.then(K);H||=am(),xe(),G({revalidation:`loading`});let e=H.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(le(w.historyAction,w.location,{startUninterruptedRevalidation:!0,dataStrategyInitiator:`revalidation`}),e):(le(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,dataStrategyInitiator:`revalidation`,enableViewTransition:j===!0}),e)}async function le(t,n,r){D&&await D,A&&A.abort(),A=null,T=t,P=(r&&r.startUninterruptedRevalidation)===!0,Re(w.location,w.matches),k=(r&&r.preventScrollReset)===!0,j=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:c.match(n),a=(r&&r.flushSync)===!0;if(i&&w.initialized&&!F&&Fp(w.location,n)&&!(r&&r.submission&&qp(r.submission.formMethod))){oe(n,{matches:i},{flushSync:a});return}let o=Be(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=Xp(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=Fe(n.pathname);oe(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;A=new AbortController;let l=Cp(e.history,n,A.signal,r&&r.submission),u=r?.initialHydration?`initialization`:r?.dataStrategyInitiator??`navigation`,d=e.getContext?await e.getContext():new cd,f;if(r&&r.pendingError)f=[Ap(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&qp(r.submission.formMethod)){let c=await de(l,u,n,r.submission,i,t,d,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(c.shortCircuited)return;if(c.pendingActionResult){let[e,t]=c.pendingActionResult;if(Bp(t)&&af(t.error)&&t.error.status===404){A=null,oe(n,{matches:c.matches,loaderData:{},errors:{[e]:t.error}});return}}i=c.matches||i,f=c.pendingActionResult,s=Qp(n,i,t,r.submission),a=!1,o.active=!1,l=Cp(e.history,l.url,l.signal)}let{shortCircuited:p,matches:m,loaderData:h,errors:g,workingFetchers:_}=await fe(l,u,n,i,t,d,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,f,r&&r.callSiteDefaultShouldRevalidate);p||(A=null,oe(n,{matches:m||i,...kp(f),loaderData:h,errors:g,..._?{fetchers:_}:{}}))}function ue(){let t=am();D=t.promise;let n=E,r=O;O=null,A?.abort(),A=null,se(),H?.resolve(),H=null;let i=new Map(w.blockers);i.forEach((e,t)=>{e.state===`proceeding`&&i.set(t,zf)});let a=new Map(w.fetchers),o=Ae(a);a.forEach((e,t)=>{e.state===`loading`&&!L.has(t)&&(a.set(t,nm(e.data)),o=!0)}),I.clear(),G({navigation:Lf,revalidation:`idle`,blockers:i,...o?{fetchers:a}:{}});function s(){D=void 0,r?.resolve(),t.resolve()}return n?(ie=s,e.history.go(-n)):s(),t.promise}async function de(t,n,i,c,d,f,p,m,h,g={}){if(o.unstable_customRouteDiscovery||xe(),G({navigation:$p(i,d,f,c)},{flushSync:g.flushSync===!0}),m){let e=await Ve(d,i.pathname,t.signal);if(o.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await ue(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=jp(u.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Ap(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)d=e.matches;else{let{notFoundMatches:e,error:t,route:n}=Fe(i.pathname);return{matches:e,pendingActionResult:[n.id,{type:`error`,error:t}]}}}o.unstable_customRouteDiscovery&&xe();let _,v=Yp(d,i);if(!v.route.action&&!v.route.lazy)_={type:`error`,error:Mp(405,{method:t.method,pathname:i.pathname,routeId:v.route.id})};else{let e=await ye(t,i,mp(a,l,t,i,d,v,h?[]:r,p),p,null,n,f);if(_=e[v.route.id],!_){for(let t of d)if(e[t.route.id]){_=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Vp(_)){let r;return r=g&&g.replace!=null?g.replace:Sp(_.response.headers.get(`Location`),new URL(t.url),s,e.history)===w.location.pathname+w.location.search,await ve(t,_,!0,n,{submission:c,replace:r}),{shortCircuited:!0}}if(Bp(_)){let e=Ap(d,v.route.id);return(g&&g.replace)!==!0&&(T=`PUSH`),{matches:d,pendingActionResult:[e.route.id,_,v.route.id]}}return{matches:d,pendingActionResult:[v.route.id,_]}}async function fe(t,n,i,s,d,f,p,m,h,g,_,v,y,b,x){let S=m||Qp(i,s,d,h),C=h||g||Zp(S),T=!P&&!v;if(p){if(T){let e=pe(b);G({navigation:S,...e===void 0?{}:{actionData:e}},{flushSync:y})}let e=await Ve(s,i.pathname,t.signal);if(o.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await ue(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=jp(u.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Ap(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)s=e.matches,v&&!t.signal.aborted&&G({matches:s});else{let{error:e,notFoundMatches:t,route:n}=Fe(i.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}}let{dsMatches:E,revalidatingFetchers:D}=Yf(t,f,a,l,e.history,w,s,C,i,v?[]:r,v===!0,F,I,V,ne,te,c,b,x);if(ee=++R,!e.dataStrategy&&!E.some(e=>e.shouldLoad)&&!E.some(e=>e.route.middleware&&e.route.middleware.length>0)&&D.length===0){let e=new Map(w.fetchers),t=Ae(e);return oe(i,{matches:s,loaderData:{},errors:b&&Bp(b[1])?{[b[0]]:b[1].error}:null,...kp(b),...t?{fetchers:e}:{}},{flushSync:y}),{shortCircuited:!0}}if(T){let e={};if(!p){e.navigation=S;let t=pe(b);t!==void 0&&(e.actionData=t)}D.length>0&&(e.fetchers=me(D)),G(e,{flushSync:y})}D.forEach(e=>{Oe(e.key),e.controller&&L.set(e.key,e.controller)});let O=()=>D.forEach(e=>{L.get(e.key)===e.controller&&Oe(e.key)});A&&A.signal.addEventListener(`abort`,O);let{loaderResults:k,fetcherResults:j}=await be(E,D,t,i,f,n,d);if(t.signal.aborted)return{shortCircuited:!0};A&&A.signal.removeEventListener(`abort`,O),D.forEach(e=>{L.get(e.key)===e.controller&&L.delete(e.key)});let M=Np(k);if(M)return await ve(t,M.result,!0,n,{replace:_}),{shortCircuited:!0};if(M=Np(j),M)return te.add(M.key),await ve(t,M.result,!0,n,{replace:_}),{shortCircuited:!0};let N=new Map(w.fetchers),{loaderData:z,errors:B}=Dp(w,s,k,b,D,j,N);if(v&&w.errors){let e=B??null;B={...w.errors,...B},Wf.set(B,e)}let re=Ae(N),ie=je(ee,N),H=re||ie||D.length>0;return{matches:s,loaderData:z,errors:B,...H?{workingFetchers:N}:{}}}function pe(e){if(e&&!Bp(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function me(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=em(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function he(t,n,r,i){D&&await D,Oe(t);let a=(i&&i.flushSync)===!0,o=_f(C),l=qf(w.location,w.matches,s,r,n,i?.relative),u=c.match(l),d=Be(u,l);if(d.active&&d.matches&&(u=d.matches),o&&o(Xp(e.history,l,u)),!u){Ce(t,n,Mp(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=Jf(!0,l,i);if(m){Ce(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new cd,g=(i&&i.preventScrollReset)===!0;if(p&&qp(p.formMethod)){await ge(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:d.active};ne.set(t,_),await _e(t,_,u,h,a,g,p)}async function ge(t,n,i,s,u,d,f,p,m,h){o.unstable_customRouteDiscovery||xe(),ne.delete(t);let g=w.fetchers.get(t);Se(t,tm(m,g),{flushSync:f});let _=new AbortController;o.unstable_customRouteDiscovery&&L.set(t,_);let v=Cp(e.history,i,_.signal,m);if(d){let e=await Ve(s,new URL(v.url).pathname,v.signal,t);if(o.unstable_customRouteDiscovery&&v.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){L.delete(t),ne.delete(t),Se(t,nm(g?.data),{flushSync:f});return}if(e.type===`error`){Ce(t,n,e.error,{flushSync:f});return}if(e.matches)s=e.matches;else{Ce(t,n,Mp(404,{pathname:i}),{flushSync:f});return}}let y=Yp(s,i);if(!y.route.action&&!y.route.lazy){Ce(t,n,Mp(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}o.unstable_customRouteDiscovery&&xe(),L.set(t,_);let b=R,x=mp(a,l,v,i,s,y,r,u),S=await ye(v,i,x,u,t,`fetcher`),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){L.get(t)===_&&L.delete(t);return}if(V.has(t)){if(Bp(C)){Se(t,nm(void 0));return}Vp(C)&&(F=!0,C={type:`data`,data:void 0})}else{if(Vp(C)){if(ee>b)F=!0,C={type:`data`,data:void 0};else return L.delete(t),te.add(t),Se(t,em(m)),ve(v,C,!1,`fetcher`,{fetcherSubmission:m,preventScrollReset:p})}if(Bp(C)){Ce(t,n,C.error);return}}F=!0;let E=w.navigation.location||w.location,D=Cp(e.history,E,_.signal),O=w.navigation.state===`idle`?w.matches:c.match(w.navigation.location);Z(O,`Didn't find any matches after fetcher action`);let k=++R;z.set(t,k);let{dsMatches:j,revalidatingFetchers:M}=Yf(D,u,a,l,e.history,w,O,m,E,r,!1,F,I,V,ne,te,c,[y.route.id,C],h),N=em(m,C.data),P=new Map(w.fetchers);P.set(t,N),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=P.get(t),r=em(void 0,n?n.data:void 0);P.set(t,r),Oe(t),e.controller&&L.set(t,e.controller)}),G({fetchers:P});let B=()=>M.forEach(e=>{L.get(e.key)===e.controller&&Oe(e.key)});_.signal.addEventListener(`abort`,B);let{loaderResults:re,fetcherResults:ie}=await be(j,M,D,E,u,`fetcher`);if(_.signal.aborted){z.get(t)===k&&z.delete(t);return}_.signal.removeEventListener(`abort`,B),z.delete(t),L.delete(t),M.forEach(e=>{L.get(e.key)===e.controller&&L.delete(e.key)});let H=w.fetchers.has(t),ae=e=>{if(!H)return e;let n=new Map(e.fetchers);return n.set(t,nm(C.data)),{...e,fetchers:n}},U=Np(re);if(U)return w=ae(w),ve(D,U.result,!1,`fetcher`,{preventScrollReset:p});if(U=Np(ie),U)return te.add(U.key),w=ae(w),ve(D,U.result,!1,`fetcher`,{preventScrollReset:p});let W=new Map(w.fetchers);H&&W.set(t,nm(C.data));let{loaderData:se,errors:ce}=Dp(w,O,re,void 0,M,ie,W);je(k,W),w.navigation.state===`loading`&&k>ee?(Z(T,`Expected pending action`),A&&A.abort(),Ae(W),oe(w.navigation.location,{matches:O,loaderData:se,errors:ce,fetchers:W})):(G({errors:ce,loaderData:Op(w.loaderData,se,O,ce),fetchers:W}),F=z.size>0)}async function _e(t,n,i,s,c,u,d){let{routeId:f,path:p}=n,m=w.fetchers.get(t);Se(t,em(d,m?m.data:void 0),{flushSync:c});let h=new AbortController;o.unstable_customRouteDiscovery&&L.set(t,h);let g=Cp(e.history,p,h.signal);if(n.isDiscovering){let e=await Ve(i,new URL(g.url).pathname,g.signal,t);if(o.unstable_customRouteDiscovery&&g.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){L.delete(t),ne.delete(t),Se(t,nm(m?.data),{flushSync:c});return}if(e.type===`error`){Ce(t,f,e.error,{flushSync:c});return}if(e.matches)i=e.matches,n.isDiscovering=!1;else{Ce(t,f,Mp(404,{pathname:p}),{flushSync:c});return}}let _=Yp(i,p);L.set(t,h);let v=R,y=await ye(g,p,mp(a,l,g,p,i,_,r,s),s,t,`fetcher`),b=y[_.route.id];if(!b){for(let e of i)if(y[e.route.id]){b=y[e.route.id];break}}if(L.get(t)===h&&L.delete(t),!g.signal.aborted){if(V.has(t))Se(t,nm(void 0));else{if(Vp(b)){if(ee>v){Se(t,nm(void 0));return}te.add(t),await ve(g,b,!1,`fetcher`,{preventScrollReset:u});return}Bp(b)?Ce(t,f,b.error):Se(t,nm(b.data))}}}async function ve(r,i,a,o,{submission:c,fetcherSubmission:l,preventScrollReset:u,replace:d}={}){a||(O?.resolve(),O=null),i.response.headers.has(`X-Remix-Revalidate`)&&(F=!0);let f=i.response.headers.get(`Location`);Z(f,`Expected a Location header on the redirect Response`);let p=f,m=new URL(r.url);f=Sp(f,m,s,e.history),Af(p,f,m,`allow-explicit`);let h=rd(w.location,f,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Ud(f)){let n=sd(t,f,!0);e=n.origin!==t.location.origin||Vd(n.pathname,s)==null}if(e){d?t.location.replace(f):t.location.assign(f);return}}A=null;let g=d===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:_,formAction:v,formEncType:y}=w.navigation;!c&&!l&&_&&v&&y&&(c=Zp(w.navigation));let b=c||l;If.has(i.response.status)&&b&&qp(b.formMethod)?await le(g,h,{submission:{...b,formAction:f},preventScrollReset:u||k,enableViewTransition:a?j:void 0,dataStrategyInitiator:o}):await le(g,h,{overrideNavigation:Qp(h,[],g,c),fetcherSubmission:l,preventScrollReset:u||k,enableViewTransition:a?j:void 0,dataStrategyInitiator:o})}async function ye(e,t,n,r,i,a,o=null){let c,l={};try{c=await hp(d,e,t,n,i,a,r,!1,o)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{l[t.route.id]={type:`error`,error:e}}),l}if(e.signal.aborted)return l;if(!qp(e.method))for(let e of n){if(c[e.route.id]?.type===`error`)break;c.hasOwnProperty(e.route.id)||w.loaderData.hasOwnProperty(e.route.id)||w.errors&&w.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(c[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(c))if(zp(r)){let i=r.result;l[t]={type:`redirect`,response:yp(i,e,t,n,s)}}else l[t]=await vp(r);return l}async function be(e,t,n,r,i,a,o=null){let s=ye(n,r,e,i,null,a,o),c=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ye(e.request,e.path,e.matches,i,e.key,a,o))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:Mp(404,{pathname:e.path})}})}));return{loaderResults:await s,fetcherResults:(await c).reduce((e,t)=>Object.assign(e,t),{})}}function xe(){F=!0,ne.forEach((e,t)=>{o.unstable_customRouteDiscovery&&e.isDiscovering||(L.has(t)&&I.add(t),Oe(t))})}function Se(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),G({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Ce(e,t,n,r={}){let i=Ap(w.matches,t),a=new Map(w.fetchers);Ee(a,e),G({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function we(e){return B.set(e,(B.get(e)||0)+1),V.has(e)&&V.delete(e),w.fetchers.get(e)||Rf}function Te(e,t){Oe(e,t?.reason),ne.delete(e),I.delete(e),Se(e,nm(null))}function Ee(e,t){let n=w.fetchers.get(t);L.has(t)&&!(n&&n.state===`loading`&&z.has(t))&&Oe(t),ne.delete(t),z.delete(t),te.delete(t),V.delete(t),I.delete(t),e.delete(t)}function De(e){let t=(B.get(e)||0)-1;t<=0?(B.delete(e),V.add(e)):B.set(e,t),G({fetchers:new Map(w.fetchers)})}function Oe(e,t){let n=L.get(e);n&&(n.abort(t),L.delete(e))}function ke(e,t){for(let n of e){let e=t.get(n);Z(e,`Expected fetcher: ${n}`);let r=nm(e.data);t.set(n,r)}}function Ae(e){let t=[],n=!1;for(let r of te){let i=e.get(r);Z(i,`Expected fetcher: ${r}`),i.state===`loading`&&(te.delete(r),t.push(r),n=!0)}return ke(t,e),n}function je(e,t){let n=[];for(let[r,i]of z)if(i<e){let e=t.get(r);Z(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Oe(r),z.delete(r),n.push(r))}return ke(n,t),n.length>0}function Me(e,t){let n=w.blockers.get(e)||zf;return re.get(e)!==t&&re.set(e,t),n}function Ne(e){w.blockers.delete(e),re.delete(e)}function Pe(e,t){let n=w.blockers.get(e)||zf;Z(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),G({blockers:r})}function q({currentLocation:e,nextLocation:t,historyAction:n}){if(re.size===0)return;re.size>1&&ed(!1,`A router only supports one blocker at a time`);let r=Array.from(re.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Fe(e){let t=Mp(404,{pathname:e}),n=u.activeRoutes,{matches:r,route:i}=jp(n);return{notFoundMatches:r,route:i,error:t}}function Ie(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===Lf){_=!0;let e=ze(w.location,w.matches);e!=null&&G({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Le(e,t){return h&&h(e,t.map(e=>bd(e,w.loaderData)))||e.key}function Re(e,t){if(m&&g){let n=Le(e,t);m[n]=g()}}function ze(e,t){if(m){let n=Le(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Be(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:c.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:c.match(n,!0)}}return{active:!1,matches:null}}async function Ve(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let s=t;for(;;){let t=l;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:s,fetcherKey:i,patch:(e,n)=>{r.aborted||tp(e,n,u,t,a,!1)}})}catch(e){if(o.unstable_customRouteDiscovery){if(r.aborted)return{type:`aborted`};if(e instanceof ld)return{type:`cancelled`}}return{type:`error`,error:e,partialMatches:s}}if(r.aborted)return{type:`aborted`};let d=c.match(n),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=c.match(n,!0),!(f&&s.length<f.length&&He(s,f.slice(0,s.length))))))return{type:`success`,matches:d};if(f||=c.match(n,!0),!f||He(s,f))return{type:`success`,matches:null};s=f}}function He(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Ue(e){l={},u.setHmrRoutes(gd(e,a,void 0,l))}function We(e,t,n=!1){tp(e,t,u,l,a,n),u.hasHMRRoutes||G({})}return C={get basename(){return s},get future(){return o},get state(){return w},get routes(){return u.stableRoutes},match(e){return c.match(e)},get manifest(){return l},get window(){return t},initialize:ae,subscribe:W,enableScrollRestoration:Ie,navigate:ce,fetch:he,revalidate:K,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:we,resetFetcher:Te,deleteFetcher:De,dispose:U,getBlocker:Me,deleteBlocker:Ne,patchRoutes:We,_internalFetchControllers:L,_internalSetRoutes:Ue,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){G(e)}},e.instrumentations&&(C=pf(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Kf(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function qf(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Yd(r||`.`,Jd(o),Vd(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Jp(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=Hd({basename:n,pathname:c.pathname})),id(c)}function Jf(e,t,n){if(!n||!Kf(n))return{path:t};if(n.formMethod&&!Kp(n.formMethod))return{path:t,error:Mp(405,{method:n.formMethod})};let r=()=>({path:t,error:Mp(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Pp(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!qp(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!qp(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}Z(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=wp(n.formData),s=n.formData;else if(n.body instanceof FormData)o=wp(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Tp(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Tp(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(qp(c.formMethod))return{path:t,submission:c};let l=ad(t);return e&&l.search&&Jp(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:id(l),submission:c}}function Yf(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?Bp(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&Bp(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=of(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!Xf(s))f=!1;else if(u){let{shouldLoad:e}=Zf(s,a.loaderData,a.errors);f=e}else Qf(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return pp(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?$f(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return pp(n,r,e,c,E,i,l,t,ep(i,m),m,v)}),O=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){O.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=Yp(_,e.path),b=new AbortController,x=Cp(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=mp(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=mp(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};ep(y,a)&&(S=mp(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function Xf(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Zf(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Xf(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Qf(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function $f(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function ep(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function tp(e,t,n,r,i,a){let o;if(e){let t=r[e];Z(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>np(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=gd(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=gd([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function np(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>np(e,t)))??!1}var rp=new WeakMap,ip=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(Z(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=rp.get(i);o||(o={},rp.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=dd(e),n=i[e]!==void 0;if(t)ed(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)ed(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c.catch(()=>{o[e]===c&&delete o[e]}),c},ap=new WeakMap;function op(e,t,n,r,i){let a=n[e.id];if(Z(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=ap.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{Z(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=pd(e),o=a[e]!==void 0;i?ed(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?ed(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return ap.set(a,n),n.catch(()=>{ap.get(a)===n&&ap.delete(a)}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=ip({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function sp(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function cp(e){return e.matches.some(e=>e.route.middleware)?lp(e,()=>sp(e)):sp(e)}function lp(e,t){return up(e,t,e=>{if(Gp(e))throw e;return e},Lp,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[Ap(r,a).route.id]:{type:`error`,result:t}}}}}async function up(e,t,n,r,i){let{matches:a,...o}=e;return await dp(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function dp(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await dp(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function fp(e,t,n,r,i){let a=ip({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=op(r.route,qp(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function pp(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=fp(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?ep(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?ep(a,{...l,defaultShouldRevalidate:e}):ep(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!qp(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(qp(n.method)||!p)?gp({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function mp(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?pp(e,t,n,r,of(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:fp(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function hp(e,t,n,r,i,a,o,s,c=null){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let l={request:t,url:sf(t,n),pattern:of(r),params:r[0].params,context:o,matches:r,unstable_initiator:a,unstable_navigationType:a===`navigation`?c:null},u=s?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=l;return lp(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},d=await e({...l,fetcherKey:i,runClientMiddleware:u});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return d}async function gp({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=qp(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:sf(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw Mp(405,{method:e.method,pathname:n,routeId:r.route.id})}else return await a,{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw Mp(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function _p(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function vp(e){let{result:t,type:n}=e;if(Up(t)){let e;try{e=await _p(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new rf(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Hp(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Ip(t),statusCode:af(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:af(t)?t.status:void 0}:Hp(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function yp(e,t,n,r,i){let a=e.headers.get(`Location`);if(Z(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Ud(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=qf(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var bp=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function xp(e){try{return bp.includes(new URL(e).protocol)}catch{return!1}}function Sp(e,t,n,r){if(Ud(e)){let r=e,i=Yu.test(r)?new URL(Xu(r,t.protocol)):new URL(r);if(xp(i.toString()))throw Error(`Invalid redirect location`);let a=Vd(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Xd(i.pathname)+i.search+i.hash}try{if(xp(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Cp(e,t,n,r){let i=e.createURL(Pp(t)).toString(),a={signal:n};if(r&&qp(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?wp(r.formData):r.formData}return new Request(i,a)}function wp(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Tp(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Ep(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Bp(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(Z(!Vp(f),`Cannot handle redirect results in processLoaderData`),Bp(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Ap(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Vf),c||(c=!0,s=af(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Dp(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Ep(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,routeId:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(Z(s,`Did not find corresponding fetcher result`),Bp(s)){let t=Ap(e.matches,r);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Vp(s))Z(!1,`Unhandled fetcher revalidation redirect`);else{let e=nm(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Op(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Vf).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function kp(e){return e?Bp(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ap(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function jp(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function Mp(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new rf(e||500,o,Error(s),!0)}function Np(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Vp(r))return{key:n,result:r}}}function Pp(e){return id({...typeof e==`string`?ad(e):e,hash:``})}function Fp(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Ip(e){return new rf(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Lp(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Rp(t))}function Rp(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function zp(e){return Up(e.result)&&Ff.has(e.result.status)}function Bp(e){return e.type===`error`}function Vp(e){return(e&&e.type)===`redirect`}function Hp(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Up(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Wp(e){return Ff.has(e)}function Gp(e){return Up(e)&&Wp(e.status)&&e.headers.has(`Location`)}function Kp(e){return Pf.has(e.toUpperCase())}function qp(e){return Mf.has(e.toUpperCase())}function Jp(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Yp(e,t){let n=typeof t==`string`?ad(t).search:t.search;if(e[e.length-1].route.index&&Jp(n||``))return e[e.length-1];let r=qd(e);return r[r.length-1]}function Xp(e,t,n){return{url:sf(e.createURL(t),t),pattern:n?of(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function Zp(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Qp(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function $p(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function em(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function tm(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function nm(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function rm(e,t){try{let n=e.sessionStorage.getItem(Bf);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function im(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Bf,JSON.stringify(n))}catch(e){ed(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function am(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var om=C.createContext(null);om.displayName=`DataRouter`;var sm=C.createContext(null);sm.displayName=`DataRouterState`;var cm=C.createContext(null);cm.displayName=`DataRouterData`;var lm=C.createContext(null);lm.displayName=`DataRouterNavigation`;var um=C.createContext(!1);function dm(){return C.useContext(um)}var fm=C.createContext({isTransitioning:!1});fm.displayName=`ViewTransition`;var pm=C.createContext(null);pm.displayName=`Fetchers`;var mm=C.createContext(null);mm.displayName=`Await`;var hm=C.createContext(null);hm.displayName=`Navigation`;var gm=C.createContext(null);gm.displayName=`Location`;var _m=C.createContext({outlet:null,matches:[],isDataRoute:!1});_m.displayName=`Route`;var vm=C.createContext(!1);vm.displayName=`IsDataRoute`;var ym=C.createContext(void 0);ym.displayName=`RouteId`;var bm=C.createContext(null);bm.displayName=`RouteError`;var xm=`REACT_ROUTER_ERROR`,Sm=`REDIRECT`,Cm=`ROUTE_ERROR_RESPONSE`;function wm(e){if(e.startsWith(`${xm}:${Sm}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Tm(e){if(e.startsWith(`${xm}:${Cm}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new rf(t.status,t.statusText,t.data)}catch{}}function Em(e,{relative:t}={}){Z(Dm(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=C.useContext(hm),{hash:i,pathname:a,search:o}=Im(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Zd([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Dm(){return C.useContext(gm)!=null}function Om(){return Z(Dm(),`useLocation() may be used only in the context of a <Router> component.`),C.useContext(gm).location}function km(e){Z(Dm(),`useMatch() may be used only in the context of a <Router> component.`);let{pathname:t}=Om();return C.useMemo(()=>Ld(e,Bd(t)),[t,e])}var Am=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function jm(){return C.useContext(vm)?nh():Mm()}function Mm(){Z(Dm(),`useNavigate() may be used only in the context of a <Router> component.`);let e=C.useContext(om),{basename:t,navigator:n}=C.useContext(hm),{matches:r}=C.useContext(_m),{pathname:i}=Om(),a=JSON.stringify(Jd(r)),o=C.useRef(!1);return C.useLayoutEffect(()=>{o.current=!0}),C.useCallback((r,s={})=>{if(ed(o.current,Am),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Yd(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Zd([t,c.pathname])),Af(typeof r==`string`?r:id(r),n.createHref(c),Df(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Nm=C.createContext(null);function Pm(e){let t=C.useContext(_m).outlet;return C.useMemo(()=>t&&C.createElement(Nm.Provider,{value:e},t),[t,e])}function Fm(){let{matches:e}=C.useContext(_m);return e[e.length-1]?.params??{}}function Im(e,{relative:t}={}){let{matches:n}=C.useContext(_m),{pathname:r}=Om(),i=JSON.stringify(Jd(n));return C.useMemo(()=>Yd(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Lm(e,t,n){Z(Dm(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=C.useContext(hm),{matches:i}=C.useContext(_m),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=Om(),l;if(t){let e=typeof t==`string`?ad(t):t;Z(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f;f=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):vd(e,{pathname:d});let p=Wm(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Zd([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:Zd([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?C.createElement(gm.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function Rm(){let e=$m(),t=af(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return C.createElement(C.Fragment,null,C.createElement(`h2`,null,`Unexpected Application Error!`),C.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?C.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var zm=C.createElement(Rm,null),Bm=class extends C.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=um;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Tm(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:C.createElement(_m.Provider,{value:this.props.routeContext},C.createElement(vm.Provider,{value:this.props.routeContext.isDataRoute},C.createElement(ym.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},C.createElement(bm.Provider,{value:e,children:this.props.component}))));return this.context?C.createElement(Hm,{error:e},t):t}},Vm=new WeakMap;function Hm({children:e,error:t}){let{basename:n,navigator:r}=C.useContext(hm);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=wm(t.digest);if(e){let i=Vm.get(t);if(i)throw i;let a=lf(e.location,n),o=a.absoluteURL||a.to;if(Af(e.location,o,Df(r),`allow-explicit`),xp(o))throw Error(`Invalid redirect location`);if(cf&&!Vm.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Vm.set(t,n),n}}return C.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Um({routeContext:e,match:t,children:n}){let r=C.useContext(om);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),C.createElement(_m.Provider,{value:e},C.createElement(vm.Provider,{value:e.isDataRoute},C.createElement(ym.Provider,{value:t.route.id},n)))}function Wm(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);Z(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:of(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||zm,o&&(s<0&&c===0?(ih(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?C.createElement(n.route.Component,null):n.route.element?n.route.element:e,C.createElement(Um,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?C.createElement(Bm,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Gm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Km(e){let t=C.useContext(om);return Z(t,Gm(e)),t}function qm(e){let t=C.useContext(sm);return Z(t,Gm(e)),t}function Jm(e){let t=C.useContext(cm);return Z(t,Gm(e)),t}function Ym(e){let t=C.useContext(lm);return Z(t,Gm(e)),t}function Xm(e){let t=C.useContext(ym);return Z(t,`${e} can only be used on routes that contain a unique "id"`),t}function Zm(){let{navigation:e}=Ym(`useNavigation`);return C.useMemo(()=>{let{matches:t,historyAction:n,...r}=e;return r},[e])}function Qm(){let{matches:e}=qm(`useMatches`),{loaderData:t}=Jm(`useMatches`);return C.useMemo(()=>e.map(e=>bd(e,t)),[e,t])}function $m(){let e=C.useContext(bm),t=Jm(`useRouteError`),n=Xm(`useRouteError`);return e===void 0?t.errors?.[n]:e}var eh=0;function th(e){let{router:t,basename:n}=Km(`useBlocker`),r=qm(`useBlocker`),[i,a]=C.useState(``),o=C.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:Vd(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:Vd(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return C.useEffect(()=>{let e=String(++eh);return a(e),()=>t.deleteBlocker(e)},[t]),C.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):zf}function nh(){let{router:e}=Km(`useNavigate`),t=Xm(`useNavigate`),n=C.useRef(!1);return C.useLayoutEffect(()=>{n.current=!0}),C.useCallback(async(r,i={})=>{ed(n.current,Am),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var rh={};function ih(e,t,n){!t&&!rh[e]&&(rh[e]=!0,ed(!1,n))}function ah(e,t){if(e===!1||e==null)throw Error(t)}var oh={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},sh=/[&><\u2028\u2029]/g;function ch(e){return e.replace(sh,e=>oh[e])}function lh(e,t,n){let r=typeof e==`string`?new URL(e,n??(typeof window>`u`?`server://singlefetch/`:window.location.origin)):new URL(e);return n&&r.origin!==n&&(r=new URL(r.pathname+r.search+r.hash,n)),r.pathname.endsWith(`/`)?r.pathname=`${r.pathname}_.${t}`:r.pathname=`${r.pathname}.${t}`,r}async function uh(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dh(e){return e!=null&&typeof e.page==`string`}function fh(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function ph(e,t,n){return vh((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await uh(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(fh).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function mh(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function hh(e,t,{includeHydrateFallback:n}={}){return gh(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function gh(e){return[...new Set(e)]}function _h(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function vh(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!dh(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(_h(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var yh={};function bh(e,t){!e&&!yh[t]&&(yh[t]=!0,console.warn(t))}var xh=C.createContext(void 0);xh.displayName=`FrameworkContext`;function Sh(){let e=C.useContext(xh);return ah(e,`You must render this element inside a <HydratedRouter> element`),e}function Ch(e,t){let n=C.useContext(xh),[r,i]=C.useState(!1),[a,o]=C.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=C.useRef(null);C.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),C.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:wh(s,p),onBlur:wh(c,m),onMouseEnter:wh(l,p),onMouseLeave:wh(u,m),onTouchStart:wh(d,p)}]:[a,f,{}]:[!1,f,{}]}function wh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Th({page:e,...t}){let n=dm(),{nonce:r}=Sh(),{router:i}=Km(`PrefetchPageLinks`),a=C.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?C.createElement(Dh,{page:e,matches:a,...t}):C.createElement(Oh,{page:e,matches:a,...t})):null}function Eh(e){let{manifest:t,routeModules:n}=Sh(),[r,i]=C.useState([]);return C.useEffect(()=>{let r=!1;return ph(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Dh({page:e,matches:t,...n}){let r=Om(),{unstable_apiServerOrigin:i}=Sh(),a=C.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=lh(e,`rsc`,i),a=!1,o=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?a=!0:o.push(e.route.id);return a&&o.length>0&&n.searchParams.set(`_routes`,o.join(`,`)),[i?n.toString():n.pathname+n.search]},[e,r,t,i]);return C.createElement(C.Fragment,null,a.map(e=>C.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Oh({page:e,matches:t,...n}){let r=Om(),{manifest:i,routeModules:a,unstable_apiServerOrigin:o}=Sh(),{matches:s}=qm(`PrefetchPageLinks`),{loaderData:c}=Jm(`PrefetchPageLinks`),l=C.useMemo(()=>mh(e,t,s,i,r,`data`),[e,t,s,i,r]),u=C.useMemo(()=>mh(e,t,s,i,r,`assets`),[e,t,s,i,r]),d=C.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!l.some(t=>t.route.id===e.route.id)&&e.route.id in c&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let u=lh(e,`data`,o);return s&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[o?u.toString():u.pathname+u.search]},[c,r,i,l,t,e,a,o]),f=C.useMemo(()=>hh(u,i),[u,i]),p=Eh(u);return C.createElement(C.Fragment,null,d.map(e=>C.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),f.map(e=>C.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),p.map(({key:e,link:t})=>C.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function kh(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Ah=[`HydrateFallback`,`hydrateFallbackElement`],jh=class{status=`pending`;promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Mh(e,t){e.ready.catch(e=>{if(!(t.visibilityState===`hidden`||typeof e==`object`&&e&&`name`in e&&e.name===`AbortError`))throw e})}function Nh({router:e,flushSync:t,onError:n,useTransitions:r}){r=dm()||r;let[i,a]=C.useState(e.state),[o,s]=(0,C.useOptimistic)(i),c=C.useRef(o),[l,u]=C.useState(),[d,f]=C.useState({isTransitioning:!1}),[p,m]=C.useState(),[h,g]=C.useState(),[_,v]=C.useState(),y=C.useRef(new Map),b=C.useRef(new WeakSet),x=C.useCallback((i,{deletedFetchers:o,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{c.current=i,l&&i.errors&&Wf.has(i.errors)&&(b.current.has(i.errors)?l=null:b.current.add(i.errors)),l&&n&&Object.values(l).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:of(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),bh(d===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let x=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(bh(_==null||x,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!x)t&&d?t(()=>a(i)):r===!1?a(i):C.startTransition(()=>{r===!0&&s(e=>Ph(e,i)),a(i)});else if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});Mh(n,e.window.document),n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n))}else h?(p?.resolve(),h.skipTransition(),v({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(i),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,r,s,n]);C.useLayoutEffect(()=>e.subscribe(x),[e,x]),C.useLayoutEffect(()=>{let t=e.state.errors,n=t?Wf.get(t):null;(c.current!==e.state||t&&n&&!b.current.has(t))&&x(e.state,{deletedFetchers:[],flushSync:!1,newErrors:n??null})},[e,x]),C.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new jh)},[d]),C.useEffect(()=>{if(p&&l&&e.window){let t=l,n=p.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):C.startTransition(()=>{r===!0&&s(e=>Ph(e,t)),a(t)}),await n});Mh(i,e.window.document),i.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(i)}},[l,p,e.window,r,s]),C.useEffect(()=>{p&&l&&o.location.key===l.location.key&&p.resolve()},[p,h,o.location,l]),C.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let S=C.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),w=e.basename||`/`,T=C.useMemo(()=>({router:e,navigator:S,static:!1,basename:w,onError:n}),[e,S,w,n]),E=C.useMemo(()=>({historyAction:o.historyAction,location:o.location,matches:o.matches,initialized:o.initialized,renderFallback:o.renderFallback,restoreScrollPosition:o.restoreScrollPosition,preventScrollReset:o.preventScrollReset,blockers:o.blockers}),[o.historyAction,o.location,o.matches,o.initialized,o.renderFallback,o.restoreScrollPosition,o.preventScrollReset,o.blockers]),D=C.useMemo(()=>({navigation:o.navigation,revalidation:o.revalidation}),[o.navigation,o.revalidation]),O=C.useMemo(()=>({loaderData:o.loaderData,actionData:o.actionData,errors:o.errors}),[o.loaderData,o.actionData,o.errors]),k=C.useMemo(()=>({fetchers:o.fetchers,fetcherData:y.current}),[o.fetchers]);return C.createElement(C.Fragment,null,C.createElement(om.Provider,{value:T},C.createElement(sm.Provider,{value:E},C.createElement(lm.Provider,{value:D},C.createElement(cm.Provider,{value:O},C.createElement(pm.Provider,{value:k},C.createElement(fm.Provider,{value:d},C.createElement(zh,{basename:w,location:o.location,navigationType:o.historyAction,navigator:S,useTransitions:r},C.createElement(Fh,{routes:e.routes,manifest:e.manifest,state:o,isStatic:!1,onError:n})))))))),null)}function Ph(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var Fh=C.memo(Ih);function Ih({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=C.useContext(om);Z(a,`You must render this element inside a <DataRouterContext.Provider> element`);let o=C.useContext(xh)?.routeDiscoveryRuntime;return C.useEffect(()=>{n.initialized&&o?.markReady()},[n.initialized,o]),Lm(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function Lh({to:e,replace:t,state:n,relative:r}){Z(Dm(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=C.useContext(hm);ed(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=C.useContext(_m),{pathname:s}=Om(),c=jm(),l=Yd(e,Jd(o),s,r===`path`);Af(typeof e==`string`?e:id(e),a.createHref(l),Df(a),`reject`);let u=JSON.stringify(l);return C.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Rh(e){return Pm(e.context)}function zh({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){Z(!Dm(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=C.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=ad(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=C.useMemo(()=>{let e=Vd(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return ed(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:C.createElement(hm.Provider,{value:c},C.createElement(gm.Provider,{children:t,value:h}))}C.Component;var Bh=`application/x-www-form-urlencoded`;function Vh(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Hh(e){return Vh(e)&&e.tagName.toLowerCase()===`button`}function Uh(e){return Vh(e)&&e.tagName.toLowerCase()===`form`}function Wh(e){return Vh(e)&&e.tagName.toLowerCase()===`input`}function Gh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kh(e,t){return e.button===0&&(!t||t===`_self`)&&!Gh(e)}function qh(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Jh(e,t){let n=qh(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Yh=null;function Xh(){if(Yh===null)try{new FormData(document.createElement(`form`),0),Yh=!1}catch{Yh=!0}return Yh}var Zh=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Qh(e){return e!=null&&!Zh.has(e)?(ed(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Bh}"`),null):e}function $h(e,t){let n,r,i,a,o;if(Uh(e)){let o=e.getAttribute(`action`);r=o?Vd(o,t):null,n=e.getAttribute(`method`)||`get`,i=Qh(e.getAttribute(`enctype`))||Bh,a=new FormData(e)}else if(Hh(e)||Wh(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Vd(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=Qh(e.getAttribute(`formenctype`))||Qh(o.getAttribute(`enctype`))||Bh,a=new FormData(o,e),!Xh()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Vh(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Bh,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var eg=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{eg&&(window.__reactRouterVersion=`8`)}catch{}function tg(e,t){return Gf({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:$u({window:t?.window}),hydrationData:t?.hydrationData||ng(),routes:e,mapRouteProperties:hd,hydrationRouteProperties:Ah,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function ng(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:rg(e.errors)}),e}function rg(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new rf(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&nf.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var ig=C.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=C.useContext(hm),v=typeof l==`string`&&Ju.test(l),y=lf(l,h);l=y.to;let b=Em(l,{relative:r}),x=Om(),S=null;if(o){let e=Yd(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Zd([h,e.pathname])),S=g.createHref(e)}let[w,T,E]=Ch(n,p),D=cg(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(y.isExternal||i),A=C.createElement(`a`,{...p,...E,href:(k?S:void 0)||y.absoluteURL||b,onClick:k?O:e,ref:kh(m,T),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return w&&!v?C.createElement(C.Fragment,null,A,C.createElement(Th,{page:b})):A});ig.displayName=`Link`;var ag=C.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Im(a,{relative:c.relative}),d=Om(),f=C.useContext(lm),{navigator:p,basename:m}=C.useContext(hm),h=f!=null&&xg(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f?.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Vd(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(y)===`/`),S={isActive:b,isPending:x,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(S):i;return C.createElement(ig,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(S):s)});ag.displayName=`NavLink`;var og=C.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=C.useContext(hm),g=fg(),_=pg(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Ju.test(s);return C.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?C.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});og.displayName=`Form`;function sg({getKey:e,storageKey:t,...n}){let r=C.useContext(xh),{basename:i}=C.useContext(hm),a=Om(),o=Qm();_g({getKey:e,storageKey:t});let s=C.useMemo(()=>{if(!r||!e)return null;let t=gg(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),C.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${ch(JSON.stringify(t||mg))}, ${ch(JSON.stringify(s))})`}})}sg.displayName=`ScrollRestoration`;function cg(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=jm(),d=Om(),f=Im(e,{relative:o});return C.useCallback(p=>{if(Kh(p,t)){p.preventDefault();let t=n===void 0?id(d)===id(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?C.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function lg(e){ed(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=C.useRef(qh(e)),n=C.useRef(!1),r=Om(),i=C.useMemo(()=>Jh(r.search,n.current?null:t.current),[r.search]),a=jm();return[i,C.useCallback((e,t)=>{let r=qh(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var ug=0,dg=()=>`__${String(++ug)}__`;function fg(){let{router:e}=Km(`useSubmit`),{basename:t}=C.useContext(hm),n=Xm(`useSubmit`),r=e.fetch,i=e.navigate;return C.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=$h(e,t);a.navigate===!1?await r(a.fetcherKey||dg(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function pg(e,{relative:t}={}){let{basename:n}=C.useContext(hm),r=C.useContext(_m);Z(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Im(e||`.`,{relative:t})},o=Om();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Zd([n,a.pathname])),id(a)}var mg=`react-router-scroll-positions`,hg={};function gg(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Vd(e.pathname,n)||e.pathname},t)),i??=e.key,i}function _g({getKey:e,storageKey:t}={}){let{router:n}=Km(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=qm(`useScrollRestoration`),{basename:a}=C.useContext(hm),o=Om(),s=Qm(),c=Zm();C.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),bg(C.useCallback(e=>{e.persisted&&(window.history.scrollRestoration=`manual`)},[])),yg(C.useCallback(()=>{if(c.state===`idle`){let t=gg(o,s,a,e);hg[t]=window.scrollY}try{sessionStorage.setItem(t||mg,JSON.stringify(hg))}catch(e){ed(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(C.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||mg);e&&(hg=JSON.parse(e))}catch{}},[t]),C.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(hg,()=>window.scrollY,e?(t,n)=>gg(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),C.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`)window.scrollTo(0,r);else{try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{ed(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}}},[o,r,i]))}function vg(e,t){let{capture:n}=t||{};C.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`beforeunload`,e,t),()=>{window.removeEventListener(`beforeunload`,e,t)}},[e,n])}function yg(e,t){let{capture:n}=t||{};C.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function bg(e,t){let{capture:n}=t||{};C.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pageshow`,e,t),()=>{window.removeEventListener(`pageshow`,e,t)}},[e,n])}function xg(e,{relative:t}={}){let n=C.useContext(fm);Z(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Km(`useViewTransitionState`),i=Im(e,{relative:t});if(!n.isTransitioning)return!1;let a=Vd(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Vd(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ld(i.pathname,o)!=null||Ld(i.pathname,a)!=null}var Sg=class extends Error{status;name=`ApiError`;constructor(e,t){super(e),this.status=t}};async function Cg(e){try{let t=await e.clone().json();if(t&&typeof t.message==`string`&&t.message)return t.message;if(t&&typeof t.error==`string`)return t.error}catch{}return`Request failed (${e.status})`}function wg({baseUrl:e,fetchImpl:t}){async function n(n,r,i){let a=t??globalThis.fetch,o={method:n,credentials:`include`};i instanceof Blob?(o.headers={"Content-Type":i.type},o.body=i):i!==void 0&&(o.headers={"Content-Type":`application/json`},o.body=JSON.stringify(i));let s=await a(`${e}${r}`,o);if(!s.ok)throw new Sg(await Cg(s),s.status);return await s.json()}return{get:e=>n(`GET`,e),put:(e,t)=>n(`PUT`,e,t),post:(e,t)=>n(`POST`,e,t),del:(e,t)=>n(`DELETE`,e,t)}}var Tg=(0,C.createContext)(void 0);function Eg({baseUrl:e,fetchImpl:t}){return{baseUrl:e,client:wg({baseUrl:e,fetchImpl:t})}}function Dg({config:e,children:t}){return(0,w.jsx)(Tg.Provider,{value:e,children:t})}function Og(){let e=(0,C.useContext)(Tg);if(!e)throw Error(`useApiConfig must be used within an ApiConfigProvider`);return e}var kg=(...e)=>t=>{let n=e.map(e=>{if(typeof e==`function`)return e(t);e&&(e.current=t)});return()=>{e.forEach((e,t)=>{let r=n[t];typeof r==`function`?r():typeof e==`function`?e(null):e&&(e.current=null)})}},Ag=l(`IconCrossMedium`,()=>(0,w.jsx)(`path`,{d:`M6.5 6.5L17.5 17.5M17.5 6.5L6.5 17.5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})),jg=C.createContext(void 0);function Mg(e){let t=C.useContext(jg);if(!e&&t===void 0)throw Error(U(27));return t}var Ng=`--nested-drawers`,Pg=`--drawer-height`,Fg=`--drawer-frontmost-height`,Ig=`--drawer-swipe-movement-x`,Lg=`--drawer-swipe-movement-y`,Rg=`--drawer-snap-point-offset`,zg=`--drawer-swipe-strength`,Bg=`--drawer-swipe-progress`,Vg=C.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Mg(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return m(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:Dt,props:[{role:`presentation`,hidden:!u,style:{pointerEvents:c?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[Bg]:`0`,[zg]:`1`}},o],enabled:a||!l})}),Hg=C.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Mg(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Hc({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Ht(Xt,e.nativeEvent))}return m(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Ug=Hg,Wg=`data-drawer-content`,Gg=C.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Mg(),m(`div`,e,{ref:t,props:[{[Wg]:``},a]})}),Kg=C.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Mg(),c=Ts(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),m(`p`,e,{ref:t,props:[{id:c},o]})}),qg=Kg,Jg=C.createContext(void 0);function Yg(){return C.useContext(Jg)}var Xg=`data-expanded`,Zg=`data-nested-drawer-open`,Qg=`data-nested-drawer-swiping`,$g=`data-swipe-dismiss`,e_=`data-swipe-direction`,t_=`data-swiping`,n_=C.createContext(void 0);function r_(){let e=C.useContext(n_);if(e===void 0)throw Error(U(26));return e}var i_=`ArrowUp`,a_=`ArrowDown`,o_=`ArrowLeft`,s_=`ArrowRight`,c_=`Home`,l_=new Set([i_,a_,o_,s_,c_,`End`]),u_=`Shift`,d_=[u_,`Control`,`Alt`,`Meta`];function f_(e){return Fe(e)&&e.tagName===`INPUT`}function p_(e){return!!(f_(e)&&e.selectionStart!=null||Fe(e)&&e.tagName===`TEXTAREA`)}function m_(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=h_(e,t,`left`),a=g_(e),o=g_(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=h_(e,t,`top`),r=g_(e),i=g_(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function h_(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function g_(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var __=C.createContext(void 0);function v_(e){let t=C.useContext(__);if(e!==!0&&t===void 0)throw Error(U(90));return t}function y_(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function b_(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function x_(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?y_(e,0,1)*t:e:null;let r=e.trim();if(r.endsWith(`px`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}if(r.endsWith(`rem`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e*n:null}return null}function S_(e,t){let n=-1,r=1/0;for(let i=0;i<e.length;i+=1){let a=Math.abs(e[i]-t);a<r&&(r=a,n=i)}return n}function C_(){let e=Mg(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i}=v_(),a=e.useState(`viewportElement`),[o,s]=C.useState(0),[c,l]=C.useState(16),u=X(()=>{let e=Rn(a).documentElement;s(a?a.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&l(t)});H(()=>{if(u(),!a||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(u);return e.observe(a),()=>{e.disconnect()}},[u,a]);let d=C.useMemo(()=>{if(!t||t.length===0||o<=0||i<=0)return[];let e=Math.min(i,o),n=t.map(t=>{let n=x_(t,o,c);if(n===null)return null;let r=y_(n,0,e);return{value:t,height:r,offset:Math.max(0,i-r)}}).filter(e=>!!e);if(n.length<=1)return n;let r=[],a=[];for(let e=n.length-1;e>=0;--e){let t=n[e];a.some(e=>Math.abs(e-t.height)<=1)||(a.push(t.height),r.push(t))}return r.reverse(),r},[i,c,t,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i,viewportHeight:o,resolvedSnapPoints:d,activeSnapPointOffset:C.useMemo(()=>{if(n===null)return;let e=d.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(i,o),r=x_(n,o,c);if(r===null)return;let a=y_(r,0,t);return d[S_(d.map(e=>e.height),a)]},[n,i,d,c,o])?.offset??null}}var w_=C.createContext(null);function T_(){return C.useContext(w_)}var E_=!1;function D_(){E_||=(typeof CSS<`u`&&`registerProperty`in CSS&&([Ig,Lg,Rg].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:Bg,initialValue:`0`},{name:zg,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var O_={...Dt,expanded(e){return e?{[Xg]:``}:null},nestedDrawerOpen(e){return e?{[Zg]:``}:null},nestedDrawerSwiping(e){return e?{[Qg]:``}:null},swipeDirection(e){return{[e_]:e}},swiping(e){return e?{[t_]:``}:null}},k_=C.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Mg(),l=c.context.popupRef,{swipeDirection:u,frontmostHeight:d,hasNestedDrawer:f,nestedSwiping:p,nestedSwipeProgressStore:h,onPopupHeightChange:g,notifyParentFrontmostHeight:_,notifyParentHasNestedDrawer:v}=v_(),y=c.useState(`descriptionElementId`),b=c.useState(`disablePointerDismissal`),S=c.useState(`floatingRootContext`),T=c.useState(`popupProps`),E=c.useState(`modal`),D=c.useState(`mounted`),O=c.useState(`nested`),k=c.useState(`nestedOpenDrawerCount`),A=c.useState(`transitionStatus`),j=c.useState(`open`),M=c.useState(`openMethod`),N=c.useState(`titleElementId`),P=c.useState(`role`),F=S.useState(`floatingId`),I=s.id??F,L=T_();r_();let{snapPoints:R,activeSnapPoint:ee,activeSnapPointOffset:z}=C_(),te=k>0,ne=L?.swiping??!1,B=L?.swipeStrength??null,[V,re]=C.useState(0),ie=C.useRef(0),ae=X(()=>{let e=l.current;if(!e)return;let t=e.offsetHeight;if(ie.current>0&&d>ie.current&&t>ie.current)return;if(ie.current>0&&f){let e=ie.current;re(e),g(e);return}let n=t;n!==ie.current&&(ie.current=n,re(n),g(n))});H(()=>{if(!D){ie.current=0,re(0),g(0);return}let e=l.current;if(!e||(D_(),ae(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(ae);return t.observe(e),()=>{t.disconnect()}},[ae,D,te,g,l]),H(()=>{let e=()=>{let e=l.current;if(!e)return;let t=h.getSnapshot();t>0?e.style.setProperty(Bg,`${t}`):e.style.setProperty(Bg,`0`)};e();let t=h.subscribe(e),n=l.current;return()=>{t(),n&&n.style.setProperty(Bg,`0`)}},[h,l]),H(()=>{if(j)return _?.(d),()=>{_?.(0)}},[d,j,_]),H(()=>{if(v)return v(j||A===`ending`),()=>{v(!1)}},[v,j,A]),ua({open:j,ref:l,onComplete(){j&&c.context.onOpenChangeComplete?.(!0)}});let U=o===void 0?l:o,W=c.useStateSetter(`popupElement`),G={open:j,nested:O,transitionStatus:A,expanded:ee===1,nestedDrawerOpen:te,nestedDrawerSwiping:p,swipeDirection:u,swiping:ne},oe;V&&(f||A===`ending`)&&(oe=`${V}px`);let se=R&&R.length>0&&(u===`down`||u===`up`),ce=null;se&&z!==null&&(ce=u===`up`?-z:z);let K=L?L.getDragStyles():x;if(se&&u===`down`){let e=z??0,t=Number.parseFloat(String(K[Lg]));K=ne&&Number.isFinite(t)?{...K,transform:void 0,[Lg]:`${b_(e,t)}px`}:{...K,transform:void 0}}let le=m(`div`,e,{state:G,props:[T,{id:I,"aria-labelledby":N,"aria-describedby":y,role:P,...fa,hidden:!D,onKeyDown(e){l_.has(e.key)&&e.stopPropagation()},style:{...K,[Bg]:`0`,[Ng]:k,[Pg]:oe,[Rg]:typeof ce==`number`?`${ce}px`:`0px`,[Fg]:d?`${d}px`:void 0,[zg]:typeof B==`number`&&Number.isFinite(B)&&B>0?`${B}`:`1`}},s],ref:[t,l,W],stateAttributesMapping:O_});return(0,w.jsx)(Yi,{context:S,openInteractionType:M,disabled:!D,closeOnFocusOut:!b,initialFocus:U,returnFocus:a,modal:E!==!1,restoreFocus:`popup`,children:le})}),A_=C.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,w.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),j_=C.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Mg(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,w.jsx)(n_.Provider,{value:n,children:(0,w.jsxs)(Ai,{ref:t,...r,children:[a&&o===!0&&(0,w.jsx)(A_,{ref:i.context.internalBackdropRef,inert:cc(!s)}),e.children]})}):null}),M_=j_;function N_({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=C.useRef(e!==void 0),[a,o]=C.useState(()=>t);return[i&&e!==void 0?e:a,C.useCallback(e=>{i||o(e)},[])]}var P_={},F_={},I_=``;function L_(e,t){return Le(e)?e:t}function R_(e,t,n){return/hidden|clip/.test(e.getComputedStyle(L_(t,n)).overflowY)}function z_(e){if(typeof document>`u`)return!1;let t=Rn(e);return Me(t).innerWidth-t.documentElement.clientWidth>0}function B_(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Rn(e),n=t.documentElement,r=t.body,i=L_(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function V_(e){let t=Rn(e),n=t.documentElement,r=t.body,i=L_(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function H_(e){let t=Rn(e),n=t.documentElement,r=t.body,i=Me(n),a=0,o=0,s=!1,c=In.create();if(be&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,P_={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},I_=n.style.scrollBehavior,F_={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=L_(n,r);s=B_(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,P_),Object.assign(r.style,F_),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=I_)}function d(){u(),c.request(l)}l();let f=Y(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var U_=new class{lockCount=0;restore=null;timeoutLock=ce.create();timeoutUnlock=ce.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Rn(e),n=t.documentElement,r=t.body,i=Me(n);if(R_(i,n,r)){let t=new i.MutationObserver(()=>{R_(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=he||!z_(e);this.restore=a?V_(e):H_(e)}};function W_(e=!0,t=null){H(()=>{if(e)return U_.acquire(t)},[e,t])}function G_({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=C.useState(0),[d,f]=C.useState(0),p=l===0,m=na(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=nt(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||J(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return W_(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),H(()=>{!r&&!i&&(u(0),f(0))},[r,i]),H(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),wa(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var K_={...Ja,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},q_=class extends za{constructor(e,t,n){let r=new Ea,i=J_(e,r,t,n);super(i,Y_(r),K_)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(va(this.state,e,t.trigger)))}};function J_(e,t,n,r=!1){return{...Ha(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Y_(e){return{popupRef:C.createRef(),backdropRef:C.createRef(),internalBackdropRef:C.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function X_(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=Mg(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=ma((e,t)=>new q_({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),T=b.useState(`payload`);Ta(b,x),Sa(b);let{forceUnmount:E}=Ca(x,b);C.useImperativeHandle(l,()=>({unmount:E,close:()=>b.setOpen(!1,Ht(yn))}),[E,b]);let D=x||S||u!=null;return(0,w.jsxs)(jg.Provider,{value:b,children:[u&&(0,w.jsx)(ha,{handle:u,store:b}),D&&(0,w.jsx)(G_,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:T}):n]})}var Z_,Q_;function $_(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null,swipeDirection:f=`down`,snapToSequentialPoints:p=!1,snapPoints:m,snapPoint:h,defaultSnapPoint:g,onSnapPointChange:_}=e,v=v_(!0),y=v?.onNestedSwipeProgressChange,b=v?.onNestedFrontmostHeightChange,x=v?.onNestedSwipingChange,S=v?.onNestedDrawerPresenceChange,[T,E]=C.useState(0),[D,O]=C.useState(0),[k,A]=C.useState(!1),[j,M]=C.useState(!1),[N]=C.useState(ev),P=g===void 0?m?.[0]??null:g,F=h!==void 0,[I,L]=N_({controlled:h,default:P,name:`Drawer`,state:`snapPoint`}),R=C.useRef(!1),ee=C.useRef(!1),z=X((e,t)=>{let n=t??Ht(`none`);_?.(e,n),n.isCanceled||L(e)}),te=C.useMemo(()=>F||!m||m.length===0?I:I===null||!m.some(e=>Object.is(e,I))?P:I,[I,F,P,m]),ne=X(e=>{E(e),!R.current&&e>0&&O(e)}),B=X(e=>{e>0?(R.current=!0,O(e)):(R.current=!1,T>0&&O(T))}),V=X(e=>{A(e)}),re=X(e=>{N.set(e),y?.(e)}),ie=X(e=>{M(e),x?.(e)}),H=X((e,t)=>{i?.(e,t),t.isCanceled||!e&&m&&m.length>0&&z(P,Ht(t.reason,t.event,t.trigger))}),ae=C.useMemo(()=>({swipeDirection:f,swipeAreaActiveRef:ee,snapToSequentialPoints:p,snapPoints:m,activeSnapPoint:te,setActiveSnapPoint:z,frontmostHeight:D,popupHeight:T,hasNestedDrawer:k,nestedSwiping:j,nestedSwipeProgressStore:N,onNestedDrawerPresenceChange:V,onPopupHeightChange:ne,onNestedFrontmostHeightChange:B,onNestedSwipingChange:ie,onNestedSwipeProgressChange:re,notifyParentFrontmostHeight:b,notifyParentSwipingChange:x,notifyParentSwipeProgressChange:y,notifyParentHasNestedDrawer:S}),[te,D,k,j,N,S,y,x,b,V,B,re,ie,ne,T,z,m,p,ee,f]),U=X_(`drawer`,{open:n,defaultOpen:r,onOpenChange:H,onOpenChangeComplete:a,disablePointerDismissal:o,modal:s,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d,children:typeof t==`function`?e=>(0,w.jsxs)(C.Fragment,{children:[Z_||=(0,w.jsx)(tv,{}),t(e)]}):(0,w.jsxs)(C.Fragment,{children:[Q_||=(0,w.jsx)(tv,{}),t]})});return(0,w.jsx)(__.Provider,{value:ae,children:U})}function ev(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(e=>{e()}))},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function tv(){let e=Yg(),t=Mg(!1),n=e?.setDrawerOpen,r=e?.removeDrawer,a=t.useState(`open`),o=t.useState(`nestedOpenDialogCount`),s=t.useState(`popupElement`),c=o===0;return H(()=>{if(r)return()=>{r(t)}},[r,t]),H(()=>{n?.(t,a)},[a,n,t]),C.useEffect(()=>{if(!a||!c||!_e)return;let e=Me(s).CloseWatcher;if(!e)return;function n(e){if(!t.select(`open`))return;let n=Ht(ln,e);e.cancelable||(n.cancel=i),t.setOpen(!1,n),n.isCanceled&&e.preventDefault()}let r=new e,o=Y(r,`cancel`,n);return()=>{o(),r.destroy()}},[t,c,a,s]),null}function nv(e,t=!1){let{overflowY:n}=Je(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}function rv(e,t=!1){let{overflowX:n}=Je(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientWidth>0:e.scrollWidth>e.clientWidth}function iv(e,t,n=!1){return t===`vertical`?nv(e,n):rv(e,n)}function av(e,t,n,r=!1){let i=e;for(;q(i)&&i!==t&&!qe(i);){if(Fe(i)&&iv(i,n,r))return i;i=Xe(i)}return null}function ov(e,t,n=`vertical`,r=!1){return av(e,t,n,r)??(iv(t,n,r)?t:null)}function sv(e,t,n){return typeof e?.elementFromPoint==`function`?e.elementFromPoint(t,n):null}function cv(e,t){let n=(t??Me(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}var lv=40,uv=10,dv=50,fv=4,pv=80,mv=1,hv=`button,a,input,select,textarea,label,[role="button"]`;function gv(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function _v(e){return Number.isFinite(e)&&e>0?e:null}function vv(e,t){return`translate3d(${e.x}px,${e.y}px,0) scale(${t})`}function yv(e){return e%2==1}function bv(e,t,n){let r=e[n];if(typeof r==`function`)try{r.call(e,t)}catch(e){if(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`)return;throw e}}function xv(e){let{enabled:t,directions:n,elementRef:r,movementCssVars:i,canStart:a,ignoreSelectorWhenTouch:o=!0,ignoreScrollableAncestors:s=!1,swipeThreshold:c,onDismiss:l,onProgress:u,onCancel:d,onSwipeStart:f,onRelease:p,onSwipingChange:m,trackDrag:h=!0}=e,g=hv,_=n.length===1?n[0]:void 0,v=Math.max(0,typeof c==`number`?c:lv),y=n.includes(`left`),b=n.includes(`right`),x=n.includes(`up`),S=n.includes(`down`),w=y||b,T=x||S,E=w?`horizontal`:`vertical`,[D,O]=C.useState(void 0),[k,A]=C.useState(!1),[j,M]=C.useState(!1),N=C.useRef({x:0,y:0}),P=C.useRef({x:0,y:0}),F=C.useRef(null),I=C.useRef({x:0,y:0,scale:1}),L=C.useRef(void 0),R=C.useRef(0),ee=C.useRef(!1),z=C.useRef({x:0,y:0}),te=C.useRef(!1),ne=C.useRef(!1),B=C.useRef(null),V=C.useRef(!1),re=C.useRef(!1),ie=C.useRef({width:0,height:0}),H=C.useRef(0),ae=C.useRef(v),U=C.useRef(null),W=C.useRef(null),G=C.useRef(null),oe=C.useRef(!1),se=C.useRef({x:0,y:0}),ce=C.useRef(null),K=C.useRef(!1),le=C.useRef(null),ue=X(e=>{K.current!==e&&(K.current=e,A(e),m?.(e))});function de(e){if(!e)return;let t=r.current,n=U.current;if(!t||!n)return;let i=n({element:t,direction:e});ae.current=Math.max(0,i)}let fe=X((e,t)=>{let n=Number.isFinite(e)?y_(e,0,1):0,r=n!==H.current,i=!1;if(t){let e=ce.current;i=!e||e.deltaX!==t.deltaX||e.deltaY!==t.deltaY||e.direction!==t.direction}(r||i)&&(H.current=n,t?ce.current=t:r&&(ce.current=null),u?.(n,t))}),pe=X(e=>{let t=r.current;if(!h||!t){e||(le.current=null);return}let n=t.style,a=le.current;e?(a||(le.current=[n.transition,n.transform]),n.transition=`none`):a&&([n.transition,n.transform]=a,le.current=null);let o=P.current,s=I.current,c=o.x-s.x,l=o.y-s.y;e&&(n.transform=vv(o,s.scale)),n.setProperty(i.x,`${c}px`),n.setProperty(i.y,`${l}px`)});function me(e,t){if(t===null)return;let n=G.current;if(n&&t>n.time){let r=Math.abs(e.x-n.x)<mv&&Math.abs(e.y-n.y)<mv,i=r&&!oe.current;if(oe.current=r,i)return;let a=Math.max(t-n.time,fv);se.current={x:(e.x-n.x)/a,y:(e.y-n.y)/a}}G.current={x:e.x,y:e.y,time:t}}let he=C.useCallback(()=>{O(void 0),ue(!1),M(!1),fe(0),ae.current=v,U.current=null,N.current={x:0,y:0},P.current={x:0,y:0},I.current={x:0,y:0,scale:1},L.current=void 0,R.current=0,ee.current=!1,z.current={x:0,y:0},te.current=!1,F.current=null,ne.current=!1,B.current=null,V.current=!1,re.current=!1,ie.current={width:0,height:0},W.current=null,G.current=null,oe.current=!1,se.current={x:0,y:0},ce.current=null,pe(!1)},[ue,v,pe,fe]);function ge(e){if(`touches`in e){let t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function _e(e){return`touches`in e||e.pointerType===`touch`}function ve(e,t){let n=r.current?.getRootNode();return sv(n,e.x,e.y)??nt(t)}function ye(e,t){return(n=>{let r=ov(e,t,n),i=Rn(r);return r===i.body||r===i.documentElement?null:r})(E)}function be(e,t,n){V.current=!1;let i=_e(e),a=ve(t,e.nativeEvent),l=Rn(r.current).body,u=i&&l?ye(a,l):null,d=n?.ignoreScrollableTarget??!1;if(u&&!d||(V.current=!!(u&&d),tt(a,g)&&(!i||o)))return!1;let p=r.current;if(s&&p&&a&&!(n?.ignoreScrollableAncestors??!1)&&av(a,p,E)!=null)return!1;if(ee.current=!1,L.current=void 0,R.current=0,N.current=t,W.current=_v(e.timeStamp),G.current=null,oe.current=!1,se.current={x:0,y:0},z.current=t,F.current=t,ae.current=v,U.current=typeof c==`function`?c:null,p){ie.current={width:p.offsetWidth,height:p.offsetHeight},de(_);let t=cv(p);I.current=t,P.current={x:t.x,y:t.y},me({x:t.x,y:t.y},W.current),`touches`in e||bv(p,e.pointerId,`setPointerCapture`)}return f?.(e.nativeEvent),ue(!0),te.current=!0,fe(0),pe(!0),!0}function xe(){Se(),V.current=!1,F.current=null}function Se(){ne.current=!1,B.current=null}function Ce(e){if(xe(),!K.current)return;ue(!1);let t=I.current;P.current={x:t.x,y:t.y},O(void 0),re.current=!1,pe(!1);let n=r.current;n&&bv(n,e.pointerId,`releasePointerCapture`),fe(0,{deltaX:0,deltaY:0,direction:void 0}),d?.(e.nativeEvent)}function we(e,t){let n=e=>Math.sign(e)*Math.abs(e)**.5,r=(e,t,r)=>!t&&e<0||!r&&e>0?n(e):e;return{x:w?r(e,y,b):n(e),y:T?r(t,x,S):n(t)}}function Te(e,t,n){let r=(e,t,n,r,i)=>e>0&&t<=0&&r||e<0&&t>=Math.max(0,n)&&i;return T&&n!==0?r(n,e.scrollTop,e.scrollHeight-e.clientHeight,S,x):w&&t!==0?r(t,e.scrollLeft,e.scrollWidth-e.clientWidth,b,y):null}let Ee=X(e=>{if(!t||e.defaultPrevented||e.nativeEvent.defaultPrevented||!(`touches`in e)&&e.button!==0)return;let n=ge(e);n&&(ne.current=!0,B.current=n,V.current=!1,re.current=!(`touches`in e),(!a||a(n,{nativeEvent:e.nativeEvent,direction:_}))&&be(e,n)&&Se())});function De(e,n,r){if(!t||!K.current)return;let i=nt(e.nativeEvent);if(_e(e)&&!V.current){let t=e.currentTarget;if(ye(i,t))return}if(`touches`in e||e.preventDefault(),te.current&&(te.current=!1,h)){N.current=n;let t=_v(e.timeStamp);t!==null&&(W.current=t),G.current=null,oe.current=!1}let a=n.x,o=n.y,s=r.x,c=r.y;(c<0&&o>z.current.y||c>0&&o<z.current.y)&&(z.current={x:z.current.x,y:o}),(s<0&&a>z.current.x||s>0&&a<z.current.x)&&(z.current={x:a,y:z.current.y});let l=a-N.current.x,u=o-N.current.y,d=o-z.current.y,f=a-z.current.x,p;if(!L.current)p=Math.abs(l)>=Math.abs(u)?l>0?`right`:`left`:u>0?`down`:`up`,p&&(p===`left`&&y||p===`right`&&b||p===`up`&&x||p===`down`&&S)&&(L.current=p,R.current=gv(p,l,u),O(p),de(p));else{let e=L.current,t=gv(e,f,d);t>ae.current?(ee.current=!1,O(e)):!(y&&b)&&!(x&&S)&&R.current-t>=uv&&(ee.current=!0)}let m=we(l,u),g=I.current.x,v=I.current.y;w&&(g+=m.x),T&&(v+=m.y);let C=P.current,E=g!==C.x||v!==C.y;P.current={x:g,y:v},E&&pe(!0),me({x:g,y:v},_v(e.timeStamp));let D=g-I.current.x,k=v-I.current.y,A={deltaX:D,deltaY:k,direction:L.current},j=0,M=_??L.current;if(M){let e=M===`left`||M===`right`?ie.current.width:ie.current.height,t=I.current.scale||1,n=gv(M,D,k);e>0&&t>0&&n>0&&(j=n/(e*t))}fe(j,A)}let Oe=X(e=>{if(!t)return;let i=P.current,a=I.current,o=i.x-a.x,s=i.y-a.y,c={deltaX:o,deltaY:s,direction:L.current};if(!K.current){xe(),fe(0,c);return}ue(!1),xe(),re.current=!1;let u=r.current;u&&(`touches`in e||bv(u,e.pointerId,`releasePointerCapture`));let d=o,f=s,m=W.current,h=_v(e.timeStamp),g=m!==null&&h!==null&&h>m?h-m:0,v=g>0?Math.max(g,dv):0,y=v>0?d/v:0,b=v>0?f/v:0,x=se.current.x,S=se.current.y,C=G.current;if(C&&h!==null&&h>=C.time){let e=h-C.time;if(e<=pv){let t=Math.max(e,fv),n=i.x-C.x,r=i.y-C.y,a=n/t,o=r/t;Math.abs(n)>=mv&&(x=a),Math.abs(r)>=mv&&(S=o)}else x=0,S=0}let w=p?.({event:e.nativeEvent,direction:L.current,deltaX:d,deltaY:f,velocityX:y,velocityY:b,releaseVelocityX:x,releaseVelocityY:S}),T=typeof w==`boolean`;if(ee.current&&!T){P.current={x:a.x,y:a.y},O(void 0),pe(!1),fe(0,c);return}let E=!1,D;if(T)E=w,D=L.current??_;else for(let e of n)if(gv(e,d,f)>ae.current){E=!0,D=e;break}E&&D?(O(D),M(!0),pe(!1),l?.(e.nativeEvent,{direction:D})):(P.current={x:a.x,y:a.y},O(void 0),pe(!1),fe(0,c))}),ke=X(e=>{let t=ge(e);if(!t)return;let n=!1;if(!(`touches`in e)){let t=yv(e.buttons);if(t&&(re.current=!0),e.buttons!==0&&!t){Ce(e);return}if(e.buttons===0&&re.current){if(!K.current){Oe(e);return}n=!0}}if(!k&&ne.current){if(!_e(e)&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)){xe();return}if(!a||a(t,{nativeEvent:e.nativeEvent,direction:_})){let n=B.current,i=!1;if(_e(e)){let a=r.current;if(n&&a){let r=ve(t,e.nativeEvent),o=Rn(a).body,s=o?ye(r,o):null;if(s&&(J(a,s)||J(s,a))){let e=Te(s,t.x-n.x,t.y-n.y);if(e===!1)return;e===!0&&(i=!0)}}}be(e,t,{ignoreScrollableTarget:i,ignoreScrollableAncestors:i})&&(n&&i?(Se(),N.current=n,z.current=n,F.current=n,te.current=!1):(Se(),V.current=!1))}}let i=F.current,o=i===null?{x:0,y:0}:{x:t.x-i.x,y:t.y-i.y};F.current=t,De(e,t,o),n&&!(`touches`in e)&&Oe(e)}),Ae=X((e,t)=>{ke({touches:e.touches,currentTarget:t,nativeEvent:e,defaultPrevented:e.defaultPrevented,timeStamp:e.timeStamp})}),je=C.useCallback(()=>{let e=K.current,t=P.current,n=I.current,r=t.x-n.x,a=t.y-n.y;return!e&&r===0&&a===0&&!j?{[i.x]:`0px`,[i.y]:`0px`}:{transition:e?`none`:void 0,transform:e?vv(t,n.scale):void 0,[i.x]:`${r}px`,[i.y]:`${a}px`}},[j,i]);return{swiping:k,swipeDirection:D,dragDismissed:j,getPointerProps:C.useCallback(()=>t?{onPointerDown:Ee,onPointerMove:ke,onPointerUp:Oe,onPointerCancel:Oe}:{},[t,Oe,ke,Ee]),getTouchProps:C.useCallback(()=>t?{onTouchStart:Ee,onTouchMove:ke,onTouchEnd:Oe,onTouchCancel:Oe}:{},[t,Oe,ke,Ee]),moveNative:Ae,getDragStyles:je,reset:he}}var Sv=C.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Mg(),c=Ts(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),m(`h2`,e,{ref:t,props:[{id:c},o]})}),Cv=Sv;function wv(e){let t=C.useRef(``),n=C.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:C.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Tv(e,t){let n=C.useRef(e),r=X(t);H(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Ev(e,t){let{onClick:n,onPointerDown:r}=wv(X((n,r)=>{(typeof e==`function`?e():e)||t(r||(he?`touch`:``))}));return C.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Dv(e){let[t,n]=C.useState(null),r=Ev(e,n);return Tv(e,t=>{t&&!e&&n(null)}),C.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var Ov=re(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=Mg(!0),f=Ya(l)??d;if(!f)throw Error(U(79));let p=Ts(s),h=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,p),_=f.useState(`triggerPopupId`,p),v=C.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=xa(p,v,f,{payload:c}),{getButtonProps:x,buttonRef:S}=Hc({disabled:a,native:o}),w=Xi(h),T=Ev(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),E={disabled:a,open:g},D=f.useState(`triggerProps`,b);return m(`button`,e,{state:E,ref:[S,t,y,v],props:[w.reference,D,T,{[bi]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":g,"aria-controls":_},u,x],stateAttributesMapping:wt})}),kv=Ov,Av=`data-nested-dialog-open`,jv={...Et,...pt,nestedDialogOpen(e){return e?{[Av]:``}:null}},Mv=C.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=r_(),c=Mg(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),h=c.useStateSetter(`viewportElement`);return m(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,h],stateAttributesMapping:jv,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),Nv=`data-nested-dialog-open`,Pv=C.createContext(void 0);function Fv(){return C.useContext(Pv)}var Iv=10,Lv=.5,Rv=.5,zv=300,Bv=4,Vv=.2,Hv=4,Uv=80,Wv=360,Gv=.1,Kv=6,qv=2,Jv=`[${Wg}]`,Yv={horizontal:`[${xi}="x"]`,vertical:`[${xi}="y"]`},Xv=C.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=Mg(),c=s.context.popupRef,l=s.context.backdropRef,{swipeDirection:d,notifyParentSwipingChange:f,notifyParentSwipeProgressChange:p,frontmostHeight:m,snapToSequentialPoints:h,swipeAreaActiveRef:g}=v_(),_=Yg(),{snapPoints:v,resolvedSnapPoints:y,activeSnapPoint:b,activeSnapPointOffset:x,setActiveSnapPoint:S,popupHeight:T}=C_(),E=s.useState(`open`),D=s.useState(`mounted`),O=s.useState(`nested`),k=s.useState(`nestedOpenDrawerCount`),A=s.useState(`viewportElement`),j=s.useState(`popupElement`),M=_?.visualStateStore,N=k>0,P=d===`left`||d===`right`?`horizontal`:`vertical`,F=P===`vertical`,I=F?`horizontal`:`vertical`,[L,R]=C.useState(null),ee=C.useRef(void 0),z=C.useRef(null),te=Ln(),ne=C.useRef(!1),B=C.useRef(!1),V=C.useRef(``),re=C.useRef(!1),ie=C.useRef(!1),ae=C.useRef(null),U=Fv(),W=C.useMemo(()=>{if(!v||v.length<2||y.length<2||d!==`down`&&d!==`up`)return null;let e=y.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[y,v,d]),G=C.useMemo(()=>!W||x===null?null:y_((x-W.minOffset)/W.range,0,1),[x,W]),oe=C.useMemo(()=>v&&v.length>0&&(d===`down`||d===`up`)?d===`down`?[`down`,`up`]:[`up`,`down`]:[d],[v,d]),se=X(e=>{c.current?.toggleAttribute($g,e),l.current?.toggleAttribute($g,e)}),ce=X(()=>{se(!1),c.current?.removeAttribute(ut),R(null)}),K=X(()=>{B.current&&(B.current=!1,f?.(!1))}),le=X((e,t,n)=>{let r=E&&!O&&t,i=r?e:0,a=E&&t?e:0;n&&p&&(p(a),a<=0&&K()),M?.set({swipeProgress:i,frontmostHeight:i>0?m:0});let o=l.current;if(!o)return;let s=r&&i>0;o.style.setProperty(Bg,s?`${i}`:`0`),s&&m>0?o.style.setProperty(Pg,`${m}px`):o.style.removeProperty(Pg)});function ue(e,t,n,r,i,a,o,s){let c=ey(e,t);if(c<=0)return null;let l=((t===`down`||t===`up`)&&v&&v.length>0?x??0:0)+gv(t,n,r),u=Math.max(0,c-l);if(u<=0)return null;let d=gv(t,o,s),f=Math.abs(d)>0?d:gv(t,i,a);return f<=Vv?null:Gv+(y_(u/y_(f,Vv,Hv),Uv,Wv)-Uv)/280*.9}function de(e){if(B.current||!e)return;let t=gv(e.direction??d,e.deltaX,e.deltaY);Math.abs(t)<Iv||(B.current=!0,f?.(!0))}let fe=xv({enabled:D&&!N,directions:oe,elementRef:s.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:Ig,y:Lg},onSwipeStart(e){if(`touches`in e||e.pointerType===`touch`)return;let t=c.current,n=Rn(t).getSelection?.();if(!n||n.isCollapsed)return;let r=q(n.anchorNode)?n.anchorNode:n.anchorNode?.parentElement,i=q(n.focusNode)?n.focusNode:n.focusNode?.parentElement;(J(t,r)||J(t,i))&&n.removeAllRanges()},onSwipingChange(e){ne.current=e,Zv(s.context.backdropRef.current,e),!e&&!p&&K()},swipeThreshold({element:e,direction:t}){return ty(e,t)},canStart(e,t){let n=s.context.popupRef.current;if(!n)return!1;let r=t.nativeEvent,i=`touches`in r||r.pointerType===`touch`,a=i?ae.current:null,o=n.ownerDocument,c=sv(n.getRootNode(),e.x,e.y);return!(!a?.startedInPopup&&!J(n,c)||i&&ay(o,n)||a?.hasCrossAxisGestureTarget&&!a.drawerAxisAttributed&&a.allowSwipe!==!0)},onProgress(e,t){let n=ne.current;n&&de(t);let r=!!(v&&v.length>0);if(n&&d===`down`&&r&&t){let e=s.context.popupRef.current;e&&(e.style.removeProperty(`transform`),e.style.setProperty(Lg,`${b_(x??0,t.deltaY)}px`))}let i=e;if(W&&T>0){let e=x??W.minOffset;n&&t&&Number.isFinite(t.deltaY)?i=(e=>y_((e-W.minOffset)/W.range,0,1))(y_(e+t.deltaY,0,T)):G!==null&&(i=G)}n||(p?.(0),K()),le(i,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:r,velocityX:i,velocityY:a,releaseVelocityX:o,releaseVelocityY:c}){let l=s.context.popupRef.current;if(!l){ce();return}let u=l;function f(e){K(),se(!0),u.style.removeProperty(`transition`),u.setAttribute(ut,``),pi.flushSync(()=>{R(ue(u,e,t,n,i,a,o,c))})}if(!v||v.length===0){if(!r){ce();return}let e=gv(r,t,n);if(e<=0)return ce(),!1;if(gv(r,i,a)>=Lv)return f(r),!0;let o=e>ty(u,r);return o?f(r):ce(),o}if(d!==`down`&&d!==`up`){ce();return}if(!T)return ce(),!1;if(y.length===0){ce();return}let p=d===`down`?n:-n,m=Math.sign(p),g=d===`down`?c:-c,_=d===`down`?a:-a,C=g;if(m!==0&&Math.abs(p)>=Iv){let e=Math.sign(C);e!==0&&e!==m&&(C=_)}let w=x??0,E=y_(w+p,0,T),D=Math.abs(C)>=Rv?y_(C,-4,Bv)*zv:0,O=h?E:y_(E+D,0,T),k=Ht(bn,e),A=()=>(le(0,!0,!0),ce(),!1),j=e=>(S(e.value,k),A()),M=e=>r?(S(null,k),k.isCanceled?A():(ee.current=b,f(d),!0)):j(e);if(h){let e=[...y].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=S_(t,w),r=e[S_(t,O)],i=Math.sign(C),a=m!==0&&i!==0&&i===m&&Math.abs(C)>=Rv,o=O;if(a){let t=y_(n+m,0,e.length-1);if(t!==n){let n=e[t];(m>0?O<n.offset:O>n.offset)&&(r=n,o=n.offset)}else if(m>0)return M(r)}return Math.abs(o-T)<Math.abs(o-r.offset)?M(r):j(r)}let N=y[S_(y.map(e=>e.offset),O)];return C>=Lv&&p>0||Math.abs(O-T)<Math.abs(O-N.offset)?M(N):j(N)},onDismiss(e){M?.set({swipeProgress:0,frontmostHeight:0});let t=s.context.backdropRef.current;t&&(t.style.setProperty(Bg,`0`),t.style.removeProperty(Pg));let n=Ht(bn,e);if(s.setOpen(!1,n),n.isCanceled){let t=ee.current;t!==void 0&&S(t,Ht(bn,e)),ee.current=void 0,z.current?.(),ce()}else if(s.select(`open`)){let t=e;te.request(()=>{if(s.select(`open`)){let e=ee.current;e!==void 0&&S(e,Ht(bn,t)),ee.current=void 0,ce(),z.current?.()}else ee.current=void 0})}else ee.current=void 0,se(!0)}}),pe=fe.getPointerProps(),me=fe.getTouchProps(),{moveNative:he,reset:ge}=fe;z.current=ge,C.useEffect(()=>{let e=A??j;if(!e||!E||!D)return;let t=e,n=Rn(t);function r(e,r,i){let a=F?i.clientY-r.lastY:i.clientX-r.lastX;if(e.touches.length===2||ay(n,t)||N||ly(r,e,i,F))return;let o=r.scrollTarget;if(!o||o===n.documentElement||o===n.body)e.cancelable&&e.preventDefault(),e.stopPropagation(),he(e,t);else if(!uy(o,P))e.cancelable&&e.preventDefault(),e.stopPropagation();else{if(a!==0){let t=py(o,P,d,a);r.allowSwipe?e.cancelable&&e.preventDefault():e.cancelable&&t?(r.allowSwipe=!0,e.preventDefault()):r.allowSwipe=!1}r.allowSwipe===!0&&(e.stopPropagation(),he(e,t))}}function i(e){if(U?.onTouchMove(e),ie.current)return;let t=ae.current,n=e.touches[0];n&&t&&(r(e,t,n),cy(t,n))}return Y(n,`touchmove`,i,{passive:!1,capture:!0})},[D,N,E,j,F,P,d,he,A,U]),H(()=>{W&&!fe.swiping&&le(!E||O?0:G??0,!0,!1)},[le,m,O,p,E,G,W,fe.swiping,s,M]),H(()=>{if(p)return E||p(0),()=>{p(0)}},[p,E]),H(()=>{E&&(g.current||ge(),ce())},[ce,E,ge,g]),H(()=>{let e=l.current;return()=>{M?.set({swipeProgress:0,frontmostHeight:0}),Zv(e,!1);let t=l.current;t!==e&&Zv(t,!1),K()}},[l,K,M]);let _e=C.useMemo(()=>({swiping:fe.swiping,getDragStyles:fe.getDragStyles,swipeStrength:L??null,setSwipeDismissed:se}),[se,fe.getDragStyles,fe.swiping,L]);function ve(e){ie.current=e,ae.current=null}function ye(){ve(!1),V.current=``,re.current=!1}function be(e){return V.current=``,e.pointerType!==`touch`}return(0,w.jsx)(Mv,{ref:t,className:r,style:i,render:n,...u(o,{onPointerDown(e){if(V.current=e.pointerType,re.current=e.pointerType===`pen`,!E||!D||N)return;let t=sv(e.currentTarget.getRootNode(),e.clientX,e.clientY);Qv(t)||$v(t)||e.pointerType!==`touch`&&pe.onPointerDown?.(e)},onPointerMove(e){e.pointerType!==`touch`&&pe.onPointerMove?.(e)},onPointerUp(e){be(e)&&pe.onPointerUp?.(e)},onPointerCancel(e){be(e)&&pe.onPointerCancel?.(e)},onTouchStart(e){if(V.current===`pen`&&re.current){re.current=!1,ve(!1);return}if(!E||!D||N){ve(!1);return}let t=e.touches[0];if(!t)return;if(sy(e)){ve(!1);return}let n=e.currentTarget,r=sv(n.getRootNode(),t.clientX,t.clientY),i=nt(e.nativeEvent),a=q(i)?i:n;if(!J(n,a)||(U?.onTouchStart(e),tt(r,`[data-base-ui-swipe-ignore]:not(${Yv[I]})`))){ve(!0);return}ie.current=!1;let o=ov(a,n,P),s=ov(a,n,I)!=null||tt(r,Yv[I])!=null,l=null;o&&(l=fy(o,P,d)?null:!1),ae.current={startX:t.clientX,startY:t.clientY,lastX:t.clientX,lastY:t.clientY,startedInPopup:J(c.current,r),scrollTarget:o,hasCrossAxisGestureTarget:s,allowSwipe:l,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},me.onTouchStart?.(e)},onTouchEnd(e){U?.onTouchEnd(e),ye(),me.onTouchEnd?.(e)},onTouchCancel(e){U?.onTouchCancel(),ye(),me.onTouchCancel?.(e)},[Nv]:void 0}),children:(0,w.jsx)(w_.Provider,{value:_e,children:a})})});function Zv(e,t){e?.toggleAttribute(t_,t)}function Qv(e){return!!tt(e,Si)}function $v(e){return!!tt(e,Jv)}function ey(e,t){return t===`left`||t===`right`?e.offsetWidth:e.offsetHeight}function ty(e,t){return Math.max(ey(e,t)*.5,Iv)}function ny(e,t){return e instanceof t.HTMLInputElement&&e.type===`range`}function ry(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function iy(e,t){let n=q(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=q(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||J(t,n)||J(t,r)}function ay(e,t){let n=et(e);if(n&&J(t,n)&&ry(n)){let{selectionStart:e,selectionEnd:t}=n;if(e!=null&&t!=null&&e<t)return!0}let r=e.getSelection?.();return!r||r.isCollapsed?!1:iy(r,t)}function oy(e,t){return e.composedPath().some(e=>ny(e,t))}function sy(e){return oy(e.nativeEvent,Me(e.currentTarget))}function cy(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function ly(e,t,n,r){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||e.allowSwipe===!0||!e.hasCrossAxisGestureTarget)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let i=r?n.clientY-e.startY:n.clientX-e.startX,a=r?n.clientX-e.startX:n.clientY-e.startY,o=Math.abs(i),s=Math.abs(a);return s>=Kv&&s>o+qv?(e.preserveNativeCrossAxisScroll=!0,!0):o>=Kv?(e.drawerAxisAttributed=!0,!1):!0}function uy(e,t){return dy(e,t).max>0}function dy(e,t){if(t===`vertical`){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function fy(e,t,n){let r=my(n,t),{offset:i,max:a}=dy(e,t);return r?i<=0:i>=a}function py(e,t,n,r){return(my(n,t)?r>0:r<0)&&fy(e,t,n)}function my(e,t){return t===`vertical`?e===`down`:e===`right`}var hy=D(`drawer-backdrop fixed inset-0 z-50`,{variants:{overlay:{visible:`bg-scrim backdrop-blur-xs`,transparent:`bg-transparent`,none:`hidden`}},defaultVariants:{overlay:`visible`}}),gy=D(`fixed z-50 flex`,{variants:{side:{top:`items-start justify-center`,bottom:`items-end justify-center`,left:`items-stretch justify-start`,right:`items-stretch justify-end`},layout:{default:`inset-0`,floating:`p-2 sm:p-3`,floatingOverlay:`inset-0 p-2 sm:p-3`},size:{md:``,lg:``,xl:``}},compoundVariants:[{side:`right`,layout:`floating`,className:`inset-y-0 right-0 max-w-full`},{side:`left`,layout:`floating`,className:`inset-y-0 left-0 max-w-full`},{side:[`left`,`right`],layout:`floating`,size:`md`,className:`w-[calc(32rem+1.5rem)] sm:w-[calc(32rem+2rem)]`},{side:[`left`,`right`],layout:`floating`,size:`lg`,className:`w-[calc(42rem+1.5rem)] sm:w-[calc(42rem+2rem)]`},{side:[`left`,`right`],layout:`floating`,size:`xl`,className:`w-[calc(56rem+1.5rem)] sm:w-[calc(56rem+2rem)]`},{side:`bottom`,layout:`floating`,className:`inset-x-0 bottom-0 h-[calc(85dvh+1.5rem)] max-h-full sm:h-[calc(85dvh+2rem)]`},{side:`top`,layout:`floating`,className:`inset-x-0 top-0 h-[calc(85dvh+1.5rem)] max-h-full sm:h-[calc(85dvh+2rem)]`}],defaultVariants:{side:`bottom`,layout:`default`,size:`md`}}),_y=D(a(`drawer-popup group/popup relative z-50 box-border flex [touch-action:auto] flex-col overflow-y-auto overscroll-x-none overscroll-y-contain will-change-transform outline-none`,`text-foreground`,I,`data-[swiping]:select-none`,`after:pointer-events-none after:absolute after:inset-0 after:bg-transparent after:transition-[background-color] after:duration-[450ms] after:content-['']`,`data-[nested-drawer-open]:after:bg-black/25`),{variants:{side:{bottom:``,top:``,left:``,right:``},variant:{default:``,floating:`drawer-popup-floating pointer-events-auto rounded-lg`},size:{md:``,lg:``,xl:``}},compoundVariants:[{side:`bottom`,variant:`default`,className:`-mb-12 h-[var(--drawer-height,auto)] max-h-[calc(85vh_+_3rem)] w-full rounded-t-xl pb-12`},{side:`top`,variant:`default`,className:`-mt-12 h-[var(--drawer-height,auto)] max-h-[calc(85vh_+_3rem)] w-full rounded-b-xl pt-12`},{side:`left`,variant:`default`,className:`h-full max-w-[85vw] rounded-r-xl`},{side:`right`,variant:`default`,className:`h-full max-w-[85vw] rounded-l-xl`},{side:[`left`,`right`],variant:`floating`,className:`h-[calc(100dvh-1.5rem)] max-w-[calc(100vw-1.5rem)] sm:h-[calc(100dvh-2rem)] sm:max-w-[calc(100vw-2rem)]`},{side:[`top`,`bottom`],variant:`floating`,className:`max-h-[calc(85dvh-1.5rem)] w-[calc(100vw-1.5rem)] sm:max-h-[calc(85dvh-2rem)] sm:w-[calc(100vw-2rem)]`},{side:[`left`,`right`],variant:`default`,size:`md`,className:`w-[20rem]`},{side:[`left`,`right`],variant:`floating`,size:`md`,className:`w-[32rem]`},{side:[`left`,`right`],size:`lg`,className:`w-2xl`},{side:[`left`,`right`],size:`xl`,className:`w-4xl`}],defaultVariants:{side:`bottom`,variant:`default`,size:`md`}}),vy={top:`up`,bottom:`down`,left:`left`,right:`right`},yy=(e,t)=>e===`auto`?t===`floating`?`none`:`visible`:e,by=C.createContext({side:`bottom`,variant:`default`,size:`md`,resolvedOverlay:`visible`}),xy=()=>C.useContext(by),Sy=(e,t)=>e===`floating`?t===`none`?`floating`:`floatingOverlay`:`default`;function Cy({side:e=`bottom`,variant:t=`default`,size:n=`md`,overlay:r=`auto`,modal:i,disablePointerDismissal:a,children:o,...s}){let c=yy(r,t),l=i??(c!==`none`&&void 0),u=a??(c===`none`||void 0),d=C.useMemo(()=>({side:e,variant:t,size:n,resolvedOverlay:c}),[e,t,n,c]);return(0,w.jsx)(by.Provider,{value:d,children:(0,w.jsx)($_,{swipeDirection:vy[e],modal:l,disablePointerDismissal:u,...s,children:o})})}Cy.displayName=`Drawer`;function wy({asChild:e,children:t,...n}){let r=e&&C.isValidElement(t)?{render:t}:{};return(0,w.jsx)(kv,{...r,...n,children:e?void 0:t})}wy.displayName=`DrawerTrigger`;var Ty=C.forwardRef(({asChild:e,children:t,...n},r)=>{let i=e&&C.isValidElement(t)?{render:t}:{};return(0,w.jsx)(Ug,{ref:r,...i,...n,children:e?void 0:t})});Ty.displayName=`DrawerClose`;var Ey=M_,Dy=C.forwardRef(({className:e,overlay:t,...n},r)=>{let{resolvedOverlay:i}=xy(),o=t??i;return(0,w.jsx)(Vg,{ref:r,"data-slot":`drawer-backdrop`,"data-overlay":o,className:a(hy({overlay:o}),e),...n})});Dy.displayName=`DrawerBackdrop`;var Oy=C.forwardRef(({className:e,side:t,variant:n,size:r,...i},o)=>{let s=xy(),c=t??s.side,l=n??s.variant,u=r??s.size,d=Sy(l,s.resolvedOverlay);return(0,w.jsx)(Xv,{ref:o,"data-slot":`drawer-viewport`,"data-variant":l,className:a(gy({side:c,layout:d,size:u}),e),...i})});Oy.displayName=`DrawerViewport`;var ky=C.forwardRef(({className:e,side:t,variant:n,size:r,...i},o)=>{let s=xy(),c=t??s.side,l=n??s.variant,u=r??s.size;return(0,w.jsx)(k_,{ref:o,"data-slot":`drawer-popup`,"data-variant":l,"data-size":u,className:a(_y({side:c,variant:l,size:u}),e),...i})});ky.displayName=`DrawerPopup`;var Ay=a(`transition-opacity duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:duration-0`,`group-data-[nested-drawer-open]/popup:opacity-0`),jy=()=>(0,w.jsx)(`div`,{"aria-hidden":!0,"data-slot":`drawer-handle`,className:a(`mx-auto my-2 h-1 w-12 shrink-0 rounded-full bg-muted`,Ay)});jy.displayName=`DrawerHandleBar`;var My=({side:e,variant:t})=>t!==`floating`||e!==`left`&&e!==`right`?null:(0,w.jsx)(`div`,{"aria-hidden":!0,"data-slot":`drawer-side-handle`,className:a(`absolute top-1/2 z-10 flex h-20 w-5 -translate-y-1/2 cursor-ew-resize touch-none items-center justify-center select-none lg:hidden`,e===`right`?`-left-2`:`-right-2`),children:(0,w.jsx)(`div`,{className:`h-10 w-1 rounded-full bg-border-strong`})});My.displayName=`DrawerFloatingSideHandle`;var Ny=C.forwardRef(({className:e,children:t,variant:n,size:r,showCloseButton:i=!0,...o},s)=>{let{side:c,variant:l,size:u,resolvedOverlay:d}=xy(),f=n??l,p=r??u,m=c===`top`||c===`bottom`;return(0,w.jsxs)(Ey,{children:[d!==`none`&&(0,w.jsx)(Dy,{}),(0,w.jsx)(Oy,{variant:f,size:p,children:(0,w.jsxs)(ky,{ref:s,variant:f,size:p,className:e,...o,children:[m&&c===`bottom`&&(0,w.jsx)(jy,{}),(0,w.jsx)(My,{side:c,variant:f}),(0,w.jsxs)(`div`,{"data-slot":`drawer-content`,className:a(`relative flex min-h-0 flex-1 flex-col`,`[&>form]:flex [&>form]:min-h-0 [&>form]:flex-1 [&>form]:flex-col [&>form]:gap-0`,Ay),children:[i&&(0,w.jsx)(Py,{}),t]}),m&&c===`top`&&(0,w.jsx)(jy,{})]})})]})});Ny.displayName=`DrawerContent`;var Py=()=>(0,w.jsx)(Ty,{asChild:!0,children:(0,w.jsx)(gl,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`absolute top-3 right-3 z-10`,"aria-label":`Close`,children:(0,w.jsx)(Ag,{})})});Py.displayName=`DrawerDefaultCloseButton`;var Fy=({className:e,...t})=>(0,w.jsx)(`div`,{"data-slot":`drawer-header`,className:a(`flex flex-col gap-0.5 px-3 py-2.5 pr-12 text-left`,e),...t});Fy.displayName=`DrawerHeader`;var Iy=({className:e,...t})=>(0,w.jsx)(`div`,{"data-slot":`drawer-footer`,className:a(`mt-auto flex flex-col-reverse gap-1.5 px-3 py-2.5 sm:flex-row sm:justify-end`,e),...t});Iy.displayName=`DrawerFooter`;var Ly=({className:e,...t})=>(0,w.jsx)(`div`,{"data-slot":`drawer-body`,className:a(`flex-1 px-3 py-2.5`,e),...t});Ly.displayName=`DrawerBody`;var Ry=C.forwardRef(({className:e,...t},n)=>(0,w.jsx)(Cv,{ref:n,className:a(`text-subheading text-foreground`,e),...t}));Ry.displayName=`DrawerTitle`;var zy=C.forwardRef(({className:e,...t},n)=>(0,w.jsx)(qg,{ref:n,className:a(`text-caption text-muted-foreground`,e),...t}));zy.displayName=`DrawerDescription`;function By(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Vy(e,t=`|`){return e.map(e=>mb(e)).join(t)}function Hy(e,t){return typeof t==`bigint`?t.toString():t}var Uy=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Wy(e){return new Uy(e)}function Gy(e){return e==null}function Ky(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function qy(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Jy=Symbol(`evaluating`);function Yy(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Jy)return r===void 0&&(r=Jy,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Xy(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Zy(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Qy(e){return Zy(e._zod.def)??e._zod.def.shape}function $y(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Xy(this,t,e),e},enumerable:!0,configurable:!0})}function eb(e,t,n){t in e?Xy(e,t,n):e[t]=n}function tb(e,t,n,r){let i=Qy(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?$y(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):eb(e,a,r?r(n.value,a):n.value))}}function nb(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?$y(e,n,()=>t[n]):eb(e,n,r.value))}}function rb(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ib(e){return JSON.stringify(e)}function ab(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ob=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function sb(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var cb=Wy(()=>{if(ix.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function lb(e){if(sb(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return sb(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ub(e){return lb(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var db=new Set([`string`,`number`,`symbol`]);function fb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function pb(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Q(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw 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 mb(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function hb(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var gb={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},_b={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function vb(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return tb(i,e,yb(e,t)),pb(e,rb(n,{shape:i,checks:[]}))}function yb(e,t){let n=Qy(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function bb(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(yb(e,t)),a={};return tb(a,e,Reflect.ownKeys(Qy(e)).filter(e=>!i.has(e))),pb(e,rb(n,{shape:a,checks:[]}))}function xb(e,t){if(!lb(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Qy(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return pb(e,rb(e._zod.def,{shape:Sb(e,t)}))}function Sb(e,t){let n={};return tb(n,e,Reflect.ownKeys(Qy(e))),nb(n,t),n}function Cb(e,t){if(!lb(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return pb(e,rb(e._zod.def,{shape:Sb(e,t)}))}function wb(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return tb(n,e,Reflect.ownKeys(Qy(e))),tb(n,t,Reflect.ownKeys(Qy(t))),pb(e,rb(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Tb(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(yb(t,n)):void 0,o={};return tb(o,t,Reflect.ownKeys(Qy(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),pb(t,rb(t._zod.def,{shape:o,checks:[]}))}function Eb(e,t,n){let r=n?new Set(yb(t,n)):void 0,i={};return tb(i,t,Reflect.ownKeys(Qy(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),pb(t,rb(t._zod.def,{shape:i}))}function Db(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ob(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function kb(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ab(e){return typeof e==`string`?e:e?.message}function jb(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Mb(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Nb(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ab(e.inst?._zod.def?.error?.(e))??Ab(a?.(e))??Ab(t?.error?.(e))??Ab(n.customError?.(e))??Ab(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Pb=/[\uD800-\uDBFF]/;function Fb(e){let t=e.length;if(!Pb.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 Ib(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Lb(e){let 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`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Rb(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function zb(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ub(e,n,r.value)}}function Bb(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Vb(e,t,n){return Bb(e,t,n,!1)}function Hb(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Bb(this,n,r(this))},set(e){Bb(this,n,e)}})}return t}function Ub(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Bb(this,t,n.bind(this))},set(e){Bb(this,t,e)}})}function Wb(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Gb,Kb=!1,qb={configurable:!0,get(){Kb=!0}};function Jb(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Gb!==e._zod?Gb=void 0:(Gb=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,qb);let e=Kb;Kb=!1;try{let r=n(this);return Kb?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Kb||=e,r}catch(n){throw delete this[t],Kb||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Yb(e,t,n,r){let i=Wb(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Xb=`~constantCatch`;function Zb(e){let t=()=>e;return t[Xb]=!0,t}var Qb,$b={value:void 0,enumerable:!1},ex=`captureStackTrace`in Error?Error:null;function tx(e){let t=ex;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return ex=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function $(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){$b.value=new a(r);try{Object.defineProperty(n,"_zod",$b)}finally{$b.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),zb(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?tx(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var nx=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},rx=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Qb=globalThis).__zod_globalConfig??(Qb.__zod_globalConfig={});var ix=globalThis.__zod_globalConfig;function ax(e){return e&&Object.assign(ix,e),ix}function ox(){let e=this._zod;return e.message??=JSON.stringify(e.def,Hy,2),e.message}function sx(e){this._zod.message=e}var cx={get:ox,set:sx,enumerable:!0,configurable:!0},lx={value:void 0,enumerable:!1},ux=new WeakSet([Object.prototype,Error.prototype]),dx=$(`$ZodError`,(e,t)=>{e.name=`$ZodError`,lx.value=t,Object.defineProperty(e,"issues",lx),lx.value=void 0,Object.defineProperty(e,"message",cx);let n=Object.getPrototypeOf(e);ux.has(n)||(ux.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function fx(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 px(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?fx(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function mx(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function hx(e,t){return{callee:t?.callee??e,Err:t?.Err}}var gx=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new nx;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Nb(e,o,ax())));throw ob(n,a?.callee??t),n}return s.value};return t},_x=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Nb(e,o,ax())));throw ob(n,a?.callee??t),n}return s.value};return t},vx=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new nx;return a.issues.length?yx(e,a.issues,i):{success:!0,data:a.value}};function yx(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Nb(e,n,ax()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var bx=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?yx(e,a.issues,i):{success:!0,data:a.value}},xx=Symbol.for(`zod.compile.invalid`),Sx=Symbol.for(`zod.compile.fallback`),Cx=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==xx)return!0;if(r.definite===!0&&n===void 0)return!1}return wx(e,t,n)});function wx(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Sx]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new nx;return a.issues.length===0}var Tx=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Ex=e=>{let t=gx(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,hx(n,a))};return n},Dx=e=>{let t=gx(e),n=(e,r,i,a)=>t(e,r,i,hx(n,a));return n},Ox=e=>{let t=_x(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,hx(n,a))};return n},kx=e=>{let t=_x(e),n=async(e,r,i,a)=>await t(e,r,i,hx(n,a));return n},Ax=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return vx(e)(t,n,i)},jx=e=>(t,n,r)=>vx(e)(t,n,r),Mx=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return bx(e)(t,n,i)},Nx=e=>async(t,n,r)=>bx(e)(t,n,r),Px=/^[cC][0-9a-z]{6,}$/,Fx=/^[0-9a-z]+$/,Ix=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Lx=/^[0-9a-vA-V]{20}$/,Rx=/^[A-Za-z0-9]{27}$/,zx=/^[a-zA-Z0-9_-]{21}$/;function Bx(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Vx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hx=/^([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})$/,Ux=e=>e?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)$/,Wx=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Gx=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Kx(){return new RegExp(Gx,`u`)}var qx=/^(?:(?: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])$/,Jx=/^(([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}|:))$/,Yx=/^((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])$/,Xx=/^(([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])$/,Zx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qx=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,$x=/^https?$/,eS=/^\+[1-9]\d{6,14}$/,tS=`(?:(?:\\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 nS(e){return RegExp(`^${e}$`)}var rS=nS(tS);function iS(e){let 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 aS(e){return RegExp(`^${iS(e)}$`)}function oS(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${iS({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${iS({precision:e.precision})}`:n;return RegExp(`^${tS}T(?:${r})$`)}var sS=/^[\s\S]{0,}$/,cS=/^-?\d+$/,lS=/^-?\d+(?:\.\d+)?$/,uS=/^(?:true|false)$/i,dS=/^[^A-Z]*$/,fS=/^[^a-z]*$/,pS=$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),mS=e=>{let t=e.value;return!Gy(t)&&t.length!==void 0},hS={number:`number`,bigint:`bigint`,object:`date`},gS=$(`$ZodCheckLessThan`,(e,t)=>{pS.init(e,t);let n=hS[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:hS[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})}}),_S=$(`$ZodCheckGreaterThan`,(e,t)=>{pS.init(e,t);let n=hS[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:hS[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})}}),vS=$(`$ZodCheckMultipleOf`,(e,t)=>{pS.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):qy(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})}}),yS=$(`$ZodCheckNumberFormat`,(e,t)=>{pS.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=gb[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),bS=$(`$ZodCheckMaxLength`,(e,t)=>{var n;pS.init(e,t),(n=e._zod.def).when??(n.when=mS),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Fb(r):i)<=t.maximum)return;let a=Ib(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),xS=$(`$ZodCheckMinLength`,(e,t)=>{var n;pS.init(e,t),(n=e._zod.def).when??(n.when=mS),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Fb(r):i)>=t.minimum)return;let a=Ib(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),SS=$(`$ZodCheckLengthEquals`,(e,t)=>{var n;pS.init(e,t),(n=e._zod.def).when??(n.when=mS),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Fb(r):i;if(a===t.length)return;let o=Ib(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),CS=$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;pS.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),wS=$(`$ZodCheckRegex`,(e,t)=>{CS.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})}}),TS=$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=dS,CS.init(e,t)}),ES=$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=fS,CS.init(e,t)}),DS=$(`$ZodCheckIncludes`,(e,t)=>{pS.init(e,t);let n=fb(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),OS=$(`$ZodCheckStartsWith`,(e,t)=>{pS.init(e,t);let n=RegExp(`^${fb(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),kS=$(`$ZodCheckEndsWith`,(e,t)=>{pS.init(e,t);let n=RegExp(`.*${fb(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),AS=$(`$ZodCheckOverwrite`,(e,t)=>{pS.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),jS=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
3
|
+
`)}\n};`)(...Object.values(this.closed))}},MS={major:4,minor:6,patch:7},NS=$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=MS;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Db(t),a;for(let o of n){if(o._zod.def.when){if(Ob(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new nx;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Mb(t.issues,n,e),i||=Db(t,n))});else{if(t.issues.length===n)continue;Mb(t.issues,n,e),i||=Db(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Db(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new nx;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new nx;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Vb(this,`~standard`,IS(this))},set"~standard"(e){Bb(this,`~standard`,e)}}),PS=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Nb(e,t,ax()))}:{value:e.value};async function FS(e,t){let n={async:!0};return PS(await e._zod.run({value:t,issues:[]},n),n)}function IS(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return PS(r,n)}catch{}return FS(e,t)},vendor:`zod`,version:1}}var LS=$(`$ZodString`,(e,t)=>{NS.init(e,t),e._zod.pattern=t.pattern??sS,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}}),RS=$(`$ZodStringFormat`,(e,t)=>{CS.init(e,t),LS.init(e,t)}),zS=$(`$ZodGUID`,(e,t)=>{t.pattern??=Hx,RS.init(e,t)}),BS=$(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ux(e)}else t.pattern??=Ux();RS.init(e,t)}),VS=$(`$ZodEmail`,(e,t)=>{t.pattern??=Wx,RS.init(e,t)});function HS(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function US(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?HS(e)||2:WS(e,t)}function WS(e,t){if(!t.normalize&&t.protocol?.source===$x.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var GS=/[\t\n\r]/g;function KS(e){return e.replace(GS,``)}function qS(e,t){return t.lastIndex=0,t.test(e.hostname)}function JS(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var YS=$(`$ZodURL`,(e,t)=>{RS.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=US(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=KS(r);return}t.hostname&&!qS(i,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&&!JS(i,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?i.href:KS(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),XS=$(`$ZodEmoji`,(e,t)=>{t.pattern??=Kx(),RS.init(e,t)}),ZS=$(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?zx:Bx(t.length),RS.init(e,t)}),QS=$(`$ZodCUID`,(e,t)=>{t.pattern??=Px,RS.init(e,t)}),$S=$(`$ZodCUID2`,(e,t)=>{t.pattern??=Fx,RS.init(e,t)}),eC=$(`$ZodULID`,(e,t)=>{t.pattern??=Ix,RS.init(e,t)}),tC=$(`$ZodXID`,(e,t)=>{t.pattern??=Lx,RS.init(e,t)}),nC=$(`$ZodKSUID`,(e,t)=>{t.pattern??=Rx,RS.init(e,t)}),rC=$(`$ZodISODateTime`,(e,t)=>{t.pattern??=oS(t),RS.init(e,t)}),iC=$(`$ZodISODate`,(e,t)=>{t.pattern??=rS,RS.init(e,t)}),aC=$(`$ZodISOTime`,(e,t)=>{t.pattern??=aS(t),RS.init(e,t)}),oC=$(`$ZodISODuration`,(e,t)=>{t.pattern??=Vx,RS.init(e,t)}),sC=$(`$ZodIPv4`,(e,t)=>{t.pattern??=qx,RS.init(e,t)}),cC=/^[0-9a-fA-F:.]+$/;function lC(e){return cC.test(e)?HS(`http://[${e}]`):!1}var uC=$(`$ZodIPv6`,(e,t)=>{t.pattern??=Jx,RS.init(e,t),e._zod.check=n=>{lC(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),dC=$(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Yx,RS.init(e,t)});function fC(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:lC(n)}var pC=$(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Xx,RS.init(e,t),e._zod.check=n=>{fC(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function mC(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var hC=/^[0-9a-zA-Z+/]*={0,2}$/,gC=$(`$ZodBase64`,(e,t)=>{t.pattern??=hC,RS.init(e,t),e._zod.check=n=>{mC(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),_C=/^[A-Za-z0-9_-]*$/;function vC(e){if(!_C.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return mC(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var yC=$(`$ZodBase64URL`,(e,t)=>{t.pattern??=_C,RS.init(e,t),e._zod.check=n=>{vC(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),bC=$(`$ZodE164`,(e,t)=>{t.pattern??=eS,RS.init(e,t)});function xC(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var SC=$(`$ZodJWT`,(e,t)=>{RS.init(e,t),e._zod.check=n=>{xC(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),CC=$(`$ZodNumber`,(e,t)=>{NS.init(e,t),e._zod.pattern=lS,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),wC=$(`$ZodNumberFormat`,(e,t)=>{yS.init(e,t),CC.init(e,t)}),TC=$(`$ZodBoolean`,(e,t)=>{NS.init(e,t),e._zod.pattern=uS,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),EC=$(`$ZodUnknown`,(e,t)=>{NS.init(e,t),e._zod.parse=e=>e}),DC=$(`$ZodNever`,(e,t)=>{NS.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function OC(e,t){let n=jb(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of jb(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Mb(n.issues,t,e),n}}return i(n,a)}}var kC=e=>Array.isArray(e)?e.length:-1;function AC(e,t,n){e.issues.length&&t.issues.push(...kb(n,e.issues)),t.value[n]=e.value}var jC=$(`$ZodArray`,(e,t)=>{NS.init(e,t);let n=ix.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>AC(t,r,e)));else if(AC(c,r,e),s&&c.issues.length!==0&&Db(c))break}return o.length?Promise.all(o).then(()=>r):r},OC(e,kC)});function MC(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...kb(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var NC=[];function PC(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:NC,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=hb(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function FC(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Db(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>MC(e,n,i,t,d,f))):MC(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var IC=$(`$ZodObject`,(e,t)=>{NS.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Wy(()=>PC(t));Jb(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Xy(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=sb,o=t.catchall,s,c=ix.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Db(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>MC(n,t,e,r,a,o))):MC(s,t,e,r,a,o)}return o?FC(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),LC=$(`$ZodObjectJIT`,(e,t)=>{IC.init(e,t);let n=e._zod.parse,r=Wy(()=>PC(t)),i=ix.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new jS([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
4
|
+
let ${e}_ab = false;
|
|
5
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
+
const iss = ${e}.issues[i];
|
|
7
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
+
payload.issues.push(iss);
|
|
9
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
+
}
|
|
11
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
+
payload.value = newResult;
|
|
13
|
+
return payload;
|
|
14
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:ib(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
15
|
+
const ${n}_present = ${i};
|
|
16
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
17
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (${e}) {
|
|
21
|
+
newResult[${r}] = ${n}.value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
`)}else f?(o.write(`
|
|
26
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
27
|
+
}
|
|
28
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
29
|
+
if (${n}.value !== undefined || ${i}) {
|
|
30
|
+
newResult[${r}] = ${n}.value;
|
|
31
|
+
}
|
|
32
|
+
`)):o.write(`
|
|
33
|
+
const ${n}_present = ${i};
|
|
34
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
35
|
+
}
|
|
36
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
37
|
+
payload.issues.push({
|
|
38
|
+
code: "invalid_type",
|
|
39
|
+
expected: "nonoptional",
|
|
40
|
+
input: undefined,
|
|
41
|
+
path: [${r}]
|
|
42
|
+
});
|
|
43
|
+
if (ctx && ctx.abortEarly) {
|
|
44
|
+
payload.value = newResult;
|
|
45
|
+
return payload;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (${n}_present) {
|
|
50
|
+
newResult[${r}] = ${n}.value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=sb,c=!ix.jitless,l=c&&cb.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?FC([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function RC(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Db(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Nb(e,r,ax())))}),t)}var zC=$(`$ZodUnion`,(e,t)=>{NS.init(e,t),Jb(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Jb(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Jb(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Jb(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Ky(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>RC(t,r,e,i)):RC(o,r,e,i)}});function BC(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var VC=$(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,zC.init(e,t);let n=e._zod.parse;Jb(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||Xy(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Zy(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Wy(()=>BC(t));e._zod.parse=(i,a)=>{let o=i.value;if(!sb(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),HC=$(`$ZodIntersection`,(e,t)=>{NS.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>WC(e,t,n)):WC(e,i,a)}});function UC(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(lb(e)&&lb(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=UC(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=UC(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function WC(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=UC(t.value,n.value);if(!c.valid){if(Db(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var GC=$(`$ZodRecord`,(e,t)=>{NS.init(e,t);let n=ix.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!lb(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Nb(e,i,ax())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...kb(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...kb(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&lS.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Nb(e,i,ax())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...kb(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...kb(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),KC=$(`$ZodEnum`,(e,t)=>{NS.init(e,t);let n=By(t.entries),r=new Set(n);e._zod.values=r,Jb(e,`pattern`,e=>{let t=By(e.def.entries).filter(e=>db.has(typeof e));return RegExp(t.length?`^(${t.map(e=>fb(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),qC=$(`$ZodLiteral`,(e,t)=>{NS.init(e,t);let n=new Set(t.values);e._zod.values=n,Jb(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?fb(e):e?fb(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),JC=$(`$ZodTransform`,(e,t)=>{NS.init(e,t),e._zod.optin=`optional`,ix.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new rx(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new nx;return n.value=i,n}});function YC(e,t){return e.value=t.issues.length?void 0:t.value,e}var XC=$(`$ZodOptional`,(e,t)=>{NS.init(e,t),Jb(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Jb(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Jb(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ky(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>YC(e,t)):YC(e,r)}return t.innerType._zod.run(e,n)}}),ZC=$(`$ZodExactOptional`,(e,t)=>{XC.init(e,t),Jb(e,`values`,e=>e.def.innerType._zod.values),Jb(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),QC=$(`$ZodNullable`,(e,t)=>{NS.init(e,t),Jb(e,`optin`,e=>e.def.innerType._zod.optin),Jb(e,`optout`,e=>e.def.innerType._zod.optout),Jb(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ky(t.source)}|null)$`):void 0}),Jb(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),$C=$(`$ZodDefault`,(e,t)=>{NS.init(e,t),e._zod.optin=`defaulted`,Jb(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ew(e,t)):ew(r,t)}});function ew(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var tw=$(`$ZodPrefault`,(e,t)=>{NS.init(e,t),e._zod.optin=`defaulted`,Jb(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),nw=$(`$ZodNonOptional`,(e,t)=>{NS.init(e,t),Jb(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>rw(t,e)):rw(i,e)}});function rw(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 iw(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Nb(e,r,ax()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var aw=$(`$ZodCatch`,(e,t)=>{NS.init(e,t),Jb(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Jb(e,`optout`,e=>e.def.innerType._zod.optout),Jb(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>iw(e,r,t,n)):iw(e,r,t,n)}}),ow=$(`$ZodPipe`,(e,t)=>{NS.init(e,t),Jb(e,`values`,e=>e.def.in._zod.values),Jb(e,`optin`,e=>e.def.in._zod.optin),Jb(e,`optout`,e=>e.def.out._zod.optout),Jb(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>sw(e,t.in,n)):sw(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>sw(e,t.out,n)):sw(r,t.out,n)}});function sw(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var cw=$(`$ZodPreprocess`,(e,t)=>{ow.init(e,t)}),lw=$(`$ZodReadonly`,(e,t)=>{NS.init(e,t),Jb(e,`propValues`,e=>e.def.innerType._zod.propValues),Jb(e,`values`,e=>e.def.innerType._zod.values),Jb(e,`optin`,e=>e.def.innerType?._zod?.optin),Jb(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(uw):uw(r)}});function uw(e){return e.memo||(e.value=Object.freeze(e.value)),e}var dw=$(`$ZodLazy`,(e,t)=>{NS.init(e,t),Yy(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),Jb(e,`pattern`,e=>e.innerType?._zod?.pattern),Jb(e,`propValues`,e=>e.innerType?._zod?.propValues),Jb(e,`optin`,e=>e.innerType?._zod?.optin??void 0),Jb(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),fw=$(`$ZodCustom`,(e,t)=>{pS.init(e,t),NS.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>pw(t,n,r,e));pw(i,n,r,e)}});function pw(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Rb(e))}}var mw=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},hw=`~memo`,gw=[];function _w(e){return typeof e==`object`&&!!e}function vw(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var yw=new WeakMap,bw=0,xw=1,Sw=2;function Cw(e,t,n){let r=yw.get(e);if(r!==void 0)return r?Sw:bw;if(t.has(e))return Sw;t.add(e);let i=bw,a=e=>{if(i!==Sw&&e?._zod){let r=Cw(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=bw;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?xw:o.value?._zod?Cw(o.value,t,n):bw;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Zy(c);s(e?o(e,!0):xw),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Cw(r,t,!1):xw);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(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),ww(e,i)}function ww(e,t){return t!==xw&&yw.set(e,t===Sw),t}function Tw(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Ew,Dw=[],Ow={alloc(e,t,n){let r=Ew;if(!r)return n;Ew=void 0;let i={value:n,issues:null};return r.set(t.value,i),Dw.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Aw(n,e.value))throw new mw;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Cw(e,new Set,!1);if(i===bw)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Sw||r?n=!0:r=!0}let l=s.value;if(!_w(l))return t(s,c);let u=c[hw];u||(u={buckets:new WeakMap,backEdges:void 0},c[hw]=u);let d;i===c?d=a:(d=Tw(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...vw(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Ew=d;let p=Dw.length,m=t(s,c);Ew=void 0;let h=Dw.length>p?Dw.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?vw(e.issues):gw),e)):(h&&(h.issues=m.issues.length?vw(m.issues):gw),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function kw(){return Ow}function Aw(e,t){let n=e[hw]?.backEdges;return n!==void 0&&_w(t)&&n.has(t)}var jw=()=>{let 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(t){return e[t]??null}let 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 i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Lb(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${mb(e.values[0])}`:`Invalid option: expected one of ${Vy(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Vy(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Mw(){return{localeError:jw()}}var Nw,Pw=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Fw(){return new Pw}(Nw=globalThis).__zod_globalRegistry??(Nw.__zod_globalRegistry=Fw());var Iw=globalThis.__zod_globalRegistry;function Lw(e){return e.checks&&=[...e.checks],e}function Rw(e,t){return new e(Lw({type:`string`,...Q(t)}))}function zw(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Q(t)})}function Bw(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Q(t)})}function Vw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Q(t)})}function Hw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Q(t)})}function Uw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Q(t)})}function Ww(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Q(t)})}function Gw(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Q(t)})}function Kw(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Q(t)})}function qw(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Q(t)})}function Jw(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Q(t)})}function Yw(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Q(t)})}function Xw(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Q(t)})}function Zw(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Q(t)})}function Qw(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Q(t)})}function $w(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Q(t)})}function eT(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Q(t)})}function tT(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Q(t)})}function nT(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Q(t)})}function rT(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Q(t)})}function iT(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Q(t)})}function aT(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Q(t)})}function oT(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Q(t)})}function sT(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Q(t)})}function cT(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Q(t)})}function lT(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Q(t)})}function uT(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Q(t)})}function dT(e,t){return new e(Lw({type:`number`,checks:[],...Q(t)}))}function fT(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Q(t)})}function pT(e,t){return new e({type:`boolean`,...Q(t)})}function mT(e){return new e({type:`unknown`})}function hT(e,t){return new e({type:`never`,...Q(t)})}function gT(e,t){return new gS({check:`less_than`,...Q(t),value:e,inclusive:!1})}function _T(e,t){return new gS({check:`less_than`,...Q(t),value:e,inclusive:!0})}function vT(e,t){return new _S({check:`greater_than`,...Q(t),value:e,inclusive:!1})}function yT(e,t){return new _S({check:`greater_than`,...Q(t),value:e,inclusive:!0})}function bT(e,t){return new vS({check:`multiple_of`,...Q(t),value:e})}function xT(e,t){return new bS({check:`max_length`,...Q(t),maximum:e})}function ST(e,t){return new xS({check:`min_length`,...Q(t),minimum:e})}function CT(e,t){return new SS({check:`length_equals`,...Q(t),length:e})}function wT(e,t){return new wS({check:`string_format`,format:`regex`,...Q(t),pattern:e})}function TT(e){return new TS({check:`string_format`,format:`lowercase`,...Q(e)})}function ET(e){return new ES({check:`string_format`,format:`uppercase`,...Q(e)})}function DT(e,t){return new DS({check:`string_format`,format:`includes`,...Q(t),includes:e})}function OT(e,t){return new OS({check:`string_format`,format:`starts_with`,...Q(t),prefix:e})}function kT(e,t){return new kS({check:`string_format`,format:`ends_with`,...Q(t),suffix:e})}function AT(e){return new AS({check:`overwrite`,tx:e})}function jT(e){return AT(t=>t.normalize(e))}function MT(){return AT(e=>e.trim())}function NT(){return AT(e=>e.toLowerCase())}function PT(){return AT(e=>e.toUpperCase())}function FT(){return AT(e=>ab(e))}function IT(e,t,n){return new e({type:`array`,element:t,...Q(n)})}function LT(e,t,n){let r=Q(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function RT(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Q(n)})}function zT(e,t){let n=BT(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Rb(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Rb(r))}},e(t.value,t)),t);return n}function BT(e,t){let n=new pS({check:`custom`,...Q(t)});return n._zod.check=e,n}function VT(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Xy(e,t,n[t]);return e}function HT(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Iw,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function UT(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function WT(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,WT(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&VT(o.schema,c),t.io===`input`&&eE(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function GT(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function KT(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${GT(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+GT(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
54
|
+
|
|
55
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function qT(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;qT(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var JT=new Set([`type`,`properties`,`required`,`additionalProperties`]),YT=[`oneOf`,`anyOf`];function XT(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ZT(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!JT.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??XT(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Xy(n,r,e.length===1?e[0]:ZT(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=XT(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function QT(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of JT)if(t in e)return;let n=t.filter(e=>YT.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ZT(t);else{let e=n[0],i=YT.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>ZT([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,VT(e,r))}function $T(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):VT(i,s),VT(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())qT(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])QT(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}VT(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Xy(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:nE(t,`input`,e.processors),output:nE(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function eE(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return eE(r.element,n);if(r.type===`set`)return eE(r.valueType,n);if(r.type===`lazy`)return eE(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 eE(r.innerType,n);if(r.type===`intersection`)return eE(r.left,n)||eE(r.right,n);if(r.type===`record`||r.type===`map`)return eE(r.keyType,n)||eE(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:eE(r.in,n)||eE(r.out,n);if(r.type===`object`){for(let e in r.shape)if(eE(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(eE(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(eE(e,n))return!0;return!!(r.rest&&eE(r.rest,n))}return!1}var tE=(e,t={})=>n=>{let r=HT({...n,processors:t});return WT(e,r),KT(r,e),$T(r,e)},nE=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=HT({...i??{},target:a,io:t,processors:n});return WT(e,o),KT(o,e),$T(o,e)},rE=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},iE=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},aE=(e,t)=>{rE(e,`minimum`,t),iE(e,`maximum`,t)},oE=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},sE=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},cE=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},lE=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},uE=(e,t)=>rE(e,`minimum`,t.minimum),dE=(e,t)=>iE(e,`maximum`,t.maximum),fE=e=>(t,n)=>{lE(t,n.format);let[r,i]=e[n.format];rE(t,`minimum`,r),iE(t,`maximum`,i)},pE={greater_than:(e,t)=>rE(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>iE(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>oE(e,t.value),number_format:fE(gb),bigint_format:fE(_b),min_length:uE,max_length:dE,length_equals:(e,t)=>aE(e,t.length),min_size:uE,max_size:dE,size_equals:(e,t)=>aE(e,t.size),string_format:(e,t)=>{lE(e,t.format),t.pattern&&sE(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)=>cE(e,t.mime)};function mE(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)pE[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&rE(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&rE(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&iE(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&iE(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&oE(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&cE(t,i.mime);for(let e of i.patterns??[])sE(t,e);return t}var hE={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},gE=new Map([[hC,Zx],[_C,Qx]]),_E=e=>gE.get(e)??e,vE=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=mE(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=hE[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(_E);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},yE=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=mE(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):UT(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},bE=(e,t,n,r)=>{n.type=`boolean`},xE=(e,t,n,r)=>{UT(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},SE=(e,t,n,r)=>{UT(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},CE=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},wE=(e,t,n,r)=>{UT(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},TE=(e,t,n,r)=>{UT(e,t,n,r,`Void cannot be represented in JSON Schema`)},EE=(e,t,n,r)=>{n.not={}},DE=(e,t,n,r)=>{},OE=(e,t,n,r)=>{},kE=(e,t,n,r)=>{UT(e,t,n,r,`Date cannot be represented in JSON Schema`)},AE=(e,t,n,r)=>{let i=e._zod.def,a=By(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},jE=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(UT(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(UT(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},ME=(e,t,n,r)=>{UT(e,t,n,r,`NaN cannot be represented in JSON Schema`)},NE=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},PE=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=mE(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},FE=(e,t,n,r)=>{n.type=`boolean`},IE=(e,t,n,r)=>{UT(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},LE=(e,t,n,r)=>{UT(e,t,n,r,`Function types cannot be represented in JSON Schema`)},RE=(e,t,n,r)=>{UT(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},zE=(e,t,n,r)=>{UT(e,t,n,r,`Map cannot be represented in JSON Schema`)},BE=(e,t,n,r)=>{UT(e,t,n,r,`Set cannot be represented in JSON Schema`)},VE=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=mE(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=WT(a.element,t,{...r,path:[...r.path,`items`]})};function HE(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?HE(t.out):t.type===`catch`?HE(t.innerType):e._zod.optin}var UE=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&UT(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Xy(i.properties,e,WT(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?HE(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=WT(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},WE=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>WT(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},GE=(e,t,n,r)=>{let i=e._zod.def,a=WT(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=WT(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},KE=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>WT(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?WT(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?HE(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=mE(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function qE(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=qE(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>qE(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?lS:cS).source)),p}var JE=new WeakMap;function YE(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of JE.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=qE(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var XE=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=mE(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=WT(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Xy(i.patternProperties,_E(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=WT(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=JE.get(t);n||(n=[],JE.set(t,n),t.deferred.push(()=>YE(t))),n.push(e)}i.additionalProperties=WT(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&HE(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},ZE=(e,t,n,r)=>{let i=e._zod.def,a=WT(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},QE=(e,t,n,r)=>{let i=e._zod.def;WT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$E=Symbol();function eD(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(UT(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),$E):JSON.parse(o)}var tD=(e,t,n,r)=>{let i=e._zod.def;WT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=eD(i.defaultValue,e,t,n,r);o!==$E&&(n.default=o)},nD=(e,t,n,r)=>{let i=e._zod.def;WT(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=eD(i.defaultValue,e,t,n,r);o!==$E&&(n._prefault=o)},rD=(e,t,n,r)=>{let i=e._zod.def;WT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{UT(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},iD=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;WT(o,t,r);let s=t.seen.get(e);s.ref=o},aD=(e,t,n,r)=>{let i=e._zod.def;WT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},oD=(e,t,n,r)=>{let i=e._zod.def;WT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},sD=(e,t,n,r)=>{let i=e._zod.def;WT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},cD=(e,t,n,r)=>{let i=e._zod.innerType;WT(i,t,r);let a=t.seen.get(e);a.ref=i},lD={string:vE,number:yE,boolean:bE,bigint:xE,symbol:SE,null:CE,undefined:wE,void:TE,never:EE,any:DE,unknown:OE,date:kE,enum:AE,literal:jE,nan:ME,template_literal:NE,file:PE,success:FE,custom:IE,function:LE,transform:RE,map:zE,set:BE,array:VE,object:UE,union:WE,intersection:GE,tuple:KE,record:XE,nullable:ZE,nonoptional:QE,default:tD,prefault:nD,catch:rD,pipe:iD,readonly:aD,promise:oD,optional:sD,lazy:cD};function uD(e,t){if(`_idmap`in e){let n=e,r=HT({...t,processors:lD}),i={};for(let e of n._idmap.entries()){let[t,n]=e;WT(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;KT(r,n),Xy(a,t,$T(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=HT({...t,processors:lD});return WT(e,n),KT(n,e),$T(n,e)}var dD=new WeakSet([Object.prototype,Error.prototype]);function fD(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var pD=$(`ZodError`,(e,t)=>{dx.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);dD.has(n)||(dD.add(n),fD(n,`format`,e=>t=>mx(e,t)),fD(n,`flatten`,e=>t=>px(e,t)),fD(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Hy,2)}),fD(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Hy,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),mD=gx(pD),hD=_x(pD),gD=vx(pD),_D=bx(pD),vD=Ex(pD),yD=Dx(pD),bD=Ox(pD),xD=kx(pD),SD=Ax(pD),CD=jx(pD),wD=Mx(pD),TD=Nx(pD);function ED(){ix.localeError||ax(Mw())}function DD(){ix.memoizer||ax({memoizer:kw()})}var OD=$(`ZodType`,(e,t)=>(ED(),NS.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(rb(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return pb(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check($O(e,t))},superRefine(e,t){return this.check(ek(e,t))},overwrite(e){return this.check(AT(e))},optional(){return jO(this)},exactOptional(){return NO(this)},nullable(){return FO(this)},nullish(){return jO(FO(this))},nonoptional(e){return VO(this,e)},array(){return pO(this)},or(e){return _O([this,e])},and(e){return xO(this,e)},transform(e){return GO(this,kO(e))},default(e){return LO(this,e)},prefault(e){return zO(this,e)},catch(e){return UO(this,e)},pipe(e){return GO(this,e)},readonly(){return JO(this)},describe(e){let t=this.clone();return Iw.add(t,{description:e}),t},meta(...e){if(e.length===0)return Iw.get(this);let t=this.clone();return Iw.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 Vb(this,`~standard`,{...IS(this),jsonSchema:{input:nE(this,`input`),output:nE(this,`output`)}})},set"~standard"(e){Bb(this,`~standard`,e)},parse:function e(t,n){return mD(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await hD(this,t,n,{callee:e})},safeParse(e,t){return gD(this,e,t)},async safeParseAsync(e,t){return _D(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Bb(this,`spa`,e)},validate(e,t){return Cx(this,e,t)},validateAsync(e,t){return Tx(this,e,t)},encode:function e(t,n){return vD(this,t,n,{callee:e})},decode:function e(t,n){return yD(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await bD(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await xD(this,t,n,{callee:e})},safeEncode(e,t){return SD(this,e,t)},safeDecode(e,t){return CD(this,e,t)},async safeEncodeAsync(e,t){return wD(this,e,t)},async safeDecodeAsync(e,t){return TD(this,e,t)},toJSONSchema(e){return tE(this,{})(e)},get description(){return Iw.get(this)?.description},get _def(){return this._zod.def}}),kD=$(`_ZodString`,(e,t)=>{LS.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vE(e,t,n,r)},Hb({format:e=>mE(e).format??null,minLength:e=>mE(e).minimum??null,maxLength:e=>mE(e).maximum??null},{regex(...e){return this.check(wT(...e))},includes(...e){return this.check(DT(...e))},startsWith(...e){return this.check(OT(...e))},endsWith(...e){return this.check(kT(...e))},min(...e){return this.check(ST(...e))},max(...e){return this.check(xT(...e))},length(...e){return this.check(CT(...e))},nonempty(...e){return this.check(ST(1,...e))},lowercase(e){return this.check(TT(e))},uppercase(e){return this.check(ET(e))},trim(){return this.check(MT())},normalize(...e){return this.check(jT(...e))},toLowerCase(){return this.check(NT())},toUpperCase(){return this.check(PT())},slugify(){return this.check(FT())}})),AD=$(`ZodString`,(e,t)=>{LS.init(e,t),kD.init(e,t)},{email(e){return this.check(zw(LD,e))},url(e){return this.check(Gw(BD,e))},jwt(e){return this.check(oT(tO,e))},emoji(e){return this.check(Kw(VD,e))},guid(e){return this.check(Bw(RD,e))},uuid(e){return this.check(Vw(zD,e))},uuidv4(e){return this.check(Hw(zD,e))},uuidv6(e){return this.check(Uw(zD,e))},uuidv7(e){return this.check(Ww(zD,e))},nanoid(e){return this.check(qw(HD,e))},cuid(e){return this.check(Jw(UD,e))},cuid2(e){return this.check(Yw(WD,e))},ulid(e){return this.check(Xw(GD,e))},base64(e){return this.check(rT(QD,e))},base64url(e){return this.check(iT($D,e))},xid(e){return this.check(Zw(KD,e))},ksuid(e){return this.check(Qw(qD,e))},ipv4(e){return this.check($w(JD,e))},ipv6(e){return this.check(eT(YD,e))},cidrv4(e){return this.check(tT(XD,e))},cidrv6(e){return this.check(nT(ZD,e))},e164(e){return this.check(aT(eO,e))},datetime(e){return this.check(sT(ND,e))},date(e){return this.check(cT(PD,e))},time(e){return this.check(lT(FD,e))},duration(e){return this.check(uT(ID,e))}});function jD(e){return Rw(AD,e)}var MD=$(`ZodStringFormat`,(e,t)=>{RS.init(e,t),kD.init(e,t)}),ND=$(`ZodISODateTime`,(e,t)=>{rC.init(e,t),MD.init(e,t)}),PD=$(`ZodISODate`,(e,t)=>{iC.init(e,t),MD.init(e,t)}),FD=$(`ZodISOTime`,(e,t)=>{aC.init(e,t),MD.init(e,t)}),ID=$(`ZodISODuration`,(e,t)=>{oC.init(e,t),MD.init(e,t)}),LD=$(`ZodEmail`,(e,t)=>{VS.init(e,t),MD.init(e,t)}),RD=$(`ZodGUID`,(e,t)=>{zS.init(e,t),MD.init(e,t)}),zD=$(`ZodUUID`,(e,t)=>{BS.init(e,t),MD.init(e,t)}),BD=$(`ZodURL`,(e,t)=>{YS.init(e,t),MD.init(e,t)}),VD=$(`ZodEmoji`,(e,t)=>{XS.init(e,t),MD.init(e,t)}),HD=$(`ZodNanoID`,(e,t)=>{ZS.init(e,t),MD.init(e,t)}),UD=$(`ZodCUID`,(e,t)=>{QS.init(e,t),MD.init(e,t)}),WD=$(`ZodCUID2`,(e,t)=>{$S.init(e,t),MD.init(e,t)}),GD=$(`ZodULID`,(e,t)=>{eC.init(e,t),MD.init(e,t)}),KD=$(`ZodXID`,(e,t)=>{tC.init(e,t),MD.init(e,t)}),qD=$(`ZodKSUID`,(e,t)=>{nC.init(e,t),MD.init(e,t)}),JD=$(`ZodIPv4`,(e,t)=>{sC.init(e,t),MD.init(e,t)}),YD=$(`ZodIPv6`,(e,t)=>{uC.init(e,t),MD.init(e,t)}),XD=$(`ZodCIDRv4`,(e,t)=>{dC.init(e,t),MD.init(e,t)}),ZD=$(`ZodCIDRv6`,(e,t)=>{pC.init(e,t),MD.init(e,t)}),QD=$(`ZodBase64`,(e,t)=>{gC.init(e,t),MD.init(e,t)}),$D=$(`ZodBase64URL`,(e,t)=>{yC.init(e,t),MD.init(e,t)}),eO=$(`ZodE164`,(e,t)=>{bC.init(e,t),MD.init(e,t)}),tO=$(`ZodJWT`,(e,t)=>{SC.init(e,t),MD.init(e,t)}),nO=$(`ZodNumber`,(e,t)=>{CC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yE(e,t,n,r),e.isFinite=!0},Hb({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=mE(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=mE(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=mE(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>mE(e).format??null},{gt(e,t){return this.check(vT(e,t))},gte(e,t){return this.check(yT(e,t))},min(e,t){return this.check(yT(e,t))},lt(e,t){return this.check(gT(e,t))},lte(e,t){return this.check(_T(e,t))},max(e,t){return this.check(_T(e,t))},int(e){return this.check(aO(e))},safe(e){return this.check(aO(e))},positive(e){return this.check(vT(0,e))},nonnegative(e){return this.check(yT(0,e))},negative(e){return this.check(gT(0,e))},nonpositive(e){return this.check(_T(0,e))},multipleOf(e,t){return this.check(bT(e,t))},step(e,t){return this.check(bT(e,t))},finite(){return this}}));function rO(e){return dT(nO,e)}var iO=$(`ZodNumberFormat`,(e,t)=>{wC.init(e,t),nO.init(e,t)});function aO(e){return fT(iO,e)}var oO=$(`ZodBoolean`,(e,t)=>{TC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bE(e,t,n,r)});function sO(e){return pT(oO,e)}var cO=$(`ZodUnknown`,(e,t)=>{EC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function lO(){return mT(cO)}var uO=$(`ZodNever`,(e,t)=>{DC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EE(e,t,n,r)});function dO(e){return hT(uO,e)}var fO=$(`ZodArray`,(e,t)=>{DD(),jC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VE(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ST(e,t))},nonempty(e){return this.check(ST(1,e))},max(e,t){return this.check(xT(e,t))},length(e,t){return this.check(CT(e,t))},unwrap(){return this.element}});function pO(e,t){return IT(fO,e,t)}var mO=$(`ZodObject`,(e,t)=>{DD(),LC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UE(e,t,n,r),Yb(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return TO(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(rb(this._zod.def,{catchall:e}))},passthrough(){return this.clone(rb(this._zod.def,{catchall:lO()}))},loose(){return this.clone(rb(this._zod.def,{catchall:lO()}))},strict(){return this.clone(rb(this._zod.def,{catchall:dO()}))},strip(){return this.clone(rb(this._zod.def,{catchall:void 0}))},extend(e){return xb(this,e)},safeExtend(e){return Cb(this,e)},merge(e){return wb(this,e)},pick(e){return vb(this,e)},omit(e){return bb(this,e)},partial(...e){return Tb(AO,this,e[0])},exactPartial(...e){return Tb(MO,this,e[0],`exactPartial`)},required(...e){return Eb(BO,this,e[0])}});function hO(e,t){return new mO({type:`object`,shape:e??{},...Q(t)})}var gO=$(`ZodUnion`,(e,t)=>{zC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WE(e,t,n,r),e.options=t.options});function _O(e,t){return new gO({type:`union`,options:e,...Q(t)})}var vO=$(`ZodDiscriminatedUnion`,(e,t)=>{gO.init(e,t),VC.init(e,t)});function yO(e,t,n){return new vO({type:`union`,options:t,discriminator:e,...Q(n)})}var bO=$(`ZodIntersection`,(e,t)=>{HC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GE(e,t,n,r)});function xO(e,t){return new bO({type:`intersection`,left:e,right:t})}var SO=$(`ZodRecord`,(e,t)=>{DD(),GC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XE(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function CO(e,t,n){return!t||!t._zod?new SO({type:`record`,keyType:jD(),valueType:e,...Q(t)}):new SO({type:`record`,keyType:e,valueType:t,...Q(n)})}var wO=$(`ZodEnum`,(e,t)=>{KC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AE(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new wO({...t,checks:[],...Q(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new wO({...t,checks:[],...Q(r),entries:i})}});function TO(e,t){return new wO({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Q(t)})}var EO=$(`ZodLiteral`,(e,t)=>{qC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jE(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function DO(e,t){return new EO({type:`literal`,values:Array.isArray(e)?e:[e],...Q(t)})}var OO=$(`ZodTransform`,(e,t)=>{DD(),JC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RE(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new rx(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Rb(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Rb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function kO(e){return new OO({type:`transform`,transform:e})}var AO=$(`ZodOptional`,(e,t)=>{XC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jO(e){return new AO({type:`optional`,innerType:e})}var MO=$(`ZodExactOptional`,(e,t)=>{ZC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function NO(e){return new MO({type:`optional`,innerType:e})}var PO=$(`ZodNullable`,(e,t)=>{QC.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ZE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function FO(e){return new PO({type:`nullable`,innerType:e})}var IO=$(`ZodDefault`,(e,t)=>{$C.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function LO(e,t){return new IO({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ub(t)}})}var RO=$(`ZodPrefault`,(e,t)=>{tw.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zO(e,t){return new RO({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ub(t)}})}var BO=$(`ZodNonOptional`,(e,t)=>{nw.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>QE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function VO(e,t){return new BO({type:`nonoptional`,innerType:e,...Q(t)})}var HO=$(`ZodCatch`,(e,t)=>{aw.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function UO(e,t){return new HO({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Zb(t)})}var WO=$(`ZodPipe`,(e,t)=>{ow.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iD(e,t,n,r),e.in=t.in,e.out=t.out});function GO(e,t){return new WO({type:`pipe`,in:e,out:t})}var KO=$(`ZodPreprocess`,(e,t)=>{WO.init(e,t),cw.init(e,t)}),qO=$(`ZodReadonly`,(e,t)=>{lw.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function JO(e){return new qO({type:`readonly`,innerType:e})}var YO=$(`ZodLazy`,(e,t)=>{dw.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cD(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function XO(e){return new YO({type:`lazy`,getter:e})}var ZO=$(`ZodCustom`,(e,t)=>{fw.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IE(e,t,n,r)});function QO(e,t){return LT(ZO,e??(()=>!0),t)}function $O(e,t={}){return RT(ZO,e,t)}function ek(e,t){return zT(e,t)}function tk(e,t){return new KO({type:`pipe`,in:kO(e),out:t})}var nk=l(`IconChevronLeftMedium`,()=>(0,w.jsx)(`path`,{d:`M14.5 18L8.5 12L14.5 6`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})),rk=`text-muted-foreground hover:text-foreground`,ik=`text-muted-foreground group-hover:text-foreground`,ak=8,ok=(e,{enabled:t=!0,startFollowing:n=!0,onFollowingChange:r})=>{let i=(0,C.useRef)(t&&n),a=(0,C.useRef)(null),o=(0,C.useRef)(!1),s=(0,C.useRef)(null);C.useEffect(()=>{if(!t||!e?.current)return;let n=e.current,c=e=>{i.current!==e&&(i.current=e,r?.(e))},l=()=>{i.current&&(a.current!==null&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{i.current&&(n.scrollTop=n.scrollHeight),a.current=null}))},u=new MutationObserver(l);u.observe(n,{childList:!0,subtree:!0,characterData:!0});let d=new ResizeObserver(l);d.observe(n);let f=()=>{a.current!==null&&(cancelAnimationFrame(a.current),a.current=null)},p=()=>{c(!1),f()},m=()=>{o.current=!0,s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{o.current=!1,s.current=null},250)},h=e=>{m(),e.deltaY<0&&p()},g=e=>{m(),[`ArrowUp`,`PageUp`,`Home`].includes(e.key)&&p()},_=e=>{let t=e.target;t.scrollTop+t.clientHeight>=t.scrollHeight-ak?c(!0):o.current&&(c(!1),f())};return n.addEventListener(`wheel`,h,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`pointerdown`,m),n.addEventListener(`keydown`,g),n.addEventListener(`scroll`,_),l(),()=>{n.removeEventListener(`wheel`,h),n.removeEventListener(`touchmove`,m),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`keydown`,g),n.removeEventListener(`scroll`,_),u.disconnect(),d.disconnect(),f(),s.current!==null&&(window.clearTimeout(s.current),s.current=null)}},[t,e,r])},sk=C.createContext(void 0);function ck(){let e=C.useContext(sk);if(e===void 0)throw Error(U(53));return e}function lk(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=`${t}${n===`x`?`Inline`:`Block`}`,a=parseFloat(r[`${i}Start`]);return n===`x`&&t===`margin`?a*2:a+parseFloat(r[`${i}End`])}var uk=`base-ui-disable-scrollbar`,dk={className:uk,getElement(e){return(0,w.jsx)(`style`,{nonce:e,href:uk,precedence:`base-ui:low`,children:`.${uk}{scrollbar-width:none}.${uk}::-webkit-scrollbar{display:none}`})}},fk=`data-has-overflow-x`,pk=`data-has-overflow-y`,mk=`data-overflow-x-start`,hk=`data-overflow-x-end`,gk=`data-overflow-y-start`,_k=`data-overflow-y-end`,vk=e=>t=>t?{[e]:``}:null,yk={hasOverflowX:vk(fk),hasOverflowY:vk(pk),overflowXStart:vk(mk),overflowXEnd:vk(hk),overflowYStart:vk(gk),overflowYEnd:vk(_k),cornerHidden:()=>null},bk=C.createContext(void 0),xk={disableStyleElements:!1};function Sk(){return C.useContext(bk)??xk}var Ck=`--scroll-area-corner-height`,wk=`--scroll-area-corner-width`,Tk=`data-orientation`,Ek={x:0,y:0},Dk={width:0,height:0},Ok={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},kk={x:!0,y:!0,corner:!0},Ak=C.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,style:a,...o}=e,{xStart:s,xEnd:c,yStart:l,yEnd:u}=jk(i),d=Ts(),f=K(),p=K(),{nonce:h,disableStyleElements:g}=Sk(),[_,v]=C.useState(!1),[y,b]=C.useState(!1),[x,S]=C.useState(!1),[T,E]=C.useState(!1),[D,O]=C.useState(!1),[k,A]=C.useState(Dk),[j,M]=C.useState(Dk),[N,P]=C.useState(Ok),[F,I]=C.useState(kk),L=C.useRef(null),R=C.useRef(null),ee=C.useRef(null),z=C.useRef(null),te=C.useRef(null),ne=C.useRef(null),B=C.useRef(null),V=C.useRef(null),re=C.useRef(0),ie=C.useRef(0),H=C.useRef(0),ae=C.useRef(0),U=C.useRef(`vertical`),W=C.useRef(Ek),G=C.useRef(null);function oe(e){let t=e?S:b,n=e?f:p;t(!0),n.start(500,()=>{t(!1)})}let se=X(e=>{let t=e.x-W.current.x,n=e.y-W.current.y;W.current=e,n!==0&&oe(!0),t!==0&&oe(!1)}),ce=X(()=>{let e=R.current;e&&G.current===null&&(G.current=e.style.scrollSnapType,e.style.scrollSnapType=`none`)}),le=X(e=>{if(e.button!==0||V.current!==null&&(U.current===`vertical`?te.current:ne.current)?.hasPointerCapture(V.current))return;V.current=e.pointerId,re.current=e.clientY,ie.current=e.clientX,U.current=e.currentTarget.getAttribute(Tk);let t=R.current;t&&(H.current=t.scrollTop,ae.current=t.scrollLeft,ce()),(U.current===`vertical`?te.current:ne.current)?.setPointerCapture(e.pointerId)}),ue=X(e=>{if(e.pointerId!==V.current)return;V.current=null,(U.current===`vertical`?S:b)(!1),G.current!==null&&(R.current&&(R.current.style.scrollSnapType=G.current),G.current=null);let t=U.current===`vertical`?te.current:ne.current;t?.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}),de=X(e=>{if(e.pointerId!==V.current)return;if(e.buttons%2==0){ue(e);return}let t=R.current;if(!t)return;let n=U.current===`vertical`,r=n?te.current:ne.current,i=n?ee.current:z.current;if(!r||!i)return;let a=n?`y`:`x`,o=lk(i,`padding`,a),s=lk(r,`margin`,a),c=n?r.offsetHeight:r.offsetWidth,l=(n?i.offsetHeight:i.offsetWidth)-c-o-s,u=n?e.clientY-re.current:e.clientX-ie.current,d=l<=0?0:u/l,f=n?t.scrollHeight:t.scrollWidth,p=n?t.clientHeight:t.clientWidth,m=(n?H.current:ae.current)+d*(f-p);n?t.scrollTop=m:t.scrollLeft=m,e.preventDefault(),oe(n)});function fe(e){E(e.pointerType===`touch`)}function pe(e){if(fe(e),e.pointerType!==`touch`){let t=J(L.current,e.target);v(t)}}let me=C.useMemo(()=>({scrolling:y||x,hasOverflowX:!F.x,hasOverflowY:!F.y,overflowXStart:N.xStart,overflowXEnd:N.xEnd,overflowYStart:N.yStart,overflowYEnd:N.yEnd,cornerHidden:F.corner}),[y,x,F.x,F.y,F.corner,N]),he={role:`presentation`,onPointerEnter:pe,onPointerMove:pe,onPointerDown:fe,onPointerLeave(){v(!1)},style:{position:`relative`,[Ck]:`${k.height}px`,[wk]:`${k.width}px`}},ge=m(`div`,e,{state:me,ref:[t,L],props:[he,o],stateAttributesMapping:yk}),_e=C.useMemo(()=>({handlePointerDown:le,handlePointerMove:de,handlePointerUp:ue,handleScroll:se,disableViewportSnap:ce,cornerSize:k,setCornerSize:A,thumbSize:j,setThumbSize:M,hasMeasuredScrollbar:D,setHasMeasuredScrollbar:O,touchModality:T,cornerRef:B,scrollingX:y,scrollingY:x,hovering:_,setHovering:v,viewportRef:R,scrollbarYRef:ee,scrollbarXRef:z,thumbYRef:te,thumbXRef:ne,rootId:d,hiddenState:F,setHiddenState:I,overflowEdges:N,setOverflowEdges:P,viewportState:me,overflowEdgeThreshold:{xStart:s,xEnd:c,yStart:l,yEnd:u}}),[le,de,ue,se,ce,k,j,D,T,y,x,_,d,F,N,me,s,c,l,u]);return(0,w.jsxs)(sk.Provider,{value:_e,children:[!g&&dk.getElement(h),ge]})});function jk(e){let t=typeof e==`number`?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}var Mk=C.createContext(void 0);function Nk(){let e=C.useContext(Mk);if(e===void 0)throw Error(U(55));return e}function Pk(e,t){return Math.max(0,e-t)}function Fk(e,t){if(t<=0)return 0;let n=y_(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var Ik=`--scroll-area-overflow-x-start`,Lk=`--scroll-area-overflow-x-end`,Rk=`--scroll-area-overflow-y-start`,zk=`--scroll-area-overflow-y-end`,Bk=`--scroll-area-thumb-height`,Vk=`--scroll-area-thumb-width`,Hk=[Ik,Lk,Rk,zk],Uk=!1;function Wk(){Uk||be||(typeof CSS<`u`&&`registerProperty`in CSS&&Hk.forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),Uk=!0)}var Gk=C.forwardRef(function(e,t){let{render:n,className:r,style:a,...o}=e,{viewportRef:s,scrollbarYRef:c,scrollbarXRef:l,thumbYRef:u,thumbXRef:d,cornerRef:f,cornerSize:p,setCornerSize:h,setThumbSize:g,rootId:_,setHiddenState:v,hiddenState:y,setHasMeasuredScrollbar:b,handleScroll:x,touchModality:S,setHovering:T,setOverflowEdges:E,overflowEdgeThreshold:D,viewportState:O}=ck(),k=zs(),A=C.useRef(!0),j=C.useRef([NaN,NaN,NaN,NaN]),M=K(),N=K(),P=X(()=>{let e=s.current,t=c.current,n=l.current,r=u.current,i=d.current,a=f.current;if(!e)return;let o=e.scrollHeight,m=e.scrollWidth,_=e.clientHeight,y=e.clientWidth,x=e.scrollTop,S=e.scrollLeft,C=j.current,w=Number.isNaN(C[0]);if(C[0]=_,C[1]=o,C[2]=y,C[3]=m,w&&b(!0),o===0||m===0)return;let T=Kk(e),O=T.y,A=T.x,M=y/m,N=_/o,P=Math.max(0,m-y),F=Math.max(0,o-_),I=0,L=0;A||(I=Fk(k===`rtl`?-S:S,P),L=P-I);let R=O?0:Fk(x,F),ee=O?0:F-R,z=A?0:y,te=O?0:_,ne=0,B=0;!A&&!O&&(ne=t?.offsetWidth||0,B=n?.offsetHeight||0);let V=p.width===0&&p.height===0,re=V?ne:0,ie=V?B:0,H=lk(n,`padding`,`x`),ae=lk(t,`padding`,`y`),U=lk(i,`margin`,`x`),W=lk(r,`margin`,`y`),G=z-H-U,oe=te-ae-W,se=n?Math.min(n.offsetWidth-re,G):G,ce=t?Math.min(t.offsetHeight-ie,oe):oe,K=Math.max(16,se*M),le=Math.max(16,ce*N);if(g(e=>qk(e,{width:K,height:le})),t&&r){let e=Jk(r,Bk,x,F,o,le,t.offsetHeight-le-ae-W);r.style.transform=`translate3d(0,${e}px,0)`}if(n&&i){let e=n.offsetWidth-K-H-U,t=Jk(i,Vk,k===`rtl`?-S:S,P,m,K,e);i.style.transform=`translate3d(${k===`rtl`?-t:t}px,0,0)`}let ue=[I,L,R,ee];Hk.forEach((t,n)=>{e.style.setProperty(t,`${ue[n]}px`)}),a&&h(e=>qk(e,{width:ne,height:B})),v(e=>qk(e,T));let de={xStart:!A&&I>D.xStart,xEnd:!A&&L>D.xEnd,yStart:!O&&R>D.yStart,yEnd:!O&&ee>D.yEnd};E(e=>qk(e,de))});H(()=>{Wk()},[]),H(()=>{queueMicrotask(P)},[P,y,k,D.xStart,D.xEnd,D.yStart,D.yEnd]),H(()=>{s.current?.matches(`:hover`)&&T(!0)},[s,T]),H(()=>{let e=s.current;if(typeof ResizeObserver>`u`||!e)return;let t=!1,n=new ResizeObserver(()=>{if(!t){t=!0;let n=j.current;if(n[0]===e.clientHeight&&n[1]===e.scrollHeight&&n[2]===e.clientWidth&&n[3]===e.scrollWidth)return}P()});return n.observe(e),N.start(0,()=>{let t=oa(e,{subtree:!0});t.length!==0&&Promise.allSettled(t.map(e=>e.finished.then(i))).then(P).catch(()=>{})}),()=>{n.disconnect(),N.clear()}},[P,s,N]);function F(){A.current=!1}let I={..._&&{"data-id":`${_}-viewport`},tabIndex:y.x&&y.y?-1:0,className:dk.className,style:{overflow:`scroll`},onScroll(){s.current&&(P(),(S||!A.current)&&x({x:s.current.scrollLeft,y:s.current.scrollTop}),M.start(100,()=>{A.current=!0}))},onWheel:F,onPointerMove:F,onPointerEnter:F,onKeyDown:F},L=m(`div`,e,{ref:[t,s],state:O,props:[I,o],stateAttributesMapping:yk}),R=C.useMemo(()=>({computeThumbPosition:P}),[P]);return(0,w.jsx)(Mk.Provider,{value:R,children:L})});function Kk(e){let t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function qk(e,t){for(let n in t)if(e[n]!==t[n])return t;return e}function Jk(e,t,n,r,i,a,o){let s=y_(n,0,r),c=n-s,l=Math.max(16,a*i/(i+Math.abs(c)));return e.style.setProperty(t,c?`${l}px`:``),(r?s/r*o:0)+(c>0?a-l:0)}var Yk=C.createContext(void 0);function Xk(){let e=C.useContext(Yk);if(e===void 0)throw Error(U(54));return e}var Zk=C.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,style:o,...s}=e,{hovering:c,scrollingX:l,scrollingY:u,hiddenState:d,scrollbarYRef:f,scrollbarXRef:p,viewportRef:h,thumbYRef:g,thumbXRef:_,handlePointerDown:v,handlePointerUp:y,handleScroll:b,disableViewportSnap:x,rootId:S,thumbSize:T,hasMeasuredScrollbar:E,viewportState:D}=ck(),O=i===`vertical`,k={...D,hovering:c,scrolling:O?u:l,orientation:i},A=zs(),j=!E&&!a,M=O?d.y:d.x,N=a||!M;C.useEffect(()=>{if(!N)return;let e=h.current,t=O?f.current:p.current;if(!t)return;function n(t){if(!e||t.ctrlKey)return;let n=!O,r=n?`scrollLeft`:`scrollTop`,i=n?t.deltaX:t.deltaY;if(i===0)return;let a=n?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,o=n&&A===`rtl`?-a:0,s=n&&A===`rtl`?0:a,c=e[r];c<=o&&i<0||c>=s&&i>0||(t.preventDefault(),e[r]=Math.min(s,Math.max(o,c+i)),b({x:e.scrollLeft,y:e.scrollTop}))}return Y(t,`wheel`,n,{passive:!1})},[A,b,O,p,f,N,h]);let P={...S&&{"data-id":`${S}-scrollbar`},"aria-hidden":!0,onPointerDown(e){if(e.button!==0)return;let t=nt(e.nativeEvent),n=O?g.current:_.current;if(n&&J(n,t))return;let r=h.current;if(!r)return;let i=O?f.current:p.current;if(!n||!i)return;let a=O?`y`:`x`,o=lk(n,`margin`,a),s=lk(i,`padding`,a),c=O?n.offsetHeight:n.offsetWidth,l=i.getBoundingClientRect(),u=O?e.clientY-l.top-c/2-s+o/2:e.clientX-l.left-c/2-s+o/2,d=O?r.scrollHeight:r.scrollWidth,m=O?r.clientHeight:r.clientWidth,y=(O?i.offsetHeight:i.offsetWidth)-c-s-o;if(y<=0)return;let S=u/y,C=d-m;x(),O?r.scrollTop=S*C:r.scrollLeft=A===`rtl`?-(1-S)*C:S*C,b({x:r.scrollLeft,y:r.scrollTop}),v(e)},onMouseDown(e){e.preventDefault()},onPointerUp:y,onPointerCancel:y,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,visibility:j?`hidden`:void 0,...O?{top:0,bottom:`var(${Ck})`,insetInlineEnd:0,[Bk]:`${T.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(${wk})`,bottom:0,[Vk]:`${T.width}px`}}},F=m(`div`,e,{ref:[t,O?f:p],state:k,props:[P,s],stateAttributesMapping:yk});return N?(0,w.jsx)(Yk.Provider,{value:i,children:F}):null}),Qk=C.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{computeThumbPosition:o}=Nk(),{hasMeasuredScrollbar:s,viewportState:c}=ck(),l=C.useRef(null),u=C.useRef(s);return H(()=>{if(typeof ResizeObserver>`u`)return;let e=!1,t=new ResizeObserver(()=>{!e&&(e=!0,!u.current)||o()});return l.current&&t.observe(l.current),()=>{t.disconnect()}},[o]),m(`div`,e,{ref:[t,l],state:c,stateAttributesMapping:yk,props:[{role:`presentation`,style:{minWidth:`fit-content`}},a]})}),$k=C.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{thumbYRef:o,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,scrollingX:d,scrollingY:f,hasMeasuredScrollbar:p}=ck(),h=Xk(),g=h===`vertical`;return m(`div`,e,{ref:[t,g?o:s],state:{scrolling:g?f:d,orientation:h},props:[{onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,style:{visibility:p?void 0:`hidden`,...g?{height:`var(--scroll-area-thumb-height)`}:{width:`var(--scroll-area-thumb-width)`}}},a]})}),eA=C.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{cornerRef:o,cornerSize:s,hiddenState:c}=ck(),l=m(`div`,e,{ref:[t,o],props:[{"aria-hidden":!0,style:{position:`absolute`,bottom:0,insetInlineEnd:0,width:s.width,height:s.height}},a]});return c.corner?null:l}),tA=100,nA=20,rA=1,iA=16,aA=`2rem`,oA=`0px`,sA=`mask-t-from-[calc(100%-min(var(--scroll-area-fade-top),var(--scroll-area-overflow-y-start,0px)))] mask-b-from-[calc(100%-min(var(--scroll-area-fade-bottom),var(--scroll-area-overflow-y-end,0px)))] mask-l-from-[calc(100%-min(var(--scroll-area-fade-left),var(--scroll-area-overflow-x-start,0px)))] mask-r-from-[calc(100%-min(var(--scroll-area-fade-right),var(--scroll-area-overflow-x-end,0px)))]`,cA=e=>e===!0?aA:e;function lA(e,t){if(e===!1)return{top:!1,bottom:!1,left:!1,right:!1};let n=(t===`vertical`||t===`both`)&&aA,r=(t===`horizontal`||t===`both`)&&aA,i={top:n,bottom:n,left:r,right:r};return e===!0||e===void 0||(e.y!==void 0&&(i.top=cA(e.y),i.bottom=cA(e.y)),e.x!==void 0&&(i.left=cA(e.x),i.right=cA(e.x)),e.top!==void 0&&(i.top=cA(e.top)),e.bottom!==void 0&&(i.bottom=cA(e.bottom)),e.left!==void 0&&(i.left=cA(e.left)),e.right!==void 0&&(i.right=cA(e.right))),i}var uA=e=>({"--scroll-area-fade-top":e.top||oA,"--scroll-area-fade-bottom":e.bottom||oA,"--scroll-area-fade-left":e.left||oA,"--scroll-area-fade-right":e.right||oA});function dA(e,t,n){let r=e??t;return Number.isFinite(r)?Math.max(n,r):Math.max(n,t)}var fA=({direction:e,label:t,onStartScrolling:n,onStopScrolling:r,onKeyboardScroll:i})=>{let o=e===`left`?nk:v;return(0,w.jsx)(`button`,{type:`button`,"aria-label":t,className:a(`absolute inset-y-1 z-10 hidden w-8 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent hover:bg-fill-subtle active:bg-fill`,rk,h,_,e===`left`?`left-1 group-data-[overflow-x-start]/scroll-area:flex`:`right-1 group-data-[overflow-x-end]/scroll-area:flex`),onPointerDown:t=>n(e,t),onPointerUp:r,onPointerLeave:r,onPointerCancel:r,onBlur:r,onClick:t=>{t.detail===0&&i(e)},children:(0,w.jsx)(o,{"aria-hidden":`true`,className:`size-4`})})},pA=({areaRef:e,scrollButtons:t})=>{let n=C.useRef(null),r=typeof t==`object`?t:void 0,i=dA(r?.scrollSpeed,tA,rA),a=dA(r?.scrollIntervalTime,nA,iA),o=r?.leftLabel??`Scroll left`,s=r?.rightLabel??`Scroll right`,c=C.useCallback(()=>{n.current&&=(clearInterval(n.current),null)},[]),l=C.useCallback((t,n=1)=>{let r=e.current;r&&r.scrollBy({left:t===`right`?i*n:-i*n,behavior:`smooth`})},[e,i]),u=C.useCallback((e,t)=>{t?.preventDefault(),t?.stopPropagation(),t?.currentTarget.setPointerCapture?.(t.pointerId),c(),l(e,2),n.current=setInterval(()=>{l(e)},a)},[a,l,c]);return C.useEffect(()=>()=>{c()},[c]),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(fA,{direction:`left`,label:o,onStartScrolling:u,onStopScrolling:c,onKeyboardScroll:e=>l(e,2)}),(0,w.jsx)(fA,{direction:`right`,label:s,onStartScrolling:u,onStopScrolling:c,onKeyboardScroll:e=>l(e,2)})]})},mA=C.createContext(null);function hA(){let e=C.use(mA);if(!e)throw Error(`ScrollAreaViewport must be a direct child of ScrollArea`);return e}function gA({className:e,contentClassName:t,children:n,ref:r,render:i}){let o=hA(),{areaRef:s}=o,c=C.useMemo(()=>kg(s,r),[s,r]);return(0,w.jsx)(Gk,{ref:c,className:a(o.className,e),style:o.style,render:i,children:(0,w.jsx)(Qk,{className:t,style:o.contentStyle,children:(0,w.jsx)(mA,{value:null,children:n})})})}function _A({className:e,children:t,maxHeight:n,autoScroll:r=!1,autoScrollStartFollowing:i,onAutoScrollFollowingChange:o,orientation:s=`vertical`,scrollButtons:c,mask:l,revealScrollbarOnHover:u=!0,alwaysShowScrollbar:d=!1,...f}){let p=C.useRef(null);ok(p,{enabled:r,startFollowing:i,onFollowingChange:o});let m=lA(l,s),h=Object.values(m).some(Boolean),g=uA(m);n&&(g.maxHeight=n),s===`vertical`?(g.overflowX=`hidden`,g.overflowY=`scroll`):s===`horizontal`&&(g.overflowX=`scroll`,g.overflowY=`hidden`);let _=s===`vertical`?{minWidth:`0px`}:s===`horizontal`?{minHeight:`0px`}:void 0,v={areaRef:p,className:a(`size-full`,h&&sA),style:g,contentStyle:_},y=C.Children.toArray(t).filter(e=>C.isValidElement(e)&&e.type===gA).length;if(y>1)throw Error(`ScrollArea takes at most one ScrollAreaViewport`);let b=y===1;return(0,w.jsxs)(Ak,{className:a(`group/scroll-area relative overflow-hidden`,e),...f,children:[(0,w.jsx)(mA,{value:v,children:b?t:(0,w.jsx)(gA,{children:t})}),c&&s!==`vertical`&&(0,w.jsx)(pA,{areaRef:p,scrollButtons:c}),(s===`vertical`||s===`both`)&&(0,w.jsx)(vA,{orientation:`vertical`,revealOnHover:u,alwaysVisible:d}),(s===`horizontal`||s===`both`)&&(0,w.jsx)(vA,{orientation:`horizontal`,revealOnHover:u,alwaysVisible:d}),s===`both`&&(0,w.jsx)(eA,{})]})}function vA({className:e,orientation:t=`vertical`,revealOnHover:n=!0,alwaysVisible:r=!1,...i}){return(0,w.jsx)(Zk,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:a(`flex touch-none transition-opacity duration-normal ease-out-custom select-none`,r?`opacity-100`:`opacity-0 data-[scrolling]:opacity-100 data-[scrolling]:duration-0`,n&&!r&&`data-[hovering]:opacity-100`,t===`vertical`&&`my-(--scroll-area-scrollbar-inset,0px) w-1.5 p-px`,t===`horizontal`&&`mx-(--scroll-area-scrollbar-inset,0px) h-1.5 flex-col p-px`,e),...i,children:(0,w.jsx)($k,{className:`relative flex-1 rounded-full bg-muted-foreground/30 hover:bg-muted-foreground/60`})})}function yA(e){let t=e.at(-2);if(typeof t!=`object`||!t||!(`q`in t)||!(`filters`in t))return!1;let{q:n,filters:r}=t;return n===``&&typeof r==`object`&&!!r&&Object.keys(r).length===0}var bA={serverFeatures:()=>[`server-features`],serverVersions:()=>[`server-versions`],serverStatus:()=>[`server-status`],factoryAuth:()=>[`factory-auth`],factories:()=>[`factories`],boardCatalog:e=>[`factory`,`boards`,e??null],board:(e,t)=>[`factory`,`boards`,e??null,`board`,t],persistedFactories:()=>[`factories`,`persisted`],factoryCreateFlow:()=>[`factories`,`create-flow`],factoryProject:e=>[`factory`,`project`,e??null],factoryEnvironment:e=>[`factory`,`environment`,e??null],factoryEnvironmentBuilds:e=>[`factory`,`environment-builds`,e??null],factoryEnvironmentBuild:(e,t)=>[`factory`,`environment-build`,e??null,t??null],factorySandboxEnvs:e=>[`factory`,`sandbox-envs`,e??null],githubStatus:()=>[`github`,`status`],githubPat:()=>[`github`,`pat`],githubRepos:e=>[`github`,`repos`,e??null],githubIssue:(e,t)=>[`github`,`issue`,e??null,t??null],githubPull:(e,t)=>[`github`,`pr`,e??null,t??null],repositorySettings:e=>[`source-control`,`repository-settings`,e??null],gitlabStatus:e=>[`gitlab`,`status`,e],gitlabProjects:e=>[`gitlab`,`projects`,e],gitlabIssue:(e,t,n)=>[`gitlab`,`issue`,e,t??null,n??null],gitlabPull:(e,t,n,r)=>[`gitlab`,`pr`,e,t??null,n??null,r??null],linearStatus:()=>[`linear`,`status`],linearProjects:()=>[`linear`,`projects`],linearTeams:()=>[`linear`,`teams`],linearIssue:(e,t,n)=>[`linear`,`issue`,e??null,t??null,n??null],jiraStatus:()=>[`jira`,`status`],platformConnections:e=>[`platform-connections`,e],connectTools:()=>[`connect-tools`],connectToolList:()=>[`connect-tools`,`tools`],jiraProjects:()=>[`jira`,`projects`],jiraIssue:(e,t,n)=>[`jira`,`issue`,e??null,t??null,n??null],incidentioSources:()=>[`incidentio`,`sources`],incidentioStatus:()=>[`incidentio`,`status`],incidentioIssue:(e,t)=>[`incidentio`,`issue`,e??null,t??null],intakeConfig:()=>[`intake`,`config`],intakeBindings:()=>[`intake`,`bindings`],intakeRoutes:e=>[`intake`,`routes`,e??null],intakeDryRun:e=>[...bA.intakeRoutes(e),`dry-run`],intakeOrder:e=>[`intake`,`order`,e??null],intakeSkipped:e=>[...bA.intakeRoutes(e),`skipped`],intakeNotRouted:e=>[`intake`,`not-routed`,e??null],channelAccounts:()=>[`channel-accounts`],workItemSessionRepository:(e,t,n)=>[`factory`,`work-item-session-repository`,e??null,t??null,n??null],workItems:e=>[`factory`,`work-items`,e??null],sessionWorkItems:(e,t)=>[...bA.workItems(e),`session`,t??null],workItem:(e,t)=>[...bA.workItems(e),`card`,t??null],workItemsWithSessions:e=>[...bA.workItems(e),`sessions`],unstartedWorkItems:(e,t)=>[...bA.workItems(e),`unstarted`,t],boardPhases:(e,t)=>[...bA.workItems(e),`phases`,t],boardPhasesView:(e,{board:t,windows:n,...r})=>[...bA.boardPhases(e,t),r,n],boardFacts:e=>[`factory`,`board-facts`,e??null],workItemStarters:e=>[...bA.boardFacts(e),`starters`],workItemActivity:(e,t)=>[...bA.boardFacts(e),`activity`,t],workItemFilterOptions:e=>[...bA.boardFacts(e),`filter-options`],sidebarPullRequestSubscriptionsAll:()=>[`sidebar-pull-request-subscriptions`],sidebarPullRequestSubscriptions:(e,t,n)=>[...bA.sidebarPullRequestSubscriptionsAll(),e,t,n],knowledgeGraph:e=>[`factory`,`knowledge-graph`,e??null],knowledgePage:(e,t,n)=>[`factory`,`knowledge-page`,e??null,t,n??null],knowledgeTreeLevel:(e,t,n)=>[`factory`,`knowledge-tree`,e??null,t,n??null],knowledgeActivity:(e,t)=>[`factory`,`knowledge-activity`,e??null,t],knowledgeSearch:(e,t)=>[`factory`,`knowledge-search`,e??null,t],factoryDecisionsRoot:e=>[`factory`,`decisions`,e??null],factoryDecisions:(e,t)=>[`factory`,`decisions`,e??null,t],factoryRunQueue:e=>[...bA.factoryDecisionsRoot(e),`run-queue`],factoryAudit:(e,t,n)=>[`factory`,`audit`,e??null,t,n??null],sessions:e=>[`sessions`,e??null],userSession:e=>[`user-session`,e??null],sessionRowsRoot:e=>[`factory`,`session-rows`,e??null],sessionRows:(e,t)=>[...bA.sessionRowsRoot(e),t],sessionActivity:e=>[`factory`,`session-activity`,e??null],providers:()=>[`providers`],mastraGatewayCredits:()=>[`mastra-gateway-credits`],availableModels:e=>e?[`available-models`,e]:[`available-models`],customProviders:()=>[`custom-providers`],defaultModel:()=>[`default-model`],voiceSettingsAll:()=>[`voice-settings`],voiceSettings:e=>[...bA.voiceSettingsAll(),e],om:(e,t,n,r)=>[`om`,e??null,t??null,n??null,r??null],factorySkills:e=>[`factory`,`skills`,e??null],fsList:e=>[`fs-list`,e??null],artifactsList:e=>[`artifacts-list`,e??null],workspaceRenderedList:(e,t)=>[`workspace-rendered-list`,e??null,t??null],workspaceTreeScope:e=>[`workspace-tree`,e??null],workspaceTree:(e,t)=>[`workspace-tree`,e??null,t],workspaceFileIndex:e=>[`workspace-tree`,e??null,{index:`files`}],workspaceFileScope:e=>[`workspace-file`,e??null],workspaceFile:(e,t)=>[`workspace-file`,e??null,t??null],planFile:(e,t,n)=>[`plan-file`,e??null,t??null,n??null],workspaceChanges:e=>[`workspace-changes`,e??null],workspacePatches:(e,t)=>[`workspace-changes`,e??null,`patches`,t],agentControllerSession:(e,t)=>[`agent-controller`,e??null,`sessions`,t??null],agentControllerConnection:(e,t)=>[`agent-controller`,e??null,`connection`,t??null],agentControllerConnectionInit:(e,t)=>[...bA.agentControllerConnection(e,t),`init`],agentControllerConnectionState:(e,t,n)=>[...bA.agentControllerConnection(e,t),`state`,...n?[n]:[]],agentControllerSettings:(e,t)=>[...bA.agentControllerSession(e,t),`settings`],agentControllerPermissions:(e,t)=>[...bA.agentControllerSession(e,t),`permissions`],agentControllerThreads:(e,t)=>[...bA.agentControllerSession(e,t),`threads`],agentControllerSessionThreadMessages:(e,t)=>[`agent-controller`,e??null,`thread-messages`,t??null],agentControllerThreadMessages:(e,t,n,r)=>[...bA.agentControllerSessionThreadMessages(e,t),n??null,`messages`,...r===void 0?[]:[r]]},xA=e=>[`factory`,`write-work-item`,e],SA=e=>[...xA(e),`transition`],CA=[`dialog-popup-motion fixed top-1/2 left-1/2 z-50 flex w-[calc(100%-2rem)] -translate-1/2 flex-col rounded-xl py-3 outline-hidden`,`[&>form]:flex [&>form]:min-h-0 [&>form]:flex-1 [&>form]:flex-col [&>form]:gap-0`,I].join(` `),wA={sm:`max-h-[calc(100dvh-4rem)] max-w-sm`,md:`max-h-[calc(100dvh-4rem)] max-w-lg`,lg:`max-h-[calc(100dvh-4rem)] max-w-2xl`,xl:`max-h-[calc(100dvh-4rem)] max-w-4xl`,full:`h-[calc(100dvh-2rem)]`},TA=(e=1024)=>{let t=`(max-width: ${e-1}px)`,n=(0,C.useCallback)(e=>{let n=window.matchMedia(t);return n.addEventListener(`change`,e),()=>n.removeEventListener(`change`,e)},[t]);return(0,C.useSyncExternalStore)(n,()=>window.matchMedia(t).matches,()=>!1)},EA=C.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Mg(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return m(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:Dt,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),DA=`--nested-dialogs`,OA=C.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Mg(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),h=c.useState(`mounted`),g=c.useState(`nested`),_=c.useState(`nestedOpenDialogCount`),v=c.useState(`open`),y=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`),C=d.useState(`floatingId`);r_(),ua({open:v,ref:c.context.popupRef,onComplete(){v&&c.context.onOpenChangeComplete?.(!0)}});let T=o===void 0?pa(c.context.popupRef):o,E=_>0,D=c.useStateSetter(`popupElement`),O=m(`div`,e,{state:{open:v,nested:g,transitionStatus:x,nestedDialogOpen:E},props:[f,{id:C,"aria-labelledby":b,"aria-describedby":l,role:S,...fa,hidden:!h,onKeyDown(e){l_.has(e.key)&&e.stopPropagation()},style:{[DA]:_}},s],ref:[t,c.context.popupRef,D],stateAttributesMapping:jv});return(0,w.jsx)(Yi,{context:d,openInteractionType:y,disabled:!h,closeOnFocusOut:!u,initialFocus:T,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:O})}),kA=V(function(e){return X_(`dialog`,e)}),AA=(0,C.createContext)({intent:`default`,pending:!1,isDrawer:!1});function jA(){return(0,C.useContext)(AA)}var MA={sm:`min-h-control-sm`,md:`min-h-control-md`,lg:`min-h-control-lg`},NA=`h-auto min-w-0 max-w-full whitespace-normal wrap-anywhere max-[22rem]:w-full`,PA=4e3;function FA(e,t){return e===`destructive`?t?`destructive`:`destructive-ghost`:t?`primary`:`ghost`}function IA({onConfirm:e,children:t,disabled:n,loading:r,holdSeconds:i=1.5,...o}){let{intent:s}=jA(),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(!1),f=(0,C.useRef)(void 0),p=(0,C.useRef)(void 0),m=(0,C.useRef)(!1),h=(0,C.useId)();function g(){clearTimeout(f.current),m.current=!1,l(!1)}function _(){clearTimeout(p.current),d(!1)}function v(){m.current=!1,l(!1),_(),e()}function y(){n||m.current||(m.current=!0,l(!0),f.current=setTimeout(v,i*1e3))}function b(e){e.preventDefault(),e.detail!==0||n||(u?v():(d(!0),p.current=setTimeout(()=>d(!1),PA)))}(0,C.useEffect)(()=>{r&&(clearTimeout(f.current),m.current=!1)},[r]),(0,C.useEffect)(()=>{function e(){document.hidden&&g()}function t(e){(e.key===` `||e.key===`Enter`)&&g()}return window.addEventListener(`keyup`,t,!0),window.addEventListener(`pointerup`,g,!0),window.addEventListener(`blur`,g),document.addEventListener(`visibilitychange`,e),()=>{clearTimeout(f.current),clearTimeout(p.current),window.removeEventListener(`keyup`,t,!0),window.removeEventListener(`pointerup`,g,!0),window.removeEventListener(`blur`,g),document.removeEventListener(`visibilitychange`,e)}},[]);function x(e){o.onPointerDown?.(e),!e.defaultPrevented&&e.button===0&&e.isPrimary&&y()}function S(e){o.onKeyDown?.(e),e.defaultPrevented||e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),e.repeat||y())}return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(gl,{size:`md`,...o,className:a(`group/hold relative isolate touch-none overflow-hidden select-none`,NA,MA[o.size??`md`],o.className),type:`button`,variant:FA(s,r),disabled:n,loading:r,"aria-describedby":[o[`aria-describedby`],h].filter(Boolean).join(` `),"data-holding":c&&!r||void 0,onClick:b,onPointerDown:x,onPointerUp:e=>{g(),o.onPointerUp?.(e)},onPointerLeave:e=>{g(),o.onPointerLeave?.(e)},onPointerCancel:e=>{g(),o.onPointerCancel?.(e)},onKeyDown:S,onKeyUp:e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),g()),o.onKeyUp?.(e)},onBlur:e=>{g(),o.onBlur?.(e)},children:[(0,w.jsx)(`span`,{children:t}),(0,w.jsx)(`span`,{"aria-hidden":`true`,className:a(`pointer-events-none absolute inset-0 flex items-center justify-center px-[inherit] [clip-path:inset(0_100%_0_0)]`,`transition-[clip-path] ease-linear motion-reduce:transition-none`,`group-data-[holding]/hold:[clip-path:inset(0)] motion-reduce:group-data-[holding]/hold:[clip-path:inset(0_50%_0_0)]`,s===`destructive`?`bg-fill-destructive text-fill-destructive-foreground`:`bg-foreground text-sidebar`),style:{transitionDuration:c?`${i}s`:`0s`},children:t})]}),(0,w.jsxs)(`span`,{id:h,className:`sr-only`,children:[`Hold Space or Enter for `,i,` seconds to confirm. Release to cancel. Screen reader users can activate twice.`]}),(0,w.jsx)(`span`,{role:`status`,className:`sr-only`,children:u?`Activate again to confirm.`:``})]})}function LA({confirmation:e=`click`,holdSeconds:t=1.5,onConfirm:n,disabled:r,type:i=`button`,loading:o,...s}){let{intent:c,pending:l}=jA(),u=o??l,d=r||l&&!u;return n&&e===`hold`?(0,w.jsx)(IA,{holdSeconds:t,...s,disabled:d,loading:u,onConfirm:n},`${d}-${t}`):(0,w.jsx)(gl,{size:`md`,...s,className:a(NA,MA[s.size??`md`],s.className),type:i,variant:c===`destructive`?`destructive`:`primary`,disabled:d,loading:u,onClick:n})}var RA=()=>TA(640);function zA({intent:e=`default`,pending:t=!1,open:n,defaultOpen:r=!1,onOpenChange:i,disablePointerDismissal:a,...o}){let s=RA(),[c,l]=C.useState(r),u={...o,open:n??c,disablePointerDismissal:a??e===`destructive`};function d(e,n){!e&&t?n.cancel():(l(e),i?.(e,n))}return(0,w.jsx)(AA.Provider,{value:{intent:e,pending:t,isDrawer:s},children:s?(0,w.jsx)(Cy,{...u,onOpenChange:d}):(0,w.jsx)(kA,{...u,onOpenChange:d})})}var BA=Ov,VA=j_,HA=Hg;function UA({className:e,...t}){return(0,w.jsx)(EA,{"data-slot":`dialog-overlay`,className:a(`dialog-backdrop-motion fixed inset-0 z-50 bg-scrim backdrop-blur-xs`,e),...t})}function WA({className:e,children:t,size:n=`md`,showOverlay:r=!0,showCloseButton:i=!0,overlayClassName:o,initialFocus:s,...c}){let{intent:l,pending:u,isDrawer:d}=jA(),f=C.useRef(null),p=l===`destructive`,m={"data-slot":`dialog-content`,"data-size":n,"data-intent":l,role:p?`alertdialog`:`dialog`,initialFocus:s??(p&&i?f:!0),"aria-busy":u||void 0,...c},h=i&&(0,w.jsx)(Hg,{ref:f,disabled:u,"data-slot":`dialog-close`,className:a(`absolute right-4`,d?`top-1.5`:`top-4`),render:(0,w.jsx)(gl,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,children:(0,w.jsx)(Ag,{})})});return d?(0,w.jsxs)(Ny,{...m,showCloseButton:!1,className:a(`pb-3`,n===`full`&&`h-[calc(85vh+3rem)]`,i&&`[&_[data-slot=dialog-header]]:pr-12`,e),children:[t,h,(0,w.jsx)(`div`,{"aria-hidden":!0,className:`h-12 shrink-0`})]}):(0,w.jsxs)(VA,{children:[r&&(0,w.jsx)(UA,{className:o}),(0,w.jsxs)(OA,{...m,className:a(CA,wA[n],i&&`[&_[data-slot=dialog-header]]:pr-12`,e),children:[t,h]})]})}function GA({className:e,...t}){return(0,w.jsx)(`div`,{"data-slot":`dialog-header`,className:a(`flex min-w-0 shrink-0 flex-col gap-1 px-5 py-2`,e),...t})}function KA({className:e,...t}){return(0,w.jsx)(`div`,{"data-slot":`dialog-footer`,className:a(`flex shrink-0 flex-wrap items-center justify-end gap-2 px-5 py-2`,e),...t})}function qA({className:e,layout:t=`scroll`,flush:n=!1,children:r,...i}){let o=a(`flex min-w-0 flex-col gap-4 text-body wrap-break-word text-muted-foreground`,!n&&`px-5 py-2`,e);return t===`fill`?(0,w.jsx)(`div`,{"data-slot":`dialog-body`,className:a(`min-h-0 flex-1`,o),...i,children:r}):(0,w.jsx)(_A,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,mask:!0,children:(0,w.jsx)(gA,{className:`h-auto min-h-0`,children:(0,w.jsx)(`div`,{"data-slot":`dialog-body`,className:o,...i,children:r})})})}function JA({className:e,...t}){return(0,w.jsx)(Sv,{className:a(`text-heading wrap-break-word text-foreground`,e),...t})}function YA({className:e,...t}){return(0,w.jsx)(Kg,{className:a(`text-body wrap-break-word text-muted-foreground`,e),...t})}function XA({disabled:e,size:t=`md`,...n}){let{pending:r}=jA();return(0,w.jsx)(Hg,{render:(0,w.jsx)(gl,{size:t,variant:`ghost`,className:a(NA,MA[t]),children:n.children}),...n,disabled:e||r})}var ZA=(0,C.createContext)(null);function QA(){return(0,C.useContext)(ZA)}function $A({"aria-label":e,"aria-labelledby":t}){return!!e&&t===void 0}function ej(e){return $A(e)?{"aria-labelledby":void 0}:{}}function tj(e={}){let t=QA();if(!t)return{};let n=[t.hasDescription&&t.descriptionId,t.invalid&&t.errorId].filter(Boolean);return{id:t.controlId,"aria-labelledby":$A(e)?void 0:t.labelId,"aria-describedby":n.length>0?n.join(` `):void 0,"aria-invalid":t.invalid||void 0}}var nj=`data-valid`,rj=`data-invalid`,ij={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},aj={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},oj={disabled:!1,...aj},sj={valid(e){return e===null?null:e?{[nj]:``}:{[rj]:``}}},cj={invalid:void 0,name:void 0,validityData:{state:ij,errors:[],error:``,value:``,initialValue:null},setValidityData:i,disabled:void 0,setTouched:i,setDirty:i,setFilled:i,setFocused:i,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:oj,registerFieldControl:i,validation:{getValidationProps:(e,t=x)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:i,getInputControl:()=>null,commit:async()=>{},change:i}},lj=C.createContext(cj);function uj(e=!0){let t=C.useContext(lj);if(t.setValidityData===i&&!e)throw Error(U(28));return t}function dj(e,t,r,i,a=!0,o){let{registerFieldControl:s}=uj(),c=n(()=>Symbol());H(()=>{let n=c.current;a?s(n,{controlRef:e,getValue:i,id:t,name:o,value:r}):s(n,void 0)},[e,a,i,t,o,s,c,r]),H(()=>{let e=c.current;return()=>{s(e,void 0)}},[s,c])}var fj=C.createContext({controlId:void 0,registerControlId:i,resetControlId:i,labelId:void 0,setLabelId:i,messageIds:[],setMessageIds:i,getDescriptionProps:e=>e});function pj(){return C.useContext(fj)}function mj(e={}){let{id:t,enabled:r=!0}=e,{controlId:a,registerControlId:o,resetControlId:s}=pj(),c=Ts(),l=n(()=>Symbol()),u=C.useRef(!1),d=C.useRef(!1),f=X(()=>{u.current&&o!==i&&(u.current=!1,o(l.current,void 0))});return H(()=>{if(!r||o===i){f();return}let e;if(t!==void 0)d.current=!0,e=t;else if(d.current)e=c;else{s();return}e===void 0?f():(u.current=!0,o(l.current,e))},[t,r,o,s,c,l,f]),H(()=>f,[f]),(r?a:void 0)??t??c}var hj=C.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:i,validationMode:`onSubmit`,submitCountRef:{current:0}});function gj(){return C.useContext(hj)}function _j(e,t,n){let{setFocused:r,focusOwnerRef:i}=uj(),a=X(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return H(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function vj(e,t=window.location.pathname+window.location.search){return`${e}/auth/login?returnTo=${encodeURIComponent(t)}`}function yj(e,t){window.location.assign(vj(e,t))}function bj(e){return`${e}/auth/logout`}function xj(){for(let e=localStorage.length-1;e>=0;--e){let t=localStorage.key(e);t?.startsWith(`mastracode`)&&localStorage.removeItem(t)}}function Sj(e){window.location.assign(bj(e))}async function Cj(e,t,n){let r=await fetch(`${e}/auth/api/${t}`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},credentials:`include`,body:JSON.stringify(n)});if(!r.ok){let e=`Authentication failed`;try{let t=await r.json();t?.message&&(e=t.message)}catch{}throw Error(e)}}function wj(e){window.location.assign(e)}function Tj(e,t){return Cj(e,`sign-in/email`,t)}function Ej(e,t){return Cj(e,`sign-up/email`,t)}async function Dj(e){let t=await fetch(`${e}/auth/me`,{headers:{Accept:`application/json`},credentials:`include`});if(t.status===404)return{authEnabled:!1,authenticated:!1};if(t.status===401||t.status===403)return{authEnabled:!0,authenticated:!1};if(!t.ok)throw Error(`Auth check failed (${t.status})`);let n=await t.json();return{authEnabled:!0,authenticated:!!n.authenticated,...typeof n.telemetryEnabled==`boolean`?{telemetryEnabled:n.telemetryEnabled}:{},user:n.user??void 0,provider:n.provider,signUpDisabled:n.signUpDisabled,customDomainUnsupported:n.customDomainUnsupported}}function Oj({monitorSession:e=!1}={}){let{baseUrl:t}=Og();return Hu({queryKey:bA.factoryAuth(),queryFn:()=>Dj(t),refetchOnMount:!e||`always`,refetchOnWindowFocus:e?`always`:!1,refetchOnReconnect:!e||`always`,refetchInterval:t=>t.state.status===`error`?2e3:e&&t.state.data?.authEnabled?6e4:!1})}async function kj(e,t){if(!e.ok){let n=Error(`${t} (${e.status})`);throw n.status=e.status,n}return await e.json()}async function Aj(e,t){let n=await fetch(e,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`,Accept:`application/json`},body:JSON.stringify(t??{})});if(!n.ok){let e=`http_${n.status}`,t=`Request failed (${n.status})`;try{let r=await n.json();r.error&&(e=r.error),r.message?t=r.message:r.error&&(t=r.error)}catch{}let r=Error(t);throw r.code=e,r.status=n.status,n.status===401&&(r.authRequired=!0),r}return await n.json()}function jj(e,t,n,r){return Aj(`${e}/web/source-control/projects/${encodeURIComponent(t)}/${n}`,r)}function Mj(e){return`provider`in e&&e.provider===`gitlab`}async function Nj(e){try{let t=await fetch(`${e}/web/github/status`,{headers:{Accept:`application/json`},credentials:`include`});return t.status===401?{enabled:!1,connected:!1,installations:[],authRequired:!0,reason:`auth_required`}:t.ok?await t.json():Pj()}catch{return Pj()}}function Pj(){return{enabled:!1,connected:!1,installations:[],reason:`unavailable`}}function Fj(){return encodeURIComponent(window.location.pathname)}function Ij(e){window.location.assign(`${e}/auth/github/connect?redirectTo=${Fj()}`)}function Lj(e){window.location.assign(`${e}/auth/github/connect?manage=1&redirectTo=${Fj()}`)}function Rj(e){window.location.assign(`${e}/auth/github/connect-user?redirectTo=${Fj()}`)}async function zj(e){let t=await fetch(`${e}/web/github/pat`,{headers:{Accept:`application/json`},credentials:`include`});if(!t.ok)throw Error(`Failed to load GitHub token status (${t.status})`);return await t.json()}async function Bj(e,t,n=`default`){let r=await fetch(`${e}/web/github/pat`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},credentials:`include`,body:JSON.stringify({token:t,kind:n})});if(!r.ok){let e=await r.json().catch(()=>void 0);throw Error(e?.error??`Failed to save GitHub token (${r.status})`)}}async function Vj(e,t=`default`){let n=await fetch(`${e}/web/github/pat?kind=${t}`,{method:`DELETE`,headers:{Accept:`application/json`},credentials:`include`});if(!n.ok)throw Error(`Failed to remove GitHub token (${n.status})`)}async function Hj(e,t,n){let r=new URLSearchParams;t&&r.set(`q`,t),n?.limit&&r.set(`limit`,String(n.limit)),n?.refresh&&r.set(`refresh`,`1`);let i=r.toString(),a=`${e}/web/github/repos${i?`?${i}`:``}`,o=await fetch(a,{headers:{Accept:`application/json`},credentials:`include`});if(!o.ok)throw Error(`Failed to list repos (${o.status})`);return(await o.json()).repos}var Uj=`github`;function Wj(e,t){return{projectRepositoryId:t.projectRepositoryId,provider:t.integrationId===`gitlab`?`gitlab`:`github`,externalId:t.externalId??void 0,slug:t.slug??e,gitBranch:t.branch??t.defaultBranch??void 0}}async function Gj(e,t){let{connections:n}=await kj(await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}/source-control-connections`,{credentials:`include`,headers:{Accept:`application/json`}}),`Failed to list Factory repositories`);return n}async function Kj(e){let t=await fetch(`${e}/web/factory/projects`,{credentials:`include`,headers:{Accept:`application/json`}});if(t.status===401||t.status===403||t.status===404)return null;let{projects:n}=await kj(t,`Failed to list Factories`);return n.map(e=>({...e,repositories:e.repositories.map(t=>Wj(e.name,t))}))}async function qj(e,t,n,r){let{project:i}=await kj(await fetch(`${e}/web/factory/projects`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`,Accept:`application/json`},body:JSON.stringify({name:t,...n?{description:n}:{},...r?{modelScope:r}:{}})}),`Failed to create Factory`);return i}async function Jj(e,t){let{project:n}=await kj(await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}`,{credentials:`include`,headers:{Accept:`application/json`}}),`Failed to load Factory`);return n}async function Yj(e,t,n){let{project:r}=await kj(await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}`,{method:`PATCH`,credentials:`include`,headers:{"content-type":`application/json`,Accept:`application/json`},body:JSON.stringify({defaultModelId:n})}),`Failed to update Factory default model`);return r}async function Xj(e,t,n){let{project:r}=await kj(await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}`,{method:`PATCH`,credentials:`include`,headers:{"content-type":`application/json`,Accept:`application/json`},body:JSON.stringify({name:n})}),`Failed to update Factory name`);return r}async function Zj(e,t,n){let{project:r}=await kj(await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}`,{method:`PATCH`,credentials:`include`,headers:{"content-type":`application/json`,Accept:`application/json`},body:JSON.stringify({modelScope:n})}),`Failed to update Factory model scope`);return r}async function Qj(e,t,n){let{project:r}=await kj(await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}`,{method:`PATCH`,credentials:`include`,headers:{"content-type":`application/json`,Accept:`application/json`},body:JSON.stringify({defaultThinkingLevel:n})}),`Failed to update Factory thinking level`);return r}async function $j(e,t){return kj(await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}/apply-default-model`,{method:`POST`,credentials:`include`,headers:{Accept:`application/json`}}),`Failed to switch running sessions`)}async function eM(e,t,n,r=Uj){let i=(await Gj(e,t)).find(e=>e.installationId===n);if(i)return i.id;let{connection:a}=await kj(await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}/source-control-connections`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`,Accept:`application/json`},body:JSON.stringify({integrationId:r,installationId:n})}),`Failed to connect ${r===`gitlab`?`GitLab`:`GitHub`} installation`);return a.id}async function tM(e,t,n,r,i){let a=Mj(r),{projectRepository:o}=await kj(await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}/source-control-connections/${encodeURIComponent(n)}/repositories`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`,Accept:`application/json`},body:JSON.stringify({repository:{externalId:a?r.externalId:String(r.id),slug:r.fullName},branch:r.defaultBranch,selectIntake:i})}),`Failed to link ${a?`GitLab`:`GitHub`} repository`);return Wj(r.fullName,{projectRepositoryId:o.id,integrationId:a?`gitlab`:`github`,externalId:o.repository?.externalId??null,slug:o.repository?.slug??null,defaultBranch:o.repository?.defaultBranch??null,branch:o.branch})}async function nM(e,t,n){let r=await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}/repositories/${encodeURIComponent(n)}`,{method:`DELETE`,credentials:`include`,headers:{Accept:`application/json`}});if(!r.ok&&r.status!==404)throw Error(`Failed to unlink repository (${r.status})`)}async function rM(e,t){let n=await fetch(`${e}/web/factory/projects/${encodeURIComponent(t)}`,{method:`DELETE`,credentials:`include`,headers:{Accept:`application/json`}});if(!n.ok&&n.status!==404)throw Error(`Failed to delete Factory (${n.status})`)}function iM(e){if(!e.projectId)return null;let t=e.projectPath??e.name,n=t.split(`/`).filter(Boolean);return{provider:`gitlab`,id:e.id,externalId:e.projectId,fullName:t,name:n.at(-1)??t,owner:n.slice(0,-1).join(`/`),defaultBranch:e.defaultBranch??`main`,private:!0,installationStorageId:e.installationStorageId}}async function aM(e){try{let t=await fetch(`${e}/web/gitlab/status`,{headers:{Accept:`application/json`},credentials:`include`});return t.status===401?{enabled:!1,configured:!1,reauthRequired:!1,reason:`auth_required`}:t.status===404?{enabled:!1,configured:!1,reauthRequired:!1,reason:`missing_config`}:t.ok?await t.json():{enabled:!1,configured:!1,reauthRequired:!1,reason:`unavailable`}}catch{return{enabled:!1,configured:!1,reauthRequired:!1,reason:`unavailable`}}}async function oM(e,t,n){let r=await fetch(`${e}${t}`,{...n,headers:{Accept:`application/json`,...n?.body?{"Content-Type":`application/json`}:{}},credentials:`include`});if(!r.ok){let e=`Request failed (${r.status})`,t;try{let n=await r.json();t=n.error,n.message?e=n.message:n.error&&(e=n.error)}catch{}let n=Error(e);throw n.code=t,n}return await r.json()}function sM(e,t,n,r){return oM(e,`/web/gitlab/projects/${encodeURIComponent(n)}/prs/${r}?factoryProjectId=${encodeURIComponent(t)}`)}function cM(e){return e?.code===`gitlab_auth_failed`}function lM(e){return!!(e?.reauthRequired||e?.connections?.some(e=>e.status===`needs_reauth`))}async function uM(e){let{projects:t}=await oM(e,`/web/gitlab/projects`);return t}async function dM(e,t){let{project:n}=await oM(e,`/web/gitlab/projects/registration`,{method:`POST`,body:JSON.stringify({sourceId:t})}),r=iM(n);if(!r?.installationStorageId)throw Error(`GitLab project registration returned no installation`);return r}function fM(e,t,n){let r=new URLSearchParams({factoryProjectId:t});return oM(e,`/web/gitlab/issues/${encodeURIComponent(n)}?${r.toString()}`)}function pM(e){let t={enabled:!1,sourceIds:null},n={github:t,gitlab:t,linear:t,jira:t,incidentio:t};for(let[t,r]of Object.entries(e??{}))r&&(n[t]=mM(t,r));return n}function mM(e,t){return e===`dependabot`||t.enabled?t:{...t,sourceIds:null}}function hM(e,t){return e.sourceIds===null?{...e,enabled:!0,sourceIds:[t]}:e.sourceIds.includes(t)?e.enabled?e:{...e,enabled:!0}:{...e,enabled:!0,sourceIds:[...e.sourceIds,t]}}async function gM(e,t){let n=await fetch(`${e}/web/intake/config`,{headers:{Accept:`application/json`,...t?.body?{"content-type":`application/json`}:{}},credentials:`include`,...t});if(!n.ok){let e=`Request failed (${n.status})`;try{let t=await n.json();t.message?e=t.message:t.error&&(e=t.error)}catch{}throw Error(e)}let{config:r}=await n.json();return pM(r)}async function _M(e){return gM(e)}async function vM(e,t,n){return gM(e,{method:`PUT`,body:JSON.stringify({[t]:n})})}var yM=class extends Error{conflicts;constructor(e,t){super(e),this.name=`IntakeBindingConflictError`,this.conflicts=t}};async function bM(e,t,n=``){let r=await fetch(`${e}/web/intake/bindings${n}`,{headers:{Accept:`application/json`,...t?.body?{"content-type":`application/json`}:{}},credentials:`include`,...t});if(!r.ok){let e=`Request failed (${r.status})`,t;try{let n=await r.json();n.message?e=n.message:n.error&&(e=n.error),n.error===`binding_conflict`&&(t=n.conflicts??[])}catch{}throw t?new yM(e,t):Error(e)}let{bindings:i}=await r.json();return i??[]}async function xM(e){return bM(e)}async function SM(e,t){return bM(e,{method:`PUT`,body:JSON.stringify(t)})}async function CM(e,t){return bM(e,{method:`DELETE`},`?${new URLSearchParams(t)}`)}function wM(e,t){let n=e.find(e=>e.integrationId===t.integrationId&&e.sourceId===t.sourceId&&(t.integrationId!==`jira`||e.factoryProjectId===t.factoryProjectId));if(t.factoryProjectId===null)return e.filter(e=>e!==n);let r={...n,integrationId:t.integrationId,sourceId:t.sourceId,factoryProjectId:t.factoryProjectId,labels:t.labels===void 0?n?.labels??null:t.labels};return n?e.map(e=>e===n?r:e):[...e,r]}function TM(e,t){return e.filter(e=>e.integrationId!==t.integrationId||e.sourceId!==t.sourceId||e.factoryProjectId!==t.factoryProjectId)}function EM(e){return Uu({queryKey:bA.intakeConfig(),queryFn:()=>_M(e)})}function DM(e=!0){let{baseUrl:t}=Og();return Hu({...EM(t),enabled:e})}function OM(e){return Uu({queryKey:bA.intakeBindings(),queryFn:()=>xM(e)})}function kM(e=!0){let{baseUrl:t}=Og();return Hu({...OM(t),enabled:e})}var AM=()=>[`intake-write`,`config`],jM=e=>[...AM(),e],MM=()=>[`intake-write`,`bindings`];function NM(e,t,n,r){let i=()=>e.isMutating({mutationKey:n})===1,a=n=>e.setQueryData(t,e=>e===void 0?void 0:r(e,n));return{scope:{id:n.join(`/`)},optimistic:async n=>{await e.cancelQueries({queryKey:t,exact:!0});let r=e.getQueryData(t);return a(n),{previous:r}},settle:n=>{i()&&e.setQueryData(t,n)},confirm:(n,r)=>{i()?e.setQueryData(t,n):a(r)},rollback:n=>{i()&&(n!==void 0&&e.setQueryData(t,n),e.invalidateQueries({queryKey:t,exact:!0}))}}}function PM(e,t){let{baseUrl:n}=Og(),r=NM(xl(),bA.intakeConfig(),AM(),(t,n)=>({...t,[e]:n}));return qu({mutationKey:jM(e),scope:r.scope,mutationFn:t=>vM(n,e,t),onMutate:r.optimistic,onSuccess:(e,n)=>{r.settle(e),t?.onSaved?.(n)},onError:(e,n,i)=>{r.rollback(i?.previous),t?.onFailed?.(e,n)}})}function FM(e){return Wu({mutationKey:jM(e)})>0}function IM(e){let{baseUrl:t}=Og(),n=NM(xl(),bA.intakeBindings(),MM(),wM);return qu({mutationKey:[...MM(),`save`],scope:n.scope,mutationFn:e=>SM(t,e),onMutate:n.optimistic,onSuccess:(t,r)=>{n.settle(t),e?.onSaved?.(r)},onError:(t,r,i)=>{n.rollback(i?.previous),e?.onFailed?.(t,r)}})}function LM(e){let{baseUrl:t}=Og(),n=NM(xl(),bA.intakeBindings(),MM(),TM);return qu({mutationKey:[...MM(),`delete`],scope:n.scope,mutationFn:e=>CM(t,e),onMutate:n.optimistic,onSuccess:(t,r)=>{n.settle(t),e?.onSaved?.(r)},onError:(t,r,i)=>{n.rollback(i?.previous),e?.onFailed?.(t,r)}})}function RM(e){let{baseUrl:t}=Og(),n=NM(xl(),bA.intakeBindings(),MM(),wM);return qu({mutationKey:[...MM(),`add`],scope:n.scope,mutationFn:e=>SM(t,e),onSuccess:(t,r)=>{n.confirm(t,r),e?.onSaved?.(r)},onError:(t,r)=>{n.rollback(),e?.onFailed?.(t,r)}})}function zM(e){e.invalidateQueries({queryKey:bA.factories()})}function BM(e,t){return Promise.all([e.invalidateQueries({queryKey:bA.factories()}),e.invalidateQueries({queryKey:bA.factoryEnvironment(t)})])}function VM(e){return e.refetchQueries({queryKey:bA.factories()})}async function HM(e){let t=await Kj(e);if(!t)throw Error(`Failed to load Factories`);return t}function UM(e){return Uu({queryKey:bA.factories(),queryFn:()=>HM(e)})}function WM(){let{baseUrl:e}=Og();return Hu(UM(e))}function GM(e){let{baseUrl:t}=Og();return Hu({...UM(t),select:t=>t.find(t=>t.id===e),enabled:!!e})}function KM(){let{baseUrl:e}=Og(),t=xl();return qu({mutationFn:({name:t,description:n})=>qj(e,t,n),onSuccess:()=>VM(t)})}function qM(){let{baseUrl:e}=Og(),t=xl(),n=PM(`gitlab`);return qu({mutationFn:async({factoryProjectId:r,repo:i,selectIntake:a=!0,onLinked:o})=>{let s=Mj(i),c=s?await dM(e,i.id):i,l=await eM(e,r,c.installationStorageId,s?`gitlab`:`github`),u=await tM(e,r,l,c,a);await o?.(u);let d=Promise.all([BM(t,r),t.invalidateQueries({queryKey:bA.intakeConfig()})]);try{if(a&&s){let t=await _M(e),r=hM(t.gitlab,i.id);r!==t.gitlab&&await n.mutateAsync(r)}}finally{await d}return u}})}function JM(){let{baseUrl:e}=Og(),t=xl();return qu({mutationFn:({factoryProjectId:t,projectRepositoryId:n})=>nM(e,t,n),onSuccess:(e,{factoryProjectId:n})=>BM(t,n)})}function YM(){let{baseUrl:e}=Og(),t=xl();return qu({mutationFn:t=>rM(e,t),onSuccess:()=>zM(t)})}var XM=l(`IconFileText`,()=>(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`path`,{d:`M12.1716 3H7C5.89543 3 5 3.89543 5 5V19C5 20.1046 5.89543 21 7 21H17C18.1046 21 19 20.1046 19 19V9.82843C19 9.29799 18.7893 8.78929 18.4142 8.41421L13.5858 3.58579C13.2107 3.21071 12.702 3 12.1716 3Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,w.jsx)(`path`,{d:`M13 3.5V7C13 8.10457 13.8954 9 15 9H18.5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,w.jsx)(`path`,{d:`M9 13H12`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,w.jsx)(`path`,{d:`M9 17H15.5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]}));function ZM(e){return!e||(0,C.isValidElement)(e)&&e.type===`button`?{type:`button`}:{}}function QM({render:e,icon:t,loading:n,className:r,children:i,...o}){let s=Yc({variant:`link`});return g({defaultTagName:`button`,render:e,props:u(ZM(e),{className:a(n?sl(s):s,`min-w-0 text-foreground [&>svg]:size-icon-sm [&>svg]:shrink-0`,r),children:(0,w.jsxs)(w.Fragment,{children:[n?(0,w.jsx)(el,{size:`sm`,loading:!0,children:t}):t,(0,w.jsx)(fl,{variant:`link`,children:i})]})},o,n?dl:void 0)})}function $M({children:e,className:t}){return(0,w.jsx)(`div`,{className:t,children:e})}var eN={success:{icon:(0,w.jsx)(yl,{}),iconClass:`text-success-indicator`},destructive:{icon:(0,w.jsx)(vl,{}),iconClass:`text-destructive-indicator`},warning:{icon:(0,w.jsx)(o,{}),iconClass:`text-warning-foreground`},info:{icon:(0,w.jsx)(_l,{}),iconClass:`text-info-indicator`},note:{icon:(0,w.jsx)(XM,{}),iconClass:`text-muted-foreground`}};function tN(e){return C.Children.toArray(e).some(e=>e!==``)}function nN({variant:e,title:t,icon:n,action:r,actionPlacement:i=`below`,onDismiss:o,children:s,className:c,...l}){let{icon:u,iconClass:d}=eN[e],f=tN(t),p=tN(s),m=tN(r);return(0,w.jsxs)(`div`,{...l,"data-slot":`notice`,"data-tone":e,"data-action-placement":i,className:a(`relative grid min-w-0 gap-x-3 rounded-lg p-3 text-body-sm`,o&&`pe-11`,c),children:[(f||p||m)&&(0,w.jsx)(`span`,{"data-slot":`notice-icon`,"aria-hidden":!0,className:a(`flex size-5 shrink-0 items-center justify-center [&>svg]:size-icon-sm`,d),children:n??u}),(f||p)&&(0,w.jsxs)(`div`,{"data-slot":`notice-content`,className:`flex min-w-0 flex-col gap-1 wrap-anywhere`,children:[f&&(0,w.jsx)(`div`,{className:`text-subheading`,children:t}),p&&(0,w.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:s})]}),m&&(0,w.jsx)(`div`,{"data-slot":`notice-action`,className:`flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2`,children:r}),o&&(0,w.jsx)(gl,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`absolute end-2 top-2 before:absolute before:-inset-2`,tooltip:`Dismiss notice`,onClick:o,children:(0,w.jsx)(Ag,{})})]})}var rN=Object.assign(nN,{Message:$M,Button:QM}),iN=e=>(0,w.jsx)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,w.jsx)(`path`,{d:`M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z`,fill:`currentColor`})});export{xj as $,Hn as $a,Ja as $i,ig as $n,at as $o,yl as $r,QO as $t,cM as A,Fi as Aa,_c as Ai,M_ as An,fn as Ao,Du as Ar,re as As,GA as At,Nj as B,$r as Ba,nc as Bi,d_ as Bn,Nt as Bo,Fl as Br,D as Bs,_A as Bt,vM as C,ra as Ca,Lc as Ci,Tv as Cn,on as Co,Bu as Cr,ve as Cs,LA as Ct,fM as D,Ri as Da,xc as Di,$_ as Dn,_n as Do,Iu as Dr,U as Ds,WA as Dt,aM as E,Yi as Ea,bc as Ei,nv as En,un as Eo,Lu as Er,oe as Es,HA as Et,qj as F,Ci as Fa,fc as Fi,o_ as Fn,pn as Fo,ou as Fr,F as Fs,TA as Ft,Bj as G,yr as Ga,vs as Gi,Gg as Gn,Tt as Go,Dl as Gr,Sk as Gt,Hj as H,Kr as Ha,zs as Hi,p_ as Hn,Mt as Ho,Gl as Hr,Pk as Ht,rM as I,wi as Ia,lc as Ii,s_ as In,xn as Io,au as Ir,P as Is,SA as It,Zj as J,Tr as Ja,ao as Ji,kg as Jn,vt as Jo,jl as Jr,ik as Jt,nM as K,vr as Ka,Zo as Ki,Vg as Kn,wt as Ko,Il as Kr,dk as Kt,Vj as L,vi as La,dc as Li,i_ as Ln,Ht as Lo,nu as Lr,ee as Ls,xA as Lt,$j as M,Mi as Ma,hc as Mi,k_ as Mn,qt as Mo,_u as Mr,j as Ms,BA as Mt,Ij as N,Ai as Na,mc as Ni,y_ as Nn,Kt as No,hu as Nr,R as Ns,NA as Nt,sM as O,zi as Oa,Sc as Oi,W_ as On,Wt as Oo,Pu as Or,H as Os,YA as Ot,Rj as P,bi as Pa,uc as Pi,a_ as Pn,Gt as Po,gu as Pr,L as Ps,MA as Pt,Oj as Q,Gn as Qa,Ha as Qi,Sg as Qn,ct as Qo,xl as Qr,sO as Qt,Jj as R,mi as Ra,cc as Ri,l_ as Rn,Ut as Ro,tu as Rr,A as Rs,yA as Rt,SM as S,ia as Sa,Ec as Si,Ev as Sn,an as So,Ru as Sr,he as Ss,zA as St,uM as T,Xi as Ta,yc as Ti,cv as Tn,dn as To,Fu as Tr,K as Ts,XA as Tt,Lj as U,xr as Ua,Ns as Ui,m_ as Un,Et as Uo,Nl as Ur,Fk as Ut,Mj as V,Gr as Va,$s as Vi,u_ as Vn,Pt as Vo,Pl as Vr,gA as Vt,Xj as W,Sr as Wa,Ts as Wi,qg as Wn,Dt as Wo,Ml as Wr,Ak as Wt,jj as X,Cr as Xa,Za as Xi,Eg as Xn,ut as Xo,Jl as Xr,TO as Xt,Qj as Y,_r as Ya,ro as Yi,Dg as Yn,pt as Yo,zl as Yr,nk as Yt,kj as Z,hr as Za,Ya as Zi,Og as Zn,lt as Zo,Sl as Zr,pO as Zt,FM as _,_a,Nc as _i,Fy as _n,$t as _o,Wu as _r,Ce as _s,sj as _t,KM as a,fa as aa,fl as ai,tk as an,X as ao,Lh as ar,nt as as,_j as at,yM as b,la as ba,Ic as bi,Xv as bn,tn as bo,Hu as br,be as bs,QA as bt,GM as c,ya as ca,Hc as ci,_O as cn,mn as co,th as cr,Xe as cs,mj as ct,OM as d,Sa as da,zc as di,Cy as dn,Xt as do,jm as dr,Fe as ds,dj as dt,Va as ea,vl as ei,yO as en,Bn as eo,ag as er,ot as es,wj as et,EM as f,Ca as fa,Ac as fi,Ly as fn,en as fo,Fm as fr,qe as fs,cj as ft,DM as g,xa as ga,Mc as gi,Iy as gn,yn as go,qu as gr,we as gs,ij as gt,kM as h,Ta as ha,jc as hi,zy as hn,sn as ho,Ld as hr,De as hs,aj as ht,UM as i,Ea as ia,el as ii,hO as in,Ln as io,lg as ir,J as is,Ej as it,lM as j,Ii as ja,gc as ji,A_ as jn,hn as jo,xu as jr,M as js,JA as jt,iM as k,Li as ka,Cc as ki,N_ as kn,Jt as ko,ju as kr,V as ks,KA as kt,qM as l,pa as la,Vc as li,lO as ln,Qt as lo,Om as lr,Me as ls,fj as lt,LM as m,ma,kc as mi,Ny as mn,cn as mo,$m as mr,Ee as ms,uj as mt,rN as n,Aa as na,gl as ni,DO as nn,Rn as no,tg as nr,et as ns,Sj as nt,YM as o,ha as oa,Yc as oi,CO as on,Dn as oo,Rh as or,Je as os,hj as ot,RM as p,wa as pa,Oc as pi,Ty as pn,gn as po,Im as pr,Ie as ps,lj as pt,Yj as q,br as qa,mo as qi,Ag as qn,_t as qo,Rl as qr,rk as qt,XM as r,Oa as ra,nl as ri,rO as rn,In as ro,vg as rr,tt as rs,Tj as rt,WM as s,ba as sa,hl as si,jD as sn,Y as so,Nh as sr,Qe as ss,gj as st,iN as t,za as ta,_l as ti,XO as tn,Vn as to,sg as tr,st as ts,yj as tt,JM as u,va as ua,Rc as ui,uD as un,Zt as uo,km as ur,q as us,pj as ut,IM as v,da as va,Pc as vi,Ry as vn,vn as vo,Ku as vr,Se as vs,ZA as vt,hM as w,na as wa,vc as wi,Cv as wn,Yt as wo,zu as wr,ce as ws,qA as wt,_M as x,aa as xa,wc as xi,Dv as xn,nn as xo,Vu as xr,_e as xs,tj as xt,PM as y,ua as ya,Fc as yi,wy as yn,rn as yo,Uu as yr,xe as ys,ej as yt,zj as z,fi as za,rc as zi,c_ as zn,It as zo,Ol as zr,k as zs,bA as zt};
|