@baochunli/flakes 0.0.5 → 0.0.6

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.
Files changed (126) hide show
  1. package/dist/node_modules/@flakes/auth/package.json +1 -1
  2. package/dist/node_modules/@flakes/console/.output/nitro.json +1 -1
  3. package/dist/node_modules/@flakes/console/.output/public/assets/{DocumentationPage-CNPk8RVl.js → DocumentationPage-CGIcMKwf.js} +1 -1
  4. package/dist/node_modules/@flakes/console/.output/public/assets/ProjectsPage-ByTl4Kyy.js +1 -0
  5. package/dist/node_modules/@flakes/console/.output/public/assets/RunPage-5MmbVpaE.js +3 -0
  6. package/dist/node_modules/@flakes/console/.output/public/assets/{RunsPage-CJbycrqM.js → RunsPage-fbDKP9kM.js} +1 -1
  7. package/dist/node_modules/@flakes/console/.output/public/assets/{SandboxesLens-BoLM52PY.js → SandboxesLens-DPG87mUE.js} +1 -1
  8. package/dist/node_modules/@flakes/console/.output/public/assets/SandboxesPage-DIpzR_Ef.js +1 -0
  9. package/dist/node_modules/@flakes/console/.output/public/assets/TranscriptPage-mCgSqfv0.js +1 -0
  10. package/dist/node_modules/@flakes/console/.output/public/assets/_-CM2hE2sZ.js +1 -0
  11. package/dist/node_modules/@flakes/console/.output/public/assets/_runId-3ZZOAqUK.js +2 -0
  12. package/dist/node_modules/@flakes/console/.output/public/assets/_taskId-cy4RxW8Y.js +2 -0
  13. package/dist/node_modules/@flakes/console/.output/public/assets/{account-BoRurhrq.js → account-BWoGGXJw.js} +1 -1
  14. package/dist/node_modules/@flakes/console/.output/public/assets/{account-forms-D4eVqOhW.js → account-forms-Dq70JDyg.js} +1 -1
  15. package/dist/node_modules/@flakes/console/.output/public/assets/{auth-layout-DBnq_eif.js → auth-layout-BFusNq3W.js} +1 -1
  16. package/dist/node_modules/@flakes/console/.output/public/assets/{bits-BOMPEHvv.js → bits-CTGNpp-v.js} +1 -1
  17. package/dist/node_modules/@flakes/console/.output/public/assets/device-BajR3eSF.js +1 -0
  18. package/dist/node_modules/@flakes/console/.output/public/assets/documentation-6ao_Ux6x.js +1 -0
  19. package/dist/node_modules/@flakes/console/.output/public/assets/{forgot-password-BSQ4TWpA.js → forgot-password-DOKn8_7P.js} +1 -1
  20. package/dist/node_modules/@flakes/console/.output/public/assets/main-DVO9gWzi.js +1215 -0
  21. package/dist/node_modules/@flakes/console/.output/public/assets/{otp-verification-CussJQT1.js → otp-verification-qolVtiom.js} +2 -2
  22. package/dist/node_modules/@flakes/console/.output/public/assets/projects-n5LSsNi3.js +2 -0
  23. package/dist/node_modules/@flakes/console/.output/public/assets/{reset-password-DwWhVkEh.js → reset-password-D-OlZeHQ.js} +1 -1
  24. package/dist/node_modules/@flakes/console/.output/public/assets/runs-BB9ogobQ.js +2 -0
  25. package/dist/node_modules/@flakes/console/.output/public/assets/sandboxes-BIimz5FI.js +2 -0
  26. package/dist/node_modules/@flakes/console/.output/public/assets/{security-MjM55vIw.js → security-DdQNcp6k.js} +1 -1
  27. package/dist/node_modules/@flakes/console/.output/public/assets/{signin-KbA1cD6o.js → signin-BoZiVxyq.js} +1 -1
  28. package/dist/node_modules/@flakes/console/.output/public/assets/{signin-form-CBF-d8iK.js → signin-form-tTBWDjhi.js} +1 -1
  29. package/dist/node_modules/@flakes/console/.output/public/assets/{signup-CbHsThKr.js → signup-CBSszmUC.js} +1 -1
  30. package/dist/node_modules/@flakes/console/.output/public/assets/styles-B8OXOvkO.css +2 -0
  31. package/dist/node_modules/@flakes/console/.output/server/{_-BULJ6utw.mjs → _-BGsKgsbF.mjs} +3 -3
  32. package/dist/node_modules/@flakes/console/.output/server/{_-_ST9QYWn.mjs → _-DtPMXzt0.mjs} +3 -3
  33. package/dist/node_modules/@flakes/console/.output/server/_chunks/ProjectsPage.mjs +1 -2
  34. package/dist/node_modules/@flakes/console/.output/server/_chunks/RunPage.mjs +1 -2
  35. package/dist/node_modules/@flakes/console/.output/server/_chunks/RunsPage.mjs +1 -2
  36. package/dist/node_modules/@flakes/console/.output/server/_chunks/SandboxesLens.mjs +1 -1
  37. package/dist/node_modules/@flakes/console/.output/server/_chunks/SandboxesPage.mjs +253 -18
  38. package/dist/node_modules/@flakes/console/.output/server/_chunks/TranscriptPage.mjs +1 -2
  39. package/dist/node_modules/@flakes/console/.output/server/_chunks/bits.mjs +1 -1
  40. package/dist/node_modules/@flakes/console/.output/server/_chunks/button.mjs +461 -3
  41. package/dist/node_modules/@flakes/console/.output/server/_chunks/card.mjs +1 -1
  42. package/dist/node_modules/@flakes/console/.output/server/_chunks/router.mjs +3 -4
  43. package/dist/node_modules/@flakes/console/.output/server/_chunks/table.mjs +1 -1
  44. package/dist/node_modules/@flakes/console/.output/server/{_runId-WZmbo654.mjs → _runId-P1u-vfcm.mjs} +2 -2
  45. package/dist/node_modules/@flakes/console/.output/server/{_runId-CmYWNL8A.mjs → _runId-vO4tlCOP.mjs} +3 -3
  46. package/dist/node_modules/@flakes/console/.output/server/_ssr/{App-CUx8Ftit.mjs → App-C-XaVKoO.mjs} +2 -2
  47. package/dist/node_modules/@flakes/console/.output/server/_ssr/{DocumentationPage-0I9oWWJT.mjs → DocumentationPage-BR2KosFz.mjs} +2 -2
  48. package/dist/node_modules/@flakes/console/.output/server/_ssr/{ProjectsPage-CGj9V2Of.mjs → ProjectsPage-BUrep1wl.mjs} +2 -2
  49. package/dist/node_modules/@flakes/console/.output/server/_ssr/{RunPage-B2vhVaj6.mjs → RunPage-BHs-v0LU.mjs} +2 -2
  50. package/dist/node_modules/@flakes/console/.output/server/_ssr/{RunsPage-BifKogQE.mjs → RunsPage-iTNYVwL0.mjs} +2 -2
  51. package/dist/node_modules/@flakes/console/.output/server/_ssr/SandboxesPage-C1Z6dVce.mjs +423 -0
  52. package/dist/node_modules/@flakes/console/.output/server/_ssr/{TranscriptPage-deSxVZaQ.mjs → TranscriptPage-BcomoTls.mjs} +2 -2
  53. package/dist/node_modules/@flakes/console/.output/server/_ssr/{account-D5y9vkAc.mjs → account-Cp0s_IQK.mjs} +2 -2
  54. package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-C91gfyy0.mjs → documentation-BnxmM-Yo.mjs} +2 -2
  55. package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-C69e9_eF.mjs → documentation-Cgyr3VKK.mjs} +3 -3
  56. package/dist/node_modules/@flakes/console/.output/server/_ssr/{hooks-DrgN35zn.mjs → hooks-CsVtQ1m-.mjs} +117 -51
  57. package/dist/node_modules/@flakes/console/.output/server/_ssr/{projects-lJ2tIIPj.mjs → projects-R9sxR_t4.mjs} +1 -1
  58. package/dist/node_modules/@flakes/console/.output/server/_ssr/{router-DHxFQ03L.mjs → router-CobdI6gO.mjs} +12 -12
  59. package/dist/node_modules/@flakes/console/.output/server/_ssr/{runs-dnPfp9dt.mjs → runs-D8MHe3QU.mjs} +2 -2
  60. package/dist/node_modules/@flakes/console/.output/server/_ssr/{runs-BWxEGKO_.mjs → runs-mTxbc_pm.mjs} +3 -3
  61. package/dist/node_modules/@flakes/console/.output/server/_ssr/{sandboxes-v28LJQM3.mjs → sandboxes-B2z_9JyU.mjs} +2 -2
  62. package/dist/node_modules/@flakes/console/.output/server/_ssr/{sandboxes-hxFINxDS.mjs → sandboxes-r0y6Ihg6.mjs} +3 -3
  63. package/dist/node_modules/@flakes/console/.output/server/_ssr/ssr.mjs +2 -2
  64. package/dist/node_modules/@flakes/console/.output/server/{_tanstack-start-manifest_v-DfwuEzTr.mjs → _tanstack-start-manifest_v-DpAwCFK9.mjs} +32 -33
  65. package/dist/node_modules/@flakes/console/.output/server/{_taskId-CBo95z-s.mjs → _taskId-Cz9xwj5L.mjs} +2 -2
  66. package/dist/node_modules/@flakes/console/.output/server/{_taskId-Sil3-PKh.mjs → _taskId-wQsG2CQj.mjs} +3 -3
  67. package/dist/node_modules/@flakes/console/package.json +1 -1
  68. package/dist/node_modules/@flakes/control-plane/dist/host-credentials.d.ts +1 -1
  69. package/dist/node_modules/@flakes/control-plane/dist/host-credentials.d.ts.map +1 -1
  70. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes.js +48 -3
  71. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes.js.map +1 -1
  72. package/dist/node_modules/@flakes/control-plane/package.json +1 -1
  73. package/dist/node_modules/@flakes/core/package.json +1 -1
  74. package/dist/node_modules/@flakes/harness-agent/package.json +1 -1
  75. package/dist/node_modules/@flakes/harness-sdk/package.json +1 -1
  76. package/dist/node_modules/@flakes/pi-agent/package.json +1 -1
  77. package/dist/node_modules/@flakes/protocol/package.json +1 -1
  78. package/dist/node_modules/@flakes/sandbox-runtime/package.json +1 -1
  79. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.d.ts +9 -1
  80. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.d.ts.map +1 -1
  81. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.js +407 -6
  82. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.js.map +1 -1
  83. package/dist/node_modules/@flakes/store/dist/mappers.d.ts.map +1 -1
  84. package/dist/node_modules/@flakes/store/dist/mappers.js +1 -0
  85. package/dist/node_modules/@flakes/store/dist/mappers.js.map +1 -1
  86. package/dist/node_modules/@flakes/store/dist/types.d.ts +30 -1
  87. package/dist/node_modules/@flakes/store/dist/types.d.ts.map +1 -1
  88. package/dist/node_modules/@flakes/store/package.json +1 -1
  89. package/package.json +1 -1
  90. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.d.ts +0 -10
  91. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.d.ts.map +0 -1
  92. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.js +0 -16
  93. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.js.map +0 -1
  94. package/dist/node_modules/@flakes/console/.output/public/assets/ProjectsPage-CKPR1nnu.js +0 -1
  95. package/dist/node_modules/@flakes/console/.output/public/assets/RunPage-BdugbnA3.js +0 -3
  96. package/dist/node_modules/@flakes/console/.output/public/assets/SandboxesPage-6KHjMeaR.js +0 -1
  97. package/dist/node_modules/@flakes/console/.output/public/assets/TranscriptPage-CHSq0_qN.js +0 -1
  98. package/dist/node_modules/@flakes/console/.output/public/assets/_-CD1Voz9h.js +0 -1
  99. package/dist/node_modules/@flakes/console/.output/public/assets/_runId-_0VPmGYe.js +0 -2
  100. package/dist/node_modules/@flakes/console/.output/public/assets/_taskId-CPAKAp4X.js +0 -2
  101. package/dist/node_modules/@flakes/console/.output/public/assets/device-FqII-S41.js +0 -1
  102. package/dist/node_modules/@flakes/console/.output/public/assets/dist-BEfdrJTS.js +0 -1
  103. package/dist/node_modules/@flakes/console/.output/public/assets/documentation-2C3ncAuV.js +0 -1
  104. package/dist/node_modules/@flakes/console/.output/public/assets/main-LpSDdT-S.js +0 -1215
  105. package/dist/node_modules/@flakes/console/.output/public/assets/projects-CLgKBrCe.js +0 -2
  106. package/dist/node_modules/@flakes/console/.output/public/assets/runs-CFYk2iRh.js +0 -2
  107. package/dist/node_modules/@flakes/console/.output/public/assets/sandboxes-mGsOcVFL.js +0 -2
  108. package/dist/node_modules/@flakes/console/.output/public/assets/styles-DtA2wbW8.css +0 -2
  109. package/dist/node_modules/@flakes/console/.output/server/_chunks/utils.mjs +0 -393
  110. package/dist/node_modules/@flakes/console/.output/server/_ssr/SandboxesPage-DGji_OdB.mjs +0 -187
  111. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.d.ts +0 -71
  112. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.d.ts.map +0 -1
  113. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.js +0 -243
  114. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.js.map +0 -1
  115. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.d.ts +0 -3
  116. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.d.ts.map +0 -1
  117. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.js +0 -153
  118. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.js.map +0 -1
  119. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.d.ts +0 -19
  120. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.d.ts.map +0 -1
  121. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.js +0 -46
  122. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.js.map +0 -1
  123. package/dist/node_modules/@flakes/store/dist/sqlite.d.ts +0 -4
  124. package/dist/node_modules/@flakes/store/dist/sqlite.d.ts.map +0 -1
  125. package/dist/node_modules/@flakes/store/dist/sqlite.js +0 -34
  126. package/dist/node_modules/@flakes/store/dist/sqlite.js.map +0 -1
@@ -0,0 +1,1215 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/signup-CBSszmUC.js","assets/react-B8IZ02wI.js","assets/link-ll3nLBSM.js","assets/react-dom-ki7NpxV4.js","assets/tiny-invariant-CO5X59di.js","assets/utils-CBxvVKOM.js","assets/otp-verification-qolVtiom.js","assets/lock-Ck2SfQA2.js","assets/signin-form-tTBWDjhi.js","assets/circle-alert-CM0SVfzc.js","assets/user-Bt9z7sSI.js","assets/auth-layout-BFusNq3W.js","assets/card-37qs8AAd.js","assets/signin-BoZiVxyq.js","assets/sandboxes-BIimz5FI.js","assets/runs-BB9ogobQ.js","assets/reset-password-D-OlZeHQ.js","assets/projects-n5LSsNi3.js","assets/forgot-password-DOKn8_7P.js","assets/documentation-6ao_Ux6x.js","assets/DocumentationPage-CGIcMKwf.js","assets/lib-COfgMmRR.js","assets/external-link-BWhbbPgy.js","assets/file-text-DLxLJ7P1.js","assets/device-BajR3eSF.js","assets/arrow-right-QzVbRzF_.js","assets/circle-check-CzwcEElH.js","assets/circle-x-C_sOQVNQ.js","assets/account-BWoGGXJw.js","assets/account-forms-Dq70JDyg.js","assets/save-Bte_1tnN.js","assets/security-DdQNcp6k.js","assets/_runId-3ZZOAqUK.js","assets/_-CM2hE2sZ.js","assets/_taskId-cy4RxW8Y.js"])))=>i.map(i=>d[i]);
2
+ import{i as e,n as t,t as n}from"./react-B8IZ02wI.js";import{a as r,c as i,d as a,f as o,i as s,l as c,m as l,o as u,p as d,r as f,s as p,t as m,u as h}from"./tiny-invariant-CO5X59di.js";import{_ as g,a as _,c as v,d as y,f as b,g as x,h as S,i as C,l as w,m as E,n as D,o as ee,p as te,r as ne,s as re,t as O,u as ie}from"./link-ll3nLBSM.js";import{a as ae,i as k,n as A,r as oe,t as se}from"./redirect-Cu9zBy04.js";import{n as ce,t as le}from"./qss-4JXuaDtg.js";import{n as ue,r as j,t as de}from"./matchContext-puEkI9BI.js";import{a as fe,c as pe,i as me,l as he,n as ge,r as _e,t as ve}from"./react-dom-ki7NpxV4.js";import{n as ye,r as be,t as xe}from"./utils-CBxvVKOM.js";var Se=new WeakMap,Ce=new WeakMap,we={current:[]},Te=!1,Ee=0,De=new Set,Oe=new Map;function ke(e){let t=Array.from(e).sort((e,t)=>e instanceof Ie&&e.options.deps.includes(t)?1:t instanceof Ie&&t.options.deps.includes(e)?-1:0);for(let e of t){if(we.current.includes(e))continue;we.current.push(e),e.recompute();let t=Ce.get(e);if(t)for(let e of t){let t=Se.get(e);t&&ke(t)}}}function Ae(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function je(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function Me(e){if(Ee>0&&!Oe.has(e)&&Oe.set(e,e.prevState),De.add(e),!(Ee>0)&&!Te)try{for(Te=!0;De.size>0;){let e=Array.from(De);De.clear();for(let t of e)t.prevState=Oe.get(t)??t.prevState,Ae(t);for(let t of e){let e=Se.get(t);e&&(we.current.push(t),ke(e))}for(let t of e){let e=Se.get(t);if(e)for(let t of e)je(t)}}}finally{Te=!1,we.current=[],Oe.clear()}}function Ne(e){Ee++;try{e()}finally{if(Ee--,Ee===0){let e=De.values().next().value;e&&Me(e)}}}function Pe(e){return typeof e==`function`}var Fe=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):Pe(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),Me(this)}},Ie=class e{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=this.options.deps.length,t=Array(e),n=Array(e);for(let r=0;r<e;r++){let e=this.options.deps[r];t[r]=e.prevState,n[r]=e.state}return this.lastSeenDepValues=n,{prevDepVals:t,currDepVals:n,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let n=this.getDepVals();this.state=this.options.fn(n),(t=(e=this.options).onUpdate)==null||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let t of this.options.deps)t instanceof e&&t.checkIfRecalculationNeededDeeply();let t=!1,n=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let e=0;e<r.length;e++)if(r[e]!==n[e]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(let e of this._subscriptions)e()}),this.subscribe=e=>{var t;this.listeners.add(e);let n=(t=this.options).onSubscribe?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(let n of t)if(n instanceof e)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof Fe){let e=Se.get(n);e||(e=new Set,Se.set(n,e)),e.add(this);let t=Ce.get(this);t||(t=new Set,Ce.set(this,t)),t.add(n)}}unregisterFromGraph(t=this.options.deps){for(let n of t)if(n instanceof e)this.unregisterFromGraph(n.options.deps);else if(n instanceof Fe){let e=Se.get(n);e&&e.delete(this);let t=Ce.get(this);t&&t.delete(n)}}},Le=`__TSR_index`,Re=`popstate`,ze=`beforeunload`;function Be(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=We(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Le];i=Ve(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Le];i=Ve(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Le]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ve(e,t){t||={};let n=Ge();return{...t,key:n,__TSR_key:n,[Le]:e}}function He(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>We(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Ge();t.history.replaceState({[Le]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=We(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[Le]-l.state[Le],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Be({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(ze,S,{capture:!0}),t.removeEventListener(Re,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(ze,S,{capture:!0}),t.addEventListener(Re,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Ue(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function We(e,t){let n=Ue(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Ge();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Le]:0,key:a,__TSR_key:a}}}function Ge(){return(Math.random()+1).toString(36).substring(7)}function Ke(e){let t;return Ne(()=>{t=e()}),t}function qe(){try{if(typeof window<`u`&&typeof window.sessionStorage==`object`)return window.sessionStorage}catch{}}var Je=`tsr-scroll-restoration-v1_3`,Ye=(e,t)=>{let n;return(...r)=>{n||=setTimeout(()=>{e(...r),n=null},t)}};function Xe(){let e=qe();if(!e)return null;let t=e.getItem(Je),n=t?JSON.parse(t):{};return{state:n,set:t=>{n=i(t,n)||n;try{e.setItem(Je,JSON.stringify(n))}catch{console.warn(`[ts-router] Could not persist scroll restoration state to sessionStorage.`)}}}}var Ze=Xe(),Qe=e=>e.state.__TSR_key||e.href;function $e(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var et=!1;function tt({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||`{}`)}catch(e){console.error(e);return}let s=t||window.history.state?.__TSR_key,c=o[s];et=!0;scroll:{if(r&&c&&Object.keys(c).length>0){for(let e in c){let t=c[e];if(e===`window`)window.scrollTo({top:t.scrollY,left:t.scrollX,behavior:n});else if(e){let n=document.querySelector(e);n&&(n.scrollLeft=t.scrollX,n.scrollTop=t.scrollY)}}break scroll}let e=(a??window.location).hash.split(`#`,2)[1];if(e){let t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){let n=document.getElementById(e);n&&n.scrollIntoView(t)}break scroll}let t={top:0,left:0,behavior:n};if(window.scrollTo(t),i)for(let e of i){if(e===`window`)continue;let n=typeof e==`function`?e():document.querySelector(e);n&&n.scrollTo(t)}}et=!1}function nt(e,t){if(!Ze||((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Ze))return;e.isScrollRestorationSetup=!0,et=!1;let n=e.options.getScrollRestorationKey||Qe;window.history.scrollRestoration=`manual`,typeof document<`u`&&document.addEventListener(`scroll`,Ye(t=>{if(et||!e.isScrollRestoring)return;let r=``;if(t.target===document||t.target===window)r=`window`;else{let e=t.target.getAttribute(`data-scroll-restoration-id`);r=e?`[data-scroll-restoration-id="${e}"]`:$e(t.target)}let i=n(e.state.location);Ze.set(e=>{let t=e[i]||={},n=t[r]||={};if(r===`window`)n.scrollX=window.scrollX||0,n.scrollY=window.scrollY||0;else if(r){let e=document.querySelector(r);e&&(n.scrollX=e.scrollLeft||0,n.scrollY=e.scrollTop||0)}return e})},100),!0),e.subscribe(`onRendered`,t=>{let r=n(t.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation})||(tt({storageKey:Je,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Ze.set(e=>(e[r]||={},e)))})}function rt(e){if(typeof document<`u`&&document.querySelector){let t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==``){let n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}var it=ot(JSON.parse),at=st(JSON.stringify,JSON.parse);function ot(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=le(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function st(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=ce(e,r);return t?`?${t}`:``}}var ct=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},lt=(e,t)=>!!(e.preload&&!e.router.state.matches.some(e=>e.id===t)),ut=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},dt=(e,t)=>{let n=e.router.routesById[t.routeId??``]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),m(n.options.notFoundComponent,`No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.`);let r=e.matches.find(e=>e.routeId===n.id);m(r,`Could not find match for route: `+n.id),e.updateMatch(r.id,e=>({...e,status:`notFound`,error:t,isFetching:!1})),t.routerCode===`BEFORE_LOAD`&&n.parentRoute&&(t.routeId=n.parentRoute.id,dt(e,t))},ft=(e,t,n)=>{if(!(!se(n)&&!k(n))){if(se(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;let r=se(n)?`redirected`:`notFound`;t._nonReactive.error=n,e.updateMatch(t.id,i=>({...i,status:r,context:ut(e,t.index),isFetching:!1,error:n})),k(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw se(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(dt(e,n),n)}},pt=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,mt=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,ft(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,ft(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},ht=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!lt(e,t)&&(n.options.loader||n.options.beforeLoad||Tt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{ct(e)},i);r._nonReactive.pendingTimeout=t}},gt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;ht(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&ft(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},_t=(e,t,n,r)=>{let i=e.router.getMatch(t),o=i._nonReactive.loadPromise;i._nonReactive.loadPromise=f(()=>{o?.resolve()});let{paramsError:s,searchError:c}=i;s&&mt(e,n,s,`PARSE_PARAMS`),c&&mt(e,n,c,`VALIDATE_SEARCH`),ht(e,t,r,i);let l=new AbortController,u=!1,d=()=>{u||(u=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:l})))},p=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){Ke(()=>{d(),p()});return}i._nonReactive.beforeLoadPromise=f();let m={...ut(e,n,!1),...i.__routeContext},{search:h,params:g,cause:_}=i,v=lt(e,t),y={search:h,abortController:l,params:g,preload:v,context:m,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?`preload`:_,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},b=r=>{if(r===void 0){Ke(()=>{d(),p()});return}(se(r)||k(r))&&(d(),mt(e,n,r,`BEFORE_LOAD`)),Ke(()=>{d(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),p()})},x;try{if(x=r.options.beforeLoad(y),a(x))return d(),x.catch(t=>{mt(e,n,t,`BEFORE_LOAD`)}).then(b)}catch(t){d(),mt(e,n,t,`BEFORE_LOAD`)}b(x)},vt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],o=()=>c(),s=()=>_t(e,n,t,i),c=()=>{if(pt(e,n))return;let t=gt(e,n,i);return a(t)?t.then(s):s()};return o()},yt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},bt=(e,t,n,r)=>{let i=e.matchPromises[n-1],{params:a,loaderDeps:o,abortController:s,cause:c}=e.router.getMatch(t),l=ut(e,n),u=lt(e,t);return{params:a,deps:o,preload:!!u,parentMatchPromise:i,abortController:s,context:l,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:u?`preload`:c,route:r,...e.router.options.additionalContext}},xt=async(e,t,n,r)=>{try{let i=e.router.getMatch(t);try{wt(r);let o=r.options.loader?.(bt(e,t,n,r)),s=r.options.loader&&a(o);if((s||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,e=>({...e,isFetching:`loader`})),r.options.loader){let n=s?await o:o;ft(e,e.router.getMatch(t),n),n!==void 0&&e.updateMatch(t,e=>({...e,loaderData:n}))}r._lazyPromise&&await r._lazyPromise;let c=i._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,t=>({...t,error:void 0,context:ut(e,n),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(a){let o=a;if(o?.name===`AbortError`){if(i.abortController.signal.aborted){i._nonReactive.loaderPromise?.resolve(),i._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:ut(e,n)}));return}let s=i._nonReactive.minPendingPromise;s&&await s,k(a)&&await r.options.notFoundComponent?.preload?.(),ft(e,e.router.getMatch(t),a);try{r.options.onError?.(a)}catch(n){o=n,ft(e,e.router.getMatch(t),n)}e.updateMatch(t,t=>({...t,error:o,context:ut(e,n),status:`error`,isFetching:!1}))}}catch(n){let r=e.router.getMatch(t);r&&(r._nonReactive.loaderPromise=void 0),ft(e,r,n)}},St=async(e,t)=>{async function n(n,i,s,c){let l=Date.now()-i.updatedAt,u=n?c.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.router.options.defaultStaleTime??0,d=c.options.shouldReload,f=typeof d==`function`?d(bt(e,r,t,c)):d,{status:p,invalid:m}=s;a=p===`success`&&(m||(f??l>u)),n&&c.options.preload===!1||(a&&!e.sync?(o=!0,(async()=>{try{await xt(e,r,t,c);let n=e.router.getMatch(r);n._nonReactive.loaderPromise?.resolve(),n._nonReactive.loadPromise?.resolve(),n._nonReactive.loaderPromise=void 0}catch(t){se(t)&&await e.router.navigate(t.options)}})()):(p!==`success`||a&&e.sync)&&await xt(e,r,t,c))}let{id:r,routeId:i}=e.matches[t],a=!1,o=!1,s=e.router.looseRoutesById[i];if(!pt(e,r)){let t=e.router.getMatch(r),i=lt(e,r);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload)return t;await t._nonReactive.loaderPromise;let a=e.router.getMatch(r),o=a._nonReactive.error||a.error;o&&ft(e,a,o),a.status===`pending`&&await n(i,t,a,s)}else{let a=i&&!e.router.state.matches.some(e=>e.id===r),o=e.router.getMatch(r);o._nonReactive.loaderPromise=f(),a!==o.preload&&e.updateMatch(r,e=>({...e,preload:a})),await n(i,t,o,s)}}let c=e.router.getMatch(r);o||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,o||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;let l=o?c.isFetching:!1;return l!==c.isFetching||c.invalid!==!1?(e.updateMatch(r,e=>({...e,isFetching:l,invalid:!1})),e.router.getMatch(r)):c};async function Ct(e){let t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(e=>e._forcePending)&&ct(t);try{for(let e=0;e<t.matches.length;e++){let n=vt(t,e);a(n)&&await n}let e=t.firstBadMatchIndex??t.matches.length;for(let n=0;n<e;n++)t.matchPromises.push(St(t,n));let n=(await Promise.allSettled(t.matchPromises)).filter(e=>e.status===`rejected`).map(e=>e.reason),r;for(let e of n){if(se(e))throw e;!r&&k(e)&&(r=e)}for(let e of t.matches){let{id:n,routeId:r}=e,i=t.router.looseRoutesById[r];try{let e=yt(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}if(r)throw r;let i=ct(t);a(i)&&await i}catch(e){if(k(e)&&!t.preload){let n=ct(t);throw a(n)&&await n,e}if(se(e))throw e}return t.matches}async function wt(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){let t=()=>{let t=[];for(let n of Et){let r=e.options[n]?.preload;r&&t.push(r())}if(t.length)return Promise.all(t).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Tt(e){for(let t of Et)if(e.options[t]?.preload)return!0;return!1}var Et=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function Dt(e){return{input:({url:t})=>{for(let n of e)t=kt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=At(e[n],t);return t}}}function Ot(e){let t=w(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=re([`/`,t,e.pathname]),e)}}function kt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function At(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function jt(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function Mt(e){let t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}var Nt=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn(`The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.`);let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=_(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=He()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=g(1e3),e=this.buildRouteTree(),this.setRoutes(e)}!this.__store&&this.latestLocation&&(this.__store=new Fe(It(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(e=>![`redirected`].includes(e.status))}}}),nt(this));let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=w(o);t&&t!==`/`&&e.push(Ot({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Dt(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=x(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&S(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let o=this.options.parseSearch(n),c=this.options.stringifySearch(o);return{href:e+c+r,publicHref:i,pathname:s(e).path,external:!1,searchStr:c,search:d(t?.search,o),hash:s(r.slice(1)).path,state:d(t?.state,a)}}let o=new URL(i,this.origin),c=kt(this.rewrite,o),l=this.options.parseSearch(c.search),u=this.options.stringifySearch(l);return c.search=u,{href:c.href.replace(c.origin,``),publicHref:i,pathname:s(c.pathname).path,external:!!this.rewrite&&c.origin!==this.origin,searchStr:u,search:d(t?.search,l),hash:s(c.hash.slice(1)).path,state:d(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>v({base:e,to:C(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Rt({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{let e=this.state.matches.filter(e=>e.status===`pending`),t=this.state.matches.filter(e=>e.isFetching===`loader`);new Set([...this.state.pendingMatches??[],...e,...t]).forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let a=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,o=this.resolvePathWithBase(a,`.`),c=r.search,l={...r.params},f=t.to?this.resolvePathWithBase(o,`${t.to}`):this.resolvePathWithBase(o,`.`),p=t.params===!1||t.params===null?{}:(t.params??!0)===!0?l:Object.assign(l,i(t.params,l)),m=ee({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,h=this.getMatchedRoutes(m),g=h.matchedRoutes;(h.foundRoute?h.foundRoute.path!==`/`&&h.routeParams[`**`]:y(m))&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]);let _=!1;if(Object.keys(p).length>0)for(let e of g){let t=e.options.params?.stringify??e.options.stringifyParams;t&&(_=!0,Object.assign(p,t(p)))}let v=e.leaveParams?f:s(_?ee({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:m).path,b=c;if(e._includeValidateSearch&&this.options.search?.strict){let e={};g.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Lt(t.options.validateSearch,{...e,...b}))}catch{}}),b=e}b=zt({search:b,dest:t,destRoutes:g,_includeValidateSearch:e._includeValidateSearch}),b=d(c,b);let x=this.options.stringifySearch(b),S=t.hash===!0?n.hash:t.hash?i(t.hash,n.hash):void 0,C=S?`#${S}`:``,w=t.state===!0?n.state:t.state?i(t.state,n.state):{};w=d(n.state,w);let E=`${v}${x}${C}`,D,te,ne=!1;if(this.rewrite){let e=new URL(E,this.origin),t=At(this.rewrite,e);D=e.href.replace(e.origin,``),t.origin===this.origin?te=t.pathname+t.search+t.hash:(te=t.href,ne=!0)}else D=u(E),te=D;return{publicHref:te,href:D,pathname:v,search:b,searchStr:x,state:w,hash:S??``,external:ne,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let a=t(n),o=r?t(r):void 0;if(!o){let n={};if(this.options.routeMasks){let s=b(a.pathname,this.processedTree);if(s){Object.assign(n,s.rawParams);let{from:a,params:c,...l}=s.route,u=c===!1||c===null?{}:(c??!0)===!0?n:Object.assign(n,i(c,n));r={from:e.from,...l,params:u},o=t(r)}}}return o&&(a.maskedLocation=o),a};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=r(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=y(this.latestLocation.href)===y(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=f(()=>{o?.resolve()}),a&&i())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=We(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=kt(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(c(t))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation);this.__store.setState(t=>({...t,status:`pending`,statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:t.cachedMatches.filter(t=>!e.some(e=>e.id===t.id))}))},this.load=async e=>{let t,n,r;for(r=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.state.resolvedLocation;this.state.redirect||this.emit({type:`onBeforeNavigate`,...Mt({resolvedLocation:n,location:t})}),this.emit({type:`onBeforeLoad`,...Mt({resolvedLocation:n,location:t})}),await Ct({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=[],t=[],n=[];Ke(()=>{this.__store.setState(r=>{let i=r.matches,a=r.pendingMatches||r.matches;return e=i.filter(e=>!a.some(t=>t.id===e.id)),t=a.filter(e=>!i.some(t=>t.id===e.id)),n=a.filter(e=>i.some(t=>t.id===e.id)),{...r,isLoading:!1,loadedAt:Date.now(),matches:a,pendingMatches:void 0,cachedMatches:[...r.cachedMatches,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`)]}}),this.clearExpiredCache()}),[[e,`onLeave`],[t,`onEnter`],[n,`onStay`]].forEach(([e,t])=>{e.forEach(e=>{this.looseRoutesById[e.routeId].options[t]?.(e)})})})})}})}catch(e){se(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):k(e)&&(n=e),this.__store.setState(e=>({...e,statusCode:t?t.status:n?404:e.matches.some(e=>e.status===`error`)?500:200,redirect:t}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(e=>e.status===`error`)&&(i=500),i!==void 0&&this.__store.setState(e=>({...e,statusCode:i}))},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.state.resolvedLocation,a=typeof t.types==`function`?t.types(Mt({resolvedLocation:i,location:r})):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.state.pendingMatches?.some(t=>t.id===e)?`pendingMatches`:this.state.matches.some(t=>t.id===e)?`matches`:this.state.cachedMatches.some(t=>t.id===e)?`cachedMatches`:``;n&&this.__store.setState(r=>({...r,[n]:r[n]?.map(n=>n.id===e?t(n):n)}))})},this.getMatch=e=>{let t=t=>t.id===e;return this.state.cachedMatches.find(t)??this.state.pendingMatches?.find(t)??this.state.matches.find(t)},this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.__store.setState(e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.__store.setState(e=>({...e,cachedMatches:[]})):this.__store.setState(e=>({...e,cachedMatches:e.cachedMatches.filter(e=>!t(e))}))},this.clearExpiredCache=()=>{this.clearCache({filter:e=>{let t=this.looseRoutesById[e.routeId];if(!t.options.loader)return!0;let n=(e.preload?t.options.preloadGcTime??this.options.defaultPreloadGcTime:t.options.gcTime??this.options.defaultGcTime)??300*1e3;return e.status===`error`?!0:Date.now()-e.updatedAt>=n}})},this.loadRouteChunk=wt,this.preloadRoute=async e=>{let t=this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(e=>e.id)),i=new Set([...r,...this.state.cachedMatches.map(e=>e.id)]);Ke(()=>{n.forEach(e=>{i.has(e.id)||this.__store.setState(t=>({...t,cachedMatches:[...t.cachedMatches,e]}))})});try{return n=await Ct({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(se(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});k(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},i=this.buildLocation(n);if(t?.pending&&this.state.status!==`pending`)return!1;let a=(t?.pending===void 0?!this.state.isLoading:t.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,o=E(i.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!r(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?r(a.search,i.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status===`notFound`||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??at,parseSearch:e.parseSearch??it}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:y(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?Vt(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map(this.state.matches.map(e=>[e.routeId,e]));for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],p,m,h;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=Lt(r.options.validateSearch,{...n})??void 0;p={...n,...e},m={...i,...e},h=void 0}catch(e){let r=e;if(e instanceof Pt||(r=new Pt(e.message,{cause:e})),t?.throwOnError)throw r;p=n,m={},h=r}}let g=r.options.loaderDeps?.({search:p})??``,_=g?JSON.stringify(g):``,{interpolatedPath:v,usedParams:y}=ee({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),b=r.id+v+_,x=this.getMatch(b),S=u.get(r.id),C=x?._strictParams??y,w;if(!x)try{Ht(r,y,a,C)}catch(e){if(w=k(e)||se(e)?e:new Ft(e.message,{cause:e}),t?.throwOnError)throw w}Object.assign(i,C);let E=S?`stay`:`enter`,D;if(x)D={...x,cause:E,params:S?.params??i,_strictParams:C,search:d(S?S.search:x.search,p),_strictSearch:m};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Tt(r)?`pending`:`success`;D={id:b,ssr:r.options.ssr,index:n,routeId:r.id,params:S?.params??i,_strictParams:C,pathname:v,updatedAt:Date.now(),search:S?d(S.search,p):p,_strictSearch:m,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:w,__routeContext:void 0,_nonReactive:{loadPromise:f()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:E,loaderDeps:S?d(S.loaderDeps,g):g,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(D.globalNotFound=c===r.id),D.searchError=h;let te=this.getParentContext(s);D.context={...te,...D.__routeContext,...D.__beforeLoadContext},l[n]=D}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?d(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=o(t),a={...e.search};for(let e of t)try{Object.assign(a,Lt(e.options.validateSearch,a))}catch{}let s=o(this.state.matches),c=s&&s.routeId===i.id&&e.pathname===this.state.location.pathname,l;if(c)l=s.params;else{let e={...n};for(let i of t)try{Ht(i,n,r??{},e)}catch{}l=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:l}}},Pt=class extends Error{},Ft=class extends Error{};function It(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Lt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Pt(`Async validation not supported`);if(n.issues)throw new Pt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Rt({pathname:e,routesById:t,processedTree:n}){let r={},i=y(e),a,o,s=te(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign({},s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function zt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Bt(n)(e,t,r??!1)}function Bt(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Lt(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:i(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Vt(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return j}function Ht(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var Ut=Symbol.for(`TSR_DEFERRED_PROMISE`);function Wt(e,t){let n=e;return n[Ut]?n:(n[Ut]={status:`pending`},n.then(e=>{n[Ut].status=`success`,n[Ut].data=e}).catch(e=>{n[Ut].status=`error`,n[Ut].error={data:(t?.serializeError??jt)(e),__isServerError:!0}}),n)}var Gt=class{constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=j:this.parentRoute||m(!1,`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);let r=n?j:t?.path;r&&r!==`/`&&(r=ie(r));let i=t?.id||r,a=n?j:re([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=re([`/`,a]));let o=a===`__root__`?`/`:re([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=y(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>oe({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}},Kt=class extends Gt{constructor(e){super(e)}},qt=(e=>(e[e.AggregateError=1]=`AggregateError`,e[e.ArrowFunction=2]=`ArrowFunction`,e[e.ErrorPrototypeStack=4]=`ErrorPrototypeStack`,e[e.ObjectAssign=8]=`ObjectAssign`,e[e.BigIntTypedArray=16]=`BigIntTypedArray`,e[e.RegExp=32]=`RegExp`,e))(qt||{}),Jt=Symbol.asyncIterator,Yt=Symbol.hasInstance,Xt=Symbol.isConcatSpreadable,Zt=Symbol.iterator,Qt=Symbol.match,$t=Symbol.matchAll,en=Symbol.replace,tn=Symbol.search,nn=Symbol.species,rn=Symbol.split,an=Symbol.toPrimitive,on=Symbol.toStringTag,sn=Symbol.unscopables,cn={[Jt]:0,[Yt]:1,[Xt]:2,[Zt]:3,[Qt]:4,[$t]:5,[en]:6,[tn]:7,[nn]:8,[rn]:9,[an]:10,[on]:11,[sn]:12},ln={0:Jt,1:Yt,2:Xt,3:Zt,4:Qt,5:$t,6:en,7:tn,8:nn,9:rn,10:an,11:on,12:sn},M=void 0,un={2:!0,3:!1,1:M,0:null,4:-0,5:1/0,6:-1/0,7:NaN},dn={0:`Error`,1:`EvalError`,2:`RangeError`,3:`ReferenceError`,4:`SyntaxError`,5:`TypeError`,6:`URIError`},fn={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function N(e,t,n,r,i,a,o,s,c,l,u,d){return{t:e,i:t,s:n,c:r,m:i,p:a,e:o,a:s,f:c,b:l,o:u,l:d}}function pn(e){return N(2,M,e,M,M,M,M,M,M,M,M,M)}var mn=pn(2),hn=pn(3),gn=pn(1),_n=pn(0),vn=pn(4),yn=pn(5),bn=pn(6),xn=pn(7);function Sn(e){switch(e){case`"`:return`\\"`;case`\\`:return`\\\\`;case`
3
+ `:return`\\n`;case`\r`:return`\\r`;case`\b`:return`\\b`;case` `:return`\\t`;case`\f`:return`\\f`;case`<`:return`\\x3C`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:return M}}function Cn(e){let t=``,n=0,r;for(let i=0,a=e.length;i<a;i++)r=Sn(e[i]),r&&(t+=e.slice(n,i)+r,n=i+1);return n===0?t=e:t+=e.slice(n),t}function wn(e){switch(e){case`\\\\`:return`\\`;case`\\"`:return`"`;case`\\n`:return`
4
+ `;case`\\r`:return`\r`;case`\\b`:return`\b`;case`\\t`:return` `;case`\\f`:return`\f`;case`\\x3C`:return`<`;case`\\u2028`:return`\u2028`;case`\\u2029`:return`\u2029`;default:return e}}function Tn(e){return e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,wn)}var En=`__SEROVAL_REFS__`,Dn=new Map,On=new Map;function kn(e){return Dn.has(e)}function An(e){return On.has(e)}function jn(e){if(kn(e))return Dn.get(e);throw new yr(e)}function Mn(e){if(An(e))return On.get(e);throw new br(e)}typeof globalThis<`u`?Object.defineProperty(globalThis,En,{value:On,configurable:!0,writable:!1,enumerable:!1}):typeof window<`u`?Object.defineProperty(window,En,{value:On,configurable:!0,writable:!1,enumerable:!1}):typeof self<`u`?Object.defineProperty(self,En,{value:On,configurable:!0,writable:!1,enumerable:!1}):typeof global<`u`&&Object.defineProperty(global,En,{value:On,configurable:!0,writable:!1,enumerable:!1});function Nn(e){return e instanceof EvalError?1:e instanceof RangeError?2:e instanceof ReferenceError?3:e instanceof SyntaxError?4:e instanceof TypeError?5:e instanceof URIError?6:0}function Pn(e){let t=dn[Nn(e)];return e.name===t?e.constructor.name===t?{}:{name:e.constructor.name}:{name:e.name}}function Fn(e,t){let n=Pn(e),r=Object.getOwnPropertyNames(e);for(let i=0,a=r.length,o;i<a;i++)o=r[i],o!==`name`&&o!==`message`&&(o===`stack`?t&4&&(n||={},n[o]=e[o]):(n||={},n[o]=e[o]));return n}function In(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:+!Object.isExtensible(e)}function Ln(e){switch(e){case 1/0:return yn;case-1/0:return bn}return e===e?Object.is(e,-0)?vn:N(0,M,e,M,M,M,M,M,M,M,M,M):xn}function Rn(e){return N(1,M,Cn(e),M,M,M,M,M,M,M,M,M)}function zn(e){return N(3,M,``+e,M,M,M,M,M,M,M,M,M)}function Bn(e){return N(4,e,M,M,M,M,M,M,M,M,M,M)}function Vn(e,t){let n=t.valueOf();return N(5,e,n===n?t.toISOString():``,M,M,M,M,M,M,M,M,M)}function Hn(e,t){return N(6,e,M,Cn(t.source),t.flags,M,M,M,M,M,M,M)}function Un(e,t){return N(17,e,cn[t],M,M,M,M,M,M,M,M,M)}function Wn(e,t){return N(18,e,Cn(jn(t)),M,M,M,M,M,M,M,M,M)}function Gn(e,t,n){return N(25,e,n,Cn(t),M,M,M,M,M,M,M,M)}function Kn(e,t,n){return N(9,e,M,M,M,M,M,n,M,M,In(t),M)}function qn(e,t){return N(21,e,M,M,M,M,M,M,t,M,M,M)}function Jn(e,t,n){return N(15,e,M,t.constructor.name,M,M,M,M,n,t.byteOffset,M,t.length)}function Yn(e,t,n){return N(16,e,M,t.constructor.name,M,M,M,M,n,t.byteOffset,M,t.byteLength)}function Xn(e,t,n){return N(20,e,M,M,M,M,M,M,n,t.byteOffset,M,t.byteLength)}function Zn(e,t,n){return N(13,e,Nn(t),M,Cn(t.message),n,M,M,M,M,M,M)}function Qn(e,t,n){return N(14,e,Nn(t),M,Cn(t.message),n,M,M,M,M,M,M)}function $n(e,t){return N(7,e,M,M,M,M,M,t,M,M,M,M)}function er(e,t){return N(28,M,M,M,M,M,M,[e,t],M,M,M,M)}function tr(e,t){return N(30,M,M,M,M,M,M,[e,t],M,M,M,M)}function nr(e,t,n){return N(31,e,M,M,M,M,M,n,t,M,M,M)}function rr(e,t){return N(32,e,M,M,M,M,M,M,t,M,M,M)}function ir(e,t){return N(33,e,M,M,M,M,M,M,t,M,M,M)}function ar(e,t){return N(34,e,M,M,M,M,M,M,t,M,M,M)}function or(e,t,n,r){return N(35,e,n,M,M,M,M,t,M,M,M,r)}var{toString:sr}=Object.prototype,cr={parsing:1,serialization:2,deserialization:3};function lr(e){return`Seroval Error (step: ${cr[e]})`}var ur=(e,t)=>lr(e),dr=class extends Error{constructor(e,t){super(ur(e,t)),this.cause=t}},fr=class extends dr{constructor(e){super(`parsing`,e)}},pr=class extends dr{constructor(e){super(`deserialization`,e)}};function mr(e){return`Seroval Error (specific: ${e})`}var hr=class extends Error{constructor(e){super(mr(1)),this.value=e}},gr=class extends Error{constructor(e){super(mr(2))}},_r=class extends Error{constructor(e){super(mr(3))}},vr=class extends Error{constructor(e){super(mr(4))}},yr=class extends Error{constructor(e){super(mr(5)),this.value=e}},br=class extends Error{constructor(e){super(mr(6))}},xr=class extends Error{constructor(e){super(mr(7))}},Sr=class extends Error{constructor(e){super(mr(8))}},Cr=class extends Error{constructor(e){super(mr(9))}},wr=class{constructor(e,t){this.value=e,this.replacement=t}},Tr=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,n)=>{e.s=t,e.f=n}),e};Tr.toString(),((e,t)=>{e.s(t),e.p.s=1,e.p.v=t}).toString(),((e,t)=>{e.f(t),e.p.s=2,e.p.v=t}).toString();var Er=()=>{let e=[],t=[],n=!0,r=!1,i=0,a=(e,n,r)=>{for(r=0;r<i;r++)t[r]&&t[r][n](e)},o=(t,i,a,o)=>{for(i=0,a=e.length;i<a;i++)o=e[i],!n&&i===a-1?t[r?`return`:`throw`](o):t.next(o)},s=(e,r)=>(n&&(r=i++,t[r]=e),o(e),()=>{n&&(t[r]=t[i],t[i--]=void 0)});return{__SEROVAL_STREAM__:!0,on:e=>s(e),next:t=>{n&&(e.push(t),a(t,`next`))},throw:i=>{n&&(e.push(i),a(i,`throw`),n=!1,r=!1,t.length=0)},return:i=>{n&&(e.push(i),a(i,`return`),n=!1,r=!0,t.length=0)}}};Er.toString();var Dr=e=>t=>()=>{let n=0,r={[e]:()=>r,next:()=>{if(n>t.d)return{done:!0,value:void 0};let e=n++,r=t.v[e];if(e===t.t)throw r;return{done:e===t.d,value:r}}};return r};Dr.toString();var Or=(e,t)=>n=>()=>{let r=0,i=-1,a=!1,o=[],s=[],c=(e=0,t=s.length)=>{for(;e<t;e++)s[e].s({done:!0,value:void 0})};n.on({next:e=>{let t=s.shift();t&&t.s({done:!1,value:e}),o.push(e)},throw:e=>{let t=s.shift();t&&t.f(e),c(),i=o.length,a=!0,o.push(e)},return:e=>{let t=s.shift();t&&t.s({done:!0,value:e}),c(),i=o.length,o.push(e)}});let l={[e]:()=>l,next:()=>{if(i===-1){let e=r++;if(e>=o.length){let e=t();return s.push(e),e.p}return{done:!1,value:o[e]}}if(r>i)return{done:!0,value:void 0};let e=r++,n=o[e];if(e!==i)return{done:!1,value:n};if(a)throw n;return{done:!0,value:n}}};return l};Or.toString();var kr=e=>{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer};kr.toString();function Ar(e){return`__SEROVAL_SEQUENCE__`in e}function jr(e,t,n){return{__SEROVAL_SEQUENCE__:!0,v:e,t,d:n}}function Mr(e){let t=[],n=-1,r=-1,i=e[Zt]();for(;;)try{let e=i.next();if(t.push(e.value),e.done){r=t.length-1;break}}catch(e){n=t.length,t.push(e)}return jr(t,n,r)}var Nr=Dr(Zt);function Pr(e){return Nr(e)}var Fr={},Ir={},Lr={0:{},1:{},2:{},3:{},4:{},5:{}};function Rr(e){return`__SEROVAL_STREAM__`in e}function zr(){return Er()}function Br(e){let t=zr(),n=e[Jt]();async function r(){try{let e=await n.next();e.done?t.return(e.value):(t.next(e.value),await r())}catch(e){t.throw(e)}}return r().catch(()=>{}),t}var Vr=Or(Jt,Tr);function Hr(e){return Vr(e)}async function Ur(e){try{return[1,await e]}catch(e){return[0,e]}}function Wr(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:63^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3}}function Gr(e,t){e.marked.add(t)}function Kr(e,t){let n=e.refs.size;return e.refs.set(t,n),n}function qr(e,t){let n=e.refs.get(t);return n==null?{type:0,value:Kr(e,t)}:(Gr(e,n),{type:1,value:Bn(n)})}function Jr(e,t){let n=qr(e,t);return n.type===1?n:kn(t)?{type:2,value:Wn(n.value,t)}:n}function Yr(e,t){let n=Jr(e,t);if(n.type!==0)return n.value;if(t in cn)return Un(n.value,t);throw new hr(t)}function Xr(e,t){let n=qr(e,Lr[t]);return n.type===1?n.value:N(26,n.value,t,M,M,M,M,M,M,M,M,M)}function Zr(e){let t=qr(e,Fr);return t.type===1?t.value:N(27,t.value,M,M,M,M,M,M,Yr(e,Zt),M,M,M)}function Qr(e){let t=qr(e,Ir);return t.type===1?t.value:N(29,t.value,M,M,M,M,M,[Xr(e,1),Yr(e,Jt)],M,M,M,M)}function $r(e,t,n,r){return N(n?11:10,e,M,M,M,r,M,M,M,M,In(t),M)}function ei(e,t,n,r){return N(8,t,M,M,M,M,{k:n,v:r},M,Xr(e,0),M,M,M)}function ti(e,t,n){let r=new Uint8Array(n),i=``;for(let e=0,t=r.length;e<t;e++)i+=String.fromCharCode(r[e]);return N(19,t,Cn(btoa(i)),M,M,M,M,M,Xr(e,5),M,M,M)}function ni(e,t){return{base:Wr(e,t),child:void 0}}var ri=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return P(this._p,this.depth,e)}};async function ii(e,t,n){let r=[];for(let i=0,a=n.length;i<a;i++)i in n?r[i]=await P(e,t,n[i]):r[i]=0;return r}async function ai(e,t,n,r){return Kn(n,r,await ii(e,t,r))}async function oi(e,t,n){let r=Object.entries(n),i=[],a=[];for(let n=0,o=r.length;n<o;n++)i.push(Cn(r[n][0])),a.push(await P(e,t,r[n][1]));return Zt in n&&(i.push(Yr(e.base,Zt)),a.push(er(Zr(e.base),await P(e,t,Mr(n))))),Jt in n&&(i.push(Yr(e.base,Jt)),a.push(tr(Qr(e.base),await P(e,t,Br(n))))),on in n&&(i.push(Yr(e.base,on)),a.push(Rn(n[on]))),Xt in n&&(i.push(Yr(e.base,Xt)),a.push(n[Xt]?mn:hn)),{k:i,v:a}}async function si(e,t,n,r,i){return $r(n,r,i,await oi(e,t,r))}async function ci(e,t,n,r){return qn(n,await P(e,t,r.valueOf()))}async function li(e,t,n,r){return Jn(n,r,await P(e,t,r.buffer))}async function ui(e,t,n,r){return Yn(n,r,await P(e,t,r.buffer))}async function di(e,t,n,r){return Xn(n,r,await P(e,t,r.buffer))}async function fi(e,t,n,r){let i=Fn(r,e.base.features);return Zn(n,r,i?await oi(e,t,i):M)}async function pi(e,t,n,r){let i=Fn(r,e.base.features);return Qn(n,r,i?await oi(e,t,i):M)}async function mi(e,t,n,r){let i=[],a=[];for(let[n,o]of r.entries())i.push(await P(e,t,n)),a.push(await P(e,t,o));return ei(e.base,n,i,a)}async function hi(e,t,n,r){let i=[];for(let n of r.keys())i.push(await P(e,t,n));return $n(n,i)}async function gi(e,t,n,r){let i=e.base.plugins;if(i)for(let a=0,o=i.length;a<o;a++){let o=i[a];if(o.parse.async&&o.test(r))return Gn(n,o.tag,await o.parse.async(r,new ri(e,t),{id:n}))}return M}async function _i(e,t,n,r){let[i,a]=await Ur(r);return N(12,n,i,M,M,M,M,M,await P(e,t,a),M,M,M)}function vi(e,t,n,r,i){let a=[],o=n.on({next:n=>{Gr(this.base,t),P(this,e,n).then(e=>{a.push(rr(t,e))},e=>{i(e),o()})},throw:n=>{Gr(this.base,t),P(this,e,n).then(e=>{a.push(ir(t,e)),r(a),o()},e=>{i(e),o()})},return:n=>{Gr(this.base,t),P(this,e,n).then(e=>{a.push(ar(t,e)),r(a),o()},e=>{i(e),o()})}})}async function yi(e,t,n,r){return nr(n,Xr(e.base,4),await new Promise(vi.bind(e,t,n,r)))}async function bi(e,t,n,r){let i=[];for(let n=0,a=r.v.length;n<a;n++)i[n]=await P(e,t,r.v[n]);return or(n,i,r.t,r.d)}async function xi(e,t,n,r){if(Array.isArray(r))return ai(e,t,n,r);if(Rr(r))return yi(e,t,n,r);if(Ar(r))return bi(e,t,n,r);let i=r.constructor;if(i===wr)return P(e,t,r.replacement);let a=await gi(e,t,n,r);if(a)return a;switch(i){case Object:return si(e,t,n,r,!1);case M:return si(e,t,n,r,!0);case Date:return Vn(n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return fi(e,t,n,r);case Number:case Boolean:case String:case BigInt:return ci(e,t,n,r);case ArrayBuffer:return ti(e.base,n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return li(e,t,n,r);case DataView:return di(e,t,n,r);case Map:return mi(e,t,n,r);case Set:return hi(e,t,n,r);default:break}if(i===Promise||r instanceof Promise)return _i(e,t,n,r);let o=e.base.features;if(o&32&&i===RegExp)return Hn(n,r);if(o&16)switch(i){case BigInt64Array:case BigUint64Array:return ui(e,t,n,r);default:break}if(o&1&&typeof AggregateError<`u`&&(i===AggregateError||r instanceof AggregateError))return pi(e,t,n,r);if(r instanceof Error)return fi(e,t,n,r);if(Zt in r||Jt in r)return si(e,t,n,r,!!i);throw new hr(r)}async function Si(e,t,n){let r=Jr(e.base,n);if(r.type!==0)return r.value;let i=await gi(e,t,r.value,n);if(i)return i;throw new hr(n)}async function P(e,t,n){switch(typeof n){case`boolean`:return n?mn:hn;case`undefined`:return gn;case`string`:return Rn(n);case`number`:return Ln(n);case`bigint`:return zn(n);case`object`:if(n){let r=Jr(e.base,n);return r.type===0?await xi(e,t+1,r.value,n):r.value}return _n;case`symbol`:return Yr(e.base,n);case`function`:return Si(e,t,n);default:throw new hr(n)}}async function Ci(e,t){try{return await P(e,0,t)}catch(e){throw e instanceof fr?e:new fr(e)}}var wi=(e=>(e[e.Vanilla=1]=`Vanilla`,e[e.Cross=2]=`Cross`,e))(wi||{});function Ti(e){return e}function Ei(e,t){for(let n=0,r=t.length;n<r;n++){let r=t[n];e.has(r)||(e.add(r),r.extends&&Ei(e,r.extends))}}function Di(e){if(e){let t=new Set;return Ei(t,e),[...t]}}function Oi(e){switch(e){case`Int8Array`:return Int8Array;case`Int16Array`:return Int16Array;case`Int32Array`:return Int32Array;case`Uint8Array`:return Uint8Array;case`Uint16Array`:return Uint16Array;case`Uint32Array`:return Uint32Array;case`Uint8ClampedArray`:return Uint8ClampedArray;case`Float32Array`:return Float32Array;case`Float64Array`:return Float64Array;case`BigInt64Array`:return BigInt64Array;case`BigUint64Array`:return BigUint64Array;default:throw new xr(e)}}var ki=1e6,Ai=1e4,ji=2e4;function Mi(e,t){switch(t){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}var Ni=1e3;function Pi(e,t){let n=t.refs||new Map;return`types`in n||Object.assign(n,{types:new Map}),{mode:e,plugins:t.plugins,refs:n,features:t.features??63^(t.disabledFeatures||0),depthLimit:t.depthLimit||Ni}}function Fi(e){return{mode:2,base:Pi(2,e),child:M}}var Ii=class{constructor(e,t){this._p=e,this.depth=t}deserialize(e){return R(this._p,this.depth,e)}};function Li(e,t){if(t<0||!Number.isFinite(t)||!Number.isInteger(t))throw new Sr({t:4,i:t});if(e.refs.has(t))throw Error(`Conflicted ref id: `+t)}function F(e,t,n){return Li(e.base,t),e.state.marked.has(t)&&e.base.refs.set(t,n),n}function I(e,t,n){return Li(e.base,t),e.base.refs.set(t,n),n}function L(e,t,n){return e.mode===1?F(e,t,n):I(e,t,n)}function Ri(e,t,n){if(Object.hasOwn(t,n))return t[n];throw new Sr(e)}function zi(e,t){return L(e,t.i,Mn(Tn(t.s)))}function Bi(e,t,n){let r=n.a,i=r.length,a=L(e,n.i,Array(i));for(let n=0,o;n<i;n++)o=r[n],o&&(a[n]=R(e,t,o));return Mi(a,n.o),a}function Vi(e){switch(e){case`constructor`:case`__proto__`:case`prototype`:case`__defineGetter__`:case`__defineSetter__`:case`__lookupGetter__`:case`__lookupSetter__`:return!1;default:return!0}}function Hi(e){switch(e){case Jt:case Xt:case on:case Zt:return!0;default:return!1}}function Ui(e,t,n){Vi(t)?e[t]=n:Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function Wi(e,t,n,r,i){if(typeof r==`string`)Ui(n,Tn(r),R(e,t,i));else{let a=R(e,t,r);switch(typeof a){case`string`:Ui(n,a,R(e,t,i));break;case`symbol`:Hi(a)&&(n[a]=R(e,t,i));break;default:throw new Sr(r)}}}function Gi(e,t,n){e.base.refs.types.set(t,n)}function Ki(e,t,n,r){if(e.base.refs.types.get(n)!==r)throw new Sr(t)}function qi(e,t,n,r){let i=n.k;if(i.length>0)for(let a=0,o=n.v,s=i.length;a<s;a++)Wi(e,t,r,i[a],o[a]);return r}function Ji(e,t,n){let r=L(e,n.i,n.t===10?{}:Object.create(null));return qi(e,t,n.p,r),Mi(r,n.o),r}function Yi(e,t){return L(e,t.i,new Date(t.s))}function Xi(e,t){if(e.base.features&32){let n=Tn(t.c);if(n.length>ji)throw new Sr(t);return L(e,t.i,new RegExp(n,t.m))}throw new gr(t)}function Zi(e,t,n){let r=L(e,n.i,new Set);for(let i=0,a=n.a,o=a.length;i<o;i++)r.add(R(e,t,a[i]));return r}function Qi(e,t,n){let r=L(e,n.i,new Map);for(let i=0,a=n.e.k,o=n.e.v,s=a.length;i<s;i++)r.set(R(e,t,a[i]),R(e,t,o[i]));return r}function $i(e,t){if(t.s.length>ki)throw new Sr(t);return L(e,t.i,kr(Tn(t.s)))}function ea(e,t,n){let r=Oi(n.c),i=R(e,t,n.f),a=n.b??0;if(a<0||a>i.byteLength)throw new Sr(n);return L(e,n.i,new r(i,a,n.l))}function ta(e,t,n){let r=R(e,t,n.f),i=n.b??0;if(i<0||i>r.byteLength)throw new Sr(n);return L(e,n.i,new DataView(r,i,n.l))}function na(e,t,n,r){if(n.p){let i=qi(e,t,n.p,{});Object.defineProperties(r,Object.getOwnPropertyDescriptors(i))}return r}function ra(e,t,n){return na(e,t,n,L(e,n.i,AggregateError([],Tn(n.m))))}function ia(e,t,n){let r=Ri(n,fn,n.s);return na(e,t,n,L(e,n.i,new r(Tn(n.m))))}function aa(e,t,n){let r=Tr(),i=L(e,n.i,r.p),a=R(e,t,n.f);return n.s?r.s(a):r.f(a),i}function oa(e,t,n){return L(e,n.i,Object(R(e,t,n.f)))}function sa(e,t,n){let r=e.base.plugins;if(r){let i=Tn(n.c);for(let a=0,o=r.length;a<o;a++){let o=r[a];if(o.tag===i)return L(e,n.i,o.deserialize(n.s,new Ii(e,t),{id:n.i}))}}throw new _r(n.c)}function ca(e,t){let n=L(e,t.i,L(e,t.s,Tr()).p);return Gi(e,t.s,22),n}function la(e,t,n){let r=e.base.refs.get(n.i);if(r)return Ki(e,n,n.i,22),r.s(R(e,t,n.a[1])),M;throw new vr(`Promise`)}function ua(e,t,n){let r=e.base.refs.get(n.i);if(r)return Ki(e,n,n.i,22),r.f(R(e,t,n.a[1])),M;throw new vr(`Promise`)}function da(e,t,n){return R(e,t,n.a[0]),Pr(R(e,t,n.a[1]))}function fa(e,t,n){return R(e,t,n.a[0]),Hr(R(e,t,n.a[1]))}function pa(e,t,n){let r=L(e,n.i,zr());Gi(e,n.i,31);let i=n.a,a=i.length;if(a)for(let n=0;n<a;n++)R(e,t,i[n]);return r}function ma(e,t,n){let r=e.base.refs.get(n.i);if(r)return Ki(e,n,n.i,31),r.next(R(e,t,n.f)),M;throw new vr(`Stream`)}function ha(e,t,n){let r=e.base.refs.get(n.i);if(r)return Ki(e,n,n.i,31),r.throw(R(e,t,n.f)),M;throw new vr(`Stream`)}function ga(e,t,n){let r=e.base.refs.get(n.i);if(r)return Ki(e,n,n.i,31),r.return(R(e,t,n.f)),M;throw new vr(`Stream`)}function _a(e,t,n){return R(e,t,n.f),M}function va(e,t,n){return R(e,t,n.a[1]),M}function ya(e,t,n){let r=L(e,n.i,jr([],n.s,n.l));for(let i=0,a=n.a.length;i<a;i++)r.v[i]=R(e,t,n.a[i]);return r}function R(e,t,n){if(t>e.base.depthLimit)throw new Cr(e.base.depthLimit);switch(t+=1,n.t){case 2:return Ri(n,un,n.s);case 0:return Number(n.s);case 1:return Tn(String(n.s));case 3:if(String(n.s).length>Ai)throw new Sr(n);return BigInt(n.s);case 4:return e.base.refs.get(n.i);case 18:return zi(e,n);case 9:return Bi(e,t,n);case 10:case 11:return Ji(e,t,n);case 5:return Yi(e,n);case 6:return Xi(e,n);case 7:return Zi(e,t,n);case 8:return Qi(e,t,n);case 19:return $i(e,n);case 16:case 15:return ea(e,t,n);case 20:return ta(e,t,n);case 14:return ra(e,t,n);case 13:return ia(e,t,n);case 12:return aa(e,t,n);case 17:return Ri(n,ln,n.s);case 21:return oa(e,t,n);case 25:return sa(e,t,n);case 22:return ca(e,n);case 23:return la(e,t,n);case 24:return ua(e,t,n);case 28:return da(e,t,n);case 30:return fa(e,t,n);case 31:return pa(e,t,n);case 32:return ma(e,t,n);case 33:return ha(e,t,n);case 34:return ga(e,t,n);case 27:return _a(e,t,n);case 29:return va(e,t,n);case 35:return ya(e,t,n);default:throw new gr(n)}}function ba(e,t){try{return R(e,0,t)}catch(e){throw new pr(e)}}var xa=(()=>T).toString();/=>/.test(xa);function Sa(e,t){return ba(Fi({plugins:Di(t.plugins),refs:t.refs,features:t.features,disabledFeatures:t.disabledFeatures,depthLimit:t.depthLimit}),e)}async function Ca(e,t={}){let n=ni(1,{plugins:Di(t.plugins),disabledFeatures:t.disabledFeatures});return{t:await Ci(n,e),f:n.base.features,m:Array.from(n.base.marked)}}function wa(e){return e}function Ta(e){return Ti({tag:`$TSR/t/`+e.key,test:e.test,parse:{sync(t,n){return n.parse(e.toSerializable(t))},async async(t,n){return await n.parse(e.toSerializable(t))},stream(t,n){return n.parse(e.toSerializable(t))}},serialize:void 0,deserialize(t,n){return e.fromSerializable(n.deserialize(t))}})}var Ea={},Da=e=>new ReadableStream({start:t=>{e.on({next:e=>{try{t.enqueue(e)}catch{}},throw:e=>{t.error(e)},return:()=>{try{t.close()}catch{}}})}}),Oa=Ti({tag:`seroval-plugins/web/ReadableStreamFactory`,test(e){return e===Ea},parse:{sync(){return Ea},async async(){return await Promise.resolve(Ea)},stream(){return Ea}},serialize(){return Da.toString()},deserialize(){return Ea}});function ka(e){let t=zr(),n=e.getReader();async function r(){try{let e=await n.read();e.done?t.return(e.value):(t.next(e.value),await r())}catch(e){t.throw(e)}}return r().catch(()=>{}),t}var Aa=Ti({tag:`seroval/plugins/web/ReadableStream`,extends:[Oa],test(e){return typeof ReadableStream>`u`?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(Ea),stream:t.parse(zr())}},async async(e,t){return{factory:await t.parse(Ea),stream:await t.parse(ka(e))}},stream(e,t){return{factory:t.parse(Ea),stream:t.parse(ka(e))}}},serialize(e,t){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t){return Da(t.deserialize(e.stream))}}),ja=Ti({tag:`$TSR/Error`,test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return`new Error(`+t.serialize(e.message)+`)`},deserialize(e,t){return Error(t.deserialize(e.message))}}),Ma=class{constructor(e,t){this.stream=e,this.hint=t?.hint??`binary`}},Na=globalThis.Buffer,Pa=!!Na&&typeof Na.from==`function`;function Fa(e){if(e.length===0)return``;if(Pa)return Na.from(e).toString(`base64`);let t=32768,n=[];for(let r=0;r<e.length;r+=t){let i=e.subarray(r,r+t);n.push(String.fromCharCode.apply(null,i))}return btoa(n.join(``))}function Ia(e){if(e.length===0)return new Uint8Array;if(Pa){let t=Na.from(e,`base64`);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var La=Object.create(null),Ra=Object.create(null),za=e=>new ReadableStream({start(t){e.on({next(e){try{t.enqueue(Ia(e))}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),Ba=new TextEncoder,Va=e=>new ReadableStream({start(t){e.on({next(e){try{typeof e==`string`?t.enqueue(Ba.encode(e)):t.enqueue(Ia(e.$b64))}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),Ha=`(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))`,Ua=`(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})`;function Wa(e){let t=zr(),n=e.getReader();return(async()=>{try{for(;;){let{done:e,value:r}=await n.read();if(e){t.return(void 0);break}t.next(Fa(r))}}catch(e){t.throw(e)}finally{n.releaseLock()}})(),t}function Ga(e){let t=zr(),n=e.getReader(),r=new TextDecoder(`utf-8`,{fatal:!0});return(async()=>{try{for(;;){let{done:e,value:i}=await n.read();if(e){try{let e=r.decode();e.length>0&&t.next(e)}catch{}t.return(void 0);break}try{let e=r.decode(i,{stream:!0});e.length>0&&t.next(e)}catch{t.next({$b64:Fa(i)})}}}catch(e){t.throw(e)}finally{n.releaseLock()}})(),t}var Ka=Ti({tag:`tss/RawStream`,extends:[Ti({tag:`tss/RawStreamFactory`,test(e){return e===La},parse:{sync(){},async(){return Promise.resolve(void 0)},stream(){}},serialize(){return Ha},deserialize(){return La}}),Ti({tag:`tss/RawStreamFactoryText`,test(e){return e===Ra},parse:{sync(){},async(){return Promise.resolve(void 0)},stream(){}},serialize(){return Ua},deserialize(){return Ra}})],test(e){return e instanceof Ma},parse:{sync(e,t){let n=e.hint===`text`?Ra:La;return{hint:e.hint,factory:t.parse(n),stream:t.parse(zr())}},async async(e,t){let n=e.hint===`text`?Ra:La,r=e.hint===`text`?Ga(e.stream):Wa(e.stream);return{hint:e.hint,factory:await t.parse(n),stream:await t.parse(r)}},stream(e,t){let n=e.hint===`text`?Ra:La,r=e.hint===`text`?Ga(e.stream):Wa(e.stream);return{hint:e.hint,factory:t.parse(n),stream:t.parse(r)}}},serialize(e,t){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t){let n=t.deserialize(e.stream);return e.hint===`text`?Va(n):za(n)}});function qa(e){return Ti({tag:`tss/RawStream`,test:()=>!1,parse:{},serialize(){throw Error(`RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.`)},deserialize(t){return e(t.streamId)}})}var Ja=[ja,Ka,Aa],z=l(),B=e(n(),1);function Ya({promise:e}){if(fe)return fe(e);let t=Wt(e);if(t[Ut].status===`pending`)throw t;if(t[Ut].status===`error`)throw t[Ut].error;return t[Ut].data}function Xa(e){let t=(0,z.jsx)(Za,{...e});return e.fallback?(0,z.jsx)(B.Suspense,{fallback:e.fallback,children:t}):t}function Za(e){let t=Ya(e);return e.children(t)}function Qa(e){let t=e.errorComponent??eo;return(0,z.jsx)($a,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?B.createElement(t,{error:n,reset:r}):e.children})}var $a=class extends B.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function eo({error:e}){let[t,n]=B.useState(!1);return(0,z.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,z.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,z.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,z.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,z.jsx)(`div`,{children:(0,z.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,z.jsx)(`code`,{children:e.message}):null})}):null]})}function to(e){let t=B.useContext(e.from?de:ue);return D({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(m(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function no(e){return to({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ro(e){let{select:t,...n}=e;return to({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function io(e){return to({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function ao(e){return to({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function oo(e){let t=ge();return B.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var so=class extends Gt{constructor(e){super(e),this.useMatch=e=>to({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>to({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>ao({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>io({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ro({...e,from:this.id}),this.useLoaderData=e=>no({...e,from:this.id}),this.useNavigate=()=>oo({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,z.jsx)(O,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function co(e){return new so(e)}var lo=class extends Kt{constructor(e){super(e),this.useMatch=e=>to({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>to({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>ao({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>io({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ro({...e,from:this.id}),this.useLoaderData=e=>no({...e,from:this.id}),this.useNavigate=()=>oo({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,z.jsx)(O,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function uo(e){return new lo(e)}function V(e){return typeof e==`object`?new H(e,{silent:!0}).createRoute(e):new H(e,{silent:!0}).createRoute}var H=class{constructor(e,t){this.path=e,this.createRoute=e=>{me(this.silent,`FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.`);let t=co(e);return t.isRoot=!1,t},this.silent=t?.silent}},U=class{constructor(e){this.useMatch=e=>to({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>to({from:this.options.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>ao({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>io({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>ro({...e,from:this.options.id}),this.useLoaderData=e=>no({...e,from:this.options.id}),this.useNavigate=()=>oo({from:ge().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for(`react.memo`)}};function fo(e){return typeof e==`object`?new U(e):t=>new U({id:e,...t})}function po(e,t){let n,r,i,a,o=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,h(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),a=!0)}}),n),s=function(e){if(a)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(fe)fe(o());else throw o();return B.createElement(r,e)};return s.preload=o,s}function mo(){let e=ge(),t=B.useRef({router:e,mounted:!1}),[n,r]=B.useState(!1),{hasPendingMatches:i,isLoading:a}=D({select:e=>({isLoading:e.isLoading,hasPendingMatches:e.matches.some(e=>e.status===`pending`)}),structuralSharing:!0}),o=he(a),s=a||n||i,c=he(s),l=a||i,u=he(l);return e.startTransition=e=>{r(!0),B.startTransition(()=>{e(),r(!1)})},B.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return y(e.latestLocation.publicHref)!==y(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),pe(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),pe(()=>{o&&!a&&e.emit({type:`onLoad`,...Mt(e.state)})},[o,e,a]),pe(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Mt(e.state)})},[l,u,e]),pe(()=>{if(c&&!s){let t=Mt(e.state);e.emit({type:`onResolved`,...t}),e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),t.hrefChanged&&rt(e)}},[s,c,e]),null}function ho(e){let t=D({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,z.jsx)(Qa,{getResetKey:()=>t,onCatch:(t,n)=>{if(k(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(k(t))return e.fallback?.(t);throw t},children:e.children})}function go(){return(0,z.jsx)(`p`,{children:`Not Found`})}function _o(e){return(0,z.jsx)(z.Fragment,{children:e.children})}function vo(e,t,n){return t.options.notFoundComponent?(0,z.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,z.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,z.jsx)(go,{})}function yo({children:e}){return ge(),null}function bo(){let e=ge();if(!e.isScrollRestoring||!0)return null;let t=(e.options.getScrollRestorationKey||Qe)(e.latestLocation),n=t===Qe(e.latestLocation)?void 0:t,r={storageKey:Je,shouldScrollRestoration:!0};return n&&(r.key=n),(0,z.jsx)(yo,{children:`(${tt.toString()})(${p(JSON.stringify(r))})`})}var xo=B.memo(function({matchId:e}){let t=ge(),n=D({select:t=>{let n=t.matches.findIndex(t=>t.id===e),r=t.matches[n];return m(r,`Could not find match for matchId "${e}". Please file an issue!`),{routeId:r.routeId,ssr:r.ssr,_displayPending:r._displayPending,resetKey:t.loadedAt,parentRouteId:t.matches[n-1]?.routeId}},structuralSharing:!0}),r=t.routesById[n.routeId],i=r.options.pendingComponent??t.options.defaultPendingComponent,a=i?(0,z.jsx)(i,{}):null,o=r.options.errorComponent??t.options.defaultErrorComponent,s=r.options.onCatch??t.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,l=n.ssr===!1||n.ssr===`data-only`,u=(!r.isRoot||r.options.wrapInSuspense||l)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||l))?B.Suspense:_o,d=o?Qa:_o,f=c?ho:_o;return(0,z.jsxs)(r.isRoot?r.options.shellComponent??_o:_o,{children:[(0,z.jsx)(ue.Provider,{value:e,children:(0,z.jsx)(u,{fallback:a,children:(0,z.jsx)(d,{getResetKey:()=>n.resetKey,errorComponent:o||eo,onCatch:(t,n)=>{if(k(t))throw t;me(!1,`Error in route match: ${e}`),s?.(t,n)},children:(0,z.jsx)(f,{fallback:e=>{if(!c||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return B.createElement(c,e)},children:l||n._displayPending?(0,z.jsx)(ne,{fallback:a,children:(0,z.jsx)(Co,{matchId:e})}):(0,z.jsx)(Co,{matchId:e})})})})}),n.parentRouteId===`__root__`&&t.options.scrollRestoration?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(So,{}),(0,z.jsx)(bo,{})]}):null]})});function So(){let e=ge(),t=B.useRef(void 0);return(0,z.jsx)(`script`,{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:`onRendered`,...Mt(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Co=B.memo(function({matchId:e}){let t=ge(),{match:n,key:r,routeId:i}=D({select:n=>{let r=n.matches.find(t=>t.id===e),i=r.routeId,a=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return{key:a?JSON.stringify(a):void 0,routeId:i,match:{id:r.id,status:r.status,error:r.error,invalid:r.invalid,_forcePending:r._forcePending,_displayPending:r._displayPending}}},structuralSharing:!0}),a=t.routesById[i],o=B.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,z.jsx)(e,{},r):(0,z.jsx)(wo,{})},[r,a.options.component,t.options.defaultComponent]);if(n._displayPending)throw t.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw t.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let r=t.getMatch(n.id);if(r&&!r._nonReactive.minPendingPromise){let t=f();r._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),r._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(n.id)?._nonReactive.loadPromise}if(n.status===`notFound`)return m(k(n.error),`Expected a notFound error`),vo(t,a,n.error);if(n.status===`redirected`)throw m(se(n.error),`Expected a redirect error`),t.getMatch(n.id)?._nonReactive.loadPromise;if(n.status===`error`)throw n.error;return o}),wo=B.memo(function(){let e=ge(),t=B.useContext(ue),n=D({select:e=>e.matches.find(e=>e.id===t)?.routeId}),r=e.routesById[n],i=D({select:e=>{let n=e.matches.find(e=>e.id===t);return m(n,`Could not find parent match for matchId "${t}"`),n.globalNotFound}}),a=D({select:e=>{let n=e.matches;return n[n.findIndex(e=>e.id===t)+1]?.id}}),o=e.options.defaultPendingComponent?(0,z.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return vo(e,r,void 0);if(!a)return null;let s=(0,z.jsx)(xo,{matchId:a});return n===`__root__`?(0,z.jsx)(B.Suspense,{fallback:o,children:s}):s});function To(){let e=ge(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,z.jsx)(t,{}):null,r=(0,z.jsxs)(typeof document<`u`&&e.ssr?_o:B.Suspense,{fallback:n,children:[(0,z.jsx)(mo,{}),(0,z.jsx)(Eo,{})]});return e.options.InnerWrap?(0,z.jsx)(e.options.InnerWrap,{children:r}):r}function Eo(){let e=ge(),t=D({select:e=>e.matches[0]?.id}),n=D({select:e=>e.loadedAt}),r=t?(0,z.jsx)(xo,{matchId:t}):null;return(0,z.jsx)(ue.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,z.jsx)(Qa,{getResetKey:()=>n,errorComponent:eo,onCatch:e=>{me(!1,`The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`),me(!1,e.message||e.toString())},children:r})})}var Do=e=>new Oo(e),Oo=class extends Nt{constructor(e){super(e)}};typeof globalThis<`u`?(globalThis.createFileRoute=V,globalThis.createLazyFileRoute=fo):typeof window<`u`&&(window.createFileRoute=V,window.createLazyFileRoute=fo);function ko({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,z.jsx)(_e().Provider,{value:e,children:t});return e.options.Wrap?(0,z.jsx)(e.options.Wrap,{children:r}):r}function Ao({router:e,...t}){return(0,z.jsx)(ko,{router:e,...t,children:(0,z.jsx)(To,{})})}function jo(e){return D({select:t=>e?.select?e.select(t.location):t.location})}function Mo({tag:e,attrs:t,children:n,nonce:r}){switch(e){case`title`:return(0,z.jsx)(`title`,{...t,suppressHydrationWarning:!0,children:n});case`meta`:return(0,z.jsx)(`meta`,{...t,suppressHydrationWarning:!0});case`link`:return(0,z.jsx)(`link`,{...t,nonce:r,suppressHydrationWarning:!0});case`style`:return(0,z.jsx)(`style`,{...t,dangerouslySetInnerHTML:{__html:n},nonce:r});case`script`:return(0,z.jsx)(No,{attrs:t,children:n});default:return null}}function No({attrs:e,children:t}){ge(),B.useEffect(()=>{if(e?.src){let t=(()=>{try{let t=document.baseURI||window.location.href;return new URL(e.src,t).href}catch{return e.src}})();if(Array.from(document.querySelectorAll(`script[src]`)).find(e=>e.src===t))return;let n=document.createElement(`script`);for(let[t,r]of Object.entries(e))t!==`suppressHydrationWarning`&&r!==void 0&&r!==!1&&n.setAttribute(t,typeof r==`boolean`?``:String(r));return document.head.appendChild(n),()=>{n.parentNode&&n.parentNode.removeChild(n)}}if(typeof t==`string`){let n=typeof e?.type==`string`?e.type:`text/javascript`,r=typeof e?.nonce==`string`?e.nonce:void 0;if(Array.from(document.querySelectorAll(`script:not([src])`)).find(e=>{if(!(e instanceof HTMLScriptElement))return!1;let i=e.getAttribute(`type`)??`text/javascript`,a=e.getAttribute(`nonce`)??void 0;return e.textContent===t&&i===n&&a===r}))return;let i=document.createElement(`script`);if(i.textContent=t,e)for(let[t,n]of Object.entries(e))t!==`suppressHydrationWarning`&&n!==void 0&&n!==!1&&i.setAttribute(t,typeof n==`boolean`?``:String(n));return document.head.appendChild(i),()=>{i.parentNode&&i.parentNode.removeChild(i)}}},[e,t]);{let{src:t,...n}=e||{};return(0,z.jsx)(`script`,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:``},...n})}return e?.src&&typeof e.src==`string`?(0,z.jsx)(`script`,{...e,suppressHydrationWarning:!0}):typeof t==`string`?(0,z.jsx)(`script`,{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var Po=()=>{let e=ge(),t=e.options.ssr?.nonce,n=D({select:e=>e.matches.map(e=>e.meta).filter(Boolean)}),r=B.useMemo(()=>{let e=[],r={},i;for(let a=n.length-1;a>=0;a--){let o=n[a];for(let n=o.length-1;n>=0;n--){let a=o[n];if(a)if(a.title)i||={tag:`title`,children:a.title};else if(`script:ld+json`in a)try{let t=JSON.stringify(a[`script:ld+json`]);e.push({tag:`script`,attrs:{type:`application/ld+json`},children:p(t)})}catch{}else{let n=a.name??a.property;if(n){if(r[n])continue;r[n]=!0}e.push({tag:`meta`,attrs:{...a,nonce:t}})}}}return i&&e.push(i),t&&e.push({tag:`meta`,attrs:{property:`csp-nonce`,content:t}}),e.reverse(),e},[n,t]),i=D({select:n=>{let r=n.matches.map(e=>e.links).filter(Boolean).flat(1).map(e=>({tag:`link`,attrs:{...e,nonce:t}})),i=e.ssr?.manifest,a=n.matches.map(e=>i?.routes[e.routeId]?.assets??[]).filter(Boolean).flat(1).filter(e=>e.tag===`link`).map(e=>({tag:`link`,attrs:{...e.attrs,suppressHydrationWarning:!0,nonce:t}}));return[...r,...a]},structuralSharing:!0}),a=D({select:n=>{let r=[];return n.matches.map(t=>e.looseRoutesById[t.routeId]).forEach(n=>e.ssr?.manifest?.routes[n.id]?.preloads?.filter(Boolean).forEach(e=>{r.push({tag:`link`,attrs:{rel:`modulepreload`,href:e,nonce:t}})})),r},structuralSharing:!0}),o=D({select:e=>e.matches.map(e=>e.styles).flat(1).filter(Boolean).map(({children:e,...n})=>({tag:`style`,attrs:{...n,nonce:t},children:e})),structuralSharing:!0}),s=D({select:e=>e.matches.map(e=>e.headScripts).flat(1).filter(Boolean).map(({children:e,...n})=>({tag:`script`,attrs:{...n,nonce:t},children:e})),structuralSharing:!0});return Fo([...r,...a,...i,...o,...s],e=>JSON.stringify(e))};function Fo(e,t){let n=new Set;return e.filter(e=>{let r=t(e);return n.has(r)?!1:(n.add(r),!0)})}function Io(){let e=Po(),t=ge().options.ssr?.nonce;return(0,z.jsx)(z.Fragment,{children:e.map(e=>(0,B.createElement)(Mo,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:t}))})}var Lo=()=>{let e=ge(),t=e.options.ssr?.nonce,n=D({select:n=>{let r=[],i=e.ssr?.manifest;return i?(n.matches.map(t=>e.looseRoutesById[t.routeId]).forEach(e=>i.routes[e.id]?.assets?.filter(e=>e.tag===`script`).forEach(e=>{r.push({tag:`script`,attrs:{...e.attrs,nonce:t},children:e.children})})),r):[]},structuralSharing:!0}),{scripts:r}=D({select:e=>({scripts:e.matches.map(e=>e.scripts).flat(1).filter(Boolean).map(({children:e,...n})=>({tag:`script`,attrs:{...n,suppressHydrationWarning:!0,nonce:t},children:e}))}),structuralSharing:!0}),i;e.serverSsr&&(i=e.serverSsr.takeBufferedScripts());let a=[...r,...n];return i&&a.unshift(i),(0,z.jsx)(z.Fragment,{children:a.map((e,t)=>(0,B.createElement)(Mo,{...e,key:`tsr-scripts-${e.tag}-${t}`}))})};function Ro(e){if(Array.isArray(e))return e.flatMap(e=>Ro(e));if(typeof e!=`string`)return[];let t=[],n=0,r,i,a,o,s,c=()=>{for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length},l=()=>(i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`);for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.slice(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.slice(r))}return t}function zo(e){return e instanceof Headers?e:Array.isArray(e)||typeof e==`object`?new Headers(e):null}function Bo(...e){return e.reduce((e,t)=>{let n=zo(t);if(!n)return e;for(let[t,r]of n.entries())t===`set-cookie`?Ro(r).forEach(t=>e.append(`set-cookie`,t)):e.set(t,r);return e},new Headers)}function Vo(e,t){e.id=t.i,e.__beforeLoadContext=t.b,e.loaderData=t.l,e.status=t.s,e.ssr=t.ssr,e.updatedAt=t.u,e.error=t.e}async function Ho(e){m(window.$_TSR,`Expected to find bootstrap data on window.$_TSR, but we did not. Please file an issue!`);let t=e.options.serializationAdapters;if(t?.length){let e=new Map;t.forEach(t=>{e.set(t.key,t.fromSerializable)}),window.$_TSR.t=e,window.$_TSR.buffer.forEach(e=>e())}window.$_TSR.initialized=!0,m(window.$_TSR.router,`Expected to find a dehydrated data on window.$_TSR.router, but we did not. Please file an issue!`);let{manifest:n,dehydratedData:r,lastMatchId:i}=window.$_TSR.router;e.ssr={manifest:n};let a=document.querySelector(`meta[property="csp-nonce"]`)?.content;e.options.ssr={nonce:a};let o=e.matchRoutes(e.state.location),s=Promise.all(o.map(t=>{let n=e.looseRoutesById[t.routeId];return e.loadRouteChunk(n)}));function c(t){let n=e.looseRoutesById[t.routeId].options.pendingMinMs??e.options.defaultPendingMinMs;if(n){let r=f();t._nonReactive.minPendingPromise=r,t._forcePending=!0,setTimeout(()=>{r.resolve(),e.updateMatch(t.id,e=>(e._nonReactive.minPendingPromise=void 0,{...e,_forcePending:void 0}))},n)}}function l(t){let n=e.looseRoutesById[t.routeId];n&&(n.options.ssr=t.ssr)}let u;o.forEach(e=>{let t=window.$_TSR.router.matches.find(t=>t.i===e.id);if(!t){e._nonReactive.dehydrated=!1,e.ssr=!1,l(e);return}Vo(e,t),l(e),e._nonReactive.dehydrated=e.ssr!==!1,(e.ssr===`data-only`||e.ssr===!1)&&u===void 0&&(u=e.index,c(e))}),e.__store.setState(e=>({...e,matches:o})),await e.options.hydrate?.(r),await Promise.all(e.state.matches.map(async t=>{try{let n=e.looseRoutesById[t.routeId],r=e.state.matches[t.index-1]?.context??e.options.context;if(n.options.context){let i={deps:t.loaderDeps,params:t.params,context:r??{},location:e.state.location,navigate:t=>e.navigate({...t,_fromLocation:e.state.location}),buildLocation:e.buildLocation,cause:t.cause,abortController:t.abortController,preload:!1,matches:o,routeId:n.id};t.__routeContext=n.options.context(i)??void 0}t.context={...r,...t.__routeContext,...t.__beforeLoadContext};let i={ssr:e.options.ssr,matches:e.state.matches,match:t,params:t.params,loaderData:t.loaderData},a=await n.options.head?.(i),s=await n.options.scripts?.(i);t.meta=a?.meta,t.links=a?.links,t.headScripts=a?.scripts,t.styles=a?.styles,t.scripts=s}catch(e){if(k(e))t.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${t.routeId}`,e);else throw t.error=e,console.error(`Error during hydration for route ${t.routeId}:`,e),e}}));let d=o[o.length-1].id!==i;if(!o.some(e=>e.ssr===!1)&&!d)return o.forEach(e=>{e._nonReactive.dehydrated=void 0}),s;let p=Promise.resolve().then(()=>e.load()).catch(e=>{console.error(`Error during router hydration:`,e)});if(d){let t=o[1];m(t,`Expected to find a match below the root match in SPA mode.`),c(t),t._displayPending=!0,t._nonReactive.displayPendingPromise=p,p.then(()=>{Ke(()=>{e.__store.state.status===`pending`&&e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),e.updateMatch(t.id,e=>({...e,_displayPending:void 0,displayPendingPromise:void 0}))})})}return s}var Uo=`__TSS_CONTEXT`,Wo=Symbol.for(`TSS_SERVER_FUNCTION`),Go=Symbol.for(`TSS_SERVER_FUNCTION_FACTORY`),Ko=`application/x-tss-framed`,qo={JSON:0,CHUNK:1,END:2,ERROR:3};`${Ko}`;var Jo=/;\s*v=(\d+)/;function Yo(e){let t=e.match(Jo);return t?parseInt(t[1],10):void 0}function Xo(e){let t=Yo(e);if(t!==void 0&&t!==1)throw Error(`Incompatible framed protocol version: server=${t}, client=1. Please ensure client and server are using compatible versions.`)}var Zo=()=>window.__TSS_START_OPTIONS__;function Qo(){return[...(Zo()?.serializationAdapters)?.map(Ta)??[],...Ja]}var $o=new TextDecoder,es=new Uint8Array,ts=16*1024*1024,ns=32*1024*1024,rs=1024,is=1e5;function as(e){let t=new Map,n=new Map,r=new Set,i=!1,a=null,o=0,s,c=new ReadableStream({start(e){s=e},cancel(){i=!0;try{a?.cancel()}catch{}t.forEach(e=>{try{e.error(Error(`Framed response cancelled`))}catch{}}),t.clear(),n.clear(),r.clear()}});function l(e){let i=n.get(e);if(i)return i;if(r.has(e))return new ReadableStream({start(e){e.close()}});if(n.size>=rs)throw Error(`Too many raw streams in framed response (max ${rs})`);let a=new ReadableStream({start(n){t.set(e,n)},cancel(){r.add(e),t.delete(e),n.delete(e)}});return n.set(e,a),a}function u(e){return l(e),t.get(e)}return(async()=>{let n=e.getReader();a=n;let c=[],l=0;function d(){if(l<9)return null;let e=c[0];if(e.length>=9)return{type:e[0],streamId:(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0,length:(e[5]<<24|e[6]<<16|e[7]<<8|e[8])>>>0};let t=new Uint8Array(9),n=0,r=9;for(let e=0;e<c.length&&r>0;e++){let i=c[e],a=Math.min(i.length,r);t.set(i.subarray(0,a),n),n+=a,r-=a}return{type:t[0],streamId:(t[1]<<24|t[2]<<16|t[3]<<8|t[4])>>>0,length:(t[5]<<24|t[6]<<16|t[7]<<8|t[8])>>>0}}function f(e){if(e===0)return es;let t=new Uint8Array(e),n=0,r=e;for(;r>0&&c.length>0;){let e=c[0];if(!e)break;let i=Math.min(e.length,r);t.set(e.subarray(0,i),n),n+=i,r-=i,i===e.length?c.shift():c[0]=e.subarray(i)}return l-=e,t}try{for(;;){let{done:e,value:a}=await n.read();if(i||e)break;if(a){if(l+a.length>ns)throw Error(`Framed response buffer exceeded ${ns} bytes`);for(c.push(a),l+=a.length;;){let e=d();if(!e)break;let{type:n,streamId:i,length:a}=e;if(n!==qo.JSON&&n!==qo.CHUNK&&n!==qo.END&&n!==qo.ERROR)throw Error(`Unknown frame type: ${n}`);if(n===qo.JSON){if(i!==0)throw Error(`Invalid JSON frame streamId (expected 0)`)}else if(i===0)throw Error(`Invalid raw frame streamId (expected non-zero)`);if(a>ts)throw Error(`Frame payload too large: ${a} bytes (max ${ts})`);let c=9+a;if(l<c)break;if(++o>is)throw Error(`Too many frames in framed response (max ${is})`);f(9);let p=f(a);switch(n){case qo.JSON:try{s.enqueue($o.decode(p))}catch{}break;case qo.CHUNK:{let e=u(i);e&&e.enqueue(p);break}case qo.END:{let e=u(i);if(r.add(i),e){try{e.close()}catch{}t.delete(i)}break}case qo.ERROR:{let e=u(i);if(r.add(i),e){let n=$o.decode(p);e.error(Error(n)),t.delete(i)}break}}}}}if(l!==0)throw Error(`Incomplete frame at end of framed response`);try{s.close()}catch{}t.forEach(e=>{try{e.close()}catch{}}),t.clear()}catch(e){try{s.error(e)}catch{}t.forEach(t=>{try{t.error(e)}catch{}}),t.clear()}finally{try{n.releaseLock()}catch{}a=null}})(),{getOrCreateStream:l,jsonChunks:c}}var os=null,ss=Object.prototype.hasOwnProperty;function cs(e){for(let t in e)if(ss.call(e,t))return!0;return!1}async function ls(e,t,n){os||=Qo();let r=t[0],i=r.fetch??n,a=r.data instanceof FormData?`formData`:`payload`,o=r.headers?new Headers(r.headers):new Headers;if(o.set(`x-tsr-serverFn`,`true`),a===`payload`&&o.set(`accept`,`${Ko}, application/x-ndjson, application/json`),r.method===`GET`){if(a===`formData`)throw Error(`FormData is not supported with GET requests`);let t=await us(r);if(t!==void 0){let n=ce({payload:t});e.includes(`?`)?e+=`&${n}`:e+=`?${n}`}}let s;if(r.method===`POST`){let e=await fs(r);e?.contentType&&o.set(`content-type`,e.contentType),s=e?.body}return await ps(async()=>i(e,{method:r.method,headers:o,signal:r.signal,body:s}))}async function us(e){let t=!1,n={};if(e.data!==void 0&&(t=!0,n.data=e.data),e.context&&cs(e.context)&&(t=!0,n.context=e.context),t)return ds(n)}async function ds(e){return JSON.stringify(await Promise.resolve(Ca(e,{plugins:os})))}async function fs(e){if(e.data instanceof FormData){let t;return e.context&&cs(e.context)&&(t=await ds(e.context)),t!==void 0&&e.data.set(Uo,t),{body:e.data}}let t=await us(e);if(t)return{body:t,contentType:`application/json`}}async function ps(e){let t;try{t=await e()}catch(e){if(e instanceof Response)t=e;else throw console.log(e),e}if(t.headers.get(`x-tss-raw`)===`true`)return t;let n=t.headers.get(`content-type`);if(m(n,`expected content-type header to be set`),t.headers.get(`x-tss-serialized`)){let e;if(n.includes(`application/x-tss-framed`)){if(Xo(n),!t.body)throw Error(`No response body for framed response`);let{getOrCreateStream:r,jsonChunks:i}=as(t.body),a=[qa(r),...os||[]],o=new Map;e=await hs({jsonStream:i,onMessage:e=>Sa(e,{refs:o,plugins:a}),onError(e,t){console.error(e,t)}})}else if(n.includes(`application/x-ndjson`)){let n=new Map;e=await ms({response:t,onMessage:e=>Sa(e,{refs:n,plugins:os}),onError(e,t){console.error(e,t)}})}else n.includes(`application/json`)&&(e=Sa(await t.json(),{plugins:os}));if(m(e,`expected result to be resolved`),e instanceof Error)throw e;return e}if(n.includes(`application/json`)){let e=await t.json(),n=A(e);if(n)throw n;if(k(e))throw e;return e}if(!t.ok)throw Error(await t.text());return t}async function ms({response:e,onMessage:t,onError:n}){if(!e.body)throw Error(`No response body`);let r=e.body.pipeThrough(new TextDecoderStream).getReader(),i=``,a=!1,o;for(;!a;){let{value:e,done:t}=await r.read();if(e&&(i+=e),i.length===0&&t)throw Error(`Stream ended before first object`);if(i.endsWith(`
5
+ `)){let e=i.split(`
6
+ `).filter(Boolean),t=e[0];if(!t)throw Error(`No JSON line in the first chunk`);o=JSON.parse(t),a=!0,i=e.slice(1).join(`
7
+ `)}else{let e=i.indexOf(`
8
+ `);if(e>=0){let t=i.slice(0,e).trim();i=i.slice(e+1),t.length>0&&(o=JSON.parse(t),a=!0)}}}return(async()=>{try{for(;;){let{value:e,done:a}=await r.read();e&&(i+=e);let o=i.lastIndexOf(`
9
+ `);if(o>=0){let e=i.slice(0,o);i=i.slice(o+1);let r=e.split(`
10
+ `).filter(Boolean);for(let e of r)try{t(JSON.parse(e))}catch(t){n?.(`Invalid JSON line: ${e}`,t)}}if(a)break}}catch(e){n?.(`Stream processing error:`,e)}})(),t(o)}async function hs({jsonStream:e,onMessage:t,onError:n}){let r=e.getReader(),{value:i,done:a}=await r.read();if(a||!i)throw Error(`Stream ended before first object`);let o=JSON.parse(i);return(async()=>{try{for(;;){let{value:e,done:i}=await r.read();if(i)break;if(e)try{t(JSON.parse(e))}catch(t){n?.(`Invalid JSON: ${e}`,t)}}}catch(e){n?.(`Stream processing error:`,e)}})(),t(o)}function gs(e){let t=`/console/_serverFn/`+e;return Object.assign((...e)=>{let n=Zo()?.serverFns?.fetch;return ls(t,e,n??fetch)},{url:t,serverFnMeta:{id:e},[Wo]:!0})}var _s=wa({key:`$TSS/serverfn`,test:e=>typeof e!=`function`||!(Wo in e)?!1:!!e[Wo],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>gs(e)}),vs=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(){}},ys=new class extends vs{#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`}},bs={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},xs=new class{#e=bs;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 Ss(e){setTimeout(e,0)}var Cs=typeof window>`u`||`Deno`in globalThis;function ws(){}function Ts(e,t){return typeof e==`function`?e(t):e}function Es(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ds(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Os(e,t){return typeof e==`function`?e(t):e}function ks(e,t){return typeof e==`function`?e(t):e}function As(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ms(o,t.options))return!1}else if(!Ps(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 js(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Ns(t.options.mutationKey)!==Ns(a))return!1}else if(!Ps(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ms(e,t){return(t?.queryKeyHashFn||Ns)(e)}function Ns(e){return JSON.stringify(e,(e,t)=>zs(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ps(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Ps(e[n],t[n])):!1}var Fs=Object.prototype.hasOwnProperty;function Is(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Rs(e)&&Rs(t);if(!r&&!(zs(e)&&zs(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:Fs.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Is(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Ls(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Rs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zs(e){if(!Bs(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Bs(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Bs(e){return Object.prototype.toString.call(e)===`[object Object]`}function Vs(e){return new Promise(t=>{xs.setTimeout(t,e)})}function Hs(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Is(e,t)}function Us(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ws(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Gs=Symbol();function Ks(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Gs?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function qs(e,t){return typeof e==`function`?e(...t):!!e}function Js(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ys=(()=>{let e=()=>Cs;return{isServer(){return e()},setIsServer(t){e=t}}})();function Xs(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Zs=Ss;function Qs(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Zs,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 $s=Qs(),ec=new class extends vs{#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 tc(e){return Math.min(1e3*2**e,3e4)}function nc(e){return(e??`online`)===`online`?ec.isOnline():!0}var rc=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ic(e){let t=!1,n=0,r,i=Xs(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new rc(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>ys.isFocused()&&(e.networkMode===`always`||ec.isOnline())&&e.canRun(),u=()=>nc(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())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(d).catch(r=>{if(a())return;let i=e.retry??(Ys.isServer()?0:3),o=e.retryDelay??tc,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Vs(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var ac=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Es(this.gcTime)&&(this.#e=xs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ys.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(xs.clearTimeout(this.#e),this.#e=void 0)}};function oc(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=e=>{Js(e,()=>t.signal,()=>n=!0)},u=Ks(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Ws:Us;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?cc:sc,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:sc(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function sc(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 cc(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function lc(e,t){return t?sc(e,t)!=null:!1}function uc(e,t){return!t||!e.getPreviousPageParam?!1:cc(e,t)!=null}var dc=class extends ac{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=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=mc(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.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=mc(this.options);e.data!==void 0&&(this.setState(pc(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Hs(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(ws).catch(ws):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=>ks(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Gs||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Os(e.options.staleTime,this)===`static`):!1}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:!Ds(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){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}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)return this.#a.continueRetry(),this.#a.promise}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.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ks(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!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`?oc(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}),this.#a=ic({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof rc&&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});try{let e=await this.#a.start();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 rc){if(e.silent)return this.#a.promise;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.scheduleGc()}}#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,...fc(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...pc(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),$s.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function fc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nc(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function pc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function mc(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 hc=class extends vs{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Xs(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),_c(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vc(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vc(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 ks(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&&!Ls(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&yc(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||ks(this.options.enabled,this.#t)!==ks(t.enabled,this.#t)||Os(this.options.staleTime,this.#t)!==Os(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||ks(this.options.enabled,this.#t)!==ks(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return xc(this,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),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.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);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ws)),t}#g(){this.#b();let e=Os(this.options.staleTime,this.#t);if(Ys.isServer()||this.#r.isStale||!Es(e))return;let t=Ds(this.#r.dataUpdatedAt,e)+1;this.#d=xs.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Ys.isServer()||ks(this.options.enabled,this.#t)===!1||!Es(this.#p)||this.#p===0)&&(this.#f=xs.setInterval(()=>{(this.options.refetchIntervalInBackground||ys.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(xs.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(xs.clearInterval(this.#f),this.#f=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&&_c(e,t),o=i&&yc(e,n,t,r);(a||o)&&(l={...l,...fc(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.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Hs(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Hs(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={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:bc(e,t),refetch:this.refetch,promise:this.#o,isEnabled:ks(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=Xs())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Ls(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#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()}#C(e){$s.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function gc(e,t){return ks(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&ks(t.retryOnMount,e)===!1)}function _c(e,t){return gc(e,t)||e.state.data!==void 0&&vc(e,t,t.refetchOnMount)}function vc(e,t,n){if(ks(t.enabled,e)!==!1&&Os(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&bc(e,t)}return!1}function yc(e,t,n,r){return(e!==t||ks(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&bc(e,n)}function bc(e,t){return ks(t.enabled,e)!==!1&&e.isStaleByTime(Os(t.staleTime,e))}function xc(e,t){return!Ls(e.getCurrentResult(),t)}var Sc=class extends hc{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:lc(t,n.data),hasPreviousPage:uc(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Cc=class extends ac{#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||wc(),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.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ic({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)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),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:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}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.#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),$s.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function wc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Tc=class extends vs{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Cc({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ec(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ec(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ec(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Ec(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){$s.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>js(t,e))}findAll(e={}){return this.getAll().filter(t=>js(e,t))}notify(e){$s.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return $s.batch(()=>Promise.all(e.map(e=>e.continue().catch(ws))))}};function Ec(e){return e.options.scope?.id}var Dc=class extends vs{#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),Ls(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Ns(t.mutationKey)!==Ns(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}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??wc();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){$s.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Oc=class extends vs{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Ms(r,t),a=this.get(i);return a||(a=new dc({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){$s.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>As(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>As(e,t)):t}notify(e){$s.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){$s.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){$s.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},kc=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Oc,this.#t=e.mutationCache||new Tc,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ys.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ec.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Os(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ts(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return $s.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;$s.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return $s.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=$s.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(ws).catch(ws)}invalidateQueries(e,t={}){return $s.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=$s.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(ws)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(ws)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Os(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ws).catch(ws)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ws).catch(ws)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ec.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Ns(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Ps(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Ns(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Ps(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Ms(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Gs&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ac=B.createContext(void 0),jc=e=>{let t=B.useContext(Ac);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Mc=({client:e,children:t})=>(B.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,z.jsx)(Ac.Provider,{value:e,children:t})),Nc=B.createContext(!1),Pc=()=>B.useContext(Nc);Nc.Provider;function Fc(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ic=B.createContext(Fc()),Lc=()=>B.useContext(Ic),W=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?qs(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Rc=e=>{B.useEffect(()=>{e.clearReset()},[e])},zc=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||qs(n,[e.error,r])),Bc=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))}},Vc=(e,t)=>e.isLoading&&e.isFetching&&!t,Hc=(e,t)=>e?.suspense&&t.isPending,Uc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Wc(e,t,n){let r=Pc(),i=Lc(),a=jc(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Bc(o),W(o,i,s),Rc(i);let l=!a.getQueryCache().get(o.queryHash),[u]=B.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(B.useSyncExternalStore(B.useCallback(e=>{let t=f?u.subscribe($s.batchCalls(e)):ws;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),B.useEffect(()=>{u.setOptions(o)},[o,u]),Hc(o,d))throw Uc(o,u,i);if(zc({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!Ys.isServer()&&Vc(d,r)&&(l?Uc(o,u,i):s?.promise)?.catch(ws).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function Gc(e,t){return Wc(e,hc,t)}function Kc(e,t){let n=jc(t),r=n.getQueryCache();return B.useSyncExternalStore(B.useCallback(e=>r.subscribe($s.batchCalls(e)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function qc(e,t){let n=jc(t),[r]=B.useState(()=>new Dc(n,e));B.useEffect(()=>{r.setOptions(e)},[r,e]);let i=B.useSyncExternalStore(B.useCallback(e=>r.subscribe($s.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=B.useCallback((e,t)=>{r.mutate(e,t).catch(ws)},[r]);if(i.error&&qs(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Jc(e,t){return Wc(e,Sc,t)}var Yc=be(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),Xc=be(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Zc=be(`folder-kanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),Qc=be(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),$c=be(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),el=be(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),tl=be(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),nl=be(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),rl=be(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),il=be(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),al=be(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),ol=be(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),sl=be(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),cl=be(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),ll=be(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),ul=()=>{throw Error(`createServerOnlyFn() functions can only be called on the server!`)};function dl(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function fl(e,t){let n=Object.create(null);if(e)for(let t of Object.keys(e))dl(t)&&(n[t]=e[t]);if(t&&typeof t==`object`)for(let e of Object.keys(t))dl(e)&&(n[e]=t[e]);return n}function pl(e){if(!e)return Object.create(null);let t=Object.create(null);for(let n of Object.keys(e))dl(n)&&(t[n]=e[n]);return t}var ml=(e,t)=>{let n=t||e||{};return n.method===void 0&&(n.method=`GET`),Object.assign(e=>ml(void 0,{...n,...e}),{options:n,middleware:e=>{let t=[...n.middleware||[]];e.map(e=>{Go in e?e.options.middleware&&t.push(...e.options.middleware):t.push(e)});let r=ml(void 0,{...n,middleware:t});return r[Go]=!0,r},inputValidator:e=>ml(void 0,{...n,inputValidator:e}),handler:(...e)=>{let[t,r]=e,i={...n,extractedFn:t,serverFn:r},a=[...i.middleware||[],vl(i)];return Object.assign(async e=>{let n=await hl(a,`client`,{...t,...i,data:e?.data,headers:e?.headers,signal:e?.signal,fetch:e?.fetch,context:pl()}),r=A(n.error);if(r)throw r;if(n.error)throw n.error;return n.result},{...t,__executeServer:async e=>{let n=ul(),r=n.contextAfterGlobalMiddlewares;return await hl(a,`server`,{...t,...e,serverFnMeta:t.serverFnMeta,context:fl(r,e.context),request:n.request}).then(e=>({result:e.result,error:e.error,context:e.sendContext}))}})}})};async function hl(e,t,n){let r=gl([...Zo()?.functionMiddleware||[],...e]);if(t===`server`){let e=ul({throwIfNotFound:!1});e?.executedRequestMiddlewares&&(r=r.filter(t=>!e.executedRequestMiddlewares.has(t)))}let i=async e=>{let n=r.shift();if(!n)return e;try{`inputValidator`in n.options&&n.options.inputValidator&&t===`server`&&(e.data=await _l(n.options.inputValidator,e.data));let r;if(t===`client`?`client`in n.options&&(r=n.options.client):`server`in n.options&&(r=n.options.server),r){let t=async(t={})=>{let n=await i({...e,...t,context:fl(e.context,t.context),sendContext:fl(e.sendContext,t.sendContext),headers:Bo(e.headers,t.headers),_callSiteFetch:e._callSiteFetch,fetch:e._callSiteFetch??t.fetch??e.fetch,result:t.result===void 0?t instanceof Response?t:e.result:t.result,error:t.error??e.error});if(n.error)throw n.error;return n},n=await r({...e,next:t});if(se(n))return{...e,error:n};if(n instanceof Response)return{...e,result:n};if(!n)throw Error(`User middleware returned undefined. You must call next() or return a result in your middlewares.`);return n}return i(e)}catch(t){return{...e,error:t}}};return i({...n,headers:n.headers||{},sendContext:n.sendContext||{},context:n.context||pl(),_callSiteFetch:n.fetch})}function gl(e,t=100){let n=new Set,r=[],i=(e,a)=>{if(a>t)throw Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);e.forEach(e=>{e.options.middleware&&i(e.options.middleware,a+1),n.has(e)||(n.add(e),r.push(e))})};return i(e,0),r}async function _l(e,t){if(e==null)return{};if(`~standard`in e){let n=await e[`~standard`].validate(t);if(n.issues)throw Error(JSON.stringify(n.issues,void 0,2));return n.value}if(`parse`in e)return e.parse(t);if(typeof e==`function`)return e(t);throw Error(`Invalid validator type!`)}function vl(e){return{"~types":void 0,options:{inputValidator:e.inputValidator,client:async({next:t,sendContext:n,fetch:r,...i})=>{let a={...i,context:n,fetch:r};return t(await e.extractedFn?.(a))},server:async({next:t,...n})=>{let r=await e.serverFn?.(n);return t({...n,result:r})}}}}var yl=ml({method:`GET`}).handler(gs(`aaeaff504f6c69b303c57758f630a549e4fdfd8025b4a25dce001f39edb2802e`)),bl=ml({method:`GET`}).handler(gs(`17426eb2474038c03892eee22aa4ff586684916bb28b8d309ab554f7beb34bad`)),xl=ml({method:`POST`}).handler(gs(`2c0cbf7a2a60cd273d5efdc22b38a68b32c419c428301906e0f8e5a64b570711`)),Sl=ml({method:`POST`}).handler(gs(`ab84ba5d863fbaede680f66ae18a8de9cae4082c2ef42f7f8aae80b9e2d0f829`)),Cl=ml({method:`POST`}).handler(gs(`ef1df28e894edbcd3cd95a458748ad5de06f814b9486846c78839a9a1ae34499`)),wl=class extends Error{},Tl=class extends Error{},El=class extends Error{status;details;constructor(e,t,n){super(e),this.status=t,this.details=n}};async function Dl(e){return Pl(await yl({data:{path:e}}))}async function Ol(e){return Pl(await bl({data:{path:e}}))}async function kl(e,t){return Pl(await xl({data:{path:e,body:t}}))}async function Al(e,t){return Pl(await Sl({data:{path:e,body:t}}))}async function jl(e){return Pl(await Cl({data:{path:e}}))}async function Ml(e,t){let n=await fetch(`/console/api/download?path=${encodeURIComponent(e)}`);if(n.status===401||n.status===403)throw new wl(`auth failed (${n.status})`);if(!n.ok)throw await Nl(n,e);let r=await n.blob(),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}async function Nl(e,t){let n,r=`${t} failed (${e.status})`;try{n=await e.clone().json(),Fl(n)&&typeof n.message==`string`?r=n.message:Fl(n)&&typeof n.error==`string`&&(r=n.error)}catch{try{let t=await e.clone().text();t.trim().length>0&&(r=t.trim())}catch{}}return new El(r,e.status,n)}function Pl(e){if(e.ok)return e.data;throw e.status===401||e.status===403?new wl(e.message):e.status===404?new Tl(e.message):new El(e.message,e.status,e.details)}function Fl(e){return typeof e==`object`&&!!e}var Il=new Set([`running`,`draining`,`stopping`,`stopped`,`failed`,`expired`,`cancelled`]),Ll={unsafe_status:`sandbox is not in a stale lifecycle state`,live_sandbox:`sandbox is live`,accepted_running_assignments:`sandbox has accepted running assignments`,provider_cleanup_required:`provider cleanup is required`};function Rl(e){return e.sandboxStatus!==`active`&&Il.has(e.status)}function zl(e,t,n){return t?`pending`:Rl(e)?n?`confirm`:`request`:`hidden`}function G(e,t){return t.status===`deleted`?e.filter(e=>e.sandboxId!==t.sandboxId):e.map(e=>e.sandboxId===t.sandboxId?{...e,status:`deleting`}:e)}function K(e){if(e instanceof Tl)return`Sandbox is unavailable or already deleted.`;if(e instanceof El&&e.status===409){let t=q(e.details);if(t.length>0)return`Delete blocked: ${t.map(J).join(`; `)}.`}return e instanceof Error?e.message:`Failed to delete sandbox.`}function q(e){return!Y(e)||!Array.isArray(e.blockers)?[]:e.blockers.filter(e=>typeof e==`string`)}function J(e){return Ll[e]??e.replaceAll(`_`,` `)}function Y(e){return typeof e==`object`&&!!e}function Bl(e){return`/v1/hosts/${encodeURIComponent(e)}/project-workspace-root`}function Vl(e){return`/v1/hosts/${encodeURIComponent(e)}/project-bindings`}function Hl(e,t){return`${Vl(e)}/${encodeURIComponent(t)}`}function Ul(e,t){let n=e.includes(`\\`)&&!e.includes(`/`)?`\\`:`/`;return e.endsWith(`/`)||e.endsWith(`\\`)?`${e}${t}`:`${e}${n}${t}`}function Wl(e){return e===void 0?{tone:`idle`,label:`Not bound`,detail:`No host binding has been saved for this project.`}:e.availability===`available`?{tone:`available`,label:`Available`,detail:`Validated ${e.lastValidatedAt??e.updatedAt}.`}:e.availability===`unavailable`?{tone:`unavailable`,label:`Unavailable`,detail:e.validationReason??`Last rejected ${e.lastValidatedAt??e.updatedAt}.`}:{tone:`pending`,label:`Pending validation`,detail:`Waiting for the host runtime to validate this binding.`}}function Gl(e,t){let n=new Set(t?.poolKeys??[]);return e.map(e=>{let t=e.status??`available`;return{poolKey:e.poolKey,selected:n.has(e.poolKey),status:t,statusLabel:t}})}var Kl=1e3;function ql(e){let t=typeof e==`string`?e:e?.state,n=typeof e==`string`?void 0:e?.projectKey;return Jc({queryKey:[`runs`,t??null,n??null],initialPageParam:void 0,queryFn:({pageParam:e})=>{let r=new URLSearchParams;t!==void 0&&r.set(`state`,t),n!==void 0&&r.set(`projectKey`,n),e!==void 0&&r.set(`cursor`,e);let i=r.toString();return Dl(`/v1/runs${i?`?${i}`:``}`)},getNextPageParam:e=>e.nextCursor,maxPages:10,refetchInterval:Kl})}function Jl(){return Gc({queryKey:[`projects`],queryFn:()=>Dl(`/v1/projects`),refetchInterval:Kl})}function Yl(){return Gc({queryKey:[`hosts`],queryFn:()=>Dl(`/v1/hosts`),refetchInterval:Kl})}function Xl(e){return Gc({queryKey:[`host-pools`,e],enabled:e!==null,queryFn:()=>Dl(`/v1/hosts/${encodeURIComponent(hu(e,`useHostPools`))}/pools`),refetchInterval:Kl})}function Zl(){return Gc({queryKey:[`sandbox-fleet`],queryFn:()=>Dl(`/v1/sandboxes`),refetchInterval:Kl})}function Ql(){let e=jc();return qc({mutationFn:e=>jl(`/v1/sandboxes/${encodeURIComponent(e)}`),onSuccess:async t=>{e.setQueryData([`sandbox-fleet`],e=>e&&{sandboxes:G(e.sandboxes,t)}),t.status===`deleted`&&e.removeQueries({queryKey:[`managed-sandbox`,t.sandboxId]}),await Promise.all([e.invalidateQueries({queryKey:[`sandbox-fleet`]}),e.invalidateQueries({queryKey:[`managed-sandbox`,t.sandboxId]})])}})}function $l(e,t=!0){return Gc({queryKey:[`host-project-bindings`,e],enabled:e!==null&&t,queryFn:()=>Dl(Vl(hu(e,`useHostProjectBindings`))),refetchInterval:Kl})}function eu(){let e=jc();return qc({mutationFn:e=>Al(Bl(e.hostId),{path:e.path}),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:[`hosts`]}),e.invalidateQueries({queryKey:[`host-project-bindings`,t.hostId]})])}})}function tu(){let e=jc();return qc({mutationFn:e=>Al(Hl(e.hostId,e.projectKey),{poolKeys:e.poolKeys}),onSuccess:async(t,n)=>{await e.invalidateQueries({queryKey:[`host-project-bindings`,n.hostId]})}})}function nu(e){return Gc({queryKey:[`run`,e],queryFn:()=>Dl(`/v1/runs/${encodeURIComponent(e)}`),refetchInterval:Kl})}function ru(e){return Gc({queryKey:[`run-tasks`,e],queryFn:()=>Dl(`/v1/runs/${encodeURIComponent(e)}/tasks`),refetchInterval:Kl})}function iu(e){return Gc({queryKey:[`run-artifacts`,e],queryFn:()=>Dl(`/v1/runs/${encodeURIComponent(e)}/artifacts`),refetchInterval:Kl})}function au(e){return Gc({queryKey:[`run-metrics`,e],queryFn:()=>Dl(`/v1/runs/${encodeURIComponent(e)}/metrics`),refetchInterval:Kl})}function ou(e){return Gc({queryKey:[`run-file-reservations`,e],queryFn:()=>Dl(`/v1/runs/${encodeURIComponent(e)}/file-reservations`),refetchInterval:Kl})}function su(){let e=jc();return qc({mutationFn:e=>jl(`/v1/runs/${encodeURIComponent(e)}`),onSuccess:async(t,n)=>{e.removeQueries({queryKey:[`run`,n]}),e.removeQueries({queryKey:[`run-tasks`,n]}),e.removeQueries({queryKey:[`run-artifacts`,n]}),e.removeQueries({queryKey:[`run-metrics`,n]}),e.removeQueries({queryKey:[`run-file-reservations`,n]}),await e.invalidateQueries({queryKey:[`runs`]})}})}function cu(e,t){return Gc({queryKey:[`task-pi-session`,e],enabled:e!==null,queryFn:async()=>{let t=mu(e,`useTaskPiSession`);try{return await Dl(`/v1/tasks/${encodeURIComponent(t)}/pi-session`)}catch(e){if(e instanceof Tl)return null;throw e}},refetchInterval:t?Kl:!1})}function lu(e,t,n){return Gc({queryKey:[`task-pi-session-raw`,e],enabled:e!==null&&t,queryFn:async()=>{let t=mu(e,`useTaskPiSessionRaw`);try{return await Ol(`/v1/tasks/${encodeURIComponent(t)}/pi-session?format=raw`)}catch(e){if(e instanceof Tl)return null;throw e}},refetchInterval:n?Kl:!1})}function uu(e){let t=jc();return qc({mutationFn:t=>{let n=mu(e,`useSendTaskMessage`);return kl(`/v1/tasks/${encodeURIComponent(n)}/messages`,t)},onSuccess:async()=>{await t.invalidateQueries({queryKey:[`task-pi-session`,e]}),await t.invalidateQueries({queryKey:[`task-pi-session-raw`,e]}),await t.invalidateQueries({queryKey:[`task-activity`,e]})}})}function du(e,t){return Gc({queryKey:[`task-workpad`,e],enabled:e!==null,queryFn:()=>Dl(`/v1/tasks/${encodeURIComponent(mu(e,`useTaskWorkpad`))}/workpad`),refetchInterval:t?Kl:!1})}function fu(e){let t=jc();return qc({mutationFn:t=>{let n=mu(e,`useSaveTaskWorkpad`);return Al(`/v1/tasks/${encodeURIComponent(n)}/workpad`,t)},onSuccess:async n=>{t.setQueryData([`task-workpad`,e],n),await t.invalidateQueries({queryKey:[`run-tasks`,n.runId]}),await t.invalidateQueries({queryKey:[`task-activity`,e]})},onSettled:async()=>{await t.invalidateQueries({queryKey:[`task-workpad`,e]})}})}function pu(e,t){return Gc({queryKey:[`task-activity`,e],enabled:e!==null,queryFn:()=>Dl(`/v1/tasks/${encodeURIComponent(mu(e,`useTaskActivity`))}/activity?limit=20`),refetchInterval:t?Kl:!1})}function mu(e,t){if(e===null)throw Error(`${t} called without taskId`);return e}function hu(e,t){if(e===null)throw Error(`${t} called without hostId`);return e}var gu=[0,60,120,180,240,300];function _u(e){let t=(0,B.useId)();return(0,z.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,className:xe(`size-5`,e.className),children:[(0,z.jsx)(`defs`,{children:(0,z.jsxs)(`g`,{id:t,children:[(0,z.jsx)(`line`,{x1:`12`,y1:`9.6`,x2:`12`,y2:`6.4`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,opacity:`0.35`}),(0,z.jsx)(`circle`,{cx:`12`,cy:`4.4`,r:`1.4`,fill:`currentColor`})]})}),gu.map(e=>(0,z.jsx)(`use`,{href:`#${t}`,transform:`rotate(${e} 12 12)`},e)),(0,z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.9`,className:`fill-primary`})]})}function vu(e){return(0,z.jsxs)(`span`,{className:xe(`flex min-w-0 items-center gap-2`,e.className),children:[(0,z.jsx)(_u,{className:`size-[18px] shrink-0`}),(0,z.jsx)(`span`,{className:`truncate font-semibold tracking-[0.12em]`,children:`FLAKES`})]})}var yu=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,bu=ye,xu=(e,t)=>n=>{if(t?.variants==null)return bu(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=yu(t)||yu(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 bu(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)};function Su(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Cu(...e){return t=>{let n=!1,r=e.map(e=>{let r=Su(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Su(e[t],null)}}}}function wu(...e){return B.useCallback(Cu(...e),e)}function Tu(e){let t=B.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Nu(r)&&typeof Lu==`function`&&(r=Lu(r._payload)),B.Children.forEach(r,e=>{if(ju(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Nu(n)&&typeof Lu==`function`&&(n=Lu(n._payload)),a=Ou(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=B.cloneElement(a,void 0,s):!o&&B.Children.count(r)===1&&B.isValidElement(r)&&(a=r);let c=a?Au(a):void 0,l=wu(n,c);if(!a){if(r||r===0)throw Error(o?Iu(e):Fu(e));return r}let u=ku(i,a.props??{});return a.type!==B.Fragment&&(u.ref=n?l:c),B.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var Eu=Tu(`Slot`),Du=Symbol.for(`radix.slottable`),Ou=(e,t)=>{if(`child`in e.props){let t=e.props.child;return B.isValidElement(t)?B.cloneElement(t,void 0,e.props.children(t.props.children)):null}return B.isValidElement(t)?t:null};function ku(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Au(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ju(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Du}var Mu=Symbol.for(`react.lazy`);function Nu(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Mu&&`_payload`in e&&Pu(e._payload)}function Pu(e){return typeof e==`object`&&!!e&&`then`in e}var Fu=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Iu=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Lu=B.use,Ru=e(ve(),1),zu=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Tu(`Primitive.${t}`),r=B.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,z.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Bu(e,t){e&&Ru.flushSync(()=>e.dispatchEvent(t))}function Vu(e,t=[]){let n=[];function r(t,r){let i=B.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=B.useMemo(()=>o,Object.values(o));return(0,z.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=B.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>B.createContext(e));return function(n){let r=n?.[e]||t;return B.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Hu(i,...t)]}function Hu(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return B.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Uu(e){let t=e+`CollectionProvider`,[n,r]=Vu(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=B.useRef(null),a=B.useRef(new Map).current;return(0,z.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Tu(s),l=B.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,z.jsx)(c,{ref:wu(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Tu(u),p=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),s=wu(t,o),c=a(u,n);return B.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,z.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return B.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}typeof window<`u`&&window.document&&window.document.createElement;function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var Wu=globalThis?.document?B.useLayoutEffect:()=>{},Z=B.useInsertionEffect||Wu;function Gu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Ku({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=B.useRef(e!==void 0);B.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,B.useCallback(t=>{if(s){let n=qu(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Ku({defaultProp:e,onChange:t}){let[n,r]=B.useState(e),i=B.useRef(n),a=B.useRef(t);return Z(()=>{a.current=t},[t]),B.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function qu(e){return typeof e==`function`}function Ju(e,t){return B.useReducer((e,n)=>t[e][n]??e,e)}var Yu=e=>{let{present:t,children:n}=e,r=Xu(t),i=typeof n==`function`?n({present:r.isPresent}):B.Children.only(n),a=Qu(r.ref,ed(i));return typeof n==`function`||r.isPresent?B.cloneElement(i,{ref:a}):null};Yu.displayName=`Presence`;function Xu(e){let[t,n]=B.useState(),r=B.useRef(null),i=B.useRef(e),a=B.useRef(`none`),[o,s]=Ju(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return B.useEffect(()=>{let e=$u(r.current);a.current=o===`mounted`?e:`none`},[o]),Wu(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=$u(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Wu(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=$u(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=$u(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:B.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Zu(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Qu(...e){let t=B.useRef(e);return t.current=e,B.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Zu(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Zu(n[e],null)}}},[])}function $u(e){return e?.animationName||`none`}function ed(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var td=B.useId||(()=>void 0),nd=0;function rd(e){let[t,n]=B.useState(td());return Wu(()=>{e||n(e=>e??String(nd++))},[e]),e||(t?`radix-${t}`:``)}var id=B.createContext(void 0);function ad(e){let t=B.useContext(id);return e||t||`ltr`}function od(e){let t=B.useRef(e);return B.useEffect(()=>{t.current=e}),B.useMemo(()=>((...e)=>t.current?.(...e)),[])}function sd(e,t=globalThis?.document){let n=od(e);B.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var cd=`DismissableLayer`,ld=`dismissableLayer.update`,ud=`dismissableLayer.pointerDownOutside`,dd=`dismissableLayer.focusOutside`,fd,pd=B.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),md=B.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=B.useContext(pd),[u,d]=B.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=B.useState({}),m=wu(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=_d(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=vd(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return sd(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),B.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(fd=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),yd(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(u),l.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=fd))}},[u,f,n,l]),B.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),yd())},[u,l]),B.useEffect(()=>{let e=()=>p({});return document.addEventListener(ld,e),()=>document.removeEventListener(ld,e)},[]),(0,z.jsx)(zu.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:X(e.onFocusCapture,S.onFocusCapture),onBlurCapture:X(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,x.onPointerDownCapture)})});md.displayName=cd;var hd=`DismissableLayerBranch`,gd=B.forwardRef((e,t)=>{let n=B.useContext(pd),r=B.useRef(null),i=wu(t,r);return B.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,z.jsx)(zu.div,{...e,ref:i})});gd.displayName=hd;function _d(e,t=globalThis?.document){let n=od(e),r=B.useRef(!1),i=B.useRef(()=>{});return B.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Q(ud,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function vd(e,t=globalThis?.document){let n=od(e),r=B.useRef(!1);return B.useEffect(()=>{let e=e=>{e.target&&!r.current&&Q(dd,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yd(){let e=new CustomEvent(ld);document.dispatchEvent(e)}function Q(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Bu(i,a):i.dispatchEvent(a)}var bd=`focusScope.autoFocusOnMount`,xd=`focusScope.autoFocusOnUnmount`,Sd={bubbles:!1,cancelable:!0},Cd=`FocusScope`,wd=B.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=B.useState(null),l=od(i),u=od(a),d=B.useRef(null),f=wu(t,e=>c(e)),p=B.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;B.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:jd(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||jd(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&jd(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),B.useEffect(()=>{if(s){Md.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(bd,Sd);s.addEventListener(bd,l),s.dispatchEvent(t),t.defaultPrevented||(Td(Pd(Dd(s)),{select:!0}),document.activeElement===e&&jd(s))}return()=>{s.removeEventListener(bd,l),setTimeout(()=>{let t=new CustomEvent(xd,Sd);s.addEventListener(xd,u),s.dispatchEvent(t),t.defaultPrevented||jd(e??document.body,{select:!0}),s.removeEventListener(xd,u),Md.remove(p)},0)}}},[s,l,u,p]);let m=B.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ed(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&jd(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&jd(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,z.jsx)(zu.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});wd.displayName=Cd;function Td(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(jd(r,{select:t}),document.activeElement!==n)return}function Ed(e){let t=Dd(e);return[Od(t,e),Od(t.reverse(),e)]}function Dd(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Od(e,t){for(let n of e)if(!kd(n,{upTo:t}))return n}function kd(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Ad(e){return e instanceof HTMLInputElement&&`select`in e}function jd(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ad(e)&&t&&e.select()}}var Md=$();function $(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Nd(e,t),e.unshift(t)},remove(t){e=Nd(e,t),e[0]?.resume()}}}function Nd(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Pd(e){return e.filter(e=>e.tagName!==`A`)}var Fd=`Portal`,Id=B.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=B.useState(!1);Wu(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Ru.createPortal((0,z.jsx)(zu.div,{...r,ref:t}),o):null});Id.displayName=Fd;var Ld=0,Rd=null;function zd(){B.useEffect(()=>{Rd||={start:Bd(),end:Bd()};let{start:e,end:t}=Rd;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ld++,()=>{Ld===1&&(Rd?.start.remove(),Rd?.end.remove(),Rd=null),Ld=Math.max(0,Ld-1)}},[])}function Bd(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Vd=function(){return Vd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Vd.apply(this,arguments)};function Hd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ud(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Wd=`right-scroll-bar-position`,Gd=`width-before-scroll-bar`,Kd=`with-scroll-bars-hidden`,qd=`--removed-body-scroll-bar-size`;function Jd(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Yd(e,t){var n=(0,B.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Xd=typeof window<`u`?B.useLayoutEffect:B.useEffect,Zd=new WeakMap;function Qd(e,t){var n=Yd(t||null,function(t){return e.forEach(function(e){return Jd(e,t)})});return Xd(function(){var t=Zd.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Jd(e,null)}),i.forEach(function(e){r.has(e)||Jd(e,a)})}Zd.set(n,e)},[e]),n}function $d(e){return e}function ef(e,t){t===void 0&&(t=$d);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function tf(e){e===void 0&&(e={});var t=ef(null);return t.options=Vd({async:!0,ssr:!1},e),t}var nf=function(e){var t=e.sideCar,n=Hd(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return B.createElement(r,Vd({},n))};nf.isSideCarExport=!0;function rf(e,t){return e.useMedium(t),nf}var af=tf(),of=function(){},sf=B.forwardRef(function(e,t){var n=B.useRef(null),r=B.useState({onScrollCapture:of,onWheelCapture:of,onTouchMoveCapture:of}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Hd(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Qd([n,t]),C=Vd(Vd({},b),i);return B.createElement(B.Fragment,null,u&&B.createElement(x,{sideCar:af,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?B.cloneElement(B.Children.only(s),Vd(Vd({},C),{ref:S})):B.createElement(v,Vd({},C,{className:c,ref:S}),s))});sf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},sf.classNames={fullWidth:Gd,zeroRight:Wd};var cf,lf=function(){if(cf)return cf;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function uf(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=lf();return t&&e.setAttribute(`nonce`,t),e}function df(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ff(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var pf=function(){var e=0,t=null;return{add:function(n){e==0&&(t=uf())&&(df(t,n),ff(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mf=function(){var e=pf();return function(t,n){B.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hf=function(){var e=mf();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},gf={left:0,top:0,right:0,gap:0},_f=function(e){return parseInt(e||``,10)||0},vf=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[_f(n),_f(r),_f(i)]},yf=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return gf;var t=vf(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},bf=hf(),xf=`data-scroll-locked`,Sf=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
11
+ .${Kd} {
12
+ overflow: hidden ${r};
13
+ padding-right: ${s}px ${r};
14
+ }
15
+ body[${xf}] {
16
+ overflow: hidden ${r};
17
+ overscroll-behavior: contain;
18
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
19
+ padding-left: ${i}px;
20
+ padding-top: ${a}px;
21
+ padding-right: ${o}px;
22
+ margin-left:0;
23
+ margin-top:0;
24
+ margin-right: ${s}px ${r};
25
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
26
+ }
27
+
28
+ .${Wd} {
29
+ right: ${s}px ${r};
30
+ }
31
+
32
+ .${Gd} {
33
+ margin-right: ${s}px ${r};
34
+ }
35
+
36
+ .${Wd} .${Wd} {
37
+ right: 0 ${r};
38
+ }
39
+
40
+ .${Gd} .${Gd} {
41
+ margin-right: 0 ${r};
42
+ }
43
+
44
+ body[${xf}] {
45
+ ${qd}: ${s}px;
46
+ }
47
+ `},Cf=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},wf=function(){B.useEffect(function(){return document.body.setAttribute(xf,(Cf()+1).toString()),function(){var e=Cf()-1;e<=0?document.body.removeAttribute(xf):document.body.setAttribute(xf,e.toString())}},[])},Tf=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;wf();var a=B.useMemo(function(){return yf(i)},[i]);return B.createElement(bf,{styles:Sf(a,!t,i,n?``:`!important`)})},Ef=!1;if(typeof window<`u`)try{var Df=Object.defineProperty({},"passive",{get:function(){return Ef=!0,!0}});window.addEventListener(`test`,Df,Df),window.removeEventListener(`test`,Df,Df)}catch{Ef=!1}var Of=Ef?{passive:!1}:!1,kf=function(e){return e.tagName===`TEXTAREA`},Af=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!kf(e)&&n[t]===`visible`)},jf=function(e){return Af(e,`overflowY`)},Mf=function(e){return Af(e,`overflowX`)},Nf=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),If(e,r)){var i=Lf(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Pf=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ff=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},If=function(e,t){return e===`v`?jf(t):Mf(t)},Lf=function(e,t){return e===`v`?Pf(t):Ff(t)},Rf=function(e,t){return e===`h`&&t===`rtl`?-1:1},zf=function(e,t,n,r,i){var a=Rf(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Lf(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&If(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Bf=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vf=function(e){return[e.deltaX,e.deltaY]},Hf=function(e){return e&&`current`in e?e.current:e},Uf=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wf=function(e){return`
48
+ .block-interactivity-${e} {pointer-events: none;}
49
+ .allow-interactivity-${e} {pointer-events: all;}
50
+ `},Gf=0,Kf=[];function qf(e){var t=B.useRef([]),n=B.useRef([0,0]),r=B.useRef(),i=B.useState(Gf++)[0],a=B.useState(hf)[0],o=B.useRef(e);B.useEffect(function(){o.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ud([e.lockRef.current],(e.shards||[]).map(Hf),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=B.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Bf(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Nf(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Nf(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return zf(h,t,e,h===`h`?s:c,!0)},[]),c=B.useCallback(function(e){var n=e;if(!(!Kf.length||Kf[Kf.length-1]!==a)){var r=`deltaY`in n?Vf(n):Bf(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Uf(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Hf).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=B.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Jf(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=B.useCallback(function(e){n.current=Bf(e),r.current=void 0},[]),d=B.useCallback(function(t){l(t.type,Vf(t),t.target,s(t,e.lockRef.current))},[]),f=B.useCallback(function(t){l(t.type,Bf(t),t.target,s(t,e.lockRef.current))},[]);B.useEffect(function(){return Kf.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Of),document.addEventListener(`touchmove`,c,Of),document.addEventListener(`touchstart`,u,Of),function(){Kf=Kf.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Of),document.removeEventListener(`touchmove`,c,Of),document.removeEventListener(`touchstart`,u,Of)}},[]);var p=e.removeScrollBar,m=e.inert;return B.createElement(B.Fragment,null,m?B.createElement(a,{styles:Wf(i)}):null,p?B.createElement(Tf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Jf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Yf=rf(af,qf),Xf=B.forwardRef(function(e,t){return B.createElement(sf,Vd({},e,{ref:t,sideCar:Yf}))});Xf.classNames=sf.classNames;var Zf=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Qf=new WeakMap,$f=new WeakMap,ep={},tp=0,np=function(e){return e&&(e.host||np(e.parentNode))},rp=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=np(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ip=function(e,t,n,r){var i=rp(t,Array.isArray(e)?e:[e]);ep[n]||(ep[n]=new WeakMap);var a=ep[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Qf.get(e)||0)+1,l=(a.get(e)||0)+1;Qf.set(e,c),a.set(e,l),o.push(e),c===1&&i&&$f.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),tp++,function(){o.forEach(function(e){var t=Qf.get(e)-1,i=a.get(e)-1;Qf.set(e,t),a.set(e,i),t||($f.has(e)||e.removeAttribute(r),$f.delete(e)),i||e.removeAttribute(n)}),tp--,tp||(Qf=new WeakMap,Qf=new WeakMap,$f=new WeakMap,ep={})}},ap=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Zf(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ip(r,i,n,`aria-hidden`)):function(){return null}};function op(e){let[t,n]=B.useState(void 0);return Wu(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var sp=[`top`,`right`,`bottom`,`left`],cp=Math.min,lp=Math.max,up=Math.round,dp=Math.floor,fp=e=>({x:e,y:e}),pp={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function mp(e,t,n){return lp(e,cp(t,n))}function hp(e,t){return typeof e==`function`?e(t):e}function gp(e){return e.split(`-`)[0]}function _p(e){return e.split(`-`)[1]}function vp(e){return e===`x`?`y`:`x`}function yp(e){return e===`y`?`height`:`width`}function bp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function xp(e){return vp(bp(e))}function Sp(e,t,n){n===void 0&&(n=!1);let r=_p(e),i=xp(e),a=yp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=jp(o)),[o,jp(o)]}function Cp(e){let t=jp(e);return[wp(e),t,wp(t)]}function wp(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Tp=[`left`,`right`],Ep=[`right`,`left`],Dp=[`top`,`bottom`],Op=[`bottom`,`top`];function kp(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ep:Tp:t?Tp:Ep;case`left`:case`right`:return t?Dp:Op;default:return[]}}function Ap(e,t,n,r){let i=_p(e),a=kp(gp(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(wp)))),a}function jp(e){let t=gp(e);return pp[t]+e.slice(t.length)}function Mp(e){return{top:0,right:0,bottom:0,left:0,...e}}function Np(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Mp(e)}function Pp(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 Fp(e,t,n){let{reference:r,floating:i}=e,a=bp(t),o=xp(t),s=yp(o),c=gp(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}}switch(_p(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Ip(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}=hp(t,e),p=Np(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Pp(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=Pp(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 Lp=50,Rp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ip},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Fp(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<Lp&&(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}=Fp(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},zp=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}=hp(e,t)||{};if(l==null)return{};let d=Np(u),f={x:n,y:r},p=xp(i),m=yp(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=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,E=C/2-h[m]/2-1,D=cp(d[_],E),ee=cp(d[v],E),te=D,ne=C-h[m]-ee,re=C/2-h[m]/2+w,O=mp(te,re,ne),ie=!c.arrow&&_p(i)!=null&&re!==O&&a.reference[m]/2-(re<te?D:ee)-h[m]/2<0,ae=ie?re<te?re-te:re-ne:0;return{[p]:f[p]+ae,data:{[p]:O,centerOffset:re-O-ae,...ie&&{alignmentOffset:ae}},reset:ie}}}),Bp=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}=hp(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=gp(r),_=bp(o),v=gp(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[jp(o)]:Cp(o)),x=p!==`none`;!d&&x&&b.push(...Ap(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],E=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Sp(r,a,y);w.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==bp(t))||E.every(e=>bp(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:E},reset:{placement:t}};let n=E.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=E.filter(e=>{if(x){let t=bp(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Vp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hp(e){return sp.some(t=>e[t]>=0)}var Up=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=hp(e,t);switch(i){case`referenceHidden`:{let e=Vp(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Hp(e)}}}case`escaped`:{let e=Vp(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Hp(e)}}}default:return{}}}}},Wp=new Set([`left`,`top`]);async function Gp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=gp(n),s=_p(n),c=bp(n)===`y`,l=Wp.has(o)?-1:1,u=a&&c?-1:1,d=hp(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 Kp=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 Gp(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}}}}},qp=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}=hp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=bp(gp(i)),p=vp(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=mp(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=mp(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Jp=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}=hp(e,t),u={x:n,y:r},d=bp(i),f=vp(d),p=u[f],m=u[d],h=hp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=Wp.has(gp(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}}}},Yp=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=hp(e,t),u=await o.detectOverflow(t,l),d=gp(i),f=_p(i),p=bp(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=cp(h-u[g],v),x=cp(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=lp(u.left,0),t=lp(u.right,0),n=lp(u.top,0),r=lp(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:lp(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:lp(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let E=await o.getDimensions(s.floating);return m!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}};function Xp(){return typeof window<`u`}function Zp(e){return em(e)?(e.nodeName||``).toLowerCase():`#document`}function Qp(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $p(e){return((em(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function em(e){return Xp()?e instanceof Node||e instanceof Qp(e).Node:!1}function tm(e){return Xp()?e instanceof Element||e instanceof Qp(e).Element:!1}function nm(e){return Xp()?e instanceof HTMLElement||e instanceof Qp(e).HTMLElement:!1}function rm(e){return!Xp()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Qp(e).ShadowRoot}function im(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=hm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function am(e){return/^(table|td|th)$/.test(Zp(e))}function om(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var sm=/transform|translate|scale|rotate|perspective|filter/,cm=/paint|layout|strict|content/,lm=e=>!!e&&e!==`none`,um;function dm(e){let t=tm(e)?hm(e):e;return lm(t.transform)||lm(t.translate)||lm(t.scale)||lm(t.rotate)||lm(t.perspective)||!pm()&&(lm(t.backdropFilter)||lm(t.filter))||sm.test(t.willChange||``)||cm.test(t.contain||``)}function fm(e){let t=_m(e);for(;nm(t)&&!mm(t);){if(dm(t))return t;if(om(t))return null;t=_m(t)}return null}function pm(){return um??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),um}function mm(e){return/^(html|body|#document)$/.test(Zp(e))}function hm(e){return Qp(e).getComputedStyle(e)}function gm(e){return tm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _m(e){if(Zp(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||rm(e)&&e.host||$p(e);return rm(t)?t.host:t}function vm(e){let t=_m(e);return mm(t)?e.ownerDocument?e.ownerDocument.body:e.body:nm(t)&&im(t)?t:vm(t)}function ym(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=vm(e),i=r===e.ownerDocument?.body,a=Qp(r);if(i){let e=bm(a);return t.concat(a,a.visualViewport||[],im(r)?r:[],e&&n?ym(e):[])}else return t.concat(r,ym(r,[],n))}function bm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xm(e){let t=hm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=nm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=up(n)!==a||up(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Sm(e){return tm(e)?e:e.contextElement}function Cm(e){let t=Sm(e);if(!nm(t))return fp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=xm(t),o=(a?up(n.width):n.width)/r,s=(a?up(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var wm=fp(0);function Tm(e){let t=Qp(e);return!pm()||!t.visualViewport?wm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Em(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qp(e)?!1:t}function Dm(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Sm(e),o=fp(1);t&&(r?tm(r)&&(o=Cm(r)):o=Cm(e));let s=Em(a,n,r)?Tm(a):fp(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){let e=Qp(a),t=r&&tm(r)?Qp(r):r,n=e,i=bm(n);for(;i&&r&&t!==n;){let e=Cm(i),t=i.getBoundingClientRect(),r=hm(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=Qp(i),i=bm(n)}}return Pp({width:u,height:d,x:c,y:l})}function Om(e,t){let n=gm(e).scrollLeft;return t?t.left+n:Dm($p(e)).left+n}function km(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Om(e,n),y:n.top+t.scrollTop}}function Am(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=$p(r),s=t?om(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=fp(1),u=fp(0),d=nm(r);if((d||!d&&!a)&&((Zp(r)!==`body`||im(o))&&(c=gm(r)),d)){let e=Dm(r);l=Cm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?km(o,c):fp(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 jm(e){return Array.from(e.getClientRects())}function Mm(e){let t=$p(e),n=gm(e),r=e.ownerDocument.body,i=lp(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=lp(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Om(e),s=-n.scrollTop;return hm(r).direction===`rtl`&&(o+=lp(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Nm=25;function Pm(e,t){let n=Qp(e),r=$p(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=pm();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Om(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Nm&&(a-=o)}else l<=Nm&&(a+=l);return{width:a,height:o,x:s,y:c}}function Fm(e,t){let n=Dm(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=nm(e)?Cm(e):fp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Im(e,t,n){let r;if(t===`viewport`)r=Pm(e,n);else if(t===`document`)r=Mm($p(e));else if(tm(t))r=Fm(t,n);else{let n=Tm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Pp(r)}function Lm(e,t){let n=_m(e);return n===t||!tm(n)||mm(n)?!1:hm(n).position===`fixed`||Lm(n,t)}function Rm(e,t){let n=t.get(e);if(n)return n;let r=ym(e,[],!1).filter(e=>tm(e)&&Zp(e)!==`body`),i=null,a=hm(e).position===`fixed`,o=a?_m(e):e;for(;tm(o)&&!mm(o);){let t=hm(o),n=dm(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||im(o)&&!n&&Lm(e,o))?r=r.filter(e=>e!==o):i=t,o=_m(o)}return t.set(e,r),r}function zm(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?om(t)?[]:Rm(t,this._c):[].concat(n),r],o=Im(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=Im(t,a[e],i);s=lp(n.top,s),c=cp(n.right,c),l=cp(n.bottom,l),u=lp(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Bm(e){let{width:t,height:n}=xm(e);return{width:t,height:n}}function Vm(e,t,n){let r=nm(t),i=$p(t),a=n===`fixed`,o=Dm(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=fp(0);function l(){c.x=Om(i)}if(r||!r&&!a)if((Zp(t)!==`body`||im(i))&&(s=gm(t)),r){let e=Dm(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?km(i,s):fp(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Hm(e){return hm(e).position===`static`}function Um(e,t){if(!nm(e)||hm(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return $p(e)===n&&(n=n.ownerDocument.body),n}function Wm(e,t){let n=Qp(e);if(om(e))return n;if(!nm(e)){let t=_m(e);for(;t&&!mm(t);){if(tm(t)&&!Hm(t))return t;t=_m(t)}return n}let r=Um(e,t);for(;r&&am(r)&&Hm(r);)r=Um(r,t);return r&&mm(r)&&Hm(r)&&!dm(r)?n:r||fm(e)||n}var Gm=async function(e){let t=this.getOffsetParent||Wm,n=this.getDimensions,r=await n(e.floating);return{reference:Vm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Km(e){return hm(e).direction===`rtl`}var qm={convertOffsetParentRelativeRectToViewportRelativeRect:Am,getDocumentElement:$p,getClippingRect:zm,getOffsetParent:Wm,getElementRects:Gm,getClientRects:jm,getDimensions:Bm,getScale:Cm,isElement:tm,isRTL:Km};function Jm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ym(e,t){let n=null,r,i=$p(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=dp(d),h=dp(i.clientWidth-(u+f)),g=dp(i.clientHeight-(d+p)),_=dp(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:lp(0,cp(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Jm(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Xm(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=Sm(e),u=i||a?[...l?ym(l):[],...t?ym(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ym(l,n):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?Dm(e):null;c&&g();function g(){let t=Dm(e);h&&!Jm(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 Zm=Kp,Qm=qp,$m=Bp,eh=Yp,th=Up,nh=zp,rh=Jp,ih=(e,t,n)=>{let r=new Map,i={platform:qm,...n},a={...i.platform,_c:r};return Rp(e,t,{...i,platform:a})},ah=typeof document<`u`?B.useLayoutEffect:function(){};function oh(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(!oh(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)&&!oh(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function sh(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ch(e,t){let n=sh(e);return Math.round(t*n)/n}function lh(e){let t=B.useRef(e);return ah(()=>{t.current=e}),t}function uh(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]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);oh(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),E=c!=null,D=lh(c),ee=lh(i),te=lh(l),ne=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),ih(S.current,C.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};re.current&&!oh(w.current,t)&&(w.current=t,Ru.flushSync(()=>{d(t)}))})},[f,t,n,ee,te]);ah(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let re=B.useRef(!1);ah(()=>(re.current=!0,()=>{re.current=!1}),[]),ah(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,ne);ne()}},[b,x,ne,D,E]);let O=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ie=B.useMemo(()=>({reference:b,floating:x}),[b,x]),ae=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!ie.floating)return e;let t=ch(ie.floating,u.x),r=ch(ie.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...sh(ie.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ie.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:ne,refs:O,elements:ie,floatingStyles:ae}),[u,ne,O,ie,ae])}var dh=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:nh({element:r.current,padding:i}).fn(n):r?nh({element:r,padding:i}).fn(n):{}}}},fh=(e,t)=>{let n=Zm(e);return{name:n.name,fn:n.fn,options:[e,t]}},ph=(e,t)=>{let n=Qm(e);return{name:n.name,fn:n.fn,options:[e,t]}},mh=(e,t)=>({fn:rh(e).fn,options:[e,t]}),hh=(e,t)=>{let n=$m(e);return{name:n.name,fn:n.fn,options:[e,t]}},gh=(e,t)=>{let n=eh(e);return{name:n.name,fn:n.fn,options:[e,t]}},_h=(e,t)=>{let n=th(e);return{name:n.name,fn:n.fn,options:[e,t]}},vh=(e,t)=>{let n=dh(e);return{name:n.name,fn:n.fn,options:[e,t]}},yh=`Arrow`,bh=B.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,z.jsx)(zu.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,z.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});bh.displayName=yh;var xh=bh,Sh=`Popper`,[Ch,wh]=Vu(Sh),[Th,Eh]=Ch(Sh),Dh=e=>{let{__scopePopper:t,children:n}=e,[r,i]=B.useState(null),[a,o]=B.useState(void 0);return(0,z.jsx)(Th,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Dh.displayName=Sh;var Oh=`PopperAnchor`,kh=B.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Eh(Oh,n),o=B.useRef(null),s=a.onAnchorChange,c=wu(t,B.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=B.useRef(null);B.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&zh(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,z.jsx)(zu.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});kh.displayName=Oh;var Ah=`PopperContent`,[jh,Mh]=Ch(Ah),Nh=B.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l,collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Eh(Ah,n),[_,v]=B.useState(null),y=wu(t,e=>v(e)),[b,x]=B.useState(null),S=op(b),C=S?.width??0,w=S?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=l?Array.isArray(l)?l:[l]:void 0,te=ee!==void 0&&ee.length>0,ne={padding:D,boundary:ee?.filter(Lh),altBoundary:te},{refs:re,floatingStyles:O,placement:ie,isPositioned:ae,middlewareData:k}=uh({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>Xm(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[fh({mainAxis:i+w,alignmentAxis:o}),c&&ph({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?mh():void 0,...ne}),c&&hh({...ne}),gh({...ne,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&vh({element:b,padding:s}),Rh({arrowWidth:C,arrowHeight:w}),f&&_h({strategy:`referenceHidden`,...ne})]}),A=g.setPlacementState;Wu(()=>(A(ie),()=>{A(void 0)}),[ie,A]);let[oe,se]=zh(ie),ce=od(m);Wu(()=>{ae&&ce?.()},[ae,ce]);let le=k.arrow?.x,ue=k.arrow?.y,j=k.arrow?.centerOffset!==0,[de,fe]=B.useState();return Wu(()=>{_&&fe(window.getComputedStyle(_).zIndex)},[_]),(0,z.jsx)(`div`,{ref:re.setFloating,"data-radix-popper-content-wrapper":``,style:{...O,transform:ae?O.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:de,"--radix-popper-transform-origin":[k.transformOrigin?.x,k.transformOrigin?.y].join(` `),...k.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(jh,{scope:n,placedSide:oe,placedAlign:se,onArrowChange:x,arrowX:le,arrowY:ue,shouldHideArrow:j,children:(0,z.jsx)(zu.div,{"data-side":oe,"data-align":se,...h,ref:y,style:{...h.style,animation:ae?void 0:`none`}})})})});Nh.displayName=Ah;var Ph=`PopperArrow`,Fh={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ih=B.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Mh(Ph,n),a=Fh[i.placedSide];return(0,z.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,z.jsx)(xh,{...r,ref:t,style:{...r.style,display:`block`}})})});Ih.displayName=Ph;function Lh(e){return e!==null}var Rh=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=zh(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function zh(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Bh=Dh,Vh=kh,Hh=Nh,Uh=Ih,Wh=`rovingFocusGroup.onEntryFocus`,Gh={bubbles:!1,cancelable:!0},Kh=`RovingFocusGroup`,[qh,Jh,Yh]=Uu(Kh),[Xh,Zh]=Vu(Kh,[Yh]),[Qh,$h]=Xh(Kh),eg=B.forwardRef((e,t)=>(0,z.jsx)(qh.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(qh.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(tg,{...e,ref:t})})}));eg.displayName=Kh;var tg=B.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=B.useRef(null),p=wu(t,f),m=ad(a),[h,g]=Gu({prop:o,defaultProp:s??null,onChange:c,caller:Kh}),[_,v]=B.useState(!1),y=od(l),b=Jh(n),x=B.useRef(!1),[S,C]=B.useState(0);return B.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Wh,y),()=>e.removeEventListener(Wh,y)},[y]),(0,z.jsx)(Qh,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:B.useCallback(e=>g(e),[g]),onItemShiftTab:B.useCallback(()=>v(!0),[]),onFocusableItemAdd:B.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:B.useCallback(()=>C(e=>e-1),[]),children:(0,z.jsx)(zu.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:X(e.onMouseDown,()=>{x.current=!0}),onFocus:X(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Wh,Gh);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);sg([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:X(e.onBlur,()=>v(!1))})})}),ng=`RovingFocusGroupItem`,rg=B.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=rd(),l=a||c,u=$h(ng,n),d=u.currentTabStopId===l,f=Jh(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return B.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,z.jsx)(qh.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,z.jsx)(zu.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:X(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:X(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:X(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=og(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?cg(n,r+1):n.slice(r+1)}setTimeout(()=>sg(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});rg.displayName=ng;var ig={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ag(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function og(e,t,n){let r=ag(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ig[r]}function sg(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function cg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var lg=eg,ug=rg,dg=[`Enter`,` `],fg=[`ArrowDown`,`PageUp`,`Home`],pg=[`ArrowUp`,`PageDown`,`End`],mg=[...fg,...pg],hg={ltr:[...dg,`ArrowRight`],rtl:[...dg,`ArrowLeft`]},gg={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},_g=`Menu`,[vg,yg,bg]=Uu(_g),[xg,Sg]=Vu(_g,[bg,wh,Zh]),Cg=wh(),wg=Zh(),[Tg,Eg]=xg(_g),[Dg,Og]=xg(_g),kg=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Cg(t),[c,l]=B.useState(null),u=B.useRef(!1),d=od(a),f=ad(i);return B.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,z.jsx)(Bh,{...s,children:(0,z.jsx)(Tg,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,z.jsx)(Dg,{scope:t,onClose:B.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};kg.displayName=_g;var Ag=`MenuAnchor`,jg=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Cg(n);return(0,z.jsx)(Vh,{...i,...r,ref:t})});jg.displayName=Ag;var Mg=`MenuPortal`,[Ng,Pg]=xg(Mg,{forceMount:void 0}),Fg=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Eg(Mg,t);return(0,z.jsx)(Ng,{scope:t,forceMount:n,children:(0,z.jsx)(Yu,{present:n||a.open,children:(0,z.jsx)(Id,{asChild:!0,container:i,children:r})})})};Fg.displayName=Mg;var Ig=`MenuContent`,[Lg,Rg]=xg(Ig),zg=B.forwardRef((e,t)=>{let n=Pg(Ig,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Eg(Ig,e.__scopeMenu),o=Og(Ig,e.__scopeMenu);return(0,z.jsx)(vg.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(Yu,{present:r||a.open,children:(0,z.jsx)(vg.Slot,{scope:e.__scopeMenu,children:o.modal?(0,z.jsx)(Bg,{...i,ref:t}):(0,z.jsx)(Vg,{...i,ref:t})})})})}),Bg=B.forwardRef((e,t)=>{let n=Eg(Ig,e.__scopeMenu),r=B.useRef(null),i=wu(t,r);return B.useEffect(()=>{let e=r.current;if(e)return ap(e)},[]),(0,z.jsx)(Ug,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Vg=B.forwardRef((e,t)=>{let n=Eg(Ig,e.__scopeMenu);return(0,z.jsx)(Ug,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Hg=Tu(`MenuContent.ScrollLock`),Ug=B.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Eg(Ig,n),_=Og(Ig,n),v=Cg(n),y=wg(n),b=yg(n),[x,S]=B.useState(null),C=B.useRef(null),w=wu(t,C,g.onContentChange),E=B.useRef(0),D=B.useRef(``),ee=B.useRef(0),te=B.useRef(null),ne=B.useRef(`right`),re=B.useRef(0),O=m?Xf:B.Fragment,ie=m?{as:Hg,allowPinchZoom:!0}:void 0,ae=e=>{let t=D.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=D_(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};B.useEffect(()=>()=>window.clearTimeout(E.current),[]),zd();let k=B.useCallback(e=>ne.current===te.current?.side&&k_(e,te.current?.area),[]);return(0,z.jsx)(Lg,{scope:n,searchRef:D,onItemEnter:B.useCallback(e=>{k(e)&&e.preventDefault()},[k]),onItemLeave:B.useCallback(e=>{k(e)||(C.current?.focus(),S(null))},[k]),onTriggerLeave:B.useCallback(e=>{k(e)&&e.preventDefault()},[k]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:B.useCallback(e=>{te.current=e},[]),children:(0,z.jsx)(O,{...ie,children:(0,z.jsx)(wd,{asChild:!0,trapped:i,onMountAutoFocus:X(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,z.jsx)(md,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,z.jsx)(lg,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:X(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,z.jsx)(Hh,{role:`menu`,"aria-orientation":`vertical`,"data-state":S_(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:X(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ae(e.key));let i=C.current;if(e.target!==i||!mg.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);pg.includes(e.key)&&a.reverse(),T_(a)}),onBlur:X(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:X(e.onPointerMove,A_(e=>{let t=e.target,n=re.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ne.current=e.clientX>re.current?`right`:`left`,re.current=e.clientX)}))})})})})})})});zg.displayName=Ig;var Wg=`MenuGroup`,Gg=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(zu.div,{role:`group`,...r,ref:t})});Gg.displayName=Wg;var Kg=`MenuLabel`,qg=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(zu.div,{...r,ref:t})});qg.displayName=Kg;var Jg=`MenuItem`,Yg=`menu.itemSelect`,Xg=B.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=B.useRef(null),o=Og(Jg,e.__scopeMenu),s=Rg(Jg,e.__scopeMenu),c=wu(t,a),l=B.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Yg,{bubbles:!0,cancelable:!0});e.addEventListener(Yg,e=>r?.(e),{once:!0}),Bu(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,z.jsx)(Zg,{...i,ref:c,disabled:n,onClick:X(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:X(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:X(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||dg.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Xg.displayName=Jg;var Zg=B.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Rg(Jg,n),s=wg(n),c=B.useRef(null),l=wu(t,c),[u,d]=B.useState(!1),[f,p]=B.useState(``);return B.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,z.jsx)(vg.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,z.jsx)(ug,{asChild:!0,...s,focusable:!r,children:(0,z.jsx)(zu.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:X(e.onPointerMove,A_(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:X(e.onPointerLeave,A_(e=>o.onItemLeave(e))),onFocus:X(e.onFocus,()=>d(!0)),onBlur:X(e.onBlur,()=>d(!1))})})})}),Qg=`MenuCheckboxItem`,$g=B.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,z.jsx)(s_,{scope:e.__scopeMenu,checked:n,children:(0,z.jsx)(Xg,{role:`menuitemcheckbox`,"aria-checked":C_(n)?`mixed`:n,...i,ref:t,"data-state":w_(n),onSelect:X(i.onSelect,()=>r?.(C_(n)?!0:!n),{checkForDefaultPrevented:!1})})})});$g.displayName=Qg;var e_=`MenuRadioGroup`,[t_,n_]=xg(e_,{value:void 0,onValueChange:()=>{}}),r_=B.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=od(r);return(0,z.jsx)(t_,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,z.jsx)(Gg,{...i,ref:t})})});r_.displayName=e_;var i_=`MenuRadioItem`,a_=B.forwardRef((e,t)=>{let{value:n,...r}=e,i=n_(i_,e.__scopeMenu),a=n===i.value;return(0,z.jsx)(s_,{scope:e.__scopeMenu,checked:a,children:(0,z.jsx)(Xg,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":w_(a),onSelect:X(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});a_.displayName=i_;var o_=`MenuItemIndicator`,[s_,c_]=xg(o_,{checked:!1}),l_=B.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=c_(o_,n);return(0,z.jsx)(Yu,{present:r||C_(a.checked)||a.checked===!0,children:(0,z.jsx)(zu.span,{...i,ref:t,"data-state":w_(a.checked)})})});l_.displayName=o_;var u_=`MenuSeparator`,d_=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(zu.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});d_.displayName=u_;var f_=`MenuArrow`,p_=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Cg(n);return(0,z.jsx)(Uh,{...i,...r,ref:t})});p_.displayName=f_;var m_=`MenuSub`,[h_,g_]=xg(m_),__=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Eg(m_,t),o=Cg(t),[s,c]=B.useState(null),[l,u]=B.useState(null),d=od(i);return B.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,z.jsx)(Bh,{...o,children:(0,z.jsx)(Tg,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,z.jsx)(h_,{scope:t,contentId:rd(),triggerId:rd(),trigger:s,onTriggerChange:c,children:n})})})};__.displayName=m_;var v_=`MenuSubTrigger`,y_=B.forwardRef((e,t)=>{let n=Eg(v_,e.__scopeMenu),r=Og(v_,e.__scopeMenu),i=g_(v_,e.__scopeMenu),a=Rg(v_,e.__scopeMenu),o=B.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=B.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return B.useEffect(()=>u,[u]),B.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,z.jsx)(jg,{asChild:!0,...l,children:(0,z.jsx)(Zg,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":S_(n.open),...e,ref:Cu(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:X(e.onPointerMove,A_(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:X(e.onPointerLeave,A_(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:X(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||hg[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});y_.displayName=v_;var b_=`MenuSubContent`,x_=B.forwardRef((e,t)=>{let n=Pg(Ig,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Eg(Ig,e.__scopeMenu),s=Og(Ig,e.__scopeMenu),c=g_(b_,e.__scopeMenu),l=B.useRef(null),u=wu(t,l);return(0,z.jsx)(vg.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(Yu,{present:r||o.open,children:(0,z.jsx)(vg.Slot,{scope:e.__scopeMenu,children:(0,z.jsx)(Ug,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:X(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:X(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:X(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=gg[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});x_.displayName=b_;function S_(e){return e?`open`:`closed`}function C_(e){return e===`indeterminate`}function w_(e){return C_(e)?`indeterminate`:e?`checked`:`unchecked`}function T_(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function E_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function D_(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=E_(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function O_(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function k_(e,t){return t?O_({x:e.clientX,y:e.clientY},t):!1}function A_(e){return t=>t.pointerType===`mouse`?e(t):void 0}var j_=kg,M_=jg,N_=Fg,P_=zg,F_=Gg,I_=qg,L_=Xg,R_=$g,z_=r_,B_=a_,V_=l_,H_=d_,U_=p_,W_=y_,G_=x_,K_=`DropdownMenu`,[q_,J_]=Vu(K_,[Sg]),Y_=Sg(),[X_,Z_]=q_(K_),Q_=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Y_(t),l=B.useRef(null),[u,d]=Gu({prop:i,defaultProp:a??!1,onChange:o,caller:K_});return(0,z.jsx)(X_,{scope:t,triggerId:rd(),triggerRef:l,contentId:rd(),open:u,onOpenChange:d,onOpenToggle:B.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,z.jsx)(j_,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Q_.displayName=K_;var $_=`DropdownMenuTrigger`,ev=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Z_($_,n),o=Y_(n);return(0,z.jsx)(M_,{asChild:!0,...o,children:(0,z.jsx)(zu.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:Cu(t,a.triggerRef),onPointerDown:X(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:X(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});ev.displayName=$_;var tv=`DropdownMenuPortal`,nv=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Y_(t);return(0,z.jsx)(N_,{...r,...n})};nv.displayName=tv;var rv=`DropdownMenuContent`,iv=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z_(rv,n),a=Y_(n),o=B.useRef(!1);return(0,z.jsx)(P_,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:X(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});iv.displayName=rv;var av=`DropdownMenuGroup`,ov=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(F_,{...i,...r,ref:t})});ov.displayName=av;var sv=`DropdownMenuLabel`,cv=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(I_,{...i,...r,ref:t})});cv.displayName=sv;var lv=`DropdownMenuItem`,uv=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(L_,{...i,...r,ref:t})});uv.displayName=lv;var dv=`DropdownMenuCheckboxItem`,fv=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(R_,{...i,...r,ref:t})});fv.displayName=dv;var pv=`DropdownMenuRadioGroup`,mv=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(z_,{...i,...r,ref:t})});mv.displayName=pv;var hv=`DropdownMenuRadioItem`,gv=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(B_,{...i,...r,ref:t})});gv.displayName=hv;var _v=`DropdownMenuItemIndicator`,vv=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(V_,{...i,...r,ref:t})});vv.displayName=_v;var yv=`DropdownMenuSeparator`,bv=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(H_,{...i,...r,ref:t})});bv.displayName=yv;var xv=`DropdownMenuArrow`,Sv=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(U_,{...i,...r,ref:t})});Sv.displayName=xv;var Cv=`DropdownMenuSubTrigger`,wv=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(W_,{...i,...r,ref:t})});wv.displayName=Cv;var Tv=`DropdownMenuSubContent`,Ev=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Y_(n);return(0,z.jsx)(G_,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Ev.displayName=Tv;var Dv=Q_,Ov=ev,kv=nv,Av=iv,jv=cv,Mv=uv,Nv=bv,Pv=xu(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Fv({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,z.jsx)(r?Eu:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:xe(Pv({variant:t,size:n,className:e})),...i})}var Iv=`flakes.console.theme`;function Lv(e){document.documentElement.classList.toggle(`dark`,e===`dark`)}function Rv(){let e=window.localStorage.getItem(Iv)===`light`?`light`:`dark`;return Lv(e),e}function zv(){return document.documentElement.classList.contains(`dark`)?`dark`:`light`}function Bv(e){let t=e===`dark`?`light`:`dark`;return window.localStorage.setItem(Iv,t),Lv(t),t}function Vv(){let[e,t]=(0,B.useState)(()=>zv());return(0,z.jsx)(Fv,{variant:`ghost`,size:`icon`,"aria-label":`Toggle theme`,onClick:()=>t(Bv(e)),children:e===`dark`?(0,z.jsx)(sl,{className:`size-4`}):(0,z.jsx)(nl,{className:`size-4`})})}function Hv({...e}){return(0,z.jsx)(Dv,{"data-slot":`dropdown-menu`,...e})}function Uv({...e}){return(0,z.jsx)(Ov,{"data-slot":`dropdown-menu-trigger`,...e})}function Wv({className:e,sideOffset:t=4,...n}){return(0,z.jsx)(kv,{children:(0,z.jsx)(Av,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:xe(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function Gv({className:e,inset:t,variant:n=`default`,...r}){return(0,z.jsx)(Mv,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:xe(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Kv({className:e,inset:t,...n}){return(0,z.jsx)(jv,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:xe(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function qv({className:e,...t}){return(0,z.jsx)(Nv,{"data-slot":`dropdown-menu-separator`,className:xe(`-mx-1 my-1 h-px bg-border`,e),...t})}function Jv(e){let t=[],n=[];for(let r of e)r.status===`archived`?n.push(r):t.push(r);return{active:$v(t),archived:$v(n)}}function Yv(e,t){let n=new Map(e.map(e=>[e.projectId,e])),r=new Map(e.map(e=>[e.projectKey,e])),i=new Map,a=new Map,o=[];for(let e of t){let t=Qv(e,n,r);if(t!==null){let n=i.get(t.projectId)??[];n.push(e),i.set(t.projectId,n);continue}let s=e.projectId??e.projectKey;if(s!==void 0&&s.length>0){let t=`unknown:${s}`,n=a.get(t)??{id:t,label:e.projectKey??e.projectId??`Unknown project`,project:null,runs:[]};n.runs.push(e),a.set(t,n);continue}o.push(e)}let s=[],{active:c,archived:l}=Jv(e);for(let e of[...c,...l]){let t=i.get(e.projectId);t!==void 0&&t.length>0&&s.push({id:`project:${e.projectId}`,label:e.name,project:e,runs:t})}return s.push(...[...a.values()].sort((e,t)=>e.label.localeCompare(t.label))),o.length>0&&s.push({id:`inbox`,label:`Inbox`,project:null,runs:o}),s}function Xv(e,t){return t.projectId===void 0?t.projectKey===e.projectKey:t.projectId===e.projectId}function Zv(e,t){let n=Qv(t,new Map(e.map(e=>[e.projectId,e])),new Map(e.map(e=>[e.projectKey,e])));return n===null?t.projectKey??t.projectId:`${n.name} (${n.projectKey})`}function Qv(e,t,n){return e.projectId===void 0?e.projectKey===void 0?null:n.get(e.projectKey)??null:t.get(e.projectId)??null}function $v(e){return e.sort((e,t)=>e.projectKey.localeCompare(t.projectKey))}var ey=`flakes.console.sidebar`;function ty(e){let t=jo(),n=ly(`(max-width: 767px)`),[r,i]=(0,B.useState)(()=>window.localStorage.getItem(ey)===`collapsed`),a=r||n,o=()=>{let e=!r;i(e),window.localStorage.setItem(ey,e?`collapsed`:`open`)},s=cy();return(0,z.jsxs)(`div`,{className:`flex h-screen overflow-hidden transition-opacity duration-300 starting:opacity-0`,children:[(0,z.jsxs)(`aside`,{className:xe(`flex shrink-0 flex-col border-r bg-sidebar text-sidebar-foreground transition-[width]`,a?`w-14`:`w-[17rem]`),children:[(0,z.jsxs)(`div`,{className:`flex h-14 items-center gap-1.5 border-b border-sidebar-border px-2`,children:[a?(0,z.jsx)(O,{to:`/runs`,"aria-label":`Flakes runs`,className:`mx-auto rounded-md p-1.5 transition-colors hover:bg-sidebar-accent/40`,children:(0,z.jsx)(_u,{className:`size-[18px]`})}):(0,z.jsx)(O,{to:`/runs`,className:`flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-2 transition-colors hover:bg-sidebar-accent/40`,children:(0,z.jsx)(vu,{})}),a?null:(0,z.jsx)(Fv,{variant:`ghost`,size:`icon-sm`,className:`shrink-0`,"aria-label":`Collapse sidebar`,onClick:o,children:(0,z.jsx)(rl,{className:`size-4`})})]}),r&&!n?(0,z.jsx)(`div`,{className:`flex justify-center py-1.5`,children:(0,z.jsx)(Fv,{variant:`ghost`,size:`icon-sm`,"aria-label":`Expand sidebar`,onClick:o,children:(0,z.jsx)(rl,{className:`size-4`})})}):null,(0,z.jsx)(ry,{collapsed:a,pathname:t.pathname}),a?(0,z.jsx)(`div`,{className:`flex-1`}):(0,z.jsx)(py,{}),(0,z.jsx)(ny,{collapsed:a,pathname:t.pathname})]}),(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,z.jsxs)(`header`,{className:`relative flex h-14 shrink-0 items-center gap-3 overflow-x-clip border-b px-5`,children:[(0,z.jsx)(`div`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:(0,z.jsx)(sy,{pathname:t.pathname})}),(0,z.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,z.jsx)(uy,{}),(0,z.jsx)(fy,{state:e.connection,pollKey:s}),(0,z.jsx)(Vv,{}),(0,z.jsxs)(Hv,{children:[(0,z.jsx)(Uv,{asChild:!0,children:(0,z.jsx)(Fv,{variant:`ghost`,size:`icon`,"aria-label":`Account menu`,children:(0,z.jsx)(iy,{user:e.user})})}),(0,z.jsxs)(Wv,{align:`end`,className:`w-64`,children:[(0,z.jsxs)(Kv,{className:`flex min-w-0 items-center gap-3`,children:[(0,z.jsx)(iy,{user:e.user}),(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{className:`block truncate font-medium`,children:ay(e.user)}),(0,z.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground`,children:e.user.email??`No email recorded`})]})]}),(0,z.jsx)(qv,{}),(0,z.jsx)(Gv,{asChild:!0,children:(0,z.jsxs)(O,{to:`/account`,children:[(0,z.jsx)(ll,{className:`size-4`}),` Account`]})}),(0,z.jsx)(Gv,{asChild:!0,children:(0,z.jsxs)(O,{to:`/account/security`,children:[(0,z.jsx)(ol,{className:`size-4`}),` Security`]})}),(0,z.jsx)(qv,{}),(0,z.jsxs)(Gv,{variant:`destructive`,onClick:e.onSignOut,children:[(0,z.jsx)(tl,{className:`size-4`}),` Sign out`]})]})]})]}),s>0&&(0,z.jsx)(`div`,{className:`animate-sweep`},s)]}),(0,z.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,z.jsx)(`div`,{className:`mx-auto max-w-6xl p-6`,children:e.children})})]})]})}function ny(e){let t=e.pathname.startsWith(`/documentation`);return(0,z.jsx)(`div`,{className:xe(`border-t border-sidebar-border p-2`,e.collapsed&&`grid justify-items-center`),children:(0,z.jsxs)(O,{to:`/documentation`,"aria-label":e.collapsed?`Documentation`:void 0,title:e.collapsed?`Documentation`:void 0,className:xe(`flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,e.collapsed&&`size-9 justify-center px-0`,t?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-muted-foreground hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground`),children:[(0,z.jsx)(Xc,{className:`size-4 shrink-0`,"aria-hidden":`true`}),e.collapsed?null:(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{className:`block truncate font-medium`,children:`Documentation`}),(0,z.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground`,children:`Guides and reference`})]})]})})}function ry(e){let t=[{to:`/runs`,label:`Runs`,detail:`Task runs`,icon:$c,active:e.pathname===`/`||e.pathname.startsWith(`/runs`)},{to:`/projects`,label:`Projects`,detail:`Project runs`,icon:Zc,active:e.pathname.startsWith(`/projects`)},{to:`/sandboxes`,label:`Sandboxes`,detail:`Run task placement`,icon:al,active:e.pathname.startsWith(`/sandboxes`)}];return(0,z.jsx)(`nav`,{"aria-label":`Console sections`,className:xe(`grid gap-1 border-b border-sidebar-border p-2`,e.collapsed&&`justify-items-center`),children:t.map(t=>{let n=t.icon;return(0,z.jsxs)(O,{to:t.to,"aria-label":e.collapsed?t.label:void 0,title:e.collapsed?t.label:void 0,className:xe(`flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,e.collapsed&&`size-9 justify-center px-0`,t.active?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-muted-foreground hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground`),children:[(0,z.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":`true`}),e.collapsed?null:(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{className:`block truncate font-medium`,children:t.label}),(0,z.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground`,children:t.detail})]})]},t.to)})})}function iy(e){return e.user.image?(0,z.jsx)(`img`,{src:e.user.image,alt:``,referrerPolicy:`no-referrer`,className:`size-6 rounded-full border object-cover`}):(0,z.jsx)(`span`,{className:`inline-flex size-6 items-center justify-center rounded-full border bg-muted font-mono text-[10px] text-muted-foreground`,children:oy(e.user)})}function ay(e){let t=e.name?.trim();return t&&t.length>0?t:e.email??`Flakes user`}function oy(e){let t=ay(e),n=t.split(/[\s@._-]+/).filter(Boolean);return(n.length>1?`${n[0]?.[0]??``}${n[1]?.[0]??``}`:t.slice(0,2)).toUpperCase()}function sy(e){let t=e.pathname.split(`/`).filter(Boolean);if(t[0]===`account`)return t[1]===`security`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(O,{to:`/account`,className:`hover:text-foreground`,children:`Account`}),` / `,(0,z.jsx)(`span`,{className:`text-foreground`,children:`Security`})]}):(0,z.jsx)(`span`,{className:`text-foreground`,children:`Account`});if(t[0]===`documentation`)return(0,z.jsx)(`span`,{className:`text-foreground`,children:`Documentation`});if(t[0]===`projects`)return(0,z.jsx)(`span`,{className:`text-foreground`,children:`Projects`});if(t[0]===`sandboxes`)return(0,z.jsx)(`span`,{className:`text-foreground`,children:`Sandboxes`});let n=t[0]===`runs`?t[1]:void 0;if(n===void 0)return(0,z.jsx)(`span`,{className:`text-foreground`,children:`Runs`});let r=t[2]===`t`?t[3]:void 0;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(O,{to:`/runs`,className:`hover:text-foreground`,children:`Runs`}),` / `,r===void 0?(0,z.jsx)(`span`,{className:`text-foreground`,children:n}):(0,z.jsx)(O,{to:`/runs/$runId`,params:{runId:n},className:`hover:text-foreground`,children:n}),r===void 0?null:(0,z.jsxs)(z.Fragment,{children:[` / `,(0,z.jsx)(`span`,{className:`text-foreground`,children:r})]})]})}function cy(){let e=Kc(),t=(0,B.useRef)(!1),[n,r]=(0,B.useState)(0);return(0,B.useEffect)(()=>{t.current&&e===0&&r(e=>e+1),t.current=e>0},[e]),n}function ly(e){let[t,n]=(0,B.useState)(()=>typeof window>`u`?!1:window.matchMedia(e).matches);return(0,B.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function uy(){let[e,t]=(0,B.useState)(()=>new Date);return(0,B.useEffect)(()=>{let e=setInterval(()=>t(new Date),1e3);return()=>clearInterval(e)},[]),(0,z.jsx)(`span`,{"data-num":!0,className:`font-mono text-xs text-muted-foreground`,children:`${e.toISOString().slice(11,19)}Z`})}var dy={ok:{dot:`bg-primary`,label:`CONNECTED`},degraded:{dot:`bg-status-warn`,label:`DEGRADED`},error:{dot:`bg-status-failed`,label:`UNREACHABLE`},pending:{dot:`bg-status-idle animate-pulse`,label:`CONNECTING`}};function fy(e){let t=dy[e.state];return(0,z.jsxs)(`span`,{className:xe(`flex items-center gap-1.5 rounded-full border px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground`,e.state===`degraded`&&`text-status-warn`,e.state===`error`&&`text-status-failed`),children:[(0,z.jsxs)(`span`,{className:`relative size-1.5`,children:[(0,z.jsx)(`span`,{className:xe(`absolute inset-0 rounded-full`,t.dot)}),e.state===`ok`&&e.pollKey>0&&(0,z.jsx)(`span`,{className:`blip absolute inset-0 rounded-full border border-primary`},e.pollKey)]}),t.label]})}function py(){let[e,t]=(0,B.useState)(!1),n=ql(),r=Jl(),i=(n.data?.pages??[]).flatMap(e=>e.runs),a=r.data?.projects??[],o=Yv(a,i);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(my,{projects:a,loading:r.isPending&&r.data===void 0,error:r.isError&&r.data===void 0?String(r.error):null}),(0,z.jsx)(`div`,{className:`border-b border-sidebar-border p-2`,children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(!0),className:`flex h-8 w-full items-center gap-2 rounded-md border border-sidebar-border bg-background/70 px-2.5 text-left text-sm text-muted-foreground transition-colors hover:bg-sidebar-accent/40 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,children:[(0,z.jsx)(il,{className:`size-3.5 shrink-0`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Search runs`}),(0,z.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:`⌘K`})]})}),(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:i.length===0?(0,z.jsx)(`div`,{className:`px-1 py-2 text-xs text-muted-foreground`,children:n.isPending?`Loading sessions…`:`No sessions yet.`}):o.map(e=>(0,z.jsx)(hy,{group:e},e.id))}),(0,z.jsx)(gy,{open:e,runs:i,projects:a,onOpenChange:t})]})}function my(e){let{active:t}=Jv(e.projects);return(0,z.jsxs)(`div`,{className:`border-b border-sidebar-border px-2 py-2`,children:[(0,z.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2 px-2`,children:[(0,z.jsx)(`span`,{className:`console-callout truncate`,children:`Active projects`}),(0,z.jsx)(O,{to:`/projects`,className:`font-mono text-[10px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:text-foreground`,children:`View`})]}),e.loading?(0,z.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`Loading projects…`}):e.error===null?t.length===0?(0,z.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`No active projects.`}):(0,z.jsx)(`div`,{className:`grid gap-0.5`,children:t.map(e=>(0,z.jsxs)(O,{to:`/runs`,search:{project:e.projectKey},title:e.name,className:`flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,children:[(0,z.jsx)(Qc,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate font-medium`,children:e.name}),(0,z.jsx)(`span`,{className:`block truncate font-mono text-[10px] text-muted-foreground`,children:e.projectKey})]})]},e.projectId))}):(0,z.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-status-failed`,children:`Projects unavailable`})]})}function hy(e){let t=e.group.project?.status===`archived`;return(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 px-2 pt-1 pb-1.5`,children:[(0,z.jsx)(`span`,{className:`console-callout min-w-0 flex-1 truncate`,children:e.group.label}),t?(0,z.jsxs)(`span`,{title:`Archived project`,className:`inline-flex shrink-0 items-center gap-1 rounded border border-sidebar-border px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,z.jsx)(Yc,{className:`size-3`,"aria-hidden":`true`}),`Archived`]}):null]}),(0,z.jsx)(`div`,{className:`grid gap-0.5`,children:e.group.runs.map(e=>(0,z.jsx)(_y,{run:e},e.runId))})]})}function gy(e){let t=oo(),n=(0,B.useRef)(null),[r,i]=(0,B.useState)(``);if((0,B.useEffect)(()=>{if(!e.open){i(``);return}let t=requestAnimationFrame(()=>n.current?.focus());function r(t){t.key===`Escape`&&e.onOpenChange(!1)}return window.addEventListener(`keydown`,r),()=>{cancelAnimationFrame(t),window.removeEventListener(`keydown`,r)}},[e.open,e.onOpenChange]),(0,B.useEffect)(()=>{function t(t){(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e.onOpenChange(!0))}return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.onOpenChange]),!e.open)return null;let a=vy(e.runs,e.projects,r).slice(0,12);return(0,z.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background/65 p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":`Search runs`,onMouseDown:t=>{t.target===t.currentTarget&&e.onOpenChange(!1)},children:(0,z.jsxs)(`div`,{className:`mx-auto mt-[12vh] w-full max-w-xl overflow-hidden rounded-lg border bg-popover shadow-2xl`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,z.jsx)(il,{className:`size-4 shrink-0 text-muted-foreground`}),(0,z.jsx)(`input`,{ref:n,value:r,onChange:e=>i(e.currentTarget.value),name:`run-search-dialog`,placeholder:`Search runs`,"aria-label":`Search runs`,autoComplete:`off`,className:`h-10 min-w-0 flex-1 bg-transparent text-base outline-none placeholder:text-muted-foreground`}),(0,z.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`ESC`})]}),(0,z.jsx)(`div`,{className:`max-h-[26rem] overflow-y-auto p-2`,children:a.length===0?(0,z.jsx)(`div`,{className:`px-3 py-8 text-center text-sm text-muted-foreground`,children:`No matching runs.`}):(0,z.jsx)(`div`,{className:`grid gap-1`,children:a.map(n=>(0,z.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-start gap-2 rounded-md px-3 py-2 text-left transition-colors hover:bg-accent focus-visible:bg-accent focus-visible:outline-none`,onClick:()=>{e.onOpenChange(!1),t({to:`/runs/$runId`,params:{runId:n.runId}})},children:[(0,z.jsx)(`span`,{className:xe(`mt-1.5 size-1.5 shrink-0 rounded-full`,Sy(n.state))}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:n.name}),(0,z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-muted-foreground`,children:[(0,z.jsx)(`span`,{className:`truncate`,children:n.state.toLowerCase()}),(0,z.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,z.jsx)(`span`,{"data-num":!0,children:yy(n)}),(0,z.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,z.jsx)(`span`,{className:`truncate`,children:n.runId})]})]})]},n.runId))})})]})})}function _y(e){let t=jo(),n=oo(),r=su(),i=t.pathname.startsWith(`/runs/${e.run.runId}`),a=xy.has(e.run.state);async function o(){if(window.confirm(`Delete "${e.run.name}" from run history?`))try{await r.mutateAsync(e.run.runId),i&&n({to:`/runs`})}catch(e){window.alert(e instanceof Error?e.message:`Failed to delete run`)}}return(0,z.jsxs)(`div`,{className:xe(`group flex items-center rounded-md transition-colors`,i?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-muted-foreground hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground`),children:[(0,z.jsxs)(O,{to:`/runs/$runId`,params:{runId:e.run.runId},title:e.run.name,className:`flex min-w-0 flex-1 items-start gap-2 px-2 py-2 text-sm`,children:[(0,z.jsx)(`span`,{className:xe(`mt-1.5 size-1.5 shrink-0 rounded-full`,Sy(e.run.state))}),(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{className:`block truncate font-medium leading-5`,children:e.run.name}),(0,z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-muted-foreground`,children:[(0,z.jsx)(`span`,{className:`truncate`,children:e.run.state.toLowerCase()}),(0,z.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,z.jsx)(`span`,{"data-num":!0,children:yy(e.run)}),(0,z.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,z.jsx)(`span`,{title:e.run.updatedAt,children:by(e.run)})]})]})]}),a?(0,z.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.run.name}`,title:`Delete run`,disabled:r.isPending,onClick:()=>{o()},className:xe(`mr-1 rounded p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-destructive/10 hover:text-destructive focus:opacity-100 group-hover:opacity-100`,r.isPending&&`cursor-not-allowed opacity-50`),children:(0,z.jsx)(cl,{className:`size-3.5`})}):null]})}function vy(e,t,n){let r=n.trim().toLowerCase();return r.length===0?e:e.filter(e=>[e.name,e.runId,e.state,Zv(t,e)].some(e=>e?.toLowerCase().includes(r)))}function yy(e){let t=e.taskStatusCounts;if(t===void 0)return`—`;let n=Object.values(t).reduce((e,t)=>e+t,0),r=(t.SUCCEEDED??0)+(t.FAILED??0)+(t.CANCELLED??0);return n===0?`0/0`:`${r}/${n}`}function by(e){let t=e.updatedAt,n=Date.now()-Date.parse(t);if(!Number.isFinite(n)||n<0)return`now`;let r=Math.floor(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60);if(i<60)return`${i}m`;let a=Math.floor(i/60);return a<48?`${a}h`:`${Math.floor(a/24)}d`}var xy=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`,`STALLED`]);function Sy(e){switch(e.toLowerCase()){case`running`:return`bg-status-running`;case`succeeded`:return`bg-status-succeeded`;case`failed`:return`bg-status-failed`;case`cancelled`:case`stalled`:return`bg-status-warn`;case`blocked`:return`bg-status-blocked`;default:return`bg-status-idle`}}var Cy=Object.create(null),wy=e=>({}),Ty=new Proxy(Cy,{get(e,t){return wy()[t]??Cy[t]},has(e,t){return t in wy()||t in Cy},set(e,t,n){let r=wy(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=wy(!0);return delete n[t],!0},ownKeys(){let e=wy(!0);return Object.keys(e)}});Ty.NODE_ENV;function Ey(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return Ey(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return Ey(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return Ey(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return Ey(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return Ey(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return Ey(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return Ey(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function Dy(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}function Oy(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function ky(e){let t=e.split(`
51
+ at `);return t.length<=1?e:(t.splice(1,1),t.join(`
52
+ at `))}function Ay(e,t){class n extends e{#e;constructor(...e){if(Oy()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=ky(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var jy={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};Ay(class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:jy[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var My=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},Ny=47;function Py(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Ny;)t--;return t===e.length?e:e.slice(0,t)}function Fy(e){try{return(Py(new URL(e).pathname)||`/`)!==`/`}catch{throw new My(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function Iy(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new My(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof My?t:new My(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Ly(e,t=`/api/auth`){if(Iy(e),Fy(e))return e;let n=Py(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function Ry(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function zy(e,t,n,r,i){if(e)return Ly(e,t);if(r!==!1){let e=Ty.BETTER_AUTH_URL||Ty.NEXT_PUBLIC_BETTER_AUTH_URL||Ty.PUBLIC_BETTER_AUTH_URL||Ty.NUXT_PUBLIC_BETTER_AUTH_URL||Ty.NUXT_PUBLIC_AUTH_URL||(Ty.BASE_URL===`/`?void 0:Ty.BASE_URL);if(e)return Ly(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&Ry(o,`proto`)&&Ry(a,`host`))try{return Ly(`${o}://${a}`,t)}catch{}if(n){let e=By(n.url);if(!e)throw new My(`Could not get origin from request. Please provide a valid base URL.`);return Ly(e,t)}if(typeof window<`u`&&window.location)return Ly(window.location.origin,t)}function By(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Vy={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Hy=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,Uy={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},Wy=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Gy(e){return e instanceof Date&&!isNaN(e.getTime())}function Ky(e){let t=Wy.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return Gy(f)?f:null}function qy(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in Uy)return Uy[s];if(!Hy.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(Vy).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=Ky(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function Jy(e,t={strict:!0}){return qy(e,t)}var Yy=[`javascript:`,`data:`,`vbscript:`];function Xy(e){let t;try{t=new URL(e)}catch{return!0}return!Yy.includes(t.protocol)}var Zy={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&Xy(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},Qy=[],$y=0,eb=4,tb=globalThis.nanostoresGlobal||={epoch:0},nb=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=$y+eb;t<Qy.length;)Qy[t]===e?Qy.splice(t,eb):t+=eb;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){tb.epoch++;let i=!Qy.length;for(let i of t)Qy.push(i,n.value,e,r);if(i){for($y=0;$y<Qy.length;$y+=eb)Qy[$y](Qy[$y+1],Qy[$y+2],Qy[$y+3]);Qy.length=0}},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},rb=2,ib=5,ab=6,ob=10,sb=(e,t,n,r)=>(e.events=e.events||{},e.events[n+ob]||(e.events[n+ob]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+ob](),delete e.events[n+ob])}),cb=(e,t)=>sb(e,t,rb,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),lb=1e3,ub=(e,t)=>sb(e,n=>{let r=t(n);r&&e.events[ab].push(r)},ib,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[ab]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[ab])t();e.events[ab]=[]}},lb)},()=>{e.listen=n,e.off=r}});function db(e,t,n){let r=new Set(t).add(void 0);return e.listen((e,t,i)=>{r.has(i)&&n(e,t,i)})}function fb(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function pb(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!pb(e[n],t[n]))return!1;return!0}if(fb(e)&&fb(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!pb(e[r],t[r]))return!1;return!0}return!1}function mb(e,t){return cb(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var hb=Symbol.for(`better-auth:broadcast-channel`),gb=()=>Math.floor(Date.now()/1e3),_b=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:gb()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event!==`session`||!t?.data||this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function vb(e=`better-auth.message`){return globalThis[hb]||(globalThis[hb]=new _b(e)),globalThis[hb]}var yb=Symbol.for(`better-auth:focus-manager`),bb=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function xb(){return globalThis[yb]||(globalThis[yb]=new bb),globalThis[yb]}var Sb=Symbol.for(`better-auth:online-manager`),Cb=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function wb(){return globalThis[Sb]||(globalThis[Sb]=new Cb),globalThis[Sb]}var Tb=()=>Math.floor(Date.now()/1e3),Eb=5;function Db(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||wb().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=Tb(),t();return}if(e?.event===`visibilitychange`){if(Tb()-c.lastSessionRequest<Eb)return;c.lastSessionRequest=Tb(),t();return}t()}},d=e=>{vb().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=vb().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=xb().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=wb().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=vb().setup(),c.cleanupFocusSetup=xb().setup(),c.cleanupOnlineSetup=wb().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var Ob=()=>typeof window>`u`;function kb(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function Ab(e){return!e||e.session===null&&e.user===null?null:e}function jb(e,t){return pb(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function Mb(e,t){let n=nb(!1),r,i=e=>s(e),a=nb({data:null,error:null,isPending:!0,isRefetching:!1,refetch:i});mb(a,jb);let o=e=>{if(r!==e)return;let t=a.get();r=void 0,!(!t.isPending&&!t.isRefetching)&&a.set({...t,isPending:!1,isRefetching:!1,refetch:i})},s=async t=>{r?.abort();let n=new AbortController;r=n;let s=a.get();a.set({...s,isPending:s.data===null,isRefetching:!0,error:null,refetch:i});try{let r=await e(`/get-session`,{method:`GET`,query:t?.query,signal:n.signal});if(n.signal.aborted){o(n);return}let{data:s,error:c}=kb(r);if(s?.needsRefresh)try{let t=await e(`/get-session`,{method:`POST`,signal:n.signal});if(n.signal.aborted){o(n);return}({data:s,error:c}=kb(t))}catch{if(n.signal.aborted){o(n);return}}if(c){let e=a.get(),t=c?.status===401;a.set({data:t?null:e.data,error:c,isPending:!1,isRefetching:!1,refetch:i});return}let l=Ab(s),u=a.get(),d=u.data!=null&&l!=null&&pb(u.data,l)?u.data:l;a.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:i})}catch(e){if(n.signal.aborted){o(n);return}let t=a.get();a.set({data:t.data,error:e,isPending:!1,isRefetching:!1,refetch:i})}},c=()=>{};return ub(a,()=>{let e;Ob()||(e=setTimeout(()=>{s()},0));let i=Db({fetchSession:s,shouldPollSession:()=>a.get().data!=null,sessionSignal:n,options:t});return i.init(),c=i.broadcastSessionUpdate,()=>{e&&clearTimeout(e);let t=r;t?.abort(),t&&o(t),i.cleanup()}}),{session:a,$sessionSignal:n,broadcastSessionUpdate:e=>c(e)}}function Nb(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function Pb(e,t,n=`.`,r){if(!Nb(t))return Pb(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:Nb(a)&&Nb(i[t])?i[t]=Pb(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function Fb(e){return(...t)=>t.reduce((t,n)=>Pb(t,n,``,e),{})}var Ib=Fb(),Lb=Object.defineProperty,Rb=Object.defineProperties,zb=Object.getOwnPropertyDescriptors,Bb=Object.getOwnPropertySymbols,Vb=Object.prototype.hasOwnProperty,Hb=Object.prototype.propertyIsEnumerable,Ub=(e,t,n)=>t in e?Lb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wb=(e,t)=>{for(var n in t||={})Vb.call(t,n)&&Ub(e,n,t[n]);if(Bb)for(var n of Bb(t))Hb.call(t,n)&&Ub(e,n,t[n]);return e},Gb=(e,t)=>Rb(e,zb(t)),Kb=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},qb=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},Jb=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},Yb=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function Xb(e){if(typeof e==`number`)return new Jb({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new Jb(e);case`exponential`:return new Yb(e);default:throw Error(`Invalid retry strategy`)}}var Zb=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},Qb=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function $b(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return Qb.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function ex(e){try{return JSON.parse(e),!0}catch{return!1}}function tx(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function nx(e){try{return JSON.parse(e)}catch{return e}}function rx(e){return typeof e==`function`}function ix(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&rx(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&rx(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function ax(...e){let t={};for(let n of e)if(n)if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}return t}async function ox(e){let t=new Headers(ax(e?.headers,await Zb(e)));if(!t.has(`content-type`)){let n=sx(e?.body);n&&t.set(`content-type`,n)}return t}function sx(e){return tx(e)?`application/json`:null}function cx(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function lx(e,t){let{body:n}=e;return n?!tx(n)||typeof n==`string`?n:cx(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function ux(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return mx.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function dx(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var fx=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function px(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new fx(n.issues);return n.value}var mx=[`get`,`post`,`put`,`patch`,`delete`],hx=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``)),e.startsWith(`/`)&&e.charAt(1)===`@`&&(e=e.substring(1));let i=r.schema[e];if(i){let e=n?.headers;if(i.headers&&!n?.disableValidation){let t={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((e,n)=>{t[n.toLowerCase()]=e});else if(typeof n.headers==`object`)for(let[e,r]of Object.entries(n.headers))r!=null&&(t[e.toLowerCase()]=r)}let r=await px(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=Gb(Wb({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=Gb(Wb({},r),{body:i.input?await px(i.input,n?.body):n?.body,params:i.params?await px(i.params,n?.params):n?.params,query:i.query?await px(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),gx=e=>{async function t(t,n){let r=Gb(Wb(Wb({},e),n),{headers:ax(e?.headers,n?.headers),plugins:[...e?.plugins||[],hx(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await bx(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await bx(t,r)}return t},_x=e=>e===`.`||e===`..`;function vx(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(_x(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function yx(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];mx.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}let l=new Map;if(r)if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];l.set(n,String(e))}}else for(let[e,t]of Object.entries(r))l.set(`:${e}`,String(t));o=o.split(`/`).map(e=>vx(e,l)).join(`/`),o=o.replace(/^\/+/,``);let u=c.toString();return u=u.length>0?`?${u}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${u}`,a):`${a}${o}${u}`}var bx=async(e,t)=>{let{hooks:n,url:r,options:i}=await qb(e,t),a=ix(i),o=new AbortController,s=i.signal??o.signal,c=yx(r,i),l=await ox(i),u=lx(i,l),d=ux(r,i),f=Gb(Wb({},i),{url:c,headers:l,body:u,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&Object.assign(f,t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=dx(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(Gb(Wb({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=$b(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??nx)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await px(f.output,r.data));for(let e of n.onSuccess)e&&await e(Gb(Wb({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??nx,_=await m.text(),v=ex(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:Gb(Wb({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(Gb(Wb({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=Xb(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await bx(e,Gb(Wb({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new Kb(m.status,m.statusText,v?y:_);return{data:null,error:Gb(Wb({},y),{status:m.status,statusText:m.statusText})}},xx=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Sx=(e,t)=>{let n=`credentials`in Request.prototype,r=zy(e?.baseURL,e?.basePath,void 0,t)??xx(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=gx({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?Jy(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[Zy],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=Mb(d,e),h=e?.plugins||[],g={},_={$sessionSignal:f,session:p},v={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},y=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of h)e.getAtoms&&Object.assign(_,e.getAtoms?.(d)),e.pathMethods&&Object.assign(v,e.pathMethods),e.atomListeners&&y.push(...e.atomListeners);let b={notify:e=>{_[e].set(!_[e].get())},listen:(e,t)=>{_[e].subscribe(t)},atoms:_};for(let t of h)t.getActions&&(g=Ib(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function Cx(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function wx(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Tx=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,Ex=/['\u2019]/g;function Dx(e){return e.replace(Ex,``).match(Tx)??[]}function Ox(e){return Dx(e).map(e=>e.toLowerCase()).join(`-`)}function kx(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function Ax(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||Cx(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(Ox).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=kx(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function jx(e,t={}){let n=(0,B.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,B.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?db(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,B.useSyncExternalStore)(a,o,o)}function Mx(e){return`use${wx(e)}`}function Nx(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:i,$store:a,atomListeners:o}=Sx(e),s={};for(let[e,t]of Object.entries(r))s[Mx(e)]=()=>jx(t);return Ax({...n,...s,$fetch:i,$store:a},i,t,r,o)}var Px=`1.6.20`,Fx=()=>({id:`device-authorization`,version:Px,$InferServerPlugin:{},pathMethods:{"/device/code":`POST`,"/device/token":`POST`,"/device":`GET`,"/device/approve":`POST`,"/device/deny":`POST`}}),Ix=Dy({OTP_EXPIRED:`OTP expired`,INVALID_OTP:`Invalid OTP`,TOO_MANY_ATTEMPTS:`Too many attempts`}),Lx=()=>({id:`email-otp`,version:Px,$InferServerPlugin:{},atomListeners:[{matcher:e=>e===`/email-otp/verify-email`||e===`/sign-in/email-otp`||e===`/email-otp/request-email-change`,signal:`$sessionSignal`}],$ERROR_CODES:Ix}),Rx=`/console/api/auth`;function zx(e=globalThis.location){return Hx()||(e?`${Bx(e.origin)}${Rx}`:`${Vx}${Rx}`)}function Bx(e){return e.endsWith(`/`)?e.slice(0,-1):e}var Vx=`http://127.0.0.1:3000`;function Hx(){let e=Ux(`BETTER_AUTH_URL`)??Ux(`PUBLIC_BETTER_AUTH_URL`)??Wx(`VITE_BETTER_AUTH_URL`);return e?Bx(e):void 0}function Ux(e){return typeof process>`u`?void 0:{}[e]?.trim()||void 0}function Wx(e){return{BASE_URL:`/console/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_CLIENT_OUTPUT_DIR:`dist/client`,TSS_DEV_SERVER:`false`,TSS_ROUTER_BASEPATH:`console`,TSS_SERVER_FN_BASE:`/console/_serverFn/`}[e]?.trim()||void 0}var Gx=Nx({baseURL:Kx(),plugins:[Fx(),Lx()]});function Kx(){return zx(globalThis.location===void 0?void 0:globalThis.location)}var qx=`http://console.invalid`,Jx=`/console`,Yx=`/runs`,Xx=[`/signin`,`/signup`,`/forgot-password`,`/reset-password`,`/device`];function Zx(e){let t=nS(e);return Xx.some(e=>t===e||t.startsWith(`${e}/`))}function Qx(e){let t=nS(e);return!(t.startsWith(`/api/`)||Zx(t))}function $x(e){if(e==null)return Yx;let t=e.trim();if(!t.startsWith(`/`)||t.startsWith(`//`)||t.includes(`\\`))return Yx;let n;try{n=new URL(t,qx)}catch{return Yx}if(n.origin!==qx)return Yx;let r=nS(n.pathname);return!rS(r)||!iS(r)?Yx:`${r}${n.search}${n.hash}`}function eS(e){return`${e.pathname}${e.searchStr}`}function tS(e){return`${Jx}${$x(e)}`}function nS(e){let t;try{t=new URL(e,qx).pathname}catch{t=`/`}return t===Jx?`/`:t.startsWith(`${Jx}/`)?t.slice(8):t||`/`}function rS(e){try{let t=decodeURIComponent(e);return!t.startsWith(`//`)&&!t.startsWith(`/\\`)}catch{return!1}}function iS(e){return Qx(e)||e===`/device`}var aS=(0,B.createContext)(null);function oS(){let e=(0,B.useContext)(aS);if(e===null)throw Error(`useConsoleSession must be used inside App`);return e}function sS(e){let t=jc(),n=jo(),r=oo(),i=Gx.useSession(),a=i.data?.user,o=eS(n),s=Qx(n.pathname),c=Zx(n.pathname),l=a==null&&s,[u,d]=(0,B.useState)(!1);(0,B.useEffect)(()=>{i.isPending||d(!0)},[i.isPending]);let f=(0,B.useCallback)(async()=>{await i.refetch()},[i.refetch]),p=(0,B.useCallback)(async()=>{await Gx.signOut(),t.clear(),await r({to:`/signin`,search:{redirect:$x(o)},replace:!0})},[r,o,t]);return(0,B.useEffect)(()=>{i.isPending||!l||r({to:`/signin`,search:{redirect:$x(o)},replace:!0})},[l,r,o,i.isPending]),i.isPending&&!u?null:a==null?l?null:(0,z.jsx)(z.Fragment,{children:e.children}):(0,z.jsx)(aS.Provider,{value:{user:a,refreshSession:f,onSignOut:p},children:c?e.children:(0,z.jsx)(cS,{children:e.children})})}function cS(e){let{onSignOut:t,user:n}=oS(),r=ql();return(0,z.jsx)(ty,{connection:r.isError?r.data===void 0?`error`:`degraded`:r.isPending?`pending`:`ok`,user:n,onSignOut:t,children:e.children})}var lS=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%3e%3ctitle%3eFlakes%3c/title%3e%3cdefs%3e%3ccircle%20id='n'%20cx='12'%20cy='4.2'%20r='1.9'%20fill='%2310b981'/%3e%3c/defs%3e%3cuse%20href='%23n'/%3e%3cuse%20href='%23n'%20transform='rotate(60%2012%2012)'/%3e%3cuse%20href='%23n'%20transform='rotate(120%2012%2012)'/%3e%3cuse%20href='%23n'%20transform='rotate(180%2012%2012)'/%3e%3cuse%20href='%23n'%20transform='rotate(240%2012%2012)'/%3e%3cuse%20href='%23n'%20transform='rotate(300%2012%2012)'/%3e%3ccircle%20cx='12'%20cy='12'%20r='2.4'%20fill='%2310b981'/%3e%3c/svg%3e`,uS=`/console/assets/styles-B8OXOvkO.css`,dS=`modulepreload`,fS=function(e){return`/console/`+e},pS={},mS=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=fS(t,n),t in pS)return;pS[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:dS,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},hS=uo({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1.0`},{title:`flakes console`}],links:[{rel:`stylesheet`,href:uS},{rel:`icon`,type:`image/svg+xml`,href:lS}]}),component:gS});function gS(){let[e,t]=(0,B.useState)(!1);(0,B.useEffect)(()=>{t(!0),Rv()},[]);let[n]=(0,B.useState)(yS);return(0,z.jsx)(_S,{children:(0,z.jsxs)(Mc,{client:n,children:[(0,z.jsx)(sS,{children:(0,z.jsx)(B.Suspense,{fallback:(0,z.jsx)(vS,{}),children:(0,z.jsx)(wo,{})})}),null]})})}function _S({children:e}){return(0,z.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,z.jsx)(`head`,{children:(0,z.jsx)(Io,{})}),(0,z.jsxs)(`body`,{className:`flex min-h-screen flex-col`,children:[e,(0,z.jsx)(Lo,{})]})]})}function vS(){return(0,z.jsx)(`section`,{className:`grid min-h-72 place-items-center p-8`,children:(0,z.jsx)(el,{className:`size-5 animate-spin text-muted-foreground`})})}function yS(){return new kc({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,refetchIntervalInBackground:!0}}})}var bS=V(`/signup`)({validateSearch:e=>({redirect:$x(typeof e.redirect==`string`?e.redirect:void 0)}),component:po(()=>mS(()=>import(`./signup-CBSszmUC.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),`component`)}),xS=V(`/signin`)({validateSearch:e=>({redirect:$x(typeof e.redirect==`string`?e.redirect:void 0)}),component:po(()=>mS(()=>import(`./signin-BoZiVxyq.js`),__vite__mapDeps([13,1,2,3,4,6,5,8,9,7,11,12])),`component`)}),SS=V(`/sandboxes`)({validateSearch:e=>({runId:typeof e.runId==`string`?e.runId:void 0}),component:po(()=>mS(()=>import(`./sandboxes-BIimz5FI.js`),__vite__mapDeps([14,1,4])),`component`)}),CS=V(`/runs`)({validateSearch:e=>{let t=e.state,n=e.project;return{...t===`RUNNING`||t===`SUCCEEDED`||t===`FAILED`?{state:t}:{},...typeof n==`string`&&wS(n)?{project:n}:{}}},component:po(()=>mS(()=>import(`./runs-BB9ogobQ.js`),__vite__mapDeps([15,1,4])),`component`)});function wS(e){return/^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/.test(e)}var TS=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function ES(e){let t=e.email.trim().toLowerCase(),n=e.password,r={};return TS.test(t)||(r.email=`Enter a valid email address.`),n.length===0&&(r.password=`Enter your password.`),Object.keys(r).length>0?{ok:!1,errors:r}:{ok:!0,data:{email:t,password:n}}}function DS(e){let t=e.name.trim(),n=e.email.trim().toLowerCase(),r=e.password,i={};return t.length===0&&(i.name=`Enter your name.`),TS.test(n)||(i.email=`Enter a valid email address.`),r.length<8&&(i.password=`Use at least 8 characters for the password.`),Object.keys(i).length>0?{ok:!1,errors:i}:{ok:!0,data:{name:t,email:n,password:r}}}function OS(e){let t=e.password,n=e.confirmPassword,r={};return t.length<8&&(r.password=`Use at least 8 characters for the password.`),(n.length===0||n!==t)&&(r.confirmPassword=`Passwords must match.`),Object.keys(r).length>0?{ok:!1,errors:r}:{ok:!0,data:{password:t,confirmPassword:n}}}function kS(e){let t=e.name.trim(),n={};return t.length===0&&(n.name=`Enter your name.`),Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,data:{name:t}}}function AS(e){let t=e.currentPassword,n=e.newPassword,r=e.confirmPassword,i={};return t.length===0&&(i.currentPassword=`Enter your current password.`),n.length<8?i.newPassword=`Use at least 8 characters for the new password.`:n===t&&(i.newPassword=`Choose a different password.`),(r.length===0||r!==n)&&(i.confirmPassword=`Passwords must match.`),Object.keys(i).length>0?{ok:!1,errors:i}:{ok:!0,data:{currentPassword:t,newPassword:n,confirmPassword:r}}}function jS(e){let t=FS(e.token)??FS(e.code);return t===``?null:t}function MS(e){let t=IS(e,`code`).toLowerCase(),n=IS(e,`statusText`).toLowerCase(),r=LS(e).toLowerCase();return t===`invalid_token`||n===`invalid_token`||(r.includes(`token`)||r.includes(`link`))&&(r.includes(`invalid`)||r.includes(`expired`)||r.includes(`expire`))}function NS(e,t=`Authentication failed.`){let n=LS(e),r=n.toLowerCase();return PS(e)?`Please verify your email before signing in.`:r.includes(`already exists`)||r.includes(`already registered`)?`An account already exists for that email.`:r.includes(`invalid email or password`)||r.includes(`invalid credentials`)?`Email or password is incorrect.`:n||t}function PS(e){let t=LS(e).toLowerCase();return t.includes(`email not verified`)||t.includes(`verify your email`)}function FS(e){return typeof e==`string`?e.trim():null}function IS(e,t){if(typeof e==`object`&&e&&t in e){let n=e[t];return typeof n==`string`?n:``}return``}function LS(e){if(typeof e==`object`&&e&&`message`in e){let t=e.message;return typeof t==`string`?t:``}return e instanceof Error?e.message:``}var RS=V(`/reset-password`)({validateSearch:e=>({redirect:$x(typeof e.redirect==`string`?e.redirect:void 0),token:jS(e),error:typeof e.error==`string`?e.error:null}),component:po(()=>mS(()=>import(`./reset-password-D-OlZeHQ.js`),__vite__mapDeps([16,1,2,3,4,5,7,8,9,11,12])),`component`)}),zS=V(`/projects`)({component:po(()=>mS(()=>import(`./projects-n5LSsNi3.js`),__vite__mapDeps([17,1])),`component`)}),BS=V(`/forgot-password`)({validateSearch:e=>({redirect:$x(typeof e.redirect==`string`?e.redirect:void 0)}),component:po(()=>mS(()=>import(`./forgot-password-DOKn8_7P.js`),__vite__mapDeps([18,1,2,3,4,5,8,9,7,11,12])),`component`)}),VS=`---
53
+ title: Installing and Authorizing the CLI
54
+ description: Installing and authorizing the Flakes CLI.
55
+ ---
56
+
57
+ You may start by signing up for a new account and signing in to the [Flakes console](https://flakes.dev/console). Once you are signed in, the console is where you review runs, watch task activity, inspect workpads and artifacts, respond to permission requests, and send live input.
58
+
59
+ To install the Flakes CLI, run:
60
+
61
+ \`\`\`sh
62
+ npm install -g @baochunli/flakes
63
+ \`\`\`
64
+
65
+ Or if you use \`bun\`:
66
+
67
+ \`\`\`sh
68
+ bun install -g @baochunli/flakes
69
+ \`\`\`
70
+
71
+ Then authorize the CLI using your Flakes account:
72
+
73
+ \`\`\`sh
74
+ flakes auth login
75
+ \`\`\`
76
+
77
+ The command starts a device authorization flow. Approve the request in the browser while signed in to the console. After approval, the CLI stores your Flakes credential locally for future use.
78
+
79
+ Check the stored CLI credential:
80
+
81
+ \`\`\`sh
82
+ flakes auth status
83
+ \`\`\`
84
+
85
+ Run, task, artifact, and host setup commands use that stored CLI credential
86
+ automatically. You should not need to handle a raw hosted API credential during
87
+ normal first-run setup.
88
+
89
+ ## Next: Create A Project
90
+
91
+ Projects are first-class work namespaces. Every new run belongs to exactly one
92
+ active Project, and host workspace placement is configured against that Project
93
+ as an explicit product field.
94
+
95
+ Create a Project before creating runs:
96
+
97
+ \`\`\`sh
98
+ flakes projects create --key alpha --name "Alpha"
99
+ \`\`\`
100
+
101
+ Create runs with an explicit Project:
102
+
103
+ \`\`\`sh
104
+ flakes runs create --project alpha --key release-notes --name "Draft release notes"
105
+ \`\`\`
106
+
107
+ If you need to connect user-supplied host capacity for that Project, continue to
108
+ [Connecting Your Hosts](/docs/connect-a-host). Run the host once so it advertises pool keys, then bind the
109
+ Project with \`flakes projects bind-host alpha --host <host-id> --pool <pool-key>\`.
110
+ `,HS=`---
111
+ title: Concepts
112
+ description: Core vocabulary for Projects, runs, hosts, pools, sandboxes, and task outputs.
113
+ ---
114
+
115
+ This page defines the terms used across the hosted-console documentation. It is
116
+ for product users, host operators, and workflow authors, not a protocol or
117
+ storage reference.
118
+
119
+ For parent-task authoring, see [Harnesses](/docs/harnesses).
120
+
121
+ ## Terms
122
+
123
+ ### Project
124
+
125
+ A **Project** is a first-class, owner-scoped work namespace. Every new run is
126
+ created inside one active Project. A Project also names the host-local workspace
127
+ directory used for execution when the Project is bound to a host.
128
+
129
+ Project keys are stable, path-safe names such as \`alpha\` or \`release-notes\`.
130
+ When a host project root is \`/srv/flakes/projects\`, Project \`alpha\` maps to the
131
+ host path \`/srv/flakes/projects/alpha\` after the binding is configured and the
132
+ host validates it.
133
+
134
+ ### Run
135
+
136
+ A **run** is the durable container for related work inside a Project. A run
137
+ holds the tasks you save, the tasks admitted for execution, and the history
138
+ needed to inspect what happened later. Close a run when no more top-level tasks
139
+ should be added.
140
+
141
+ ### Task
142
+
143
+ A **task** is one unit of work inside a run. It has instructions, target
144
+ execution requirements, optional inputs and outputs, and a final result.
145
+ Tasks can be created directly by a user or integrator, or spawned by a running
146
+ parent task.
147
+
148
+ ### Group
149
+
150
+ A **group** is a durable phase owned by a running parent task. The parent opens
151
+ the group, spawns fresh child tasks into it, closes the child set, and waits
152
+ for the group to settle. Harnesses use groups for phases such as draft, review,
153
+ revise, and promote.
154
+
155
+ ### Assignment
156
+
157
+ An **assignment** is Flakes saying that one sandbox currently owns one task.
158
+ When a task reports activity, output, or a final result, Flakes checks that the
159
+ report comes from the current assignment. That keeps stale retries or late
160
+ updates from replacing newer task state.
161
+
162
+ ### Host
163
+
164
+ A **host** is the runner identity and lifecycle for a Linux or Mac machine that
165
+ runs the Flakes host agent. The host connects user-supplied capacity to Flakes
166
+ and keeps credentials, paths, mounts, and tool details on that machine.
167
+
168
+ Host = runner identity/lifecycle. Pool = capacity/resource/adapter constraints. Project = work namespace and workspace root mapping.
169
+
170
+ ### Pool
171
+
172
+ A **pool** is a host-local capacity definition. Pools describe which adapter can
173
+ run, how much concurrency is available, which capabilities are advertised, and
174
+ which local MatchLock image, executable paths, mounts, environment, and resource
175
+ bounds the host uses. Pools do not select the Project directory. Project
176
+ placement is managed by setting a host project root and binding Projects to
177
+ allowed pools.
178
+
179
+ ### Sandbox
180
+
181
+ A **sandbox** is the execution environment where assigned tasks run. It may be a
182
+ VM, container, local environment, or another isolated runtime started from host
183
+ capacity. The sandbox is what Flakes schedules for task execution.
184
+
185
+ ### Thread
186
+
187
+ A **thread** is one active task execution inside a sandbox. It includes the
188
+ task's running agent process, task-local files, session record, messages, and
189
+ result handling for the current assignment.
190
+
191
+ ### Workpad
192
+
193
+ A **workpad** is the durable Markdown note attached to a task. Humans and
194
+ agents use it for plans, progress, decisions, and handoffs. It is saved with
195
+ version checks so a stale update does not overwrite newer edits.
196
+
197
+ ### Transcript
198
+
199
+ A **transcript** is the saved agent session record for a task. Use it when you
200
+ need to inspect what the agent saw, said, and did during execution. A transcript
201
+ is evidence, not the task result by itself.
202
+
203
+ ### Artifact
204
+
205
+ An **artifact** is an optional managed file or blob that a task consumes or
206
+ produces. Use artifacts for concrete deliverables such as reports, logs,
207
+ datasets, images, or archives. A task can still be useful without declaring an
208
+ artifact when the result is captured by status, workpad, activity, or a
209
+ workspace handle.
210
+
211
+ ### Workspace Handle
212
+
213
+ A **workspace handle** is an immutable, git-backed reference to bounded paths in
214
+ a run workspace. Harnesses use workspace handles to pass repo-shaped state to
215
+ children and to receive bounded candidate changes back from them. The handle is
216
+ a reference to committed state, not a shared mutable directory.
217
+
218
+ ## Project, Host, Pool, Sandbox, And Task Thread
219
+
220
+ These terms often appear together, but they are different layers.
221
+
222
+ | Question | Project | Host | Pool | Sandbox | Task thread |
223
+ | --- | --- | --- | --- | --- | --- |
224
+ | What is it? | The work namespace for runs and workspace placement. | The runner identity and lifecycle for a machine. | Capacity and adapter constraints on a host. | The environment that can run assigned tasks. | One active task execution inside that environment. |
225
+ | What owns it? | The account owns Projects. | The host owns its credential and lifecycle. | The host owns local capacity config. | Flakes schedules sandboxes from host capacity. | The task thread is the running attempt for one assignment. |
226
+ | Who cares most? | Users and workflow authors. | Host operators. | Host operators and workflow authors. | Host operators and workflow authors. | Workflow authors and users inspecting task detail. |
227
+ | What is visible in the product? | Project list, runs, and host placement. | Host status and advertised capacity. | Adapter, capabilities, concurrency, and binding availability. | Task placement and runtime capability. | Task activity, workpad changes, transcripts, artifacts, and results. |
228
+ | What should not be mixed up? | A Project is not a run tag or metadata blob. | A host is not the task itself. | A pool is not a Project directory. | A sandbox is not a whole run. | A thread is not durable workflow state by itself. |
229
+
230
+ The practical rule: create Projects for work namespaces, connect and operate
231
+ hosts, bind Projects to compatible pools, let Flakes schedule sandboxes, and
232
+ inspect task threads when you need to understand a specific running or completed
233
+ task.
234
+ `,US=`---
235
+ title: Connecting Your Hosts
236
+ description: Connecting your own hosts to Flakes, configuring pools, and binding Projects.
237
+ ---
238
+
239
+ Connect a host when you want Flakes to run Project work on compute you provide.
240
+ The setup path starts from a hosted account, creates a host directly from the
241
+ authenticated CLI, writes credentials locally on the host, configures Project
242
+ placement, and then keeps a host agent connected to \`https://flakes.dev\`.
243
+
244
+ ## Prerequisites
245
+
246
+ You can connect a physical Linux or Mac machine that can start and run MatchLock sandboxes.
247
+
248
+ You need:
249
+
250
+ - MatchLock available on the host machine.
251
+ - A Project created with \`flakes projects create\`.
252
+ - A host-local project root directory, such as \`/srv/flakes/projects\`, with one
253
+ child directory for each Project key you plan to run.
254
+
255
+ Host setup is a CLI/direct user auth flow. Do not route raw host credentials
256
+ through the browser console, and do not assume the web console can display host
257
+ secrets. The setup route returns the raw host credential exactly once to the
258
+ CLI so the host can persist it locally.
259
+
260
+ ## Project Placement Model
261
+
262
+ Host = runner identity/lifecycle. Pool = capacity/resource/adapter constraints. Project = work namespace and workspace root mapping.
263
+
264
+ Host TOML declares identity, credentials, state, and pools. Pools describe only
265
+ the local capacity the host can advertise: adapter, resource limits,
266
+ capabilities, MatchLock image, executable paths, mounts, and environment. The
267
+ Project root is set through the API, CLI, or console. A Project is then bound
268
+ to one or more host pools, and the host validates the derived local path
269
+ \`<project-root>/<project-key>\` before Flakes schedules work there.
270
+
271
+ ## 1. Authorize The CLI
272
+
273
+ Authorize the CLI on the host machine against the hosted API:
274
+
275
+ \`\`\`sh
276
+ flakes auth login
277
+ flakes auth status
278
+ \`\`\`
279
+
280
+ \`flakes host setup\` uses this stored CLI credential. If no valid credential is
281
+ available, setup can start the same device authorization flow before creating
282
+ the host.
283
+
284
+ ## 2. Create The Host
285
+
286
+ Run setup on the host machine:
287
+
288
+ \`\`\`sh
289
+ flakes host setup --config <host.toml>
290
+ \`\`\`
291
+
292
+ Setup calls the direct host setup API using CLI user auth. The server creates
293
+ the host and its first host-scoped credential in one transaction, then returns
294
+ the raw credential exactly once so the CLI can write it to a protected local
295
+ credential file. Command output and browser console responses should expose
296
+ credential summaries, not the secret value.
297
+
298
+ By default, setup writes under the user's Flakes config directory. Passing
299
+ \`--config\`, \`--credential-file\`, and \`--state-dir\` lets you choose explicit host
300
+ paths.
301
+
302
+ ## 3. Add Pools To The Host Config
303
+
304
+ \`flakes host setup\` writes the host identity and credential reference first. Add
305
+ one or more \`[[pools]]\` entries before starting the host agent:
306
+
307
+ \`\`\`toml
308
+ controlPlaneUrl = "https://flakes.dev"
309
+ hostId = "host_..."
310
+ credentialFile = "/home/flakes/.config/flakes/host.credential"
311
+ stateDir = "/home/flakes/.config/flakes/state"
312
+
313
+ [[pools]]
314
+ poolKey = "local-pi"
315
+ matchlockImage = "registry.example.com/flakes/pi:latest"
316
+ adapter = "pi"
317
+ maxInstances = 2
318
+ maxConcurrency = 1
319
+ advertisedCapabilities = ["pi"]
320
+
321
+ [pools.executablePaths]
322
+ matchlock = "/usr/local/bin/matchlock"
323
+
324
+ [pools.resourceBounds]
325
+ cpus = 4
326
+ memoryMb = 8192
327
+ \`\`\`
328
+
329
+ Pool config is host-local. The host uses values such as \`matchlockImage\`,
330
+ \`credentialFile\`, \`stateDir\`, executable paths, mounts, and environment values
331
+ locally. When the host connects, Flakes receives a sanitized pool advertisement:
332
+ pool key, provider, adapter, capacity limits, advertised capabilities, and safe
333
+ resource bounds.
334
+
335
+ Do not add \`workspace\` under \`[[pools]]\`. Project directories are configured
336
+ after setup with \`flakes host project-root set\`, then Projects are bound to pool
337
+ keys after the host has advertised those pools.
338
+
339
+ ## 4. Set The Project Root
340
+
341
+ Create the host-local directories that should back each Project key. For a
342
+ Project named \`alpha\` and a root of \`/srv/flakes/projects\`, the host validates
343
+ \`/srv/flakes/projects/alpha\`.
344
+
345
+ Store the root on the hosted control plane:
346
+
347
+ \`\`\`sh
348
+ flakes host project-root set --config <host.toml> --path /srv/flakes/projects
349
+ \`\`\`
350
+
351
+ ## 5. Run The Host And Discover Pools
352
+
353
+ Start the host process:
354
+
355
+ \`\`\`sh
356
+ flakes host run --config <host.toml>
357
+ \`\`\`
358
+
359
+ Keep this process running on the host. It connects to the hosted control plane,
360
+ advertises sanitized pool capacity, validates active Project bindings, claims
361
+ matching launch work, starts MatchLock only after the control plane accepts the
362
+ claim, and reports lifecycle results back to Flakes.
363
+
364
+ The host status moves through \`created\`, \`offline\`, \`online\`, and \`disabled\`.
365
+ Pools become schedulable only after the running host connects and Flakes
366
+ acknowledges the pool snapshot.
367
+
368
+ In another terminal, confirm the remote host and pool snapshot:
369
+
370
+ \`\`\`sh
371
+ flakes host status --config <host.toml> --json
372
+ \`\`\`
373
+
374
+ The command checks that the credential file is private, the host config is
375
+ valid, and the configured pools can be advertised. When the CLI has a valid
376
+ stored user credential, it also reads remote host, pool, and credential
377
+ summaries for the same account. \`flakes host status\` does not report Project
378
+ binding availability.
379
+
380
+ ## 6. Bind The Project To Discovered Pools
381
+
382
+ After the target pool key is visible in host status or the console host page,
383
+ bind the Project to one or more pools from this host:
384
+
385
+ \`\`\`sh
386
+ flakes projects bind-host alpha --host <host-id> --pool local-pi
387
+ \`\`\`
388
+
389
+ You can get the host ID from \`flakes host setup\` output, \`flakes host status\`,
390
+ or the console host detail page. The binding controls which pools can launch
391
+ work for that Project; it does not edit the host TOML file. If you bind before
392
+ the host has advertised pools, the control plane rejects the request with
393
+ \`unknown_host_pool_keys\`.
394
+
395
+ A Project becomes schedulable on that host only after its binding validates
396
+ successfully for at least one allowed pool. Inspect binding availability in the
397
+ console host placement panel or with
398
+ \`GET /v1/hosts/:hostId/project-bindings\`.
399
+
400
+ ## Credential Handling
401
+
402
+ Host credentials are separate from user CLI credentials:
403
+
404
+ - \`flakes auth login\` stores a user CLI
405
+ credential for the hosted API.
406
+ - \`flakes host setup\` uses that user credential to create a host and first
407
+ host-scoped credential, then writes the raw host credential only to the local
408
+ credential file.
409
+ - \`flakes host run\` reads the host credential file and uses the host-scoped
410
+ credential to connect as that host.
411
+ - \`flakes host rotate --config <host.toml>\` rotates the host-scoped credential
412
+ through direct CLI user auth, writes the new raw host credential only to the
413
+ credential file, and requires restarting \`flakes host run\` before claiming new
414
+ launch work.
415
+
416
+ The web console in the browser is for operating and observing Flakes. It should
417
+ not expose raw host credential setup or rotation flows.
418
+ `,WS=`---
419
+ title: Harnesses
420
+ description: Author durable parent tasks that spawn, wait for, and resume child work.
421
+ ---
422
+
423
+ A harness is a TypeScript task that coordinates other tasks. Use one when a
424
+ workflow needs durable fan-out, review/revise loops, staged workspace handoffs,
425
+ or a parent task that can pause while children run and later resume from saved
426
+ state.
427
+
428
+ For vocabulary used here, see [Concepts](/docs/concepts).
429
+
430
+ ## When To Use A Harness
431
+
432
+ Use the Harness SDK when the parent task needs to make decisions while work is
433
+ running:
434
+
435
+ - split a larger job into child tasks and collect their declared outputs;
436
+ - run phases such as draft, review, revise, and promote;
437
+ - wait for a group of children without keeping a local process alive;
438
+ - pass repo-shaped state through workspace handles;
439
+ - rebuild its next step after a yielded wait, retry, or sandbox change.
440
+
441
+ Do not use a harness for a single prompt, a static dependency graph, or a job
442
+ that only needs ordinary task creation from the console or CLI. In those cases,
443
+ save normal tasks and dependencies as described in [Running Workflows](/docs/run-work).
444
+
445
+ ## Where Harness Code Runs
446
+
447
+ Harness code runs only when a task using the \`harness\` adapter is assigned to a
448
+ sandbox. It does not run in the console, the CLI, the host process, or as a
449
+ privileged control-plane script.
450
+
451
+ The product path is:
452
+
453
+ 1. You write and check a harness module.
454
+ 2. You submit it as an ordinary task with \`--adapter harness\`.
455
+ 3. Flakes schedules that task onto a sandbox that can run the harness adapter.
456
+ 4. The harness opens groups, spawns children, waits, resumes, and returns a
457
+ normal task result.
458
+
459
+ The main package name a harness author needs is \`@flakes/harness-sdk\`, used for
460
+ the \`defineHarness(...)\` import in the module source.
461
+
462
+ ## Start From A Template
463
+
464
+ Create a starter harness, then run the checker before submitting it:
465
+
466
+ \`\`\`bash
467
+ flakes harness init --template paper --dir harnesses
468
+ flakes harness check harnesses/paper-writer.ts
469
+ \`\`\`
470
+
471
+ The current CLI starter templates are:
472
+
473
+ - \`paper\`
474
+ - \`review-revise\`
475
+ - \`fanout-fanin\`
476
+ - \`autowrite\`
477
+ - \`autoresearch\`
478
+
479
+ The SDK source also includes \`fix-review-live.ts\` for live implementer/reviewer
480
+ loops. Use it only when the child adapter advertises live task round support.
481
+
482
+ If a template uses \`ctx.pi(...)\` without explicit child agent IDs, provide
483
+ checker defaults:
484
+
485
+ \`\`\`bash
486
+ cat > harnesses/defaults.json <<'JSON'
487
+ { "agents": { "pi": "agent_pi_writer" } }
488
+ JSON
489
+
490
+ flakes harness check harnesses/paper-writer.ts \\
491
+ --defaults harnesses/defaults.json
492
+ \`\`\`
493
+
494
+ Submit a checked module as a normal task:
495
+
496
+ \`\`\`bash
497
+ flakes tasks save \\
498
+ --run paper-run \\
499
+ --key paper-planner \\
500
+ --title "Paper planner" \\
501
+ --adapter harness \\
502
+ --harness-file harnesses/paper-writer.ts \\
503
+ --tool-grant flakes.tasks.spawn \\
504
+ --tool-grant flakes.groups.open \\
505
+ --tool-grant flakes.groups.close \\
506
+ --tool-grant flakes.groups.wait \\
507
+ --tool-grant flakes.workspace.commit \\
508
+ --tool-grant flakes.workspace.resolve \\
509
+ --tool-grant flakes.workspace.promote \\
510
+ --tool-grant flakes.childOutputs.read
511
+
512
+ flakes tasks admit --run paper-run paper-planner
513
+ \`\`\`
514
+
515
+ ## Groups, Spawn, Wait, And Resume
516
+
517
+ Harnesses build around durable groups. A group is one named phase owned by the
518
+ running parent task. In code, \`ctx.group(...)\` opens the group, lets you call
519
+ \`group.spawn(...)\` for children, closes the child set, and waits for the group
520
+ to settle.
521
+
522
+ \`\`\`ts
523
+ import { defineHarness } from "@flakes/harness-sdk";
524
+
525
+ export default defineHarness(async (ctx) => {
526
+ const draft = await ctx.group(
527
+ "draft-sections",
528
+ { join: "all_success", maxChildren: 2 },
529
+ (group) => {
530
+ group.spawn(
531
+ "intro",
532
+ ctx.pi({
533
+ title: "Draft introduction",
534
+ prompt: "Write the introduction and publish notes.",
535
+ outputs: {
536
+ notes: ctx.output.json({ required: true }),
537
+ },
538
+ }),
539
+ );
540
+ },
541
+ );
542
+
543
+ ctx.requireGroupSuccess(draft);
544
+ const notes = await ctx.outputs.readJson(draft, "intro", "notes");
545
+ return ctx.succeeded({ data: { notes } });
546
+ });
547
+ \`\`\`
548
+
549
+ If the group is not terminal yet, Flakes can yield the current assignment. The
550
+ logical parent task is scheduled again after the wait condition is satisfied.
551
+ Resume is reconstruction, not a live JavaScript continuation: use stable group
552
+ keys, child keys, output keys, workspace labels, and promotion labels, then
553
+ rebuild decisions from durable group status, child outputs, workpad snapshots,
554
+ and promotion records.
555
+
556
+ ## Workspace Handles
557
+
558
+ Workspace handles are immutable, git-backed references to bounded paths in a
559
+ run workspace. Use them for repo-shaped handoffs instead of copying directories
560
+ or sharing a mutable worktree.
561
+
562
+ The normal pattern is:
563
+
564
+ 1. Commit bounded parent paths with \`ctx.workspace.commit(...)\`.
565
+ 2. Pass the returned handle to children in their \`inputs\`.
566
+ 3. Require children to publish bounded workspace outputs.
567
+ 4. Read a child candidate with \`ctx.outputs.workspace(...)\`.
568
+ 5. Review and promote selected paths with \`ctx.workspace.promote(...)\`.
569
+
570
+ \`\`\`ts
571
+ const base = await ctx.workspace.commit("paper-base", {
572
+ paths: ["paper", ".harness/plan.json"],
573
+ message: "Base paper state",
574
+ });
575
+
576
+ const draft = await ctx.group("draft", { join: "all_success" }, (group) => {
577
+ group.spawn(
578
+ "intro",
579
+ ctx.pi({
580
+ title: "Draft intro",
581
+ prompt: "Edit work/paper/intro.md and publish a candidate.",
582
+ inputs: { "work/": base },
583
+ outputs: {
584
+ candidate: ctx.output.workspace({
585
+ paths: ["work/paper/intro.md"],
586
+ required: true,
587
+ }),
588
+ },
589
+ }),
590
+ );
591
+ });
592
+
593
+ ctx.requireGroupSuccess(draft);
594
+ const candidate = await ctx.outputs.workspace(draft, "intro", "candidate");
595
+
596
+ await ctx.workspace.promote("promote-intro", {
597
+ base,
598
+ candidate,
599
+ paths: ["paper/intro.md"],
600
+ mode: "replace_bounded_paths",
601
+ conflictPolicy: "fail",
602
+ });
603
+ \`\`\`
604
+
605
+ Small settings can go in child \`input\` or in bounded workspace files written by
606
+ the parent before commit. Use workspace handles for source trees, papers,
607
+ experiment folders, and other state where history and path boundaries matter.
608
+
609
+ ## Current MVP Boundaries
610
+
611
+ The current Harness SDK MVP supports direct child group orchestration, yielded
612
+ wait/resume, declared terminal child outputs, child workpad snapshots, live
613
+ round helpers for supported child adapters, and workspace handles.
614
+
615
+ It does not support broad child browsing, spawned child \`inputArtifacts\`,
616
+ shared mutable worktrees, arbitrary npm dependencies, unbounded loops without a
617
+ clear budget, or control-plane-side TypeScript execution.
618
+
619
+ Keep harnesses deterministic. Group keys, child keys, output keys, workspace
620
+ labels, and promotion labels should come from stable workflow input, not random
621
+ values or current time.
622
+ `,GS=`---
623
+ title: Overview
624
+ description: What is Flakes?
625
+ ---
626
+
627
+ [Flakes](https://flakes.dev) is a hosted harness runtime for distributed agent workflows. Workflows run within sandbox environments, and across hosts that are supplied by the user. The [console](https://flakes.dev/console) is the primary user interface for interacting with Flakes: use it to review runs, inspect task state, read transcripts and artifacts, respond to permission requests, and steer running tasks.
628
+
629
+ Flakes keeps all the transcripts, inputs, outputs and artifacts _durable_ in its control plane console. and _observable_ using its console, while workflows run on hosts you provide. A user-supplied host advertises one or more _pools_, which represents the capabilities and resources, such as GPUs, that the host supports. Flakes then matches ready tasks to compatible capabilities, and the console is the place for the user to observe what happened even when machines, sandboxes, or task runners disconnect (and return later).
630
+
631
+ Start with [Installing and Authorizing the CLI](/docs/cli). To bring your own hosts, continue to [Connecting Your Hosts](/docs/connect-a-host).
632
+ `,KS=`---
633
+ title: Observing And Steering
634
+ description: Inspecting workflow runs in the console, read task history, and send live input.
635
+ ---
636
+
637
+ Use the console at \`https://flakes.dev/console\` to watch durable work, inspect
638
+ what an agent did, and send live input while a task is running.
639
+
640
+ The important boundary: durable task state is the source of truth. Status,
641
+ dependencies, workpads, activity, artifacts, and transcript pointers live in
642
+ the control plane. A transient agent process, sandbox assignment, or local
643
+ session can end and be replaced without erasing that durable task state.
644
+
645
+ ## Runs
646
+
647
+ The Runs page lists every run your account can read, newest first. Use the
648
+ state filters for all, running, succeeded, or failed runs. Each row shows the
649
+ run name, run id, current state, task progress, creation time, and last update.
650
+ Open a row to inspect the run.
651
+
652
+ Queued work is visible here as a running run whose task progress has not moved
653
+ to terminal states yet. If a run remains active longer than expected, open the
654
+ run and check whether tasks are waiting for capacity, waiting for dependencies,
655
+ running on a sandbox, or blocked on input.
656
+
657
+ ## Run Detail
658
+
659
+ Run detail starts with the run state, elapsed time, task terminal count, and a
660
+ download action for the run history. The Overview tab has three views:
661
+
662
+ - Map: shows the task graph and dependency shape.
663
+ - Timeline: shows queue time and execution time for each task.
664
+ - By Sandbox: groups tasks by the sandbox that ran or is running them.
665
+
666
+ The Tasks table is the operational list. It shows task number, task name,
667
+ status, workpad version, sandbox, dependencies, accepted time, finished time,
668
+ and a Task button that opens task detail.
669
+
670
+ Other run tabs show declared artifacts, metrics, and active file reservations.
671
+ Delete is available only after the run is terminal; it removes finished run
672
+ history and is not a control for stopping active work.
673
+
674
+ ## Task Detail
675
+
676
+ Open a task from the run map, timeline, sandbox view, or Tasks table. Task
677
+ detail shows the task brief, acceptance criteria, adapter, live round state when
678
+ present, dependencies, sandbox, attempt, accepted time, heartbeat, and finished
679
+ time.
680
+
681
+ The Workpad panel is the durable task note. Use it for current plan, progress,
682
+ findings, and handoff notes. The console saves with a version check, so if
683
+ someone else updated the workpad first, your edit is rejected instead of
684
+ silently overwriting newer text.
685
+
686
+ The Activity panel is the short timeline for product events. It can show
687
+ workpad edits, human input, live round events, \`permission.requested\`, and
688
+ \`permission.responded\`. Activity is not a full transcript and does not replace
689
+ the workpad.
690
+
691
+ The Agent transcript panel shows the saved Pi session when the task uses the
692
+ Pi adapter. Use Parsed for a readable conversation and tool view. Use Raw when
693
+ you need the underlying session record. A transcript is evidence of what the
694
+ agent did; it is not how Flakes decides whether the task succeeded.
695
+
696
+ ## Steer Running Work
697
+
698
+ The task transcript includes live input controls while the task is running:
699
+
700
+ - Follow up: add information or answer a question from the agent.
701
+ - Steer: nudge direction without replacing the task definition.
702
+
703
+ The console queues the message and sends it to the active running task. The
704
+ message is accepted only while the task is running on a connected sandbox. If
705
+ the task has already finished, is waiting, or its sandbox is offline, the
706
+ composer is disabled or the send fails and you can retry only after there is an
707
+ active running assignment again.
708
+
709
+ Live input does not edit the saved task. It is an event delivered to the
710
+ current agent process. The durable record is the task state, activity entry,
711
+ workpad, and transcript update that follow.
712
+
713
+ ## Permission Requests
714
+
715
+ When an adapter needs human approval, it can create a durable permission
716
+ request. The task activity shows \`permission.requested\`; after a response is
717
+ accepted it shows \`permission.responded\` with the decision.
718
+
719
+ If your console deployment renders an inline permission prompt, answer it from
720
+ the task page by approving or denying the request and include a reason when the
721
+ prompt asks for one. A permission request accepts only one response. Flakes
722
+ delivers the answer only to the active assignment for that task, so stale
723
+ agents cannot receive answers for work they no longer own.
724
+
725
+ Permission requests are always visible as durable activity events. Some
726
+ deployments or integrations may also render an inline approval prompt in the
727
+ console, but do not assume every task page has a general approve or deny
728
+ control. When no control is visible, answer the request through the integration
729
+ or API client that surfaced it, then use the console activity and transcript to
730
+ confirm the response was recorded and delivered.
731
+
732
+ ## What To Do By State
733
+
734
+ | State | What it means | What you can do |
735
+ | --- | --- | --- |
736
+ | queued | The task is admitted but has not started. | Check dependencies, required capabilities, and connected host capacity. Usually the right action is to wait for capacity or connect capacity that advertises the needed adapter and capabilities. |
737
+ | running | A sandbox currently owns the task. | Watch heartbeat, activity, workpad, and transcript. Send a follow-up or steer message if the agent needs more context. |
738
+ | waiting | The task yielded because a durable wait condition is not satisfied. | Inspect the group or dependency that must settle. Do not expect the old process to resume; Flakes resumes the logical task from durable state when the wait condition resolves. |
739
+ | failed | The task reached a terminal failure. | Open task detail, read the activity and transcript, inspect the workpad, and decide whether to create follow-up work in a new or still-open run. |
740
+ | blocked on input | The task needs a human answer, such as a permission decision or missing context. | Use the visible prompt or live follow-up control when available. If no permission control is visible, respond through the client or integration that owns the prompt and verify \`permission.responded\` in activity. |
741
+
742
+ For scheduling issues, start with the run Timeline and By Sandbox views. For
743
+ agent behavior, start with task Activity, Workpad, and Agent transcript. For
744
+ human intervention, use Follow up, Steer, and the permission response path
745
+ available in your deployment.
746
+ `,qS='---\ntitle: Reference\ndescription: CLI commands, host configuration, selected API routes, and integrator exports for hosted Flakes.\n---\n\nUse this page after you understand the main workflows. It is a lookup for the\nhosted console at `https://flakes.dev`, the `flakes` CLI, user-supplied hosts,\nand selected integration surfaces.\n\nFor first-run steps, start with [Installing and Authorizing the CLI](/docs/cli).\nFor host setup, see [Connecting Your Hosts](/docs/connect-a-host).\n\n## CLI Command Reference\n\nCLI commands target the hosted control plane at `https://flakes.dev`. Most\ncommands use the stored credential from `flakes auth login`; commands that also\naccept `--token` are mainly for trusted automation.\n\n### Auth\n\n| Command | Use |\n| --- | --- |\n| `flakes auth login` | Start device authorization, open the browser approval page, and save the CLI credential. |\n| `flakes auth login --no-open` | Print the verification URL and user code without opening a browser. Useful on remote shells. |\n| `flakes auth login --timeout-ms 600000` | Wait longer for browser approval. |\n| `flakes auth login --json` | Emit the device-code and authenticated records as newline-delimited JSON for automation. |\n| `flakes auth status` | Show whether the stored CLI credential is authenticated, expired, or missing. |\n| `flakes auth status --json` | Emit structured credential status. |\n| `flakes auth logout` | Remove the stored CLI credential. |\n| `flakes auth logout --json` | Emit structured logout output. |\n\n### Local Runtime And Config\n\nThese commands are mostly for local development, smoke checks, or authoring\nruntime config files. The hosted path usually starts with auth and host setup.\n\n| Command | Use |\n| --- | --- |\n| `flakes server --config <server.toml>` | Validate config, open the PostgreSQL store, and start the control-plane server. `-c` is also accepted. |\n| `flakes server --config <server.toml> --host 127.0.0.1 --port 7733 --dry-run` | Validate server config and print a redacted JSON summary without starting the daemon. |\n| `flakes sandbox --config <sandbox.toml>` | Validate config, load adapters, and start the sandbox daemon. `-c` is also accepted. |\n| `flakes sandbox --config <sandbox.toml> --dry-run` | Validate sandbox config and print the daemon descriptor without opening a control-plane stream. |\n| `flakes down --session flakes --dry-run --json` | Stop or preview stopping a local tmux runtime session. |\n| `flakes config schema` | Print annotated TOML examples for server and sandbox config. |\n| `flakes config schema server` | Print only the server config example. `sandbox` is also supported. |\n\n### Projects\n\n| Command | Use |\n| --- | --- |\n| `flakes projects create --key <project-key> --name <name>` | Create or idempotently read an active Project namespace for new runs. |\n| `flakes projects list` | List Projects owned by the authenticated account, including archived Projects. |\n| `flakes projects archive <project-key>` | Archive a Project so new runs and host bindings cannot use it. Existing history remains visible. |\n| `flakes projects bind-host <project-key> --host <host-id> --pool <pool-key>` | Bind a Project to a host pool. Repeat `--pool` to allow more than one pool on the same host. |\n\nProject keys are lowercase path-safe names. They are used for hosted identity\nand for the host-local directory under each configured project root.\n\n### Host Setup And Operation\n\n| Command | Use |\n| --- | --- |\n| `flakes host setup --config <host.toml>` | Create a host and first host-scoped credential through direct CLI user auth, then write the host config. |\n| `flakes host setup --config <host.toml> --credential-file <path> --state-dir <dir> --host-name <name>` | Override the credential file, state directory, or displayed host name. |\n| `flakes host setup --config <host.toml> --no-open --timeout-ms 600000` | Run setup on a remote shell and let the embedded device-login flow wait longer for approval. |\n| `flakes host setup --config <host.toml> --json` | Emit structured setup output with redacted host and credential summaries. The raw credential is not printed. |\n| `flakes host rotate --config <host.toml>` | Request a new host credential, write it to the configured credential file, and retire the replaced credential. Restart the host process afterward. |\n| `flakes host rotate --config <host.toml> --json` | Emit structured rotation output, including the new credential summary and next steps. The raw credential is not printed. |\n| `flakes host project-root set --config <host.toml> --path <absolute-root>` | Store the host-local project root on the hosted control plane. The server stores the path but does not inspect the host filesystem. |\n| `flakes host run --config <host.toml>` | Start the host runtime and connect capacity to Flakes. This process should stay running. |\n| `flakes host status --config <host.toml>` | Validate local config and, when a CLI credential is available, read remote host, pool, and credential status. |\n| `flakes host status --config <host.toml> --json` | Emit structured local and remote status. |\n\nSetup writes new files only when the target config and credential file do not\nalready exist. Setup and rotation require an authenticated CLI user credential\nfor the same hosted origin; they are direct user bearer auth flows, not console\nproxy flows.\n\n### Runs\n\n| Command | Use |\n| --- | --- |\n| `flakes runs create --project <project-key> --key <run-key> --name "Release notes"` | Create or reuse a run identified by a stable run key inside an active Project. |\n| `flakes runs create --project <project-key> --key <run-key> --name "Release notes" --token <token>` | Create a run using an explicit automation bearer token instead of the stored CLI credential. `-t` is also accepted. |\n| `flakes runs close <run-key>` | Close the run so no more top-level tasks can be admitted. |\n| `flakes runs close <run-key> --wait --timeout-ms 600000` | Close the run and poll until the run reaches a terminal state or the timeout expires. |\n| `flakes runs close <run-key> --token <token>` | Close a run using an explicit automation bearer token. `-t` is also accepted. |\n| `flakes inspect <run-id-or-key>` | Read a run. A non-`run_` value is treated as a run key. |\n| `flakes inspect <task-id> --task` | Read a task explicitly. |\n| `flakes logs <task-id> --after <cursor> --limit <n>` | Read bounded task logs. |\n| `flakes metrics <run-id>` | Read run metrics. |\n\n`runs`, `inspect`, `logs`, and `metrics` accept `--token <token>` or `-t\n<token>` when trusted automation should bypass the stored CLI credential.\n\n### Tasks\n\n| Command | Use |\n| --- | --- |\n| `flakes tasks save --run <run-key> --key <task-key> --title "Draft" --adapter pi --body "Write the draft."` | Save or update a not-yet-admitted task. |\n| `flakes tasks save --run <run-key> --key <task-key> --title "Draft" --adapter pi --body-file prompt.md --required-capability pi --depends-on outline` | Save a task with a file body, capability requirement, and dependency. |\n| `flakes tasks save --run <run-key> --key <task-key> --title "Plan" --adapter harness --harness-file harnesses/paper-writer.ts --tool-grant flakes.tasks.spawn` | Submit a harness module as a normal task. |\n| `flakes tasks admit --run <run-key> <task-key>` | Admit specific saved tasks for scheduling. |\n| `flakes tasks admit --run <run-key> --all` | Admit all saved tasks that are ready for admission. |\n\nTask save accepts `--acceptance`, `--depends-on`, `--required-capability`, and\n`--tool-grant` more than once. `--harness-file` requires `--adapter harness`.\nTask commands that call the hosted API accept `--token <token>` or `-t <token>`\nfor trusted automation.\n\n### Workpads And File Reservations\n\n| Command | Use |\n| --- | --- |\n| `flakes tasks workpad show <task-id>` | Read a task workpad as JSON. |\n| `flakes tasks workpad show <task-id> --raw` | Print only the Markdown body. |\n| `flakes tasks workpad save <task-id> --file <workpad.md> --base-version <version>` | Save a workpad with an optimistic version check. `-f` is also accepted for `--file`. |\n| `flakes tasks workpad template <task-id> --output <workpad.md>` | Create a local Markdown template for editing. `-o` is also accepted. |\n| `flakes tasks workpad pull` | Inside a running Flakes task, pull the assignment-local workpad into the thread state directory. |\n| `flakes tasks workpad push` | Inside a running Flakes task, push the assignment-local workpad with its saved base version. |\n| `flakes tasks files reserve <path...> --reason "editing" --json` | Inside a running task, reserve assignment-scoped file paths before editing. |\n| `flakes tasks files reserve <path...> --prefix --json` | Reserve path prefixes instead of exact paths. |\n| `flakes tasks files release <path...> --json` | Release assignment-scoped file reservations. |\n| `flakes tasks files release <path...> --prefix --json` | Release prefix reservations instead of exact-path reservations. |\n| `flakes tasks files release --all --json` | Release all reservations owned by the current assignment. |\n| `flakes tasks files list --json` | List current assignment file reservations. |\n| `flakes tasks files check <path...> --json` | Check whether paths conflict with existing reservations. |\n| `flakes tasks files check <path...> --prefix --json` | Check prefix selectors for conflicts. |\n\nThe `pull`, `push`, and `files` commands are attached to a running task through\nthread-local environment variables. They fail outside a running Flakes task.\n\n### Messages And Permissions\n\nMessages and permission responses do not have standalone top-level CLI commands.\nUse the console controls when available, or call the selected API routes:\n\n| Route | Use |\n| --- | --- |\n| `POST /v1/tasks/:taskId/messages` | Send a `follow_up` or `steer` message to a running task. |\n| `POST /v1/tasks/:taskId/permissions/:permissionRequestId/respond` | Answer a task permission request with `approved` or `denied`. |\n\nBoth routes require the task to be running on a connected sandbox. See\n[Observing And Steering](/docs/observe-and-steer) for user-facing behavior.\n\n### Harness Checks\n\n| Command | Use |\n| --- | --- |\n| `flakes harness init --template paper --dir harnesses` | Create a starter harness module. |\n| `flakes harness init --template review-revise --dir harnesses --file review.ts --force` | Write a specific template and overwrite the target file. |\n| `flakes harness check harnesses/paper-writer.ts` | Typecheck and validate a harness module before submission. |\n| `flakes harness check harnesses/paper-writer.ts --defaults harnesses/defaults.json --json` | Check with adapter/agent defaults and emit structured diagnostics. |\n\nCurrent template names are `paper`, `review-revise`, `fanout-fanin`,\n`autowrite`, and `autoresearch`.\n\n### Artifacts\n\n| Command | Use |\n| --- | --- |\n| `flakes artifacts create --file artifact.json` | Create artifact metadata, optionally with inline bytes in the JSON payload. `-f` is also accepted. |\n| `flakes artifacts get <artifact-id>` | Read artifact metadata. |\n| `flakes artifacts fetch <artifact-id> --location-id <location-id>` | Fetch a specific artifact location when more than one location is available. |\n| `flakes artifacts fetch <artifact-id> --output <file>` | Fetch artifact bytes to a file. `-o` is also accepted. |\n| `flakes artifacts fetch <artifact-id> --raw` | Write exact artifact bytes to stdout. |\n\nArtifact commands accept `--token <token>` or `-t <token>` for trusted\nautomation.\n\n## Host Config Reference\n\n`flakes host setup` writes a starter Host config TOML file. Add at least one\npool before running `flakes host run`.\n\nHost config TOML describes host identity, credentials, state, and capacity\npools. Host TOML pools do not contain `workspace`; the project workspace root\nis stored in the control plane with `flakes host project-root set`.\nThe project workspace root is stored in the control plane, not in Host TOML.\n\n```toml\ncontrolPlaneUrl = "https://flakes.dev"\nhostId = "host_abc123"\ncredentialFile = "/Users/me/.config/flakes/host.credential"\nstateDir = "/Users/me/.config/flakes/state"\n\n[[pools]]\npoolKey = "mac-coding"\nmatchlockImage = "registry.example/flakes/macos:latest"\nmounts = ["/Users/me/.cache/flakes:/cache"]\nadapter = "pi"\nmaxInstances = 2\nmaxConcurrency = 1\nadvertisedCapabilities = ["pi", "node", "mac"]\n\n[pools.resourceBounds]\nmemoryMb = 8192\ncpus = 4\n\n[pools.env]\nEXAMPLE = "value"\n\n[pools.executablePaths]\nmatchlock = "/usr/local/bin/matchlock"\nflakes = "/usr/local/bin/flakes"\n```\n\n### Top-Level Fields\n\n| Field | Required | Meaning |\n| --- | --- | --- |\n| `controlPlaneUrl` | Yes | Hosted API origin. Host setup writes `https://flakes.dev`. |\n| `hostId` | Yes | Host identity returned by setup. It must be a non-empty identifier. |\n| `credentialFile` | Yes | Absolute path to the host-scoped credential file. `credentialFile must be an absolute path`; it must be a regular file owned by the current user, not a symlink, with `0600` permissions. |\n| `stateDir` | No | Absolute private directory for host runtime state. When omitted, it defaults beside the credential file. The runtime also creates a generated sandbox config directory under this state directory. |\n| `pools` | Yes | One to 64 pool definitions. A config with no pools is invalid for `flakes host run`. |\n\n### Pool Fields\n\n| Field | Required | Meaning |\n| --- | --- | --- |\n| `poolKey` | Yes | Stable pool identifier advertised to Flakes. Must be unique within the host config. |\n| `provider` | Implied | The current provider is `matchlock`. It is advertised as `provider: "matchlock"`; it is not a required TOML field. |\n| `matchlockImage` | Yes | Local MatchLock image or template used by the host to launch sandboxes. This is local-only and is not sent in the sanitized pool advertisement. |\n| `mounts` | No | Local mount strings passed to the provider. These stay on the host. |\n| `adapter` | Yes | Adapter the sandbox should run, such as `pi` or `harness`. This is advertised for scheduling. |\n| `maxInstances` | Yes | Positive integer limit for provider instances in the pool. |\n| `maxConcurrency` | Yes | Positive integer limit for concurrent work in each advertised sandbox config. |\n| `advertisedCapabilities` | Yes | Up to 64 scheduling capability strings, such as `pi`, `node`, or `mac`. These become advertised as `capabilities`. |\n| `resourceBounds` | No | Small sanitized record for scheduler-facing bounds, such as CPU or memory. Oversized or unsafe records are rejected. |\n| `env` | No | Local environment variables for provider startup. These are local-only and are not advertised. |\n| `executablePaths.matchlock` | Yes | Absolute path to the MatchLock executable. It must exist, be a file, be executable, and not be a symlink. |\n| `executablePaths.<name>` | No | Additional executable paths, for example `flakes`. These are local-only. |\n\n### Sanitized Pool Advertisement\n\nThe host sends only a sanitized pool advertisement to the control plane:\n\n- `poolKey`\n- `provider`\n- `adapter`\n- `maxInstances`\n- `maxConcurrency`\n- `capabilities`\n- sanitized `resourceBounds`, when present\n\nLocal-only fields stay on the host: `matchlockImage`, `mounts`, `env`,\n`credentialFile`, `stateDir`, `executablePaths`, and the derived Project\nworkspace paths. Do not rely on those fields appearing in the console or API\npool responses.\n\n`workspace` is rejected inside `[[pools]]`. Configure Project placement with\n`PUT /v1/hosts/:hostId/project-workspace-root` or\n`flakes host project-root set`, then bind Projects to allowed pool keys.\n\n## Selected API Reference\n\nThis section is for integrators. Ordinary users should prefer the console and\nCLI workflows above. Unless noted otherwise, routes use `/v1`, require a user\nbearer credential for the same hosted origin, and are scoped to the authenticated\nowner.\n\n### Projects\n\n| Route | Use |\n| --- | --- |\n| `GET /v1/projects` | List owned Projects. Archived Projects remain visible unless a client filters them. |\n| `PUT /v1/projects/:projectKey` | Create or idempotently read a Project. Body includes `projectKey`, `name`, and optional user metadata. |\n| `GET /v1/projects/:projectKey` | Read one owned Project by key. |\n| `PATCH /v1/projects/:projectKey` | Update safe Project display fields such as `name` and user metadata. The key is immutable. |\n| `POST /v1/projects/:projectKey/archive` | Archive an owned Project. Archived Projects cannot be used for new run creation or new host bindings. |\n\nProject DTOs include `projectId`, `projectKey`, `name`, `status`, timestamps,\nand user metadata. Project identity is stored as Project fields on runs and\ntasks; do not encode it into a generic metadata value.\n\n### Runs And Tasks\n\n| Route | Use |\n| --- | --- |\n| `PUT /v1/runs/:runKey` | Create or idempotently read a Project-scoped run by stable key. Body includes `name` and either `projectKey` or `projectId`. |\n| `GET /v1/runs?projectKey=<project-key>&state=<state>&cursor=<cursor>&limit=<n>` | List owned runs, optionally filtered by Project key and state. |\n| `GET /v1/runs/:runId` | Read one owned run by run ID. |\n| `DELETE /v1/runs/:runId` | Delete an owned run after cancel delivery is attempted for live tasks. |\n| `POST /v1/runs/:runKey/close` | Close a run so no more top-level work can be admitted. |\n| `GET /v1/runs/:runId/tasks` | List tasks with workpad metadata for console task overview screens. |\n| `PUT /v1/runs/:runKey/tasks/:taskKey` | Save a task before admission. Body includes task metadata, target adapter, input, dependencies, capabilities, and grants. |\n| `POST /v1/runs/:runKey/tasks/admit` | Admit selected task keys or all saved tasks. |\n| `GET /v1/tasks/:taskId` | Read one task. |\n| `POST /v1/tasks/:taskId/cancel` | Request cancellation for a live task and record task state. |\n| `GET /v1/tasks/:taskId/logs` | Read bounded task logs. |\n| `GET /v1/tasks/:taskId/activity` | Read activity events such as workpad updates, human input, and permission events. |\n\n### Workpads, Messages, And Permissions\n\n| Route | Use |\n| --- | --- |\n| `GET /v1/tasks/:taskId/workpad` | Read the current task workpad. |\n| `PUT /v1/tasks/:taskId/workpad` | Save Markdown with `bodyMarkdown` and `baseVersion`. A stale version returns `workpad_version_conflict` with the current workpad. Workpads are limited to 512 KiB. |\n| `POST /v1/tasks/:taskId/messages` | Queue `follow_up` or `steer` input for a running task. Messages must be non-empty and at most 20000 characters. |\n| `POST /v1/tasks/:taskId/permissions/:permissionRequestId/respond` | Send `approved` or `denied` for a permission request. A request accepts only one answer and must still belong to the active assignment. |\n| `GET /v1/tasks/:taskId/rounds/:roundKey/outputs/:outputKey/fetch` | Read a bounded JSON or text live-round output. |\n| `GET /v1/tasks/:taskId/rounds/:roundKey/outputs/:outputKey/workspace` | Resolve a live-round workspace output handle. |\n\n### Hosts\n\n| Route | Use |\n| --- | --- |\n| `GET /v1/hosts` | List owned hosts. |\n| `POST /v1/hosts` | Create a host record directly for integrator workflows that do not need the CLI to mint a local host credential. |\n| `POST /v1/hosts/setup` | Create a host and its first host-scoped credential in one transaction. Requires direct user bearer auth and returns the raw credential exactly once for CLI persistence. |\n| `GET /v1/hosts/:hostId` | Read one owned host. |\n| `PATCH /v1/hosts/:hostId` | Update safe display fields and user metadata. Runtime, adapter, path, env, image, provider, and status metadata keys are rejected. |\n| `PUT /v1/hosts/:hostId/project-workspace-root` | Store an absolute host-local Project root. The control plane stores the string and does not perform filesystem checks. |\n| `PUT /v1/hosts/:hostId/project-bindings/:projectKey` | Bind an active owned Project to one or more existing pool keys on the owned host. Body includes `poolKeys`. |\n| `GET /v1/hosts/:hostId/project-bindings` | List Project bindings for the host, including derived `workspacePath`, allowed `poolKeys`, availability, and validation reason. |\n| `POST /v1/hosts/:hostId/disable` | Disable a host. Disabled hosts cannot claim new work. |\n| `DELETE /v1/hosts/:hostId` | Delete a host only when active lifecycle state no longer blocks deletion. |\n| `GET /v1/hosts/:hostId/pools` | Read pools synced from the running host. There is no user-facing pool write route; edit host TOML and restart or reconnect the host. |\n| `GET /v1/hosts/:hostId/credentials` | List redacted host credential summaries. |\n| `GET /v1/hosts/:hostId/credentials/:hostCredentialId` | Read one redacted host credential summary. |\n| `POST /v1/hosts/:hostId/credentials/rotate` | Rotate a host credential. Requires direct user bearer auth and returns the raw replacement credential once. |\n| `POST /v1/hosts/:hostId/credentials/:hostCredentialId/revoke` | Revoke a host credential. |\n\nHost setup and credential rotation require direct user bearer auth. Do not send\nthose requests through the browser console proxy.\n\n### Sandbox Fleet\n\n| Route | Use |\n| --- | --- |\n| `GET /v1/sandboxes` | List owned fleet entries, including lifecycle status and retained sandbox liveness status when present. |\n| `GET /v1/sandboxes/:sandboxId` | Read one owned fleet entry. Missing and wrong-owner sandboxes return `404`. |\n| `DELETE /v1/sandboxes/:sandboxId` | Delete a stale owned entry immediately when no provider resource remains, or queue provider cleanup when one does. Returns `deleted`, `cleanup_queued`, `404`, or `409 sandbox_delete_blocked`. |\n| `POST /v1/sandboxes/:sandboxId/drain` | Mark an owned running entry as draining and clear unaccepted assignments. |\n| `POST /v1/sandboxes/:sandboxId/stop` | Start the stop path for an owned provider-backed entry. |\n\nDelete is intentionally owner-scoped. A stale entry can be deleted when it has\nno live sandbox stream and no accepted running work. Entries in unsafe lifecycle\nstates return `409 sandbox_delete_blocked` with displayable blockers. If the\nentry still has a provider resource, Flakes marks it `deleting` and queues\nprovider cleanup; the Console keeps the row visible as `Cleanup queued` until\nthe cleanup succeeds and the durable row is removed.\n\nImmediate delete response:\n\n```json\n{\n "status": "deleted",\n "sandboxId": "sandbox_123",\n "instanceId": "managed_instance_123",\n "clearedAssignments": 0\n}\n```\n\nQueued cleanup response:\n\n```json\n{\n "status": "cleanup_queued",\n "sandboxId": "sandbox_123",\n "instanceId": "managed_instance_123",\n "clearedAssignments": 0\n}\n```\n\n### Artifacts And Run Outputs\n\n| Route | Use |\n| --- | --- |\n| `POST /v1/artifacts` | Create artifact metadata and optional inline bytes. |\n| `GET /v1/artifacts/:artifactId` | Read artifact metadata. |\n| `GET /v1/artifacts/:artifactId/fetch` | Fetch artifact bytes. |\n| `GET /v1/runs/:runId/artifacts` | List artifacts associated with a run. |\n| `GET /v1/runs/:runId/history.jsonl` | Export redacted run history as JSONL. |\n| `GET /v1/runs/:runId/file-reservations` | List file reservations visible for the run. |\n| `GET /v1/runs/:runId/metrics` | Read evaluation metrics for the run. |\n\nSandbox-scoped workspace, group, and live-round routes are runtime surfaces for\nadapters and harness execution. Integrators should normally use the CLI,\nselected client routes, or Harness SDK helpers instead of calling those routes\ndirectly.\n\n## Relevant Exports\n\nThe hosted API and CLI are the primary user boundary. These exports are useful\nonly for integrations, harness modules, adapters, or repository-local tooling.\n\n| Export | Use |\n| --- | --- |\n| `@flakes/harness-sdk` | Harness authors import `defineHarness`, use `HarnessContext`, and call helpers such as `ctx.group(...)`, `ctx.groups.open(...)`, `ctx.output.json(...)`, `ctx.outputs.readJson(...)`, `ctx.workpads.read(...)`, `ctx.workspace.commit(...)`, `ctx.workspace.promote(...)`, and `ctx.liveTasks.send(...)`. |\n| `@flakes/core` | Integrators that build typed payloads can reuse schemas and types for run/task IDs, saved tasks, task metadata, task groups, task spawn requests, workpads, file reservations, and workspace handles. Common names include `WorkspaceHandle`, `WorkspaceHandleSchema`, `TaskProductMetadataSchema`, and `TaskWorkpadPutRequestSchema`. |\n| `@flakes/protocol` | Runtime implementers can parse and validate sandbox and host stream messages with protocol schemas and safe parse helpers. Ordinary API clients do not need these types. |\n| `@flakes/cli` | Test harnesses or wrappers can call `runCli(...)` with injected IO and transport dependencies instead of shelling out. The installed binary remains `flakes`. |\n\nDo not treat this table as a package architecture guide. It lists only the\nexports a user, harness author, or integrator might reasonably need.\n',JS=`---
747
+ title: Running Workflows
748
+ description: Launching workflows, saving tasks, admitting ready work, and closing durable workflows.
749
+ ---
750
+
751
+ This section covers the Flakes workflow for creating and launching distributed
752
+ agent workflows. Use it after you can sign in at \`https://flakes.dev/console\`,
753
+ authorize the CLI, create a Project, and see enough connected host capacity
754
+ bound to that Project for the adapter you want to use.
755
+
756
+ ## The Model
757
+
758
+ A Project is the work namespace for related runs and the host workspace root
759
+ mapping used by task execution. Every new run belongs to exactly one active
760
+ Project. Project identity is a first-class run field, not run metadata.
761
+
762
+ A run is the durable container for one job inside a Project. It holds saved
763
+ tasks, admitted tasks, dependencies, task status, workpads, activity, artifacts,
764
+ and history. That durable task state lives in Flakes even if an agent process
765
+ exits, a sandbox disconnects, or a transient agent process starts again on
766
+ another assignment.
767
+
768
+ A saved task is a draft definition inside an open run. Save tasks while you are
769
+ still shaping the graph: title, Markdown body, acceptance criteria, target
770
+ adapter, dependencies, required capabilities, and any grants needed by a
771
+ planner or harness. Saved tasks are not schedulable yet.
772
+
773
+ Admission turns saved tasks into durable runtime work. After a task is
774
+ admitted, treat it as immutable user intent: do not expect to edit, delete, or
775
+ rewire it. Add another saved task before admission, or have an authorized
776
+ running task append children through its granted runtime tools.
777
+
778
+ Closing a run means no more top-level saved tasks should be admitted by the
779
+ client. Close does not stop work that is already admitted. With \`--wait\`, the
780
+ CLI waits for the run to reach a terminal state or until the timeout expires.
781
+ If the timeout expires, the run can still continue in the console.
782
+
783
+ ## Create A Run
784
+
785
+ This example uses the hosted user-auth flow. It assumes the CLI is already
786
+ installed and host capacity has been connected by you or your host operator.
787
+
788
+ \`\`\`bash
789
+ flakes auth login
790
+
791
+ flakes projects create --key alpha --name "Alpha"
792
+
793
+ flakes runs create --project alpha --key release-notes --name "Draft release notes"
794
+
795
+ flakes tasks save \\
796
+ --run release-notes \\
797
+ --key draft \\
798
+ --title "Draft release notes" \\
799
+ --adapter pi \\
800
+ --body "Read the shipped changes and draft concise release notes for users." \\
801
+ --acceptance "Notes describe user-visible changes" \\
802
+ --acceptance "Open questions are listed at the end" \\
803
+ --required-capability pi
804
+
805
+ flakes tasks save \\
806
+ --run release-notes \\
807
+ --key review \\
808
+ --title "Review release notes" \\
809
+ --adapter pi \\
810
+ --body "Review the draft for accuracy, missing risks, and unclear wording." \\
811
+ --depends-on draft \\
812
+ --acceptance "Review comments are actionable" \\
813
+ --required-capability pi
814
+
815
+ flakes tasks admit --run release-notes --all
816
+ flakes runs close release-notes --wait --timeout-ms 600000
817
+ \`\`\`
818
+
819
+ The first command authorizes the CLI against \`https://flakes.dev\`. The Project
820
+ is created under your account. The run is created inside that Project, the two
821
+ tasks are saved under stable keys, and the \`review\` task depends on \`draft\`.
822
+ Admission makes both tasks part of the durable graph. The close command tells
823
+ Flakes there is no more top-level work to add and then waits for the graph to
824
+ settle.
825
+
826
+ ## Shape The Graph
827
+
828
+ Use dependencies only for real ordering requirements. A task with unsatisfied
829
+ dependencies is not ready, even if capacity is available. In the example above,
830
+ \`review\` waits until \`draft\` is terminal according to the dependency policy
831
+ before it can run.
832
+
833
+ Use required capabilities to keep work on compatible capacity. A task that
834
+ requires \`pi\` should only be assigned to connected capacity that advertises the
835
+ \`pi\` capability and the matching adapter. The run Project must also be bound to
836
+ the host pool. If no connected host capacity can satisfy the Project, adapter,
837
+ and required capabilities, the task stays queued.
838
+
839
+ Acceptance criteria should be short, observable checks. The agent receives the
840
+ task title, body, and acceptance criteria as its brief, and the console shows
841
+ the same user-facing context on the task page.
842
+
843
+ ## Scheduling
844
+
845
+ Flakes schedules admitted, ready tasks to connected host capacity. A host
846
+ advertises sanitized pool capacity: adapter, capabilities, and concurrency,
847
+ not local paths, secrets, mounts, or private execution details. The scheduler
848
+ matches each queued task against its Project, ready dependencies, required
849
+ capabilities, and available concurrency.
850
+
851
+ Queued work usually means one of three things:
852
+
853
+ - a dependency has not finished;
854
+ - no connected host capacity currently matches the Project binding, adapter, or
855
+ required capabilities;
856
+ - matching capacity exists, but all concurrency is busy.
857
+
858
+ When capacity appears, Flakes can assign the task to a sandbox. The task then
859
+ moves through running status as the sandbox accepts the assignment and starts
860
+ the agent process. The process and its local session are transient. The task
861
+ record, status, workpad, activity, artifacts, and transcript pointers are the
862
+ durable state.
863
+
864
+ ## Dynamic Work
865
+
866
+ A trusted client should use \`flakes tasks save\` and \`flakes tasks admit\` for the
867
+ initial graph. A running planner or harness can append children only when its
868
+ admitted task includes the needed grants, such as \`flakes.tasks.spawn\` and the
869
+ task-group grants documented in [Harnesses](/docs/harnesses).
870
+
871
+ Spawned children are appended to the same run. They do not edit existing
872
+ accepted tasks, and they do not inherit broad graph-editing powers unless the
873
+ parent explicitly grants the runtime tools the workflow needs.
874
+
875
+ ## Close And Wait
876
+
877
+ Close a run when the client has admitted all intended top-level work. Keep the
878
+ run open while a planner is expected to add children. Close it after the
879
+ planner has created the work you want the scheduler to drain.
880
+
881
+ \`flakes runs close RUN_KEY --wait\` is useful for scripts and handoffs. It
882
+ returns the latest run body after the wait completes or times out, while the
883
+ console remains the best place to inspect detailed task state.
884
+
885
+ \`WAITING\` is different from queued capacity. A task in \`WAITING\` has yielded its
886
+ current assignment because it is waiting on durable state, such as a closed
887
+ task group. It is not schedulable until the wait condition is satisfied. When
888
+ the condition resolves, Flakes can resume the logical task from durable state
889
+ with a fresh assignment.
890
+ `,YS=`---
891
+ title: Troubleshooting
892
+ description: Diagnose hosted-console, CLI auth, host setup, scheduling, and task input failures.
893
+ ---
894
+
895
+ Start with the surface that failed: console sign-in, CLI auth, Project setup,
896
+ host setup, host runtime, task scheduling, or task interaction. Most failures
897
+ are caused by a missing credential, an invalid host config, a missing Project
898
+ binding, no matching host capacity, or a running task that no longer has a
899
+ connected sandbox.
900
+
901
+ ## Authentication And Device Login
902
+
903
+ ### Device authorization does not finish
904
+
905
+ Symptoms include:
906
+
907
+ - \`device authorization timed out\`
908
+ - \`device authorization denied\`
909
+ - \`device authorization expired\`
910
+
911
+ A browser page that no longer accepts the code is the same class of problem.
912
+
913
+ Run a fresh login:
914
+
915
+ \`\`\`bash
916
+ flakes auth login
917
+ \`\`\`
918
+
919
+ For remote shells, print the URL and code instead of opening a browser:
920
+
921
+ \`\`\`bash
922
+ flakes auth login --no-open
923
+ \`\`\`
924
+
925
+ If approval normally takes longer than five minutes, pass a longer timeout:
926
+
927
+ \`\`\`bash
928
+ flakes auth login --timeout-ms 600000
929
+ \`\`\`
930
+
931
+ Use the same Flakes account in the browser that started the device request. If
932
+ the request was denied or expired, start over; old device codes are not
933
+ recoverable.
934
+
935
+ ### CLI commands cannot find credentials
936
+
937
+ Common error text:
938
+
939
+ - \`No CLI credential found\`
940
+ - \`Stored CLI credential expired\`
941
+ - \`Stored CLI credential has invalid expiry metadata\`
942
+
943
+ Check the current status:
944
+
945
+ \`\`\`bash
946
+ flakes auth status
947
+ \`\`\`
948
+
949
+ Then log in again:
950
+
951
+ \`\`\`bash
952
+ flakes auth login
953
+ \`\`\`
954
+
955
+ If you intentionally changed accounts, remove the old local credential first:
956
+
957
+ \`\`\`bash
958
+ flakes auth logout
959
+ flakes auth login
960
+ \`\`\`
961
+
962
+ ## Projects And Host Placement
963
+
964
+ ### Run creation fails with a Project error
965
+
966
+ Every new run requires an active Project. Common error text includes
967
+ \`runs create requires --project\`, \`runs create requires projectKey or
968
+ projectId\`, \`project_not_found\`, or \`project_archived\`.
969
+
970
+ Create or choose an active Project, then create the run with \`--project\`:
971
+
972
+ \`\`\`bash
973
+ flakes projects create --key alpha --name "Alpha"
974
+ flakes runs create --project alpha --key release-notes --name "Draft release notes"
975
+ \`\`\`
976
+
977
+ Archived Projects remain visible for history, but they cannot accept new runs
978
+ or new host bindings. Create a new Project key for new work.
979
+
980
+ ### Project is not schedulable on a host
981
+
982
+ If a run exists but tasks stay queued, first confirm that the host has connected
983
+ and advertised the pool key you want to use:
984
+
985
+ \`\`\`bash
986
+ flakes host status --config <host.toml> --json
987
+ \`\`\`
988
+
989
+ If the pool key is present, bind the Project to that discovered pool:
990
+
991
+ \`\`\`bash
992
+ flakes host project-root set --config <host.toml> --path /srv/flakes/projects
993
+ flakes projects bind-host alpha --host <host-id> --pool local-pi
994
+ \`\`\`
995
+
996
+ Inspect binding availability in the console host placement panel or with
997
+ \`GET /v1/hosts/:hostId/project-bindings\`. \`flakes host status\` reports host,
998
+ pool, and credential state; it does not report Project binding availability.
999
+
1000
+ Common API errors:
1001
+
1002
+ - \`host_project_workspace_root_required\`: set the host Project root before
1003
+ binding a Project to that host.
1004
+ - \`unknown_host_pool_keys\`: bind only pool keys currently advertised by the
1005
+ host. Start \`flakes host run --config <host.toml>\` and wait for the pool to
1006
+ appear in host status or the console before retrying.
1007
+ - \`project_archived\`: bind only active Projects.
1008
+
1009
+ The control plane stores the Project root path as host metadata. The running
1010
+ host validates the derived local Project directory, such as
1011
+ \`/srv/flakes/projects/alpha\`, and reports whether the binding is available.
1012
+
1013
+ ## Host Setup And Config
1014
+
1015
+ ### Host setup fails before writing files
1016
+
1017
+ \`flakes host setup\` refuses to overwrite an existing config or credential file.
1018
+ Move the existing file, or pass new paths:
1019
+
1020
+ \`\`\`bash
1021
+ flakes host setup \\
1022
+ --config <host.toml> \\
1023
+ --credential-file <host.credential> \\
1024
+ --state-dir <host-state>
1025
+ \`\`\`
1026
+
1027
+ The config path, credential file path, and state directory must be distinct.
1028
+ They cannot point at the same file or nest inside each other in a way that
1029
+ makes setup ambiguous.
1030
+
1031
+ ### Host setup request fails
1032
+
1033
+ Common error text includes \`host setup failed with HTTP ...\`,
1034
+ \`host setup requires direct user bearer auth\`,
1035
+ \`direct_user_auth_required\`, or \`host_credentials_not_configured\`.
1036
+
1037
+ Recover by checking these items:
1038
+
1039
+ - Run \`flakes auth status\`; if it is not
1040
+ authenticated, run \`flakes auth login\`.
1041
+ - Run setup directly from the CLI. The setup request requires direct user bearer
1042
+ auth and should not be sent through the browser console proxy.
1043
+ - If setup failed after the server created a credential but before local files
1044
+ were written, the CLI attempts to revoke that newly created credential. Remove
1045
+ partial local files and rerun setup.
1046
+
1047
+ ### Host config is invalid
1048
+
1049
+ \`flakes host status --config <host.toml>\` reports \`host config is invalid\` when
1050
+ the runtime cannot load or validate the config. The most common causes are:
1051
+
1052
+ - \`controlPlaneUrl\` is missing, malformed, or uses plaintext HTTP. Host control
1053
+ URLs must use HTTPS.
1054
+ - \`hostId\` is missing or not a valid identifier.
1055
+ - \`credentialFile\` is missing, is not absolute, is a symlink, is not owned by
1056
+ the current user, or \`credentialFile must have 0600 permissions\`.
1057
+ - \`stateDir\` is not an absolute private directory.
1058
+ - \`at least one pool is required\`.
1059
+ - \`workspace\` appears inside a \`[[pools]]\` entry. Remove it, set the host
1060
+ Project root with \`flakes host project-root set\`, and bind Projects with
1061
+ \`flakes projects bind-host\`.
1062
+ - \`executablePaths.matchlock\` is missing, is not absolute, is a symlink, or is
1063
+ not executable.
1064
+ - \`maxInstances\` or \`maxConcurrency\` is not a positive integer.
1065
+
1066
+ Validate the local and remote view:
1067
+
1068
+ \`\`\`bash
1069
+ flakes host status --config <host.toml> --json
1070
+ \`\`\`
1071
+
1072
+ If local validation passes but remote status is not checked, the hosted CLI user
1073
+ credential is missing or expired. Run \`flakes auth status\`, then re-run
1074
+ \`flakes auth login\` if needed. Remote host status uses the hosted control plane
1075
+ and the \`hostId\` from the local config.
1076
+
1077
+ ### Host rotation succeeds but work does not launch
1078
+
1079
+ \`flakes host rotate --config <host.toml>\` writes a new host credential and
1080
+ retires the replaced credential. Restart the host process after rotation:
1081
+
1082
+ \`\`\`bash
1083
+ flakes host rotate --config <host.toml>
1084
+ flakes host run --config <host.toml>
1085
+ \`\`\`
1086
+
1087
+ Old active streams cannot claim new launch work after the replaced credential
1088
+ is retired. A restart makes the host reconnect with the new credential.
1089
+
1090
+ ## Scheduling And Runtime
1091
+
1092
+ ### No matching host capacity
1093
+
1094
+ If the console shows \`No matching host capacity\` or tasks stay \`queued\`, compare
1095
+ the task requirements with the connected host pools:
1096
+
1097
+ \`\`\`bash
1098
+ flakes host status --config <host.toml> --json
1099
+ \`\`\`
1100
+
1101
+ Check:
1102
+
1103
+ - The host is \`online\`, not \`offline\` or \`disabled\`.
1104
+ - The run was created with the expected Project, such as
1105
+ \`flakes runs create --project alpha --key <run-key> --name <name>\`.
1106
+ - Host status or the console shows the expected pool key from the running host.
1107
+ - The console host placement panel or
1108
+ \`GET /v1/hosts/:hostId/project-bindings\` shows the Project bound to this host
1109
+ with at least one allowed pool.
1110
+ - The host has a configured Project root and the derived Project directory
1111
+ exists locally.
1112
+ - At least one pool advertises the task adapter, such as \`pi\` or \`harness\`.
1113
+ - The pool advertises every \`--required-capability\` used by the task.
1114
+ - The pool is not already at its \`maxInstances\` or \`maxConcurrency\` limit.
1115
+ - \`flakes host run --config <host.toml>\` is still running.
1116
+ - A sandbox has connected back and become schedulable after startup.
1117
+
1118
+ Saved tasks do not run until they are admitted. If a task is only saved, run:
1119
+
1120
+ \`\`\`bash
1121
+ flakes tasks admit --run <run-key> <task-key>
1122
+ \`\`\`
1123
+
1124
+ ### Queued tasks do not start
1125
+
1126
+ A queued task is waiting for prerequisites. Common causes:
1127
+
1128
+ - The run has saved tasks that were never admitted.
1129
+ - The task depends on another task that has not finished successfully.
1130
+ - The task requests capabilities that no online pool advertises.
1131
+ - The run was closed after admission but no matching capacity is available.
1132
+ - The host process exited or lost connectivity.
1133
+
1134
+ Use the run and task views in the console first. From the CLI, inspect the run
1135
+ or task and read logs for a running task:
1136
+
1137
+ \`\`\`bash
1138
+ flakes inspect <run-id-or-key>
1139
+ flakes inspect <task-id> --task
1140
+ flakes logs <task-id>
1141
+ \`\`\`
1142
+
1143
+ ### Offline sandboxes block messages or permissions
1144
+
1145
+ When a task interaction returns \`sandbox_offline\` or \`task sandbox is not
1146
+ connected\`, the task record still points at a sandbox but the sandbox stream is
1147
+ not connected.
1148
+
1149
+ Recover by:
1150
+
1151
+ - Checking whether the host is still running.
1152
+ - Reading host status and pool status with \`flakes host status --config
1153
+ <host.toml> --json\`.
1154
+ - Restarting \`flakes host run --config <host.toml>\` if the process exited.
1155
+ - Waiting for the scheduler to retry if the task is retryable.
1156
+ - Creating follow-up work in a new task if the original task reached a
1157
+ terminal state.
1158
+
1159
+ ## Task Input And Permissions
1160
+
1161
+ ### Follow-up or steer input is rejected
1162
+
1163
+ The task messages API accepts only running tasks on connected sandboxes.
1164
+ Messages must be non-empty, at most 20000 characters, and use mode \`follow_up\`
1165
+ or \`steer\`.
1166
+
1167
+ If the console input box is disabled, check the task state:
1168
+
1169
+ - \`queued\`: wait for capacity or fix host matching.
1170
+ - \`running\`: the task can receive input only while its sandbox is connected.
1171
+ - \`waiting\`: the task is waiting on durable workflow state; use the harness or
1172
+ wait condition instead of sending arbitrary input.
1173
+ - terminal states: create follow-up work in a new task or run.
1174
+
1175
+ ### Permission prompt cannot be answered
1176
+
1177
+ Permission responses require a running task, a connected sandbox, and an
1178
+ unanswered request that still belongs to the active assignment.
1179
+
1180
+ Common API errors:
1181
+
1182
+ - \`permission_already_responded\`: someone already answered this request. Read
1183
+ task activity for the accepted response.
1184
+ - \`permission_stale_assignment\`: the request belonged to older work and cannot
1185
+ be answered for the current assignment.
1186
+ - \`task_not_running\`: the task is no longer running on an active sandbox.
1187
+ - \`sandbox_offline\`: the task sandbox is not connected.
1188
+
1189
+ Use the console prompt when it is visible. If no prompt is visible but activity
1190
+ shows \`permission.requested\`, answer through the integration that owns the
1191
+ prompt or wait for the task to fail and create follow-up work.
1192
+
1193
+ ### Workpad save conflicts
1194
+
1195
+ \`workpad_version_conflict\` means another user or agent saved a newer workpad
1196
+ after your base version. Pull or read the latest workpad, merge your changes,
1197
+ and save again with the latest version:
1198
+
1199
+ \`\`\`bash
1200
+ flakes tasks workpad show <task-id>
1201
+ flakes tasks workpad save <task-id> --file <workpad.md> --base-version <latest-version>
1202
+ \`\`\`
1203
+
1204
+ Inside a running task, \`flakes tasks workpad push\` writes the latest conflicting
1205
+ body and version to \`workpad.current.md\` and \`workpad.current.version\`. Merge
1206
+ those changes before retrying.
1207
+ `,XS={title:`Flakes`,pages:[`index`,`cli`,`connect-a-host`,`run-work`,`observe-and-steer`,`harnesses`,`concepts`,`reference`,`troubleshooting`]},ZS={title:`Reference`,pages:[`index`]},QS=Object.assign({"../../../../docs/content/docs/cli.mdx":VS,"../../../../docs/content/docs/concepts.mdx":HS,"../../../../docs/content/docs/connect-a-host.mdx":US,"../../../../docs/content/docs/harnesses.mdx":WS,"../../../../docs/content/docs/index.mdx":GS,"../../../../docs/content/docs/observe-and-steer.mdx":KS,"../../../../docs/content/docs/reference/index.mdx":qS,"../../../../docs/content/docs/run-work.mdx":JS,"../../../../docs/content/docs/troubleshooting.mdx":YS}),$S=Object.assign({"../../../../docs/content/docs/meta.json":XS,"../../../../docs/content/docs/reference/meta.json":ZS}),eC=new Map(Object.entries(QS).map(([e,t])=>[mC(e),t])),tC=new Map(Object.entries($S).map(([e,t])=>[hC(e),t])),nC=uC(),rC=new Map(nC.map(e=>[e.path,e])),iC=dC(``);nC[0]?.slug;var aC=nC[0]?.path??``;function oC(e){return nC.find(t=>t.slug===e||t.path===gC(e))}function sC(e){return rC.get(gC(e??``))}function cC(e){return typeof e==`string`?(sC(e)??oC(e))?.path??aC:aC}function lC(e){if(e===void 0)return;let[t]=e.split(/[?#]/);if(t===void 0||t.startsWith(`#`)||t.startsWith(`http`))return;let n=gC(t);return rC.has(n)?n:void 0}function uC(){let e=[],t=new Set;function n(n,r){if(t.has(n))return;let i=eC.get(n);if(i===void 0)return;let a=bC(i),o=yC(n,e);e.push({slug:o,path:n,title:a.frontmatter.title??CC(n),description:a.frontmatter.description??``,body:a.body,...r?{groupTitle:r}:{}}),t.add(n)}function r(e){let t=tC.get(e),i=e?t?.title:void 0,a=t?.pages??fC(e);for(let t of a){let a=_C(e,t);n(t===`index`?e:a,i),t!==`index`&&tC.has(a)&&r(a)}}r(``);for(let e of[...eC.keys()].sort((e,t)=>e.localeCompare(t)))n(e,vC(e));return e}function dC(e){let t=tC.get(e)?.pages??fC(e),n=[];for(let r of t){let t=_C(e,r),i=r===`index`?e:t,a=rC.get(i);if(a!==void 0){n.push({type:`page`,page:a});continue}if(tC.has(t)){let e=dC(t);e.length>0&&n.push({type:`folder`,key:`folder-${t}`,path:t,title:tC.get(t)?.title??CC(t),children:e})}}return n}function fC(e){let t=e?`${e}/`:``,n=new Set;for(let e of eC.keys()){if(!e.startsWith(t))continue;let r=e.slice(t.length);if(!r){n.add(`index`);continue}n.add(r.split(`/`)[0]??r)}for(let r of tC.keys()){if(!r.startsWith(t)||r===e)continue;let i=r.slice(t.length);n.add(i.split(`/`)[0]??i)}return[...n].sort((e,t)=>e.localeCompare(t))}function pC(e){let t=e.replace(/\\/g,`/`),n=t.indexOf(`docs/content/docs/`);return n===-1?t:t.slice(n+18)}function mC(e){return gC(pC(e).replace(/\.mdx$/,``))}function hC(e){return gC(pC(e).replace(/\/?meta\.json$/,``))}function gC(e){let t=e.replace(/\\/g,`/`).replace(/^\/docs\/?/,``).replace(/^docs\/?/,``).replace(/^\/+/,``).replace(/\/+$/,``);return t===``||t===`index`||t===`overview`?``:t.replace(/\/index$/,``)}function _C(e,t){return e?`${e}/${t}`:t}function vC(e){let t=e.split(`/`).slice(0,-1).join(`/`);return t?tC.get(t)?.title:void 0}function yC(e,t){let n=e===``?`overview`:e.split(`/`).at(-1)??e;if(!t.some(e=>e.slug===n))return n;let r=e.replaceAll(`/`,`-`)||`overview`;if(!t.some(e=>e.slug===r))return r;let i=2;for(;t.some(e=>e.slug===`${r}-${i}`);)i+=1;return`${r}-${i}`}function bC(e){let t=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(e);return t===null?{frontmatter:{},body:e.trim()}:{frontmatter:xC(t[1]??``),body:e.slice(t[0].length).trim()}}function xC(e){let t={};for(let n of e.split(/\r?\n/)){let e=n.indexOf(`:`);if(e===-1)continue;let r=n.slice(0,e).trim();r!==`title`&&r!==`description`||(t[r]=SC(n.slice(e+1).trim()))}return t}function SC(e){return e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`)?e.slice(1,-1):e}function CC(e){return(e===``?`overview`:e.split(`/`).at(-1)??e).split(`-`).map(e=>`${e.slice(0,1).toUpperCase()}${e.slice(1)}`).join(` `)}var wC=V(`/documentation`)({validateSearch:e=>typeof e.doc==`string`?{doc:e.doc}:{},beforeLoad:({search:e})=>{if(e.doc===void 0)return;let t=oC(e.doc)??oC(cC(e.doc));throw t===void 0||t.path===aC?oe({to:`/documentation`,replace:!0}):oe({to:`/documentation/$`,params:{_splat:t.path},replace:!0})},component:po(()=>mS(()=>import(`./documentation-6ao_Ux6x.js`),__vite__mapDeps([19,4,1,20,2,3,21,5,22,23])),`component`)}),TC=V(`/device`)({validateSearch:e=>({user_code:typeof e.user_code==`string`?e.user_code:``}),component:po(()=>mS(()=>import(`./device-BajR3eSF.js`),__vite__mapDeps([24,1,2,3,4,5,6,25,26,27,8,9,7,10,11,12])),`component`)}),EC=V(`/$`)({beforeLoad:()=>{throw oe({to:`/runs`,replace:!0})}}),DC=V(`/`)({beforeLoad:()=>{throw oe({to:`/runs`,replace:!0})}}),OC=V(`/account/`)({component:po(()=>mS(()=>import(`./account-BWoGGXJw.js`),__vite__mapDeps([28,1,4,29,26,5,7,8,2,3,9,30,10,12])),`component`)}),kC=V(`/account/security`)({component:po(()=>mS(()=>import(`./security-DdQNcp6k.js`),__vite__mapDeps([31,1,4,29,26,5,7,8,2,3,9,30,10,12])),`component`)}),AC=V(`/runs/$runId`)({validateSearch:e=>{let t={},n=e.tab;(n===`artifacts`||n===`metrics`||n===`files`)&&(t.tab=n);let r=e.view;return(r===`timeline`||r===`sandboxes`)&&(t.view=r),t},component:po(()=>mS(()=>import(`./_runId-3ZZOAqUK.js`),__vite__mapDeps([32,1,4])),`component`)}),jC=V(`/documentation/$`)({loader:({params:e})=>{let t=sC(e._splat);if(t===void 0)throw ae();return{path:t.path}},component:po(()=>mS(()=>import(`./_-CM2hE2sZ.js`),__vite__mapDeps([33,4,1,20,2,3,21,5,22,23])),`component`)}),MC=V(`/runs/$runId/t/$taskId`)({validateSearch:e=>e.transcript===`raw`?{transcript:`raw`}:{},component:po(()=>mS(()=>import(`./_taskId-cy4RxW8Y.js`),__vite__mapDeps([34,1,4])),`component`)}),NC=bS.update({id:`/signup`,path:`/signup`,getParentRoute:()=>hS}),PC=xS.update({id:`/signin`,path:`/signin`,getParentRoute:()=>hS}),FC=SS.update({id:`/sandboxes`,path:`/sandboxes`,getParentRoute:()=>hS}),IC=CS.update({id:`/runs`,path:`/runs`,getParentRoute:()=>hS}),LC=RS.update({id:`/reset-password`,path:`/reset-password`,getParentRoute:()=>hS}),RC=zS.update({id:`/projects`,path:`/projects`,getParentRoute:()=>hS}),zC=BS.update({id:`/forgot-password`,path:`/forgot-password`,getParentRoute:()=>hS}),BC=wC.update({id:`/documentation`,path:`/documentation`,getParentRoute:()=>hS}),VC=TC.update({id:`/device`,path:`/device`,getParentRoute:()=>hS}),HC=EC.update({id:`/$`,path:`/$`,getParentRoute:()=>hS}),UC=DC.update({id:`/`,path:`/`,getParentRoute:()=>hS}),WC=OC.update({id:`/account/`,path:`/account/`,getParentRoute:()=>hS}),GC=kC.update({id:`/account/security`,path:`/account/security`,getParentRoute:()=>hS}),KC=AC.update({id:`/$runId`,path:`/$runId`,getParentRoute:()=>IC}),qC=jC.update({id:`/$`,path:`/$`,getParentRoute:()=>BC}),JC=MC.update({id:`/t/$taskId`,path:`/t/$taskId`,getParentRoute:()=>KC}),YC={DocumentationSplatRoute:qC},XC=BC._addFileChildren(YC),ZC={RunsRunIdTTaskIdRoute:JC},QC={RunsRunIdRoute:KC._addFileChildren(ZC)},$C={IndexRoute:UC,SplatRoute:HC,DeviceRoute:VC,DocumentationRoute:XC,ForgotPasswordRoute:zC,ProjectsRoute:RC,ResetPasswordRoute:LC,RunsRoute:IC._addFileChildren(QC),SandboxesRoute:FC,SigninRoute:PC,SignupRoute:NC,AccountSecurityRoute:GC,AccountIndexRoute:WC},ew=hS._addFileChildren($C);function tw(){return Do({routeTree:ew,basepath:`/console`,defaultPreload:`intent`,scrollRestoration:!0})}async function nw(){let e=await tw(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(_s),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:`console`,serializationAdapters:t}),e.state.matches.length||await Ho(e),e}async function rw(){let e=await nw();return window.$_TSR?.h(),e}var iw;function aw(){return iw||=rw(),(0,z.jsx)(Xa,{promise:iw,children:e=>(0,z.jsx)(Ao,{router:e})})}var ow=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,te());else{var t=n(l);t!==null&&O(x,t.startTime-e)}}var S=!1,C=-1,w=5,E=-1;function D(){return g?!0:!(e.unstable_now()-E<w)}function ee(){if(g=!1,S){var t=e.unstable_now();E=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&O(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=ee,te=function(){re.postMessage(null)}}else te=function(){_(ee,0)};function O(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,O(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),sw=t(((e,t)=>{t.exports=ow()})),cw=t((e=>{var t=sw(),r=n(),i=ve();function a(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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var O=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===O?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,k=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function ue(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function j(e,t){ce++,se[ce]=e.current,e.current=t}var de=le(null),fe=le(null),pe=le(null),me=le(null);function he(e,t){switch(j(pe,t),j(fe,e),j(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ue(de),j(de,e)}function ge(){ue(de),ue(fe),ue(pe)}function _e(e){e.memoizedState!==null&&j(me,e);var t=de.current,n=Hd(t,e.type);t!==n&&(j(fe,e),j(de,n))}function ye(e){fe.current===e&&(ue(de),ue(fe)),me.current===e&&(ue(me),Qf._currentValue=oe)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
1208
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
1209
+ `+be+e+xe}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
1210
+ `),l=s.split(`
1211
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
1212
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
1213
+ Error generating stack: `+e.message+`
1214
+ `+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-We(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=A.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function dt(e,t){var n=A.p;try{return A.p=e,t()}finally{A.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,ht=`__reactContainer$`+ft,gt=`__reactEvents$`+ft,_t=`__reactListeners$`+ft,vt=`__reactHandles$`+ft,yt=`__reactResources$`+ft,bt=`__reactMarker$`+ft;function xt(e){delete e[pt],delete e[mt],delete e[gt],delete e[_t],delete e[vt]}function St(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ht]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[pt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function Ct(e){if(e=e[pt]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Tt(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Et(e){e[bt]=!0}var Dt=new Set,Ot={};function kt(e,t){At(e,t),At(e+`Capture`,t)}function At(e,t){for(Ot[e]=t,e=0;e<t.length;e++)Dt.add(t[e])}var jt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Mt={},Nt={};function Pt(e){return De.call(Nt,e)?!0:De.call(Mt,e)?!1:jt.test(e)?Nt[e]=!0:(Mt[e]=!0,!1)}function Ft(e,t,n){if(Pt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function It(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Lt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Rt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Bt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vt(e){if(!e._valueTracker){var t=zt(e)?`checked`:`value`;e._valueTracker=Bt(e,t,``+e[t])}}function Ht(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=zt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ut(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Wt=/[\n"\\]/g;function Gt(e){return e.replace(Wt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Kt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Rt(t)):e.value!==``+Rt(t)&&(e.value=``+Rt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Jt(e,o,Rt(n)):Jt(e,o,Rt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Rt(s):e.removeAttribute(`name`)}function qt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Vt(e);return}n=n==null?``:``+Rt(n),t=t==null?n:``+Rt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Vt(e)}function Jt(e,t,n){t===`number`&&Ut(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Yt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Rt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Xt(e,t,n){if(t!=null&&(t=``+Rt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Rt(n)}function Zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ae(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Rt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Vt(e)}function Qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $t=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function en(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||$t.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function tn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&en(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&en(e,o,t[o])}function nn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var rn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),an=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function on(e){return an.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function sn(){}var cn=null;function ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var M=null,un=null;function dn(e){var t=Ct(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Kt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Gt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[mt]||null;if(!i)throw Error(a(90));Kt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ht(r)}break a;case`textarea`:Xt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Yt(e,!!n.multiple,t,!1)}}}var fn=!1;function N(e,t,n){if(fn)return e(t,n);fn=!0;try{return e(t)}finally{if(fn=!1,(M!==null||un!==null)&&(xu(),M&&(t=M,e=un,un=M=null,dn(t),e)))for(t=0;t<e.length;t++)dn(e[t])}}function pn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var mn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),hn=!1;if(mn)try{var gn={};Object.defineProperty(gn,"passive",{get:function(){hn=!0}}),window.addEventListener(`test`,gn,gn),window.removeEventListener(`test`,gn,gn)}catch{hn=!1}var _n=null,vn=null,yn=null;function bn(){if(yn)return yn;var e,t=vn,n=t.length,r,i=`value`in _n?_n.value:_n.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return yn=i.slice(e,1<r?1-r:void 0)}function xn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Sn(){return!0}function Cn(){return!1}function wn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Sn:Cn,this.isPropagationStopped=Cn,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Sn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Sn)},persist:function(){},isPersistent:Sn}),t}var Tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},En=wn(Tn),Dn=p({},Tn,{view:0,detail:0}),On=wn(Dn),kn,An,jn,Mn=p({},Dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Un,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==jn&&(jn&&e.type===`mousemove`?(kn=e.screenX-jn.screenX,An=e.screenY-jn.screenY):An=kn=0,jn=e),kn)},movementY:function(e){return`movementY`in e?e.movementY:An}}),Nn=wn(Mn),Pn=wn(p({},Mn,{dataTransfer:0})),Fn=wn(p({},Dn,{relatedTarget:0})),In=wn(p({},Tn,{animationName:0,elapsedTime:0,pseudoElement:0})),Ln=wn(p({},Tn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Rn=wn(p({},Tn,{data:0})),zn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Bn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Vn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vn[e])?!!t[e]:!1}function Un(){return Hn}var Wn=wn(p({},Dn,{key:function(e){if(e.key){var t=zn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=xn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Bn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Un,charCode:function(e){return e.type===`keypress`?xn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?xn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Gn=wn(p({},Mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Kn=wn(p({},Dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Un})),qn=wn(p({},Tn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Jn=wn(p({},Mn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Yn=wn(p({},Tn,{newState:0,oldState:0})),Xn=[9,13,27,32],Zn=mn&&`CompositionEvent`in window,Qn=null;mn&&`documentMode`in document&&(Qn=document.documentMode);var $n=mn&&`TextEvent`in window&&!Qn,er=mn&&(!Zn||Qn&&8<Qn&&11>=Qn),tr=` `,nr=!1;function rr(e,t){switch(e){case`keyup`:return Xn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ir(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ar=!1;function or(e,t){switch(e){case`compositionend`:return ir(t);case`keypress`:return t.which===32?(nr=!0,tr):null;case`textInput`:return e=t.data,e===tr&&nr?null:e;default:return null}}function sr(e,t){if(ar)return e===`compositionend`||!Zn&&rr(e,t)?(e=bn(),yn=vn=_n=null,ar=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return er&&t.locale!==`ko`?null:t.data;default:return null}}var cr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function lr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!cr[e.type]:t===`textarea`}function ur(e,t,n,r){M?un?un.push(r):un=[r]:M=r,t=Ed(t,`onChange`),0<t.length&&(n=new En(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var dr=null,fr=null;function pr(e){yd(e,0)}function mr(e){if(Ht(wt(e)))return e}function hr(e,t){if(e===`change`)return t}var gr=!1;if(mn){var _r;if(mn){var vr=`oninput`in document;if(!vr){var yr=document.createElement(`div`);yr.setAttribute(`oninput`,`return;`),vr=typeof yr.oninput==`function`}_r=vr}else _r=!1;gr=_r&&(!document.documentMode||9<document.documentMode)}function br(){dr&&(dr.detachEvent(`onpropertychange`,xr),fr=dr=null)}function xr(e){if(e.propertyName===`value`&&mr(fr)){var t=[];ur(t,fr,e,ln(e)),N(pr,t)}}function Sr(e,t,n){e===`focusin`?(br(),dr=t,fr=n,dr.attachEvent(`onpropertychange`,xr)):e===`focusout`&&br()}function Cr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return mr(fr)}function wr(e,t){if(e===`click`)return mr(t)}function Tr(e,t){if(e===`input`||e===`change`)return mr(t)}function Er(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Dr=typeof Object.is==`function`?Object.is:Er;function Or(e,t){if(Dr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!De.call(t,i)||!Dr(e[i],t[i]))return!1}return!0}function kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ar(e,t){var n=kr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=kr(n)}}function jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ut(e.document)}return t}function Nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Pr=mn&&`documentMode`in document&&11>=document.documentMode,Fr=null,Ir=null,Lr=null,Rr=!1;function zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rr||Fr==null||Fr!==Ut(r)||(r=Fr,`selectionStart`in r&&Nr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Lr&&Or(Lr,r)||(Lr=r,r=Ed(Ir,`onSelect`),0<r.length&&(t=new En(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Fr)))}function Br(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Vr={animationend:Br(`Animation`,`AnimationEnd`),animationiteration:Br(`Animation`,`AnimationIteration`),animationstart:Br(`Animation`,`AnimationStart`),transitionrun:Br(`Transition`,`TransitionRun`),transitionstart:Br(`Transition`,`TransitionStart`),transitioncancel:Br(`Transition`,`TransitionCancel`),transitionend:Br(`Transition`,`TransitionEnd`)},Hr={},Ur={};mn&&(Ur=document.createElement(`div`).style,`AnimationEvent`in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),`TransitionEvent`in window||delete Vr.transitionend.transition);function Wr(e){if(Hr[e])return Hr[e];if(!Vr[e])return e;var t=Vr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ur)return Hr[e]=t[n];return e}var Gr=Wr(`animationend`),Kr=Wr(`animationiteration`),qr=Wr(`animationstart`),Jr=Wr(`transitionrun`),Yr=Wr(`transitionstart`),Xr=Wr(`transitioncancel`),Zr=Wr(`transitionend`),Qr=new Map,$r=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);$r.push(`scrollEnd`);function ei(e,t){Qr.set(e,t),kt(t,[e])}var ti=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ni=[],ri=0,ii=0;function ai(){for(var e=ri,t=ii=ri=0;t<e;){var n=ni[t];ni[t++]=null;var r=ni[t];ni[t++]=null;var i=ni[t];ni[t++]=null;var a=ni[t];if(ni[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&li(n,i,a)}}function oi(e,t,n,r){ni[ri++]=e,ni[ri++]=t,ni[ri++]=n,ni[ri++]=r,ii|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function si(e,t,n,r){return oi(e,t,n,r),ui(e)}function ci(e,t){return oi(e,null,null,t),ui(e)}function li(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ui(e){if(50<fu)throw fu=0,pu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var di={};function fi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pi(e,t,n,r){return new fi(e,t,n,r)}function mi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hi(e,t){var n=e.alternate;return n===null?(n=pi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function gi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function _i(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)mi(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,de.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=pi(31,n,t,i),e.elementType=ee,e.lanes=o,e;case _:return vi(n.children,i,o,t);case v:s=8,i|=24;break;case y:return e=pi(12,n,t,i|2),e.elementType=y,e.lanes=o,e;case C:return e=pi(13,n,t,i),e.elementType=C,e.lanes=o,e;case w:return e=pi(19,n,t,i),e.elementType=w,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=pi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function vi(e,t,n,r){return e=pi(7,e,r,t),e.lanes=n,e}function yi(e,t,n){return e=pi(6,e,null,t),e.lanes=n,e}function bi(e){var t=pi(18,null,null,0);return t.stateNode=e,t}function xi(e,t,n){return t=pi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Si=new WeakMap;function P(e,t){if(typeof e==`object`&&e){var n=Si.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},Si.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var Ci=[],wi=0,Ti=null,Ei=0,Di=[],Oi=0,ki=null,Ai=1,ji=``;function Mi(e,t){Ci[wi++]=Ei,Ci[wi++]=Ti,Ti=e,Ei=t}function Ni(e,t,n){Di[Oi++]=Ai,Di[Oi++]=ji,Di[Oi++]=ki,ki=e;var r=Ai;e=ji;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ai=1<<32-We(t)+i|n<<i|r,ji=a+e}else Ai=1<<a|n<<i|r,ji=e}function Pi(e){e.return!==null&&(Mi(e,1),Ni(e,1,0))}function Fi(e){for(;e===Ti;)Ti=Ci[--wi],Ci[wi]=null,Ei=Ci[--wi],Ci[wi]=null;for(;e===ki;)ki=Di[--Oi],Di[Oi]=null,ji=Di[--Oi],Di[Oi]=null,Ai=Di[--Oi],Di[Oi]=null}function Ii(e,t){Di[Oi++]=Ai,Di[Oi++]=ji,Di[Oi++]=ki,Ai=t.id,ji=t.overflow,ki=e}var Li=null,F=null,I=!1,L=null,Ri=!1,zi=Error(a(519));function Bi(e){throw Ki(P(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),zi}function Vi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=sn),t=!0):t=!1,t||Bi(e,!0)}function Hi(e){for(Li=e.return;Li;)switch(Li.tag){case 5:case 31:case 13:Ri=!1;return;case 27:case 3:Ri=!0;return;default:Li=Li.return}}function Ui(e){if(e!==Li)return!1;if(!I)return Hi(e),I=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&F&&Bi(e),Hi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));F=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));F=uf(e)}else t===27?(t=F,Zd(e.type)?(e=lf,lf=null,F=e):F=t):F=Li?cf(e.stateNode.nextSibling):null;return!0}function Wi(){F=Li=null,I=!1}function Gi(){var e=L;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),L=null),e}function Ki(e){L===null?L=[e]:L.push(e)}var qi=le(null),Ji=null,Yi=null;function Xi(e,t,n){j(qi,t._currentValue),t._currentValue=n}function Zi(e){e._currentValue=qi.current,ue(qi)}function Qi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function $i(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Qi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Qi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function ea(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;Dr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===me.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&$i(t,e,n,r),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!Dr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function na(e){Ji=e,Yi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ra(e){return aa(Ji,e)}function ia(e,t){return Ji===null&&na(e),aa(e,t)}function aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Yi===null){if(e===null)throw Error(a(308));Yi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Yi=Yi.next=t;return n}var oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},sa=t.unstable_scheduleCallback,ca=t.unstable_NormalPriority,la={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ua(){return{controller:new oa,data:new Map,refCount:0}}function da(e){e.refCount--,e.refCount===0&&sa(ca,function(){e.controller.abort()})}var fa=null,pa=0,ma=0,ha=null;function ga(e,t){if(fa===null){var n=fa=[];pa=0,ma=dd(),ha={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return pa++,t.then(_a,_a),t}function _a(){if(--pa===0&&fa!==null){ha!==null&&(ha.status=`fulfilled`);var e=fa;fa=null,ma=0,ha=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function va(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ya=k.S;k.S=function(e,t){tu=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&ga(e,t),ya!==null&&ya(e,t)};var R=le(null);function ba(){var e=R.current;return e===null?K.pooledCache:e}function xa(e,t){t===null?j(R,R.current):j(R,t.pool)}function Sa(){var e=ba();return e===null?null:{parent:la._currentValue,pool:e}}var Ca=Error(a(460)),wa=Error(a(474)),Ta=Error(a(542)),Ea={then:function(){}};function Da(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Oa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(sn,sn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e;default:if(typeof t.status==`string`)t.then(sn,sn);else{if(e=K,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e}throw Aa=t,Ca}}function ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Aa=e,Ca):e}}var Aa=null;function ja(){if(Aa===null)throw Error(a(459));var e=Aa;return Aa=null,e}function Ma(e){if(e===Ca||e===Ta)throw Error(a(483))}var Na=null,Pa=0;function Fa(e){var t=Pa;return Pa+=1,Na===null&&(Na=[]),Oa(Na,e,t)}function Ia(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function La(e,t){throw t.$$typeof===m?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ra(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=hi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=yi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===_?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===D&&ka(a)===t.type)?(t=i(t,n.props),Ia(t,n),t.return=e,t):(t=_i(n.type,n.key,n.props,null,e.mode,r),Ia(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=xi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=vi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=yi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=_i(t.type,t.key,t.props,null,e.mode,n),Ia(n,t),n.return=e,n;case g:return t=xi(t,e.mode,n),t.return=e,t;case D:return t=ka(t),f(e,t,n)}if(ae(t)||re(t))return t=vi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Fa(t),n);if(t.$$typeof===x)return f(e,ia(e,t),n);La(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case h:return n.key===i?l(e,t,n,r):null;case g:return n.key===i?u(e,t,n,r):null;case D:return n=ka(n),p(e,t,n,r)}if(ae(n)||re(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Fa(n),r);if(n.$$typeof===x)return p(e,t,ia(e,n),r);La(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case h:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case g:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=ka(r),m(e,t,n,r,i)}if(ae(r)||re(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Fa(r),i);if(r.$$typeof===x)return m(e,t,n,ia(t,r),i);La(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),I&&Mi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return I&&Mi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),I&&Mi(i,h),l}function y(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),I&&Mi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return I&&Mi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),I&&Mi(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&ka(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===_?(c=vi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=_i(o.type,o.key,o.props,null,e.mode,c),Ia(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=xi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=ka(o),b(e,r,o,c)}if(ae(o))return v(e,r,o,c);if(re(o)){if(l=re(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Fa(o),c);if(o.$$typeof===x)return b(e,r,ia(e,o),c);La(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=yi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=b(e,t,n,r);return Na=null,i}catch(t){if(t===Ca||t===Ta)throw t;var a=pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var za=Ra(!0),Ba=Ra(!1),Va=!1;function Ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ui(e),li(e,null,n),t}return oi(e,r,t,n),ui(e)}function Ka(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ja=!1;function z(){if(Ja){var e=ha;if(e!==null)throw e}}function B(e,t,n,r){Ja=!1;var i=e.updateQueue;Va=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(J&f)===f:(r&f)===f){f!==0&&f===ma&&(Ja=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Va=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Kl|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ya(n[e],t)}var Za=le(null),Qa=le(0);function $a(e,t){e=Wl,j(Qa,e),j(Za,t),Wl=e|t.baseLanes}function eo(){j(Qa,Wl),j(Za,Za.current)}function to(){Wl=Qa.current,ue(Za),ue(Qa)}var no=le(null),ro=null;function io(e){var t=e.alternate;j(lo,lo.current&1),j(no,e),ro===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(ro=e)}function ao(e){j(lo,lo.current),j(no,e),ro===null&&(ro=e)}function oo(e){e.tag===22?(j(lo,lo.current),j(no,e),ro===null&&(ro=e)):so(e)}function so(){j(lo,lo.current),j(no,no.current)}function co(e){ue(no),ro===e&&(ro=null),ue(lo)}var lo=le(0);function uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var V=0,H=null,U=null,fo=null,po=!1,mo=!1,ho=!1,go=0,_o=0,vo=null,yo=0;function bo(){throw Error(a(321))}function xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dr(e[n],t[n]))return!1;return!0}function So(e,t,n,r,i,a){return V=a,H=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?zs:Bs,ho=!1,a=n(r,i),ho=!1,mo&&(a=wo(t,n,r,i)),Co(e),a}function Co(e){k.H=Rs;var t=U!==null&&U.next!==null;if(V=0,fo=U=H=null,po=!1,_o=0,vo=null,t)throw Error(a(300));e===null||rc||(e=e.dependencies,e!==null&&ta(e)&&(rc=!0))}function wo(e,t,n,r){H=e;var i=0;do{if(mo&&(vo=null),_o=0,mo=!1,25<=i)throw Error(a(301));if(i+=1,fo=U=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=Vs,o=t(n,r)}while(mo);return o}function To(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Mo(t):t,e=e.useState()[0],(U===null?null:U.memoizedState)!==e&&(H.flags|=1024),t}function Eo(){var e=go!==0;return go=0,e}function Do(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Oo(e){if(po){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}po=!1}V=0,fo=U=H=null,mo=!1,_o=go=0,vo=null}function ko(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fo===null?H.memoizedState=fo=e:fo=fo.next=e,fo}function Ao(){if(U===null){var e=H.alternate;e=e===null?null:e.memoizedState}else e=U.next;var t=fo===null?H.memoizedState:fo.next;if(t!==null)fo=t,U=e;else{if(e===null)throw H.alternate===null?Error(a(467)):Error(a(310));U=e,e={memoizedState:U.memoizedState,baseState:U.baseState,baseQueue:U.baseQueue,queue:U.queue,next:null},fo===null?H.memoizedState=fo=e:fo=fo.next=e}return fo}function jo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mo(e){var t=_o;return _o+=1,vo===null&&(vo=[]),e=Oa(vo,e,t),t=H,(fo===null?t.memoizedState:fo.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?zs:Bs),e}function No(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Mo(e);if(e.$$typeof===x)return ra(e)}throw Error(a(438,String(e)))}function Po(e){var t=null,n=H.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=H.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=jo(),H.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=te;return t.index++,n}function Fo(e,t){return typeof t==`function`?t(e):t}function Io(e){return Lo(Ao(),U,e)}function Lo(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(V&f)===f:(J&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ma&&(d=!0);else if((V&p)===p){u=u.next,p===ma&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,H.lanes|=p,Kl|=p;f=u.action,ho&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,H.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Dr(o,e.memoizedState)&&(rc=!0,d&&(n=ha,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ro(e){var t=Ao(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Dr(o,t.memoizedState)||(rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function zo(e,t,n){var r=H,i=Ao(),o=I;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Dr((U||i).memoizedState,n);if(s&&(i.memoizedState=n,rc=!0),i=i.queue,us(Ho.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||fo!==null&&fo.memoizedState.tag&1){if(r.flags|=2048,as(9,{destroy:void 0},Vo.bind(null,r,i,n,t),null),K===null)throw Error(a(349));o||V&127||Bo(r,t,n)}return n}function Bo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=H.updateQueue,t===null?(t=jo(),H.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Vo(e,t,n,r){t.value=n,t.getSnapshot=r,Uo(t)&&Wo(e)}function Ho(e,t,n){return n(function(){Uo(t)&&Wo(e)})}function Uo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dr(e,n)}catch{return!0}}function Wo(e){var t=ci(e,2);t!==null&&gu(t,e,2)}function Go(e){var t=ko();if(typeof e==`function`){var n=e;if(e=n(),ho){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:e},t}function Ko(e,t,n,r){return e.baseState=n,Lo(e,U,typeof r==`function`?r:Fo)}function qo(e,t,n,r,i){if(Fs(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Jo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Jo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),Yo(e,t,s)}catch(n){Zo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),Yo(e,t,a)}catch(n){Zo(e,t,n)}}function Yo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Xo(e,t,n)},function(n){return Zo(e,t,n)}):Xo(e,t,n)}function Xo(e,t,n){t.status=`fulfilled`,t.value=n,Qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Jo(e,n)))}function Zo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Qo(t),t=t.next;while(t!==r)}e.action=null}function Qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $o(e,t){return t}function es(e,t){if(I){var n=K.formState;if(n!==null){a:{var r=H;if(I){if(F){b:{for(var i=F,a=Ri;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){F=cf(i.nextSibling),r=i.data===`F!`;break a}}Bi(r)}r=!1}r&&(t=n[0])}}return n=ko(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:t},n.queue=r,n=Ms.bind(null,H,r),r.dispatch=n,r=Go(!1),a=Ps.bind(null,H,!1,r.queue),r=ko(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=qo.bind(null,H,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ts(e){return ns(Ao(),U,e)}function ns(e,t,n){if(t=Lo(e,t,$o)[0],e=Io(Fo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Mo(t)}catch(e){throw e===Ca?Ta:e}else r=t;t=Ao();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(H.flags|=2048,as(9,{destroy:void 0},rs.bind(null,i,n),null)),[r,a,e]}function rs(e,t){e.action=t}function is(e){var t=Ao(),n=U;if(n!==null)return ns(t,n,e);Ao(),t=t.memoizedState,n=Ao();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function as(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=H.updateQueue,t===null&&(t=jo(),H.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function os(){return Ao().memoizedState}function ss(e,t,n,r){var i=ko();H.flags|=e,i.memoizedState=as(1|t,{destroy:void 0},n,r===void 0?null:r)}function cs(e,t,n,r){var i=Ao();r=r===void 0?null:r;var a=i.memoizedState.inst;U!==null&&r!==null&&xo(r,U.memoizedState.deps)?i.memoizedState=as(t,a,n,r):(H.flags|=e,i.memoizedState=as(1|t,a,n,r))}function ls(e,t){ss(8390656,8,e,t)}function us(e,t){cs(2048,8,e,t)}function ds(e){H.flags|=4;var t=H.updateQueue;if(t===null)t=jo(),H.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function fs(e){var t=Ao().memoizedState;return ds({ref:t,nextImpl:e}),function(){if(G&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ps(e,t){return cs(4,2,e,t)}function ms(e,t){return cs(4,4,e,t)}function hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gs(e,t,n){n=n==null?null:n.concat([e]),cs(4,4,hs.bind(null,t,e),n)}function _s(){}function vs(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ys(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&xo(t,r[1]))return r[0];if(r=e(),ho){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function bs(e,t,n){return n===void 0||V&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),H.lanes|=e,Kl|=e,n)}function xs(e,t,n,r){return Dr(n,t)?n:Za.current===null?!(V&42)||V&1073741824&&!(J&261930)?(rc=!0,e.memoizedState=n):(e=hu(),H.lanes|=e,Kl|=e,t):(e=bs(e,n,r),Dr(e,t)||(rc=!0),e)}function Ss(e,t,n,r,i){var a=A.p;A.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,Ps(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ns(e,t,va(c,r),mu(e)):Ns(e,t,r,mu(e))}catch(n){Ns(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function Cs(){}function ws(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Ts(e).queue;Ss(e,i,t,oe,n===null?Cs:function(){return Es(e),n(r)})}function Ts(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Es(e){var t=Ts(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},mu())}function Ds(){return ra(Qf)}function Os(){return Ao().memoizedState}function ks(){return Ao().memoizedState}function As(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=Wa(n);var r=Ga(t,e,n);r!==null&&(gu(r,t,n),Ka(r,t,n)),t={cache:ua()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Is(t,n):(n=si(e,t,n,r),n!==null&&(gu(n,e,r),Ls(n,t,r)))}function Ms(e,t,n){Ns(e,t,n,mu())}function Ns(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Is(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Dr(s,o))return oi(e,t,i,0),K===null&&ai(),!1}catch{}if(n=si(e,t,i,r),n!==null)return gu(n,e,r),Ls(n,t,r),!0}return!1}function Ps(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(a(479))}else t=si(e,n,r,2),t!==null&&gu(t,e,2)}function Fs(e){var t=e.alternate;return e===H||t!==null&&t===H}function Is(e,t){mo=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ls(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Rs={readContext:ra,use:No,useCallback:bo,useContext:bo,useEffect:bo,useImperativeHandle:bo,useLayoutEffect:bo,useInsertionEffect:bo,useMemo:bo,useReducer:bo,useRef:bo,useState:bo,useDebugValue:bo,useDeferredValue:bo,useTransition:bo,useSyncExternalStore:bo,useId:bo,useHostTransitionStatus:bo,useFormState:bo,useActionState:bo,useOptimistic:bo,useMemoCache:bo,useCacheRefresh:bo};Rs.useEffectEvent=bo;var zs={readContext:ra,use:No,useCallback:function(e,t){return ko().memoizedState=[e,t===void 0?null:t],e},useContext:ra,useEffect:ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ss(4194308,4,hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var n=ko();t=t===void 0?null:t;var r=e();if(ho){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ko();if(n!==void 0){var i=n(t);if(ho){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=js.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=ko();return e={current:e},t.memoizedState=e},useState:function(e){e=Go(e);var t=e.queue,n=Ms.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:_s,useDeferredValue:function(e,t){return bs(ko(),e,t)},useTransition:function(){var e=Go(!1);return e=Ss.bind(null,H,e.queue,!0,!1),ko().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=H,i=ko();if(I){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),K===null)throw Error(a(349));J&127||Bo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ls(Ho.bind(null,r,o,e),[e]),r.flags|=2048,as(9,{destroy:void 0},Vo.bind(null,r,o,n,t),null),n},useId:function(){var e=ko(),t=K.identifierPrefix;if(I){var n=ji,r=Ai;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ds,useFormState:es,useActionState:es,useOptimistic:function(e){var t=ko();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ps.bind(null,H,!0,n),n.dispatch=t,[e,t]},useMemoCache:Po,useCacheRefresh:function(){return ko().memoizedState=As.bind(null,H)},useEffectEvent:function(e){var t=ko(),n={impl:e};return t.memoizedState=n,function(){if(G&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Bs={readContext:ra,use:No,useCallback:vs,useContext:ra,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Io,useRef:os,useState:function(){return Io(Fo)},useDebugValue:_s,useDeferredValue:function(e,t){return xs(Ao(),U.memoizedState,e,t)},useTransition:function(){var e=Io(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Os,useHostTransitionStatus:Ds,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){return Ko(Ao(),U,e,t)},useMemoCache:Po,useCacheRefresh:ks};Bs.useEffectEvent=fs;var Vs={readContext:ra,use:No,useCallback:vs,useContext:ra,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Ro,useRef:os,useState:function(){return Ro(Fo)},useDebugValue:_s,useDeferredValue:function(e,t){var n=Ao();return U===null?bs(n,e,t):xs(n,U.memoizedState,e,t)},useTransition:function(){var e=Ro(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Os,useHostTransitionStatus:Ds,useFormState:is,useActionState:is,useOptimistic:function(e,t){var n=Ao();return U===null?(n.baseState=e,[e,n.queue.dispatch]):Ko(n,U,e,t)},useMemoCache:Po,useCacheRefresh:ks};Vs.useEffectEvent=fs;function Hs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Us={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Wa(r);i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(gu(t,e,r),Ka(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Wa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(gu(t,e,r),Ka(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=Wa(n);r.tag=2,t!=null&&(r.callback=t),t=Ga(e,r,n),t!==null&&(gu(t,e,n),Ka(t,e,n))}};function Ws(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Or(n,r)||!Or(i,a):!0}function Gs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Us.enqueueReplaceState(t,t.state,null)}function Ks(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function qs(e){ti(e)}function Js(e){console.error(e)}function Ys(e){ti(e)}function Xs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){return n=Wa(n),n.tag=3,n.payload={element:null},n.callback=function(){Xs(e,t)},n}function $s(e){return e=Wa(e),e.tag=3,e}function ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Zs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Zs(t,n,r),typeof i!=`function`&&(iu===null?iu=new Set([this]):iu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function tc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ea(t,n,i,!0),n=no.current,n!==null){switch(n.tag){case 31:case 13:return ro===null?Ou():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,i)),!1;case 22:return n.flags|=65536,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,i)),!1}throw Error(a(435,n.tag))}return Gu(e,r,i),Ou(),!1}if(I)return t=no.current,t===null?(r!==zi&&(t=Error(a(423),{cause:r}),Ki(P(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=P(r,n),i=Qs(e.stateNode,r,i),qa(e,i),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==zi&&(e=Error(a(422),{cause:r}),Ki(P(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=P(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=P(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Qs(n.stateNode,r,e),qa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(iu===null||!iu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=$s(i),ec(i,e,n,r),qa(n,i),!1}n=n.return}while(n!==null);return!1}var nc=Error(a(461)),rc=!1;function ic(e,t,n,r){t.child=e===null?Ba(t,null,n,r):za(t,e.child,n,r)}function ac(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return na(t),r=So(e,t,n,o,a,i),s=Eo(),e!==null&&!rc?(Do(e,t,i),kc(e,t,i)):(I&&s&&Pi(t),t.flags|=1,ic(e,t,r,i),t.child)}function oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!mi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,sc(e,t,a,r,i)):(e=_i(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ac(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Or:n,n(o,r)&&e.ref===t.ref)return kc(e,t,i)}return t.flags|=1,e=hi(a,r),e.ref=t.ref,e.return=t,t.child=e}function sc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Or(a,r)&&e.ref===t.ref)if(rc=!1,t.pendingProps=r=a,Ac(e,i))e.flags&131072&&(rc=!0);else return t.lanes=e.lanes,kc(e,t,i)}return hc(e,t,n,r,i)}function cc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xa(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),oo(t);else return r=t.lanes=536870912,uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&xa(t,null),eo(),so(t)):(xa(t,a.cachePool),$a(t,a),so(t),t.memoizedState=null);return ic(e,t,i,n),t.child}function lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uc(e,t,n,r,i){var a=ba();return a=a===null?null:{parent:la._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&xa(t,null),eo(),oo(t),e!==null&&ea(e,t,r,!0),t.childLanes=i,null}function dc(e,t){return t=wc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fc(e,t,n){return za(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,co(t),t.memoizedState=null,e}function pc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(I){if(r.mode===`hidden`)return e=dc(t,r),t.lanes=536870912,lc(null,e);if(ao(t),(e=F)?(e=rf(e,Ri),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ki===null?null:{id:Ai,overflow:ji},retryLane:536870912,hydrationErrors:null},n=bi(e),n.return=t,t.child=n,Li=t,F=null)):e=null,e===null)throw Bi(t);return t.lanes=536870912,null}return dc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ao(t),i)if(t.flags&256)t.flags&=-257,t=fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(rc||ea(e,t,n,!1),i=(n&e.childLanes)!==0,rc||i){if(r=K,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ci(e,s),gu(r,e,s),nc;Ou(),t=fc(e,t,n)}else e=o.treeContext,F=cf(s.nextSibling),Li=t,I=!0,L=null,Ri=!1,e!==null&&Ii(t,e),t=dc(t,r),t.flags|=4096;return t}return e=hi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function hc(e,t,n,r,i){return na(t),n=So(e,t,n,r,void 0,i),r=Eo(),e!==null&&!rc?(Do(e,t,i),kc(e,t,i)):(I&&r&&Pi(t),t.flags|=1,ic(e,t,n,i),t.child)}function gc(e,t,n,r,i,a){return na(t),t.updateQueue=null,n=wo(t,r,n,i),Co(e),r=Eo(),e!==null&&!rc?(Do(e,t,a),kc(e,t,a)):(I&&r&&Pi(t),t.flags|=1,ic(e,t,n,a),t.child)}function _c(e,t,n,r,i){if(na(t),t.stateNode===null){var a=di,o=n.contextType;typeof o==`object`&&o&&(a=ra(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Us,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ha(t),o=n.contextType,a.context=typeof o==`object`&&o?ra(o):di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Hs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Us.enqueueReplaceState(a,a.state,null),B(t,r,a,i),z(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ks(n,s);a.props=c;var l=a.context,u=n.contextType;o=di,typeof u==`object`&&u&&(o=ra(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Gs(t,a,r,o),Va=!1;var f=t.memoizedState;a.state=f,B(t,r,a,i),z(),l=t.memoizedState,s||f!==l||Va?(typeof d==`function`&&(Hs(t,n,d,r),l=t.memoizedState),(c=Va||Ws(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ua(e,t),o=t.memoizedProps,u=Ks(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=di,typeof l==`object`&&l&&(c=ra(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Gs(t,a,r,c),Va=!1,f=t.memoizedState,a.state=f,B(t,r,a,i),z();var p=t.memoizedState;o!==d||f!==p||Va||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof s==`function`&&(Hs(t,n,s,r),p=t.memoizedState),(u=Va||Ws(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ta(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,mc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=za(t,e.child,null,i),t.child=za(t,null,n,i)):ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=kc(e,t,i),e}function vc(e,t,n,r){return Wi(),t.flags|=256,ic(e,t,n,r),t.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bc(e){return{baseLanes:e,cachePool:Sa()}}function xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function Sc(e,t,n){var r=t.pendingProps,i=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(lo.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(I){if(i?io(t):so(t),(e=F)?(e=rf(e,Ri),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ki===null?null:{id:Ai,overflow:ji},retryLane:536870912,hydrationErrors:null},n=bi(e),n.return=t,t.child=n,Li=t,F=null)):e=null,e===null)throw Bi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(so(t),i=t.mode,c=wc({mode:`hidden`,children:c},i),r=vi(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(null,r)):(io(t),Cc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(io(t),t.flags&=-257,t=Tc(e,t,n)):t.memoizedState===null?(so(t),c=r.fallback,i=t.mode,r=wc({mode:`visible`,children:r.children},i),c=vi(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,za(t,e.child,null,n),r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,t=lc(null,r)):(so(t),t.child=e.child,t.flags|=128,t=null);else if(io(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Ki({value:r,source:null,stack:null}),t=Tc(e,t,n)}else if(rc||ea(e,t,n,!1),s=(n&e.childLanes)!==0,rc||s){if(s=K,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ci(e,r),gu(s,e,r),nc;af(c)||Ou(),t=Tc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,F=cf(c.nextSibling),Li=t,I=!0,L=null,Ri=!1,e!==null&&Ii(t,e),t=Cc(t,r.children),t.flags|=4096);return t}return i?(so(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=hi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=vi(c,i,n,null),c.flags|=2):c=hi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,lc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=bc(n):(i=c.cachePool,i===null?i=Sa():(l=la._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(e.child,r)):(io(t),n=e.child,e=n.sibling,n=hi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Cc(e,t){return t=wc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function wc(e,t){return e=pi(22,e,null,t),e.lanes=0,e}function Tc(e,t,n){return za(t,e.child,null,n),e=Cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ec(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qi(e.return,t,n)}function Dc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Oc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=lo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,j(lo,o),ic(e,t,r,n),r=I?Ei:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ec(e,n,t);else if(e.tag===19)Ec(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&uo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Dc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Dc(t,!0,n,null,a,r);break;case`together`:Dc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function kc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=hi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=hi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ac(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ta(e))):!0}function jc(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),Xi(t,la,e.memoizedState.cache),Wi();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:Xi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(io(t),e=kc(e,t,n),e===null?null:e.sibling):Sc(e,t,n):(io(t),t.flags|=128,null);io(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ea(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Oc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),j(lo,lo.current),r)break;return null;case 22:return t.lanes=0,cc(e,t,n,t.pendingProps);case 24:Xi(t,la,e.memoizedState.cache)}return kc(e,t,n)}function Mc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)rc=!0;else{if(!Ac(e,n)&&!(t.flags&128))return rc=!1,jc(e,t,n);rc=!!(e.flags&131072)}else rc=!1,I&&t.flags&1048576&&Ni(t,Ei,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ka(t.elementType),t.type=e,typeof e==`function`)mi(e)?(r=Ks(e,r),t.tag=1,t=_c(null,t,e,r,n)):(t.tag=0,t=hc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===S){t.tag=11,t=ac(null,t,e,r,n);break a}else if(i===E){t.tag=14,t=oc(null,t,e,r,n);break a}}throw t=ie(e)||e,Error(a(306,t,``))}}return t;case 0:return hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Ks(r,t.pendingProps),_c(e,t,r,i,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Ua(e,t),B(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Xi(t,la,r),r!==o.cache&&$i(t,[la],n,!0),z(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=vc(e,t,r,n);break a}else if(r!==i){i=P(Error(a(424)),t),Ki(i),t=vc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(F=cf(e.firstChild),Li=t,I=!0,L=null,Ri=!0,n=Ba(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Wi(),r===i){t=kc(e,t,n);break a}ic(e,t,r,n)}t=t.child}return t;case 26:return mc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:I||(n=t.type,e=t.pendingProps,r=Bd(pe.current).createElement(n),r[pt]=t,r[mt]=e,Pd(r,n,e),Et(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&I&&(r=t.stateNode=ff(t.type,t.pendingProps,pe.current),Li=t,Ri=!0,i=F,Zd(t.type)?(lf=i,F=cf(r.firstChild)):F=i),ic(e,t,t.pendingProps.children,n),mc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&I&&((i=r=F)&&(r=tf(r,t.type,t.pendingProps,Ri),r===null?i=!1:(t.stateNode=r,Li=t,F=cf(r.firstChild),Ri=!1,i=!0)),i||Bi(t)),_e(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(i,o)?r=null:s!==null&&Ud(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=So(e,t,To,null,null,n),Qf._currentValue=i),mc(e,t),ic(e,t,r,n),t.child;case 6:return e===null&&I&&((e=n=F)&&(n=nf(n,t.pendingProps,Ri),n===null?e=!1:(t.stateNode=n,Li=t,F=null,e=!0)),e||Bi(t)),null;case 13:return Sc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=za(t,null,r,n):ic(e,t,r,n),t.child;case 11:return ac(e,t,t.type,t.pendingProps,n);case 7:return ic(e,t,t.pendingProps,n),t.child;case 8:return ic(e,t,t.pendingProps.children,n),t.child;case 12:return ic(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Xi(t,t.type,r.value),ic(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,na(t),i=ra(i),r=r(i),t.flags|=1,ic(e,t,r,n),t.child;case 14:return oc(e,t,t.type,t.pendingProps,n);case 15:return sc(e,t,t.type,t.pendingProps,n);case 19:return Oc(e,t,n);case 31:return pc(e,t,n);case 22:return cc(e,t,n,t.pendingProps);case 24:return na(t),r=ra(la),e===null?(i=ba(),i===null&&(i=K,o=ua(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Ha(t),Xi(t,la,i)):((e.lanes&n)!==0&&(Ua(e,t),B(t,null,null,n),z()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Xi(t,la,r),r!==i.cache&&$i(t,[la],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Xi(t,la,r))),ic(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Nc(e){e.flags|=4}function Pc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw Aa=Ea,wa}else e.flags&=-16777217}function Fc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Tu())e.flags|=8192;else throw Aa=Ea,wa}function Ic(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,Xl|=t)}function Lc(e,t){if(!I)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function W(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Rc(e,t,n){var r=t.pendingProps;switch(Fi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(t),null;case 1:return W(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Zi(la),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ui(t)?Nc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Gi())),W(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Nc(t),o===null?(W(t),Pc(t,i,null,r,n)):(W(t),Fc(t,o))):o?o===e.memoizedState?(W(t),t.flags&=-16777217):(Nc(t),W(t),Fc(t,o)):(e=e.memoizedProps,e!==r&&Nc(t),W(t),Pc(t,i,e,r,n)),null;case 27:if(ye(t),n=pe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return W(t),null}e=de.current,Ui(t)?Vi(t,e):(e=ff(i,r,n),t.stateNode=e,Nc(t))}return W(t),null;case 5:if(ye(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return W(t),null}if(o=de.current,Ui(t))Vi(t,o);else{var s=Bd(pe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Nc(t)}}return W(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=pe.current,Ui(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Li,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Bi(t,!0)}else e=Bd(e).createTextNode(r),e[pt]=t,t.stateNode=e}return W(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ui(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[pt]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;W(t),e=!1}else n=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(co(t),t):(co(t),null);if(t.flags&128)throw Error(a(558))}return W(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ui(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[pt]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;W(t),i=!1}else i=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(co(t),t):(co(t),null)}return co(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ic(t,t.updateQueue),W(t),null);case 4:return ge(),e===null&&Sd(t.stateNode.containerInfo),W(t),null;case 10:return Zi(t.type),W(t),null;case 19:if(ue(lo),r=t.memoizedState,r===null)return W(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Lc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=uo(e),o!==null){for(t.flags|=128,Lc(r,!1),e=o.updateQueue,t.updateQueue=e,Ic(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gi(n,e),n=n.sibling;return j(lo,lo.current&1|2),I&&Mi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>nu&&(t.flags|=128,i=!0,Lc(r,!1),t.lanes=4194304)}else{if(!i)if(e=uo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ic(t,e),Lc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!I)return W(t),null}else 2*Me()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,i=!0,Lc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(W(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=lo.current,j(lo,i?n&1|2:n&1),I&&Mi(t,r.treeForkCount),e);case 22:case 23:return co(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(W(t),t.subtreeFlags&6&&(t.flags|=8192)):W(t),n=t.updateQueue,n!==null&&Ic(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ue(R),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Zi(la),W(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function zc(e,t){switch(Fi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zi(la),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(co(t),t.alternate===null)throw Error(a(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(lo),null;case 4:return ge(),null;case 10:return Zi(t.type),null;case 22:case 23:return co(t),to(),e!==null&&ue(R),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Zi(la),null;case 25:return null;default:return null}}function Bc(e,t){switch(Fi(t),t.tag){case 3:Zi(la),ge();break;case 26:case 27:case 5:ye(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&co(t);break;case 13:co(t);break;case 19:ue(lo);break;case 10:Zi(t.type);break;case 22:case 23:co(t),to(),e!==null&&ue(R);break;case 24:Zi(la)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){Z(e,e.return,t)}}}function Wc(e,t,n){n.props=Ks(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[mt]=t}catch(t){Z(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sn));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[pt]=e,t[mt]=n}catch(t){Z(e,e.return,t)}}var el=!1,tl=!1,nl=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,Rd=sp,e=Mr(e),Nr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ks(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,il=e;break}il=t.return}}function ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:xl(e,n),r&4&&Vc(5,n);break;case 1:if(xl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ks(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Uc(n),r&512&&Gc(n,n.return);break;case 3:if(xl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Xa(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&$c(n);case 26:case 5:xl(e,n),t===null&&r&4&&qc(n),r&512&&Gc(n,n.return);break;case 12:xl(e,n);break;case 31:xl(e,n),r&4&&fl(e,n);break;case 13:xl(e,n),r&4&&pl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||el,!r){t=t!==null&&t.memoizedState!==null||tl,i=el;var a=tl;el=r,(tl=t)&&!a?Cl(e,n,(n.subtreeFlags&8772)!=0):xl(e,n),el=i,tl=a}break;case 30:break;default:xl(e,n)}}function sl(e){var t=e.alternate;t!==null&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var cl=null,ll=!1;function ul(e,t,n){for(n=n.child;n!==null;)dl(e,t,n),n=n.sibling}function dl(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:tl||Kc(n,t),ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tl||Kc(n,t);var r=cl,i=ll;Zd(n.type)&&(cl=n.stateNode,ll=!1),ul(e,t,n),pf(n.stateNode),cl=r,ll=i;break;case 5:tl||Kc(n,t);case 6:if(r=cl,i=ll,cl=null,ul(e,t,n),cl=r,ll=i,cl!==null)if(ll)try{(cl.nodeType===9?cl.body:cl.nodeName===`HTML`?cl.ownerDocument.body:cl).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{cl.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:cl!==null&&(ll?(e=cl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(cl,n.stateNode));break;case 4:r=cl,i=ll,cl=n.stateNode.containerInfo,ll=!0,ul(e,t,n),cl=r,ll=i;break;case 0:case 11:case 14:case 15:Hc(2,n,t),tl||Hc(4,n,t),ul(e,t,n);break;case 1:tl||(Kc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Wc(n,t,r)),ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:tl=(r=tl)||n.memoizedState!==null,ul(e,t,n),tl=r;break;default:ul(e,t,n)}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function ml(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rl),t;default:throw Error(a(435,e.tag))}}function hl(e,t){var n=ml(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function gl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){cl=c.stateNode,ll=!1;break a}break;case 5:cl=c.stateNode,ll=!1;break a;case 3:case 4:cl=c.stateNode.containerInfo,ll=!0;break a}c=c.return}if(cl===null)throw Error(a(160));dl(o,s,i),cl=null,ll=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vl(t,e),t=t.sibling}var _l=null;function vl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gl(t,e),yl(e),r&4&&(Hc(3,e,e.return),Vc(3,e),Hc(5,e,e.return));break;case 1:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&64&&el&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=_l;if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[bt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Pd(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[pt]=e,Et(o),r=o}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Jc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),n!==null&&r&4&&Jc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),e.flags&32){i=e.stateNode;try{Qt(i,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Jc(e,i,n===null?i:n.memoizedProps)),r&1024&&(nl=!0);break;case 6:if(gl(t,e),yl(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,i=_l,_l=gf(t.containerInfo),gl(t,e),_l=i,yl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}nl&&(nl=!1,bl(e));break;case 4:r=_l,_l=gf(e.stateNode.containerInfo),gl(t,e),yl(e),_l=r;break;case 12:gl(t,e),yl(e);break;case 31:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 13:gl(t,e),yl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eu=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=el,d=tl;if(el=u||i,tl=d||l,gl(t,e),tl=d,el=u,yl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||el||tl||Sl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,hl(e,n))));break;case 19:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 30:break;case 21:break;default:gl(t,e),yl(e)}}function yl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Yc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;Qc(e,Xc(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Qt(o,``),n.flags&=-33),Qc(e,Xc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Zc(e,Xc(e),s);break;default:throw Error(a(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ol(e,t.alternate,t),t=t.sibling}function Sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hc(4,t,t.return),Sl(t);break;case 1:Kc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Wc(t,t.return,n),Sl(t);break;case 27:pf(t.stateNode);case 26:case 5:Kc(t,t.return),Sl(t);break;case 22:t.memoizedState===null&&Sl(t);break;case 30:Sl(t);break;default:Sl(t)}e=e.sibling}}function Cl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Cl(i,a,n),Vc(4,a);break;case 1:if(Cl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ya(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Uc(a),Gc(a,a.return);break;case 27:$c(a);case 26:case 5:Cl(i,a,n),n&&r===null&&o&4&&qc(a),Gc(a,a.return);break;case 12:Cl(i,a,n);break;case 31:Cl(i,a,n),n&&o&4&&fl(i,a);break;case 13:Cl(i,a,n),n&&o&4&&pl(i,a);break;case 22:a.memoizedState===null&&Cl(i,a,n),Gc(a,a.return);break;case 30:break;default:Cl(i,a,n)}t=t.sibling}}function wl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&da(n))}function Tl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&da(e))}function El(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dl(e,t,n,r),t=t.sibling}function Dl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:El(e,t,n,r),i&2048&&Vc(9,t);break;case 1:El(e,t,n,r);break;case 3:El(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&da(e)));break;case 12:if(i&2048){El(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else El(e,t,n,r);break;case 31:El(e,t,n,r);break;case 13:El(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?El(e,t,n,r):(a._visibility|=2,Ol(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?El(e,t,n,r):kl(e,t),i&2048&&wl(o,t);break;case 24:El(e,t,n,r),i&2048&&Tl(t.alternate,t);break;default:El(e,t,n,r)}}function Ol(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ol(a,o,s,c,i),Vc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ol(a,o,s,c,i)):u._visibility&2?Ol(a,o,s,c,i):kl(a,o),i&&l&2048&&wl(o.alternate,o);break;case 24:Ol(a,o,s,c,i),i&&l&2048&&Tl(o.alternate,o);break;default:Ol(a,o,s,c,i)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:kl(n,r),i&2048&&wl(r.alternate,r);break;case 24:kl(n,r),i&2048&&Tl(r.alternate,r);break;default:kl(n,r)}t=t.sibling}}var Al=8192;function jl(e,t,n){if(e.subtreeFlags&Al)for(e=e.child;e!==null;)Ml(e,t,n),e=e.sibling}function Ml(e,t,n){switch(e.tag){case 26:jl(e,t,n),e.flags&Al&&e.memoizedState!==null&&Gf(n,_l,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,n);break;case 3:case 4:var r=_l;_l=gf(e.stateNode.containerInfo),jl(e,t,n),_l=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Al,Al=16777216,jl(e,t,n),Al=r):jl(e,t,n));break;default:jl(e,t,n)}}function Nl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Ll(r,e)}Nl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Fl(e),e=e.sibling}function Fl(e){switch(e.tag){case 0:case 11:case 15:Pl(e),e.flags&2048&&Hc(9,e,e.return);break;case 3:Pl(e);break;case 12:Pl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Il(e)):Pl(e);break;default:Pl(e)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Ll(r,e)}Nl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hc(8,t,t.return),Il(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Il(t));break;default:Il(t)}e=e.sibling}}function Ll(e,t){for(;il!==null;){var n=il;switch(n.tag){case 0:case 11:case 15:Hc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,il=r;else a:for(n=e;il!==null;){r=il;var i=r.sibling,a=r.return;if(sl(r),r===n){il=null;break a}if(i!==null){i.return=a,il=i;break a}il=a}}}var Rl={getCacheForType:function(e){var t=ra(la),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ra(la).controller.signal}},zl=typeof WeakMap==`function`?WeakMap:Map,G=0,K=null,q=null,J=0,Y=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,iu=null,au=0,ou=null,su=null,cu=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return G&2&&J!==0?J&-J:k.T===null?ut():dd()}function hu(){if(Yl===0)if(!(J&536870912)||I){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),Yl=e}else Yl=536870912;return e=no.current,e!==null&&(e.flags|=32),Yl}function gu(e,t,n){(e===K&&(Y===2||Y===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,J,Yl,!1)),rt(e,n),(!(G&2)||e!==K)&&(e===K&&(!(G&2)&&(ql|=n),Gl===4&&bu(e,J,Yl,!1)),rd(e))}function _u(e,t,n){if(G&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||$e(e,t),i=r?ju(e,t):ku(e,t,!0),o=r;do{if(i===0){Hl&&!r&&bu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!yu(n)){i=ku(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,i=4;break a}o=Ql,Ql=i,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Cu(e,0),bu(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:bu(r,t,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=eu+300-Me(),10<i)){if(bu(r,t,Yl,!Vl),Qe(r,0,!0)!==0)break a;cu=t,r.timeoutHandle=Kd(vu.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),i);break a}vu(r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,null,-0,0)}}break}while(1);rd(e)}function vu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sn},Ml(t,a,d);var m=(a&62914560)===a?eu-Me():(a&4194048)===a?tu-Me():0;if(m=qf(d,m),m!==null){cu=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function yu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Dr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function xu(){return G&6?!0:(id(0,!1),!1)}function Su(){if(q!==null){if(Y===0)var e=q.return;else e=q,Yi=Ji=null,Oo(e),Na=null,Pa=0,e=q;for(;e!==null;)Bc(e.alternate,e),e=e.return;q=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cu=0,Su(),K=e,q=n=hi(e.current,null),J=t,Y=0,Bl=null,Vl=!1,Hl=$e(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-We(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,ai(),n}function wu(e,t){H=null,k.H=Rs,t===Ca||t===Ta?(t=ja(),Y=3):t===wa?(t=ja(),Y=4):Y=t===nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,q===null&&(Gl=1,Xs(e,P(t,e.current)))}function Tu(){var e=no.current;return e===null?!0:(J&4194048)===J?ro===null:(J&62914560)===J||J&536870912?e===ro:!1}function Eu(){var e=k.H;return k.H=Rs,e===null?Rs:e}function Du(){var e=k.A;return k.A=Rl,e}function Ou(){Gl=4,Vl||(J&4194048)!==J&&no.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||K===null||bu(K,J,Yl,!1)}function ku(e,t,n){var r=G;G|=2;var i=Eu(),a=Du();(K!==e||J!==t)&&(ru=null,Cu(e,t)),t=!1;var o=Gl;a:do try{if(Y!==0&&q!==null){var s=q,c=Bl;switch(Y){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:no.current===null&&(t=!0);var l=Y;if(Y=0,Bl=null,Fu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=Y,Y=0,Bl=null,Fu(e,s,c,l)}}Au(),o=Gl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,Yi=Ji=null,G=r,k.H=i,k.A=a,q===null&&(K=null,J=0,ai()),o}function Au(){for(;q!==null;)Nu(q)}function ju(e,t){var n=G;G|=2;var r=Eu(),i=Du();K!==e||J!==t?(ru=null,nu=Me()+500,Cu(e,t)):Hl=$e(e,t);a:do try{if(Y!==0&&q!==null){t=q;var o=Bl;b:switch(Y){case 1:Y=0,Bl=null,Fu(e,t,o,1);break;case 2:case 9:if(Da(o)){Y=0,Bl=null,Pu(t);break}t=function(){Y!==2&&Y!==9||K!==e||(Y=7),rd(e)},o.then(t,t);break a;case 3:Y=7;break a;case 4:Y=5;break a;case 7:Da(o)?(Y=0,Bl=null,Pu(t)):(Y=0,Bl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?Wf(s):c.stateNode.complete){Y=0,Bl=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,Iu(u))}break b}}Y=0,Bl=null,Fu(e,t,o,5);break;case 6:Y=0,Bl=null,Fu(e,t,o,6);break;case 8:Su(),Gl=6;break a;default:throw Error(a(462))}}Mu();break}catch(t){wu(e,t)}while(1);return Yi=Ji=null,k.H=r,k.A=i,G=n,q===null?(K=null,J=0,ai(),Gl):0}function Mu(){for(;q!==null&&!Ae();)Nu(q)}function Nu(e){var t=Mc(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Iu(e):q=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=gc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=gc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:Oo(t);default:Bc(n,t),t=q=gi(t,Wl),t=Mc(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):q=t}function Fu(e,t,n,r){Yi=Ji=null,Oo(t),Na=null,Pa=0;var i=t.return;try{if(tc(e,i,t,n,J)){Gl=1,Xs(e,P(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;Gl=1,Xs(e,P(n,e.current)),q=null;return}t.flags&32768?(I||r===1?e=!0:Hl||J&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=no.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Vl);return}e=t.return;var n=Rc(t.alternate,t,Wl);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);Gl===0&&(Gl=5)}function Lu(e,t){do{var n=zc(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);Gl=6,q=null}function Ru(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(au!==0);if(G&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=ii,it(e,n,o,s,c,l),e===K&&(q=K=null,J=0),su=t,ou=e,cu=n,lu=o,uu=i,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ie,function(){return X(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=k.T,k.T=null,i=A.p,A.p=2,s=G,G|=4;try{al(e,t,n)}finally{G=s,A.p=i,k.T=r}}au=1,zu(),Bu(),Vu()}}function zu(){if(au===1){au=0;var e=ou,t=su,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=G;G|=4;try{vl(t,e);var a=zd,o=Mr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&jr(s.ownerDocument.documentElement,s)){if(c!==null&&Nr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Ar(s,h),v=Ar(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{G=i,A.p=r,k.T=n}}e.current=t,au=2}}function Bu(){if(au===2){au=0;var e=ou,t=su,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=G;G|=4;try{ol(e,t.alternate,t)}finally{G=i,A.p=r,k.T=n}}au=3}}function Vu(){if(au===4||au===3){au=0,je();var e=ou,t=su,n=cu,r=du;t.subtreeFlags&10256||t.flags&10256?au=5:(au=0,su=ou=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(iu=null),lt(n),t=t.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=A.p,A.p=2,k.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{k.T=t,A.p=i}}cu&3&&Uu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,id(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,da(t)))}function Uu(){return zu(),Bu(),Vu(),X()}function X(){if(au!==5)return!1;var e=ou,t=lu;lu=0;var n=lt(cu),r=k.T,i=A.p;try{A.p=32>n?32:n,k.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,G&6)throw Error(a(331));var c=G;if(G|=4,Fl(o.current),Dl(o,o.current,s,n),G=c,id(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{A.p=i,k.T=r,Hu(e,t)}}function Wu(e,t,n){t=P(n,t),t=Qs(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&(rt(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(iu===null||!iu.has(r))){e=P(n,e),n=$s(2),r=Ga(t,n,2),r!==null&&(ec(n,r,t,e),rt(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ul=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(J&n)===n&&(Gl===4||Gl===3&&(J&62914560)===J&&300>Me()-eu?!(G&2)&&Cu(e,0):Jl|=n,Xl===J&&(Xl=0)),rd(e)}function qu(e,t){t===0&&(t=tt()),e=ci(e,t),e!==null&&(rt(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Oe(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=J,a=Qe(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Me(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}au!==0&&au!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=K,n=J,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Y===2||Y===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),lt(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Re;break;default:n=Ie}return r=cd.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(au!==0&&au!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=J;return r=Qe(e,e===K?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),sd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Uu())return null;_u(e,t,!0)}function ud(){Yd(function(){G&6?Oe(Pe,ad):od()})}function dd(){if(nd===0){var e=ma;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:on(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new En(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);ws(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),ws(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<$r.length;hd++){var gd=$r[hd];ei(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}ei(Gr,`onAnimationEnd`),ei(Kr,`onAnimationIteration`),ei(qr,`onAnimationStart`),ei(`dblclick`,`onDoubleClick`),ei(`focusin`,`onFocus`),ei(`focusout`,`onBlur`),ei(Jr,`onTransitionRun`),ei(Yr,`onTransitionStart`),ei(Xr,`onTransitionCancel`),ei(Zr,`onTransitionEnd`),At(`onMouseEnter`,[`mouseout`,`mouseover`]),At(`onMouseLeave`,[`mouseout`,`mouseover`]),At(`onPointerEnter`,[`pointerout`,`pointerover`]),At(`onPointerLeave`,[`pointerout`,`pointerover`]),kt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),kt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),kt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),kt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ti(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ti(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,Dt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!hn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=St(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}N(function(){var r=a,i=ln(n),o=[];a:{var c=Qr.get(e);if(c!==void 0){var l=En,u=e;switch(e){case`keypress`:if(xn(n)===0)break a;case`keydown`:case`keyup`:l=Wn;break;case`focusin`:u=`focus`,l=Fn;break;case`focusout`:u=`blur`,l=Fn;break;case`beforeblur`:case`afterblur`:l=Fn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Nn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Pn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Kn;break;case Gr:case Kr:case qr:l=In;break;case Zr:l=qn;break;case`scroll`:case`scrollend`:l=On;break;case`wheel`:l=Jn;break;case`copy`:case`cut`:case`paste`:l=Ln;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Gn;break;case`toggle`:case`beforetoggle`:l=Yn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=pn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==cn&&(u=n.relatedTarget||n.fromElement)&&(St(u)||u[ht]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?St(u):null,u!==null&&(f=s(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Nn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Gn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:wt(l),h=u==null?c:wt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,St(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(o,c,l,d,!1),u!==null&&f!==null&&Od(o,f,u,d,!0)}}a:{if(c=r?wt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=hr;else if(lr(c))if(gr)v=Tr;else{v=Cr;var y=Sr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&nn(r.elementType)&&(v=hr):v=wr;if(v&&=v(e,r)){ur(o,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Jt(c,`number`,c.value)}switch(y=r?wt(r):window,e){case`focusin`:(lr(y)||y.contentEditable===`true`)&&(Fr=y,Ir=r,Lr=null);break;case`focusout`:Lr=Ir=Fr=null;break;case`mousedown`:Rr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Rr=!1,zr(o,n,i);break;case`selectionchange`:if(Pr)break;case`keydown`:case`keyup`:zr(o,n,i)}var b;if(Zn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else ar?rr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(er&&n.locale!==`ko`&&(ar||x!==`onCompositionStart`?x===`onCompositionEnd`&&ar&&(b=bn()):(_n=i,vn=`value`in _n?_n.value:_n.textContent,ar=!0)),y=Ed(r,x),0<y.length&&(x=new Rn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=ir(n),b!==null&&(x.data=b)))),(b=$n?or(e,n):sr(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Rn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),md(o,e,r,n,i)}yd(o,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=pn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=pn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=pn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=pn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
1215
+ `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Qt(e,``+r);break;case`className`:It(e,`class`,r);break;case`tabIndex`:It(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:It(e,n,r);break;case`style`:tn(e,r,o);break;case`data`:if(t!==`object`){It(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=on(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Ft(e,`popover`,r);break;case`xlinkActuate`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ft(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=rn.get(n)||n,Ft(e,n,r))}}function Nd(e,t,n,r,i,o){switch(n){case`style`:tn(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Qt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ot.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[mt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ft(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,o,s,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:$(e,t,r,d,n,null)}}qt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Yt(e,!!r,n,!0):Yt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:$(e,t,s,c,n,null)}Zt(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,u,r,n,null)}return;default:if(nn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Kt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Yt(e,!!n,n?[]:``,!1):Yt(e,!!n,t,!0)):Yt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&$(e,t,s,i,r,o)}Xt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(nn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[bt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=A.d;A.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=xu();return e||t}function yf(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Es(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Et(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=Tt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Et(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=Tt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Et(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=Tt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Et(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=pe.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=Tt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=Tt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=Tt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Gt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),Et(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Gt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var i=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,Et(i),i):(r=n,(i=mf.get(o))&&(r=p({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Et(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[bt]||a[pt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:x,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=pi(3,null,null,t),e.current=a,a.stateNode=e,t=ua(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ha(a),e}function tp(e){return e?(e=di,e):di}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Wa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ga(e,r,t),n!==null&&(gu(n,e,t),Ka(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ci(e,67108864);t!==null&&gu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=mu();t=ct(t);var n=ci(e,t);n!==null&&gu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=2,up(e,t,n,r)}finally{A.p=a,k.T=i}}function lp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=8,up(e,t,n,r)}finally{A.p=a,k.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}rd(a),!(G&6)&&(nu=Me()+500,id(0,!1))}}break;case 31:case 13:s=ci(a,2),s!==null&&gu(s,a,2),xu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=ln(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=St(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case Le:return 32;case Re:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ct(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=St(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){op(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,dt(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cn=r,n.target.dispatchEvent(r),cn=null}else return t=Ct(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,ws(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[mt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;np(n,mu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),xu(),t[ht]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=r.version;if(Lp!==`19.2.7`)throw Error(a(527,Lp,`19.2.7`));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ve=zp.inject(Rp),He=zp}catch{}}e.hydrateRoot=function(e,t,n){if(!o(e))throw Error(a(299));var r=!1,i=``,s=qs,c=Js,l=Ys,u=null;return n!=null&&(!0===n.unstable_strictMode&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(c=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=ep(e,1,!0,t,n??null,r,i,u,s,c,l,Pp),t.context=tp(null),n=t.current,r=mu(),r=ct(r),i=Wa(r),i.callback=null,Ga(n,i,r),n=r,t.current.lanes=n,rt(t,n),rd(t),e[ht]=t.current,Sd(e),new Ip(t)}}));(0,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=cw()}))().hydrateRoot)(document,(0,z.jsx)(B.StrictMode,{children:(0,z.jsx)(aw,{})}));export{iu as $,Jv as A,X as B,bS as C,el as Ct,Gx as D,jo as Dt,tS as E,Yc as Et,Zh as F,vu as G,zu as H,ad as I,Xl as J,Ql as K,rd as L,Fv as M,ug as N,Zv as O,wo as Ot,lg as P,nu as Q,Yu as R,xS as S,al as St,oS as T,Xc as Tt,Eu as U,Vu as V,xu as W,Yl as X,$l as Y,Jl as Z,OS as _,K as _t,aC as a,fu as at,CS as b,cl as bt,lC as c,pu as ct,RS as d,du as dt,ou as et,NS as f,tu as ft,AS as g,zl as gt,kS as h,Gl as ht,TC as i,Zl as it,Vv as j,Xv as k,oo as kt,sC as l,cu as lt,MS as m,Ul as mt,jC as n,ru as nt,iC as o,uu as ot,PS as p,Wl as pt,su as q,AC as r,ql as rt,nC as s,eu as st,MC as t,au as tt,BS as u,lu as ut,ES as v,El as vt,mS as w,Qc as wt,SS as x,ol as xt,DS as y,Ml as yt,Gu as z};