@bryanhu/codexly 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -1
- package/README.md +3 -1
- package/README.zh-CN.md +3 -1
- package/dist/{chunk-Y7HG5THF.js → chunk-4PA52XB7.js} +938 -83
- package/dist/{chunk-VZLNYRY3.js → chunk-AGMOIRX4.js} +1 -1
- package/dist/{chunk-3OBVX5TN.js → chunk-RNTA4MFS.js} +9 -1
- package/dist/{chunk-6HXWAD7A.js → chunk-UAJCHOZK.js} +1260 -466
- package/dist/{chunk-DR6HEQ7V.js → chunk-ZSWNUDDK.js} +123 -7
- package/dist/cli.js +10 -6
- package/dist/client/index.js +35 -5
- package/dist/core/index.js +1 -1
- package/dist/protocol/index.js +1 -1
- package/dist/providers/codex/index.js +3 -3
- package/dist/server/index.js +5 -5
- package/dist/sqlite-state-worker.js +117 -7
- package/dist/web/.vite/manifest.json +406 -273
- package/dist/web/.vite/manifest.json.br +0 -0
- package/dist/web/.vite/manifest.json.gz +0 -0
- package/dist/web/assets/button-group-GolVMDRO.js +1 -0
- package/dist/web/assets/button-group-GolVMDRO.js.br +0 -0
- package/dist/web/assets/button-group-GolVMDRO.js.gz +0 -0
- package/dist/web/assets/check-DufG-ZUa.js +1 -0
- package/dist/web/assets/check-DufG-ZUa.js.br +0 -0
- package/dist/web/assets/check-DufG-ZUa.js.gz +0 -0
- package/dist/web/assets/checkbox-37DlWLBa.js +1 -0
- package/dist/web/assets/checkbox-37DlWLBa.js.br +0 -0
- package/dist/web/assets/checkbox-37DlWLBa.js.gz +0 -0
- package/dist/web/assets/{chunk-BO2N2NFS-Cv0xdEIU.js → chunk-BO2N2NFS-C9R62W5i.js} +4 -4
- package/dist/web/assets/chunk-BO2N2NFS-C9R62W5i.js.br +0 -0
- package/dist/web/assets/chunk-BO2N2NFS-C9R62W5i.js.gz +0 -0
- package/dist/web/assets/{code-highlighter-XA2cEb7n.js → code-highlighter-B_sQt157.js} +1 -1
- package/dist/web/assets/code-highlighter-B_sQt157.js.br +0 -0
- package/dist/web/assets/code-highlighter-B_sQt157.js.gz +0 -0
- package/dist/web/assets/code-languages-lQDTaxNN.js +2 -0
- package/dist/web/assets/code-languages-lQDTaxNN.js.br +0 -0
- package/dist/web/assets/code-languages-lQDTaxNN.js.gz +0 -0
- package/dist/web/assets/context-menu-Dag_JnAP.js +1 -0
- package/dist/web/assets/context-menu-Dag_JnAP.js.br +0 -0
- package/dist/web/assets/context-menu-Dag_JnAP.js.gz +0 -0
- package/dist/web/assets/cpp-DrC1WCyF.js +1 -0
- package/dist/web/assets/cpp-DrC1WCyF.js.br +0 -0
- package/dist/web/assets/cpp-DrC1WCyF.js.gz +0 -0
- package/dist/web/assets/cpp-DuI2J82L.js +1 -0
- package/dist/web/assets/cpp-DuI2J82L.js.br +0 -0
- package/dist/web/assets/cpp-DuI2J82L.js.gz +0 -0
- package/dist/web/assets/dist-D75B5EEW.js +1 -0
- package/dist/web/assets/dist-D75B5EEW.js.br +0 -0
- package/dist/web/assets/dist-D75B5EEW.js.gz +0 -0
- package/dist/web/assets/dist-rI8Y0b5t.js +1 -0
- package/dist/web/assets/dist-rI8Y0b5t.js.br +0 -0
- package/dist/web/assets/dist-rI8Y0b5t.js.gz +0 -0
- package/dist/web/assets/{engine-compile-DQ0HPfe0.js → engine-compile-Bqjaa_8Z.js} +14 -14
- package/dist/web/assets/engine-compile-Bqjaa_8Z.js.br +0 -0
- package/dist/web/assets/engine-compile-Bqjaa_8Z.js.gz +0 -0
- package/dist/web/assets/es2015-Bu8fG2VP.js +41 -0
- package/dist/web/assets/es2015-Bu8fG2VP.js.br +0 -0
- package/dist/web/assets/es2015-Bu8fG2VP.js.gz +0 -0
- package/dist/web/assets/file-code-corner-BfUyC-bF.js +1 -0
- package/dist/web/assets/file-code-corner-BfUyC-bF.js.br +1 -0
- package/dist/web/assets/file-code-corner-BfUyC-bF.js.gz +0 -0
- package/dist/web/assets/file-navigation-view-preference-De4_ih3I.js +1 -0
- package/dist/web/assets/file-navigation-view-preference-De4_ih3I.js.br +0 -0
- package/dist/web/assets/file-navigation-view-preference-De4_ih3I.js.gz +0 -0
- package/dist/web/assets/file-review-dialog-D6itznUk.js +2 -0
- package/dist/web/assets/file-review-dialog-D6itznUk.js.br +0 -0
- package/dist/web/assets/file-review-dialog-D6itznUk.js.gz +0 -0
- package/dist/web/assets/file-tree-CFUaXf_b.js +1 -0
- package/dist/web/assets/file-tree-CFUaXf_b.js.br +0 -0
- package/dist/web/assets/file-tree-CFUaXf_b.js.gz +0 -0
- package/dist/web/assets/git-commit-horizontal-BsjVPZ9W.js +1 -0
- package/dist/web/assets/git-commit-horizontal-BsjVPZ9W.js.br +0 -0
- package/dist/web/assets/git-commit-horizontal-BsjVPZ9W.js.gz +0 -0
- package/dist/web/assets/git-history-panel-DIr_4cfP.js +2 -0
- package/dist/web/assets/git-history-panel-DIr_4cfP.js.br +0 -0
- package/dist/web/assets/git-history-panel-DIr_4cfP.js.gz +0 -0
- package/dist/web/assets/global-settings-dialog-CWeXTy89.js +1 -0
- package/dist/web/assets/global-settings-dialog-CWeXTy89.js.br +0 -0
- package/dist/web/assets/global-settings-dialog-CWeXTy89.js.gz +0 -0
- package/dist/web/assets/grammar-cpp-support-CH6jZNJS.js +1 -0
- package/dist/web/assets/grammar-cpp-support-CH6jZNJS.js.br +0 -0
- package/dist/web/assets/grammar-cpp-support-CH6jZNJS.js.gz +0 -0
- package/dist/web/assets/{highlighted-body-OFNGDK62-3Xd1uGCw.js → highlighted-body-OFNGDK62-J6vd4AIe.js} +1 -1
- package/dist/web/assets/highlighted-body-OFNGDK62-J6vd4AIe.js.br +0 -0
- package/dist/web/assets/highlighted-body-OFNGDK62-J6vd4AIe.js.gz +0 -0
- package/dist/web/assets/index-CMCPev5S.js +4 -0
- package/dist/web/assets/index-CMCPev5S.js.br +0 -0
- package/dist/web/assets/index-CMCPev5S.js.gz +0 -0
- package/dist/web/assets/index-CcSDzrvO.css +2 -0
- package/dist/web/assets/index-CcSDzrvO.css.br +0 -0
- package/dist/web/assets/index-CcSDzrvO.css.gz +0 -0
- package/dist/web/assets/lazy-message-response-kziUJe0I.js +2 -0
- package/dist/web/assets/lazy-message-response-kziUJe0I.js.br +0 -0
- package/dist/web/assets/lazy-message-response-kziUJe0I.js.gz +0 -0
- package/dist/web/assets/loader-circle-DUyazd0N.js +1 -0
- package/dist/web/assets/loader-circle-DUyazd0N.js.br +0 -0
- package/dist/web/assets/loader-circle-DUyazd0N.js.gz +0 -0
- package/dist/web/assets/mermaid-GHXKKRXX-6KIGYUKQ.js +1 -0
- package/dist/web/assets/mermaid-GHXKKRXX-6KIGYUKQ.js.br +0 -0
- package/dist/web/assets/mermaid-GHXKKRXX-6KIGYUKQ.js.gz +0 -0
- package/dist/web/assets/message-response-BH1WLiOG.js +7 -0
- package/dist/web/assets/message-response-BH1WLiOG.js.br +0 -0
- package/dist/web/assets/message-response-BH1WLiOG.js.gz +0 -0
- package/dist/web/assets/{patch-diff-viewer-DHfvCO4S.js → patch-diff-viewer-BP7d9z00.js} +2 -2
- package/dist/web/assets/patch-diff-viewer-BP7d9z00.js.br +0 -0
- package/dist/web/assets/patch-diff-viewer-BP7d9z00.js.gz +0 -0
- package/dist/web/assets/{perl-Br95gH8g.js → perl-C4NAnH_t.js} +1 -1
- package/dist/web/assets/perl-C4NAnH_t.js.br +0 -0
- package/dist/web/assets/{perl-Br95gH8g.js.gz → perl-C4NAnH_t.js.gz} +0 -0
- package/dist/web/assets/{php-CYrBA5iX.js → php-CQT4wx5i.js} +1 -1
- package/dist/web/assets/php-CQT4wx5i.js.br +0 -0
- package/dist/web/assets/{php-CYrBA5iX.js.gz → php-CQT4wx5i.js.gz} +0 -0
- package/dist/web/assets/project-file-popup-page-BqEZEv1s.js +1 -0
- package/dist/web/assets/project-file-popup-page-BqEZEv1s.js.br +0 -0
- package/dist/web/assets/project-file-popup-page-BqEZEv1s.js.gz +0 -0
- package/dist/web/assets/project-source-panel-BkRa6eOs.js +3 -0
- package/dist/web/assets/project-source-panel-BkRa6eOs.js.br +0 -0
- package/dist/web/assets/project-source-panel-BkRa6eOs.js.gz +0 -0
- package/dist/web/assets/prompt-input-controls-5tCLhg2X.js +1 -0
- package/dist/web/assets/prompt-input-controls-5tCLhg2X.js.br +0 -0
- package/dist/web/assets/prompt-input-controls-5tCLhg2X.js.gz +0 -0
- package/dist/web/assets/prompt-reference-token-Dnq6GpIQ.js +1 -0
- package/dist/web/assets/prompt-reference-token-Dnq6GpIQ.js.br +3 -0
- package/dist/web/assets/prompt-reference-token-Dnq6GpIQ.js.gz +0 -0
- package/dist/web/assets/provider-connection-queries-BPczkhUT.js +1 -0
- package/dist/web/assets/provider-connection-queries-BPczkhUT.js.br +0 -0
- package/dist/web/assets/provider-connection-queries-BPczkhUT.js.gz +0 -0
- package/dist/web/assets/{ruby-CbXu8Ywv.js → ruby-Oh3ZbUP2.js} +1 -1
- package/dist/web/assets/ruby-Oh3ZbUP2.js.br +0 -0
- package/dist/web/assets/ruby-Oh3ZbUP2.js.gz +0 -0
- package/dist/web/assets/{shiki-bundle-CNYWcrCX.js → shiki-bundle-VSjMZiOC.js} +1 -1
- package/dist/web/assets/shiki-bundle-VSjMZiOC.js.br +0 -0
- package/dist/web/assets/shiki-bundle-VSjMZiOC.js.gz +0 -0
- package/dist/web/assets/swift-CyEgAFGc.js +1 -0
- package/dist/web/assets/swift-CyEgAFGc.js.br +0 -0
- package/dist/web/assets/swift-CyEgAFGc.js.gz +0 -0
- package/dist/web/assets/tooltip-jGsHGylL.js +1 -0
- package/dist/web/assets/tooltip-jGsHGylL.js.br +0 -0
- package/dist/web/assets/tooltip-jGsHGylL.js.gz +0 -0
- package/dist/web/assets/upload-D6X3pnK5.js +1 -0
- package/dist/web/assets/upload-D6X3pnK5.js.br +0 -0
- package/dist/web/assets/upload-D6X3pnK5.js.gz +0 -0
- package/dist/web/assets/useInfiniteQuery-Bs3l5hx7.js +1 -0
- package/dist/web/assets/useInfiniteQuery-Bs3l5hx7.js.br +0 -0
- package/dist/web/assets/useInfiniteQuery-Bs3l5hx7.js.gz +0 -0
- package/dist/web/assets/{vue-BpAUjojh.js → vue-BcFuTOIy.js} +1 -1
- package/dist/web/assets/vue-BcFuTOIy.js.br +0 -0
- package/dist/web/assets/vue-BcFuTOIy.js.gz +0 -0
- package/dist/web/assets/workbench-inspector-changes-BbHDvE9x.js +2 -0
- package/dist/web/assets/workbench-inspector-changes-BbHDvE9x.js.br +0 -0
- package/dist/web/assets/workbench-inspector-changes-BbHDvE9x.js.gz +0 -0
- package/dist/web/assets/workbench-pet-canvas-DRzsdZ1c.js +1 -0
- package/dist/web/assets/workbench-pet-canvas-DRzsdZ1c.js.br +0 -0
- package/dist/web/assets/workbench-pet-canvas-DRzsdZ1c.js.gz +0 -0
- package/dist/web/assets/workbench-shell-wnOOfeVI.js +15 -0
- package/dist/web/assets/workbench-shell-wnOOfeVI.js.br +0 -0
- package/dist/web/assets/workbench-shell-wnOOfeVI.js.gz +0 -0
- package/dist/web/index.html +12 -8
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/package.json +7 -10
- package/dist/web/assets/button-B0Zy5xUw.js +0 -1
- package/dist/web/assets/button-B0Zy5xUw.js.br +0 -0
- package/dist/web/assets/button-B0Zy5xUw.js.gz +0 -0
- package/dist/web/assets/button-group-Czp67RFV.js +0 -1
- package/dist/web/assets/button-group-Czp67RFV.js.br +0 -0
- package/dist/web/assets/button-group-Czp67RFV.js.gz +0 -0
- package/dist/web/assets/checkbox-J-dVFT8h.js +0 -1
- package/dist/web/assets/checkbox-J-dVFT8h.js.br +0 -0
- package/dist/web/assets/checkbox-J-dVFT8h.js.gz +0 -0
- package/dist/web/assets/chunk-BO2N2NFS-Cv0xdEIU.js.br +0 -0
- package/dist/web/assets/chunk-BO2N2NFS-Cv0xdEIU.js.gz +0 -0
- package/dist/web/assets/code-highlighter-XA2cEb7n.js.br +0 -0
- package/dist/web/assets/code-highlighter-XA2cEb7n.js.gz +0 -0
- package/dist/web/assets/code-languages-B1bG8xP9.js +0 -2
- package/dist/web/assets/code-languages-B1bG8xP9.js.br +0 -0
- package/dist/web/assets/code-languages-B1bG8xP9.js.gz +0 -0
- package/dist/web/assets/cpp-BcHBJY00.js +0 -1
- package/dist/web/assets/cpp-BcHBJY00.js.br +0 -0
- package/dist/web/assets/cpp-BcHBJY00.js.gz +0 -0
- package/dist/web/assets/cpp-CIkEvbIe.js +0 -1
- package/dist/web/assets/cpp-CIkEvbIe.js.br +0 -0
- package/dist/web/assets/cpp-CIkEvbIe.js.gz +0 -0
- package/dist/web/assets/engine-compile-DQ0HPfe0.js.br +0 -0
- package/dist/web/assets/engine-compile-DQ0HPfe0.js.gz +0 -0
- package/dist/web/assets/es2015-D1QRD4rq.js +0 -41
- package/dist/web/assets/es2015-D1QRD4rq.js.br +0 -0
- package/dist/web/assets/es2015-D1QRD4rq.js.gz +0 -0
- package/dist/web/assets/file-fDjkn3KE.js +0 -1
- package/dist/web/assets/file-fDjkn3KE.js.br +0 -2
- package/dist/web/assets/file-fDjkn3KE.js.gz +0 -0
- package/dist/web/assets/file-review-dialog-a4LVk4QA.js +0 -2
- package/dist/web/assets/file-review-dialog-a4LVk4QA.js.br +0 -0
- package/dist/web/assets/file-review-dialog-a4LVk4QA.js.gz +0 -0
- package/dist/web/assets/file-tree-Dh8mZi4H.js +0 -1
- package/dist/web/assets/file-tree-Dh8mZi4H.js.br +0 -0
- package/dist/web/assets/file-tree-Dh8mZi4H.js.gz +0 -0
- package/dist/web/assets/git-commit-horizontal-DqCudnTd.js +0 -1
- package/dist/web/assets/git-commit-horizontal-DqCudnTd.js.br +0 -0
- package/dist/web/assets/git-commit-horizontal-DqCudnTd.js.gz +0 -0
- package/dist/web/assets/git-history-panel-C0BqsVJw.js +0 -2
- package/dist/web/assets/git-history-panel-C0BqsVJw.js.br +0 -0
- package/dist/web/assets/git-history-panel-C0BqsVJw.js.gz +0 -0
- package/dist/web/assets/global-settings-dialog-DAk0qzab.js +0 -1
- package/dist/web/assets/global-settings-dialog-DAk0qzab.js.br +0 -0
- package/dist/web/assets/global-settings-dialog-DAk0qzab.js.gz +0 -0
- package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js +0 -1
- package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js.br +0 -0
- package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js.gz +0 -0
- package/dist/web/assets/highlighted-body-OFNGDK62-3Xd1uGCw.js.br +0 -0
- package/dist/web/assets/highlighted-body-OFNGDK62-3Xd1uGCw.js.gz +0 -0
- package/dist/web/assets/index-C9MtcGVc.js +0 -4
- package/dist/web/assets/index-C9MtcGVc.js.br +0 -0
- package/dist/web/assets/index-C9MtcGVc.js.gz +0 -0
- package/dist/web/assets/index-DAs_avwK.css +0 -2
- package/dist/web/assets/index-DAs_avwK.css.br +0 -0
- package/dist/web/assets/index-DAs_avwK.css.gz +0 -0
- package/dist/web/assets/lazy-message-response-BDqsH4Ww.js +0 -2
- package/dist/web/assets/lazy-message-response-BDqsH4Ww.js.br +0 -0
- package/dist/web/assets/lazy-message-response-BDqsH4Ww.js.gz +0 -0
- package/dist/web/assets/mermaid-GHXKKRXX-Cp6mRHuL.js +0 -1
- package/dist/web/assets/mermaid-GHXKKRXX-Cp6mRHuL.js.br +0 -0
- package/dist/web/assets/mermaid-GHXKKRXX-Cp6mRHuL.js.gz +0 -0
- package/dist/web/assets/message-response-DyFE9GSy.js +0 -7
- package/dist/web/assets/message-response-DyFE9GSy.js.br +0 -0
- package/dist/web/assets/message-response-DyFE9GSy.js.gz +0 -0
- package/dist/web/assets/patch-diff-viewer-DHfvCO4S.js.br +0 -0
- package/dist/web/assets/patch-diff-viewer-DHfvCO4S.js.gz +0 -0
- package/dist/web/assets/perl-Br95gH8g.js.br +0 -0
- package/dist/web/assets/php-CYrBA5iX.js.br +0 -0
- package/dist/web/assets/prompt-input-controls-CLj9lxlf.js +0 -1
- package/dist/web/assets/prompt-input-controls-CLj9lxlf.js.br +0 -0
- package/dist/web/assets/prompt-input-controls-CLj9lxlf.js.gz +0 -0
- package/dist/web/assets/prompt-reference-token-Cxx6C-IR.js +0 -1
- package/dist/web/assets/prompt-reference-token-Cxx6C-IR.js.br +0 -0
- package/dist/web/assets/prompt-reference-token-Cxx6C-IR.js.gz +0 -0
- package/dist/web/assets/provider-connection-queries-C2Fn0xx2.js +0 -1
- package/dist/web/assets/provider-connection-queries-C2Fn0xx2.js.br +0 -0
- package/dist/web/assets/provider-connection-queries-C2Fn0xx2.js.gz +0 -0
- package/dist/web/assets/ruby-CbXu8Ywv.js.br +0 -0
- package/dist/web/assets/ruby-CbXu8Ywv.js.gz +0 -0
- package/dist/web/assets/shiki-bundle-CNYWcrCX.js.br +0 -0
- package/dist/web/assets/shiki-bundle-CNYWcrCX.js.gz +0 -0
- package/dist/web/assets/swift-DonLKvLd.js +0 -1
- package/dist/web/assets/swift-DonLKvLd.js.br +0 -0
- package/dist/web/assets/swift-DonLKvLd.js.gz +0 -0
- package/dist/web/assets/vue-BpAUjojh.js.br +0 -0
- package/dist/web/assets/vue-BpAUjojh.js.gz +0 -0
- package/dist/web/assets/workbench-inspector-changes-fibkZGwp.js +0 -1
- package/dist/web/assets/workbench-inspector-changes-fibkZGwp.js.br +0 -0
- package/dist/web/assets/workbench-inspector-changes-fibkZGwp.js.gz +0 -0
- package/dist/web/assets/workbench-shell-eo1pFJFk.js +0 -13
- package/dist/web/assets/workbench-shell-eo1pFJFk.js.br +0 -0
- package/dist/web/assets/workbench-shell-eo1pFJFk.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,41 +0,0 @@
|
|
|
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-B0Zy5xUw.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`)&>(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)&<(e.parameters)&&e.parameters.every(e=>Hr(e))}function sr(e){return L(e,`Constructor`)&&e.type===`Constructor`&&I(e.$id)&<(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)&<(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`)&<(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)&>(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`)&<(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)&>(e.minItems)&>(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)&<(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)&>(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({command:K.String(),cwd:K.String(),exitCode:K.Optional(K.Integer()),id:K.String({minLength:1}),output:K.Optional(K.String()),outputTruncated:K.Boolean(),status:cf,type:K.Literal(`command`)},{additionalProperties:!1}),Mf=K.Object({command:K.String({minLength:1}),cwd:K.String({minLength:1}),id:K.String({minLength:1}),itemId:K.String({minLength:1})},{additionalProperties:!1}),Nf=K.Object({data:K.Array(Mf)},{additionalProperties:!1}),Pf=K.Object({status:K.Literal(`terminated`),terminalId:K.String({minLength:1})},{additionalProperties:!1}),Ff=K.Union([K.String(),K.Null()]),If=K.Union([K.Number(),K.Null()]),Lf={description:Ff,id:K.String({minLength:1}),required:K.Boolean(),title:K.String({minLength:1})},Rf=K.Object({label:K.String({minLength:1}),value:K.String()},{additionalProperties:!1}),zf=K.Union([K.Object({...Lf,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({...Lf,defaultValue:K.Union([K.String(),K.Null()]),options:K.Array(Rf,{minItems:1}),type:K.Literal(`select`)},{additionalProperties:!1}),K.Object({...Lf,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(Rf,{minItems:1}),type:K.Literal(`multi_select`)},{additionalProperties:!1}),K.Object({...Lf,defaultValue:If,maximum:If,minimum:If,type:K.Union([K.Literal(`number`),K.Literal(`integer`)])},{additionalProperties:!1}),K.Object({...Lf,defaultValue:K.Union([K.Boolean(),K.Null()]),type:K.Literal(`boolean`)},{additionalProperties:!1})]),Bf=K.Record(K.String(),K.Union([K.String(),K.Number(),K.Boolean(),K.Array(K.String())])),Vf=K.Union([K.Object({action:K.Literal(`accept`),content:Bf},{additionalProperties:!1}),K.Object({action:K.Union([K.Literal(`decline`),K.Literal(`cancel`)]),content:K.Null()},{additionalProperties:!1})]),Hf=K.Union([K.Literal(`pending`),K.Literal(`resolved`),K.Literal(`expired`)]),Uf=K.Union([K.Literal(`allow`),K.Literal(`allow_for_session`),K.Literal(`deny`)]),Wf=K.Object({host:K.String({minLength:1}),protocol:K.Union([K.Literal(`http`),K.Literal(`https`),K.Literal(`socks5Tcp`),K.Literal(`socks5Udp`)])},{additionalProperties:!1}),Gf={createdAt:Fd,expiresAt:Id,itemId:K.String({minLength:1}),projectId:K.String({minLength:1}),requestId:K.String({minLength:1}),status:Hf,taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},Kf={itemId:K.String({minLength:1}),projectId:K.String({minLength:1}),taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},qf=K.Object({description:K.String(),label:K.String({minLength:1})},{additionalProperties:!1}),Jf={header:K.String({minLength:1}),id:K.String({minLength:1}),isSecret:K.Boolean(),prompt:K.String({minLength:1})},Yf=K.Union([K.Object({...Jf,isOther:K.Boolean(),options:K.Array(qf,{minItems:1}),type:K.Literal(`choice`)},{additionalProperties:!1}),K.Object({...Jf,isOther:K.Literal(!0),options:K.Array(qf,{maxItems:0}),type:K.Literal(`choice`)},{additionalProperties:!1}),K.Object({...Jf,isOther:K.Literal(!1),options:K.Array(qf,{maxItems:2,minItems:2}),type:K.Literal(`confirmation`)},{additionalProperties:!1}),K.Object({...Jf,isOther:K.Boolean(),options:K.Array(qf,{maxItems:0}),type:K.Literal(`short_text`)},{additionalProperties:!1})]),Xf=K.Object({...Gf,availableDecisions:K.Array(Uf,{minItems:1}),grantRoot:K.Union([K.String(),K.Null()]),reason:K.Union([K.String(),K.Null()]),type:K.Literal(`file_change_approval`)},{additionalProperties:!1}),Zf=K.Union([K.Literal(`network`),K.Literal(`file_system`)]),Qf=K.Union([K.Literal(`read`),K.Literal(`write`),K.Literal(`deny`)]),$f=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})]),ep=K.Object({entries:K.Array(K.Object({access:Qf,path:$f},{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}),tp=K.Object({fileSystem:K.Union([ep,K.Null()]),network:K.Union([K.Object({enabled:K.Union([K.Boolean(),K.Null()])},{additionalProperties:!1}),K.Null()])},{additionalProperties:!1}),np=K.Object({...Gf,additionalPermissions:K.Optional(K.Union([tp,K.Null()])),availableDecisions:K.Array(Uf,{minItems:1}),command:K.Union([K.String(),K.Null()]),cwd:K.Union([K.String(),K.Null()]),networkAccess:K.Union([Wf,K.Null()]),reason:K.Union([K.String(),K.Null()]),type:K.Literal(`command_approval`)},{additionalProperties:!1}),rp=K.Object({...Gf,cwd:K.String({minLength:1}),environmentId:K.Union([K.String({minLength:1}),K.Null()]),permissions:tp,reason:K.Union([K.String(),K.Null()]),type:K.Literal(`permissions_approval`)},{additionalProperties:!1}),ip=K.Object({...Gf,questions:K.Array(Yf,{minItems:1,maxItems:3}),type:K.Literal(`user_input`)},{additionalProperties:!1}),ap={...Gf,message:K.String({minLength:1}),serverName:K.String({minLength:1}),type:K.Literal(`mcp_elicitation`)},op=K.Object({...ap,fields:K.Array(zf),mode:K.Literal(`form`)},{additionalProperties:!1}),sp=K.Object({...ap,mode:K.Literal(`url`),url:K.String({minLength:1})},{additionalProperties:!1}),cp=K.Object({...ap,mode:K.Literal(`unsupported`)},{additionalProperties:!1}),lp=K.Union([op,sp,cp]),up=K.Union([np,Xf,rp,ip,lp]);function dp(e){return K.Union([K.Object({...np.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...Xf.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...rp.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...ip.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...op.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})])}var fp=dp(`pending`),pp=dp(`resolved`),mp=dp(`expired`),hp=K.Object({decision:Uf},{additionalProperties:!1}),gp=K.Object({answers:K.Record(K.String(),K.Array(K.String({minLength:1}),{maxItems:1,minItems:1}))},{additionalProperties:!1}),_p=K.Object({grantedPermissions:K.Array(Zf,{maxItems:2,uniqueItems:!0}),scope:K.Union([K.Literal(`turn`),K.Literal(`session`)])},{additionalProperties:!1});K.Union([K.Object({...Kf,resolution:hp,type:K.Literal(`command_approval`)},{additionalProperties:!1}),K.Object({...Kf,resolution:hp,type:K.Literal(`file_change_approval`)},{additionalProperties:!1}),K.Object({...Kf,resolution:_p,type:K.Literal(`permissions_approval`)},{additionalProperties:!1}),K.Object({...Kf,resolution:gp,type:K.Literal(`user_input`)},{additionalProperties:!1}),K.Object({...Kf,resolution:Vf,type:K.Literal(`mcp_elicitation`)},{additionalProperties:!1})]);var vp=K.Object({request:up},{additionalProperties:!1}),yp=K.Object({diff:K.String(),kind:K.Union([K.Literal(`create`),K.Literal(`update`),K.Literal(`delete`)]),path:K.String({minLength:1})},{additionalProperties:!1}),bp=K.String({maxLength:64,minLength:64,pattern:`^[a-f0-9]{64}$`}),xp=K.String({maxLength:1024,minLength:1,pattern:`\\S`}),Sp=K.String({maxLength:1024,minLength:1,pattern:`^(?!\\.{1,2}$)(?!.*[\\u0000\\r\\n])[^/\\\\]+$`}),Cp=K.Array(Ld,{maxItems:500,minItems:1,uniqueItems:!0}),wp=K.String({maxLength:1e4,minLength:1,pattern:`\\S`}),Tp=K.Object({diff:K.String(),kind:K.Union([K.Literal(`create`),K.Literal(`update`),K.Literal(`delete`)]),path:Ld},{additionalProperties:!1}),Ep=K.Object({baseBranches:K.Array(K.String({minLength:1}),{uniqueItems:!0}),branch:K.Union([K.String({minLength:1}),K.Null()]),branches:K.Array(xp,{uniqueItems:!0}),repositoryMode:K.Union([K.Literal(`root`),K.Literal(`children`),K.Literal(`none`)]),snapshot:bp,staged:K.Array(Tp),unstaged:K.Array(Tp)},{additionalProperties:!1});K.Object({includeDiff:K.Optional(K.Boolean()),repository:K.Optional(Sp),rootPath:kd},{additionalProperties:!1});var Dp=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}),Op=K.String({maxLength:20,minLength:1,pattern:`^[0-9]+$`});K.Object({cursor:K.Optional(Op),repository:K.Optional(Ld),rootPath:kd},{additionalProperties:!1});var kp=K.Object({branch:K.Union([xp,K.Null()]),commits:K.Array(Dp,{maxItems:20}),nextCursor:K.Union([Op,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}),Ap=K.String({maxLength:64,minLength:40,pattern:`^[a-f0-9]+$`}),jp=K.String({maxLength:20,minLength:1,pattern:`^[0-9]+$`});K.Object({cursor:K.Optional(jp),repository:K.Optional(Ld),rootPath:kd,sha:Ap},{additionalProperties:!1});var Mp=K.Object({kind:K.Union([K.Literal(`create`),K.Literal(`update`),K.Literal(`delete`)]),path:Ld},{additionalProperties:!1}),Np=K.Object({files:K.Array(Mp,{maxItems:100}),nextCursor:K.Union([jp,K.Null()])},{additionalProperties:!1});K.Object({path:Ld,repository:K.Optional(Ld),rootPath:kd,sha:Ap},{additionalProperties:!1});var Pp=K.Object({diff:K.String({maxLength:512*1024}),truncated:K.Boolean()},{additionalProperties:!1});K.Object({branch:xp,expectedSnapshot:bp},{additionalProperties:!1}),K.Object({branch:xp,expectedSnapshot:bp},{additionalProperties:!1});var Fp=K.Object({branch:K.Union([xp,K.Null()]),current:K.Boolean(),path:Wd},{additionalProperties:!1}),Ip=K.Object({worktrees:K.Array(Fp,{maxItems:256})},{additionalProperties:!1});K.Object({branch:xp,expectedSnapshot:bp},{additionalProperties:!1}),K.Object({path:Wd},{additionalProperties:!1});var Lp=K.Object({project:Ud,worktree:Fp},{additionalProperties:!1});K.Object({expectedSnapshot:bp,paths:Cp,repository:K.Optional(Sp)},{additionalProperties:!1});var Rp=K.Object({message:wp,snapshot:bp},{additionalProperties:!1});K.Object({action:K.Union([K.Literal(`commit`),K.Literal(`commit_and_push`)]),expectedSnapshot:bp,message:wp,paths:Cp,repository:K.Optional(Sp)},{additionalProperties:!1});var zp=K.Object({branch:K.Union([K.String({minLength:1}),K.Null()]),commitSha:K.String({maxLength:64,minLength:7,pattern:`^[a-f0-9]+$`}),message:wp,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}),Bp=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 Vp=K.Object({entries:K.Array(Bp),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 Hp=K.Object({content:K.String(),nextCursor:K.Union([K.Integer({minimum:0}),K.Null()]),path:Hd},{additionalProperties:!1}),Up=K.Object({changes:K.Array(yp),id:K.String({minLength:1}),status:cf,type:K.Literal(`file_change`)},{additionalProperties:!1}),Wp=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}),Gp=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}),Kp=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}),qp=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}),Jp=K.Union([Gp,Kp,qp]),Yp=K.Object({id:K.String({minLength:1}),text:K.String(),type:K.Literal(`plan`)},{additionalProperties:!1}),Xp=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}),Zp=K.Union([K.Literal(`in_progress`),K.Literal(`approved`),K.Literal(`denied`),K.Literal(`timed_out`),K.Literal(`aborted`)]),Qp=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}),$p=K.Object({action:Qp,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:Zp,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}),em=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})]),tm=K.Object({id:K.String({minLength:1}),target:em,type:K.Literal(`review`)},{additionalProperties:!1}),nm=K.Union([kf,Af,jf,Up,Wp,Yp,Xp,$p,tm,Jp]),rm=K.Union([K.Literal(`running`),K.Literal(`completed`),K.Literal(`failed`),K.Literal(`interrupted`)]),im=K.Object({completedAt:Id,error:K.Union([K.String(),K.Null()]),id:K.String({minLength:1}),items:K.Array(nm),startedAt:Id,status:rm},{additionalProperties:!1}),am=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}),om=K.Object({attachment:am},{additionalProperties:!1}),sm=K.Union([K.Literal(`user`),K.Literal(`repo`),K.Literal(`system`),K.Literal(`admin`)]),cm=K.Object({description:K.String(),displayName:K.String({minLength:1}),id:K.String({minLength:1}),name:K.String({minLength:1}),scope:sm},{additionalProperties:!1}),lm=K.Union([K.Literal(`starting`),K.Literal(`ready`),K.Literal(`failed`),K.Literal(`cancelled`)]),um=K.Union([K.Literal(`unknown`),K.Literal(`unsupported`),K.Literal(`notLoggedIn`),K.Literal(`bearerToken`),K.Literal(`oAuth`)]),dm=K.Literal(`reauthenticationRequired`),fm=K.Object({authStatus:K.Union([um,K.Null()]),description:K.Union([K.String(),K.Null()]),error:K.Union([K.String({maxLength:8192}),K.Null()]),failureReason:K.Union([dm,K.Null()]),name:K.String({minLength:1}),status:lm,title:K.Union([K.String(),K.Null()]),toolCount:K.Integer({minimum:0}),version:K.Union([K.String(),K.Null()])},{additionalProperties:!1}),pm=K.Object({data:K.Array(fm,{uniqueItems:!0})},{additionalProperties:!1}),mm=K.Object({id:K.String({minLength:1}),name:K.String({minLength:1})},{additionalProperties:!1}),hm=K.Object({id:K.String({minLength:1})},{additionalProperties:!1}),gm={attachments:K.Array(hm),skills:K.Array(mm),text:K.String({maxLength:1e5}),type:K.Literal(`prompt`)},_m=K.Union([K.Object({...gm,text:K.String({maxLength:1e5,minLength:1})},{additionalProperties:!1}),K.Object({...gm,attachments:K.Array(hm,{minItems:1})},{additionalProperties:!1}),K.Object({...gm,skills:K.Array(mm,{minItems:1})},{additionalProperties:!1})]),vm=K.Object({attachments:K.Array(Ef,{maxItems:gf}),clientUserMessageId:K.String({minLength:1}),id:K.String({minLength:1}),skills:K.Array(mm),text:K.String({maxLength:1e5})},{additionalProperties:!1}),ym=K.Object({data:K.Array(vm),nextCursor:K.Union([K.String({minLength:1}),K.Null()])},{additionalProperties:!1}),bm=K.Union([K.Literal(`active`),K.Literal(`paused`),K.Literal(`blocked`),K.Literal(`usage_limited`),K.Literal(`budget_limited`),K.Literal(`complete`)]),xm=K.Object({createdAt:Fd,objective:K.String({maxLength:4e3,minLength:1}),status:bm,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 Sm=K.Object({goal:xm},{additionalProperties:!1}),Cm=K.Object({cleared:K.Boolean()},{additionalProperties:!1}),wm=`gpt-5.6-luna`,Tm=K.Object({mcp_elicitations:K.Boolean(),request_permissions:K.Boolean(),rules:K.Boolean(),sandbox_approval:K.Boolean(),skill_approval:K.Boolean()},{additionalProperties:!1}),Em=K.Object({granular:Tm},{additionalProperties:!1}),Dm=K.Union([K.Literal(`on-request`),Em,K.Literal(`never`)]),Om=K.Union([K.Literal(`untrusted`),K.Literal(`on-request`),Em,K.Literal(`never`)]),km=K.Union([K.Literal(`user`),K.Literal(`auto_review`)]),Am=K.Union([K.Literal(`read-only`),K.Literal(`workspace-write`),K.Literal(`danger-full-access`)]),jm={model:K.String({minLength:1}),reasoningEffort:K.String({minLength:1}),sandboxMode:Am},Mm=K.Object({approvalPolicy:Om,approvalsReviewer:km,...jm},{additionalProperties:!1}),Nm=K.Literal(`plan`),Pm={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`)]),...jm},Fm=K.Object({approvalPolicy:Dm,approvalsReviewer:km,...Pm},{additionalProperties:!1}),Im=K.Object({settings:Fm},{additionalProperties:!1}),Lm=K.Object({approvalPolicy:Om,approvalsReviewer:km,fastMode:K.Boolean(),...jm},{additionalProperties:!1}),Rm=K.Object({settings:Lm},{additionalProperties:!1}),zm=K.Object({settings:Mm},{additionalProperties:!1}),Bm={collaborationMode:K.Optional(Nm),fastMode:K.Optional(K.Literal(!0)),goalMode:K.Optional(K.Literal(!0)),...jm},Vm=K.Object({approvalPolicy:Om,approvalsReviewer:km,...Bm},{additionalProperties:!1}),Hm=K.Object({description:K.String(),id:K.String({minLength:1})},{additionalProperties:!1}),Um=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(Hm,{minItems:1})},{additionalProperties:!1}),Wm=K.Object({contextWindow:K.Union([K.Integer({minimum:1}),K.Null()]),usedTokens:K.Integer({minimum:0})},{additionalProperties:!1}),Gm=`temporary`,Km=`/v1/temporary`,qm=K.Union([K.Literal(`pending`),K.Literal(`in_progress`),K.Literal(`completed`)]),Jm=K.Object({status:qm,text:K.String({minLength:1})},{additionalProperties:!1}),Ym=K.Object({explanation:K.Union([K.String(),K.Null()]),steps:K.Array(Jm)},{additionalProperties:!1}),Xm=K.Object({contextUsage:K.Union([Wm,K.Null()]),goal:K.Union([xm,K.Null()]),id:K.String({minLength:1}),plan:K.Union([Ym,K.Null()]),pendingRequests:K.Array(fp),pinned:K.Boolean(),projectId:K.String({minLength:1}),settings:Mm,status:K.Union([K.Literal(`idle`),K.Literal(`running`),K.Literal(`failed`)]),title:K.String({minLength:1}),turns:K.Array(im),turnsNextCursor:K.Union([K.String({minLength:1}),K.Null()]),updatedAt:Fd},{additionalProperties:!1});function Zm(e){return K.Object({data:K.Array(e),nextCursor:K.Union([K.String(),K.Null()])},{additionalProperties:!1})}var Qm=Zm(Ud),$m=Qm,eh=Zm(sf),th=Zm(Um),nh=Zm(cm),rh=K.Object({status:K.Literal(`ok`),version:K.Literal(1)},{additionalProperties:!1}),ih=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}),ah=K.Union([K.Literal(`official`),K.Literal(`custom`)]),oh=K.Union([K.Literal(`disconnected`),K.Literal(`pending`),K.Literal(`connected`),K.Literal(`failed`)]),sh=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})]),ch=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}),lh=K.Object({account:K.Union([sh,K.Null()]),customBaseUrl:K.Union([K.String({maxLength:2048,minLength:1}),K.Null()]),mode:ah,pendingLogin:K.Union([ch,K.Null()]),state:oh},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var uh=K.Object({authUrl:K.String({maxLength:8192,minLength:1}),loginId:K.String({maxLength:256,minLength:1}),status:lh},{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 dh=K.Object({models:th,status:lh},{additionalProperties:!1});K.Object({loginId:K.String({maxLength:256,minLength:1})},{additionalProperties:!1});var fh=K.Object({status:lh},{additionalProperties:!1});K.Object({customBaseUrl:K.Union([K.String({maxLength:2048,minLength:1}),K.Null()]),customModels:K.Union([th,K.Null()]),mode:ah,updatedAt:Fd},{additionalProperties:!1});function ph(e){return e.mode===`official`&&e.state===`connected`&&e.account?.type===`chatgpt`}K.Object({},{additionalProperties:!1});var mh=K.Object({task:sf},{additionalProperties:!1});K.Object({pinned:K.Boolean()},{additionalProperties:!1});var hh=K.Object({task:sf},{additionalProperties:!1});K.Object({title:K.String({maxLength:200,minLength:1,pattern:`\\S`})},{additionalProperties:!1});var gh=K.Object({task:sf},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var _h=K.Object({status:K.Literal(`archived`),taskId:K.String({minLength:1})},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var vh=K.Object({task:sf},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var yh=K.Object({status:K.Literal(`deleted`),taskId:K.String({minLength:1})},{additionalProperties:!1}),bh=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 xh=K.Object({taskId:K.String({minLength:1}),turn:im},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var Sh=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 Ch=K.Object({task:sf},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var wh=pm;K.Object({classification:K.String({maxLength:100,minLength:1}),includeLogs:K.Boolean(),reason:K.String({maxLength:4e3,minLength:1})},{additionalProperties:!1});var Th=K.Object({status:K.Literal(`sent`),taskId:K.String({minLength:1})},{additionalProperties:!1});K.Object({input:_m,options:Vm},{additionalProperties:!1});var Eh=K.Object({taskId:K.String({minLength:1}),turn:im},{additionalProperties:!1});K.Object({input:_m,taskId:K.String({minLength:1})},{additionalProperties:!1});var Dh=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:_m},{additionalProperties:!1});var Oh=K.Object({queuedSubmission:vm},{additionalProperties:!1});K.Object({input:_m},{additionalProperties:!1});var kh=Oh,Ah=K.Object({deleted:K.Boolean()},{additionalProperties:!1});K.Object({queuedSubmissionIds:K.Array(K.String({minLength:1}),{uniqueItems:!0})},{additionalProperties:!1});var jh=K.Object({status:K.Literal(`reordered`)},{additionalProperties:!1});K.Object({queuedSubmissionId:K.Optional(K.String({minLength:1}))},{additionalProperties:!1});var Mh=K.Object({taskId:K.String({minLength:1}),turn:im},{additionalProperties:!1});K.Object({taskId:K.String({minLength:1})},{additionalProperties:!1});var Nh=K.Object({status:K.Literal(`interrupting`),taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},{additionalProperties:!1}),Ph=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`)]),Fh=K.Object({code:Ph,message:K.String({minLength:1}),retryable:K.Boolean()},{additionalProperties:!1}),Ih=K.String({minLength:1}),Lh=K.Integer({minimum:0}),Rh=K.String({format:`date-time`}),zh={originalByteLength:K.Integer({minimum:0}),truncated:K.Boolean()},Bh={provider:K.String({minLength:1}),sequence:Lh,sessionId:Ih,taskId:K.String({minLength:1}),timestamp:Rh,version:K.Literal(2)};function q(e){return K.Object({...Bh,...e},{additionalProperties:!1})}var Vh=q({payload:K.Object({turn:im},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`turn.started`)}),Hh=q({itemId:K.String({minLength:1}),payload:K.Object({delta:K.String()},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`message.delta`)}),Uh=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`)}),Wh=q({itemId:K.String({minLength:1}),payload:K.Object({delta:K.String()},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`plan.delta`)}),Gh=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`)}),Kh=q({itemId:K.String({minLength:1}),payload:K.Object({changes:K.Array(yp,{maxItems:100}),...zh},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`file_change.updated`)}),qh=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`)}),Jh=q({payload:K.Object({error:K.Union([K.String({maxLength:8192}),K.Null()]),failureReason:K.Union([dm,K.Null()]),name:K.String({minLength:1}),status:lm},{additionalProperties:!1}),type:K.Literal(`mcp_server.status_updated`)}),Yh=q({payload:K.Object({status:K.Union([K.Literal(`idle`),K.Literal(`running`),K.Literal(`failed`)])},{additionalProperties:!1}),type:K.Literal(`task.status_updated`)}),Xh=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`task.metadata_changed`)}),Zh=q({payload:K.Object({reason:K.Union([K.Literal(`archived`),K.Literal(`deleted`)])},{additionalProperties:!1}),type:K.Literal(`task.removed`)}),Qh=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`skills.changed`)}),$h=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`queue.changed`)}),eg=q({payload:K.Object({rootPath:K.String({minLength:1})},{additionalProperties:!1}),type:K.Literal(`project.git_metadata_changed`)}),tg=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`)}),ng=q({itemId:K.String({minLength:1}),payload:K.Object({item:nm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`item.completed`)}),rg=q({itemId:K.String({minLength:1}),payload:K.Object({item:nm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`item.started`)}),ig=q({payload:K.Object({turn:im},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`turn.completed`)}),ag=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`)}),og=q({payload:K.Object({usage:Wm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`usage.updated`)}),sg=q({payload:K.Object({plan:Ym},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`plan.updated`)}),cg=q({payload:K.Object({goal:xm},{additionalProperties:!1}),type:K.Literal(`goal.updated`)}),lg=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`goal.cleared`)});function ug(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 dg=ug(`pending_request.created`,fp),fg=ug(`pending_request.resolved`,pp),pg=ug(`pending_request.expired`,mp),mg=K.Union([Vh,Hh,Uh,tg,Wh,Gh,Kh,rg,ng,ig,og,sg,cg,lg,ag,qh,Jh,Yh,Xh,Zh,Qh,$h,eg,dg,fg,pg]),hg=K.Object({events:K.Array(mg,{maxItems:64,minItems:1}),type:K.Literal(`events.batch`),version:K.Literal(3)},{additionalProperties:!1}),gg=K.Object({latestSequence:Lh,sessionId:Ih,type:K.Literal(`connection.ready`),version:K.Literal(3)},{additionalProperties:!1}),_g=K.Object({latestSequence:Lh,reason:K.Union([K.Literal(`event_retention_exceeded`),K.Literal(`session_changed`),K.Literal(`sequence_gap`)]),sessionId:Ih,type:K.Literal(`resync.required`),version:K.Literal(3)},{additionalProperties:!1}),vg=K.Union([gg,_g,hg]),yg=K.Object({sequence:Lh,sessionId:Ih},{additionalProperties:!1}),bg=K.Object({checkpoint:yg,snapshot:Xm},{additionalProperties:!1}),xg=class extends Zt{constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function Sg(e,t){let n=t.find(t=>t.$id===e.$ref);if(n===void 0)throw new xg(e);return wg(n,t)}function Cg(e,t){return!Vt(e.$id)||t.some(t=>t.$id===e.$id)||t.push(e),t}function wg(e,t){return e[M]===`This`||e[M]===`Ref`?Sg(e,t):e}var Tg=class extends Zt{constructor(e){super(`Unable to hash value`),this.value=e}},Eg;(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`})(Eg||={});var Dg=BigInt(`14695981039346656037`),[Og,kg]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],Ag=Array.from({length:256}).map((e,t)=>BigInt(t)),jg=new Float64Array(1),Mg=new DataView(jg.buffer),Ng=new Uint8Array(jg.buffer);function*Pg(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 Fg(e){qg(Eg.Array);for(let t of e)Kg(t)}function Ig(e){qg(Eg.Boolean),qg(+!!e)}function Lg(e){qg(Eg.BigInt),Mg.setBigInt64(0,e);for(let e of Ng)qg(e)}function Rg(e){qg(Eg.Date),Kg(e.getTime())}function zg(e){qg(Eg.Null)}function Bg(e){qg(Eg.Number),Mg.setFloat64(0,e);for(let e of Ng)qg(e)}function Vg(e){qg(Eg.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Kg(t),Kg(e[t])}function Hg(e){qg(Eg.String);for(let t=0;t<e.length;t++)for(let n of Pg(e.charCodeAt(t)))qg(n)}function Ug(e){qg(Eg.Symbol),Kg(e.description)}function Wg(e){qg(Eg.Uint8Array);for(let t=0;t<e.length;t++)qg(e[t])}function Gg(e){return qg(Eg.Undefined)}function Kg(e){if(Pt(e))return Fg(e);if(Lt(e))return Ig(e);if(Bt(e))return Lg(e);if(jt(e))return Rg(e);if(It(e))return zg(e);if(Rt(e))return Bg(e);if(Nt(e))return Vg(e);if(Vt(e))return Hg(e);if(Ut(e))return Ug(e);if(Mt(e))return Wg(e);if(Ft(e))return Gg(e);throw new Tg(e)}function qg(e){Dg^=Ag[e],Dg=Dg*Og%kg}function Jg(e){return Dg=BigInt(`14695981039346656037`),Kg(e),Dg}var Yg=class extends Zt{constructor(e){super(`Unknown type`),this.schema=e}};function Xg(e){return e[M]===`Any`||e[M]===`Unknown`}function J(e){return e!==void 0}function Zg(e,t,n){return!0}function Qg(e,t,n){return!0}function $g(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=Jg(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 e_(e,t,n){return Ot(n)}function t_(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 n_(e,t,n){return Lt(n)}function r_(e,t,n){return Y(e.returns,t,n.prototype)}function i_(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 a_(e,t,n){return Ht(n)}function o_(e,t,n){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Y(i,[...t,...r],n)}function s_(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 c_(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 l_(e,t,n){return kt(n)}function u_(e,t,n){return n===e.const}function d_(e,t,n){return!1}function f_(e,t,n){return!Y(e.not,t,n)}function p_(e,t,n){return It(n)}function m_(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 h_(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)||Xg(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 g_(e,t,n){return At(n)}function __(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 v_(e,t,n){return Y(wg(e,t),t,n)}function y_(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 b_(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 x_(e,t,n){return Ut(n)}function S_(e,t,n){return Vt(n)&&new RegExp(e.pattern).test(n)}function C_(e,t,n){return Y(wg(e,t),t,n)}function w_(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 T_(e,t,n){return Ft(n)}function E_(e,t,n){return e.anyOf.some(e=>Y(e,t,n))}function D_(e,t,n){return!(!Mt(n)||J(e.maxByteLength)&&!(n.length<=e.maxByteLength)||J(e.minByteLength)&&!(n.length>=e.minByteLength))}function O_(e,t,n){return!0}function k_(e,t,n){return Wt.IsVoidLike(n)}function A_(e,t,n){return ti(e[M])?ni(e[M])(e,n):!1}function Y(e,t,n){let r=J(e.$id)?Cg(e,t):t,i=e;switch(i[M]){case`Any`:return Zg(i,r,n);case`Argument`:return Qg(i,r,n);case`Array`:return $g(i,r,n);case`AsyncIterator`:return e_(i,r,n);case`BigInt`:return t_(i,r,n);case`Boolean`:return n_(i,r,n);case`Constructor`:return r_(i,r,n);case`Date`:return i_(i,r,n);case`Function`:return a_(i,r,n);case`Import`:return o_(i,r,n);case`Integer`:return s_(i,r,n);case`Intersect`:return c_(i,r,n);case`Iterator`:return l_(i,r,n);case`Literal`:return u_(i,r,n);case`Never`:return d_(i,r,n);case`Not`:return f_(i,r,n);case`Null`:return p_(i,r,n);case`Number`:return m_(i,r,n);case`Object`:return h_(i,r,n);case`Promise`:return g_(i,r,n);case`Record`:return __(i,r,n);case`Ref`:return v_(i,r,n);case`RegExp`:return y_(i,r,n);case`String`:return b_(i,r,n);case`Symbol`:return x_(i,r,n);case`TemplateLiteral`:return S_(i,r,n);case`This`:return C_(i,r,n);case`Tuple`:return w_(i,r,n);case`Undefined`:return T_(i,r,n);case`Union`:return E_(i,r,n);case`Uint8Array`:return D_(i,r,n);case`Unknown`:return O_(i,r,n);case`Void`:return k_(i,r,n);default:if(!ti(i[M]))throw new Yg(i);return A_(i,r,n)}}function j_(...e){return e.length===3?Y(e[0],e[1],e[2]):Y(e[0],[],e[1])}var M_=class extends Error{constructor(e,t){super(e,t),this.name=`CodexlyEventError`}};function N_(e,t,n){let r=t===`temporary`?`${Km}/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 P_(e,t,n){return{latestSequence:t,reason:n,sessionId:e,type:`resync.required`,version:3}}function F_(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 M_(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(N_(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(!j_(vg,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(P_(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(P_(t.sessionId,t.sequence,`session_changed`));return}if(!(t.sequence<=i)){if(t.sequence!==i+1){d(P_(t.sessionId,t.sequence,`sequence_gap`));return}if(i=t.sequence,e.onEvent(t),!h())return}}},_=()=>{!n||s!==m||e.onError?.(new M_(`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 I_=[];for(let e=0;e<256;++e)I_.push((e+256).toString(16).slice(1));function L_(e,t=0){return(I_[e[t+0]]+I_[e[t+1]]+I_[e[t+2]]+I_[e[t+3]]+`-`+I_[e[t+4]]+I_[e[t+5]]+`-`+I_[e[t+6]]+I_[e[t+7]]+`-`+I_[e[t+8]]+I_[e[t+9]]+`-`+I_[e[t+10]]+I_[e[t+11]]+I_[e[t+12]]+I_[e[t+13]]+I_[e[t+14]]+I_[e[t+15]]).toLowerCase()}var R_=new Uint8Array(16);function z_(){return crypto.getRandomValues(R_)}function B_(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():V_(e,t,n)}function V_(e,t,n){e||={};let r=e.random??e.rng?.()??z_();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 L_(r)}var H_=15e4,U_=class extends Error{status;constructor(e,t,n){super(n??`Codexly request failed with ${String(e)} ${t}`.trim()),this.name=`CodexlyHttpError`,this.status=e}},W_=class extends U_{code;retryable;constructor(e,t,n){super(e,t,n.message),this.name=`CodexlyMutationError`,this.code=n.code,this.retryable=n.retryable}},G_=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`?Km:`/v1/projects/${encodeURIComponent(e)}`}function Q(e,t){return`${Z(e)}/tasks/${encodeURIComponent(t)}`}function K_(e,t,n,r){return`${e.replace(/\/$/u,``)}${Q(t,n)}/attachments/${encodeURIComponent(r)}`}function q_(e,t,n,r){let i=X(`${Z(t)}/files/image`,{path:n,rootPath:r});return`${e.replace(/\/$/u,``)}${i}`}function J_(e,t,n){return`${e.replace(/\/$/u,``)}${Z(t)}/attachments/${encodeURIComponent(n)}`}var Y_=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`,rh,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`,H_)}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`},Fh,{timeoutMs:this.requestTimeouts.mutationMs})}async logoutAccess(){return this.request(`/v1/access/logout`,Od,{body:`{}`,headers:{"content-type":`application/json`},method:`POST`},Fh,{timeoutMs:this.requestTimeouts.mutationMs})}subscribeUnauthorized(e){return this.unauthorizedListeners.add(e),()=>this.unauthorizedListeners.delete(e)}async getCapabilities(e={}){return this.read(`/v1/capabilities`,ih,e)}async listModels(e={}){return this.read(`/v1/models`,th,e)}async getProviderConnection(e={}){return this.read(`/v1/provider-connection`,lh,e)}async startOfficialProviderLogin(e={}){return this.mutation(`/v1/provider-connection/official-login`,{},uh,e)}async cancelProviderLogin(e,t={}){return this.mutation(`/v1/provider-connection/official-login/cancel`,{loginId:e},fh,t)}async configureCustomProvider(e,t={}){return this.mutation(`/v1/provider-connection/custom`,e,dh,t,`PUT`)}async logoutProvider(e={}){return this.mutation(`/v1/provider-connection/logout`,{},fh,e)}async getGlobalSettings(e={}){return this.read(`/v1/settings`,Im,e)}async updateGlobalSettings(e,t={}){return this.mutation(`/v1/settings`,e,Im,t,`PUT`)}subscribeEvents(e){return F_({...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??B_()},method:i},Fh,{...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 G_(`Codexly error response is not valid JSON`,{cause:e})}throw j_(r,e)?new W_(s.status,s.statusText,e):new G_(`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 U_(s.status,s.statusText,e.message)}catch(e){if(e instanceof U_)throw e}throw new U_(s.status,s.statusText)}let c;try{c=await s.json()}catch(e){throw new G_(`Codexly response is not valid JSON`,{cause:e})}if(!j_(t,c))throw new G_(`Codexly response does not match the protocol schema`);return c}},X_=class extends Y_{async listSkills(e,t={}){return this.read(`${Z(e)}/skills`,nh,t)}async listMcpServers(e,t,n={}){return this.read(`${Q(e,t)}/mcp-servers`,pm,n,Fh)}async retryMcpServers(e,t,n={}){return this.mutation(`${Q(e,t)}/mcp-servers/retry`,{},wh,n)}async listProjects(e={}){return this.read(`/v1/projects`,Qm,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},$m,t,`PUT`)}async getProjectDefaults(e,t={}){return this.read(`${Z(e)}/defaults`,Rm,t)}async updateProjectDefaults(e,t,n={}){return this.mutation(`${Z(e)}/defaults`,t,Rm,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}),Ep,n)}async getProjectGitHistory(e,t,n={}){return this.read(X(`${Z(e)}/git/history`,{cursor:t.cursor,repository:t.repository,rootPath:t.rootPath}),kp,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}),Np,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}),Pp,n)}async switchProjectBranch(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/branch`,{rootPath:t}),n,Ep,r)}async createProjectBranch(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/branches`,{rootPath:t}),n,Ep,r)}async listProjectWorktrees(e,t,n={}){return this.read(X(`${Z(e)}/git/worktrees`,{rootPath:t}),Ip,n)}async createProjectWorktree(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/worktrees`,{rootPath:t}),n,Lp,r)}async switchProjectWorktree(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/worktree`,{rootPath:t}),n,Lp,r)}async generateCommitMessage(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/commit-message`,{rootPath:t}),n,Rp,r)}async commitProjectChanges(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/commits`,{rootPath:t}),n,zp,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,Vp,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,Hp,i)}},Z_=class extends X_{async archiveTask(e,t,n={}){return this.mutation(`${Q(e,t)}/archive`,{},_h,n)}async unarchiveTask(e,t,n={}){return this.mutation(`${Q(e,t)}/unarchive`,{},vh,n)}async deleteTask(e,t,n={}){return this.mutation(Q(e,t),{},yh,n,`DELETE`)}},Q_=class extends Z_{async updateTaskGoal(e,t,n,r={}){return this.mutation(`${Q(e,t)}/goal`,n,Sm,r,`PUT`)}async clearTaskGoal(e,t,n={}){return this.mutation(`${Q(e,t)}/goal`,{},Cm,n,`DELETE`)}},$_=class extends Q_{async listQueuedSubmissions(e,t,n={},r={}){return this.read(X(`${Q(e,t)}/queue`,n),ym,r)}async addQueuedSubmission(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/queue`,{clientUserMessageId:r,input:n},Oh,i)}async updateQueuedSubmission(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/queue/${encodeURIComponent(n)}`,{input:r},kh,i,`PUT`)}async deleteQueuedSubmission(e,t,n,r={}){return this.mutation(`${Q(e,t)}/queue/${encodeURIComponent(n)}`,{},Ah,r,`DELETE`)}async reorderQueuedSubmissions(e,t,n,r={}){return this.mutation(`${Q(e,t)}/queue/reorder`,{queuedSubmissionIds:n},jh,r,`PUT`)}async startQueuedSubmission(e,t,n,r={}){return this.mutation(`${Q(e,t)}/queue/start`,{...n===void 0?{}:{queuedSubmissionId:n}},Mh,r)}async listTasks(e,t={},n={}){let r=X(`${Z(e)}/tasks`,t);return this.read(r,eh,n)}async readTask(e,t,n={}){let{cursor:r,...i}=n;return this.read(X(Q(e,t),{cursor:r}),bg,i)}getTaskAttachmentUrl(e,t,n){return K_(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`,Nf,n)}async terminateBackgroundTerminal(e,t,n,r={}){return this.mutation(`${Q(e,t)}/background-terminals/${encodeURIComponent(n)}/terminate`,{},Pf,r)}async getTaskSettings(e,t,n={}){return this.read(`${Q(e,t)}/settings`,zm,n)}async updateTaskSettings(e,t,n,r={}){return this.mutation(`${Q(e,t)}/settings`,n,zm,r,`PUT`)}async startTask(e,t={}){return this.mutation(`${Z(e)}/tasks`,{},mh,t)}async pinTask(e,t,n,r={}){return this.mutation(`${Q(e,t)}/pin`,{pinned:n},hh,r,`PUT`)}async renameTask(e,t,n,r={}){return this.mutation(`${Q(e,t)}/rename`,{title:n},gh,r)}async unsubscribeTask(e,t){return this.request(`${Q(e,t)}/unsubscribe`,bh,{body:`{}`,headers:{"content-type":`application/json`},method:`POST`})}async startReview(e,t,n,r={}){return this.mutation(`${Q(e,t)}/review`,n,xh,r)}async compactTask(e,t,n={}){return this.mutation(`${Q(e,t)}/compact`,{},Sh,n)}async forkTask(e,t,n,r={}){return this.mutation(`${Q(e,t)}/fork`,n,Ch,r)}async uploadFeedback(e,t,n,r={}){return this.mutation(`${Q(e,t)}/feedback`,n,Th,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}`,om,{body:r,headers:{"idempotency-key":n.idempotencyKey??B_()},method:`POST`},Fh,{...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},om,r)}async startTurn(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/turns`,{input:n,options:r},Eh,i)}async steerTurn(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/turns/${encodeURIComponent(n)}/steer`,{input:r,taskId:t},Dh,i)}async interruptTurn(e,t,n,r={}){return this.mutation(`${Q(e,t)}/turns/${encodeURIComponent(n)}/interrupt`,{taskId:t},Nh,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,vp,n)}},ev=class extends $_{},tv=`pinned`,nv=`search-source`,rv=3e4;function iv(e,t){return[`projects`,e,`tasks`,t,`queue`]}var av=new ev,ov=l(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),sv=l(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),cv=Object.defineProperty,lv=(e,t)=>cv(e,`name`,{value:t,configurable:!0}),uv=!!(typeof window<`u`&&window.document&&window.document.createElement);function dv(e,t,{checkForDefaultPrevented:n=!0}={}){return lv(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}lv(dv,`composeEventHandlers`);function fv(e){if(!uv)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}lv(fv,`getOwnerWindow`);function pv(e){if(!uv)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}lv(pv,`getOwnerDocument`);function mv(e,t=!1){let{activeElement:n}=pv(e);if(!n?.nodeName)return null;if(hv(n)&&n.contentDocument)return mv(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=pv(n).getElementById(e);if(t)return t}}return n}lv(mv,`getActiveElement`);function hv(e){return e.tagName===`IFRAME`}lv(hv,`isFrame`);var gv=Object.defineProperty,_v=(e,t)=>gv(e,`name`,{value:t,configurable:!0});function vv(e,t){let n=E.createContext(t);n.displayName=e+`Context`;let r=_v(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 _v(i,`useContext`),[r,i]}_v(vv,`createContext`);function yv(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=_v(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 _v(s,`useContext`),[o,s]}_v(r,`createContext`);let i=_v(()=>{let t=n.map(e=>E.createContext(e));return _v(function(n){let r=n?.[e]||t;return E.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,bv(i,...t)]}_v(yv,`createContextScope`);function bv(...e){let t=e[0];if(e.length===1)return t;let n=_v(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return _v(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}_v(bv,`composeContextScopes`);var xv=t(r(),1),Sv=Object.defineProperty,Cv=(e,t)=>Sv(e,`name`,{value:t,configurable:!0}),wv=[`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 Tv(e,t){e&&xv.flushSync(()=>e.dispatchEvent(t))}Cv(Tv,`dispatchDiscreteCustomEvent`);var Ev=Object.defineProperty,Dv=(e,t)=>Ev(e,`name`,{value:t,configurable:!0});function Ov(e){let t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>((...e)=>t.current?.(...e)),[])}Dv(Ov,`useCallbackRef`);var kv=Object.defineProperty,$=(e,t)=>kv(e,`name`,{value:t,configurable:!0}),Av=`dismissableLayer.update`,jv=`dismissableLayer.pointerDownOutside`,Mv=`dismissableLayer.focusOutside`,Nv,Pv=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Fv=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(Pv),[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=Rv(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=zv(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=Ov(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&&(Nv=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Bv(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Nv))}},[f,m,n,d]),E.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Bv())},[f,d]),E.useEffect(()=>{let e=$(()=>h({}),`handleUpdate`);return document.addEventListener(Av,e),()=>document.removeEventListener(Av,e)},[]),(0,D.jsx)(wv.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:dv(e.onFocusCapture,w.onFocusCapture),onBlurCapture:dv(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:dv(e.onPointerDownCapture,ee.onPointerDownCapture)})},`DismissableLayer`));function Iv(){let e=E.useContext(Pv),[t,n]=E.useState(null);return E.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}$(Iv,`useDismissableLayerSurface`);var Lv=$(()=>!0,`IS_TRUE`);function Rv(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Lv}=t,s=Ov(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||Vv(jv,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`)}}$(Rv,`usePointerDownOutside`);function zv(e,t=globalThis?.document){let n=Ov(e),r=E.useRef(!1);return E.useEffect(()=>{let e=$(e=>{e.target&&!r.current&&Vv(Mv,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`)}}$(zv,`useFocusOutside`);function Bv(){let e=new CustomEvent(Av);document.dispatchEvent(e)}$(Bv,`dispatchUpdate`);function Vv(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?Tv(i,a):i.dispatchEvent(a)}$(Vv,`handleAndDispatchCustomEvent`);var Hv=globalThis?.document?E.useLayoutEffect:()=>{},Uv=Object.defineProperty,Wv=(e,t)=>Uv(e,`name`,{value:t,configurable:!0}),Gv=E.useId||(()=>void 0),Kv=0;function qv(e){let[t,n]=E.useState(Gv());return Hv(()=>{e||n(e=>e??String(Kv++))},[e]),e||(t?`radix-${t}`:``)}Wv(qv,`useId`);var Jv=[`top`,`right`,`bottom`,`left`],Yv=Math.min,Xv=Math.max,Zv=Math.round,Qv=Math.floor,$v=e=>({x:e,y:e}),ey={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ty(e,t,n){return Xv(e,Yv(t,n))}function ny(e,t){return typeof e==`function`?e(t):e}function ry(e){return e.split(`-`)[0]}function iy(e){return e.split(`-`)[1]}function ay(e){return e===`x`?`y`:`x`}function oy(e){return e===`y`?`height`:`width`}function sy(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function cy(e){return ay(sy(e))}function ly(e,t,n){n===void 0&&(n=!1);let r=iy(e),i=cy(e),a=oy(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=vy(o)),[o,vy(o)]}function uy(e){let t=vy(e);return[dy(e),t,dy(t)]}function dy(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var fy=[`left`,`right`],py=[`right`,`left`],my=[`top`,`bottom`],hy=[`bottom`,`top`];function gy(e,t,n){switch(e){case`top`:case`bottom`:return n?t?py:fy:t?fy:py;case`left`:case`right`:return t?my:hy;default:return[]}}function _y(e,t,n,r){let i=iy(e),a=gy(ry(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(dy)))),a}function vy(e){let t=ry(e);return ey[t]+e.slice(t.length)}function yy(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function by(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:yy(e)}function xy(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 Sy(e,t,n){let{reference:r,floating:i}=e,a=sy(t),o=cy(t),s=oy(o),c=ry(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=iy(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Cy(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}=ny(t,e),p=by(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=xy(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=xy(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 wy=50,Ty=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Cy},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Sy(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<wy&&(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}=Sy(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ey=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}=ny(e,t)||{};if(l==null)return{};let d=by(u),f={x:n,y:r},p=cy(i),m=oy(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=Yv(d[_],w),ne=Yv(d[v],w),re=C-h[m]-ne,T=C/2-h[m]/2+ee,ie=ty(te,T,re),ae=!c.arrow&&iy(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}}}),Dy=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}=ny(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ry(r),_=sy(o),v=ry(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[vy(o)]:uy(o)),x=p!==`none`;!d&&x&&b.push(..._y(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=ly(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`&&_!==sy(t))||w.every(e=>sy(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=sy(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 Oy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ky(e){return Jv.some(t=>e[t]>=0)}var Ay=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ny(e,t);switch(i){case`referenceHidden`:{let e=Oy(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ky(e)}}}case`escaped`:{let e=Oy(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ky(e)}}}default:return{}}}}},jy=new Set([`left`,`top`]);async function My(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ry(n),s=iy(n),c=sy(n)===`y`,l=jy.has(o)?-1:1,u=a&&c?-1:1,d=ny(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 Ny=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 My(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}}}}},Py=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}=ny(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=sy(i),p=ay(f),m=u[p],h=u[f],g=(e,t)=>ty(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}}}}}},Fy=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}=ny(e,t),u={x:n,y:r},d=sy(i),f=ay(d),p=u[f],m=u[d],h=ny(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=jy.has(ry(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}}}},Iy=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}=ny(e,t),c=await i.detectOverflow(t,s),l=ry(n),u=iy(n),d=sy(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=Yv(p-c[m],g),y=Yv(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*Xv(c.left,c.right):S=p-2*Xv(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 Ly(){return typeof window<`u`}function Ry(e){return Vy(e)?(e.nodeName||``).toLowerCase():`#document`}function zy(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function By(e){return((Vy(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Vy(e){return Ly()?e instanceof Node||e instanceof zy(e).Node:!1}function Hy(e){return Ly()?e instanceof Element||e instanceof zy(e).Element:!1}function Uy(e){return Ly()?e instanceof HTMLElement||e instanceof zy(e).HTMLElement:!1}function Wy(e){return!Ly()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof zy(e).ShadowRoot}function Gy(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=nb(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ky(e){return/^(table|td|th)$/.test(Ry(e))}function qy(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Jy=/transform|translate|scale|rotate|perspective|filter/,Yy=/paint|layout|strict|content/,Xy=e=>!!e&&e!==`none`,Zy;function Qy(e){let t=Hy(e)?nb(e):e;return Xy(t.transform)||Xy(t.translate)||Xy(t.scale)||Xy(t.rotate)||Xy(t.perspective)||!eb()&&(Xy(t.backdropFilter)||Xy(t.filter))||Jy.test(t.willChange||``)||Yy.test(t.contain||``)}function $y(e){let t=ib(e);for(;Uy(t)&&!tb(t);){if(Qy(t))return t;if(qy(t))return null;t=ib(t)}return null}function eb(){return Zy??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Zy}function tb(e){return/^(html|body|#document)$/.test(Ry(e))}function nb(e){return zy(e).getComputedStyle(e)}function rb(e){return Hy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ib(e){if(Ry(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Wy(e)&&e.host||By(e);return Wy(t)?t.host:t}function ab(e){let t=ib(e);return tb(t)?(e.ownerDocument||e).body:Uy(t)&&Gy(t)?t:ab(t)}function ob(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ab(e),i=r===e.ownerDocument?.body,a=zy(r);if(i){let e=sb(a);return t.concat(a,a.visualViewport||[],Gy(r)?r:[],e&&n?ob(e):[])}else return t.concat(r,ob(r,[],n))}function sb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cb(e){let t=nb(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Uy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Zv(n)!==a||Zv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function lb(e){return Hy(e)?e:e.contextElement}function ub(e){let t=lb(e);if(!Uy(t))return $v(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=cb(t),o=(a?Zv(n.width):n.width)/r,s=(a?Zv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var db=$v(0);function fb(e){let t=zy(e);return!eb()||!t.visualViewport?db:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pb(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===zy(e)}function mb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=lb(e),o=$v(1);t&&(r?Hy(r)&&(o=ub(r)):o=ub(e));let s=pb(a,n,r)?fb(a):$v(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=zy(a),t=Hy(r)?zy(r):r,n=e,i=sb(n);for(;i&&t!==n;){let e=ub(i),t=i.getBoundingClientRect(),r=nb(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=zy(i),i=sb(n)}}return xy({width:u,height:d,x:c,y:l})}function hb(e,t){let n=rb(e).scrollLeft;return t?t.left+n:mb(By(e)).left+n}function gb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-hb(e,n),y:n.top+t.scrollTop}}function _b(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=By(r),s=t?qy(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=$v(1),u=$v(0),d=Uy(r);if((d||!a)&&((Ry(r)!==`body`||Gy(o))&&(c=rb(r)),d)){let e=mb(r);l=ub(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?gb(o,c):$v(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 vb(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function yb(e){let t=rb(e),n=e.ownerDocument.body,r=Xv(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Xv(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+hb(e),o=-t.scrollTop;return nb(n).direction===`rtl`&&(a+=Xv(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var bb=25;function xb(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=zy(e),a=By(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!eb()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(hb(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<=bb&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Sb(e,t){let n=mb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ub(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Cb(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=xb(e,n,t);else if(t===`document`)r=yb(By(e));else if(Hy(t))r=Sb(t,n);else{let n=fb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return xy(r)}function wb(e,t){let n=t.get(e);if(n)return n;let r=ob(e,[],!1).filter(e=>Hy(e)&&Ry(e)!==`body`),i=null,a=nb(e).position===`fixed`,o=a?ib(e):e;for(;Hy(o)&&!tb(o);){let e=nb(o),t=Qy(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ib(o)}return t.set(e,r),r}function Tb(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?qy(t)?[]:wb(t,this._c):[].concat(n),r],o=Cb(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=Cb(t,a[e],i);s=Xv(n.top,s),c=Yv(n.right,c),l=Yv(n.bottom,l),u=Xv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Eb(e){let{width:t,height:n}=cb(e);return{width:t,height:n}}function Db(e,t,n){let r=Uy(t),i=By(t),a=n===`fixed`,o=mb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=$v(0);if((r||!a)&&((Ry(t)!==`body`||Gy(i))&&(s=rb(t)),r)){let e=mb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=hb(i));let l=i&&!r&&!a?gb(i,s):$v(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 Ob(e){return nb(e).position===`static`}function kb(e,t){if(!Uy(e)||nb(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return By(e)===n&&(n=n.ownerDocument.body),n}function Ab(e,t){let n=zy(e);if(qy(e))return n;if(!Uy(e)){let t=ib(e);for(;t&&!tb(t);){if(Hy(t)&&!Ob(t))return t;t=ib(t)}return n}let r=kb(e,t);for(;r&&Ky(r)&&Ob(r);)r=kb(r,t);return r&&tb(r)&&Ob(r)&&!Qy(r)?n:r||$y(e)||n}var jb=async function(e){let t=this.getOffsetParent||Ab,n=this.getDimensions,r=await n(e.floating);return{reference:Db(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mb(e){return nb(e).direction===`rtl`}var Nb={convertOffsetParentRelativeRectToViewportRelativeRect:_b,getDocumentElement:By,getClippingRect:Tb,getOffsetParent:Ab,getElementRects:jb,getClientRects:vb,getDimensions:Eb,getScale:ub,isElement:Hy,isRTL:Mb};function Pb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fb(e,t,n){let r=null,i,a=By(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=Qv(d),h=Qv(a.clientWidth-(u+f)),g=Qv(a.clientHeight-(d+p)),_=Qv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Xv(0,Yv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Pb(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=zy(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ib(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=lb(e),u=i||a?[...l?ob(l):[],...t?ob(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fb(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?mb(e):null;c&&g();function g(){let t=mb(e);h&&!Pb(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 Lb=Ny,Rb=Py,zb=Dy,Bb=Iy,Vb=Ay,Hb=Ey,Ub=Fy,Wb=(e,t,n)=>{let r=new Map,i=n??{},a={...Nb,...i.platform,_c:r};return Ty(e,t,{...i,platform:a})},Gb=typeof document<`u`?E.useLayoutEffect:function(){};function Kb(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(!Kb(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)&&!Kb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function qb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jb(e,t){let n=qb(e);return Math.round(t*n)/n}function Yb(e){let t=E.useRef(e);return Gb(()=>{t.current=e}),t}function Xb(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);Kb(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=Yb(c),ne=Yb(i),re=Yb(l),T=E.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ne.current&&(e.platform=ne.current),Wb(S.current,C.current,e).then(e=>{let t={...e,isPositioned:re.current!==!1};ie.current&&!Kb(ee.current,t)&&(ee.current=t,xv.flushSync(()=>{d(t)}))})},[f,t,n,ne,re]);Gb(()=>{l===!1&&ee.current.isPositioned&&(ee.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=E.useRef(!1);Gb(()=>(ie.current=!0,()=>{ie.current=!1}),[]),Gb(()=>{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=Jb(oe.floating,u.x),r=Jb(oe.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...qb(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 Zb=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?{}:Hb({element:r.current,padding:i}).fn(n):r?Hb({element:r,padding:i}).fn(n):{}}}},Qb=(e,t)=>{let n=Lb(e);return{name:n.name,fn:n.fn,options:[e,t]}},$b=(e,t)=>{let n=Rb(e);return{name:n.name,fn:n.fn,options:[e,t]}},ex=(e,t)=>({fn:Ub(e).fn,options:[e,t]}),tx=(e,t)=>{let n=zb(e);return{name:n.name,fn:n.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=Zb(e);return{name:n.name,fn:n.fn,options:[e,t]}},ax=Object.defineProperty,ox=(e,t)=>ax(e,`name`,{value:t,configurable:!0});function sx(e){let[t,n]=E.useState(void 0);return Hv(()=>{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}ox(sx,`useSize`);var cx=Object.defineProperty,lx=(e,t)=>cx(e,`name`,{value:t,configurable:!0}),ux=`Popper`,[dx,fx]=yv(ux),[px,mx]=dx(ux),hx=lx(e=>{let{__scopePopper:t,children:n}=e,[r,i]=E.useState(null),[a,o]=E.useState(void 0);return(0,D.jsx)(px,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),gx=`PopperAnchor`,_x=E.forwardRef(lx(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,o=mx(gx,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&&wx(o.placementState),f=d?.[0],p=d?.[1];return r?null:(0,D.jsx)(wv.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),vx=`PopperContent`,[yx,bx]=dx(vx),xx=E.forwardRef(lx(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,_=mx(vx,n),[v,y]=E.useState(null),b=a(t,y),[x,S]=E.useState(null),C=sx(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(Sx),altBoundary:T},{refs:ae,floatingStyles:oe,placement:se,isPositioned:ce,middlewareData:le}=Xb({strategy:`fixed`,placement:te,whileElementsMounted:lx((...e)=>Ib(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Qb({mainAxis:i+w,alignmentAxis:s}),l&&$b({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?ex():void 0,...ie}),l&&tx({...ie}),nx({...ie,apply:lx(({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&&ix({element:x,padding:c}),Cx({arrowWidth:ee,arrowHeight:w}),p&&rx({strategy:`referenceHidden`,...ie,boundary:T?ie.boundary:void 0})]}),ue=_.setPlacementState;Hv(()=>(ue(se),()=>{ue(void 0)}),[se,ue]);let[de,fe]=wx(se),pe=Ov(h);Hv(()=>{ce&&pe?.()},[ce,pe]);let me=le.arrow?.x,he=le.arrow?.y,ge=le.arrow?.centerOffset!==0,[_e,ve]=E.useState();return Hv(()=>{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)(yx,{scope:n,placedSide:de,placedAlign:fe,onArrowChange:S,arrowX:me,arrowY:he,shouldHideArrow:ge,children:(0,D.jsx)(wv.div,{"data-side":de,"data-align":fe,...g,ref:b,style:{...g.style,animation:ce?g.style?.animation:`none`}})})})},`PopperContent`));function Sx(e){return e!==null}lx(Sx,`isNotNull`);var Cx=lx(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]=wx(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 wx(e){let[t,n=`center`]=e.split(`-`);return[t,n]}lx(wx,`getSideAndAlignFromPlacement`);var Tx=hx,Ex=_x,Dx=xx,Ox=Object.defineProperty,kx=E.forwardRef(((e,t)=>Ox(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=E.useState(!1);Hv(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?xv.createPortal((0,D.jsx)(wv.div,{...r,ref:t}),o):null},`Portal`)),Ax=Object.defineProperty,jx=(e,t)=>Ax(e,`name`,{value:t,configurable:!0});function Mx(e,t){return E.useReducer((e,n)=>t[e][n]??e,e)}jx(Mx,`useStateMachine`);var Nx=jx(e=>{let{present:t,children:n}=e,r=Px(t),i=typeof n==`function`?n({present:r.isPresent}):E.Children.only(n),a=Ix(r.ref,Rx(i));return typeof n==`function`||r.isPresent?E.cloneElement(i,{ref:a}):null},`Presence`);function Px(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]=Mx(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??Lx(r.current),o.current=void 0):a.current=`none`},[s]),Hv(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Lx(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]),Hv(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=jx(a=>{let o=Lx(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=jx(e=>{e.target===t&&(a.current=Lx(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=Lx(t)}else r.current=null;n(e)},[])}}jx(Px,`usePresence`);function Fx(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}jx(Fx,`setRef`);function Ix(...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=Fx(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():Fx(n[e],null)}}},[])}jx(Ix,`useStableComposedRefs`);function Lx(e){return e?.animationName||`none`}jx(Lx,`getAnimationName`);function Rx(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)}jx(Rx,`getElementRef`);var zx=Object.defineProperty,Bx=(e,t)=>zx(e,`name`,{value:t,configurable:!0}),Vx=E.useEffectEvent,Hx=E.useInsertionEffect;function Ux(e){if(typeof Vx==`function`)return Vx(e);let t=E.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Hx==`function`?Hx(()=>{t.current=e}):Hv(()=>{t.current=e}),E.useMemo(()=>((...e)=>t.current?.(...e)),[])}Bx(Ux,`useEffectEvent`);var Wx=Object.defineProperty,Gx=(e,t)=>Wx(e,`name`,{value:t,configurable:!0}),Kx=E.useInsertionEffect||Hv;function qx({prop:e,defaultProp:t,onChange:n=Gx(()=>{},`onChange`),caller:r}){let[i,a,o]=Jx({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,E.useCallback(t=>{if(s){let n=Yx(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Gx(qx,`useControllableState`);function Jx({defaultProp:e,onChange:t}){let[n,r]=E.useState(e),i=E.useRef(n),a=E.useRef(t);return Kx(()=>{a.current=t},[t]),E.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Gx(Jx,`useUncontrolledState`);function Yx(e){return typeof e==`function`}Gx(Yx,`isFunction`);var Xx=Symbol(`RADIX:SYNC_STATE`);function Zx(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Ux(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=E.useReducer((t,n)=>{if(n.type===Xx)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:Xx,state:i})},[i,d.state,c]),[h,f]}Gx(Zx,`useControllableStateReducer`);var Qx=Object.defineProperty,$x=(e,t)=>Qx(e,`name`,{value:t,configurable:!0}),eS=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`}),tS=E.forwardRef($x(function(e,t){return(0,D.jsx)(wv.span,{...e,ref:t,style:{...eS,...e.style}})},`VisuallyHidden`)),nS=Object.defineProperty,rS=(e,t)=>nS(e,`name`,{value:t,configurable:!0}),[iS,aS]=yv(`Tooltip`,[fx]),oS=fx(),sS=`TooltipProvider`,cS=700,lS=`tooltip.open`,[uS,dS]=iS(sS),fS=rS(e=>{let{__scopeTooltip:t,delayDuration:n=cS,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)(uS,{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`),pS=`Tooltip`,[mS,hS]=iS(pS),gS=rS(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=dS(pS,e.__scopeTooltip),l=oS(t),[u,d]=E.useState(null),[f,p]=E.useState(void 0),m=qv(),h=E.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=E.useRef(!1),[y,b]=qx({prop:r,defaultProp:i??!1,onChange:rS(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(lS))):c.onClose(),a?.(e)},`onChange`),caller:pS}),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)(Tx,{...l,children:(0,D.jsx)(mS,{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`),_S=`TooltipTrigger`,vS=E.forwardRef(rS(function(e,t){let{__scopeTooltip:n,...r}=e,i=hS(_S,n),o=dS(_S,n),s=oS(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)(Ex,{asChild:!0,...s,children:(0,D.jsx)(wv.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:dv(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:dv(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:dv(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:dv(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:dv(e.onBlur,i.onClose),onClick:dv(e.onClick,i.onClose)})})},`TooltipTrigger`)),yS=`TooltipPortal`,[bS,xS]=iS(yS,{forceMount:void 0}),SS=rS(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=hS(yS,t);return(0,D.jsx)(bS,{scope:t,forceMount:n,children:(0,D.jsx)(Nx,{present:n||a.open,children:(0,D.jsx)(kx,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),CS=`TooltipContent`,wS=E.forwardRef(rS(function(e,t){let n=xS(CS,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=hS(CS,e.__scopeTooltip);return(0,D.jsx)(Nx,{present:r||o.open,children:o.disableHoverableContent?(0,D.jsx)(DS,{side:i,...a,ref:t}):(0,D.jsx)(TS,{side:i,...a,ref:t})})},`TooltipContent`)),TS=E.forwardRef(rS(function(e,t){let n=hS(CS,e.__scopeTooltip),r=dS(CS,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=kS(r,OS(r,n.getBoundingClientRect())),a=AS(t.getBoundingClientRect()),o=MS([...i,...a]);c(o),f(!0)},[f]);return E.useEffect(()=>()=>p(),[p]),E.useEffect(()=>{if(l&&d){let e=rS(e=>m(e,d),`handleTriggerLeave`),t=rS(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=rS(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!jS(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)(DS,{...e,ref:o})},`TooltipContentHoverable`)),ES=o(`TooltipContent`),DS=E.forwardRef(rS(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=hS(CS,n),u=oS(n),{onClose:d}=l;E.useEffect(()=>(document.addEventListener(lS,d),()=>document.removeEventListener(lS,d)),[d]),E.useEffect(()=>{if(l.trigger){let e=rS(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 Hv(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,D.jsx)(Fv,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,D.jsxs)(Dx,{"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)(ES,{children:r}),i?(0,D.jsx)(tS,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function OS(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`)}}rS(OS,`getExitSideFromRect`);function kS(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}rS(kS,`getPaddedExitPoints`);function AS(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}]}rS(AS,`getPointsFromRect`);function jS(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}rS(jS,`isPointInPolygon`);function MS(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)),NS(t)}rS(MS,`getHull`);function NS(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)}rS(NS,`getHullPresorted`);var PS=fS,FS=gS,IS=vS,LS=SS,RS=wS;function zS({delayDuration:e=350,disableHoverableContent:t=!0,skipDelayDuration:n=150,...r}){return(0,D.jsx)(PS,{"data-slot":`tooltip-provider`,delayDuration:e,disableHoverableContent:t,skipDelayDuration:n,...r})}function BS(e){return(0,D.jsx)(FS,{"data-slot":`tooltip`,...e})}function VS(e){return(0,D.jsx)(IS,{"data-slot":`tooltip-trigger`,...e})}function HS({children:e,className:t,collisionPadding:n=8,sideOffset:r=8,...i}){return(0,D.jsx)(LS,{children:(0,D.jsx)(RS,{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 US=Object.defineProperty,WS=(e,t)=>US(e,`name`,{value:t,configurable:!0}),GS=`focusScope.autoFocusOnMount`,KS=`focusScope.autoFocusOnUnmount`,qS={bubbles:!1,cancelable:!0},JS=E.forwardRef(WS(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[c,l]=E.useState(null),u=Ov(i),d=Ov(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:tC(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||tC(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&tC(c)};WS(e,`handleFocusIn`),WS(t,`handleFocusOut`),WS(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){nC.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(GS,qS);c.addEventListener(GS,u),c.dispatchEvent(t),t.defaultPrevented||(YS(aC(ZS(c)),{select:!0}),document.activeElement===e&&tC(c))}return()=>{c.removeEventListener(GS,u),setTimeout(()=>{let t=new CustomEvent(KS,qS);c.addEventListener(KS,d),c.dispatchEvent(t),t.defaultPrevented||tC(e??document.body,{select:!0}),c.removeEventListener(KS,d),nC.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]=XS(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&tC(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&tC(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,D.jsx)(wv.div,{tabIndex:-1,...s,ref:p,onKeyDown:h})},`FocusScope`));function YS(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(tC(r,{select:t}),document.activeElement!==n)return}WS(YS,`focusFirst`);function XS(e){let t=ZS(e);return[QS(t,e),QS(t.reverse(),e)]}WS(XS,`getTabbableEdges`);function ZS(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:WS(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}WS(ZS,`getTabbableCandidates`);function QS(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):$S(r,{upTo:t})))return r}WS(QS,`findVisible`);function $S(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}WS($S,`isHidden`);function eC(e){return e instanceof HTMLInputElement&&`select`in e}WS(eC,`isSelectableInput`);function tC(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&eC(e)&&t&&e.select()}}WS(tC,`focus`);var nC=rC();function rC(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=iC(e,t),e.unshift(t)},remove(t){e=iC(e,t),e[0]?.resume()}}}WS(rC,`createFocusScopesStack`);function iC(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}WS(iC,`arrayRemove`);function aC(e){return e.filter(e=>e.tagName!==`A`)}WS(aC,`removeLinks`);var oC=Object.defineProperty,sC=(e,t)=>oC(e,`name`,{value:t,configurable:!0}),cC=0,lC=null;function uC(e){return dC(),e.children}sC(uC,`FocusGuards`);function dC(){E.useEffect(()=>{lC||={start:fC(),end:fC()};let{start:e,end:t}=lC;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),cC++,()=>{cC===1&&(lC?.start.remove(),lC?.end.remove(),lC=null),cC=Math.max(0,cC-1)}},[])}sC(dC,`useFocusGuards`);function fC(){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}sC(fC,`createFocusGuard`);var pC=function(){return pC=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},pC.apply(this,arguments)};function mC(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 hC(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 gC=`right-scroll-bar-position`,_C=`width-before-scroll-bar`,vC=`with-scroll-bars-hidden`,yC=`--removed-body-scroll-bar-size`;function bC(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function xC(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 SC=typeof window<`u`?E.useLayoutEffect:E.useEffect,CC=new WeakMap;function wC(e,t){var n=xC(t||null,function(t){return e.forEach(function(e){return bC(e,t)})});return SC(function(){var t=CC.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||bC(e,null)}),i.forEach(function(e){r.has(e)||bC(e,a)})}CC.set(n,e)},[e]),n}function TC(e){return e}function EC(e,t){t===void 0&&(t=TC);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 DC(e){e===void 0&&(e={});var t=EC(null);return t.options=pC({async:!0,ssr:!1},e),t}var OC=function(e){var t=e.sideCar,n=mC(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,pC({},n))};OC.isSideCarExport=!0;function kC(e,t){return e.useMedium(t),OC}var AC=DC(),jC=function(){},MC=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:jC,onWheelCapture:jC,onTouchMoveCapture:jC}),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=mC(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=wC([n,t]),C=pC(pC({},b),i);return E.createElement(E.Fragment,null,u&&E.createElement(x,{sideCar:AC,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),pC(pC({},C),{ref:S})):E.createElement(v,pC({},C,{className:c,ref:S}),s))});MC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},MC.classNames={fullWidth:_C,zeroRight:gC};var NC,PC=function(){if(NC)return NC;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function FC(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=PC();return t&&e.setAttribute(`nonce`,t),e}function IC(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function LC(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var RC=function(){var e=0,t=null;return{add:function(n){e==0&&(t=FC())&&(IC(t,n),LC(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zC=function(){var e=RC();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},BC=function(){var e=zC();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},VC={left:0,top:0,right:0,gap:0},HC=function(e){return parseInt(e||``,10)||0},UC=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[HC(n),HC(r),HC(i)]},WC=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return VC;var t=UC(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])}},GC=BC(),KC=`data-scroll-locked`,qC=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
|
-
.${vC} {
|
|
3
|
-
overflow: hidden ${r};
|
|
4
|
-
padding-right: ${s}px ${r};
|
|
5
|
-
}
|
|
6
|
-
body[${KC}] {
|
|
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
|
-
.${gC} {
|
|
20
|
-
right: ${s}px ${r};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.${_C} {
|
|
24
|
-
margin-right: ${s}px ${r};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${gC} .${gC} {
|
|
28
|
-
right: 0 ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${_C} .${_C} {
|
|
32
|
-
margin-right: 0 ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[${KC}] {
|
|
36
|
-
${yC}: ${s}px;
|
|
37
|
-
}
|
|
38
|
-
`},JC=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},YC=function(){E.useEffect(function(){return document.body.setAttribute(KC,(JC()+1).toString()),function(){var e=JC()-1;e<=0?document.body.removeAttribute(KC):document.body.setAttribute(KC,e.toString())}},[])},XC=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;YC();var a=E.useMemo(function(){return WC(i)},[i]);return E.createElement(GC,{styles:qC(a,!t,i,n?``:`!important`)})},ZC=!1;if(typeof window<`u`)try{var QC=Object.defineProperty({},"passive",{get:function(){return ZC=!0,!0}});window.addEventListener(`test`,QC,QC),window.removeEventListener(`test`,QC,QC)}catch{ZC=!1}var $C=ZC?{passive:!1}:!1,ew=function(e){return e.tagName===`TEXTAREA`},tw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ew(e)&&n[t]===`visible`)},nw=function(e){return tw(e,`overflowY`)},rw=function(e){return tw(e,`overflowX`)},iw=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),sw(e,r)){var i=cw(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},aw=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ow=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},sw=function(e,t){return e===`v`?nw(t):rw(t)},cw=function(e,t){return e===`v`?aw(t):ow(t)},lw=function(e,t){return e===`h`&&t===`rtl`?-1:1},uw=function(e,t,n,r,i){var a=lw(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=cw(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&sw(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},dw=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fw=function(e){return[e.deltaX,e.deltaY]},pw=function(e){return e&&`current`in e?e.current:e},mw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},hw=function(e){return`
|
|
39
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},gw=0,_w=[];function vw(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(gw++)[0],a=E.useState(BC)[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=hC([e.lockRef.current],(e.shards||[]).map(pw),!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=dw(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=iw(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=iw(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 uw(h,t,e,h===`h`?s:c,!0)},[]),c=E.useCallback(function(e){var n=e;if(!(!_w.length||_w[_w.length-1]!==a)){var r=`deltaY`in n?fw(n):dw(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&mw(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(pw).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:yw(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=dw(e),r.current=void 0},[]),d=E.useCallback(function(t){l(t.type,fw(t),t.target,s(t,e.lockRef.current))},[]),f=E.useCallback(function(t){l(t.type,dw(t),t.target,s(t,e.lockRef.current))},[]);E.useEffect(function(){return _w.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,$C),document.addEventListener(`touchmove`,c,$C),document.addEventListener(`touchstart`,u,$C),function(){_w=_w.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,$C),document.removeEventListener(`touchmove`,c,$C),document.removeEventListener(`touchstart`,u,$C)}},[]);var p=e.removeScrollBar,m=e.inert;return E.createElement(E.Fragment,null,m?E.createElement(a,{styles:hw(i)}):null,p?E.createElement(XC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yw(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var bw=kC(AC,vw),xw=E.forwardRef(function(e,t){return E.createElement(MC,pC({},e,{ref:t,sideCar:bw}))});xw.classNames=MC.classNames;var Sw=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Cw=new WeakMap,ww=new WeakMap,Tw={},Ew=0,Dw=function(e){return e&&(e.host||Dw(e.parentNode))},Ow=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Dw(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})},kw=function(e,t,n,r){var i=Ow(t,Array.isArray(e)?e:[e]);Tw[n]||(Tw[n]=new WeakMap);var a=Tw[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=(Cw.get(e)||0)+1,l=(a.get(e)||0)+1;Cw.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ww.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(),Ew++,function(){o.forEach(function(e){var t=Cw.get(e)-1,i=a.get(e)-1;Cw.set(e,t),a.set(e,i),t||(ww.has(e)||e.removeAttribute(r),ww.delete(e)),i||e.removeAttribute(n)}),Ew--,Ew||(Cw=new WeakMap,Cw=new WeakMap,ww=new WeakMap,Tw={})}},Aw=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Sw(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),kw(r,i,n,`aria-hidden`)):function(){return null}};export{rt as $,nv as A,u as At,wm as B,wv as C,te as Ct,sv as D,me as Dt,dv as E,T as Et,q_ as F,pf as G,vf as H,K_ as I,st as J,mf as K,B_ as L,av as M,iv as N,ov as O,fe as Ot,J_ as P,et as Q,ph as R,Ov as S,g as St,yv as T,b as Tt,df as U,xf as V,ff as W,at as X,ot as Y,it as Z,sx as _,w as _t,BS as a,qe as at,Fv as b,C as bt,VS as c,Ie as ct,Nx as d,je as dt,nt as et,kx as f,Ee as ft,fx as g,_ as gt,Tx as h,be as ht,JS as i,Xe as it,rv as j,tv as k,d as kt,eS as l,Me as lt,Dx as m,xe as mt,xw as n,$e as nt,HS as o,Ge as ot,Ex as p,Te as pt,Tf as q,dC as r,Qe as rt,zS as s,We as st,Aw as t,Ze as tt,qx as u,Ae as ut,qv as v,ee as vt,Tv as w,re as wt,Iv as x,S as xt,Hv as y,le as yt,Gm as z};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as e}from"./button-B0Zy5xUw.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};
|
|
Binary file
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/patch-diff-viewer-DHfvCO4S.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CVaUQXZF.js","assets/index-C9MtcGVc.js","assets/button-B0Zy5xUw.js","assets/bundle-mjs-rHxsej31.js","assets/es2015-D1QRD4rq.js","assets/checkbox-J-dVFT8h.js","assets/file-tree-Dh8mZi4H.js","assets/file-fDjkn3KE.js","assets/provider-connection-queries-C2Fn0xx2.js","assets/index-DAs_avwK.css","assets/engine-compile-DQ0HPfe0.js","assets/lib-DrPFkMXk.js","assets/code-languages-B1bG8xP9.js","assets/shiki-bundle-CNYWcrCX.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-B0Zy5xUw.js";import{O as o,a as s,c,o as l}from"./es2015-D1QRD4rq.js";import{i as u,l as d,r as f,t as p}from"./file-tree-Dh8mZi4H.js";import{A as m,F as h,Q as g,j as _,lt as v}from"./index-C9MtcGVc.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-DHfvCO4S.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};
|
|
Binary file
|
|
Binary file
|