@zonease/aiworker-cli 0.12.2 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +158 -350
  2. package/aiworker-bun.js +614 -694
  3. package/drizzle/worker/0000_polite_stellaris.sql +219 -0
  4. package/drizzle/worker/0001_red_lady_mastermind.sql +29 -0
  5. package/drizzle/worker/0002_concerned_slyde.sql +45 -0
  6. package/drizzle/worker/meta/0000_snapshot.json +1055 -194
  7. package/drizzle/worker/meta/0001_snapshot.json +1244 -222
  8. package/drizzle/worker/meta/0002_snapshot.json +1557 -273
  9. package/drizzle/worker/meta/_journal.json +6 -48
  10. package/official-apps/aiworker-hr/README.md +16 -0
  11. package/official-apps/aiworker-hr/capabilities/candidate-screen/prompt.md +3 -0
  12. package/official-apps/aiworker-hr/capabilities/candidate-screen/review.md +5 -0
  13. package/official-apps/aiworker-hr/capabilities/person-profile/prompt.md +3 -0
  14. package/official-apps/aiworker-hr/capabilities/person-profile/review.md +5 -0
  15. package/official-apps/aiworker-hr/dist/host-mounted.js +15677 -0
  16. package/official-apps/aiworker-hr/dist/index.js +15411 -0
  17. package/official-apps/aiworker-hr/dist/standalone.js +15451 -0
  18. package/official-apps/aiworker-hr/migrations/0001_hr.sql +2 -0
  19. package/official-apps/aiworker-hr/package.json +31 -0
  20. package/official-apps/aiworker-hr/packs/hr-recruiting/SOUL.md +7 -0
  21. package/official-apps/aiworker-hr/review/candidate-screen.md +5 -0
  22. package/official-apps/aiworker-hr/review/person-profile.md +5 -0
  23. package/official-apps/aiworker-hr/schemas/candidate-screen.schema.json +50 -0
  24. package/official-apps/aiworker-hr/schemas/person-profile.schema.json +50 -0
  25. package/official-apps/aiworker-hr/soul-app.manifest.json +374 -0
  26. package/official-apps/aiworker-hr/src/api.ts +1 -0
  27. package/official-apps/aiworker-hr/src/host-mounted.ts +308 -0
  28. package/official-apps/aiworker-hr/src/index.ts +152 -0
  29. package/official-apps/aiworker-hr/src/protocol/artifact.ts +2 -0
  30. package/official-apps/aiworker-hr/src/protocol/connectors.ts +2 -0
  31. package/official-apps/aiworker-hr/src/protocol/lifecycle.ts +2 -0
  32. package/official-apps/aiworker-hr/src/protocol/review.ts +2 -0
  33. package/official-apps/aiworker-hr/src/protocol/runtime.ts +2 -0
  34. package/official-apps/aiworker-hr/src/protocol/ui.ts +2 -0
  35. package/official-apps/aiworker-hr/src/standalone.ts +43 -0
  36. package/official-apps/aiworker-hr/src/ui/candidate-screen-preview.tsx +2 -0
  37. package/official-apps/aiworker-hr/src/ui/hr-route.tsx +1 -0
  38. package/official-apps/aiworker-hr/src/ui/people-widget.tsx +1 -0
  39. package/official-apps/aiworker-hr/src/ui/person-profile-preview.tsx +2 -0
  40. package/official-apps/aiworker-hr/src/ui/profile-panel.tsx +1 -0
  41. package/official-apps/aiworker-hr/src/ui/review-panel.tsx +1 -0
  42. package/official-apps/aiworker-hr/tsconfig.json +20 -0
  43. package/official-apps/aiworker-qa/README.md +14 -0
  44. package/official-apps/aiworker-qa/capabilities/regression-matrix/prompt.md +3 -0
  45. package/official-apps/aiworker-qa/capabilities/regression-matrix/review.md +5 -0
  46. package/official-apps/aiworker-qa/capabilities/release-gate/prompt.md +3 -0
  47. package/official-apps/aiworker-qa/capabilities/release-gate/review.md +5 -0
  48. package/official-apps/aiworker-qa/dist/host-mounted.js +15655 -0
  49. package/official-apps/aiworker-qa/dist/index.js +15395 -0
  50. package/official-apps/aiworker-qa/dist/standalone.js +15435 -0
  51. package/official-apps/aiworker-qa/migrations/0001_qa.sql +2 -0
  52. package/official-apps/aiworker-qa/package.json +31 -0
  53. package/official-apps/aiworker-qa/packs/qa-reviewer/SOUL.md +7 -0
  54. package/official-apps/aiworker-qa/review/regression-matrix.md +5 -0
  55. package/official-apps/aiworker-qa/review/release-gate.md +5 -0
  56. package/official-apps/aiworker-qa/schemas/regression-matrix.schema.json +50 -0
  57. package/official-apps/aiworker-qa/schemas/release-gate.schema.json +50 -0
  58. package/official-apps/aiworker-qa/soul-app.manifest.json +356 -0
  59. package/official-apps/aiworker-qa/src/api.ts +1 -0
  60. package/official-apps/aiworker-qa/src/host-mounted.ts +302 -0
  61. package/official-apps/aiworker-qa/src/index.ts +152 -0
  62. package/official-apps/aiworker-qa/src/protocol/artifact.ts +2 -0
  63. package/official-apps/aiworker-qa/src/protocol/connectors.ts +2 -0
  64. package/official-apps/aiworker-qa/src/protocol/lifecycle.ts +2 -0
  65. package/official-apps/aiworker-qa/src/protocol/review.ts +2 -0
  66. package/official-apps/aiworker-qa/src/protocol/runtime.ts +2 -0
  67. package/official-apps/aiworker-qa/src/protocol/ui.ts +2 -0
  68. package/official-apps/aiworker-qa/src/standalone.ts +43 -0
  69. package/official-apps/aiworker-qa/src/ui/qa-route.tsx +1 -0
  70. package/official-apps/aiworker-qa/src/ui/regression-matrix-preview.tsx +2 -0
  71. package/official-apps/aiworker-qa/src/ui/release-gate-preview.tsx +2 -0
  72. package/official-apps/aiworker-qa/src/ui/release-panel.tsx +1 -0
  73. package/official-apps/aiworker-qa/src/ui/release-review-panel.tsx +1 -0
  74. package/official-apps/aiworker-qa/src/ui/release-widget.tsx +1 -0
  75. package/official-apps/aiworker-qa/src/ui/review-panel.tsx +1 -0
  76. package/official-apps/aiworker-qa/tsconfig.json +20 -0
  77. package/package.json +5 -4
  78. package/web/worker/assets/index-ByOwFiyz.js +18 -0
  79. package/web/worker/assets/index-K-y56wrL.css +2 -0
  80. package/web/worker/assets/markdown-preview-DFe-rfff.js +29 -0
  81. package/web/worker/assets/people-workbench-V1Ajqfzv.js +1 -0
  82. package/web/worker/engine-icons/claude.svg +1 -0
  83. package/web/worker/engine-icons/cursor.svg +1 -0
  84. package/web/worker/engine-icons/gemini.svg +1 -0
  85. package/web/worker/engine-icons/hermesagent.svg +1 -0
  86. package/web/worker/engine-icons/openai.svg +1 -0
  87. package/web/worker/engine-icons/opencode.svg +1 -0
  88. package/web/worker/engine-icons/qwen.svg +1 -0
  89. package/web/worker/fonts/inter-latin-wght-normal.woff2 +0 -0
  90. package/web/worker/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  91. package/web/worker/fonts/nunito-latin-wght-normal.woff2 +0 -0
  92. package/web/worker/index.html +8 -4
  93. package/web/worker/logo.svg +8 -0
  94. package/drizzle/fleet/0000_fine_havok.sql +0 -23
  95. package/drizzle/fleet/meta/0000_snapshot.json +0 -165
  96. package/drizzle/fleet/meta/_journal.json +0 -13
  97. package/drizzle/worker/0000_spooky_kat_farrell.sql +0 -112
  98. package/drizzle/worker/0001_secret_dagger.sql +0 -1
  99. package/drizzle/worker/0002_jazzy_moondragon.sql +0 -13
  100. package/drizzle/worker/0003_rare_cloak.sql +0 -7
  101. package/drizzle/worker/0004_daffy_thing.sql +0 -26
  102. package/drizzle/worker/0005_worthless_whiplash.sql +0 -20
  103. package/drizzle/worker/0006_fair_jetstream.sql +0 -34
  104. package/drizzle/worker/0007_solid_bromley.sql +0 -11
  105. package/drizzle/worker/0008_peaceful_titanium_man.sql +0 -14
  106. package/drizzle/worker/meta/0003_snapshot.json +0 -873
  107. package/drizzle/worker/meta/0004_snapshot.json +0 -1058
  108. package/drizzle/worker/meta/0005_snapshot.json +0 -1192
  109. package/drizzle/worker/meta/0006_snapshot.json +0 -1420
  110. package/drizzle/worker/meta/0007_snapshot.json +0 -1489
  111. package/drizzle/worker/meta/0008_snapshot.json +0 -1593
  112. package/web/fleet/assets/index-BTknRPEg.js +0 -1372
  113. package/web/fleet/assets/index-lu-9OhC0.css +0 -2
  114. package/web/fleet/favicon.svg +0 -4
  115. package/web/fleet/index.html +0 -14
  116. package/web/worker/assets/index-DuxsPbd7.js +0 -1382
  117. package/web/worker/assets/index-lu-9OhC0.css +0 -2
@@ -1,1372 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=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(){}},u=new class extends l{#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`}},d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;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 p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==C(o,t.options))return!1}else if(!T(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 S(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(w(t.options.mutationKey)!==w(a))return!1}else if(!T(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function C(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>k(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function T(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>T(e[n],t[n])):!1}var E=Object.prototype.hasOwnProperty;function D(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ee(e)&&ee(t);if(!r&&!(k(e)&&k(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:E.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=D(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function O(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 ee(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function k(e){if(!A(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!A(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function A(e){return Object.prototype.toString.call(e)===`[object Object]`}function j(e){return new Promise(t=>{f.setTimeout(t,e)})}function M(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:D(e,t)}function N(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function te(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var P=Symbol();function ne(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===P?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function re(e,t){return typeof e==`function`?e(...t):!!e}function ie(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 F=(()=>{let e=()=>m;return{isServer(){return e()},setIsServer(t){e=t}}})();function I(){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 ae=p;function oe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ae,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 L=oe(),R=new class extends l{#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 se(e){return Math.min(1e3*2**e,3e4)}function ce(e){return(e??`online`)===`online`?R.isOnline():!0}var le=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ue(e){let t=!1,n=0,r,i=I(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new le(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>u.isFocused()&&(e.networkMode===`always`||R.isOnline())&&e.canRun(),d=()=>ce(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{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(f).catch(r=>{if(a())return;let i=e.retry??(F.isServer()?0:3),o=e.retryDelay??se,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){p(r);return}n++,e.onFail?.(n,r),j(s).then(()=>l()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:d,start:()=>(d()?h():m().then(h),i)}}var de=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(F.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}},fe=class extends de{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=he(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=he(this.options);e.data!==void 0&&(this.setState(me(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=M(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>b(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===P||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>y(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:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.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.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.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.#o=!0,n.signal)})},i=()=>{let e=ne(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!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.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=ue({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof le&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof le){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(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,...pe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...me(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=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),L.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function pe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ce(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function me(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function he(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 ge=class extends l{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=I(),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),ve(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ye(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ye(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 b(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&&!O(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&be(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(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 Se(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(h)),t}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(F.isServer()||this.#r.isStale||!_(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#d=f.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,!(F.isServer()||b(this.options.enabled,this.#t)===!1||!_(this.#p)||this.#p===0)&&(this.#f=f.setInterval(()=>{(this.options.refetchIntervalInBackground||u.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(f.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(f.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&&ve(e,t),o=i&&be(e,n,t,r);(a||o)&&(l={...l,...pe(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=M(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=M(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,x=d!==void 0,S={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&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:xe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:b(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=I())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}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),!O(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){L.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function _e(e,t){return b(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function ve(e,t){return _e(e,t)||e.state.data!==void 0&&ye(e,t,t.refetchOnMount)}function ye(e,t,n){if(b(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&xe(e,t)}return!1}function be(e,t,n,r){return(e!==t||b(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&xe(e,n)}function xe(e,t){return b(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}function Se(e,t){return!O(e.getCurrentResult(),t)}function Ce(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=>{ie(e,()=>t.signal,()=>n=!0)},u=ne(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();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?te:N;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Te:we,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:we(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 we(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 Te(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ee=class extends de{#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||De(),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=ue({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),L.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function De(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Oe=class extends l{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 Ee({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=ke(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=ke(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=ke(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=ke(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){L.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=>S(t,e))}findAll(e={}){return this.getAll().filter(t=>S(e,t))}notify(e){L.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return L.batch(()=>Promise.all(e.map(e=>e.continue().catch(h))))}};function ke(e){return e.options.scope?.id}var Ae=class extends l{#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),O(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&w(t.mutationKey)!==w(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??De();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){L.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)})})}},je=class extends l{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??C(r,t),a=this.get(i);return a||(a=new fe({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(){L.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=>x(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>x(e,t)):t}notify(e){L.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){L.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){L.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Me=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new je,this.#t=e.mutationCache||new Oe,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=u.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=R.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(y(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=g(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return L.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;L.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return L.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=L.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(h).catch(h)}invalidateQueries(e,t={}){return L.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=L.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(h)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(h)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(y(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(h).catch(h)}fetchInfiniteQuery(e){return e.behavior=Ce(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(h).catch(h)}ensureInfiniteQueryData(e){return e.behavior=Ce(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return R.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(w(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{T(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(w(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{T(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||=C(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===P&&(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()}},Ne=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=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)},ne={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),Pe=o(((e,t)=>{t.exports=Ne()})),Fe=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Ie=o(((e,t)=>{t.exports=Fe()})),z=c(Pe(),1),B=Ie(),Le=z.createContext(void 0),Re=e=>{let t=z.useContext(Le);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ze=({client:e,children:t})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,B.jsx)(Le.Provider,{value:e,children:t})),Be=z.createContext(!1),Ve=()=>z.useContext(Be);Be.Provider;function He(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ue=z.createContext(He()),We=()=>z.useContext(Ue),Ge=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?re(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ke=e=>{z.useEffect(()=>{e.clearReset()},[e])},qe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||re(n,[e.error,r])),Je=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))}},Ye=(e,t)=>e.isLoading&&e.isFetching&&!t,Xe=(e,t)=>e?.suspense&&t.isPending,Ze=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Qe(e,t,n){let r=Ve(),i=We(),a=Re(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,Je(o),Ge(o,i,s),Ke(i);let c=!a.getQueryCache().get(o.queryHash),[l]=z.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(z.useSyncExternalStore(z.useCallback(e=>{let t=d?l.subscribe(L.batchCalls(e)):h;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),z.useEffect(()=>{l.setOptions(o)},[o,l]),Xe(o,u))throw Ze(o,l,i);if(qe({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!F.isServer()&&Ye(u,r)&&(c?Ze(o,l,i):s?.promise)?.catch(h).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function $e(e,t){return Qe(e,ge,t)}function et(e,t){let n=Re(t),[r]=z.useState(()=>new Ae(n,e));z.useEffect(()=>{r.setOptions(e)},[r,e]);let i=z.useSyncExternalStore(z.useCallback(e=>r.subscribe(L.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=z.useCallback((e,t)=>{r.mutate(e,t).catch(h)},[r]);if(i.error&&re(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var tt=typeof window<`u`?z.useLayoutEffect:z.useEffect;function nt(e){let t=z.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function rt(e,t,n={},r={}){z.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function it(e){let t=z.useRef(null);return z.useImperativeHandle(e,()=>t.current,[]),t}function at(e){return e[e.length-1]}function ot(e){return typeof e==`function`}function st(e,t){return ot(e)?e(t):e}var ct=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,ut=()=>Object.create(null),dt=(e,t)=>ft(e,t,ut);function ft(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=gt(e)&&gt(i);if(!a&&!(mt(e)&&mt(i)))return i;let o=a?e:pt(e);if(!o)return i;let s=a?i:pt(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:ct.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=ft(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function pt(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!lt.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!lt.call(e,t))return!1;r.push(t)}return r}function mt(e){if(!ht(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ht(n)||!n.hasOwnProperty(`isPrototypeOf`))}function ht(e){return Object.prototype.toString.call(e)===`[object Object]`}function gt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _t(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!_t(e[r],t[r],n))return!1;return!0}if(mt(e)&&mt(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!_t(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!_t(e[o],t[o],n)))return!1;return i===a}return!1}function vt(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function yt(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function bt(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function xt(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return bt(t)}var St=[`http:`,`https:`,`mailto:`,`tel:`];function Ct(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function wt(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=xt(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=xt(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Tt(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Et(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Dt(){throw Error(`Invariant failed`)}function Ot(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var kt=4,At=5;function jt(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Mt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=jt(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Nt(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=Mt(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=It(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=It(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Lt(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Lt(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Lt(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=It(n.fullPath??n.from);e.kind=At,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=It(n.fullPath??n.from);e.kind=kt,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Nt(e,t,r,s,i,a,o)}function Pt(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ft(e){if(e.pathless)for(let t of e.pathless)Ft(t);if(e.static)for(let t of e.static.values())Ft(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Ft(t);if(e.dynamic?.length){e.dynamic.sort(Pt);for(let t of e.dynamic)Ft(t)}if(e.optional?.length){e.optional.sort(Pt);for(let t of e.optional)Ft(t)}if(e.wildcard?.length){e.wildcard.sort(Pt);for(let t of e.wildcard)Ft(t)}}function It(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Lt(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function Rt(e,t){let n=It(`/`),r=new Uint16Array(6);for(let t of e)Nt(!1,r,t,1,n,0);Ft(n),t.masksTree=n,t.flatCache=Ot(1e3)}function zt(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Wt(e,t.masksTree);return t.flatCache.set(e,r),r}function Bt(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=It(`/`),Nt(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Wt(r,o,n)}function Vt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Wt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Kt(a.route)),t.matchCache.set(r,a),a}function Ht(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Ut(e,t=!1,n){let r=It(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Nt(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&Dt(),a[e.id]=e,s!==0&&e.path){let t=Ht(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Ft(r),{processedTree:{segmentTree:r,singleCache:Ot(1e3),matchCache:Ot(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Wt(e,t,n=!1){let r=e.split(`/`),i=Jt(e,r,t,n);if(!i)return null;let[a]=Gt(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function Gt(e,t,n){let r=qt(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===kt)break;if(u.kind===At){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Kt(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function qt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Jt(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!at(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!Yt(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==kt&&Xt(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&Xt(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(Yt(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;Xt(u,n)&&(u=n)}}if(i.wildcard&&Xt(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!Yt(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return Xt(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function Yt(e,t,n){try{let[r,i]=Gt(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function Xt(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===kt)>(e.node.kind===kt)||t.node.kind===kt==(e.node.kind===kt)&&t.depth>e.depth))):!0}function Zt(e){return Qt(e.filter(e=>e!==void 0).join(`/`))}function Qt(e){return e.replace(/\/{2,}/g,`/`)}function $t(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function en(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function tn(e){return en($t(e))}function nn(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function rn(e,t,n){return nn(e,n)===nn(t,n)}function an({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&at(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(at(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=Mt(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Qt(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function on(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function sn(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>ln(e,n)).join(`/`):ln(r,n):r}function cn({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Mt(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=sn(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=sn(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=sn(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function ln(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function un(e){return e?.isNotFound===!0}function dn(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var fn=`tsr-scroll-restoration-v1_3`;function pn(){let e=dn();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);mt(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=st(e,t)||t},persist:()=>{try{e.setItem(fn,JSON.stringify(t))}catch{}}}}var mn=pn(),hn=e=>e.state.__TSR_key||e.href;function gn(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 _n=!1,vn=`window`,yn=`data-scroll-restoration-id`;function bn(e,t){if(!mn)return;let n=mn;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,_n=!1;let r=e.options.getScrollRestorationKey||hn,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(_n||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(vn,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===vn)n=vn;else if(e.isConnected){let t=e.getAttribute(yn);n=t?`[${yn}="${t}"]`:gn(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){_n=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!mt(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===vn)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===vn)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{_n=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function xn(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Sn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Cn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Sn(r):Array.isArray(t)?t.push(Sn(r)):n[e]=[t,Sn(r)]}return n}var wn=En(JSON.parse),Tn=Dn(JSON.stringify,JSON.parse);function En(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Cn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Dn(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=xn(e,r);return t?`?${t}`:``}}var On=`__root__`;function kn(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function An(e){return e instanceof Response&&!!e.options}function jn(e){return{input:({url:t})=>{for(let n of e)t=Nn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Pn(e[n],t);return t}}}function Mn(e){let t=tn(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=Zt([`/`,t,e.pathname]),e)}}function Nn(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 Pn(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 Fn(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>In(o,_.get())),x=r(()=>In(s,v.get())),S=r(()=>In(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=Ot(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let ee={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:k,setPending:A,setCached:j};k(e.matches),a?.(ee);function k(e){Ln(e,o,_,n,i)}function A(e){Ln(e,s,v,n,i)}function j(e){Ln(e,c,y,n,i)}return ee}function In(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Ln(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}Et(n.get(),a)||n.set(a)})}var Rn=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},zn=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Bn=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Vn=(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},Hn=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Un=(e,t,n)=>{if(!(!An(n)&&!un(n)))throw An(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:An(n)?`redirected`:un(n)?`notFound`:r.status===`pending`?`success`:r.status,context:Vn(e,t.index),isFetching:!1,error:n})),un(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),An(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Wn=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Gn=(e,t,n)=>{let r=Vn(e,n);e.updateMatch(t,e=>({...e,context:r}))},Kn=(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,Un(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,Un(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})),!e.preload&&!An(n)&&!un(n)&&(e.serialError??=n)},qn=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Bn(e,t)&&(n.options.loader||n.options.beforeLoad||ir(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Rn(e)},i);r._nonReactive.pendingTimeout=t}},Jn=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;qn(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Un(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Yn=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=vt(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Kn(e,n,o,`PARSE_PARAMS`),s&&Kn(e,n,s,`VALIDATE_SEARCH`),qn(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=vt();let f={...Vn(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=Bn(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(An(r)||un(r))&&(u(),Kn(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),yt(y))return u(),y.catch(t=>{Kn(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Kn(e,n,t,`BEFORE_LOAD`)}v(y)},Xn=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Yn(e,n,t,i),s=()=>{if(Wn(e,n))return;let t=Jn(e,n,i);return yt(t)?t.then(o):o()};return a()},Zn=(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}))},Qn=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Vn(e,r),d=Bn(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},$n=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{rr(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Qn(e,t,n,r,i)),l=!!s&&yt(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Un(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Vn(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Vn(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,un(t)&&await i.options.notFoundComponent?.preload?.(),Un(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Un(e,e.router.getMatch(n),t)}!An(o)&&!un(o)&&await rr(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Vn(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Un(e,r,t)}},er=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Qn(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await $n(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){An(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await $n(e,t,i,n,d):Gn(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Wn(e,i)){if(!e.router.getMatch(i))return e.matches[n];Gn(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=Bn(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Un(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=vt(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function tr(e){let t=e,n=[];zn(t.router)&&Rn(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Xn(t,e);yt(n)&&await n}catch(e){if(An(e))throw e;if(un(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Hn(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(er(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(An(e))throw e;un(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Hn(t,l);e===void 0&&Dt();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await rr(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await rr(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Zn(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)}}let d=Rn(t);if(yt(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function nr(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function rr(e,t=ar){!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);let n=()=>e._componentsLoaded?void 0:t===ar?(()=>{if(e._componentsPromise===void 0){let t=nr(e,ar);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():nr(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function ir(e){for(let t of ar)if(e.options[t]?.preload)return!0;return!1}var ar=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],or=`__TSR_index`,sr=`popstate`,cr=`beforeunload`;function lr(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=pr(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[or];i=ur(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[or];i=ur(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[or]!==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 ur(e,t){t||={};let n=mr();return{...t,key:n,__TSR_key:n,[or]:e}}function dr(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??(()=>pr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=mr();t.history.replaceState({[or]: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=pr(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[or]-l.state[or],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=lr({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(cr,S,{capture:!0}),t.removeEventListener(sr,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(cr,S,{capture:!0}),t.addEventListener(sr,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 fr(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function pr(e,t){let n=fr(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=mr();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||{[or]:0,key:a,__TSR_key:a}}}function mr(){return(Math.random()+1).toString(36).substring(7)}function hr(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var gr=class{constructor(e,t){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=>{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.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=on(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=dr()),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=Ot(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Fn(yr(this.latestLocation),e),bn(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=tn(o);t&&t!==`/`&&e.push(Mn({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:jn(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(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=Ut(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Rt(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 i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:wt(e).path,external:!1,searchStr:o,search:dt(t?.search,i),hash:wt(r.slice(1)).path,state:ft(t?.state,a)}}let o=new URL(i,this.origin),s=Nn(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:wt(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:dt(t?.search,c),hash:wt(s.hash.slice(1)).path,state:ft(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)=>an({base:e,to:Qt(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=>xr({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=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s=Object.assign(Object.create(null),r.params),c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,st(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:wt(cn({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,br(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=Sr({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=dt(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?st(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?st(t.state,n.state):{};_=ft(n.state,_);let v=`${f}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=Pn(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=Tt(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=zt(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,st(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=_t(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=en(this.latestLocation.href)===en(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=vt(()=>{a?.resolve(),a=void 0}),i&&r())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=pr(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Nn(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(Ct(t,this.protocolAllowlist))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),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.get()??this.stores.location.get();for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=hr(t,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...n}),this.emit({type:`onBeforeLoad`,...n}),await tr({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatches.get(),location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){An(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):un(e)&&(n=e);let r=t?t.status:n?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(r),this.stores.redirect.set(t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},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.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(hr(r,i)):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.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),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.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().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{}if(e.options.href&&!e.options._builtLocation&&Ct(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=rr,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await tr({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(An(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});un(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},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Bt(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!_t(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?_t(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Tn,parseSearch:e.parseSearch??wn,protocolAllowlist:e.protocolAllowlist??St}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}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[`**`]:en(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?wr(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.matchStores.values())e.routeId&&u.set(e.routeId,e.get());for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=br(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof _r||(r=new _r(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=cn({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{Tr(r,_,a,x)}catch(e){if(S=un(e)||An(e)?e:new vr(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:dt(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||ir(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?dt(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:vt()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?ft(b.loaderDeps,m):m,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||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}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?dt(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=at(t),a={...e.search};for(let e of t)try{Object.assign(a,br(e.options.validateSearch,a))}catch{}let o=at(this.stores.matchesId.get()),s=o&&this.stores.matchStores.get(o)?.get(),c=s&&s.routeId===i.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{Tr(i,n,r??{},e)}catch{}l=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:l}}},_r=class extends Error{},vr=class extends Error{};function yr(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function br(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new _r(`Async validation not supported`);if(n.issues)throw new _r(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 xr({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=en(e),a,o,s=Vt(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function Sr({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Cr(n)(e,t,r??!1)}function Cr(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,...br(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:st(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 wr(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 On}function Tr(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 Er=`Error preloading route! ☝️`,Dr=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}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=On:this.parentRoute||Dt();let r=n?On:t?.path;r&&r!==`/`&&(r=$t(r));let i=t?.id||r,a=n?On:Zt([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Zt([`/`,a]));let o=a===`__root__`?`/`:Zt([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=en(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=>kn({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.`)}},Or=class extends Dr{constructor(e){super(e)}};function kr(e){if(typeof document<`u`&&document.querySelector){let t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==``){let e=document.getElementById(t.hash);e&&e.scrollIntoView(n)}}}function Ar(e){let t=e.errorComponent??Mr;return(0,B.jsx)(jr,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?z.createElement(t,{error:n,reset:r}):e.children})}var jr=class extends z.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Mr({error:e}){let[t,n]=z.useState(!1);return(0,B.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,B.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,B.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,B.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,B.jsx)(`div`,{children:(0,B.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,B.jsx)(`code`,{children:e.message}):null})}):null]})}function Nr({children:e,fallback:t=null}){return Pr()?(0,B.jsx)(z.Fragment,{children:e}):(0,B.jsx)(z.Fragment,{children:t})}function Pr(){return z.useSyncExternalStore(Fr,()=>!0,()=>!1)}function Fr(){return()=>{}}var Ir=z.createContext(null);function Lr(e){return z.useContext(Ir)}var Rr=z.createContext(void 0),zr=z.createContext(void 0),Br=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Br||{});function Vr({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Hr(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Ur=[],Wr=0,{link:Gr,unlink:Kr,propagate:qr,checkDirty:Jr,shallowPropagate:Yr}=Vr({update(e){return e._update()},notify(e){Ur[Zr++]=e,e.flags&=~Br.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Br.Mutable|Br.Dirty,ti(e))}}),Xr=0,Zr=0,Qr,$r=0;function ei(e){try{++$r,e()}finally{--$r||ni()}}function ti(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Kr(n,e)}function ni(){if(!($r>0)){for(;Xr<Zr;){let e=Ur[Xr];Ur[Xr++]=void 0,e.notify()}Xr=0,Zr=0}}function ri(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Br.None:Br.Mutable,get(){return Qr!==void 0&&Gr(i,Qr,Wr),i._snapshot},subscribe(e){let t=Hr(e),n={current:!1},r=ii(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Qr,o=t?.compare??Object.is;if(n)Qr=i,++Wr,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Br.Mutable|Br.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Qr=a,n&&(i.flags&=~Br.RecursedCheck),ti(i)}}};return n?(i.flags=Br.Mutable|Br.Dirty,i.get=function(){let e=i.flags;if(e&Br.Dirty||e&Br.Pending&&Jr(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Yr(e)}}else e&Br.Pending&&(i.flags=e&~Br.Pending);return Qr!==void 0&&Gr(i,Qr,Wr),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(qr(e),Yr(e),ni())}},i}function ii(e){let t=()=>{let t=Qr;Qr=n,++Wr,n.depsTail=void 0,n.flags=Br.Watching|Br.RecursedCheck;try{return e()}finally{Qr=t,n.flags&=~Br.RecursedCheck,ti(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Br.Watching|Br.RecursedCheck,notify(){let e=this.flags;e&Br.Dirty||e&Br.Pending&&Jr(this.deps,this)?t():this.flags=Br.Watching},stop(){this.flags=Br.None,this.depsTail=void 0,ti(this)}};return t(),n}var ai=o((e=>{var t=Pe();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),oi=o(((e,t)=>{t.exports=ai()})),si=o((e=>{var t=Pe(),n=oi();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ci=o(((e,t)=>{t.exports=si()}))();function li(e,t){return e===t}function ui(e,t,n=li){let r=(0,z.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,z.useCallback)(()=>e?.get(),[e]);return(0,ci.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var di={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function fi(e){let t=Lr(),n=z.useContext(e.from?zr:Rr),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=z.useRef(void 0);return ui(i??di,n=>{if((e.shouldThrow??!0)&&!n&&Dt(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=ft(a.current,r);return a.current=e,e}return r})}function pi(e){return fi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function mi(e){let{select:t,...n}=e;return fi({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function hi(e){return fi({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 gi(e){return fi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function _i(e){let t=Lr();return z.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function vi(e){return fi({...e,select:t=>e.select?e.select(t.context):t.context})}var yi=o((e=>{var t=Pe();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),bi=o(((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=yi()})),xi=c(bi(),1);function Si(e,t){let n=Lr(),r=it(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:ee,hash:k,state:A,mask:j,reloadDocument:M,unsafeRelative:N,from:te,_fromLocation:P,...ne}=e,re=Pr(),ie=z.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),F=ui(n.stores.location,e=>e,(e,t)=>e.href===t.href),I=z.useMemo(()=>{let e={_fromLocation:F,...ie};return n.buildLocation(e)},[n,F,ie]),ae=I.maskedLocation?I.maskedLocation.publicHref:I.publicHref,oe=I.maskedLocation?I.maskedLocation.external:I.external,L=z.useMemo(()=>ji(ae,oe,n.history,v),[v,oe,ae,n.history]),R=z.useMemo(()=>{if(L?.external)return Ct(L.href,n.protocolAllowlist)?void 0:L.href;if(!Mi(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),Ct(s,n.protocolAllowlist)?void 0:s}catch{}},[s,L,n.protocolAllowlist]),se=z.useMemo(()=>{if(R)return!1;if(o?.exact){if(!rn(F.pathname,I.pathname,n.basepath))return!1}else{let e=nn(F.pathname,n.basepath),t=nn(I.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!_t(F.search,I.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?re&&F.hash===I.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,F,R,re,I.hash,I.pathname,I.search,n.basepath]),ce=se?st(i,{})??wi:Ci,le=se?Ci:st(a,{})??Ci,ue=[b,ce.className,le.className].filter(Boolean).join(` `),de=(y||ce.style||le.style)&&{...y,...ce.style,...le.style},[fe,pe]=z.useState(!1),me=z.useRef(!1),he=e.reloadDocument||R?!1:c??n.options.defaultPreload,ge=l??n.options.defaultPreloadDelay??0,_e=z.useCallback(()=>{n.preloadRoute({...ie,_builtLocation:I}).catch(e=>{console.warn(e),console.warn(Er)})},[n,ie,I]);rt(r,z.useCallback(e=>{e?.isIntersecting&&_e()},[_e]),ki,{disabled:!!v||he!==`viewport`}),z.useEffect(()=>{me.current||!v&&he===`render`&&(_e(),me.current=!0)},[v,_e,he]);let ve=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!Pi(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,xi.flushSync)(()=>{pe(!0)});let t=n.subscribe(`onResolved`,()=>{t(),pe(!1)});n.navigate({...ie,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(R)return{...ne,ref:r,href:R,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let ye=e=>{if(v||he!==`intent`)return;if(!ge){_e();return}let t=e.currentTarget;if(Oi.has(t))return;let n=setTimeout(()=>{Oi.delete(t),_e()},ge);Oi.set(t,n)},be=e=>{v||he!==`intent`||_e()},xe=e=>{if(v||!he||!ge)return;let t=e.currentTarget,n=Oi.get(t);n&&(clearTimeout(n),Oi.delete(t))};return{...ne,...ce,...le,href:L?.href,ref:r,onClick:Ai([x,ve]),onBlur:Ai([S,xe]),onFocus:Ai([C,ye]),onMouseEnter:Ai([w,ye]),onMouseLeave:Ai([T,xe]),onTouchStart:Ai([E,be]),disabled:!!v,target:_,...de&&{style:de},...ue&&{className:ue},...v&&Ti,...se&&Ei,...re&&fe&&Di}}var Ci={},wi={className:`active`},Ti={role:`link`,"aria-disabled":!0},Ei={"data-status":`active`,"aria-current":`page`},Di={"data-transitioning":`transitioning`},Oi=new WeakMap,ki={rootMargin:`100px`},Ai=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function ji(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Mi(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Ni=z.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Si(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return z.createElement(`a`,t,o)}return z.createElement(n,a,o)});function Pi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Fi=class extends Dr{constructor(e){super(e),this.useMatch=e=>fi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>vi({...e,from:this.id}),this.useSearch=e=>gi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>hi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>mi({...e,from:this.id}),this.useLoaderData=e=>pi({...e,from:this.id}),this.useNavigate=()=>_i({from:this.fullPath}),this.Link=z.forwardRef((e,t)=>(0,B.jsx)(Ni,{ref:t,from:this.fullPath,...e}))}};function Ii(e){return new Fi(e)}var Li=class extends Or{constructor(e){super(e),this.useMatch=e=>fi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>vi({...e,from:this.id}),this.useSearch=e=>gi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>hi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>mi({...e,from:this.id}),this.useLoaderData=e=>pi({...e,from:this.id}),this.useNavigate=()=>_i({from:this.fullPath}),this.Link=z.forwardRef((e,t)=>(0,B.jsx)(Ni,{ref:t,from:this.fullPath,...e}))}};function Ri(e){return new Li(e)}function zi(e){return new Bi(e,{silent:!0}).createRoute}var Bi=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Ii(e);return t.isRoot=!1,t},this.silent=t?.silent}};function Vi(e){let t=Lr(),n=`not-found-${ui(t.stores.location,e=>e.pathname)}-${ui(t.stores.status,e=>e)}`;return(0,B.jsx)(Ar,{getResetKey:()=>n,onCatch:(t,n)=>{if(un(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(un(t))return e.fallback?.(t);throw t},children:e.children})}function Hi(){return(0,B.jsx)(`p`,{children:`Not Found`})}function Ui(e){return(0,B.jsx)(B.Fragment,{children:e.children})}function Wi(e,t,n){return t.options.notFoundComponent?(0,B.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,B.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,B.jsx)(Hi,{})}var Gi=z.memo(function({matchId:e}){let t=Lr(),n=t.stores.matchStores.get(e);n||Dt();let r=ui(t.stores.loadedAt,e=>e),i=ui(n,e=>e);return(0,B.jsx)(Ki,{router:t,matchId:e,resetKey:r,matchState:z.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Ki({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,B.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?z.Suspense:Ui,f=s?Ar:Ui,p=l?Vi:Ui;return(0,B.jsxs)(i.isRoot?i.options.shellComponent??Ui:Ui,{children:[(0,B.jsx)(Rr.Provider,{value:t,children:(0,B.jsx)(d,{fallback:o,children:(0,B.jsx)(f,{getResetKey:()=>n,errorComponent:s||Mr,onCatch:(e,t)=>{if(un(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,B.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return z.createElement(l,e)},children:u||r._displayPending?(0,B.jsx)(Nr,{fallback:o,children:(0,B.jsx)(Ji,{matchId:t})}):(0,B.jsx)(Ji,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(qi,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function qi({resetKey:e}){let t=Lr(),n=z.useRef(void 0);return tt(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...hr(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var Ji=z.memo(function({matchId:e}){let t=Lr(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||Dt();let i=ui(r,e=>e),a=i.routeId,o=t.routesById[a],s=z.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=z.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,B.jsx)(e,{},s):(0,B.jsx)(Yi,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=vt();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return un(i.error)||Dt(),Wi(t,o,i.error);if(i.status===`redirected`)throw An(i.error)||Dt(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),Yi=z.memo(function(){let e=Lr(),t=z.useContext(Rr),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=ui(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=ui(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,B.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||Dt(),Wi(e,a,void 0);if(!i)return null;let s=(0,B.jsx)(Gi,{matchId:i});return n===`__root__`?(0,B.jsx)(z.Suspense,{fallback:o,children:s}):s});function Xi(){let e=Lr(),t=z.useRef({router:e,mounted:!1}),[n,r]=z.useState(!1),i=ui(e.stores.isLoading,e=>e),a=ui(e.stores.hasPending,e=>e),o=nt(i),s=i||n||a,c=nt(s),l=i||a,u=nt(l);return e.startTransition=e=>{r(!0),z.startTransition(()=>{e(),r(!1)})},z.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 en(e.latestLocation.publicHref)!==en(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),tt(()=>{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]),tt(()=>{o&&!i&&e.emit({type:`onLoad`,...hr(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),tt(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...hr(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),tt(()=>{if(c&&!s){let t=hr(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),ei(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())}),t.hrefChanged&&kr(e)}},[s,c,e]),null}function Zi(){let e=Lr(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,B.jsx)(t,{}):null,r=(0,B.jsxs)(typeof document<`u`&&e.ssr?Ui:z.Suspense,{fallback:n,children:[(0,B.jsx)(Xi,{}),(0,B.jsx)(Qi,{})]});return e.options.InnerWrap?(0,B.jsx)(e.options.InnerWrap,{children:r}):r}function Qi(){let e=Lr(),t=ui(e.stores.firstId,e=>e),n=ui(e.stores.loadedAt,e=>e),r=t?(0,B.jsx)(Gi,{matchId:t}):null;return(0,B.jsx)(Rr.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,B.jsx)(Ar,{getResetKey:()=>n,errorComponent:Mr,onCatch:void 0,children:r})})}var $i=e=>({createMutableStore:ri,createReadonlyStore:ri,batch:ei}),ea=e=>new ta(e),ta=class extends gr{constructor(e){super(e,$i)}};function na({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,B.jsx)(Ir.Provider,{value:e,children:t});return e.options.Wrap?(0,B.jsx)(e.options.Wrap,{children:r}):r}function ra({router:e,...t}){return(0,B.jsx)(na,{router:e,...t,children:(0,B.jsx)(Zi,{})})}var ia=o((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,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=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&&E());){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&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,k=ee.port2;ee.port1.onmessage=D,O=function(){k.postMessage(null)}}else O=function(){_(D,0)};function A(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,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),aa=o(((e,t)=>{t.exports=ia()})),oa=o((e=>{var t=aa(),n=Pe(),r=bi();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function ee(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var k=Symbol.for(`react.client.reference`);function A(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?A(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return A(e(t))}catch{}}return null}var j=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},P=[],ne=-1;function re(e){return{current:e}}function ie(e){0>ne||(e.current=P[ne],P[ne]=null,ne--)}function F(e,t){ne++,P[ne]=e.current,e.current=t}var I=re(null),ae=re(null),oe=re(null),L=re(null);function R(e,t){switch(F(oe,t),F(ae,e),F(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ud(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ud(t),e=Wd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ie(I),F(I,e)}function se(){ie(I),ie(ae),ie(oe)}function ce(e){e.memoizedState!==null&&F(L,e);var t=I.current,n=Wd(t,e.type);t!==n&&(F(ae,e),F(I,n))}function le(e){ae.current===e&&(ie(I),ie(ae)),L.current===e&&(ie(L),ep._currentValue=te)}var ue,de;function fe(e){if(ue===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ue=t&&t[1]||``,de=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+ue+e+de}var pe=!1;function me(e,t){if(!e||pe)return``;pe=!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(`
4
- `),l=s.split(`
5
- `);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=`
6
- `+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{pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?fe(n):``}function he(e,t){switch(e.tag){case 26:case 27:case 5:return fe(e.type);case 16:return fe(`Lazy`);case 13:return e.child!==t&&t!==null?fe(`Suspense Fallback`):fe(`Suspense`);case 19:return fe(`SuspenseList`);case 0:case 15:return me(e.type,!1);case 11:return me(e.type.render,!1);case 1:return me(e.type,!0);case 31:return fe(`Activity`);default:return``}}function ge(e){try{var t=``,n=null;do t+=he(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var _e=Object.prototype.hasOwnProperty,ve=t.unstable_scheduleCallback,ye=t.unstable_cancelCallback,be=t.unstable_shouldYield,xe=t.unstable_requestPaint,Se=t.unstable_now,Ce=t.unstable_getCurrentPriorityLevel,we=t.unstable_ImmediatePriority,Te=t.unstable_UserBlockingPriority,Ee=t.unstable_NormalPriority,De=t.unstable_LowPriority,Oe=t.unstable_IdlePriority,ke=t.log,Ae=t.unstable_setDisableYieldValue,je=null,Me=null;function Ne(e){if(typeof ke==`function`&&Ae(e),Me&&typeof Me.setStrictMode==`function`)try{Me.setStrictMode(je,e)}catch{}}var Fe=Math.clz32?Math.clz32:B,Ie=Math.log,z=Math.LN2;function B(e){return e>>>=0,e===0?32:31-(Ie(e)/z|0)|0}var Le=256,Re=262144,ze=4194304;function Be(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 Ve(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=Be(n))):i=Be(o):i=Be(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Be(n))):i=Be(o)):i=Be(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 He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ue(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 We(){var e=ze;return ze<<=1,!(ze&62914560)&&(ze=4194304),e}function Ge(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qe(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-Fe(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&&Je(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Fe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ye(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Xe(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(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 Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=N.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function et(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var tt=Math.random().toString(36).slice(2),nt=`__reactFiber$`+tt,rt=`__reactProps$`+tt,it=`__reactContainer$`+tt,at=`__reactEvents$`+tt,ot=`__reactListeners$`+tt,st=`__reactHandles$`+tt,ct=`__reactResources$`+tt,lt=`__reactMarker$`+tt;function ut(e){delete e[nt],delete e[rt],delete e[at],delete e[ot],delete e[st]}function dt(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pf(e);e!==null;){if(n=e[nt])return n;e=pf(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[nt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function mt(e){var t=e[ct];return t||=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ht(e){e[lt]=!0}var gt=new Set,_t={};function vt(e,t){yt(e,t),yt(e+`Capture`,t)}function yt(e,t){for(_t[e]=t,e=0;e<t.length;e++)gt.add(t[e])}var bt=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]*$`),xt={},St={};function Ct(e){return _e.call(St,e)?!0:_e.call(xt,e)?!1:bt.test(e)?St[e]=!0:(xt[e]=!0,!1)}function wt(e,t,n){if(Ct(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 Tt(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 Et(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 Dt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ot(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function kt(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 At(e){if(!e._valueTracker){var t=Ot(e)?`checked`:`value`;e._valueTracker=kt(e,t,``+e[t])}}function jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ot(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Mt(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 Nt=/[\n"\\]/g;function Pt(e){return e.replace(Nt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ft(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=``+Dt(t)):e.value!==``+Dt(t)&&(e.value=``+Dt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Lt(e,o,Dt(n)):Lt(e,o,Dt(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=``+Dt(s):e.removeAttribute(`name`)}function It(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)){At(e);return}n=n==null?``:``+Dt(n),t=t==null?n:``+Dt(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),At(e)}function Lt(e,t,n){t===`number`&&Mt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Rt(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=``+Dt(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 zt(e,t,n){if(t!=null&&(t=``+Dt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Dt(n)}function Bt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(j(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Dt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),At(e)}function Vt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ht=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 Ut(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||Ht.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Wt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(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 a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ut(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ut(e,o,t[o])}function Gt(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 Kt=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`]]),qt=/^[\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 Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ft(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="`+Pt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[rt]||null;if(!a)throw Error(i(90));Ft(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&jt(r)}break a;case`textarea`:zt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Rt(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(yu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[rt]||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(i(231,t,typeof n));return n}var an=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,`passive`,{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.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 un=i.slice(e,1<r?1-r:void 0)}function fn(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 pn(){return!0}function mn(){return!1}function hn(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)?pn:mn,this.isPropagationStopped=mn,this}return f(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=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=f({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=f({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,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!==Sn&&(Sn&&e.type===`mousemove`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=hn(Cn),Tn=hn(f({},Cn,{dataTransfer:0})),En=hn(f({},vn,{relatedTarget:0})),Dn=hn(f({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(f({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=hn(f({},gn,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={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`},Mn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=hn(f({},vn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=hn(f({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(f({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(f({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(f({},Cn,{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})),Bn=hn(f({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],Hn=an&&`CompositionEvent`in window,Un=null;an&&`documentMode`in document&&(Un=document.documentMode);var Wn=an&&`TextEvent`in window&&!Un,Gn=an&&(!Hn||Un&&8<Un&&11>=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Qn(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=dn(),un=ln=cn=null,Xn=!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 Gn&&t.locale!==`ko`?null:t.data;default:return null}}var $n={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 er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!$n[e.type]:t===`textarea`}function tr(e,t,n,r){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=Dd(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var nr=null,rr=null;function ir(e){yd(e,0)}function ar(e){if(jt(pt(e)))return e}function or(e,t){if(e===`change`)return t}var sr=!1;if(an){var cr;if(an){var lr=`oninput`in document;if(!lr){var ur=document.createElement(`div`);ur.setAttribute(`oninput`,`return;`),lr=typeof ur.oninput==`function`}cr=lr}else cr=!1;sr=cr&&(!document.documentMode||9<document.documentMode)}function dr(){nr&&(nr.detachEvent(`onpropertychange`,fr),rr=nr=null)}function fr(e){if(e.propertyName===`value`&&ar(rr)){var t=[];tr(t,rr,e,Zt(e)),nn(ir,t)}}function pr(e,t,n){e===`focusin`?(dr(),nr=t,rr=n,nr.attachEvent(`onpropertychange`,fr)):e===`focusout`&&dr()}function mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ar(rr)}function hr(e,t){if(e===`click`)return ar(t)}function gr(e,t){if(e===`input`||e===`change`)return ar(t)}function _r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var vr=typeof Object.is==`function`?Object.is:_r;function yr(e,t){if(vr(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(!_e.call(t,i)||!vr(e[i],t[i]))return!1}return!0}function br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xr(e,t){var n=br(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=br(n)}}function Sr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mt(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=Mt(e.document)}return t}function wr(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 Tr=an&&`documentMode`in document&&11>=document.documentMode,Er=null,Dr=null,Or=null,kr=!1;function Ar(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kr||Er==null||Er!==Mt(r)||(r=Er,`selectionStart`in r&&wr(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}),Or&&yr(Or,r)||(Or=r,r=Dd(Dr,`onSelect`),0<r.length&&(t=new _n(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Er)))}function jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Mr={animationend:jr(`Animation`,`AnimationEnd`),animationiteration:jr(`Animation`,`AnimationIteration`),animationstart:jr(`Animation`,`AnimationStart`),transitionrun:jr(`Transition`,`TransitionRun`),transitionstart:jr(`Transition`,`TransitionStart`),transitioncancel:jr(`Transition`,`TransitionCancel`),transitionend:jr(`Transition`,`TransitionEnd`)},Nr={},Pr={};an&&(Pr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Mr.animationend.animation,delete Mr.animationiteration.animation,delete Mr.animationstart.animation),`TransitionEvent`in window||delete Mr.transitionend.transition);function Fr(e){if(Nr[e])return Nr[e];if(!Mr[e])return e;var t=Mr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Pr)return Nr[e]=t[n];return e}var Ir=Fr(`animationend`),Lr=Fr(`animationiteration`),Rr=Fr(`animationstart`),zr=Fr(`transitionrun`),Br=Fr(`transitionstart`),Vr=Fr(`transitioncancel`),Hr=Fr(`transitionend`),Ur=new Map,Wr=`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(` `);Wr.push(`scrollEnd`);function Gr(e,t){Ur.set(e,t),vt(t,[e])}var Kr=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)},qr=[],Jr=0,Yr=0;function Xr(){for(var e=Jr,t=Yr=Jr=0;t<e;){var n=qr[t];qr[t++]=null;var r=qr[t];qr[t++]=null;var i=qr[t];qr[t++]=null;var a=qr[t];if(qr[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&&ei(n,i,a)}}function Zr(e,t,n,r){qr[Jr++]=e,qr[Jr++]=t,qr[Jr++]=n,qr[Jr++]=r,Yr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qr(e,t,n,r){return Zr(e,t,n,r),ti(e)}function $r(e,t){return Zr(e,null,null,t),ti(e)}function ei(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-Fe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ti(e){if(50<uu)throw uu=0,du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ni={};function ri(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 ii(e,t,n,r){return new ri(e,t,n,r)}function ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oi(e,t){var n=e.alternate;return n===null?(n=ii(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 si(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 ci(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ai(e)&&(s=1);else if(typeof e==`string`)s=Gf(e,n,I.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=ii(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return li(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=ii(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=ii(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=ii(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ii(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function li(e,t,n,r){return e=ii(7,e,r,t),e.lanes=n,e}function ui(e,t,n){return e=ii(6,e,null,t),e.lanes=n,e}function di(e){var t=ii(18,null,null,0);return t.stateNode=e,t}function fi(e,t,n){return t=ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pi=new WeakMap;function mi(e,t){if(typeof e==`object`&&e){var n=pi.get(e);return n===void 0?(t={value:e,source:t,stack:ge(t)},pi.set(e,t),t):n}return{value:e,source:t,stack:ge(t)}}var hi=[],gi=0,_i=null,vi=0,yi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){hi[gi++]=vi,hi[gi++]=_i,_i=e,vi=t}function Ei(e,t,n){yi[xi++]=Ci,yi[xi++]=wi,yi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-Fe(r)-1;r&=~(1<<i),n+=1;var a=32-Fe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-Fe(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===_i;)_i=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null;for(;e===Si;)Si=yi[--xi],yi[xi]=null,wi=yi[--xi],yi[xi]=null,Ci=yi[--xi],yi[xi]=null}function ki(e,t){yi[xi++]=Ci,yi[xi++]=wi,yi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,Mi=!1,Ni=null,Pi=!1,Fi=Error(i(519));function Ii(e){throw Hi(mi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[nt]=e,t[rt]=r,n){case`dialog`:bd(`cancel`,t),bd(`close`,t);break;case`iframe`:case`object`:case`embed`:bd(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)bd(_d[n],t);break;case`source`:bd(`error`,t);break;case`img`:case`image`:case`link`:bd(`error`,t),bd(`load`,t);break;case`details`:bd(`toggle`,t);break;case`input`:bd(`invalid`,t),It(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:bd(`invalid`,t);break;case`textarea`:bd(`invalid`,t),Bt(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||Nd(t.textContent,n)?(r.popover!=null&&(bd(`beforetoggle`,t),bd(`toggle`,t)),r.onScroll!=null&&bd(`scroll`,t),r.onScrollEnd!=null&&bd(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Ai=Ai.return}}function zi(e){if(e!==Ai)return!1;if(!Mi)return Ri(e),Mi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Gd(e.type,e.memoizedProps)),n=!n),n&&ji&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=ff(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=ff(e)}else t===27?(t=ji,$d(e.type)?(e=df,df=null,ji=e):ji=t):ji=Ai?uf(e.stateNode.nextSibling):null;return!0}function Bi(){ji=Ai=null,Mi=!1}function Vi(){var e=Ni;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=re(null),Wi=null,Gi=null;function Ki(e,t,n){F(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,ie(Ui)}function Ji(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 Yi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ji(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ji(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Xi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;vr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===L.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!vr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(i(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=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()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,oa={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sa(){return{controller:new na,data:new Map,refCount:0}}function ca(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var la=null,ua=0,da=0,fa=null;function pa(e,t){if(la===null){var n=la=[];ua=0,da=dd(),fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ua++,t.then(ma,ma),t}function ma(){if(--ua===0&&la!==null){fa!==null&&(fa.status=`fulfilled`);var e=la;la=null,da=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ha(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 ga=M.S;M.S=function(e,t){$l=Se(),typeof t==`object`&&t&&typeof t.then==`function`&&pa(e,t),ga!==null&&ga(e,t)};var _a=re(null);function va(){var e=_a.current;return e===null?Pl.pooledCache:e}function ya(e,t){t===null?F(_a,_a.current):F(_a,t.pool)}function ba(){var e=va();return e===null?null:{parent:oa._currentValue,pool:e}}var xa=Error(i(460)),Sa=Error(i(474)),Ca=Error(i(542)),wa={then:function(){}};function Ta(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ea(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yt,Yt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e;default:if(typeof t.status==`string`)t.then(Yt,Yt);else{if(e=Pl,e!==null&&100<e.shellSuspendCounter)throw Error(i(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,Aa(e),e}throw Oa=t,xa}}function Da(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Oa=e,xa):e}}var Oa=null;function ka(){if(Oa===null)throw Error(i(459));var e=Oa;return Oa=null,e}function Aa(e){if(e===xa||e===Ca)throw Error(i(483))}var ja=null,Ma=0;function Na(e){var t=Ma;return Ma+=1,ja===null&&(ja=[]),Ea(ja,e,t)}function Pa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Fa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ia(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 a(e,t){return e=oi(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=ui(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Da(i)===t.type)?(t=a(t,n.props),Pa(t,n),t.return=e,t):(t=ci(n.type,n.key,n.props,null,e.mode,r),Pa(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=fi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=li(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ui(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=ci(t.type,t.key,t.props,null,e.mode,n),Pa(n,t),n.return=e,n;case h:return t=fi(t,e.mode,n),t.return=e,t;case T:return t=Da(t),f(e,t,n)}if(j(t)||ee(t))return t=li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Na(t),n);if(t.$$typeof===b)return f(e,ea(e,t),n);Fa(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 m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Da(n),p(e,t,n,r)}if(j(n)||ee(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Na(n),r);if(n.$$typeof===b)return p(e,t,ea(e,n),r);Fa(e,n)}return null}function _(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 m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Da(r),_(e,t,n,r,i)}if(j(r)||ee(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Na(r),i);if(r.$$typeof===b)return _(e,t,n,ea(t,r),i);Fa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Mi&&Ti(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Mi&&Ti(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Mi&&Ti(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Mi&&Ti(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Mi&&Ti(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Mi&&Ti(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Da(l)===r.type){n(e,r.sibling),c=a(r,o.props),Pa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=li(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ci(o.type,o.key,o.props,null,e.mode,c),Pa(c,o),c.return=e,e=c)}return s(e);case h: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=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=fi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Da(o),x(e,r,o,c)}if(j(o))return v(e,r,o,c);if(ee(o)){if(l=ee(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Na(o),c);if(o.$$typeof===b)return x(e,r,ea(e,o),c);Fa(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=a(r,o),c.return=e,e=c):(n(e,r),c=ui(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ma=0;var i=x(e,t,n,r);return ja=null,i}catch(t){if(t===xa||t===Ca)throw t;var a=ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var La=Ia(!0),Ra=Ia(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(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 Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Nl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function Wa(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,Ye(e,n)}}function Ga(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 Ka=!1;function qa(){if(Ka){var e=fa;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!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 p=s.lane&-536870913,m=p!==s.lane;if(m?(Il&p)===p:(r&p)===p){p!==0&&p===da&&(Ka=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:za=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;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),Wl|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(i(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=re(null),Qa=re(0);function $a(e,t){e=Hl,F(Qa,e),F(Za,t),Hl=e|t.baseLanes}function eo(){F(Qa,Hl),F(Za,Za.current)}function to(){Hl=Qa.current,ie(Za),ie(Qa)}var no=re(null),ro=null;function V(e){var t=e.alternate;F(so,so.current&1),F(no,e),ro===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(ro=e)}function io(e){F(so,so.current),F(no,e),ro===null&&(ro=e)}function H(e){e.tag===22?(F(so,so.current),F(no,e),ro===null&&(ro=e)):ao(e)}function ao(){F(so,so.current),F(no,no.current)}function oo(e){ie(no),ro===e&&(ro=null),ie(so)}var so=re(0);function co(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sf(n)||cf(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 lo=0,U=null,uo=null,W=null,fo=!1,po=!1,mo=!1,ho=0,go=0,_o=null,G=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return lo=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Fs:Is,mo=!1,a=n(r,i),mo=!1,po&&(a=So(t,n,r,i)),xo(e),a}function xo(e){M.H=q;var t=uo!==null&&uo.next!==null;if(lo=0,W=uo=U=null,fo=!1,go=0,_o=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Zi(e)&&(Xs=!0))}function So(e,t,n,r){U=e;var a=0;do{if(po&&(_o=null),go=0,po=!1,25<=a)throw Error(i(301));if(a+=1,W=uo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=J,o=t(n,r)}while(po);return o}function Co(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(uo===null?null:uo.memoizedState)!==e&&(U.flags|=1024),t}function wo(){var e=ho!==0;return ho=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(fo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}fo=!1}lo=0,W=uo=U=null,po=!1,go=ho=0,_o=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return W===null?U.memoizedState=W=e:W=W.next=e,W}function Oo(){if(uo===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=uo.next;var t=W===null?U.memoizedState:W.next;if(t!==null)W=t,uo=e;else{if(e===null)throw U.alternate===null?Error(i(467)):Error(i(310));uo=e,e={memoizedState:uo.memoizedState,baseState:uo.baseState,baseQueue:uo.baseQueue,queue:uo.queue,next:null},W===null?U.memoizedState=W=e:W=W.next=e}return W}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=go;return go+=1,_o===null&&(_o=[]),e=Ea(_o,e,t),t=U,(W===null?t.memoizedState:W.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Fs:Is),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===b)return $i(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.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=ko(),U.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]=D;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),uo,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(lo&f)===f:(Il&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===da&&(d=!0);else if((lo&p)===p){u=u.next,p===da&&(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,U.lanes|=p,Wl|=p;f=u.action,mo&&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,U.lanes|=f,Wl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!vr(o,e.memoizedState)&&(Xs=!0,d&&(n=fa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);vr(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=U,a=Oo(),o=Mi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!vr((uo||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||W!==null&&W.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),Pl===null)throw Error(i(349));o||lo&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=ko(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function Ho(e){var t=$r(e,2);t!==null&&mu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),mo){Ne(!0);try{n()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,uo,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ns(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(Mi){var n=Pl.formState;if(n!==null){a:{var r=U;if(Mi){if(ji){b:{for(var i=ji,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=uf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=uf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,U,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,U,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),uo,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===xa?Ca:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=uo;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=ko(),U.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 is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();U.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;uo!==null&&r!==null&&yo(r,uo.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(U.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=ko(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(Nl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(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 ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),mo){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||lo&1073741824&&!(Il&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),U.lanes|=e,Wl|=e,n)}function ys(e,t,n,r){return vr(n,t)?n:Za.current===null?!(lo&42)||lo&1073741824&&!(Il&261930)?(Xs=!0,e.memoizedState=n):(e=pu(),U.lanes|=e,Wl|=e,t):(e=vs(e,n,r),vr(e,t)||(Xs=!0),e)}function bs(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};M.T=s,Ms(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,ha(c,r),fu(e)):js(e,t,r,fu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,te,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},fu())}function Ts(){return $i(ep)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Ha(n);var r=Ua(t,e,n);r!==null&&(mu(r,t,n),Wa(r,t,n)),t={cache:sa()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=Qr(e,t,n,r),n!==null&&(mu(n,e,r),K(n,t,r)))}function As(e,t,n){js(e,t,n,fu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(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,vr(s,o))return Zr(e,t,i,0),Pl===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return mu(n,e,r),K(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=Qr(e,n,r,2),t!==null&&mu(t,e,2)}function Ns(e){var t=e.alternate;return e===U||t!==null&&t===U}function Ps(e,t){po=fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function K(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}var q={readContext:$i,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};q.useEffectEvent=vo;var Fs={readContext:$i,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(mo){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(mo){Ne(!0);try{n(t)}finally{Ne(!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=ks.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,U,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,a=Do();if(Mi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Pl===null)throw Error(i(349));Il&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=Pl.identifierPrefix;if(Mi){var n=wi,r=Ci;n=(r&~(1<<32-Fe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ho++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=G++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,U)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(Nl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:$i,use:jo,useCallback:gs,useContext:$i,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),uo.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),uo,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Is.useEffectEvent=us;var J={readContext:$i,use:jo,useCallback:gs,useContext:$i,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return uo===null?vs(n,e,t):ys(n,uo.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return uo===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,uo,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};J.useEffectEvent=us;function Y(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var X={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Ha(r);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(mu(t,e,r),Wa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Ha(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(mu(t,e,r),Wa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=Ha(n);r.tag=2,t!=null&&(r.callback=t),t=Ua(e,r,n),t!==null&&(mu(t,e,n),Wa(t,e,n))}};function Ls(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?!yr(n,r)||!yr(i,a):!0}function Rs(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&&X.enqueueReplaceState(t,t.state,null)}function zs(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=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Bs(e){Kr(e)}function Vs(e){console.error(e)}function Hs(e){Kr(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(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 Gs(e,t,n){return n=Ha(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=Ha(e),e.tag=3,e}function qs(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(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(t,n,r),typeof i!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=no.current,n!==null){switch(n.tag){case 31:case 13:return ro===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===wa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===wa?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,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Eu(),!1}if(Mi)return t=no.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),Hi(mi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=mi(r,n),a=Gs(e.stateNode,r,a),Ga(e,a),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),Hi(mi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=mi(o,n),Yl===null?Yl=[o]:Yl.push(o),Ul!==4&&(Ul=2),t===null)return!0;r=mi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Ga(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`&&(nu===null||!nu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ks(a),qs(a,e,n,r),Ga(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?Ra(t,null,n,r):La(t,e.child,n,r)}function Qs(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 Qi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!Xs?(To(e,t,i),Sc(e,t,i)):(Mi&&s&&Di(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ec(e,t,a,r,i)):(e=ci(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?yr:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(yr(a,r)&&e.ref===t.ref)if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}return cc(e,t,n,r,i)}function tc(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 rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ya(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),H(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ya(t,null),eo(),ao(t)):(ya(t,a.cachePool),$a(t,a),ao(t),t.memoizedState=null);return Zs(e,t,i,n),t.child}function nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rc(e,t,n,r,i){var a=va();return a=a===null?null:{parent:oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ya(t,null),eo(),H(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return La(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,oo(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Mi){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(io(t),(e=ji)?(e=of(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(io(t),a)if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Xs||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Pl,r!==null&&(s=Xe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,$r(e,s),mu(r,e,s),Ys;Eu(),t=ac(e,t,n)}else e=o.treeContext,ji=uf(s.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=ic(t,r),t.flags|=4096;return t}return e=oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function cc(e,t,n,r,i){return Qi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!Xs?(To(e,t,i),Sc(e,t,i)):(Mi&&r&&Di(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!Xs?(To(e,t,a),Sc(e,t,a)):(Mi&&r&&Di(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=ni,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=X,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ba(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Y(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&&X.enqueueReplaceState(a,a.state,null),Ja(t,r,a,i),qa(),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=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ni,typeof u==`object`&&u&&(o=$i(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)&&Rs(t,a,r,o),za=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,i),qa(),l=t.memoizedState,s||f!==l||za?(typeof d==`function`&&(Y(t,n,d,r),l=t.memoizedState),(c=za||Ls(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,Va(e,t),o=t.memoizedProps,u=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ni,typeof l==`object`&&l&&(c=$i(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)&&Rs(t,a,r,c),za=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,i),qa();var p=t.memoizedState;o!==d||f!==p||za||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Y(t,n,s,r),p=t.memoizedState),(u=za||Ls(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(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,sc(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=La(t,e.child,null,i),t.child=La(t,null,n,i)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return Bi(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:ba()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function hc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(so.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Mi){if(a?V(t):ao(t),(e=ji)?(e=of(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return cf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ao(t),a=t.mode,c=_c({mode:`hidden`,children:c},a),r=li(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(V(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(V(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(ao(t),c=r.fallback,a=t.mode,r=_c({mode:`visible`,children:r.children},a),c=li(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,La(t,e.child,null,n),r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(ao(t),t.child=e.child,t.flags|=128,t=null);else if(V(t),cf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Pl,s!==null&&(r=Xe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,$r(e,r),mu(s,e,r),Ys;sf(c)||Eu(),t=vc(e,t,n)}else sf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=uf(c.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(ao(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=oi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=li(c,a,n,null),c.flags|=2):c=oi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=ba():(l=oa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(V(t),n=e.child,e=n.sibling,n=oi(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 gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=ii(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return La(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function bc(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 xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=so.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,F(so,o),Zs(e,t,r,n),r=Mi?vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(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&&co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bc(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&&co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Zi(e))):!0}function wc(e,t,n){switch(t.tag){case 3:R(t,t.stateNode.containerInfo),Ki(t,oa,e.memoizedState.cache),Bi();break;case 27:case 5:ce(t);break;case 4:R(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,io(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(V(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(V(t),t.flags|=128,null);V(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),F(so,so.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Ki(t,oa,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}else Xs=!1,Mi&&t.flags&1048576&&Ei(t,vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Da(t.elementType),t.type=e,typeof e==`function`)ai(e)?(r=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=Qs(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=A(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(R(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Va(e,t),Ja(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,oa,r),r!==o.cache&&Yi(t,[oa],n,!0),qa(),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=dc(e,t,r,n);break a}else if(r!==a){a=mi(Error(i(424)),t),Hi(a),t=dc(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(ji=uf(e.firstChild),Ai=t,Mi=!0,Ni=null,Pi=!0,n=Ra(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=jf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Mi||(n=t.type,e=t.pendingProps,r=Hd(oe.current).createElement(n),r[nt]=t,r[rt]=e,Id(r,n,e),ht(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ce(t),e===null&&Mi&&(r=t.stateNode=mf(t.type,t.pendingProps,oe.current),Ai=t,Pi=!0,a=ji,$d(t.type)?(df=a,ji=uf(r.firstChild)):ji=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Mi&&((a=r=ji)&&(r=rf(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,Ai=t,ji=uf(r.firstChild),Pi=!1,a=!0)),a||Ii(t)),ce(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Gd(a,o)?r=null:s!==null&&Gd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),ep._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&Mi&&((e=n=ji)&&(n=af(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Ii(t)),null;case 13:return hc(e,t,n);case 4:return R(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(oa),e===null?(a=va(),a===null&&(a=Pl,o=sa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ba(t),Ki(t,oa,a)):((e.lanes&n)!==0&&(Va(e,t),Ja(t,null,null,n),qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ki(t,oa,r),r!==a.cache&&Yi(t,[oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ki(t,oa,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(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(Cu())e.flags|=8192;else throw Oa=wa,Sa}else e.flags&=-16777217}function Oc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Kf(t))if(Cu())e.flags|=8192;else throw Oa=wa,Sa}function kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:We(),e.lanes|=t,Jl|=t)}function Ac(e,t){if(!Mi)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 jc(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 Mc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(oa),se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(le(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=I.current,zi(t)?Li(t,e):(e=mf(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(le(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=I.current,zi(t))Li(t,o);else{var s=Hd(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);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(a,{is:r.is}):s.createElement(a)}}o[nt]=t,o[rt]=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(Id(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Nd(e.nodeValue,n)),e||Ii(t,!0)}else e=Hd(e).createTextNode(r),e[nt]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[nt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(oo(t),t):(oo(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[nt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(oo(t),t):(oo(t),null)}return oo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),kc(t,t.updateQueue),jc(t),null);case 4:return se(),e===null&&Cd(t.stateNode.containerInfo),jc(t),null;case 10:return qi(t.type),jc(t),null;case 19:if(ie(so),r=t.memoizedState,r===null)return jc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ac(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=co(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)si(n,e),n=n.sibling;return F(so,so.current&1|2),Mi&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Se()>eu&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}else{if(!a)if(e=co(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Mi)return jc(t),null}else 2*Se()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,Ac(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?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Se(),e.sibling=null,n=so.current,F(so,a?n&1|2:n&1),Mi&&Ti(t,r.treeForkCount),e);case 22:case 23:return oo(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)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(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&&ie(_a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(oa),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(oa),se(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return le(t),null;case 31:if(t.memoizedState!==null){if(oo(t),t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(so),null;case 4:return se(),null;case 10:return qi(t.type),null;case 22:case 23:return oo(t),to(),e!==null&&ie(_a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(oa),null;case 25:return null;default:return null}}function Pc(e,t){switch(Oi(t),t.tag){case 3:qi(oa),se();break;case 26:case 27:case 5:le(t);break;case 4:se();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:ie(so);break;case 10:qi(t.type);break;case 22:case 23:oo(t),to(),e!==null&&ie(_a);break;case 24:qi(oa)}}function Fc(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){Wu(t,t.return,e)}}function Ic(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){Wu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Wu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){Wu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Wu(e,t,n)}}function zc(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){Wu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Wu(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){Wu(e,t,n)}else n.current=null}function Vc(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){Wu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Ld(r,e.type,n,t),r[rt]=t}catch(t){Wu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$d(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(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&&$d(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 Gc(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=Yt));else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(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&&$d(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Id(t,r,n),t[nt]=e,t[rt]=n}catch(t){Wu(e,e.return,t)}}var Z=!1,Jc=!1,Yc=!1,Xc=typeof WeakSet==`function`?WeakSet:Set,Zc=null;function Qc(e,t){if(e=e.containerInfo,Bd=lp,e=Cr(e),wr(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 a=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||a!==0&&f.nodeType!==3||(c=s+a),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===a&&(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(Vd={focusedElem:e,selectionRange:n},lp=!1,Zc=t;Zc!==null;)if(t=Zc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Zc=e;else for(;Zc!==null;){switch(t=Zc,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++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Wu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)nf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:nf(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(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Zc=e;break}Zc=t.return}}function $c(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ml(e,n),r&4&&Fc(5,n);break;case 1:if(ml(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Wu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Wu(n,n.return,e)}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(ml(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){Wu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:ml(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:ml(e,n);break;case 31:ml(e,n),r&4&&al(e,n);break;case 13:ml(e,n),r&4&&ol(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),lf(e,n))));break;case 22:if(r=n.memoizedState!==null||Z,!r){t=t!==null&&t.memoizedState!==null||Jc,i=Z;var a=Jc;Z=r,(Jc=t)&&!a?gl(e,n,(n.subtreeFlags&8772)!=0):ml(e,n),Z=i,Jc=a}break;case 30:break;default:ml(e,n)}}function el(e){var t=e.alternate;t!==null&&(e.alternate=null,el(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(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 tl=null,nl=!1;function rl(e,t,n){for(n=n.child;n!==null;)il(e,t,n),n=n.sibling}function il(e,t,n){if(Me&&typeof Me.onCommitFiberUnmount==`function`)try{Me.onCommitFiberUnmount(je,n)}catch{}switch(n.tag){case 26:Jc||Bc(n,t),rl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Jc||Bc(n,t);var r=tl,i=nl;$d(n.type)&&(tl=n.stateNode,nl=!1),rl(e,t,n),hf(n.stateNode),tl=r,nl=i;break;case 5:Jc||Bc(n,t);case 6:if(r=tl,i=nl,tl=null,rl(e,t,n),tl=r,nl=i,tl!==null)if(nl)try{(tl.nodeType===9?tl.body:tl.nodeName===`HTML`?tl.ownerDocument.body:tl).removeChild(n.stateNode)}catch(e){Wu(n,t,e)}else try{tl.removeChild(n.stateNode)}catch(e){Wu(n,t,e)}break;case 18:tl!==null&&(nl?(e=tl,ef(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Fp(e)):ef(tl,n.stateNode));break;case 4:r=tl,i=nl,tl=n.stateNode.containerInfo,nl=!0,rl(e,t,n),tl=r,nl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Jc||Ic(4,n,t),rl(e,t,n);break;case 1:Jc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),rl(e,t,n);break;case 21:rl(e,t,n);break;case 22:Jc=(r=Jc)||n.memoizedState!==null,rl(e,t,n),Jc=r;break;default:rl(e,t,n)}}function al(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fp(e)}catch(e){Wu(t,t.return,e)}}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fp(e)}catch(e){Wu(t,t.return,e)}}function sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xc),t;default:throw Error(i(435,e.tag))}}function cl(e,t){var n=sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function ll(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if($d(c.type)){tl=c.stateNode,nl=!1;break a}break;case 5:tl=c.stateNode,nl=!1;break a;case 3:case 4:tl=c.stateNode.containerInfo,nl=!0;break a}c=c.return}if(tl===null)throw Error(i(160));il(o,s,a),tl=null,nl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)dl(t,e),t=t.sibling}var ul=null;function dl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ll(t,e),fl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),r&64&&Z&&(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 a=ul;if(ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(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,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[lt]||o[nt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Id(o,r,n),o[nt]=e,ht(o),r=o;break a;case`link`:var s=Uf(`link`,`href`,a).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=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Uf(`meta`,`content`,a).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=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[nt]=e,ht(o),r=o}e.stateNode=r}else Wf(a,e.type,e.stateNode);else e.stateNode=Rf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Wf(a,e.type,e.stateNode):Rf(a,r,e.memoizedProps))}break;case 27:ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ll(t,e),fl(e),r&512&&(Jc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{Vt(a,``)}catch(t){Wu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Yc=!0);break;case 6:if(ll(t,e),fl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Wu(e,e.return,t)}}break;case 3:if(Hf=null,a=ul,ul=vf(t.containerInfo),ll(t,e),ul=a,fl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(t){Wu(e,e.return,t)}Yc&&(Yc=!1,pl(e));break;case 4:r=ul,ul=vf(e.stateNode.containerInfo),ll(t,e),fl(e),ul=r;break;case 12:ll(t,e),fl(e);break;case 31:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 13:ll(t,e),fl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=Se()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Z,d=Jc;if(Z=u||a,Jc=d||l,ll(t,e),Jc=d,Z=u,fl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Z||Jc||hl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)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){Wu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Wu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?tf(m,!0):tf(l.stateNode,!1)}catch(e){Wu(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,cl(e,n))));break;case 19:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 30:break;case 21:break;default:ll(t,e),fl(e)}}function fl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Vt(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Wu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ml(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$c(e,t.alternate,t),t=t.sibling}function hl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),hl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),hl(t);break;case 27:hf(t.stateNode);case 26:case 5:Bc(t,t.return),hl(t);break;case 22:t.memoizedState===null&&hl(t);break;case 30:hl(t);break;default:hl(t)}e=e.sibling}}function gl(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:gl(i,a,n),Fc(4,a);break;case 1:if(gl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Wu(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){Wu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:gl(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:gl(i,a,n);break;case 31:gl(i,a,n),n&&o&4&&al(i,a);break;case 13:gl(i,a,n),n&&o&4&&ol(i,a);break;case 22:a.memoizedState===null&&gl(i,a,n),zc(a,a.return);break;case 30:break;default:gl(i,a,n)}t=t.sibling}}function _l(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&&ca(n))}function vl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e))}function yl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bl(e,t,n,r),t=t.sibling}function bl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:yl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:yl(e,t,n,r);break;case 3:yl(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&&ca(e)));break;case 12:if(i&2048){yl(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){Wu(t,t.return,e)}}else yl(e,t,n,r);break;case 31:yl(e,t,n,r);break;case 13:yl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?yl(e,t,n,r):(a._visibility|=2,xl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?yl(e,t,n,r):Sl(e,t),i&2048&&_l(o,t);break;case 24:yl(e,t,n,r),i&2048&&vl(t.alternate,t);break;default:yl(e,t,n,r)}}function xl(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:xl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,xl(a,o,s,c,i)):u._visibility&2?xl(a,o,s,c,i):Sl(a,o),i&&l&2048&&_l(o.alternate,o);break;case 24:xl(a,o,s,c,i),i&&l&2048&&vl(o.alternate,o);break;default:xl(a,o,s,c,i)}t=t.sibling}}function Sl(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:Sl(n,r),i&2048&&_l(r.alternate,r);break;case 24:Sl(n,r),i&2048&&vl(r.alternate,r);break;default:Sl(n,r)}t=t.sibling}}var Cl=8192;function wl(e,t,n){if(e.subtreeFlags&Cl)for(e=e.child;e!==null;)Tl(e,t,n),e=e.sibling}function Tl(e,t,n){switch(e.tag){case 26:wl(e,t,n),e.flags&Cl&&e.memoizedState!==null&&qf(n,ul,e.memoizedState,e.memoizedProps);break;case 5:wl(e,t,n);break;case 3:case 4:var r=ul;ul=vf(e.stateNode.containerInfo),wl(e,t,n),ul=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Cl,Cl=16777216,wl(e,t,n),Cl=r):wl(e,t,n));break;default:wl(e,t,n)}}function El(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 Dl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ol(e),e=e.sibling}function Ol(e){switch(e.tag){case 0:case 11:case 15:Dl(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Dl(e);break;case 12:Dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kl(e)):Dl(e);break;default:Dl(e)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),kl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,kl(t));break;default:kl(t)}e=e.sibling}}function Al(e,t){for(;Zc!==null;){var n=Zc;switch(n.tag){case 0:case 11:case 15:Ic(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:ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Zc=r;else a:for(n=e;Zc!==null;){r=Zc;var i=r.sibling,a=r.return;if(el(r),r===n){Zc=null;break a}if(i!==null){i.return=a,Zc=i;break a}Zc=a}}}var jl={getCacheForType:function(e){var t=$i(oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(oa).controller.signal}},Ml=typeof WeakMap==`function`?WeakMap:Map,Nl=0,Pl=null,Fl=null,Il=0,Ll=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return Nl&2&&Il!==0?Il&-Il:M.T===null?$e():dd()}function pu(){if(ql===0)if(!(Il&536870912)||Mi){var e=Re;Re<<=1,!(Re&3932160)&&(Re=262144),ql=e}else ql=536870912;return e=no.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===Pl&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,Il,ql,!1)),Ke(e,n),(!(Nl&2)||e!==Pl)&&(e===Pl&&(!(Nl&2)&&(Gl|=n),Ul===4&&vu(e,Il,ql,!1)),rd(e))}function hu(e,t,n){if(Nl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||He(e,t),a=r?ku(e,t):Du(e,t,!0),o=r;do{if(a===0){Bl&&!r&&vu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!_u(n)){a=Du(e,t,!1),o=!1;continue}if(a===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;a=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(xu(c,s).flags|=256),s=Du(c,s,!1),s!==2){if(Vl&&!l){c.errorRecoveryDisabledLanes|=o,Gl|=o,a=4;break a}o=Xl,Xl=a,o!==null&&(Xl===null?Xl=o:Xl.push.apply(Xl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){xu(e,0),vu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ql+300-Se(),10<a)){if(vu(r,t,ql,!zl),Ve(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=Jd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,`Throttled`,-0,0),a);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,null,-0,0)}}break}while(1);rd(e)}function gu(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:Yt},Tl(t,a,d);var m=(a&62914560)===a?Ql-Se():(a&4194048)===a?$l-Se():0;if(m=Yf(d,m),m!==null){ou=a,e.cancelPendingCommit=m(Iu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),vu(e,a,o,!l);return}}Iu(e,t,a,n,r,i,o,s,c)}function _u(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(!vr(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 vu(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Fe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Je(e,n,t)}function yu(){return Nl&6?!0:(id(0,!1),!1)}function bu(){if(Fl!==null){if(Ll===0)var e=Fl.return;else e=Fl,Gi=Wi=null,Eo(e),ja=null,Ma=0,e=Fl;for(;e!==null;)Pc(e.alternate,e),e=e.return;Fl=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Yd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),Pl=e,Fl=n=oi(e.current,null),Il=t,Ll=0,Rl=null,zl=!1,Bl=He(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Fe(r),a=1<<i;t|=e[i],r&=~a}return Hl=t,Xr(),n}function Su(e,t){U=null,M.H=q,t===xa||t===Ca?(t=ka(),Ll=3):t===Sa?(t=ka(),Ll=4):Ll=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,Fl===null&&(Ul=1,Us(e,mi(t,e.current)))}function Cu(){var e=no.current;return e===null?!0:(Il&4194048)===Il?ro===null:(Il&62914560)===Il||Il&536870912?e===ro:!1}function wu(){var e=M.H;return M.H=q,e===null?q:e}function Tu(){var e=M.A;return M.A=jl,e}function Eu(){Ul=4,zl||(Il&4194048)!==Il&&no.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||Pl===null||vu(Pl,Il,ql,!1)}function Du(e,t,n){var r=Nl;Nl|=2;var i=wu(),a=Tu();(Pl!==e||Il!==t)&&(tu=null,xu(e,t)),t=!1;var o=Ul;a:do try{if(Ll!==0&&Fl!==null){var s=Fl,c=Rl;switch(Ll){case 8:bu(),o=6;break a;case 3:case 2:case 9:case 6:no.current===null&&(t=!0);var l=Ll;if(Ll=0,Rl=null,Nu(e,s,c,l),n&&Bl){o=0;break a}break;default:l=Ll,Ll=0,Rl=null,Nu(e,s,c,l)}}Ou(),o=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,Nl=r,M.H=i,M.A=a,Fl===null&&(Pl=null,Il=0,Xr()),o}function Ou(){for(;Fl!==null;)ju(Fl)}function ku(e,t){var n=Nl;Nl|=2;var r=wu(),a=Tu();Pl!==e||Il!==t?(tu=null,eu=Se()+500,xu(e,t)):Bl=He(e,t);a:do try{if(Ll!==0&&Fl!==null){t=Fl;var o=Rl;b:switch(Ll){case 1:Ll=0,Rl=null,Nu(e,t,o,1);break;case 2:case 9:if(Ta(o)){Ll=0,Rl=null,Mu(t);break}t=function(){Ll!==2&&Ll!==9||Pl!==e||(Ll=7),rd(e)},o.then(t,t);break a;case 3:Ll=7;break a;case 4:Ll=5;break a;case 7:Ta(o)?(Ll=0,Rl=null,Mu(t)):(Ll=0,Rl=null,Nu(e,t,o,7));break;case 5:var s=null;switch(Fl.tag){case 26:s=Fl.memoizedState;case 5:case 27:var c=Fl;if(s?Kf(s):c.stateNode.complete){Ll=0,Rl=null;var l=c.sibling;if(l!==null)Fl=l;else{var u=c.return;u===null?Fl=null:(Fl=u,Pu(u))}break b}}Ll=0,Rl=null,Nu(e,t,o,5);break;case 6:Ll=0,Rl=null,Nu(e,t,o,6);break;case 8:bu(),Ul=6;break a;default:throw Error(i(462))}}Au();break}catch(t){Su(e,t)}while(1);return Gi=Wi=null,M.H=r,M.A=a,Nl=n,Fl===null?(Pl=null,Il=0,Xr(),Ul):0}function Au(){for(;Fl!==null&&!be();)ju(Fl)}function ju(e){var t=Tc(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):Fl=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lc(n,t,t.pendingProps,t.type,void 0,Il);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Il);break;case 5:Eo(t);default:Pc(n,t),t=Fl=si(t,Hl),t=Tc(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):Fl=t}function Nu(e,t,n,r){Gi=Wi=null,Eo(t),ja=null,Ma=0;var i=t.return;try{if(Js(e,i,t,n,Il)){Ul=1,Us(e,mi(n,e.current)),Fl=null;return}}catch(t){if(i!==null)throw Fl=i,t;Ul=1,Us(e,mi(n,e.current)),Fl=null;return}t.flags&32768?(Mi||r===1?e=!0:Bl||Il&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=no.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=Mc(t.alternate,t,Hl);if(n!==null){Fl=n;return}if(t=t.sibling,t!==null){Fl=t;return}Fl=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Nc(e.alternate,e);if(n!==null){n.flags&=32767,Fl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Fl=e;return}Fl=e=n}while(e!==null);Ul=6,Fl=null}function Iu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(Nl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Yr,qe(e,n,o,s,c,l),e===Pl&&(Fl=Pl=null,Il=0),au=t,iu=e,ou=n,su=o,cu=a,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ee,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=M.T,M.T=null,a=N.p,N.p=2,s=Nl,Nl|=4;try{Qc(e,t,n)}finally{Nl=s,N.p=a,M.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=Nl;Nl|=4;try{dl(t,e);var a=Vd,o=Cr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Sr(s.ownerDocument.documentElement,s)){if(c!==null&&wr(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 _=xr(s,h),v=xr(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}}lp=!!Bd,Vd=Bd=null}finally{Nl=i,N.p=r,M.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=Nl;Nl|=4;try{$c(e,t.alternate,t)}finally{Nl=i,N.p=r,M.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,xe();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(nu=null),Qe(n),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot==`function`)try{Me.onCommitFiberRoot(je,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=M.T,i=N.p,N.p=2,M.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{M.T=t,N.p=i}}ou&3&&Vu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===du?uu++:(uu=0,du=e):uu=0,id(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ca(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=Qe(ou),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,Nl&6)throw Error(i(331));var c=Nl;if(Nl|=4,Ol(o.current),bl(o,o.current,s,n),Nl=c,id(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{N.p=a,M.T=r,Bu(e,t)}}function Uu(e,t,n){t=mi(n,t),t=Gs(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Ke(e,2),rd(e))}function Wu(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=mi(n,e),n=Ks(2),r=Ua(t,n,2),r!==null&&(qs(n,r,t,e),Ke(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ml;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)||(Vl=!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,Pl===e&&(Il&n)===n&&(Ul===4||Ul===3&&(Il&62914560)===Il&&300>Se()-Ql?!(Nl&2)&&xu(e,0):Kl|=n,Jl===Il&&(Jl=0)),rd(e)}function qu(e,t){t===0&&(t=We()),e=$r(e,t),e!==null&&(Ke(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,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return ve(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-Fe(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=Il,a=Ve(r,r===Pl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||He(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&&qd()&&(e=nd);for(var t=Se(),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}ru!==0&&ru!==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-Fe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ue(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Pl,n=Il,n=Ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ye(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||He(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ye(r),Qe(n)){case 2:case 8:n=Te;break;case 32:n=Ee;break;case 268435456:n=Oe;break;default:n=Ee}return r=cd.bind(null,e),n=ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ye(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=Il;return r=Ve(e,e===Pl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),sd(e,Se()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Vu())return null;hu(e,t,!0)}function ud(){Zd(function(){Nl&6?ve(we,ad):od()})}function dd(){if(nd===0){var e=da;e===0&&(e=Le,Le<<=1,!(Le&261888)&&(Le=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+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[rt]||null).action),o=r.submitter;o&&(t=(t=o[rt]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new _n(`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);Ss(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),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Wr.length;hd++){var gd=Wr[hd];Gr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Gr(Ir,`onAnimationEnd`),Gr(Lr,`onAnimationIteration`),Gr(Rr,`onAnimationStart`),Gr(`dblclick`,`onDoubleClick`),Gr(`focusin`,`onFocus`),Gr(`focusout`,`onBlur`),Gr(zr,`onTransitionRun`),Gr(Br,`onTransitionStart`),Gr(Vr,`onTransitionCancel`),Gr(Hr,`onTransitionEnd`),yt(`onMouseEnter`,[`mouseout`,`mouseover`]),yt(`onMouseLeave`,[`mouseout`,`mouseover`]),yt(`onPointerEnter`,[`pointerout`,`pointerover`]),yt(`onPointerLeave`,[`pointerout`,`pointerover`]),vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),vt(`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){Kr(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){Kr(e)}i.currentTarget=null,a=c}}}}function bd(e,t){var n=t[at];n===void 0&&(n=t[at]=new Set);var r=e+`__bubble`;n.has(r)||(wd(t,e,2,!1),n.add(r))}function xd(e,t,n){var r=0;t&&(r|=4),wd(n,e,r,t)}var Sd=`_reactListening`+Math.random().toString(36).slice(2);function Cd(e){if(!e[Sd]){e[Sd]=!0,gt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||xd(t,!1,e),xd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sd]||(t[Sd]=!0,xd(`selectionchange`,!1,t))}}function wd(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!on||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 Td(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=dt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}nn(function(){var r=a,i=Zt(n),s=[];a:{var c=Ur.get(e);if(c!==void 0){var l=_n,u=e;switch(e){case`keypress`:if(fn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;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=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Ir:case Lr:case Rr:l=Dn;break;case Hr:l=Rn;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=On;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=Bn}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=rn(m,p),g!=null&&d.push(Ed(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Xt&&(u=n.relatedTarget||n.fromElement)&&(dt(u)||u[it]))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?dt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:pt(l),h=u==null?c:pt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,dt(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=Od,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&&kd(s,c,l,d,!1),u!==null&&f!==null&&kd(s,f,u,d,!0)}}a:{if(c=r?pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=or;else if(er(c))if(sr)v=gr;else{v=mr;var y=pr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Gt(r.elementType)&&(v=or):v=hr;if(v&&=v(e,r)){tr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Lt(c,`number`,c.value)}switch(y=r?pt(r):window,e){case`focusin`:(er(y)||y.contentEditable===`true`)&&(Er=y,Dr=r,Or=null);break;case`focusout`:Or=Dr=Er=null;break;case`mousedown`:kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:kr=!1,Ar(s,n,i);break;case`selectionchange`:if(Tr)break;case`keydown`:case`keyup`:Ar(s,n,i)}var b;if(Hn)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 Xn?Jn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Gn&&n.locale!==`ko`&&(Xn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Xn&&(b=dn()):(cn=i,ln=`value`in cn?cn.value:cn.textContent,Xn=!0)),y=Dd(r,x),0<y.length&&(x=new kn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Yn(n),b!==null&&(x.data=b)))),(b=Wn?Zn(e,n):Qn(e,n))&&(x=Dd(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Ed(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dd(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=rn(e,n),i!=null&&r.unshift(Ed(e,i,a)),i=rn(e,t),i!=null&&r.push(Ed(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Od(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kd(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=rn(n,a),l!=null&&o.unshift(Ed(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(Ed(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ad=/\r\n?/g,jd=/\u0000|\uFFFD/g;function Md(e){return(typeof e==`string`?e:``+e).replace(Ad,`
9
- `).replace(jd,``)}function Nd(e,t){return t=Md(t),Md(e)===t}function Pd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Vt(e,``+r);break;case`className`:Tt(e,`class`,r);break;case`tabIndex`:Tt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Tt(e,n,r);break;case`style`:Wt(e,r,o);break;case`data`:if(t!==`object`){Tt(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=Jt(``+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`&&Pd(e,t,`name`,a.name,a,null),Pd(e,t,`formEncType`,a.formEncType,a,null),Pd(e,t,`formMethod`,a.formMethod,a,null),Pd(e,t,`formTarget`,a.formTarget,a,null)):(Pd(e,t,`encType`,a.encType,a,null),Pd(e,t,`method`,a.method,a,null),Pd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(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=Jt(``+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`:bd(`beforetoggle`,e),bd(`toggle`,e),wt(e,`popover`,r);break;case`xlinkActuate`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:wt(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=Kt.get(n)||n,wt(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:Wt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Vt(e,``+r);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[rt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):wt(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:bd(`error`,e),bd(`load`,e);var r=!1,a=!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`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,o,s,n,null)}}a&&Pd(e,t,`srcSet`,n.srcSet,n,null),r&&Pd(e,t,`src`,n.src,n,null);return;case`input`:bd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=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(i(137,t));break;default:Pd(e,t,r,d,n,null)}}It(e,o,c,l,u,s,a,!1);return;case`select`:for(a in bd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Pd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Rt(e,!!r,n,!0):Rt(e,!!r,t,!1);return;case`textarea`:for(s in bd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Pd(e,t,s,c,n,null)}Bt(e,r,a,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:Pd(e,t,l,r,n,null)}return;case`dialog`:bd(`beforetoggle`,e),bd(`toggle`,e),bd(`cancel`,e),bd(`close`,e);break;case`iframe`:case`object`:bd(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)bd(_d[r],e);break;case`image`:bd(`error`,e),bd(`load`,e);break;case`details`:bd(`toggle`,e);break;case`embed`:case`source`:case`link`:bd(`error`,e),bd(`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(i(137,t));default:Pd(e,t,u,r,n,null)}return;default:if(Gt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Pd(e,t,c,r,n,null))}function Ld(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 a=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)||Pd(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`:a=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(i(137,t));break;default:m!==f&&Pd(e,t,p,m,r,f)}}Ft(e,s,c,l,u,d,o,a);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)||Pd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Pd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Rt(e,!!n,n?[]:``,!1):Rt(e,!!n,t,!0)):Rt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Pd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Pd(e,t,s,a,r,o)}zt(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:Pd(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:Pd(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)&&Pd(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(i(137,t));break;default:Pd(e,t,u,p,r,m)}return;default:if(Gt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(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||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Pd(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||Pd(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){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&&Rd(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&&Rd(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 Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(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 Wd(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 Gd(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 Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e===Kd?!1:(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Yd=typeof clearTimeout==`function`?clearTimeout:void 0,Xd=typeof Promise==`function`?Promise:void 0,Zd=typeof queueMicrotask==`function`?queueMicrotask:Xd===void 0?Jd:function(e){return Xd.resolve(null).then(e).catch(Qd)};function Qd(e){setTimeout(function(){throw e})}function $d(e){return e===`head`}function ef(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)hf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,hf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&hf(e.ownerDocument.body);n=i}while(n);Fp(t)}function tf(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 nf(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`:nf(n),ut(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rf(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[lt])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=uf(e.nextSibling),e===null)break}return null}function af(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=uf(e.nextSibling),e===null))return null;return e}function of(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=uf(e.nextSibling),e===null))return null;return e}function sf(e){return e.data===`$?`||e.data===`$~`}function cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lf(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 uf(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 df=null;function ff(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return uf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pf(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 mf(e,t,n){switch(t=Hd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var gf=new Map,_f=new Set;function vf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=N.d;N.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=yu();return e||t}function xf(e){var t=ft(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=Pt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),ht(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Pt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Pt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Pt(n.imageSizes)+`"]`)):i+=`[href="`+Pt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}gf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Id(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Pt(r)+`"][href="`+Pt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!gf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Id(r,`link`,e),ht(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=mt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);ht(c),Id(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,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=mt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=f({src:e,async:!0},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),ht(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=mt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),ht(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=oe.current)?vf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=mt(a).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=Mf(n.href);var o=mt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.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},gf.set(e,n),o||Ff(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=If(n),n=mt(a).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(i(444,e))}}function Mf(e){return`href="`+Pt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(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}),Id(t,`link`,n),ht(t),e.head.appendChild(t))}function If(e){return`[src="`+Pt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Pt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Id(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=Pf(n),(a=gf.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,ht(a),a):(r=n,(a=gf.get(o))&&(r=f({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ht(a),Id(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,zf(r,n.precedence,e));return t.instance}function zf(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 Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,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[lt]||a[nt]||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 Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(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 Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(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=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ht(a);return}a=t.ownerDocument||t,r=Pf(r),(i=gf.get(i))&&Bf(r,i),a=a.createElement(`link`),ht(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:b,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function tp(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=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(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 np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ii(3,null,null,t),e.current=a,a.stateNode=e,t=sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ba(a),e}function rp(e){return e?(e=ni,e):ni}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(mu(n,e,t),Wa(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=$r(e,67108864);t!==null&&mu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=fu();t=Ze(t);var n=$r(e,t);n!==null&&mu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,fp(e,t,n,r)}finally{N.p=a,M.T=i}}function dp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,fp(e,t,n,r)}finally{N.p=a,M.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Td(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Fe(o);s.entanglements[1]|=c,o&=~c}rd(a),!(Nl&6)&&(eu=Se()+500,id(0,!1))}}break;case 31:case 13:s=$r(a,2),s!==null&&mu(s,a,2),yu(),op(a,2)}if(a=pp(r),a===null&&Td(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function pp(e){return e=Zt(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=dt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 mp=e,null}function gp(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(Ce()){case we:return 2;case Te:return 8;case Ee:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=ft(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=dt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,et(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=ft(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=ft(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[rt]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,fu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),yu(),t[it]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.5`)throw Error(i(527,zp,`19.2.5`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{je=Vp.inject(Bp),Me=Vp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[it]=t.current,Cd(e),new Lp(t)}})),sa=o(((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=oa()}))();function ca(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var la=e=>{switch(e){case`success`:return fa;case`info`:return ma;case`warning`:return pa;case`error`:return ha;default:return null}},ua=Array(12).fill(0),da=({visible:e,className:t})=>z.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},z.createElement(`div`,{className:`sonner-spinner`},ua.map((e,t)=>z.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),fa=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),pa=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),ma=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),ha=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ga=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),z.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),_a=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},va=1,ya=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:va++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],z.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(xa(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||va++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ba=(e,t)=>{let n=t?.id||va++;return ya.addToast({title:e,...t,id:n}),n},xa=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(ba,{success:ya.success,info:ya.info,warning:ya.warning,error:ya.error,custom:ya.custom,message:ya.message,promise:ya.promise,dismiss:ya.dismiss,loading:ya.loading},{getHistory:()=>ya.toasts,getToasts:()=>ya.getActiveToasts()}),ca(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Sa(e){return e.label!==void 0}var Ca=3,wa=`24px`,Ta=`16px`,Ea=4e3,Da=356,Oa=14,ka=45,Aa=200;function ja(...e){return e.filter(Boolean).join(` `)}function Ma(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Na=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=z.useState(null),[O,ee]=z.useState(null),[k,A]=z.useState(!1),[j,M]=z.useState(!1),[N,te]=z.useState(!1),[P,ne]=z.useState(!1),[re,ie]=z.useState(!1),[F,I]=z.useState(0),[ae,oe]=z.useState(0),L=z.useRef(n.duration||y||Ea),R=z.useRef(null),se=z.useRef(null),ce=c===0,le=c+1<=o,ue=n.type,de=n.dismissible!==!1,fe=n.className||``,pe=n.descriptionClassName||``,me=z.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),he=z.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ge=z.useMemo(()=>n.duration||y||Ea,[n.duration,y]),_e=z.useRef(0),ve=z.useRef(0),ye=z.useRef(0),be=z.useRef(null),[xe,Se]=b.split(`-`),Ce=z.useMemo(()=>s.reduce((e,t,n)=>n>=me?e:e+t.height,0),[s,me]),we=_a(),Te=n.invert||t,Ee=ue===`loading`;ve.current=z.useMemo(()=>me*x+Ce,[me,Ce]),z.useEffect(()=>{L.current=ge},[ge]),z.useEffect(()=>{A(!0)},[]),z.useEffect(()=>{let e=se.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),z.useLayoutEffect(()=>{if(!k)return;let e=se.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[k,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=z.useCallback(()=>{M(!0),I(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Aa)},[n,d,a,ve]);z.useEffect(()=>{if(n.promise&&ue===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||we?(()=>{if(ye.current<_e.current){let e=new Date().getTime()-_e.current;L.current-=e}ye.current=new Date().getTime()})():L.current!==1/0&&(_e.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},L.current)),()=>clearTimeout(e)},[u,i,n,ue,we,De]),z.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return w?.loading?z.createElement(`div`,{className:ja(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ue===`loading`},w.loading):z.createElement(da,{className:ja(C?.loader,n?.classNames?.loader),visible:ue===`loading`})}let ke=n.icon||w?.[ue]||la(ue);return z.createElement(`li`,{tabIndex:0,ref:se,className:ja(_,fe,C?.toast,n?.classNames?.toast,C?.default,C?.[ue],n?.classNames?.[ue]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":k,"data-promise":!!n.promise,"data-swiped":re,"data-removed":j,"data-visible":le,"data-y-position":xe,"data-x-position":Se,"data-index":c,"data-front":ce,"data-swiping":N,"data-dismissible":de,"data-type":ue,"data-invert":Te,"data-swipe-out":P,"data-swipe-direction":O,"data-expanded":!!(u||S&&k),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${j?F:ve.current}px`,"--initial-height":S?`auto`:`${ae}px`,...m,...n.style},onDragEnd:()=>{te(!1),D(null),be.current=null},onPointerDown:e=>{e.button!==2&&(Ee||!de||(R.current=new Date,I(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(te(!0),be.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(P||!de)return;be.current=null;let e=Number(se.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(se.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-R.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=ka||a>.11){I(ve.current),n.onDismiss==null||n.onDismiss.call(n,n),ee(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),ne(!0);return}else{var o,s;(o=se.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=se.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ie(!1),te(!1),D(null)},onPointerMove:t=>{var n,r;if(!be.current||!de||window.getSelection()?.toString().length>0)return;let i=t.clientY-be.current.y,a=t.clientX-be.current.x,o=e.swipeDirections??Ma(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ie(!0),(n=se.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=se.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},he&&!n.jsx&&ue!==`loading`?z.createElement(`button`,{"aria-label":T,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!de?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:ja(C?.closeButton,n?.classNames?.closeButton)},w?.close??ga):null,(ue||n.icon||n.promise)&&n.icon!==null&&(w?.[ue]!==null||n.icon)?z.createElement(`div`,{"data-icon":``,className:ja(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Oe():null,n.type===`loading`?null:ke):null,z.createElement(`div`,{"data-content":``,className:ja(C?.content,n?.classNames?.content)},z.createElement(`div`,{"data-title":``,className:ja(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?z.createElement(`div`,{"data-description":``,className:ja(v,pe,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),z.isValidElement(n.cancel)?n.cancel:n.cancel&&Sa(n.cancel)?z.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Sa(n.cancel)&&de&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:ja(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,z.isValidElement(n.action)?n.action:n.action&&Sa(n.action)?z.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Sa(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:ja(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Pa(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Fa(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ta:wa;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Ia=z.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Ca,toastOptions:g,dir:_=Pa(),gap:v=Oa,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=z.useState([]),C=z.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=z.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=z.useState([]),[D,O]=z.useState(!1),[ee,k]=z.useState(!1),[A,j]=z.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),M=z.useRef(null),N=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),te=z.useRef(null),P=z.useRef(!1),ne=z.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||ya.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return z.useEffect(()=>ya.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{xi.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),z.useEffect(()=>{if(d!==`system`){j(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?j(`dark`):j(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{j(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{j(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),z.useEffect(()=>{x.length<=1&&O(!1)},[x]),z.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=M.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===M.current||M.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),z.useEffect(()=>{if(M.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,P.current=!1)}},[M.current]),z.createElement(`section`,{ref:t,"aria-label":`${b} ${N}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?z.createElement(`ol`,{key:t,dir:_===`auto`?Pa():_,tabIndex:-1,ref:M,className:c,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Da}px`,"--gap":`${v}px`,...m,...Fa(l,u)},onBlur:e=>{P.current&&!e.currentTarget.contains(e.relatedTarget)&&(P.current=!1,te.current&&=(te.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||P.current||(P.current=!0,te.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{ee||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||k(!0)},onPointerUp:()=>k(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>z.createElement(Na,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:ee,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ne,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),La=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Ra=(e=>e?La(e):La),za=e=>e;function Ba(e,t=za){let n=z.useSyncExternalStore(e.subscribe,z.useCallback(()=>t(e.getState()),[e,t]),z.useCallback(()=>t(e.getInitialState()),[e,t]));return z.useDebugValue(n),n}var Va=e=>{let t=Ra(e),n=e=>Ba(t,e);return Object.assign(n,t),n},Ha=(e=>e?Va(e):Va),Ua=`aiworker-theme`,Wa=new Set([`light`,`dark`,`system`]),Ga=Ha()(e=>({theme:`system`,setTheme:t=>e({theme:t})}));function Ka(e){return`${Ua}:${e}`}function qa(e){return e!==null&&Wa.has(e)}function Ja(e){let t=window.localStorage.getItem(Ka(e));return qa(t)?t:null}function Ya(){return typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function Xa(e){return e===`system`?Ya()?`dark`:`light`:e}function Za(e){let t=document.documentElement,n=Xa(e);t.dataset.theme=n,t.dataset.themePreference=e}function Qa(e){let t=Ja(e)??`system`;Ga.setState({theme:t}),Za(t)}function $a({scope:e}){let t=Ga(e=>e.theme),n=Ga(e=>e.setTheme),r=(0,z.useRef)(!1),i=(0,z.useRef)(!0);return(0,z.useEffect)(()=>{let t=Ja(e);t&&n(t),r.current=!0},[e,n]),(0,z.useEffect)(()=>{if(Za(t),i.current?i.current=!1:r.current&&window.localStorage.setItem(Ka(e),t),t!==`system`||typeof window.matchMedia!=`function`)return;let n=window.matchMedia(`(prefers-color-scheme: dark)`),a=()=>Za(`system`);return n.addEventListener(`change`,a),()=>n.removeEventListener(`change`,a)},[e,t]),null}function eo(e){return(0,B.jsx)(Ia,{theme:Ga(e=>e.theme),className:`toaster group`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:rounded-sm group-[.toaster]:border-hairline group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:shadow-popover`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:rounded-pill group-[.toast]:border group-[.toast]:border-primary group-[.toast]:bg-primary group-[.toast]:font-medium group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-soft-stone group-[.toast]:text-muted-foreground`}},...e})}var to=new Me({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),no;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(no||={});var ro;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(ro||={});var V=no.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),io=e=>{switch(typeof e){case`undefined`:return V.undefined;case`string`:return V.string;case`number`:return Number.isNaN(e)?V.nan:V.number;case`boolean`:return V.boolean;case`function`:return V.function;case`bigint`:return V.bigint;case`symbol`:return V.symbol;case`object`:return Array.isArray(e)?V.array:e===null?V.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?V.promise:typeof Map<`u`&&e instanceof Map?V.map:typeof Set<`u`&&e instanceof Set?V.set:typeof Date<`u`&&e instanceof Date?V.date:V.object;default:return V.unknown}},H=no.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),ao=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,no.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};ao.create=e=>new ao(e);var oo=(e,t)=>{let n;switch(e.code){case H.invalid_type:n=e.received===V.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case H.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,no.jsonStringifyReplacer)}`;break;case H.unrecognized_keys:n=`Unrecognized key(s) in object: ${no.joinValues(e.keys,`, `)}`;break;case H.invalid_union:n=`Invalid input`;break;case H.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${no.joinValues(e.options)}`;break;case H.invalid_enum_value:n=`Invalid enum value. Expected ${no.joinValues(e.options)}, received '${e.received}'`;break;case H.invalid_arguments:n=`Invalid function arguments`;break;case H.invalid_return_type:n=`Invalid function return type`;break;case H.invalid_date:n=`Invalid date`;break;case H.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:no.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case H.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case H.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case H.custom:n=`Invalid input`;break;case H.invalid_intersection_types:n=`Intersection results could not be merged`;break;case H.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case H.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,no.assertNever(e)}return{message:n}},so=oo;function co(){return so}var lo=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function U(e,t){let n=co(),r=lo({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===oo?void 0:oo].filter(e=>!!e)});e.common.issues.push(r)}var uo=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return W;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return W;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},W=Object.freeze({status:`aborted`}),fo=e=>({status:`dirty`,value:e}),po=e=>({status:`valid`,value:e}),mo=e=>e.status===`aborted`,ho=e=>e.status===`dirty`,go=e=>e.status===`valid`,_o=e=>typeof Promise<`u`&&e instanceof Promise,G;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(G||={});var vo=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},yo=(e,t)=>{if(go(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new ao(e.common.issues);return this._error=t,this._error}}};function bo(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var xo=class{get description(){return this._def.description}_getType(e){return io(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:io(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new uo,ctx:{common:e.parent.common,data:e.data,parsedType:io(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(_o(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:io(e)};return yo(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:io(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return go(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>go(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:io(e)},r=this._parse({data:e,path:n.path,parent:n});return yo(n,await(_o(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:H.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new ws({schema:this,typeName:K.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Ts.create(this,this._def)}nullable(){return Es.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return as.create(this)}promise(){return Cs.create(this,this._def)}or(e){return cs.create([this,e],this._def)}and(e){return fs.create(this,e,this._def)}transform(e){return new ws({...bo(this._def),schema:this,typeName:K.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Ds({...bo(this._def),innerType:this,defaultValue:t,typeName:K.ZodDefault})}brand(){return new As({typeName:K.ZodBranded,type:this,...bo(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Os({...bo(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return js.create(this,e)}readonly(){return Ms.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},So=/^c[^\s-]{8,}$/i,Co=/^[0-9a-z]+$/,wo=/^[0-9A-HJKMNP-TV-Z]{26}$/i,To=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Eo=/^[a-z0-9_-]{21}$/i,Do=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Oo=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ko=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ao=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,jo,Mo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,No=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Po=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Fo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Io=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Lo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ro=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,zo=RegExp(`^${Ro}$`);function Bo(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Vo(e){return RegExp(`^${Bo(e)}$`)}function Ho(e){let t=`${Ro}T${Bo(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Uo(e,t){return!!((t===`v4`||!t)&&Mo.test(e)||(t===`v6`||!t)&&Po.test(e))}function Wo(e,t){if(!Do.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Go(e,t){return!!((t===`v4`||!t)&&No.test(e)||(t===`v6`||!t)&&Fo.test(e))}var Ko=class e extends xo{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.string,received:t.parsedType}),W}let t=new uo,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),U(n,{code:H.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),U(n,{code:H.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?U(n,{code:H.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&U(n,{code:H.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)ko.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`email`,code:H.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)jo||=new RegExp(Ao,`u`),jo.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`emoji`,code:H.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)To.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`uuid`,code:H.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Eo.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`nanoid`,code:H.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)So.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`cuid`,code:H.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Co.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`cuid2`,code:H.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)wo.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`ulid`,code:H.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),U(n,{validation:`url`,code:H.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`regex`,code:H.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),U(n,{code:H.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),U(n,{code:H.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),U(n,{code:H.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Ho(r).test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:H.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?zo.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:H.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Vo(r).test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:H.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Oo.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`duration`,code:H.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Uo(e.data,r.version)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`ip`,code:H.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Wo(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`jwt`,code:H.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Go(e.data,r.version)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`cidr`,code:H.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Io.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`base64`,code:H.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Lo.test(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{validation:`base64url`,code:H.invalid_string,message:r.message}),t.dirty()):no.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:H.invalid_string,...G.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...G.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...G.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...G.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...G.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...G.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...G.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...G.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...G.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...G.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...G.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...G.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...G.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...G.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...G.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...G.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...G.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...G.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...G.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...G.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...G.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...G.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...G.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...G.errToObj(t)})}nonempty(e){return this.min(1,G.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Ko.create=e=>new Ko({checks:[],typeName:K.ZodString,coerce:e?.coerce??!1,...bo(e)});function qo(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Jo=class e extends xo{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.number,received:t.parsedType}),W}let t,n=new uo;for(let r of this._def.checks)r.kind===`int`?no.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),U(t,{code:H.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),U(t,{code:H.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),U(t,{code:H.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?qo(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),U(t,{code:H.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),U(t,{code:H.not_finite,message:r.message}),n.dirty()):no.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,G.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,G.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,G.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,G.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:G.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:G.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:G.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:G.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:G.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:G.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:G.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&no.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Jo.create=e=>new Jo({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...bo(e)});var Yo=class e extends xo{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let t,n=new uo;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),U(t,{code:H.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),U(t,{code:H.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),U(t,{code:H.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):no.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.bigint,received:t.parsedType}),W}gte(e,t){return this.setLimit(`min`,e,!0,G.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,G.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,G.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,G.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:G.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:G.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:G.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Yo.create=e=>new Yo({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...bo(e)});var Xo=class extends xo{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.boolean,received:t.parsedType}),W}return po(e.data)}};Xo.create=e=>new Xo({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...bo(e)});var Zo=class e extends xo{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.date,received:t.parsedType}),W}if(Number.isNaN(e.data.getTime()))return U(this._getOrReturnCtx(e),{code:H.invalid_date}),W;let t=new uo,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),U(n,{code:H.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),U(n,{code:H.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):no.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:G.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:G.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Zo.create=e=>new Zo({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...bo(e)});var Qo=class extends xo{_parse(e){if(this._getType(e)!==V.symbol){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.symbol,received:t.parsedType}),W}return po(e.data)}};Qo.create=e=>new Qo({typeName:K.ZodSymbol,...bo(e)});var $o=class extends xo{_parse(e){if(this._getType(e)!==V.undefined){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.undefined,received:t.parsedType}),W}return po(e.data)}};$o.create=e=>new $o({typeName:K.ZodUndefined,...bo(e)});var es=class extends xo{_parse(e){if(this._getType(e)!==V.null){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.null,received:t.parsedType}),W}return po(e.data)}};es.create=e=>new es({typeName:K.ZodNull,...bo(e)});var ts=class extends xo{constructor(){super(...arguments),this._any=!0}_parse(e){return po(e.data)}};ts.create=e=>new ts({typeName:K.ZodAny,...bo(e)});var ns=class extends xo{constructor(){super(...arguments),this._unknown=!0}_parse(e){return po(e.data)}};ns.create=e=>new ns({typeName:K.ZodUnknown,...bo(e)});var rs=class extends xo{_parse(e){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.never,received:t.parsedType}),W}};rs.create=e=>new rs({typeName:K.ZodNever,...bo(e)});var is=class extends xo{_parse(e){if(this._getType(e)!==V.undefined){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.void,received:t.parsedType}),W}return po(e.data)}};is.create=e=>new is({typeName:K.ZodVoid,...bo(e)});var as=class e extends xo{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==V.array)return U(t,{code:H.invalid_type,expected:V.array,received:t.parsedType}),W;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(U(t,{code:e?H.too_big:H.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(U(t,{code:H.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(U(t,{code:H.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new vo(t,e,t.path,n)))).then(e=>uo.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new vo(t,e,t.path,n)));return uo.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:G.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:G.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:G.toString(n)}})}nonempty(e){return this.min(1,e)}};as.create=(e,t)=>new as({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...bo(t)});function os(e){if(e instanceof ss){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Ts.create(os(r))}return new ss({...e._def,shape:()=>t})}else if(e instanceof as)return new as({...e._def,type:os(e.element)});else if(e instanceof Ts)return Ts.create(os(e.unwrap()));else if(e instanceof Es)return Es.create(os(e.unwrap()));else if(e instanceof ps)return ps.create(e.items.map(e=>os(e)));else return e}var ss=class e extends xo{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=no.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==V.object){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.object,received:t.parsedType}),W}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof rs&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new vo(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof rs){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(U(n,{code:H.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new vo(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>uo.mergeObjectSync(t,e)):uo.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return G.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:G.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:K.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of no.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of no.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return os(this)}partial(t){let n={};for(let e of no.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of no.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Ts;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return bs(no.objectKeys(this.shape))}};ss.create=(e,t)=>new ss({shape:()=>e,unknownKeys:`strip`,catchall:rs.create(),typeName:K.ZodObject,...bo(t)}),ss.strictCreate=(e,t)=>new ss({shape:()=>e,unknownKeys:`strict`,catchall:rs.create(),typeName:K.ZodObject,...bo(t)}),ss.lazycreate=(e,t)=>new ss({shape:e,unknownKeys:`strip`,catchall:rs.create(),typeName:K.ZodObject,...bo(t)});var cs=class extends xo{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new ao(e.ctx.common.issues));return U(t,{code:H.invalid_union,unionErrors:n}),W}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new ao(e));return U(t,{code:H.invalid_union,unionErrors:i}),W}}get options(){return this._def.options}};cs.create=(e,t)=>new cs({options:e,typeName:K.ZodUnion,...bo(t)});var ls=e=>e instanceof vs?ls(e.schema):e instanceof ws?ls(e.innerType()):e instanceof ys?[e.value]:e instanceof xs?e.options:e instanceof Ss?no.objectValues(e.enum):e instanceof Ds?ls(e._def.innerType):e instanceof $o?[void 0]:e instanceof es?[null]:e instanceof Ts?[void 0,...ls(e.unwrap())]:e instanceof Es?[null,...ls(e.unwrap())]:e instanceof As||e instanceof Ms?ls(e.unwrap()):e instanceof Os?ls(e._def.innerType):[],us=class e extends xo{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==V.object)return U(t,{code:H.invalid_type,expected:V.object,received:t.parsedType}),W;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(U(t,{code:H.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),W)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=ls(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:K.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...bo(r)})}};function ds(e,t){let n=io(e),r=io(t);if(e===t)return{valid:!0,data:e};if(n===V.object&&r===V.object){let n=no.objectKeys(t),r=no.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ds(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===V.array&&r===V.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ds(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===V.date&&r===V.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var fs=class extends xo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(mo(e)||mo(r))return W;let i=ds(e.value,r.value);return i.valid?((ho(e)||ho(r))&&t.dirty(),{status:t.value,value:i.data}):(U(n,{code:H.invalid_intersection_types}),W)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};fs.create=(e,t,n)=>new fs({left:e,right:t,typeName:K.ZodIntersection,...bo(n)});var ps=class e extends xo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.array)return U(n,{code:H.invalid_type,expected:V.array,received:n.parsedType}),W;if(n.data.length<this._def.items.length)return U(n,{code:H.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),W;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:H.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new vo(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>uo.mergeArray(t,e)):uo.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ps.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ps({items:e,typeName:K.ZodTuple,rest:null,...bo(t)})};var ms=class e extends xo{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.object)return U(n,{code:H.invalid_type,expected:V.object,received:n.parsedType}),W;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new vo(n,e,n.path,e)),value:a._parse(new vo(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?uo.mergeObjectAsync(t,r):uo.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof xo?new e({keyType:t,valueType:n,typeName:K.ZodRecord,...bo(r)}):new e({keyType:Ko.create(),valueType:t,typeName:K.ZodRecord,...bo(n)})}},hs=class extends xo{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.map)return U(n,{code:H.invalid_type,expected:V.map,received:n.parsedType}),W;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new vo(n,e,n.path,[a,`key`])),value:i._parse(new vo(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return W;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return W;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};hs.create=(e,t,n)=>new hs({valueType:t,keyType:e,typeName:K.ZodMap,...bo(n)});var gs=class e extends xo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.set)return U(n,{code:H.invalid_type,expected:V.set,received:n.parsedType}),W;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(U(n,{code:H.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(U(n,{code:H.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return W;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new vo(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:G.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:G.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};gs.create=(e,t)=>new gs({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...bo(t)});var _s=class e extends xo{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==V.function)return U(t,{code:H.invalid_type,expected:V.function,received:t.parsedType}),W;function n(e,n){return lo({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,co(),oo].filter(e=>!!e),issueData:{code:H.invalid_arguments,argumentsError:n}})}function r(e,n){return lo({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,co(),oo].filter(e=>!!e),issueData:{code:H.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Cs){let e=this;return po(async function(...t){let o=new ao([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return po(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new ao([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new ao([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ps.create(t).rest(ns.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||ps.create([]).rest(ns.create()),returns:n||ns.create(),typeName:K.ZodFunction,...bo(r)})}},vs=class extends xo{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};vs.create=(e,t)=>new vs({getter:e,typeName:K.ZodLazy,...bo(t)});var ys=class extends xo{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return U(t,{received:t.data,code:H.invalid_literal,expected:this._def.value}),W}return{status:`valid`,value:e.data}}get value(){return this._def.value}};ys.create=(e,t)=>new ys({value:e,typeName:K.ZodLiteral,...bo(t)});function bs(e,t){return new xs({values:e,typeName:K.ZodEnum,...bo(t)})}var xs=class e extends xo{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return U(t,{expected:no.joinValues(n),received:t.parsedType,code:H.invalid_type}),W}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return U(t,{received:t.data,code:H.invalid_enum_value,options:n}),W}return po(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};xs.create=bs;var Ss=class extends xo{_parse(e){let t=no.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==V.string&&n.parsedType!==V.number){let e=no.objectValues(t);return U(n,{expected:no.joinValues(e),received:n.parsedType,code:H.invalid_type}),W}if(this._cache||=new Set(no.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=no.objectValues(t);return U(n,{received:n.data,code:H.invalid_enum_value,options:e}),W}return po(e.data)}get enum(){return this._def.values}};Ss.create=(e,t)=>new Ss({values:e,typeName:K.ZodNativeEnum,...bo(t)});var Cs=class extends xo{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==V.promise&&t.common.async===!1?(U(t,{code:H.invalid_type,expected:V.promise,received:t.parsedType}),W):po((t.parsedType===V.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Cs.create=(e,t)=>new Cs({type:e,typeName:K.ZodPromise,...bo(t)});var ws=class extends xo{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{U(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return W;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?W:r.status===`dirty`||t.value===`dirty`?fo(r.value):r});{if(t.value===`aborted`)return W;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?W:r.status===`dirty`||t.value===`dirty`?fo(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?W:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?W:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!go(e))return W;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>go(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):W);no.assertNever(r)}};ws.create=(e,t,n)=>new ws({schema:e,typeName:K.ZodEffects,effect:t,...bo(n)}),ws.createWithPreprocess=(e,t,n)=>new ws({schema:t,effect:{type:`preprocess`,transform:e},typeName:K.ZodEffects,...bo(n)});var Ts=class extends xo{_parse(e){return this._getType(e)===V.undefined?po(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ts.create=(e,t)=>new Ts({innerType:e,typeName:K.ZodOptional,...bo(t)});var Es=class extends xo{_parse(e){return this._getType(e)===V.null?po(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Es.create=(e,t)=>new Es({innerType:e,typeName:K.ZodNullable,...bo(t)});var Ds=class extends xo{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===V.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Ds.create=(e,t)=>new Ds({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...bo(t)});var Os=class extends xo{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return _o(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new ao(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new ao(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Os.create=(e,t)=>new Os({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...bo(t)});var ks=class extends xo{_parse(e){if(this._getType(e)!==V.nan){let t=this._getOrReturnCtx(e);return U(t,{code:H.invalid_type,expected:V.nan,received:t.parsedType}),W}return{status:`valid`,value:e.data}}};ks.create=e=>new ks({typeName:K.ZodNaN,...bo(e)});var As=class extends xo{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},js=class e extends xo{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?W:e.status===`dirty`?(t.dirty(),fo(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?W:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:K.ZodPipeline})}},Ms=class extends xo{_parse(e){let t=this._def.innerType._parse(e),n=e=>(go(e)&&(e.value=Object.freeze(e.value)),e);return _o(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};Ms.create=(e,t)=>new Ms({innerType:e,typeName:K.ZodReadonly,...bo(t)});function Ns(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function Ps(e,t={},n){return e?ts.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=Ns(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=Ns(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):ts.create()}ss.lazycreate;var K;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(K||={});var q=Ko.create,Fs=Jo.create;ks.create,Yo.create;var Is=Xo.create;Zo.create,Qo.create,$o.create,es.create,ts.create;var J=ns.create;rs.create,is.create;var Y=as.create,X=ss.create;ss.strictCreate;var Ls=cs.create,Rs=us.create;fs.create,ps.create;var zs=ms.create;hs.create,gs.create,_s.create,vs.create;var Bs=ys.create,Vs=xs.create;Ss.create,Cs.create,ws.create,Ts.create,Es.create,ws.createWithPreprocess,js.create;var Hs=/^[a-z0-9][a-z0-9._-]*$/,Us=/^[a-z][a-z0-9-]*$/,Ws=/^[a-z][a-z0-9-]*$/,Gs=q().min(1).regex(Hs,`admission id must be lowercase alphanumeric with . _ -`),Ks=q().min(1).regex(Us,`admission kind must be kebab-case`),qs=Vs([`low`,`medium`,`high`]),Js=Vs([`pending`,`approved`,`rejected`,`applied`,`failed`]),Ys=Vs([`approved`,`rejected`,`applied`,`failed`]),Xs=Vs([`conversation`,`message`,`tool-call`,`observation`,`artifact`,`memory`,`log`]),Zs=X({at:q().min(1),kind:Xs,summary:q().max(500).optional(),notes:q().max(2e3).optional(),ref:q().min(1)});X({confidence:Fs().min(0).max(1),createdAt:q().min(1),evidence:Y(Zs).readonly(),id:Gs,kind:Ks,payload:zs(q(),J()).optional(),risk:qs,rollback:q().min(1),scopeId:q().min(1).optional(),soulId:q().min(1).regex(Ws),status:Js,summary:q().min(1).max(2e3),target:q().min(1),updatedAt:q().min(1)}),X({confidence:Fs().min(0).max(1),evidence:Y(Zs).readonly().optional(),id:Gs,kind:Ks,payload:zs(q(),J()).optional(),risk:qs.default(`high`),rollback:q().min(1),scopeId:q().min(1).optional(),soulId:q().min(1).regex(Ws),summary:q().min(1).max(2e3),target:q().min(1)}),X({appliedAt:q().min(1).optional(),decidedAt:q().min(1),decidedBy:q().min(1),decision:Ys,failureReason:q().max(4e3).optional(),id:Fs().int().positive(),proposalId:Gs,reason:q().max(2e3).optional()}),X({body:q().min(1).max(2e4),topic:q().min(1).regex(/^[a-z0-9][a-z0-9._-]*$/).optional(),indexEntry:q().min(1).max(280).optional()}),X({body:q().min(1).max(2e4),skillId:q().min(1).regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/),overwrite:Is().optional()});var Qs=/^[a-z0-9][a-z0-9._-]*$/,$s=/^[a-z][a-z0-9-]*$/,ec=q().min(1).regex(Qs,`artifact id must be lowercase alphanumeric with . _ -`),tc=q().min(1).regex($s,`artifact type must be kebab-case`),nc=Vs([`public`,`internal`,`confidential`,`secret`]),rc=Vs([`active`,`archived`,`removed`]),ic=Vs([`operator`,`brain-runtime`,`executor`,`channel-import`]);X({createdAt:q().min(1),evidenceRefs:Y(q().min(1)).readonly(),hash:q().regex(/^[a-f0-9]{64}$/).optional(),id:ec,metadata:zs(q(),J()).optional(),ref:q().min(1),retention:q().min(1).optional(),scopeId:q().min(1).optional(),sensitivity:nc,source:ic,status:rc,summary:q().max(2e3).optional(),type:tc,updatedAt:q().min(1)}),X({evidenceRefs:Y(q().min(1)).readonly().optional(),hash:q().regex(/^[a-f0-9]{64}$/).optional(),id:ec,metadata:zs(q(),J()).optional(),ref:q().min(1),retention:q().min(1).optional(),scopeId:q().min(1).optional(),sensitivity:nc.default(`internal`),source:ic,status:rc.default(`active`),summary:q().max(2e3).optional(),type:tc});var ac=q().min(1).regex(/^[a-z][a-z0-9-]*$/,`brief section id must be kebab-case`),oc=Vs([`soul-doc`,`memory-doc`,`rollup-doc`,`risk-policy`,`admission-summary`,`artifact-summary`,`scope-manifest`,`soul-skeleton`]),sc=X({body:q().min(1),id:ac,protected:Is(),source:oc,tokens:Fs().int().nonnegative()}),cc=X({estimatedTokens:Fs().int().nonnegative(),id:ac,reason:q().min(1)});X({artifactRefs:Y(J()).transform(e=>e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e.length>0)).pipe(Y(q().min(1)).readonly()).optional(),executor:q().min(1).optional(),risk:qs.optional(),scopeId:q().min(1).optional(),soulId:q().min(1).optional(),task:q().min(1).max(4e3),tokenBudget:Fs().int().min(200).max(5e4).optional()}),X({compiledAt:q().min(1),droppedSections:Y(cc).readonly(),executor:q().min(1).optional(),scopeId:q().min(1).optional(),sections:Y(sc).readonly(),soulId:q().min(1),task:q().min(1),tokensBudget:Fs().int().positive(),tokensUsed:Fs().int().nonnegative(),warnings:Y(q().min(1)).readonly()});var lc=Symbol.for(`yaml.alias`),uc=Symbol.for(`yaml.document`),dc=Symbol.for(`yaml.map`),fc=Symbol.for(`yaml.pair`),pc=Symbol.for(`yaml.scalar`),mc=Symbol.for(`yaml.seq`),hc=Symbol.for(`yaml.node.type`),gc=e=>!!e&&typeof e==`object`&&e[hc]===lc,_c=e=>!!e&&typeof e==`object`&&e[hc]===uc,vc=e=>!!e&&typeof e==`object`&&e[hc]===dc,yc=e=>!!e&&typeof e==`object`&&e[hc]===fc,bc=e=>!!e&&typeof e==`object`&&e[hc]===pc,xc=e=>!!e&&typeof e==`object`&&e[hc]===mc;function Sc(e){if(e&&typeof e==`object`)switch(e[hc]){case dc:case mc:return!0}return!1}function Cc(e){if(e&&typeof e==`object`)switch(e[hc]){case lc:case dc:case pc:case mc:return!0}return!1}var wc=e=>(bc(e)||Sc(e))&&!!e.anchor,Tc=Symbol(`break visit`),Ec=Symbol(`skip children`),Dc=Symbol(`remove node`);function Oc(e,t){let n=Mc(t);_c(e)?kc(null,e.contents,n,Object.freeze([e]))===Dc&&(e.contents=null):kc(null,e,n,Object.freeze([]))}Oc.BREAK=Tc,Oc.SKIP=Ec,Oc.REMOVE=Dc;function kc(e,t,n,r){let i=Nc(e,t,n,r);if(Cc(i)||yc(i))return Pc(e,r,i),kc(e,i,n,r);if(typeof i!=`symbol`){if(Sc(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=kc(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tc)return Tc;else i===Dc&&(t.items.splice(e,1),--e)}}else if(yc(t)){r=Object.freeze(r.concat(t));let e=kc(`key`,t.key,n,r);if(e===Tc)return Tc;e===Dc&&(t.key=null);let i=kc(`value`,t.value,n,r);if(i===Tc)return Tc;i===Dc&&(t.value=null)}}return i}async function Ac(e,t){let n=Mc(t);_c(e)?await jc(null,e.contents,n,Object.freeze([e]))===Dc&&(e.contents=null):await jc(null,e,n,Object.freeze([]))}Ac.BREAK=Tc,Ac.SKIP=Ec,Ac.REMOVE=Dc;async function jc(e,t,n,r){let i=await Nc(e,t,n,r);if(Cc(i)||yc(i))return Pc(e,r,i),jc(e,i,n,r);if(typeof i!=`symbol`){if(Sc(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await jc(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tc)return Tc;else i===Dc&&(t.items.splice(e,1),--e)}}else if(yc(t)){r=Object.freeze(r.concat(t));let e=await jc(`key`,t.key,n,r);if(e===Tc)return Tc;e===Dc&&(t.key=null);let i=await jc(`value`,t.value,n,r);if(i===Tc)return Tc;i===Dc&&(t.value=null)}}return i}function Mc(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Nc(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(vc(t))return n.Map?.(e,t,r);if(xc(t))return n.Seq?.(e,t,r);if(yc(t))return n.Pair?.(e,t,r);if(bc(t))return n.Scalar?.(e,t,r);if(gc(t))return n.Alias?.(e,t,r)}function Pc(e,t,n){let r=t[t.length-1];if(Sc(r))r.items[e]=n;else if(yc(r))e===`key`?r.key=n:r.value=n;else if(_c(r))r.contents=n;else{let e=gc(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Fc={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Ic=e=>e.replace(/[!,[\]{}]/g,e=>Fc[e]),Lc=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Ic(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Cc(e.contents)){let t={};Oc(e.contents,(e,n)=>{Cc(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
10
- `)}};Lc.defaultYaml={explicit:!1,version:`1.2`},Lc.defaultTags={"!!":`tag:yaml.org,2002:`};function Rc(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function zc(e){let t=new Set;return Oc(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Bc(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Vc(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=zc(e);let a=Bc(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(bc(t.node)||Sc(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function Hc(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Hc(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Hc(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Hc(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Hc(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function Uc(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Uc(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!wc(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Wc=class{constructor(e){Object.defineProperty(this,hc,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!_c(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=Uc(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Hc(i,{"":o},``,o):o}},Gc=class extends Wc{constructor(e){super(lc),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Oc(e,{Node:(e,t)=>{(gc(t)||wc(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(Uc(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Kc(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Rc(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Kc(e,t,n){if(gc(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Sc(t)){let r=0;for(let i of t.items){let t=Kc(e,i,n);t>r&&(r=t)}return r}else if(yc(t)){let r=Kc(e,t.key,n),i=Kc(e,t.value,n);return Math.max(r,i)}return 1}var qc=e=>!e||typeof e!=`function`&&typeof e!=`object`,Z=class extends Wc{constructor(e){super(pc),this.value=e}toJSON(e,t){return t?.keep?this.value:Uc(this.value,e,t)}toString(){return String(this.value)}};Z.BLOCK_FOLDED=`BLOCK_FOLDED`,Z.BLOCK_LITERAL=`BLOCK_LITERAL`,Z.PLAIN=`PLAIN`,Z.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Z.QUOTE_SINGLE=`QUOTE_SINGLE`;var Jc=`tag:yaml.org,2002:`;function Yc(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function Xc(e,t,n){if(_c(e)&&(e=e.contents),Cc(e))return e;if(yc(e)){let t=n.schema[dc].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new Gc(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=Jc+t.slice(2));let l=Yc(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new Z(e);return c&&(c.node=t),t}l=e instanceof Map?o[dc]:Symbol.iterator in Object(e)?o[mc]:o[dc]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new Z(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Zc(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Xc(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Qc=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,$c=class extends Wc{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Cc(t)||yc(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Qc(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Sc(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Zc(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Sc(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&bc(i)?i.value:i:Sc(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!yc(t))return!1;let n=t.value;return n==null||e&&bc(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Sc(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Sc(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Zc(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},el=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function tl(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var nl=(e,t,n)=>e.endsWith(`
11
- `)?tl(n,t):n.includes(`
12
- `)?`
13
- `+tl(n,t):(e.endsWith(` `)?``:` `)+n,rl=`flow`,il=`block`,al=`quoted`;function ol(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=sl(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
14
- `)n===`block`&&(h=sl(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
15
- `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
16
- `&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function sl(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
17
- `);r=t,i=t+1,a=e[i]}return r}var cl=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ll=e=>/^(%|---|\.\.\.)/m.test(e);function ul(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
18
- `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function dl(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(ll(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
19
-
20
- `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
21
- `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:ol(o,a,al,cl(t,!1))}function fl(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
22
- `)||/[ \t]\n|\n[ \t]/.test(e))return dl(e,t);let n=t.indent||(ll(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:ol(r,n,rl,cl(t,!1))}function pl(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=dl;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?fl:i&&!t?dl:n?fl:dl}return r(e,t)}var ml;try{ml=RegExp(`(^|(?<!
23
- ))
24
- +(?!
25
- |$)`,`g`)}catch{ml=/\n+(?!\n|$)/g}function hl({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return pl(n,r);let l=r.indent||(r.forceBlockIndent||ll(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===Z.BLOCK_FOLDED?!1:t===Z.BLOCK_LITERAL?!0:!ul(n,c,l.length);if(!n)return u?`|
26
- `:`>
27
- `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
28
- `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
29
- `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
30
- `&&(p=p.slice(0,-1)),p.replace(ml,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
31
- `)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
32
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=cl(r,!0);o!==`folded`&&t!==Z.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=ol(`${v}${e}${p}`,l,il,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function gl(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
33
- `)||u&&/[[\]{},]/.test(a))return pl(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
34
- `)?pl(a,t):hl(e,t,n,r);if(!s&&!u&&i!==Z.PLAIN&&a.includes(`
35
- `))return hl(e,t,n,r);if(ll(a)){if(c===``)return t.forceBlockIndent=!0,hl(e,t,n,r);if(s&&c===l)return pl(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return pl(a,t)}return s?d:ol(d,c,rl,cl(t,!1))}function _l(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==Z.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=Z.QUOTE_DOUBLE);let c=e=>{switch(e){case Z.BLOCK_FOLDED:case Z.BLOCK_LITERAL:return i||a?pl(o.value,t):hl(o,t,n,r);case Z.QUOTE_DOUBLE:return dl(o.value,t);case Z.QUOTE_SINGLE:return fl(o.value,t);case Z.PLAIN:return gl(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function vl(e,t){let n=Object.assign({blockQuote:!0,commentString:el,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function yl(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(bc(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function bl(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(bc(e)||Sc(e))&&e.anchor;a&&Rc(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function xl(e,t,n,r){if(yc(e))return e.toString(t,n,r);if(gc(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=Cc(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=yl(t.doc.schema.tags,a);let o=bl(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):bc(a)?_l(a,t,n,r):a.toString(t,n,r);return o?bc(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Sl({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Cc(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Sc(e)||!Cc(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Sc(e)||(bc(e)?e.type===Z.BLOCK_FOLDED||e.type===Z.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=xl(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=nl(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=nl(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=nl(g,n.indent,l(f))));let _,v,y;Cc(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&bc(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&xc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=xl(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
36
- `:``,v){let e=l(v);S+=`\n${tl(e,n.indent)}`}x===``&&!n.inFlow?S===`
37
- `&&y&&(S=`
38
-
39
- `):S+=`\n${n.indent}`}else if(!p&&Sc(t)){let e=x[0],r=x.indexOf(`
40
- `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else (x===``||x[0]===`
41
- `)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=nl(g,n.indent,l(y)):h&&i&&i(),g}function Cl(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var wl=`<<`,Tl={identify:e=>e===wl||typeof e==`symbol`&&e.description===wl,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new Z(Symbol(wl)),{addToJSMap:Dl}),stringify:()=>wl},El=(e,t)=>(Tl.identify(t)||bc(t)&&(!t.type||t.type===Z.PLAIN)&&Tl.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===Tl.tag&&e.default);function Dl(e,t,n){if(n=e&&gc(n)?n.resolve(e.doc):n,xc(n))for(let r of n.items)Ol(e,t,r);else if(Array.isArray(n))for(let r of n)Ol(e,t,r);else Ol(e,t,n)}function Ol(e,t,n){let r=e&&gc(n)?n.resolve(e.doc):n;if(!vc(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function kl(e,t,{key:n,value:r}){if(Cc(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(El(e,n))Dl(e,t,r);else{let i=Uc(n,``,e);if(t instanceof Map)t.set(i,Uc(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Al(n,i,e),o=Uc(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Al(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Cc(e)&&n?.doc){let t=vl(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Cl(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function jl(e,t,n){return new Ml(Xc(e,void 0,n),Xc(t,void 0,n))}var Ml=class e{constructor(e,t=null){Object.defineProperty(this,hc,{value:fc}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Cc(n)&&(n=n.clone(t)),Cc(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return kl(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Sl(this,e,t,n):JSON.stringify(this)}};function Nl(e,t,n){return(t.inFlow??e.flow?Fl:Pl)(e,t,n)}function Pl({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(Cc(i))!d&&i.spaceBefore&&f.push(``),Il(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(yc(i)){let e=Cc(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Il(n,f,e.commentBefore,d))}d=!1;let s=xl(i,u,()=>o=null,()=>d=!0);o&&(s+=nl(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
42
- `}}return e?(p+=`
43
- `+tl(l(e),c),s&&s()):d&&o&&o(),p}function Fl({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(Cc(i))i.spaceBefore&&d.push(``),Il(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(yc(i)){let e=Cc(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Il(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Cc(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=xl(i,c,()=>a=null);l||=d.length>u||o.includes(`
44
- `),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=nl(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
45
- `;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function Il({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=tl(t(r),e);n.push(i.trimStart())}}function Ll(e,t){let n=bc(t)?t.value:t;for(let r of e)if(yc(r)&&(r.key===t||r.key===n||bc(r.key)&&r.key.value===n))return r}var Rl=class extends $c{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(dc,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(jl(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=yc(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Ml(e,e?.value):new Ml(e.key,e.value);let r=Ll(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);bc(r.value)&&qc(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=Ll(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Ll(this.items,e)?.value;return(!t&&bc(n)?n.value:n)??void 0}has(e){return!!Ll(this.items,e)}set(e,t){this.add(new Ml(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)kl(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!yc(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Nl(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},zl={collection:`map`,default:!0,nodeClass:Rl,tag:`tag:yaml.org,2002:map`,resolve(e,t){return vc(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Rl.from(e,t,n)},Bl=class extends $c{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(mc,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Vl(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=Vl(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&bc(r)?r.value:r}has(e){let t=Vl(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Vl(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];bc(r)&&qc(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(Uc(e,String(r++),t));return n}toString(e,t,n){return e?Nl(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(Xc(a,void 0,n))}}return i}};function Vl(e){let t=bc(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Hl={collection:`seq`,default:!0,nodeClass:Bl,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return xc(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Bl.from(e,t,n)},Ul={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),_l(e,t,n,r)}},Wl={identify:e=>e==null,createNode:()=>new Z(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Z(null),stringify:({source:e},t)=>typeof e==`string`&&Wl.test.test(e)?e:t.options.nullStr},Gl={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Z(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Gl.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function Kl({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}var ql={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Kl},Jl={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Kl(e)}},Yl={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Z(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:Kl},Xl=e=>typeof e==`bigint`||Number.isInteger(e),Zl=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Ql(e,t,n){let{value:r}=e;return Xl(r)&&r>=0?n+r.toString(t):Kl(e)}var $l={identify:e=>Xl(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>Zl(e,2,8,n),stringify:e=>Ql(e,8,`0o`)},eu={identify:Xl,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Zl(e,0,10,n),stringify:Kl},tu={identify:e=>Xl(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Zl(e,2,16,n),stringify:e=>Ql(e,16,`0x`)},nu=[zl,Hl,Ul,Wl,Gl,$l,eu,tu,ql,Jl,Yl];function ru(e){return typeof e==`bigint`||Number.isInteger(e)}var iu=({value:e})=>JSON.stringify(e),au=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:iu},{identify:e=>e==null,createNode:()=>new Z(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:iu},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:iu},{identify:ru,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>ru(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:iu}],ou=[zl,Hl].concat(au,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),su={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}else return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=Z.BLOCK_LITERAL,t!==Z.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===Z.BLOCK_LITERAL?`
46
- `:` `)}return _l({comment:e,type:t,value:s},r,i,a)}};function cu(e,t){if(xc(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!yc(r)){if(vc(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Ml(new Z(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=yc(r)?r:new Ml(r)}}else t(`Expected a sequence for this tag`);return e}function lu(e,t,n){let{replacer:r}=n,i=new Bl(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(jl(o,s,n))}return i}var uu={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:cu,createNode:lu},du=class e extends Bl{constructor(){super(),this.add=Rl.prototype.add.bind(this),this.delete=Rl.prototype.delete.bind(this),this.get=Rl.prototype.get.bind(this),this.has=Rl.prototype.has.bind(this),this.set=Rl.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(yc(e)?(r=Uc(e.key,``,t),i=Uc(e.value,r,t)):r=Uc(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=lu(e,t,n),i=new this;return i.items=r.items,i}};du.tag=`tag:yaml.org,2002:omap`;var fu={collection:`seq`,identify:e=>e instanceof Map,nodeClass:du,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=cu(e,t),r=[];for(let{key:e}of n.items)bc(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new du,n)},createNode:(e,t,n)=>du.from(e,t,n)};function pu({value:e,source:t},n){return t&&(e?mu:hu).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var mu={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Z(!0),stringify:pu},hu={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Z(!1),stringify:pu},gu={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Kl},_u={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Kl(e)}},vu={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Z(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:Kl},yu=e=>typeof e==`bigint`||Number.isInteger(e);function bu(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function xu(e,t,n){let{value:r}=e;if(yu(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return Kl(e)}var Su={identify:yu,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>bu(e,2,2,n),stringify:e=>xu(e,2,`0b`)},Cu={identify:yu,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>bu(e,1,8,n),stringify:e=>xu(e,8,`0`)},wu={identify:yu,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>bu(e,0,10,n),stringify:Kl},Tu={identify:yu,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>bu(e,2,16,n),stringify:e=>xu(e,16,`0x`)},Eu=class e extends Rl{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=yc(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Ml(e.key,null):new Ml(e,null),Ll(this.items,t.key)||this.items.push(t)}get(e,t){let n=Ll(this.items,e);return!t&&yc(n)?bc(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Ll(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ml(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(jl(e,null,n));return i}};Eu.tag=`tag:yaml.org,2002:set`;var Du={collection:`map`,identify:e=>e instanceof Set,nodeClass:Eu,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>Eu.from(e,t,n),resolve(e,t){if(vc(e)){if(e.hasAllNullValues(!0))return Object.assign(new Eu,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function Ou(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function ku(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Kl(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var Au={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Ou(e,n),stringify:ku},ju={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Ou(e,!1),stringify:ku},Mu={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(Mu.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=Ou(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},Nu=[zl,Hl,Ul,Wl,mu,hu,Su,Cu,wu,Tu,gu,_u,vu,su,Tl,fu,uu,Du,Au,ju,Mu],Pu=new Map([[`core`,nu],[`failsafe`,[zl,Hl,Ul]],[`json`,ou],[`yaml11`,Nu],[`yaml-1.1`,Nu]]),Fu={binary:su,bool:Gl,float:Yl,floatExp:Jl,floatNaN:ql,floatTime:ju,int:eu,intHex:tu,intOct:$l,intTime:Au,map:zl,merge:Tl,null:Wl,omap:fu,pairs:uu,seq:Hl,set:Du,timestamp:Mu},Iu={"tag:yaml.org,2002:binary":su,"tag:yaml.org,2002:merge":Tl,"tag:yaml.org,2002:omap":fu,"tag:yaml.org,2002:pairs":uu,"tag:yaml.org,2002:set":Du,"tag:yaml.org,2002:timestamp":Mu};function Lu(e,t,n){let r=Pu.get(t);if(r&&!e)return n&&!r.includes(Tl)?r.concat(Tl):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(Pu.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(Tl)),i.reduce((e,t)=>{let n=typeof t==`string`?Fu[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(Fu).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var Ru=(e,t)=>e.key<t.key?-1:+(e.key>t.key),zu=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Lu(e,`compat`):e?Lu(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?Iu:{},this.tags=Lu(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,dc,{value:zl}),Object.defineProperty(this,pc,{value:Ul}),Object.defineProperty(this,mc,{value:Hl}),this.sortMapEntries=typeof a==`function`?a:a===!0?Ru:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function Bu(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=vl(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(tl(t,``))}let o=!1,s=null;if(e.contents){if(Cc(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(tl(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=xl(e.contents,i,()=>s=null,t);s&&(c+=nl(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(xl(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=a(e.comment);t.includes(`
47
- `)?(n.push(`...`),n.push(tl(t,``))):n.push(`... ${t}`)}else n.push(`...`);else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(tl(a(t),``)))}return n.join(`
48
- `)+`
49
- `}var Vu=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,hc,{value:uc});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Lc({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[hc]:{value:uc}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Cc(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Hu(this.contents)&&this.contents.add(e)}addIn(e,t){Hu(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=zc(this);e.anchor=!t||n.has(t)?Bc(t||`a`,n):t}return new Gc(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=Vc(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=Xc(e,l,p);return o&&Sc(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Ml(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Hu(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Qc(e)?this.contents==null?!1:(this.contents=null,!0):Hu(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Sc(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Qc(e)?!t&&bc(this.contents)?this.contents.value:this.contents:Sc(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Sc(this.contents)?this.contents.has(e):!1}hasIn(e){return Qc(e)?this.contents!==void 0:Sc(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Zc(this.schema,[e],t):Hu(this.contents)&&this.contents.set(e,t)}setIn(e,t){Qc(e)?this.contents=t:this.contents==null?this.contents=Zc(this.schema,Array.from(e),t):Hu(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new Lc({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new Lc({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new zu(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=Uc(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?Hc(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Bu(this,e)}};function Hu(e){if(Sc(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Uu=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Wu=class extends Uu{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Gu=class extends Uu{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Ku=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
50
- `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function qu(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function Ju(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
51
- `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(Ju(t.key)||Ju(t.value))return!0}return!1;default:return!0}}function Yu(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&Ju(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Xu(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||bc(e)&&bc(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Zu=`All mapping items must start at the same column`;function Qu({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??Rl)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=qu(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,Zu)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
52
- `+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||Ju(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,Zu);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Yu(r.indent,u,i),n.atKey=!1,Xu(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=qu(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&Yu(r.indent,f,i),s=c.range[2];let l=new Ml(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
53
- `+_.comment:g.comment=_.comment);let e=new Ml(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function $u({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??Bl)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=qu(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&Yu(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function ed(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var td=`Block collections are not allowed within flow collections`,nd=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function rd({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new(a?.nodeClass??(o?Rl:Bl))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=qu(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
54
- `+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&Ju(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];yc(t)&&(t=t.value??t.key),t.comment?t.comment+=`
55
- `+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],nd(m)&&i(r.range,`BLOCK_IN_FLOW`,td)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);nd(f)&&i(g.range,`BLOCK_IN_FLOW`,td),n.atKey=!1;let _=qu(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?nd(m)&&i(v.range,`BLOCK_IN_FLOW`,td):_.comment&&(g.comment?g.comment+=`
56
- `+_.comment:g.comment=_.comment);let y=new Ml(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Xu(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new Rl(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=ed(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
57
- `+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function id(e,t,n,r,i,a){let o=n.type===`block-map`?Qu(e,t,n,r,a):n.type===`block-seq`?$u(e,t,n,r,a):rd(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function ad(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===Rl.tagName&&s===`map`||o===Bl.tagName&&s===`seq`)return id(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),id(e,t,n,i,o)}let l=id(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Cc(u)?u:new Z(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function od(e,t,n){let r=t.offset,i=sd(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?Z.BLOCK_FOLDED:Z.BLOCK_LITERAL,o=t.source?cd(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
58
- `.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
59
- `;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===Z.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
60
- `):t.length>c||r[0]===` `?(f===` `?f=`
61
- `:!p&&f===`
62
- `&&(f=`
63
-
64
- `),d+=f+t.slice(c)+r,f=`
65
- `,p=!0):r===``?f===`
66
- `?d+=`
67
- `:f=`
68
- `:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
69
- `+o[e][0].slice(c);d[d.length-1]!==`
70
- `&&(d+=`
71
- `);break;default:d+=`
72
- `}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function sd({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function cd(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function ld(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=Z.PLAIN,c=ud(a,l);break;case`single-quoted-scalar`:s=Z.QUOTE_SINGLE,c=dd(a,l);break;case`double-quoted-scalar`:s=Z.QUOTE_DOUBLE,c=pd(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=ed(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function ud(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),fd(e)}function dd(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),fd(e.slice(1,-1)).replace(/''/g,`'`)}function fd(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
73
- `,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
74
- `,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
75
- `?i+=a:a=`
76
- `:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function pd(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===`
77
- `))if(i===`
78
- `){let{fold:t,offset:i}=md(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=hd[i];if(a)n+=a;else if(i===`
79
- `)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
80
- `)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a={x:2,u:4,U:8}[i];n+=gd(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
81
- `&&!(a===`\r`&&e[r+2]===`
82
- `)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function md(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
83
- `||r===`\r`)&&!(r===`\r`&&e[t+2]!==`
84
- `);)r===`
85
- `&&(n+=`
86
- `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var hd={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
87
- `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function gd(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}function _d(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?od(e,t,r):ld(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[pc]:c?vd(e.schema,i,c,n,r):t.type===`scalar`?yd(e,i,t,r):e.schema[pc];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=bc(a)?a:new Z(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new Z(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function vd(e,t,n,r,i){if(n===`!`)return e[pc];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(t.default&&t.test)a.push(t);else return t;for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[pc])}function yd({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[pc];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[pc];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function bd(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var xd={composeNode:Sd,composeEmptyNode:Cd};function Sd(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=wd(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=_d(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=ad(xd,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=Cd(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!bc(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Cd(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=_d(e,{type:`scalar`,offset:bd(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function wd({options:e},{offset:t,source:n,end:r},i){let a=new Gc(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=ed(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function Td(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Vu(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=qu(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?Sd(c,i,l,o):Cd(c,l.end,r,null,l,o);let u=s.contents.range[2],d=ed(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Ed(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function Dd(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
88
-
89
- `:`
90
- `)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Od=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Ed(e);r?this.warnings.push(new Gu(i,t,n)):this.errors.push(new Wu(i,t,n))},this.directives=new Lc({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=Dd(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Sc(i)&&!i.flow&&i.items.length>0){let e=i.items[0];yc(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Dd(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=Ed(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=Td(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Wu(Ed(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new Wu(Ed(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=ed(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Wu(Ed(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new Vu(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},kd=Symbol(`break visit`),Ad=Symbol(`skip children`),jd=Symbol(`remove item`);function Md(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Nd(Object.freeze([]),e,t)}Md.BREAK=kd,Md.SKIP=Ad,Md.REMOVE=jd,Md.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Md.parentCollection=(e,t)=>{let n=Md.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Nd(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Nd(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===kd)return kd;else r===jd&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function Pd(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
91
- `:case`\r
92
- `:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function Fd(e){switch(e){case void 0:case` `:case`
93
- `:case`\r`:case` `:return!0;default:return!1}}var Id=new Set(`0123456789ABCDEFabcdef`),Ld=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),Rd=new Set(`,[]{}`),zd=new Set(` ,[]{}
94
- \r `),Bd=e=>!e||zd.has(e),Vd=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
95
- `?!0:t===`\r`?this.buffer[e+1]===`
96
- `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
97
- `||!t&&!this.atEnd)return e+n+1}return t===`
98
- `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&Fd(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
99
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}else n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&Fd(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Fd(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&Fd(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(Bd),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&Fd(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]===`]`||r[0]===`}`)))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(Bd),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||Fd(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
100
- `,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
101
- `,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>Fd(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
102
- `:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
103
- `)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
104
- `,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
105
- `;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
106
- `&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(Fd(r)||e&&Rd.has(r))break;t=n}else if(Fd(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
107
- `?(n+=1,r=`
108
- `,i=this.buffer[n+1]):t=n),i===`#`||e&&Rd.has(i))break;if(r===`
109
- `){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&Rd.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(Bd))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(Fd(t)||e&&Rd.has(t))return e?this.flowKey&&=!1:this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!Fd(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Ld.has(t))t=this.buffer[++e];else if(t===`%`&&Id.has(this.buffer[e+1])&&Id.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
110
- `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
111
- `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Hd=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function Ud(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Wd(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function Gd(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function Kd(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function qd(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function Jd(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!Ud(t.start,`explicit-key-ind`)&&!Ud(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,Gd(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}var Yd=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new Vd,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Pd(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&Jd(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Wd(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:Wd(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=qd(Kd(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
112
- `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
113
- `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(Ud(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=qd(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ud(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Gd(t.key)&&!Ud(t.sep,`newline`)){let e=qd(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Ud(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!Ud(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||Ud(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=qd(Kd(t));Jd(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
114
- `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
115
- `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=qd(Kd(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=qd(Kd(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Xd(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Hd||null,prettyErrors:t}}function Zd(e,t={}){let{lineCounter:n,prettyErrors:r}=Xd(t),i=new Yd(n?.addNewLine),a=new Od(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Wu(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Ku(e,n)),o.warnings.forEach(Ku(e,n))),o}function Qd(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=Zd(e,n);if(!i)return null;if(i.warnings.forEach(e=>Cl(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var $d=q().min(1).regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/),ef=Vs([`info`,`warning`,`error`]),tf=Vs([`pending`,`pass`,`warn`,`fail`]),nf=Vs([`draft`,`enabled`,`disabled`]),rf=X({code:q().min(1),message:q().min(1),path:q().min(1).optional(),severity:ef}),af=X({checkedAt:q().min(1).optional(),issues:Y(rf),status:tf}),of=X({id:$d,status:nf,validation:af}),sf=Vs([`auto`,`ask`,`deny`]),cf=X({action:sf,pattern:q().min(1),reason:q().min(1).optional()});X({outOfScope:X({default:q().min(1).optional(),strategy:q().min(1).optional()}).passthrough().refine(e=>typeof e.default==`string`||typeof e.strategy==`string`,`outOfScope requires either default or strategy`),risk:X({highRiskRequiresApproval:Is(),policy:q().min(1).optional()}).passthrough(),schemaVersion:Bs(1),soul:X({label:q().min(1).optional(),preset:$d,source:q().min(1).optional()}).passthrough().optional(),status:nf,toolPolicy:X({default:sf,rules:Y(cf)}).passthrough().optional()});var lf=X({description:q().min(1).optional(),risk:Vs([`low`,`medium`,`high`]).optional(),tools:Y(q().min(1)).optional()}).passthrough(),uf=X({secretRef:q().min(1)}),df=X({description:q().min(1).optional(),inputSchema:zs(J()).optional(),name:q().min(1)}).passthrough(),ff=X({args:Y(q()).optional(),command:q().min(1).optional(),description:q().min(1).optional(),disabled:Is().optional(),env:zs(J()).optional(),headers:zs(J()).optional(),tools:Y(df).optional(),transport:Vs([`stdio`,`streamable-http`,`sse`]).optional(),url:q().min(1).optional()}).passthrough(),pf=X({schemaVersion:Bs(1).optional(),servers:zs(ff)});X({defaultToolsets:Y($d),mcp:pf,packs:Y(of),schemaVersion:Bs(1),soul:$d.optional(),status:nf,toolsets:zs(lf).optional(),validation:af.optional()});var mf=Vs([`filesystem-read`,`filesystem-write`,`shell`,`network`,`browser`,`mcp`]),hf=X({capabilities:Y(q().min(1)).optional(),description:q().min(1),name:q().min(1),permissions:Y(mf).optional(),version:q().min(1).optional()}).passthrough(),gf=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/,_f=hf.extend({id:q().min(1)}),vf=X({expectedId:q().min(1),skillMd:q().min(1),sourcePath:q().min(1)});function yf(e,t){let n=gf.exec(e);if(!n)throw Error(`Brain skill pack ${t} is missing YAML frontmatter`);let r;try{r=Qd(n[1]??``)}catch(e){throw Error(`Brain skill pack ${t} has invalid YAML frontmatter: ${e instanceof Error?e.message:String(e)}`)}try{return _f.parse(r)}catch(e){throw e instanceof ao?Error(`Brain skill pack ${t} does not satisfy SkillMetadata: ${e.issues.map(e=>e.message).join(`; `)}`):e}}function bf(e){let t=vf.parse(e),n=yf(t.skillMd,t.sourcePath);if(n.id!==t.expectedId)throw Error(`Brain skill pack ${t.sourcePath} declares id "${n.id}" but expected "${t.expectedId}"`);return{id:n.id,installPath:`${n.id}/SKILL.md`,metadata:n,skillMd:t.skillMd.trimEnd(),sourcePath:t.sourcePath}}var xf=`---
116
- id: developer.codebase-orientation
117
- name: Codebase Orientation
118
- description: Build codebase context before editing, with narrow search, impact tracing, and focused verification.
119
- version: 0.1.0
120
- capabilities:
121
- - codebase
122
- - implementation
123
- permissions:
124
- - filesystem-read
125
- - filesystem-write
126
- - shell
127
- ---
128
- # Codebase Orientation Skill
129
-
130
- Use this before implementing code changes.
131
-
132
- ## Workflow
133
-
134
- 1. Locate the smallest relevant files and tests.
135
- 2. Trace upstream inputs and downstream consumers.
136
- 3. Identify existing conventions before introducing new structure.
137
- 4. Make scoped edits that map directly to the requested behavior.
138
- 5. Run focused verification first, then broaden only when the change crosses package boundaries.
139
-
140
- ## Guardrails
141
-
142
- - Do not rewrite unrelated code.
143
- - Do not use destructive git operations.
144
- - Keep secrets out of source, logs, and Brain memory.
145
- `,Sf=`---
146
- id: devops-sre.incident-triage
147
- name: Incident Triage
148
- description: Triage operational incidents with timeline, blast radius, evidence, rollback, and escalation.
149
- version: 0.1.0
150
- capabilities:
151
- - incident
152
- - operations
153
- permissions:
154
- - filesystem-read
155
- - shell
156
- - network
157
- ---
158
- # Incident Triage Skill
159
-
160
- Use this for alerts, outages, degraded service, deployment failures, or reliability investigations.
161
-
162
- ## Workflow
163
-
164
- 1. Establish current state, user impact, and time window.
165
- 2. Collect evidence from logs, health checks, dashboards, recent deploys, or operator-provided artifacts.
166
- 3. Separate mitigation from root-cause analysis.
167
- 4. Prefer dry-run and read-only checks before remediation.
168
- 5. Record rollback or recovery steps before high-risk operations.
169
-
170
- ## Guardrails
171
-
172
- - Do not restart, scale, deploy, or change production state without explicit approval.
173
- - Redact tokens, host secrets, and customer data in summaries.
174
- `,Cf=`---
175
- id: finance-ops.financial-evidence-review
176
- name: Financial Evidence Review
177
- description: Review finance artifacts with source tracking, reconciliation questions, and escalation boundaries.
178
- version: 0.1.0
179
- capabilities:
180
- - finance
181
- - evidence-review
182
- permissions:
183
- - filesystem-read
184
- ---
185
- # Financial Evidence Review Skill
186
-
187
- Use this for invoices, expenses, reconciliation notes, payment questions, and finance operations evidence.
188
-
189
- ## Workflow
190
-
191
- 1. Identify the financial object, period, amount, counterparty, and source artifact.
192
- 2. Separate observed facts from assumptions.
193
- 3. Flag missing approvals, mismatched amounts, duplicate references, or unclear ownership.
194
- 4. Recommend the next evidence to collect before judgment.
195
- 5. Escalate legal, tax, payroll, or regulated advice instead of presenting it as final guidance.
196
-
197
- ## Guardrails
198
-
199
- - Do not infer sensitive account details that are not in evidence.
200
- - Do not store personal or payment data in Brain memory without admission and redaction.
201
- `,wf=`---
202
- id: general-assistant.general-task-framing
203
- name: General Task Framing
204
- description: Turn broad requests into scoped, evidence-backed next actions without overreaching.
205
- version: 0.1.0
206
- capabilities:
207
- - task-framing
208
- - clarification
209
- permissions:
210
- - filesystem-read
211
- ---
212
- # General Task Framing Skill
213
-
214
- Use this when the user asks for help but the domain, evidence, or desired output is ambiguous.
215
-
216
- ## Workflow
217
-
218
- 1. Restate the concrete objective in one sentence.
219
- 2. Identify missing input, constraints, audience, and expected output format.
220
- 3. Choose the smallest useful next step.
221
- 4. Ask a concise clarifying question only when acting would risk crossing scope.
222
- 5. Keep durable learnings behind Brain admission.
223
-
224
- ## Guardrails
225
-
226
- - Do not silently convert a general request into code, finance, HR, legal, or production operations.
227
- - Do not expand filesystem or network access without a clear reason.
228
- `,Tf=`---
229
- id: hr-recruiting.candidate-screening
230
- name: Candidate Screening
231
- description: Screen recruiting evidence against role criteria with bias-aware, source-backed notes.
232
- version: 0.1.0
233
- capabilities:
234
- - recruiting
235
- - evidence-review
236
- permissions:
237
- - filesystem-read
238
- ---
239
- # Candidate Screening Skill
240
-
241
- Use this for resumes, candidate notes, role requirements, interview packets, and recruiting pipeline review.
242
-
243
- ## Workflow
244
-
245
- 1. Identify role criteria and must-have constraints from evidence.
246
- 2. Extract candidate facts with source references.
247
- 3. Separate facts, uncertainties, and recommendations.
248
- 4. Note missing evidence before making a screening recommendation.
249
- 5. Produce a concise decision support summary, not an automated hiring decision.
250
-
251
- ## Guardrails
252
-
253
- - Avoid protected-class inference and unsupported personal judgments.
254
- - Treat candidate data as sensitive; durable memory requires admission and redaction.
255
- `,Ef=`---
256
- id: product-designer.design-critique
257
- name: Design Critique
258
- description: Critique product design evidence against user goals, interaction clarity, and visual system fit.
259
- version: 0.1.0
260
- capabilities:
261
- - design
262
- - critique
263
- permissions:
264
- - filesystem-read
265
- ---
266
- # Design Critique Skill
267
-
268
- Use this for product UI, flows, prototypes, screenshots, specs, or visual direction reviews.
269
-
270
- ## Workflow
271
-
272
- 1. Identify the user, job-to-be-done, surface, and success criteria.
273
- 2. Review information hierarchy, interaction clarity, accessibility, and consistency.
274
- 3. Tie critique to visible evidence or supplied design requirements.
275
- 4. Prioritize issues by user impact.
276
- 5. Suggest concrete revisions without inventing unrelated product strategy.
277
-
278
- ## Guardrails
279
-
280
- - Do not present subjective taste as a hard rule.
281
- - Do not overwrite design-system constraints unless the operator asks to change them.
282
- `,Df=`---
283
- id: project-manager.delivery-risk-review
284
- name: Delivery Risk Review
285
- description: Review project delivery state, dependencies, blockers, owner clarity, and next milestones.
286
- version: 0.1.0
287
- capabilities:
288
- - planning
289
- - risk-review
290
- permissions:
291
- - filesystem-read
292
- ---
293
- # Delivery Risk Review Skill
294
-
295
- Use this for roadmaps, plans, delivery status, blockers, handoffs, and execution tradeoffs.
296
-
297
- ## Workflow
298
-
299
- 1. Identify goal, current status, deadline, owners, and dependency chain.
300
- 2. Separate committed work, proposed work, and unresolved questions.
301
- 3. Surface the highest-risk blocker first.
302
- 4. Recommend the next decision or artifact needed to unblock execution.
303
- 5. Keep status changes evidence-backed and explicit.
304
-
305
- ## Guardrails
306
-
307
- - Do not treat plans as approvals.
308
- - Do not hide missing owner, scope, or deadline information behind optimistic summaries.
309
- `,Of=`---
310
- id: qa-reviewer.regression-review
311
- name: Regression Review
312
- description: Review behavior changes for regression risk, missing tests, and focused verification strategy.
313
- version: 0.1.0
314
- capabilities:
315
- - qa
316
- - regression
317
- permissions:
318
- - filesystem-read
319
- - shell
320
- ---
321
- # Regression Review Skill
322
-
323
- Use this before closing a bug fix, refactor, release, or behavior change.
324
-
325
- ## Workflow
326
-
327
- 1. Identify changed behavior and affected user paths.
328
- 2. Map direct tests and adjacent regression risks.
329
- 3. Check edge cases, error paths, data boundaries, and rollback signals.
330
- 4. Prefer reproducible evidence over confidence statements.
331
- 5. Return a concise pass/fail/risk summary with missing verification.
332
-
333
- ## Guardrails
334
-
335
- - Do not claim coverage from unrelated tests.
336
- - Do not require broad test gates when a focused test is sufficient.
337
- `,kf=`---
338
- id: support-operator.support-case-triage
339
- name: Support Case Triage
340
- description: Triage support cases into facts, customer impact, severity, next response, and escalation path.
341
- version: 0.1.0
342
- capabilities:
343
- - support
344
- - triage
345
- permissions:
346
- - filesystem-read
347
- ---
348
- # Support Case Triage Skill
349
-
350
- Use this for customer tickets, support inbox items, troubleshooting notes, and escalation summaries.
351
-
352
- ## Workflow
353
-
354
- 1. Identify customer, product surface, impact, timeline, and requested outcome.
355
- 2. Separate confirmed facts from customer claims and internal assumptions.
356
- 3. Assign a tentative severity with the evidence that supports it.
357
- 4. Draft the next customer-facing response or internal escalation note.
358
- 5. Request missing diagnostics only when they are necessary for progress.
359
-
360
- ## Guardrails
361
-
362
- - Do not expose internal secrets, private notes, or unrelated customer data.
363
- - Do not promise fixes, refunds, or policy exceptions without authorization.
364
- `;bf({expectedId:`kernel.brain-admission`,skillMd:`---
365
- id: kernel.brain-admission
366
- name: Brain Admission
367
- description: Propose durable Project Brain mutations with evidence, rollback, and operator approval.
368
- version: 0.1.0
369
- capabilities:
370
- - brain-admission
371
- - governance
372
- permissions:
373
- - filesystem-read
374
- - shell
375
- ---
376
- # Brain Admission Skill
377
-
378
- Use this when a reply would change durable Project Brain state: memory, brain skill, policy, toolset, capability pack, scope manifest, or other \`.aiworker/\` brain assets.
379
-
380
- ## Workflow
381
-
382
- 1. Identify the exact target path or asset class.
383
- 2. Collect evidence from the current conversation or cited files.
384
- 3. State why the change is durable and why it belongs in AIWorker Brain rather than executor-native memory.
385
- 4. Create an admission proposal with summary, confidence, evidence, target, payload, and rollback instructions.
386
- 5. Treat the proposal as pending until an operator approves and applies it.
387
-
388
- ## Guardrails
389
-
390
- - Do not write durable Brain files directly as a side effect of a normal task.
391
- - Do not claim admission succeeded unless AIWorker admission state confirms it.
392
- - Do not store plaintext secrets; use redacted values or secret refs.
393
- `,sourcePath:`packages/shared/src/brain/skills/kernel/brain-admission/SKILL.md`}),bf({expectedId:`kernel.executor-quality-review`,skillMd:`---
394
- id: kernel.executor-quality-review
395
- name: Executor Quality Review
396
- description: Review executor output for evidence, boundary fit, verification, and Brain governance bypass risk.
397
- version: 0.1.0
398
- capabilities:
399
- - quality-gate
400
- - executor-supervision
401
- permissions:
402
- - filesystem-read
403
- ---
404
- # Executor Quality Review Skill
405
-
406
- Use this when checking whether an executor result is ready to return, retry, or escalate.
407
-
408
- ## Review Axes
409
-
410
- 1. Evidence: does the answer cite observed files, commands, API responses, or conversation facts when needed?
411
- 2. Scope: did the executor stay inside the worker-bound business scope?
412
- 3. Verification: were the relevant tests, dry-runs, or inspections performed?
413
- 4. Risk: did the executor attempt high-risk writes, production operations, or secret exposure without approval?
414
- 5. Brain boundary: did it claim memory, skill, or policy changes without an AIWorker admission proposal?
415
-
416
- ## Output
417
-
418
- Return a concise verdict: \`pass\`, \`needs-repair\`, or \`escalate\`, followed by the smallest concrete repair.
419
- `,sourcePath:`packages/shared/src/brain/skills/kernel/executor-quality-review/SKILL.md`});var Af=bf({expectedId:`developer.codebase-orientation`,skillMd:xf,sourcePath:`packages/shared/src/soul/packs/developer/skills/codebase-orientation/SKILL.md`}),jf=bf({expectedId:`devops-sre.incident-triage`,skillMd:Sf,sourcePath:`packages/shared/src/soul/packs/devops-sre/skills/incident-triage/SKILL.md`}),Mf=bf({expectedId:`finance-ops.financial-evidence-review`,skillMd:Cf,sourcePath:`packages/shared/src/soul/packs/finance-ops/skills/financial-evidence-review/SKILL.md`}),Nf=bf({expectedId:`general-assistant.general-task-framing`,skillMd:wf,sourcePath:`packages/shared/src/soul/packs/general-assistant/skills/general-task-framing/SKILL.md`}),Pf=bf({expectedId:`hr-recruiting.candidate-screening`,skillMd:Tf,sourcePath:`packages/shared/src/soul/packs/hr-recruiting/skills/candidate-screening/SKILL.md`}),Ff=bf({expectedId:`product-designer.design-critique`,skillMd:Ef,sourcePath:`packages/shared/src/soul/packs/product-designer/skills/design-critique/SKILL.md`}),If=bf({expectedId:`project-manager.delivery-risk-review`,skillMd:Df,sourcePath:`packages/shared/src/soul/packs/project-manager/skills/delivery-risk-review/SKILL.md`}),Lf=bf({expectedId:`qa-reviewer.regression-review`,skillMd:Of,sourcePath:`packages/shared/src/soul/packs/qa-reviewer/skills/regression-review/SKILL.md`}),Rf=bf({expectedId:`support-operator.support-case-triage`,skillMd:kf,sourcePath:`packages/shared/src/soul/packs/support-operator/skills/support-case-triage/SKILL.md`}),zf={developer:[Af],"devops-sre":[jf],"finance-ops":[Mf],"general-assistant":[Nf],"hr-recruiting":[Pf],"product-designer":[Ff],"project-manager":[If],"qa-reviewer":[Lf],"support-operator":[Rf]};function Bf(e){return zf[e]??[]}var Vf=Vs([`codex`,`claude-code`]),Hf=Vs([`project`]),Uf=Vs([`stdio`,`streamable-http`,`sse`]),Wf=Ls([q().min(1),uf]),Gf=X({args:Y(q()).optional(),bearerTokenEnvVar:q().min(1).optional(),command:q().min(1).optional(),description:q().min(1).optional(),disabled:Is().optional(),env:zs(Wf).optional(),headers:zs(Wf).optional(),scope:Hf,transport:Uf,url:q().min(1).optional()}).passthrough(),Kf=X({issues:Y(X({code:q().min(1),message:q().min(1),severity:Vs([`error`,`warning`])})).optional(),status:Vs([`pending`,`pass`,`warn`,`fail`])}).passthrough(),qf=X({disabled:Is().optional(),scope:Hf.optional(),source:X({ref:q().min(1).optional(),type:Vs([`engine-cli`,`path`,`registry`,`url`,`manual`])}).passthrough().optional(),status:Vs([`draft`,`declared`,`validated`,`projected`]).optional(),validation:Kf.optional()}).passthrough();X({engines:zs(Vf,X({mcp:zs(Gf).optional(),plugins:zs(qf).optional(),policies:zs(qf).optional(),skills:zs(qf).optional()}).passthrough()),schemaVersion:Bs(1)});var Jf=/^w_[0-9a-hjkmnp-tv-z]{12}$/,Yf=`wtk_`,Xf=/^wtk_[\w-]{32,}$/;function Zf(){let e=new Uint8Array(32);return globalThis.crypto.getRandomValues(e),`${Yf}${Qf(e)}`}function Qf(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return globalThis.btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var $f=Rs(`kind`,[X({kind:Bs(`file_read`),path:q()}),X({kind:Bs(`file_edit`),path:q(),diff:q().optional()}),X({kind:Bs(`command_run`),command:q()}),X({kind:Bs(`search`),query:q()}),X({kind:Bs(`web_fetch`),url:q()}),X({kind:Bs(`task_plan`),summary:q()}),X({kind:Bs(`tool`),toolName:q(),arguments:zs(J()).optional()}),X({kind:Bs(`other`),description:q().optional()})]),ep=Vs([`pending`,`running`,`success`,`failed`,`pending_approval`,`denied`]),tp=X({inputTokens:Fs().int().nonnegative(),outputTokens:Fs().int().nonnegative()}),np=zs(J()),rp=Vs([`stop`,`tool`,`length`,`error`,`cancelled`]);Rs(`type`,[X({type:Bs(`assistant_message_delta`),delta:q()}),X({type:Bs(`thinking_delta`),delta:q()}),X({type:Bs(`tool_use`),id:q(),name:q(),arguments:zs(J()),action:$f,status:ep.optional()}),X({type:Bs(`tool_result`),id:q(),name:q(),content:q(),isError:Is().optional()}),X({type:Bs(`permission_request`),id:q(),reason:q(),toolUseId:q().optional()}),X({type:Bs(`token_usage`),usage:tp}),X({type:Bs(`engine_binding`),engine:q().min(1),binding:np.nullable()}),X({type:Bs(`finish`),reason:rp,usage:tp.optional()}),X({type:Bs(`error`),error:q()})]);var ip=/^[a-z0-9][a-z0-9._-]*$/,ap=/^[a-z][a-z0-9-]*$/,op=/^[a-z][a-z0-9-]*$/,sp=Vs([`private`,`team`,`public`]),cp=Vs([`manual-approval`,`auto-low-risk`]),lp=q().min(1).regex(ip,`scope id must be lowercase alphanumeric with . _ -`),up=q().min(1).regex(ap,`scope kind must be kebab-case`),dp=q().min(1).regex(op,`primary soul id must be kebab-case`),fp=X({description:q().min(1).optional(),path:q().min(1)});X({approval:cp.optional(),artifactRoots:Y(fp).readonly().optional(),id:lp.optional(),kind:up,labels:Y(q().min(1)).readonly().optional(),primarySoul:dp,privacy:sp.optional(),retention:q().min(1).optional(),schemaVersion:Bs(1),subject:q().min(1).optional()});var pp=/^[a-z][a-z0-9-]*$/,mp=/^\d+\.\d+\.\d+$/,hp=/^[a-z][a-z0-9-]*$/,gp=/^[a-z][a-z0-9-]*$/,_p=q().min(1).regex(pp,`soul id must be kebab-case`),vp=q().regex(mp,`soul version must be major.minor.patch`),yp=q().min(1).regex(hp,`scope kind must be kebab-case`),bp=X({description:q().min(1),id:_p,label:q().min(1),version:vp}),xp=X({communicationStyle:q().min(1),highRiskRequiresApproval:Is(),outOfScopeStrategy:q().min(1),riskNotes:q().min(1),vagueContextStrategy:q().min(1).optional()}),Sp=X({retention:q().min(1),target:q().min(1)}),Cp=X({artifactTypes:Y(q().min(1)).readonly(),entityTypes:Y(q().min(1)).readonly(),proposalTypes:Y(q().min(1)).readonly(),workflowStates:Y(q().min(1)).readonly()}),wp=X({briefHooks:X({defaultSections:Y(q().min(1).regex(gp)).readonly(),protectedSections:Y(q().min(1).regex(gp)).readonly()}).superRefine((e,t)=>{let n=new Set(e.defaultSections);for(let r of e.protectedSections)n.has(r)||t.addIssue({code:H.custom,message:`protected section "${r}" must also appear in defaultSections`,path:[`protectedSections`]})}),initProjection:X({boundaries:Y(q().min(1)).min(1).readonly(),packs:Y(q().min(1)).min(1).readonly(),responsibilities:Y(q().min(1)).min(1).readonly(),toolsets:Y(q().min(1)).min(1).readonly()}),manifest:bp,primaryScopeKind:yp,retentionDefaults:Y(Sp).readonly(),riskPolicy:xp,schemaPack:Cp,supportedScopeKinds:Y(yp).min(1).readonly()}).superRefine((e,t)=>{e.supportedScopeKinds.includes(e.primaryScopeKind)||t.addIssue({code:H.custom,message:`primaryScopeKind must appear in supportedScopeKinds`,path:[`primaryScopeKind`]})}),Tp=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,Ep=X({brainSkillPacks:Ps().optional(),expectedId:q().min(1),soulMd:q().min(1),sourcePath:q().min(1)});function Dp(e){let t=Tp.exec(e);return t?(t[2]??``).trim():e.trim()}function Op(e,t){let n=Tp.exec(e);if(!n)throw Error(`Soul pack ${t} is missing YAML frontmatter`);let r;try{r=Qd(n[1]??``)}catch(e){throw Error(`Soul pack ${t} has invalid YAML frontmatter: ${e instanceof Error?e.message:String(e)}`)}try{return wp.parse(r)}catch(e){throw e instanceof ao?Error(`Soul pack ${t} does not satisfy SoulModule: ${e.issues.map(e=>e.message).join(`; `)}`):e}}function kp(e){let t=Ep.parse(e),n=Op(t.soulMd,t.sourcePath);if(n.manifest.id!==t.expectedId)throw Error(`Soul pack ${t.sourcePath} declares id "${n.manifest.id}" but expected "${t.expectedId}"`);return{brainSkillPacks:t.brainSkillPacks??[],module:n,soulBody:Dp(t.soulMd),soulMd:t.soulMd.trimEnd(),sourcePath:t.sourcePath}}var Ap=`---
420
- manifest:
421
- id: developer
422
- label: Developer
423
- description: 开发、调试、代码审查、仓库维护。
424
- version: 0.1.0
425
- primaryScopeKind: developer-repo
426
- supportedScopeKinds:
427
- - developer-repo
428
- - general
429
- briefHooks:
430
- defaultSections:
431
- - soul
432
- - memory
433
- - rollup
434
- - recent-changes
435
- - risk-policy
436
- protectedSections:
437
- - risk-policy
438
- initProjection:
439
- responsibilities:
440
- - 理解代码库并实现小步可验证改动
441
- - 修复缺陷并补充聚焦测试
442
- - 维护构建、类型检查、lint 与发布脚本
443
- boundaries:
444
- - 不擅自执行破坏性 git 操作
445
- - 不把 secret 写入源码或长期记忆
446
- - 遇到高风险生产写入先给出 dry-run 与回滚路径
447
- packs:
448
- - code
449
- - repo-maintenance
450
- - review
451
- toolsets:
452
- - filesystem-read
453
- - filesystem-write
454
- - shell
455
- - git
456
- - test
457
- riskPolicy:
458
- communicationStyle: 直接、证据优先、默认给出可执行下一步。
459
- highRiskRequiresApproval: true
460
- outOfScopeStrategy: 非代码类运营、财务、人事任务先说明不属于核心职责,并建议切换或新增对应能力。
461
- riskNotes: 文件写入、数据库写入、部署和发布类动作需要明确意图;生产写入必须先 dry-run。
462
- vagueContextStrategy: 不直接 ls / grep 探索整个项目;先一句话反问关键缺失:具体报错文本、复现步骤、最近改动的文件或提交、是否能在干净 checkout 上复现。
463
- schemaPack:
464
- artifactTypes:
465
- - code-module
466
- - adr
467
- - design-doc
468
- - test-suite
469
- - release-note
470
- - changelog-entry
471
- entityTypes:
472
- - repository
473
- - release-tag
474
- - incident-postmortem
475
- proposalTypes:
476
- - memory-add
477
- - brain-skill-add
478
- - policy-update
479
- workflowStates:
480
- - draft
481
- - review
482
- - merged
483
- - released
484
- - rolled-back
485
- retentionDefaults: []
486
- ---
487
- # Developer Soul
488
-
489
- ## 主要职责
490
-
491
- - 理解代码库并实现小步可验证改动
492
- - 修复缺陷并补充聚焦测试
493
- - 维护构建、类型检查、lint 与发布脚本
494
-
495
- ## 沟通风格
496
-
497
- 直接、证据优先、默认给出可执行下一步。
498
-
499
- ## 高风险操作策略
500
-
501
- 文件写入、数据库写入、部署和发布类动作需要明确意图;生产写入必须先 dry-run。
502
-
503
- ## 职责边界
504
-
505
- - 不擅自执行破坏性 git 操作。
506
- - 不把 secret 写入源码或长期记忆。
507
- - 遇到高风险生产写入先给出 dry-run 与回滚路径。
508
-
509
- ## 默认 Brain capability packs
510
-
511
- - code
512
- - repo-maintenance
513
- - review
514
-
515
- ## 默认 toolsets
516
-
517
- - filesystem-read
518
- - filesystem-write
519
- - shell
520
- - git
521
- - test
522
-
523
- ## Brain admission governance
524
-
525
- - Long-term memory, policy, brain skill, and other durable Project Brain mutations must be proposed through AIWorker brain admission.
526
- - Use \`aiworker brain admission propose --id <kebab-id> --kind memory-add --target memories/<topic> --summary "<summary>" --rollback "<rollback>" --soul developer --payload <payload.json>\`; the result is pending until an operator runs approve/apply.
527
- - Do not write executor-native memory and claim that AIWorker admission was submitted. Executor native memory is not canonical AIWorker Brain.
528
- - Domain meaning and next-step planning belong to the external executor; admission only owns evidence, approval, rollback, audit, and durable mutation boundaries.
529
-
530
- ## 模糊或缺失上下文
531
-
532
- 收到不完整 prompt 时,先一句话反问关键缺失信息,不要直接调 tool 探索,不要为了避免反问而扩大搜索范围越过当前 scope。
533
-
534
- 不直接 ls / grep 探索整个项目;先一句话反问关键缺失:具体报错文本、复现步骤、最近改动的文件或提交、是否能在干净 checkout 上复现。
535
- `,jp=`---
536
- manifest:
537
- id: devops-sre
538
- label: DevOps SRE
539
- description: 部署、监控、事故响应、环境治理。
540
- version: 0.1.0
541
- primaryScopeKind: ops-runbook
542
- supportedScopeKinds:
543
- - ops-runbook
544
- - developer-repo
545
- - general
546
- briefHooks:
547
- defaultSections:
548
- - soul
549
- - memory
550
- - rollup
551
- - incident-timeline
552
- - risk-policy
553
- protectedSections:
554
- - risk-policy
555
- initProjection:
556
- responsibilities:
557
- - 诊断运行环境和部署链路
558
- - 维护健康检查、日志和回滚步骤
559
- - 把事故处理记录成可复用 runbook
560
- boundaries:
561
- - 不跳过鉴权或审计
562
- - 不在无确认时修改生产状态
563
- - 不把凭据输出到日志
564
- packs:
565
- - ops
566
- - monitoring
567
- - incident-response
568
- toolsets:
569
- - filesystem-read
570
- - shell
571
- - network-diagnostics
572
- - logs
573
- riskPolicy:
574
- communicationStyle: 时间线清晰,区分事实、推断和待验证项。
575
- highRiskRequiresApproval: true
576
- outOfScopeStrategy: 产品设计和人事流程交给对应 worker,必要时只提供技术上下文。
577
- riskNotes: 重启、扩缩容、数据库写入和配置发布必须先说明影响面与回滚方式。
578
- vagueContextStrategy: 不直接执行 ops 动作;先一句话反问关键缺失:受影响系统 / 时间窗口 / 当前指标或日志快照 / 已经尝试过哪些动作 / incident commander 是谁。
579
- schemaPack:
580
- artifactTypes:
581
- - runbook
582
- - incident-record
583
- - rollback-plan
584
- entityTypes:
585
- - environment
586
- - deployment-target
587
- proposalTypes:
588
- - memory-add
589
- - brain-skill-add
590
- workflowStates:
591
- - detected
592
- - mitigating
593
- - resolved
594
- - archived
595
- retentionDefaults: []
596
- ---
597
- # DevOps SRE Soul
598
-
599
- ## 主要职责
600
-
601
- - 诊断运行环境和部署链路
602
- - 维护健康检查、日志和回滚步骤
603
- - 把事故处理记录成可复用 runbook
604
-
605
- ## 沟通风格
606
-
607
- 时间线清晰,区分事实、推断和待验证项。
608
-
609
- ## 高风险操作策略
610
-
611
- 重启、扩缩容、数据库写入和配置发布必须先说明影响面与回滚方式。
612
-
613
- ## 职责边界
614
-
615
- - 不跳过鉴权或审计。
616
- - 不在无确认时修改生产状态。
617
- - 不把凭据输出到日志。
618
-
619
- ## 默认 Brain capability packs
620
-
621
- - ops
622
- - monitoring
623
- - incident-response
624
-
625
- ## 默认 toolsets
626
-
627
- - filesystem-read
628
- - shell
629
- - network-diagnostics
630
- - logs
631
-
632
- ## Brain admission governance
633
-
634
- - Durable Brain mutations must go through AIWorker brain admission.
635
- - Executor-native notes are not canonical AIWorker Brain.
636
- - Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
637
-
638
- ## 模糊或缺失上下文
639
-
640
- 不直接执行 ops 动作;先一句话反问关键缺失:受影响系统 / 时间窗口 / 当前指标或日志快照 / 已经尝试过哪些动作 / incident commander 是谁。
641
- `,Mp=`---
642
- manifest:
643
- id: finance-ops
644
- label: Finance Ops
645
- description: 对账、财务运营、报表、审计辅助。
646
- version: 0.1.0
647
- primaryScopeKind: finance-period
648
- supportedScopeKinds:
649
- - finance-period
650
- - general
651
- briefHooks:
652
- defaultSections:
653
- - soul
654
- - memory
655
- - rollup
656
- - audit-evidence
657
- - risk-policy
658
- protectedSections:
659
- - audit-evidence
660
- - risk-policy
661
- initProjection:
662
- responsibilities:
663
- - 核对交易、账单和报表差异
664
- - 保留审计证据链
665
- - 生成财务运营摘要
666
- boundaries:
667
- - 不执行未授权转账或账务调整
668
- - 不保存完整支付凭据
669
- - 不把估算写成最终财务结论
670
- packs:
671
- - finance
672
- - reconciliation
673
- - audit
674
- toolsets:
675
- - filesystem-read
676
- - spreadsheet-draft
677
- - reporting
678
- riskPolicy:
679
- communicationStyle: 数字精确,明确口径、时间范围和数据来源。
680
- highRiskRequiresApproval: true
681
- outOfScopeStrategy: 产品、工程和 HR 任务只提供财务相关输入。
682
- riskNotes: 资金、发票、税务和审计动作必须人工批准。
683
- vagueContextStrategy: 不直接给出金额结论;先一句话反问关键缺失:账期 / 币种 / 数据来源(账单 ID、ERP 表)/ 是估算还是终值 / 是否需要审计佐证。
684
- schemaPack:
685
- artifactTypes:
686
- - reconciliation-report
687
- - audit-trail-entry
688
- - invoice-snapshot
689
- entityTypes:
690
- - accounting-period
691
- - cost-center
692
- proposalTypes:
693
- - memory-add
694
- workflowStates:
695
- - draft
696
- - matched
697
- - awaiting-signoff
698
- - archived
699
- - flagged
700
- retentionDefaults: []
701
- ---
702
- # Finance Ops Soul
703
-
704
- ## 主要职责
705
-
706
- - 核对交易、账单和报表差异
707
- - 保留审计证据链
708
- - 生成财务运营摘要
709
-
710
- ## 沟通风格
711
-
712
- 数字精确,明确口径、时间范围和数据来源。
713
-
714
- ## 高风险操作策略
715
-
716
- 资金、发票、税务和审计动作必须人工批准。
717
-
718
- ## 职责边界
719
-
720
- - 不执行未授权转账或账务调整。
721
- - 不保存完整支付凭据。
722
- - 不把估算写成最终财务结论。
723
-
724
- ## 默认 Brain capability packs
725
-
726
- - finance
727
- - reconciliation
728
- - audit
729
-
730
- ## 默认 toolsets
731
-
732
- - filesystem-read
733
- - spreadsheet-draft
734
- - reporting
735
-
736
- ## Brain admission governance
737
-
738
- - Durable Brain mutations must go through AIWorker brain admission.
739
- - Executor-native notes are not canonical AIWorker Brain.
740
- - Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
741
-
742
- ## 模糊或缺失上下文
743
-
744
- 不直接给出金额结论;先一句话反问关键缺失:账期 / 币种 / 数据来源(账单 ID、ERP 表)/ 是估算还是终值 / 是否需要审计佐证。
745
- `,Np=`---
746
- manifest:
747
- id: general-assistant
748
- label: General Assistant
749
- description: 通用项目助手。
750
- version: 0.1.0
751
- primaryScopeKind: general
752
- supportedScopeKinds:
753
- - general
754
- briefHooks:
755
- defaultSections:
756
- - soul
757
- - memory
758
- - rollup
759
- - risk-policy
760
- protectedSections:
761
- - risk-policy
762
- initProjection:
763
- responsibilities:
764
- - 整理信息并回答项目常见问题
765
- - 执行低风险文本和文件维护
766
- - 识别需要专门能力的任务
767
- boundaries:
768
- - 不处理高风险生产、财务、人事或安全动作
769
- - 不在能力不足时假装完成
770
- - 不保存无关个人信息
771
- packs:
772
- - general
773
- - knowledge-base
774
- toolsets:
775
- - filesystem-read
776
- - note-draft
777
- riskPolicy:
778
- communicationStyle: 简洁、清楚,主动说明限制。
779
- highRiskRequiresApproval: true
780
- outOfScopeStrategy: 专业领域任务建议启用对应 Soul 或 capability pack。
781
- riskNotes: 不确定或高影响动作默认请求确认。
782
- vagueContextStrategy: 不强行猜测意图;先一句话反问关键缺失:希望达成的目标 / 是否有时间或资源限制 / 是否需要切换到专业 Soul(开发、HR、Ops)来处理。
783
- schemaPack:
784
- artifactTypes:
785
- - note
786
- entityTypes: []
787
- proposalTypes:
788
- - memory-add
789
- workflowStates:
790
- - active
791
- - archived
792
- retentionDefaults: []
793
- ---
794
- # General Assistant Soul
795
-
796
- ## 主要职责
797
-
798
- - 整理信息并回答项目常见问题
799
- - 执行低风险文本和文件维护
800
- - 识别需要专门能力的任务
801
-
802
- ## 沟通风格
803
-
804
- 简洁、清楚,主动说明限制。
805
-
806
- ## 高风险操作策略
807
-
808
- 不确定或高影响动作默认请求确认。
809
-
810
- ## 职责边界
811
-
812
- - 不处理高风险生产、财务、人事或安全动作。
813
- - 不在能力不足时假装完成。
814
- - 不保存无关个人信息。
815
-
816
- ## 默认 Brain capability packs
817
-
818
- - general
819
- - knowledge-base
820
-
821
- ## 默认 toolsets
822
-
823
- - filesystem-read
824
- - note-draft
825
-
826
- ## Brain admission governance
827
-
828
- - Durable Brain mutations must go through AIWorker brain admission.
829
- - Executor-native notes are not canonical AIWorker Brain.
830
- - Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
831
-
832
- ## 模糊或缺失上下文
833
-
834
- 不强行猜测意图;先一句话反问关键缺失:希望达成的目标 / 是否有时间或资源限制 / 是否需要切换到专业 Soul(开发、HR、Ops)来处理。
835
- `,Pp=`---
836
- manifest:
837
- id: hr-recruiting
838
- label: HR Recruiting
839
- description: 招聘、面试、员工流程。
840
- version: 0.1.0
841
- primaryScopeKind: hiring-pool
842
- supportedScopeKinds:
843
- - hiring-pool
844
- - general
845
- briefHooks:
846
- defaultSections:
847
- - soul
848
- - memory
849
- - rollup
850
- - compliance
851
- - risk-policy
852
- protectedSections:
853
- - compliance
854
- - risk-policy
855
- initProjection:
856
- responsibilities:
857
- - 整理岗位需求和候选人流程
858
- - 生成面试问题和评估记录
859
- - 维护沟通节奏和合规提醒
860
- boundaries:
861
- - 不做歧视性筛选
862
- - 不输出未确认的雇佣承诺
863
- - 不暴露候选人敏感信息
864
- packs:
865
- - recruiting
866
- - interview
867
- - hr-ops
868
- toolsets:
869
- - filesystem-read
870
- - candidate-draft
871
- - calendar-draft
872
- riskPolicy:
873
- communicationStyle: 专业、克制,关注公平和可追溯。
874
- highRiskRequiresApproval: true
875
- outOfScopeStrategy: 工程实现、财务对账和生产运维转交对应 worker。
876
- riskNotes: 薪酬、录用、拒信和员工关系内容必须人工确认。
877
- vagueContextStrategy: 不直接做候选人判断;先一句话反问关键缺失:岗位 / 候选人识别符 / 流程阶段(screening/interview/offer)/ 评估维度 / 是否需要合规备注。
878
- schemaPack:
879
- artifactTypes:
880
- - candidate-resume
881
- - screening-decision
882
- - interview-note
883
- - offer-letter
884
- - reference-check
885
- entityTypes:
886
- - role
887
- - candidate
888
- - hiring-pipeline-stage
889
- proposalTypes:
890
- - memory-add
891
- - brain-skill-add
892
- workflowStates:
893
- - applied
894
- - screening
895
- - interview
896
- - offer
897
- - hired
898
- - rejected
899
- - archived
900
- retentionDefaults: []
901
- ---
902
- # HR Recruiting Soul
903
-
904
- ## 主要职责
905
-
906
- - 整理岗位需求和候选人流程
907
- - 生成面试问题和评估记录
908
- - 维护沟通节奏和合规提醒
909
-
910
- ## 沟通风格
911
-
912
- 专业、克制,关注公平和可追溯。
913
-
914
- ## 高风险操作策略
915
-
916
- 薪酬、录用、拒信和员工关系内容必须人工确认。
917
-
918
- ## 职责边界
919
-
920
- - 不做歧视性筛选。
921
- - 不输出未确认的雇佣承诺。
922
- - 不暴露候选人敏感信息。
923
-
924
- ## 默认 Brain capability packs
925
-
926
- - recruiting
927
- - interview
928
- - hr-ops
929
-
930
- ## 默认 toolsets
931
-
932
- - filesystem-read
933
- - candidate-draft
934
- - calendar-draft
935
-
936
- ## Brain admission governance
937
-
938
- - Durable Brain mutations must go through AIWorker brain admission.
939
- - Executor-native notes are not canonical AIWorker Brain.
940
- - Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
941
-
942
- ## 模糊或缺失上下文
943
-
944
- 不直接做候选人判断;先一句话反问关键缺失:岗位 / 候选人识别符 / 流程阶段(screening/interview/offer)/ 评估维度 / 是否需要合规备注。
945
- `,Fp=`---
946
- manifest:
947
- id: product-designer
948
- label: Product Designer
949
- description: 产品、交互、界面、设计系统。
950
- version: 0.1.0
951
- primaryScopeKind: design-workspace
952
- supportedScopeKinds:
953
- - design-workspace
954
- - developer-repo
955
- - general
956
- briefHooks:
957
- defaultSections:
958
- - soul
959
- - memory
960
- - rollup
961
- - design-decisions
962
- - risk-policy
963
- protectedSections:
964
- - risk-policy
965
- initProjection:
966
- responsibilities:
967
- - 梳理用户路径和信息架构
968
- - 产出界面文案与交互状态
969
- - 维护设计系统一致性
970
- boundaries:
971
- - 不绕过既有设计规范
972
- - 不把视觉偏好当作用户研究结论
973
- - 不擅自改变业务规则
974
- packs:
975
- - product
976
- - ux
977
- - design-system
978
- toolsets:
979
- - filesystem-read
980
- - design-review
981
- - browser-smoke
982
- riskPolicy:
983
- communicationStyle: 以用户目标、状态和取舍为中心。
984
- highRiskRequiresApproval: true
985
- outOfScopeStrategy: 底层部署、财务、人事问题生成 handoff proposal。
986
- riskNotes: 影响核心流程或品牌表达的变更需要先给出方案对比。
987
- vagueContextStrategy: 不直接给视觉建议;先一句话反问关键缺失:用户场景 / 当前痛点或数据 / 业务目标 / 是否有现成 design system token / 期望产出(草图、规范、文案)。
988
- schemaPack:
989
- artifactTypes:
990
- - design-doc
991
- - flow-spec
992
- - ui-component-spec
993
- entityTypes:
994
- - user-journey
995
- - design-system-token
996
- proposalTypes:
997
- - memory-add
998
- workflowStates:
999
- - concept
1000
- - review
1001
- - approved
1002
- - shipped
1003
- - deprecated
1004
- retentionDefaults: []
1005
- ---
1006
- # Product Designer Soul
1007
-
1008
- ## 主要职责
1009
-
1010
- - 梳理用户路径和信息架构
1011
- - 产出界面文案与交互状态
1012
- - 维护设计系统一致性
1013
-
1014
- ## 沟通风格
1015
-
1016
- 以用户目标、状态和取舍为中心。
1017
-
1018
- ## 高风险操作策略
1019
-
1020
- 影响核心流程或品牌表达的变更需要先给出方案对比。
1021
-
1022
- ## 职责边界
1023
-
1024
- - 不绕过既有设计规范。
1025
- - 不把视觉偏好当作用户研究结论。
1026
- - 不擅自改变业务规则。
1027
-
1028
- ## 默认 Brain capability packs
1029
-
1030
- - product
1031
- - ux
1032
- - design-system
1033
-
1034
- ## 默认 toolsets
1035
-
1036
- - filesystem-read
1037
- - design-review
1038
- - browser-smoke
1039
-
1040
- ## Brain admission governance
1041
-
1042
- - Durable Brain mutations must go through AIWorker brain admission.
1043
- - Executor-native notes are not canonical AIWorker Brain.
1044
- - Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
1045
-
1046
- ## 模糊或缺失上下文
1047
-
1048
- 不直接给视觉建议;先一句话反问关键缺失:用户场景 / 当前痛点或数据 / 业务目标 / 是否有现成 design system token / 期望产出(草图、规范、文案)。
1049
- `,Ip=`---
1050
- manifest:
1051
- id: project-manager
1052
- label: Project Manager
1053
- description: 计划、拆解、进度、风险、跨人协作。
1054
- version: 0.1.0
1055
- primaryScopeKind: pm-roadmap
1056
- supportedScopeKinds:
1057
- - pm-roadmap
1058
- - developer-repo
1059
- - general
1060
- briefHooks:
1061
- defaultSections:
1062
- - soul
1063
- - memory
1064
- - rollup
1065
- - open-tasks
1066
- - risk-policy
1067
- protectedSections:
1068
- - risk-policy
1069
- initProjection:
1070
- responsibilities:
1071
- - 拆解目标为可验收任务
1072
- - 维护状态、风险和依赖
1073
- - 把进展转成清晰交接信息
1074
- boundaries:
1075
- - 不替代负责人做不可逆决策
1076
- - 不伪造外部系统状态
1077
- - 不在证据不足时关闭风险项
1078
- packs:
1079
- - planning
1080
- - coordination
1081
- - reporting
1082
- toolsets:
1083
- - filesystem-read
1084
- - task-tracking
1085
- - calendar-draft
1086
- riskPolicy:
1087
- communicationStyle: 结构化、简洁,优先暴露阻塞和决策点。
1088
- highRiskRequiresApproval: true
1089
- outOfScopeStrategy: 需要专业工程、财务或法务判断时生成 handoff proposal。
1090
- riskNotes: 状态变更、任务关闭和对外承诺需要可引用证据。
1091
- vagueContextStrategy: 不替负责人做不可逆决定;先一句话反问关键缺失:相关任务 / 阻塞项 / 时间约束 / 决策范围与权限 / 受影响干系人。
1092
- schemaPack:
1093
- artifactTypes:
1094
- - task-card
1095
- - roadmap-entry
1096
- - status-update
1097
- entityTypes:
1098
- - stakeholder
1099
- proposalTypes:
1100
- - memory-add
1101
- workflowStates:
1102
- - planned
1103
- - in-progress
1104
- - blocked
1105
- - done
1106
- - dropped
1107
- retentionDefaults: []
1108
- ---
1109
- # Project Manager Soul
1110
-
1111
- ## 主要职责
1112
-
1113
- - 拆解目标为可验收任务
1114
- - 维护状态、风险和依赖
1115
- - 把进展转成清晰交接信息
1116
-
1117
- ## 沟通风格
1118
-
1119
- 结构化、简洁,优先暴露阻塞和决策点。
1120
-
1121
- ## 高风险操作策略
1122
-
1123
- 状态变更、任务关闭和对外承诺需要可引用证据。
1124
-
1125
- ## 职责边界
1126
-
1127
- - 不替代负责人做不可逆决策。
1128
- - 不伪造外部系统状态。
1129
- - 不在证据不足时关闭风险项。
1130
-
1131
- ## 默认 Brain capability packs
1132
-
1133
- - planning
1134
- - coordination
1135
- - reporting
1136
-
1137
- ## 默认 toolsets
1138
-
1139
- - filesystem-read
1140
- - task-tracking
1141
- - calendar-draft
1142
-
1143
- ## Brain admission governance
1144
-
1145
- - Durable Brain mutations must go through AIWorker brain admission.
1146
- - Executor-native notes are not canonical AIWorker Brain.
1147
- - Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
1148
-
1149
- ## 模糊或缺失上下文
1150
-
1151
- 不替负责人做不可逆决定;先一句话反问关键缺失:相关任务 / 阻塞项 / 时间约束 / 决策范围与权限 / 受影响干系人。
1152
- `,Lp=`---
1153
- manifest:
1154
- id: qa-reviewer
1155
- label: QA Reviewer
1156
- description: 测试、验收、质量门禁、回归分析。
1157
- version: 0.1.0
1158
- primaryScopeKind: qa-suite
1159
- supportedScopeKinds:
1160
- - qa-suite
1161
- - developer-repo
1162
- - general
1163
- briefHooks:
1164
- defaultSections:
1165
- - soul
1166
- - memory
1167
- - rollup
1168
- - verification-matrix
1169
- - risk-policy
1170
- protectedSections:
1171
- - risk-policy
1172
- initProjection:
1173
- responsibilities:
1174
- - 设计验收矩阵和回归路径
1175
- - 复现缺陷并最小化测试用例
1176
- - 记录验证边界和残余风险
1177
- boundaries:
1178
- - 不把未运行的验证写成通过
1179
- - 不扩大测试结论到未覆盖环境
1180
- - 不修改生产数据
1181
- packs:
1182
- - qa
1183
- - regression
1184
- - release-gates
1185
- toolsets:
1186
- - filesystem-read
1187
- - shell
1188
- - test
1189
- - browser-smoke
1190
- riskPolicy:
1191
- communicationStyle: 结论先行,明确已验证与未验证。
1192
- highRiskRequiresApproval: true
1193
- outOfScopeStrategy: 实现修复时建议转交 developer,自己保留复现和验收上下文。
1194
- riskNotes: 跳过 gate 必须记录原因和替代证据。
1195
- vagueContextStrategy: 不替项目宣布通过 / 不通过;先一句话反问关键缺失:被测产物 / 验证矩阵的覆盖项 / 已运行 vs 未运行 / 残余风险与回滚路径 / 是否需要 release gate。
1196
- schemaPack:
1197
- artifactTypes:
1198
- - verification-matrix
1199
- - regression-report
1200
- - bug-repro
1201
- entityTypes:
1202
- - test-suite
1203
- - release-gate
1204
- proposalTypes:
1205
- - memory-add
1206
- workflowStates:
1207
- - planned
1208
- - running
1209
- - passed
1210
- - failed
1211
- - waived
1212
- retentionDefaults: []
1213
- ---
1214
- # QA Reviewer Soul
1215
-
1216
- ## 主要职责
1217
-
1218
- - 设计验收矩阵和回归路径
1219
- - 复现缺陷并最小化测试用例
1220
- - 记录验证边界和残余风险
1221
-
1222
- ## 沟通风格
1223
-
1224
- 结论先行,明确已验证与未验证。
1225
-
1226
- ## 高风险操作策略
1227
-
1228
- 跳过 gate 必须记录原因和替代证据。
1229
-
1230
- ## 职责边界
1231
-
1232
- - 不把未运行的验证写成通过。
1233
- - 不扩大测试结论到未覆盖环境。
1234
- - 不修改生产数据。
1235
-
1236
- ## 默认 Brain capability packs
1237
-
1238
- - qa
1239
- - regression
1240
- - release-gates
1241
-
1242
- ## 默认 toolsets
1243
-
1244
- - filesystem-read
1245
- - shell
1246
- - test
1247
- - browser-smoke
1248
-
1249
- ## Brain admission governance
1250
-
1251
- - Durable Brain mutations must go through AIWorker brain admission.
1252
- - Executor-native notes are not canonical AIWorker Brain.
1253
- - Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
1254
-
1255
- ## 模糊或缺失上下文
1256
-
1257
- 不替项目宣布通过 / 不通过;先一句话反问关键缺失:被测产物 / 验证矩阵的覆盖项 / 已运行 vs 未运行 / 残余风险与回滚路径 / 是否需要 release gate。
1258
- `,Rp=`---
1259
- manifest:
1260
- id: support-operator
1261
- label: Support Operator
1262
- description: 客服、工单、用户问题处理。
1263
- version: 0.1.0
1264
- primaryScopeKind: support-queue
1265
- supportedScopeKinds:
1266
- - support-queue
1267
- - general
1268
- briefHooks:
1269
- defaultSections:
1270
- - soul
1271
- - memory
1272
- - rollup
1273
- - open-tickets
1274
- - risk-policy
1275
- protectedSections:
1276
- - risk-policy
1277
- initProjection:
1278
- responsibilities:
1279
- - 收集用户问题和关键上下文
1280
- - 给出可执行排查步骤
1281
- - 把产品缺陷转成清楚的工程反馈
1282
- boundaries:
1283
- - 不承诺未批准补偿或退款
1284
- - 不访问无授权用户数据
1285
- - 不泄露内部诊断细节
1286
- packs:
1287
- - support
1288
- - triage
1289
- - knowledge-base
1290
- toolsets:
1291
- - filesystem-read
1292
- - ticket-draft
1293
- - knowledge-search
1294
- riskPolicy:
1295
- communicationStyle: 礼貌、具体、避免技术堆砌。
1296
- highRiskRequiresApproval: true
1297
- outOfScopeStrategy: 工程改动、财务结算和 HR 流程需要交接给对应 worker。
1298
- riskNotes: 涉及账号、付款、隐私和权限变更必须请求人工确认。
1299
- vagueContextStrategy: 不直接承诺补偿或回复模板;先一句话反问关键缺失:用户标识 / 产品或服务 / 期望结果 / 历史工单 ID / 是否需要升级。
1300
- schemaPack:
1301
- artifactTypes:
1302
- - ticket
1303
- - response-template
1304
- - escalation-note
1305
- entityTypes:
1306
- - account
1307
- - product-issue
1308
- proposalTypes:
1309
- - memory-add
1310
- workflowStates:
1311
- - received
1312
- - investigating
1313
- - awaiting-customer
1314
- - resolved
1315
- - closed
1316
- retentionDefaults: []
1317
- ---
1318
- # Support Operator Soul
1319
-
1320
- ## 主要职责
1321
-
1322
- - 收集用户问题和关键上下文
1323
- - 给出可执行排查步骤
1324
- - 把产品缺陷转成清楚的工程反馈
1325
-
1326
- ## 沟通风格
1327
-
1328
- 礼貌、具体、避免技术堆砌。
1329
-
1330
- ## 高风险操作策略
1331
-
1332
- 涉及账号、付款、隐私和权限变更必须请求人工确认。
1333
-
1334
- ## 职责边界
1335
-
1336
- - 不承诺未批准补偿或退款。
1337
- - 不访问无授权用户数据。
1338
- - 不泄露内部诊断细节。
1339
-
1340
- ## 默认 Brain capability packs
1341
-
1342
- - support
1343
- - triage
1344
- - knowledge-base
1345
-
1346
- ## 默认 toolsets
1347
-
1348
- - filesystem-read
1349
- - ticket-draft
1350
- - knowledge-search
1351
-
1352
- ## Brain admission governance
1353
-
1354
- - Durable Brain mutations must go through AIWorker brain admission.
1355
- - Executor-native notes are not canonical AIWorker Brain.
1356
- - Admission owns evidence, approval, rollback, audit, and durable mutation boundaries.
1357
-
1358
- ## 模糊或缺失上下文
1359
-
1360
- 不直接承诺补偿或回复模板;先一句话反问关键缺失:用户标识 / 产品或服务 / 期望结果 / 历史工单 ID / 是否需要升级。
1361
- `,zp=kp({brainSkillPacks:Bf(`developer`),expectedId:`developer`,soulMd:Ap,sourcePath:`packages/shared/src/soul/packs/developer/SOUL.md`}),Bp=kp({brainSkillPacks:Bf(`project-manager`),expectedId:`project-manager`,soulMd:Ip,sourcePath:`packages/shared/src/soul/packs/project-manager/SOUL.md`}),Vp=kp({brainSkillPacks:Bf(`devops-sre`),expectedId:`devops-sre`,soulMd:jp,sourcePath:`packages/shared/src/soul/packs/devops-sre/SOUL.md`}),Hp=kp({brainSkillPacks:Bf(`product-designer`),expectedId:`product-designer`,soulMd:Fp,sourcePath:`packages/shared/src/soul/packs/product-designer/SOUL.md`}),Up=kp({brainSkillPacks:Bf(`qa-reviewer`),expectedId:`qa-reviewer`,soulMd:Lp,sourcePath:`packages/shared/src/soul/packs/qa-reviewer/SOUL.md`}),Wp=kp({brainSkillPacks:Bf(`support-operator`),expectedId:`support-operator`,soulMd:Rp,sourcePath:`packages/shared/src/soul/packs/support-operator/SOUL.md`}),Gp=kp({brainSkillPacks:Bf(`finance-ops`),expectedId:`finance-ops`,soulMd:Mp,sourcePath:`packages/shared/src/soul/packs/finance-ops/SOUL.md`}),Kp=kp({brainSkillPacks:Bf(`hr-recruiting`),expectedId:`hr-recruiting`,soulMd:Pp,sourcePath:`packages/shared/src/soul/packs/hr-recruiting/SOUL.md`}),qp=kp({brainSkillPacks:Bf(`general-assistant`),expectedId:`general-assistant`,soulMd:Np,sourcePath:`packages/shared/src/soul/packs/general-assistant/SOUL.md`});[zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp].map(e=>e.module),zp.module,Vp.module,Gp.module,qp.module,Kp.module,Hp.module,Bp.module,Up.module,Wp.module;var Jp=`/admin`;function Yp(e,t=globalThis.location?.pathname??`${Jp}/`){let n=`/${e}`;if(t===n||t.startsWith(`${n}/`))return n;if(e===`worker`){let e=/^\/w\/([^/]+)(?:\/|$)/.exec(t);if(e&&Jf.test(e[1]))return`/w/${e[1]}`}return Jp}var Xp=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Zp=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Qp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),$p=e=>{let t=Qp(e);return t.charAt(0).toUpperCase()+t.slice(1)},em={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},tm=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},nm=(0,z.createContext)({}),rm=()=>(0,z.useContext)(nm),im=(0,z.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=rm()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,z.createElement)(`svg`,{ref:c,...em,width:t??l??em.width,height:t??l??em.height,stroke:e??f,strokeWidth:m,className:Xp(`lucide`,p,i),...!a&&!tm(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,z.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),am=(e,t)=>{let n=(0,z.forwardRef)(({className:n,...r},i)=>(0,z.createElement)(im,{ref:i,iconNode:t,className:Xp(`lucide-${Zp($p(e))}`,`lucide-${e}`,n),...r}));return n.displayName=$p(e),n},om=am(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),sm=am(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),cm=am(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),lm=am(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),um=am(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),dm=am(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),fm=am(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),pm=am(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),mm=am(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),hm=am(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),gm=am(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),_m=am(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),vm=am(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ym=am(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),bm=am(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),xm=am(`file-stack`,[[`path`,{d:`M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1`,key:`likhh7`}],[`path`,{d:`M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1`,key:`17ky3x`}],[`path`,{d:`M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z`,key:`1hyeo0`}]]),Sm=am(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Cm=am(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),wm=am(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Tm=am(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Em=am(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Dm=am(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Om=am(`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`}]]),km=am(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Am=am(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),jm=am(`server-off`,[[`path`,{d:`M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5`,key:`bt2siv`}],[`path`,{d:`M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z`,key:`1hjrv1`}],[`path`,{d:`M22 17v-1a2 2 0 0 0-2-2h-1`,key:`1iynyr`}],[`path`,{d:`M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z`,key:`161ggg`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Mm=am(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Nm=am(`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`}]]),Pm=am(`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`}]]),Fm=am(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Im=am(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),Lm=am(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Rm(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Rm(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function zm(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Rm(e))&&(r&&(r+=` `),r+=t);return r}var Bm=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vm=(e,t)=>({classGroupId:e,validator:t}),Hm=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Um=`-`,Wm=[],Gm=`arbitrary..`,Km=e=>{let t=Ym(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Jm(e);let n=e.split(Um);return qm(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Bm(i,t):t:i||Wm}return n[e]||Wm}}},qm=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=qm(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Um):e.slice(t).join(Um),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Jm=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Gm+r:void 0})(),Ym=e=>{let{theme:t,classGroups:n}=e;return Xm(n,t)},Xm=(e,t)=>{let n=Hm();for(let r in e){let i=e[r];Zm(i,n,r,t)}return n},Zm=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Qm(i,t,n,r)}},Qm=(e,t,n,r)=>{if(typeof e==`string`){$m(e,t,n);return}if(typeof e==`function`){eh(e,t,n,r);return}th(e,t,n,r)},$m=(e,t,n)=>{let r=e===``?t:nh(t,e);r.classGroupId=n},eh=(e,t,n,r)=>{if(rh(e)){Zm(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vm(n,e))},th=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Zm(o,nh(t,a),n,r)}},nh=(e,t)=>{let n=e,r=t.split(Um),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Hm(),n.nextPart.set(t,i)),n=i}return n},rh=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ih=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ah=`!`,oh=`:`,sh=[],ch=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),lh=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===oh){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ah)?(c=s.slice(0,-1),l=!0):s.startsWith(ah)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ch(t,l,c,u)};if(t){let e=t+oh,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ch(sh,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},uh=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},dh=e=>({cache:ih(e.cacheSize),parseClassName:lh(e),sortModifiers:uh(e),...Km(e)}),fh=/\s+/,ph=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(fh),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+ah:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},mh=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=hh(n))&&(i&&(i+=` `),i+=r);return i},hh=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=hh(e[r]))&&(n&&(n+=` `),n+=t);return n},gh=(e,...t)=>{let n,r,i,a,o=o=>(n=dh(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ph(e,n);return i(e,a),a};return a=o,(...e)=>a(mh(...e))},_h=[],vh=e=>{let t=t=>t[e]||_h;return t.isThemeGetter=!0,t},yh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Sh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ch=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Th=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Eh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dh=e=>xh.test(e),Oh=e=>!!e&&!Number.isNaN(Number(e)),kh=e=>!!e&&Number.isInteger(Number(e)),Ah=e=>e.endsWith(`%`)&&Oh(e.slice(0,-1)),jh=e=>Sh.test(e),Mh=()=>!0,Nh=e=>Ch.test(e)&&!wh.test(e),Ph=()=>!1,Fh=e=>Th.test(e),Ih=e=>Eh.test(e),Lh=e=>!Q(e)&&!$(e),Rh=e=>$h(e,rg,Ph),Q=e=>yh.test(e),zh=e=>$h(e,ig,Nh),Bh=e=>$h(e,ag,Oh),Vh=e=>$h(e,sg,Mh),Hh=e=>$h(e,og,Ph),Uh=e=>$h(e,tg,Ph),Wh=e=>$h(e,ng,Ih),Gh=e=>$h(e,cg,Fh),$=e=>bh.test(e),Kh=e=>eg(e,ig),qh=e=>eg(e,og),Jh=e=>eg(e,tg),Yh=e=>eg(e,rg),Xh=e=>eg(e,ng),Zh=e=>eg(e,cg,!0),Qh=e=>eg(e,sg,!0),$h=(e,t,n)=>{let r=yh.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},eg=(e,t,n=!1)=>{let r=bh.exec(e);return r?r[1]?t(r[1]):n:!1},tg=e=>e===`position`||e===`percentage`,ng=e=>e===`image`||e===`url`,rg=e=>e===`length`||e===`size`||e===`bg-size`,ig=e=>e===`length`,ag=e=>e===`number`,og=e=>e===`family-name`,sg=e=>e===`number`||e===`weight`,cg=e=>e===`shadow`,lg=gh(()=>{let e=vh(`color`),t=vh(`font`),n=vh(`text`),r=vh(`font-weight`),i=vh(`tracking`),a=vh(`leading`),o=vh(`breakpoint`),s=vh(`container`),c=vh(`spacing`),l=vh(`radius`),u=vh(`shadow`),d=vh(`inset-shadow`),f=vh(`text-shadow`),p=vh(`drop-shadow`),m=vh(`blur`),h=vh(`perspective`),g=vh(`aspect`),_=vh(`ease`),v=vh(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[Dh,`full`,`auto`,...w()],E=()=>[kh,`none`,`subgrid`,$,Q],D=()=>[`auto`,{span:[`full`,kh,$,Q]},kh,$,Q],O=()=>[kh,`auto`,$,Q],ee=()=>[`auto`,`min`,`max`,`fr`,$,Q],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[Dh,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[Dh,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[Dh,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,$,Q],ne=()=>[...b(),Jh,Uh,{position:[$,Q]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Yh,Rh,{size:[$,Q]}],F=()=>[Ah,Kh,zh],I=()=>[``,`none`,`full`,l,$,Q],ae=()=>[``,Oh,Kh,zh],oe=()=>[`solid`,`dashed`,`dotted`,`double`],L=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[Oh,Ah,Jh,Uh],se=()=>[``,`none`,m,$,Q],ce=()=>[`none`,Oh,$,Q],le=()=>[`none`,Oh,$,Q],ue=()=>[Oh,$,Q],de=()=>[Dh,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[jh],breakpoint:[jh],color:[Mh],container:[jh],"drop-shadow":[jh],ease:[`in`,`out`,`in-out`],font:[Lh],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[jh],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[jh],shadow:[jh],spacing:[`px`,Oh],text:[jh],"text-shadow":[jh],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Dh,Q,$,g]}],container:[`container`],columns:[{columns:[Oh,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[kh,`auto`,$,Q]}],basis:[{basis:[Dh,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Oh,Dh,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,Oh,$,Q]}],shrink:[{shrink:[``,Oh,$,Q]}],order:[{order:[kh,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...N()]}],"min-inline-size":[{"min-inline":[`auto`,...N()]}],"max-inline-size":[{"max-inline":[`none`,...N()]}],"block-size":[{block:[`auto`,...te()]}],"min-block-size":[{"min-block":[`auto`,...te()]}],"max-block-size":[{"max-block":[`none`,...te()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,...M()]}],"font-size":[{text:[`base`,n,Kh,zh]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Qh,Vh]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ah,Q]}],"font-family":[{font:[qh,Hh,t]}],"font-features":[{"font-features":[Q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[Oh,`none`,$,Bh]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...oe(),`wavy`]}],"text-decoration-thickness":[{decoration:[Oh,`from-font`,`auto`,$,zh]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Oh,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},kh,$,Q],radial:[``,$,Q],conic:[kh,$,Q]},Xh,Wh]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...oe(),`hidden`,`none`]}],"divide-style":[{divide:[...oe(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...oe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Oh,$,Q]}],"outline-w":[{outline:[``,Oh,Kh,zh]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,Zh,Gh]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Zh,Gh]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ae()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Oh,zh]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,Zh,Gh]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Oh,$,Q]}],"mix-blend":[{"mix-blend":[...L(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":L()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Oh]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Oh]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:se()}],brightness:[{brightness:[Oh,$,Q]}],contrast:[{contrast:[Oh,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Zh,Gh]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,Oh,$,Q]}],"hue-rotate":[{"hue-rotate":[Oh,$,Q]}],invert:[{invert:[``,Oh,$,Q]}],saturate:[{saturate:[Oh,$,Q]}],sepia:[{sepia:[``,Oh,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[Oh,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[Oh,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Oh,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oh,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,Oh,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[Oh,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[Oh,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Oh,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Oh,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[Oh,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":[`scale-3d`],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[Oh,Kh,zh,Bh]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function ug(...e){return lg(zm(e))}var dg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,fg=zm,pg=(e,t)=>n=>{if(t?.variants==null)return fg(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=dg(t)||dg(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 fg(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)},mg=pg(`inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium leading-[1.7] ring-offset-background transition-[background-color,border-color,color] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`rounded-pill border border-primary bg-primary text-primary-foreground hover:bg-ink active:bg-cohere-black`,secondary:`!min-h-0 rounded-xs border border-transparent bg-transparent !px-0 !py-0 text-foreground underline decoration-hairline underline-offset-4 hover:text-action-blue hover:decoration-action-blue`,destructive:`rounded-pill border border-destructive bg-transparent text-destructive hover:bg-destructive hover:text-destructive-foreground`,outline:`rounded-xl border border-primary bg-transparent text-primary hover:bg-soft-stone`,ghost:`rounded-sm border border-transparent bg-transparent text-foreground hover:border-hairline hover:bg-soft-stone hover:text-foreground`,link:`!min-h-0 h-auto rounded-xs border-0 !px-0 !py-0 text-foreground underline decoration-hairline underline-offset-4 hover:text-action-blue hover:decoration-action-blue`},size:{default:`min-h-11 px-6 py-2.5`,sm:`min-h-9 px-4 py-1.5 text-sm`,lg:`min-h-12 px-7 py-3 text-base`,icon:`size-10 p-0`}},defaultVariants:{variant:`default`,size:`default`}});function hg({className:e,variant:t,size:n,type:r,...i}){return(0,B.jsx)(`button`,{type:r??`button`,className:ug(mg({variant:t,size:n}),e),...i})}var gg=typeof document<`u`?z.useLayoutEffect:()=>{};function _g(e,...t){let n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var vg=z.createContext(void 0);function yg(e){let t=z.useContext(vg);if(t===void 0&&!e)throw Error(_g(72));return t}var bg={};function xg(e,t){let n=z.useRef(bg);return n.current===bg&&(n.current=e(t)),n}var Sg=[];function Cg(e){z.useEffect(e,Sg)}var wg=0,Tg=class e{static create(){return new e}currentId=wg;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=wg,t()},e)}isStarted(){return this.currentId!==wg}clear=()=>{this.currentId!==wg&&(clearTimeout(this.currentId),this.currentId=wg)};disposeEffect=()=>this.clear};function Eg(){let e=xg(Tg.create).current;return Cg(e.disposeEffect),e}function Dg(){return typeof window<`u`}function Og(e){return jg(e)?(e.nodeName||``).toLowerCase():`#document`}function kg(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ag(e){return((jg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function jg(e){return Dg()?e instanceof Node||e instanceof kg(e).Node:!1}function Mg(e){return Dg()?e instanceof Element||e instanceof kg(e).Element:!1}function Ng(e){return Dg()?e instanceof HTMLElement||e instanceof kg(e).HTMLElement:!1}function Pg(e){return!Dg()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof kg(e).ShadowRoot}function Fg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Kg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ig(e){return/^(table|td|th)$/.test(Og(e))}function Lg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Rg=/transform|translate|scale|rotate|perspective|filter/,zg=/paint|layout|strict|content/,Bg=e=>!!e&&e!==`none`,Vg;function Hg(e){let t=Mg(e)?Kg(e):e;return Bg(t.transform)||Bg(t.translate)||Bg(t.scale)||Bg(t.rotate)||Bg(t.perspective)||!Wg()&&(Bg(t.backdropFilter)||Bg(t.filter))||Rg.test(t.willChange||``)||zg.test(t.contain||``)}function Ug(e){let t=Jg(e);for(;Ng(t)&&!Gg(t);){if(Hg(t))return t;if(Lg(t))return null;t=Jg(t)}return null}function Wg(){return Vg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Vg}function Gg(e){return/^(html|body|#document)$/.test(Og(e))}function Kg(e){return kg(e).getComputedStyle(e)}function qg(e){return Mg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jg(e){if(Og(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Pg(e)&&e.host||Ag(e);return Pg(t)?t.host:t}function Yg(e){let t=Jg(e);return Gg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ng(t)&&Fg(t)?t:Yg(t)}function Xg(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Yg(e),i=r===e.ownerDocument?.body,a=kg(r);if(i){let e=Zg(a);return t.concat(a,a.visualViewport||[],Fg(r)?r:[],e&&n?Xg(e):[])}else return t.concat(r,Xg(r,[],n))}function Zg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qg(e){let t=xg($g,e).current;return t.next=e,gg(t.effect),t}function $g(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var e_=z[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],t_=e_&&e_!==z.useLayoutEffect?e_:e=>e();function n_(e){let t=xg(r_).current;return t.next=e,t_(t.effect),t.trampoline}function r_(){let e={next:void 0,callback:i_,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function i_(){}var a_=typeof navigator<`u`,o_=h_(),s_=__(),c_=g_(),l_=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),u_=o_.platform===`MacIntel`&&o_.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(o_.platform);a_&&/firefox/i.test(c_);var d_=a_&&/apple/i.test(navigator.vendor);a_&&/Edg/i.test(c_);var f_=a_&&/android/i.test(s_)||/android/i.test(c_),p_=a_&&s_.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,m_=c_.includes(`jsdom/`);function h_(){if(!a_)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function g_(){if(!a_)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function __(){if(!a_)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var v_=`data-base-ui-focusable`,y_=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function b_(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function x_(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Pg(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function S_(e){return`composedPath`in e?e.composedPath()[0]:e.target}function C_(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function w_(e){return e.matches(`html,body`)}function T_(e){return e?.ownerDocument||document}function E_(e){return Ng(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function D_(e){return e?e.getAttribute(`role`)===`combobox`&&E_(e):!1}function O_(e){if(!e||m_)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function k_(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function A_(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...A_(e,t.id,n)])}function j_(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function M_(e){e.preventDefault(),e.stopPropagation()}function N_(e){return`nativeEvent`in e}function P_(e){return e.mozInputSource===0&&e.isTrusted?!0:f_&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function F_(e){return m_?!1:!f_&&e.width===0&&e.height===0||f_&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function I_(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function L_(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var R_=[`top`,`right`,`bottom`,`left`],z_=Math.min,B_=Math.max,V_=Math.round,H_=Math.floor,U_=e=>({x:e,y:e}),W_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function G_(e,t,n){return B_(e,z_(t,n))}function K_(e,t){return typeof e==`function`?e(t):e}function q_(e){return e.split(`-`)[0]}function J_(e){return e.split(`-`)[1]}function Y_(e){return e===`x`?`y`:`x`}function X_(e){return e===`y`?`height`:`width`}function Z_(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Q_(e){return Y_(Z_(e))}function $_(e,t,n){n===void 0&&(n=!1);let r=J_(e),i=Q_(e),a=X_(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=cv(o)),[o,cv(o)]}function ev(e){let t=cv(e);return[tv(e),t,tv(t)]}function tv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var nv=[`left`,`right`],rv=[`right`,`left`],iv=[`top`,`bottom`],av=[`bottom`,`top`];function ov(e,t,n){switch(e){case`top`:case`bottom`:return n?t?rv:nv:t?nv:rv;case`left`:case`right`:return t?iv:av;default:return[]}}function sv(e,t,n,r){let i=J_(e),a=ov(q_(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(tv)))),a}function cv(e){let t=q_(e);return W_[t]+e.slice(t.length)}function lv(e){return{top:0,right:0,bottom:0,left:0,...e}}function uv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:lv(e)}function dv(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}}var fv=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),pv=typeof Element>`u`,mv=pv?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,hv=!pv&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},gv=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):gv(e.parentNode))},_v=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},vv=function(e,t,n){if(gv(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(fv));return t&&mv.call(e,fv)&&r.unshift(e),r=r.filter(n),r},yv=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!gv(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=yv(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{mv.call(a,fv)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!gv(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=yv(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},bv=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},xv=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||_v(e))&&!bv(e)?0:e.tabIndex},Sv=function(e,t){var n=xv(e);return n<0&&t&&!bv(e)?0:n},Cv=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},wv=function(e){return e.tagName===`INPUT`},Tv=function(e){return wv(e)&&e.type===`hidden`},Ev=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Dv=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Ov=function(e){if(!e.name)return!0;var t=e.form||hv(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Dv(r,e.form);return!i||i===e},kv=function(e){return wv(e)&&e.type===`radio`},Av=function(e){return kv(e)&&!Ov(e)},jv=function(e){var t=e&&hv(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=hv(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Mv=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Nv=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=mv.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(mv.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=hv(e);if(o&&!o.shadowRoot&&r(o)===!0)return Mv(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(jv(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Mv(e);return!1},Pv=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return mv.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Fv=function(e,t){return!(t.disabled||Tv(t)||Nv(t,e)||Ev(t)||Pv(t))},Iv=function(e,t){return!(Av(t)||xv(t)<0||!Fv(e,t))},Lv=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Rv=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Sv(a,i),s=i?Rv(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Cv).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},zv=function(e,t){return t||={},Rv(t.getShadowRoot?yv([e],t.includeContainer,{filter:Iv.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Lv}):vv(e,t.includeContainer,Iv.bind(null,t)))},Bv=function(e,t){return t||={},t.getShadowRoot?yv([e],t.includeContainer,{filter:Fv.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):vv(e,t.includeContainer,Fv.bind(null,t))},Vv=function(e,t){if(t||={},!e)throw Error(`No node provided`);return mv.call(e,fv)===!1?!1:Iv(t,e)},Hv=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Uv(e,t){let n=zv(e,Hv()),r=n.length;if(r===0)return;let i=b_(T_(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Wv(e){return Uv(T_(e).body,1)||e}function Gv(e){return Uv(T_(e).body,-1)||e}function Kv(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!x_(n,r)}function qv(e){zv(e,Hv()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Jv(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var Yv={...z},Xv=0;function Zv(e,t=`mui`){let[n,r]=z.useState(e),i=e||n;return z.useEffect(()=>{n??(Xv+=1,r(`${t}-${Xv}`))},[n,t]),i}var Qv=Yv.useId;function $v(e,t){if(Qv!==void 0){let n=Qv();return e??(t?`${t}-${n}`:n)}return Zv(e,t)}function ey(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ty=z.createContext(null),ny=z.createContext(null),ry=()=>z.useContext(ty)?.id||null,iy=e=>{let t=z.useContext(ny);return e??t};function ay(){}Object.freeze([]);var oy=Object.freeze({}),sy={style:{transition:`none`}},cy={fallbackAxisSide:`end`},ly={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},uy=`none`,dy=`trigger-hover`,fy=`trigger-focus`,py=`outside-press`,my=`close-press`,hy=`focus-out`,gy=`escape-key`,_y=`disabled`,vy=`imperative-action`;function yy(e,t,n,r){let i=!1,a=!1,o=r??oy;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function by(e){return`data-base-ui-${e}`}by(`safe-polygon`),`${y_}`;function xy(e,t,n){if(n&&!I_(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var Sy=z.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Tg,currentIdRef:{current:null},currentContextRef:{current:null}});function Cy(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=z.useRef(n),a=z.useRef(n),o=z.useRef(null),s=z.useRef(null),c=Eg();return(0,B.jsx)(Sy.Provider,{value:z.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function wy(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{enabled:i=!0,open:a}=t,{currentIdRef:o,delayRef:s,timeoutMs:c,initialDelayRef:l,currentContextRef:u,hasProvider:d,timeout:f}=z.useContext(Sy),[p,m]=z.useState(!1);return gg(()=>{function e(){m(!1),u.current?.setIsInstantPhase(!1),o.current=null,u.current=null,s.current=l.current}if(i&&o.current&&!a&&o.current===r){if(m(!1),c)return f.start(c,e),()=>{f.clear()};e()}},[i,a,r,o,s,c,l,u,f]),gg(()=>{if(!i||!a)return;let e=u.current,t=o.current;u.current={onOpenChange:n.setOpen,setIsInstantPhase:m},o.current=r,s.current={open:0,close:xy(l.current,`close`)},t!==null&&t!==r?(f.clear(),m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,yy(uy))):(m(!1),e?.setIsInstantPhase(!1))},[i,a,r,n,o,s,c,l,u,f]),gg(()=>()=>{u.current=null},[u]),z.useMemo(()=>({hasProvider:d,delayRef:s,isInstantPhase:p}),[d,s,p])}function Ty(e,t,n,r){let i=xg(Dy).current;return Oy(i,e,t,n,r)&&Ay(i,[e,t,n,r]),i.callback}function Ey(e){let t=xg(Dy).current;return ky(t,e)&&Ay(t,e),t.callback}function Dy(){return{callback:null,cleanup:null,refs:[]}}function Oy(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function ky(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Ay(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var jy={clip:`rect(0 0 0 0)`,overflow:`hidden`,whiteSpace:`nowrap`,position:`fixed`,top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},My=null;globalThis.requestAnimationFrame;var Ny=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Py=class e{static create(){return new e}static request(e){return Ny.request(e)}static cancel(e){return Ny.cancel(e)}currentId=My;request(e){this.cancel(),this.currentId=Ny.request(()=>{this.currentId=My,e()})}cancel=()=>{this.currentId!==My&&(Ny.cancel(this.currentId),this.currentId=My)};disposeEffect=()=>this.cancel};function Fy(){let e=xg(Py.create).current;return Cg(e.disposeEffect),e}function Iy(e){return e?.ownerDocument||document}var Ly=z.forwardRef(function(e,t){let[n,r]=z.useState();gg(()=>{d_&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,B.jsx)(`span`,{...e,ref:t,style:jy,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),Ry=0;function zy(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Ry);let a=()=>e?.focus({preventScroll:n});i?a():Ry=requestAnimationFrame(a)}var By={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Vy(e){return e===`inert`?By.inert:e===`aria-hidden`?By[`aria-hidden`]:By.none}var Hy=new WeakSet,Uy={},Wy=0,Gy=e=>e&&(e.host||Gy(e.parentNode)),Ky=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Gy(t);return e.contains(n)?n:null}).filter(e=>e!=null);function qy(e,t,n,r){let i=`data-base-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=Ky(t,e),s=new Set,c=new Set(o),l=[];Uy[i]||(Uy[i]=new WeakMap);let u=Uy[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(Og(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Vy(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&Hy.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Wy+=1,()=>{l.forEach(e=>{let t=Vy(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Hy.has(e)&&a&&e.removeAttribute(a),Hy.delete(e)),r||e.removeAttribute(i)}),--Wy,Wy||(By.inert=new WeakMap,By[`aria-hidden`]=new WeakMap,By.none=new WeakMap,Hy=new WeakSet,Uy={})}}function Jy(e,t=!1,n=!1){let r=T_(e[0]).body;return qy(e.concat(Array.from(r.querySelectorAll(`[aria-live]`))),r,t,n)}var Yy=19;function Xy(e){return Yy>=e}function Zy(e){if(!z.isValidElement(e))return null;let t=e,n=t.props;return(Xy(19)?n?.ref:t.ref)??null}function Qy(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function $y(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function eb(e,t){return typeof e==`function`?e(t):e}function tb(e,t){return typeof e==`function`?e(t):e}var nb={};function rb(e,t,n,r,i){let a={...lb(e,nb)};return t&&(a=ab(a,t)),n&&(a=ab(a,n)),r&&(a=ab(a,r)),i&&(a=ab(a,i)),a}function ib(e){if(e.length===0)return nb;if(e.length===1)return lb(e[0],nb);let t={...lb(e[0],nb)};for(let n=1;n<e.length;n+=1)t=ab(t,e[n]);return t}function ab(e,t){return cb(t)?t(e):ob(e,t)}function ob(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Qy(e.style,r);break;case`className`:e[n]=fb(e.className,r);break;default:sb(n,r)?e[n]=ub(e[n],r):e[n]=r}}return e}function sb(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function cb(e){return typeof e==`function`}function lb(e,t){return cb(e)?e(t):e??nb}function ub(e,t){return t?e?n=>{if(pb(n)){let r=n;db(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function db(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function fb(e,t){return t?e?t+` `+e:t:e}function pb(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function mb(e,t,n={}){let r=t.render,i=hb(t,n);return n.enabled===!1?null:gb(e,r,i,n.state??oy)}function hb(e,t={}){let{className:n,style:r,render:i}=e,{state:a=oy,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?eb(n,a):void 0,d=l?tb(r,a):void 0,f=l?$y(a,c):oy,p=l?Qy(f,Array.isArray(s)?ib(s):s)??oy:oy;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=Ey([p.ref,Zy(i),...o]):p.ref=Ty(p.ref,Zy(i),o):Ty(null,null)),l?(u!==void 0&&(p.className=fb(p.className,u)),d!==void 0&&(p.style=Qy(p.style,d)),p):oy}function gb(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=rb(n,t.props);return e.ref=n.ref,z.cloneElement(t,e)}if(e&&typeof e==`string`)return _b(e,n);throw Error(_g(8))}function _b(e,t){return e===`button`?(0,z.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,z.createElement)(`img`,{alt:``,...t,key:t.key}):z.createElement(e,t)}var vb=z.createContext(null),yb=()=>z.useContext(vb),bb=by(`portal`);function xb(e={}){let{ref:t,container:n,componentProps:r=oy,elementProps:i,elementState:a}=e,o=$v(),s=yb()?.portalNode,[c,l]=z.useState(null),[u,d]=z.useState(null),f=z.useRef(null);gg(()=>{if(n===null){f.current&&(f.current=null,d(null),l(null));return}if(o==null)return;let e=(n&&(jg(n)?n:n.current))??s??document.body;if(e==null){f.current&&(f.current=null,d(null),l(null));return}f.current!==e&&(f.current=e,d(null),l(e))},[n,s,o]);let p=mb(`div`,r,{ref:[t,d],state:a,props:[{id:o,[bb]:``},i]});return{portalNode:u,portalSubtree:c&&p?xi.createPortal(p,c):null}}var Sb=z.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:l}=xb({container:r,ref:t,componentProps:e,elementProps:s}),u=z.useRef(null),d=z.useRef(null),f=z.useRef(null),p=z.useRef(null),[m,h]=z.useState(null),g=m?.modal,_=m?.open,v=typeof o==`boolean`?o:!!m&&!m.modal&&m.open&&!!c;z.useEffect(()=>{if(!c||g)return;function e(e){c&&Kv(e)&&(e.type===`focusin`?Jv:qv)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,g]),z.useEffect(()=>{!c||_||Jv(c)},[_,c]);let y=z.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return(0,B.jsxs)(z.Fragment,{children:[l,(0,B.jsxs)(vb.Provider,{value:y,children:[v&&c&&(0,B.jsx)(Ly,{"data-type":`outside`,ref:u,onFocus:e=>{Kv(e,c)?f.current?.focus():Gv(m?m.domReference:null)?.focus()}}),v&&c&&(0,B.jsx)(`span`,{"aria-owns":c.id,style:ly}),c&&xi.createPortal(n,c),v&&c&&(0,B.jsx)(Ly,{"data-type":`outside`,ref:d,onFocus:e=>{Kv(e,c)?p.current?.focus():(Wv(m?m.domReference:null)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,yy(`focus-out`,e.nativeEvent)))}})]})]})});function Cb(e){return e==null?e:`current`in e?e.current:e}function wb(e,t){let n=kg(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Tb=20,Eb=[];function Db(){Eb=Eb.filter(e=>e.isConnected)}function Ob(e){Db(),e&&Og(e)!==`body`&&(Eb.push(e),Eb.length>Tb&&(Eb=Eb.slice(-Tb)))}function kb(){return Db(),Eb[Eb.length-1]}function Ab(e){if(!e)return null;let t=Hv();return Vv(e,t)?e:zv(e,t)[0]||e}function jb(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():Kg(e).display!==`none`}function Mb(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Hv(),r=Bv(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Vv(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Nb(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,getInsideElements:d=()=>[],nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=n_(()=>x.current.floatingContext?.nodeId),C=n_(d),w=a===!1,T=D_(v)&&w,E=Qg(i),D=Qg(a),O=Qg(o),ee=Qg(u),k=iy(h),A=yb(),j=z.useRef(null),M=z.useRef(null),N=z.useRef(!1),te=z.useRef(!1),P=z.useRef(!1),ne=z.useRef(-1),re=z.useRef(``),ie=z.useRef(``),F=Eg(),I=Eg(),ae=Fy(),oe=A!=null,L=k_(y),R=n_((e=L)=>e?zv(e,Hv()):[]),se=n_(e=>{let t=R(e);return E.current.map(()=>t).filter(Boolean).flat()});z.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&x_(L,b_(T_(L)))&&R().length===0&&!T&&M_(e)}let t=T_(L);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,v,L,c,E,T,R,se]),z.useEffect(()=>{if(r||!y)return;function e(e){let t=S_(e),n=R().indexOf(t);n!==-1&&(ne.current=n)}return y.addEventListener(`focusin`,e),()=>{y.removeEventListener(`focusin`,e)}},[r,y,R]),z.useEffect(()=>{if(r||!_)return;let e=T_(L);function t(){P.current=!1}function n(e){let t=S_(e);P.current=!(x_(y,t)||x_(v,t)||x_(A?.portalNode,t)),ie.current=e.pointerType||`keyboard`}function i(){ie.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,y,v,L,_,A]),z.useEffect(()=>{if(r||!l)return;function e(){te.current=!0,I.start(0,()=>{te.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=S_(e);queueMicrotask(()=>{let i=S(),a=g.context.triggerElements,o=!(x_(v,t)||x_(y,t)||x_(t,y)||x_(A?.portalNode,t)||t!=null&&a.hasElement(t)||a.hasMatchingElement(e=>x_(e,t))||t?.hasAttribute(by(`focus-guard`))||k&&(A_(k.nodesRef.current,i).find(e=>x_(e.context?.elements.floating,t)||x_(e.context?.elements.domReference,t))||j_(k.nodesRef.current,i).find(e=>[e.context?.elements.floating,k_(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&L&&Mb(L,E),s&&n!==v&&!jb(r)&&b_(T_(L))===T_(L).body){if(Ng(L)&&(L.focus(),s===`popup`)){ae.request(()=>{L.focus()});return}let e=ne.current,t=R(),n=t[e]||t[t.length-1]||L;Ng(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(T||!c)&&t&&o&&!te.current&&(T||t!==kb())&&(N.current=!0,g.setOpen(!1,yy(hy,e)))})}function n(){P.current||(x.current.insideReactTree=!0,F.start(0,()=>{x.current.insideReactTree=!1}))}let i=Ng(v)?v:null,a=[];if(!(!y&&!i))return i&&(i.addEventListener(`focusout`,t),i.addEventListener(`pointerdown`,e),a.push(()=>{i.removeEventListener(`focusout`,t),i.removeEventListener(`pointerdown`,e)})),y&&(y.addEventListener(`focusout`,t),A&&(y.addEventListener(`focusout`,n,!0),a.push(()=>{y.removeEventListener(`focusout`,n,!0)})),a.push(()=>{y.removeEventListener(`focusout`,t)})),()=>{a.forEach(e=>{e()})}},[r,v,y,L,c,k,A,g,l,s,R,T,S,E,x,F,I,ae]);let ce=z.useRef(null),le=z.useRef(null),ue=Ty(ce,m,A?.beforeInsideRef),de=Ty(le,A?.afterInsideRef);z.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${by(`portal`)}]`)||[]),t=Jy([y,(k?j_(k.nodesRef.current,S()):[]).find(e=>D_(e.context?.elements.domReference||null))?.context?.elements.domReference,...e,...C(),j.current,M.current,ce.current,le.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Cb(p),Cb(f),T?v:null].filter(e=>e!=null),c||T);return()=>{t()}},[_,r,v,y,c,E,A,T,k,S,C,f,p]),gg(()=>{if(!_||r||!Ng(L))return;let e=b_(T_(L));queueMicrotask(()=>{let t=se(L),n=D.current,r=typeof n==`function`?n(ee.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||L:Cb(r),i=i||t[0]||L,!x_(L,e)&&zy(i,{preventScroll:i===L})})},[r,_,L,w,se,D,ee]),gg(()=>{if(r||!L)return;let e=T_(L);Ob(b_(e));function t(e){if(e.open||(re.current=wb(e.nativeEvent,ie.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(N.current=!0),e.reason===`outside-press`)if(e.nested)N.current=!1;else if(P_(e.nativeEvent)||F_(e.nativeEvent))N.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}b.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,jy),oe&&v&&v.insertAdjacentElement(`afterend`,n);function i(){let e=O.current,t=typeof e==`function`?e(re.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=v||kb();return e&&e.isConnected?e:n}let r=v||kb()||n;return Cb(t)||r}return()=>{b.off(`openchange`,t);let r=b_(e),a=x_(y,r)||k&&A_(k.nodesRef.current,S(),!1).some(e=>x_(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Ab(o),i=typeof O.current!=`boolean`;O.current&&!N.current&&Ng(t)&&(!(!i&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,y,L,O,x,b,k,oe,v,S]),z.useEffect(()=>{queueMicrotask(()=>{N.current=!1})},[r]),z.useEffect(()=>{if(r||!_)return;function e(e){S_(e)?.closest(`[data-base-ui-click-trigger]`)&&(te.current=!0)}let t=T_(L);return t.addEventListener(`pointerdown`,e,!0),()=>{t.removeEventListener(`pointerdown`,e,!0)}},[r,_,L]),gg(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,c,_,g,l,v]),gg(()=>{if(!(r||!L))return Mb(L,E),()=>{queueMicrotask(Db)}},[r,L,E]);let fe=!r&&(c?!T:!0)&&(oe||c);return(0,B.jsxs)(z.Fragment,{children:[fe&&(0,B.jsx)(Ly,{"data-type":`inside`,ref:ue,onFocus:e=>{if(c){let e=se();zy(e[e.length-1])}else A?.portalNode&&(N.current=!1,Kv(e,A.portalNode)?Wv(v)?.focus():Cb(p??A.beforeOutsideRef)?.focus())}}),n,fe&&(0,B.jsx)(Ly,{"data-type":`inside`,ref:de,onFocus:e=>{c?zy(se()[0]):A?.portalNode&&(l&&(N.current=!0),Kv(e,A.portalNode)?Gv(v)?.focus():Cb(f??A.afterOutsideRef)?.focus())}})]})}function Pb(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Fb(e){return e!=null&&e.clientX!=null}function Ib(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`,x:l=null,y:u=null}=t,d=z.useRef(!1),f=z.useRef(null),[p,m]=z.useState(),[h,g]=z.useState([]),_=n_((e,t)=>{d.current||o.current.openEvent&&!Fb(o.current.openEvent)||n.set(`positionReference`,Pb(a,{x:e,y:t,axis:c,dataRef:o,pointerType:p}))}),v=n_(e=>{l!=null||u!=null||(r?f.current||g([]):_(e.clientX,e.clientY))}),y=I_(p)?i:r,b=z.useCallback(()=>{if(!y||!s||l!=null||u!=null)return;let e=kg(i);function t(n){x_(i,S_(n))?(e.removeEventListener(`mousemove`,t),f.current=null):_(n.clientX,n.clientY)}if(!o.current.openEvent||Fb(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),f.current=null};return f.current=n,n}n.set(`positionReference`,a)},[y,s,l,u,i,o,a,n,_]);z.useEffect(()=>b(),[b,h]),z.useEffect(()=>{s&&!i&&(d.current=!1)},[s,i]),z.useEffect(()=>{!s&&r&&(d.current=!0)},[s,r]),gg(()=>{s&&(l!=null||u!=null)&&(d.current=!1,_(l,u))},[s,l,u,_]);let x=z.useMemo(()=>{function e(e){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return z.useMemo(()=>s?{reference:x}:{},[s,x])}function Lb(e,t,n){let{reference:r,floating:i}=e,a=Z_(t),o=Q_(t),s=X_(o),c=q_(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(J_(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 Rb(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}=K_(t,e),p=uv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=dv(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=dv(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 zb=50,Bb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Rb},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Lb(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<zb&&(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}=Lb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Vb=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}=K_(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=q_(r),_=Z_(o),v=q_(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[cv(o)]:ev(o)),x=p!==`none`;!d&&x&&b.push(...sv(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=$_(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Z_(t))||T.every(e=>Z_(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Z_(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 Hb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ub(e){return R_.some(t=>e[t]>=0)}var Wb=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=K_(e,t);switch(i){case`referenceHidden`:{let e=Hb(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ub(e)}}}case`escaped`:{let e=Hb(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ub(e)}}}default:return{}}}}},Gb=new Set([`left`,`top`]);async function Kb(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=q_(n),s=J_(n),c=Z_(n)===`y`,l=Gb.has(o)?-1:1,u=a&&c?-1:1,d=K_(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 qb=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 Kb(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}}}}},Jb=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}=K_(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Z_(q_(i)),p=Y_(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=G_(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=G_(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}}}}}},Yb=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}=K_(e,t),u={x:n,y:r},d=Z_(i),f=Y_(d),p=u[f],m=u[d],h=K_(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=Gb.has(q_(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}}}},Xb=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}=K_(e,t),u=await o.detectOverflow(t,l),d=q_(i),f=J_(i),p=Z_(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=z_(h-u[g],v),x=z_(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=B_(u.left,0),t=B_(u.right,0),n=B_(u.top,0),r=B_(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:B_(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:B_(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Zb(e){let t=Kg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ng(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=V_(n)!==a||V_(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Qb(e){return Mg(e)?e:e.contextElement}function $b(e){let t=Qb(e);if(!Ng(t))return U_(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Zb(t),o=(a?V_(n.width):n.width)/r,s=(a?V_(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ex=U_(0);function tx(e){let t=kg(e);return!Wg()||!t.visualViewport?ex:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==kg(e)?!1:t}function rx(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Qb(e),o=U_(1);t&&(r?Mg(r)&&(o=$b(r)):o=$b(e));let s=nx(a,n,r)?tx(a):U_(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=kg(a),t=r&&Mg(r)?kg(r):r,n=e,i=Zg(n);for(;i&&r&&t!==n;){let e=$b(i),t=i.getBoundingClientRect(),r=Kg(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=kg(i),i=Zg(n)}}return dv({width:u,height:d,x:c,y:l})}function ix(e,t){let n=qg(e).scrollLeft;return t?t.left+n:rx(Ag(e)).left+n}function ax(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ix(e,n),y:n.top+t.scrollTop}}function ox(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ag(r),s=t?Lg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=U_(1),u=U_(0),d=Ng(r);if((d||!d&&!a)&&((Og(r)!==`body`||Fg(o))&&(c=qg(r)),d)){let e=rx(r);l=$b(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ax(o,c):U_(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 sx(e){return Array.from(e.getClientRects())}function cx(e){let t=Ag(e),n=qg(e),r=e.ownerDocument.body,i=B_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=B_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ix(e),s=-n.scrollTop;return Kg(r).direction===`rtl`&&(o+=B_(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var lx=25;function ux(e,t){let n=kg(e),r=Ag(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Wg();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ix(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<=lx&&(a-=o)}else l<=lx&&(a+=l);return{width:a,height:o,x:s,y:c}}function dx(e,t){let n=rx(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ng(e)?$b(e):U_(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function fx(e,t,n){let r;if(t===`viewport`)r=ux(e,n);else if(t===`document`)r=cx(Ag(e));else if(Mg(t))r=dx(t,n);else{let n=tx(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return dv(r)}function px(e,t){let n=Jg(e);return n===t||!Mg(n)||Gg(n)?!1:Kg(n).position===`fixed`||px(n,t)}function mx(e,t){let n=t.get(e);if(n)return n;let r=Xg(e,[],!1).filter(e=>Mg(e)&&Og(e)!==`body`),i=null,a=Kg(e).position===`fixed`,o=a?Jg(e):e;for(;Mg(o)&&!Gg(o);){let t=Kg(o),n=Hg(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Fg(o)&&!n&&px(e,o))?r=r.filter(e=>e!==o):i=t,o=Jg(o)}return t.set(e,r),r}function hx(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Lg(t)?[]:mx(t,this._c):[].concat(n),r],o=fx(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=fx(t,a[e],i);s=B_(n.top,s),c=z_(n.right,c),l=z_(n.bottom,l),u=B_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function gx(e){let{width:t,height:n}=Zb(e);return{width:t,height:n}}function _x(e,t,n){let r=Ng(t),i=Ag(t),a=n===`fixed`,o=rx(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=U_(0);function l(){c.x=ix(i)}if(r||!r&&!a)if((Og(t)!==`body`||Fg(i))&&(s=qg(t)),r){let e=rx(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?ax(i,s):U_(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 vx(e){return Kg(e).position===`static`}function yx(e,t){if(!Ng(e)||Kg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ag(e)===n&&(n=n.ownerDocument.body),n}function bx(e,t){let n=kg(e);if(Lg(e))return n;if(!Ng(e)){let t=Jg(e);for(;t&&!Gg(t);){if(Mg(t)&&!vx(t))return t;t=Jg(t)}return n}let r=yx(e,t);for(;r&&Ig(r)&&vx(r);)r=yx(r,t);return r&&Gg(r)&&vx(r)&&!Hg(r)?n:r||Ug(e)||n}var xx=async function(e){let t=this.getOffsetParent||bx,n=this.getDimensions,r=await n(e.floating);return{reference:_x(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sx(e){return Kg(e).direction===`rtl`}var Cx={convertOffsetParentRelativeRectToViewportRelativeRect:ox,getDocumentElement:Ag,getClippingRect:hx,getOffsetParent:bx,getElementRects:xx,getClientRects:sx,getDimensions:gx,getScale:$b,isElement:Mg,isRTL:Sx};function wx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tx(e,t){let n=null,r,i=Ag(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=H_(d),h=H_(i.clientWidth-(u+f)),g=H_(i.clientHeight-(d+p)),_=H_(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:B_(0,z_(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&&!wx(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 Ex(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=Qb(e),u=i||a?[...l?Xg(l):[],...t?Xg(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Tx(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?rx(e):null;c&&g();function g(){let t=rx(e);h&&!wx(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 Dx=qb,Ox=Jb,kx=Vb,Ax=Xb,jx=Wb,Mx=Yb,Nx=(e,t,n)=>{let r=new Map,i={platform:Cx,...n},a={...i.platform,_c:r};return Bb(e,t,{...i,platform:a})},Px=typeof document<`u`?z.useLayoutEffect:function(){};function Fx(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(!Fx(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)&&!Fx(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ix(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lx(e,t){let n=Ix(e);return Math.round(t*n)/n}function Rx(e){let t=z.useRef(e);return Px(()=>{t.current=e}),t}function zx(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]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);Fx(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),T=c!=null,E=Rx(c),D=Rx(i),O=Rx(l),ee=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Nx(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};k.current&&!Fx(w.current,t)&&(w.current=t,xi.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Px(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=z.useRef(!1);Px(()=>(k.current=!0,()=>{k.current=!1}),[]),Px(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ee);ee()}},[b,x,ee,E,T]);let A=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=z.useMemo(()=>({reference:b,floating:x}),[b,x]),M=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=Lx(j.floating,u.x),r=Lx(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ix(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:ee,refs:A,elements:j,floatingStyles:M}),[u,ee,A,j,M])}var Bx=(e,t)=>{let n=Dx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vx=(e,t)=>{let n=Ox(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hx=(e,t)=>({fn:Mx(e).fn,options:[e,t]}),Ux=(e,t)=>{let n=kx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wx=(e,t)=>{let n=Ax(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gx=(e,t)=>{let n=jx(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kx={intentional:`onClick`,sloppy:`onPointerDown`};function qx(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Jx(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`referenceElement`),o=n.useState(`domReferenceElement`),{onOpenChange:s,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f=`sloppy`,referencePress:p=!1,referencePressEvent:m=`sloppy`,ancestorScroll:h=!1,bubbles:g,externalTree:_}=t,v=iy(_),y=n_(typeof d==`function`?d:()=>!1),b=typeof d==`function`?y:d,x=z.useRef(!1),{escapeKey:S,outsidePress:C}=qx(g),w=z.useRef(null),T=Eg(),E=Eg(),D=n_(()=>{E.clear(),c.current.insideReactTree=!1}),O=z.useRef(!1),ee=z.useRef(``),k=n_(e=>{ee.current=e.pointerType}),A=n_(()=>{let e=ee.current,t=e===`pen`||!e?`mouse`:e,n=typeof f==`function`?f():f;return typeof n==`string`?n:n[t]}),j=n_(e=>{if(!r||!l||!u||e.key!==`Escape`||O.current)return;let t=c.current.floatingContext?.nodeId,i=v?A_(v.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=yy(gy,N_(e)?e.nativeEvent:e);n.setOpen(!1,a),!S&&!a.isPropagationAllowed&&e.stopPropagation()}),M=n_(e=>{let t=A();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),N=n_(()=>{c.current.insideReactTree=!0,E.start(0,D)}),te=n_((e,t=!1)=>{if(M(e)){D();return}if(c.current.insideReactTree){D();return}if(A()===`intentional`&&t||typeof b==`function`&&!b(e))return;let r=S_(e),i=`[${by(`inert`)}]`,a=T_(n.select(`floatingElement`)).querySelectorAll(i),o=n.context.triggerElements;if(r&&(o.hasElement(r)||o.hasMatchingElement(e=>x_(e,r))))return;let s=Mg(r)?r:null;for(;s&&!Gg(s);){let e=Jg(s);if(Gg(e)||!Mg(e))break;s=e}if(a.length&&Mg(r)&&!w_(r)&&!x_(r,n.select(`floatingElement`))&&Array.from(a).every(e=>!x_(s,e)))return;if(Ng(r)&&!(`touches`in e)){let t=Gg(r),n=Kg(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let l=c.current.floatingContext?.nodeId,u=v&&A_(v.nodesRef.current,l).some(t=>C_(e,t.context?.elements.floating));if(C_(e,n.select(`floatingElement`))||C_(e,n.select(`domReferenceElement`))||u)return;let d=v?A_(v.nodesRef.current,l):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,yy(py,e)),D()}),P=n_(e=>{A()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!l||C_(e,n.select(`floatingElement`))||C_(e,n.select(`domReferenceElement`))||te(e)}),ne=n_(e=>{if(A()!==`sloppy`||!n.select(`open`)||!l||C_(e,n.select(`floatingElement`))||C_(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}),re=n_(e=>{let t=S_(e);function n(){ne(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),ie=n_(e=>{let t=x.current;if(x.current=!1,T.clear(),e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)return;let n=S_(e);function r(){e.type===`pointerdown`?P(e):te(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),F=n_(e=>{if(A()!==`sloppy`||!w.current||C_(e,n.select(`floatingElement`))||C_(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(te(e),T.clear(),w.current=null)}),I=n_(e=>{let t=S_(e);function n(){F(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),ae=n_(e=>{A()!==`sloppy`||!w.current||C_(e,n.select(`floatingElement`))||C_(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&te(e),T.clear(),w.current=null)}),oe=n_(e=>{let t=S_(e);function n(){ae(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});z.useEffect(()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=S,c.current.__outsidePressBubbles=C;let e=new Tg;function t(e){n.setOpen(!1,yy(uy,e))}function s(){e.clear(),O.current=!0}function d(){e.start(Wg()?5:0,()=>{O.current=!1})}let f=T_(i);f.addEventListener(`pointerdown`,k,!0),u&&(f.addEventListener(`keydown`,j),f.addEventListener(`compositionstart`,s),f.addEventListener(`compositionend`,d)),b&&(f.addEventListener(`click`,ie,!0),f.addEventListener(`pointerdown`,ie,!0),f.addEventListener(`touchstart`,re,!0),f.addEventListener(`touchmove`,I,!0),f.addEventListener(`touchend`,oe,!0),f.addEventListener(`mousedown`,ie,!0));let p=[];return h&&(Mg(o)&&(p=Xg(o)),Mg(i)&&(p=p.concat(Xg(i))),!Mg(a)&&a&&a.contextElement&&(p=p.concat(Xg(a.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,k,!0),u&&(f.removeEventListener(`keydown`,j),f.removeEventListener(`compositionstart`,s),f.removeEventListener(`compositionend`,d)),b&&(f.removeEventListener(`click`,ie,!0),f.removeEventListener(`pointerdown`,ie,!0),f.removeEventListener(`touchstart`,re,!0),f.removeEventListener(`touchmove`,I,!0),f.removeEventListener(`touchend`,oe,!0),f.removeEventListener(`mousedown`,ie,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear()}},[c,i,a,o,u,b,r,s,h,l,S,C,j,te,ie,P,re,I,oe,k,n]),z.useEffect(D,[b,D]);let L=z.useMemo(()=>({onKeyDown:j,...p&&{[Kx[m]]:e=>{n.setOpen(!1,yy(`trigger-press`,e.nativeEvent))},...m!==`intentional`&&{onClick(e){n.setOpen(!1,yy(`trigger-press`,e.nativeEvent))}}}}),[j,n,p,m]),R=n_(e=>{let t=S_(e.nativeEvent);!x_(n.select(`floatingElement`),t)||e.button!==0||(x.current=!0)}),se=z.useMemo(()=>({onKeyDown:j,onPointerDown:R,onMouseDown:R,onMouseUp:R,onClickCapture:N,onMouseDownCapture:N,onPointerDownCapture:N,onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[j,R,N]);return z.useMemo(()=>l?{reference:L,floating:se,trigger:L}:{},[l,L,se])}var Yx=Symbol(`NOT_FOUND`);function Xx(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Zx(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function Qx(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var $x=e=>Array.isArray(e)?e:[e];function eS(e){let t=Array.isArray(e[0])?e[0]:e;return Qx(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function tS(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function nS(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Yx},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function rS(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return Yx}function i(t,i){r(t)===Yx&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var iS=(e,t)=>e===t;function aS(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function oS(e,t){let{equalityCheck:n=iS,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=aS(n),o=0,s=r<=1?nS(a):rS(r,a);function c(){let t=s.get(arguments);if(t===Yx){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var sS=class{constructor(e){this.value=e}deref(){return this.value}},cS=typeof WeakRef<`u`?WeakRef:sS,lS=0,uS=1;function dS(){return{s:lS,v:void 0,o:null,p:null}}function fS(e,t={}){let n=dS(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=dS(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=dS(),e.set(n,t)):t=r}}let s=t,c;if(t.s===uS)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new cS(c):c}return s.s=uS,s.v=c,c}return o.clearCache=()=>{n=dS(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function pS(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Xx(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=fS,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=$x(c),p=$x(u),m=eS(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=tS(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var mS=pS(fS),hS=Object.assign((e,t=mS)=>{Zx(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>hS});pS({memoize:oS,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var gS=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(_g(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},_S=oi(),vS=Xy(19)?bS:xS;function yS(e,t,n,r,i){return vS(e,t,n,r,i)}function bS(e,t,n,r,i){let a=z.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,_S.useSyncExternalStore)(e.subscribe,a,a)}function xS(e,t,n,r,i){return(0,ci.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var SS=class e{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(t){for(let n in t)if(!Object.is(this.state[n],t[n])){e.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||e.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){let t={...this.state};e.prototype.setState.call(this,t)}},CS=class extends SS{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,t){z.useDebugValue(e),gg(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){gg(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){gg(()=>{this.update(e)},Object.values(e))}useControlledProp(e,t,n){z.useDebugValue(e);let r=t!==void 0;this.controlledValues.has(e)||(this.controlledValues.set(e,r),!r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})),gg(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n,r])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.setState({...this.state,...t})}select=(e,t,n,r)=>{let i=this.selectors[e];return i(this.state,t,n,r)};useState=(e,t,n,r)=>{z.useDebugValue(e);let i=this.selectors[e];return yS(this,i,t,n,r)};useContextCallback(e,t){z.useDebugValue(e);let n=n_(t??ay);this.context[e]=n}useStateSetter(e){let t=z.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},wS={open:gS(e=>e.open),domReferenceElement:gS(e=>e.domReferenceElement),referenceElement:gS(e=>e.positionReference??e.referenceElement),floatingElement:gS(e=>e.floatingElement),floatingId:gS(e=>e.floatingId)},TS=class extends CS{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:ey(),nested:t,noEmit:n,triggerElements:i},wS)}setOpen=(e,t)=>{if((!e||!this.state.open||L_(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function ES(e,t=!1,n=!1){let[r,i]=z.useState(e&&t?`idle`:void 0),[a,o]=z.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),gg(()=>{if(!e&&a&&r!==`ending`&&n){let e=Py.request(()=>{i(`ending`)});return()=>{Py.cancel(e)}}},[e,a,r,n]),gg(()=>{if(!e||t)return;let n=Py.request(()=>{xi.flushSync(()=>{i(void 0)})});return()=>{Py.cancel(n)}},[t,e]),gg(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Py.request(()=>{i(`idle`)});return()=>{Py.cancel(n)}},[t,e,a,i,r]),z.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}function DS(e,t=!1,n=!0){let r=Fy();return n_((i,a=null)=>{r.cancel();let o=Cb(e);o!=null&&(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED?i():r.request(()=>{function e(){o&&Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{a!=null&&a.aborted||xi.flushSync(i)}).catch(()=>{if(n){if(a!=null&&a.aborted)return;xi.flushSync(i)}else o.getAnimations().length>0&&o.getAnimations().some(e=>e.pending||e.playState!==`finished`)&&e()})}t?r.request(e):e()}))})}function OS(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Qg(n),o=n_(i),s=DS(r,n);z.useEffect(()=>{t&&s(()=>{n===a.current&&o()})},[t,n,o,s,a])}function kS(e,t){let n=z.useRef(null);return z.useCallback(r=>{if(e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),r!==null))return n.current=e,t.context.triggerElements.add(e,r),()=>{n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null)}},[t,e])}function AS(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=kS(e,n),o=n_(t=>{let i=a(t);return t!==null&&n.select(`open`)&&n.select(`activeTriggerId`)==null&&n.update({activeTriggerId:e,activeTriggerElement:t,...r}),i});return gg(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function jS(e){let t=e.useState(`open`);gg(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function MS(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=ES(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=n_(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return OS({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var NS=class{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}};function PS(){return new TS({open:!1,floatingElement:null,referenceElement:null,triggerElements:new NS,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function FS(){return{open:!1,mounted:!1,transitionStatus:`idle`,floatingRootContext:PS(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:oy,inactiveTriggerProps:oy,popupProps:oy}}var IS={open:gS(e=>e.open),mounted:gS(e=>e.mounted),transitionStatus:gS(e=>e.transitionStatus),floatingRootContext:gS(e=>e.floatingRootContext),preventUnmountingOnClose:gS(e=>e.preventUnmountingOnClose),payload:gS(e=>e.payload),activeTriggerId:gS(e=>e.activeTriggerId),activeTriggerElement:gS(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:gS((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:gS((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:gS((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:gS((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:gS(e=>e.popupProps),popupElement:gS(e=>e.popupElement),positionerElement:gS(e=>e.positionerElement)};function LS(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=$v(),a=ry()!=null,o=xg(()=>new TS({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new NS,floatingId:i,nested:a,noEmit:e.noEmit||!1})).current;return gg(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Mg(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=e.noEmit||!1,o}function RS(e={}){let{nodeId:t,externalTree:n}=e,r=LS(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=z.useState(null),c=z.useRef(null),l=iy(n);gg(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=zx({...e,elements:{...a,...o&&{reference:o}}}),d=z.useCallback(e=>{let t=Mg(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=z.useState(null),[m,h]=z.useState(null);i.useSyncedValue(`referenceElement`,f),i.useSyncedValue(`domReferenceElement`,Mg(f)?f:null),i.useSyncedValue(`floatingElement`,m);let g=z.useCallback(e=>{(Mg(e)||e===null)&&(c.current=e,p(e)),(Mg(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!Mg(e))&&u.refs.setReference(e)},[u.refs,p]),_=z.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),v=z.useMemo(()=>({...u.refs,setReference:g,setFloating:_,setPositionReference:d,domReference:c}),[u.refs,g,_,d]),y=z.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),b=i.useState(`open`),x=i.useState(`floatingId`),S=z.useMemo(()=>({...u,dataRef:i.context.dataRef,open:b,onOpenChange:i.setOpen,events:i.context.events,floatingId:x,refs:v,elements:y,nodeId:t,rootStore:i}),[u,v,y,t,i,b,x]);return gg(()=>{i.context.dataRef.current.floatingContext=S;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),z.useMemo(()=>({...u,context:S,refs:v,elements:y,rootStore:i}),[u,v,y,S,i])}function zS(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=$v(),o=ry()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=xg(()=>new TS({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return gg(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};Mg(c)&&(e.domReferenceElement=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var BS=p_&&d_;function VS(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,visibleOnly:o=!0}=t,s=z.useRef(!1),c=Eg(),l=z.useRef(!0);z.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=kg(e);function r(){!n.select(`open`)&&Ng(e)&&e===b_(T_(e))&&(s.current=!0)}function i(){l.current=!0}function o(){l.current=!1}return t.addEventListener(`blur`,r),BS&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),BS&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),z.useEffect(()=>{if(!a)return;function e(e){(e.reason===`trigger-press`||e.reason===`escape-key`)&&(s.current=!0)}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a]);let u=z.useMemo(()=>({onMouseLeave(){s.current=!1},onFocus(e){if(s.current)return;let t=S_(e.nativeEvent);if(o&&Mg(t)){if(BS&&!e.relatedTarget){if(!l.current&&!E_(t))return}else if(!O_(t))return}n.setOpen(!0,yy(fy,e.nativeEvent,e.currentTarget))},onBlur(e){s.current=!1;let t=e.relatedTarget,r=e.nativeEvent,a=Mg(t)&&t.hasAttribute(by(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;c.start(0,()=>{let o=n.select(`domReferenceElement`),s=b_(o?o.ownerDocument:document);!t&&s===o||x_(i.current.floatingContext?.refs.floating.current,s)||x_(o,s)||a||n.context.triggerElements.hasElement(e.relatedTarget)||n.setOpen(!1,yy(fy,r))})}}),[i,n,o,c]);return z.useMemo(()=>a?{reference:u,trigger:u}:{},[a,u])}var HS=by(`safe-polygon`),US=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${y_}`;function WS(e){return e?!!e.closest(US):!1}function GS(e){let t=z.useRef(void 0),n=z.useRef(!1),r=z.useRef(void 0),i=z.useRef(!0),a=z.useRef(!1),o=z.useRef(()=>{}),s=z.useRef(!1),c=Eg(),l=Eg(),u=z.useRef(void 0);return z.useMemo(()=>{let d=e.context.dataRef.current;return d.hoverInteractionState||={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:i,performedPointerEventsMutationRef:a,unbindMouseMoveRef:o,restTimeoutPendingRef:s,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u},d.hoverInteractionState},[e,t,n,r,i,a,o,s,c,l,u])}var KS=new Set([`click`,`mousedown`]);function qS(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:d,handlerRef:f,performedPointerEventsMutationRef:p,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:g,handleCloseOptionsRef:_}=GS(n),v=iy(l),y=ry(),b=n_(()=>d.current?!0:o.current.openEvent?KS.has(o.current.openEvent.type):!1),x=n_(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),S=z.useCallback((e,t=!0)=>{let r=JS(c,u.current);r&&!f.current?g.start(r,()=>n.setOpen(!1,yy(dy,e))):t&&(g.clear(),n.setOpen(!1,yy(dy,e)))},[c,f,n,u,g]),C=n_(()=>{m.current(),f.current=void 0}),w=n_(()=>{if(p.current){let e=T_(i).body;e.style.pointerEvents=``,e.removeAttribute(HS),p.current=!1}}),T=n_(e=>{if(!WS(S_(e))){d.current=!1;return}d.current=!0});gg(()=>{r||(u.current=void 0,h.current=!1,d.current=!1,C(),w())},[r,u,h,d,C,w]),z.useEffect(()=>()=>{C()},[C]),z.useEffect(()=>w,[w]),gg(()=>{if(s&&r&&_.current?.blockPointerEvents&&x()&&Mg(a)&&i){p.current=!0;let e=T_(i).body;e.setAttribute(HS,``);let t=a,n=i,r=v?.nodesRef.current.find(e=>e.id===y)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[s,r,a,i,_,x,v,y,p]),z.useEffect(()=>{if(!s)return;function e(e){if(b()||!o.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(w(),C(),b()||S(e))}function t(e){g.clear(),w(),f.current?.(e),C()}function r(e){b()||S(e,!1)}let a=i;return a&&(a.addEventListener(`mouseleave`,e),a.addEventListener(`mouseenter`,t),a.addEventListener(`mouseleave`,r),a.addEventListener(`pointerdown`,T,!0)),()=>{a&&(a.removeEventListener(`mouseleave`,e),a.removeEventListener(`mouseenter`,t),a.removeEventListener(`mouseleave`,r),a.removeEventListener(`pointerdown`,T,!0))}})}function JS(e,t){return t&&!I_(t)?0:typeof e==`function`?e():e}function YS(e){return typeof e==`function`?e():e}var XS={current:null};function ZS(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=XS,externalTree:f,isActiveTrigger:p=!0}=t,m=iy(f),{pointerTypeRef:h,interactedInsideRef:g,handlerRef:_,blockMouseMoveRef:v,performedPointerEventsMutationRef:y,unbindMouseMoveRef:b,restTimeoutPendingRef:x,openChangeTimeout:S,restTimeout:C,handleCloseOptionsRef:w}=GS(n),T=Qg(s),E=Qg(o),D=Qg(l);p&&(w.current=T.current?.__options);let O=n_(()=>g.current?!0:r.current.openEvent?[`click`,`mousedown`].includes(r.current.openEvent.type):!1),ee=z.useCallback((e,t=!0)=>{let r=xy(E.current,`close`,h.current);r&&!_.current?S.start(r,()=>n.setOpen(!1,yy(dy,e))):t&&(S.clear(),n.setOpen(!1,yy(dy,e)))},[E,_,n,h,S]),k=n_(()=>{b.current(),_.current=void 0}),A=n_(()=>{if(y.current){let e=T_(n.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(HS),y.current=!1}});z.useEffect(()=>{if(!a)return;function e(e){e.open||(S.clear(),C.clear(),v.current=!0,x.current=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,S,C,v,x]);let j=n_(e=>{if(O()||!r.current.floatingContext)return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||T.current?.({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){A(),k(),O()||ee(e)}})(e)});return z.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!Mg(e))return;function t(e){if(S.clear(),v.current=!1,c&&!I_(h.current)||YS(D.current)>0&&!xy(E.current,`open`))return;let t=xy(E.current,`open`,h.current),r=n.select(`domReferenceElement`),i=n.context.triggerElements,a=(i.hasElement(e.target)||i.hasMatchingElement(t=>x_(t,e.target)))&&(!r||!x_(r,e.target)),o=e.currentTarget??null;t?S.start(t,()=>{n.select(`open`)||n.setOpen(!0,yy(dy,e,o))}):(!n.select(`open`)||a)&&n.setOpen(!0,yy(dy,e,o))}function i(e){if(O()){A();return}b.current();let t=T_(n.select(`domReferenceElement`));C.clear(),x.current=!1;let i=n.context.triggerElements;if(!(e.relatedTarget&&i.hasElement(e.relatedTarget))){if(T.current&&r.current.floatingContext){n.select(`open`)||S.clear(),_.current=T.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){A(),k(),O()||ee(e,!0)}});let i=_.current;i(e),t.addEventListener(`mousemove`,i),b.current=()=>{t.removeEventListener(`mousemove`,i)};return}(h.current!==`touch`||!x_(n.select(`floatingElement`),e.relatedTarget))&&ee(e)}}function o(e){j(e)}return n.select(`open`)&&e.addEventListener(`mouseleave`,o),u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`mouseleave`,o),u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[k,A,v,r,E,ee,n,a,T,j,p,O,c,u,h,D,C,x,S,d,m,b,_]),z.useMemo(()=>{function e(e){h.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.context.triggerElements,o=n.select(`open`),s=(a.hasElement(e.target)||a.hasMatchingElement(t=>x_(t,e.target)))&&(!i||!x_(i,e.target));if(c&&!I_(h.current)||o&&!s||YS(D.current)===0||!s&&x.current&&e.movementX**2+e.movementY**2<2)return;C.clear();function l(){!v.current&&(!o||s)&&n.setOpen(!0,yy(dy,t,r))}h.current===`touch`?xi.flushSync(()=>{l()}):s&&o?l():(x.current=!0,C.start(YS(D.current),l))}}},[v,c,n,h,D,C,x])}function QS(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=z.useCallback(t=>$S(t,e,`reference`),t),o=z.useCallback(t=>$S(t,e,`floating`),n),s=z.useCallback(t=>$S(t,e,`item`),r),c=z.useCallback(t=>$S(t,e,`trigger`),i);return z.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function $S(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[v_]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&eC(a,s,i,r)}return eC(a,e,i,r),a}function eC(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var tC=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function nC(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{enabled:s=!0,role:c=`dialog`}=t,l=$v(),u=a?.id||l,d=z.useMemo(()=>k_(o)?.id||i,[o,i]),f=tC.get(c)??c,p=ry()!=null,m=z.useMemo(()=>f===`tooltip`||c===`label`?oy:{"aria-haspopup":f===`alertdialog`?`dialog`:f,"aria-expanded":`false`,...f===`listbox`&&{role:`combobox`},...f===`menu`&&p&&{role:`menuitem`},...c===`select`&&{"aria-autocomplete":`none`},...c===`combobox`&&{"aria-autocomplete":`list`}},[f,p,c]),h=z.useMemo(()=>f===`tooltip`||c===`label`?{[`aria-${c===`label`?`labelledby`:`describedby`}`]:r?d:void 0}:{...m,"aria-expanded":r?`true`:`false`,"aria-controls":r?d:void 0,...f===`menu`&&{id:u}},[f,d,r,u,c,m]),g=z.useMemo(()=>{let e={id:d,...f&&{role:f}};return f===`tooltip`||c===`label`?e:{...e,...f===`menu`&&{"aria-labelledby":u}}},[f,d,u,c]),_=z.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${d}-fui-option`}};switch(c){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[d,c]);return z.useMemo(()=>s?{reference:h,floating:g,item:_,trigger:m}:{},[s,h,g,m,_])}function rC(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function iC(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function aC(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new Tg,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=S_(f),v=f.type===`mouseleave`,y=x_(s.floating,_),b=x_(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,E=iC(g,x),D=S.width>x.width,O=S.height>x.height,ee=(D?x:S).left,k=(D?x:S).right,A=(O?x:S).top,j=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&Mg(f.relatedTarget)&&x_(s.floating,f.relatedTarget)||d&&A_(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let M=[];switch(C){case`top`:M=[[ee,x.top+1],[ee,S.bottom-1],[k,S.bottom-1],[k,x.top+1]];break;case`bottom`:M=[[ee,S.top+1],[ee,x.bottom-1],[k,x.bottom-1],[k,S.top+1]];break;case`left`:M=[[S.right-1,j],[S.right-1,A],[x.left+1,A],[x.left+1,j]];break;case`right`:M=[[x.right-1,j],[x.right-1,A],[S.left+1,A],[S.left+1,j]];break;default:}function N([e,n]){switch(C){case`top`:return[[D?e+t/2:w?e+t*4:e-t*4,n+t+1],[D?e-t/2:w?e+t*4:e-t*4,n+t+1],...[[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]]];case`bottom`:return[[D?e+t/2:w?e+t*4:e-t*4,n-t],[D?e-t/2:w?e+t*4:e-t*4,n-t],...[[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]]];case`left`:{let r=[e+t+1,O?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,O?n-t/2:T?n+t*4:n-t*4];return[...[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom]],r,i]}case`right`:return[[e-t,O?n+t/2:T?n+t*4:n-t*4],[e-t,O?n-t/2:T?n+t*4:n-t*4],...[[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]];default:return[]}}if(!rC([m,h],M)){if(a&&!E)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}rC([m,h],N([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}var oC={...IS,disabled:gS(e=>e.disabled),instantType:gS(e=>e.instantType),isInstantPhase:gS(e=>e.isInstantPhase),trackCursorAxis:gS(e=>e.trackCursorAxis),disableHoverablePopup:gS(e=>e.disableHoverablePopup),lastOpenChangeReason:gS(e=>e.openChangeReason),closeDelay:gS(e=>e.closeDelay)},sC=class e extends CS{constructor(e){super({...cC(),...e},{popupRef:z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new NS},oC)}setOpen=(e,t)=>{let n=t.reason,r=n===dy,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?xi.flushSync(o):o()};static useStore(t,n){let r=xg(()=>t??new e(n)).current,i=zS({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}};function cC(){return{...FS(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function lC(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=sC.useStore(l?.store,{open:r??n,activeTriggerId:u===void 0?d:u});p.useControlledProp(`open`,r,n),p.useControlledProp(`activeTriggerId`,u,d),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=p.useState(`activeTriggerId`),g=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});let _=!t&&m;gg(()=>{m&&t&&p.setOpen(!1,yy(_y))},[m,t,p]),p.useSyncedValue(`disabled`,t),jS(p);let{forceUnmount:v,transitionStatus:y}=MS(_,p),b=p.useState(`isInstantPhase`),x=p.useState(`instantType`),S=p.useState(`lastOpenChangeReason`),C=z.useRef(null);gg(()=>{y===`ending`&&S===`none`||y!==`ending`&&b?(x!==`delay`&&(C.current=x),p.set(`instantType`,`delay`)):C.current!==null&&(p.set(`instantType`,C.current),C.current=null)},[y,b,S,x,p]),gg(()=>{_&&(h??p.set(`payload`,void 0))},[p,h,_]);let w=z.useCallback(()=>{p.setOpen(!1,uC(p,vy))},[p]);z.useImperativeHandle(o,()=>({unmount:v,close:w}),[v,w]);let T=p.useState(`floatingRootContext`),{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=QS([VS(T,{enabled:!t}),Jx(T,{enabled:!t,referencePress:!0}),Ib(T,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),ee=z.useMemo(()=>E(),[E]),k=z.useMemo(()=>O(),[O]),A=z.useMemo(()=>D(),[D]);return p.useSyncedValues({floatingRootContext:T,activeTriggerProps:ee,inactiveTriggerProps:k,popupProps:A}),(0,B.jsx)(vg.Provider,{value:p,children:typeof f==`function`?f({payload:g}):f})}function uC(e,t){let n=yy(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var dC=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),fC={[dC.startingStyle]:``},pC={[dC.endingStyle]:``},mC={transitionStatus(e){return e===`starting`?fC:e===`ending`?pC:null}},hC=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=dC.startingStyle]=`startingStyle`,e[e.endingStyle=dC.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e}({}),gC=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),_C={[gC.popupOpen]:``};gC.popupOpen,gC.pressed;var vC={[hC.open]:``},yC={[hC.closed]:``},bC={[hC.anchorHidden]:``},xC={open(e){return e?_C:null}},SC={open(e){return e?vC:yC},anchorHidden(e){return e?bC:null}};function CC(e){return $v(e,`base-ui`)}var wC=z.createContext(void 0);function TC(){return z.useContext(wC)}var EC=z.forwardRef(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeDelay:c,id:l,...u}=e,d=yg(!0),f=i?.store??d;if(!f)throw Error(_g(82));let p=CC(l),m=f.useState(`isTriggerActive`,p),h=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,p),_=z.useRef(null),v=s??600,y=c??0,{registerTrigger:b,isMountedByThisTrigger:x}=AS(p,_,f,{payload:a,closeDelay:y}),S=TC(),{delayRef:C,isInstantPhase:w,hasProvider:T}=wy(h,{open:g});f.useSyncedValue(`isInstantPhase`,w);let E=f.useState(`disabled`),D=o??E,O=f.useState(`trackCursorAxis`),ee=f.useState(`disableHoverablePopup`),k=ZS(h,{enabled:!D,mouseOnly:!0,move:!1,handleClose:!ee&&O!==`both`?aC():null,restMs(){let e=S?.delay,t=typeof C.current==`object`?C.current.open:void 0,n=v;return T&&(n=t===0?0:s??e??v),n},delay(){let e=typeof C.current==`object`?C.current.close:void 0,t=y;return c==null&&T&&(t=e),{close:t}},triggerElementRef:_,isActiveTrigger:m}),A=z.useMemo(()=>({open:g}),[g]),j=f.useState(`triggerProps`,x);return mb(`button`,e,{state:A,ref:[t,b,_],props:[k,j,{id:p},u],stateAttributesMapping:xC})}),DC=z.createContext(void 0);function OC(){let e=z.useContext(DC);if(e===void 0)throw Error(_g(70));return e}var kC=z.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=xb({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,B.jsxs)(z.Fragment,{children:[c,s&&xi.createPortal(n,s)]})}),AC=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return yg().useState(`mounted`)||n?(0,B.jsx)(DC.Provider,{value:n,children:(0,B.jsx)(kC,{ref:t,...r})}):null}),jC=z.createContext(void 0);function MC(){let e=z.useContext(jC);if(e===void 0)throw Error(_g(71));return e}var NC=z.createContext(void 0);function PC(){return z.useContext(NC)?.direction??`ltr`}var FC=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,offsetParent:d=`real`}=K_(e,t)||{};if(l==null)return{};let f=uv(u),p={x:n,y:r},m=Q_(i),h=X_(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),ee=D,k=w-g[h]-O,A=w/2-g[h]/2+T,j=G_(ee,A,k),M=!c.arrow&&J_(i)!=null&&A!==j&&a.reference[h]/2-(A<ee?D:O)-g[h]/2<0,N=M?A<ee?A-ee:A-k:0;return{[m]:p[m]+N,data:{[m]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),IC=(e,t)=>({...FC(e),options:[e,t]}),LC={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Gx().fn(e)).data?.referenceHidden||a}}}},RC={sideX:`left`,sideY:`top`},zC={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=kg(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:RC};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=Iy(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=q_(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:RC.sideX,g=f===`top`?`bottom`:RC.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function BC(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function VC(e,t,n){let{rects:r,placement:i}=e;return{side:BC(t,q_(i),n),align:J_(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function HC(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=z.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=n_(E),O=E?D:t,ee=Qg(t),k=PC()===`rtl`,A=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":k?`left`:`right`,"inline-start":k?`right`:`left`}[r],j=a===`center`?A:`${A}-${a}`,M=c,N=+(r===`bottom`),te=+(r===`top`),P=+(r===`right`),ne=+(r===`left`);typeof M==`number`?M={top:M+N,right:M+ne,bottom:M+te,left:M+P}:M&&={top:(M.top||0)+N,right:(M.right||0)+ne,bottom:(M.bottom||0)+te,left:(M.left||0)+P};let re={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:M},ie=z.useRef(null),F=Qg(i),I=Qg(o),ae=[Bx(e=>{let t=VC(e,r,k),n=typeof F.current==`function`?F.current(t):F.current,i=typeof I.current==`function`?I.current(t):I.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,k,r])],oe=w===`none`&&C!==`shift`,L=!oe&&(l||g||C===`shift`),R=C===`none`?null:Ux({...re,padding:{top:M.top+1,right:M.right+1,bottom:M.bottom+1,left:M.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`?`alignment`:!1,fallbackAxisSideDirection:T}),se=oe?null:Vx(e=>{let t=Iy(e.elements.floating).documentElement;return{...re,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:L,limiter:l||g?void 0:Hx(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=Z_(q_(e.placement)),i=r===`y`?t:n,a=r===`y`?M.left+M.right:M.top+M.bottom;return{offset:i/2+a/2}})}},[re,l,g,M,w]);C===`shift`||w===`shift`||a===`center`?ae.push(se,R):ae.push(R,se),ae.push(Wx({...re,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}}),IC(()=>({element:ie.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=q_(a),l=Z_(c),u=ie.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(VC(e,r,k)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,L&&l===`y`&&b?S:x),{}}},LC,v),gg(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let ce=z.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:le,elements:ue,x:de,y:fe,middlewareData:pe,update:me,placement:he,context:ge,isPositioned:_e,floatingStyles:ve}=RS({rootContext:p,placement:j,middleware:ae,strategy:n,whileElementsMounted:f?void 0:(...e)=>Ex(...e,ce),nodeId:_,externalTree:b}),{sideX:ye,sideY:be}=pe.adaptiveOrigin||RC,xe=_e?n:`fixed`,Se=z.useMemo(()=>v?{position:xe,[ye]:de,[be]:fe}:{position:xe,...ve},[v,xe,ye,de,be,fe,ve]),Ce=z.useRef(null);gg(()=>{if(!m)return;let e=ee.current,t=typeof e==`function`?e():e,n=(UC(t)?t.current:t)||null;n!==Ce.current&&(le.setPositionReference(n),Ce.current=n)},[m,le,O,ee]),z.useEffect(()=>{if(!m)return;let e=ee.current;typeof e!=`function`&&UC(e)&&e.current!==Ce.current&&(le.setPositionReference(e.current),Ce.current=e.current)},[m,le,O,ee]),z.useEffect(()=>{if(f&&m&&ue.domReference&&ue.floating)return Ex(ue.domReference,ue.floating,me,ce)},[f,m,ue,me,ce]);let we=q_(he),Te=BC(r,we,k),Ee=J_(he)||`center`,De=!!pe.hide?.referenceHidden;gg(()=>{y&&m&&_e&&S(we)},[y,m,_e,we]);let Oe=z.useMemo(()=>({position:`absolute`,top:pe.arrow?.y,left:pe.arrow?.x}),[pe.arrow]),ke=pe.arrow?.centerOffset!==0;return z.useMemo(()=>({positionerStyles:Se,arrowStyles:Oe,arrowRef:ie,arrowUncentered:ke,side:Te,align:Ee,physicalSide:we,anchorHidden:De,refs:le,context:ge,isPositioned:_e,update:me}),[Se,Oe,ie,ke,Te,Ee,we,De,le,ge,_e,me])}function UC(e){return e!=null&&`current`in e}function WC(e){return e===`starting`?sy:oy}var GC=z.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=cy,...g}=e,_=yg(),v=OC(),y=_.useState(`open`),b=_.useState(`mounted`),x=_.useState(`trackCursorAxis`),S=_.useState(`disableHoverablePopup`),C=_.useState(`floatingRootContext`),w=_.useState(`instantType`),T=_.useState(`transitionStatus`),E=HC({anchor:i,positionMethod:a,floatingRootContext:C,mounted:b,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:h,adaptiveOrigin:zC}),D=z.useMemo(()=>{let e={};return(!y||x===`both`||S)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!b,style:{...E.positionerStyles,...e}}},[y,x,S,b,E.positionerStyles]),O=z.useMemo(()=>({open:y,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:x===`none`?w:`tracking-cursor`}),[y,E.side,E.align,E.anchorHidden,x,w]),ee=z.useMemo(()=>({...O,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[O,E.arrowRef,E.arrowStyles,E.arrowUncentered]),k=mb(`div`,e,{state:O,props:[D,WC(T),g],ref:[t,_.useStateSetter(`positionerElement`)],stateAttributesMapping:SC});return(0,B.jsx)(jC.Provider,{value:ee,children:k})});function KC(e){let t=Kg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ng(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(V_(n)!==a||V_(r)!==o)&&(n=a,r=o),{width:n,height:r}}var qC=typeof ResizeObserver<`u`,JC=()=>!0;function YC(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=JC,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=z.useRef(!0),d=DS(t,!0,!1),f=Fy(),p=z.useRef(null),m=n_(o),h=n_(s),g=z.useMemo(()=>{let e=c===`top`,t=c===`left`;return l===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:oy},[c,l]);gg(()=>{if(!i||!a()||!qC){u.current=!0,p.current=null;return}if(!t||!n)return;Object.entries(g).forEach(([e,n])=>{t.style.setProperty(e,n)});let e=new ResizeObserver(e=>{let t=e[0];t&&(p.current===null?p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)}:(p.current.width=Math.ceil(t.borderBoxSize[0].inlineSize),p.current.height=Math.ceil(t.borderBoxSize[0].blockSize)))});e.observe(t),t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`);let r=XC(t,`position`,`static`),o=XC(t,`transform`,`none`),s=XC(t,`scale`,`1`),c=XC(n,`--available-width`,`max-content`),l=XC(n,`--available-height`,`max-content`);if(m?.(),u.current||p.current===null){n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let i=KC(t);return n.style.setProperty(`--positioner-width`,`${i.width}px`),n.style.setProperty(`--positioner-height`,`${i.height}px`),r(),o(),s(),c(),l(),h?.(null,i),u.current=!1,()=>{e.disconnect()}}t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`),n.style.setProperty(`--positioner-width`,`max-content`),n.style.setProperty(`--positioner-height`,`max-content`);let _=KC(t);t.style.setProperty(`--popup-width`,`${p.current.width}px`),t.style.setProperty(`--popup-height`,`${p.current.height}px`),r(),o(),c(),l(),h?.(p.current,_),n.style.setProperty(`--positioner-width`,`${_.width}px`),n.style.setProperty(`--positioner-height`,`${_.height}px`);let v=new AbortController;return f.request(()=>{t.style.setProperty(`--popup-width`,`${_.width}px`),t.style.setProperty(`--popup-height`,`${_.height}px`),d(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},v.signal)}),()=>{e.disconnect(),v.abort(),f.cancel()}},[r,t,n,d,f,a,i,m,h,g])}function XC(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}var ZC={...SC,...mC},QC=z.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=yg(),{side:o,align:s}=MC(),c=a.useState(`open`),l=a.useState(`mounted`),u=a.useState(`instantType`),d=a.useState(`transitionStatus`),f=a.useState(`popupProps`),p=a.useState(`payload`),m=a.useState(`popupElement`),h=a.useState(`positionerElement`),g=a.useState(`floatingRootContext`),_=PC();OS({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});function v(){g.context.events.emit(`measure-layout`)}function y(e,t){g.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}YC({popupElement:m,positionerElement:h,mounted:l,content:p,enabled:()=>a.context.triggerElements.size>1,onMeasureLayout:v,onMeasureLayoutComplete:y,side:o,direction:_});let b=a.useState(`disabled`),x=a.useState(`closeDelay`);return qS(g,{enabled:!b,closeDelay:x}),mb(`div`,e,{state:z.useMemo(()=>({open:c,side:o,align:s,instant:u,transitionStatus:d}),[c,o,s,u,d]),ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[f,WC(d),i],stateAttributesMapping:ZC})}),$C=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=z.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=z.useMemo(()=>({open:t,close:n}),[t,n]);return(0,B.jsx)(wC.Provider,{value:i,children:(0,B.jsx)(Cy,{delay:a,timeoutMs:r,children:e.children})})};function ew(e){return Xy(19)?e:e?`true`:void 0}var tw=$C,nw=lC,rw=EC;function iw({className:e,children:t,...n}){return(0,B.jsx)(AC,{children:(0,B.jsx)(GC,{sideOffset:6,children:(0,B.jsx)(QC,{className:ug(`z-50 overflow-hidden rounded-sm border border-hairline bg-popover px-3 py-1.5 text-xs font-normal text-popover-foreground shadow-popover`,e),...n,children:t})})})}var aw=[`system`,`light`,`dark`],ow={dark:`Dark`,light:`Light`,system:`System`},sw={dark:Om,light:Nm,system:Dm};function cw(e){return aw[(aw.indexOf(e)+1)%aw.length]??`system`}function lw({className:e}){let t=Ga(e=>e.theme),n=Ga(e=>e.setTheme),r=sw[t],i=ow[t];return(0,B.jsxs)(nw,{children:[(0,B.jsx)(rw,{render:(0,B.jsx)(hg,{"aria-label":`Theme: ${i}`,size:`icon`,variant:`ghost`,className:e,onClick:()=>n(cw(t)),children:(0,B.jsx)(r,{className:`size-4`})})}),(0,B.jsxs)(iw,{children:[`Theme:`,` `,i]})]})}function uw({className:e,orientation:t=`horizontal`,...n}){return(0,B.jsx)(`div`,{role:`separator`,"aria-orientation":t,className:ug(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...n})}var dw=[{to:`/workers`,label:`Workers`,icon:cm,exact:!1},{to:`/enroll`,label:`Enrollments`,icon:wm,exact:!1},{to:`/audit`,label:`Audit`,icon:Sm,exact:!1},{to:`/presence`,label:`Presence`,icon:om,exact:!1}];function fw(){return(0,B.jsx)(tw,{delay:300,children:(0,B.jsxs)(`div`,{"data-testid":`fleet-shell`,className:`flex h-dvh w-full flex-col overflow-hidden bg-background text-foreground`,children:[(0,B.jsxs)(`header`,{"data-testid":`fleet-shell-header`,className:`grid shrink-0 gap-3 border-b border-hairline bg-background px-4 py-3 md:grid-cols-[minmax(12rem,1fr)_auto_minmax(12rem,1fr)] md:items-center md:px-8`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-sm border border-hairline bg-primary text-primary-foreground`,children:(0,B.jsx)(xm,{className:`size-4`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`font-display text-lg leading-none text-foreground`,children:`AIWorker`}),(0,B.jsx)(`p`,{className:`text-micro text-muted-foreground`,children:`Fleet`})]})]}),(0,B.jsx)(`nav`,{"data-testid":`fleet-shell-nav`,className:`grid min-w-0 grid-cols-2 gap-1 sm:grid-cols-4 md:flex md:items-center md:justify-center`,children:dw.map(e=>(0,B.jsxs)(Ni,{to:e.to,className:ug(`flex min-w-0 items-center justify-center gap-2 rounded-xl border border-transparent px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:border-hairline hover:bg-soft-stone hover:text-foreground`),activeProps:{className:`!border-primary !bg-primary !text-primary-foreground hover:!border-primary hover:!bg-primary hover:!text-primary-foreground`},activeOptions:{exact:e.exact},children:[(0,B.jsx)(e.icon,{className:`size-4`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to))}),(0,B.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,B.jsx)(lw,{})})]}),(0,B.jsx)(uw,{}),(0,B.jsx)(`main`,{className:`min-h-0 min-w-0 flex-1 overflow-auto px-4 py-6 sm:px-6 lg:px-8`,children:(0,B.jsx)(`div`,{className:`mx-auto w-full max-w-7xl`,children:(0,B.jsx)(Yi,{})})})]})})}var pw=Ri({component:fw}),mw={WORKER_ONLINE:`worker.online`,WORKER_OFFLINE:`worker.offline`,CHAT_MESSAGE:`chat.message`,AGENT_THINKING:`agent.thinking`,AGENT_TOOL_CALL:`agent.tool_call`,AGENT_DONE:`agent.done`,CONFIG_CHANGED:`config.changed`,LOGS_LINE:`logs.line`,APPROVAL_REQUESTED:`approval.requested`,ENROLLMENT_OTP:`enrollment.otp`,ENROLLMENT_APPROVED:`enrollment.approved`,ENROLLMENT_PENDING:`enrollment.pending`},hw=X({workerId:q().min(1)});hw.extend({displayName:q().optional(),deviceId:q().min(1),connectedAt:Fs().int()}),hw.extend({deviceId:q().min(1),reason:Vs([`disconnected`,`expired`,`kicked`]).optional(),disconnectedAt:Fs().int()}),hw.extend({conversationId:q().min(1),role:Vs([`user`,`assistant`,`system`]),content:q(),createdAt:Fs().int()}),hw.extend({conversationId:q().min(1),taskId:q().min(1).optional(),chunk:q().optional()}),hw.extend({conversationId:q().min(1),taskId:q().min(1).optional(),toolCallId:q().min(1),toolName:q().min(1),status:Vs([`pending`,`running`,`success`,`error`]),args:J().optional(),result:J().optional()}),hw.extend({conversationId:q().min(1),taskId:q().min(1).optional(),finishReason:Vs([`stop`,`length`,`tool_use`,`error`,`cancelled`]),usage:X({inputTokens:Fs().int().nonnegative().optional(),outputTokens:Fs().int().nonnegative().optional(),totalTokens:Fs().int().nonnegative().optional()}).optional()}),hw.extend({version:Fs().int().nonnegative(),changedAt:Fs().int()}),hw.extend({stream:Vs([`stdout`,`stderr`]),line:q(),ts:Fs().int()}),hw.extend({taskId:q().min(1),toolCallId:q().min(1),toolName:q().min(1),params:zs(J()),expiresAt:Fs().int()}),hw.extend({otp:q().min(1),expiresAt:Fs().int()}),hw.extend({deviceToken:q().min(1)}),hw.extend({otp:q().min(1),displayName:q().min(1).optional(),submittedAt:Fs().int(),expiresAt:Fs().int(),reason:Vs([`submitted`,`approved`,`rejected`,`expired`,`abandoned`])}),mw.WORKER_ONLINE,mw.WORKER_OFFLINE,mw.CHAT_MESSAGE,mw.AGENT_THINKING,mw.AGENT_TOOL_CALL,mw.AGENT_DONE,mw.CONFIG_CHANGED,mw.LOGS_LINE,mw.APPROVAL_REQUESTED,mw.ENROLLMENT_OTP,mw.ENROLLMENT_APPROVED,mw.ENROLLMENT_PENDING;var gw={OPERATOR:`operator`,NODE:`node`},_w=Ls([Bs(gw.OPERATOR),Bs(gw.NODE)]),vw=X({type:Bs(`connect`),role:_w,agentId:q().min(1),deviceId:q().min(1),auth:X({token:q()}),meta:zs(q()).optional(),enroll:X({apiToken:q().regex(Xf,`apiToken must match wtk_<base64url>`),displayName:q().min(1).max(80).optional(),mode:Vs([`join-token`,`otp`]).optional(),joinToken:q().min(1).optional()}).optional().refine(e=>e===void 0||((e.mode??`join-token`)===`otp`?e.joinToken===void 0:!!e.joinToken),{message:`mode=join-token requires joinToken; mode=otp must omit joinToken`})}),yw=X({type:Bs(`request`),id:q().min(1),method:q().min(1),params:J().optional()}),bw=X({code:q().min(1),message:q(),details:J().optional()}),xw=Ls([vw,yw,Rs(`ok`,[X({type:Bs(`response`),id:q().min(1),ok:Bs(!0),result:J()}),X({type:Bs(`response`),id:q().min(1),ok:Bs(!1),error:bw})]),X({type:Bs(`event`),name:q().min(1),payload:J(),ts:Fs().int()})]);function Sw(e){let t;try{t=JSON.parse(e)}catch(e){return{ok:!1,error:`invalid_json:${e instanceof Error?e.message:String(e)}`}}let n=xw.safeParse(t);return n.success?{ok:!0,frame:n.data}:{ok:!1,error:`schema:${n.error.message}`}}function Cw(e){return JSON.stringify(e)}var ww=X({workerId:q().min(1),displayName:q().optional(),online:Is(),deviceId:q().min(1).optional(),baseUrl:q().optional(),lastSeenAt:Fs().int().nullable().optional()});X({}).optional().default({}),X({workers:Y(ww)}),X({workerId:q().min(1)}),J(),X({workerBaseUrl:q().min(1),bootstrapToken:q().min(1),displayName:q().optional()}),X({workerId:q().min(1),deviceToken:q().min(1)}),X({displayName:q().optional(),image:q().optional(),env:zs(q()).optional()}),X({workerId:q().min(1)}),X({stopped:Is()}),X({workerId:q().min(1)}),X({removed:Is()});var Tw=X({otp:q().min(1),workerId:q().min(1),displayName:q().min(1).optional(),submittedAt:Fs().int(),expiresAt:Fs().int()});X({}).optional().default({}),X({pending:Y(Tw)}),X({otp:q().min(1)}),X({workerId:q().min(1),deviceToken:q().min(1)}),X({otp:q().min(1)}),X({rejected:Is()});var Ew=X({id:Fs().int().positive(),at:q().min(1),actor:q().min(1),action:q().min(1),workerId:q().min(1).nullable(),detail:zs(J()).nullable()});X({limit:Fs().int().positive().max(200).optional(),before:Fs().int().positive().optional(),action:q().min(1).optional(),workerId:q().min(1).optional()}).optional().default({}),X({events:Y(Ew),hasMore:Is()}),X({workerId:q().min(1),conversationId:q().min(1).optional(),content:q().min(1),metadata:zs(J()).optional()}),X({conversationId:q().min(1),taskId:q().min(1).optional(),accepted:Is()}),X({workerId:q().min(1)}),X({version:Fs().int().nonnegative(),config:J()}),X({workerId:q().min(1),ifMatch:Fs().int().nonnegative(),config:J()}),X({version:Fs().int().nonnegative(),appliedAt:Fs().int()}),X({workerId:q().min(1)}),X({deviceToken:q().min(1)}),X({workerId:q().min(1),follow:Is().optional(),lines:Fs().int().positive().max(1e3).optional()}),X({subscribed:Is()});var Dw=Vs([`allow`,`deny`]),Ow=X({workerId:q().min(1),taskId:q().min(1),toolCallId:q().min(1),toolName:q().min(1),params:zs(J()),expiresAt:Fs().int()});X({workerId:q().min(1)}),X({approvals:Y(Ow)}),X({workerId:q().min(1),taskId:q().min(1),toolCallId:q().min(1),decision:Dw}),X({granted:Is()});var kw=Vs([`web`,`line`,`telegram`,`lark`,`whatsapp`]),Aw=q().regex(/^[\w.-]{1,128}$/);X({workerId:q().min(1)}),X({keys:Y(q())}),X({workerId:q().min(1),key:Aw,value:q().min(1)}),X({ok:Bs(!0)}),X({workerId:q().min(1),key:Aw}),X({ok:Bs(!0)}),X({workerId:q().min(1),refresh:Is().optional()}),X({engines:Y(J())}),X({workerId:q().min(1)}),J();var jw=Vs([`pending`,`approved`,`rejected`,`applied`,`failed`]),Mw=Vs([`active`,`archived`,`removed`]),Nw=Vs([`public`,`internal`,`confidential`,`secret`]),Pw=Vs([`block`,`redact`,`raw`]);X({workerId:q().min(1)}),J(),X({workerId:q().min(1),status:jw.optional(),kind:q().min(1).optional(),scopeId:q().min(1).optional(),soulId:q().min(1).optional(),limit:Fs().int().min(1).max(500).optional(),showSensitive:Is().optional()}),J(),X({workerId:q().min(1),id:q().min(1),showSensitive:Is().optional()}),J(),X({workerId:q().min(1),id:q().min(1),decidedBy:q().min(1).max(200),reason:q().min(1).max(2e3).optional()}),J(),J(),X({workerId:q().min(1),id:q().min(1),decidedBy:q().min(1).max(200),commit:Is().optional(),allowSecretBody:Pw.optional()}),J(),X({workerId:q().min(1),scopeId:q().min(1).optional(),type:q().min(1).optional(),status:Mw.optional(),minSensitivity:Nw.optional(),limit:Fs().int().min(1).max(500).optional(),showSensitive:Is().optional()}),J(),X({workerId:q().min(1),id:q().min(1),showSensitive:Is().optional()}),J(),X({workerId:q().min(1),limit:Fs().int().min(1).max(200).optional()}),X({cases:Y(J())}),X({workerId:q().min(1),taskId:q().min(1)}),X({case:J()}),X({workerId:q().min(1),taskId:q().min(1),prompt:q().min(1).max(8e3).optional()}),X({task:J()}),X({workerId:q().min(1),taskId:q().min(1),scopeId:q().min(1).optional(),soulId:q().min(1).optional()}),J(),X({workerId:q().min(1),probe:Is().optional()}),J(),X({workerId:q().min(1),channel:kw,body:X({chatId:q().optional(),text:q().optional()}).optional()}),J(),X({workerId:q().min(1)}),X({tasks:Y(J())}),X({workerId:q().min(1),prompt:q().trim().min(1).max(8e3)}),X({task:J()}),X({workerId:q().min(1),taskId:q().min(1)}),X({journal:J()}),X({workerId:q().min(1),taskId:q().min(1),prompt:q().min(1).optional()}),X({task:J()}),X({workerId:q().min(1)}),X({conversations:Y(J())}),X({workerId:q().min(1),conversationId:q().min(1)}),X({messages:Y(J())}),X({}).optional().default({}),X({now:Fs().int(),online:Y(ww)});var Fw=kw,Iw=X({id:q().min(1),expression:q().min(1),prompt:q().min(1),channel:Fw,chatId:q().min(1),accountId:q().min(1),enabled:Is(),lastRunAt:q().nullable(),nextRunAt:q().nullable(),createdAt:q(),updatedAt:q()}),Lw=X({expression:q().min(1),prompt:q().min(1),channel:Fw,chatId:q().min(1),accountId:q().min(1).optional(),enabled:Is().optional()}),Rw=X({expression:q().min(1).optional(),prompt:q().min(1).optional(),channel:Fw.optional(),chatId:q().min(1).optional(),accountId:q().min(1).optional(),enabled:Is().optional()}).refine(e=>Object.keys(e).length>0,{message:`至少提供一个待更新字段`});X({workerId:q().min(1)}),X({jobs:Y(Iw)}),X({workerId:q().min(1),job:Lw}),X({job:Iw}),X({workerId:q().min(1),jobId:q().min(1)}),X({removed:Is()}),X({workerId:q().min(1),jobId:q().min(1),patch:Rw}),X({job:Iw});var zw=class extends Error{code;details;constructor(e,t,n){super(t),this.name=`GatewayApiError`,this.code=e,this.details=n}},Bw=class extends Error{constructor(e){super(e),this.name=`GatewayConnectionError`}};function Vw(){return typeof window>`u`?`ws://127.0.0.1:9218/ws`:`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws`}function Hw(){return`web-${crypto.randomUUID()}`}var Uw=class{url;token;requestTimeoutMs;reconnectBaseMs;agentId;deviceId;ws=null;handshakeDone=!1;pending=new Map;handlers=new Map;reconnectAttempt=0;reconnectTimer=null;readyPromise=null;readyResolve=null;constructor(e={}){this.url=e.url??Vw(),this.token=e.token??``,this.requestTimeoutMs=e.requestTimeoutMs??3e4,this.reconnectBaseMs=e.reconnectBaseMs??500,this.agentId=Hw(),this.deviceId=`browser-${crypto.randomUUID()}`,this.connect()}connect(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.handshakeDone=!1,this.readyPromise=new Promise(e=>{this.readyResolve=e});try{this.ws=new WebSocket(this.url)}catch(e){this.scheduleReconnect(),console.warn(`[gateway-client] new WebSocket failed`,e);return}this.ws.onopen=()=>{let e={type:`connect`,role:`operator`,agentId:this.agentId,deviceId:this.deviceId,auth:{token:this.token}};try{this.ws.send(Cw(e)),this.handshakeDone=!0,this.reconnectAttempt=0,this.readyResolve?.()}catch(e){console.warn(`[gateway-client] 发送 connect 帧失败`,e)}},this.ws.onmessage=e=>{let t=typeof e.data==`string`?e.data:``;if(!t)return;let n=Sw(t);if(!n.ok){console.warn(`[gateway-client] 解析 frame 失败`,n.error);return}this.handleFrame(n.frame)},this.ws.onerror=()=>{},this.ws.onclose=()=>{this.handshakeDone=!1,this.rejectAllPending(new Bw(`gateway 连接已断开`)),this.scheduleReconnect()}}scheduleReconnect(){if(this.reconnectTimer)return;this.reconnectAttempt+=1;let e=Math.min(3e4,this.reconnectBaseMs*2**Math.min(6,this.reconnectAttempt));this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}rejectAllPending(e){for(let[,t]of this.pending)t.timer&&clearTimeout(t.timer),t.reject(e);this.pending.clear()}handleFrame(e){if(e.type===`response`){let t=this.pending.get(e.id);if(!t)return;this.pending.delete(e.id),t.timer&&clearTimeout(t.timer),e.ok?t.resolve(e.result):t.reject(new zw(e.error.code,e.error.message,e.error.details));return}if(e.type===`event`){let t=this.handlers.get(e.name);if(!t)return;for(let n of t)try{n(e.payload)}catch(t){console.warn(`[gateway-client] event handler for ${e.name} threw`,t)}}}async ensureReady(){this.handshakeDone||(this.readyPromise||=Promise.resolve(),await Promise.race([this.readyPromise,new Promise((e,t)=>{setTimeout(()=>t(new Bw(`gateway 连接就绪超时`)),this.requestTimeoutMs)})]))}async request(e,t={}){await this.ensureReady();let n=crypto.randomUUID(),r=Cw({type:`request`,id:n,method:e,params:t});return await new Promise((t,i)=>{let a=setTimeout(()=>{this.pending.delete(n),i(new zw(`timeout`,`${e} 等待 gateway 响应超时 (${this.requestTimeoutMs}ms)`))},this.requestTimeoutMs);this.pending.set(n,{resolve:e=>{t(e)},reject:i,timer:a});try{this.ws.send(r)}catch(e){this.pending.delete(n),clearTimeout(a),i(new Bw(`gateway 连接不可用: ${e instanceof Error?e.message:String(e)}`))}})}onEvent(e,t){let n=this.handlers.get(e);return n||(n=new Set,this.handlers.set(e,n)),n.add(t),()=>{let n=this.handlers.get(e);n&&(n.delete(t),n.size===0&&this.handlers.delete(e))}}async close(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null);try{this.ws?.close(1e3,`client_close`)}catch{}this.rejectAllPending(new Bw(`gateway client closed`))}},Ww=null;function Gw(){return Ww||=new Uw,Ww}var Kw={not_found:`not-found`,already_registered:`already-registered`,auth_failed:`auth-failed`,worker_unreachable:`worker-unreachable`,invalid_worker_info:`invalid-worker-info`,invalid_params:`invalid-body`,quota_exceeded:`quota-exceeded`,launch_timeout:`launch-timeout`,launch_failed:`launch-failed`,feature_disabled:`feature-disabled`,node_offline:`worker-unreachable`,master_key_missing:`launch-failed`,forward_failed:`worker-unreachable`,node_gone:`worker-unreachable`,forward_timeout:`worker-unreachable`},qw=class extends Error{code;details;workerId;quotaLimit;quotaCurrent;constructor(e,t,n){super(t),this.name=`WorkerApiError`,this.code=e,this.details=n;let r=n&&typeof n==`object`?n:{};this.workerId=r.workerId,this.quotaLimit=r.limit,this.quotaCurrent=r.current}};function Jw(e){return e instanceof zw?new qw(Kw[e.code]??`unknown`,e.message,e.details):e instanceof qw?e:new qw(`unknown`,e instanceof Error?e.message:String(e))}async function Yw(e,t){try{return await Gw().request(e,t)}catch(e){throw Jw(e)}}function Xw(e){return{id:e.workerId,baseUrl:e.baseUrl??``,displayName:e.displayName??e.workerId,addedAt:``,addedBy:`manual`,lastSeenAt:e.lastSeenAt?new Date(e.lastSeenAt).toISOString():void 0,lastSeenState:e.online?`online`:`offline`,lastConfigVersion:void 0}}async function Zw(){let{workers:e}=await Yw(`workers.list`,{});return e.map(Xw)}async function Qw(e){let t=(await Zw()).find(t=>t.id===e);if(!t)throw new qw(`not-found`,`worker ${e} 不在 fleet 中`);return t}async function $w(e){let t=await Yw(`workers.pair`,{workerBaseUrl:e.baseUrl,bootstrapToken:e.bootstrapToken,displayName:e.displayName});return{worker:await Qw(t.workerId).catch(()=>({id:t.workerId,baseUrl:e.baseUrl,displayName:e.displayName,addedAt:new Date().toISOString(),addedBy:`manual`,lastSeenAt:new Date().toISOString(),lastSeenState:`online`})),deviceToken:t.deviceToken}}async function eT(e){let t=await Yw(`workers.launch`,{displayName:e.displayName,...e.forceId===void 0?{}:{forceId:e.forceId}});return{worker:await Qw(t.workerId).catch(()=>({id:t.workerId,baseUrl:``,displayName:e.displayName,addedAt:new Date().toISOString(),addedBy:`launch-local`,lastSeenAt:new Date().toISOString(),lastSeenState:`online`})),deviceToken:t.deviceToken}}async function tT(e){await Yw(`workers.remove`,{workerId:e})}async function nT(e){return await Yw(`workers.stop`,{workerId:e})}async function rT(e){let t=await Yw(`token.rotate`,{workerId:e});return{rotatedAt:new Date().toISOString(),deviceToken:t.deviceToken}}async function iT(){return(await Yw(`enroll.list`,{})).pending}async function aT(e){return await Yw(`enroll.approve`,{otp:e})}async function oT(e){return await Yw(`enroll.reject`,{otp:e})}async function sT(e={}){return await Yw(`audit.list`,e)}async function cT(){return await Yw(`system.presence`,{})}var lT=Ha(e=>({currentWorkerId:null,registered:[],setCurrentWorkerId:t=>e({currentWorkerId:t}),setRegistered:t=>e({registered:t})})),uT=[`fleet`,`workers`],dT=e=>[`fleet`,`workers`,e],fT=[`fleet`,`presence`];function pT(){let e=lT(e=>e.setRegistered),t=$e({queryKey:uT,queryFn:Zw,staleTime:1e4});return(0,z.useEffect)(()=>{t.data&&e(t.data)},[t.data,e]),t}function mT(e){return $e({queryKey:e?dT(e):[`fleet`,`workers`,`__missing__`],queryFn:()=>Qw(e),enabled:!!e,staleTime:1e4})}function hT(){let e=Re();return et({mutationFn:$w,onSuccess:({worker:t})=>{e.invalidateQueries({queryKey:uT}),e.setQueryData(dT(t.id),t)}})}function gT(){let e=Re();return et({mutationFn:eT,onSuccess:({worker:t})=>{e.invalidateQueries({queryKey:uT}),e.setQueryData(dT(t.id),t)}})}function _T(){let e=Re();return et({mutationFn:tT,onSuccess:(t,n)=>{e.invalidateQueries({queryKey:uT}),e.removeQueries({queryKey:dT(n)})}})}function vT(){let e=Re();return et({mutationFn:nT,onSuccess:()=>{e.invalidateQueries({queryKey:uT})}})}function yT(){let e=Re();return et({mutationFn:rT,onSuccess:()=>{e.invalidateQueries({queryKey:uT})}})}function bT(){return $e({queryKey:fT,queryFn:cT,refetchInterval:3e4,staleTime:15e3})}function xT({className:e,...t}){return(0,B.jsx)(`div`,{className:ug(`rounded-sm border border-card-border bg-card text-card-foreground shadow-card`,e),...t})}function ST({className:e,...t}){return(0,B.jsx)(`div`,{className:ug(`flex flex-col gap-2 p-6`,e),...t})}function CT({className:e,...t}){return(0,B.jsx)(`h3`,{className:ug(`text-feature font-normal leading-tight`,e),...t})}function wT({className:e,...t}){return(0,B.jsx)(`p`,{className:ug(`text-sm text-muted-foreground`,e),...t})}function TT({className:e,...t}){return(0,B.jsx)(`div`,{className:ug(`p-6 pt-0`,e),...t})}function ET({className:e,...t}){return(0,B.jsx)(`div`,{className:ug(`animate-pulse rounded-sm bg-soft-stone`,e),...t})}function DT(){let e=bT(),t=pT(),n=kT(),r=e.data?.online.length??0,i=t.data?.length??0,a=Math.max(0,i-r);return(0,B.jsxs)(`div`,{className:`app-page`,children:[(0,B.jsxs)(`div`,{className:`app-page-header`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Presence`}),(0,B.jsxs)(`p`,{className:`app-page-copy break-words`,children:[`Live snapshot driven by`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`system.presence`}),` `,`(30s) and`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`workers.list`}),` `,`(10s).`]})]}),(0,B.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,B.jsxs)(xT,{className:`border-hairline`,children:[(0,B.jsx)(ST,{children:(0,B.jsxs)(CT,{className:`flex items-center gap-2 text-sm font-normal text-muted-foreground`,children:[(0,B.jsx)(om,{className:`size-4`}),`Online workers`]})}),(0,B.jsxs)(TT,{children:[e.isLoading?(0,B.jsx)(ET,{className:`h-8 w-16`}):(0,B.jsxs)(`div`,{className:`font-display text-card-heading font-normal`,children:[r,(0,B.jsxs)(`span`,{className:`text-sm font-normal text-muted-foreground`,children:[` `,`/`,` `,i]})]}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[a,` `,`offline`]})]})]}),(0,B.jsxs)(xT,{className:`border-hairline`,children:[(0,B.jsx)(ST,{children:(0,B.jsxs)(CT,{className:`flex items-center gap-2 text-sm font-normal text-muted-foreground`,children:[(0,B.jsx)(hm,{className:`size-4`}),`Heartbeat distribution`]})}),(0,B.jsx)(TT,{children:t.isLoading?(0,B.jsx)(ET,{className:`h-16 w-full`}):(0,B.jsx)(OT,{lastSeen:(t.data??[]).map(e=>e.lastSeenAt)})})]}),(0,B.jsxs)(xT,{className:`border-hairline`,children:[(0,B.jsx)(ST,{children:(0,B.jsxs)(CT,{className:`flex items-center gap-2 text-sm font-normal text-muted-foreground`,children:[(0,B.jsx)(Im,{className:`size-4`}),`Enrollments today`]})}),(0,B.jsxs)(TT,{children:[n.isLoading?(0,B.jsx)(ET,{className:`h-8 w-16`}):(0,B.jsx)(`div`,{className:`font-display text-card-heading font-normal`,children:n.data??0}),(0,B.jsx)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:`gateway.worker.paired + gateway.enrollment.approved since 00:00 local`})]})]})]})]})}function OT({lastSeen:e}){let t=Date.now(),n={recent:0,hour:0,day:0,stale:0,never:0};for(let r of e){if(!r){n.never+=1;continue}let e=Date.parse(r);if(Number.isNaN(e)){n.never+=1;continue}let i=t-e;i<=5*6e4?n.recent+=1:i<=60*6e4?n.hour+=1:i<=1440*6e4?n.day+=1:n.stale+=1}let r=[{label:`< 5 min`,count:n.recent},{label:`< 1 hour`,count:n.hour},{label:`< 1 day`,count:n.day},{label:`> 1 day`,count:n.stale},{label:`never`,count:n.never}],i=r.reduce((e,t)=>e+t.count,0);return(0,B.jsx)(`div`,{className:`space-y-1.5`,children:r.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`font-mono`,children:e.count}),(0,B.jsx)(`div`,{className:`h-1.5 w-24 overflow-hidden rounded-full bg-soft-stone`,children:(0,B.jsx)(`div`,{className:`h-full bg-deep-green`,style:{width:i===0?`0`:`${e.count/i*100}%`}})})]})]},e.label))})}function kT(){return $e({queryKey:[`fleet`,`presence`,`enrollments-today`],queryFn:async()=>{let e=AT(),[t,n]=await Promise.all([sT({action:`gateway.worker.paired`,limit:200}),sT({action:`gateway.enrollment.approved`,limit:200})]),r=t=>t.filter(t=>t.at>=e).length;return r(t.events)+r(n.events)},refetchInterval:6e4,staleTime:3e4})}function AT(){let e=new Date;return e.setHours(0,0,0,0),e.toISOString()}function jT(){return(0,B.jsx)(DT,{})}var MT=zi(`/presence`)({component:jT}),NT=pg(`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-normal leading-tight transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-primary bg-primary text-primary-foreground`,secondary:`border-hairline bg-soft-stone text-secondary-foreground`,destructive:`border-destructive bg-transparent text-destructive`,outline:`border-border bg-transparent text-foreground`,success:`border-success bg-success-soft text-success`,warning:`border-warning bg-warning-soft text-warning`}},defaultVariants:{variant:`default`}});function PT({className:e,variant:t,...n}){return(0,B.jsx)(`span`,{className:ug(NT({variant:t}),e),...n})}var FT=z.createContext(void 0);function IT(e){let t=z.useContext(FT);if(e===!1&&t===void 0)throw Error(_g(27));return t}var LT={...SC,...mC},RT=z.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=IT(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return mb(`div`,e,{state:z.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:LT,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),zT=z.createContext(void 0);function BT(e=!1){let t=z.useContext(zT);if(t===void 0&&!e)throw Error(_g(16));return t}function VT(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:z.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function HT(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=z.useRef(null),o=BT(!0)!==void 0,s=n_(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=VT({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=z.useCallback(()=>{let e=a.current;UT(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return gg(l,[l]),{getButtonProps:z.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return rb({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(db(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(db(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:n_(e=>{a.current=e,l()})}}function UT(e){return Ng(e)&&e.tagName===`BUTTON`}var WT=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{store:s}=IT(),c=s.useState(`open`);function l(e){c&&s.setOpen(!1,yy(my,e.nativeEvent))}let{getButtonProps:u,buttonRef:d}=HT({disabled:i,native:a});return mb(`button`,e,{state:z.useMemo(()=>({disabled:i}),[i]),ref:[t,d],props:[{onClick:l},o,u]})}),GT=z.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=IT(),s=CC(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),mb(`p`,e,{ref:t,props:[{id:s},a]})}),KT=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),qT=function(e){return e[e.open=hC.open]=`open`,e[e.closed=hC.closed]=`closed`,e[e.startingStyle=hC.startingStyle]=`startingStyle`,e[e.endingStyle=hC.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),JT=z.createContext(void 0);function YT(){let e=z.useContext(JT);if(e===void 0)throw Error(_g(26));return e}var XT=`ArrowUp`,ZT=`ArrowDown`,QT=`ArrowLeft`,$T=`ArrowRight`,eE=`Home`,tE=new Set([QT,$T]),nE=new Set([XT,ZT]),rE=new Set([...tE,...nE]);new Set([...rE,eE,`End`]);var iE=new Set([XT,ZT,QT,$T,eE,`End`]),aE={...SC,...mC,nestedDialogOpen(e){return e?{[qT.nestedDialogOpen]:``}:null}},oE=z.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=IT(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);YT(),OS({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=h>0,w=mb(`div`,e,{state:z.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){iE.has(e.key)&&e.stopPropagation()},style:{[KT.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:aE});return(0,B.jsx)(Nb,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),sE=z.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
1362
- 0% 0%,
1363
- 100% 0%,
1364
- 100% 100%,
1365
- 0% 100%,
1366
- 0% 0%,
1367
- ${e.left}px ${e.top}px,
1368
- ${e.left}px ${e.bottom}px,
1369
- ${e.right}px ${e.bottom}px,
1370
- ${e.right}px ${e.top}px,
1371
- ${e.left}px ${e.top}px
1372
- )`}return(0,B.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),cE=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=IT(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,B.jsx)(JT.Provider,{value:n,children:(0,B.jsxs)(Sb,{ref:t,...r,children:[a&&o===!0&&(0,B.jsx)(sE,{ref:i.context.internalBackdropRef,inert:ew(!open)}),e.children]})}):null}),lE={},uE={},dE=``;function fE(e){if(typeof document>`u`)return!1;let t=Iy(e);return kg(t).innerWidth-t.documentElement.clientWidth>0}function pE(e){let t=Iy(e),n=t.documentElement,r=t.body,i=Fg(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function mE(e){let t=Iy(e),n=t.documentElement,r=t.body,i=kg(n),a=0,o=0,s=Py.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(l_&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,lE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},dE=n.style.scrollBehavior,uE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=Fg(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,lE),Object.assign(r.style,uE),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=dE)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var hE=new class{lockCount=0;restore=null;timeoutLock=Tg.create();timeoutUnlock=Tg.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Iy(e).documentElement,n=kg(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=ay;return}let r=u_||!fE(e);this.restore=r?pE(e):mE(e)}};function gE(e=!0,t=null){gg(()=>{if(e)return hE.acquire(t)},[e,t])}function _E(e){let t=z.useRef(``),n=z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:z.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n&&e(n,n.pointerType),e(n,t.current),t.current=``},[e]),onPointerDown:n}}function vE(e){let[t,n]=z.useState(null),r=n_((t,r)=>{e||n(r)}),i=z.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=_E(r);return z.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}function yE(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=vE(i);jS(t);let{forceUnmount:d}=MS(i,t,()=>{u()}),f=n_(e=>{let n=yy(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=z.useCallback(()=>{t.setOpen(!1,f(vy))},[t,f]);z.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=zS({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=z.useState(0),_=h===0,v=nC(m),y=Jx(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=S_(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||x_(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});gE(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=QS([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),z.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=z.useMemo(()=>b(l),[b,l]),w=z.useMemo(()=>S(l),[S,l]),T=z.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var bE={...IS,modal:gS(e=>e.modal),nested:gS(e=>e.nested),nestedOpenDialogCount:gS(e=>e.nestedOpenDialogCount),disablePointerDismissal:gS(e=>e.disablePointerDismissal),openMethod:gS(e=>e.openMethod),descriptionElementId:gS(e=>e.descriptionElementId),titleElementId:gS(e=>e.titleElementId),viewportElement:gS(e=>e.viewportElement),role:gS(e=>e.role)},xE=class extends CS{constructor(e){super(SE(e),{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),triggerElements:new NS,onOpenChange:void 0,onOpenChangeComplete:void 0},bE)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function SE(e={}){return{...FS(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function CE(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=IT(!0),p=!!f,m=xg(()=>l?.store??new xE({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);yE({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=z.useMemo(()=>({store:m}),[m]);return(0,B.jsx)(FT.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}var wE=z.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=IT(),s=CC(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),mb(`h2`,e,{ref:t,props:[{id:s},a]})}),TE=CE,EE=WT,DE=cE;function OE({className:e,...t}){return(0,B.jsx)(RT,{className:ug(`fixed inset-0 z-50 bg-cohere-black/70 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 transition-opacity duration-150`,e),...t})}function kE({className:e,children:t,showCloseButton:n=!0,...r}){return(0,B.jsxs)(DE,{children:[(0,B.jsx)(OE,{}),(0,B.jsxs)(oE,{className:ug(`fixed left-1/2 top-1/2 z-50 grid w-[calc(100vw-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-5 rounded-lg border border-card-border bg-background p-6 shadow-popover outline-none sm:p-8`,`data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[starting-style]:scale-95 transition-[opacity,transform] duration-150`,e),...r,children:[t,n&&(0,B.jsx)(EE,{className:`absolute right-4 top-4 rounded-full p-1 opacity-70 ring-offset-background transition-opacity hover:bg-soft-stone hover:text-primary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,"aria-label":`Close dialog`,children:(0,B.jsx)(Lm,{className:`size-4`})})]})]})}function AE({className:e,...t}){return(0,B.jsx)(`div`,{className:ug(`flex flex-col space-y-1.5 text-left`,e),...t})}function jE({className:e,...t}){return(0,B.jsx)(`div`,{className:ug(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function ME({className:e,...t}){return(0,B.jsx)(wE,{className:ug(`text-card-heading font-normal leading-tight`,e),...t})}function NE({className:e,...t}){return(0,B.jsx)(GT,{className:ug(`text-sm text-muted-foreground`,e),...t})}function PE({className:e,containerClassName:t,...n}){return(0,B.jsx)(`div`,{className:ug(`relative w-full overflow-auto rounded-sm border border-hairline bg-card`,t),children:(0,B.jsx)(`table`,{className:ug(`w-full caption-bottom text-sm`,e),...n})})}function FE({className:e,...t}){return(0,B.jsx)(`thead`,{className:ug(`[&_tr]:border-b`,e),...t})}function IE({className:e,...t}){return(0,B.jsx)(`tbody`,{className:ug(`[&_tr:last-child]:border-0`,e),...t})}function LE({className:e,...t}){return(0,B.jsx)(`tr`,{className:ug(`border-b border-hairline transition-colors hover:bg-soft-stone/60 data-[state=selected]:bg-soft-stone`,e),...t})}function RE({className:e,...t}){return(0,B.jsx)(`th`,{className:ug(`h-11 bg-background px-4 text-left align-middle text-xs font-normal uppercase text-muted-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function zE({className:e,...t}){return(0,B.jsx)(`td`,{className:ug(`px-4 py-4 align-middle [&:has([role=checkbox])]:pr-0`,e),...t})}var BE=[`fleet`,`enroll`,`pending`];function VE(){let e=Re(),t=$e({queryKey:BE,queryFn:iT,refetchInterval:3e4,staleTime:5e3});return(0,z.useEffect)(()=>Gw().onEvent(`enrollment.pending`,t=>{e.invalidateQueries({queryKey:BE})}),[e]),t}function HE(){let e=Re();return et({mutationFn:aT,onSuccess:()=>{e.invalidateQueries({queryKey:BE}),e.invalidateQueries({queryKey:[`fleet`,`workers`]})}})}function UE(){let e=Re();return et({mutationFn:oT,onSuccess:()=>{e.invalidateQueries({queryKey:BE})}})}function WE(){let e=VE(),t=HE(),n=UE(),[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(null);return(0,B.jsxs)(`div`,{className:`app-page`,children:[(0,B.jsxs)(`div`,{className:`app-page-header`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Pending enrollments`}),(0,B.jsxs)(`p`,{className:`app-page-copy`,children:[`Workers awaiting OTP approval. Issued OTPs are`,` `,(0,B.jsx)(`strong`,{children:`not displayed`}),` `,`here for shoulder-surfing safety — operators read the OTP from the worker's own logs / CLI before approving.`]})]}),a&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error`,children:a}),e.isLoading?(0,B.jsx)(ET,{className:`h-32 w-full`}):(e.data??[]).length===0?(0,B.jsx)(KE,{}):(0,B.jsx)(`div`,{className:`overflow-hidden rounded-sm border border-hairline bg-card`,children:(0,B.jsxs)(PE,{children:[(0,B.jsx)(FE,{children:(0,B.jsxs)(LE,{children:[(0,B.jsx)(RE,{children:`Worker id`}),(0,B.jsx)(RE,{children:`Display name`}),(0,B.jsx)(RE,{children:`Submitted`}),(0,B.jsx)(RE,{children:`Expires`}),(0,B.jsx)(RE,{className:`text-right`,children:`Actions`})]})}),(0,B.jsx)(IE,{children:(e.data??[]).map(e=>(0,B.jsx)(GE,{entry:e,busy:t.isPending||n.isPending,onApprove:async()=>{o(null);try{i(await t.mutateAsync(e.otp))}catch(e){o(e instanceof qw||e instanceof Error?e.message:String(e))}},onReject:async()=>{o(null);try{await n.mutateAsync(e.otp)}catch(e){o(e instanceof qw||e instanceof Error?e.message:String(e))}}},e.otp))})]})}),r&&(0,B.jsx)(qE,{payload:r,onClose:()=>i(null)})]})}function GE({entry:e,busy:t,onApprove:n,onReject:r}){let i=new Date(e.submittedAt),a=new Date(e.expiresAt),o=Math.max(0,a.getTime()-Date.now()),s=Math.floor(o/6e4),c=Math.floor(o%6e4/1e3);return(0,B.jsxs)(LE,{children:[(0,B.jsx)(zE,{children:(0,B.jsx)(`code`,{className:`app-code`,children:e.workerId})}),(0,B.jsx)(zE,{children:e.displayName??`—`}),(0,B.jsx)(zE,{className:`text-xs text-muted-foreground`,children:i.toLocaleString()}),(0,B.jsx)(zE,{className:`text-xs text-muted-foreground`,children:(0,B.jsx)(PT,{variant:o===0?`destructive`:`outline`,children:o===0?`expired`:`${s}m ${c.toString().padStart(2,`0`)}s`})}),(0,B.jsx)(zE,{className:`text-right`,children:(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsxs)(hg,{variant:`outline`,size:`sm`,disabled:t,onClick:r,children:[(0,B.jsx)(Lm,{className:`size-3.5`}),`Reject`]}),(0,B.jsxs)(hg,{size:`sm`,disabled:t,onClick:n,children:[(0,B.jsx)(um,{className:`size-3.5`}),`Approve`]})]})})]})}function KE(){return(0,B.jsxs)(`div`,{className:`app-empty flex flex-col items-center justify-center gap-3`,children:[(0,B.jsx)(wm,{className:`size-10 text-muted-foreground`}),(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal text-foreground`,children:`No pending enrollments`}),(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Workers started with`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`aiworker serve`}),` `,`and`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`AIWORKER_GATEWAY_URL`}),` `,`set will request an OTP here. Use`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`aiworker enroll list`}),` `,`and`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`aiworker enroll approve <otp>`}),` `,`to review and approve them.`]})]})]})}function qE({payload:e,onClose:t}){let[n,r]=(0,z.useState)(!1),[i,a]=(0,z.useState)(!1);async function o(){try{await navigator.clipboard.writeText(e.deviceToken),a(!0),setTimeout(()=>a(!1),1500)}catch{}}return(0,B.jsx)(TE,{open:!0,onOpenChange:e=>!e&&t(),children:(0,B.jsxs)(kE,{className:`sm:max-w-lg`,children:[(0,B.jsxs)(AE,{children:[(0,B.jsx)(ME,{children:`Enrollment approved`}),(0,B.jsxs)(NE,{children:[`Fleet has issued a fresh`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`deviceToken`}),` `,`for`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:e.workerId}),`. Shown`,` `,(0,B.jsx)(`strong`,{children:`once`}),`; copy it before closing.`]})]}),(0,B.jsxs)(`div`,{className:`app-panel text-xs`,children:[(0,B.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 font-medium text-foreground`,children:[(0,B.jsx)(Em,{className:`size-3.5`}),`One-time deviceToken`]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-soft-stone px-2 py-1.5 font-mono text-micro`,children:[(0,B.jsx)(`code`,{className:`flex-1 break-all`,children:n?e.deviceToken:e.deviceToken.replace(/./g,`•`)}),(0,B.jsx)(hg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>r(e=>!e),"aria-label":n?`Hide token`:`Show token`,children:n?(0,B.jsx)(ym,{className:`size-3`}):(0,B.jsx)(bm,{className:`size-3`})}),(0,B.jsx)(hg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:o,"aria-label":`Copy token`,children:(0,B.jsx)(gm,{className:`size-3`})})]}),i&&(0,B.jsx)(`p`,{role:`status`,className:`mt-1 text-success`,children:`Copied.`}),(0,B.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-muted-foreground`,children:[(0,B.jsx)(Fm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,B.jsx)(`span`,{children:`Worker has already received this token via its WS connection. Use this dialog only if you need to forward it elsewhere.`})]})]}),(0,B.jsx)(jE,{children:(0,B.jsx)(hg,{onClick:t,children:`Close`})})]})})}function JE(){return(0,B.jsx)(WE,{})}var YE=zi(`/enroll`)({component:JE});function XE({className:e,type:t,...n}){return(0,B.jsx)(`input`,{type:t,className:ug(`flex min-h-11 w-full rounded-xs border border-input bg-background px-4 py-2 text-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-form-focus focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}function ZE({className:e,...t}){return(0,B.jsx)(`label`,{className:ug(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e),...t})}function QE(e,t=300){let[n,r]=(0,z.useState)(e);return(0,z.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var $E=[`fleet`,`audit`];function eD(e){return $e({queryKey:[...$E,e],queryFn:()=>sT(e),staleTime:5e3})}var tD=50;function nD(){let[e,t]=(0,z.useState)(``),[n,r]=(0,z.useState)(``),[i,a]=(0,z.useState)([]),o=QE(e.trim(),300),s=QE(n.trim(),300),c=i[i.length-1],l=eD({limit:tD,...c===void 0?{}:{before:c},...o.length>0?{action:o}:{},...s.length>0?{workerId:s}:{}});return(0,B.jsxs)(`div`,{className:`app-page h-full min-h-0`,children:[(0,B.jsxs)(`div`,{className:`app-page-header`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Audit log`}),(0,B.jsxs)(`p`,{className:`app-page-copy break-words`,children:[`fleet.db`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`audit_events`}),` `,`— gateway-side activity. Worker-side audit lives in each worker's own database.`]})]}),(0,B.jsx)(rD,{action:e,workerId:n,onActionChange:e=>{t(e),a([])},onWorkerIdChange:e=>{r(e),a([])}}),l.isLoading?(0,B.jsx)(ET,{className:`h-64 w-full`}):l.isError?(0,B.jsxs)(`p`,{className:`app-alert-error`,children:[`Failed to load audit events:`,` `,l.error?.message??`unknown error`]}):(l.data?.events??[]).length===0?(0,B.jsx)(aD,{}):(0,B.jsxs)(PE,{className:`min-w-[60rem]`,containerClassName:`min-h-0 flex-1 bg-card`,"data-testid":`audit-table-scroll`,children:[(0,B.jsx)(FE,{children:(0,B.jsxs)(LE,{children:[(0,B.jsx)(RE,{className:`sticky top-0 z-10 w-[7rem]`,children:`id`}),(0,B.jsx)(RE,{className:`sticky top-0 z-10 w-[12rem]`,children:`When`}),(0,B.jsx)(RE,{className:`sticky top-0 z-10 w-[10rem]`,children:`Actor`}),(0,B.jsx)(RE,{className:`sticky top-0 z-10`,children:`Action`}),(0,B.jsx)(RE,{className:`sticky top-0 z-10 w-[14rem]`,children:`Worker`}),(0,B.jsx)(RE,{className:`sticky top-0 z-10`,children:`Detail`})]})}),(0,B.jsx)(IE,{children:(l.data?.events??[]).map(e=>(0,B.jsx)(iD,{event:e},e.id))})]}),(0,B.jsx)(oD,{canBack:i.length>0,canForward:l.data?.hasMore??!1,onBack:()=>a(e=>e.slice(0,-1)),onForward:()=>{let e=l.data?.events??[],t=e[e.length-1];t&&a(e=>[...e,t.id])}})]})}function rD({action:e,workerId:t,onActionChange:n,onWorkerIdChange:r}){return(0,B.jsxs)(`div`,{className:`grid gap-3 sm:flex sm:flex-wrap sm:items-end`,children:[(0,B.jsxs)(`div`,{className:`grid w-full gap-1 sm:w-64`,children:[(0,B.jsx)(ZE,{htmlFor:`audit-action`,children:`Action prefix`}),(0,B.jsx)(XE,{id:`audit-action`,placeholder:`gateway.connect.`,value:e,onChange:e=>n(e.target.value),spellCheck:!1,autoComplete:`off`,className:`w-full`})]}),(0,B.jsxs)(`div`,{className:`grid w-full gap-1 sm:w-64`,children:[(0,B.jsx)(ZE,{htmlFor:`audit-worker`,children:`Worker id (exact)`}),(0,B.jsx)(XE,{id:`audit-worker`,placeholder:`w_…`,value:t,onChange:e=>r(e.target.value),spellCheck:!1,autoComplete:`off`,className:`w-full`})]}),(0,B.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5 pb-1.5 text-xs text-muted-foreground sm:items-center`,children:[(0,B.jsx)(Cm,{className:`mt-0.5 size-3.5 shrink-0 sm:mt-0`}),(0,B.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`Filters apply on debounce. Action prefix is a SQL`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`LIKE`}),`;`,` `,`non-alphanumeric characters fall back to exact match.`]})]})]})}function iD({event:e}){let[t,n]=(0,z.useState)(!1),r=e.detail?JSON.stringify(e.detail,null,2):null,i=r?.replace(/\s+/g,` `).trim()??`—`;return(0,B.jsxs)(LE,{className:`align-top`,children:[(0,B.jsx)(zE,{className:`font-mono text-xs`,children:e.id}),(0,B.jsx)(zE,{className:`text-xs text-muted-foreground`,children:new Date(e.at).toLocaleString()}),(0,B.jsx)(zE,{className:`text-xs`,children:e.actor}),(0,B.jsx)(zE,{children:(0,B.jsx)(`code`,{className:`app-code`,children:e.action})}),(0,B.jsx)(zE,{className:`font-mono text-xs`,children:e.workerId??`—`}),(0,B.jsx)(zE,{className:`text-xs`,children:r===null?(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`button`,{type:`button`,className:`text-left text-xs text-action-blue underline decoration-hairline underline-offset-2 hover:decoration-action-blue`,onClick:()=>n(e=>!e),children:t?`Hide JSON`:`Show JSON`}),t?(0,B.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-sm bg-soft-stone p-2 font-mono text-micro`,children:r}):(0,B.jsx)(`span`,{className:`line-clamp-1 break-all text-muted-foreground`,children:i})]})})]})}function aD(){return(0,B.jsxs)(`div`,{className:`app-empty flex flex-col items-center justify-center gap-3`,children:[(0,B.jsx)(Sm,{className:`size-10 text-muted-foreground`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No audit events match the current filters.`})]})}function oD({canBack:e,canForward:t,onBack:n,onForward:r}){return(0,B.jsxs)(`div`,{className:`flex justify-between`,children:[(0,B.jsxs)(hg,{variant:`outline`,size:`sm`,disabled:!e,onClick:n,children:[(0,B.jsx)(dm,{className:`size-3.5`}),`Newer`]}),(0,B.jsxs)(hg,{variant:`outline`,size:`sm`,disabled:!t,onClick:r,children:[`Older`,(0,B.jsx)(fm,{className:`size-3.5`})]})]})}function sD(){return(0,B.jsx)(nD,{})}var cD=zi(`/audit`)({component:sD}),lD=zi(`/`)({beforeLoad:()=>{throw kn({to:`/workers`})}});function uD(e){switch(e){case`online`:return`success`;case`offline`:return`secondary`;case`auth-failed`:return`destructive`;case`config-version-mismatch`:return`warning`;default:return`outline`}}function dD(e){return e??`unknown`}var fD=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`}),pD=[{unit:`year`,ms:365*24*3600*1e3},{unit:`month`,ms:720*3600*1e3},{unit:`day`,ms:24*3600*1e3},{unit:`hour`,ms:3600*1e3},{unit:`minute`,ms:60*1e3},{unit:`second`,ms:1e3}];function mD(e,t=Date.now()){if(!e)return`—`;let n=Date.parse(e);if(Number.isNaN(n))return`—`;let r=n-t,i=Math.abs(r);for(let{unit:e,ms:t}of pD)if(i>=t||e===`second`)return fD.format(Math.round(r/t),e);return fD.format(0,`second`)}function hD(e){return e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`}function gD({open:e,onOpenChange:t}){let[n,r]=(0,z.useState)(0);function i(e){e&&r(e=>e+1),t(e)}return(0,B.jsx)(TE,{open:e,onOpenChange:i,children:(0,B.jsx)(kE,{className:`sm:max-w-xl`,children:(0,B.jsx)(_D,{onClose:()=>t(!1)},n)})})}function _D({onClose:e}){let[t,n]=(0,z.useState)(null),r=_i();return t?(0,B.jsx)(xD,{payload:t,onClose:e,onGoToWorker:()=>{e(),r({to:`/workers/$workerId`,params:{workerId:t.id}})}}):(0,B.jsx)(vD,{onCancel:e,onSuccess:n})}function vD({onCancel:e,onSuccess:t}){let n=(0,z.useId)(),r=(0,z.useId)(),[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(``),[c,l]=(0,z.useState)({}),[u,d]=(0,z.useState)(!1),f=gT();function p(){let e={},t=i.trim();return t.length===0?e.displayName=`Display name is required`:t.length>80&&(e.displayName=`Display name must be 80 characters or fewer`),o.trim().length>0&&!Jf.test(o.trim())&&(e.forceId=`Worker id must match w_<12 chars> (base32 crockford)`),Object.keys(e).length>0?e:null}async function m(e){e.preventDefault();let n=p();if(n){l(n);return}l({});try{let e=await f.mutateAsync({displayName:i.trim(),...o.trim().length>0?{forceId:o.trim()}:{}});t({id:e.worker.id,displayName:e.worker.displayName,baseUrl:e.worker.baseUrl,lastSeenState:e.worker.lastSeenState,deviceToken:e.deviceToken})}catch(e){l(yD(e))}}return(0,B.jsxs)(`form`,{onSubmit:m,noValidate:!0,children:[(0,B.jsxs)(AE,{children:[(0,B.jsx)(ME,{children:`Create worker`}),(0,B.jsx)(NE,{children:`The manager spawns a fresh worker container on the local docker engine, scrapes its bootstrap token, and registers it in one step. Takes 10–30 seconds.`})]}),(0,B.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(ZE,{htmlFor:n,children:`Display name`}),(0,B.jsx)(XE,{id:n,placeholder:`prod-edge-1`,value:i,onChange:e=>a(e.target.value),maxLength:80,autoFocus:!0,"aria-invalid":c.displayName?`true`:void 0}),(0,B.jsx)(bD,{message:c.displayName})]}),(0,B.jsx)(`div`,{children:(0,B.jsxs)(`button`,{type:`button`,className:`text-xs text-muted-foreground underline-offset-2 hover:underline`,onClick:()=>d(e=>!e),children:[u?`Hide`:`Show`,` `,`advanced options`]})}),u&&(0,B.jsxs)(`div`,{className:`grid gap-1.5 rounded-sm border border-dashed border-hairline bg-card p-3`,children:[(0,B.jsx)(ZE,{htmlFor:r,children:`Force workerId (optional)`}),(0,B.jsx)(XE,{id:r,placeholder:`w_abcdef123456`,value:o,onChange:e=>s(e.target.value),spellCheck:!1,autoComplete:`off`,"aria-invalid":c.forceId?`true`:void 0}),(0,B.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(Tm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,B.jsx)(`span`,{children:`Pins the container's future workerId. Only useful for deterministic replay / test scenarios — leave empty to let the worker mint its own.`})]}),(0,B.jsx)(bD,{message:c.forceId})]}),c.form&&(0,B.jsx)(`p`,{className:`app-alert-error text-xs`,children:c.form})]}),(0,B.jsxs)(jE,{children:[(0,B.jsx)(hg,{type:`button`,variant:`outline`,onClick:e,children:`Cancel`}),(0,B.jsx)(hg,{type:`submit`,disabled:f.isPending,children:f.isPending?`Launching…`:`Launch`})]})]})}function yD(e){if(e instanceof qw){let t=e;switch(t.code){case`quota-exceeded`:return{form:typeof t.quotaLimit==`number`?`Worker quota reached (${t.quotaCurrent??`?`} / ${t.quotaLimit}). Delete an existing worker or raise MANAGER_MAX_WORKERS.`:`Worker quota reached. Delete an existing worker or raise MANAGER_MAX_WORKERS.`};case`launch-timeout`:return{form:"The worker container took too long to emit its bootstrap token. Check `docker logs` on the host."};case`launch-failed`:return{form:t.message||`Launch failed. Check the dashboard logs and the supervisor prerequisites in docs/deployment.md.`};case`auth-failed`:return{form:`The launched worker rejected its own bootstrap token. This is a bug — file an issue.`};case`worker-unreachable`:return{form:t.message||`The launched worker could not be reached at its baseUrl. Check the docker network membership of the dashboard.`};case`invalid-worker-info`:return{form:`Reached the worker but its /info response was malformed.`};case`already-registered`:return{form:`The worker reported an id that is already in the registry.`};case`invalid-body`:return{form:`The manager rejected the payload. Re-check the fields.`};case`auth-required`:return{form:`Dashboard authentication required. Reload the page and sign in.`};default:return{form:t.message||`Launch failed. Try again.`}}}return{form:`Launch failed. Try again.`}}function bD({message:e}){return e?(0,B.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:e}):null}function xD({payload:e,onClose:t,onGoToWorker:n}){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(!1);async function s(){try{await navigator.clipboard.writeText(e.deviceToken),o(!0),setTimeout(()=>o(!1),1500)}catch{}}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(AE,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-success`,children:[(0,B.jsx)(pm,{className:`size-5`}),(0,B.jsx)(ME,{children:`Worker created`})]}),(0,B.jsxs)(NE,{children:[`The bearer token is shown`,` `,(0,B.jsx)(`strong`,{children:`once`}),` `,`— copy it before closing if you need it outside the dashboard. The manager retains an encrypted copy; the plaintext is not recoverable.`]})]}),(0,B.jsxs)(`dl`,{className:`grid grid-cols-[120px_1fr] gap-x-4 gap-y-2 py-4 text-sm`,children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Worker id`}),(0,B.jsx)(`dd`,{className:`font-mono text-xs`,children:e.id}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Display name`}),(0,B.jsx)(`dd`,{children:e.displayName}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Base URL`}),(0,B.jsx)(`dd`,{className:`break-all font-mono text-xs`,children:e.baseUrl}),e.lastSeenState&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`State`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(PT,{variant:uD(e.lastSeenState),children:dD(e.lastSeenState)})})]})]}),(0,B.jsxs)(`div`,{className:`app-panel text-xs`,children:[(0,B.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 font-medium text-foreground`,children:[(0,B.jsx)(Em,{className:`size-3.5`}),`One-time bearer token`]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-soft-stone px-2 py-1.5 font-mono text-micro`,children:[(0,B.jsx)(`code`,{className:`flex-1 break-all`,children:r?e.deviceToken:e.deviceToken.replace(/./g,`•`)}),(0,B.jsx)(hg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>i(e=>!e),"aria-label":r?`Hide token`:`Show token`,children:r?(0,B.jsx)(ym,{className:`size-3`}):(0,B.jsx)(bm,{className:`size-3`})}),(0,B.jsx)(hg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:s,"aria-label":`Copy token`,children:(0,B.jsx)(gm,{className:`size-3`})})]}),a&&(0,B.jsx)(`p`,{role:`status`,className:`mt-1 text-success`,children:`Copied.`}),(0,B.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-muted-foreground`,children:[(0,B.jsx)(Fm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,B.jsx)(`span`,{children:`This value is not shown again. If you lose it, rotate the token from the worker's detail page.`})]})]}),(0,B.jsxs)(jE,{children:[(0,B.jsx)(hg,{variant:`outline`,onClick:t,children:`Close`}),(0,B.jsx)(hg,{onClick:n,children:`Go to worker`})]})]})}function SD({open:e,onOpenChange:t}){let[n,r]=(0,z.useState)(0);function i(e){e&&r(e=>e+1),t(e)}return(0,B.jsx)(TE,{open:e,onOpenChange:i,children:(0,B.jsx)(kE,{className:`sm:max-w-xl`,children:(0,B.jsx)(CD,{onClose:()=>t(!1)},n)})})}function CD({onClose:e}){let[t,n]=(0,z.useState)(null),r=_i();return t?(0,B.jsx)(OD,{worker:t.worker,deviceToken:t.deviceToken,onClose:e,onGoToWorker:()=>{e(),r({to:`/workers/$workerId`,params:{workerId:t.worker.id}})}}):(0,B.jsx)(wD,{onCancel:e,onSuccess:n})}function wD({onCancel:e,onSuccess:t}){let n=(0,z.useId)(),r=(0,z.useId)(),i=(0,z.useId)(),a=(0,z.useId)(),[o,s]=(0,z.useState)(``),[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(``),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(null),[g,_]=(0,z.useState)(!1),[v,y]=(0,z.useState)({}),b=hT();function x(){let e=Zf();l(e),h(e),p(!0),_(!1),y(e=>({...e,apiToken:void 0}))}async function S(){if(m)try{await navigator.clipboard.writeText(m),_(!0),setTimeout(()=>_(!1),1500)}catch{}}function C(){let e={};try{let t=new URL(o);t.protocol!==`http:`&&t.protocol!==`https:`&&(e.baseUrl=`Base URL must use http(s)://`)}catch{e.baseUrl=`Enter a valid URL (e.g. https://worker.example.com)`}c.startsWith(`wtk_`)||(e.apiToken=`API token must start with ${Yf}`);let t=u.trim();return t.length===0?e.displayName=`Display name is required`:t.length>80&&(e.displayName=`Display name must be 80 characters or fewer`),Object.keys(e).length>0?e:null}async function w(e){e.preventDefault();let n=C();if(n){y(n);return}y({});try{t(await b.mutateAsync({baseUrl:o.replace(/\/+$/,``),bootstrapToken:c,displayName:u.trim()}))}catch(e){y(ED(e))}}return(0,B.jsxs)(`form`,{onSubmit:w,noValidate:!0,children:[(0,B.jsxs)(AE,{children:[(0,B.jsx)(ME,{children:`Register a worker`}),(0,B.jsxs)(NE,{children:[`The manager calls`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`/api/worker/info`}),` `,`on the worker to verify the bearer token before storing it.`]})]}),(0,B.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(ZE,{htmlFor:n,children:`Base URL`}),(0,B.jsx)(XE,{id:n,placeholder:`http://aiworker-worker:9217`,value:o,onChange:e=>s(e.target.value),autoComplete:`off`,autoFocus:!0,"data-invalid":v.baseUrl?`true`:void 0,"aria-invalid":v.baseUrl?`true`:void 0,"aria-describedby":a}),(0,B.jsxs)(`p`,{id:a,className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(Tm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,B.jsxs)(`span`,{children:[`Worker's HTTP root — scheme + host/port, no trailing path. Typical shapes:`,(0,B.jsx)(`code`,{className:`app-code mx-1`,children:`http://aiworker-worker:9217`}),`(same compose),`,(0,B.jsx)(`code`,{className:`app-code mx-1`,children:`https://worker-1.example.com`}),`(reverse proxy),`,(0,B.jsx)(`code`,{className:`app-code mx-1`,children:`http://203.0.113.10:9217`}),`(direct port).`]})]}),(0,B.jsx)(DD,{message:v.baseUrl})]}),(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(ZE,{htmlFor:r,children:`Bootstrap API token`}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(XE,{id:r,placeholder:`wtk_…`,value:c,onChange:e=>{l(e.target.value),m&&e.target.value!==m&&h(null)},type:f?`text`:`password`,autoComplete:`off`,spellCheck:!1,"aria-invalid":v.apiToken?`true`:void 0}),(0,B.jsx)(hg,{type:`button`,variant:`outline`,size:`icon`,"aria-label":f?`Hide API token`:`Show API token`,onClick:()=>p(e=>!e),children:f?(0,B.jsx)(ym,{className:`size-4`}):(0,B.jsx)(bm,{className:`size-4`})}),(0,B.jsxs)(hg,{type:`button`,variant:`outline`,onClick:x,"aria-label":`Generate API token`,children:[(0,B.jsx)(Mm,{className:`size-4`}),`Generate`]})]}),(0,B.jsx)(DD,{message:v.apiToken}),m&&(0,B.jsxs)(`div`,{className:`app-panel text-xs`,children:[(0,B.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Token minted in this browser.`}),(0,B.jsxs)(`p`,{className:`mb-2 text-muted-foreground`,children:[`Set it as an env var on the worker container before first boot — only honoured on a fresh worker (no`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`worker_identity`}),` `,`row yet):`]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-soft-stone px-2 py-1.5 font-mono text-micro`,children:[(0,B.jsxs)(`code`,{className:`flex-1 break-all`,children:[`AIWORKER_FORCE_TOKEN=`,m]}),(0,B.jsx)(hg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:S,"aria-label":`Copy env assignment`,children:(0,B.jsx)(gm,{className:`size-3`})})]}),g&&(0,B.jsx)(`p`,{role:`status`,className:`mt-1 text-success`,children:`Copied.`}),(0,B.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:`If the worker already minted its own token on a previous boot, this env var is ignored and registration will fail — use the token from its startup logs instead.`})]}),(0,B.jsx)(TD,{})]}),(0,B.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,B.jsx)(ZE,{htmlFor:i,children:`Display name`}),(0,B.jsx)(XE,{id:i,placeholder:`prod-edge-1`,value:u,onChange:e=>d(e.target.value),maxLength:80,"aria-invalid":v.displayName?`true`:void 0}),(0,B.jsx)(DD,{message:v.displayName})]}),v.form&&(0,B.jsx)(`p`,{className:`app-alert-error text-xs`,children:v.form})]}),(0,B.jsxs)(jE,{children:[(0,B.jsx)(hg,{type:`button`,variant:`outline`,onClick:e,children:`Cancel`}),(0,B.jsx)(hg,{type:`submit`,disabled:b.isPending,children:b.isPending?`Pairing…`:`Pair worker`})]})]})}function TD(){return(0,B.jsxs)(`details`,{className:`rounded-sm border border-dashed border-hairline bg-card px-3 py-2 text-xs`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer select-none font-medium text-muted-foreground`,children:`Using an agentic engine? You'll also need to seed CLI auth on the worker.`}),(0,B.jsxs)(`p`,{className:`mt-2 text-muted-foreground`,children:[`The bearer token above only authorises dashboard → worker calls.`,` `,"claude-code / codex / gemini / qwen / cursor each need their own login state (`~/.claude.json`, `~/.codex/auth.json`, etc.) inside the worker container. Two recipes:"]}),(0,B.jsxs)(`ul`,{className:`mt-1.5 ml-4 list-disc text-muted-foreground`,children:[(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`strong`,{children:`Mount the host's auth dir`}),` `,`into the container (read-only), or`]}),(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`strong`,{children:`docker exec <worker> <cli> login`}),` `,`once inside a fresh container.`]})]}),(0,B.jsxs)(`p`,{className:`mt-2 text-muted-foreground`,children:[`Full walkthrough:`,` `,(0,B.jsx)(`a`,{className:`underline decoration-dotted underline-offset-2 hover:text-foreground`,href:`/docs/executor-engines.md#auth-recipes`,target:`_blank`,rel:`noreferrer`,children:`docs/executor-engines.md#auth-recipes`}),` `,`· starter compose:`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`ops/compose/docker-compose.worker.example.yml`})]})]})}function ED(e){if(e instanceof qw)switch(e.code){case`auth-failed`:return{apiToken:`Worker rejected this token (HTTP 401). Double-check the value.`};case`already-registered`:return{displayName:e.workerId?`This worker is already registered as ${e.workerId}.`:`This worker is already registered.`};case`worker-unreachable`:return{baseUrl:e.message||`Could not reach this worker (HTTP 502).`};case`invalid-worker-info`:return{baseUrl:`Reached the worker but its /info response was malformed.`};case`invalid-body`:return{form:`The manager rejected the payload. Re-check each field.`};default:return{form:e.message||`Registration failed. Try again.`}}return{form:`Registration failed. Try again.`}}function DD({message:e}){return e?(0,B.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:e}):null}function OD({worker:e,deviceToken:t,onClose:n,onGoToWorker:r}){let[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)(!1);async function c(){try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),1500)}catch{}}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(AE,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-success`,children:[(0,B.jsx)(pm,{className:`size-5`}),(0,B.jsx)(ME,{children:`Worker paired`})]}),(0,B.jsxs)(NE,{children:[`The fleet has issued a fresh`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`deviceToken`}),` `,`for this worker. It is shown`,` `,(0,B.jsx)(`strong`,{children:`once`}),` `,`and not stored in browser storage — copy it before closing if needed.`]})]}),(0,B.jsxs)(`dl`,{className:`grid grid-cols-[120px_1fr] gap-x-4 gap-y-2 py-4 text-sm`,children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Worker id`}),(0,B.jsx)(`dd`,{className:`font-mono text-xs`,children:e.id}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Display name`}),(0,B.jsx)(`dd`,{children:e.displayName}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Base URL`}),(0,B.jsx)(`dd`,{className:`break-all font-mono text-xs`,children:e.baseUrl||`—`}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`State`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(PT,{variant:uD(e.lastSeenState),children:dD(e.lastSeenState)})})]}),(0,B.jsxs)(`div`,{className:`app-panel text-xs`,children:[(0,B.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 font-medium text-foreground`,children:[(0,B.jsx)(Em,{className:`size-3.5`}),`One-time deviceToken`]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-soft-stone px-2 py-1.5 font-mono text-micro`,children:[(0,B.jsx)(`code`,{className:`flex-1 break-all`,children:i?t:t.replace(/./g,`•`)}),(0,B.jsx)(hg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>a(e=>!e),"aria-label":i?`Hide token`:`Show token`,children:i?(0,B.jsx)(ym,{className:`size-3`}):(0,B.jsx)(bm,{className:`size-3`})}),(0,B.jsx)(hg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:c,"aria-label":`Copy token`,children:(0,B.jsx)(gm,{className:`size-3`})})]}),o&&(0,B.jsx)(`p`,{role:`status`,className:`mt-1 text-success`,children:`Copied.`}),(0,B.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-muted-foreground`,children:[(0,B.jsx)(Fm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,B.jsx)(`span`,{children:`This value is not shown again. If lost, rotate the token from the worker's detail page.`})]})]}),(0,B.jsxs)(jE,{children:[(0,B.jsx)(hg,{variant:`outline`,onClick:n,children:`Close`}),(0,B.jsx)(hg,{onClick:r,children:`Go to worker`})]})]})}function kD({worker:e,open:t,onOpenChange:n}){let[r,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(null),s=_T(),c=e.displayName;function l(){i(``),o(null)}return(0,B.jsx)(TE,{open:t,onOpenChange:e=>{e||l(),n(e)},children:(0,B.jsxs)(kE,{className:`sm:max-w-lg`,children:[(0,B.jsxs)(AE,{children:[(0,B.jsx)(ME,{children:`Remove worker`}),(0,B.jsxs)(NE,{children:[`Removing`,` `,(0,B.jsx)(`strong`,{children:e.displayName}),` `,`invalidates its`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`deviceToken`}),` `,`and deletes its fleet.db row. The worker container itself is not stopped — use the`,` `,(0,B.jsx)(`em`,{children:`Stop runtime`}),` `,`action first if you also want to halt it.`]})]}),(0,B.jsxs)(`div`,{className:`grid gap-2 py-4 text-sm`,children:[(0,B.jsxs)(ZE,{htmlFor:`remove-confirm`,children:[`Type`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:c}),` `,`to confirm`]}),(0,B.jsx)(XE,{id:`remove-confirm`,value:r,autoFocus:!0,autoComplete:`off`,spellCheck:!1,onChange:e=>i(e.target.value)})]}),a&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error text-xs`,children:a}),(0,B.jsxs)(jE,{children:[(0,B.jsx)(hg,{variant:`outline`,onClick:()=>n(!1),disabled:s.isPending,children:`Cancel`}),(0,B.jsxs)(hg,{variant:`destructive`,disabled:s.isPending||r!==c,onClick:async()=>{o(null);try{await s.mutateAsync(e.id),n(!1)}catch(e){o(e instanceof qw||e instanceof Error?e.message:String(e))}},children:[(0,B.jsx)(Pm,{className:`size-4`}),s.isPending?`Removing…`:`Remove worker`]})]})]})})}function AD({worker:e,open:t,onOpenChange:n}){let[r,i]=(0,z.useState)(0);function a(e){e&&i(e=>e+1),n(e)}return(0,B.jsx)(TE,{open:t,onOpenChange:a,children:(0,B.jsx)(kE,{className:`sm:max-w-lg`,children:(0,B.jsx)(jD,{worker:e,onClose:()=>n(!1)},r)})})}function jD({worker:e,onClose:t}){let[n,r]=(0,z.useState)(null),[i,a]=(0,z.useState)(null),o=yT();return n?(0,B.jsx)(MD,{worker:e,deviceToken:n,onClose:t}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(AE,{children:[(0,B.jsx)(ME,{children:`Rotate device token`}),(0,B.jsxs)(NE,{children:[`Issuing a new`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`deviceToken`}),` `,`immediately invalidates the previous one. The worker must re-pair (or auto-reconnect with the new token) before it can talk to the fleet again.`]})]}),(0,B.jsxs)(`dl`,{className:`grid grid-cols-[100px_1fr] gap-x-4 gap-y-2 py-4 text-sm`,children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Worker`}),(0,B.jsx)(`dd`,{className:`font-medium`,children:e.displayName}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Worker id`}),(0,B.jsx)(`dd`,{className:`font-mono text-xs`,children:e.id})]}),i&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error text-xs`,children:i}),(0,B.jsxs)(jE,{children:[(0,B.jsx)(hg,{variant:`outline`,onClick:t,disabled:o.isPending,children:`Cancel`}),(0,B.jsxs)(hg,{disabled:o.isPending,onClick:async()=>{a(null);try{r((await o.mutateAsync(e.id)).deviceToken)}catch(e){a(e instanceof qw||e instanceof Error?e.message:String(e))}},children:[(0,B.jsx)(Am,{className:`size-4`}),o.isPending?`Rotating…`:`Rotate token`]})]})]})}function MD({worker:e,deviceToken:t,onClose:n}){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(!1);async function s(){try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),1500)}catch{}}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(AE,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-success`,children:[(0,B.jsx)(pm,{className:`size-5`}),(0,B.jsx)(ME,{children:`Token rotated`})]}),(0,B.jsxs)(NE,{children:[`New deviceToken for`,` `,(0,B.jsx)(`strong`,{children:e.displayName}),` `,`shown`,` `,(0,B.jsx)(`strong`,{children:`once`}),`. Copy it before closing — the fleet retains only an encrypted copy.`]})]}),(0,B.jsxs)(`div`,{className:`app-panel text-xs`,children:[(0,B.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 font-medium text-foreground`,children:[(0,B.jsx)(Em,{className:`size-3.5`}),`One-time deviceToken`]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-soft-stone px-2 py-1.5 font-mono text-micro`,children:[(0,B.jsx)(`code`,{className:`flex-1 break-all`,children:r?t:t.replace(/./g,`•`)}),(0,B.jsx)(hg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>i(e=>!e),"aria-label":r?`Hide token`:`Show token`,children:r?(0,B.jsx)(ym,{className:`size-3`}):(0,B.jsx)(bm,{className:`size-3`})}),(0,B.jsx)(hg,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6`,onClick:s,"aria-label":`Copy token`,children:(0,B.jsx)(gm,{className:`size-3`})})]}),a&&(0,B.jsx)(`p`,{role:`status`,className:`mt-1 text-success`,children:`Copied.`}),(0,B.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-muted-foreground`,children:[(0,B.jsx)(Fm,{className:`mt-0.5 size-3.5 shrink-0`}),(0,B.jsx)(`span`,{children:`This value is not shown again. Lost tokens require another rotation.`})]})]}),(0,B.jsx)(jE,{children:(0,B.jsx)(hg,{onClick:n,children:`Close`})})]})}function ND({worker:e,open:t,onOpenChange:n}){let[r,i]=(0,z.useState)(null),a=vT();return(0,B.jsx)(TE,{open:t,onOpenChange:n,children:(0,B.jsxs)(kE,{className:`sm:max-w-lg`,children:[(0,B.jsxs)(AE,{children:[(0,B.jsx)(ME,{children:`Stop worker runtime`}),(0,B.jsxs)(NE,{children:[`Sends`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:`workers.stop`}),` `,`to`,` `,(0,B.jsx)(`strong`,{children:e.displayName}),`. The fleet.db row is kept so the worker can reconnect later. Use`,` `,(0,B.jsx)(`em`,{children:`Remove from fleet`}),` `,`if you also want to invalidate its deviceToken.`]})]}),r&&(0,B.jsx)(`p`,{role:`alert`,className:`app-alert-error my-2 text-xs`,children:r}),(0,B.jsxs)(jE,{children:[(0,B.jsx)(hg,{variant:`outline`,onClick:()=>n(!1),disabled:a.isPending,children:`Cancel`}),(0,B.jsxs)(hg,{disabled:a.isPending,onClick:async()=>{i(null);try{await a.mutateAsync(e.id),n(!1)}catch(e){i(e instanceof qw||e instanceof Error?e.message:String(e))}},children:[(0,B.jsx)(km,{className:`size-4`}),a.isPending?`Stopping…`:`Stop runtime`]})]})]})})}function PD({value:e,label:t}){let[n,r]=(0,z.useState)(!1);return(0,B.jsx)(hg,{variant:`ghost`,size:`icon`,"aria-label":`Copy ${t}`,className:`size-6`,onClick:t=>{t.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1200)})},children:n?(0,B.jsx)(um,{className:`size-3.5`}):(0,B.jsx)(gm,{className:`size-3.5`})})}function FD({workers:e}={}){let t=_i(),n=pT(),[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(null),l=e??n.data,u=e===void 0&&n.isLoading;return(0,B.jsxs)(`div`,{className:`app-page`,children:[(0,B.jsxs)(`div`,{className:`app-page-header sm:flex-row sm:items-end sm:justify-between`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h1`,{className:`app-page-title`,children:`Workers`}),(0,B.jsx)(`p`,{className:`app-page-copy`,children:`Registered AIWorker runtimes the fleet can drive.`})]}),(0,B.jsxs)(`div`,{className:`flex w-full flex-col gap-2 sm:w-auto sm:flex-row`,children:[(0,B.jsxs)(hg,{variant:`outline`,className:`w-full sm:w-auto`,onClick:()=>i(!0),children:[(0,B.jsx)(mm,{className:`size-4`}),`Pair worker`]}),(0,B.jsxs)(hg,{className:`w-full sm:w-auto`,onClick:()=>o(!0),children:[(0,B.jsx)(Mm,{className:`size-4`}),`Launch worker`]})]})]}),u?(0,B.jsx)(RD,{}):l&&l.length>0?(0,B.jsx)(`div`,{className:`overflow-hidden rounded-sm border border-hairline bg-card`,children:(0,B.jsxs)(PE,{children:[(0,B.jsx)(FE,{children:(0,B.jsxs)(LE,{children:[(0,B.jsx)(RE,{children:`Display name`}),(0,B.jsx)(RE,{children:`Worker id`}),(0,B.jsx)(RE,{children:`Base URL`}),(0,B.jsx)(RE,{children:`Last seen`}),(0,B.jsx)(RE,{children:`State`}),(0,B.jsx)(RE,{className:`w-[1%] text-right`,children:`Actions`})]})}),(0,B.jsx)(IE,{children:l.map(e=>(0,B.jsxs)(LE,{className:`cursor-pointer`,onClick:()=>void t({to:`/workers/$workerId`,params:{workerId:e.id}}),children:[(0,B.jsx)(zE,{className:`font-medium`,children:e.displayName}),(0,B.jsx)(zE,{children:(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(`code`,{className:`app-code`,children:hD(e.id)}),(0,B.jsx)(PD,{value:e.id,label:`worker id`})]})}),(0,B.jsx)(zE,{children:e.baseUrl?(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsxs)(`a`,{href:e.baseUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-action-blue underline decoration-hairline underline-offset-2 hover:decoration-action-blue`,onClick:e=>e.stopPropagation(),children:[e.baseUrl,(0,B.jsx)(vm,{className:`size-3`})]}),(0,B.jsx)(PD,{value:e.baseUrl,label:`base URL`})]}):(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})}),(0,B.jsx)(zE,{className:`text-xs text-muted-foreground`,children:mD(e.lastSeenAt)}),(0,B.jsx)(zE,{children:(0,B.jsx)(PT,{variant:uD(e.lastSeenState),children:dD(e.lastSeenState)})}),(0,B.jsx)(zE,{className:`text-right`,onClick:e=>e.stopPropagation(),children:(0,B.jsx)(ID,{worker:e,onRotate:()=>c({kind:`rotate`,worker:e}),onRemove:()=>c({kind:`remove`,worker:e}),onStop:()=>c({kind:`stop`,worker:e})})})]},e.id))})]})}):(0,B.jsx)(zD,{onRegister:()=>i(!0)}),(0,B.jsx)(SD,{open:r,onOpenChange:i}),(0,B.jsx)(gD,{open:a,onOpenChange:o}),s?.kind===`rotate`&&(0,B.jsx)(AD,{worker:s.worker,open:!0,onOpenChange:e=>!e&&c(null)}),s?.kind===`remove`&&(0,B.jsx)(kD,{worker:s.worker,open:!0,onOpenChange:e=>!e&&c(null)}),s?.kind===`stop`&&(0,B.jsx)(ND,{worker:s.worker,open:!0,onOpenChange:e=>!e&&c(null)})]})}function ID({worker:e,onRotate:t,onRemove:n,onStop:r}){let[i,a]=(0,z.useState)(!1),o=e.lastSeenState===`online`;return(0,B.jsxs)(`div`,{className:`relative inline-block text-left`,children:[(0,B.jsx)(hg,{variant:`ghost`,size:`icon`,"aria-label":`Worker actions`,"aria-haspopup":`menu`,"aria-expanded":i,className:`size-8`,onClick:()=>a(e=>!e),children:(0,B.jsx)(_m,{className:`size-4`})}),i&&(0,B.jsxs)(`div`,{role:`menu`,className:`absolute right-0 z-20 mt-1 w-48 rounded-sm border border-hairline bg-popover p-1 text-sm shadow-popover`,onMouseLeave:()=>a(!1),children:[(0,B.jsxs)(`a`,{role:`menuitem`,href:LD(e.id),target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-2 rounded-xs px-2 py-1.5 hover:bg-soft-stone`,onClick:()=>a(!1),children:[(0,B.jsx)(vm,{className:`size-3.5`}),`Open worker UI`]}),(0,B.jsx)(`button`,{role:`menuitem`,type:`button`,className:`flex w-full items-center gap-2 rounded-xs px-2 py-1.5 text-left hover:bg-soft-stone`,onClick:()=>{a(!1),t()},children:`Rotate token`}),(0,B.jsx)(`button`,{role:`menuitem`,type:`button`,disabled:!o,title:o?void 0:`Stop is only available while the worker is online.`,className:`flex w-full items-center gap-2 rounded-xs px-2 py-1.5 text-left hover:bg-soft-stone disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`,onClick:()=>{a(!1),r()},children:`Stop runtime`}),(0,B.jsx)(`button`,{role:`menuitem`,type:`button`,className:`flex w-full items-center gap-2 rounded-xs px-2 py-1.5 text-left text-destructive hover:bg-destructive/10`,onClick:()=>{a(!1),n()},children:`Remove from fleet`})]})]})}function LD(e){return`/w/${e}/`}function RD(){return(0,B.jsx)(`div`,{className:`overflow-hidden rounded-sm border border-hairline bg-card`,children:(0,B.jsx)(`div`,{className:`space-y-3 p-4 sm:p-6`,children:[0,1,2].map(e=>(0,B.jsx)(ET,{className:`h-10 w-full`},e))})})}function zD({onRegister:e}){return(0,B.jsxs)(`div`,{className:`app-empty flex flex-col items-center justify-center gap-3`,children:[(0,B.jsx)(jm,{className:`size-10 text-muted-foreground`}),(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`h2`,{className:`text-feature font-normal text-foreground`,children:`No workers registered yet`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Click Pair to attach a worker that has already started — it just needs the worker's base URL and bootstrap API token.`})]}),(0,B.jsxs)(hg,{className:`w-full sm:w-auto`,onClick:e,children:[(0,B.jsx)(mm,{className:`size-4`}),`Register a worker`]})]})}function BD(){return(0,B.jsx)(FD,{})}var VD=zi(`/workers/`)({component:BD});function HD(){let{workerId:e}=hi({from:`/workers/$workerId`}),t=lT(e=>e.setCurrentWorkerId),n=mT(e),[r,i]=(0,z.useState)(null);if((0,z.useEffect)(()=>(t(e),()=>t(null)),[e,t]),n.isLoading)return(0,B.jsxs)(`div`,{className:`space-y-3 p-2`,children:[(0,B.jsx)(ET,{className:`h-8 w-64`}),(0,B.jsx)(ET,{className:`h-40 w-full max-w-3xl`})]});if(n.isError&&n.error instanceof qw&&n.error.code===`not-found`)return(0,B.jsx)(JD,{id:e});if(!n.data)return(0,B.jsxs)(`div`,{className:`app-alert-error`,children:[`Failed to load worker`,` `,e,`:`,` `,n.error?.message??`unknown error`]});let a=n.data,o=GD(a.id),s=a.lastSeenState===`online`;return(0,B.jsxs)(`div`,{className:`app-page`,children:[(0,B.jsxs)(`div`,{className:`app-page-header lg:flex-row lg:items-end lg:justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(Ni,{to:`/workers`,className:`mb-2 inline-flex items-center gap-1 text-xs text-muted-foreground underline decoration-hairline underline-offset-2 hover:text-foreground`,children:[(0,B.jsx)(sm,{className:`size-3.5`}),`Back to workers`]}),(0,B.jsx)(`h1`,{className:`app-page-title`,children:a.displayName}),(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,B.jsx)(`code`,{className:`app-code`,children:hD(a.id)}),` · `,(0,B.jsx)(PT,{variant:uD(a.lastSeenState),children:dD(a.lastSeenState)})]})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`a`,{href:o,target:`_blank`,rel:`noreferrer`,className:mg({variant:`default`}),children:[(0,B.jsx)(vm,{className:`size-4`}),`Open worker UI`]}),(0,B.jsxs)(hg,{variant:`outline`,onClick:()=>i(`rotate`),children:[(0,B.jsx)(Am,{className:`size-4`}),`Rotate token`]}),(0,B.jsxs)(hg,{variant:`outline`,disabled:!s,title:s?void 0:`Stop is only available while the worker is online.`,onClick:()=>i(`stop`),children:[(0,B.jsx)(km,{className:`size-4`}),`Stop runtime`]}),(0,B.jsxs)(hg,{variant:`destructive`,onClick:()=>i(`remove`),children:[(0,B.jsx)(Pm,{className:`size-4`}),`Remove`]})]})]}),(0,B.jsx)(UD,{worker:a}),(0,B.jsx)(qD,{worker:a}),(0,B.jsx)(WD,{worker:a}),r===`rotate`&&(0,B.jsx)(AD,{worker:a,open:!0,onOpenChange:e=>!e&&i(null)}),r===`remove`&&(0,B.jsx)(kD,{worker:a,open:!0,onOpenChange:e=>!e&&i(null)}),r===`stop`&&(0,B.jsx)(ND,{worker:a,open:!0,onOpenChange:e=>!e&&i(null)})]})}function UD({worker:e}){return(0,B.jsxs)(xT,{children:[(0,B.jsxs)(ST,{children:[(0,B.jsx)(CT,{children:`Fleet record`}),(0,B.jsx)(wT,{children:`fleet.db pointer for this worker. Config / secrets / cron / approvals live in the worker's own database; fleet opens a same-origin worker UI bridge for those.`})]}),(0,B.jsx)(TT,{children:(0,B.jsxs)(`dl`,{className:`grid grid-cols-1 gap-x-6 gap-y-3 text-sm sm:grid-cols-[140px_1fr]`,children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Worker id`}),(0,B.jsx)(`dd`,{className:`break-all font-mono text-xs`,children:e.id}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Display name`}),(0,B.jsx)(`dd`,{children:e.displayName}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Base URL`}),(0,B.jsx)(`dd`,{className:`break-all font-mono text-xs`,children:e.baseUrl||`—`}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Origin`}),(0,B.jsx)(`dd`,{className:`font-mono text-xs`,children:e.addedBy}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Last seen`}),(0,B.jsx)(`dd`,{children:mD(e.lastSeenAt)}),(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:`Last config version`}),(0,B.jsx)(`dd`,{className:`font-mono text-xs`,children:e.lastConfigVersion??`—`})]})})]})}function WD({worker:e}){let t=GD(e.id);return(0,B.jsxs)(xT,{children:[(0,B.jsxs)(ST,{children:[(0,B.jsx)(CT,{children:`Fleet-hosted worker UI`}),(0,B.jsx)(wT,{children:`Config / secrets / cron / approvals / chat for this worker live in its own database. The fleet path opens the worker bundle through the gateway bridge.`})]}),(0,B.jsx)(TT,{children:(0,B.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:mg({variant:`outline`}),children:[(0,B.jsx)(vm,{className:`size-4`}),t]})})]})}function GD(e){return`/w/${e}/`}function KD(e){return`/w/${e}/#/brain`}function qD({worker:e}){let t=KD(e.id);return(0,B.jsxs)(xT,{children:[(0,B.jsxs)(ST,{children:[(0,B.jsx)(CT,{children:`Brain (PLAN-103)`}),(0,B.jsx)(wT,{children:`scope manifest、Soul、artifact 注册表与 admission 审批由 worker 数据面拥有;fleet 控制面只持有 fleet.db 指针 + audit,不复制 proposal 全文、artifact 内容或 canonical brain。请打开 worker UI 的 Brain 视图进行审批。`})]}),(0,B.jsx)(TT,{children:(0,B.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:mg({variant:`outline`}),children:[(0,B.jsx)(lm,{className:`size-4`}),`Open worker Brain admin`]})})]})}function JD({id:e}){return(0,B.jsxs)(`div`,{className:`app-empty flex flex-col items-center justify-center gap-3`,children:[(0,B.jsx)(`h1`,{className:`text-feature font-normal text-foreground`,children:`Worker not found`}),(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No registered worker with id`,` `,(0,B.jsx)(`code`,{className:`app-code`,children:e}),`.`]}),(0,B.jsx)(Ni,{to:`/workers`,className:mg({variant:`default`}),children:`Back to workers`})]})}var YD=zi(`/workers/$workerId`)({component:HD}),XD=MT.update({id:`/presence`,path:`/presence`,getParentRoute:()=>pw}),ZD=YE.update({id:`/enroll`,path:`/enroll`,getParentRoute:()=>pw}),QD=cD.update({id:`/audit`,path:`/audit`,getParentRoute:()=>pw}),$D=lD.update({id:`/`,path:`/`,getParentRoute:()=>pw}),eO=VD.update({id:`/workers/`,path:`/workers/`,getParentRoute:()=>pw}),tO={IndexRoute:$D,AuditRoute:QD,EnrollRoute:ZD,PresenceRoute:XD,WorkersWorkerIdRoute:YD.update({id:`/workers/$workerId`,path:`/workers/$workerId`,getParentRoute:()=>pw}),WorkersIndexRoute:eO},nO=pw._addFileChildren(tO)._addFileTypes();Qa(`fleet`);var rO=ea({routeTree:nO,basepath:Yp(`fleet`),defaultPreload:`intent`,defaultPreloadStaleTime:0,scrollRestoration:!0}),iO=document.getElementById(`root`);if(!iO)throw Error(`Root element not found`);(0,sa.createRoot)(iO).render((0,B.jsx)(z.StrictMode,{children:(0,B.jsxs)(ze,{client:to,children:[(0,B.jsx)($a,{scope:`fleet`}),(0,B.jsx)(ra,{router:rO}),(0,B.jsx)(eo,{})]})}));