@bryanhu/codexly 0.2.0 → 0.4.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 (204) hide show
  1. package/CHANGELOG.md +34 -1
  2. package/dist/{chunk-AWQWQU2B.js → chunk-63TSFHXS.js} +429 -77
  3. package/dist/{chunk-TEPSAXZZ.js → chunk-6W2NSQP6.js} +1 -1
  4. package/dist/{chunk-2P25XCI6.js → chunk-I5XCZA2U.js} +191 -39
  5. package/dist/{chunk-MH54VCZJ.js → chunk-TGDKFWII.js} +60 -2
  6. package/dist/cli.js +5 -5
  7. package/dist/client/index.js +25 -3
  8. package/dist/protocol/index.js +1 -1
  9. package/dist/providers/codex/index.js +2 -2
  10. package/dist/server/index.js +4 -4
  11. package/dist/web/.vite/manifest.json +264 -257
  12. package/dist/web/.vite/manifest.json.br +0 -0
  13. package/dist/web/.vite/manifest.json.gz +0 -0
  14. package/dist/web/assets/button-SdoQawHa.js +1 -0
  15. package/dist/web/assets/button-SdoQawHa.js.br +0 -0
  16. package/dist/web/assets/button-SdoQawHa.js.gz +0 -0
  17. package/dist/web/assets/button-group-cIDkfDF9.js +1 -0
  18. package/dist/web/assets/button-group-cIDkfDF9.js.br +0 -0
  19. package/dist/web/assets/button-group-cIDkfDF9.js.gz +0 -0
  20. package/dist/web/assets/{checkbox-CCES4UbV.js → checkbox-BlpFo5_d.js} +1 -1
  21. package/dist/web/assets/checkbox-BlpFo5_d.js.br +0 -0
  22. package/dist/web/assets/{checkbox-CCES4UbV.js.gz → checkbox-BlpFo5_d.js.gz} +0 -0
  23. package/dist/web/assets/{chunk-BO2N2NFS-BWAdG1_E.js → chunk-BO2N2NFS-D3J36g1Z.js} +5 -5
  24. package/dist/web/assets/chunk-BO2N2NFS-D3J36g1Z.js.br +0 -0
  25. package/dist/web/assets/chunk-BO2N2NFS-D3J36g1Z.js.gz +0 -0
  26. package/dist/web/assets/{code-highlighter-CHF26Qu6.js → code-highlighter-Cl_7OKC4.js} +1 -1
  27. package/dist/web/assets/code-highlighter-Cl_7OKC4.js.br +0 -0
  28. package/dist/web/assets/code-highlighter-Cl_7OKC4.js.gz +0 -0
  29. package/dist/web/assets/code-languages-CoeGleQS.js +2 -0
  30. package/dist/web/assets/code-languages-CoeGleQS.js.br +0 -0
  31. package/dist/web/assets/code-languages-CoeGleQS.js.gz +0 -0
  32. package/dist/web/assets/cpp-DrC1WCyF.js +1 -0
  33. package/dist/web/assets/cpp-DrC1WCyF.js.br +0 -0
  34. package/dist/web/assets/cpp-DrC1WCyF.js.gz +0 -0
  35. package/dist/web/assets/cpp-DuI2J82L.js +1 -0
  36. package/dist/web/assets/cpp-DuI2J82L.js.br +0 -0
  37. package/dist/web/assets/cpp-DuI2J82L.js.gz +0 -0
  38. package/dist/web/assets/{engine-compile-DQ0HPfe0.js → engine-compile-Bqjaa_8Z.js} +14 -14
  39. package/dist/web/assets/engine-compile-Bqjaa_8Z.js.br +0 -0
  40. package/dist/web/assets/engine-compile-Bqjaa_8Z.js.gz +0 -0
  41. package/dist/web/assets/es2015-B-skuqay.js +41 -0
  42. package/dist/web/assets/es2015-B-skuqay.js.br +0 -0
  43. package/dist/web/assets/es2015-B-skuqay.js.gz +0 -0
  44. package/dist/web/assets/{file-CdvUKvsI.js → file-DwOQ4CRt.js} +1 -1
  45. package/dist/web/assets/file-DwOQ4CRt.js.br +0 -0
  46. package/dist/web/assets/file-DwOQ4CRt.js.gz +0 -0
  47. package/dist/web/assets/{file-review-dialog-D2A8VOae.js → file-review-dialog-BmXxZad1.js} +2 -2
  48. package/dist/web/assets/file-review-dialog-BmXxZad1.js.br +0 -0
  49. package/dist/web/assets/file-review-dialog-BmXxZad1.js.gz +0 -0
  50. package/dist/web/assets/{file-tree-AZsgAlZn.js → file-tree-Bl6o98td.js} +1 -1
  51. package/dist/web/assets/file-tree-Bl6o98td.js.br +0 -0
  52. package/dist/web/assets/file-tree-Bl6o98td.js.gz +0 -0
  53. package/dist/web/assets/{git-commit-horizontal-C0Tc8kLo.js → git-commit-horizontal-1BtAo1_y.js} +1 -1
  54. package/dist/web/assets/git-commit-horizontal-1BtAo1_y.js.br +0 -0
  55. package/dist/web/assets/git-commit-horizontal-1BtAo1_y.js.gz +0 -0
  56. package/dist/web/assets/{git-history-panel-CeJ0MXUi.js → git-history-panel-zXprGDsD.js} +2 -2
  57. package/dist/web/assets/git-history-panel-zXprGDsD.js.br +0 -0
  58. package/dist/web/assets/git-history-panel-zXprGDsD.js.gz +0 -0
  59. package/dist/web/assets/global-settings-dialog-CQK8OvfF.js +1 -0
  60. package/dist/web/assets/global-settings-dialog-CQK8OvfF.js.br +0 -0
  61. package/dist/web/assets/global-settings-dialog-CQK8OvfF.js.gz +0 -0
  62. package/dist/web/assets/grammar-cpp-support-CH6jZNJS.js +1 -0
  63. package/dist/web/assets/grammar-cpp-support-CH6jZNJS.js.br +0 -0
  64. package/dist/web/assets/grammar-cpp-support-CH6jZNJS.js.gz +0 -0
  65. package/dist/web/assets/{highlighted-body-OFNGDK62-CBB2e5gz.js → highlighted-body-OFNGDK62-DLuRF1Ir.js} +1 -1
  66. package/dist/web/assets/highlighted-body-OFNGDK62-DLuRF1Ir.js.br +0 -0
  67. package/dist/web/assets/highlighted-body-OFNGDK62-DLuRF1Ir.js.gz +0 -0
  68. package/dist/web/assets/index-BQDjXTIj.js +4 -0
  69. package/dist/web/assets/index-BQDjXTIj.js.br +0 -0
  70. package/dist/web/assets/index-BQDjXTIj.js.gz +0 -0
  71. package/dist/web/assets/index-Cg_JyLiC.css +2 -0
  72. package/dist/web/assets/index-Cg_JyLiC.css.br +0 -0
  73. package/dist/web/assets/index-Cg_JyLiC.css.gz +0 -0
  74. package/dist/web/assets/lazy-message-response-BAESsr6y.js +2 -0
  75. package/dist/web/assets/lazy-message-response-BAESsr6y.js.br +0 -0
  76. package/dist/web/assets/lazy-message-response-BAESsr6y.js.gz +0 -0
  77. package/dist/web/assets/mermaid-GHXKKRXX-D80VLkUl.js +1 -0
  78. package/dist/web/assets/mermaid-GHXKKRXX-D80VLkUl.js.br +0 -0
  79. package/dist/web/assets/mermaid-GHXKKRXX-D80VLkUl.js.gz +0 -0
  80. package/dist/web/assets/message-response-ll2GyVvz.js +7 -0
  81. package/dist/web/assets/message-response-ll2GyVvz.js.br +0 -0
  82. package/dist/web/assets/message-response-ll2GyVvz.js.gz +0 -0
  83. package/dist/web/assets/{patch-diff-viewer-BlbG4Z8Q.js → patch-diff-viewer-7Ar-plzV.js} +2 -2
  84. package/dist/web/assets/patch-diff-viewer-7Ar-plzV.js.br +0 -0
  85. package/dist/web/assets/patch-diff-viewer-7Ar-plzV.js.gz +0 -0
  86. package/dist/web/assets/{perl-Br95gH8g.js → perl-C4NAnH_t.js} +1 -1
  87. package/dist/web/assets/perl-C4NAnH_t.js.br +0 -0
  88. package/dist/web/assets/{perl-Br95gH8g.js.gz → perl-C4NAnH_t.js.gz} +0 -0
  89. package/dist/web/assets/{php-CYrBA5iX.js → php-CQT4wx5i.js} +1 -1
  90. package/dist/web/assets/php-CQT4wx5i.js.br +0 -0
  91. package/dist/web/assets/{php-CYrBA5iX.js.gz → php-CQT4wx5i.js.gz} +0 -0
  92. package/dist/web/assets/prompt-input-controls-t69FYoWk.js +1 -0
  93. package/dist/web/assets/prompt-input-controls-t69FYoWk.js.br +0 -0
  94. package/dist/web/assets/prompt-input-controls-t69FYoWk.js.gz +0 -0
  95. package/dist/web/assets/{provider-connection-queries-bzb4TYim.js → provider-connection-queries-BKyJMJn1.js} +1 -1
  96. package/dist/web/assets/provider-connection-queries-BKyJMJn1.js.br +0 -0
  97. package/dist/web/assets/provider-connection-queries-BKyJMJn1.js.gz +0 -0
  98. package/dist/web/assets/{ruby-CbXu8Ywv.js → ruby-Oh3ZbUP2.js} +1 -1
  99. package/dist/web/assets/ruby-Oh3ZbUP2.js.br +0 -0
  100. package/dist/web/assets/ruby-Oh3ZbUP2.js.gz +0 -0
  101. package/dist/web/assets/{shiki-bundle-BndEhlUP.js → shiki-bundle-UDLEjOL9.js} +1 -1
  102. package/dist/web/assets/shiki-bundle-UDLEjOL9.js.br +0 -0
  103. package/dist/web/assets/shiki-bundle-UDLEjOL9.js.gz +0 -0
  104. package/dist/web/assets/swift-CyEgAFGc.js +1 -0
  105. package/dist/web/assets/swift-CyEgAFGc.js.br +0 -0
  106. package/dist/web/assets/swift-CyEgAFGc.js.gz +0 -0
  107. package/dist/web/assets/upload-Bbk2LEzM.js +1 -0
  108. package/dist/web/assets/upload-Bbk2LEzM.js.br +0 -0
  109. package/dist/web/assets/upload-Bbk2LEzM.js.gz +0 -0
  110. package/dist/web/assets/{vue-BpAUjojh.js → vue-BcFuTOIy.js} +1 -1
  111. package/dist/web/assets/vue-BcFuTOIy.js.br +0 -0
  112. package/dist/web/assets/vue-BcFuTOIy.js.gz +0 -0
  113. package/dist/web/assets/workbench-inspector-changes-CumCxeA7.js +1 -0
  114. package/dist/web/assets/workbench-inspector-changes-CumCxeA7.js.br +0 -0
  115. package/dist/web/assets/workbench-inspector-changes-CumCxeA7.js.gz +0 -0
  116. package/dist/web/assets/workbench-shell-D21PPmmO.js +13 -0
  117. package/dist/web/assets/workbench-shell-D21PPmmO.js.br +0 -0
  118. package/dist/web/assets/workbench-shell-D21PPmmO.js.gz +0 -0
  119. package/dist/web/index.html +8 -8
  120. package/dist/web/index.html.br +0 -0
  121. package/dist/web/index.html.gz +0 -0
  122. package/package.json +7 -10
  123. package/dist/web/assets/button-DPWbWvQN.js +0 -1
  124. package/dist/web/assets/button-DPWbWvQN.js.br +0 -0
  125. package/dist/web/assets/button-DPWbWvQN.js.gz +0 -0
  126. package/dist/web/assets/button-group-CvflSgg8.js +0 -1
  127. package/dist/web/assets/button-group-CvflSgg8.js.br +0 -0
  128. package/dist/web/assets/button-group-CvflSgg8.js.gz +0 -0
  129. package/dist/web/assets/checkbox-CCES4UbV.js.br +0 -0
  130. package/dist/web/assets/chunk-BO2N2NFS-BWAdG1_E.js.br +0 -0
  131. package/dist/web/assets/chunk-BO2N2NFS-BWAdG1_E.js.gz +0 -0
  132. package/dist/web/assets/code-highlighter-CHF26Qu6.js.br +0 -0
  133. package/dist/web/assets/code-highlighter-CHF26Qu6.js.gz +0 -0
  134. package/dist/web/assets/code-languages-0g9buMoI.js +0 -2
  135. package/dist/web/assets/code-languages-0g9buMoI.js.br +0 -0
  136. package/dist/web/assets/code-languages-0g9buMoI.js.gz +0 -0
  137. package/dist/web/assets/cpp-BcHBJY00.js +0 -1
  138. package/dist/web/assets/cpp-BcHBJY00.js.br +0 -0
  139. package/dist/web/assets/cpp-BcHBJY00.js.gz +0 -0
  140. package/dist/web/assets/cpp-CIkEvbIe.js +0 -1
  141. package/dist/web/assets/cpp-CIkEvbIe.js.br +0 -0
  142. package/dist/web/assets/cpp-CIkEvbIe.js.gz +0 -0
  143. package/dist/web/assets/engine-compile-DQ0HPfe0.js.br +0 -0
  144. package/dist/web/assets/engine-compile-DQ0HPfe0.js.gz +0 -0
  145. package/dist/web/assets/es2015-DsWAjMth.js +0 -41
  146. package/dist/web/assets/es2015-DsWAjMth.js.br +0 -0
  147. package/dist/web/assets/es2015-DsWAjMth.js.gz +0 -0
  148. package/dist/web/assets/file-CdvUKvsI.js.br +0 -0
  149. package/dist/web/assets/file-CdvUKvsI.js.gz +0 -0
  150. package/dist/web/assets/file-review-dialog-D2A8VOae.js.br +0 -0
  151. package/dist/web/assets/file-review-dialog-D2A8VOae.js.gz +0 -0
  152. package/dist/web/assets/file-tree-AZsgAlZn.js.br +0 -0
  153. package/dist/web/assets/file-tree-AZsgAlZn.js.gz +0 -0
  154. package/dist/web/assets/git-commit-horizontal-C0Tc8kLo.js.br +0 -0
  155. package/dist/web/assets/git-commit-horizontal-C0Tc8kLo.js.gz +0 -0
  156. package/dist/web/assets/git-history-panel-CeJ0MXUi.js.br +0 -0
  157. package/dist/web/assets/git-history-panel-CeJ0MXUi.js.gz +0 -0
  158. package/dist/web/assets/global-settings-dialog-BdOP1wS8.js +0 -1
  159. package/dist/web/assets/global-settings-dialog-BdOP1wS8.js.br +0 -0
  160. package/dist/web/assets/global-settings-dialog-BdOP1wS8.js.gz +0 -0
  161. package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js +0 -1
  162. package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js.br +0 -0
  163. package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js.gz +0 -0
  164. package/dist/web/assets/highlighted-body-OFNGDK62-CBB2e5gz.js.br +0 -0
  165. package/dist/web/assets/highlighted-body-OFNGDK62-CBB2e5gz.js.gz +0 -0
  166. package/dist/web/assets/index-BoX8xH2D.css +0 -2
  167. package/dist/web/assets/index-BoX8xH2D.css.br +0 -0
  168. package/dist/web/assets/index-BoX8xH2D.css.gz +0 -0
  169. package/dist/web/assets/index-CoRYl0EO.js +0 -4
  170. package/dist/web/assets/index-CoRYl0EO.js.br +0 -0
  171. package/dist/web/assets/index-CoRYl0EO.js.gz +0 -0
  172. package/dist/web/assets/lazy-message-response-Be__rdOq.js +0 -2
  173. package/dist/web/assets/lazy-message-response-Be__rdOq.js.br +0 -0
  174. package/dist/web/assets/lazy-message-response-Be__rdOq.js.gz +0 -0
  175. package/dist/web/assets/mermaid-GHXKKRXX-C4HZuN1f.js +0 -1
  176. package/dist/web/assets/mermaid-GHXKKRXX-C4HZuN1f.js.br +0 -0
  177. package/dist/web/assets/mermaid-GHXKKRXX-C4HZuN1f.js.gz +0 -0
  178. package/dist/web/assets/message-response-UwCHtKG1.js +0 -7
  179. package/dist/web/assets/message-response-UwCHtKG1.js.br +0 -0
  180. package/dist/web/assets/message-response-UwCHtKG1.js.gz +0 -0
  181. package/dist/web/assets/patch-diff-viewer-BlbG4Z8Q.js.br +0 -0
  182. package/dist/web/assets/patch-diff-viewer-BlbG4Z8Q.js.gz +0 -0
  183. package/dist/web/assets/perl-Br95gH8g.js.br +0 -0
  184. package/dist/web/assets/php-CYrBA5iX.js.br +0 -0
  185. package/dist/web/assets/prompt-input-controls-DRwTXxuF.js +0 -1
  186. package/dist/web/assets/prompt-input-controls-DRwTXxuF.js.br +0 -0
  187. package/dist/web/assets/prompt-input-controls-DRwTXxuF.js.gz +0 -0
  188. package/dist/web/assets/provider-connection-queries-bzb4TYim.js.br +0 -0
  189. package/dist/web/assets/provider-connection-queries-bzb4TYim.js.gz +0 -0
  190. package/dist/web/assets/ruby-CbXu8Ywv.js.br +0 -0
  191. package/dist/web/assets/ruby-CbXu8Ywv.js.gz +0 -0
  192. package/dist/web/assets/shiki-bundle-BndEhlUP.js.br +0 -0
  193. package/dist/web/assets/shiki-bundle-BndEhlUP.js.gz +0 -0
  194. package/dist/web/assets/swift-DonLKvLd.js +0 -1
  195. package/dist/web/assets/swift-DonLKvLd.js.br +0 -0
  196. package/dist/web/assets/swift-DonLKvLd.js.gz +0 -0
  197. package/dist/web/assets/vue-BpAUjojh.js.br +0 -0
  198. package/dist/web/assets/vue-BpAUjojh.js.gz +0 -0
  199. package/dist/web/assets/workbench-inspector-changes-8ZkoC9AD.js +0 -1
  200. package/dist/web/assets/workbench-inspector-changes-8ZkoC9AD.js.br +0 -0
  201. package/dist/web/assets/workbench-inspector-changes-8ZkoC9AD.js.gz +0 -0
  202. package/dist/web/assets/workbench-shell-BLSbA9u6.js +0 -13
  203. package/dist/web/assets/workbench-shell-BLSbA9u6.js.br +0 -0
  204. package/dist/web/assets/workbench-shell-BLSbA9u6.js.gz +0 -0
@@ -0,0 +1,41 @@
1
+ import{n as e,r as t}from"./rolldown-runtime-QTnfLwEv.js";import{i as n,r,t as i}from"./react-runtime-CVaUQXZF.js";import{a,i as o,n as s,r as c,s as l}from"./button-SdoQawHa.js";var u=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(){}},d=new class extends u{#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`}},f={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},p=new class{#e=f;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 m(e){setTimeout(e,0)}var h=typeof window>`u`||`Deno`in globalThis;function g(){}function _(e,t){return typeof e==`function`?e(t):e}function v(e){return typeof e==`number`&&e>=0&&e!==1/0}function y(e,t){return Math.max(e+(t||0)-Date.now(),0)}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){return typeof e==`function`?e(t):e}function S(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!te(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 C(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(!te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>ae(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function te(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!te(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!te(e[r],t[r]))return!1;return!0}return!1}var ne=Object.prototype.hasOwnProperty;function re(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ie(e)&&ie(t);if(!r&&!(ae(e)&&ae(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:ne.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=re(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function T(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 ie(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ae(e){if(!oe(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!oe(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function oe(e){return Object.prototype.toString.call(e)===`[object Object]`}function se(e){return new Promise(t=>{p.setTimeout(t,e)})}function ce(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:re(e,t)}function le(e){return e}function ue(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function de(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var fe=Symbol();function pe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===fe?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function me(e,t){return typeof e==`function`?e(...t):!!e}function he(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 ge=(()=>{let e=()=>h;return{isServer(){return e()},setIsServer(t){e=t}}})();function _e(){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 ve=m;function ye(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ve,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 be=ye(),xe=new class extends u{#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`||xe.isOnline()}var we=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Te(e){let t=!1,n=0,r,i=_e(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new we(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>d.isFocused()&&(e.networkMode===`always`||xe.isOnline())&&e.canRun(),u=()=>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??(ge.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),se(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:u,start:()=>(u()?h():m().then(h),i)}}var Ee=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),v(this.gcTime)&&(this.#e=p.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ge.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(p.clearTimeout(this.#e),this.#e=void 0)}};function De(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=>{he(e,()=>t.signal,()=>n=!0)},u=pe(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?de:ue;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ke:Oe,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:Oe(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 Oe(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 ke(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ae(e,t){return t?Oe(e,t)!=null:!1}function je(e,t){return!t||!e.getPreviousPageParam?!1:ke(e,t)!=null}var Me=class extends Ee{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Fe(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Fe(this.options);e.data!==void 0&&(this.setState(Pe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ce(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(g).catch(g):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>x(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>b(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!y(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=pe(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?De(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Te({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof we&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof we){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ne(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Pe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),be.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ne(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ce(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Pe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Fe(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 Ie=class extends u{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=_e(),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),Re(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ze(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ze(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 x(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&&!T(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||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||b(this.options.staleTime,this.#t)!==b(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(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 He(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(g)),t}#g(){this.#b();let e=b(this.options.staleTime,this.#t);if(ge.isServer()||this.#r.isStale||!v(e))return;let t=y(this.#r.dataUpdatedAt,e)+1;this.#d=p.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,!(ge.isServer()||x(this.options.enabled,this.#t)===!1||!v(this.#p)||this.#p===0)&&(this.#f=p.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(p.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(p.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&&Re(e,t),o=i&&Be(e,n,t,r);(a||o)&&(l={...l,...Ne(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=ce(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=ce(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,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&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ve(e,t),refetch:this.refetch,promise:this.#o,isEnabled:x(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=()=>{let e=this.#o=S.promise=_e();i(e)},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),!T(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){be.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Le(e,t){return x(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&x(t.retryOnMount,e)===!1)}function Re(e,t){return Le(e,t)||e.state.data!==void 0&&ze(e,t,t.refetchOnMount)}function ze(e,t,n){if(x(t.enabled,e)!==!1&&b(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ve(e,t)}return!1}function Be(e,t,n,r){return(e!==t||x(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ve(e,n)}function Ve(e,t){return x(t.enabled,e)!==!1&&e.isStaleByTime(b(t.staleTime,e))}function He(e,t){return!T(e.getCurrentResult(),t)}var E=t(n(),1),D=i(),Ue=E.createContext(void 0),We=e=>{let t=E.useContext(Ue);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ge=({client:e,children:t})=>(E.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,D.jsx)(Ue.Provider,{value:e,children:t})),Ke=E.createContext(!1),qe=()=>E.useContext(Ke);Ke.Provider;function Je(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ye=E.createContext(Je()),Xe=()=>E.useContext(Ye),Ze=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?me(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Qe=e=>{E.useEffect(()=>{e.clearReset()},[e])},$e=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||me(n,[e.error,r])),et=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))}},tt=(e,t)=>e.isLoading&&e.isFetching&&!t,nt=(e,t)=>e?.suspense&&t.isPending,rt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function it(e,t,n){let r=qe(),i=Xe(),a=We(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,et(o),Ze(o,i,s),Qe(i);let l=!a.getQueryCache().get(o.queryHash),[u]=E.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(E.useSyncExternalStore(E.useCallback(e=>{let t=f?u.subscribe(be.batchCalls(e)):g;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),E.useEffect(()=>{u.setOptions(o)},[o,u]),nt(o,d))throw rt(o,u,i);if($e({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!ge.isServer()&&tt(d,r)&&(l?rt(o,u,i):s?.promise)?.catch(g).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function at(e,t){return it(e,Ie,t)}function ot(e){return e}function st(e){return e}function ct(e){return O(e)&&!lt(e)&&!yt(e)&&Symbol.asyncIterator in e}function lt(e){return Array.isArray(e)}function ut(e){return typeof e==`bigint`}function dt(e){return typeof e==`boolean`}function ft(e){return e instanceof globalThis.Date}function pt(e){return typeof e==`function`}function mt(e){return O(e)&&!lt(e)&&!yt(e)&&Symbol.iterator in e}function ht(e){return e===null}function gt(e){return typeof e==`number`}function O(e){return typeof e==`object`&&!!e}function _t(e){return e instanceof globalThis.RegExp}function k(e){return typeof e==`string`}function vt(e){return typeof e==`symbol`}function yt(e){return e instanceof globalThis.Uint8Array}function A(e){return e===void 0}function bt(e){return e.map(e=>Tt(e))}function xt(e){return new Date(e.getTime())}function St(e){return new Uint8Array(e)}function Ct(e){return new RegExp(e.source,e.flags)}function wt(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Tt(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Tt(e[n]);return t}function Tt(e){return lt(e)?bt(e):ft(e)?xt(e):yt(e)?St(e):_t(e)?Ct(e):O(e)?wt(e):e}function Et(e){return Tt(e)}function Dt(e,t){return Et(t===void 0?e:{...t,...e})}function Ot(e){return Nt(e)&&globalThis.Symbol.asyncIterator in e}function kt(e){return Nt(e)&&globalThis.Symbol.iterator in e}function At(e){return e instanceof globalThis.Promise}function jt(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function Mt(e){return e instanceof globalThis.Uint8Array}function Nt(e){return typeof e==`object`&&!!e}function Pt(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function Ft(e){return e===void 0}function It(e){return e===null}function Lt(e){return typeof e==`boolean`}function Rt(e){return typeof e==`number`}function zt(e){return globalThis.Number.isInteger(e)}function Bt(e){return typeof e==`bigint`}function Vt(e){return typeof e==`string`}function Ht(e){return typeof e==`function`}function Ut(e){return typeof e==`symbol`}var Wt;(function(e){e.InstanceMode=`default`,e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(t,n){return e.ExactOptionalPropertyTypes?n in t:t[n]!==void 0}e.IsExactOptionalProperty=t;function n(t){let n=Nt(t);return e.AllowArrayObject?n:n&&!Pt(t)}e.IsObjectLike=n;function r(e){return n(e)&&!(e instanceof Date)&&!(e instanceof Uint8Array)}e.IsRecordLike=r;function i(t){return e.AllowNaN?Rt(t):Number.isFinite(t)}e.IsNumberLike=i;function a(t){let n=Ft(t);return e.AllowNullVoid?n||t===null:n}e.IsVoidLike=a})(Wt||={});function Gt(e){return globalThis.Object.freeze(e).map(e=>Xt(e))}function Kt(e){return e}function qt(e){return e}function Jt(e){return e}function Yt(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Xt(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Xt(e[n]);return globalThis.Object.freeze(t)}function Xt(e){return lt(e)?Gt(e):ft(e)?Kt(e):yt(e)?qt(e):_t(e)?Jt(e):O(e)?Yt(e):e}function j(e,t){let n=t===void 0?e:{...t,...e};switch(Wt.InstanceMode){case`freeze`:return Xt(n);case`clone`:return Et(n);default:return n}}var Zt=class extends Error{constructor(e){super(e)}},Qt=Symbol.for(`TypeBox.Transform`),$t=Symbol.for(`TypeBox.Readonly`),en=Symbol.for(`TypeBox.Optional`),tn=Symbol.for(`TypeBox.Hint`),M=Symbol.for(`TypeBox.Kind`);function nn(e){return O(e)&&e[$t]===`Readonly`}function rn(e){return O(e)&&e[en]===`Optional`}function an(e){return N(e,`Any`)}function on(e){return N(e,`Argument`)}function sn(e){return N(e,`Array`)}function cn(e){return N(e,`AsyncIterator`)}function ln(e){return N(e,`BigInt`)}function un(e){return N(e,`Boolean`)}function dn(e){return N(e,`Computed`)}function fn(e){return N(e,`Constructor`)}function pn(e){return N(e,`Date`)}function mn(e){return N(e,`Function`)}function hn(e){return N(e,`Integer`)}function gn(e){return N(e,`Intersect`)}function _n(e){return N(e,`Iterator`)}function N(e,t){return O(e)&&M in e&&e[M]===t}function vn(e){return dt(e)||gt(e)||k(e)}function yn(e){return N(e,`Literal`)}function bn(e){return N(e,`MappedKey`)}function xn(e){return N(e,`MappedResult`)}function Sn(e){return N(e,`Never`)}function Cn(e){return N(e,`Not`)}function wn(e){return N(e,`Null`)}function Tn(e){return N(e,`Number`)}function En(e){return N(e,`Object`)}function Dn(e){return N(e,`Promise`)}function On(e){return N(e,`Record`)}function kn(e){return N(e,`Ref`)}function An(e){return N(e,`RegExp`)}function jn(e){return N(e,`String`)}function Mn(e){return N(e,`Symbol`)}function Nn(e){return N(e,`TemplateLiteral`)}function Pn(e){return N(e,`This`)}function Fn(e){return O(e)&&Qt in e}function In(e){return N(e,`Tuple`)}function Ln(e){return N(e,`Undefined`)}function P(e){return N(e,`Union`)}function Rn(e){return N(e,`Uint8Array`)}function zn(e){return N(e,`Unknown`)}function Bn(e){return N(e,`Unsafe`)}function Vn(e){return N(e,`Void`)}function Hn(e){return O(e)&&M in e&&k(e[M])}function Un(e){return an(e)||on(e)||sn(e)||un(e)||ln(e)||cn(e)||dn(e)||fn(e)||pn(e)||mn(e)||hn(e)||gn(e)||_n(e)||yn(e)||bn(e)||xn(e)||Sn(e)||Cn(e)||wn(e)||Tn(e)||En(e)||Dn(e)||On(e)||kn(e)||An(e)||jn(e)||Mn(e)||Nn(e)||Pn(e)||In(e)||Ln(e)||P(e)||Rn(e)||zn(e)||Bn(e)||Vn(e)||Hn(e)}var Wn=`Argument.Any.Array.AsyncIterator.BigInt.Boolean.Computed.Constructor.Date.Enum.Function.Integer.Intersect.Iterator.Literal.MappedKey.MappedResult.Not.Null.Number.Object.Promise.Record.Ref.RegExp.String.Symbol.TemplateLiteral.This.Tuple.Undefined.Union.Uint8Array.Unknown.Void`.split(`.`);function Gn(e){try{return new RegExp(e),!0}catch{return!1}}function Kn(e){if(!k(e))return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}function qn(e){return Yn(e)||Hr(e)}function Jn(e){return A(e)||ut(e)}function F(e){return A(e)||gt(e)}function Yn(e){return A(e)||dt(e)}function I(e){return A(e)||k(e)}function Xn(e){return A(e)||k(e)&&Kn(e)&&Gn(e)}function Zn(e){return A(e)||k(e)&&Kn(e)}function Qn(e){return A(e)||Hr(e)}function $n(e){return O(e)&&e[en]===`Optional`}function er(e){return L(e,`Any`)&&I(e.$id)}function tr(e){return L(e,`Argument`)&&gt(e.index)}function nr(e){return L(e,`Array`)&&e.type===`array`&&I(e.$id)&&Hr(e.items)&&F(e.minItems)&&F(e.maxItems)&&Yn(e.uniqueItems)&&Qn(e.contains)&&F(e.minContains)&&F(e.maxContains)}function rr(e){return L(e,`AsyncIterator`)&&e.type===`AsyncIterator`&&I(e.$id)&&Hr(e.items)}function ir(e){return L(e,`BigInt`)&&e.type===`bigint`&&I(e.$id)&&Jn(e.exclusiveMaximum)&&Jn(e.exclusiveMinimum)&&Jn(e.maximum)&&Jn(e.minimum)&&Jn(e.multipleOf)}function ar(e){return L(e,`Boolean`)&&e.type===`boolean`&&I(e.$id)}function or(e){return L(e,`Computed`)&&k(e.target)&&lt(e.parameters)&&e.parameters.every(e=>Hr(e))}function sr(e){return L(e,`Constructor`)&&e.type===`Constructor`&&I(e.$id)&&lt(e.parameters)&&e.parameters.every(e=>Hr(e))&&Hr(e.returns)}function cr(e){return L(e,`Date`)&&e.type===`Date`&&I(e.$id)&&F(e.exclusiveMaximumTimestamp)&&F(e.exclusiveMinimumTimestamp)&&F(e.maximumTimestamp)&&F(e.minimumTimestamp)&&F(e.multipleOfTimestamp)}function lr(e){return L(e,`Function`)&&e.type===`Function`&&I(e.$id)&&lt(e.parameters)&&e.parameters.every(e=>Hr(e))&&Hr(e.returns)}function ur(e){return L(e,`Integer`)&&e.type===`integer`&&I(e.$id)&&F(e.exclusiveMaximum)&&F(e.exclusiveMinimum)&&F(e.maximum)&&F(e.minimum)&&F(e.multipleOf)}function dr(e){return O(e)&&Object.entries(e).every(([e,t])=>Kn(e)&&Hr(t))}function fr(e){return L(e,`Intersect`)&&!(k(e.type)&&e.type!==`object`)&&lt(e.allOf)&&e.allOf.every(e=>Hr(e)&&!Nr(e))&&I(e.type)&&(Yn(e.unevaluatedProperties)||Qn(e.unevaluatedProperties))&&I(e.$id)}function pr(e){return L(e,`Iterator`)&&e.type===`Iterator`&&I(e.$id)&&Hr(e.items)}function L(e,t){return O(e)&&M in e&&e[M]===t}function mr(e){return _r(e)&&k(e.const)}function hr(e){return _r(e)&&gt(e.const)}function gr(e){return _r(e)&&dt(e.const)}function _r(e){return L(e,`Literal`)&&I(e.$id)&&vr(e.const)}function vr(e){return dt(e)||gt(e)||k(e)}function yr(e){return L(e,`MappedKey`)&&lt(e.keys)&&e.keys.every(e=>gt(e)||k(e))}function br(e){return L(e,`MappedResult`)&&dr(e.properties)}function xr(e){return L(e,`Never`)&&O(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function Sr(e){return L(e,`Not`)&&Hr(e.not)}function Cr(e){return L(e,`Null`)&&e.type===`null`&&I(e.$id)}function wr(e){return L(e,`Number`)&&e.type===`number`&&I(e.$id)&&F(e.exclusiveMaximum)&&F(e.exclusiveMinimum)&&F(e.maximum)&&F(e.minimum)&&F(e.multipleOf)}function R(e){return L(e,`Object`)&&e.type===`object`&&I(e.$id)&&dr(e.properties)&&qn(e.additionalProperties)&&F(e.minProperties)&&F(e.maxProperties)}function Tr(e){return L(e,`Promise`)&&e.type===`Promise`&&I(e.$id)&&Hr(e.item)}function Er(e){return L(e,`Record`)&&e.type===`object`&&I(e.$id)&&qn(e.additionalProperties)&&O(e.patternProperties)&&(e=>{let t=Object.getOwnPropertyNames(e.patternProperties);return t.length===1&&Gn(t[0])&&O(e.patternProperties)&&Hr(e.patternProperties[t[0]])})(e)}function Dr(e){return L(e,`Ref`)&&I(e.$id)&&k(e.$ref)}function Or(e){return L(e,`RegExp`)&&I(e.$id)&&k(e.source)&&k(e.flags)&&F(e.maxLength)&&F(e.minLength)}function kr(e){return L(e,`String`)&&e.type===`string`&&I(e.$id)&&F(e.minLength)&&F(e.maxLength)&&Xn(e.pattern)&&Zn(e.format)}function Ar(e){return L(e,`Symbol`)&&e.type===`symbol`&&I(e.$id)}function jr(e){return L(e,`TemplateLiteral`)&&e.type===`string`&&k(e.pattern)&&e.pattern[0]===`^`&&e.pattern[e.pattern.length-1]===`$`}function Mr(e){return L(e,`This`)&&I(e.$id)&&k(e.$ref)}function Nr(e){return O(e)&&Qt in e}function Pr(e){return L(e,`Tuple`)&&e.type===`array`&&I(e.$id)&&gt(e.minItems)&&gt(e.maxItems)&&e.minItems===e.maxItems&&(A(e.items)&&A(e.additionalItems)&&e.minItems===0||lt(e.items)&&e.items.every(e=>Hr(e)))}function Fr(e){return L(e,`Undefined`)&&e.type===`undefined`&&I(e.$id)}function Ir(e){return L(e,`Union`)&&I(e.$id)&&O(e)&&lt(e.anyOf)&&e.anyOf.every(e=>Hr(e))}function Lr(e){return L(e,`Uint8Array`)&&e.type===`Uint8Array`&&I(e.$id)&&F(e.minByteLength)&&F(e.maxByteLength)}function Rr(e){return L(e,`Unknown`)&&I(e.$id)}function zr(e){return L(e,`Unsafe`)}function Br(e){return L(e,`Void`)&&e.type===`void`&&I(e.$id)}function Vr(e){return O(e)&&M in e&&k(e[M])&&!Wn.includes(e[M])}function Hr(e){return O(e)&&(er(e)||tr(e)||nr(e)||ar(e)||ir(e)||rr(e)||or(e)||sr(e)||cr(e)||lr(e)||ur(e)||fr(e)||pr(e)||_r(e)||yr(e)||br(e)||xr(e)||Sr(e)||Cr(e)||wr(e)||R(e)||Tr(e)||Er(e)||Dr(e)||Or(e)||kr(e)||Ar(e)||jr(e)||Mr(e)||Pr(e)||Fr(e)||Ir(e)||Lr(e)||Rr(e)||zr(e)||Br(e)||Vr(e))}var Ur=`(true|false)`,Wr=`(0|[1-9][0-9]*)`,Gr=`(.*)`,Kr=`(?!.*)`;`${Ur}`;var qr=`^${Wr}$`,Jr=`^${Gr}$`,Yr=`^${Kr}$`,Xr=new Map;function Zr(e){return Xr.has(e)}function Qr(e,t){Xr.set(e,t)}function $r(e){return Xr.get(e)}var ei=new Map;function ti(e){return ei.has(e)}function ni(e){return ei.get(e)}function ri(e,t){return e.includes(t)}function ii(e){return[...new Set(e)]}function ai(e,t){return e.filter(e=>t.includes(e))}function oi(e,t){return e.reduce((e,t)=>ai(e,t),t)}function si(e){return e.length===1?e[0]:e.length>1?oi(e.slice(1),e[0]):[]}function ci(e){let t=[];for(let n of e)t.push(...n);return t}function li(e){return j({[M]:`Any`},e)}function ui(e,t){return j({[M]:`Array`,type:`array`,items:e},t)}function di(e){return j({[M]:`Argument`,index:e})}function fi(e,t){return j({[M]:`AsyncIterator`,type:`AsyncIterator`,items:e},t)}function pi(e,t,n){return j({[M]:`Computed`,target:e,parameters:t},n)}function mi(e,t){let{[t]:n,...r}=e;return r}function hi(e,t){return t.reduce((e,t)=>mi(e,t),e)}function z(e){return j({[M]:`Never`,not:{}},e)}function gi(e){return j({[M]:`MappedResult`,properties:e})}function _i(e,t,n){return j({[M]:`Constructor`,type:`Constructor`,parameters:e,returns:t},n)}function vi(e,t,n){return j({[M]:`Function`,type:`Function`,parameters:e,returns:t},n)}function yi(e,t){return j({[M]:`Union`,anyOf:e},t)}function bi(e){return e.some(e=>rn(e))}function xi(e){return e.map(e=>rn(e)?Si(e):e)}function Si(e){return hi(e,[en])}function Ci(e,t){return bi(e)?so(yi(xi(e),t)):yi(xi(e),t)}function wi(e,t){return e.length===1?j(e[0],t):e.length===0?z(t):Ci(e,t)}function Ti(e,t){return e.length===0?z(t):e.length===1?j(e[0],t):yi(e,t)}var Ei=class extends Zt{};function Di(e){return e.replace(/\\\$/g,`$`).replace(/\\\*/g,`*`).replace(/\\\^/g,`^`).replace(/\\\|/g,`|`).replace(/\\\(/g,`(`).replace(/\\\)/g,`)`)}function Oi(e,t,n){return e[t]===n&&e.charCodeAt(t-1)!==92}function ki(e,t){return Oi(e,t,`(`)}function Ai(e,t){return Oi(e,t,`)`)}function ji(e,t){return Oi(e,t,`|`)}function Mi(e){if(!(ki(e,0)&&Ai(e,e.length-1)))return!1;let t=0;for(let n=0;n<e.length;n++)if(ki(e,n)&&(t+=1),Ai(e,n)&&--t,t===0&&n!==e.length-1)return!1;return!0}function Ni(e){return e.slice(1,e.length-1)}function Pi(e){let t=0;for(let n=0;n<e.length;n++)if(ki(e,n)&&(t+=1),Ai(e,n)&&--t,ji(e,n)&&t===0)return!0;return!1}function Fi(e){for(let t=0;t<e.length;t++)if(ki(e,t))return!0;return!1}function Ii(e){let[t,n]=[0,0],r=[];for(let i=0;i<e.length;i++)if(ki(e,i)&&(t+=1),Ai(e,i)&&--t,ji(e,i)&&t===0){let t=e.slice(n,i);t.length>0&&r.push(Ri(t)),n=i+1}let i=e.slice(n);return i.length>0&&r.push(Ri(i)),r.length===0?{type:`const`,const:``}:r.length===1?r[0]:{type:`or`,expr:r}}function Li(e){function t(e,t){if(!ki(e,t))throw new Ei(`TemplateLiteralParser: Index must point to open parens`);let n=0;for(let r=t;r<e.length;r++)if(ki(e,r)&&(n+=1),Ai(e,r)&&--n,n===0)return[t,r];throw new Ei(`TemplateLiteralParser: Unclosed group parens in expression`)}function n(e,t){for(let n=t;n<e.length;n++)if(ki(e,n))return[t,n];return[t,e.length]}let r=[];for(let i=0;i<e.length;i++)if(ki(e,i)){let[n,a]=t(e,i),o=e.slice(n,a+1);r.push(Ri(o)),i=a}else{let[t,a]=n(e,i),o=e.slice(t,a);o.length>0&&r.push(Ri(o)),i=a-1}return r.length===0?{type:`const`,const:``}:r.length===1?r[0]:{type:`and`,expr:r}}function Ri(e){return Mi(e)?Ri(Ni(e)):Pi(e)?Ii(e):Fi(e)?Li(e):{type:`const`,const:Di(e)}}function zi(e){return Ri(e.slice(1,e.length-1))}var Bi=class extends Zt{};function Vi(e){return e.type===`or`&&e.expr.length===2&&e.expr[0].type===`const`&&e.expr[0].const===`0`&&e.expr[1].type===`const`&&e.expr[1].const===`[1-9][0-9]*`}function Hi(e){return e.type===`or`&&e.expr.length===2&&e.expr[0].type===`const`&&e.expr[0].const===`true`&&e.expr[1].type===`const`&&e.expr[1].const===`false`}function Ui(e){return e.type===`const`&&e.const===`.*`}function Wi(e){return Vi(e)||Ui(e)?!1:Hi(e)?!0:e.type===`and`||e.type===`or`?e.expr.every(e=>Wi(e)):e.type===`const`||(()=>{throw new Bi(`Unknown expression type`)})()}function Gi(e){return Wi(zi(e.pattern))}var Ki=class extends Zt{};function*qi(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let n of qi(e.slice(1)))yield`${t}${n}`}function*Ji(e){return yield*qi(e.expr.map(e=>[...Zi(e)]))}function*Yi(e){for(let t of e.expr)yield*Zi(t)}function*Xi(e){return yield e.const}function*Zi(e){return e.type===`and`?yield*Ji(e):e.type===`or`?yield*Yi(e):e.type===`const`?yield*Xi(e):(()=>{throw new Ki(`Unknown expression`)})()}function Qi(e){let t=zi(e.pattern);return Wi(t)?[...Zi(t)]:[]}function B(e,t){return j({[M]:`Literal`,const:e,type:typeof e},t)}function $i(e){return j({[M]:`Boolean`,type:`boolean`},e)}function ea(e){return j({[M]:`BigInt`,type:`bigint`},e)}function ta(e){return j({[M]:`Number`,type:`number`},e)}function na(e){return j({[M]:`String`,type:`string`},e)}function*ra(e){let t=e.trim().replace(/"|'/g,``);return t===`boolean`?yield $i():t===`number`?yield ta():t===`bigint`?yield ea():t===`string`?yield na():yield(()=>{let e=t.split(`|`).map(e=>B(e.trim()));return e.length===0?z():e.length===1?e[0]:wi(e)})()}function*ia(e){if(e[1]!==`{`)return yield*[B(`$`),...aa(e.slice(1))];for(let t=2;t<e.length;t++)if(e[t]===`}`){let n=ra(e.slice(2,t)),r=aa(e.slice(t+1));return yield*[...n,...r]}yield B(e)}function*aa(e){for(let t=0;t<e.length;t++)if(e[t]===`$`)return yield*[B(e.slice(0,t)),...ia(e.slice(t))];yield B(e)}function oa(e){return[...aa(e)]}var sa=class extends Zt{};function ca(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function la(e,t){return Nn(e)?e.pattern.slice(1,e.pattern.length-1):P(e)?`(${e.anyOf.map(e=>la(e,t)).join(`|`)})`:Tn(e)||hn(e)||ln(e)?`${t}${Wr}`:jn(e)?`${t}${Gr}`:yn(e)?`${t}${ca(e.const.toString())}`:un(e)?`${t}${Ur}`:(()=>{throw new sa(`Unexpected Kind '${e[M]}'`)})()}function ua(e){return`^${e.map(e=>la(e,``)).join(``)}\$`}function da(e){return wi(Qi(e).map(e=>B(e)))}function fa(e,t){let n=k(e)?ua(oa(e)):ua(e);return j({[M]:`TemplateLiteral`,type:`string`,pattern:n},t)}function pa(e){return Qi(e).map(e=>e.toString())}function ma(e){let t=[];for(let n of e)t.push(...ga(n));return t}function ha(e){return[e.toString()]}function ga(e){return[...new Set(Nn(e)?pa(e):P(e)?ma(e.anyOf):yn(e)?ha(e.const):Tn(e)||hn(e)?[`[number]`]:[])]}function _a(e,t,n){let r={};for(let i of Object.getOwnPropertyNames(t))r[i]=ja(e,ga(t[i]),n);return r}function va(e,t,n){return _a(e,t.properties,n)}function ya(e,t,n){return gi(va(e,t,n))}function ba(e,t){return e.map(e=>Oa(e,t))}function xa(e){return e.filter(e=>!Sn(e))}function Sa(e,t){return _o(xa(ba(e,t)))}function Ca(e){return e.some(e=>Sn(e))?[]:e}function wa(e,t){return wi(Ca(ba(e,t)))}function Ta(e,t){return t in e?e[t]:t===`[number]`?wi(e):z()}function Ea(e,t){return t===`[number]`?e:z()}function Da(e,t){return t in e?e[t]:z()}function Oa(e,t){return gn(e)?Sa(e.allOf,t):P(e)?wa(e.anyOf,t):In(e)?Ta(e.items??[],t):sn(e)?Ea(e.items,t):En(e)?Da(e.properties,t):z()}function ka(e,t){return t.map(t=>Oa(e,t))}function Aa(e,t){return wi(ka(e,t))}function ja(e,t,n){if(kn(e)||kn(t)){if(!Un(e)||!Un(t))throw new Zt(`Index types using Ref parameters require both Type and Key to be of TSchema`);return pi(`Index`,[e,t])}return xn(t)?ya(e,t,n):bn(t)?Fa(e,t,n):j(Un(t)?Aa(e,ga(t)):Aa(e,t),n)}function Ma(e,t,n){return{[t]:ja(e,[t],Et(n))}}function Na(e,t,n){return t.reduce((t,r)=>({...t,...Ma(e,r,n)}),{})}function Pa(e,t,n){return Na(e,t.keys,n)}function Fa(e,t,n){return gi(Pa(e,t,n))}function Ia(e,t){return j({[M]:`Iterator`,type:`Iterator`,items:e},t)}function La(e){return globalThis.Object.keys(e).filter(t=>!rn(e[t]))}function Ra(e,t){let n=La(e);return j(n.length>0?{[M]:`Object`,type:`object`,required:n,properties:e}:{[M]:`Object`,type:`object`,properties:e},t)}var V=Ra;function za(e,t){return j({[M]:`Promise`,type:`Promise`,item:e},t)}function Ba(e){return j(hi(e,[$t]))}function Va(e){return j({...e,[$t]:`Readonly`})}function Ha(e,t){return t===!1?Ba(e):Va(e)}function Ua(e,t){let n=t??!0;return xn(e)?Ka(e,n):Ha(e,n)}function Wa(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Ua(e[r],t);return n}function Ga(e,t){return Wa(e.properties,t)}function Ka(e,t){return gi(Ga(e,t))}function qa(e,t){return j(e.length>0?{[M]:`Tuple`,type:`array`,items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[M]:`Tuple`,type:`array`,minItems:e.length,maxItems:e.length},t)}function Ja(e,t){return e in t?to(e,t[e]):gi(t)}function Ya(e){return{[e]:B(e)}}function Xa(e){let t={};for(let n of e)t[n]=B(n);return t}function Za(e,t){return ri(t,e)?Ya(e):Xa(t)}function Qa(e,t){return Ja(e,Za(e,t))}function $a(e,t){return t.map(t=>to(e,t))}function eo(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=to(e,t[r]);return n}function to(e,t){let n={...t};return rn(t)?so(to(e,hi(t,[en]))):nn(t)?Ua(to(e,hi(t,[$t]))):xn(t)?Ja(e,t.properties):bn(t)?Qa(e,t.keys):fn(t)?_i($a(e,t.parameters),to(e,t.returns),n):mn(t)?vi($a(e,t.parameters),to(e,t.returns),n):cn(t)?fi(to(e,t.items),n):_n(t)?Ia(to(e,t.items),n):gn(t)?vo($a(e,t.allOf),n):P(t)?Ti($a(e,t.anyOf),n):In(t)?qa($a(e,t.items??[]),n):En(t)?V(eo(e,t.properties),n):sn(t)?ui(to(e,t.items),n):Dn(t)?za(to(e,t.item),n):t}function no(e,t){let n={};for(let r of e)n[r]=to(r,t);return n}function ro(e,t,n){let r=Un(e)?ga(e):e;return V(no(r,t({[M]:`MappedKey`,keys:r})),n)}function io(e){return j(hi(e,[en]))}function ao(e){return j({...e,[en]:`Optional`})}function oo(e,t){return t===!1?io(e):ao(e)}function so(e,t){let n=t??!0;return xn(e)?uo(e,n):oo(e,n)}function co(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=so(e[r],t);return n}function lo(e,t){return co(e.properties,t)}function uo(e,t){return gi(lo(e,t))}function fo(e,t={}){let n=e.every(e=>En(e)),r=Un(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return j(t.unevaluatedProperties===!1||Un(t.unevaluatedProperties)||n?{...r,[M]:`Intersect`,type:`object`,allOf:e}:{...r,[M]:`Intersect`,allOf:e},t)}function po(e){return e.every(e=>rn(e))}function mo(e){return hi(e,[en])}function ho(e){return e.map(e=>rn(e)?mo(e):e)}function go(e,t){return po(e)?so(fo(ho(e),t)):fo(ho(e),t)}function _o(e,t={}){if(e.length===1)return j(e[0],t);if(e.length===0)return z(t);if(e.some(e=>Fn(e)))throw Error(`Cannot intersect transform types`);return go(e,t)}function vo(e,t){if(e.length===1)return j(e[0],t);if(e.length===0)return z(t);if(e.some(e=>Fn(e)))throw Error(`Cannot intersect transform types`);return fo(e,t)}function yo(...e){let[t,n]=typeof e[0]==`string`?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!=`string`)throw new Zt(`Ref: $ref must be a string`);return j({[M]:`Ref`,$ref:t},n)}function bo(e,t){return pi(`Awaited`,[pi(e,t)])}function xo(e){return pi(`Awaited`,[yo(e)])}function So(e){return vo(To(e))}function Co(e){return Ti(To(e))}function wo(e){return Eo(e)}function To(e){return e.map(e=>Eo(e))}function Eo(e,t){return j(dn(e)?bo(e.target,e.parameters):gn(e)?So(e.allOf):P(e)?Co(e.anyOf):Dn(e)?wo(e.item):kn(e)?xo(e.$ref):e,t)}function Do(e){let t=[];for(let n of e)t.push(Po(n));return t}function Oo(e){return ci(Do(e))}function ko(e){return si(Do(e))}function Ao(e){return e.map((e,t)=>t.toString())}function jo(e){return[`[number]`]}function Mo(e){return globalThis.Object.getOwnPropertyNames(e)}function No(e){return Fo?globalThis.Object.getOwnPropertyNames(e).map(e=>e[0]===`^`&&e[e.length-1]===`$`?e.slice(1,e.length-1):e):[]}function Po(e){return gn(e)?Oo(e.allOf):P(e)?ko(e.anyOf):In(e)?Ao(e.items??[]):sn(e)?jo(e.items):En(e)?Mo(e.properties):On(e)?No(e.patternProperties):[]}var Fo=!1;function Io(e){Fo=!0;let t=Po(e);return Fo=!1,`^(${t.map(e=>`(${e})`).join(`|`)})$`}function Lo(e,t){return pi(`KeyOf`,[pi(e,t)])}function Ro(e){return pi(`KeyOf`,[yo(e)])}function zo(e,t){return j(wi(Bo(Po(e))),t)}function Bo(e){return e.map(e=>e===`[number]`?ta():B(e))}function Vo(e,t){return dn(e)?Lo(e.target,e.parameters):kn(e)?Ro(e.$ref):xn(e)?Wo(e,t):zo(e,t)}function Ho(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Vo(e[r],Et(t));return n}function Uo(e,t){return Ho(e.properties,t)}function Wo(e,t){return gi(Uo(e,t))}function Go(e){let t=[];for(let n of e)t.push(...Po(n));return ii(t)}function Ko(e){return e.filter(e=>!Sn(e))}function qo(e,t){let n=[];for(let r of e)n.push(...ka(r,[t]));return Ko(n)}function Jo(e,t){let n={};for(let r of t)n[r]=_o(qo(e,r));return n}function Yo(e,t){return V(Jo(e,Go(e)),t)}function Xo(e){return j({[M]:`Date`,type:`Date`},e)}function Zo(e){return j({[M]:`Null`,type:`null`},e)}function Qo(e){return j({[M]:`Symbol`,type:`symbol`},e)}function $o(e){return j({[M]:`Undefined`,type:`undefined`},e)}function es(e){return j({[M]:`Uint8Array`,type:`Uint8Array`},e)}function ts(e){return j({[M]:`Unknown`},e)}function ns(e){return e.map(e=>as(e,!1))}function rs(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=Ua(as(e[n],!1));return t}function is(e,t){return t===!0?e:Ua(e)}function as(e,t){return ct(e)||mt(e)?is(li(),t):lt(e)?Ua(qa(ns(e))):yt(e)?es():ft(e)?Xo():O(e)?is(V(rs(e)),t):pt(e)?is(vi([],ts()),t):A(e)?$o():ht(e)?Zo():vt(e)?Qo():ut(e)?ea():gt(e)||dt(e)||k(e)?B(e):V({})}function os(e,t){return j(as(e,!0),t)}function ss(e,t){return fn(e)?qa(e.parameters,t):z(t)}function cs(e,t){if(A(e))throw Error(`Enum undefined or empty`);let n=globalThis.Object.getOwnPropertyNames(e).filter(e=>isNaN(e)).map(t=>e[t]);return Ti([...new Set(n)].map(e=>B(e)),{...t,[tn]:`Enum`})}var ls=class extends Zt{},H;(function(e){e[e.Union=0]=`Union`,e[e.True=1]=`True`,e[e.False=2]=`False`})(H||={});function us(e){return e===H.False?e:H.True}function ds(e){throw new ls(e)}function U(e){return xr(e)||fr(e)||Ir(e)||Rr(e)||er(e)}function W(e,t){return xr(t)?ks(e,t):fr(t)?Ts(e,t):Ir(t)?fc(e,t):Rr(t)?mc(e,t):er(t)?fs(e,t):ds(`StructuralRight`)}function fs(e,t){return H.True}function ps(e,t){return fr(t)?Ts(e,t):Ir(t)&&t.anyOf.some(e=>er(e)||Rr(e))?H.True:Ir(t)?H.Union:Rr(t)||er(t)?H.True:H.Union}function ms(e,t){return Rr(e)?H.False:er(e)?H.Union:xr(e)?H.True:H.False}function hs(e,t){return R(t)&&Ks(t)?H.True:U(t)?W(e,t):nr(t)?us(G(e.items,t.items)):H.False}function gs(e,t){return U(t)?W(e,t):rr(t)?us(G(e.items,t.items)):H.False}function _s(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):ir(t)?H.True:H.False}function vs(e,t){return gr(e)||ar(e)?H.True:H.False}function ys(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):ar(t)?H.True:H.False}function bs(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):sr(t)?e.parameters.length>t.parameters.length?H.False:e.parameters.every((e,n)=>us(G(t.parameters[n],e))===H.True)?us(G(e.returns,t.returns)):H.False:H.False}function xs(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):cr(t)?H.True:H.False}function Ss(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):lr(t)?e.parameters.length>t.parameters.length?H.False:e.parameters.every((e,n)=>us(G(t.parameters[n],e))===H.True)?us(G(e.returns,t.returns)):H.False:H.False}function Cs(e,t){return _r(e)&&gt(e.const)||wr(e)||ur(e)?H.True:H.False}function ws(e,t){return ur(t)||wr(t)?H.True:U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):H.False}function Ts(e,t){return t.allOf.every(t=>G(e,t)===H.True)?H.True:H.False}function Es(e,t){return e.allOf.some(e=>G(e,t)===H.True)?H.True:H.False}function Ds(e,t){return U(t)?W(e,t):pr(t)?us(G(e.items,t.items)):H.False}function Os(e,t){return _r(t)&&t.const===e.const?H.True:U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):kr(t)?rc(e,t):wr(t)?Ps(e,t):ur(t)?Cs(e,t):ar(t)?vs(e,t):H.False}function ks(e,t){return H.False}function As(e,t){return H.True}function js(e){let[t,n]=[e,0];for(;Sr(t);)t=t.not,n+=1;return n%2==0?t:ts()}function Ms(e,t){return Sr(e)?G(js(e),t):Sr(t)?G(e,js(t)):ds(`Invalid fallthrough for Not`)}function Ns(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):Cr(t)?H.True:H.False}function Ps(e,t){return hr(e)||wr(e)||ur(e)?H.True:H.False}function Fs(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):ur(t)||wr(t)?H.True:H.False}function Is(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function Ls(e){return Ks(e)}function Rs(e){return Is(e,0)||Is(e,1)&&`description`in e.properties&&Ir(e.properties.description)&&e.properties.description.anyOf.length===2&&(kr(e.properties.description.anyOf[0])&&Fr(e.properties.description.anyOf[1])||kr(e.properties.description.anyOf[1])&&Fr(e.properties.description.anyOf[0]))}function zs(e){return Is(e,0)}function Bs(e){return Is(e,0)}function Vs(e){return Is(e,0)}function Hs(e){return Is(e,0)}function Us(e){return Ks(e)}function Ws(e){let t=ta();return Is(e,0)||Is(e,1)&&`length`in e.properties&&us(G(e.properties.length,t))===H.True}function Gs(e){return Is(e,0)}function Ks(e){let t=ta();return Is(e,0)||Is(e,1)&&`length`in e.properties&&us(G(e.properties.length,t))===H.True}function qs(e){let t=vi([li()],li());return Is(e,0)||Is(e,1)&&`then`in e.properties&&us(G(e.properties.then,t))===H.True}function Js(e,t){return G(e,t)===H.False||$n(e)&&!$n(t)?H.False:H.True}function Ys(e,t){return Rr(e)?H.False:er(e)?H.Union:xr(e)||mr(e)&&Ls(t)||hr(e)&&zs(t)||gr(e)&&Bs(t)||Ar(e)&&Rs(t)||ir(e)&&Vs(t)||kr(e)&&Ls(t)||Ar(e)&&Rs(t)||wr(e)&&zs(t)||ur(e)&&zs(t)||ar(e)&&Bs(t)||Lr(e)&&Us(t)||cr(e)&&Hs(t)||sr(e)&&Gs(t)||lr(e)&&Ws(t)?H.True:Er(e)&&kr(Qs(e))?t[tn]===`Record`?H.True:H.False:Er(e)&&wr(Qs(e))&&Is(t,0)?H.True:H.False}function Xs(e,t){return U(t)?W(e,t):Er(t)?ec(e,t):R(t)?(()=>{for(let n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!$n(t.properties[n]))return H.False;if($n(t.properties[n]))return H.True;if(Js(e.properties[n],t.properties[n])===H.False)return H.False}return H.True})():H.False}function Zs(e,t){return U(t)?W(e,t):R(t)&&qs(t)?H.True:Tr(t)?us(G(e.item,t.item)):H.False}function Qs(e){return qr in e.patternProperties?ta():Jr in e.patternProperties?na():ds(`Unknown record key pattern`)}function $s(e){return qr in e.patternProperties?e.patternProperties[qr]:Jr in e.patternProperties?e.patternProperties[Jr]:ds(`Unable to get record value schema`)}function ec(e,t){let[n,r]=[Qs(t),$s(t)];return mr(e)&&wr(n)&&us(G(e,r))===H.True?H.True:Lr(e)&&wr(n)||kr(e)&&wr(n)||nr(e)&&wr(n)?G(e,r):R(e)?(()=>{for(let t of Object.getOwnPropertyNames(e.properties))if(Js(r,e.properties[t])===H.False)return H.False;return H.True})():H.False}function tc(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?G($s(e),$s(t)):H.False}function nc(e,t){return G(Or(e)?na():e,Or(t)?na():t)}function rc(e,t){return _r(e)&&k(e.const)||kr(e)?H.True:H.False}function ic(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):kr(t)?H.True:H.False}function ac(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):Ar(t)?H.True:H.False}function oc(e,t){return jr(e)?G(da(e),t):jr(t)?G(e,da(t)):ds(`Invalid fallthrough for TemplateLiteral`)}function sc(e,t){return nr(t)&&e.items!==void 0&&e.items.every(e=>G(e,t.items)===H.True)}function cc(e,t){return xr(e)?H.True:Rr(e)?H.False:er(e)?H.Union:H.False}function lc(e,t){return U(t)?W(e,t):R(t)&&Ks(t)||nr(t)&&sc(e,t)?H.True:Pr(t)?A(e.items)&&!A(t.items)||!A(e.items)&&A(t.items)?H.False:A(e.items)&&!A(t.items)||e.items.every((e,n)=>G(e,t.items[n])===H.True)?H.True:H.False:H.False}function uc(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):Lr(t)?H.True:H.False}function dc(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):Br(t)?gc(e,t):Fr(t)?H.True:H.False}function fc(e,t){return t.anyOf.some(t=>G(e,t)===H.True)?H.True:H.False}function pc(e,t){return e.anyOf.every(e=>G(e,t)===H.True)?H.True:H.False}function mc(e,t){return H.True}function hc(e,t){return xr(t)?ks(e,t):fr(t)?Ts(e,t):Ir(t)?fc(e,t):er(t)?fs(e,t):kr(t)?rc(e,t):wr(t)?Ps(e,t):ur(t)?Cs(e,t):ar(t)?vs(e,t):nr(t)?ms(e,t):Pr(t)?cc(e,t):R(t)?Ys(e,t):Rr(t)?H.True:H.False}function gc(e,t){return Fr(e)||Fr(e)?H.True:H.False}function _c(e,t){return fr(t)?Ts(e,t):Ir(t)?fc(e,t):Rr(t)?mc(e,t):er(t)?fs(e,t):R(t)?Ys(e,t):Br(t)?H.True:H.False}function G(e,t){return jr(e)||jr(t)?oc(e,t):Or(e)||Or(t)?nc(e,t):Sr(e)||Sr(t)?Ms(e,t):er(e)?ps(e,t):nr(e)?hs(e,t):ir(e)?_s(e,t):ar(e)?ys(e,t):rr(e)?gs(e,t):sr(e)?bs(e,t):cr(e)?xs(e,t):lr(e)?Ss(e,t):ur(e)?ws(e,t):fr(e)?Es(e,t):pr(e)?Ds(e,t):_r(e)?Os(e,t):xr(e)?As(e,t):Cr(e)?Ns(e,t):wr(e)?Fs(e,t):R(e)?Xs(e,t):Er(e)?tc(e,t):kr(e)?ic(e,t):Ar(e)?ac(e,t):Pr(e)?lc(e,t):Tr(e)?Zs(e,t):Lr(e)?uc(e,t):Fr(e)?dc(e,t):Ir(e)?pc(e,t):Rr(e)?hc(e,t):Br(e)?_c(e,t):ds(`Unknown left type operand '${e[M]}'`)}function vc(e,t){return G(e,t)}function yc(e,t,n,r,i){let a={};for(let o of globalThis.Object.getOwnPropertyNames(e))a[o]=Cc(e[o],t,n,r,Et(i));return a}function bc(e,t,n,r,i){return yc(e.properties,t,n,r,i)}function xc(e,t,n,r,i){return gi(bc(e,t,n,r,i))}function Sc(e,t,n,r){let i=vc(e,t);return i===H.Union?Ti([n,r]):i===H.True?n:r}function Cc(e,t,n,r,i){return xn(e)?xc(e,t,n,r,i):bn(e)?j(Dc(e,t,n,r,i)):j(Sc(e,t,n,r),i)}function wc(e,t,n,r,i){return{[e]:Cc(B(e),t,n,r,Et(i))}}function Tc(e,t,n,r,i){return e.reduce((e,a)=>({...e,...wc(a,t,n,r,i)}),{})}function Ec(e,t,n,r,i){return Tc(e.keys,t,n,r,i)}function Dc(e,t,n,r,i){return gi(Ec(e,t,n,r,i))}function Oc(e){return e.allOf.every(e=>jc(e))}function kc(e){return e.anyOf.some(e=>jc(e))}function Ac(e){return!jc(e.not)}function jc(e){return e[M]===`Intersect`?Oc(e):e[M]===`Union`?kc(e):e[M]===`Not`?Ac(e):e[M]===`Undefined`}function Mc(e,t){return Pc(da(e),t)}function Nc(e,t){let n=e.filter(e=>vc(e,t)===H.False);return n.length===1?n[0]:Ti(n)}function Pc(e,t,n={}){return Nn(e)?j(Mc(e,t),n):xn(e)?j(Lc(e,t),n):j(P(e)?Nc(e.anyOf,t):vc(e,t)===H.False?e:z(),n)}function Fc(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Pc(e[r],t);return n}function Ic(e,t){return Fc(e.properties,t)}function Lc(e,t){return gi(Ic(e,t))}function Rc(e,t){return Bc(da(e),t)}function zc(e,t){let n=e.filter(e=>vc(e,t)!==H.False);return n.length===1?n[0]:Ti(n)}function Bc(e,t,n){return Nn(e)?j(Rc(e,t),n):xn(e)?j(Uc(e,t),n):j(P(e)?zc(e.anyOf,t):vc(e,t)===H.False?z():e,n)}function Vc(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Bc(e[r],t);return n}function Hc(e,t){return Vc(e.properties,t)}function Uc(e,t){return gi(Hc(e,t))}function Wc(e,t){return fn(e)?j(e.returns,t):z(t)}function Gc(e){return Ua(so(e))}function Kc(e,t,n){return j({[M]:`Record`,type:`object`,patternProperties:{[e]:t}},n)}function qc(e,t,n){let r={};for(let n of e)r[n]=t;return V(r,{...n,[tn]:`Record`})}function Jc(e,t,n){return Gi(e)?qc(ga(e),t,n):Kc(e.pattern,t,n)}function Yc(e,t,n){return qc(ga(Ti(e)),t,n)}function Xc(e,t,n){return qc([e.toString()],t,n)}function Zc(e,t,n){return Kc(e.source,t,n)}function Qc(e,t,n){return Kc(A(e.pattern)?Jr:e.pattern,t,n)}function $c(e,t,n){return Kc(Jr,t,n)}function el(e,t,n){return Kc(Yr,t,n)}function tl(e,t,n){return V({true:t,false:t},n)}function nl(e,t,n){return Kc(qr,t,n)}function rl(e,t,n){return Kc(qr,t,n)}function il(e,t,n={}){return P(e)?Yc(e.anyOf,t,n):Nn(e)?Jc(e,t,n):yn(e)?Xc(e.const,t,n):un(e)?tl(e,t,n):hn(e)?nl(e,t,n):Tn(e)?rl(e,t,n):An(e)?Zc(e,t,n):jn(e)?Qc(e,t,n):an(e)?$c(e,t,n):Sn(e)?el(e,t,n):z(n)}function al(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function ol(e){let t=al(e);return t===Jr?na():t===qr?ta():na({pattern:t})}function sl(e){return e.patternProperties[al(e)]}function cl(e,t){return t.parameters=Sl(e,t.parameters),t.returns=Cl(e,t.returns),t}function ll(e,t){return t.parameters=Sl(e,t.parameters),t.returns=Cl(e,t.returns),t}function ul(e,t){return t.allOf=Sl(e,t.allOf),t}function dl(e,t){return t.anyOf=Sl(e,t.anyOf),t}function fl(e,t){return A(t.items)||(t.items=Sl(e,t.items)),t}function pl(e,t){return t.items=Cl(e,t.items),t}function ml(e,t){return t.items=Cl(e,t.items),t}function hl(e,t){return t.items=Cl(e,t.items),t}function gl(e,t){return t.item=Cl(e,t.item),t}function _l(e,t){let n=xl(e,t.properties);return{...t,...V(n)}}function vl(e,t){let n=il(Cl(e,ol(t)),Cl(e,sl(t)));return{...t,...n}}function yl(e,t){return t.index in e?e[t.index]:ts()}function bl(e,t){let n=nn(t),r=rn(t),i=Cl(e,t);return n&&r?Gc(i):n&&!r?Ua(i):!n&&r?so(i):i}function xl(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,r)=>({...n,[r]:bl(e,t[r])}),{})}function Sl(e,t){return t.map(t=>Cl(e,t))}function Cl(e,t){return fn(t)?cl(e,t):mn(t)?ll(e,t):gn(t)?ul(e,t):P(t)?dl(e,t):In(t)?fl(e,t):sn(t)?pl(e,t):cn(t)?ml(e,t):_n(t)?hl(e,t):Dn(t)?gl(e,t):En(t)?_l(e,t):On(t)?vl(e,t):on(t)?yl(e,t):t}function wl(e,t){return Cl(t,Dt(e))}function Tl(e){return j({[M]:`Integer`,type:`integer`},e)}function El(e,t,n){return{[e]:Ll(B(e),t,Et(n))}}function Dl(e,t,n){return e.reduce((e,r)=>({...e,...El(r,t,n)}),{})}function Ol(e,t,n){return Dl(e.keys,t,n)}function kl(e,t,n){return gi(Ol(e,t,n))}function Al(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join(``)}function jl(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join(``)}function Ml(e){return e.toUpperCase()}function Nl(e){return e.toLowerCase()}function Pl(e,t,n){let r=zi(e.pattern);return Wi(r)?fa([Ti(Il([...Zi(r)].map(e=>B(e)),t))],n):{...e,pattern:Fl(e.pattern,t)}}function Fl(e,t){return typeof e==`string`?t===`Uncapitalize`?Al(e):t===`Capitalize`?jl(e):t===`Uppercase`?Ml(e):t===`Lowercase`?Nl(e):e:e.toString()}function Il(e,t){return e.map(e=>Ll(e,t))}function Ll(e,t,n={}){return bn(e)?kl(e,t,n):Nn(e)?Pl(e,t,n):P(e)?Ti(Il(e.anyOf,t),n):yn(e)?B(Fl(e.const,t),n):j(e,n)}function Rl(e,t={}){return Ll(e,`Capitalize`,t)}function zl(e,t={}){return Ll(e,`Lowercase`,t)}function Bl(e,t={}){return Ll(e,`Uncapitalize`,t)}function Vl(e,t={}){return Ll(e,`Uppercase`,t)}function Hl(e,t,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Ql(e[i],t,Et(n));return r}function Ul(e,t,n){return Hl(e.properties,t,n)}function Wl(e,t,n){return gi(Ul(e,t,n))}function Gl(e,t){return e.map(e=>Zl(e,t))}function Kl(e,t){return e.map(e=>Zl(e,t))}function ql(e,t){let{[t]:n,...r}=e;return r}function Jl(e,t){return t.reduce((e,t)=>ql(e,t),e)}function Yl(e,t,n){let r=hi(e,[Qt,`$id`,`required`,`properties`]);return V(Jl(n,t),r)}function Xl(e){return Ti(e.reduce((e,t)=>vn(t)?[...e,B(t)]:e,[]))}function Zl(e,t){return gn(e)?vo(Gl(e.allOf,t)):P(e)?Ti(Kl(e.anyOf,t)):En(e)?Yl(e,t,e.properties):V({})}function Ql(e,t,n){let r=lt(t)?Xl(t):t,i=Un(t)?ga(t):t,a=kn(e),o=kn(t);return xn(e)?Wl(e,i,n):bn(t)?nu(e,t,n):a&&o||!a&&o||a&&!o?pi(`Omit`,[e,r],n):j({...Zl(e,i),...n})}function $l(e,t,n){return{[t]:Ql(e,[t],Et(n))}}function eu(e,t,n){return t.reduce((t,r)=>({...t,...$l(e,r,n)}),{})}function tu(e,t,n){return eu(e,t.keys,n)}function nu(e,t,n){return gi(tu(e,t,n))}function ru(e,t,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=fu(e[i],t,Et(n));return r}function iu(e,t,n){return ru(e.properties,t,n)}function au(e,t,n){return gi(iu(e,t,n))}function ou(e,t){return e.map(e=>du(e,t))}function su(e,t){return e.map(e=>du(e,t))}function cu(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function lu(e,t,n){let r=hi(e,[Qt,`$id`,`required`,`properties`]);return V(cu(n,t),r)}function uu(e){return Ti(e.reduce((e,t)=>vn(t)?[...e,B(t)]:e,[]))}function du(e,t){return gn(e)?vo(ou(e.allOf,t)):P(e)?Ti(su(e.anyOf,t)):En(e)?lu(e,t,e.properties):V({})}function fu(e,t,n){let r=lt(t)?uu(t):t,i=Un(t)?ga(t):t,a=kn(e),o=kn(t);return xn(e)?au(e,i,n):bn(t)?gu(e,t,n):a&&o||!a&&o||a&&!o?pi(`Pick`,[e,r],n):j({...du(e,i),...n})}function pu(e,t,n){return{[t]:fu(e,[t],Et(n))}}function mu(e,t,n){return t.reduce((t,r)=>({...t,...pu(e,r,n)}),{})}function hu(e,t,n){return mu(e,t.keys,n)}function gu(e,t,n){return gi(hu(e,t,n))}function _u(e,t){return pi(`Partial`,[pi(e,t)])}function vu(e){return pi(`Partial`,[yo(e)])}function yu(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=so(e[n]);return t}function bu(e,t){let n=hi(e,[Qt,`$id`,`required`,`properties`]);return V(yu(t),n)}function xu(e){return e.map(e=>Su(e))}function Su(e){return dn(e)?_u(e.target,e.parameters):kn(e)?vu(e.$ref):gn(e)?vo(xu(e.allOf)):P(e)?Ti(xu(e.anyOf)):En(e)?bu(e,e.properties):ln(e)||un(e)||hn(e)||yn(e)||wn(e)||Tn(e)||jn(e)||Mn(e)||Ln(e)?e:V({})}function Cu(e,t){return xn(e)?Eu(e,t):j({...Su(e),...t})}function wu(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Cu(e[r],Et(t));return n}function Tu(e,t){return wu(e.properties,t)}function Eu(e,t){return gi(Tu(e,t))}function Du(e,t){return pi(`Required`,[pi(e,t)])}function Ou(e){return pi(`Required`,[yo(e)])}function ku(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=hi(e[n],[en]);return t}function Au(e,t){let n=hi(e,[Qt,`$id`,`required`,`properties`]);return V(ku(t),n)}function ju(e){return e.map(e=>Mu(e))}function Mu(e){return dn(e)?Du(e.target,e.parameters):kn(e)?Ou(e.$ref):gn(e)?vo(ju(e.allOf)):P(e)?Ti(ju(e.anyOf)):En(e)?Au(e,e.properties):ln(e)||un(e)||hn(e)||yn(e)||wn(e)||Tn(e)||jn(e)||Mn(e)||Ln(e)?e:V({})}function Nu(e,t){return xn(e)?Iu(e,t):j({...Mu(e),...t})}function Pu(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Nu(e[r],t);return n}function Fu(e,t){return Pu(e.properties,t)}function Iu(e,t){return gi(Fu(e,t))}function Lu(e,t){return t.map(t=>kn(t)?Ru(e,t.$ref):ad(e,t))}function Ru(e,t){return t in e?kn(e[t])?Ru(e,e[t].$ref):ad(e,e[t]):z()}function zu(e){return Eo(e[0])}function Bu(e){return ja(e[0],e[1])}function Vu(e){return Vo(e[0])}function Hu(e){return Cu(e[0])}function Uu(e){return Ql(e[0],e[1])}function Wu(e){return fu(e[0],e[1])}function Gu(e){return Nu(e[0])}function Ku(e,t,n){let r=Lu(e,n);return t===`Awaited`?zu(r):t===`Index`?Bu(r):t===`KeyOf`?Vu(r):t===`Partial`?Hu(r):t===`Omit`?Uu(r):t===`Pick`?Wu(r):t===`Required`?Gu(r):z()}function qu(e,t){return ui(ad(e,t))}function Ju(e,t){return fi(ad(e,t))}function Yu(e,t,n){return _i(id(e,t),ad(e,n))}function Xu(e,t,n){return vi(id(e,t),ad(e,n))}function Zu(e,t){return vo(id(e,t))}function Qu(e,t){return Ia(ad(e,t))}function $u(e,t){return V(globalThis.Object.keys(t).reduce((n,r)=>({...n,[r]:ad(e,t[r])}),{}))}function ed(e,t){let[n,r]=[ad(e,sl(t)),al(t)],i=Dt(t);return i.patternProperties[r]=n,i}function td(e,t){return kn(t)?{...Ru(e,t.$ref),[Qt]:t[Qt]}:t}function nd(e,t){return qa(id(e,t))}function rd(e,t){return Ti(id(e,t))}function id(e,t){return t.map(t=>ad(e,t))}function ad(e,t){return rn(t)?j(ad(e,hi(t,[en])),t):nn(t)?j(ad(e,hi(t,[$t])),t):Fn(t)?j(td(e,t),t):sn(t)?j(qu(e,t.items),t):cn(t)?j(Ju(e,t.items),t):dn(t)?j(Ku(e,t.target,t.parameters)):fn(t)?j(Yu(e,t.parameters,t.returns),t):mn(t)?j(Xu(e,t.parameters,t.returns),t):gn(t)?j(Zu(e,t.allOf),t):_n(t)?j(Qu(e,t.items),t):En(t)?j($u(e,t.properties),t):On(t)?j(ed(e,t)):In(t)?j(nd(e,t.items||[]),t):P(t)?j(rd(e,t.anyOf),t):t}function od(e,t){return t in e?ad(e,e[t]):z()}function sd(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:od(e,n)}),{})}var cd=class{constructor(e){let t=sd(e),n=this.WithIdentifiers(t);this.$defs=n}Import(e,t){let n={...this.$defs,[e]:j(this.$defs[e],t)};return j({[M]:`Import`,$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:{...e[n],$id:n}}),{})}};function ld(e){return new cd(e)}function ud(e,t){return j({[M]:`Not`,not:e},t)}function dd(e,t){return mn(e)?qa(e.parameters,t):z()}var fd=0;function pd(e,t={}){A(t.$id)&&(t.$id=`T${fd++}`);let n=Dt(e({[M]:`This`,$ref:`${t.$id}`}));return n.$id=t.$id,j({[tn]:`Recursive`,...n},t)}function md(e,t){let n=k(e)?new globalThis.RegExp(e):e;return j({[M]:`RegExp`,type:`RegExp`,source:n.source,flags:n.flags},t)}function hd(e){return gn(e)?e.allOf:P(e)?e.anyOf:In(e)?e.items??[]:[]}function gd(e){return hd(e)}function _d(e,t){return mn(e)?j(e.returns,t):z(t)}var vd=class{constructor(e){this.schema=e}Decode(e){return new yd(this.schema,e)}},yd=class{constructor(e,t){this.schema=e,this.decode=t}EncodeTransform(e,t){let n={Encode:n=>t[Qt].Encode(e(n)),Decode:e=>this.decode(t[Qt].Decode(e))};return{...t,[Qt]:n}}EncodeSchema(e,t){let n={Decode:this.decode,Encode:e};return{...t,[Qt]:n}}Encode(e){return Fn(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function bd(e){return new vd(e)}function xd(e={}){return j({[M]:e[M]??`Unsafe`},e)}function Sd(e){return j({[M]:`Void`,type:`void`},e)}var K=e({Any:()=>li,Argument:()=>di,Array:()=>ui,AsyncIterator:()=>fi,Awaited:()=>Eo,BigInt:()=>ea,Boolean:()=>$i,Capitalize:()=>Rl,Composite:()=>Yo,Const:()=>os,Constructor:()=>_i,ConstructorParameters:()=>ss,Date:()=>Xo,Enum:()=>cs,Exclude:()=>Pc,Extends:()=>Cc,Extract:()=>Bc,Function:()=>vi,Index:()=>ja,InstanceType:()=>Wc,Instantiate:()=>wl,Integer:()=>Tl,Intersect:()=>vo,Iterator:()=>Ia,KeyOf:()=>Vo,Literal:()=>B,Lowercase:()=>zl,Mapped:()=>ro,Module:()=>ld,Never:()=>z,Not:()=>ud,Null:()=>Zo,Number:()=>ta,Object:()=>V,Omit:()=>Ql,Optional:()=>so,Parameters:()=>dd,Partial:()=>Cu,Pick:()=>fu,Promise:()=>za,Readonly:()=>Ua,ReadonlyOptional:()=>Gc,Record:()=>il,Recursive:()=>pd,Ref:()=>yo,RegExp:()=>md,Required:()=>Nu,Rest:()=>gd,ReturnType:()=>_d,String:()=>na,Symbol:()=>Qo,TemplateLiteral:()=>fa,Transform:()=>bd,Tuple:()=>qa,Uint8Array:()=>es,Uncapitalize:()=>Bl,Undefined:()=>$o,Union:()=>Ti,Unknown:()=>ts,Unsafe:()=>xd,Uppercase:()=>Vl,Void:()=>Sd}),Cd=K.String({pattern:`^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-(?:(?:0|[1-9][0-9]*)|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:(?:0|[1-9][0-9]*)|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$`}),wd=K.Union([K.Literal(`current`),K.Literal(`available`),K.Literal(`restart-required`),K.Literal(`check-failed`)]),Td=K.Object({appVersion:Cd,codexVersion:Cd,latestVersion:K.Union([Cd,K.Null()]),releaseNotes:K.Union([K.String({maxLength:32768}),K.Null()]),status:wd,updateAvailable:K.Boolean()},{additionalProperties:!1});K.Object({version:Cd},{additionalProperties:!1});var Ed=K.Object({appVersion:Cd,codexVersion:Cd,latestVersion:Cd,releaseNotes:K.Null(),status:K.Literal(`restart-required`),updateAvailable:K.Literal(!1)},{additionalProperties:!1}),Dd=K.Union([K.Literal(`local`),K.Literal(`lan`)]),Od=K.Object({authenticated:K.Boolean(),mode:Dd,version:K.Literal(1)},{additionalProperties:!1});K.Object({code:K.String({minLength:1})},{additionalProperties:!1});var kd=K.String({maxLength:32768,minLength:1,pattern:`^(?!.*[\\u0000\\r\\n])(?:/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\/]+[\\\\/][^\\\\/]+).*$`}),Ad=K.String({maxLength:64,minLength:1}),jd=K.Object({path:kd},{additionalProperties:!1}),Md=K.Object({id:Ad,path:kd},{additionalProperties:!1}),Nd=K.Readonly(K.Array(Md,{minItems:1,uniqueItems:!0})),Pd=K.Readonly(K.Array(jd,{minItems:1,uniqueItems:!0}));K.Object({rootPath:kd},{additionalProperties:!1}),Zr(`date-time`)||Qr(`date-time`,e=>!Number.isNaN(Date.parse(e)));var Fd=K.String({format:`date-time`}),Id=K.Union([Fd,K.Null()]),Ld=K.String({minLength:1,pattern:`^(?![A-Za-z]:)(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))(?!.*//)(?!.*\\\\)(?!.*\\/$).+$`}),Rd=K.String({maxLength:128,minLength:1,pattern:`^[A-Za-z0-9._:-]+$`});K.Object({query:K.String({maxLength:256}),rootPath:K.Optional(kd),sessionId:Rd},{additionalProperties:!1});var zd=K.Object({name:K.String({minLength:1}),path:Ld,rootId:Ad,rootPath:kd},{additionalProperties:!1}),Bd=K.Object({data:K.Array(zd,{maxItems:50})},{additionalProperties:!1});K.Object({rootPath:K.Optional(kd),sessionId:Rd},{additionalProperties:!1});var Vd=K.Object({},{additionalProperties:!1}),Hd=K.String({maxLength:32768,minLength:1,pattern:`^[^\\u0000\\r\\n]+$`}),Ud=K.Object({createdAt:Fd,id:K.String({minLength:1}),name:K.String({minLength:1}),roots:Nd},{additionalProperties:!1}),Wd=kd;K.Object({includeHidden:K.Optional(K.Boolean()),path:K.Optional(Wd)},{additionalProperties:!1});var Gd=K.Object({name:K.String({minLength:1}),path:Wd},{additionalProperties:!1}),Kd=K.Object({name:K.String({minLength:1}),path:Wd},{additionalProperties:!1}),qd=K.Object({entries:K.Array(Gd),parentPath:K.Union([Wd,K.Null()]),path:Wd,roots:K.Array(Kd)},{additionalProperties:!1}),Jd=K.Union([K.Literal(`file`),K.Literal(`image`)]);K.Object({includeHidden:K.Optional(K.Boolean()),kind:Jd,path:K.Optional(Wd)},{additionalProperties:!1});var Yd=K.Object({name:K.String({minLength:1}),path:Wd,type:K.Union([K.Literal(`directory`),K.Literal(`file`)])},{additionalProperties:!1}),Xd=K.Object({entries:K.Array(Yd),parentPath:K.Union([Wd,K.Null()]),path:Wd,roots:K.Array(Kd)},{additionalProperties:!1});K.Object({path:Wd},{additionalProperties:!1}),K.Object({roots:Pd},{additionalProperties:!1});var Zd=K.Object({project:Ud},{additionalProperties:!1}),Qd=K.Union([K.Literal(`visual-studio-code`),K.Literal(`system-default`),K.Literal(`zed`),K.Literal(`windsurf`),K.Literal(`finder`),K.Literal(`terminal`),K.Literal(`ghostty`),K.Literal(`xcode`),K.Literal(`android-studio`),K.Literal(`file-manager`),K.Literal(`gnome-terminal`),K.Literal(`konsole`),K.Literal(`xfce-terminal`),K.Literal(`explorer`),K.Literal(`windows-terminal`),K.Literal(`command-prompt`)]),$d=K.Union([K.Literal(`editor`),K.Literal(`file-manager`),K.Literal(`system-default`),K.Literal(`terminal`),K.Literal(`tool`)]),ef=K.Object({id:Qd,kind:$d,name:K.String({minLength:1})},{additionalProperties:!1}),tf=K.Union([K.Literal(`darwin`),K.Literal(`linux`),K.Literal(`win32`)]),nf=K.Object({apps:K.Array(ef,{uniqueItems:!0}),platform:tf},{additionalProperties:!1});K.Object({appId:Qd,path:K.Optional(Hd)},{additionalProperties:!1});var rf=K.Object({appId:Qd,path:K.Optional(Hd)},{additionalProperties:!1});K.Object({projectIds:K.Array(K.String({minLength:1}),{minItems:1,uniqueItems:!0})},{additionalProperties:!1}),K.Object({name:K.String({maxLength:200,minLength:1,pattern:`\\S`})},{additionalProperties:!1});var af=K.Object({project:Ud},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var of=K.Object({projectId:K.String({minLength:1}),status:K.Literal(`removed`)},{additionalProperties:!1}),sf=K.Object({id:K.String({minLength:1}),pinned:K.Boolean(),projectId:K.String({minLength:1}),title:K.String({minLength:1}),updatedAt:Fd},{additionalProperties:!1}),cf=K.Union([K.Literal(`pending`),K.Literal(`running`),K.Literal(`completed`),K.Literal(`failed`),K.Literal(`declined`),K.Literal(`interrupted`)]),lf=K.Object({branch:K.Optional(K.String({minLength:1})),instructions:K.Optional(K.String({minLength:1})),sha:K.Optional(K.String({minLength:1})),title:K.Optional(K.String({minLength:1})),type:K.Union([K.Literal(`uncommitted_changes`),K.Literal(`base_branch`),K.Literal(`commit`),K.Literal(`custom`)])},{additionalProperties:!1}),uf=K.Intersect([lf,K.Union([K.Object({type:K.Literal(`uncommitted_changes`)}),K.Object({branch:K.String({minLength:1}),type:K.Literal(`base_branch`)}),K.Object({sha:K.String({minLength:1}),type:K.Literal(`commit`)}),K.Object({instructions:K.String({minLength:1}),type:K.Literal(`custom`)})])]),df=50*1024*1024,ff=50*1024*1024,pf=10*1024*1024,mf=50*1024*1024,hf=Math.max(df,pf),gf=1500,_f=512*1024*1024,vf=`.png,.jpg,.jpeg,.webp,.gif`,yf=`.asm,.astro,.awk,.bash,.bat,.c,.cc,.conf,.cs,.cpp,.css,.csv,.cxx,.def,.dic,.diff,.doc,.docx,.dot,.eml,.ejs,.ex,.exs,.go,.gradle,.graphql,.groovy,.h,.hh,.htm,.html,.hbs,.hcl,.hs,.ics,.ifb,.iif,.in,.ini,.jade,.java,.jinja2,.jl,.js,.jsx,.json,.json5,.kt,.kts,.ksh,.list,.liquid,.lua,.log,.markdown,.md,.mht,.mhtml,.mime,.mjs,.nws,.ndjson,.odt,.pdf,.pl,.patch,.php,.pot,.ppa,.pps,.ppt,.pptx,.pwz,.py,.properties,.proto,.ps1,.pug,.r,.rb,.rst,.rtf,.rs,.s,.sass,.scala,.scss,.sh,.sql,.srt,.text,.tex,.tf,.tmpl,.toml,.ts,.tsx,.tsv,.txt,.vcf,.vtt,.vbs,.wiz,.xla,.xlb,.xlc,.xlm,.xls,.xlsx,.xlt,.xlw,.xml,.yaml,.yml,.zsh`.split(`,`),bf=`application/csv,application/graphql,application/javascript,application/json,application/msword,application/pdf,application/rtf,application/toml,application/typescript,application/vnd.ms-excel,application/vnd.ms-powerpoint,application/vnd.oasis.opendocument.text,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/x-httpd-php,application/x-iif,application/x-ndjson,application/x-patch,application/x-protobuf,application/x-rust,application/x-shellscript,application/x-sql,application/x-toml,application/x-typescript,application/x-yaml,application/yaml,message/rfc822,text/calendar,text/csv,text/css,text/html,text/javascript,text/jsx,text/markdown,text/plain,text/rtf,text/tsx,text/tsv,text/vtt,text/x-c,text/x-c++,text/x-csharp,text/x-diff,text/x-go,text/x-java,text/x-makefile,text/x-python,text/x-rst,text/x-rust,text/x-shellscript,text/x-sql,text/x-typescript,text/x-yaml,text/xml`.split(`,`),xf=[...yf,...bf].join(`,`);K.Union([K.Literal(`image/gif`),K.Literal(`image/jpeg`),K.Literal(`image/png`),K.Literal(`image/webp`)]);var Sf=K.String({maxLength:255,minLength:1}),Cf=K.Union([K.Literal(`file`),K.Literal(`image`),K.Literal(`text`)]),wf=K.Object({name:K.String({minLength:1})},{additionalProperties:!1});function Tf(e,t){let n=new Set(t.map(e=>e.name)),r=e,i=!1;for(;r.length>0;){let e=/^\s*\$([^\s$]+)/u.exec(r),t=e?.[1];if(e===null||t===void 0||!n.has(t))break;r=r.slice(e[0].length),i=!0}return i?r.trimStart():e}var Ef=K.Object({id:K.String({minLength:1}),kind:Cf,mediaType:Sf,name:K.String({maxLength:255,minLength:1}),size:K.Integer({maximum:_f,minimum:1})},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var Df=K.Object({attachmentId:K.String({minLength:1}),status:K.Literal(`opened`)},{additionalProperties:!1}),Of=K.Union([K.Literal(`commentary`),K.Literal(`final_answer`)]),kf=K.Object({attachments:K.Optional(K.Array(Ef,{maxItems:gf})),id:K.String({minLength:1}),phase:K.Optional(Of),role:K.Union([K.Literal(`user`),K.Literal(`assistant`)]),skills:K.Optional(K.Array(wf)),text:K.String(),type:K.Literal(`message`)},{additionalProperties:!1}),Af=K.Object({content:K.String(),id:K.String({minLength:1}),summary:K.String(),type:K.Literal(`reasoning`)},{additionalProperties:!1}),jf=K.Object({bytes:K.Integer({minimum:0}),lines:K.Integer({minimum:0})},{additionalProperties:!1}),Mf=K.Object({command:K.String(),cwd:K.String(),exitCode:K.Optional(K.Integer()),id:K.String({minLength:1}),output:K.Optional(K.String()),outputOmitted:jf,status:cf,type:K.Literal(`command`)},{additionalProperties:!1}),Nf=K.Object({command:K.String({minLength:1}),cwd:K.String({minLength:1}),id:K.String({minLength:1}),itemId:K.String({minLength:1})},{additionalProperties:!1}),Pf=K.Object({data:K.Array(Nf)},{additionalProperties:!1}),Ff=K.Object({status:K.Literal(`terminated`),terminalId:K.String({minLength:1})},{additionalProperties:!1}),If=K.Union([K.String(),K.Null()]),Lf=K.Union([K.Number(),K.Null()]),Rf={description:If,id:K.String({minLength:1}),required:K.Boolean(),title:K.String({minLength:1})},zf=K.Object({label:K.String({minLength:1}),value:K.String()},{additionalProperties:!1}),Bf=K.Union([K.Object({...Rf,defaultValue:K.Union([K.String(),K.Null()]),format:K.Union([K.Literal(`email`),K.Literal(`uri`),K.Literal(`date`),K.Literal(`date-time`),K.Null()]),maxLength:K.Union([K.Integer({minimum:0}),K.Null()]),minLength:K.Union([K.Integer({minimum:0}),K.Null()]),type:K.Literal(`string`)},{additionalProperties:!1}),K.Object({...Rf,defaultValue:K.Union([K.String(),K.Null()]),options:K.Array(zf,{minItems:1}),type:K.Literal(`select`)},{additionalProperties:!1}),K.Object({...Rf,defaultValue:K.Array(K.String()),maximum:K.Union([K.Integer({minimum:0}),K.Null()]),minimum:K.Union([K.Integer({minimum:0}),K.Null()]),options:K.Array(zf,{minItems:1}),type:K.Literal(`multi_select`)},{additionalProperties:!1}),K.Object({...Rf,defaultValue:Lf,maximum:Lf,minimum:Lf,type:K.Union([K.Literal(`number`),K.Literal(`integer`)])},{additionalProperties:!1}),K.Object({...Rf,defaultValue:K.Union([K.Boolean(),K.Null()]),type:K.Literal(`boolean`)},{additionalProperties:!1})]),Vf=K.Record(K.String(),K.Union([K.String(),K.Number(),K.Boolean(),K.Array(K.String())])),Hf=K.Union([K.Object({action:K.Literal(`accept`),content:Vf},{additionalProperties:!1}),K.Object({action:K.Union([K.Literal(`decline`),K.Literal(`cancel`)]),content:K.Null()},{additionalProperties:!1})]),Uf=K.Union([K.Literal(`pending`),K.Literal(`resolved`),K.Literal(`expired`)]),Wf=K.Union([K.Literal(`allow`),K.Literal(`allow_for_session`),K.Literal(`deny`)]),Gf=K.Object({host:K.String({minLength:1}),protocol:K.Union([K.Literal(`http`),K.Literal(`https`),K.Literal(`socks5Tcp`),K.Literal(`socks5Udp`)])},{additionalProperties:!1}),Kf={createdAt:Fd,expiresAt:Id,itemId:K.String({minLength:1}),projectId:K.String({minLength:1}),requestId:K.String({minLength:1}),status:Uf,taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},qf={itemId:K.String({minLength:1}),projectId:K.String({minLength:1}),taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},Jf=K.Object({description:K.String(),label:K.String({minLength:1})},{additionalProperties:!1}),Yf={header:K.String({minLength:1}),id:K.String({minLength:1}),isSecret:K.Boolean(),prompt:K.String({minLength:1})},Xf=K.Union([K.Object({...Yf,isOther:K.Boolean(),options:K.Array(Jf,{minItems:1}),type:K.Literal(`choice`)},{additionalProperties:!1}),K.Object({...Yf,isOther:K.Literal(!0),options:K.Array(Jf,{maxItems:0}),type:K.Literal(`choice`)},{additionalProperties:!1}),K.Object({...Yf,isOther:K.Literal(!1),options:K.Array(Jf,{maxItems:2,minItems:2}),type:K.Literal(`confirmation`)},{additionalProperties:!1}),K.Object({...Yf,isOther:K.Boolean(),options:K.Array(Jf,{maxItems:0}),type:K.Literal(`short_text`)},{additionalProperties:!1})]),Zf=K.Object({...Kf,availableDecisions:K.Array(Wf,{minItems:1}),grantRoot:K.Union([K.String(),K.Null()]),reason:K.Union([K.String(),K.Null()]),type:K.Literal(`file_change_approval`)},{additionalProperties:!1}),Qf=K.Union([K.Literal(`network`),K.Literal(`file_system`)]),$f=K.Union([K.Literal(`read`),K.Literal(`write`),K.Literal(`deny`)]),ep=K.Union([K.Object({type:K.Literal(`path`),value:K.String({minLength:1})},{additionalProperties:!1}),K.Object({type:K.Literal(`glob`),value:K.String({minLength:1})},{additionalProperties:!1}),K.Object({kind:K.Union([K.Literal(`root`),K.Literal(`minimal`),K.Literal(`project_roots`),K.Literal(`tmpdir`),K.Literal(`slash_tmp`),K.Literal(`unknown`)]),path:K.Union([K.String({minLength:1}),K.Null()]),subpath:K.Union([K.String(),K.Null()]),type:K.Literal(`special`)},{additionalProperties:!1})]),tp=K.Object({entries:K.Array(K.Object({access:$f,path:ep},{additionalProperties:!1})),globScanMaxDepth:K.Union([K.Integer({minimum:0}),K.Null()]),read:K.Union([K.Array(K.String({minLength:1})),K.Null()]),write:K.Union([K.Array(K.String({minLength:1})),K.Null()])},{additionalProperties:!1}),np=K.Object({fileSystem:K.Union([tp,K.Null()]),network:K.Union([K.Object({enabled:K.Union([K.Boolean(),K.Null()])},{additionalProperties:!1}),K.Null()])},{additionalProperties:!1}),rp=K.Object({...Kf,additionalPermissions:K.Optional(K.Union([np,K.Null()])),availableDecisions:K.Array(Wf,{minItems:1}),command:K.Union([K.String(),K.Null()]),cwd:K.Union([K.String(),K.Null()]),networkAccess:K.Union([Gf,K.Null()]),reason:K.Union([K.String(),K.Null()]),type:K.Literal(`command_approval`)},{additionalProperties:!1}),ip=K.Object({...Kf,cwd:K.String({minLength:1}),environmentId:K.Union([K.String({minLength:1}),K.Null()]),permissions:np,reason:K.Union([K.String(),K.Null()]),type:K.Literal(`permissions_approval`)},{additionalProperties:!1}),ap=K.Object({...Kf,questions:K.Array(Xf,{minItems:1,maxItems:3}),type:K.Literal(`user_input`)},{additionalProperties:!1}),op={...Kf,message:K.String({minLength:1}),serverName:K.String({minLength:1}),type:K.Literal(`mcp_elicitation`)},sp=K.Object({...op,fields:K.Array(Bf),mode:K.Literal(`form`)},{additionalProperties:!1}),cp=K.Object({...op,mode:K.Literal(`url`),url:K.String({minLength:1})},{additionalProperties:!1}),lp=K.Object({...op,mode:K.Literal(`unsupported`)},{additionalProperties:!1}),up=K.Union([sp,cp,lp]),dp=K.Union([rp,Zf,ip,ap,up]);function fp(e){return K.Union([K.Object({...rp.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...Zf.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...ip.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...ap.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...sp.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...cp.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...lp.properties,status:K.Literal(e)},{additionalProperties:!1})])}var pp=fp(`pending`),mp=fp(`resolved`),hp=fp(`expired`),gp=K.Object({decision:Wf},{additionalProperties:!1}),_p=K.Object({answers:K.Record(K.String(),K.Array(K.String({minLength:1}),{maxItems:1,minItems:1}))},{additionalProperties:!1}),vp=K.Object({grantedPermissions:K.Array(Qf,{maxItems:2,uniqueItems:!0}),scope:K.Union([K.Literal(`turn`),K.Literal(`session`)])},{additionalProperties:!1});K.Union([K.Object({...qf,resolution:gp,type:K.Literal(`command_approval`)},{additionalProperties:!1}),K.Object({...qf,resolution:gp,type:K.Literal(`file_change_approval`)},{additionalProperties:!1}),K.Object({...qf,resolution:vp,type:K.Literal(`permissions_approval`)},{additionalProperties:!1}),K.Object({...qf,resolution:_p,type:K.Literal(`user_input`)},{additionalProperties:!1}),K.Object({...qf,resolution:Hf,type:K.Literal(`mcp_elicitation`)},{additionalProperties:!1})]);var yp=K.Object({request:dp},{additionalProperties:!1}),bp=K.Object({diff:K.String(),kind:K.Union([K.Literal(`create`),K.Literal(`update`),K.Literal(`delete`)]),path:K.String({minLength:1})},{additionalProperties:!1}),xp=K.String({maxLength:64,minLength:64,pattern:`^[a-f0-9]{64}$`}),Sp=K.String({maxLength:1024,minLength:1,pattern:`\\S`}),Cp=K.String({maxLength:1024,minLength:1,pattern:`^(?!\\.{1,2}$)(?!.*[\\u0000\\r\\n])[^/\\\\]+$`}),wp=K.Array(Ld,{maxItems:500,minItems:1,uniqueItems:!0}),Tp=K.String({maxLength:1e4,minLength:1,pattern:`\\S`}),Ep=K.Object({diff:K.String(),kind:K.Union([K.Literal(`create`),K.Literal(`update`),K.Literal(`delete`)]),path:Ld},{additionalProperties:!1}),Dp=K.Object({baseBranches:K.Array(K.String({minLength:1}),{uniqueItems:!0}),branch:K.Union([K.String({minLength:1}),K.Null()]),branches:K.Array(Sp,{uniqueItems:!0}),repositoryMode:K.Union([K.Literal(`root`),K.Literal(`children`),K.Literal(`none`)]),snapshot:xp,staged:K.Array(Ep),unstaged:K.Array(Ep)},{additionalProperties:!1});K.Object({includeDiff:K.Optional(K.Boolean()),repository:K.Optional(Cp),rootPath:kd},{additionalProperties:!1});var Op=K.Object({authoredAt:K.String({format:`date-time`}),authorEmail:K.String({maxLength:320,minLength:1}),authorName:K.String({maxLength:512,minLength:1,pattern:`\\S`}),sha:K.String({maxLength:64,minLength:40,pattern:`^[a-f0-9]+$`}),title:K.String({maxLength:1e4,minLength:1,pattern:`\\S`})},{additionalProperties:!1}),kp=K.String({maxLength:20,minLength:1,pattern:`^[0-9]+$`});K.Object({cursor:K.Optional(kp),repository:K.Optional(Ld),rootPath:kd},{additionalProperties:!1});var Ap=K.Object({branch:K.Union([Sp,K.Null()]),commits:K.Array(Op,{maxItems:20}),nextCursor:K.Union([kp,K.Null()]),repositories:K.Array(Ld,{maxItems:256,uniqueItems:!0}),repository:K.Union([Ld,K.Null()]),repositoryMode:K.Union([K.Literal(`root`),K.Literal(`children`)])},{additionalProperties:!1}),jp=K.String({maxLength:64,minLength:40,pattern:`^[a-f0-9]+$`}),Mp=K.String({maxLength:20,minLength:1,pattern:`^[0-9]+$`});K.Object({cursor:K.Optional(Mp),repository:K.Optional(Ld),rootPath:kd,sha:jp},{additionalProperties:!1});var Np=K.Object({kind:K.Union([K.Literal(`create`),K.Literal(`update`),K.Literal(`delete`)]),path:Ld},{additionalProperties:!1}),Pp=K.Object({files:K.Array(Np,{maxItems:100}),nextCursor:K.Union([Mp,K.Null()])},{additionalProperties:!1});K.Object({path:Ld,repository:K.Optional(Ld),rootPath:kd,sha:jp},{additionalProperties:!1});var Fp=K.Object({diff:K.String({maxLength:512*1024}),truncated:K.Boolean()},{additionalProperties:!1});K.Object({branch:Sp,expectedSnapshot:xp},{additionalProperties:!1}),K.Object({branch:Sp,expectedSnapshot:xp},{additionalProperties:!1});var Ip=K.Object({branch:K.Union([Sp,K.Null()]),current:K.Boolean(),path:Wd},{additionalProperties:!1}),Lp=K.Object({worktrees:K.Array(Ip,{maxItems:256})},{additionalProperties:!1});K.Object({branch:Sp,expectedSnapshot:xp},{additionalProperties:!1}),K.Object({path:Wd},{additionalProperties:!1});var Rp=K.Object({project:Ud,worktree:Ip},{additionalProperties:!1});K.Object({expectedSnapshot:xp,paths:wp,repository:K.Optional(Cp)},{additionalProperties:!1});var zp=K.Object({message:Tp,snapshot:xp},{additionalProperties:!1});K.Object({action:K.Union([K.Literal(`commit`),K.Literal(`commit_and_push`)]),expectedSnapshot:xp,message:Tp,paths:wp,repository:K.Optional(Cp)},{additionalProperties:!1});var Bp=K.Object({branch:K.Union([K.String({minLength:1}),K.Null()]),commitSha:K.String({maxLength:64,minLength:7,pattern:`^[a-f0-9]+$`}),message:Tp,pushError:K.Union([K.String({minLength:1}),K.Null()]),pushStatus:K.Union([K.Literal(`not_requested`),K.Literal(`pushed`),K.Literal(`failed`),K.Literal(`not_configured`)])},{additionalProperties:!1}),Vp=K.Object({path:Ld,type:K.Union([K.Literal(`directory`),K.Literal(`file`)])},{additionalProperties:!1});K.Object({path:K.Optional(Ld),rootPath:K.Optional(kd)},{additionalProperties:!1});var Hp=K.Object({entries:K.Array(Vp),path:K.Union([Ld,K.Null()])},{additionalProperties:!1});K.Object({cursor:K.Optional(K.Integer({minimum:0})),path:Hd,rootPath:K.Optional(kd)},{additionalProperties:!1});var Up=K.Object({content:K.String(),nextCursor:K.Union([K.Integer({minimum:0}),K.Null()]),path:Hd},{additionalProperties:!1}),Wp=K.Object({changes:K.Array(bp),id:K.String({minLength:1}),status:cf,type:K.Literal(`file_change`)},{additionalProperties:!1}),Gp=K.Object({id:K.String({minLength:1}),input:K.Optional(K.Unknown()),name:K.String({minLength:1}),output:K.Optional(K.Unknown()),progress:K.Optional(K.String({maxLength:8192})),status:cf,type:K.Literal(`tool`)},{additionalProperties:!1}),Kp=K.Object({fasterModel:K.Optional(K.String({minLength:1})),id:K.String({minLength:1}),kind:K.Literal(`safety_buffering`),model:K.String({minLength:1}),status:cf,type:K.Literal(`runtime_status`)},{additionalProperties:!1}),qp=K.Object({fromModel:K.String({minLength:1}),id:K.String({minLength:1}),kind:K.Literal(`model_rerouted`),status:K.Literal(`completed`),toModel:K.String({minLength:1}),type:K.Literal(`runtime_status`)},{additionalProperties:!1}),Jp=K.Object({detail:K.Optional(K.String({maxLength:8192})),durationMs:K.Optional(K.Integer({minimum:0})),eventName:K.String({minLength:1}),id:K.String({minLength:1}),kind:K.Literal(`hook`),status:cf,type:K.Literal(`runtime_status`)},{additionalProperties:!1}),Yp=K.Union([Kp,qp,Jp]),Xp=K.Object({id:K.String({minLength:1}),text:K.String(),type:K.Literal(`plan`)},{additionalProperties:!1}),Zp=K.Object({detail:K.Optional(K.String()),id:K.String({minLength:1}),label:K.String({minLength:1}),status:K.Optional(cf),transient:K.Optional(K.Boolean()),type:K.Literal(`activity`)},{additionalProperties:!1}),Qp=K.Union([K.Literal(`in_progress`),K.Literal(`approved`),K.Literal(`denied`),K.Literal(`timed_out`),K.Literal(`aborted`)]),$p=K.Object({detail:K.String(),type:K.Union([K.Literal(`command`),K.Literal(`file_change`),K.Literal(`network_access`),K.Literal(`mcp_tool_call`),K.Literal(`permissions`)])},{additionalProperties:!1}),em=K.Object({action:$p,id:K.String({minLength:1}),rationale:K.Optional(K.String()),riskLevel:K.Optional(K.Union([K.Literal(`low`),K.Literal(`medium`),K.Literal(`high`),K.Literal(`critical`)])),status:Qp,targetItemId:K.Optional(K.String({minLength:1})),type:K.Literal(`approval_review`),userAuthorization:K.Optional(K.Union([K.Literal(`unknown`),K.Literal(`low`),K.Literal(`medium`),K.Literal(`high`)]))},{additionalProperties:!1}),tm=K.Union([K.Object({type:K.Literal(`uncommitted_changes`)},{additionalProperties:!1}),K.Object({branch:K.String({minLength:1}),type:K.Literal(`base_branch`)},{additionalProperties:!1}),K.Object({sha:K.String({minLength:1}),title:K.Optional(K.String({minLength:1})),type:K.Literal(`commit`)},{additionalProperties:!1}),K.Object({instructions:K.String({minLength:1}),type:K.Literal(`custom`)},{additionalProperties:!1})]),nm=K.Object({id:K.String({minLength:1}),target:tm,type:K.Literal(`review`)},{additionalProperties:!1}),rm=K.Union([kf,Af,Mf,Wp,Gp,Xp,Zp,em,nm,Yp]),im=K.Union([K.Literal(`running`),K.Literal(`completed`),K.Literal(`failed`),K.Literal(`interrupted`)]),am=K.Object({completedAt:Id,error:K.Union([K.String(),K.Null()]),id:K.String({minLength:1}),items:K.Array(rm),startedAt:Id,status:im},{additionalProperties:!1}),om=K.Object({id:K.String({minLength:1}),kind:Cf,mediaType:Sf,name:K.String({maxLength:255,minLength:1}),size:K.Integer({maximum:hf,minimum:1})},{additionalProperties:!1}),sm=K.Object({attachment:om},{additionalProperties:!1}),cm=K.Union([K.Literal(`user`),K.Literal(`repo`),K.Literal(`system`),K.Literal(`admin`)]),lm=K.Object({description:K.String(),displayName:K.String({minLength:1}),id:K.String({minLength:1}),name:K.String({minLength:1}),scope:cm},{additionalProperties:!1}),um=K.Union([K.Literal(`starting`),K.Literal(`ready`),K.Literal(`failed`),K.Literal(`cancelled`)]),dm=K.Union([K.Literal(`unknown`),K.Literal(`unsupported`),K.Literal(`notLoggedIn`),K.Literal(`bearerToken`),K.Literal(`oAuth`)]),fm=K.Literal(`reauthenticationRequired`),pm=K.Object({authStatus:K.Union([dm,K.Null()]),description:K.Union([K.String(),K.Null()]),error:K.Union([K.String({maxLength:8192}),K.Null()]),failureReason:K.Union([fm,K.Null()]),name:K.String({minLength:1}),status:um,title:K.Union([K.String(),K.Null()]),toolCount:K.Integer({minimum:0}),version:K.Union([K.String(),K.Null()])},{additionalProperties:!1}),mm=K.Object({data:K.Array(pm,{uniqueItems:!0})},{additionalProperties:!1}),hm=K.Object({id:K.String({minLength:1}),name:K.String({minLength:1})},{additionalProperties:!1}),gm=K.Object({id:K.String({minLength:1})},{additionalProperties:!1}),_m={attachments:K.Array(gm),skills:K.Array(hm),text:K.String({maxLength:1e5}),type:K.Literal(`prompt`)},vm=K.Union([K.Object({..._m,text:K.String({maxLength:1e5,minLength:1})},{additionalProperties:!1}),K.Object({..._m,attachments:K.Array(gm,{minItems:1})},{additionalProperties:!1}),K.Object({..._m,skills:K.Array(hm,{minItems:1})},{additionalProperties:!1})]),ym=K.Object({attachments:K.Array(Ef,{maxItems:gf}),clientUserMessageId:K.String({minLength:1}),id:K.String({minLength:1}),skills:K.Array(hm),text:K.String({maxLength:1e5})},{additionalProperties:!1}),bm=K.Object({data:K.Array(ym),nextCursor:K.Union([K.String({minLength:1}),K.Null()])},{additionalProperties:!1}),xm=K.Union([K.Literal(`active`),K.Literal(`paused`),K.Literal(`blocked`),K.Literal(`usage_limited`),K.Literal(`budget_limited`),K.Literal(`complete`)]),Sm=K.Object({createdAt:Fd,objective:K.String({maxLength:4e3,minLength:1}),status:xm,timeUsedSeconds:K.Integer({minimum:0}),tokenBudget:K.Union([K.Integer({minimum:0}),K.Null()]),tokensUsed:K.Integer({minimum:0}),updatedAt:Fd},{additionalProperties:!1});K.Object({status:K.Union([K.Literal(`active`),K.Literal(`paused`)])},{additionalProperties:!1});var Cm=K.Object({goal:Sm},{additionalProperties:!1}),wm=K.Object({cleared:K.Boolean()},{additionalProperties:!1}),Tm=`gpt-5.6-luna`,Em=K.Object({mcp_elicitations:K.Boolean(),request_permissions:K.Boolean(),rules:K.Boolean(),sandbox_approval:K.Boolean(),skill_approval:K.Boolean()},{additionalProperties:!1}),Dm=K.Object({granular:Em},{additionalProperties:!1}),Om=K.Union([K.Literal(`on-request`),Dm,K.Literal(`never`)]),km=K.Union([K.Literal(`untrusted`),K.Literal(`on-request`),Dm,K.Literal(`never`)]),Am=K.Union([K.Literal(`user`),K.Literal(`auto_review`)]),jm=K.Union([K.Literal(`read-only`),K.Literal(`workspace-write`),K.Literal(`danger-full-access`)]),Mm={model:K.String({minLength:1}),reasoningEffort:K.String({minLength:1}),sandboxMode:jm},Nm=K.Object({approvalPolicy:km,approvalsReviewer:Am,...Mm},{additionalProperties:!1}),Pm=K.Literal(`plan`),Fm={commitMessageModel:K.String({minLength:1}),commitMessagePrompt:K.String({maxLength:4e3}),defaultOpenAppId:K.Union([K.Exclude(Qd,K.Literal(`system-default`)),K.Null()]),fastMode:K.Boolean(),followUpBehavior:K.Union([K.Literal(`queue`),K.Literal(`steer`)]),...Mm},Im=K.Object({approvalPolicy:Om,approvalsReviewer:Am,...Fm},{additionalProperties:!1}),Lm=K.Object({settings:Im},{additionalProperties:!1}),Rm=K.Object({approvalPolicy:km,approvalsReviewer:Am,fastMode:K.Boolean(),...Mm},{additionalProperties:!1}),zm=K.Object({settings:Rm},{additionalProperties:!1}),Bm=K.Object({settings:Nm},{additionalProperties:!1}),Vm={collaborationMode:K.Optional(Pm),fastMode:K.Optional(K.Literal(!0)),goalMode:K.Optional(K.Literal(!0)),...Mm},Hm=K.Object({approvalPolicy:km,approvalsReviewer:Am,...Vm},{additionalProperties:!1}),Um=K.Object({description:K.String(),id:K.String({minLength:1})},{additionalProperties:!1}),Wm=K.Object({defaultReasoningEffort:K.String({minLength:1}),description:K.String(),displayName:K.String({minLength:1}),id:K.String({minLength:1}),isDefault:K.Boolean(),supportedReasoningEfforts:K.Array(Um,{minItems:1})},{additionalProperties:!1}),Gm=K.Object({contextWindow:K.Union([K.Integer({minimum:1}),K.Null()]),usedTokens:K.Integer({minimum:0})},{additionalProperties:!1}),Km=`temporary`,qm=`/v1/temporary`,Jm=K.Union([K.Literal(`pending`),K.Literal(`in_progress`),K.Literal(`completed`)]),Ym=K.Object({status:Jm,text:K.String({minLength:1})},{additionalProperties:!1}),Xm=K.Object({explanation:K.Union([K.String(),K.Null()]),steps:K.Array(Ym)},{additionalProperties:!1}),Zm=K.Object({contextUsage:K.Union([Gm,K.Null()]),goal:K.Union([Sm,K.Null()]),id:K.String({minLength:1}),plan:K.Union([Xm,K.Null()]),pendingRequests:K.Array(pp),pinned:K.Boolean(),projectId:K.String({minLength:1}),settings:Nm,status:K.Union([K.Literal(`idle`),K.Literal(`running`),K.Literal(`failed`)]),title:K.String({minLength:1}),turns:K.Array(am),turnsNextCursor:K.Union([K.String({minLength:1}),K.Null()]),updatedAt:Fd},{additionalProperties:!1});function Qm(e){return K.Object({data:K.Array(e),nextCursor:K.Union([K.String(),K.Null()])},{additionalProperties:!1})}var $m=Qm(Ud),eh=$m,th=Qm(sf),nh=Qm(Wm),rh=Qm(lm),ih=K.Object({status:K.Literal(`ok`),version:K.Literal(1)},{additionalProperties:!1}),ah=K.Object({feedback:K.Object({upload:K.Boolean()},{additionalProperties:!1}),goals:K.Object({clear:K.Boolean(),read:K.Boolean(),update:K.Boolean()},{additionalProperties:!1}),provider:K.String({minLength:1}),skills:K.Object({list:K.Boolean(),use:K.Boolean()},{additionalProperties:!1}),tasks:K.Object({fork:K.Boolean(),list:K.Boolean(),read:K.Boolean(),start:K.Boolean()},{additionalProperties:!1}),turns:K.Object({compact:K.Boolean(),interrupt:K.Boolean(),review:K.Boolean(),start:K.Boolean(),steer:K.Boolean()},{additionalProperties:!1})},{additionalProperties:!1}),oh=K.Union([K.Literal(`official`),K.Literal(`custom`)]),sh=K.Union([K.Literal(`disconnected`),K.Literal(`pending`),K.Literal(`connected`),K.Literal(`failed`)]),ch=K.Union([K.Object({email:K.Union([K.String({maxLength:320}),K.Null()]),planType:K.Union([K.String({maxLength:64}),K.Null()]),type:K.Literal(`chatgpt`)},{additionalProperties:!1}),K.Object({type:K.Literal(`apiKey`)},{additionalProperties:!1})]),lh=K.Object({error:K.Union([K.String({maxLength:1e3}),K.Null()]),loginId:K.String({maxLength:256,minLength:1}),state:K.Union([K.Literal(`pending`),K.Literal(`failed`)])},{additionalProperties:!1}),uh=K.Object({account:K.Union([ch,K.Null()]),customBaseUrl:K.Union([K.String({maxLength:2048,minLength:1}),K.Null()]),mode:oh,pendingLogin:K.Union([lh,K.Null()]),state:sh},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var dh=K.Object({authUrl:K.String({maxLength:8192,minLength:1}),loginId:K.String({maxLength:256,minLength:1}),status:uh},{additionalProperties:!1});K.Object({apiKey:K.Optional(K.String({maxLength:16384,minLength:1})),baseUrl:K.String({maxLength:2048,minLength:1}),models:K.Optional(K.Array(K.Object({id:K.String({maxLength:256,minLength:1,pattern:`.*\\S.*`}),name:K.String({maxLength:256,minLength:1,pattern:`.*\\S.*`})},{additionalProperties:!1}),{maxItems:1e3}))},{additionalProperties:!1});var fh=K.Object({models:nh,status:uh},{additionalProperties:!1});K.Object({loginId:K.String({maxLength:256,minLength:1})},{additionalProperties:!1});var ph=K.Object({status:uh},{additionalProperties:!1});K.Object({customBaseUrl:K.Union([K.String({maxLength:2048,minLength:1}),K.Null()]),customModels:K.Union([nh,K.Null()]),mode:oh,updatedAt:Fd},{additionalProperties:!1});function mh(e){return e.mode===`official`&&e.state===`connected`&&e.account?.type===`chatgpt`}K.Object({},{additionalProperties:!1});var hh=K.Object({task:sf},{additionalProperties:!1});K.Object({pinned:K.Boolean()},{additionalProperties:!1});var gh=K.Object({task:sf},{additionalProperties:!1});K.Object({title:K.String({maxLength:200,minLength:1,pattern:`\\S`})},{additionalProperties:!1});var _h=K.Object({task:sf},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var vh=K.Object({status:K.Literal(`archived`),taskId:K.String({minLength:1})},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var yh=K.Object({task:sf},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var bh=K.Object({status:K.Literal(`deleted`),taskId:K.String({minLength:1})},{additionalProperties:!1}),xh=K.Object({status:K.Union([K.Literal(`busy`),K.Literal(`notLoaded`),K.Literal(`notSubscribed`),K.Literal(`unsubscribed`)]),taskId:K.String({minLength:1})},{additionalProperties:!1});K.Object({target:uf},{additionalProperties:!1});var Sh=K.Object({taskId:K.String({minLength:1}),turn:am},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var Ch=K.Object({status:K.Literal(`compacting`),taskId:K.String({minLength:1})},{additionalProperties:!1});K.Object({lastTurnId:K.Optional(K.String({minLength:1}))},{additionalProperties:!1});var wh=K.Object({task:sf},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var Th=mm;K.Object({classification:K.String({maxLength:100,minLength:1}),includeLogs:K.Boolean(),reason:K.String({maxLength:4e3,minLength:1})},{additionalProperties:!1});var Eh=K.Object({status:K.Literal(`sent`),taskId:K.String({minLength:1})},{additionalProperties:!1});K.Object({input:vm,options:Hm},{additionalProperties:!1});var Dh=K.Object({taskId:K.String({minLength:1}),turn:am},{additionalProperties:!1});K.Object({input:vm,taskId:K.String({minLength:1})},{additionalProperties:!1});var Oh=K.Object({status:K.Literal(`accepted`),taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},{additionalProperties:!1});K.Object({clientUserMessageId:K.String({minLength:1}),input:vm},{additionalProperties:!1});var kh=K.Object({queuedSubmission:ym},{additionalProperties:!1});K.Object({input:vm},{additionalProperties:!1});var Ah=kh,jh=K.Object({deleted:K.Boolean()},{additionalProperties:!1});K.Object({queuedSubmissionIds:K.Array(K.String({minLength:1}),{uniqueItems:!0})},{additionalProperties:!1});var Mh=K.Object({status:K.Literal(`reordered`)},{additionalProperties:!1});K.Object({queuedSubmissionId:K.Optional(K.String({minLength:1}))},{additionalProperties:!1});var Nh=K.Object({taskId:K.String({minLength:1}),turn:am},{additionalProperties:!1});K.Object({taskId:K.String({minLength:1})},{additionalProperties:!1});var Ph=K.Object({status:K.Literal(`interrupting`),taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},{additionalProperties:!1}),Fh=K.Union([K.Literal(`ACCESS_DENIED`),K.Literal(`IDEMPOTENCY_KEY_REQUIRED`),K.Literal(`IDEMPOTENCY_CONFLICT`),K.Literal(`IDEMPOTENCY_CAPACITY_EXCEEDED`),K.Literal(`INVALID_REQUEST`),K.Literal(`PROJECT_NOT_FOUND`),K.Literal(`TASK_NOT_FOUND`),K.Literal(`TURN_NOT_FOUND`),K.Literal(`TURN_NOT_RUNNING`),K.Literal(`ATTACHMENT_NOT_FOUND`),K.Literal(`PENDING_REQUEST_NOT_FOUND`),K.Literal(`PENDING_REQUEST_EXPIRED`),K.Literal(`PENDING_REQUEST_ALREADY_RESOLVED`),K.Literal(`PENDING_REQUEST_MISMATCH`),K.Literal(`PAIRING_FAILED`),K.Literal(`PAIRING_RATE_LIMITED`),K.Literal(`GIT_STATUS_CHANGED`),K.Literal(`GIT_REPOSITORY_UNAVAILABLE`),K.Literal(`GIT_PATH_UNAVAILABLE`),K.Literal(`GIT_COMMIT_FAILED`),K.Literal(`GIT_BRANCH_ALREADY_ACTIVE`),K.Literal(`GIT_BRANCH_ALREADY_EXISTS`),K.Literal(`GIT_BRANCH_CREATE_FAILED`),K.Literal(`GIT_BRANCH_INVALID`),K.Literal(`GIT_BRANCH_NOT_FOUND`),K.Literal(`GIT_BRANCH_SWITCH_FAILED`),K.Literal(`GIT_WORKTREE_ALREADY_ACTIVE`),K.Literal(`GIT_WORKTREE_CREATE_FAILED`),K.Literal(`GIT_WORKTREE_NOT_FOUND`),K.Literal(`GIT_MUTATION_IN_PROGRESS`),K.Literal(`GIT_REPOSITORY_READ_ONLY`),K.Literal(`COMMIT_MESSAGE_GENERATION_FAILED`),K.Literal(`UPDATE_NOT_AVAILABLE`),K.Literal(`UPDATE_CHECK_FAILED`),K.Literal(`UPDATE_INSTALL_FAILED`),K.Literal(`PROVIDER_ERROR`)]),Ih=K.Object({code:Fh,message:K.String({minLength:1}),retryable:K.Boolean()},{additionalProperties:!1}),Lh=K.String({minLength:1}),Rh=K.Integer({minimum:0}),zh=K.String({format:`date-time`}),Bh={originalByteLength:K.Integer({minimum:0}),truncated:K.Boolean()},Vh={provider:K.String({minLength:1}),sequence:Rh,sessionId:Lh,taskId:K.String({minLength:1}),timestamp:zh,version:K.Literal(2)};function q(e){return K.Object({...Vh,...e},{additionalProperties:!1})}var Hh=q({payload:K.Object({turn:am},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`turn.started`)}),Uh=q({itemId:K.String({minLength:1}),payload:K.Object({delta:K.String()},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`message.delta`)}),Wh=q({itemId:K.String({minLength:1}),payload:K.Object({delta:K.String(),field:K.Union([K.Literal(`content`),K.Literal(`summary`)]),sectionIndex:K.Optional(K.Integer({minimum:0}))},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`reasoning.delta`)}),Gh=q({itemId:K.String({minLength:1}),payload:K.Object({delta:K.String()},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`plan.delta`)}),Kh=q({itemId:K.String({minLength:1}),payload:K.Object({message:K.String({maxLength:8192})},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`tool.progress`)}),qh=q({itemId:K.String({minLength:1}),payload:K.Object({changes:K.Array(bp,{maxItems:100}),...Bh},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`file_change.updated`)}),Jh=q({payload:K.Object({code:K.Union([K.Literal(`runtime_warning`),K.Literal(`guardian_warning`),K.Literal(`strict_review_required`),K.Literal(`model_verification`),K.Literal(`hook_status`)]),level:K.Union([K.Literal(`info`),K.Literal(`warning`)]),message:K.String({maxLength:8192,minLength:1})},{additionalProperties:!1}),type:K.Literal(`task.notice`)}),Yh=q({payload:K.Object({error:K.Union([K.String({maxLength:8192}),K.Null()]),failureReason:K.Union([fm,K.Null()]),name:K.String({minLength:1}),status:um},{additionalProperties:!1}),type:K.Literal(`mcp_server.status_updated`)}),Xh=q({payload:K.Object({status:K.Union([K.Literal(`idle`),K.Literal(`running`),K.Literal(`failed`)])},{additionalProperties:!1}),type:K.Literal(`task.status_updated`)}),Zh=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`task.metadata_changed`)}),Qh=q({payload:K.Object({reason:K.Union([K.Literal(`archived`),K.Literal(`deleted`)])},{additionalProperties:!1}),type:K.Literal(`task.removed`)}),$h=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`skills.changed`)}),eg=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`queue.changed`)}),tg=q({payload:K.Object({rootPath:K.String({minLength:1})},{additionalProperties:!1}),type:K.Literal(`project.git_metadata_changed`)}),ng=q({itemId:K.String({minLength:1}),payload:K.Object({delta:K.String()},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`command.output_delta`)}),rg=q({itemId:K.String({minLength:1}),payload:K.Object({item:rm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`item.completed`)}),ig=q({itemId:K.String({minLength:1}),payload:K.Object({item:rm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`item.started`)}),ag=q({payload:K.Object({turn:am},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`turn.completed`)}),og=q({payload:K.Object({code:K.Optional(K.Union([K.Literal(`context_window_exceeded`),K.Literal(`session_budget_exceeded`),K.Literal(`usage_limit_exceeded`),K.Literal(`server_overloaded`),K.Literal(`policy_blocked`),K.Literal(`connection_failed`),K.Literal(`internal_error`),K.Literal(`unauthorized`),K.Literal(`bad_request`),K.Literal(`sandbox_error`),K.Literal(`other`)])),httpStatusCode:K.Optional(K.Integer({maximum:599,minimum:100})),message:K.String({minLength:1}),willRetry:K.Boolean()},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`provider.error`)}),sg=q({payload:K.Object({usage:Gm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`usage.updated`)}),cg=q({payload:K.Object({plan:Xm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`plan.updated`)}),lg=q({payload:K.Object({goal:Sm},{additionalProperties:!1}),type:K.Literal(`goal.updated`)}),ug=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`goal.cleared`)});function dg(e,t){return q({itemId:K.String({minLength:1}),payload:K.Object({request:t},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(e)})}var fg=dg(`pending_request.created`,pp),pg=dg(`pending_request.resolved`,mp),mg=dg(`pending_request.expired`,hp),hg=K.Union([Hh,Uh,Wh,ng,Gh,Kh,qh,ig,rg,ag,sg,cg,lg,ug,og,Jh,Yh,Xh,Zh,Qh,$h,eg,tg,fg,pg,mg]),gg=K.Object({events:K.Array(hg,{maxItems:64,minItems:1}),type:K.Literal(`events.batch`),version:K.Literal(3)},{additionalProperties:!1}),_g=K.Object({latestSequence:Rh,sessionId:Lh,type:K.Literal(`connection.ready`),version:K.Literal(3)},{additionalProperties:!1}),vg=K.Object({latestSequence:Rh,reason:K.Union([K.Literal(`event_retention_exceeded`),K.Literal(`session_changed`),K.Literal(`sequence_gap`)]),sessionId:Lh,type:K.Literal(`resync.required`),version:K.Literal(3)},{additionalProperties:!1}),yg=K.Union([_g,vg,gg]),bg=K.Object({sequence:Rh,sessionId:Lh},{additionalProperties:!1}),xg=K.Object({checkpoint:bg,snapshot:Zm},{additionalProperties:!1}),Sg=class extends Zt{constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function Cg(e,t){let n=t.find(t=>t.$id===e.$ref);if(n===void 0)throw new Sg(e);return Tg(n,t)}function wg(e,t){return!Vt(e.$id)||t.some(t=>t.$id===e.$id)||t.push(e),t}function Tg(e,t){return e[M]===`This`||e[M]===`Ref`?Cg(e,t):e}var Eg=class extends Zt{constructor(e){super(`Unable to hash value`),this.value=e}},Dg;(function(e){e[e.Undefined=0]=`Undefined`,e[e.Null=1]=`Null`,e[e.Boolean=2]=`Boolean`,e[e.Number=3]=`Number`,e[e.String=4]=`String`,e[e.Object=5]=`Object`,e[e.Array=6]=`Array`,e[e.Date=7]=`Date`,e[e.Uint8Array=8]=`Uint8Array`,e[e.Symbol=9]=`Symbol`,e[e.BigInt=10]=`BigInt`})(Dg||={});var Og=BigInt(`14695981039346656037`),[kg,Ag]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],jg=Array.from({length:256}).map((e,t)=>BigInt(t)),Mg=new Float64Array(1),Ng=new DataView(Mg.buffer),Pg=new Uint8Array(Mg.buffer);function*Fg(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let n=0;n<t;n++)yield e>>8*(t-1-n)&255}function Ig(e){Jg(Dg.Array);for(let t of e)qg(t)}function Lg(e){Jg(Dg.Boolean),Jg(+!!e)}function Rg(e){Jg(Dg.BigInt),Ng.setBigInt64(0,e);for(let e of Pg)Jg(e)}function zg(e){Jg(Dg.Date),qg(e.getTime())}function Bg(e){Jg(Dg.Null)}function Vg(e){Jg(Dg.Number),Ng.setFloat64(0,e);for(let e of Pg)Jg(e)}function Hg(e){Jg(Dg.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())qg(t),qg(e[t])}function Ug(e){Jg(Dg.String);for(let t=0;t<e.length;t++)for(let n of Fg(e.charCodeAt(t)))Jg(n)}function Wg(e){Jg(Dg.Symbol),qg(e.description)}function Gg(e){Jg(Dg.Uint8Array);for(let t=0;t<e.length;t++)Jg(e[t])}function Kg(e){return Jg(Dg.Undefined)}function qg(e){if(Pt(e))return Ig(e);if(Lt(e))return Lg(e);if(Bt(e))return Rg(e);if(jt(e))return zg(e);if(It(e))return Bg(e);if(Rt(e))return Vg(e);if(Nt(e))return Hg(e);if(Vt(e))return Ug(e);if(Ut(e))return Wg(e);if(Mt(e))return Gg(e);if(Ft(e))return Kg(e);throw new Eg(e)}function Jg(e){Og^=jg[e],Og=Og*kg%Ag}function Yg(e){return Og=BigInt(`14695981039346656037`),qg(e),Og}var Xg=class extends Zt{constructor(e){super(`Unknown type`),this.schema=e}};function Zg(e){return e[M]===`Any`||e[M]===`Unknown`}function J(e){return e!==void 0}function Qg(e,t,n){return!0}function $g(e,t,n){return!0}function e_(e,t,n){if(!Pt(n)||J(e.minItems)&&!(n.length>=e.minItems)||J(e.maxItems)&&!(n.length<=e.maxItems))return!1;for(let r of n)if(!Y(e.items,t,r))return!1;if(e.uniqueItems===!0&&!(function(){let e=new Set;for(let t of n){let n=Yg(t);if(e.has(n))return!1;e.add(n)}return!0})())return!1;if(!(J(e.contains)||Rt(e.minContains)||Rt(e.maxContains)))return!0;let r=J(e.contains)?e.contains:z(),i=n.reduce((e,n)=>Y(r,t,n)?e+1:e,0);return!(i===0||Rt(e.minContains)&&i<e.minContains||Rt(e.maxContains)&&i>e.maxContains)}function t_(e,t,n){return Ot(n)}function n_(e,t,n){return!(!Bt(n)||J(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||J(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||J(e.maximum)&&!(n<=e.maximum)||J(e.minimum)&&!(n>=e.minimum)||J(e.multipleOf)&&n%e.multipleOf!==BigInt(0))}function r_(e,t,n){return Lt(n)}function i_(e,t,n){return Y(e.returns,t,n.prototype)}function a_(e,t,n){return!(!jt(n)||J(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)||J(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)||J(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)||J(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)||J(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0)}function o_(e,t,n){return Ht(n)}function s_(e,t,n){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Y(i,[...t,...r],n)}function c_(e,t,n){return!(!zt(n)||J(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||J(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||J(e.maximum)&&!(n<=e.maximum)||J(e.minimum)&&!(n>=e.minimum)||J(e.multipleOf)&&n%e.multipleOf!==0)}function l_(e,t,n){let r=e.allOf.every(e=>Y(e,t,n));if(e.unevaluatedProperties===!1){let t=new RegExp(Io(e)),i=Object.getOwnPropertyNames(n).every(e=>t.test(e));return r&&i}else if(Un(e.unevaluatedProperties)){let i=new RegExp(Io(e)),a=Object.getOwnPropertyNames(n).every(r=>i.test(r)||Y(e.unevaluatedProperties,t,n[r]));return r&&a}else return r}function u_(e,t,n){return kt(n)}function d_(e,t,n){return n===e.const}function f_(e,t,n){return!1}function p_(e,t,n){return!Y(e.not,t,n)}function m_(e,t,n){return It(n)}function h_(e,t,n){return!(!Wt.IsNumberLike(n)||J(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||J(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||J(e.minimum)&&!(n>=e.minimum)||J(e.maximum)&&!(n<=e.maximum)||J(e.multipleOf)&&n%e.multipleOf!==0)}function g_(e,t,n){if(!Wt.IsObjectLike(n)||J(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||J(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let r=Object.getOwnPropertyNames(e.properties);for(let i of r){let r=e.properties[i];if(e.required&&e.required.includes(i)){if(!Y(r,t,n[i])||(jc(r)||Zg(r))&&!(i in n))return!1}else if(Wt.IsExactOptionalProperty(n,i)&&!Y(r,t,n[i]))return!1}if(e.additionalProperties===!1){let t=Object.getOwnPropertyNames(n);return e.required&&e.required.length===r.length&&t.length===r.length?!0:t.every(e=>r.includes(e))}else if(typeof e.additionalProperties==`object`)return Object.getOwnPropertyNames(n).every(i=>r.includes(i)||Y(e.additionalProperties,t,n[i]));else return!0}function __(e,t,n){return At(n)}function v_(e,t,n){if(!Wt.IsRecordLike(n)||J(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||J(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let[r,i]=Object.entries(e.patternProperties)[0],a=new RegExp(r),o=Object.entries(n).every(([e,n])=>!a.test(e)||Y(i,t,n)),s=typeof e.additionalProperties!=`object`||Object.entries(n).every(([n,r])=>a.test(n)?!0:Y(e.additionalProperties,t,r)),c=e.additionalProperties!==!1||Object.getOwnPropertyNames(n).every(e=>a.test(e));return o&&s&&c}function y_(e,t,n){return Y(Tg(e,t),t,n)}function b_(e,t,n){let r=new RegExp(e.source,e.flags);return J(e.minLength)&&!(n.length>=e.minLength)||J(e.maxLength)&&!(n.length<=e.maxLength)?!1:r.test(n)}function x_(e,t,n){return!Vt(n)||J(e.minLength)&&!(n.length>=e.minLength)||J(e.maxLength)&&!(n.length<=e.maxLength)||J(e.pattern)&&!new RegExp(e.pattern).test(n)?!1:J(e.format)?Zr(e.format)?$r(e.format)(n):!1:!0}function S_(e,t,n){return Ut(n)}function C_(e,t,n){return Vt(n)&&new RegExp(e.pattern).test(n)}function w_(e,t,n){return Y(Tg(e,t),t,n)}function T_(e,t,n){if(!Pt(n)||e.items===void 0&&n.length!==0||n.length!==e.maxItems)return!1;if(!e.items)return!0;for(let r=0;r<e.items.length;r++)if(!Y(e.items[r],t,n[r]))return!1;return!0}function E_(e,t,n){return Ft(n)}function D_(e,t,n){return e.anyOf.some(e=>Y(e,t,n))}function O_(e,t,n){return!(!Mt(n)||J(e.maxByteLength)&&!(n.length<=e.maxByteLength)||J(e.minByteLength)&&!(n.length>=e.minByteLength))}function k_(e,t,n){return!0}function A_(e,t,n){return Wt.IsVoidLike(n)}function j_(e,t,n){return ti(e[M])?ni(e[M])(e,n):!1}function Y(e,t,n){let r=J(e.$id)?wg(e,t):t,i=e;switch(i[M]){case`Any`:return Qg(i,r,n);case`Argument`:return $g(i,r,n);case`Array`:return e_(i,r,n);case`AsyncIterator`:return t_(i,r,n);case`BigInt`:return n_(i,r,n);case`Boolean`:return r_(i,r,n);case`Constructor`:return i_(i,r,n);case`Date`:return a_(i,r,n);case`Function`:return o_(i,r,n);case`Import`:return s_(i,r,n);case`Integer`:return c_(i,r,n);case`Intersect`:return l_(i,r,n);case`Iterator`:return u_(i,r,n);case`Literal`:return d_(i,r,n);case`Never`:return f_(i,r,n);case`Not`:return p_(i,r,n);case`Null`:return m_(i,r,n);case`Number`:return h_(i,r,n);case`Object`:return g_(i,r,n);case`Promise`:return __(i,r,n);case`Record`:return v_(i,r,n);case`Ref`:return y_(i,r,n);case`RegExp`:return b_(i,r,n);case`String`:return x_(i,r,n);case`Symbol`:return S_(i,r,n);case`TemplateLiteral`:return C_(i,r,n);case`This`:return w_(i,r,n);case`Tuple`:return T_(i,r,n);case`Undefined`:return E_(i,r,n);case`Union`:return D_(i,r,n);case`Uint8Array`:return O_(i,r,n);case`Unknown`:return k_(i,r,n);case`Void`:return A_(i,r,n);default:if(!ti(i[M]))throw new Xg(i);return j_(i,r,n)}}function M_(...e){return e.length===3?Y(e[0],e[1],e[2]):Y(e[0],[],e[1])}var N_=class extends Error{constructor(e,t){super(e,t),this.name=`CodexlyEventError`}};function P_(e,t,n){let r=t===`temporary`?`${qm}/events`:`/v1/projects/${encodeURIComponent(t)}/events`,i=e?new URL(`${e}${r}`):new URL(r,globalThis.location.href);return i.protocol=i.protocol===`https:`?`wss:`:`ws:`,i.searchParams.set(`afterSequence`,String(n)),i.toString()}function F_(e,t,n){return{latestSequence:t,reason:n,sessionId:e,type:`resync.required`,version:3}}function I_(e){let t=e.reconnectDelayMs??250,n=!0,r=!0,i=e.afterSequence,a=0,o,s,c,l=t=>{e.onConnectionState?.(t)},u=(e,t)=>{let n=s;n!==void 0&&(c?.(),c=void 0,s=void 0,n.close(e,t))},d=t=>{r=!1,e.onResyncRequired(t),u(1e3,`Snapshot resync required`),l(`closed`)},f=(t,n)=>{r=!1,e.onError?.(new N_(t,n===void 0?void 0:{cause:n})),u(1002,`Invalid Agent Event frame`),l(`closed`)},p=()=>{if(!n)return;o=void 0;let u=!1,m=e.webSocketFactory(P_(e.baseUrl,e.projectId,i));s=m;let h=()=>n&&s===m,g=t=>{if(!h())return;let n;try{n=JSON.parse(String(t.data))}catch(e){f(`Codexly event frame is not valid JSON`,e);return}if(!M_(yg,n)){f(`Codexly event frame does not match the protocol schema`);return}let r=n;if(r.type===`resync.required`){d(r);return}if(r.type===`connection.ready`){if(r.sessionId!==e.sessionId||r.latestSequence<i){d(F_(r.sessionId,r.latestSequence,`session_changed`));return}u=!0,a=0,l(`connected`);return}if(!u){f(`Codexly event arrived before connection.ready`);return}for(let t of r.events){if(t.sessionId!==e.sessionId){d(F_(t.sessionId,t.sequence,`session_changed`));return}if(!(t.sequence<=i)){if(t.sequence!==i+1){d(F_(t.sessionId,t.sequence,`sequence_gap`));return}if(i=t.sequence,e.onEvent(t),!h())return}}},_=()=>{!n||s!==m||e.onError?.(new N_(`Codexly event connection failed`))},v=()=>{if(s!==m||(c?.(),c=void 0,s=void 0,!n))return;if(!r){l(`closed`);return}l(`reconnecting`);let e=Math.min(t*2**a,5e3);a+=1,o=setTimeout(p,e)};c=()=>{m.removeEventListener(`message`,g),m.removeEventListener(`error`,_),m.removeEventListener(`close`,v)},m.addEventListener(`message`,g),m.addEventListener(`error`,_),m.addEventListener(`close`,v)};return l(`connecting`),p(),()=>{n&&(n=!1,r=!1,o!==void 0&&clearTimeout(o),u(1e3,`Subscription cancelled`),l(`closed`))}}var L_=[];for(let e=0;e<256;++e)L_.push((e+256).toString(16).slice(1));function R_(e,t=0){return(L_[e[t+0]]+L_[e[t+1]]+L_[e[t+2]]+L_[e[t+3]]+`-`+L_[e[t+4]]+L_[e[t+5]]+`-`+L_[e[t+6]]+L_[e[t+7]]+`-`+L_[e[t+8]]+L_[e[t+9]]+`-`+L_[e[t+10]]+L_[e[t+11]]+L_[e[t+12]]+L_[e[t+13]]+L_[e[t+14]]+L_[e[t+15]]).toLowerCase()}var z_=new Uint8Array(16);function B_(){return crypto.getRandomValues(z_)}function V_(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():H_(e,t,n)}function H_(e,t,n){e||={};let r=e.random??e.rng?.()??B_();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return R_(r)}var U_=15e4,W_=class extends Error{status;constructor(e,t,n){super(n??`Codexly request failed with ${String(e)} ${t}`.trim()),this.name=`CodexlyHttpError`,this.status=e}},G_=class extends W_{code;retryable;constructor(e,t,n){super(e,t,n.message),this.name=`CodexlyMutationError`,this.code=n.code,this.retryable=n.retryable}},K_=class extends Error{constructor(e,t){super(e,t),this.name=`CodexlyResponseError`}};function X(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!==void 0&&n.set(e,String(r));let r=n.toString();return r?`${e}?${r}`:e}function Z(e){return e===`temporary`?qm:`/v1/projects/${encodeURIComponent(e)}`}function Q(e,t){return`${Z(e)}/tasks/${encodeURIComponent(t)}`}function q_(e,t,n,r){return`${e.replace(/\/$/u,``)}${Q(t,n)}/attachments/${encodeURIComponent(r)}`}function J_(e,t,n,r){let i=X(`${Z(t)}/files/image`,{path:n,rootPath:r});return`${e.replace(/\/$/u,``)}${i}`}function Y_(e,t,n){return`${e.replace(/\/$/u,``)}${Z(t)}/attachments/${encodeURIComponent(n)}`}var X_=class{baseUrl;fetchImplementation;requestTimeouts;webSocketFactory;unauthorizedListeners=new Set;constructor(e={}){this.baseUrl=e.baseUrl?.replace(/\/$/u,``)??``,this.fetchImplementation=e.fetch??globalThis.fetch.bind(globalThis),this.requestTimeouts={mutationMs:e.requestTimeouts?.mutationMs??6e4,queryMs:e.requestTimeouts?.queryMs??3e4,readMs:e.requestTimeouts?.readMs??15e3},this.webSocketFactory=e.webSocketFactory??(e=>new WebSocket(e))}async getHealth(e={}){return this.read(`/v1/health`,ih,e)}async getAppInfo(e={}){return this.read(`/v1/app-info`,Td,e)}async installAppUpdate(e,t={}){return this.mutation(`/v1/app-update`,{version:e},Ed,t,`POST`,U_)}async getAccessStatus(e={}){return this.read(`/v1/access`,Od,e)}async pairAccess(e){return this.request(`/v1/access/pair`,Od,{body:JSON.stringify({code:e}),headers:{"content-type":`application/json`},method:`POST`},Ih,{timeoutMs:this.requestTimeouts.mutationMs})}async logoutAccess(){return this.request(`/v1/access/logout`,Od,{body:`{}`,headers:{"content-type":`application/json`},method:`POST`},Ih,{timeoutMs:this.requestTimeouts.mutationMs})}subscribeUnauthorized(e){return this.unauthorizedListeners.add(e),()=>this.unauthorizedListeners.delete(e)}async getCapabilities(e={}){return this.read(`/v1/capabilities`,ah,e)}async listModels(e={}){return this.read(`/v1/models`,nh,e)}async getProviderConnection(e={}){return this.read(`/v1/provider-connection`,uh,e)}async startOfficialProviderLogin(e={}){return this.mutation(`/v1/provider-connection/official-login`,{},dh,e)}async cancelProviderLogin(e,t={}){return this.mutation(`/v1/provider-connection/official-login/cancel`,{loginId:e},ph,t)}async configureCustomProvider(e,t={}){return this.mutation(`/v1/provider-connection/custom`,e,fh,t,`PUT`)}async logoutProvider(e={}){return this.mutation(`/v1/provider-connection/logout`,{},ph,e)}async getGlobalSettings(e={}){return this.read(`/v1/settings`,Lm,e)}async updateGlobalSettings(e,t={}){return this.mutation(`/v1/settings`,e,Lm,t,`PUT`)}subscribeEvents(e){return I_({...e,baseUrl:this.baseUrl,webSocketFactory:this.webSocketFactory})}mutation(e,t,n,r,i=`POST`,a=this.requestTimeouts.mutationMs){return this.request(e,n,{body:JSON.stringify(t),headers:{"content-type":`application/json`,"idempotency-key":r.idempotencyKey??V_()},method:i},Ih,{...r.signal===void 0?{}:{signal:r.signal},timeoutMs:a})}read(e,t,n,r){return this.request(e,t,{},r,{...n.signal===void 0?{}:{signal:n.signal},timeoutMs:n.signal===void 0?this.requestTimeouts.readMs:this.requestTimeouts.queryMs})}async request(e,t,n={},r,i={}){let a=AbortSignal.timeout(i.timeoutMs??this.requestTimeouts.readMs),o=i.signal===void 0?a:AbortSignal.any([i.signal,a]),s=await this.fetchImplementation(`${this.baseUrl}${e}`,{...n,credentials:`same-origin`,headers:{accept:`application/json`,...n.headers},signal:o});if(!s.ok){if(s.status===401)for(let e of this.unauthorizedListeners)try{e()}catch{}if(r!==void 0){let e;try{e=await s.json()}catch(e){throw new K_(`Codexly error response is not valid JSON`,{cause:e})}throw M_(r,e)?new G_(s.status,s.statusText,e):new K_(`Codexly error response does not match the protocol schema`)}try{let e=await s.json();if(typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`&&e.message.length>0)throw new W_(s.status,s.statusText,e.message)}catch(e){if(e instanceof W_)throw e}throw new W_(s.status,s.statusText)}let c;try{c=await s.json()}catch(e){throw new K_(`Codexly response is not valid JSON`,{cause:e})}if(!M_(t,c))throw new K_(`Codexly response does not match the protocol schema`);return c}},Z_=class extends X_{async listSkills(e,t={}){return this.read(`${Z(e)}/skills`,rh,t)}async listMcpServers(e,t,n={}){return this.read(`${Q(e,t)}/mcp-servers`,mm,n,Ih)}async retryMcpServers(e,t,n={}){return this.mutation(`${Q(e,t)}/mcp-servers/retry`,{},Th,n)}async listProjects(e={}){return this.read(`/v1/projects`,$m,e)}async listProjectDirectories(e,t={}){return this.read(X(`/v1/project-directories`,{path:e,includeHidden:t.includeHidden===!0?`true`:void 0}),qd,t)}async listHostFiles(e,t,n={}){return this.read(X(`/v1/host-files`,{kind:e,path:t,includeHidden:n.includeHidden===!0?`true`:void 0}),Xd,n)}async reorderProjects(e,t={}){return this.mutation(`/v1/projects/order`,{projectIds:e},eh,t,`PUT`)}async getProjectDefaults(e,t={}){return this.read(`${Z(e)}/defaults`,zm,t)}async updateProjectDefaults(e,t,n={}){return this.mutation(`${Z(e)}/defaults`,t,zm,n,`PUT`)}async addProject(e,t={}){return this.mutation(`/v1/projects`,{roots:e.map(e=>({path:e}))},Zd,t)}async renameProject(e,t,n={}){return this.mutation(`${Z(e)}/rename`,{name:t},af,n)}async removeProject(e,t={}){return this.mutation(`${Z(e)}/remove`,{},of,t)}async getProjectOpenCapabilities(e,t={}){return this.read(`${Z(e)}/open-capabilities`,nf,t)}async openProject(e,t,n,r={}){return this.mutation(X(`${Z(e)}/open`,{rootPath:t}),n,rf,r)}async getProjectGitStatus(e,t,n={}){return this.read(X(`/v1/projects/${encodeURIComponent(e)}/git/status`,{includeDiff:t.includeDiff===!0?`true`:void 0,repository:t.repository,rootPath:t.rootPath}),Dp,n)}async getProjectGitHistory(e,t,n={}){return this.read(X(`${Z(e)}/git/history`,{cursor:t.cursor,repository:t.repository,rootPath:t.rootPath}),Ap,n)}async getProjectGitCommitFiles(e,t,n={}){return this.read(X(`${Z(e)}/git/commit-files`,{cursor:t.cursor,repository:t.repository,rootPath:t.rootPath,sha:t.sha}),Pp,n)}async getProjectGitCommitFileDiff(e,t,n={}){return this.read(X(`${Z(e)}/git/commit-diff`,{path:t.path,repository:t.repository,rootPath:t.rootPath,sha:t.sha}),Fp,n)}async switchProjectBranch(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/branch`,{rootPath:t}),n,Dp,r)}async createProjectBranch(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/branches`,{rootPath:t}),n,Dp,r)}async listProjectWorktrees(e,t,n={}){return this.read(X(`${Z(e)}/git/worktrees`,{rootPath:t}),Lp,n)}async createProjectWorktree(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/worktrees`,{rootPath:t}),n,Rp,r)}async switchProjectWorktree(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/worktree`,{rootPath:t}),n,Rp,r)}async generateCommitMessage(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/commit-message`,{rootPath:t}),n,zp,r)}async commitProjectChanges(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/commits`,{rootPath:t}),n,Bp,r)}async listProjectFiles(e,t,n,r={}){let i=X(`/v1/projects/${encodeURIComponent(e)}/files/tree`,{path:n??void 0,rootPath:t});return this.read(i,Hp,r)}async searchProjectFiles(e,t,n,r,i={}){let a=X(`/v1/projects/${encodeURIComponent(e)}/files/search`,{query:n,rootPath:t,sessionId:r});return this.read(a,Bd,i)}async stopProjectFileSearch(e,t,n,r={}){return this.mutation(`/v1/projects/${encodeURIComponent(e)}/files/search/stop`,{rootPath:t,sessionId:n},Vd,r)}async readProjectSourceFile(e,t,n,r,i={}){let a=X(`${Z(e)}/files/source`,{cursor:r,path:n,rootPath:t});return this.read(a,Up,i)}},Q_=class extends Z_{async archiveTask(e,t,n={}){return this.mutation(`${Q(e,t)}/archive`,{},vh,n)}async unarchiveTask(e,t,n={}){return this.mutation(`${Q(e,t)}/unarchive`,{},yh,n)}async deleteTask(e,t,n={}){return this.mutation(Q(e,t),{},bh,n,`DELETE`)}},$_=class extends Q_{async updateTaskGoal(e,t,n,r={}){return this.mutation(`${Q(e,t)}/goal`,n,Cm,r,`PUT`)}async clearTaskGoal(e,t,n={}){return this.mutation(`${Q(e,t)}/goal`,{},wm,n,`DELETE`)}},ev=class extends $_{async listQueuedSubmissions(e,t,n={},r={}){return this.read(X(`${Q(e,t)}/queue`,n),bm,r)}async addQueuedSubmission(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/queue`,{clientUserMessageId:r,input:n},kh,i)}async updateQueuedSubmission(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/queue/${encodeURIComponent(n)}`,{input:r},Ah,i,`PUT`)}async deleteQueuedSubmission(e,t,n,r={}){return this.mutation(`${Q(e,t)}/queue/${encodeURIComponent(n)}`,{},jh,r,`DELETE`)}async reorderQueuedSubmissions(e,t,n,r={}){return this.mutation(`${Q(e,t)}/queue/reorder`,{queuedSubmissionIds:n},Mh,r,`PUT`)}async startQueuedSubmission(e,t,n,r={}){return this.mutation(`${Q(e,t)}/queue/start`,{...n===void 0?{}:{queuedSubmissionId:n}},Nh,r)}async listTasks(e,t={},n={}){let r=X(`${Z(e)}/tasks`,t);return this.read(r,th,n)}async readTask(e,t,n={}){let{cursor:r,...i}=n;return this.read(X(Q(e,t),{cursor:r}),xg,i)}getTaskAttachmentUrl(e,t,n){return q_(this.baseUrl,e,t,n)}async openTaskAttachment(e,t,n,r={}){return this.mutation(`${Q(e,t)}/attachments/${encodeURIComponent(n)}/open`,{},Df,r)}async listBackgroundTerminals(e,t,n={}){return this.read(`${Q(e,t)}/background-terminals`,Pf,n)}async terminateBackgroundTerminal(e,t,n,r={}){return this.mutation(`${Q(e,t)}/background-terminals/${encodeURIComponent(n)}/terminate`,{},Ff,r)}async getTaskSettings(e,t,n={}){return this.read(`${Q(e,t)}/settings`,Bm,n)}async updateTaskSettings(e,t,n,r={}){return this.mutation(`${Q(e,t)}/settings`,n,Bm,r,`PUT`)}async startTask(e,t={}){return this.mutation(`${Z(e)}/tasks`,{},hh,t)}async pinTask(e,t,n,r={}){return this.mutation(`${Q(e,t)}/pin`,{pinned:n},gh,r,`PUT`)}async renameTask(e,t,n,r={}){return this.mutation(`${Q(e,t)}/rename`,{title:n},_h,r)}async unsubscribeTask(e,t){return this.request(`${Q(e,t)}/unsubscribe`,xh,{body:`{}`,headers:{"content-type":`application/json`},method:`POST`})}async startReview(e,t,n,r={}){return this.mutation(`${Q(e,t)}/review`,n,Sh,r)}async compactTask(e,t,n={}){return this.mutation(`${Q(e,t)}/compact`,{},Ch,n)}async forkTask(e,t,n,r={}){return this.mutation(`${Q(e,t)}/fork`,n,wh,r)}async uploadFeedback(e,t,n,r={}){return this.mutation(`${Q(e,t)}/feedback`,n,Eh,r)}async uploadAttachment(e,t,n={}){let r=new FormData;return r.set(`attachment`,t.content,t.name),this.request(`${Z(e)}/attachments/${t.kind}`,sm,{body:r,headers:{"idempotency-key":n.idempotencyKey??V_()},method:`POST`},Ih,{...n.signal===void 0?{}:{signal:n.signal},timeoutMs:this.requestTimeouts.mutationMs})}async importHostAttachment(e,t,n,r={}){return this.mutation(`${Z(e)}/attachments/${t}/host`,{path:n},sm,r)}async startTurn(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/turns`,{input:n,options:r},Dh,i)}async steerTurn(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/turns/${encodeURIComponent(n)}/steer`,{input:r,taskId:t},Oh,i)}async interruptTurn(e,t,n,r={}){return this.mutation(`${Q(e,t)}/turns/${encodeURIComponent(n)}/interrupt`,{taskId:t},Ph,r)}async resolvePendingRequest(e,t,n={}){let r={itemId:e.itemId,projectId:e.projectId,resolution:t,taskId:e.taskId,turnId:e.turnId,type:e.type};return this.mutation(`${Q(e.projectId,e.taskId)}/pending-requests/${encodeURIComponent(e.requestId)}/resolve`,r,yp,n)}},tv=class extends ev{},nv=`pinned`,rv=`search-source`,iv=3e4;function av(e,t){return[`projects`,e,`tasks`,t,`queue`]}var ov=new tv,sv=l(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),cv=l(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),lv=Object.defineProperty,uv=(e,t)=>lv(e,`name`,{value:t,configurable:!0}),dv=!!(typeof window<`u`&&window.document&&window.document.createElement);function fv(e,t,{checkForDefaultPrevented:n=!0}={}){return uv(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}uv(fv,`composeEventHandlers`);function pv(e){if(!dv)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}uv(pv,`getOwnerWindow`);function mv(e){if(!dv)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}uv(mv,`getOwnerDocument`);function hv(e,t=!1){let{activeElement:n}=mv(e);if(!n?.nodeName)return null;if(gv(n)&&n.contentDocument)return hv(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=mv(n).getElementById(e);if(t)return t}}return n}uv(hv,`getActiveElement`);function gv(e){return e.tagName===`IFRAME`}uv(gv,`isFrame`);var _v=Object.defineProperty,vv=(e,t)=>_v(e,`name`,{value:t,configurable:!0});function yv(e,t){let n=E.createContext(t);n.displayName=e+`Context`;let r=vv(e=>{let{children:t,...r}=e,i=E.useMemo(()=>r,Object.values(r));return(0,D.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=E.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return vv(i,`useContext`),[r,i]}vv(yv,`createContext`);function bv(e,t=[]){let n=[];function r(t,r){let i=E.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=vv(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=E.useMemo(()=>o,Object.values(o));return(0,D.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=E.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return vv(s,`useContext`),[o,s]}vv(r,`createContext`);let i=vv(()=>{let t=n.map(e=>E.createContext(e));return vv(function(n){let r=n?.[e]||t;return E.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,xv(i,...t)]}vv(bv,`createContextScope`);function xv(...e){let t=e[0];if(e.length===1)return t;let n=vv(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return vv(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}vv(xv,`composeContextScopes`);var Sv=t(r(),1),Cv=Object.defineProperty,wv=(e,t)=>Cv(e,`name`,{value:t,configurable:!0}),Tv=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=c(`Primitive.${t}`),r=E.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,D.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ev(e,t){e&&Sv.flushSync(()=>e.dispatchEvent(t))}wv(Ev,`dispatchDiscreteCustomEvent`);var Dv=Object.defineProperty,Ov=(e,t)=>Dv(e,`name`,{value:t,configurable:!0});function kv(e){let t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ov(kv,`useCallbackRef`);var Av=Object.defineProperty,$=(e,t)=>Av(e,`name`,{value:t,configurable:!0}),jv=`dismissableLayer.update`,Mv=`dismissableLayer.pointerDownOutside`,Nv=`dismissableLayer.focusOutside`,Pv,Fv=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Iv=E.forwardRef($(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=E.useContext(Fv),[f,p]=E.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=E.useState({}),g=a(t,p),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=E.useRef(!1),ee=zv(e=>{o?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:E.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return S&&!t},[d.branches,S])}),w=Bv(e=>{if(r&&C.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m),te=f?b===_.length-1:!1,ne=kv(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return E.useEffect(()=>{if(te)return m.addEventListener(`keydown`,ne,{capture:!0}),()=>m.removeEventListener(`keydown`,ne,{capture:!0})},[m,te,ne]),E.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Pv=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Vv(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Pv))}},[f,m,n,d]),E.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Vv())},[f,d]),E.useEffect(()=>{let e=$(()=>h({}),`handleUpdate`);return document.addEventListener(jv,e),()=>document.removeEventListener(jv,e)},[]),(0,D.jsx)(Tv.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:fv(e.onFocusCapture,w.onFocusCapture),onBlurCapture:fv(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:fv(e.onPointerDownCapture,ee.onPointerDownCapture)})},`DismissableLayer`));function Lv(){let e=E.useContext(Fv),[t,n]=E.useState(null);return E.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}$(Lv,`useDismissableLayerSurface`);var Rv=$(()=>!0,`IS_TRUE`);function zv(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Rv}=t,s=kv(e),c=E.useRef(!1),l=E.useRef(!1),u=E.useRef(new Map),d=E.useRef(()=>{});return E.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}$(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}$(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}$(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}$(p,`handleInteractionBubble`);let m=$(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Hv(Mv,s,p,{discrete:!0})};if($(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:$(()=>c.current=!0,`onPointerDownCapture`)}}$(zv,`usePointerDownOutside`);function Bv(e,t=globalThis?.document){let n=kv(e),r=E.useRef(!1);return E.useEffect(()=>{let e=$(e=>{e.target&&!r.current&&Hv(Nv,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:$(()=>r.current=!0,`onFocusCapture`),onBlurCapture:$(()=>r.current=!1,`onBlurCapture`)}}$(Bv,`useFocusOutside`);function Vv(){let e=new CustomEvent(jv);document.dispatchEvent(e)}$(Vv,`dispatchUpdate`);function Hv(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ev(i,a):i.dispatchEvent(a)}$(Hv,`handleAndDispatchCustomEvent`);var Uv=globalThis?.document?E.useLayoutEffect:()=>{},Wv=Object.defineProperty,Gv=(e,t)=>Wv(e,`name`,{value:t,configurable:!0}),Kv=E.useId||(()=>void 0),qv=0;function Jv(e){let[t,n]=E.useState(Kv());return Uv(()=>{e||n(e=>e??String(qv++))},[e]),e||(t?`radix-${t}`:``)}Gv(Jv,`useId`);var Yv=[`top`,`right`,`bottom`,`left`],Xv=Math.min,Zv=Math.max,Qv=Math.round,$v=Math.floor,ey=e=>({x:e,y:e}),ty={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ny(e,t,n){return Zv(e,Xv(t,n))}function ry(e,t){return typeof e==`function`?e(t):e}function iy(e){return e.split(`-`)[0]}function ay(e){return e.split(`-`)[1]}function oy(e){return e===`x`?`y`:`x`}function sy(e){return e===`y`?`height`:`width`}function cy(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ly(e){return oy(cy(e))}function uy(e,t,n){n===void 0&&(n=!1);let r=ay(e),i=ly(e),a=sy(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yy(o)),[o,yy(o)]}function dy(e){let t=yy(e);return[fy(e),t,fy(t)]}function fy(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var py=[`left`,`right`],my=[`right`,`left`],hy=[`top`,`bottom`],gy=[`bottom`,`top`];function _y(e,t,n){switch(e){case`top`:case`bottom`:return n?t?my:py:t?py:my;case`left`:case`right`:return t?hy:gy;default:return[]}}function vy(e,t,n,r){let i=ay(e),a=_y(iy(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fy)))),a}function yy(e){let t=iy(e);return ty[t]+e.slice(t.length)}function by(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function xy(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:by(e)}function Sy(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Cy(e,t,n){let{reference:r,floating:i}=e,a=cy(t),o=ly(t),s=sy(o),c=iy(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ay(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function wy(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}=ry(t,e),p=xy(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Sy(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=Sy(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 Ty=50,Ey=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:wy},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Cy(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<Ty&&(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}=Cy(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Dy=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}=ry(e,t)||{};if(l==null)return{};let d=xy(u),f={x:n,y:r},p=ly(i),m=sy(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let ee=b/2-x/2,w=C/2-h[m]/2-1,te=Xv(d[_],w),ne=Xv(d[v],w),re=C-h[m]-ne,T=C/2-h[m]/2+ee,ie=ny(te,T,re),ae=!c.arrow&&ay(i)!=null&&T!==ie&&a.reference[m]/2-(T<te?te:ne)-h[m]/2<0,oe=ae?T<te?T-te:T-re:0;return{[p]:f[p]+oe,data:{[p]:ie,centerOffset:T-ie-oe,...ae&&{alignmentOffset:oe}},reset:ae}}}),Oy=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}=ry(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=iy(r),_=cy(o),v=iy(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yy(o)]:dy(o)),x=p!==`none`;!d&&x&&b.push(...vy(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),ee=[],w=i.flip?.overflows||[];if(l&&ee.push(C[g]),u){let e=uy(r,a,y);ee.push(C[e[0]],C[e[1]])}if(w=[...w,{placement:r,overflows:ee}],!ee.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==cy(t))||w.every(e=>cy(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:w},reset:{placement:t}};let n=w.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=w.filter(e=>{if(x){let t=cy(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 ky(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ay(e){return Yv.some(t=>e[t]>=0)}var jy=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ry(e,t);switch(i){case`referenceHidden`:{let e=ky(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ay(e)}}}case`escaped`:{let e=ky(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ay(e)}}}default:return{}}}}},My=new Set([`left`,`top`]);async function Ny(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=iy(n),s=ay(n),c=cy(n)===`y`,l=My.has(o)?-1:1,u=a&&c?-1:1,d=ry(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 Py=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 Ny(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}}}}},Fy=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}=ry(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=cy(i),p=oy(f),m=u[p],h=u[f],g=(e,t)=>ny(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Iy=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}=ry(e,t),u={x:n,y:r},d=cy(i),f=oy(d),p=u[f],m=u[d],h=ry(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=My.has(iy(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}}}},Ly=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ry(e,t),c=await i.detectOverflow(t,s),l=iy(n),u=ay(n),d=cy(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Xv(p-c[m],g),y=Xv(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Zv(c.left,c.right):S=p-2*Zv(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let ee=await i.getDimensions(a.floating);return f!==ee.width||p!==ee.height?{reset:{rects:!0}}:{}}}};function Ry(){return typeof window<`u`}function zy(e){return Hy(e)?(e.nodeName||``).toLowerCase():`#document`}function By(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vy(e){return((Hy(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Hy(e){return Ry()?e instanceof Node||e instanceof By(e).Node:!1}function Uy(e){return Ry()?e instanceof Element||e instanceof By(e).Element:!1}function Wy(e){return Ry()?e instanceof HTMLElement||e instanceof By(e).HTMLElement:!1}function Gy(e){return!Ry()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof By(e).ShadowRoot}function Ky(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=rb(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function qy(e){return/^(table|td|th)$/.test(zy(e))}function Jy(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Yy=/transform|translate|scale|rotate|perspective|filter/,Xy=/paint|layout|strict|content/,Zy=e=>!!e&&e!==`none`,Qy;function $y(e){let t=Uy(e)?rb(e):e;return Zy(t.transform)||Zy(t.translate)||Zy(t.scale)||Zy(t.rotate)||Zy(t.perspective)||!tb()&&(Zy(t.backdropFilter)||Zy(t.filter))||Yy.test(t.willChange||``)||Xy.test(t.contain||``)}function eb(e){let t=ab(e);for(;Wy(t)&&!nb(t);){if($y(t))return t;if(Jy(t))return null;t=ab(t)}return null}function tb(){return Qy??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Qy}function nb(e){return/^(html|body|#document)$/.test(zy(e))}function rb(e){return By(e).getComputedStyle(e)}function ib(e){return Uy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ab(e){if(zy(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Gy(e)&&e.host||Vy(e);return Gy(t)?t.host:t}function ob(e){let t=ab(e);return nb(t)?(e.ownerDocument||e).body:Wy(t)&&Ky(t)?t:ob(t)}function sb(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ob(e),i=r===e.ownerDocument?.body,a=By(r);if(i){let e=cb(a);return t.concat(a,a.visualViewport||[],Ky(r)?r:[],e&&n?sb(e):[])}else return t.concat(r,sb(r,[],n))}function cb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lb(e){let t=rb(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Wy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qv(n)!==a||Qv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ub(e){return Uy(e)?e:e.contextElement}function db(e){let t=ub(e);if(!Wy(t))return ey(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=lb(t),o=(a?Qv(n.width):n.width)/r,s=(a?Qv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var fb=ey(0);function pb(e){let t=By(e);return!tb()||!t.visualViewport?fb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mb(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===By(e)}function hb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ub(e),o=ey(1);t&&(r?Uy(r)&&(o=db(r)):o=db(e));let s=mb(a,n,r)?pb(a):ey(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=By(a),t=Uy(r)?By(r):r,n=e,i=cb(n);for(;i&&t!==n;){let e=db(i),t=i.getBoundingClientRect(),r=rb(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=By(i),i=cb(n)}}return Sy({width:u,height:d,x:c,y:l})}function gb(e,t){let n=ib(e).scrollLeft;return t?t.left+n:hb(Vy(e)).left+n}function _b(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gb(e,n),y:n.top+t.scrollTop}}function vb(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Vy(r),s=t?Jy(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ey(1),u=ey(0),d=Wy(r);if((d||!a)&&((zy(r)!==`body`||Ky(o))&&(c=ib(r)),d)){let e=hb(r);l=db(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_b(o,c):ey(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 yb(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bb(e){let t=ib(e),n=e.ownerDocument.body,r=Zv(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Zv(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gb(e),o=-t.scrollTop;return rb(n).direction===`rtl`&&(a+=Zv(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xb=25;function Sb(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=By(e),a=Vy(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!tb()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gb(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=xb&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Cb(e,t){let n=hb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=db(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wb(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Sb(e,n,t);else if(t===`document`)r=bb(Vy(e));else if(Uy(t))r=Cb(t,n);else{let n=pb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Sy(r)}function Tb(e,t){let n=t.get(e);if(n)return n;let r=sb(e,[],!1).filter(e=>Uy(e)&&zy(e)!==`body`),i=null,a=rb(e).position===`fixed`,o=a?ab(e):e;for(;Uy(o)&&!nb(o);){let e=rb(o),t=$y(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ab(o)}return t.set(e,r),r}function Eb(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Jy(t)?[]:Tb(t,this._c):[].concat(n),r],o=wb(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=wb(t,a[e],i);s=Zv(n.top,s),c=Xv(n.right,c),l=Xv(n.bottom,l),u=Zv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Db(e){let{width:t,height:n}=lb(e);return{width:t,height:n}}function Ob(e,t,n){let r=Wy(t),i=Vy(t),a=n===`fixed`,o=hb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ey(0);if((r||!a)&&((zy(t)!==`body`||Ky(i))&&(s=ib(t)),r)){let e=hb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gb(i));let l=i&&!r&&!a?_b(i,s):ey(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function kb(e){return rb(e).position===`static`}function Ab(e,t){if(!Wy(e)||rb(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Vy(e)===n&&(n=n.ownerDocument.body),n}function jb(e,t){let n=By(e);if(Jy(e))return n;if(!Wy(e)){let t=ab(e);for(;t&&!nb(t);){if(Uy(t)&&!kb(t))return t;t=ab(t)}return n}let r=Ab(e,t);for(;r&&qy(r)&&kb(r);)r=Ab(r,t);return r&&nb(r)&&kb(r)&&!$y(r)?n:r||eb(e)||n}var Mb=async function(e){let t=this.getOffsetParent||jb,n=this.getDimensions,r=await n(e.floating);return{reference:Ob(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nb(e){return rb(e).direction===`rtl`}var Pb={convertOffsetParentRelativeRectToViewportRelativeRect:vb,getDocumentElement:Vy,getClippingRect:Eb,getOffsetParent:jb,getElementRects:Mb,getClientRects:yb,getDimensions:Db,getScale:db,isElement:Uy,isRTL:Nb};function Fb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ib(e,t,n){let r=null,i,a=Vy(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=$v(d),h=$v(a.clientWidth-(u+f)),g=$v(a.clientHeight-(d+p)),_=$v(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Zv(0,Xv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Fb(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=By(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Lb(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=ub(e),u=i||a?[...l?sb(l):[],...t?sb(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ib(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?hb(e):null;c&&g();function g(){let t=hb(e);h&&!Fb(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 Rb=Py,zb=Fy,Bb=Oy,Vb=Ly,Hb=jy,Ub=Dy,Wb=Iy,Gb=(e,t,n)=>{let r=new Map,i=n??{},a={...Pb,...i.platform,_c:r};return Ey(e,t,{...i,platform:a})},Kb=typeof document<`u`?E.useLayoutEffect:function(){};function qb(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(!qb(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)&&!qb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Jb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yb(e,t){let n=Jb(e);return Math.round(t*n)/n}function Xb(e){let t=E.useRef(e);return Kb(()=>{t.current=e}),t}function Zb(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]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=E.useState(r);qb(f,r)||p(r);let[m,h]=E.useState(null),[g,_]=E.useState(null),v=E.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=E.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=E.useRef(null),C=E.useRef(null),ee=E.useRef(u),w=c!=null,te=Xb(c),ne=Xb(i),re=Xb(l),T=E.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ne.current&&(e.platform=ne.current),Gb(S.current,C.current,e).then(e=>{let t={...e,isPositioned:re.current!==!1};ie.current&&!qb(ee.current,t)&&(ee.current=t,Sv.flushSync(()=>{d(t)}))})},[f,t,n,ne,re]);Kb(()=>{l===!1&&ee.current.isPositioned&&(ee.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=E.useRef(!1);Kb(()=>(ie.current=!0,()=>{ie.current=!1}),[]),Kb(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(te.current)return te.current(b,x,T);T()}},[b,x,T,te,w]);let ae=E.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),oe=E.useMemo(()=>({reference:b,floating:x}),[b,x]),se=E.useMemo(()=>{let e={position:n,left:0,top:0};if(!oe.floating)return e;let t=Yb(oe.floating,u.x),r=Yb(oe.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Jb(oe.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,oe.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:T,refs:ae,elements:oe,floatingStyles:se}),[u,T,ae,oe,se])}var Qb=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Ub({element:r.current,padding:i}).fn(n):r?Ub({element:r,padding:i}).fn(n):{}}}},$b=(e,t)=>{let n=Rb(e);return{name:n.name,fn:n.fn,options:[e,t]}},ex=(e,t)=>{let n=zb(e);return{name:n.name,fn:n.fn,options:[e,t]}},tx=(e,t)=>({fn:Wb(e).fn,options:[e,t]}),nx=(e,t)=>{let n=Bb(e);return{name:n.name,fn:n.fn,options:[e,t]}},rx=(e,t)=>{let n=Vb(e);return{name:n.name,fn:n.fn,options:[e,t]}},ix=(e,t)=>{let n=Hb(e);return{name:n.name,fn:n.fn,options:[e,t]}},ax=(e,t)=>{let n=Qb(e);return{name:n.name,fn:n.fn,options:[e,t]}},ox=Object.defineProperty,sx=(e,t)=>ox(e,`name`,{value:t,configurable:!0});function cx(e){let[t,n]=E.useState(void 0);return Uv(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}sx(cx,`useSize`);var lx=Object.defineProperty,ux=(e,t)=>lx(e,`name`,{value:t,configurable:!0}),dx=`Popper`,[fx,px]=bv(dx),[mx,hx]=fx(dx),gx=ux(e=>{let{__scopePopper:t,children:n}=e,[r,i]=E.useState(null),[a,o]=E.useState(void 0);return(0,D.jsx)(mx,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),_x=`PopperAnchor`,vx=E.forwardRef(ux(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,o=hx(_x,n),s=E.useRef(null),c=o.onAnchorChange,l=a(t,E.useCallback(e=>{s.current=e,e&&c(e)},[c])),u=E.useRef(null);E.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=o.placementState&&Tx(o.placementState),f=d?.[0],p=d?.[1];return r?null:(0,D.jsx)(Tv.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),yx=`PopperContent`,[bx,xx]=fx(yx),Sx=E.forwardRef(ux(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=hx(yx,n),[v,y]=E.useState(null),b=a(t,y),[x,S]=E.useState(null),C=cx(x),ee=C?.width??0,w=C?.height??0,te=r+(o===`center`?``:`-`+o),ne=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},re=Array.isArray(u)?u:[u],T=re.length>0,ie={padding:ne,boundary:re.filter(Cx),altBoundary:T},{refs:ae,floatingStyles:oe,placement:se,isPositioned:ce,middlewareData:le}=Zb({strategy:`fixed`,placement:te,whileElementsMounted:ux((...e)=>Lb(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[$b({mainAxis:i+w,alignmentAxis:s}),l&&ex({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?tx():void 0,...ie}),l&&nx({...ie}),rx({...ie,apply:ux(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&ax({element:x,padding:c}),wx({arrowWidth:ee,arrowHeight:w}),p&&ix({strategy:`referenceHidden`,...ie,boundary:T?ie.boundary:void 0})]}),ue=_.setPlacementState;Uv(()=>(ue(se),()=>{ue(void 0)}),[se,ue]);let[de,fe]=Tx(se),pe=kv(h);Uv(()=>{ce&&pe?.()},[ce,pe]);let me=le.arrow?.x,he=le.arrow?.y,ge=le.arrow?.centerOffset!==0,[_e,ve]=E.useState();return Uv(()=>{v&&ve(window.getComputedStyle(v).zIndex)},[v]),(0,D.jsx)(`div`,{ref:ae.setFloating,"data-radix-popper-content-wrapper":``,style:{...oe,transform:ce?oe.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:_e,"--radix-popper-transform-origin":[le.transformOrigin?.x,le.transformOrigin?.y].join(` `),...le.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,D.jsx)(bx,{scope:n,placedSide:de,placedAlign:fe,onArrowChange:S,arrowX:me,arrowY:he,shouldHideArrow:ge,children:(0,D.jsx)(Tv.div,{"data-side":de,"data-align":fe,...g,ref:b,style:{...g.style,animation:ce?g.style?.animation:`none`}})})})},`PopperContent`));function Cx(e){return e!==null}ux(Cx,`isNotNull`);var wx=ux(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Tx(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Tx(e){let[t,n=`center`]=e.split(`-`);return[t,n]}ux(Tx,`getSideAndAlignFromPlacement`);var Ex=gx,Dx=vx,Ox=Sx,kx=Object.defineProperty,Ax=E.forwardRef(((e,t)=>kx(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=E.useState(!1);Uv(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Sv.createPortal((0,D.jsx)(Tv.div,{...r,ref:t}),o):null},`Portal`)),jx=Object.defineProperty,Mx=(e,t)=>jx(e,`name`,{value:t,configurable:!0});function Nx(e,t){return E.useReducer((e,n)=>t[e][n]??e,e)}Mx(Nx,`useStateMachine`);var Px=Mx(e=>{let{present:t,children:n}=e,r=Fx(t),i=typeof n==`function`?n({present:r.isPresent}):E.Children.only(n),a=Lx(r.ref,zx(i));return typeof n==`function`||r.isPresent?E.cloneElement(i,{ref:a}):null},`Presence`);function Fx(e){let[t,n]=E.useState(),r=E.useRef(null),i=E.useRef(e),a=E.useRef(`none`),o=E.useRef(void 0),[s,c]=Nx(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return E.useEffect(()=>{s===`mounted`?(a.current=o.current??Rx(r.current),o.current=void 0):a.current=`none`},[s]),Uv(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Rx(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Uv(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Mx(a=>{let o=Rx(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Mx(e=>{e.target===t&&(a.current=Rx(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:E.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Rx(t)}else r.current=null;n(e)},[])}}Mx(Fx,`usePresence`);function Ix(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Mx(Ix,`setRef`);function Lx(...e){let t=E.useRef(e);return t.current=e,E.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ix(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ix(n[e],null)}}},[])}Mx(Lx,`useStableComposedRefs`);function Rx(e){return e?.animationName||`none`}Mx(Rx,`getAnimationName`);function zx(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Mx(zx,`getElementRef`);var Bx=Object.defineProperty,Vx=(e,t)=>Bx(e,`name`,{value:t,configurable:!0}),Hx=E.useEffectEvent,Ux=E.useInsertionEffect;function Wx(e){if(typeof Hx==`function`)return Hx(e);let t=E.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ux==`function`?Ux(()=>{t.current=e}):Uv(()=>{t.current=e}),E.useMemo(()=>((...e)=>t.current?.(...e)),[])}Vx(Wx,`useEffectEvent`);var Gx=Object.defineProperty,Kx=(e,t)=>Gx(e,`name`,{value:t,configurable:!0}),qx=E.useInsertionEffect||Uv;function Jx({prop:e,defaultProp:t,onChange:n=Kx(()=>{},`onChange`),caller:r}){let[i,a,o]=Yx({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,E.useCallback(t=>{if(s){let n=Xx(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Kx(Jx,`useControllableState`);function Yx({defaultProp:e,onChange:t}){let[n,r]=E.useState(e),i=E.useRef(n),a=E.useRef(t);return qx(()=>{a.current=t},[t]),E.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Kx(Yx,`useUncontrolledState`);function Xx(e){return typeof e==`function`}Kx(Xx,`isFunction`);var Zx=Symbol(`RADIX:SYNC_STATE`);function Qx(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Wx(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=E.useReducer((t,n)=>{if(n.type===Zx)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=E.useRef(p);E.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=E.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return E.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Zx,state:i})},[i,d.state,c]),[h,f]}Kx(Qx,`useControllableStateReducer`);var $x=Object.defineProperty,eS=(e,t)=>$x(e,`name`,{value:t,configurable:!0}),tS=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),nS=E.forwardRef(eS(function(e,t){return(0,D.jsx)(Tv.span,{...e,ref:t,style:{...tS,...e.style}})},`VisuallyHidden`)),rS=Object.defineProperty,iS=(e,t)=>rS(e,`name`,{value:t,configurable:!0}),[aS,oS]=bv(`Tooltip`,[px]),sS=px(),cS=`TooltipProvider`,lS=700,uS=`tooltip.open`,[dS,fS]=aS(cS),pS=iS(e=>{let{__scopeTooltip:t,delayDuration:n=lS,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=E.useRef(!0),s=E.useRef(!1),c=E.useRef(0);return E.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,D.jsx)(dS,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:E.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:E.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:E.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),mS=`Tooltip`,[hS,gS]=aS(mS),_S=iS(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=fS(mS,e.__scopeTooltip),l=sS(t),[u,d]=E.useState(null),[f,p]=E.useState(void 0),m=Jv(),h=E.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=E.useRef(!1),[y,b]=Jx({prop:r,defaultProp:i??!1,onChange:iS(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(uS))):c.onClose(),a?.(e)},`onChange`),caller:mS}),x=E.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=E.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=E.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),ee=E.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);E.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let w=f??m;return(0,D.jsx)(Ex,{...l,children:(0,D.jsx)(hS,{scope:t,contentId:w,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:E.useCallback(()=>{c.isOpenDelayedRef.current?ee():S()},[c.isOpenDelayedRef,ee,S]),onTriggerLeave:E.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),vS=`TooltipTrigger`,yS=E.forwardRef(iS(function(e,t){let{__scopeTooltip:n,...r}=e,i=gS(vS,n),o=fS(vS,n),s=sS(n),c=a(t,E.useRef(null),i.onTriggerChange),l=E.useRef(!1),u=E.useRef(!1),d=E.useCallback(()=>l.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,D.jsx)(Dx,{asChild:!0,...s,children:(0,D.jsx)(Tv.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:fv(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:fv(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:fv(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:fv(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:fv(e.onBlur,i.onClose),onClick:fv(e.onClick,i.onClose)})})},`TooltipTrigger`)),bS=`TooltipPortal`,[xS,SS]=aS(bS,{forceMount:void 0}),CS=iS(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=gS(bS,t);return(0,D.jsx)(xS,{scope:t,forceMount:n,children:(0,D.jsx)(Px,{present:n||a.open,children:(0,D.jsx)(Ax,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),wS=`TooltipContent`,TS=E.forwardRef(iS(function(e,t){let n=SS(wS,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=gS(wS,e.__scopeTooltip);return(0,D.jsx)(Px,{present:r||o.open,children:o.disableHoverableContent?(0,D.jsx)(OS,{side:i,...a,ref:t}):(0,D.jsx)(ES,{side:i,...a,ref:t})})},`TooltipContent`)),ES=E.forwardRef(iS(function(e,t){let n=gS(wS,e.__scopeTooltip),r=fS(wS,e.__scopeTooltip),i=E.useRef(null),o=a(t,i),[s,c]=E.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=E.useCallback(()=>{c(null),f(!1)},[f]),m=E.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=AS(r,kS(r,n.getBoundingClientRect())),a=jS(t.getBoundingClientRect()),o=NS([...i,...a]);c(o),f(!0)},[f]);return E.useEffect(()=>()=>p(),[p]),E.useEffect(()=>{if(l&&d){let e=iS(e=>m(e,d),`handleTriggerLeave`),t=iS(e=>m(e,l),`handleContentLeave`);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),E.useEffect(()=>{if(s){let e=iS(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!MS(n,s);r?p():i&&(p(),u())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,s,u,p]),(0,D.jsx)(OS,{...e,ref:o})},`TooltipContentHoverable`)),DS=o(`TooltipContent`),OS=E.forwardRef(iS(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=gS(wS,n),u=sS(n),{onClose:d}=l;E.useEffect(()=>(document.addEventListener(uS,d),()=>document.removeEventListener(uS,d)),[d]),E.useEffect(()=>{if(l.trigger){let e=iS(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Uv(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,D.jsx)(Iv,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,D.jsxs)(Ox,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,D.jsx)(DS,{children:r}),i?(0,D.jsx)(nS,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function kS(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}iS(kS,`getExitSideFromRect`);function AS(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}iS(AS,`getPaddedExitPoints`);function jS(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}iS(jS,`getPointsFromRect`);function MS(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}iS(MS,`isPointInPolygon`);function NS(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),PS(t)}iS(NS,`getHull`);function PS(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}iS(PS,`getHullPresorted`);var FS=pS,IS=_S,LS=yS,RS=CS,zS=TS;function BS({delayDuration:e=350,disableHoverableContent:t=!0,skipDelayDuration:n=150,...r}){return(0,D.jsx)(FS,{"data-slot":`tooltip-provider`,delayDuration:e,disableHoverableContent:t,skipDelayDuration:n,...r})}function VS(e){return(0,D.jsx)(IS,{"data-slot":`tooltip`,...e})}function HS(e){return(0,D.jsx)(LS,{"data-slot":`tooltip-trigger`,...e})}function US({children:e,className:t,collisionPadding:n=8,sideOffset:r=8,...i}){return(0,D.jsx)(RS,{children:(0,D.jsx)(zS,{className:s(`pointer-events-none z-50 w-fit max-w-[min(20rem,calc(100vw-1rem))] whitespace-normal rounded-control bg-foreground px-2 py-1 text-meta text-raised shadow-floating`,t),collisionPadding:n,"data-slot":`tooltip-content`,sideOffset:r,...i,children:e})})}var WS=Object.defineProperty,GS=(e,t)=>WS(e,`name`,{value:t,configurable:!0}),KS=`focusScope.autoFocusOnMount`,qS=`focusScope.autoFocusOnUnmount`,JS={bubbles:!1,cancelable:!0},YS=E.forwardRef(GS(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[c,l]=E.useState(null),u=kv(i),d=kv(o),f=E.useRef(null),p=a(t,l),m=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:nC(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||nC(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&nC(c)};GS(e,`handleFocusIn`),GS(t,`handleFocusOut`),GS(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),E.useEffect(()=>{if(c){rC.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(KS,JS);c.addEventListener(KS,u),c.dispatchEvent(t),t.defaultPrevented||(XS(oC(QS(c)),{select:!0}),document.activeElement===e&&nC(c))}return()=>{c.removeEventListener(KS,u),setTimeout(()=>{let t=new CustomEvent(qS,JS);c.addEventListener(qS,d),c.dispatchEvent(t),t.defaultPrevented||nC(e??document.body,{select:!0}),c.removeEventListener(qS,d),rC.remove(m)},0)}}},[c,u,d,m]);let h=E.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ZS(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&nC(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&nC(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,D.jsx)(Tv.div,{tabIndex:-1,...s,ref:p,onKeyDown:h})},`FocusScope`));function XS(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(nC(r,{select:t}),document.activeElement!==n)return}GS(XS,`focusFirst`);function ZS(e){let t=QS(e);return[$S(t,e),$S(t.reverse(),e)]}GS(ZS,`getTabbableEdges`);function QS(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:GS(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}GS(QS,`getTabbableCandidates`);function $S(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):eC(r,{upTo:t})))return r}GS($S,`findVisible`);function eC(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}GS(eC,`isHidden`);function tC(e){return e instanceof HTMLInputElement&&`select`in e}GS(tC,`isSelectableInput`);function nC(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&tC(e)&&t&&e.select()}}GS(nC,`focus`);var rC=iC();function iC(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=aC(e,t),e.unshift(t)},remove(t){e=aC(e,t),e[0]?.resume()}}}GS(iC,`createFocusScopesStack`);function aC(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}GS(aC,`arrayRemove`);function oC(e){return e.filter(e=>e.tagName!==`A`)}GS(oC,`removeLinks`);var sC=Object.defineProperty,cC=(e,t)=>sC(e,`name`,{value:t,configurable:!0}),lC=0,uC=null;function dC(e){return fC(),e.children}cC(dC,`FocusGuards`);function fC(){E.useEffect(()=>{uC||={start:pC(),end:pC()};let{start:e,end:t}=uC;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),lC++,()=>{lC===1&&(uC?.start.remove(),uC?.end.remove(),uC=null),lC=Math.max(0,lC-1)}},[])}cC(fC,`useFocusGuards`);function pC(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}cC(pC,`createFocusGuard`);var mC=function(){return mC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mC.apply(this,arguments)};function hC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function gC(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var _C=`right-scroll-bar-position`,vC=`width-before-scroll-bar`,yC=`with-scroll-bars-hidden`,bC=`--removed-body-scroll-bar-size`;function xC(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function SC(e,t){var n=(0,E.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var CC=typeof window<`u`?E.useLayoutEffect:E.useEffect,wC=new WeakMap;function TC(e,t){var n=SC(t||null,function(t){return e.forEach(function(e){return xC(e,t)})});return CC(function(){var t=wC.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||xC(e,null)}),i.forEach(function(e){r.has(e)||xC(e,a)})}wC.set(n,e)},[e]),n}function EC(e){return e}function DC(e,t){t===void 0&&(t=EC);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function OC(e){e===void 0&&(e={});var t=DC(null);return t.options=mC({async:!0,ssr:!1},e),t}var kC=function(e){var t=e.sideCar,n=hC(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return E.createElement(r,mC({},n))};kC.isSideCarExport=!0;function AC(e,t){return e.useMedium(t),kC}var jC=OC(),MC=function(){},NC=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:MC,onWheelCapture:MC,onTouchMoveCapture:MC}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=hC(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=TC([n,t]),C=mC(mC({},b),i);return E.createElement(E.Fragment,null,u&&E.createElement(x,{sideCar:jC,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?E.cloneElement(E.Children.only(s),mC(mC({},C),{ref:S})):E.createElement(v,mC({},C,{className:c,ref:S}),s))});NC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},NC.classNames={fullWidth:vC,zeroRight:_C};var PC,FC=function(){if(PC)return PC;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function IC(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=FC();return t&&e.setAttribute(`nonce`,t),e}function LC(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function RC(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var zC=function(){var e=0,t=null;return{add:function(n){e==0&&(t=IC())&&(LC(t,n),RC(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},BC=function(){var e=zC();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},VC=function(){var e=BC();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},HC={left:0,top:0,right:0,gap:0},UC=function(e){return parseInt(e||``,10)||0},WC=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[UC(n),UC(r),UC(i)]},GC=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return HC;var t=WC(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},KC=VC(),qC=`data-scroll-locked`,JC=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${yC} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${qC}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${_C} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${vC} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${_C} .${_C} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${vC} .${vC} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${qC}] {
36
+ ${bC}: ${s}px;
37
+ }
38
+ `},YC=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},XC=function(){E.useEffect(function(){return document.body.setAttribute(qC,(YC()+1).toString()),function(){var e=YC()-1;e<=0?document.body.removeAttribute(qC):document.body.setAttribute(qC,e.toString())}},[])},ZC=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;XC();var a=E.useMemo(function(){return GC(i)},[i]);return E.createElement(KC,{styles:JC(a,!t,i,n?``:`!important`)})},QC=!1;if(typeof window<`u`)try{var $C=Object.defineProperty({},"passive",{get:function(){return QC=!0,!0}});window.addEventListener(`test`,$C,$C),window.removeEventListener(`test`,$C,$C)}catch{QC=!1}var ew=QC?{passive:!1}:!1,tw=function(e){return e.tagName===`TEXTAREA`},nw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!tw(e)&&n[t]===`visible`)},rw=function(e){return nw(e,`overflowY`)},iw=function(e){return nw(e,`overflowX`)},aw=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),cw(e,r)){var i=lw(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ow=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},sw=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},cw=function(e,t){return e===`v`?rw(t):iw(t)},lw=function(e,t){return e===`v`?ow(t):sw(t)},uw=function(e,t){return e===`h`&&t===`rtl`?-1:1},dw=function(e,t,n,r,i){var a=uw(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=lw(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&cw(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},fw=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pw=function(e){return[e.deltaX,e.deltaY]},mw=function(e){return e&&`current`in e?e.current:e},hw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gw=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},_w=0,vw=[];function yw(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(_w++)[0],a=E.useState(VC)[0],o=E.useRef(e);E.useEffect(function(){o.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=gC([e.lockRef.current],(e.shards||[]).map(mw),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=E.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=fw(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=aw(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=aw(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return dw(h,t,e,h===`h`?s:c,!0)},[]),c=E.useCallback(function(e){var n=e;if(!(!vw.length||vw[vw.length-1]!==a)){var r=`deltaY`in n?pw(n):fw(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&hw(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(mw).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=E.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:bw(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=E.useCallback(function(e){n.current=fw(e),r.current=void 0},[]),d=E.useCallback(function(t){l(t.type,pw(t),t.target,s(t,e.lockRef.current))},[]),f=E.useCallback(function(t){l(t.type,fw(t),t.target,s(t,e.lockRef.current))},[]);E.useEffect(function(){return vw.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ew),document.addEventListener(`touchmove`,c,ew),document.addEventListener(`touchstart`,u,ew),function(){vw=vw.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ew),document.removeEventListener(`touchmove`,c,ew),document.removeEventListener(`touchstart`,u,ew)}},[]);var p=e.removeScrollBar,m=e.inert;return E.createElement(E.Fragment,null,m?E.createElement(a,{styles:gw(i)}):null,p?E.createElement(ZC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bw(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var xw=AC(jC,yw),Sw=E.forwardRef(function(e,t){return E.createElement(NC,mC({},e,{ref:t,sideCar:xw}))});Sw.classNames=NC.classNames;var Cw=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ww=new WeakMap,Tw=new WeakMap,Ew={},Dw=0,Ow=function(e){return e&&(e.host||Ow(e.parentNode))},kw=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ow(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Aw=function(e,t,n,r){var i=kw(t,Array.isArray(e)?e:[e]);Ew[n]||(Ew[n]=new WeakMap);var a=Ew[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(ww.get(e)||0)+1,l=(a.get(e)||0)+1;ww.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Tw.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Dw++,function(){o.forEach(function(e){var t=ww.get(e)-1,i=a.get(e)-1;ww.set(e,t),a.set(e,i),t||(Tw.has(e)||e.removeAttribute(r),Tw.delete(e)),i||e.removeAttribute(n)}),Dw--,Dw||(ww=new WeakMap,ww=new WeakMap,Tw=new WeakMap,Ew={})}},jw=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Cw(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Aw(r,i,n,`aria-hidden`)):function(){return null}};export{rt as $,rv as A,u as At,Tm as B,Tv as C,te as Ct,cv as D,me as Dt,fv as E,T as Et,J_ as F,pf as G,vf as H,q_ as I,st as J,mf as K,V_ as L,ov as M,av as N,sv as O,fe as Ot,Y_ as P,et as Q,mh as R,kv as S,g as St,bv as T,b as Tt,df as U,xf as V,ff as W,at as X,ot as Y,it as Z,cx as _,w as _t,VS as a,qe as at,Iv as b,C as bt,HS as c,Ie as ct,Px as d,je as dt,nt as et,Ax as f,Ee as ft,px as g,_ as gt,Ex as h,be as ht,YS as i,Xe as it,iv as j,nv as k,d as kt,tS as l,Me as lt,Ox as m,xe as mt,Sw as n,$e as nt,US as o,Ge as ot,Dx as p,Te as pt,Tf as q,fC as r,Qe as rt,BS as s,We as st,jw as t,Ze as tt,Jx as u,Ae as ut,Jv as v,ee as vt,Ev as w,re as wt,Lv as x,S as xt,Uv as y,le as yt,Km as z};
@@ -1 +1 @@
1
- import{s as e}from"./button-DPWbWvQN.js";var t=e(`file`,[[`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`}]]);export{t};
1
+ import{s as e}from"./button-SdoQawHa.js";var t=e(`file`,[[`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`}]]);export{t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/patch-diff-viewer-BlbG4Z8Q.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CVaUQXZF.js","assets/index-CoRYl0EO.js","assets/button-DPWbWvQN.js","assets/bundle-mjs-rHxsej31.js","assets/es2015-DsWAjMth.js","assets/checkbox-CCES4UbV.js","assets/file-tree-AZsgAlZn.js","assets/file-CdvUKvsI.js","assets/provider-connection-queries-bzb4TYim.js","assets/index-BoX8xH2D.css","assets/engine-compile-DQ0HPfe0.js","assets/lib-DrPFkMXk.js","assets/code-languages-0g9buMoI.js","assets/shiki-bundle-BndEhlUP.js","assets/file-change-D7aZLgtG.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CVaUQXZF.js";import{s as r,t as i,u as a}from"./button-DPWbWvQN.js";import{O as o,a as s,c,o as l}from"./es2015-DsWAjMth.js";import{i as u,l as d,r as f,t as p}from"./file-tree-AZsgAlZn.js";import{A as m,F as h,Q as g,j as _,lt as v}from"./index-CoRYl0EO.js";import{n as y,t as b}from"./file-change-D7aZLgtG.js";var x=r(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),S=r(`files`,[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),C=r(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),w=r(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),T=e(t(),1),E=n();function D(e,t){return e.name.localeCompare(t.name,`en`)}function O(e){let t=[e.name],n=e;for(;n.files.length===0&&n.directories.size===1;){let e=n.directories.values().next().value;if(e===void 0)break;t.push(e.name),n=e}let r=[...n.directories.values()].sort(D).map(O),i=n.files.toSorted(D);return{children:[...r,...i],name:t.join(`/`),path:n.path,type:`folder`}}function k(e){let t={directories:new Map,files:[],name:``,path:``};return e.forEach((e,n)=>{let r=e.path.split(/[\\/]/),i=r.at(-1)??e.path,a=t,o=``;for(let e of r.slice(0,-1)){o=o.length===0?e:`${o}/${e}`;let t=a.directories.get(e);t===void 0&&(t={directories:new Map,files:[],name:e,path:o},a.directories.set(e,t)),a=t}let{additions:s,removals:c}=b(e);a.files.push({additions:s,changeIndex:n,name:i,path:r.join(`/`),removals:c,type:`file`})}),[...[...t.directories.values()].sort(D).map(O),...t.files.toSorted(D)]}function A(e,t=new Set){for(let n of e)n.type===`folder`&&(t.add(n.path),A(n.children,t));return t}function j({fileLabel:e,nodes:t,showStats:n}){return t.map(t=>t.type===`folder`?(0,E.jsx)(u,{name:t.name,path:t.path,children:(0,E.jsx)(j,{fileLabel:e,nodes:t.children,showStats:n})},t.path):(0,E.jsx)(f,{"aria-label":e(t),icon:(0,E.jsx)(x,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),name:t.name,path:t.path,trailing:n?(0,E.jsxs)(`span`,{"aria-hidden":`true`,className:`ml-auto flex shrink-0 items-center gap-1 text-meta`,children:[(0,E.jsxs)(`span`,{className:`font-medium text-diff-added`,children:[`+`,t.additions]}),(0,E.jsxs)(`span`,{className:`font-medium text-diff-removed`,children:[`-`,t.removals]})]}):void 0},`${t.path}:${String(t.changeIndex)}`))}function M({nodes:e,onSelect:t,selectedPath:n,showStats:r=!0}){let{t:i}=a(`workbench`),o=(0,T.useMemo)(()=>A(e),[e]);return(0,E.jsx)(p,{"aria-label":i(`diff.changedFilesNavigation`),defaultExpanded:o,onSelect:t,selectedPath:n,children:(0,E.jsx)(j,{fileLabel:e=>r?i(`diff.fileStats`,{additions:e.additions,path:e.path,removals:e.removals}):e.path,nodes:e,showStats:r})})}var N=(0,T.lazy)(()=>v(()=>import(`./patch-diff-viewer-BlbG4Z8Q.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),P=`(max-width: 760px)`;function F(){return typeof window>`u`||!window.matchMedia(P).matches}function I(e){return e===`ArrowUp`?`previous`:e===`ArrowDown`?`next`:null}function L(e,t,n){return n<=0?0:Math.min(Math.max(e+(t===`next`?1:-1),0),n-1)}function R({changes:e,currentIndex:t,navigationFooter:n,onClose:r,onCurrentIndexChange:u,renderContent:f,showStats:p=!0,titleId:m}){let{t:h}=a(`workbench`),_=(0,T.useRef)(null),[v,b]=(0,T.useState)(F),D=(0,T.useMemo)(()=>k(e),[e]),O=(0,T.useMemo)(()=>new Map(e.map((e,t)=>[e.path.replaceAll(`\\`,`/`),t])),[e]);if((0,T.useEffect)(()=>{b(F())},[e]),(0,T.useEffect)(()=>{let n=n=>{if(n.defaultPrevented)return;let r=I(n.key);r!==null&&(n.preventDefault(),u(L(t,r,e.length)))};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n)}},[e.length,t,u]),(0,T.useLayoutEffect)(()=>{_.current!==null&&(_.current.scrollTop=0)},[t]),e.length===0)return null;let A=e[0];if(A===void 0)return null;let j=e[t]??A,P=j.path.replaceAll(`\\`,`/`),R=y(j.path),z=h(v?`diff.collapseChangedFilesNavigation`:`diff.expandChangedFilesNavigation`),B=n=>{u(L(t,n,e.length))};return(0,E.jsxs)(`section`,{className:`grid h-full min-h-0 w-full min-w-0 grid-rows-[auto_minmax(0,1fr)] bg-raised`,children:[(0,E.jsxs)(`header`,{className:`flex min-h-toolbar min-w-0 items-center gap-2 px-3 shadow-toolbar sm:px-4`,children:[(0,E.jsx)(x,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`h2`,{className:`truncate text-body-small font-semibold`,id:m,title:j.path,children:R}),(0,E.jsx)(`p`,{className:`truncate text-caption text-muted-foreground`,title:j.path,children:j.path})]}),(0,E.jsxs)(`span`,{className:`shrink-0 text-label text-muted-foreground`,children:[t+1,` / `,e.length]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-label":h(`diff.previousFile`),disabled:t===0,onClick:()=>{B(`previous`)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:h(`diff.previousFile`)})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-label":h(`diff.nextFile`),disabled:t===e.length-1,onClick:()=>{B(`next`)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(o,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:h(`diff.nextFile`)})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-controls":`file-review-navigation`,"aria-expanded":v,"aria-label":z,onClick:()=>{b(e=>!e)},size:`icon-sm`,type:`button`,variant:`ghost`,children:v?(0,E.jsx)(C,{className:`size-3.5`,"aria-hidden":`true`}):(0,E.jsx)(w,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:z})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-label":h(`diff.closeReview`),onClick:r,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(g,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:h(`diff.closeReview`)})]})]})]}),(0,E.jsxs)(`div`,{className:`relative grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)] bg-content ${v?`workbench:grid-cols-[minmax(0,1fr)_minmax(12rem,26%)]`:``}`,children:[(0,E.jsx)(`section`,{"aria-label":h(`diff.reviewContent`),className:`min-h-0 min-w-0 overflow-auto`,ref:_,children:f===void 0?(0,E.jsx)(T.Suspense,{fallback:(0,E.jsx)(`div`,{className:`grid min-h-48 place-items-center text-body-small text-muted-foreground`,role:`status`,children:h(`diff.loading`)}),children:(0,E.jsx)(N,{change:j})}):f(j)}),(0,E.jsxs)(`aside`,{"aria-label":h(`diff.changedFilesNavigation`),className:`absolute inset-y-0 right-0 z-10 grid min-h-0 w-[min(16rem,82%)] grid-rows-[auto_minmax(0,1fr)] border-l border-separator bg-panel shadow-panel workbench:static workbench:z-auto workbench:w-auto workbench:shadow-none`,hidden:!v,id:`file-review-navigation`,children:[(0,E.jsxs)(`div`,{className:`flex min-h-toolbar items-center gap-2 border-b border-separator px-3`,children:[(0,E.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,E.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-label font-semibold`,children:h(`diff.changedFiles`)}),(0,E.jsx)(`span`,{className:`text-meta text-muted-foreground`,children:e.length})]}),(0,E.jsxs)(`div`,{className:`min-h-0 overflow-y-auto px-2 py-2`,children:[(0,E.jsx)(M,{nodes:D,onSelect:e=>{let t=O.get(e);t!==void 0&&u(t)},selectedPath:P,showStats:p}),n]})]})]})]})}function z({changes:e,onClose:t}){let[n,r]=(0,T.useState)(0);if((0,T.useEffect)(()=>{e!==null&&r(0)},[e]),e===null||e.length===0)return null;let i=`file-review-dialog-title`;return(0,E.jsx)(m,{onOpenChange:e=>{e||t()},open:!0,children:(0,E.jsxs)(_,{"aria-labelledby":i,className:`h-[min(86dvh,58rem)] max-w-[78rem] overflow-hidden p-0`,children:[(0,E.jsx)(h,{className:`sr-only`,children:y(e[0]?.path??``)}),(0,E.jsx)(R,{changes:e,currentIndex:n,onClose:t,onCurrentIndexChange:r,titleId:i})]})})}export{x as a,S as i,R as n,C as r,z as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/patch-diff-viewer-7Ar-plzV.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CVaUQXZF.js","assets/index-BQDjXTIj.js","assets/button-SdoQawHa.js","assets/bundle-mjs-rHxsej31.js","assets/es2015-B-skuqay.js","assets/checkbox-BlpFo5_d.js","assets/file-tree-Bl6o98td.js","assets/file-DwOQ4CRt.js","assets/provider-connection-queries-BKyJMJn1.js","assets/index-Cg_JyLiC.css","assets/engine-compile-Bqjaa_8Z.js","assets/lib-DrPFkMXk.js","assets/code-languages-CoeGleQS.js","assets/shiki-bundle-UDLEjOL9.js","assets/file-change-D7aZLgtG.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CVaUQXZF.js";import{s as r,t as i,u as a}from"./button-SdoQawHa.js";import{O as o,a as s,c,o as l}from"./es2015-B-skuqay.js";import{i as u,l as d,r as f,t as p}from"./file-tree-Bl6o98td.js";import{A as m,F as h,Q as g,j as _,lt as v}from"./index-BQDjXTIj.js";import{n as y,t as b}from"./file-change-D7aZLgtG.js";var x=r(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),S=r(`files`,[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),C=r(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),w=r(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),T=e(t(),1),E=n();function D(e,t){return e.name.localeCompare(t.name,`en`)}function O(e){let t=[e.name],n=e;for(;n.files.length===0&&n.directories.size===1;){let e=n.directories.values().next().value;if(e===void 0)break;t.push(e.name),n=e}let r=[...n.directories.values()].sort(D).map(O),i=n.files.toSorted(D);return{children:[...r,...i],name:t.join(`/`),path:n.path,type:`folder`}}function k(e){let t={directories:new Map,files:[],name:``,path:``};return e.forEach((e,n)=>{let r=e.path.split(/[\\/]/),i=r.at(-1)??e.path,a=t,o=``;for(let e of r.slice(0,-1)){o=o.length===0?e:`${o}/${e}`;let t=a.directories.get(e);t===void 0&&(t={directories:new Map,files:[],name:e,path:o},a.directories.set(e,t)),a=t}let{additions:s,removals:c}=b(e);a.files.push({additions:s,changeIndex:n,name:i,path:r.join(`/`),removals:c,type:`file`})}),[...[...t.directories.values()].sort(D).map(O),...t.files.toSorted(D)]}function A(e,t=new Set){for(let n of e)n.type===`folder`&&(t.add(n.path),A(n.children,t));return t}function j({fileLabel:e,nodes:t,showStats:n}){return t.map(t=>t.type===`folder`?(0,E.jsx)(u,{name:t.name,path:t.path,children:(0,E.jsx)(j,{fileLabel:e,nodes:t.children,showStats:n})},t.path):(0,E.jsx)(f,{"aria-label":e(t),icon:(0,E.jsx)(x,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),name:t.name,path:t.path,trailing:n?(0,E.jsxs)(`span`,{"aria-hidden":`true`,className:`ml-auto flex shrink-0 items-center gap-1 text-meta`,children:[(0,E.jsxs)(`span`,{className:`font-medium text-diff-added`,children:[`+`,t.additions]}),(0,E.jsxs)(`span`,{className:`font-medium text-diff-removed`,children:[`-`,t.removals]})]}):void 0},`${t.path}:${String(t.changeIndex)}`))}function M({nodes:e,onSelect:t,selectedPath:n,showStats:r=!0}){let{t:i}=a(`workbench`),o=(0,T.useMemo)(()=>A(e),[e]);return(0,E.jsx)(p,{"aria-label":i(`diff.changedFilesNavigation`),defaultExpanded:o,onSelect:t,selectedPath:n,children:(0,E.jsx)(j,{fileLabel:e=>r?i(`diff.fileStats`,{additions:e.additions,path:e.path,removals:e.removals}):e.path,nodes:e,showStats:r})})}var N=(0,T.lazy)(()=>v(()=>import(`./patch-diff-viewer-7Ar-plzV.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),P=`(max-width: 760px)`;function F(){return typeof window>`u`||!window.matchMedia(P).matches}function I(e){return e===`ArrowUp`?`previous`:e===`ArrowDown`?`next`:null}function L(e,t,n){return n<=0?0:Math.min(Math.max(e+(t===`next`?1:-1),0),n-1)}function R({changes:e,currentIndex:t,navigationFooter:n,onClose:r,onCurrentIndexChange:u,renderContent:f,showStats:p=!0,titleId:m}){let{t:h}=a(`workbench`),_=(0,T.useRef)(null),[v,b]=(0,T.useState)(F),D=(0,T.useMemo)(()=>k(e),[e]),O=(0,T.useMemo)(()=>new Map(e.map((e,t)=>[e.path.replaceAll(`\\`,`/`),t])),[e]);if((0,T.useEffect)(()=>{b(F())},[e]),(0,T.useEffect)(()=>{let n=n=>{if(n.defaultPrevented)return;let r=I(n.key);r!==null&&(n.preventDefault(),u(L(t,r,e.length)))};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n)}},[e.length,t,u]),(0,T.useLayoutEffect)(()=>{_.current!==null&&(_.current.scrollTop=0)},[t]),e.length===0)return null;let A=e[0];if(A===void 0)return null;let j=e[t]??A,P=j.path.replaceAll(`\\`,`/`),R=y(j.path),z=h(v?`diff.collapseChangedFilesNavigation`:`diff.expandChangedFilesNavigation`),B=n=>{u(L(t,n,e.length))};return(0,E.jsxs)(`section`,{className:`grid h-full min-h-0 w-full min-w-0 grid-rows-[auto_minmax(0,1fr)] bg-raised`,children:[(0,E.jsxs)(`header`,{className:`flex min-h-toolbar min-w-0 items-center gap-2 px-3 shadow-toolbar sm:px-4`,children:[(0,E.jsx)(x,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`h2`,{className:`truncate text-body-small font-semibold`,id:m,title:j.path,children:R}),(0,E.jsx)(`p`,{className:`truncate text-caption text-muted-foreground`,title:j.path,children:j.path})]}),(0,E.jsxs)(`span`,{className:`shrink-0 text-label text-muted-foreground`,children:[t+1,` / `,e.length]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-label":h(`diff.previousFile`),disabled:t===0,onClick:()=>{B(`previous`)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:h(`diff.previousFile`)})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-label":h(`diff.nextFile`),disabled:t===e.length-1,onClick:()=>{B(`next`)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(o,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:h(`diff.nextFile`)})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-controls":`file-review-navigation`,"aria-expanded":v,"aria-label":z,onClick:()=>{b(e=>!e)},size:`icon-sm`,type:`button`,variant:`ghost`,children:v?(0,E.jsx)(C,{className:`size-3.5`,"aria-hidden":`true`}):(0,E.jsx)(w,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:z})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-label":h(`diff.closeReview`),onClick:r,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(g,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:h(`diff.closeReview`)})]})]})]}),(0,E.jsxs)(`div`,{className:`relative grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)] bg-content ${v?`workbench:grid-cols-[minmax(0,1fr)_minmax(12rem,26%)]`:``}`,children:[(0,E.jsx)(`section`,{"aria-label":h(`diff.reviewContent`),className:`min-h-0 min-w-0 overflow-auto`,ref:_,children:f===void 0?(0,E.jsx)(T.Suspense,{fallback:(0,E.jsx)(`div`,{className:`grid min-h-48 place-items-center text-body-small text-muted-foreground`,role:`status`,children:h(`diff.loading`)}),children:(0,E.jsx)(N,{change:j})}):f(j)}),(0,E.jsxs)(`aside`,{"aria-label":h(`diff.changedFilesNavigation`),className:`absolute inset-y-0 right-0 z-10 grid min-h-0 w-[min(16rem,82%)] grid-rows-[auto_minmax(0,1fr)] border-l border-separator bg-panel shadow-panel workbench:static workbench:z-auto workbench:w-auto workbench:shadow-none`,hidden:!v,id:`file-review-navigation`,children:[(0,E.jsxs)(`div`,{className:`flex min-h-toolbar items-center gap-2 border-b border-separator px-3`,children:[(0,E.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,E.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-label font-semibold`,children:h(`diff.changedFiles`)}),(0,E.jsx)(`span`,{className:`text-meta text-muted-foreground`,children:e.length})]}),(0,E.jsxs)(`div`,{className:`min-h-0 overflow-y-auto px-2 py-2`,children:[(0,E.jsx)(M,{nodes:D,onSelect:e=>{let t=O.get(e);t!==void 0&&u(t)},selectedPath:P,showStats:p}),n]})]})]})]})}function z({changes:e,onClose:t}){let[n,r]=(0,T.useState)(0);if((0,T.useEffect)(()=>{e!==null&&r(0)},[e]),e===null||e.length===0)return null;let i=`file-review-dialog-title`;return(0,E.jsx)(m,{onOpenChange:e=>{e||t()},open:!0,children:(0,E.jsxs)(_,{"aria-labelledby":i,className:`h-[min(86dvh,58rem)] max-w-[78rem] overflow-hidden bg-transparent p-0`,children:[(0,E.jsx)(h,{className:`sr-only`,children:y(e[0]?.path??``)}),(0,E.jsx)(R,{changes:e,currentIndex:n,onClose:t,onCurrentIndexChange:r,titleId:i})]})})}export{x as a,S as i,R as n,C as r,z as t};