@opentig/cli 0.2.3 → 0.2.4
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/LICENSE +1 -1
- package/README.md +14 -14
- package/dist/bin.mjs +25 -10
- package/dist/chunks/{cli-L6lvCZdX.mjs → cli-gyjD1t0O.mjs} +611 -268
- package/dist/chunks/network-settings-CdFeKFRB.mjs +142 -0
- package/dist/chunks/{server-Cz0gvydn.mjs → server-DMk8-Xxt.mjs} +557 -105
- package/dist/chunks/{service-manager-Jyx-MWo-.mjs → service-manager-BxSmV_8Z.mjs} +88 -14
- package/dist/client/assets/App-Bfw_TX8q.js +132 -0
- package/dist/client/assets/CreatePullRequestDialog-DyPd6SKH.js +2 -0
- package/dist/client/assets/DiffWorkspace-DCo89dF1.js +7 -0
- package/dist/client/assets/EditableFileViewer-Dotntfij.js +1 -0
- package/dist/client/assets/EditableFileViewer-svutjHZv.css +1 -0
- package/dist/client/assets/ExternalLink-jdtpN_yL.js +1 -0
- package/dist/client/assets/{File-BPxtFxHC.js → File-DHnVtIhS.js} +1 -1
- package/dist/client/assets/FilesView-D6f1hPVy.js +1 -0
- package/dist/client/assets/GitHubAvatar-B6vyoVlh.js +1 -0
- package/dist/client/assets/HistoryView-D9RhzCPY.js +1 -0
- package/dist/client/assets/HtmlFileViewer-Bwmj5umg.js +2 -0
- package/dist/client/assets/{IconAlertTriangle-C1OX2bTH.js → IconAlertTriangle-B9iDJKvP.js} +1 -1
- package/dist/client/assets/IconCheck-C-G-IA13.js +1 -0
- package/dist/client/assets/IconChevronDown-DU5i40lD.js +1 -0
- package/dist/client/assets/{IconEdit-BP5Emwzw.js → IconEdit-CZe-EJxX.js} +1 -1
- package/dist/client/assets/{IconFolderSymlink-BNWI0eXB.js → IconFolderSymlink-DkLEuUb6.js} +1 -1
- package/dist/client/assets/IconGitMerge-D9KEj1cE.js +1 -0
- package/dist/client/assets/IconGitPullRequest-ClaUqyVa.js +1 -0
- package/dist/client/assets/{IconLoader4-Bk6G4Bls.js → IconLoader4-D2VN7u1V.js} +1 -1
- package/dist/client/assets/{IconPlus-DUFNSK_i.js → IconPlus-DJCoD3wt.js} +1 -1
- package/dist/client/assets/{IconSearch-ZL3YVslZ.js → IconSearch-1VQ4P4kW.js} +1 -1
- package/dist/client/assets/{IconSelector-BGwY84R8.js → IconSelector-BVMU1PEt.js} +1 -1
- package/dist/client/assets/ImageFileViewer-3izbFVTw.css +1 -0
- package/dist/client/assets/ImageFileViewer-CdFLl_in.js +1 -0
- package/dist/client/assets/LinkedMarkdown-Bnc2OA63.js +1 -0
- package/dist/client/assets/LinkedText-BD6K3d1t.js +1 -0
- package/dist/client/assets/LocalRefsDialog-Bl-fddap.js +1 -0
- package/dist/client/assets/MarkdownFileViewer-NUAoQmv5.js +2 -0
- package/dist/client/assets/PairingPage-CqrxpC3_.js +1 -0
- package/dist/client/assets/PierreDiffViewer-CDfQ32e0.js +1 -0
- package/dist/client/assets/{PierreEditBoundary-Bt0q7SXc.js → PierreEditBoundary-DAdYNYZ3.js} +1 -1
- package/dist/client/assets/{PierreWorkerPool-DMFigp0u.js → PierreWorkerPool-mIDzTMB9.js} +3 -3
- package/dist/client/assets/PullRequestDiff-n1NZFHKN.js +1 -0
- package/dist/client/assets/PullRequestViewer-u89zl169.js +2 -0
- package/dist/client/assets/PullRequestsView-D6BqvB4E.js +1 -0
- package/dist/client/assets/QuickOpenDialog-BbEifGRi.js +1 -0
- package/dist/client/assets/RepositoryProjectsDialog-EGAsXL-Z.js +1 -0
- package/dist/client/assets/{SearchView-BYz1K1Ta.js → SearchView-BMz7qOdc.js} +1 -1
- package/dist/client/assets/SettingsDialog-DmD7HvhX.js +9 -0
- package/dist/client/assets/Viewer-CDj_vo6w.js +3 -0
- package/dist/client/assets/{abnfDiagram-YUKMZFIV-CpKAN_8n.js → abnfDiagram-YUKMZFIV-It6tW-4v.js} +1 -1
- package/dist/client/assets/{architecture-WOLXFQ4H-DrizVopY.js → architecture-WOLXFQ4H-CaOaChND.js} +1 -1
- package/dist/client/assets/{architectureDiagram-47P4ROYG-gvUijB3H.js → architectureDiagram-47P4ROYG-COtncecA.js} +1 -1
- package/dist/client/assets/{blockDiagram-E7TT5TSB-CdcXmnf_.js → blockDiagram-E7TT5TSB-NU4wFrfP.js} +1 -1
- package/dist/client/assets/{c4Diagram-CRA5TL53-DtoD1jKt.js → c4Diagram-CRA5TL53-0xzM4S8q.js} +1 -1
- package/dist/client/assets/channel-QED-4ACa.js +1 -0
- package/dist/client/assets/checkbox-Dh4T0bCe.js +1 -0
- package/dist/client/assets/{chunk-2BW5OAIV-Bxqf2dFQ.js → chunk-2BW5OAIV-BQMxlSNI.js} +1 -1
- package/dist/client/assets/{chunk-3YJQHVM4-BhzXJiq0.js → chunk-3YJQHVM4-CdP15KtA.js} +1 -1
- package/dist/client/assets/{chunk-4EA7E6EY-CvEILf8c.js → chunk-4EA7E6EY-xRPCCZLU.js} +1 -1
- package/dist/client/assets/{chunk-7TKQ45FW-pTEdzVz3.js → chunk-7TKQ45FW-Cr_UAObV.js} +1 -1
- package/dist/client/assets/{chunk-AW2ZBBNX-LVROkcXk.js → chunk-AW2ZBBNX-DBqqxF2h.js} +1 -1
- package/dist/client/assets/{chunk-DBDB3WZW-FCGrB-q8.js → chunk-DBDB3WZW-BonEIRP2.js} +1 -1
- package/dist/client/assets/{chunk-E2ZNV5FY-B3rGXPn-.js → chunk-E2ZNV5FY-DnKvxSiA.js} +1 -1
- package/dist/client/assets/{chunk-EU5HNXII-D6a_Ly_W.js → chunk-EU5HNXII-DLK0K3sR.js} +1 -1
- package/dist/client/assets/{chunk-FVRAUYC3-B5hy0Ket.js → chunk-FVRAUYC3-DmjKoYAh.js} +1 -1
- package/dist/client/assets/{chunk-HJ2JQQFS-CKHFz1Wl.js → chunk-HJ2JQQFS-AF4phse0.js} +1 -1
- package/dist/client/assets/{chunk-HTAEGDNF-CtwDuO27.js → chunk-HTAEGDNF-CG4pBnUZ.js} +1 -1
- package/dist/client/assets/{chunk-KQW6MTUR-BN3uxLYf.js → chunk-KQW6MTUR-Dd87yj5r.js} +1 -1
- package/dist/client/assets/{chunk-NTY3LDVX-CfXSvyIC.js → chunk-NTY3LDVX-OolU2PaP.js} +1 -1
- package/dist/client/assets/{chunk-VPRB5NB3-LAggcSji.js → chunk-VPRB5NB3-Dnr3edxV.js} +3 -3
- package/dist/client/assets/{chunk-XC4XBNZT-BksIPWQU.js → chunk-XC4XBNZT-CIqGRxkD.js} +1 -1
- package/dist/client/assets/{classDiagram-v2-K4WV4PDN-DH78Maqm.js → classDiagram-v2-K4WV4PDN-CPGawm8n.js} +1 -1
- package/dist/client/assets/createReactComponent-Ctub7J3a.js +1 -0
- package/dist/client/assets/{cynefin-EF2NZ3EQ-DozKlDV1.js → cynefin-EF2NZ3EQ-OA2R9WCH.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-3GCD6N5R-A1yS7NKN.js → cynefinDiagram-3GCD6N5R-DqCVtoKt.js} +1 -1
- package/dist/client/assets/{dagre-W4DXFKR2-DRJ1mmbe.js → dagre-W4DXFKR2-kc3-tkAQ.js} +1 -1
- package/dist/client/assets/{diagram-2UJZ2QOL-B1sI2b2o.js → diagram-2UJZ2QOL-DoBZKT3s.js} +1 -1
- package/dist/client/assets/{diagram-OVF4WLC6-DLE1o4-P.js → diagram-OVF4WLC6-DGkyha_F.js} +1 -1
- package/dist/client/assets/{diagram-PFPMY2P6-UtIEsv14.js → diagram-PFPMY2P6-DpRDDgdV.js} +1 -1
- package/dist/client/assets/{diagram-UMYRVEAY-BwTyzVap.js → diagram-UMYRVEAY-DlsfhYv3.js} +1 -1
- package/dist/client/assets/{diagram-YEKJPTXX-DNPUQqu0.js → diagram-YEKJPTXX-BIhRZzBM.js} +1 -1
- package/dist/client/assets/{diagram-ZIFT7M5P-ClXykQ3I.js → diagram-ZIFT7M5P-mweJcgBZ.js} +1 -1
- package/dist/client/assets/diff-parse.worker-C1IFRYY9.js +13 -0
- package/dist/client/assets/{ebnfDiagram-VR2GEFS7-Dm8VAviu.js → ebnfDiagram-VR2GEFS7-Dn5zyIbZ.js} +1 -1
- package/dist/client/assets/{elk-IJKZMXRS-CEEoPARn.js → elk-IJKZMXRS-eBPlf1-o.js} +1 -1
- package/dist/client/assets/{erDiagram-O2IAPWRE-CaDE4obX.js → erDiagram-O2IAPWRE-WEE519yZ.js} +1 -1
- package/dist/client/assets/{eventmodeling-K75KTNOO-PjYgMkPC.js → eventmodeling-K75KTNOO-BgE_VmNy.js} +1 -1
- package/dist/client/assets/external-url-IUS7RmYD.js +1 -0
- package/dist/client/assets/flowDiagram-OXPTDLAJ-CHQYfkMg.js +1 -0
- package/dist/client/assets/{ganttDiagram-R7TSEDQI-CmkBarBi.js → ganttDiagram-R7TSEDQI-D_1KyJZU.js} +1 -1
- package/dist/client/assets/{gitGraph-VSP46ZUC-DeotTdHj.js → gitGraph-VSP46ZUC-CEbT7DA4.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-XJZIOB7I-uV1hPaZT.js → gitGraphDiagram-XJZIOB7I-QQyYc1gM.js} +1 -1
- package/dist/client/assets/index-DsKvWsTs.js +47 -0
- package/dist/client/assets/index-kyWCnbkb.css +2 -0
- package/dist/client/assets/{info-OHQRW6UA-BQDsGvSl.js → info-OHQRW6UA-ChHAnveo.js} +1 -1
- package/dist/client/assets/{infoDiagram-5W2HQ5XZ-CDfEPsgZ.js → infoDiagram-5W2HQ5XZ-BaxAE7UA.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-K3B6WC7H-Bb7PQGe6.js → ishikawaDiagram-K3B6WC7H-vhUflBE_.js} +1 -1
- package/dist/client/assets/{journeyDiagram-COXZFDF6-BDythglw.js → journeyDiagram-COXZFDF6-C8WWosVa.js} +1 -1
- package/dist/client/assets/{kanban-definition-P3RFRI5V-CvY5kXhh.js → kanban-definition-P3RFRI5V-CU6W9Yi3.js} +1 -1
- package/dist/client/assets/katex-CQfTPFh0.js +1 -0
- package/dist/client/assets/{line-99p2yFnB.js → line-Axq4vVX-.js} +1 -1
- package/dist/client/assets/{mermaid-parser.core-BjZYtoJ8.js → mermaid-parser.core-DNeaCX12.js} +3 -3
- package/dist/client/assets/{mermaid.core-DRcXnUox.js → mermaid.core-Dtt7rXw0.js} +4 -4
- package/dist/client/assets/{mindmap-definition-LZFPQGKD-t9LoCpnW.js → mindmap-definition-LZFPQGKD-D_8ZqQot.js} +1 -1
- package/dist/client/assets/{packet-JDAUHWVQ-BlR-5V7K.js → packet-JDAUHWVQ-6z7ujmGF.js} +1 -1
- package/dist/client/assets/{pegDiagram-BGZESJAR-CWeGI-T9.js → pegDiagram-BGZESJAR-3ujyk-bt.js} +1 -1
- package/dist/client/assets/{pie-XZMESJXO-BkvYHWgl.js → pie-XZMESJXO-DvpLy2DB.js} +1 -1
- package/dist/client/assets/{pieDiagram-CAPJLFHJ-CY5PPIr3.js → pieDiagram-CAPJLFHJ-BPMPWyc7.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-GDMTTRAM-kqj-z271.js → quadrantDiagram-GDMTTRAM-BVUCR_lf.js} +1 -1
- package/dist/client/assets/{radar-ABXABTNO-DuEtYatv.js → radar-ABXABTNO-lu14X99R.js} +1 -1
- package/dist/client/assets/{railroad-I3PHUGI6-CVlnj2j9.js → railroad-I3PHUGI6-DI_WtDmt.js} +1 -1
- package/dist/client/assets/{railroad-abnf-LNEFI6M7-9Qiczw4d.js → railroad-abnf-LNEFI6M7-CmWAKZ2T.js} +1 -1
- package/dist/client/assets/{railroad-ebnf-DWYD2UWJ-BNL7TMEg.js → railroad-ebnf-DWYD2UWJ-BWKFU_UH.js} +1 -1
- package/dist/client/assets/{railroad-peg-JR7BVNR7-DdpRxgk6.js → railroad-peg-JR7BVNR7-9wkgzxMB.js} +1 -1
- package/dist/client/assets/{railroadDiagram-SM67HX2B-CDXvYNqW.js → railroadDiagram-SM67HX2B-4JnRbxl_.js} +1 -1
- package/dist/client/assets/{render-markdown-DF9Fy7MD.js → render-markdown-CQi2yKYQ.js} +2 -2
- package/dist/client/assets/{requirementDiagram-X7JNWC4A-BDdhqnZA.js → requirementDiagram-X7JNWC4A-CVJiZZsi.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-UM26HJRW-Rkyk5oEf.js → sankeyDiagram-UM26HJRW-BmlWQdkv.js} +1 -1
- package/dist/client/assets/select-Dq3KDX2O.js +1 -0
- package/dist/client/assets/{sequenceDiagram-ZO4K6R2Y-Coj9ap7h.js → sequenceDiagram-ZO4K6R2Y-zUx3LmPj.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-TBUQTH76-BucWlahR.js → stateDiagram-v2-TBUQTH76-o_ci-2bu.js} +1 -1
- package/dist/client/assets/{swimlanes-N4OXWK64-tEECcFP9.js → swimlanes-N4OXWK64-BlI0GC5-.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-K3J5GTZL-BEeJLN8d.js +8 -0
- package/dist/client/assets/tanstack-CVAt_k_T.js +1 -0
- package/dist/client/assets/{timeline-definition-YOQAKGHF-XvIbGO4d.js → timeline-definition-YOQAKGHF-DLnvF__o.js} +1 -1
- package/dist/client/assets/{treeView-D4JQ5SDB-DuhJpfXe.js → treeView-D4JQ5SDB-DPuMLQhB.js} +1 -1
- package/dist/client/assets/{treemap-SAJKECNS-CLiUWfZh.js → treemap-SAJKECNS-DjxqxJ8-.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-VIAY4XPW-BuwkpV9w.js → usecaseDiagram-VIAY4XPW-BtnFNltN.js} +1 -1
- package/dist/client/assets/utils-D0T3A-kS.js +1 -0
- package/dist/client/assets/{vennDiagram-BLWOH2XV-kfza5Rxq.js → vennDiagram-BLWOH2XV-CAiF2FKz.js} +1 -1
- package/dist/client/assets/viewer-tabs-DkkqN9MD.js +1 -0
- package/dist/client/assets/{wardley-7MLQ67FV-CcbU_Ykg.js → wardley-7MLQ67FV-DAWySamq.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YMQ3BMBF-DnxlEg3a.js → wardleyDiagram-YMQ3BMBF-DiBCclEL.js} +1 -1
- package/dist/client/assets/{xychartDiagram-TAQBALBS-BzgtwtvK.js → xychartDiagram-TAQBALBS-B0NgfXz6.js} +1 -1
- package/dist/client/index.html +6 -4
- package/dist/dev.mjs +6 -6
- package/dist/manifest.json +1 -1
- package/dist/server.mjs +1 -1
- package/dist/service-update.mjs +11 -3
- package/dist/utility.mjs +25 -4
- package/package.json +4 -4
- package/dist/client/assets/App-DEIZhWJG.js +0 -132
- package/dist/client/assets/CreatePullRequestDialog-BceOUbYK.js +0 -2
- package/dist/client/assets/DiffWorkspace-BMtV4MMc.js +0 -6
- package/dist/client/assets/EditableFileViewer-B44TSuFu.css +0 -1
- package/dist/client/assets/EditableFileViewer-BE3AsnVa.js +0 -1
- package/dist/client/assets/FilesView-DoVhRfi1.js +0 -1
- package/dist/client/assets/GitHubAvatar-RiePq1Yf.js +0 -1
- package/dist/client/assets/HistoryView-Dl8uqmKe.js +0 -1
- package/dist/client/assets/HtmlFileViewer-xfjY1Swc.js +0 -2
- package/dist/client/assets/IconCheck-BPhxw_LS.js +0 -1
- package/dist/client/assets/IconChevronDown-C3FplJL8.js +0 -1
- package/dist/client/assets/ImageFileViewer-BJBOmpsf.css +0 -1
- package/dist/client/assets/ImageFileViewer-DXaIo7_d.js +0 -1
- package/dist/client/assets/LocalRefsDialog-C5J3kgTe.js +0 -1
- package/dist/client/assets/MarkdownFileViewer-18mvm0f2.js +0 -2
- package/dist/client/assets/PairingPage-BEUj3t0V.js +0 -1
- package/dist/client/assets/PierreDiffViewer-p29h7lW_.js +0 -1
- package/dist/client/assets/PullRequestDiff-C17JA4ko.js +0 -1
- package/dist/client/assets/PullRequestViewer-DaMtkESD.js +0 -2
- package/dist/client/assets/PullRequestsView-44f03VLC.js +0 -1
- package/dist/client/assets/QuickOpenDialog-Bi-L68PU.js +0 -1
- package/dist/client/assets/RepositoryProjectsDialog-DFGn74fe.js +0 -1
- package/dist/client/assets/SettingsDialog-CruoIiyN.js +0 -9
- package/dist/client/assets/Viewer-3WKpwRzo.js +0 -3
- package/dist/client/assets/channel-BqKQxg-1.js +0 -1
- package/dist/client/assets/checkbox-MDl2t9_3.js +0 -1
- package/dist/client/assets/createReactComponent-BfrD_oQK.js +0 -1
- package/dist/client/assets/flowDiagram-OXPTDLAJ-DSokwYKA.js +0 -1
- package/dist/client/assets/index-CoZCJqTQ.js +0 -47
- package/dist/client/assets/index-DUERTTRS.css +0 -2
- package/dist/client/assets/katex-C6e6EqXB.js +0 -1
- package/dist/client/assets/select-pZpCy7qn.js +0 -1
- package/dist/client/assets/swimlanesDiagram-K3J5GTZL-DEFKR6Vf.js +0 -8
- package/dist/client/assets/tanstack-CYi5knVJ.js +0 -1
- package/dist/client/assets/viewer-tabs-MMNrJqGE.js +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{Ct as t,a as n,i as r,n as i,r as a,t as o,xt as s}from"./base-ui-DDpgJXgO.js";import{a as c,d as l,g as u,i as d,l as f,m as p,n as m,r as h,t as g}from"./tanstack-CVAt_k_T.js";import{t as _}from"./utils-D0T3A-kS.js";import{n as v,t as y}from"./createReactComponent-Ctub7J3a.js";import{t as b}from"./IconAlertTriangle-B9iDJKvP.js";import{n as x}from"./IconPlus-DJCoD3wt.js";import{t as S}from"./IconCheck-C-G-IA13.js";import{t as ee}from"./IconChevronDown-DU5i40lD.js";import{a as te,i as C,n as ne,o as w,r as re,t as ie}from"./select-Dq3KDX2O.js";import{t as ae}from"./IconEdit-CZe-EJxX.js";import{t as oe}from"./IconLoader4-D2VN7u1V.js";import{S as se,T,g as E,h as D,k as O,l as k,n as ce,v as A,w as le}from"./index-DsKvWsTs.js";import{a as ue,c as de,i as fe,l as pe,n as me,o as he,r as j}from"./shortcuts-BzIlT01I.js";import{At as ge,Dt as _e,Ft as ve,Gt as M,Ht as ye,It as be,Lt as xe,Mt as Se,Nt as Ce,Ot as we,Pt as Te,Rt as N,St as Ee,T as De,Tt as Oe,Vt as ke,Zt as Ae,jt as je,kt as Me,n as Ne,s as Pe,w as Fe,wt as Ie,xt as Le}from"./App-Bfw_TX8q.js";var Re=y(`outline`,`adjustments`,`Adjustments`,[[`path`,{d:`M4 10a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M6 4v4`,key:`svg-1`}],[`path`,{d:`M6 12v8`,key:`svg-2`}],[`path`,{d:`M10 16a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-3`}],[`path`,{d:`M12 4v10`,key:`svg-4`}],[`path`,{d:`M12 18v2`,key:`svg-5`}],[`path`,{d:`M16 7a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-6`}],[`path`,{d:`M18 4v1`,key:`svg-7`}],[`path`,{d:`M18 9v11`,key:`svg-8`}]]),ze=y(`outline`,`arrows-sort`,`ArrowsSort`,[[`path`,{d:`M3 9l4 -4l4 4m-4 -4v14`,key:`svg-0`}],[`path`,{d:`M21 15l-4 4l-4 -4m4 4v-14`,key:`svg-1`}]]),Be=y(`outline`,`browser`,`Browser`,[[`path`,{d:`M4 8h16`,key:`svg-0`}],[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-1`}],[`path`,{d:`M8 4v4`,key:`svg-2`}]]),Ve=y(`outline`,`keyboard`,`Keyboard`,[[`path`,{d:`M2 8a2 2 0 0 1 2 -2h16a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-16a2 2 0 0 1 -2 -2l0 -8`,key:`svg-0`}],[`path`,{d:`M6 10l0 .01`,key:`svg-1`}],[`path`,{d:`M10 10l0 .01`,key:`svg-2`}],[`path`,{d:`M14 10l0 .01`,key:`svg-3`}],[`path`,{d:`M18 10l0 .01`,key:`svg-4`}],[`path`,{d:`M6 14l0 .01`,key:`svg-5`}],[`path`,{d:`M18 14l0 .01`,key:`svg-6`}],[`path`,{d:`M10 14l4 .01`,key:`svg-7`}]]),He=y(`outline`,`link`,`Link`,[[`path`,{d:`M9 15l6 -6`,key:`svg-0`}],[`path`,{d:`M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464`,key:`svg-1`}],[`path`,{d:`M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463`,key:`svg-2`}]]),Ue=y(`outline`,`list`,`List`,[[`path`,{d:`M9 6l11 0`,key:`svg-0`}],[`path`,{d:`M9 12l11 0`,key:`svg-1`}],[`path`,{d:`M9 18l11 0`,key:`svg-2`}],[`path`,{d:`M5 6l0 .01`,key:`svg-3`}],[`path`,{d:`M5 12l0 .01`,key:`svg-4`}],[`path`,{d:`M5 18l0 .01`,key:`svg-5`}]]),P=y(`outline`,`moon`,`Moon`,[[`path`,{d:`M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454l0 .008`,key:`svg-0`}]]),We=y(`outline`,`network`,`Network`,[[`path`,{d:`M6 9a6 6 0 1 0 12 0a6 6 0 0 0 -12 0`,key:`svg-0`}],[`path`,{d:`M12 3c1.333 .333 2 2.333 2 6s-.667 5.667 -2 6`,key:`svg-1`}],[`path`,{d:`M12 3c-1.333 .333 -2 2.333 -2 6s.667 5.667 2 6`,key:`svg-2`}],[`path`,{d:`M6 9h12`,key:`svg-3`}],[`path`,{d:`M3 20h7`,key:`svg-4`}],[`path`,{d:`M14 20h7`,key:`svg-5`}],[`path`,{d:`M10 20a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-6`}],[`path`,{d:`M12 15v3`,key:`svg-7`}]]),Ge=y(`outline`,`qrcode`,`Qrcode`,[[`path`,{d:`M4 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-0`}],[`path`,{d:`M7 17l0 .01`,key:`svg-1`}],[`path`,{d:`M14 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-2`}],[`path`,{d:`M7 7l0 .01`,key:`svg-3`}],[`path`,{d:`M4 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-4`}],[`path`,{d:`M17 7l0 .01`,key:`svg-5`}],[`path`,{d:`M14 14l3 0`,key:`svg-6`}],[`path`,{d:`M20 14l0 .01`,key:`svg-7`}],[`path`,{d:`M14 14l0 3`,key:`svg-8`}],[`path`,{d:`M14 20l3 0`,key:`svg-9`}],[`path`,{d:`M17 17l3 0`,key:`svg-10`}],[`path`,{d:`M20 17l0 3`,key:`svg-11`}]]),Ke=y(`outline`,`shield-lock`,`ShieldLock`,[[`path`,{d:`M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3`,key:`svg-0`}],[`path`,{d:`M11 11a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M12 12l0 2.5`,key:`svg-2`}]]),qe=y(`outline`,`sort-ascending`,`SortAscending`,[[`path`,{d:`M4 6l7 0`,key:`svg-0`}],[`path`,{d:`M4 12l7 0`,key:`svg-1`}],[`path`,{d:`M4 18l9 0`,key:`svg-2`}],[`path`,{d:`M15 9l3 -3l3 3`,key:`svg-3`}],[`path`,{d:`M18 6l0 12`,key:`svg-4`}]]),Je=y(`outline`,`sort-descending`,`SortDescending`,[[`path`,{d:`M4 6l9 0`,key:`svg-0`}],[`path`,{d:`M4 12l7 0`,key:`svg-1`}],[`path`,{d:`M4 18l7 0`,key:`svg-2`}],[`path`,{d:`M15 15l3 3l3 -3`,key:`svg-3`}],[`path`,{d:`M18 6l0 12`,key:`svg-4`}]]),Ye=y(`outline`,`sparkles`,`Sparkles`,[[`path`,{d:`M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6`,key:`svg-0`}]]),Xe=y(`outline`,`sun`,`Sun`,[[`path`,{d:`M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0`,key:`svg-0`}],[`path`,{d:`M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7`,key:`svg-1`}]]),Ze=y(`outline`,`typography`,`Typography`,[[`path`,{d:`M4 20l3 0`,key:`svg-0`}],[`path`,{d:`M14 20l7 0`,key:`svg-1`}],[`path`,{d:`M6.9 15l6.9 0`,key:`svg-2`}],[`path`,{d:`M10.2 6.3l5.8 13.7`,key:`svg-3`}],[`path`,{d:`M5 20l6 -16l2 0l7 16`,key:`svg-4`}]]),F=e(t()),I=s();function Qe({repository:e}){let t=u(),n=e?.id??`none`,r=ce.aiRepositoryInstructions(n),i=l({queryKey:r,queryFn:()=>k.ai.repositoryInstructions(e.id),enabled:e!==null});(0,F.useEffect)(()=>{let r=()=>{t.invalidateQueries({queryKey:ce.aiRepositoryInstructions(n)})},i=k.events.onAiInstructionsChanged(t=>{(!t.length||t.includes(e?.id??``))&&r()}),a=k.events.onRepositoryChanged(t=>{t===e?.id&&r()});return()=>{i(),a()}},[t,n,e?.id]);let a=f({mutationFn:t=>k.ai.setRepositoryInstructions(e.id,t),onSuccess:e=>{t.setQueryData(r,e)},onError:()=>O.error({title:`Could not save repository instructions`})});return(0,I.jsxs)(`div`,{className:`settings-field settings-field-separated`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`This repository`}),(0,I.jsx)(`span`,{children:e?`Shared across its worktrees and connected clients.`:`Open a repository to configure its AI writing conventions.`})]}),(0,I.jsxs)(`div`,{className:`settings-general-row settings-general-toggle`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{id:`repository-ai-instructions-label`,children:`Use repository instructions`}),(0,I.jsx)(`span`,{id:`repository-ai-instructions-description`,children:`Apply repository terminology and structure to commit messages and PR drafts. English and Conventional Commits stay required. Off by default.`})]}),(0,I.jsxs)(`div`,{className:`settings-general-control`,children:[(0,I.jsx)(`span`,{className:`settings-general-switch-state`,"aria-hidden":`true`,children:i.data?.enabled?`On`:`Off`}),(0,I.jsx)(`button`,{type:`button`,role:`switch`,className:`settings-switch`,"aria-labelledby":`repository-ai-instructions-label`,"aria-describedby":`repository-ai-instructions-description`,"aria-checked":i.data?.enabled??!1,disabled:!e||!i.data||a.isPending,onClick:()=>a.mutate(!i.data?.enabled),children:(0,I.jsx)(`span`,{})})]})]}),e&&i.data&&(0,I.jsxs)(`p`,{className:`ai-privacy-note`,children:[i.data.files.length?`Detected: ${i.data.files.join(`, `)}.`:`No supported instruction files detected.`,` Only AGENTS.md, CLAUDE.md and GROK.md at this worktree’s root are supported. Hooks, tools and CLI configuration stay disabled.`]}),i.isError&&(0,I.jsxs)(`p`,{className:`ai-login-hint`,children:[`Could not check repository instructions. `,(0,I.jsx)(T,{variant:`outline`,size:`sm`,onClick:()=>void i.refetch(),children:`Try again`})]})]})}function $e({className:e,...t}){return(0,I.jsx)(n,{"data-slot":`accordion`,className:_(`w-full overflow-hidden rounded-xl border border-border`,e),...t})}function et({className:e,...t}){return(0,I.jsx)(r,{"data-slot":`accordion-item`,className:_(`not-last:border-b`,e),...t})}function tt({className:e,children:t,...n}){return(0,I.jsx)(a,{className:`flex`,children:(0,I.jsxs)(i,{"data-slot":`accordion-trigger`,className:_(`group flex flex-1 items-center justify-between gap-4 rounded-lg p-4 text-left text-xs font-semibold outline-none transition-colors hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring aria-disabled:pointer-events-none aria-disabled:opacity-50`,e),...n,children:[t,(0,I.jsx)(ee,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground transition-transform group-aria-expanded:rotate-180 motion-reduce:transition-none`})]})})}function nt({className:e,children:t,...n}){return(0,I.jsx)(o,{"data-slot":`accordion-content`,className:`accordion-content`,...n,children:(0,I.jsx)(`div`,{className:_(`px-4 pb-4`,e),children:t})})}function rt({harness:e,preferences:t,status:n,onPreference:r}){let i=t.aiExecutablePaths[e]??``,[a,o]=(0,F.useState)(i),[s,c]=(0,F.useState)(!1),l=async n=>{c(!0);try{await r({aiExecutablePaths:{...t.aiExecutablePaths,[e]:n}})!==!1&&o(n)}finally{c(!1)}};return(0,I.jsx)($e,{className:`ai-executable-settings`,children:(0,I.jsxs)(et,{value:`cli-detection`,children:[(0,I.jsx)(tt,{className:`ai-executable-trigger p-3`,children:(0,I.jsxs)(`span`,{className:`ai-executable-heading`,children:[(0,I.jsx)(Re,{"aria-hidden":`true`}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`strong`,{children:`Advanced CLI detection`}),(0,I.jsx)(`small`,{children:`Executable path and diagnostics`})]})]})}),(0,I.jsx)(nt,{className:`ai-executable-content`,children:(0,I.jsxs)(`div`,{className:`settings-field`,children:[(0,I.jsxs)(`label`,{className:`settings-field-label`,htmlFor:`ai-executable-path`,children:[(0,I.jsxs)(`strong`,{children:[Ne(e),` executable`]}),(0,I.jsx)(`span`,{children:`Leave on Automatic, or enter an absolute executable path without arguments. For web access, use a path on the server.`})]}),(0,I.jsxs)(`div`,{className:`ai-executable-editor`,children:[(0,I.jsx)(`input`,{className:`ai-executable-input`,id:`ai-executable-path`,value:a,onChange:e=>o(e.target.value),placeholder:`Automatic`,maxLength:4096,spellCheck:!1,autoComplete:`off`,disabled:s}),(0,I.jsxs)(`div`,{className:`ai-executable-actions`,children:[(0,I.jsx)(T,{size:`sm`,onClick:()=>void l(a),disabled:s||a===i,children:`Save path`}),(0,I.jsx)(T,{size:`sm`,variant:`outline`,onClick:()=>void l(``),disabled:s||!i&&!a,children:`Reset to Automatic`})]})]}),n?.executablePath&&(0,I.jsxs)(`div`,{className:`ai-executable-diagnostic`,children:[(0,I.jsx)(`strong`,{children:`Detected executable`}),(0,I.jsx)(`code`,{children:n.executablePath}),(0,I.jsxs)(`span`,{children:[`Source: `,it(n.executableSource)]})]}),n?.discoveryWarning&&(0,I.jsx)(`p`,{className:`ai-login-hint`,children:n.discoveryWarning})]})})]})})}function it(e){return e===`configured`?`Configured path`:e===`process-path`?`Inherited PATH`:e===`user-path`?`Refreshed user PATH`:`Known installation location`}function at(e){return JSON.stringify([`codex`,`claude`,`opencode`,`grok`].map(t=>e[t]??``))}var ot=(0,F.createContext)({});function st(e){let t=(0,F.useRef)(null);return t.current===null&&(t.current=e()),t.current}var ct=typeof window<`u`?F.useLayoutEffect:F.useEffect,lt=(0,F.createContext)(null);function ut(e,t){e.indexOf(t)===-1&&e.push(t)}function dt(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var ft=(e,t,n)=>n>t?t:n<e?e:n,pt={},mt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ht=e=>typeof e==`object`&&!!e,gt=e=>/^0[^.\s]+$/u.test(e);function _t(e){let t;return()=>(t===void 0&&(t=e()),t)}var L=e=>e,vt=(...e)=>e.reduce((e,t)=>n=>t(e(n))),yt=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},bt=class{constructor(){this.subscriptions=[]}add(e){return ut(this.subscriptions,e),()=>this.remove(e)}remove(e){dt(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},R=e=>e*1e3,z=e=>e/1e3,xt=(e,t)=>t?1e3/t*e:0,St=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Ct=1e-7,wt=12;function Tt(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=St(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Ct&&++s<wt);return o}function Et(e,t,n,r){if(e===t&&n===r)return L;let i=t=>Tt(t,0,1,e,n);return e=>e===0||e===1?e:St(i(e),t,r)}var Dt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ot=e=>t=>1-e(1-t),kt=Et(.33,1.53,.69,.99),At=Ot(kt),jt=Dt(At),Mt=e=>e>=1?1:(e*=2)<1?.5*At(e):.5*(2-2**(-10*(e-1))),Nt=e=>1-Math.sin(Math.acos(e)),Pt=Ot(Nt),Ft=Dt(Nt),It=Et(.42,0,1,1),Lt=Et(0,0,.58,1),Rt=Et(.42,0,.58,1),zt=e=>Array.isArray(e)&&typeof e[0]!=`number`,Bt=e=>Array.isArray(e)&&typeof e[0]==`number`,Vt={linear:L,easeIn:It,easeInOut:Rt,easeOut:Lt,circIn:Nt,circInOut:Ft,circOut:Pt,backIn:At,backInOut:jt,backOut:kt,anticipate:Mt},Ht=e=>typeof e==`string`,Ut=e=>{if(Bt(e)){e.length;let[t,n,r,i]=e;return Et(t,n,r,i)}return Ht(e)?(Vt[e],`${e}`,Vt[e]):e},B={delta:0,timestamp:0,isProcessing:!1},Wt;function Gt(){Wt=void 0}var V={now:()=>(Wt===void 0&&V.set(B.isProcessing||pt.useManualTiming?B.timestamp:performance.now()),Wt),set:e=>{Wt=e,queueMicrotask(Gt)}},Kt=e=>Math.round(e*1e5)/1e5,qt=e=>t=>typeof t==`string`&&t.startsWith(e),Jt=qt(`--`),Yt=qt(`var(--`),Xt=e=>Yt(e)?Zt.test(e.split(`/*`)[0].trim()):!1,Zt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Qt(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var $t={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},en={...$t,transform:e=>ft(0,1,e)},tn={...$t,default:1},nn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function rn(e){return e==null}var an=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,on=(e,t)=>n=>!!(typeof n==`string`&&an.test(n)&&n.startsWith(e)||t&&!rn(n)&&Object.prototype.hasOwnProperty.call(n,t)),sn=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(nn);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},cn=e=>ft(0,255,e),ln={...$t,transform:e=>Math.round(cn(e))},un={test:on(`rgb`,`red`),parse:sn(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+ln.transform(e)+`, `+ln.transform(t)+`, `+ln.transform(n)+`, `+Kt(en.transform(r))+`)`};function dn(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var fn={test:on(`#`),parse:dn,transform:un.transform},pn=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),mn=pn(`deg`),hn=pn(`%`),H=pn(`px`),gn=pn(`vh`),_n=pn(`vw`),vn={...hn,parse:e=>hn.parse(e)/100,transform:e=>hn.transform(e*100)},yn={test:on(`hsl`,`hue`),parse:sn(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+hn.transform(Kt(t))+`, `+hn.transform(Kt(n))+`, `+Kt(en.transform(r))+`)`},U={test:e=>un.test(e)||fn.test(e)||yn.test(e),parse:e=>un.test(e)?un.parse(e):yn.test(e)?yn.parse(e):fn.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?un.transform(e):yn.transform(e),getAnimatableNone:e=>{let t=U.parse(e);return t.alpha=0,U.transform(t)}},bn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,xn=new RegExp(nn.source),Sn=new RegExp(bn.source,`i`);function Cn(e){return isNaN(e)&&typeof e==`string`&&(xn.test(e)||Sn.test(e))}var wn=`number`,Tn=`color`,En=`var`,Dn=`var(`,On="${}",kn=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function An(e){let t=e.toString();return xn.test(t)||Sn.test(t)}function jn(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(kn,e=>(U.test(e)?(r.color.push(a),i.push(Tn),n.push(U.parse(e))):e.startsWith(Dn)?(r.var.push(a),i.push(En),n.push(e)):(r.number.push(a),i.push(wn),n.push(parseFloat(e))),++a,On)).split(On),indexes:r,types:i}}function Mn(e){return jn(e).values}function Nn({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===wn?Kt(r[a]):e===Tn?U.transform(r[a]):r[a]}return i}}function Pn(e){return Nn(jn(e))}var Fn=e=>typeof e==`number`?0:U.test(e)?U.getAnimatableNone(e):e,In=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Fn(e);function Ln(e){let t=jn(e);return Nn(t)(t.values.map((e,n)=>In(e,t.split[n])))}var W={test:Cn,parse:Mn,createTransformer:Pn,getAnimatableNone:Ln};function Rn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function zn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Rn(s,r,e+1/3),a=Rn(s,r,e),o=Rn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Bn(e,t){return n=>n>0?t:e}var G=(e,t,n)=>e+(t-e)*n,Vn=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Hn=[fn,un,yn],Un=e=>Hn.find(t=>t.test(e));function Wn(e){let t=Un(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===yn&&(n=zn(n)),n}var Gn=(e,t)=>{let n=Wn(e),r=Wn(t);if(!n||!r)return Bn(e,t);let i={...n};return e=>(i.red=Vn(n.red,r.red,e),i.green=Vn(n.green,r.green,e),i.blue=Vn(n.blue,r.blue,e),i.alpha=G(n.alpha,r.alpha,e),un.transform(i))},Kn=new Set([`none`,`hidden`]);function qn(e,t){return Kn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Jn(e,t){return n=>G(e,t,n)}function Yn(e){return typeof e==`number`?Jn:typeof e==`string`?Xt(e)?Bn:U.test(e)?Gn:$n:Array.isArray(e)?Xn:typeof e==`object`?U.test(e)?Gn:Zn:Bn}function Xn(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Yn(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Zn(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Yn(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Qn(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var $n=(e,t)=>{let n=W.createTransformer(t),r=jn(e),i=jn(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Kn.has(e)&&!i.values.length||Kn.has(t)&&!r.values.length?qn(e,t):vt(Xn(Qn(r,i),i.values),n):(`${e}${t}`,Bn(e,t))},er=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function tr(e,t){let n=er.exec(e);if(!n)return;let r=er.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Kt(G(a,o,e))+i}function nr(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return G(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=tr(e,t);if(n)return n}return Yn(e)(e,t)}var rr=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function ir(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var ar=40;function or(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=rr.reduce((e,t)=>(e[t]=ir(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=pt.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,ar),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:rr.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<rr.length;t++)o[rr[t]].cancel(e)},state:n,steps:o}}var{schedule:K,cancel:sr,steps:cr}=or(typeof requestAnimationFrame<`u`?requestAnimationFrame:L,!0,B),lr=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>K.update(t,e),stop:()=>sr(t),now:()=>B.isProcessing?B.timestamp:V.now()}},ur=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},dr=2e4;function fr(e,t=50,n=dr,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function pr(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(fr(r),dr);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:z(i)}}var q={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},mr=e=>e<0?1/Math.max(1+e,q.minDamping):Math.max(1-e,q.minDamping);function hr(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return vr(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function gr(e,t){return e*Math.sqrt(1-t*t)}var _r=12;function vr(e,t,n){let r=n;for(let n=1;n<_r;n++)r-=e(r)/t(r);return r}var yr=.001;function br({duration:e=q.duration,bounce:t=q.bounce}){let n,r;q.maxDuration;let i=mr(t);e=ft(q.minDuration,q.maxDuration,z(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=gr(t,i),o=Math.exp(-r);return yr-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=gr(t*t,i);return(-n(t)+yr>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=vr(n,r,a),s=o*hr(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:R(e)}}var xr=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Sr(e,t){if(xr(e,t))return e}function Cr(e){let t=Sr(e.stiffness),n=Sr(e.damping,!0),r=Sr(e.mass),i={...e,stiffness:t??q.stiffness,damping:n??q.damping,mass:r??q.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=mr(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*hr(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,br(i)),i.isResolvedFromDuration=!0;(!xr(i.stiffness)||!xr(i.damping,!0))&&(i.stiffness=q.stiffness,i.damping=q.damping)}return i}function wr(e=q.visualDuration,t=q.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Cr({...n}),f=e=>d?0:-z(e),p=s/(2*Math.sqrt(o*c)),m=z(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?q.restSpeed.granular:q.restSpeed.default),g.restDelta=n.restDelta||(e?q.restDelta.granular:q.restDelta.default)};_();let v,y,b;if(p<1){let e=gr(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>R(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=R(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(fr(S),dr),t=ur(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}wr.applyToOptions=e=>{let t=pr(e,100,wr);return e.ease=t.ease,e.duration=R(t.duration),e.type=`keyframes`,e};function Tr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=wr({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Er(e,t,n){let r=[],i=n||pt.mix||nr,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=vt(Array.isArray(t)?t[n]||L:t,a)),r.push(a)}return r}function Dr(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Er(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=yt(e[r],e[r+1],n);return s[r](i)};return n?t=>l(ft(e[0],e[a-1],t)):l}function Or(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=yt(0,t,r);e.push(G(n,1,i))}}function kr(e){let t=[0];return Or(t,e.length-1),t}function Ar(e,t){return e.map(e=>e*t)}function jr(e,t){return e.map(()=>t||Rt).splice(0,e.length-1)}function Mr({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=zt(r)?r.map(Ut):Ut(r)||Rt,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(pt.mix||nr)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?ft(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Dr(Ar(n&&n.length===t.length?n:kr(t),e),t,{ease:Array.isArray(i)?i:jr(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Nr=5;function Pr(e,t,n){let r=Math.max(t-Nr,0);return xt(n-e(r),t-r)}function Fr(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Pr(t=>e.next(t).value,t,e.next(t).value)}var Ir=e=>e!==null;function Lr(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Ir),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Rr={decay:Tr,inertia:Tr,tween:Mr,keyframes:Mr,spring:wr};function zr(e){typeof e.type==`string`&&(e.type=Rr[e.type])}function Br(e,t){return{kind:e,animation:t,timestamp:V.now(),frameTimestamp:B.timestamp,frameIsProcessing:B.isProcessing}}function Vr(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Br(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Hr(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Br(`layout-animation-start`,e),node:t})}catch{}}var Ur=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Wr=e=>e/100,Gr=class extends Ur{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==V.now()&&this.tick(V.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Vr(this,this.options)}initAnimation(){let{options:e}=this;zr(e);let{type:t=Mr,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Mr;s!==Mr&&typeof o[0]!=`number`&&(this.mixKeyframes=vt(Wr,nr(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=fr(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=ft(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Tr&&(b.value=Lr(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return z(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+z(e)}get time(){return z(this.currentTime)}set time(e){e=R(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Fr(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(V.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=z(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=lr,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(V.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},Kr=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function qr(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(nn)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Kr.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Jr=/\b([a-z-]*)\(.*?\)/gu,Yr={...W,getAnimatableNone:e=>{let t=e.match(Jr);return t?t.map(qr).join(` `):e}},Xr={...W,getAnimatableNone:e=>{let t=W.parse(e);return W.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Zr={...$t,transform:Math.round},Qr={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,inset:H,insetBlock:H,insetBlockStart:H,insetBlockEnd:H,insetInline:H,insetInlineStart:H,insetInlineEnd:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,paddingBlock:H,paddingBlockStart:H,paddingBlockEnd:H,paddingInline:H,paddingInlineStart:H,paddingInlineEnd:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,marginBlock:H,marginBlockStart:H,marginBlockEnd:H,marginInline:H,marginInlineStart:H,marginInlineEnd:H,fontSize:H,backgroundPositionX:H,backgroundPositionY:H,rotate:mn,pathRotation:mn,rotateX:mn,rotateY:mn,rotateZ:mn,scale:tn,scaleX:tn,scaleY:tn,scaleZ:tn,skew:mn,skewX:mn,skewY:mn,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:en,originX:vn,originY:vn,originZ:H,zIndex:Zr,fillOpacity:en,strokeOpacity:en,numOctaves:Zr},$r={...Qr,color:U,backgroundColor:U,outlineColor:U,fill:U,stroke:U,borderColor:U,borderTopColor:U,borderRightColor:U,borderBottomColor:U,borderLeftColor:U,filter:Yr,WebkitFilter:Yr,mask:Xr,WebkitMask:Xr},ei=e=>$r[e],ti=new Set([Yr,Xr]);function ni(e,t){let n=ei(e);return ti.has(n)||(n=W),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function ri(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var ii=e=>e*180/Math.PI,ai=e=>si(ii(Math.atan2(e[1],e[0]))),oi={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ai,rotateZ:ai,skewX:e=>ii(Math.atan(e[1])),skewY:e=>ii(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},si=e=>(e%=360,e<0&&(e+=360),e),ci=ai,li=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ui=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),di={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:li,scaleY:ui,scale:e=>(li(e)+ui(e))/2,rotateX:e=>si(ii(Math.atan2(e[6],e[5]))),rotateY:e=>si(ii(Math.atan2(-e[2],e[0]))),rotateZ:ci,rotate:ci,skewX:e=>ii(Math.atan(e[4])),skewY:e=>ii(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function fi(e){return+!!e.includes(`scale`)}function pi(e,t){if(!e||e===`none`)return fi(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=di,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=oi,i=t}if(!i)return fi(t);let a=r[t],o=i[1].split(`,`).map(hi);return typeof a==`function`?a(o):o[a]}var mi=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return pi(n,t)};function hi(e){return parseFloat(e.trim())}var gi=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],_i=new Set([...gi,`pathRotation`]),vi=e=>e===$t||e===H,yi=new Set([`x`,`y`,`z`]),bi=gi.filter(e=>!yi.has(e));function xi(e){let t=[];return bi.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Si=new Set([`bottom`,`right`]);function Ci(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var wi={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Ci(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Ci(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>pi(e,`x`),y:({transform:e})=>pi(e,`y`)};wi.translateX=wi.x,wi.translateY=wi.y;var Ti=new Set,Ei=!1,Di=!1,Oi=!1;function ki(){if(Di){let e=[],t=new Set,n=new Set;Ti.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Si.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=xi(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Di=!1,Ei=!1,Ti.forEach(e=>e.complete(Oi)),Ti.clear()}function Ai(){Ti.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Di=!0)})}function ji(){Oi=!0,Ai(),ki(),Oi=!1}function Mi(e,t,n){if(typeof e==`string`){if(mt(e)||gt(e))return parseFloat(e);if(!W.test(e)&&W.test(n))return ni(t,n)}return e??void 0}var Ni=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Ti.add(this),Ei||(Ei=!0,K.read(Ai),K.resolveKeyframes(ki))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Mi(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}ri(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ti.delete(this)}cancel(){this.state===`scheduled`&&(Ti.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Pi=e=>e.startsWith(`--`);function Fi(e,t,n){Pi(t)?e.style.setProperty(t,n):e.style[t]=n}var Ii={};function Li(e,t){let n=_t(e);return()=>Ii[t]??n()}var Ri=Li(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),zi=Li(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Bi=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Vi={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Bi([0,.65,.55,1]),circOut:Bi([.55,0,1,.45]),backIn:Bi([.31,.01,.66,-.59]),backOut:Bi([.33,1.53,.69,.99])};function Hi(e,t){if(e)return typeof e==`function`?zi()?ur(e,t):`ease-out`:Bt(e)?Bi(e):Array.isArray(e)?e.map(e=>Hi(e,t)||Vi.easeOut):Vi[e]}function Ui(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Hi(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Wi(e){return typeof e==`function`&&`applyToOptions`in e}function Gi({type:e,...t}){return Wi(e)&&zi()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Ki=class extends Ur{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Gi(e);this.animation=Ui(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Lr(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Fi(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Vr(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return z(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+z(e)}get time(){return z(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=R(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Ri()?(this.animation.timeline=e,t?.(this.animation),L):n(this)}},qi={anticipate:Mt,backInOut:jt,circInOut:Ft};function Ji(e){return e in qi}function Yi(e){typeof e.ease==`string`&&Ji(e.ease)&&(e.ease=qi[e.ease])}var Xi=10,Zi=class extends Ki{constructor(e){Yi(e),zr(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Gr({...a,autoplay:!1}),s=Math.max(Xi,V.now()-this.startTime),c=ft(0,Xi,s-Xi),l=o.sample(s).value,{name:u}=this.options;i&&u&&Fi(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},Qi=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(W.test(e)||e===`0`)&&!e.startsWith(`url(`));function $i(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function ea(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Qi(i,t),s=Qi(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):$i(e)||(n===`spring`||Wi(n))&&r}function ta(e){e.duration=0,e.type=`keyframes`}var na=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),ra=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ia(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&ra.test(e[t]))return!0;return!1}var aa=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),oa=_t(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function sa(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(na.has(n)||aa.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return oa()&&(na.has(n)||aa.has(n)&&ia(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var ca=40,la=class extends Ur{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=V.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Ni;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=V.now();let u=!0;ea(e,i,a,o)||(u=!1,(pt.instantAnimations||!s)&&l?.(Lr(e,n,t)),e[0]=e[e.length-1],ta(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>ca?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&sa(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new Zi(n)}catch{m=new Gr(n)}}else m=new Gr(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ji()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function ua(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var da=30,fa=e=>!isNaN(parseFloat(e)),pa={current:void 0},ma=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=V.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=V.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=fa(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new bt)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new bt,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){K.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return pa.current&&pa.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=V.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>da)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,da);return xt(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function ha(e,t){return new ma(e,t)}function ga(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function _a(e,t){let n=e?.[t]??e?.default??e;return n===e?n:ga(n,e)}var va={type:`spring`,stiffness:500,damping:25,restSpeed:10},ya=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ba={type:`keyframes`,duration:.8},xa={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Sa=(e,{keyframes:t})=>t.length>2?ba:_i.has(e)?e.startsWith(`scale`)?ya(t[1]):va:xa,Ca=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function wa(e){for(let t in e)if(!Ca.has(t))return!0;return!1}var Ta=(e,t,n,r={},i,a)=>o=>{let s=_a(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=R(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};wa(s)||Object.assign(u,Sa(e,u)),u.duration&&=R(u.duration),u.repeatDelay&&=R(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ta(u),u.delay===0&&(d=!0)),(pt.instantAnimations||pt.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,ta(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Lr(u.keyframes,s);if(e!==void 0){K.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Gr(u):new la(u)},Ea=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Da(e){let t=Ea.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Oa(e,t,n=1){`${e}`;let[r,i]=Da(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return mt(e)?parseFloat(e):e}return Xt(i)?Oa(i,t,n+1):i}function ka(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Aa(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...ka(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function ja(e,t,n){return Aa(e.getProps(),t,n,e)}var Ma=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Na=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...gi]),Pa=e=>Array.isArray(e);function Fa(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ha(n))}function Ia(e){return Pa(e)?e[e.length-1]||0:e}function La(e,t){let{transitionEnd:n={},transition:r={},...i}=ja(e,t)||{};i={...i,...n};for(let t in i)Fa(e,t,Ia(i[t]))}var J=e=>!!(e&&e.getVelocity);function Ra(e){return!!(J(e)&&e.add)}function za(e,t){let n=e.getValue(`willChange`);if(Ra(n))return n.add(t);if(!n&&pt.WillChange){let n=new pt.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Ba(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Va=`data-`+Ba(`framerAppearId`);function Ha(e){return e.props[Va]}var Ua=typeof window<`u`;function Wa({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Ga(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?ga(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Wa(f,t))continue;let o={delay:n,..._a(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){K.update(()=>r.set(i));continue}let p=!1;if(Ua&&window.MotionHandoffAnimation){let n=Ha(e);if(n){let e=window.MotionHandoffAnimation(n,t,K);e!==null&&(o.startTime=e,p=!0)}}za(e,t);let m=l??e.shouldReduceMotion;r.start(Ta(t,r,i,m&&Na.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>K.update(()=>{o&&La(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Ka(e,t,n={}){let r=ja(e,t,Ma(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Ga(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Ka(e,t,{...n,delay:r+(typeof o==`function`?0:o)+ua(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function qa(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Ka(e,t,n))):typeof t==`string`?Ka(e,t,n):Promise.all(Ga(e,ja(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var Ja={test:e=>e===`auto`,parse:e=>e},Ya=e=>t=>t.test(e),Xa=[$t,H,hn,mn,_n,gn,Ja],Za=e=>Xa.find(Ya(e));function Qa(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||gt(e)}var $a=new Set([`auto`,`none`,`0`]);function eo(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!$a.has(t)&&An(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=ni(n,i))}var to=class extends Ni{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Xt(r))){let i=Oa(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Na.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Za(r),o=Za(i);if(Qt(r)!==Qt(i)&&wi[n])this.needsMeasurement=!0;else if(a!==o){if(vi(a)&&vi(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else wi[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Qa(e[t]))&&n.push(t);n.length&&eo(e,n,t)}measure(){let{element:e,name:t}=this;return wi[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},no=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function ro(e){return ht(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function io(e){return ht(e)&&`ownerSVGElement`in e}var ao=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function oo(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var so={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},co=gi.length;function lo(e,t,n){let r=``,i=!0;for(let a=0;a<co;a++){let o=gi[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=ao(s,Qr[o]);if(!c){i=!1;let t=so[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${ao(a,Qr.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function uo(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(_i.has(e))o=!0;else if(Jt(e))i[e]=n;else{let t=ao(n,Qr[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=lo(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var fo={offset:`stroke-dashoffset`,array:`stroke-dasharray`},po={offset:`strokeDashoffset`,array:`strokeDasharray`};function mo(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?fo:po;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var ho=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function go(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(uo(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of ho)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&mo(d,i,a,o,!1)}function _o({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function vo({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function yo(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function bo(e){return e===void 0||e===1}function xo({scale:e,scaleX:t,scaleY:n}){return!bo(e)||!bo(t)||!bo(n)}function So(e){return xo(e)||Co(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Co(e){return wo(e.x)||wo(e.y)}function wo(e){return e&&e!==`0%`}function To(e,t,n){return n+t*(e-n)}function Eo(e,t,n,r,i){return i!==void 0&&(e=To(e,i,r)),To(e,n,r)+t}function Do(e,t=0,n=1,r,i){e.min=Eo(e.min,t,n,r,i),e.max=Eo(e.max,t,n,r,i)}function Oo(e,{x:t,y:n}){Do(e.x,t.translate,t.scale,t.originPoint),Do(e.y,n.translate,n.scale,n.originPoint)}var ko=.999999999999,Ao=1.0000000000001;function jo(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Mo(e.x,-a.scroll.offset.x),Mo(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Oo(e,o)),r&&So(a.latestValues)&&Fo(e,a.latestValues,a.layout?.layoutBox))}t.x<Ao&&t.x>ko&&(t.x=1),t.y<Ao&&t.y>ko&&(t.y=1)}function Mo(e,t){e.min+=t,e.max+=t}function No(e,t,n,r,i=.5){Do(e,t,n,G(e.min,e.max,i),r)}function Po(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Fo(e,t,n){let r=n??e;No(e.x,Po(t.x,r.x),t.scaleX,t.scale,t.originX),No(e.y,Po(t.y,r.y),t.scaleY,t.scale,t.originY)}function Io(e,t){return _o(yo(e.getBoundingClientRect(),t))}function Lo(e,t,n){let r=Io(e,n),{scroll:i}=t;return i&&(Mo(r.x,i.offset.x),Mo(r.y,i.offset.y)),r}var{schedule:Ro,cancel:zo}=or(queueMicrotask,!1),Y={x:!1,y:!1};function Bo(){return Y.x||Y.y}function Vo(e){return e===`x`||e===`y`?Y[e]?null:(Y[e]=!0,()=>{Y[e]=!1}):Y.x||Y.y?null:(Y.x=Y.y=!0,()=>{Y.x=Y.y=!1})}function Ho(e,t){let n=oo(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Uo(e){return!(e.pointerType===`touch`||Bo())}function Wo(e,t,n={}){let[r,i,a]=Ho(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Uo(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Go=(e,t)=>t?e===t||Go(e,t.parentElement):!1,Ko=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,qo=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Jo(e){return qo.has(e.tagName)||e.isContentEditable===!0}var Yo=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Xo(e){return Yo.has(e.tagName)||e.isContentEditable===!0}var Zo=new WeakSet;function Qo(e){return t=>{t.key===`Enter`&&e(t)}}function $o(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var es=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Qo(()=>{if(Zo.has(n))return;$o(n,`down`);let e=Qo(()=>{$o(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>$o(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function ts(e){return Ko(e)&&!Bo()}var ns=new WeakSet;function rs(e,t,n={}){let[r,i,a]=Ho(e,n),o=e=>{let r=e.currentTarget;if(!ts(e)||ns.has(e))return;Zo.add(r),n.stopPropagation&&ns.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Zo.has(r)&&Zo.delete(r),ts(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Go(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),ro(e)&&(e.addEventListener(`focus`,e=>es(e,i)),!Jo(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var is=new WeakMap,as,os=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:io(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ss=os(`inline`,`width`,`offsetWidth`),cs=os(`block`,`height`,`offsetHeight`);function ls({target:e,borderBoxSize:t}){is.get(e)?.forEach(n=>{n(e,{get width(){return ss(e,t)},get height(){return cs(e,t)}})})}function us(e){e.forEach(ls)}function ds(){typeof ResizeObserver<`u`&&(as=new ResizeObserver(us))}function fs(e,t){as||ds();let n=oo(e);return n.forEach(e=>{let n=is.get(e);n||(n=new Set,is.set(e,n)),n.add(t),as?.observe(e)}),()=>{n.forEach(e=>{let n=is.get(e);n?.delete(t),n?.size||as?.unobserve(e)})}}var ps=new Set,ms;function hs(){ms=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ps.forEach(t=>t(e))},window.addEventListener(`resize`,ms)}function gs(e){return ps.add(e),ms||hs(),()=>{ps.delete(e),!ps.size&&typeof ms==`function`&&(window.removeEventListener(`resize`,ms),ms=void 0)}}function _s(e,t){return typeof e==`function`?gs(e):fs(e,t)}var vs={value:null,addProjectionMetrics:null};function ys(e){return io(e)&&e.tagName===`svg`}var bs=e=>typeof e==`number`?e:parseFloat(e),xs=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ss=()=>({x:xs(),y:xs()}),Cs=()=>({min:0,max:0}),X=()=>({x:Cs(),y:Cs()}),ws=new WeakMap;function Ts(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Es(e){return typeof e==`string`||Array.isArray(e)}var Ds=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Os=[`initial`,...Ds];function ks(e){if(Ts(e.animate))return!0;for(let t=0;t<Os.length;t++)if(Es(e[Os[t]]))return!0;return!1}function As(e){return!!(ks(e)||e.variants)}function js(e,t,n){for(let r in t){let i=t[r],a=n[r];if(J(i))e.addValue(r,i);else if(J(a))e.addValue(r,ha(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,ha(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Ms={current:null},Ns={current:!1},Ps=typeof window<`u`;function Fs(){if(Ns.current=!0,Ps){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Ms.current=e.matches;e.addEventListener(`change`,t),t()}else Ms.current=!1}}var Is=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Ls={};function Rs(e){Ls=e}function zs(){return Ls}var Bs=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ni,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=V.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,K.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=ks(t),this.isVariantNode=As(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&J(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,ws.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Ns.current||Fs(),this.shouldReduceMotion=Ms.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),sr(this.notifyUpdate),sr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&na.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Ki({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:R(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=_i.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&K.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Ls){let t=Ls[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):X()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Is.length;t++){let n=Is[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=js(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=ha(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(mt(n)||gt(n))?n=parseFloat(n):typeof n!=`number`&&!W.test(n)&&W.test(t)&&(n=ni(e,t)),this.setBaseTarget(e,J(n)?n.get():n)),J(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new bt),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Ro.render(this.render)}},Vs=class extends Bs{constructor(){super(...arguments),this.KeyframeResolver=to}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;J(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Hs=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Us(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var Ws={};function Gs(e,{layout:t,layoutId:n}){return _i.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Ws[e]||e===`opacity`)}function Ks(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(J(r[t])||i&&J(i[t])||Gs(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function qs(e){return window.getComputedStyle(e)}var Js=class extends Vs{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Us}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(_i.has(t))return this.projection?.isProjecting?fi(t):mi(e,t);{let n=qs(e),r=(Jt(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Io(e,t)}build(e,t,n){uo(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ks(e,t,n)}},Ys=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Xs=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Zs(e,t,n,r){Us(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Ys.has(n)?n:Ba(n),t.attrs[n])}function Qs(e,t,n){let r=Ks(e,t,n);for(let n in e)if(J(e[n])||J(t[n])){let t=gi.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var $s=class extends Vs{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=X}getBaseTargetFromProps(e,t){return _i.has(t)?super.getBaseTargetFromProps(e,t)??fi(t):e[t]}getDefaultValue(e){return _i.has(e)?this.latestValues[e]??fi(e):void 0}readValueFromInstance(e,t){if(_i.has(t)){let e=ei(t);return e&&e.default||0}if(ho.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=Ys.has(t)?t:Ba(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Qs(e,t,n)}build(e,t,n){go(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Zs(e,t,n,r)}mount(e){this.isSVGTag=Xs(e.tagName),super.mount(e)}};function ec(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var tc=[...Ds].reverse();function nc(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>qa(e,t,n))),n=ic(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(tc.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?Es(g)||g===!1?g:void 0:h,v=Es(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||Ts(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=rc(i.prevProp,_),S=x||v&&(y&&!b||r>p),ee=!1,te=Array.isArray(_)?_:[_],C={};if(y!==!1)for(let n of te){let{transition:r,transitionEnd:i,...a}=ja(e,n,Ma(e,t))||{};C={...C,...a,...i}}let{prevResolvedValues:ne}=i;for(let t in{...ne,...C}){if(t in f)continue;let n=C[t],r=ne[t],a=Array.isArray(n)&&Array.isArray(r)?!ec(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(ee=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=C,i.isActive&&(f={...f,...C}),S&&(!(b&&x)||ee))for(let n of te){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=ja(s,n)?.transition?.delayChildren;r.delay=ua(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&ja(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!J(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=ic(),i=!0}}}function rc(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!ec(t,e):!1}function ic(){let e={};for(let t of Ds)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function ac(e,t){e.min=t.min,e.max=t.max}function Z(e,t){ac(e.x,t.x),ac(e.y,t.y)}function oc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var sc=.9999,cc=1.0001,lc=-.01,uc=.01;function Q(e){return e.max-e.min}function dc(e,t,n){return Math.abs(e-t)<=n}function fc(e,t,n,r=.5){e.origin=r,e.originPoint=G(t.min,t.max,e.origin),e.scale=Q(n)/Q(t),e.translate=G(n.min,n.max,e.origin)-e.originPoint,(e.scale>=sc&&e.scale<=cc||isNaN(e.scale))&&(e.scale=1),(e.translate>=lc&&e.translate<=uc||isNaN(e.translate))&&(e.translate=0)}function pc(e,t,n,r){fc(e.x,t.x,n.x,r?r.originX:void 0),fc(e.y,t.y,n.y,r?r.originY:void 0)}function mc(e,t,n,r=0){e.min=(r?G(n.min,n.max,r):n.min)+t.min,e.max=e.min+Q(t)}function hc(e,t,n,r){mc(e.x,t.x,n.x,r?.x),mc(e.y,t.y,n.y,r?.y)}function gc(e,t,n,r=0){let i=r?G(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Q(t)}function _c(e,t,n,r){gc(e.x,t.x,n.x,r?.x),gc(e.y,t.y,n.y,r?.y)}function vc(e,t,n,r,i){return e-=t,e=To(e,1/n,r),i!==void 0&&(e=To(e,1/i,r)),e}function yc(e,t=0,n=1,r=.5,i,a=e,o=e){if(hn.test(t)&&(t=parseFloat(t),t=G(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=G(a.min,a.max,r);e===a&&(s-=t),e.min=vc(e.min,t,n,s,i),e.max=vc(e.max,t,n,s,i)}function bc(e,t,[n,r,i],a,o){yc(e,t[n],t[r],t[i],t.scale,a,o)}var xc=[`x`,`scaleX`,`originX`],Sc=[`y`,`scaleY`,`originY`];function Cc(e,t,n,r){bc(e.x,t,xc,n?n.x:void 0,r?r.x:void 0),bc(e.y,t,Sc,n?n.y:void 0,r?r.y:void 0)}function wc(e){return e.translate===0&&e.scale===1}function Tc(e){return wc(e.x)&&wc(e.y)}function Ec(e,t){return e.min===t.min&&e.max===t.max}function Dc(e,t){return Ec(e.x,t.x)&&Ec(e.y,t.y)}function Oc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function kc(e,t){return Oc(e.x,t.x)&&Oc(e.y,t.y)}function Ac(e){return Q(e.x)/Q(e.y)}function jc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Mc(e){return[e(`x`),e(`y`)]}function Nc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Pc={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(H.test(e))e=parseFloat(e);else return e}return`${Nc(e,t.target.x)}% ${Nc(e,t.target.y)}%`}},Fc={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=W.parse(e);if(i.length>5)return r;let a=W.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=G(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function Ic(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Lc=no.length,Rc=e=>typeof e==`number`||H.test(e);function zc(e,t,n,r,i,a){i?(e.opacity=G(0,n.opacity??1,Vc(r)),e.opacityExit=G(t.opacity??1,0,Hc(r))):a&&(e.opacity=G(t.opacity??1,n.opacity??1,r));for(let i=0;i<Lc;i++){let a=no[i],o=Bc(t,a),s=Bc(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Rc(o)===Rc(s)?(e[a]=Math.max(G(bs(o),bs(s),r),0),(hn.test(s)||hn.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=G(t.rotate||0,n.rotate||0,r))}function Bc(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Vc=Uc(0,.5,Pt),Hc=Uc(.5,.95,L);function Uc(e,t,n){return r=>r<e?0:r>t?1:n(yt(e,t,r))}function Wc(e,t,n){let r=J(e)?e:ha(e);return r.start(Ta(``,r,t,n)),r.animation}function Gc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Kc=(e,t)=>e.depth-t.depth,qc=class{constructor(){this.children=[],this.isDirty=!1}add(e){ut(this.children,e),this.isDirty=!0}remove(e){dt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Kc),this.isDirty=!1,this.children.forEach(e)}};function Jc(e,t){let n=V.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(sr(r),e(a-t))};return K.setup(r,!0),()=>sr(r)}function Yc(e){return J(e)?e.get():e}var Xc=class{constructor(){this.members=[]}add(e){ut(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(dt(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(dt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Zc={borderRadius:{...Pc,applyTo:[...no]},borderTopLeftRadius:Pc,borderTopRightRadius:Pc,borderBottomLeftRadius:Pc,borderBottomRightRadius:Pc,boxShadow:Fc},Qc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Ws,{...Zc,...Ws});var $c={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},el=[``,`X`,`Y`,`Z`],tl=1e3,nl=0;function rl(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function il(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Ha(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,K,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&il(r)}function al({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=nl++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,vs.value&&($c.nodes=$c.calculatedTargetDeltas=$c.calculatedProjections=0),this.nodes.forEach(cl),this.nodes.forEach(vl),this.nodes.forEach(yl),this.nodes.forEach(ll),vs.addProjectionMetrics&&vs.addProjectionMetrics($c)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new qc)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new bt),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=io(t)&&!ys(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;K.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Jc(i,250),Qc.hasAnimatedSinceResize&&(Qc.hasAnimatedSinceResize=!1,this.nodes.forEach(_l)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||El,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!kc(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={..._a(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||_l(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),sr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(bl),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&il(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(fl),this.nodes.forEach(dl);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(pl);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ml),this.nodes.forEach(hl),this.nodes.forEach(gl),this.nodes.forEach(ol),this.nodes.forEach(sl)):this.nodes.forEach(pl),this.clearAllSnapshots();let e=V.now();B.delta=ft(0,1e3/60,e-B.timestamp),B.timestamp=e,B.isProcessing=!0,cr.update.process(B),cr.preRender.process(B),cr.render.process(B),B.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ro.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ul),this.sharedNodes.forEach(xl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,K.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){K.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Q(this.snapshot.measuredBox.x)&&!Q(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=X(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Tc(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||So(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Al(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return X();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Ml))){let{scroll:e}=this.root;e&&(Mo(t.x,e.offset.x),Mo(t.y,e.offset.y))}return t}removeElementScroll(e){let t=X();if(Z(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Z(t,e),Mo(t.x,i.offset.x),Mo(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||X();Z(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Mo(r.x,-n.scroll.offset.x),Mo(r.y,-n.scroll.offset.y)),So(n.latestValues)&&Fo(r,n.latestValues,n.layout?.layoutBox)}return So(this.latestValues)&&Fo(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=X();Z(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!So(n.latestValues))continue;let r;n.instance&&(xo(n.latestValues)&&n.updateSnapshot(),r=X(),Z(r,n.measurePageBox())),Cc(t,n.latestValues,n.snapshot?.layoutBox,r)}return So(this.latestValues)&&Cc(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==B.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=B.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=X(),this.targetWithTransforms=X()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hc(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Z(this.target,this.layout.layoutBox),Oo(this.target,this.targetDelta)):Z(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),vs.value&&$c.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||xo(this.parent.latestValues)||Co(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=X(),this.relativeTargetOrigin=X(),_c(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Z(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===B.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Z(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;jo(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=X());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(oc(this.prevProjectionDelta.x,this.projectionDelta.x),oc(this.prevProjectionDelta.y,this.projectionDelta.y)),pc(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!jc(this.projectionDelta.x,this.prevProjectionDelta.x)||!jc(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),vs.value&&$c.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ss(),this.projectionDelta=Ss(),this.projectionDeltaWithTransform=Ss()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Ss();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=X(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Tl));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=G(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=G(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Sl(o.x,e.x,n),Sl(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_c(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),wl(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Dc(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=X(),Z(f,this.relativeTarget)),c&&(this.animationValues=a,zc(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(sr(this.pendingAnimation),void 0),this.pendingAnimation=K.update(()=>{Qc.hasAnimatedSinceResize=!0,this.motionValue||=ha(0),this.motionValue.jump(0,!1),this.currentAnimation=Wc(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Hr(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(tl),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&jl(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||X();let t=Q(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Q(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}Z(t,i),Fo(t,r),pc(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Xc),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&rl(`z`,e,r,this.animationValues);for(let t=0;t<el.length;t++)rl(`rotate${el[t]}`,e,r,this.animationValues),rl(`skew${el[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Yc(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Yc(t?.pointerEvents)||``),this.hasProjected&&!So(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Ic(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Ws){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Ws[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Yc(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(dl),this.root.sharedNodes.clear()}}}function ol(e){e.updateLayout()}function sl(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Mc(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Q(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;ac(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else jl(i,t.layoutBox,n)&&Mc(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Q(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Ss();pc(o,n,t.layoutBox);let s=Ss();a?pc(s,e.applyTransform(r,!0),t.measuredBox):pc(s,n,t.layoutBox);let c=!Tc(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=X();_c(s,t.layoutBox,i.layoutBox,o);let c=X();_c(c,n,a.layoutBox,o),kc(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function cl(e){vs.value&&$c.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function ll(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ul(e){e.clearSnapshot()}function dl(e){e.clearMeasurements()}function fl(e){e.isLayoutDirty=!0,e.updateLayout()}function pl(e){e.isLayoutDirty=!1}function ml(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function hl(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function gl(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function _l(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function vl(e){e.resolveTargetDelta()}function yl(e){e.calcProjection()}function bl(e){e.resetSkewAndRotation()}function xl(e){e.removeLeadSnapshot()}function Sl(e,t,n){e.translate=G(t.translate,0,n),e.scale=G(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Cl(e,t,n,r){e.min=G(t.min,n.min,r),e.max=G(t.max,n.max,r)}function wl(e,t,n,r){Cl(e.x,t.x,n.x,r),Cl(e.y,t.y,n.y,r)}function Tl(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var El={duration:.45,ease:[.4,0,.1,1]},Dl=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ol=Dl(`applewebkit/`)&&!Dl(`chrome/`)?Math.round:L;function kl(e){e.min=Ol(e.min),e.max=Ol(e.max)}function Al(e){kl(e.x),kl(e.y)}function jl(e,t,n){return e===`position`||e===`preserve-aspect`&&!dc(Ac(t),Ac(n),.2)}function Ml(e){return e!==e.root&&e.scroll?.wasRoot}var Nl=al({attachResizeListener:(e,t)=>Gc(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Pl={current:void 0},Fl=al({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Pl.current){let e=new Nl({});e.mount(window),e.setOptions({layoutScroll:!0}),Pl.current=e}return Pl.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Il=(0,F.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Ll(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Rl(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ll(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ll(e[t],null)}}}}function zl(...e){return F.useCallback(Rl(...e),e)}var Bl=class extends F.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(ro(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=ro(e)&&e.offsetWidth||0,r=ro(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function Vl({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,F.useId)(),s=(0,F.useRef)(null),c=(0,F.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,F.useContext)(Il),u=zl(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,F.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${o}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${e}px !important;
|
|
5
|
+
height: ${u}px !important;
|
|
6
|
+
${_}px !important;
|
|
7
|
+
${v}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,I.jsx)(Bl,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:F.cloneElement(e,{ref:u})})}var Hl=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=st(Ul),d=(0,F.useId)(),f=(0,F.useRef)(n),p=(0,F.useRef)(r);ct(()=>{f.current=n,p.current=r});let m=!0,h=(0,F.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,F.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),F.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,I.jsx)(Vl,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,I.jsx)(lt.Provider,{value:h,children:e})};function Ul(){return new Map}function Wl(e=!0){let t=(0,F.useContext)(lt);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,F.useId)();(0,F.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,F.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Gl=e=>e.key||``;function Kl(e){let t=[];return F.Children.forEach(e,e=>{(0,F.isValidElement)(e)&&t.push(e)}),t}var ql=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Wl(o),f=(0,F.useMemo)(()=>Kl(e),[e]),p=o&&!u?[]:f.map(Gl),m=(0,F.useRef)(!0),h=st(()=>new Map),g=(0,F.useRef)(new Set),[_,v]=(0,F.useState)(f),[y,b]=(0,F.useState)(f);ct(()=>{o&&!u&&!y.length&&d?.()},[u,o,y.length,d]),ct(()=>{m.current=!1;for(let e=0;e<y.length;e++){let t=Gl(y[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[y,p.length,p.join(`-`)]);let x=[];if(f!==_){let e=[...f],t=0;for(let n of y){let r=p.indexOf(Gl(n));r===-1?(e.splice(t++,0,n),x.push(n)):t=r+x.length+1}return x.every(e=>h.get(Gl(e)))?e=f:a===`wait`&&(e=x),b(Kl(e)),v(f),null}let{forceRender:S}=(0,F.useContext)(ot);return(0,I.jsx)(I.Fragment,{children:y.map(e=>{let _=Gl(e),b=o&&!u?!1:f===y||p.includes(_);return(0,I.jsx)(Hl,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(S?.(),v([]),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},_)})})},Jl=(0,F.createContext)({strict:!1}),Yl={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Xl=!1;function Zl(){if(Xl)return;let e={};for(let t in Yl)e[t]={isEnabled:e=>Yl[t].some(t=>!!e[t])};Rs(e),Xl=!0}function Ql(){return Zl(),zs()}function $l(e){let t=Ql();for(let n in e)t[n]={...t[n],...e[n]};Rs(t)}var eu=(0,F.createContext)({});function tu(e,t){if(ks(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Es(t)?t:void 0,animate:Es(n)?n:void 0}}return e.inherit===!1?{}:t}function nu(e){let{initial:t,animate:n}=tu(e,(0,F.useContext)(eu));return(0,F.useMemo)(()=>({initial:t,animate:n}),[ru(t),ru(n)])}function ru(e){return Array.isArray(e)?e.join(` `):e}var iu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function au(e,t,n){for(let r in t)!J(t[r])&&!Gs(r,n)&&(e[r]=t[r])}function ou({transformTemplate:e},t){return(0,F.useMemo)(()=>{let n=iu();return uo(n,t,e),Object.assign({},n.vars,n.style)},[t])}function su(e,t){let n=e.style||{},r={};return au(r,n,e),Object.assign(r,ou(e,t)),r}function cu(e,t){let n={},r=su(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var lu=()=>({...iu(),attrs:{}});function uu(e,t,n,r){let i=(0,F.useMemo)(()=>{let n=lu();return go(n,t,Xs(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};au(t,e.style,e),i.style={...t,...i.style}}return i}var du=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function fu(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||du.has(e)}function pu(e,t){return e.startsWith(`on`)?!fu(e):t?.(e)??!fu(e)}function mu(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(J(e[a])||(pu(a,r)||n===!0&&fu(a)||!t&&!fu(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var hu=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function gu(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(hu.indexOf(e)>-1||/[A-Z]/u.test(e))}function _u(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??gu(e)?uu:cu)(t,r,i,e),l=mu(t,typeof e==`string`,a,s),u=e===F.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,F.useMemo)(()=>J(d)?d.get():d,[d]);return(0,F.createElement)(e,{...u,children:f})}function vu({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:yu(n,r,i,e),renderState:t()}}function yu(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Yc(a[e]);let{initial:o,animate:s}=e,c=ks(e),l=As(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Ts(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Aa(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var bu=e=>(t,n)=>{let r=(0,F.useContext)(eu),i=(0,F.useContext)(lt),a=()=>vu(e,t,r,i);return n?a():st(a)},xu=bu({scrapeMotionValuesFromProps:Ks,createRenderState:iu}),Su=bu({scrapeMotionValuesFromProps:Qs,createRenderState:lu}),Cu=Symbol.for(`motionComponentSymbol`);function wu(e,t,n){let r=(0,F.useRef)(n);(0,F.useInsertionEffect)(()=>{r.current=n});let i=(0,F.useRef)(null);return(0,F.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Tu=(0,F.createContext)({});function Eu(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Du(e,t,n,r,i,a){let{visualElement:o}=(0,F.useContext)(eu),s=(0,F.useContext)(Jl),c=(0,F.useContext)(lt),l=(0,F.useContext)(Il),u=l.reducedMotion,d=l.skipAnimations,f=(0,F.useRef)(null),p=(0,F.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,F.useContext)(Tu);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Ou(f.current,n,i,h);let g=(0,F.useRef)(!1);(0,F.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Va],v=(0,F.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return ct(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),ct(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,F.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Ou(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:ku(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Eu(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function ku(e){if(e)return e.options.allowProjection===!1?ku(e.parent):e.projection}function Au(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&$l(r);let a=n?n===`svg`:gu(e),o=a?Su:xu;function s(n,s){let c,l={...(0,F.useContext)(Il),...n,layoutId:ju(n)},{isStatic:u,isValidProp:d}=l,f=nu(n),p=o(n,u);if(!u&&typeof window<`u`){Mu(l,r);let t=Nu(l);c=t.MeasureLayout,f.visualElement=Du(e,p,l,i,t.ProjectionNode,a)}return(0,I.jsxs)(eu.Provider,{value:f,children:[c&&f.visualElement?(0,I.jsx)(c,{visualElement:f.visualElement,...l}):null,_u(e,n,wu(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,F.forwardRef)(s);return c[Cu]=e,c}function ju({layoutId:e}){let t=(0,F.useContext)(ot).id;return t&&e!==void 0?t+`-`+e:e}function Mu(e,t){(0,F.useContext)(Jl).strict}function Nu(e){let{drag:t,layout:n}=Ql();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Pu(e,t){if(typeof Proxy>`u`)return Au;let n=new Map,r=(n,r)=>Au(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Au(a,void 0,e,t)),n.get(a))})}var Fu=(e,t)=>t.isSVG??gu(e)?new $s(t):new Js(t,{allowProjection:e!==F.Fragment}),Iu=class extends Hs{constructor(e){super(e),e.animationState||=nc(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Ts(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Lu=0,Ru={animation:{Feature:Iu},exit:{Feature:class extends Hs{constructor(){super(...arguments),this.id=Lu++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=ja(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function zu(e){return{point:{x:e.pageX,y:e.pageY}}}var Bu=e=>t=>Ko(t)&&e(t,zu(t));function Vu(e,t,n,r){return Gc(e,t,Bu(n),r)}var Hu=({current:e})=>e?e.ownerDocument.defaultView:null,Uu=(e,t)=>Math.abs(e-t);function Wu(e,t){let n=Uu(e.x,t.x),r=Uu(e.y,t.y);return Math.sqrt(n**2+r**2)}var Gu=new Set([`auto`,`scroll`]),Ku=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=qu(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Yu(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Wu(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:V.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=qu(t,this.transformPagePoint),this.hasPendingMove=!0,K.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Yu(e.type===`pointercancel`?this.lastMoveEventInfo:qu(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Ko(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=qu(zu(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=B;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Yu(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=vt(Vu(this.contextWindow,`pointermove`,this.handlePointerMove,d),Vu(this.contextWindow,`pointerup`,this.handlePointerUp,d),Vu(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Gu.has(e.overflowX)||Gu.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),K.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),sr(this.updatePoint)}};function qu(e,t){return t?{point:t(e.point)}:e}function Ju(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Yu({point:e},t){return{point:e,delta:Ju(e,Zu(t)),offset:Ju(e,Xu(t)),velocity:Qu(t,.1)}}function Xu(e){return e[0]}function Zu(e){return e[e.length-1]}function Qu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Zu(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>R(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>R(t)*2&&(r=e[1]);let a=z(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function $u(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?G(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?G(n,e,r.max):Math.min(e,n)),e}function ed(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function td(e,{top:t,left:n,bottom:r,right:i}){return{x:ed(e.x,n,i),y:ed(e.y,t,r)}}function nd(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function rd(e,t){return{x:nd(e.x,t.x),y:nd(e.y,t.y)}}function id(e,t){let n=.5,r=Q(e),i=Q(t);return i>r?n=yt(t.min,t.max-r,e.min):r>i&&(n=yt(e.min,e.max-i,t.min)),ft(0,1,n)}function ad(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var od=.35;function sd(e=od){return e===!1?e=0:e===!0&&(e=od),{x:cd(e,`left`,`right`),y:cd(e,`top`,`bottom`)}}function cd(e,t,n){return{min:ld(e,t),max:ld(e,n)}}function ld(e,t){return typeof e==`number`?e:e[t]||0}var ud=new WeakMap,dd=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=X(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vo(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Mc(e=>{let t=this.getAxisMotionValue(e).get()||0;if(hn.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Q(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&K.update(()=>i(e,t),!1,!0),za(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;r&&this.currentDirection===null?(this.currentDirection=hd(o),this.currentDirection!==null&&i&&i(this.currentDirection)):(this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&K.update(()=>a(e,t),!1,!0))},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Ku(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Hu(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&K.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!md(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=$u(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Eu(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?td(n.layoutBox,e):!1,this.elastic=sd(t),r!==this.constraints&&!Eu(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Mc(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=ad(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Eu(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Lo(n,r.root,this.visualElement.getTransformPagePoint()),a=rd(r.layout.layoutBox,i);if(t){let e=t(vo(a));this.hasMutatedConstraints=!!e,e&&(a=_o(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Mc(o=>{if(!md(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return za(this.visualElement,e),n.start(Ta(e,n,0,t,this.visualElement,!1))}stopAnimation(){Mc(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Mc(e=>{if(!md(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-G(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Eu(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Mc(e=>{let t=this.getAxisMotionValue(e).get();i[e]=id({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Mc(t=>{let n=this.getAxisMotionValue(t);if(!md(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(G(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ud.set(this.visualElement,this);let e=this.visualElement.current,t=Vu(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Xo(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Eu(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=pd(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),K.read(r);let o=Gc(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Mc(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=od,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function fd(e){let t=!0;return()=>{t?t=!1:e()}}function pd(e,t,n){let r=_s(e,fd(n)),i=_s(t,fd(n));return()=>{r(),i()}}function md(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function hd(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var gd=class extends Hs{constructor(e){super(e),this.removeGroupControls=L,this.removeListeners=L,this.controls=new dd(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||L}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},_d=e=>(t,n)=>{e&&K.update(()=>e(t,n),!1,!0)},vd=class extends Hs{constructor(){super(...arguments),this.removePointerDownListener=L}onPointerDown(e){this.session=new Ku(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Hu(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:_d(e),onStart:_d(t),onMove:_d(n),onEnd:(e,t)=>{delete this.session,r&&K.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Vu(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},yd=!1,bd=class extends F.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),yd&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Qc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a&&(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),yd=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||K.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Ro.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;yd=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function xd(e){let[t,n]=Wl(),r=(0,F.useContext)(ot);return(0,I.jsx)(bd,{...e,layoutGroup:r,switchLayoutGroup:(0,F.useContext)(Tu),isPresent:t,safeToRemove:n})}var Sd={pan:{Feature:vd},drag:{Feature:gd,ProjectionNode:Fl,MeasureLayout:xd}};function Cd(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&K.postRender(()=>i(t,zu(t)))}var wd=class extends Hs{mount(){let{current:e}=this.node;e&&(this.unmount=Wo(e,(e,t)=>(Cd(this.node,t,`Start`),e=>Cd(this.node,e,`End`))))}unmount(){}},Td=class extends Hs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=vt(Gc(this.node.current,`focus`,()=>this.onFocus()),Gc(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Ed(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&K.postRender(()=>i(t,zu(t)))}var Dd=class extends Hs{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=rs(e,(e,t)=>(Ed(this.node,t,`Start`),(e,{success:t})=>Ed(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Od=new WeakMap,kd=new WeakMap,Ad=e=>{let t=Od.get(e.target);t&&t(e)},jd=e=>{e.forEach(Ad)};function Md({root:e,...t}){let n=e||document;kd.has(n)||kd.set(n,{});let r=kd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(jd,{root:e,...t})),r[i]}function Nd(e,t,n){let r=Md(t);return Od.set(e,n),r.observe(e),()=>{Od.delete(e),r.unobserve(e)}}var Pd={some:0,all:1},Fd=class extends Hs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Pd[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Nd(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Id(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Id({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Ld={inView:{Feature:Fd},tap:{Feature:Dd},focus:{Feature:Td},hover:{Feature:wd}},Rd={layout:{ProjectionNode:Fl,MeasureLayout:xd}},zd=Pu({...Ru,...Ld,...Sd,...Rd},Fu);function Bd(){!Ns.current&&Fs();let[e]=(0,F.useState)(Ms.current);return e}var Vd=zd;function Hd({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full`,children:(0,I.jsx)(`table`,{"data-slot":`table`,className:_(`w-full caption-bottom text-xs`,e),...t})})}function Ud({className:e,...t}){return(0,I.jsx)(`thead`,{"data-slot":`table-header`,className:_(`[&_tr]:border-b`,e),...t})}function Wd({className:e,...t}){return(0,I.jsx)(`tbody`,{"data-slot":`table-body`,className:_(`[&_tr:last-child]:border-0`,e),...t})}function Gd({className:e,...t}){return(0,I.jsx)(`tr`,{"data-slot":`table-row`,className:_(`border-b border-border transition-colors hover:bg-muted/40 data-[state=selected]:bg-muted`,e),...t})}function Kd({className:e,...t}){return(0,I.jsx)(`th`,{"data-slot":`table-head`,className:_(`h-8 whitespace-nowrap px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function qd({className:e,...t}){return(0,I.jsx)(`td`,{"data-slot":`table-cell`,className:_(`px-2 py-1.5 align-middle [&:has([role=checkbox])]:pr-0`,e),...t})}var Jd={"commit-message":`commit message`,"pull-request-draft":`pull request draft`};function Yd({column:e,label:t}){let n=e.getIsSorted();return(0,I.jsxs)(`button`,{type:`button`,className:`ai-log-sort-button`,onClick:()=>e.toggleSorting(n===`asc`),children:[t,n===`asc`&&(0,I.jsx)(qe,{size:13}),n===`desc`&&(0,I.jsx)(Je,{size:13}),!n&&(0,I.jsx)(ze,{size:13,className:`ai-log-sort-idle`})]})}var Xd=d({rowSortingFeature:h,sortedRowModel:m()}),Zd=c(),Qd=Zd.columns([Zd.accessor(`status`,{header:({column:e})=>(0,I.jsx)(Yd,{column:e,label:`Status`}),cell:({getValue:e})=>{let t=e();return(0,I.jsx)(Oe,{variant:t===`success`?`secondary`:t===`cancelled`?`outline`:`destructive`,children:t})}}),Zd.accessor(`harness`,{header:({column:e})=>(0,I.jsx)(Yd,{column:e,label:`Harness`}),cell:({getValue:e})=>(0,I.jsx)(`strong`,{children:e()})}),Zd.accessor(`model`,{header:({column:e})=>(0,I.jsx)(Yd,{column:e,label:`Model`}),cell:({getValue:e})=>(0,I.jsx)(`span`,{className:`ai-log-model`,children:e()})}),Zd.accessor(`operation`,{header:({column:e})=>(0,I.jsx)(Yd,{column:e,label:`Task`}),cell:({getValue:e})=>Jd[e()]}),Zd.accessor(e=>new Date(e.at).getTime(),{id:`at`,header:({column:e})=>(0,I.jsx)(Yd,{column:e,label:`Date`}),cell:({row:e})=>(0,I.jsx)(`time`,{dateTime:e.original.at,children:_e(e.original.at,{seconds:!0})})}),Zd.accessor(`durationMs`,{header:({column:e})=>(0,I.jsx)(Yd,{column:e,label:`Duration`}),cell:({getValue:e})=>`${(e()/1e3).toFixed(1)}s`}),Zd.accessor(e=>(e.usage.inputTokens??0)+(e.usage.outputTokens??0),{id:`usage`,header:({column:e})=>(0,I.jsx)(Yd,{column:e,label:`Usage`}),cell:({row:e})=>nf(e.original)}),Zd.accessor(`stagedFileCount`,{header:({column:e})=>(0,I.jsx)(Yd,{column:e,label:`Staged`}),cell:({getValue:e})=>e()??`—`}),Zd.display({id:`notes`,header:`Notes`,cell:({row:e})=>{let t=e.original,n=[];return t.errorCode&&n.push({key:`error`,text:t.errorCode,tone:`error`}),t.errorMessage&&n.push({key:`error-message`,text:t.errorMessage,tone:`error`,detail:t.errorMessage}),t.splitOffered===!0&&n.push({key:`split`,text:`split: ${t.splitGroups} commits`}),t.splitRejectedReason&&n.push({key:`rejected`,text:`split refused: ${t.splitRejectedReason}`,tone:`warn`,detail:t.splitRejectedReason}),t.splitBlockedReason&&n.push({key:`blocked`,text:`no split: ${t.splitBlockedReason}`,detail:t.splitBlockedReason}),t.contextTruncated===!0&&n.push({key:`truncated`,text:`context trimmed`}),n.length===0?null:(0,I.jsx)(`div`,{className:`ai-log-row-notes`,children:n.map(e=>(0,I.jsx)(tf,{text:e.text,tone:e.tone,detail:e.detail},e.key))})}})]);function $d({open:e,onOpenChange:t}){let[n,r]=(0,F.useState)([]),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)([]),c=(0,F.useCallback)(async()=>{a(!0);try{r(await k.ai.log())}catch(e){O.error({title:`Could not read the AI history`,description:af(e)})}finally{a(!1)}},[]);(0,F.useEffect)(()=>{e&&c()},[c,e]);let l=(0,F.useMemo)(()=>{let e=n.filter(e=>e.status===`failed`).length;return{runs:n.length,failed:e,tokens:n.reduce((e,t)=>e+(t.usage.inputTokens??0)+(t.usage.outputTokens??0),0),cost:n.reduce((e,t)=>e+(t.usage.costUsd??0),0),costed:n.filter(e=>e.usage.costUsd!==null).length}},[n]),u=g({features:Xd,data:n,columns:Qd,onSortingChange:s,state:{sorting:o}}),d=async()=>{if(window.confirm(`Delete the whole AI history? This cannot be undone.`))try{await k.ai.clearLog(),r([])}catch(e){O.error({title:`Could not clear the AI history`,description:af(e)})}};return(0,I.jsx)(Me,{open:e,onOpenChange:t,children:(0,I.jsxs)(Se,{className:`ai-log-dialog`,children:[(0,I.jsxs)(`header`,{className:`ai-log-header`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Ce,{children:`AI history`}),(0,I.jsx)(je,{children:`Recent generations on this machine. Prompts and file contents are never recorded.`})]}),(0,I.jsxs)(`div`,{className:`ai-log-header-actions`,children:[(0,I.jsxs)(T,{variant:`outline`,size:`sm`,disabled:i,onClick:()=>void c(),children:[i?(0,I.jsx)(oe,{className:`animate-spin`}):(0,I.jsx)(N,{}),` Refresh`]}),(0,I.jsxs)(T,{variant:`ghost`,size:`sm`,disabled:n.length===0,onClick:()=>void d(),children:[(0,I.jsx)(ve,{}),` Clear`]}),(0,I.jsx)(ge,{render:(0,I.jsx)(T,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close AI history`}),children:(0,I.jsx)(Te,{})})]})]}),n.length>0&&(0,I.jsxs)(`div`,{className:`ai-log-totals`,children:[(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`strong`,{children:l.runs}),` runs`]}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`strong`,{children:l.failed}),` failed`]}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`strong`,{children:rf(l.tokens)}),` tokens`]}),l.costed>0&&(0,I.jsxs)(`span`,{children:[(0,I.jsxs)(`strong`,{children:[`$`,l.cost.toFixed(4)]}),` reported by `,l.costed,` of `,l.runs]})]}),(0,I.jsxs)(`div`,{className:`ai-log-body`,children:[i&&n.length===0&&(0,I.jsxs)(`div`,{className:`view-loading`,role:`status`,children:[(0,I.jsx)(oe,{className:`spinner`}),` `,(0,I.jsx)(v,{text:`Reading history…`})]}),!i&&n.length===0&&(0,I.jsx)(`p`,{className:`ai-log-empty`,children:`No generations recorded yet. Generate a commit message and it will show up here.`}),n.length>0&&(0,I.jsx)(`div`,{className:`ai-log-table-wrap`,children:(0,I.jsxs)(Hd,{children:[(0,I.jsx)(Ud,{children:u.getHeaderGroups().map(e=>(0,I.jsx)(Gd,{children:e.headers.map(e=>(0,I.jsx)(Kd,{children:e.isPlaceholder?null:(0,I.jsx)(u.FlexRender,{header:e})},e.id))},e.id))}),(0,I.jsx)(Wd,{children:u.getRowModel().rows.map(e=>(0,I.jsx)(Gd,{className:e.original.status===`failed`?`ai-log-row-failed`:void 0,children:e.getAllCells().map(e=>(0,I.jsx)(qd,{children:(0,I.jsx)(u.FlexRender,{cell:e})},e.id))},e.id))})]})})]})]})})}var ef=140;function tf({text:e,tone:t,detail:n}){let[r,i]=(0,F.useState)(!1),a=e.length>ef?`${e.slice(0,139)}…`:e,o=`ai-log-note ${t??``}`;return n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(`button`,{type:`button`,className:o,onClick:()=>i(!0),"aria-label":`Read generation details`}),children:a}),(0,I.jsx)(E,{className:`max-w-md`,children:n})]}),(0,I.jsx)(Me,{open:r,onOpenChange:i,children:(0,I.jsx)(Se,{className:`name-dialog`,children:(0,I.jsxs)(`div`,{className:`name-dialog-content`,children:[(0,I.jsx)(Ce,{children:`Generation details`}),(0,I.jsx)(je,{className:`whitespace-pre-wrap break-words`,children:n}),(0,I.jsx)(`div`,{className:`name-dialog-actions`,children:(0,I.jsx)(ge,{render:(0,I.jsx)(T,{variant:`outline`}),children:`Close`})})]})})})]}):(0,I.jsx)(`span`,{className:o,children:a})}function nf(e){let{inputTokens:t,outputTokens:n,costUsd:r}=e.usage;if(t===null&&n===null)return`no usage reported`;let i=`${rf(t??0)} in · ${rf(n??0)} out`;return r===null?i:`${i} · $${r.toFixed(4)}`}function rf(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function af(e){return e instanceof Error?e.message:`An unexpected error occurred.`}var of=[{value:`system`,label:`System`,icon:Ae},{value:`light`,label:`Light`,icon:Xe},{value:`dark`,label:`Dark`,icon:P}],sf=[{value:`tree`,label:`Tree`,icon:ye},{value:`list`,label:`List`,icon:Ue}],cf=[{value:`geist`,label:`Geist`,family:`'Geist Variable', sans-serif`},{value:`plus-jakarta-sans`,label:`Plus Jakarta Sans`,family:`'Plus Jakarta Sans Variable', sans-serif`},{value:`space-grotesk`,label:`Space Grotesk`,family:`'Space Grotesk Variable', sans-serif`}],lf=[{value:`geist-mono`,label:`Geist Mono`,family:`'Geist Mono Variable', ui-monospace, monospace`},{value:`jetbrains-mono`,label:`JetBrains Mono`,family:`'JetBrains Mono Variable', ui-monospace, monospace`},{value:`inconsolata`,label:`Inconsolata`,family:`'Inconsolata Variable', ui-monospace, monospace`},{value:`departure`,label:`Departure Mono`,family:`'Departure Mono', ui-monospace, monospace`},{value:`space-grotesk`,label:`Space Grotesk`,family:`'Space Grotesk Variable', sans-serif`}],uf=[0,15,30,60,120,300];function df({label:e,description:t,children:n,toggle:r=!1}){return(0,I.jsxs)(`div`,{className:`settings-general-row${r?` settings-general-toggle`:``}`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:e}),(0,I.jsx)(`span`,{children:t})]}),(0,I.jsx)(`div`,{className:`settings-general-control`,children:n})]})}function ff({label:e,options:t,value:n,onChange:r}){return(0,I.jsx)(`div`,{className:`settings-theme-options`,role:`radiogroup`,"aria-label":e,children:t.map(({value:e,label:i,icon:a},o)=>(0,I.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n===e,tabIndex:n===e?0:-1,className:`settings-theme-option${n===e?` active`:``}`,onClick:()=>r(e),onKeyDown:e=>{if(![`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key))return;e.preventDefault();let n=e.key===`Home`?0:e.key===`End`?t.length-1:(o+([`ArrowLeft`,`ArrowUp`].includes(e.key)?-1:1)+t.length)%t.length,i=t[n];i&&(r(i.value),e.currentTarget.parentElement?.querySelectorAll(`button`)[n]?.focus())},children:[(0,I.jsx)(a,{"aria-hidden":`true`}),(0,I.jsx)(`span`,{children:i})]},e))})}function pf({label:e,options:t,value:n,onChange:r}){let i=t.find(e=>e.value===n);return(0,I.jsxs)(ie,{value:n,onValueChange:e=>{let n=t.find(t=>t.value===e);n&&r(n.value)},children:[(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(te,{className:`settings-general-select w-[220px] text-[11px] font-normal`,"aria-label":e,style:{fontFamily:i?.family}}),children:(0,I.jsx)(w,{children:i?.label??n})}),(0,I.jsx)(E,{children:i?.label})]}),(0,I.jsx)(ne,{align:`end`,alignItemWithTrigger:!1,className:`settings-general-font-menu min-w-[14rem]`,children:t.map(e=>(0,I.jsx)(C,{value:e.value,className:`min-h-8 text-xs font-normal`,children:(0,I.jsx)(`span`,{style:{fontFamily:e.family},children:e.label})},e.value))})]})}function mf(e){return e===0?`Off`:e>=60&&e%60==0?`${e/60} ${e===60?`minute`:`minutes`}`:`${e} seconds`}function hf({preferences:e,onPreference:t,showRepositoryOptions:n=!0}){let r=(0,F.useId)(),i=(0,F.useRef)(null),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(!1),p=e.remoteFetchIntervalSeconds,m=()=>{o(null),c(!1),i.current?.focus()};return(0,I.jsxs)(`div`,{className:`settings-general`,children:[(0,I.jsxs)(`div`,{className:`settings-general-content`,children:[(0,I.jsxs)(`section`,{className:`settings-general-group`,"aria-labelledby":`${r}-appearance`,children:[(0,I.jsxs)(`h3`,{id:`${r}-appearance`,children:[(0,I.jsx)(Xe,{"aria-hidden":`true`}),`Appearance`]}),(0,I.jsx)(df,{label:`Theme`,description:`Follow your system or choose a theme.`,children:(0,I.jsx)(ff,{label:`Theme`,options:of,value:e.theme,onChange:e=>t({theme:e})})}),(0,I.jsx)(df,{label:`Interface font`,description:`Menus, labels and navigation.`,children:(0,I.jsx)(pf,{label:`Interface font`,options:cf,value:e.uiFont,onChange:e=>t({uiFont:e})})}),(0,I.jsx)(df,{label:`Code font`,description:`Code, diffs and the file viewer.`,children:(0,I.jsx)(pf,{label:`Code font`,options:lf,value:e.monoFont,onChange:e=>t({monoFont:e})})}),(0,I.jsx)(df,{label:`Interface size`,description:`Scale text, icons and controls.`,children:(0,I.jsxs)(`div`,{className:`settings-zoom-control`,children:[(0,I.jsx)(`input`,{type:`range`,min:`80`,max:`130`,step:`10`,value:e.uiZoom,onChange:e=>t({uiZoom:Number(e.target.value)}),"aria-label":`Interface zoom`}),(0,I.jsxs)(`output`,{"aria-live":`off`,children:[e.uiZoom,`%`]})]})}),d&&(0,I.jsxs)(`div`,{id:`${r}-preview`,className:`settings-general-preview`,children:[(0,I.jsxs)(`span`,{children:[(0,I.jsx)(M,{"aria-hidden":`true`}),`src / components / Button.tsx`]}),(0,I.jsxs)(`code`,{children:[(0,I.jsx)(`span`,{children:`const`}),` changes = files.filter(isModified);`]})]})]}),(0,I.jsxs)(`section`,{className:`settings-general-group`,"aria-labelledby":`${r}-files`,children:[(0,I.jsxs)(`h3`,{id:`${r}-files`,children:[(0,I.jsx)(M,{"aria-hidden":`true`}),`Files & viewer`]}),(0,I.jsx)(df,{label:`Changes layout`,description:`Folders or a flat list.`,children:(0,I.jsx)(ff,{label:`Changes layout`,options:sf,value:e.changesLayout,onChange:e=>t({changesLayout:e})})}),(0,I.jsxs)(df,{label:`Wrap long lines`,description:`Fit lines to the viewer width.`,toggle:!0,children:[(0,I.jsx)(`span`,{className:`settings-general-switch-state`,"aria-hidden":`true`,children:e.wrapLines?`On`:`Off`}),(0,I.jsx)(`button`,{type:`button`,role:`switch`,"aria-label":`Wrap long lines`,"aria-checked":e.wrapLines,className:`settings-switch`,onClick:()=>t({wrapLines:!e.wrapLines}),children:(0,I.jsx)(`span`,{})})]}),n&&(0,I.jsxs)(df,{label:`Show ignored files`,description:(0,I.jsxs)(I.Fragment,{children:[`Include files excluded by `,(0,I.jsx)(`code`,{children:`.gitignore`}),`.`]}),toggle:!0,children:[(0,I.jsx)(`span`,{className:`settings-general-switch-state`,"aria-hidden":`true`,children:e.showDotEnvFiles?`On`:`Off`}),(0,I.jsx)(`button`,{type:`button`,role:`switch`,"aria-label":`Show ignored files`,"aria-checked":e.showDotEnvFiles,className:`settings-switch`,onClick:()=>t({showDotEnvFiles:!e.showDotEnvFiles}),children:(0,I.jsx)(`span`,{})})]})]}),n&&(0,I.jsxs)(`section`,{className:`settings-general-group`,"aria-labelledby":`${r}-sync`,children:[(0,I.jsxs)(`h3`,{id:`${r}-sync`,children:[(0,I.jsx)(N,{"aria-hidden":`true`}),`Repository sync`]}),(0,I.jsx)(df,{label:`Remote check interval`,description:`Keep ahead / behind counts current.`,children:(0,I.jsxs)(ie,{value:String(p),onValueChange:e=>{c(!1),e===`custom`?o(String(p||30)):e!==null&&uf.includes(Number(e))&&(o(null),t({remoteFetchIntervalSeconds:Number(e)}))},children:[(0,I.jsx)(te,{ref:i,className:`settings-general-select settings-general-interval w-[174px] text-[11px] font-normal`,"aria-label":`Remote check interval`,children:(0,I.jsx)(w,{children:mf(p)})}),(0,I.jsxs)(ne,{align:`end`,alignItemWithTrigger:!1,className:`min-w-[14rem]`,children:[uf.map(e=>(0,I.jsxs)(C,{value:String(e),className:`min-h-8 text-xs font-normal`,children:[mf(e),e===30&&(0,I.jsx)(`small`,{className:`settings-general-option-note`,children:`Default`})]},e)),!uf.includes(p)&&(0,I.jsxs)(C,{value:String(p),className:`min-h-8 text-xs font-normal`,children:[mf(p),(0,I.jsx)(`small`,{className:`settings-general-option-note`,children:`Custom`})]}),(0,I.jsxs)(C,{value:`custom`,className:`min-h-8 text-xs font-normal`,children:[`Custom…`,(0,I.jsx)(`small`,{className:`settings-general-option-note`,children:`5–300 seconds`})]})]})]})}),(0,I.jsxs)(`div`,{className:`settings-general-help`,children:[(0,I.jsx)(`span`,{children:p===0?`Periodic fetch is off.`:`Checks every ${p} seconds.`}),(0,I.jsx)(`button`,{type:`button`,"aria-expanded":l,"aria-controls":`${r}-interval-help`,onClick:()=>u(!l),children:`What does Off do?`})]}),l&&(0,I.jsx)(`p`,{id:`${r}-interval-help`,className:`settings-general-help-detail`,children:`Off disables periodic fetch. Remote checks still run when you pull or push.`}),a!==null&&(0,I.jsxs)(`form`,{className:`settings-general-custom`,noValidate:!0,onSubmit:e=>{e.preventDefault();let n=Number(a);!Number.isFinite(n)||n<5||n>300||n%5!=0?c(!0):(t({remoteFetchIntervalSeconds:n}),m())},children:[(0,I.jsxs)(`div`,{className:`settings-general-custom-controls`,children:[(0,I.jsx)(`label`,{htmlFor:`${r}-custom-interval`,children:`Every`}),(0,I.jsx)(`input`,{id:`${r}-custom-interval`,type:`number`,min:5,max:300,step:5,required:!0,autoFocus:!0,value:a,"aria-label":`Custom interval in seconds`,"aria-invalid":s,"aria-describedby":`${r}-interval-range`,onChange:e=>{o(e.target.value),c(!1)},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),m())}}),(0,I.jsx)(`span`,{children:`seconds`}),(0,I.jsx)(T,{type:`submit`,variant:`outline`,size:`sm`,children:`Apply`}),(0,I.jsx)(T,{type:`button`,variant:`ghost`,size:`sm`,onClick:m,children:`Cancel`})]}),(0,I.jsx)(`p`,{id:`${r}-interval-range`,className:s?`settings-general-error`:`settings-general-help-detail`,role:s?`alert`:void 0,children:`Choose 5–300 seconds, in steps of 5.`})]})]})]}),(0,I.jsxs)(`footer`,{className:`settings-general-footer`,children:[(0,I.jsxs)(`span`,{children:[(0,I.jsx)(S,{"aria-hidden":`true`}),`Changes apply immediately`]}),(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":d,"aria-controls":`${r}-preview`,onClick:()=>f(!d),children:[(0,I.jsx)(Ze,{"aria-hidden":`true`}),`Text preview`]})]})]})}function gf({column:e,label:t}){let n=e.getIsSorted();return(0,I.jsxs)(`button`,{type:`button`,className:`ai-log-sort-button`,onClick:()=>e.toggleSorting(n===`asc`),children:[t,n===`asc`&&(0,I.jsx)(qe,{size:13}),n===`desc`&&(0,I.jsx)(Je,{size:13}),!n&&(0,I.jsx)(ze,{size:13,className:`ai-log-sort-idle`})]})}var _f=d({rowSortingFeature:h,sortedRowModel:m()}),vf=c(),yf=vf.columns([vf.accessor(`level`,{header:({column:e})=>(0,I.jsx)(gf,{column:e,label:`Level`}),cell:({getValue:e})=>{let t=e();return(0,I.jsx)(Oe,{variant:t===`warn`?`outline`:`destructive`,children:t})}}),vf.accessor(`operation`,{header:({column:e})=>(0,I.jsx)(gf,{column:e,label:`Operation`}),cell:({getValue:e})=>(0,I.jsx)(`strong`,{children:e()})}),vf.accessor(`code`,{header:({column:e})=>(0,I.jsx)(gf,{column:e,label:`Code`}),cell:({getValue:e})=>e()??`—`}),vf.accessor(e=>new Date(e.at).getTime(),{id:`at`,header:({column:e})=>(0,I.jsx)(gf,{column:e,label:`Date`}),cell:({row:e})=>(0,I.jsx)(`time`,{dateTime:e.original.at,children:_e(e.original.at,{seconds:!0})})}),vf.accessor(`message`,{header:({column:e})=>(0,I.jsx)(gf,{column:e,label:`Message`}),cell:({getValue:e})=>(0,I.jsx)(`span`,{className:`ai-log-model`,children:e()})})]);function bf(e){return e instanceof Error?e.message:`An unexpected error occurred.`}function xf({open:e,onOpenChange:t}){let[n,r]=(0,F.useState)([]),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)([]),c=(0,F.useCallback)(async()=>{a(!0);try{r(await k.diagnostics.list())}catch(e){O.error({title:`Could not read local problems`,description:bf(e)})}finally{a(!1)}},[]);(0,F.useEffect)(()=>{e&&c()},[c,e]);let l=(0,F.useMemo)(()=>({all:n.length,errors:n.filter(e=>e.level===`error`).length}),[n]),u=g({features:_f,data:n,columns:yf,onSortingChange:s,state:{sorting:o}}),d=async()=>{if(window.confirm(`Delete the local problem history? This cannot be undone.`))try{await k.diagnostics.clear(),r([])}catch(e){O.error({title:`Could not clear local problems`,description:bf(e)})}};return(0,I.jsx)(Me,{open:e,onOpenChange:t,children:(0,I.jsxs)(Se,{className:`ai-log-dialog`,children:[(0,I.jsxs)(`header`,{className:`ai-log-header`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(Ce,{children:`Problem history`}),(0,I.jsx)(je,{children:`Recent local failures on this machine. Prompts and file contents are never recorded.`})]}),(0,I.jsxs)(`div`,{className:`ai-log-header-actions`,children:[(0,I.jsxs)(T,{variant:`outline`,size:`sm`,disabled:i,onClick:()=>void c(),children:[i?(0,I.jsx)(oe,{className:`animate-spin`}):(0,I.jsx)(N,{}),` Refresh`]}),(0,I.jsxs)(T,{variant:`ghost`,size:`sm`,disabled:n.length===0,onClick:()=>void d(),children:[(0,I.jsx)(ve,{}),` Clear`]}),(0,I.jsx)(ge,{render:(0,I.jsx)(T,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close problem history`}),children:(0,I.jsx)(Te,{})})]})]}),n.length>0&&(0,I.jsxs)(`div`,{className:`ai-log-totals`,children:[(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`strong`,{children:l.all}),` recorded`]}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`strong`,{children:l.errors}),` errors`]})]}),(0,I.jsxs)(`div`,{className:`ai-log-body`,children:[i&&n.length===0&&(0,I.jsxs)(`div`,{className:`view-loading`,role:`status`,children:[(0,I.jsx)(oe,{className:`spinner`}),` `,(0,I.jsx)(v,{text:`Reading problems…`})]}),!i&&n.length===0&&(0,I.jsx)(`p`,{className:`ai-log-empty`,children:`No local problems recorded yet. Failed Git, file, and network operations will show up here.`}),n.length>0&&(0,I.jsx)(`div`,{className:`ai-log-table-wrap`,children:(0,I.jsxs)(Hd,{children:[(0,I.jsx)(Ud,{children:u.getHeaderGroups().map(e=>(0,I.jsx)(Gd,{children:e.headers.map(e=>(0,I.jsx)(Kd,{children:e.isPlaceholder?null:(0,I.jsx)(u.FlexRender,{header:e})},e.id))},e.id))}),(0,I.jsx)(Wd,{children:u.getRowModel().rows.map(e=>(0,I.jsx)(Gd,{className:e.original.level===`error`?`ai-log-row-failed`:void 0,children:e.getAllCells().map(e=>(0,I.jsx)(qd,{children:(0,I.jsx)(u.FlexRender,{cell:e})},e.id))},e.id))})]})})]})]})})}var Sf=new Set([`Control`,`Shift`,`Alt`,`Meta`]);function Cf({preferences:e,onPreference:t}){let n=(0,F.useMemo)(()=>pe(e.shortcutOverrides),[e.shortcutOverrides]),[r,i]=(0,F.useState)(null),a=Object.keys(e.shortcutOverrides).length>0,o=(0,F.useMemo)(()=>[`General`,`Commit`,`Editor`,`Tabs`].map(e=>({category:e,definitions:j.filter(t=>t.category===e)})),[]),s=(0,F.useMemo)(()=>[...new Set(me.map(e=>e.category))].map(e=>({category:e,items:me.filter(t=>t.category===e)})),[]),c=(r,a)=>{if(a===n[r]){i(null);return}let o=fe(r,a,n);if(o){let e=o===`reserved`?`${ue(a)} is reserved for a fixed shortcut.`:`${ue(a)} is already used by "${j.find(e=>e.id===o).label}".`;i({id:r,message:e});return}i(null);let s=j.find(e=>e.id===r),c={...e.shortcutOverrides};a===s.defaultCombo?delete c[r]:c[r]=a,t({shortcutOverrides:c})},l=n=>{i(null);let r={...e.shortcutOverrides};delete r[n],t({shortcutOverrides:r})};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`settings-field settings-toggle-row`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`Show and focus from anywhere`}),(0,I.jsx)(`span`,{children:`Double-tap Control to bring OpenTig to the front, even while another app is focused.`})]}),(0,I.jsx)(`button`,{type:`button`,role:`switch`,"aria-label":`Show and focus from anywhere`,"aria-checked":e.doubleControlShortcutEnabled,className:`settings-switch`,onClick:()=>t({doubleControlShortcutEnabled:!e.doubleControlShortcutEnabled}),children:(0,I.jsx)(`span`,{})})]}),(0,I.jsxs)(`div`,{className:`settings-field settings-field-separated`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`Keyboard shortcuts`}),(0,I.jsx)(`span`,{children:`Click a shortcut, then press a new key combination. Press Escape to cancel.`})]}),a&&(0,I.jsxs)(T,{variant:`outline`,size:`sm`,className:`shortcuts-reset-all`,onClick:()=>{i(null),t({shortcutOverrides:{}})},children:[(0,I.jsx)(xe,{}),` Reset all to defaults`]}),o.map(({category:t,definitions:i})=>(0,I.jsxs)(`div`,{className:`shortcuts-group`,children:[(0,I.jsx)(`div`,{className:`shortcuts-group-heading`,children:t}),i.map(t=>(0,I.jsxs)(`div`,{className:`shortcuts-row`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:t.label}),(0,I.jsx)(`span`,{children:t.description})]}),(0,I.jsx)(wf,{combo:n[t.id],allowBare:t.allowBare,isCustom:e.shortcutOverrides[t.id]!==void 0,error:r?.id===t.id?r.message:null,onCapture:e=>c(t.id,e),onReset:()=>l(t.id)})]},t.id))]},t))]}),(0,I.jsxs)(`div`,{className:`settings-field settings-field-separated`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`Fixed shortcuts`}),(0,I.jsx)(`span`,{children:`These follow platform and file-manager conventions and cannot be changed.`})]}),s.map(({category:e,items:t})=>(0,I.jsxs)(`div`,{className:`shortcuts-group`,children:[(0,I.jsx)(`div`,{className:`shortcuts-group-heading`,children:e}),t.map(e=>(0,I.jsxs)(`div`,{className:`shortcuts-fixed-row`,children:[(0,I.jsx)(`span`,{children:e.label}),(0,I.jsx)(Ee,{children:e.combo.split(` / `).flatMap((e,t)=>[...t>0?[(0,I.jsx)(`span`,{className:`shortcuts-fixed-sep`,children:` / `},`sep-${e}`)]:[],...e.split(` + `).map((t,n)=>(0,I.jsx)(Le,{children:t},`${e}-${n}`))])})]},e.combo+e.label))]},e))]})]})}function wf({combo:e,allowBare:t,isCustom:n,error:r,onCapture:i,onReset:a}){let[o,s]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{if(!o)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){s(!1);return}if(Sf.has(e.key))return;let n=de(e);s(!1),n&&he(n,t)&&i(n)};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[o,t,i]),(0,I.jsxs)(`div`,{className:`shortcut-recorder`,children:[r&&(0,I.jsx)(`span`,{className:`shortcut-recorder-error`,children:r}),(0,I.jsx)(`button`,{type:`button`,className:`shortcut-recorder-button ${o?`listening`:``} ${r?`error`:``}`,onClick:()=>s(!0),onBlur:()=>s(!1),children:o?`Press a key…`:(0,I.jsx)(Ee,{children:e.split(`+`).map(e=>(0,I.jsx)(Le,{children:e},e))})}),n&&(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(T,{variant:`ghost`,size:`icon-xs`,"aria-label":`Reset to default`,onClick:a}),children:(0,I.jsx)(xe,{})}),(0,I.jsx)(E,{children:`Reset to default`})]})]})}function Tf(e){let t=e.trim();if(!t||t.length>2048||/[\s\\]/.test(t)||!/^https?:\/\/[^/?#]+\/?$/i.test(t))throw Error(`Enter an HTTP or HTTPS address without a path, query, fragment, or credentials.`);let n=new URL(t);if(n.protocol!==`http:`&&n.protocol!==`https:`||n.username||n.password||n.pathname!==`/`||n.search||n.hash)throw Error(`Enter an HTTP or HTTPS address without a path, query, fragment, or credentials.`);return n.origin}var Ef=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(Ef||{}),Df=[0,1],Of=[1,0],kf=[2,3],Af=[3,2],jf={L:Df,M:Of,Q:kf,H:Af},Mf=/^\d*$/,Nf=/^[A-Z0-9 $%*+./:-]*$/,Pf=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,Ff=1,If=40,Lf=3,Rf=3,zf=40,Bf=10,Vf=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Hf=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],Uf=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,e<Ff||e>If)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,Ef.Timing),this.setFunctionModule(e,6,e%2==0,Ef.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,Gf(r,e));this.setFunctionModule(8,7,Gf(r,6)),this.setFunctionModule(8,8,Gf(r,7)),this.setFunctionModule(7,8,Gf(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,Gf(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,Gf(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,Gf(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=Gf(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;a>=0&&a<this.size&&o>=0&&o<this.size&&this.setFunctionModule(a,o,i!==2&&i!==4,Ef.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,Ef.Alignment)}setFunctionModule(e,t,n,r=Ef.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==op(t,n))throw RangeError(`Invalid argument`);let r=Hf[n[0]][t],i=Vf[n[0]][t],a=Math.floor(ap(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=sp(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=cp(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor(ap(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=Gf(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=Lf:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*zf),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*zf}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=Lf:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*zf),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*zf}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=Rf)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*Bf,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function Wf(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function Gf(e,t){return!!(e>>>t&1)}var Kf=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},qf=[1,10,12,14],Jf=[2,9,11,13],Yf=[4,8,16,16];function Xf(e,t){return e[Math.floor((t+7)/17)+1]}function Zf(e){let t=[];for(let n of e)Wf(n,8,t);return new Kf(Yf,e.length,t)}function Qf(e){if(!tp(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);Wf(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new Kf(qf,e.length,t)}function $f(e){if(!np(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n=0;for(;n+2<=e.length;n+=2){let r=Pf.indexOf(e.charAt(n))*45;r+=Pf.indexOf(e.charAt(n+1)),Wf(r,11,t)}return n<e.length&&Wf(Pf.indexOf(e.charAt(n)),6,t),new Kf(Jf,e.length,t)}function ep(e){return e===``?[]:tp(e)?[Qf(e)]:np(e)?[$f(e)]:[Zf(ip(e))]}function tp(e){return Mf.test(e)}function np(e){return Nf.test(e)}function rp(e,t){let n=0;for(let r of e){let e=Xf(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function ip(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function ap(e){if(e<Ff||e>If)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function op(e,t){return Math.floor(ap(e)/8)-Vf[t[0]][e]*Hf[t[0]][e]}function sp(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=lp(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=lp(n,2)}return t}function cp(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=lp(t,e))}return n}function lp(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function up(e,t,n=1,r=40,i=-1,a=!0){if(!(Ff<=n&&n<=r&&r<=If)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=op(o,t)*8,i=rp(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[Of,kf,Af])a&&s<=op(o,e)*8&&(t=e);let c=[];for(let t of e){Wf(t.mode[0],4,c),Wf(t.numChars,Xf(t.mode,o),c);for(let e of t.getData())c.push(e)}let l=op(o,t)*8;Wf(0,Math.min(4,l-c.length),c),Wf(0,(8-c.length%8)%8,c);for(let e=236;c.length<l;e^=253)Wf(e,8,c);let u=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((e,t)=>u[t>>>3]|=e<<7-(t&7)),new Uf(o,t,u,i)}function dp(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?ep(e):Array.isArray(e)?[Zf(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=up(c,jf[n],i,a,o,r),u=fp({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function fp(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=Ef.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}function pp(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function mp(e,t={}){let n=dp(e,t),{pixelSize:r=10,whiteColor:i=`white`,blackColor:a=`black`}=t,o=n.size*r,s=n.size*r,c=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${o}">`,l=[];for(let e=0;e<n.size;e++)for(let t=0;t<n.size;t++){let i=t*r,a=e*r;n.data[e][t]&&l.push(`M${i},${a}h${r}v${r}h-${r}z`)}return c+=`<rect fill="${pp(i)}" width="${s}" height="${o}"/>`,c+=`<path fill="${pp(a)}" d="${l.join(``)}"/>`,c+=`</svg>`,c}async function hp(){let e=await fetch(`/api/auth/sessions`,{credentials:`include`});if(!e.ok)throw Error(await bp(e,`Could not load owner sessions.`));let t=await e.json();if(!Array.isArray(t.sessions))throw Error(`OpenTig returned an invalid session list.`);return t.sessions}async function gp(e){return yp(`/api/auth/sessions/revoke`,{sessionId:e})}async function _p(){return yp(`/api/auth/sessions/revoke-all`,{})}async function vp(e,t){let n=await fetch(`/api/auth/sessions/rename`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e,clientName:t})});if(!n.ok)throw Error(await bp(n,`Could not rename the browser session.`))}async function yp(e,t){let n=await fetch(e,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(await bp(n,`Could not revoke the browser session.`));let r=await n.json();if(!Number.isSafeInteger(r.revokedCount)||Number(r.revokedCount)<0)throw Error(`OpenTig returned an invalid revocation result.`);return Number(r.revokedCount)}async function bp(e,t){try{let n=await e.json();return typeof n.error==`string`?n.error:t}catch{return t}}var xp=class{generation=0;pending=!1;begin(){return this.pending?null:(this.pending=!0,++this.generation)}dismiss(){this.generation++}isCurrent(e){return e===this.generation}finish(e){return this.pending=!1,this.isCurrent(e)}};async function Sp(){return Dp(`/api/auth/web-access`)}async function Cp(e){return Dp(`/api/auth/pairing-link`,`POST`,e&&e!==window.location.origin?{endpoint:e}:void 0)}function wp(e){return e.configuration??{webAccessEnabled:e.webAccessEnabled,lanAccessEnabled:e.listeningOnLan,listeningOnLan:e.listeningOnLan,publicOrigin:null,listenerHost:e.listenerHost,serverState:e.ready?`ready`:`starting`,actualPort:e.actualPort,localEndpoint:`http://127.0.0.1:${e.actualPort}`,networkEndpoints:[],pairingEndpoints:[window.location.origin],connectedSessionCount:0,restartError:null,...e.recoveryCommand?{recoveryCommand:e.recoveryCommand}:{}}}function Tp(e){return Dp(`/api/auth/web-access`,`POST`,e)}var Ep={getStatus:async()=>wp(await Sp()),setEnabled:e=>Tp({webAccessEnabled:e}),setLanEnabled:e=>Tp({lanAccessEnabled:e}),setPublicOrigin:e=>Tp({publicOrigin:e||null}),createPairingLink:Cp};async function Dp(e,t=`GET`,n){let r=await fetch(e,{method:t,credentials:`include`,...n===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}}),i=await r.json();if(!r.ok)throw Error(typeof i?.error==`string`?i.error:`Could not read web access information.`);return i}function Op({status:e,disabled:t,onChange:n}){let[r,i]=(0,F.useState)(e.listenerHost??(e.listeningOnLan?`0.0.0.0`:`127.0.0.1`)),[a,o]=(0,F.useState)(String(e.actualPort??``)),[s,c]=(0,F.useState)(null),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(null);(0,F.useEffect)(()=>{i(e.listenerHost??(e.listeningOnLan?`0.0.0.0`:`127.0.0.1`))},[e.listenerHost,e.listeningOnLan]),(0,F.useEffect)(()=>{o(String(e.actualPort??``))},[e.actualPort]);let p=r.trim()!==(e.listenerHost??(e.listeningOnLan?`0.0.0.0`:`127.0.0.1`))||Number(a)!==e.actualPort,m=async()=>{if(s){u(!0),f(null);try{if(!De())throw Error(`Save your edited files and finish running operations before changing the listener.`);n(await Tp(s)),c(null)}catch(e){f(e instanceof Error?e.message:`Could not change the listener.`),c(null)}finally{u(!1)}}};return(0,I.jsxs)(`details`,{className:`web-access-connection-details settings-field-separated`,children:[(0,I.jsxs)(`summary`,{children:[`Connection details `,(0,I.jsx)(`span`,{children:`Edit listener`})]}),(0,I.jsxs)(`form`,{className:`web-access-listener-form`,onSubmit:e=>{e.preventDefault(),f(null),p&&c({listenerHost:r.trim(),listenerPort:Number(a)})},children:[(0,I.jsx)(`label`,{htmlFor:`web-access-listener-host`,children:`Listening address`}),(0,I.jsx)(`input`,{id:`web-access-listener-host`,className:`web-access-rename-input`,value:r,onChange:e=>i(e.target.value),required:!0,maxLength:45,disabled:t||l,autoComplete:`off`,spellCheck:!1,"aria-describedby":`web-access-listener-help`}),(0,I.jsx)(`label`,{htmlFor:`web-access-listener-port`,children:`Port`}),(0,I.jsx)(`input`,{id:`web-access-listener-port`,className:`web-access-rename-input`,type:`number`,min:`1`,max:`65535`,step:`1`,value:a,onChange:e=>o(e.target.value),required:!0,disabled:t||l}),(0,I.jsx)(`p`,{id:`web-access-listener-help`,className:`web-access-hint`,children:`Use 127.0.0.1 for a tunnel on this server, 0.0.0.0 for all IPv4 interfaces, or a specific IPv4/IPv6 address. Changing the listener may disconnect browsers. Tunnel routing is configured separately.`}),d&&(0,I.jsx)(`p`,{className:`web-access-error`,role:`alert`,children:d}),(0,I.jsx)(`div`,{children:(0,I.jsx)(T,{type:`submit`,variant:`outline`,size:`sm`,disabled:t||l||!p,children:`Apply listener`})})]}),(0,I.jsx)(Me,{open:s!==null,onOpenChange:e=>{!e&&!l&&c(null)},children:(0,I.jsxs)(Se,{className:`undo-commit-dialog`,children:[(0,I.jsxs)(`div`,{className:`undo-commit-content`,children:[(0,I.jsx)(Ce,{children:`Change listening address?`}),(0,I.jsx)(je,{children:`This changes the listener for every client. Save edits on connected clients first. Direct connections may need the new address and port; a tunnel may need its origin updated. Paired devices stay saved. If the new address or port cannot be used, OpenTig restores the previous listener.`}),(0,I.jsx)(`p`,{className:`web-access-hint`,children:(0,I.jsxs)(`code`,{children:[s?.listenerHost,`:`,s?.listenerPort]})}),e.recoveryCommand&&(0,I.jsxs)(`p`,{className:`web-access-hint`,children:[`If you lose access, run `,(0,I.jsx)(`code`,{children:e.recoveryCommand}),` on the server and restart this instance.`]})]}),(0,I.jsxs)(`div`,{className:`undo-commit-actions`,children:[(0,I.jsx)(T,{variant:`ghost`,disabled:l,onClick:()=>c(null),children:`Cancel`}),(0,I.jsx)(T,{disabled:l,onClick:()=>void m(),children:l?`Applying…`:`Change listener`})]})]})})]})}var kp={starting:`Starting`,ready:`Ready`,restarting:`Restarting`,failed:`Failed`,stopped:`Stopped`};function Ap(){let e=!window.opentigDesktop?.webAccess,t=window.opentigDesktop?.webAccess??Ep,[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)([]),[o,s]=(0,F.useState)(null),[c,l]=(0,F.useState)(e?`current`:`local`),[u,d]=(0,F.useState)(``),[f,p]=(0,F.useState)(!1),[m,h]=(0,F.useState)(``),[g,_]=(0,F.useState)(null),y=(0,F.useRef)(null),[x,S]=(0,F.useState)(!1),[ee,k]=(0,F.useState)(!1),[ce,ue]=(0,F.useState)(null),de=(0,F.useRef)(new xp),fe=(0,F.useRef)(null),pe=(0,F.useRef)(!0),[me,he]=(0,F.useState)(!0),[j,M]=(0,F.useState)(null),[ye,be]=(0,F.useState)(null),[xe,we]=(0,F.useState)(null),[N,Ee]=(0,F.useState)(null),[ke,Ne]=(0,F.useState)(null),[Pe,Fe]=(0,F.useState)(``),Ie=n?.webAccessEnabled&&n.listeningOnLan?n.networkEndpoints.filter(e=>n.pairingEndpoints.includes(e)):[],Le=c===`current`?window.location.origin:c===`public`?n?.publicOrigin??``:c===`lan`?u:n?.localEndpoint??``,Re=c===`public`&&(!n?.publicOrigin||f),ze=n?.webAccessEnabled,Ve=ze&&n?.serverState===`ready`&&(c===`current`||n.pairingEndpoints.includes(Le))&&!Re&&j===null&&!x,Ue=[...e?[{value:`current`,label:`Current address`}]:[],{value:`local`,label:`Local`},...Ie.length?[{value:`lan`,label:`LAN`}]:[],{value:`public`,label:`My domain`}],P=(0,F.useCallback)(()=>{de.current.dismiss(),fe.current=null,s(null),k(!1)},[]);(0,F.useEffect)(()=>{let e=de.current;return pe.current=!0,()=>{pe.current=!1,e.dismiss()}},[]),(0,F.useEffect)(()=>{h(n?.publicOrigin??``)},[n?.publicOrigin]),(0,F.useEffect)(()=>{ze===!1&&(P(),p(!1),_(null),h(n?.publicOrigin??``))},[ze,n?.publicOrigin,P]),(0,F.useEffect)(()=>{ze&&Re&&y.current?.focus()},[ze,Re]),(0,F.useEffect)(()=>{P()},[Le,P]),(0,F.useEffect)(()=>{if(!o||ce===null)return;let e=window.setTimeout(()=>{de.current.isCurrent(ce)&&P()},Math.max(0,Date.parse(o.expiresAt)-Date.now()));return()=>window.clearTimeout(e)},[o,ce,P]);let We=(0,F.useCallback)(async(n=!0)=>{let i=fe.current,o=await Promise.allSettled([e?Sp().then(e=>{pe.current&&(r(wp(e)),!e.pairingAvailable&&i!==null&&de.current.isCurrent(i)&&P())}):t.getStatus().then(e=>{pe.current&&r(e)}),hp()]);pe.current&&(o[0].status===`rejected`&&n&&O.error({title:`Could not read web access status`,description:$(o[0].reason)}),o[1].status===`fulfilled`?a(o[1].value):n&&O.error({title:`Could not read owner sessions`,description:$(o[1].reason)}),he(!1))},[t,e,P]);(0,F.useEffect)(()=>{We();let e=window.setInterval(()=>void We(!1),2e3);return()=>window.clearInterval(e)},[We]),(0,F.useEffect)(()=>{if(!n)return;let e=n.listeningOnLan?n.networkEndpoints.filter(e=>n.pairingEndpoints.includes(e)):[];e.includes(u)||d(e[0]??``),c===`lan`&&e.length===0&&l(`local`)},[u,c,n]);let qe=(0,F.useMemo)(()=>o?`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(mp(o.url,{ecc:`M`,border:2}))}`:null,[o]),Je=(0,F.useMemo)(()=>o?new URLSearchParams(new URL(o.url).hash.slice(1)).get(`token`)??``:``,[o]);if(me&&!n&&i.length===0)return(0,I.jsxs)(`div`,{className:`web-access-loading`,role:`status`,children:[(0,I.jsx)(oe,{className:`animate-spin`,"aria-hidden":`true`}),(0,I.jsx)(v,{text:`Loading web access…`})]});let Ye=async n=>{M(`toggle`),P();try{if(e&&!n&&!De())throw Error(`Save your edited files and finish running operations before pausing web access.`);r(await t.setEnabled(n)),O.success({title:n?`Web access enabled`:`Web access paused; paired devices saved`})}catch(e){O.error({title:`Could not change web access`,description:$(e)}),await We(!1)}finally{M(null),be(null)}},Xe=async e=>{M(`lan`),P();try{if(!De())throw Error(`Save your edited files and finish running operations before changing LAN access.`);r(await t.setLanEnabled(e))}catch(e){O.error({title:`Could not change LAN access`,description:$(e)}),await We(!1)}finally{M(null)}},Ze=async(e=!1)=>{_(null);let n;try{let t=m.trim();n=e?``:Tf(t&&!t.includes(`://`)?`https://${t}`:t)}catch(e){_($(e));return}M(`origin`),P();try{let e=await t.setPublicOrigin(n);r(e),h(e.publicOrigin??``),p(!1),l(e.publicOrigin?`public`:`local`)}catch(e){_($(e))}finally{M(null)}},Qe=e=>{P(),l(e),p(!1),h(n?.publicOrigin??``),_(null)},$e=()=>{h(n?.publicOrigin??``),_(null),p(!1),n?.publicOrigin||l(`local`)},et=async()=>{if(!Ve)return;let e=de.current.begin();if(e!==null){s(null),ue(e),k(!0),S(!0);try{let n=await t.createPairingLink(Le);pe.current&&de.current.isCurrent(e)&&(fe.current=e,s(n))}catch(t){pe.current&&de.current.isCurrent(e)&&(k(!1),O.error({title:`Could not create pairing link`,description:$(t)}))}finally{de.current.finish(e),pe.current&&S(!1)}}},tt=async()=>{if(o)try{await se(o.url),O.success({title:`Pairing link copied`})}catch(e){O.error({title:`Could not copy pairing link`,description:$(e)})}},nt=async()=>{if(Je)try{await se(Je),O.success({title:`Pairing code copied`})}catch(e){O.error({title:`Could not copy pairing code`,description:$(e)})}},rt=async()=>{let e=ke,t=Pe.trim();if(!(!e||!t||t.length>64)){M(`rename:${e.id}`);try{await vp(e.id,t),O.success({title:`Device renamed`}),await We(!1),Ne(null)}catch(e){O.error({title:`Could not rename device`,description:$(e)})}finally{M(null)}}},it=async()=>{let e=N;if(!e)return;let t=e===`all`?`revoke-all`:`revoke:${e.id}`;M(t);try{let t=e===`all`?await _p():await gp(e.id);s(null),O.success({title:`${t} browser ${t===1?`session`:`sessions`} revoked`}),await We(!1)}catch(e){O.error({title:`Could not revoke session`,description:$(e)})}finally{M(null),Ee(null)}},at=n?.serverState===`ready`,ot=i.filter(e=>e.kind!==`desktop`);return(0,I.jsxs)(`div`,{className:`web-access-settings`,children:[n&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`web-access-summary`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`Web access`}),(0,I.jsxs)(`span`,{children:[`Allow paired browsers to use OpenTig. Turning this off disconnects browsers but keeps paired devices. `,e?`Restore access from the desktop app or with the local recovery command below.`:`Enable it again to restore their access; the desktop stays connected.`]})]}),(0,I.jsx)(`button`,{type:`button`,role:`switch`,"aria-label":`Web access`,"aria-checked":n.webAccessEnabled,className:`settings-switch`,disabled:j!==null||!at,onClick:()=>be(n.webAccessEnabled?`disable`:`enable`),children:(0,I.jsx)(`span`,{})})]}),e&&n.recoveryCommand&&(0,I.jsxs)(`p`,{className:`web-access-hint`,children:[`Local recovery: `,(0,I.jsx)(`code`,{children:n.recoveryCommand}),`, then restart this instance. For a custom CLI home, add --home. Paired devices are preserved.`]}),(0,I.jsxs)(`div`,{className:`web-access-facts`,"aria-live":`polite`,children:[(0,I.jsx)(jp,{label:`Server status`,children:(0,I.jsx)(Oe,{variant:at?`secondary`:`outline`,children:kp[n.serverState]})}),(0,I.jsx)(jp,{label:`Actual port`,children:(0,I.jsx)(`code`,{children:n.actualPort??`Unavailable`})}),(0,I.jsx)(jp,{label:`Listening on`,children:(0,I.jsx)(`span`,{children:n.listenerHost??(n.listeningOnLan?`All network interfaces`:`This computer (loopback)`)})}),(0,I.jsx)(jp,{label:`Local endpoint`,children:(0,I.jsx)(Mp,{value:n.localEndpoint})}),(0,I.jsxs)(`div`,{className:`web-access-summary web-access-network-settings`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`LAN access`}),(0,I.jsx)(`span`,{children:`Allow direct connections from the server's network. A tunnel on the same host works with LAN access off. Changing LAN access reconnects clients.`})]}),(0,I.jsx)(`button`,{type:`button`,role:`switch`,"aria-label":`LAN access`,"aria-checked":n.listeningOnLan,className:`settings-switch`,disabled:!n.webAccessEnabled||j!==null||!at,onClick:()=>e?we(!n.listeningOnLan):void Xe(!n.listeningOnLan),children:(0,I.jsx)(`span`,{})})]}),(0,I.jsx)(jp,{label:`LAN endpoints`,children:(0,I.jsx)(`div`,{className:`web-access-endpoints`,children:n.networkEndpoints.length===0?(0,I.jsx)(`span`,{children:`None detected`}):n.networkEndpoints.map(e=>(0,I.jsx)(Mp,{value:e,muted:!n.webAccessEnabled||!n.listeningOnLan},e))})})]}),(0,I.jsx)(Op,{status:n,disabled:j!==null||!at,onChange:r}),n.restartError&&(0,I.jsxs)(`div`,{className:`web-access-error`,role:`alert`,children:[(0,I.jsx)(b,{}),` `,(0,I.jsx)(`span`,{children:n.restartError})]}),!n.webAccessEnabled&&(0,I.jsx)(`p`,{className:`web-access-hint`,children:`Browser access is paused, including through tunnels. Paired devices are saved; the private desktop session stays connected.`})]}),ze&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`web-access-actions settings-field-separated`,children:(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`Pair a browser`}),(0,I.jsx)(`span`,{children:`Choose where to open your five-minute, one-use link.`})]})}),(0,I.jsxs)(`div`,{className:`web-access-pairing-options`,children:[n&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`fieldset`,{className:`web-access-destinations`,disabled:j!==null,children:[(0,I.jsx)(`legend`,{className:`sr-only`,children:`Pairing destination`}),Ue.map(({value:e,label:t})=>(0,I.jsxs)(`label`,{children:[(0,I.jsx)(`input`,{type:`radio`,name:`web-access-destination`,value:e,checked:c===e,onChange:()=>Qe(e)}),t]},e))]}),c===`public`?(0,I.jsx)(`div`,{className:`web-access-domain`,children:Re?(0,I.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),Ze()},children:[(0,I.jsx)(`label`,{htmlFor:`web-access-public-origin`,children:`Your domain`}),(0,I.jsx)(`input`,{ref:y,id:`web-access-public-origin`,className:`web-access-rename-input`,value:m,onChange:e=>{h(e.target.value),_(null)},placeholder:`https://git.example.com`,"aria-invalid":g!==null,"aria-describedby":`web-access-origin-help${g?` web-access-origin-error`:``}`,maxLength:2048,disabled:j!==null,autoComplete:`off`,spellCheck:!1,inputMode:`url`}),(0,I.jsx)(`p`,{id:`web-access-origin-help`,className:`web-access-hint`,children:`Your tunnel address, without a path. It will be used in the link and QR. Point your tunnel at the local endpoint shown above.`}),g&&(0,I.jsx)(`p`,{id:`web-access-origin-error`,className:`web-access-error`,role:`alert`,children:g}),(0,I.jsxs)(`div`,{className:`web-access-domain-actions`,children:[(0,I.jsx)(T,{type:`submit`,size:`sm`,disabled:j!==null||!m.trim(),children:`Save and use`}),(0,I.jsx)(T,{type:`button`,variant:`ghost`,size:`sm`,onClick:$e,disabled:j!==null,children:`Cancel`}),n.publicOrigin&&(0,I.jsx)(T,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void Ze(!0),disabled:j!==null,children:`Remove`})]})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`web-access-saved-domain`,children:[(0,I.jsx)(`code`,{children:n.publicOrigin}),(0,I.jsxs)(T,{variant:`ghost`,size:`sm`,onClick:()=>{P(),p(!0)},disabled:j!==null,children:[(0,I.jsx)(ae,{}),` Edit`]})]}),(0,I.jsx)(`p`,{className:`web-access-hint`,children:`Saved and selected for this link and QR.`})]})}):c===`lan`?(0,I.jsxs)(`div`,{className:`web-access-endpoint-select`,children:[(0,I.jsx)(`label`,{htmlFor:`web-access-endpoint`,children:`Network address`}),(0,I.jsxs)(ie,{value:u,onValueChange:e=>{e&&d(e)},disabled:j!==null,children:[(0,I.jsx)(te,{id:`web-access-endpoint`,className:`w-full`,children:(0,I.jsx)(w,{children:u})}),(0,I.jsx)(ne,{alignItemWithTrigger:!1,children:(0,I.jsx)(re,{children:Ie.map(e=>(0,I.jsx)(C,{value:e,children:e},e))})})]})]}):(0,I.jsx)(`p`,{className:`web-access-hint`,children:c===`current`?`Use this browser’s address, including through a tunnel.`:`For a browser on the server itself.`})]}),(0,I.jsxs)(`div`,{className:`web-access-link-destination`,children:[(0,I.jsx)(`span`,{children:`Address for the link and QR`}),(0,I.jsx)(`code`,{children:Le||(c===`public`?`Add your domain above`:`Unavailable`)})]}),(0,I.jsxs)(T,{size:`sm`,onClick:()=>void et(),disabled:!Ve,children:[x?(0,I.jsx)(oe,{className:`animate-spin`}):(0,I.jsx)(He,{}),` Create pairing link`]})]}),ee&&(0,I.jsxs)(`div`,{className:`web-access-pairing`,role:`status`,children:[(0,I.jsxs)(`div`,{className:`web-access-pairing-copy`,children:[o?(0,I.jsx)(Ge,{"aria-hidden":`true`}):(0,I.jsx)(oe,{className:`animate-spin`,"aria-hidden":`true`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`strong`,{children:o?`Pairing link ready`:(0,I.jsx)(v,{text:`Creating pairing link…`})}),(0,I.jsx)(`span`,{children:o?`Expires ${_e(o.expiresAt,{seconds:!0})}.`:`You can close this while the link is being created.`})]}),(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(T,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close pairing link`,onClick:P}),children:(0,I.jsx)(Te,{})}),(0,I.jsx)(E,{children:`Close pairing link`})]})]}),o&&(0,I.jsxs)(I.Fragment,{children:[qe&&(0,I.jsx)(`img`,{src:qe,alt:`QR code for the one-use OpenTig pairing link`}),(0,I.jsxs)(`div`,{className:`web-access-link-row`,children:[(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(`code`,{className:`web-access-link`}),children:o.url}),(0,I.jsx)(E,{side:`bottom`,children:`One-use link; do not share publicly`})]}),(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(T,{variant:`outline`,size:`icon-sm`,"aria-label":`Copy pairing link`,onClick:()=>void tt()}),children:(0,I.jsx)(le,{})}),(0,I.jsx)(E,{children:`Copy pairing link`})]})]}),(0,I.jsxs)(`div`,{className:`web-access-link-row`,children:[(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(`code`,{className:`web-access-link`}),children:Je}),(0,I.jsx)(E,{side:`bottom`,children:`Paste this code on any /pair page served by this OpenTig instance`})]}),(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(T,{variant:`outline`,size:`icon-sm`,"aria-label":`Copy pairing code`,onClick:()=>void nt()}),children:(0,I.jsx)(le,{})}),(0,I.jsx)(E,{children:`Copy pairing code`})]})]}),(0,I.jsx)(`p`,{className:`web-access-hint`,children:`Closing hides this code. A copied code remains valid until used, replaced, or expired. Turning off Web access invalidates it.`})]})]})]}),(0,I.jsxs)(`div`,{className:`web-access-session-heading settings-field-separated`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`Owner sessions`}),(0,I.jsxs)(`span`,{children:[e?``:`Desktop authentication stays private. `,`Paired browsers can be renamed or disconnected individually.`]})]}),(0,I.jsxs)(T,{variant:`destructive`,size:`sm`,onClick:()=>Ee(`all`),disabled:ot.length===0||j!==null,children:[(0,I.jsx)(Ke,{}),` Revoke browsers`]})]}),(0,I.jsx)(`div`,{className:`web-access-session-list`,"aria-live":`polite`,children:i.length===0?(0,I.jsx)(`div`,{className:`web-access-empty-session`,children:`No owner sessions found.`}):i.map(e=>(0,I.jsxs)(`div`,{className:`web-access-session`,children:[(0,I.jsx)(`div`,{className:`web-access-session-icon ${e.connected?`connected`:``}`,children:e.kind===`desktop`?(0,I.jsx)(Ae,{}):(0,I.jsx)(Be,{})}),(0,I.jsxs)(`div`,{className:`web-access-session-copy`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`strong`,{children:e.clientName}),e.current&&(0,I.jsx)(Oe,{variant:`secondary`,children:`This session`}),e.kind===`desktop`&&(0,I.jsx)(Oe,{variant:`outline`,children:`Desktop`})]}),(0,I.jsxs)(`span`,{children:[e.connected?`Connected${e.connectionCount>1?` (${e.connectionCount} tabs)`:``}`:e.lastConnectedAt?`Last connected ${_e(e.lastConnectedAt,{seconds:!0})}`:`Not yet connected`,` · `,e.browser&&e.os?`${e.browser} on ${e.os}`:e.browser??e.os??Np(e.deviceType),e.viaProxy?` · Via proxy`:``,e.remoteAddress?` · ${e.remoteAddress}`:``]})]}),e.kind!==`desktop`&&(0,I.jsxs)(`div`,{className:`web-access-session-controls`,children:[(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(T,{variant:`ghost`,size:`icon-sm`,"aria-label":`Rename ${e.clientName}`,onClick:()=>{Ne(e),Fe(e.clientName)},disabled:j!==null}),children:(0,I.jsx)(ae,{})}),(0,I.jsx)(E,{children:`Rename this device`})]}),(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(T,{variant:`ghost`,size:`icon-sm`,"aria-label":`Revoke ${e.clientName} session`,onClick:()=>Ee(e),disabled:j!==null}),children:(0,I.jsx)(ve,{})}),(0,I.jsx)(E,{children:`Revoke this browser session`})]})]})]},e.id))}),(0,I.jsx)(Me,{open:xe!==null,onOpenChange:e=>{e||we(null)},children:(0,I.jsxs)(Se,{className:`undo-commit-dialog`,children:[(0,I.jsxs)(`div`,{className:`undo-commit-content`,children:[(0,I.jsx)(Ce,{children:xe?`Enable LAN access?`:`Disable LAN access?`}),(0,I.jsxs)(je,{children:[xe?`Other devices on the server’s network will be able to reach OpenTig. They still need pairing. Use a trusted LAN or VPN.`:`Direct LAN connections will stop. If you use a LAN address, this browser will disconnect. A tunnel on the same server can still connect.`,` Paired devices are preserved.`]})]}),(0,I.jsxs)(`div`,{className:`undo-commit-actions`,children:[(0,I.jsx)(T,{variant:`ghost`,onClick:()=>we(null),children:`Cancel`}),(0,I.jsx)(T,{onClick:()=>{let e=xe;we(null),Xe(e)},children:xe?`Enable LAN access`:`Disable LAN access`})]})]})}),(0,I.jsx)(Me,{open:ye!==null,onOpenChange:e=>{e||be(null)},children:(0,I.jsxs)(Se,{className:`undo-commit-dialog`,children:[(0,I.jsxs)(`div`,{className:`undo-commit-content`,children:[(0,I.jsx)(Ce,{children:ye===`disable`?`Disable Web access?`:`Enable browser access?`}),(0,I.jsx)(je,{children:ye===`disable`?`Connected browsers will disconnect and cannot access OpenTig until Web access is enabled again. Paired devices stay saved and can reconnect with their valid sessions. ${e?`You will lose access from this browser. Restore it from the desktop app, or run the recovery command on the server and restart it.`:`The desktop stays connected.`}`:`Paired browsers can edit or delete files and act with your OS user permissions. Saved paired devices can reconnect. Use only devices you trust. LAN exposure is configured separately.`})]}),(0,I.jsxs)(`div`,{className:`undo-commit-actions`,children:[(0,I.jsx)(ge,{render:(0,I.jsx)(T,{variant:`ghost`}),children:`Cancel`}),(0,I.jsx)(T,{variant:ye===`disable`?`destructive`:`default`,onClick:()=>void Ye(ye===`enable`),disabled:j!==null||!at,children:ye===`disable`?`Disable Web access`:`Enable Web access`})]})]})}),(0,I.jsx)(Me,{open:N!==null,onOpenChange:e=>{e||Ee(null)},children:(0,I.jsxs)(Se,{className:`undo-commit-dialog`,children:[(0,I.jsxs)(`div`,{className:`undo-commit-content`,children:[(0,I.jsx)(Ce,{children:N===`all`?`Revoke all browser sessions?`:`Revoke this browser session?`}),(0,I.jsx)(je,{children:N===`all`?`Every paired browser disconnects immediately. The private desktop session remains signed in.`:N?.current?`This browser will disconnect immediately and require a new pairing link.`:`That browser disconnects immediately and will require a new pairing link.`}),N&&N!==`all`&&(0,I.jsx)(`div`,{className:`undo-commit-summary`,children:(0,I.jsx)(`strong`,{children:N.clientName})})]}),(0,I.jsxs)(`div`,{className:`undo-commit-actions`,children:[(0,I.jsx)(ge,{render:(0,I.jsx)(T,{variant:`ghost`}),children:`Cancel`}),(0,I.jsxs)(T,{variant:`destructive`,onClick:()=>void it(),disabled:j!==null,children:[(0,I.jsx)(Ke,{}),` Revoke`]})]})]})}),(0,I.jsx)(Me,{open:ke!==null,onOpenChange:e=>{e||Ne(null)},children:(0,I.jsxs)(Se,{className:`undo-commit-dialog`,children:[(0,I.jsxs)(`div`,{className:`undo-commit-content`,children:[(0,I.jsx)(Ce,{children:`Rename paired device`}),(0,I.jsx)(je,{children:`Use a name that makes this browser easy to identify later.`}),(0,I.jsx)(`input`,{className:`web-access-rename-input`,value:Pe,onChange:e=>Fe(e.target.value),maxLength:64,"aria-label":`Device name`,autoComplete:`off`})]}),(0,I.jsxs)(`div`,{className:`undo-commit-actions`,children:[(0,I.jsx)(ge,{render:(0,I.jsx)(T,{variant:`ghost`}),children:`Cancel`}),(0,I.jsx)(T,{onClick:()=>void rt(),disabled:j!==null||!Pe.trim(),children:`Save`})]})]})})]})}function jp({label:e,children:t}){return(0,I.jsxs)(`div`,{className:`web-access-fact`,children:[(0,I.jsx)(`span`,{children:e}),(0,I.jsx)(`div`,{children:t})]})}function Mp({value:e,muted:t=!1}){return e?(0,I.jsxs)(D,{children:[(0,I.jsx)(A,{render:(0,I.jsx)(`code`,{className:t?`muted`:void 0}),children:e}),(0,I.jsx)(E,{side:`bottom`,children:t?`Enable Web access and LAN access to use this endpoint`:e})]}):(0,I.jsx)(`span`,{children:`Unavailable`})}function Np(e){return e===`desktop`?`Desktop browser`:e===`mobile`?`Mobile browser`:e===`tablet`?`Tablet browser`:e===`bot`?`Automated client`:`Unknown browser`}function $(e){return e instanceof Error?e.message:String(e)}var Pp=[{id:`general`,label:`General`,icon:be},{id:`updates`,label:`Updates`,icon:N},{id:`shortcuts`,label:`Shortcuts`,icon:Ve},{id:`github`,label:`GitHub`,icon:x},{id:`ai`,label:`AI assistance`,icon:Ye},{id:`diagnostics`,label:`Diagnostics`,icon:b},{id:`webAccess`,label:`Web access`,icon:We}],Fp={github:{title:`GitHub`,description:`Separate settings for this repository and the OpenTig instance.`},updates:{title:`Updates`,description:`Check, download, and install new OpenTig releases.`},general:{title:`General`,description:`Appearance, files and repository behavior.`},shortcuts:{title:`Shortcuts`,description:`Rebind commands or review the shortcuts that stay fixed.`},ai:{title:`AI assistance`,description:`Local harness and model used to suggest commit messages and pull-request drafts.`},diagnostics:{title:`Diagnostics`,description:`Recent local failures on this machine. Prompts and file contents are never recorded.`}};function Ip({preferences:e,onPreference:t,open:n,onOpenChange:r,section:i,onSectionChange:a,repository:o=null}){let s=u(),c=at(e.aiExecutablePaths),d=ce.aiStatuses(c),f=l({queryKey:d,queryFn:()=>k.ai.statuses(!1),enabled:n&&i===`ai`,staleTime:1/0,gcTime:1/0,placeholderData:p}),m=f.data??[],h=f.isFetching,[g,_]=(0,F.useState)(!1),[y,x]=(0,F.useState)(!1),S=(0,F.useRef)(null),ee=Bd(),te=ee?{duration:0}:{duration:.16,ease:[.22,1,.36,1]},C=(0,F.useRef)(c);(0,F.useEffect)(()=>{C.current!==c&&(s.removeQueries({queryKey:ce.aiStatuses(C.current),exact:!0}),C.current=c)},[c,s]),(0,F.useEffect)(()=>{f.error&&O.error({title:`Could not check local AI`,description:Bp(f.error)})},[f.error]);let ne=()=>s.fetchQuery({queryKey:d,queryFn:()=>k.ai.statuses(!0),staleTime:0}).catch(()=>void 0);(0,F.useLayoutEffect)(()=>{n&&S.current&&(S.current.scrollTop=0)},[n,i]);let w=e.commitMessageHarness,re=m.find(e=>e.id===w),ie=e.commitMessageModels[w]??`default`,ae=re?.models??[{id:`default`,label:`Default (CLI)`}],se=ae.some(e=>e.id===ie)?ae:[...ae,{id:ie,label:`${ie} (unavailable)`}],E=[];for(let e of se){let t=w===`opencode`?e.id.indexOf(`/`):-1,n=t>0?e.id.slice(0,t):w,r=e.id==="default"?`default`:`provider:${n}`,i=E.find(e=>e.id===r);i||(i={id:r,label:e.id==="default"?``:t>0?n:Ne(w),items:[]},E.push(i)),i.items.push({value:e.id,label:t>0&&e.label===e.id?e.id.slice(t+1):e.label,search:e.id,tooltip:e.id==="default"||e.label===e.id?e.label:`${e.label} · ${e.id}`,pinned:e.id==="default",icon:(0,I.jsx)(Ye,{})})}let D=se.find(e=>e.id===ie)?.label??ie,{title:A,description:le}=i===`webAccess`?{title:`Web access`,description:window.opentigDesktop?`Connect trusted browsers locally, over your LAN, or through an HTTPS tunnel.`:`Configure server access, create pairing links, and manage connected browsers.`}:Fp[i];return(0,I.jsx)(Me,{open:n,onOpenChange:r,children:(0,I.jsx)(Se,{className:`settings-dialog w-[min(860px,calc((100vw-48px)/var(--settings-ui-scale,1)))]`,style:{"--settings-ui-scale":window.opentigDesktop||window.matchMedia(`(max-width: 767px)`).matches?1:e.uiZoom/100},children:(0,I.jsxs)(`div`,{className:`settings-shell`,children:[(0,I.jsxs)(`aside`,{className:`settings-nav`,children:[(0,I.jsx)(`div`,{className:`settings-nav-title`,children:`Settings`}),Pp.map(({id:e,label:t,icon:n})=>(0,I.jsxs)(`button`,{className:`settings-nav-item ${i===e?`active`:``}`,onClick:()=>a(e),"aria-current":i===e,children:[(0,I.jsx)(n,{}),` `,t]},e))]}),(0,I.jsxs)(`section`,{className:`settings-panel`,children:[(0,I.jsxs)(`header`,{className:`settings-panel-header`,children:[(0,I.jsx)(ql,{initial:!1,mode:`wait`,children:(0,I.jsxs)(Vd.div,{initial:!ee&&{opacity:0,y:4},animate:{opacity:1,y:0},exit:ee?{opacity:1}:{opacity:0,y:-3},transition:te,children:[(0,I.jsx)(Ce,{children:A}),(0,I.jsx)(je,{children:le})]},i)}),(0,I.jsx)(ge,{render:(0,I.jsx)(T,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close settings`}),children:(0,I.jsx)(Te,{})})]}),(0,I.jsx)(`div`,{ref:S,className:`settings-panel-body${i===`general`||i===`github`?` settings-panel-body-general`:``}`,children:(0,I.jsx)(ql,{initial:!1,mode:`wait`,children:(0,I.jsx)(Vd.div,{className:`settings-panel-section${i===`general`||i===`github`?` settings-panel-section-general`:``}${i===`ai`?` settings-panel-section-ai`:``}`,initial:!ee&&{opacity:0,y:7},animate:{opacity:1,y:0},exit:ee?{opacity:1}:{opacity:0,y:-5},transition:te,children:i===`github`?(0,I.jsx)(Ie,{repository:o},o?.id):i===`general`?(0,I.jsx)(hf,{preferences:e,onPreference:t}):i===`updates`?(0,I.jsx)(Fe,{}):i===`shortcuts`?(0,I.jsx)(Cf,{preferences:e,onPreference:t}):i===`webAccess`?(0,I.jsx)(Ap,{}):i===`diagnostics`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`settings-field`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`Problem history`}),(0,I.jsx)(`span`,{children:`Failed Git, file, and network operations recorded locally. Prompts and file contents are never stored.`})]}),(0,I.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>x(!0),children:[(0,I.jsx)(b,{}),` View problems`]})]}),(0,I.jsx)(xf,{open:y,onOpenChange:x})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`ai-settings-heading`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`Local harness`}),(0,I.jsx)(`span`,{children:`OpenTig uses the selected CLI session. It does not copy or store credentials.`}),re&&(0,I.jsxs)(`span`,{children:[`Last checked: `,_e(re.checkedAt,{seconds:!0})]})]}),(0,I.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>void ne(),disabled:h,children:[h?(0,I.jsx)(oe,{className:`animate-spin`}):(0,I.jsx)(N,{}),` `,h?(0,I.jsx)(v,{text:m.length?`Checking…`:`Loading…`}):`Check again`]})]}),(0,I.jsx)(`div`,{className:`ai-harness-list`,role:`radiogroup`,"aria-label":`Harness for AI assistance`,children:[`codex`,`claude`,`opencode`,`grok`].map(e=>{let n=m.find(t=>t.id===e),r=w===e;return(0,I.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,className:`ai-harness-card ${r?`active`:``}`,onClick:()=>t({commitMessageHarness:e}),children:[(0,I.jsxs)(`span`,{className:`ai-harness-card-main`,children:[(0,I.jsx)(Pe,{harness:e}),(0,I.jsxs)(`span`,{className:`ai-harness-card-copy`,children:[(0,I.jsx)(`strong`,{children:Ne(e)}),(0,I.jsx)(`small`,{children:n?.version||(n?n.installationStatus===`inspection-failed`?`Inspection unavailable`:n.installed?`Version unavailable`:`Executable not found`:h?(0,I.jsx)(v,{text:`Loading…`}):`Status not checked`)})]})]}),(0,I.jsx)(Oe,{variant:Rp(n),className:`ai-status-badge ${n?.availability??`unknown`}`,children:Lp(n)}),n?.message&&(0,I.jsx)(`span`,{className:`ai-harness-message`,children:n.message})]},e)})}),(0,I.jsxs)(`div`,{className:`settings-field settings-field-separated ai-model-field`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsxs)(`strong`,{children:[Ne(w),` model`]}),(0,I.jsx)(`span`,{children:`Default uses the harness’s built-in default. OpenTig remembers a separate selection for each harness; custom CLI configuration is excluded during generation.`})]}),(0,I.jsx)(we,{groups:E,value:ie,onValueChange:n=>t({commitMessageModels:{...e.commitMessageModels,[w]:n}}),label:`${Ne(w)} model`,triggerLabel:D,triggerClassName:`ai-model-select`,contentClassName:`ai-model-picker`,size:`default`,align:`end`,placeholder:`Search models…`},w),re?.authStatus===`unauthenticated`&&(0,I.jsxs)(`p`,{className:`ai-login-hint`,children:[`Sign in from a terminal with `,(0,I.jsx)(`code`,{children:zp(w,re.cliName)}),` and check again.`]}),re&&!re.installed&&re.installationStatus!==`inspection-failed`&&(0,I.jsxs)(`p`,{className:`ai-login-hint`,children:[`Install `,Ne(w),` and check its availability again.`]})]}),(0,I.jsx)(rt,{harness:w,preferences:e,status:re,onPreference:t},w),(0,I.jsx)(Qe,{repository:o},o?.id),(0,I.jsxs)(`div`,{className:`settings-field settings-field-separated ai-history-field`,children:[(0,I.jsxs)(`div`,{className:`settings-field-label`,children:[(0,I.jsx)(`strong`,{children:`Generation history`}),(0,I.jsx)(`span`,{children:`Outcome, duration, tokens, and cost of recent runs, kept locally for diagnostics.`})]}),(0,I.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>_(!0),children:[(0,I.jsx)(ke,{}),` View history`]})]}),(0,I.jsx)(`p`,{className:`ai-privacy-note`,children:`OpenTig sends the relevant diff, summary and commit subjects to the selected harness, plus supported repository instruction text when enabled. Generated content remains pending your review; history records metadata only.`}),(0,I.jsx)($d,{open:g,onOpenChange:_})]})},i)})})]})]})})})}function Lp(e){return e?e.installationStatus===`inspection-failed`?`Check failed`:e.installationStatus===`not-executable`?`Cannot run`:e.installationStatus===`incompatible`?`Incompatible`:e.installed?e.authStatus===`unauthenticated`?`Not authenticated`:e.availability===`ready`?`Available`:`Check`:`Not found`:`Not checked`}function Rp(e){return e?!e.installed||e.authStatus===`unauthenticated`||e.availability===`error`?`destructive`:e.availability===`ready`?`default`:`secondary`:`outline`}function zp(e,t){return e===`codex`?`codex login`:e===`claude`?`claude auth login`:e===`grok`?`grok login`:t===`opencode2`?`opencode2 auth login`:`opencode auth login`}function Bp(e){return e instanceof Error?e.message:`An unexpected error occurred.`}export{Ip as SettingsDialog};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PierreDiffViewer-CDfQ32e0.js","assets/rolldown-runtime-C0FnF6B9.js","assets/base-ui-DDpgJXgO.js","assets/createReactComponent-Ctub7J3a.js","assets/utils-D0T3A-kS.js","assets/DiffWorkspace-DCo89dF1.js","assets/IconChevronDown-DU5i40lD.js","assets/index-DsKvWsTs.js","assets/react-BlQ_XOQu.js","assets/tanstack-CVAt_k_T.js","assets/external-url-IUS7RmYD.js","assets/index-kyWCnbkb.css","assets/color-C1Sk4dBL.js","assets/cloneFileDiffMetadata-zVRGqYgv.js","assets/PierreWorkerPool-mIDzTMB9.js","assets/esm-C-5CJumt.js","assets/string-TLTPtCPs-SBynuHAV.js","assets/dist-B8XHAue7.js","assets/App-Bfw_TX8q.js","assets/IconAlertTriangle-B9iDJKvP.js","assets/IconPlus-DJCoD3wt.js","assets/IconCheck-C-G-IA13.js","assets/select-Dq3KDX2O.js","assets/IconSelector-BVMU1PEt.js","assets/IconGitMerge-D9KEj1cE.js","assets/IconGitPullRequest-ClaUqyVa.js","assets/IconLoader4-D2VN7u1V.js","assets/IconSearch-1VQ4P4kW.js","assets/shortcuts-BzIlT01I.js","assets/EditContext-rlYgrfe2.js","assets/File-DHnVtIhS.js","assets/PierreEditBoundary-DAdYNYZ3.js","assets/edit-ready-context-MO-PrQZN.js","assets/MarkdownFileViewer-NUAoQmv5.js","assets/viewer-tabs-DkkqN9MD.js","assets/viewer-tabs-DQFTTliM.css","assets/EditableFileViewer-Dotntfij.js","assets/EditableFileViewer-svutjHZv.css","assets/render-markdown-CQi2yKYQ.js","assets/markdown-nv3OtW6n.css","assets/PullRequestViewer-u89zl169.js","assets/GitHubAvatar-B6vyoVlh.js","assets/LinkedText-BD6K3d1t.js","assets/ExternalLink-jdtpN_yL.js","assets/LinkedMarkdown-Bnc2OA63.js","assets/HtmlFileViewer-Bwmj5umg.js","assets/HtmlFileViewer-CQqWleQI.css","assets/ImageFileViewer-CdFLl_in.js","assets/ImageFileViewer-3izbFVTw.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{Ct as t,xt as n}from"./base-ui-DDpgJXgO.js";import{n as r}from"./createReactComponent-Ctub7J3a.js";import{t as i}from"./IconLoader4-D2VN7u1V.js";import{T as a,g as o,h as s,l as c,t as l,v as u}from"./index-DsKvWsTs.js";import{Dt as d,d as f,ft as ee,o as p,pt as m,u as te}from"./App-Bfw_TX8q.js";import{t as h}from"./LinkedText-BD6K3d1t.js";var g=e(t()),_=n(),v=(0,g.lazy)(()=>l(()=>import(`./PierreDiffViewer-CDfQ32e0.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]))),y=(0,g.lazy)(()=>l(()=>import(`./PierreEditBoundary-DAdYNYZ3.js`).then(e=>({default:e.PierreEditBoundary})),__vite__mapDeps([31,1,2,7,8,9,4,3,10,11,29,32]))),b=(0,g.lazy)(()=>l(()=>import(`./MarkdownFileViewer-NUAoQmv5.js`).then(e=>({default:e.MarkdownFileViewer})),__vite__mapDeps([33,1,2,3,4,26,7,8,9,10,11,18,19,20,21,22,6,23,24,25,27,28,34,35,36,14,12,15,16,17,30,29,32,37,38,39]))),x=(0,g.lazy)(()=>l(()=>import(`./PullRequestViewer-u89zl169.js`).then(e=>({default:e.PullRequestViewer})),__vite__mapDeps([40,1,2,9,3,4,41,26,7,8,10,11,18,19,20,21,22,6,23,24,25,27,28,42,43,34,35,44,39]))),S=(0,g.lazy)(()=>l(()=>import(`./EditableFileViewer-Dotntfij.js`).then(e=>({default:e.EditableFileViewer})),__vite__mapDeps([36,1,2,7,8,9,4,3,10,11,14,12,15,16,17,28,18,19,20,21,22,6,23,24,25,26,27,30,29,32,37]))),ne=(0,g.lazy)(()=>l(()=>import(`./HtmlFileViewer-Bwmj5umg.js`).then(e=>({default:e.HtmlFileViewer})),__vite__mapDeps([45,1,2,34,4,35,36,7,8,9,3,10,11,14,12,15,16,17,28,18,19,20,21,22,6,23,24,25,26,27,30,29,32,37,46]))),re=(0,g.lazy)(()=>l(()=>import(`./ImageFileViewer-CdFLl_in.js`).then(e=>({default:e.ImageFileViewer})),__vite__mapDeps([47,1,2,3,4,26,7,8,9,10,11,34,35,36,14,12,15,16,17,28,18,19,20,21,22,6,23,24,25,27,30,29,32,37,48]))),ie=(0,g.lazy)(()=>l(()=>import(`./ImageFileViewer-CdFLl_in.js`).then(e=>({default:e.SvgFileViewer})),__vite__mapDeps([47,1,2,3,4,26,7,8,9,10,11,34,35,36,14,12,15,16,17,28,18,19,20,21,22,6,23,24,25,27,30,29,32,37,48]))),C=new p({maxEntries:8,maxBytes:16777216,sizeOf:e=>e.patch.length*2+e.path.length*2+256}),w=null;function T({repositoryId:e,selection:t,diffView:n,wrapLines:o,theme:s,revision:l,readOnly:u,commits:d,draftFor:p,onSelect:h,onOpenFile:T,onDiffViewChange:O,onWrapLinesChange:k,onDraftChange:A,onDraftSaved:j,onUpdateConflict:M,onResolveConflict:N}){let[P,F]=(0,g.useState)(null),[I,L]=(0,g.useState)(!1),[R,z]=(0,g.useState)(null),[B,V]=(0,g.useState)(!1),H=(0,g.useRef)(0),U=(0,g.useRef)(!1),W=oe(e,t);(0,g.useEffect)(()=>{V(!1),U.current=!1},[t]),(0,g.useEffect)(()=>{w!==e&&(C.clear(),w=e);let n=++H.current;z(null),!t||t.type===`pull-request`?(F(null),L(!1)):(L(!0),(async()=>{try{if(t.type===`file`||t.type===`conflict`){if(t.type===`file`&&te(t.path)){let r=await c.repository.readImage(e,t.path);if(n!==H.current)return;F({docKey:W,type:`image`,value:r});return}let r=await c.repository.readFile(e,t.path,t.type===`conflict`||B);if(n!==H.current)return;if(t.type===`conflict`){F({docKey:W,type:`conflict`,value:r});return}F(e=>e&&e.docKey===W&&e.type===`file`&&U.current||e&&e.docKey===W&&e.type===`file`&&e.value.content===r.content&&e.value.size===r.size&&e.value.binary===r.binary&&e.value.tooLarge===r.tooLarge?e:{docKey:W,type:`file`,value:r})}else{let r=t.type!==`diff`,i=r?C.get(W):void 0;if(i||(i=t.type===`commit`?await c.diff.getCommit(e,t.oid):t.type===`commit-file`?await c.diff.getCommitFile(e,t.oid,t.path,t.oldPath):await c.diff.get({repositoryId:e,path:t.path,kind:t.kind}),r&&C.set(W,i)),n!==H.current)return;let a=i;F(e=>e&&e.docKey===W&&e.type===`diff`&&e.value.patch===a.patch&&e.value.binary===a.binary?e:{docKey:W,type:`diff`,value:a})}}catch(e){n===H.current&&z(e instanceof Error?e.message:`Could not load the viewer.`)}finally{n===H.current&&L(!1)}})())},[B,W,e,l,t]);let G=s===`system`?`system`:s,ce=o?`wrap`:`scroll`,K=(0,g.useCallback)(e=>{U.current=e},[]),q=(0,g.useCallback)(async(t,n,r)=>{let i=p(t),a=await c.repository.writeFile(e,t,n,i?.expectedContent??r);return a.status===`saved`&&(U.current=!1,j(t),F(e=>e?.type===`file`&&e.value.path===t?{...e,value:{...e.value,content:n,binary:!1,tooLarge:!1,size:a.size,mtimeMs:a.mtimeMs}}:e)),a},[p,j,e]),J=(0,g.useCallback)(e=>e.path,[]),Y=(0,g.useCallback)(e=>p(e.path)?.content??e.content,[p]),X=(0,g.useCallback)(e=>t=>A(e.path,t,e.content,e.mtimeMs),[A]),le=I&&P!==null&&!R,Z,Q=null;if(!t)Z=(0,_.jsx)(se,{});else if(t.type===`pull-request`)Z=(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(E,{}),children:(0,_.jsx)(x,{repositoryId:e,prNumber:t.number,onSelectPullRequest:e=>h({type:`pull-request`,number:e}),diffView:n,themeType:G,wrapLines:o,onDiffViewChange:O,onWrapLinesChange:k,onClose:()=>h(null)},`${e}:${t.number}`)});else if(R)Z=(0,_.jsx)(`div`,{className:`viewer-message text-destructive`,children:R});else if(!P)Z=(0,_.jsxs)(`div`,{className:`viewer-message`,children:[(0,_.jsx)(i,{className:`spinner`}),` `,(0,_.jsx)(r,{text:`Loading…`})]});else if(P.type===`image`)Z=(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(E,{}),children:(0,_.jsx)(re,{image:P.value},`${P.value.path}:${P.value.mtimeMs}`)});else if(P.type!==`diff`&&P.value.binary)Z=(0,_.jsxs)(`div`,{className:`viewer-message`,children:[`Binary file · `,D(P.value.size)]});else if(P.type===`file`&&P.value.tooLarge&&!B)Z=(0,_.jsxs)(`div`,{className:`viewer-message flex-col gap-3`,children:[(0,_.jsxs)(`p`,{children:[`The file is `,D(P.value.size),`. Preview is limited to protect performance.`]}),(0,_.jsx)(a,{variant:`outline`,onClick:()=>V(!0),children:`Load preview`})]});else if(P.type===`file`&&P.value.tooLarge)Z=(0,_.jsx)(`div`,{className:`viewer-message text-destructive`,children:`The file exceeds the built-in editor's 8 MB safety limit.`});else if(P.type===`conflict`&&P.value.tooLarge)Z=(0,_.jsx)(`div`,{className:`viewer-message text-destructive`,children:`The conflicted file exceeds the viewer's safe limit. Open it in an external editor to resolve it.`});else if(P.type===`conflict`)Z=null,Q=(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(E,{}),children:(0,_.jsx)(v,{kind:`conflict`,contentKey:P.docKey,file:P.value,themeType:G,overflow:ce,onUpdate:M,onResolve:N})});else if(P.type===`file`&&m(P.value.path)){let t=P.value;Z=(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(E,{}),children:(0,_.jsx)(b,{repositoryId:e,file:t,initialContent:Y(t),revision:l,themeType:G,wrapLines:o,readOnly:u||t.tooLarge,onOpenFile:T,onDirtyChange:K,onDraftChange:X(t),onSave:q},J(t))})}else if(P.type===`file`&&f(P.value.path)){let e=P.value;Z=(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(E,{}),children:(0,_.jsx)(ie,{file:e,initialContent:Y(e),themeType:G,wrapLines:o,readOnly:u||e.tooLarge,onDirtyChange:K,onDraftChange:X(e),onSave:q},J(e))})}else if(P.type===`file`&&ee(P.value.path)){let e=P.value;Z=(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(E,{}),children:(0,_.jsx)(ne,{file:e,initialContent:Y(e),themeType:G,wrapLines:o,readOnly:u||e.tooLarge,onDirtyChange:K,onDraftChange:X(e),onSave:q},J(e))})}else if(P.type===`file`){let e=P.value;Z=(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(E,{}),children:(0,_.jsx)(S,{file:e,initialContent:Y(e),themeType:G,wrapLines:o,readOnly:u,onDirtyChange:K,onDraftChange:X(e),onSave:q},J(e))})}else if(P.type===`diff`){let e=t.type===`commit`||t.type===`commit-file`?t:null,r=e?d.find(t=>t.oid===e.oid):void 0,i=t.type===`commit-file`?(0,_.jsx)(a,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>h({type:`commit`,oid:t.oid,subject:r?.subject??t.oid.slice(0,8)}),children:`All files`}):void 0;Z=null,Q=(0,_.jsxs)(`div`,{className:e?`commit-diff-viewer`:`standalone-diff-viewer`,children:[e&&(0,_.jsx)(ae,{commit:r,fallbackSubject:`subject`in e?e.subject:``},e.oid),P.value.patch?(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(E,{}),children:(0,_.jsx)(v,{kind:`diff`,contentKey:P.docKey,value:P.value,diffView:n,themeType:G,wrapLines:o,initiallyCollapsed:t.type===`commit`,compact:t.type===`diff`,scopeControl:i,onDiffViewChange:O,onWrapLinesChange:k,onClose:()=>h(null)})}):(0,_.jsx)(`div`,{className:`viewer-message`,children:t.type===`commit`&&r?.parentCount&&r.parentCount>1?`This merge commit has no changes of its own.`:`No differences to show.`})]})}else Z=(0,_.jsx)(`div`,{className:`viewer-message`,children:`This file cannot be edited.`});let $=(0,_.jsxs)(_.Fragment,{children:[Q??(0,_.jsx)(`div`,{className:`viewer-transition`,children:Z},P?P.docKey:W),le&&(0,_.jsx)(`span`,{className:`viewer-reloading`,"aria-hidden":`true`,children:(0,_.jsx)(i,{className:`spinner`})})]});return P?.type===`file`?(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(E,{}),children:(0,_.jsx)(y,{enabled:!0,children:$})}):$}function ae({commit:e,fallbackSubject:t}){let n=e?.date,[r,i]=(0,g.useState)(!0),a=e?.body??``,c=a.length>240||a.split(`
|
|
3
|
+
`).length>3;return(0,_.jsxs)(`header`,{className:`commit-diff-header`,children:[(0,_.jsx)(`h2`,{children:(0,_.jsx)(h,{text:e?.subject||t||`(no subject)`})}),a&&(0,_.jsxs)(`div`,{className:`commit-diff-description-wrap`,children:[(0,_.jsx)(`p`,{className:`commit-diff-description ${c&&!r?`collapsed`:``}`,children:(0,_.jsx)(h,{text:a})}),c&&(0,_.jsx)(`button`,{type:`button`,className:`commit-description-toggle`,"aria-expanded":r,onClick:()=>i(e=>!e),children:r?`Show less`:`Show full description`})]}),(0,_.jsxs)(`div`,{className:`commit-diff-meta`,children:[(0,_.jsx)(`code`,{children:e?.shortOid??`commit`}),e?.author&&(0,_.jsxs)(`span`,{children:[e.author,e.email?` <${e.email}>`:``]}),n&&Number.isFinite(new Date(n).getTime())&&(0,_.jsxs)(s,{children:[(0,_.jsx)(u,{render:(0,_.jsx)(`time`,{dateTime:e?.date}),children:d(n,{seconds:!0})}),(0,_.jsx)(o,{children:d(n,{seconds:!0})})]}),e?.parentCount&&e.parentCount>1?(0,_.jsx)(`span`,{children:`Merge commit · Own files compared with first parent`}):null,e?.upstreamState===`local-only`&&(0,_.jsx)(`span`,{className:`commit-local-label`,children:`Local only`})]})]})}function oe(e,t){return t?t.type===`pull-request`?`${e}:pull:${t.number}`:t.type===`commit`?`${e}:commit:${t.oid}`:t.type===`commit-file`?`${e}:commit-file:${t.oid}:${t.oldPath??``}:${t.path}`:t.type===`diff`?`${e}:diff:${t.kind}:${t.path}`:`${e}:${t.type}:${t.path}`:`${e}:empty`}function E(){return(0,_.jsxs)(`div`,{className:`viewer-message`,children:[(0,_.jsx)(i,{className:`spinner`}),` `,(0,_.jsx)(r,{text:`Loading viewer…`})]})}function se(){return(0,_.jsxs)(`div`,{className:`viewer-empty`,children:[(0,_.jsx)(`h2`,{children:`Nothing selected`}),(0,_.jsx)(`p`,{children:`Select a change, file, commit, or pull request.`})]})}function D(e){return e?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`:`unknown size`}export{T as default};
|
package/dist/client/assets/{abnfDiagram-YUKMZFIV-CpKAN_8n.js → abnfDiagram-YUKMZFIV-It6tW-4v.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e,t}from"./mermaid-parser.core-
|
|
1
|
+
import{m as e,t}from"./mermaid-parser.core-DNeaCX12.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-JH1jZ6Eh.js";import"./chunk-VPRB5NB3-Dnr3edxV.js";import{n as i,r as a,t as o}from"./chunk-AW2ZBBNX-DBqqxF2h.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-Dtt7rXw0.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=n(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=n(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
|
package/dist/client/assets/{architecture-WOLXFQ4H-DrizVopY.js → architecture-WOLXFQ4H-CaOaChND.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-NGNAAXSQ-C2Wy9Xmz.js";export{M as createArchitectureServices}from"./mermaid-parser.core-
|
|
1
|
+
import"./chunk-NGNAAXSQ-C2Wy9Xmz.js";export{M as createArchitectureServices}from"./mermaid-parser.core-DNeaCX12.js";
|