decocms 4.186.3 → 4.186.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/dist/client/assets/{AlertCircle-BfuYC-ez.js → AlertCircle-BM2arXAG.js} +1 -1
- package/dist/client/assets/{AreaChart-Ci-A0btx.js → AreaChart-DAXzCJFT.js} +1 -1
- package/dist/client/assets/{ArrowUp-Dkm0nOGw.js → ArrowUp-Boc-905Z.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CRz_iHAu.js → ArrowUpRight-B3CxAPJj.js} +1 -1
- package/dist/client/assets/{Check-CfIRDOap.js → Check-D0s6wH1X.js} +1 -1
- package/dist/client/assets/{CheckCircle-UqA3DPGv.js → CheckCircle-BGu0rmUQ.js} +1 -1
- package/dist/client/assets/{ChevronDown-Dfx8ph9o.js → ChevronDown-CsqU07CB.js} +1 -1
- package/dist/client/assets/{ChevronRight-BXMKC2_M.js → ChevronRight-DzEO4WOO.js} +1 -1
- package/dist/client/assets/{ChevronUp-Dl1S15_f.js → ChevronUp-CLKFL_od.js} +1 -1
- package/dist/client/assets/{Copy01-DDRpZJ1h.js → Copy01-Bu4T-_yj.js} +1 -1
- package/dist/client/assets/{CpuChip01-DZ_mRqyz.js → CpuChip01-C3l-ayM0.js} +1 -1
- package/dist/client/assets/{CreditCard01-DsphY5qx.js → CreditCard01-UMOdY0Uv.js} +1 -1
- package/dist/client/assets/{DotsVertical-CHkGthlj.js → DotsVertical-C4U-eO1-.js} +1 -1
- package/dist/client/assets/{Eye-mJ_2ivh6.js → Eye-BtghZBaq.js} +1 -1
- package/dist/client/assets/{FilterLines-C_1h3ZoJ.js → FilterLines-BMQz2giZ.js} +1 -1
- package/dist/client/assets/{HardDrive-Bdh7pAUM.js → HardDrive-CrMH19j9.js} +1 -1
- package/dist/client/assets/{Key01-BLGPH0DL.js → Key01-_U8PdKT-.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BfIP_r4O.js → LayoutLeft-DhqFICkJ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Ba5xXfz2.js → LinkExternal01-D1rq1_uq.js} +1 -1
- package/dist/client/assets/{LogOut01-CvwGYyrH.js → LogOut01--8dqoEbi.js} +1 -1
- package/dist/client/assets/{Monitor01-3irKmnvO.js → Monitor01-Cjz_FTaX.js} +1 -1
- package/dist/client/assets/{Palette-CbPK4Rpt.js → Palette-dgaramLA.js} +1 -1
- package/dist/client/assets/{Play-54eB0T2G.js → Play-CEjkQJmT.js} +1 -1
- package/dist/client/assets/{Plus-CKO7n5Po.js → Plus-C-ooojQ-.js} +1 -1
- package/dist/client/assets/{SearchLg-CrtIkrUb.js → SearchLg-BsbCGElD.js} +1 -1
- package/dist/client/assets/{SearchMd-Bx38R8jT.js → SearchMd-DJxFGUte.js} +1 -1
- package/dist/client/assets/{Settings02-CDjArU7G.js → Settings02-Dd6wiqD1.js} +1 -1
- package/dist/client/assets/{Shield01-DWbsBnKy.js → Shield01-C-gfca5T.js} +1 -1
- package/dist/client/assets/{Star01-DOCStMKN.js → Star01-COab1bwH.js} +1 -1
- package/dist/client/assets/{Stars01-CYjq7xRF.js → Stars01-CrqdYStA.js} +1 -1
- package/dist/client/assets/{Stars02-BHlXbARl.js → Stars02-6dK01kpk.js} +1 -1
- package/dist/client/assets/{Sun-BLG01WIk.js → Sun-SP_cSydQ.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-25hapEqS.js → SwitchHorizontal01-ddUhxlHz.js} +1 -1
- package/dist/client/assets/{Tool01-DhSkNcMo.js → Tool01-n_pcUGI4.js} +1 -1
- package/dist/client/assets/{Tool02-CQZsqe8L.js → Tool02-CM2QQuSk.js} +1 -1
- package/dist/client/assets/{Trash01-DFj83XXx.js → Trash01-4ciIHO0v.js} +1 -1
- package/dist/client/assets/{TrendUp01-DEIKe0v4.js → TrendUp01-ok3-xVRP.js} +1 -1
- package/dist/client/assets/{Upload01-C4AUAXd5.js → Upload01-BN6NYqWG.js} +1 -1
- package/dist/client/assets/{User01-CDS7qDs6.js → User01-ZyVKonG8.js} +1 -1
- package/dist/client/assets/{Users01-Dev0Wnwe.js → Users01-Chm4EuVC.js} +1 -1
- package/dist/client/assets/{Users03-cydJxCq2.js → Users03-CAfxXxrx.js} +1 -1
- package/dist/client/assets/{X-ImXzxvCp.js → X-C9CNUxMc.js} +1 -1
- package/dist/client/assets/{XCircle-BlO0Qy51.js → XCircle-CgmQaEpw.js} +1 -1
- package/dist/client/assets/{XClose-D7r31LaY.js → XClose-Ir2v6njF.js} +1 -1
- package/dist/client/assets/{Zap-C1KfAU0L.js → Zap-DMOaYDez.js} +1 -1
- package/dist/client/assets/{ZapSquare-CCPTmscL.js → ZapSquare-DJ6Cr-Gd.js} +1 -1
- package/dist/client/assets/{access-gate-CT_xPmsE.js → access-gate-CJbiw1ui.js} +1 -1
- package/dist/client/assets/{add-section-modal-2h2v7Eix.js → add-section-modal-CPDfAg6v.js} +1 -1
- package/dist/client/assets/{agent-icon-DyvgCmDh.js → agent-icon-DZlxuF49.js} +1 -1
- package/dist/client/assets/{agents-list-B7uSsdOW.js → agents-list-yd5LMd0m.js} +1 -1
- package/dist/client/assets/{ai-providers-DYKYHtHN.js → ai-providers-BYQ_-U47.js} +1 -1
- package/dist/client/assets/{alert-DgOKny_5.js → alert-BUeQIcZG.js} +1 -1
- package/dist/client/assets/{alert-dialog-qODg0L4t.js → alert-dialog-xIkA8j5x.js} +2 -2
- package/dist/client/assets/app-editor-DOobewvH.js +1 -0
- package/dist/client/assets/{auth-CzoWoS_Q.js → auth-BS9hvljB.js} +1 -1
- package/dist/client/assets/{auth-catchall-Do2b1Q5s.js → auth-catchall-BQkJx0Q9.js} +1 -1
- package/dist/client/assets/{auth-entry-C1cRB-Mt.js → auth-entry-COeA_b06.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BpxjTMnc.js → auth-split-layout-D3vaJt1T.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-_aMCtvov.js → authenticate-and-persist-oauth-BpEFvvfk.js} +1 -1
- package/dist/client/assets/{automation-list-row-qM5LBHmY.js → automation-list-row-BeYIheNk.js} +1 -1
- package/dist/client/assets/automation-runs-DJDyx8Ab.js +281 -0
- package/dist/client/assets/{automations-DYJT_-Df.js → automations-Dc8V9snr.js} +1 -1
- package/dist/client/assets/{avatar-BzQ7WmXz.js → avatar-TMC1sUqM.js} +1 -1
- package/dist/client/assets/{badge-0OderU4R.js → badge-Cw8NAtiW.js} +1 -1
- package/dist/client/assets/{billing-sUUWLMkH.js → billing-C0B7lv24.js} +1 -1
- package/dist/client/assets/{block-document-B9MqZDy8.js → block-document-BAeei5ic.js} +3 -3
- package/dist/client/assets/{brand-context-Cd1XITlN.js → brand-context-B8Z3AOB1.js} +1 -1
- package/dist/client/assets/{buckets-BvDdA7ec.js → buckets-BUDz0wYB.js} +1 -1
- package/dist/client/assets/bulk-category-panel-Bp_iUjkm.js +1 -0
- package/dist/client/assets/{capability-load-error-CrHwHuDV.js → capability-load-error-DlPlQyTu.js} +1 -1
- package/dist/client/assets/{card-DmKStgES.js → card-f7IIAQow.js} +1 -1
- package/dist/client/assets/category-editor-Q4jhDglC.js +1 -0
- package/dist/client/assets/{chat-context-BTbaCF1T.js → chat-context-lZafrisH.js} +4 -4
- package/dist/client/assets/{checkbox-BZRzofDI.js → checkbox-DRvNUH73.js} +1 -1
- package/dist/client/assets/{cli-auth-success-GLWllWTp.js → cli-auth-success-C8NhW6ZX.js} +1 -1
- package/dist/client/assets/{collection-detail-BgGn5qWk.js → collection-detail-Cw8pxVYF.js} +1 -1
- package/dist/client/assets/{collection-display-button-1iQBb-oM.js → collection-display-button-Bt8fcXAU.js} +1 -1
- package/dist/client/assets/{collection-search-C1t7YBY3.js → collection-search-BcJG8MRL.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BoIzuQ13.js → collection-table-wrapper-KcuXHMSk.js} +1 -1
- package/dist/client/assets/{collection-tabs-DkKbZNxK.js → collection-tabs-DdOwtj6b.js} +1 -1
- package/dist/client/assets/{command-M0ieFwmm.js → command-DGcauViI.js} +1 -1
- package/dist/client/assets/commerce-onboarding-CfDDDw6y.js +1 -0
- package/dist/client/assets/{connect-DZ11YKFe.js → connect-BOHbND-E.js} +1 -1
- package/dist/client/assets/{connection-Vbw7_lND.js → connection-D6HFEYzq.js} +1 -1
- package/dist/client/assets/{connection-card-DuKkmMXb.js → connection-card-BVHwhA2v.js} +1 -1
- package/dist/client/assets/{connection-detail-27wuK5wq.js → connection-detail-DNk_cneF.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CAyGL1Rc.js → connection-form-helpers-4kXFEJvh.js} +1 -1
- package/dist/client/assets/{connections-CqIOOtH4.js → connections-BtTLDoE9.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Clmp1BFL.js → decopilot-sse-pool-DIaaeHkx.js} +1 -1
- package/dist/client/assets/{dialog-B5y5hFnb.js → dialog-CM96GyMN.js} +1 -1
- package/dist/client/assets/{domain-settings-B5CZtkpJ.js → domain-settings-B-8BrNH4.js} +1 -1
- package/dist/client/assets/{drawer-BZTnQot8.js → drawer-Dn3JbFxM.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CHizDN5S.js → dropdown-menu-CuE5oWLS.js} +1 -1
- package/dist/client/assets/{empty-state-DQHHZFK3.js → empty-state-B-rbOsZt.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DveMzJnj.js → extract-connection-data-D78MPGm0.js} +1 -1
- package/dist/client/assets/file-explorer-BNEWK43O.js +2 -0
- package/dist/client/assets/{form-Bq1A_P9t.js → form-DJREymz4.js} +1 -1
- package/dist/client/assets/{general-AzcYBHSb.js → general-Bvib2mwc.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CT456aBC.js → github-repo-picker-DnRkLuCY.js} +1 -1
- package/dist/client/assets/{hooks-_oUacd7x.js → hooks-DzdIDE_S.js} +5 -5
- package/dist/client/assets/{index-BE7mJhFy.js → index-B0fkC9lT.js} +27 -27
- package/dist/client/assets/{index-wxJpDGRQ.js → index-BKQvMWY3.js} +2 -2
- package/dist/client/assets/index-BLe-kRg3.js +1 -0
- package/dist/client/assets/index-C9Hb4-0H.js +1 -0
- package/dist/client/assets/index-CFru9TWd.js +738 -0
- package/dist/client/assets/{index-DAM0y29_.js → index-Cbb91-P4.js} +1 -1
- package/dist/client/assets/{index-NuvNvWBH.js → index-Ccnv49_z.js} +1 -1
- package/dist/client/assets/{index-BcXDjqbG.js → index-ClVafn5Q.js} +1 -1
- package/dist/client/assets/{index-jM_Cebcw.js → index-D3hIc5HE.js} +1 -1
- package/dist/client/assets/{index-C3N6oAxN.js → index-Dytal4UA.js} +1 -1
- package/dist/client/assets/{index-DmcNl6lo.js → index-Uyw3lO4W.js} +4 -4
- package/dist/client/assets/{index-redirect-DZYpYiG4.js → index-redirect-C63Ka-dC.js} +1 -1
- package/dist/client/assets/{input-SHG4kEt8.js → input-BLYKaojw.js} +1 -1
- package/dist/client/assets/{integration-icon-BPgt71bM.js → integration-icon-y2a679m_.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BMdHwRKu.js → invite-member-dialog-pvdnivHT.js} +1 -1
- package/dist/client/assets/{label-BoGYufMX.js → label-CpR3NhLK.js} +1 -1
- package/dist/client/assets/{layout-t1l41lNQ.js → layout-DkAn-olq.js} +1 -1
- package/dist/client/assets/{login-CbQVX_Ku.js → login-uBznkVFV.js} +1 -1
- package/dist/client/assets/{mcp-oauth-h1LtXs-F.js → mcp-oauth-Cbz6v_pp.js} +1 -1
- package/dist/client/assets/{members-DtiRSiv7.js → members-CYoo4I8Y.js} +1 -1
- package/dist/client/assets/{monaco-editor-AdkIaxez.js → monaco-editor-ChN-uCZ5.js} +4 -4
- package/dist/client/assets/{monitoring-stats-row-BH5n-y90.js → monitoring-stats-row-CaWJELM4.js} +1 -1
- package/dist/client/assets/{multi-select-CC0lBwV8.js → multi-select-HsDIiU9u.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bdfoq5pi.js → oauth-callback-D4B9fvV3.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DqX6IkBf.js → oauth-callback-ai-provider-D8wbGI6A.js} +1 -1
- package/dist/client/assets/{onboarding-B2fYGhas.js → onboarding-Ds1l48aO.js} +1 -1
- package/dist/client/assets/{org-layout-Nbsmhfuf.js → org-layout-D5C_xL5_.js} +1 -1
- package/dist/client/assets/{organization-choice-UHJGNPVD.js → organization-choice-DAqtf8QJ.js} +1 -1
- package/dist/client/assets/{orgs-rmUP3nva.js → orgs-D62MZerx.js} +1 -1
- package/dist/client/assets/{page-seo-form-DSI5Z6Xm.js → page-seo-form-C4SkFKsY.js} +1 -1
- package/dist/client/assets/{popover-Bu5EGKLW.js → popover-BbhyOPS3.js} +1 -1
- package/dist/client/assets/post-editor-Bpk6It1u.js +1 -0
- package/dist/client/assets/{primitives-zMJeNtQk.js → primitives-Bt3tuGeo.js} +1 -1
- package/dist/client/assets/{profile-Bh_w10qc.js → profile-BctbNEfJ.js} +1 -1
- package/dist/client/assets/project-app-view-BKQjXNca.js +1 -0
- package/dist/client/assets/{provision-repo-scoped-github-connection-B2s3ApVy.js → provision-repo-scoped-github-connection-ufuvpGD9.js} +1 -1
- package/dist/client/assets/record-editor-QqrTdXL4.js +1 -0
- package/dist/client/assets/redirect-editor-D8jJ6iR_.js +1 -0
- package/dist/client/assets/registry-DhILOcmJ.js +2 -0
- package/dist/client/assets/{registry-layout-BNL3rWwh.js → registry-layout-CQMbkd7b.js} +1 -1
- package/dist/client/assets/{reports-TRcjEu_G.js → reports-rEO41B-T.js} +1 -1
- package/dist/client/assets/{require-capability-D_i84gfM.js → require-capability-CZ-yYBiA.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DduipUtL.js → required-auth-layout-DtQVJg-L.js} +1 -1
- package/dist/client/assets/{reset-password-DWRCcb4-.js → reset-password-xaU8NkAt.js} +1 -1
- package/dist/client/assets/{roles-CBcjWl-7.js → roles-CaPOmG9k.js} +1 -1
- package/dist/client/assets/{search-input-CY-7-6Mr.js → search-input-CZdp52yV.js} +1 -1
- package/dist/client/assets/{secrets-kNdWJ7Jo.js → secrets-DizdSJgN.js} +1 -1
- package/dist/client/assets/sections-editor-B4E9k2Dl.js +2 -0
- package/dist/client/assets/{select-DE2zqg5r.js → select-BudfwrnS.js} +1 -1
- package/dist/client/assets/{select-model-D2N9Z9Ec.js → select-model-C7aX0FnY.js} +1 -1
- package/dist/client/assets/self-tool-result-Cj3FZK_q.js +1 -0
- package/dist/client/assets/seo-editor-Dgknhqwj.js +1 -0
- package/dist/client/assets/{settings-layout-DfS5HS2T.js → settings-layout-CU-4TAUD.js} +1 -1
- package/dist/client/assets/{settings-section-DBkfk9BB.js → settings-section-BE7oCApW.js} +1 -1
- package/dist/client/assets/{shell-controls-CPQdyoX4.js → shell-controls-crL6wfUO.js} +1 -1
- package/dist/client/assets/{shell-layout-DbBB0LUI.js → shell-layout-GtI-8lBm.js} +1 -1
- package/dist/client/assets/sidebar-D3IIq4Vk.js +1 -0
- package/dist/client/assets/{skeleton-AvMrml5O.js → skeleton-GgH9QFOh.js} +1 -1
- package/dist/client/assets/{spinner-BB2hby2t.js → spinner-DFReXmvo.js} +1 -1
- package/dist/client/assets/{sso-CFR5Du-O.js → sso-BWPSV72o.js} +1 -1
- package/dist/client/assets/{store-Gd8umnDO.js → store-BhZZOuCy.js} +1 -1
- package/dist/client/assets/store-registry-DJSlp72K.js +2 -0
- package/dist/client/assets/{studio-tools-DXVCK0sW.js → studio-tools-BaJrIiyZ.js} +1 -1
- package/dist/client/assets/{switch-BEKqgb1f.js → switch-tQg0oUQP.js} +1 -1
- package/dist/client/assets/{tab-id-xREOP0to.js → tab-id-7eVkCyFd.js} +1 -1
- package/dist/client/assets/{table-pV8D0u2m.js → table-C1MCilFh.js} +1 -1
- package/dist/client/assets/{tabs-C97TV6wP.js → tabs-DX3EM3Ee.js} +1 -1
- package/dist/client/assets/{textarea-BIsK3TvL.js → textarea-mkvWFVEl.js} +1 -1
- package/dist/client/assets/{toggle-group-B_DzWSgI.js → toggle-group-F8qf1aho.js} +1 -1
- package/dist/client/assets/{toolbar-CKmQWdVF.js → toolbar-Cf542s4U.js} +1 -1
- package/dist/client/assets/{tooltip-B-gahmZ0.js → tooltip-CD1UqZ9B.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Db5LNUJN.js → use-ai-providers-D16FGHJt.js} +1 -1
- package/dist/client/assets/{use-automations-DfD-q04Z.js → use-automations-D8H19XtT.js} +1 -1
- package/dist/client/assets/{use-autosave-Dbj26Vw8.js → use-autosave-DL6SLVUG.js} +1 -1
- package/dist/client/assets/{use-capability-DbPUHhbH.js → use-capability-CE9es946.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CU7u0LpL.js → use-clock-tick-B_PZSxjQ.js} +1 -1
- package/dist/client/assets/{use-connection-Di6VWa3L.js → use-connection-C9xGzeZ0.js} +1 -1
- package/dist/client/assets/{use-copy-B64dHmlD.js → use-copy-Biga7DQq.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BL707Luj.js → use-create-virtual-mcp-C5b_hYeV.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DsmYOWfj.js → use-debounced-autosave-oSeifFUO.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BMDLplmP.js → use-debounced-value-B6d-EEaH.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BKsepuUx.js → use-deco-credits-DEFWEFHy.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CZNjfghP.js → use-decopilot-events-DPOdIyZW.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CtqbbhKd.js → use-delete-connection-B83lgoSz.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-D-SiWD8V.js → use-deployment-admin-BQjxPpS5.js} +1 -1
- package/dist/client/assets/{use-file-configs-B_bqkDL5.js → use-file-configs-lWDULD1a.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CmpA7aNk.js → use-infinite-scroll-BuArBLl_.js} +1 -1
- package/dist/client/assets/{use-join-requests-D3PioMCU.js → use-join-requests-CeBrzND0.js} +1 -1
- package/dist/client/assets/use-mcp-client-D8jVoojU.js +10 -0
- package/dist/client/assets/{use-mcp-tools-gs2BaxE7.js → use-mcp-tools-CxNi4RsV.js} +1 -1
- package/dist/client/assets/{use-members-Cw9Cvkx3.js → use-members-DYQSbhV-.js} +1 -1
- package/dist/client/assets/{use-mobile-Fq3m92SB.js → use-mobile-C76oZZ_y.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Bpm8yGLA.js → use-navigate-to-agent-B7ku0JC8.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-CAxNtzL4.js → use-open-billing-url-DquSLGrh.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Bxh7oYIw.js → use-org-auth-client-CLw_zaJR.js} +1 -1
- package/dist/client/assets/{use-org-sso-CHpy2ljn.js → use-org-sso-DQRelBUr.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BhcqsdWg.js → use-organization-roles-B7ZCQVse.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B1oXAg8v.js → use-organization-settings-DAWGh7rb.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CMu53VQD.js → use-registry-connections-4HrWpBE2.js} +1 -1
- package/dist/client/assets/{use-secrets-DuSGJa4J.js → use-secrets-CV1UNts7.js} +1 -1
- package/dist/client/assets/{use-status-sounds--hLMjyxJ.js → use-status-sounds-Dxu-GZwE.js} +1 -1
- package/dist/client/assets/{use-tags-0YzsYO3f.js → use-tags-CF2jWoFP.js} +1 -1
- package/dist/client/assets/{use-view-mode-B1gvmNYJ.js → use-view-mode-8obytCVP.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-SgXDkg75.js → use-virtual-mcp-BRfZj2ng.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CuXI7a9b.js +1 -0
- package/dist/client/assets/{useRouterState-CrL8ZHBU.js → useRouterState-CIMkbMOV.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-FYAwQiAK.js +1 -0
- package/dist/client/assets/{users-Cv1B39Hm.js → users-l3buiqkJ.js} +1 -1
- package/dist/client/assets/variant-calendar-CufrhFsD.js +1 -0
- package/dist/client/assets/{view-mode-toggle-iaC8KMna.js → view-mode-toggle-CErBMjrv.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/app-editor-B0XFGNw1.js +0 -1
- package/dist/client/assets/automation-runs-BAj-VvKU.js +0 -47
- package/dist/client/assets/bulk-category-panel-DEFprjKz.js +0 -1
- package/dist/client/assets/calendar-DzZPxWQd.js +0 -235
- package/dist/client/assets/category-editor-CA0KjE4N.js +0 -1
- package/dist/client/assets/commerce-onboarding-BZW1JyaC.js +0 -1
- package/dist/client/assets/companions-core-B5XTmC8f.js +0 -1
- package/dist/client/assets/file-explorer-B-6UIupX.js +0 -2
- package/dist/client/assets/index-BUxqhuMH.js +0 -77
- package/dist/client/assets/index-BsA-EPSZ.js +0 -1
- package/dist/client/assets/index-D1QykbrQ.js +0 -663
- package/dist/client/assets/index-FQ8XLQdc.js +0 -1
- package/dist/client/assets/post-editor-D_0v5MIW.js +0 -1
- package/dist/client/assets/project-app-view-64N_hCxT.js +0 -1
- package/dist/client/assets/record-editor-CfyDRkai.js +0 -1
- package/dist/client/assets/redirect-editor-DtpQyamh.js +0 -1
- package/dist/client/assets/registry-wwH7QUtH.js +0 -2
- package/dist/client/assets/sections-editor-CTSmdAom.js +0 -2
- package/dist/client/assets/self-tool-result-DNH6ZaMF.js +0 -1
- package/dist/client/assets/seo-editor-y4WzGjJn.js +0 -1
- package/dist/client/assets/sidebar-jMHKufA-.js +0 -1
- package/dist/client/assets/store-registry-BhGNNIkp.js +0 -2
- package/dist/client/assets/use-mcp-client-B6rroWiF.js +0 -10
- package/dist/client/assets/useInfiniteQuery-ZHHCL_4m.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-k1g0FdzT.js +0 -1
- package/dist/client/assets/variant-calendar-BWhYWq7j.js +0 -1
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D1QykbrQ.js","assets/index-BE7mJhFy.js","assets/index-DHCkR8xR.css","assets/ArrowUp-Dkm0nOGw.js","assets/chat-context-BTbaCF1T.js","assets/tab-id-xREOP0to.js","assets/dialog-B5y5hFnb.js","assets/X-ImXzxvCp.js","assets/Check-CfIRDOap.js","assets/Copy01-DDRpZJ1h.js","assets/hooks-_oUacd7x.js","assets/use-mcp-client-B6rroWiF.js","assets/auth-CzoWoS_Q.js","assets/decopilot-sse-pool-Clmp1BFL.js","assets/backoff-CrEUbyZT.js","assets/delay-CnY5UFtP.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-virtual-mcp-SgXDkg75.js","assets/use-ai-providers-Db5LNUJN.js","assets/studio-tools-DXVCK0sW.js","assets/use-decopilot-events-CZNjfghP.js","assets/use-organization-settings-B1oXAg8v.js","assets/automation-runs-BAj-VvKU.js","assets/select-DE2zqg5r.js","assets/tooltip-B-gahmZ0.js","assets/ChevronDown-Dfx8ph9o.js","assets/ChevronUp-Dl1S15_f.js","assets/useInfiniteQuery-ZHHCL_4m.js","assets/use-infinite-scroll-CmpA7aNk.js","assets/use-connection-Di6VWa3L.js","assets/card-DmKStgES.js","assets/sidebar-jMHKufA-.js","assets/LayoutLeft-BfIP_r4O.js","assets/use-mobile-Fq3m92SB.js","assets/table-pV8D0u2m.js","assets/empty-state-DQHHZFK3.js","assets/use-members-Cw9Cvkx3.js","assets/use-org-auth-client-Bxh7oYIw.js","assets/use-clock-tick-CU7u0LpL.js","assets/AlertCircle-BfuYC-ez.js","assets/CheckCircle-UqA3DPGv.js","assets/DotsVertical-CHkGthlj.js","assets/agent-icon-DyvgCmDh.js","assets/Tool01-DhSkNcMo.js","assets/Settings02-CDjArU7G.js","assets/Tool02-CQZsqe8L.js","assets/XCircle-BlO0Qy51.js","assets/ArrowUpRight-CRz_iHAu.js","assets/TrendUp01-DEIKe0v4.js","assets/ZapSquare-CCPTmscL.js","assets/Users03-cydJxCq2.js","assets/ChevronRight-BXMKC2_M.js","assets/Stars02-BHlXbARl.js","assets/CpuChip01-DZ_mRqyz.js","assets/CreditCard01-DsphY5qx.js","assets/Eye-mJ_2ivh6.js","assets/FilterLines-C_1h3ZoJ.js","assets/Star01-DOCStMKN.js","assets/Palette-CbPK4Rpt.js","assets/SwitchHorizontal01-25hapEqS.js","assets/HardDrive-Bdh7pAUM.js","assets/Key01-BLGPH0DL.js","assets/LinkExternal01-Ba5xXfz2.js","assets/LogOut01-CvwGYyrH.js","assets/Monitor01-3irKmnvO.js","assets/Sun-BLG01WIk.js","assets/Play-54eB0T2G.js","assets/Plus-CKO7n5Po.js","assets/SearchLg-CrtIkrUb.js","assets/SearchMd-Bx38R8jT.js","assets/Shield01-DWbsBnKy.js","assets/Stars01-CYjq7xRF.js","assets/Trash01-DFj83XXx.js","assets/Upload01-C4AUAXd5.js","assets/User01-CDS7qDs6.js","assets/Users01-Dev0Wnwe.js","assets/XClose-D7r31LaY.js","assets/Zap-C1KfAU0L.js","assets/use-automations-DfD-q04Z.js","assets/useSuspenseInfiniteQuery-k1g0FdzT.js","assets/avatar-BzQ7WmXz.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-B64dHmlD.js","assets/calendar-DzZPxWQd.js","assets/monaco-editor-AdkIaxez.js","assets/spinner-BB2hby2t.js","assets/index-DmcNl6lo.js","assets/shell-layout-DbBB0LUI.js","assets/required-auth-layout-DduipUtL.js","assets/use-org-sso-CHpy2ljn.js","assets/integration-icon-BPgt71bM.js","assets/use-navigate-to-agent-Bpm8yGLA.js","assets/reusable-new-chat-CouMjkYR.js","assets/AreaChart-Ci-A0btx.js","assets/form-Bq1A_P9t.js","assets/label-BoGYufMX.js","assets/input-SHG4kEt8.js","assets/drawer-BZTnQot8.js","assets/collection-search-C1t7YBY3.js","assets/tabs-C97TV6wP.js","assets/toggle-group-B_DzWSgI.js","assets/use-deco-credits-BKsepuUx.js","assets/popover-Bu5EGKLW.js","assets/alert-dialog-qODg0L4t.js","assets/toolbar-CKmQWdVF.js","assets/skeleton-AvMrml5O.js","assets/github-repo-picker-CT456aBC.js","assets/use-debounced-value-BMDLplmP.js","assets/authenticate-and-persist-oauth-_aMCtvov.js","assets/mcp-oauth-h1LtXs-F.js","assets/use-mcp-tools-gs2BaxE7.js","assets/extract-connection-data-DveMzJnj.js","assets/metadata-dUsYcpuu.js","assets/provision-repo-scoped-github-connection-B2s3ApVy.js","assets/agent-capabilities-cXfbMfjV.js","assets/connection-card-DuKkmMXb.js","assets/use-registry-connections-CMu53VQD.js","assets/retry-CErkP7V6.js","assets/connection-slug-eyAPH6o3.js","assets/textarea-BIsK3TvL.js","assets/connection-form-helpers-CAyGL1Rc.js","assets/collection-tabs-DkKbZNxK.js","assets/badge-0OderU4R.js","assets/use-open-billing-url-CAxNtzL4.js","assets/select-model-D2N9Z9Ec.js","assets/checkbox-BZRzofDI.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-DBkfk9BB.js","assets/dropdown-menu-CHizDN5S.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds--hLMjyxJ.js","assets/deco-site-production-url-CaKZ7xBn.js","assets/use-capability-DbPUHhbH.js","assets/pt-BR-CLy76QW2.js","assets/switch-BEKqgb1f.js","assets/use-debounced-autosave-DsmYOWfj.js","assets/index-C3N6oAxN.js","assets/search-input-CY-7-6Mr.js","assets/index-BcXDjqbG.js","assets/use-secrets-DuSGJa4J.js","assets/command-M0ieFwmm.js","assets/index-jM_Cebcw.js","assets/self-tool-result-DNH6ZaMF.js","assets/companions-core-B5XTmC8f.js","assets/use-file-configs-B_bqkDL5.js","assets/automation-list-row-qM5LBHmY.js","assets/get-initials-D-f_fDFw.js","assets/index-CiP0VfIv.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{G as Sa,r as S,c as U,x as Ca,K as xe,F as Me,o as pn,e as Ye,n as Ze,aw as Te,ae as sn,a as Ro,t as St,ar as ja,m as Z,j as c,b as oe,aW as Eo,aX as Io,aY as _o,aZ as Ao,a_ as Bo,a$ as Oo,b0 as $o,b1 as Mo,b2 as zo,B as Ae,y as Ta,av as Zr,E as Na,d as Lo,p as Mi,k as Ts,u as Da,aF as Ra}from"./index-BE7mJhFy.js";import{g as _t}from"./get-initials-D-f_fDFw.js";import{A as At}from"./avatar-BzQ7WmXz.js";import{aC as Ns,ae as Ea,af as Ia,ah as _a,a5 as Aa,aD as Ba,y as Oa,n as $a,aE as Jr,aF as Ma,W as ei,d as Po,ad as za,g as Fo,k as ur,aG as La,aA as Tr,ar as ti,Z as Yn,aH as Pa,ay as Fa}from"./agent-icon-DyvgCmDh.js";import{i as Uo}from"./SwitchHorizontal01-25hapEqS.js";import{s as ws}from"./Plus-CKO7n5Po.js";import{i as cn}from"./X-ImXzxvCp.js";import{a as Xn,b as xs,P as bs}from"./popover-Bu5EGKLW.js";import{a as Ct,i as qo,D as dn,b as un,c as fn,d as ls,e as as,f as cs}from"./dropdown-menu-CHizDN5S.js";import{W as Ua,m as zi,S as Ko,C as Ho,g as qa,u as Ka,h as Ha,Q as Wa,j as Va,a as Qa}from"./use-mcp-client-B6rroWiF.js";import{u as Ga,G as $r,a as Xa}from"./github-repo-picker-CT456aBC.js";import{e as Jn,d as es,b as ts,h as ni,a as si,c as ri}from"./dialog-B5y5hFnb.js";import{b as Ya,u as Za}from"./use-connection-Di6VWa3L.js";import{b as Ja}from"./provision-repo-scoped-github-connection-B2s3ApVy.js";import{a as ec}from"./authenticate-and-persist-oauth-_aMCtvov.js";import{e as tc}from"./extract-connection-data-DveMzJnj.js";import{u as Wo}from"./use-members-Cw9Cvkx3.js";import{u as gn}from"./studio-tools-DXVCK0sW.js";import{t as nc,T as sc,a as rc,S as $e,i as Vo,b as Li}from"./decopilot-sse-pool-Clmp1BFL.js";import{u as ic}from"./use-decopilot-events-CZNjfghP.js";import{a as ii}from"./format-time-BnbuEtat.js";import{i as fr}from"./AlertCircle-BfuYC-ez.js";import{i as mn}from"./CheckCircle-UqA3DPGv.js";import{i as oc}from"./DotsVertical-CHkGthlj.js";import{s as lc}from"./Eye-mJ_2ivh6.js";import{u as Qo,a as ac,b as cc}from"./use-tags-0YzsYO3f.js";import{o as dc,P as rn,a as oi,D as uc,p as fc,q as hc,S as Vt,r as pc,T as Go,F as Nr,s as ps,v as gc,w as mc,x as Xo,N as xc,k as li,y as bc,z as yc,d as Yo,n as kc,A as Yt,B as vc,G as ds,H as wc,I as Zo,R as Jo,m as el,J as tl,K as Sc,L as Cc,Q as jc,e as Tc,u as Nc,f as Dc,j as Rc,C as nl,c as Ec}from"./calendar-DzZPxWQd.js";import{S as Vn}from"./skeleton-AvMrml5O.js";import{u as Ic}from"./use-copy-B64dHmlD.js";import{i as Ds}from"./Check-CfIRDOap.js";import{i as sl}from"./ChevronRight-BXMKC2_M.js";import{a as _c}from"./Copy01-DDRpZJ1h.js";import{n as Ac,i as rl}from"./Tool02-CQZsqe8L.js";import{n as Gs}from"./LinkExternal01-Ba5xXfz2.js";import{b as il,i as ol}from"./XCircle-BlO0Qy51.js";import{s as ll}from"./Trash01-DFj83XXx.js";import{u as Pi,a as Bc}from"./use-organization-settings-B1oXAg8v.js";import{d as ai,a as ci,c as en,b as ns,C as di,e as ui}from"./command-M0ieFwmm.js";import{s as Mr}from"./User01-CDS7qDs6.js";import{i as Oc}from"./ArrowUp-Dkm0nOGw.js";import{i as $c}from"./Tool01-DhSkNcMo.js";import{u as Mc}from"./use-open-billing-url-CAxNtzL4.js";import{f as zc}from"./tab-id-xREOP0to.js";import{u as zr}from"./companions-core-B5XTmC8f.js";import{d as Lc,b as Pc,f as Fc,g as Uc,a as qc,D as Kc}from"./drawer-BZTnQot8.js";import{t as fi}from"./ChevronDown-Dfx8ph9o.js";import{i as al}from"./FilterLines-C_1h3ZoJ.js";import{s as Hc}from"./TrendUp01-DEIKe0v4.js";import{u as Wc}from"./shell-layout-DbBB0LUI.js";import{b as Vc}from"./hooks-_oUacd7x.js";const Qc="[SUBSCRIPTION_REQUIRED]";function Gc(t){return t?.message.startsWith(Qc)?t.message.includes("used its free task executions")?"trial_exhausted":t.message.includes("used its monthly task executions")?"monthly_exhausted":t.message.includes("reached its execution limit")?"runs_exhausted":null:null}function Xc(t){return!t||!t.content||t.content.length===0?!0:t.content.every(e=>e.type==="paragraph"?!e.content||e.content.length===0?!0:e.content.every(n=>n.type==="hardBreak"||n.type==="text"&&(!n.text||n.text.trim()==="")):!1)}const Hm="__home__";function hi(t,e){return Sa.chatDraft(t,e)}function Yc(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object"||typeof e.updatedAt!="number")return null;const n=e.tiptapDoc;return!n||typeof n!="object"||n.type!=="doc"||!Array.isArray(n.content)?null:n}function Zc(t,e,n,r,s){const i=hi(e,n);if(Xc(r)){t.removeItem(i);return}const o={tiptapDoc:r,updatedAt:Date.now()},l=JSON.stringify(o);try{t.setItem(i,l)}catch(a){if(Jc(a)){const d=new TextEncoder().encode(l).byteLength;s?.onQuotaExceeded?.({docSizeBytes:d});return}throw a}}function Wm(t,e,n){const r=hi(e,n),s=t.getItem(r),i=Yc(s);return s!==null&&i===null&&t.removeItem(r),i}function Vm(t,e,n){t.removeItem(hi(e,n))}function Jc(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}var ed=dc;function td(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=t,a=r&&!s,d=hc(n),f=new RegExp(`\\s${d}$`),h=o?"^":"",p=s?"":d,u=a?new RegExp(`${h}${d}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${h}(?:^)?${d}[^\\s${p}]*`,"gm"),m=((e=l.nodeBefore)==null?void 0:e.isText)&&l.nodeBefore.text;if(!m)return null;const y=l.pos-m.length,b=Array.from(m.matchAll(u)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const g=b.input.slice(Math.max(0,b.index-1),b.index),x=new RegExp(`^[${i?.join("")}\0]?$`).test(g);if(i!==null&&!x)return null;const k=y+b.index;let v=k+b[0].length;return a&&f.test(m.slice(v-1,v+1))&&(b[0]+=" ",v+=1),k<l.pos&&v>=l.pos?{range:{from:k,to:v},query:b[0].slice(n.length),text:b[0]}:null}var nd=new rn("suggestion");function sd({pluginKey:t=nd,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:a="suggestion",decorationContent:d="",decorationEmptyClass:f="is-empty",command:h=()=>null,items:p=()=>[],render:u=()=>({}),allow:m=()=>!0,findSuggestionMatch:y=td,shouldShow:b}){let g;const x=u?.(),k=()=>{const C=e.state.selection.$anchor.pos,T=e.view.coordsAtPos(C),{top:D,right:E,bottom:N,left:I}=T;try{return new DOMRect(I,D,E-I,N-D)}catch{return null}},v=(C,T)=>T?()=>{const D=t.getState(e.state),E=D?.decorationId,N=C.dom.querySelector(`[data-decoration-id="${E}"]`);return N?.getBoundingClientRect()||null}:k;function w(C,T){var D;try{const N=t.getState(C.state),I=N?.decorationId?C.dom.querySelector(`[data-decoration-id="${N.decorationId}"]`):null,A={editor:e,range:N?.range||{from:0,to:0},query:N?.query||null,text:N?.text||null,items:[],command:_=>h({editor:e,range:N?.range||{from:0,to:0},props:_}),decorationNode:I,clientRect:v(C,I)};(D=x?.onExit)==null||D.call(x,A)}catch{}const E=C.state.tr.setMeta(T,{exit:!0});C.dispatch(E)}const j=new oi({key:t,view(){return{update:async(C,T)=>{var D,E,N,I,A,_,z;const R=(D=this.key)==null?void 0:D.getState(T),O=(E=this.key)==null?void 0:E.getState(C.state),L=R.active&&O.active&&R.range.from!==O.range.from,B=!R.active&&O.active,F=R.active&&!O.active,$=!B&&!F&&R.query!==O.query,W=B||L&&$,K=$||L,Q=F||L&&$;if(!W&&!K&&!Q)return;const G=Q&&!W?R:O,Y=C.dom.querySelector(`[data-decoration-id="${G.decorationId}"]`);g={editor:e,range:G.range,query:G.query,text:G.text,items:[],command:ee=>h({editor:e,range:G.range,props:ee}),decorationNode:Y,clientRect:v(C,Y)},W&&((N=x?.onBeforeStart)==null||N.call(x,g)),K&&((I=x?.onBeforeUpdate)==null||I.call(x,g)),(K||W)&&(g.items=await p({editor:e,query:G.query})),Q&&((A=x?.onExit)==null||A.call(x,g)),K&&((_=x?.onUpdate)==null||_.call(x,g)),W&&((z=x?.onStart)==null||z.call(x,g))},destroy:()=>{var C;g&&((C=x?.onExit)==null||C.call(x,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,T,D,E){const{isEditable:N}=e,{composing:I}=e.view,{selection:A}=C,{empty:_,from:z}=A,R={...T},O=C.getMeta(t);if(O&&O.exit)return R.active=!1,R.decorationId=null,R.range={from:0,to:0},R.query=null,R.text=null,R;if(R.composing=I,N&&(_||e.view.composing)){(z<T.range.from||z>T.range.to)&&!I&&!T.composing&&(R.active=!1);const L=y({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:A.$from}),B=`id_${Math.floor(Math.random()*4294967295)}`;L&&m({editor:e,state:E,range:L.range,isActive:T.active})&&(!b||b({editor:e,range:L.range,query:L.query,text:L.text,transaction:C}))?(R.active=!0,R.decorationId=T.decorationId?T.decorationId:B,R.range=L.range,R.query=L.query,R.text=L.text):R.active=!1}else R.active=!1;return R.active||(R.decorationId=null,R.range={from:0,to:0},R.query=null,R.text=null),R}},props:{handleKeyDown(C,T){var D,E,N,I;const{active:A,range:_}=j.getState(C.state);if(!A)return!1;if(T.key==="Escape"||T.key==="Esc"){const R=j.getState(C.state),O=(D=g?.decorationNode)!=null?D:null,L=O??(R?.decorationId?C.dom.querySelector(`[data-decoration-id="${R.decorationId}"]`):null);if(((E=x?.onKeyDown)==null?void 0:E.call(x,{view:C,event:T,range:R.range}))||!1)return!0;const F={editor:e,range:R.range,query:R.query,text:R.text,items:[],command:$=>h({editor:e,range:R.range,props:$}),decorationNode:L,clientRect:L?()=>L.getBoundingClientRect()||null:null};return(N=x?.onExit)==null||N.call(x,F),w(C,t),!0}return((I=x?.onKeyDown)==null?void 0:I.call(x,{view:C,event:T,range:_}))||!1},decorations(C){const{active:T,range:D,decorationId:E,query:N}=j.getState(C);if(!T)return null;const I=!N?.length,A=[a];return I&&A.push(f),uc.create(C.doc,[fc.inline(D.from,D.to,{nodeName:l,class:A.join(" "),"data-decoration-id":E,"data-decoration-content":d})])}}});return j}function rd(t){const e=U.c(24),{editor:n,query:r,items:s,onSelect:i,onClose:o}=t,[l,a]=S.useState(0),d=S.useRef(s),f=S.useRef(l),h=S.useRef(i),p=S.useRef(o),u=S.useDeferredValue(r);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{a(0)},e[0]=m):m=e[0];let y;e[1]!==u?(y=[u],e[1]=u,e[2]=y):y=e[2],S.useEffect(m,y);let b,g;e[3]!==s.length||e[4]!==l?(b=()=>{l>=s.length&&s.length>0&&a(0)},g=[s.length,l],e[3]=s.length,e[4]=l,e[5]=b,e[6]=g):(b=e[5],g=e[6]),S.useEffect(b,g);let x,k;e[7]!==s?(x=()=>{d.current=s},k=[s],e[7]=s,e[8]=x,e[9]=k):(x=e[8],k=e[9]),S.useEffect(x,k);let v,w;e[10]!==l?(v=()=>{f.current=l},w=[l],e[10]=l,e[11]=v,e[12]=w):(v=e[11],w=e[12]),S.useEffect(v,w);let j,C;e[13]!==i?(C=()=>{h.current=i},j=[i],e[13]=i,e[14]=j,e[15]=C):(j=e[14],C=e[15]),S.useEffect(C,j);let T,D;e[16]!==o?(T=()=>{p.current=o},D=[o],e[16]=o,e[17]=T,e[18]=D):(T=e[17],D=e[18]),S.useEffect(T,D);let E,N;e[19]!==n?(E=()=>{if(n?.isDestroyed)return;let _;try{_=n.view.dom}catch{return}if(!_)return;const z=O=>{const L=d.current;if(!L.length)return!1;const B=()=>a($=>($+1)%L.length),F=()=>a($=>($-1+L.length)%L.length);switch(O.key){case"ArrowUp":return O.preventDefault(),F(),!0;case"ArrowDown":return O.preventDefault(),B(),!0;case"Tab":return O.preventDefault(),O.shiftKey?F():B(),!0;case"Home":return O.preventDefault(),a(0),!0;case"End":return O.preventDefault(),a(L.length-1),!0;case"Enter":{if(O.isComposing)return!1;O.preventDefault();const $=f.current;return $!==-1&&L[$]&&h.current?.(L[$],$),!0}case"Escape":return O.preventDefault(),p.current?.(),!0;default:return!1}},R=O=>{z(O)};return _.addEventListener("keydown",R,!0),()=>{_?.removeEventListener("keydown",R,!0)}},N=[n],e[19]=n,e[20]=E,e[21]=N):(E=e[20],N=e[21]),S.useEffect(E,N);const I=s.length?l:void 0;let A;return e[22]!==I?(A={selectedIndex:I,setSelectedIndex:a},e[22]=I,e[23]=A):A=e[23],A}function id(t,e){switch(e.type){case"SET_SELECTED_ITEM":return{...t,selectedItem:e.payload};case"ON_START":return{...t,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...t,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return t}}const od=S.createContext(void 0);function ld(){const t=S.useContext(od);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function Qm(t){const e=U.c(16),{editor:n,char:r,pluginKey:s,allow:i,onOpenChange:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=l):l=e[0];const[a,d]=S.useReducer(id,l);let f;e[1]!==o?(f=y=>{o?.(y)},e[1]=o,e[2]=f):f=e[2];const h=S.useEffectEvent(f);let p;e[3]!==r||e[4]!==i||e[5]!==n||e[6]!==h||e[7]!==s?(p=()=>{if(n?.isDestroyed)return;const y=s instanceof rn?s:new rn(s);n.state.plugins.find(x=>x.spec.key===y)&&n.unregisterPlugin(y);const g=sd({pluginKey:y,editor:n,char:r,allow(x){const k=n.state.doc.resolve(x.range.from);for(let v=k.depth;v>0;v--)if(k.node(v).type.name==="image")return!1;return!(i&&!i(x))},command(){},render:()=>({onStart:x=>{d({type:"ON_START",payload:{element:x.decorationNode??null,query:x.query,range:x.range}}),h(!0)},onUpdate:x=>{d({type:"ON_UPDATE",payload:{element:x.decorationNode??null,query:x.query,range:x.range}})},onKeyDown:x=>x.event.key==="Escape"?(d({type:"ON_EXIT"}),!0):!1,onExit:()=>{d({type:"ON_EXIT"}),h(!1)}}),items:ad});return n.registerPlugin(g),()=>{n?.isDestroyed||n.unregisterPlugin(y)}},e[3]=r,e[4]=i,e[5]=n,e[6]=h,e[7]=s,e[8]=p):p=e[8];let u;e[9]!==r||e[10]!==i||e[11]!==n||e[12]!==s?(u=[n,s,r,d,i],e[9]=r,e[10]=i,e[11]=n,e[12]=s,e[13]=u):u=e[13],S.useEffect(p,u);let m;return e[14]!==a?(m={state:a,dispatch:d},e[14]=a,e[15]=m):m=e[15],m}function ad(){return[]}function Gm({editor:t,queryKey:e,queryFn:n,onSelect:r}){const{state:s,dispatch:i}=ld(),o=S.useDeferredValue(s.query),{data:l}=Ca({queryKey:xe.suggestionItems(e,s.open,o),queryFn:()=>s.open?n({query:o}):[]}),a=()=>{i({type:"ON_EXIT"})},d=async(h,p)=>{if(!(s.selectedItem!==null||!s.range)){i({type:"SET_SELECTED_ITEM",payload:h});try{const{view:u}=t,y=u.state.selection.$to.nodeAfter?.text?.startsWith(" "),b=s.range?{...s.range}:{from:0,to:0};y&&s.range&&(b.to+=1),await r({range:b,item:h})===!1?i({type:"SET_SELECTED_ITEM",payload:null}):a()}catch{a()}}},{selectedIndex:f}=rd({editor:t,query:o,items:l,onSelect:d,onClose:a});return{selectedItem:s.selectedItem,items:l,selectedIndex:f,close:a,onSelect:d}}function Xm(t){return t.contentHash??`${t.size}-${t.updatedAt}`}function jt(t,e,n,r){const s=new URLSearchParams(r).toString();return`/api/${encodeURIComponent(t)}/fs/${encodeURIComponent(e)}/${n}${s?`?${s}`:""}`}async function Je(t,e,n){const r=await fetch(t,e);if(r.ok||n?.allow404&&r.status===404)return r;let s="";try{s=(await r.json()).error??""}catch{}throw new Error(s||`HTTP ${r.status}`)}function Ym(t,e){const n=U.c(15),{org:r}=Me();let s;n[0]!==r.id||n[1]!==e||n[2]!==t?(s=xe.orgFsList(r.id,t,e),n[0]=r.id,n[1]=e,n[2]=t,n[3]=s):s=n[3];let i;n[4]!==r.id||n[5]!==t?(i=(a,d)=>d?.queryKey[1]===r.id&&d.queryKey[2]===t?a:void 0,n[4]=r.id,n[5]=t,n[6]=i):i=n[6];let o;n[7]!==r.slug||n[8]!==e||n[9]!==t?(o=async()=>(await(await Je(jt(r.slug,t,"list",{path:e}))).json()).entries.toSorted(cd),n[7]=r.slug,n[8]=e,n[9]=t,n[10]=o):o=n[10];let l;return n[11]!==s||n[12]!==i||n[13]!==o?(l={queryKey:s,placeholderData:i,queryFn:o},n[11]=s,n[12]=i,n[13]=o,n[14]=l):l=n[14],Ze(l)}function cd(t,e){return t.kind!==e.kind?t.kind==="dir"?-1:1:t.path.localeCompare(e.path)}function Zm(t,e,n){const r=U.c(15),{org:s}=Me();let i;r[0]!==s.id||r[1]!==e||r[2]!==t?(i=xe.orgFsStat(s.id,t??"",e),r[0]=s.id,r[1]=e,r[2]=t,r[3]=i):i=r[3];const o=t!==null;let l;r[4]!==n?(l=n?.refetchIntervalWhenAbsent?f=>f.state.data?!1:n.refetchIntervalWhenAbsent??!1:void 0,r[4]=n,r[5]=l):l=r[5];let a;r[6]!==s.slug||r[7]!==e||r[8]!==t?(a=async()=>{const f=await Je(jt(s.slug,t??"","stat",{path:e}),void 0,{allow404:!0});return f.status===404?null:(await f.json()).entry},r[6]=s.slug,r[7]=e,r[8]=t,r[9]=a):a=r[9];let d;return r[10]!==i||r[11]!==o||r[12]!==l||r[13]!==a?(d={queryKey:i,enabled:o,refetchInterval:l,queryFn:a},r[10]=i,r[11]=o,r[12]=l,r[13]=a,r[14]=d):d=r[14],Ze(d)}function Jm(t){const e=U.c(9),{org:n}=Me();let r;e[0]!==n.id||e[1]!==t?(r=xe.orgFsUsage(n.id,t),e[0]=n.id,e[1]=t,e[2]=r):r=e[2];let s;e[3]!==n.slug||e[4]!==t?(s=async()=>await(await Je(jt(n.slug,t,"usage"))).json(),e[3]=n.slug,e[4]=t,e[5]=s):s=e[5];let i;return e[6]!==r||e[7]!==s?(i={queryKey:r,queryFn:s},e[6]=r,e[7]=s,e[8]=i):i=e[8],Ze(i)}function e1(t,e){const n=U.c(9),r=t===void 0?60:t,{org:s}=Me();let i;n[0]!==s.id?(i=xe.orgFsRecent(s.id),n[0]=s.id,n[1]=i):i=n[1];const o=e?.enabled;let l;n[2]!==r||n[3]!==s.slug?(l=async()=>(await(await Je(`/api/${encodeURIComponent(s.slug)}/fs/recent?limit=${r}`)).json()).entries,n[2]=r,n[3]=s.slug,n[4]=l):l=n[4];let a;return n[5]!==i||n[6]!==o||n[7]!==l?(a={queryKey:i,enabled:o,queryFn:l},n[5]=i,n[6]=o,n[7]=l,n[8]=a):a=n[8],Ze(a)}const dd=50;function t1(t,e){const n=U.c(16),{org:r}=Me();let s;n[0]!==r.id||n[1]!==t||n[2]!==e?.prefix||n[3]!==e?.volume?(s=xe.orgFsSearch(r.id,t,e?.volume??"",e?.prefix??""),n[0]=r.id,n[1]=t,n[2]=e?.prefix,n[3]=e?.volume,n[4]=s):s=n[4];const i=t.length>0;let o;n[5]!==r.id?(o=(d,f)=>f?.queryKey[1]===r.id?d:void 0,n[5]=r.id,n[6]=o):o=n[6];let l;n[7]!==r.slug||n[8]!==t||n[9]!==e?(l=async()=>{const d=new URLSearchParams({q:t,limit:String(dd)});return e&&(d.set("volume",e.volume),e.prefix&&d.set("prefix",e.prefix)),(await(await Je(`/api/${encodeURIComponent(r.slug)}/fs/search?${d}`)).json()).entries},n[7]=r.slug,n[8]=t,n[9]=e,n[10]=l):l=n[10];let a;return n[11]!==s||n[12]!==i||n[13]!==o||n[14]!==l?(a={queryKey:s,enabled:i,placeholderData:o,queryFn:l},n[11]=s,n[12]=i,n[13]=o,n[14]=l,n[15]=a):a=n[15],Ze(a)}function n1(t){const e=U.c(8),{org:n}=Me();let r;e[0]!==n.id?(r=xe.orgFsSkills(n.id),e[0]=n.id,e[1]=r):r=e[1];const s=t?.enabled;let i;e[2]!==n.slug?(i=async()=>{const l=await Je(`/api/${encodeURIComponent(n.slug)}/fs/skills`),{skills:a}=await l.json();return a.map(ud)},e[2]=n.slug,e[3]=i):i=e[3];let o;return e[4]!==r||e[5]!==s||e[6]!==i?(o={queryKey:r,enabled:s,queryFn:i},e[4]=r,e[5]=s,e[6]=i,e[7]=o):o=e[7],Ze(o)}function ud(t){return{volume:t.volume,path:t.path}}async function s1(t){const e=await Je(`/api/${encodeURIComponent(t)}/fs/skills`),{skills:n}=await e.json();return n}async function fd(t,e,n){return(await Je(jt(t,e,"read",{path:n}))).text()}function r1(t,e){const n=U.c(8);let r;n[0]!==t?(r=xe.fileText(t),n[0]=t,n[1]=r):r=n[1];const s=e?.enabled!==!1&&t!=="";let i;n[2]!==t?(i=async()=>{const l=await fetch(t,{credentials:"include"});return l.ok?await l.text():null},n[2]=t,n[3]=i):i=n[3];let o;return n[4]!==r||n[5]!==s||n[6]!==i?(o={queryKey:r,enabled:s,staleTime:6e4,retry:!1,queryFn:i},n[4]=r,n[5]=s,n[6]=i,n[7]=o):o=n[7],Ze(o)}const hd=new Set(["md","mdx","markdown","txt","text"]),pd=25,gd=64*1024,md=256*1024,xd=4;function bd(t){const e=t.lastIndexOf(".");return e===-1?!1:hd.has(t.slice(e+1).toLowerCase())}async function i1(t,e,n){const r=n?`${n}/`:"",s=h=>h.startsWith(r)?h.slice(r.length):h,i=[],o=[],l=[{path:n,depth:0}];for(;l.length>0;){const h=l.shift();if(!h)break;let p;try{p=(await(await Je(jt(t,e,"list",{path:h.path}))).json()).entries}catch{continue}for(const u of[...p].sort((m,y)=>m.path.localeCompare(y.path))){if(u.kind==="dir"){h.depth<xd&&l.push({path:u.path,depth:h.depth+1});continue}bd(u.path)&&u.size<=gd&&i.length<pd?i.push(u.path):o.push(s(u.path))}}const a=await Promise.all(i.map(h=>fd(t,e,h).catch(()=>null))),d=[];let f=0;return i.forEach((h,p)=>{const u=a[p];if(u==null||f+u.length>md){o.push(s(h));return}f+=u.length,d.push({relPath:s(h),content:u})}),d.sort((h,p)=>h.relPath==="SKILL.md"?-1:p.relPath==="SKILL.md"?1:h.relPath.localeCompare(p.relPath)),o.sort(),{files:d,omittedPaths:o}}function o1(){const t=U.c(7),{org:e}=Me();let n;t[0]!==e.id?(n=xe.orgFsPublicSets(e.id),t[0]=e.id,t[1]=n):n=t[1];let r;t[2]!==e.slug?(r=async()=>(await(await Je(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,t[2]=e.slug,t[3]=r):r=t[3];let s;return t[4]!==n||t[5]!==r?(s={queryKey:n,staleTime:3e5,queryFn:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],Ze(s)}function yd(t){const e=U.c(3),{org:n}=Me();let r;return e[0]!==n.slug||e[1]!==t?(r=s=>jt(n.slug,t,"read",{path:s}),e[0]=n.slug,e[1]=t,e[2]=r):r=e[2],r}function l1(){const t=U.c(2),{org:e}=Me();let n;return t[0]!==e.slug?(n=(r,s)=>jt(e.slug,r,"read",{path:s}),t[0]=e.slug,t[1]=n):n=t[1],n}function a1(t){const e=U.c(3),{org:n}=Me();let r;return e[0]!==n||e[1]!==t?(r={mutationFn:async s=>(await(await Je(jt(n.slug,t,"file",{path:s.path}),{method:"PUT",headers:{"content-type":s.contentType??"text/html; charset=utf-8"},body:s.body})).json()).entry},e[0]=n,e[1]=t,e[2]=r):r=e[2],Ye(r)}function c1(t){const e=U.c(18),{org:n}=Me(),r=pn();let s;e[0]!==n||e[1]!==t?(s=async d=>(await(await Je(jt(n.slug,t,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.password})})).json()).entry,e[0]=n,e[1]=t,e[2]=s):s=e[2];let i;e[3]!==n||e[4]!==r||e[5]!==t?(i=async d=>{const f=xe.orgFsStat(n.id,t,d.path);await r.cancelQueries({queryKey:f});const h=r.getQueryData(f),p=d.mode!=="private";return r.setQueryData(f,u=>u&&{...u,readPublic:p,effectivePublic:p,shareMode:d.mode}),{key:f,previous:h}},e[3]=n,e[4]=r,e[5]=t,e[6]=i):i=e[6];let o;e[7]!==r?(o=(d,f,h)=>{h&&r.setQueryData(h.key,h.previous)},e[7]=r,e[8]=o):o=e[8];let l;e[9]!==n||e[10]!==r||e[11]!==t?(l=(d,f,h)=>{r.invalidateQueries({queryKey:xe.orgFsStat(n.id,t,h.path)}),r.invalidateQueries({queryKey:xe.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:xe.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:xe.orgFsSearchRoot(n.id)})},e[9]=n,e[10]=r,e[11]=t,e[12]=l):l=e[12];let a;return e[13]!==s||e[14]!==i||e[15]!==o||e[16]!==l?(a={mutationFn:s,onMutate:i,onError:o,onSettled:l},e[13]=s,e[14]=i,e[15]=o,e[16]=l,e[17]=a):a=e[17],Ye(a)}function kd(t){const e=U.c(33),{org:n}=Me(),r=pn();let s;e[0]!==n||e[1]!==r||e[2]!==t?(s=()=>{r.invalidateQueries({queryKey:xe.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:xe.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:xe.orgFsSearchRoot(n.id)})},e[0]=n,e[1]=r,e[2]=t,e[3]=s):s=e[3];const i=s;let o;e[4]!==n||e[5]!==t?(o=async k=>{const w=(await Promise.allSettled(k.files.map(j=>{const C=k.dir?`${k.dir}/${j.name}`:j.name;return Je(jt(n.slug,t,"file",{path:C}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find(vd);if(w)throw w.reason},e[4]=n,e[5]=t,e[6]=o):o=e[6];let l;e[7]!==i||e[8]!==o?(l={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=l):l=e[9];const a=Ye(l);let d;e[10]!==n||e[11]!==t?(d=async k=>{await Je(jt(n.slug,t,"dir",{path:k}),{method:"POST"})},e[10]=n,e[11]=t,e[12]=d):d=e[12];let f;e[13]!==i||e[14]!==d?(f={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=f):f=e[15];const h=Ye(f);let p;e[16]!==n||e[17]!==t?(p=async k=>{await Je(jt(n.slug,t,"file",{path:k}),{method:"DELETE"})},e[16]=n,e[17]=t,e[18]=p):p=e[18];let u;e[19]!==i||e[20]!==p?(u={mutationFn:p,onSuccess:i},e[19]=i,e[20]=p,e[21]=u):u=e[21];const m=Ye(u);let y;e[22]!==n||e[23]!==t?(y=async k=>{await Je(jt(n.slug,t,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(k)})},e[22]=n,e[23]=t,e[24]=y):y=e[24];let b;e[25]!==i||e[26]!==y?(b={mutationFn:y,onSuccess:i},e[25]=i,e[26]=y,e[27]=b):b=e[27];const g=Ye(b);let x;return e[28]!==h||e[29]!==g||e[30]!==m||e[31]!==a?(x={upload:a,mkdir:h,remove:m,move:g},e[28]=h,e[29]=g,e[30]=m,e[31]=a,e[32]=x):x=e[32],x}function vd(t){return t.status==="rejected"}function wd(t){return t?t.run_in_progress?"generating":t.scanned_at?"ready":"none":"none"}const Sd=2e4;function Cd(t){if(typeof t!="string"||!t)return null;try{return new URL(t).hostname||null}catch{return null}}function jd(){const t=U.c(17),{org:e}=Me(),n=Ua.COMMERCE_DISCOVERY(e.id);let r;t[0]!==e.id||t[1]!==e.slug?(r=zi({connectionId:Ko,orgId:e.id,orgSlug:e.slug}),t[0]=e.id,t[1]=e.slug,t[2]=r):r=t[2];const{data:s}=Ze(r),o=Ze({queryKey:xe.commerceDiscoveryConnection(e.id,n),enabled:!!s,retry:!1,staleTime:6e4,queryFn:async()=>{if(!s)throw new Error("selfClient not ready");const k=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}});return zr(k)}}).data?.item??null,{data:l}=Ze({...zi({connectionId:n,orgId:e.id,orgSlug:e.slug}),enabled:!!o}),a=xe.commerceDiscoveryDiagnostic(e.id,n),d=!!l;let f;t[3]!==l?(f=async()=>{if(!l)throw new Error("cdClient not ready");const k=await l.callTool({name:Ho,arguments:{}});return zr(k).diagnostic??null},t[3]=l,t[4]=f):f=t[4];let h;t[5]!==a||t[6]!==d||t[7]!==f?(h={queryKey:a,enabled:d,retry:1,refetchInterval:Td,queryFn:f},t[5]=a,t[6]=d,t[7]=f,t[8]=h):h=t[8];const p=Ze(h),u=p.data??null,m=p.isSuccess,y=o?.metadata?.siteUrl;let b;t[9]!==y?(b=Cd(y),t[9]=y,t[10]=b):b=t[10];const g=l??null;let x;return t[11]!==n||t[12]!==p.isSuccess||t[13]!==u||t[14]!==b||t[15]!==g?(x={diagnostic:u,isSuccess:m,host:b,connectionId:n,cdClient:g},t[11]=n,t[12]=p.isSuccess,t[13]=u,t[14]=b,t[15]=g,t[16]=x):x=t[16],x}function Td(t){return t.state.status!=="error"&&wd(t.state.data)==="generating"?Sd:!1}function Nd(t,e){return{to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:qa(t.id),main:zc(e,Ho)}}}function Dd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return S.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const hr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ss(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function pi(t){return"nodeType"in t}function it(t){var e,n;return t?ss(t)?t:pi(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function gi(t){const{Document:e}=it(t);return t instanceof e}function Rs(t){return ss(t)?!1:t instanceof it(t).HTMLElement}function cl(t){return t instanceof it(t).SVGElement}function rs(t){return t?ss(t)?t.document:pi(t)?gi(t)?t:Rs(t)||cl(t)?t.ownerDocument:document:document:document}const Ft=hr?S.useLayoutEffect:S.useEffect;function pr(t){const e=S.useRef(t);return Ft(()=>{e.current=t}),S.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function Rd(){const t=S.useRef(null),e=S.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=S.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Ss(t,e){e===void 0&&(e=[t]);const n=S.useRef(t);return Ft(()=>{n.current!==t&&(n.current=t)},e),n}function Es(t,e){const n=S.useRef();return S.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Zs(t){const e=pr(t),n=S.useRef(null),r=S.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function Js(t){const e=S.useRef();return S.useEffect(()=>{e.current=t},[t]),e.current}let Dr={};function Is(t,e){return S.useMemo(()=>{if(e)return e;const n=Dr[t]==null?0:Dr[t]+1;return Dr[t]=n,t+"-"+n},[t,e])}function dl(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,o)=>{const l=Object.entries(o);for(const[a,d]of l){const f=i[a];f!=null&&(i[a]=f+t*d)}return i},{...e})}}const Zn=dl(1),Cs=dl(-1);function Ed(t){return"clientX"in t&&"clientY"in t}function gr(t){if(!t)return!1;const{KeyboardEvent:e}=it(t.target);return e&&t instanceof e}function Id(t){if(!t)return!1;const{TouchEvent:e}=it(t.target);return e&&t instanceof e}function er(t){if(Id(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return Ed(t)?{x:t.clientX,y:t.clientY}:null}const on=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[on.Translate.toString(t),on.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),Fi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function _d(t){return t.matches(Fi)?t:t.querySelector(Fi)}const Ad={display:"none"};function Bd(t){let{id:e,value:n}=t;return Te.createElement("div",{id:e,style:Ad},n)}function Od(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Te.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function $d(){const[t,e]=S.useState("");return{announce:S.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const ul=S.createContext(null);function Md(t){const e=S.useContext(ul);S.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function zd(){const[t]=S.useState(()=>new Set),e=S.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[S.useCallback(r=>{let{type:s,event:i}=r;t.forEach(o=>{var l;return(l=o[s])==null?void 0:l.call(o,i)})},[t]),e]}const Ld={draggable:`
|
|
3
|
-
To pick up a draggable item, press the space bar.
|
|
4
|
-
While dragging, use the arrow keys to move the item.
|
|
5
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
6
|
-
`},Pd={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function Fd(t){let{announcements:e=Pd,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Ld}=t;const{announce:i,announcement:o}=$d(),l=Is("DndLiveRegion"),[a,d]=S.useState(!1);if(S.useEffect(()=>{d(!0)},[]),Md(S.useMemo(()=>({onDragStart(h){let{active:p}=h;i(e.onDragStart({active:p}))},onDragMove(h){let{active:p,over:u}=h;e.onDragMove&&i(e.onDragMove({active:p,over:u}))},onDragOver(h){let{active:p,over:u}=h;i(e.onDragOver({active:p,over:u}))},onDragEnd(h){let{active:p,over:u}=h;i(e.onDragEnd({active:p,over:u}))},onDragCancel(h){let{active:p,over:u}=h;i(e.onDragCancel({active:p,over:u}))}}),[i,e])),!a)return null;const f=Te.createElement(Te.Fragment,null,Te.createElement(Bd,{id:r,value:s.draggable}),Te.createElement(Od,{id:l,announcement:o}));return n?sn.createPortal(f,n):f}var He;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(He||(He={}));function tr(){}function Ui(t,e){return S.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Ud(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return S.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Ut=Object.freeze({x:0,y:0});function fl(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function qd(t,e){const n=er(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function hl(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function Kd(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function qi(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function pl(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function Ki(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const d1=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=Ki(e,e.left,e.top),i=[];for(const o of r){const{id:l}=o,a=n.get(l);if(a){const d=fl(Ki(a),s);i.push({id:l,data:{droppableContainer:o,value:d}})}}return i.sort(hl)},gl=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=qi(e),i=[];for(const o of r){const{id:l}=o,a=n.get(l);if(a){const d=qi(a),f=s.reduce((p,u,m)=>p+fl(d[m],u),0),h=Number((f/4).toFixed(4));i.push({id:l,data:{droppableContainer:o,value:h}})}}return i.sort(hl)};function Hd(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),o=s-r,l=i-n;if(r<s&&n<i){const a=e.width*e.height,d=t.width*t.height,f=o*l,h=f/(a+d-f);return Number(h.toFixed(4))}return 0}const Wd=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,l=n.get(o);if(l){const a=Hd(l,e);a>0&&s.push({id:o,data:{droppableContainer:i,value:a}})}}return s.sort(Kd)};function Vd(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function ml(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Ut}function Qd(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((o,l)=>({...o,top:o.top+t*l.y,bottom:o.bottom+t*l.y,left:o.left+t*l.x,right:o.right+t*l.x}),{...n})}}const Gd=Qd(1);function xl(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function Xd(t,e,n){const r=xl(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:l}=r,a=t.left-o-(1-s)*parseFloat(n),d=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=s?t.width/s:t.width,h=i?t.height/i:t.height;return{width:f,height:h,top:d,right:a+f,bottom:d+h,left:a}}const Yd={ignoreTransform:!1};function is(t,e){e===void 0&&(e=Yd);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:f}=it(t).getComputedStyle(t);d&&(n=Xd(n,d,f))}const{top:r,left:s,width:i,height:o,bottom:l,right:a}=n;return{top:r,left:s,width:i,height:o,bottom:l,right:a}}function Hi(t){return is(t,{ignoreTransform:!0})}function Zd(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function Jd(t,e){return e===void 0&&(e=it(t).getComputedStyle(t)),e.position==="fixed"}function eu(t,e){e===void 0&&(e=it(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function mr(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(gi(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Rs(s)||cl(s)||n.includes(s))return n;const i=it(t).getComputedStyle(s);return s!==t&&eu(s,i)&&n.push(s),Jd(s,i)?n:r(s.parentNode)}return t?r(t):n}function bl(t){const[e]=mr(t,1);return e??null}function Rr(t){return!hr||!t?null:ss(t)?t:pi(t)?gi(t)||t===rs(t).scrollingElement?window:Rs(t)?t:null:null}function yl(t){return ss(t)?t.scrollX:t.scrollLeft}function kl(t){return ss(t)?t.scrollY:t.scrollTop}function Lr(t){return{x:yl(t),y:kl(t)}}var Ve;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Ve||(Ve={}));function vl(t){return!hr||!t?!1:t===document.scrollingElement}function wl(t){const e={x:0,y:0},n=vl(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,o=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:l,maxScroll:r,minScroll:e}}const tu={x:.2,y:.2};function nu(t,e,n,r,s){let{top:i,left:o,right:l,bottom:a}=n;r===void 0&&(r=10),s===void 0&&(s=tu);const{isTop:d,isBottom:f,isLeft:h,isRight:p}=wl(t),u={x:0,y:0},m={x:0,y:0},y={height:e.height*s.y,width:e.width*s.x};return!d&&i<=e.top+y.height?(u.y=Ve.Backward,m.y=r*Math.abs((e.top+y.height-i)/y.height)):!f&&a>=e.bottom-y.height&&(u.y=Ve.Forward,m.y=r*Math.abs((e.bottom-y.height-a)/y.height)),!p&&l>=e.right-y.width?(u.x=Ve.Forward,m.x=r*Math.abs((e.right-y.width-l)/y.width)):!h&&o<=e.left+y.width&&(u.x=Ve.Backward,m.x=r*Math.abs((e.left+y.width-o)/y.width)),{direction:u,speed:m}}function su(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function Sl(t){return t.reduce((e,n)=>Zn(e,Lr(n)),Ut)}function ru(t){return t.reduce((e,n)=>e+yl(n),0)}function iu(t){return t.reduce((e,n)=>e+kl(n),0)}function Cl(t,e){if(e===void 0&&(e=is),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);bl(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const ou=[["x",["left","right"],ru],["y",["top","bottom"],iu]];class mi{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=mr(n),s=Sl(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,l]of ou)for(const a of o)Object.defineProperty(this,a,{get:()=>{const d=l(r),f=s[i]-d;return this.rect[a]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ys{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function lu(t){const{EventTarget:e}=it(t);return t instanceof e?t:rs(t)}function Er(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var Rt;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Rt||(Rt={}));function Wi(t){t.preventDefault()}function au(t){t.stopPropagation()}var ae;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(ae||(ae={}));const jl={start:[ae.Space,ae.Enter],cancel:[ae.Esc],end:[ae.Space,ae.Enter,ae.Tab]},cu=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case ae.Right:return{...n,x:n.x+25};case ae.Left:return{...n,x:n.x-25};case ae.Down:return{...n,y:n.y+25};case ae.Up:return{...n,y:n.y-25}}};class xi{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new ys(rs(n)),this.windowListeners=new ys(it(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Rt.Resize,this.handleCancel),this.windowListeners.add(Rt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Rt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&Cl(r),n(Ut)}handleKeyDown(e){if(gr(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=jl,coordinateGetter:o=cu,scrollBehavior:l="smooth"}=s,{code:a}=e;if(i.end.includes(a)){this.handleEnd(e);return}if(i.cancel.includes(a)){this.handleCancel(e);return}const{collisionRect:d}=r.current,f=d?{x:d.left,y:d.top}:Ut;this.referenceCoordinates||(this.referenceCoordinates=f);const h=o(e,{active:n,context:r.current,currentCoordinates:f});if(h){const p=Cs(h,f),u={x:0,y:0},{scrollableAncestors:m}=r.current;for(const y of m){const b=e.code,{isTop:g,isRight:x,isLeft:k,isBottom:v,maxScroll:w,minScroll:j}=wl(y),C=su(y),T={x:Math.min(b===ae.Right?C.right-C.width/2:C.right,Math.max(b===ae.Right?C.left:C.left+C.width/2,h.x)),y:Math.min(b===ae.Down?C.bottom-C.height/2:C.bottom,Math.max(b===ae.Down?C.top:C.top+C.height/2,h.y))},D=b===ae.Right&&!x||b===ae.Left&&!k,E=b===ae.Down&&!v||b===ae.Up&&!g;if(D&&T.x!==h.x){const N=y.scrollLeft+p.x,I=b===ae.Right&&N<=w.x||b===ae.Left&&N>=j.x;if(I&&!p.y){y.scrollTo({left:N,behavior:l});return}I?u.x=y.scrollLeft-N:u.x=b===ae.Right?y.scrollLeft-w.x:y.scrollLeft-j.x,u.x&&y.scrollBy({left:-u.x,behavior:l});break}else if(E&&T.y!==h.y){const N=y.scrollTop+p.y,I=b===ae.Down&&N<=w.y||b===ae.Up&&N>=j.y;if(I&&!p.x){y.scrollTo({top:N,behavior:l});return}I?u.y=y.scrollTop-N:u.y=b===ae.Down?y.scrollTop-w.y:y.scrollTop-j.y,u.y&&y.scrollBy({top:-u.y,behavior:l});break}}this.handleMove(e,Zn(Cs(h,this.referenceCoordinates),u))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}xi.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=jl,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function Vi(t){return!!(t&&"distance"in t)}function Qi(t){return!!(t&&"delay"in t)}class bi{constructor(e,n,r){var s;r===void 0&&(r=lu(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=rs(o),this.documentListeners=new ys(this.document),this.listeners=new ys(r),this.windowListeners=new ys(it(o)),this.initialCoordinates=(s=er(i))!=null?s:Ut,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Rt.Resize,this.handleCancel),this.windowListeners.add(Rt.DragStart,Wi),this.windowListeners.add(Rt.VisibilityChange,this.handleCancel),this.windowListeners.add(Rt.ContextMenu,Wi),this.documentListeners.add(Rt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Qi(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Vi(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Rt.Click,au,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Rt.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:l}}=i;if(!s)return;const a=(n=er(e))!=null?n:Ut,d=Cs(s,a);if(!r&&l){if(Vi(l)){if(l.tolerance!=null&&Er(d,l.tolerance))return this.handleCancel();if(Er(d,l.distance))return this.handleStart()}if(Qi(l)&&Er(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}e.cancelable&&e.preventDefault(),o(a)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===ae.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const du={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class yi extends bi{constructor(e){const{event:n}=e,r=rs(n.target);super(e,du,r)}}yi.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const uu={move:{name:"mousemove"},end:{name:"mouseup"}};var Pr;(function(t){t[t.RightClick=2]="RightClick"})(Pr||(Pr={}));class fu extends bi{constructor(e){super(e,uu,rs(e.event.target))}}fu.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===Pr.RightClick?!1:(r?.({event:n}),!0)}}];const Ir={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class hu extends bi{constructor(e){super(e,Ir)}static setup(){return window.addEventListener(Ir.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ir.move.name,e)};function e(){}}}hu.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var ks;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(ks||(ks={}));var nr;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(nr||(nr={}));function pu(t){let{acceleration:e,activator:n=ks.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:l=nr.TreeOrder,pointerCoordinates:a,scrollableAncestors:d,scrollableAncestorRects:f,delta:h,threshold:p}=t;const u=mu({delta:h,disabled:!i}),[m,y]=Rd(),b=S.useRef({x:0,y:0}),g=S.useRef({x:0,y:0}),x=S.useMemo(()=>{switch(n){case ks.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case ks.DraggableRect:return s}},[n,s,a]),k=S.useRef(null),v=S.useCallback(()=>{const j=k.current;if(!j)return;const C=b.current.x*g.current.x,T=b.current.y*g.current.y;j.scrollBy(C,T)},[]),w=S.useMemo(()=>l===nr.TreeOrder?[...d].reverse():d,[l,d]);S.useEffect(()=>{if(!i||!d.length||!x){y();return}for(const j of w){if(r?.(j)===!1)continue;const C=d.indexOf(j),T=f[C];if(!T)continue;const{direction:D,speed:E}=nu(j,T,x,e,p);for(const N of["x","y"])u[N][D[N]]||(E[N]=0,D[N]=0);if(E.x>0||E.y>0){y(),k.current=j,m(v,o),b.current=E,g.current=D;return}}b.current={x:0,y:0},g.current={x:0,y:0},y()},[e,v,r,y,i,o,JSON.stringify(x),JSON.stringify(u),m,d,w,f,JSON.stringify(p)])}const gu={x:{[Ve.Backward]:!1,[Ve.Forward]:!1},y:{[Ve.Backward]:!1,[Ve.Forward]:!1}};function mu(t){let{delta:e,disabled:n}=t;const r=Js(e);return Es(s=>{if(n||!r||!s)return gu;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Ve.Backward]:s.x[Ve.Backward]||i.x===-1,[Ve.Forward]:s.x[Ve.Forward]||i.x===1},y:{[Ve.Backward]:s.y[Ve.Backward]||i.y===-1,[Ve.Forward]:s.y[Ve.Forward]||i.y===1}}},[n,e,r])}function xu(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Es(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function bu(t,e){return S.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,r)}));return[...n,...i]},[]),[t,e])}var js;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(js||(js={}));var Fr;(function(t){t.Optimized="optimized"})(Fr||(Fr={}));const Gi=new Map;function yu(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=S.useState(null),{frequency:l,measure:a,strategy:d}=s,f=S.useRef(t),h=b(),p=Ss(h),u=S.useCallback(function(g){g===void 0&&(g=[]),!p.current&&o(x=>x===null?g:x.concat(g.filter(k=>!x.includes(k))))},[p]),m=S.useRef(null),y=Es(g=>{if(h&&!n)return Gi;if(!g||g===Gi||f.current!==t||i!=null){const x=new Map;for(let k of t){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){x.set(k.id,k.rect.current);continue}const v=k.node.current,w=v?new mi(a(v),v):null;k.rect.current=w,w&&x.set(k.id,w)}return x}return g},[t,i,n,h,a]);return S.useEffect(()=>{f.current=t},[t]),S.useEffect(()=>{h||u()},[n,h]),S.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),S.useEffect(()=>{h||typeof l!="number"||m.current!==null||(m.current=setTimeout(()=>{u(),m.current=null},l))},[l,h,u,...r]),{droppableRects:y,measureDroppableContainers:u,measuringScheduled:i!=null};function b(){switch(d){case js.Always:return!1;case js.BeforeDragging:return n;default:return!n}}}function ki(t,e){return Es(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function ku(t,e){return ki(t,e)}function vu(t){let{callback:e,disabled:n}=t;const r=pr(e),s=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return S.useEffect(()=>()=>s?.disconnect(),[s]),s}function xr(t){let{callback:e,disabled:n}=t;const r=pr(e),s=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return S.useEffect(()=>()=>s?.disconnect(),[s]),s}function wu(t){return new mi(is(t),t)}function Xi(t,e,n){e===void 0&&(e=wu);const[r,s]=S.useState(null);function i(){s(a=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=a??n)!=null?d:null}const f=e(t);return JSON.stringify(a)===JSON.stringify(f)?a:f})}const o=vu({callback(a){if(t)for(const d of a){const{type:f,target:h}=d;if(f==="childList"&&h instanceof HTMLElement&&h.contains(t)){i();break}}}}),l=xr({callback:i});return Ft(()=>{i(),t?(l?.observe(t),o?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),o?.disconnect())},[t]),r}function Su(t){const e=ki(t);return ml(t,e)}const Yi=[];function Cu(t){const e=S.useRef(t),n=Es(r=>t?r&&r!==Yi&&t&&e.current&&t.parentNode===e.current.parentNode?r:mr(t):Yi,[t]);return S.useEffect(()=>{e.current=t},[t]),n}function ju(t){const[e,n]=S.useState(null),r=S.useRef(t),s=S.useCallback(i=>{const o=Rr(i.target);o&&n(l=>l?(l.set(o,Lr(o)),new Map(l)):null)},[]);return S.useEffect(()=>{const i=r.current;if(t!==i){o(i);const l=t.map(a=>{const d=Rr(a);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,Lr(d)]):null}).filter(a=>a!=null);n(l.length?new Map(l):null),r.current=t}return()=>{o(t),o(i)};function o(l){l.forEach(a=>{const d=Rr(a);d?.removeEventListener("scroll",s)})}},[s,t]),S.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>Zn(i,o),Ut):Sl(t):Ut,[t,e])}function Zi(t,e){e===void 0&&(e=[]);const n=S.useRef(null);return S.useEffect(()=>{n.current=null},e),S.useEffect(()=>{const r=t!==Ut;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?Cs(t,n.current):Ut}function Tu(t){S.useEffect(()=>{if(!hr)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function Nu(t,e){return S.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function Tl(t){return S.useMemo(()=>t?Zd(t):null,[t])}const Ji=[];function Du(t,e){e===void 0&&(e=is);const[n]=t,r=Tl(n?it(n):null),[s,i]=S.useState(Ji);function o(){i(()=>t.length?t.map(a=>vl(a)?r:new mi(e(a),a)):Ji)}const l=xr({callback:o});return Ft(()=>{l?.disconnect(),o(),t.forEach(a=>l?.observe(a))},[t]),s}function Nl(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Rs(e)?e:t}function Ru(t){let{measure:e}=t;const[n,r]=S.useState(null),s=S.useCallback(d=>{for(const{target:f}of d)if(Rs(f)){r(h=>{const p=e(f);return h?{...h,width:p.width,height:p.height}:p});break}},[e]),i=xr({callback:s}),o=S.useCallback(d=>{const f=Nl(d);i?.disconnect(),f&&i?.observe(f),r(f?e(f):null)},[e,i]),[l,a]=Zs(o);return S.useMemo(()=>({nodeRef:l,rect:n,setRef:a}),[n,l,a])}const Eu=[{sensor:yi,options:{}},{sensor:xi,options:{}}],Iu={current:{}},Xs={draggable:{measure:Hi},droppable:{measure:Hi,strategy:js.WhileDragging,frequency:Fr.Optimized},dragOverlay:{measure:is}};class vs extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const _u={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new vs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tr},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Xs,measureDroppableContainers:tr,windowRect:null,measuringScheduled:!1},Dl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tr,draggableNodes:new Map,over:null,measureDroppableContainers:tr},_s=S.createContext(Dl),Rl=S.createContext(_u);function Au(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vs}}}function Bu(t,e){switch(e.type){case He.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case He.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case He.DragEnd:case He.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case He.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new vs(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case He.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const o=new vs(t.droppable.containers);return o.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:o}}}case He.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new vs(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Ou(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=S.useContext(_s),i=Js(r),o=Js(n?.id);return S.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!gr(i)||document.activeElement===i.target)return;const l=s.get(o);if(!l)return;const{activatorNode:a,node:d}=l;if(!a.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[a.current,d.current]){if(!f)continue;const h=_d(f);if(h){h.focus();break}}})}},[r,e,s,o,i]),null}function El(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function $u(t){return S.useMemo(()=>({draggable:{...Xs.draggable,...t?.draggable},droppable:{...Xs.droppable,...t?.droppable},dragOverlay:{...Xs.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Mu(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=S.useRef(!1),{x:o,y:l}=typeof s=="boolean"?{x:s,y:s}:s;Ft(()=>{if(!o&&!l||!e){i.current=!1;return}if(i.current||!r)return;const d=e?.node.current;if(!d||d.isConnected===!1)return;const f=n(d),h=ml(f,r);if(o||(h.x=0),l||(h.y=0),i.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const p=bl(d);p&&p.scrollBy({top:h.y,left:h.x})}},[e,o,l,r,n])}const br=S.createContext({...Ut,scaleX:1,scaleY:1});var nn;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(nn||(nn={}));const zu=S.memo(function(e){var n,r,s,i;let{id:o,accessibility:l,autoScroll:a=!0,children:d,sensors:f=Eu,collisionDetection:h=Wd,measuring:p,modifiers:u,...m}=e;const y=S.useReducer(Bu,void 0,Au),[b,g]=y,[x,k]=zd(),[v,w]=S.useState(nn.Uninitialized),j=v===nn.Initialized,{draggable:{active:C,nodes:T,translate:D},droppable:{containers:E}}=b,N=C!=null?T.get(C):null,I=S.useRef({initial:null,translated:null}),A=S.useMemo(()=>{var pe;return C!=null?{id:C,data:(pe=N?.data)!=null?pe:Iu,rect:I}:null},[C,N]),_=S.useRef(null),[z,R]=S.useState(null),[O,L]=S.useState(null),B=Ss(m,Object.values(m)),F=Is("DndDescribedBy",o),$=S.useMemo(()=>E.getEnabled(),[E]),W=$u(p),{droppableRects:K,measureDroppableContainers:Q,measuringScheduled:G}=yu($,{dragging:j,dependencies:[D.x,D.y],config:W.droppable}),Y=xu(T,C),ee=S.useMemo(()=>O?er(O):null,[O]),se=Tt(),re=ku(Y,W.draggable.measure);Mu({activeNode:C!=null?T.get(C):null,config:se.layoutShiftCompensation,initialRect:re,measure:W.draggable.measure});const q=Xi(Y,W.draggable.measure,re),V=Xi(Y?Y.parentElement:null),J=S.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=E.getNodeFor((n=J.current.over)==null?void 0:n.id),te=Ru({measure:W.dragOverlay.measure}),P=(r=te.nodeRef.current)!=null?r:Y,H=j?(s=te.rect)!=null?s:q:null,le=!!(te.nodeRef.current&&te.rect),ge=Su(le?null:q),ke=Tl(P?it(P):null),ye=Cu(j?ie??Y:null),Ne=Du(ye),Be=El(u,{transform:{x:D.x-ge.x,y:D.y-ge.y,scaleX:1,scaleY:1},activatorEvent:O,active:A,activeNodeRect:q,containerNodeRect:V,draggingNodeRect:H,over:J.current.over,overlayNodeRect:te.rect,scrollableAncestors:ye,scrollableAncestorRects:Ne,windowRect:ke}),et=ee?Zn(ee,D):null,dt=ju(ye),Gt=Zi(dt),ot=Zi(dt,[q]),ue=Zn(Be,Gt),Qe=H?Gd(H,Be):null,ze=A&&Qe?h({active:A,collisionRect:Qe,droppableRects:K,droppableContainers:$,pointerCoordinates:et}):null,Xt=pl(ze,"id"),[Le,de]=S.useState(null),De=le?Be:Zn(Be,ot),ut=Vd(De,(i=Le?.rect)!=null?i:null,q),he=S.useRef(null),Bt=S.useCallback((pe,ve)=>{let{sensor:we,options:Fe}=ve;if(_.current==null)return;const Re=T.get(_.current);if(!Re)return;const Se=pe.nativeEvent,Ce=new we({active:_.current,activeNode:Re,event:Se,options:Fe,context:J,onAbort(me){if(!T.get(me))return;const{onDragAbort:Ie}=B.current,_e={id:me};Ie?.(_e),x({type:"onDragAbort",event:_e})},onPending(me,Ee,Ie,_e){if(!T.get(me))return;const{onDragPending:qe}=B.current,Ge={id:me,constraint:Ee,initialCoordinates:Ie,offset:_e};qe?.(Ge),x({type:"onDragPending",event:Ge})},onStart(me){const Ee=_.current;if(Ee==null)return;const Ie=T.get(Ee);if(!Ie)return;const{onDragStart:_e}=B.current,Ue={activatorEvent:Se,active:{id:Ee,data:Ie.data,rect:I}};sn.unstable_batchedUpdates(()=>{_e?.(Ue),w(nn.Initializing),g({type:He.DragStart,initialCoordinates:me,active:Ee}),x({type:"onDragStart",event:Ue}),R(he.current),L(Se)})},onMove(me){g({type:He.DragMove,coordinates:me})},onEnd:Oe(He.DragEnd),onCancel:Oe(He.DragCancel)});he.current=Ce;function Oe(me){return async function(){const{active:Ie,collisions:_e,over:Ue,scrollAdjustedTranslate:qe}=J.current;let Ge=null;if(Ie&&qe){const{cancelDrop:Xe}=B.current;Ge={activatorEvent:Se,active:Ie,collisions:_e,delta:qe,over:Ue},me===He.DragEnd&&typeof Xe=="function"&&await Promise.resolve(Xe(Ge))&&(me=He.DragCancel)}_.current=null,sn.unstable_batchedUpdates(()=>{g({type:me}),w(nn.Uninitialized),de(null),R(null),L(null),he.current=null;const Xe=me===He.DragEnd?"onDragEnd":"onDragCancel";if(Ge){const lt=B.current[Xe];lt?.(Ge),x({type:Xe,event:Ge})}})}}},[T]),tt=S.useCallback((pe,ve)=>(we,Fe)=>{const Re=we.nativeEvent,Se=T.get(Fe);if(_.current!==null||!Se||Re.dndKit||Re.defaultPrevented)return;const Ce={active:Se};pe(we,ve.options,Ce)===!0&&(Re.dndKit={capturedBy:ve.sensor},_.current=Fe,Bt(we,ve))},[T,Bt]),We=bu(f,tt);Tu(f),Ft(()=>{q&&v===nn.Initializing&&w(nn.Initialized)},[q,v]),S.useEffect(()=>{const{onDragMove:pe}=B.current,{active:ve,activatorEvent:we,collisions:Fe,over:Re}=J.current;if(!ve||!we)return;const Se={active:ve,activatorEvent:we,collisions:Fe,delta:{x:ue.x,y:ue.y},over:Re};sn.unstable_batchedUpdates(()=>{pe?.(Se),x({type:"onDragMove",event:Se})})},[ue.x,ue.y]),S.useEffect(()=>{const{active:pe,activatorEvent:ve,collisions:we,droppableContainers:Fe,scrollAdjustedTranslate:Re}=J.current;if(!pe||_.current==null||!ve||!Re)return;const{onDragOver:Se}=B.current,Ce=Fe.get(Xt),Oe=Ce&&Ce.rect.current?{id:Ce.id,rect:Ce.rect.current,data:Ce.data,disabled:Ce.disabled}:null,me={active:pe,activatorEvent:ve,collisions:we,delta:{x:Re.x,y:Re.y},over:Oe};sn.unstable_batchedUpdates(()=>{de(Oe),Se?.(me),x({type:"onDragOver",event:me})})},[Xt]),Ft(()=>{J.current={activatorEvent:O,active:A,activeNode:Y,collisionRect:Qe,collisions:ze,droppableRects:K,draggableNodes:T,draggingNode:P,draggingNodeRect:H,droppableContainers:E,over:Le,scrollableAncestors:ye,scrollAdjustedTranslate:ue},I.current={initial:H,translated:Qe}},[A,Y,ze,Qe,T,P,H,K,E,Le,ye,ue]),pu({...se,delta:D,draggingRect:Qe,pointerCoordinates:et,scrollableAncestors:ye,scrollableAncestorRects:Ne});const nt=S.useMemo(()=>({active:A,activeNode:Y,activeNodeRect:q,activatorEvent:O,collisions:ze,containerNodeRect:V,dragOverlay:te,draggableNodes:T,droppableContainers:E,droppableRects:K,over:Le,measureDroppableContainers:Q,scrollableAncestors:ye,scrollableAncestorRects:Ne,measuringConfiguration:W,measuringScheduled:G,windowRect:ke}),[A,Y,q,O,ze,V,te,T,E,K,Le,Q,ye,Ne,W,G,ke]),st=S.useMemo(()=>({activatorEvent:O,activators:We,active:A,activeNodeRect:q,ariaDescribedById:{draggable:F},dispatch:g,draggableNodes:T,over:Le,measureDroppableContainers:Q}),[O,We,A,q,g,F,T,Le,Q]);return Te.createElement(ul.Provider,{value:k},Te.createElement(_s.Provider,{value:st},Te.createElement(Rl.Provider,{value:nt},Te.createElement(br.Provider,{value:ut},d)),Te.createElement(Ou,{disabled:l?.restoreFocus===!1})),Te.createElement(Fd,{...l,hiddenTextDescribedById:F}));function Tt(){const pe=z?.autoScrollEnabled===!1,ve=typeof a=="object"?a.enabled===!1:a===!1,we=j&&!pe&&!ve;return typeof a=="object"?{...a,enabled:we}:{enabled:we}}}),Lu=S.createContext(null),eo="button",Pu="Draggable";function Fu(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=Is(Pu),{activators:o,activatorEvent:l,active:a,activeNodeRect:d,ariaDescribedById:f,draggableNodes:h,over:p}=S.useContext(_s),{role:u=eo,roleDescription:m="draggable",tabIndex:y=0}=s??{},b=a?.id===e,g=S.useContext(b?br:Lu),[x,k]=Zs(),[v,w]=Zs(),j=Nu(o,e),C=Ss(n);Ft(()=>(h.set(e,{id:e,key:i,node:x,activatorNode:v,data:C}),()=>{const D=h.get(e);D&&D.key===i&&h.delete(e)}),[h,e]);const T=S.useMemo(()=>({role:u,tabIndex:y,"aria-disabled":r,"aria-pressed":b&&u===eo?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,u,y,b,m,f.draggable]);return{active:a,activatorEvent:l,activeNodeRect:d,attributes:T,isDragging:b,listeners:r?void 0:j,node:x,over:p,setNodeRef:k,setActivatorNodeRef:w,transform:g}}function Il(){return S.useContext(Rl)}const Uu="Droppable",qu={timeout:25};function _l(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=Is(Uu),{active:o,dispatch:l,over:a,measureDroppableContainers:d}=S.useContext(_s),f=S.useRef({disabled:n}),h=S.useRef(!1),p=S.useRef(null),u=S.useRef(null),{disabled:m,updateMeasurementsFor:y,timeout:b}={...qu,...s},g=Ss(y??r),x=S.useCallback(()=>{if(!h.current){h.current=!0;return}u.current!=null&&clearTimeout(u.current),u.current=setTimeout(()=>{d(Array.isArray(g.current)?g.current:[g.current]),u.current=null},b)},[b]),k=xr({callback:x,disabled:m||!o}),v=S.useCallback((T,D)=>{k&&(D&&(k.unobserve(D),h.current=!1),T&&k.observe(T))},[k]),[w,j]=Zs(v),C=Ss(e);return S.useEffect(()=>{!k||!w.current||(k.disconnect(),h.current=!1,k.observe(w.current))},[w,k]),S.useEffect(()=>(l({type:He.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:p,data:C}}),()=>l({type:He.UnregisterDroppable,key:i,id:r})),[r]),S.useEffect(()=>{n!==f.current.disabled&&(l({type:He.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,l]),{active:o,rect:p,isOver:a?.id===r,node:w,over:a,setNodeRef:j}}function Ku(t){let{animation:e,children:n}=t;const[r,s]=S.useState(null),[i,o]=S.useState(null),l=Js(n);return!n&&!r&&l&&s(l),Ft(()=>{if(!i)return;const a=r?.key,d=r?.props.id;if(a==null||d==null){s(null);return}Promise.resolve(e(d,i)).then(()=>{s(null)})},[e,r,i]),Te.createElement(Te.Fragment,null,n,r?S.cloneElement(r,{ref:o}):null)}const Hu={x:0,y:0,scaleX:1,scaleY:1};function Wu(t){let{children:e}=t;return Te.createElement(_s.Provider,{value:Dl},Te.createElement(br.Provider,{value:Hu},e))}const Vu={position:"fixed",touchAction:"none"},Qu=t=>gr(t)?"transform 250ms ease":void 0,Gu=S.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:l,style:a,transform:d,transition:f=Qu}=t;if(!l)return null;const h=s?d:{...d,scaleX:1,scaleY:1},p={...Vu,width:l.width,height:l.height,top:l.top,left:l.left,transform:on.Transform.toString(h),transformOrigin:s&&r?qd(r,l):void 0,transition:typeof f=="function"?f(r):f,...a};return Te.createElement(n,{className:o,style:p,ref:e},i)}),Xu=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[l,a]of Object.entries(i.active))a!==void 0&&(s[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,a));if(i!=null&&i.dragOverlay)for(const[l,a]of Object.entries(i.dragOverlay))a!==void 0&&r.node.style.setProperty(l,a);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[a,d]of Object.entries(s))n.node.style.setProperty(a,d);o!=null&&o.active&&n.node.classList.remove(o.active)}},Yu=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:on.Transform.toString(e)},{transform:on.Transform.toString(n)}]},Zu={duration:250,easing:"ease",keyframes:Yu,sideEffects:Xu({styles:{active:{opacity:"0"}}})};function Ju(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return pr((i,o)=>{if(e===null)return;const l=n.get(i);if(!l)return;const a=l.node.current;if(!a)return;const d=Nl(o);if(!d)return;const{transform:f}=it(o).getComputedStyle(o),h=xl(f);if(!h)return;const p=typeof e=="function"?e:ef(e);return Cl(a,s.draggable.measure),p({active:{id:i,data:l.data,node:a,rect:s.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:s,transform:h})})}function ef(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...Zu,...t};return i=>{let{active:o,dragOverlay:l,transform:a,...d}=i;if(!e)return;const f={x:l.rect.left-o.rect.left,y:l.rect.top-o.rect.top},h={scaleX:a.scaleX!==1?o.rect.width*a.scaleX/l.rect.width:1,scaleY:a.scaleY!==1?o.rect.height*a.scaleY/l.rect.height:1},p={x:a.x-f.x,y:a.y-f.y,...h},u=s({...d,active:o,dragOverlay:l,transform:{initial:a,final:p}}),[m]=u,y=u[u.length-1];if(JSON.stringify(m)===JSON.stringify(y))return;const b=r?.({active:o,dragOverlay:l,...d}),g=l.node.animate(u,{duration:e,easing:n,fill:"forwards"});return new Promise(x=>{g.onfinish=()=>{b?.(),x()}})}}let to=0;function tf(t){return S.useMemo(()=>{if(t!=null)return to++,to},[t])}const nf=Te.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:l="div",className:a,zIndex:d=999}=t;const{activatorEvent:f,active:h,activeNodeRect:p,containerNodeRect:u,draggableNodes:m,droppableContainers:y,dragOverlay:b,over:g,measuringConfiguration:x,scrollableAncestors:k,scrollableAncestorRects:v,windowRect:w}=Il(),j=S.useContext(br),C=tf(h?.id),T=El(o,{activatorEvent:f,active:h,activeNodeRect:p,containerNodeRect:u,draggingNodeRect:b.rect,over:g,overlayNodeRect:b.rect,scrollableAncestors:k,scrollableAncestorRects:v,transform:j,windowRect:w}),D=ki(p),E=Ju({config:r,draggableNodes:m,droppableContainers:y,measuringConfiguration:x}),N=D?b.setRef:void 0;return Te.createElement(Wu,null,Te.createElement(Ku,{animation:E},h&&C?Te.createElement(Gu,{key:C,id:h.id,ref:N,as:l,activatorEvent:f,adjustScale:e,className:a,transition:i,rect:D,style:{zIndex:d,...s},transform:T},n):null))});function sf(t){const{org:e}=Me(),{data:n}=Ro.useSession(),r=Ya(),s=pn(),i=Ka({connectionId:Ko,orgId:e.id,orgSlug:e.slug}),[o,l]=S.useState(!1),a=Ga(t,{enabled:!1});return{connect:async()=>{if(!(o||!n?.user?.id||!e)){l(!0);try{const f=a.data??(await a.refetch()).data;if(!f){St.error("Could not find this integration in the registry");return}const h=tc(f,e.id,n.user.id,{remoteIndex:0});if(!h.connection_url){St.error("This integration has no connection method available");return}const p=h.app_name?await rf(i,h.app_name):null,u=!p,m=p?.id??(await r.create.mutateAsync(h)).id,y=await ec({connectionId:m,orgId:e.id,orgSlug:e.slug,persistFallback:b=>r.update.mutateAsync({id:m,data:{connection_token:b}}).then(()=>{})});if(y.ran&&!y.ok){if(u)try{await r.delete.mutateAsync(m)}catch{}St.error(`Authentication failed: ${y.error??"no token"}`);return}ja(s,e.id),St.success(u?"Connected successfully":"Already connected")}catch(f){St.error(`Failed to connect: ${f instanceof Error?f.message:String(f)}`)}finally{l(!1)}}},isConnecting:o}}async function rf(t,e){return(await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_name"],operator:"eq",value:e},limit:1}})).structuredContent?.items?.[0]??null}function vi(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function of(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function Fs(t){return t!==null&&t>=0}function lf(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function af(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Al=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=vi(e,r,n),o=e[s],l=i[s];return!l||!o?null:{x:l.left-o.left,y:l.top-o.top,scaleX:l.width/o.width,scaleY:l.height/o.height}},Us={scaleX:1,scaleY:1},cf=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const l=(e=i[n])!=null?e:r;if(!l)return null;if(s===n){const d=i[o];return d?{x:0,y:n<o?d.top+d.height-(l.top+l.height):d.top-l.top,...Us}:null}const a=df(i,s,n);return s>n&&s<=o?{x:0,y:-l.height-a,...Us}:s<n&&s>=o?{x:0,y:l.height+a,...Us}:{x:0,y:0,...Us}};function df(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return r?n<e?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const Bl="Sortable",Ol=Te.createContext({activeIndex:-1,containerId:Bl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Al,disabled:{draggable:!1,droppable:!1}});function uf(t){let{children:e,id:n,items:r,strategy:s=Al,disabled:i=!1}=t;const{active:o,dragOverlay:l,droppableRects:a,over:d,measureDroppableContainers:f}=Il(),h=Is(Bl,n),p=l.rect!==null,u=S.useMemo(()=>r.map(j=>typeof j=="object"&&"id"in j?j.id:j),[r]),m=o!=null,y=o?u.indexOf(o.id):-1,b=d?u.indexOf(d.id):-1,g=S.useRef(u),x=!lf(u,g.current),k=b!==-1&&y===-1||x,v=af(i);Ft(()=>{x&&m&&f(u)},[x,u,m,f]),S.useEffect(()=>{g.current=u},[u]);const w=S.useMemo(()=>({activeIndex:y,containerId:h,disabled:v,disableTransforms:k,items:u,overIndex:b,useDragOverlay:p,sortedRects:of(u,a),strategy:s}),[y,h,v.draggable,v.droppable,k,u,b,a,p,s]);return Te.createElement(Ol.Provider,{value:w},e)}const ff=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return vi(n,r,s).indexOf(e)},hf=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:l,previousContainerId:a,transition:d}=t;return!d||!r||l!==i&&s===o?!1:n?!0:o!==s&&e===a},pf={duration:200,easing:"ease"},$l="transform",gf=on.Transition.toString({property:$l,duration:0,easing:"linear"}),mf={roleDescription:"sortable"};function xf(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=S.useState(null),l=S.useRef(n);return Ft(()=>{if(!e&&n!==l.current&&r.current){const a=s.current;if(a){const d=is(r.current,{ignoreTransform:!0}),f={x:a.left-d.left,y:a.top-d.top,scaleX:a.width/d.width,scaleY:a.height/d.height};(f.x||f.y)&&o(f)}}n!==l.current&&(l.current=n)},[e,n,r,s]),S.useEffect(()=>{i&&o(null)},[i]),i}function bf(t){let{animateLayoutChanges:e=hf,attributes:n,disabled:r,data:s,getNewIndex:i=ff,id:o,strategy:l,resizeObserverConfig:a,transition:d=pf}=t;const{items:f,containerId:h,activeIndex:p,disabled:u,disableTransforms:m,sortedRects:y,overIndex:b,useDragOverlay:g,strategy:x}=S.useContext(Ol),k=yf(r,u),v=f.indexOf(o),w=S.useMemo(()=>({sortable:{containerId:h,index:v,items:f},...s}),[h,s,v,f]),j=S.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:C,node:T,isOver:D,setNodeRef:E}=_l({id:o,data:w,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...a}}),{active:N,activatorEvent:I,activeNodeRect:A,attributes:_,setNodeRef:z,listeners:R,isDragging:O,over:L,setActivatorNodeRef:B,transform:F}=Fu({id:o,data:w,attributes:{...mf,...n},disabled:k.draggable}),$=Dd(E,z),W=!!N,K=W&&!m&&Fs(p)&&Fs(b),Q=!g&&O,G=Q&&K?F:null,ee=K?G??(l??x)({rects:y,activeNodeRect:A,activeIndex:p,overIndex:b,index:v}):null,se=Fs(p)&&Fs(b)?i({id:o,items:f,activeIndex:p,overIndex:b}):v,re=N?.id,q=S.useRef({activeId:re,items:f,newIndex:se,containerId:h}),V=f!==q.current.items,J=e({active:N,containerId:h,isDragging:O,isSorting:W,id:o,index:v,items:f,newIndex:q.current.newIndex,previousItems:q.current.items,previousContainerId:q.current.containerId,transition:d,wasDragging:q.current.activeId!=null}),ie=xf({disabled:!J,index:v,node:T,rect:C});return S.useEffect(()=>{W&&q.current.newIndex!==se&&(q.current.newIndex=se),h!==q.current.containerId&&(q.current.containerId=h),f!==q.current.items&&(q.current.items=f)},[W,se,h,f]),S.useEffect(()=>{if(re===q.current.activeId)return;if(re!=null&&q.current.activeId==null){q.current.activeId=re;return}const P=setTimeout(()=>{q.current.activeId=re},50);return()=>clearTimeout(P)},[re]),{active:N,activeIndex:p,attributes:_,data:w,rect:C,index:v,newIndex:se,items:f,isOver:D,isSorting:W,isDragging:O,listeners:R,node:T,overIndex:b,over:L,setNodeRef:$,setActivatorNodeRef:B,setDroppableNodeRef:E,setDraggableNodeRef:z,transform:ie??ee,transition:te()};function te(){if(ie||V&&q.current.newIndex===v)return gf;if(!(Q&&!gr(I)||!d)&&(W||J))return on.Transition.toString({...d,property:$l})}}function yf(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function sr(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const kf=[ae.Down,ae.Right,ae.Up,ae.Left],vf=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:l}}=e;if(kf.includes(t.code)){if(t.preventDefault(),!n||!r)return;const a=[];i.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const p=s.get(h.id);if(p)switch(t.code){case ae.Down:r.top<p.top&&a.push(h);break;case ae.Up:r.top>p.top&&a.push(h);break;case ae.Left:r.left>p.left&&a.push(h);break;case ae.Right:r.left<p.left&&a.push(h);break}});const d=gl({collisionRect:r,droppableRects:s,droppableContainers:a});let f=pl(d,"id");if(f===o?.id&&d.length>1&&(f=d[1].id),f!=null){const h=i.get(n.id),p=i.get(f),u=p?s.get(p.id):null,m=p?.node.current;if(m&&u&&h&&p){const b=mr(m).some((j,C)=>l[C]!==j),g=Ml(h,p),x=wf(h,p),k=b||!g?{x:0,y:0}:{x:x?r.width-u.width:0,y:x?r.height-u.height:0},v={x:u.left,y:u.top};return k.x&&k.y?v:Cs(v,k)}}}};function Ml(t,e){return!sr(t)||!sr(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function wf(t,e){return!sr(t)||!sr(e)||!Ml(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}function Pt(t){const e=U.c(8),{size:n,className:r}=t,s=n===void 0?16:n;let i;e[0]!==s?(i={width:s,height:s},e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=Z("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==s||e[5]!==i||e[6]!==o?(l=c.jsx("img",{src:Ha,alt:"Super Agent",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=l):l=e[7],l}const no=()=>0;function Sf(t){const{orgSlug:e,enabled:n=!0,onUpdate:r,onDelete:s}=t,i=S.useRef(r);i.current=r;const o=S.useRef(s);o.current=s;const l=S.useRef(null),a=S.useRef(n),d=S.useRef(e);(!l.current||a.current!==n||d.current!==e)&&(a.current=n,d.current=e,l.current=h=>{if(!n||!e)return()=>{};const p=u=>{let m;try{m=JSON.parse(u.data)}catch{return}m.data&&(u.type===sc?o.current?.(m.data.id):i.current(m.data)),h()};return nc.subscribe(e,p)}),S.useSyncExternalStore(l.current,no,no)}function Cf(){const t=U.c(30),{org:e,locator:n}=Me(),r=gn(),s=pn();let i;t[0]!==n?(i=xe.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const o=i;let l;t[2]!==r?(l=async()=>(await r.call("TASK_BOARD_ITEM_LIST",{})).items,t[2]=r,t[3]=l):l=t[3];let a;t[4]!==o||t[5]!==l?(a={queryKey:o,queryFn:l},t[4]=o,t[5]=l,t[6]=a):a=t[6];const d=Ze(a);let f;t[7]!==n||t[8]!==s||t[9]!==o?(f=g=>{s.setQueryData(o,x=>{const k=x??[];return k.some(v=>v.id===g.id)?k.map(v=>v.id===g.id?g:v):[g,...k]}),s.invalidateQueries({queryKey:xe.taskBoardActivity(n,g.id)})},t[7]=n,t[8]=s,t[9]=o,t[10]=f):f=t[10];let h;t[11]!==s||t[12]!==o?(h=g=>{s.setQueryData(o,x=>x?.filter(k=>k.id!==g))},t[11]=s,t[12]=o,t[13]=h):h=t[13];let p;t[14]!==e.slug||t[15]!==f||t[16]!==h?(p={orgSlug:e.slug,onUpdate:f,onDelete:h},t[14]=e.slug,t[15]=f,t[16]=h,t[17]=p):p=t[17],Sf(p);let u;t[18]!==s||t[19]!==o?(u=g=>{const x=g.subject,k=g.data.status;s.setQueryData(o,v=>v?.map(w=>w.threads.some(j=>j.threadId===x)?{...w,threads:w.threads.map(j=>j.threadId===x?{...j,status:k}:j)}:w))},t[18]=s,t[19]=o,t[20]=u):u=t[20];let m;t[21]!==e.slug||t[22]!==u?(m={orgSlug:e.slug,onTaskStatus:u},t[21]=e.slug,t[22]=u,t[23]=m):m=t[23],ic(m);let y;t[24]!==d.data?(y=d.data??[],t[24]=d.data,t[25]=y):y=t[25];let b;return t[26]!==d.error||t[27]!==d.isLoading||t[28]!==y?(b={items:y,isLoading:d.isLoading,error:d.error},t[26]=d.error,t[27]=d.isLoading,t[28]=y,t[29]=b):b=t[29],b}function jf(){const t=U.c(65),{locator:e}=Me(),n=gn(),r=pn(),s=oe();let i;t[0]!==e?(i=xe.taskBoardItems(e),t[0]=e,t[1]=i):i=t[1];const o=i;let l;t[2]!==r||t[3]!==o?(l=()=>r.invalidateQueries({queryKey:o}),t[2]=r,t[3]=o,t[4]=l):l=t[4];const a=l;let d;t[5]!==n?(d=B=>n.call("TASK_BOARD_ITEM_CREATE",B),t[5]=n,t[6]=d):d=t[6];let f;t[7]!==a||t[8]!==d?(f={mutationFn:d,onSuccess:a},t[7]=a,t[8]=d,t[9]=f):f=t[9];const h=Ye(f);let p;t[10]!==n?(p=B=>n.call("TASK_BOARD_ITEM_UPDATE",B),t[10]=n,t[11]=p):p=t[11];let u,m;t[12]!==r||t[13]!==o?(u=async B=>{await r.cancelQueries({queryKey:o});const F=r.getQueryData(o);return r.setQueryData(o,$=>$?.map(W=>W.id===B.id?{...W,...B}:W)),{previous:F}},m=(B,F,$)=>{$?.previous&&r.setQueryData(o,$.previous)},t[12]=r,t[13]=o,t[14]=u,t[15]=m):(u=t[14],m=t[15]);let y;t[16]!==a||t[17]!==e||t[18]!==r?(y=(B,F,$)=>{a(),r.invalidateQueries({queryKey:xe.taskBoardActivity(e,$.id)})},t[16]=a,t[17]=e,t[18]=r,t[19]=y):y=t[19];let b;t[20]!==p||t[21]!==u||t[22]!==m||t[23]!==y?(b={mutationFn:p,onMutate:u,onError:m,onSettled:y},t[20]=p,t[21]=u,t[22]=m,t[23]=y,t[24]=b):b=t[24];const g=Ye(b);let x;t[25]!==n?(x=B=>n.call("TASK_BOARD_ITEM_DELETE",{id:B}),t[25]=n,t[26]=x):x=t[26];let k;t[27]!==a||t[28]!==s?(k=B=>{St.error(B instanceof Error&&B.message?B.message:s("taskBoard.taskBoard.deleteError")),a()},t[27]=a,t[28]=s,t[29]=k):k=t[29];let v;t[30]!==a||t[31]!==k||t[32]!==x?(v={mutationFn:x,onSuccess:a,onError:k},t[30]=a,t[31]=k,t[32]=x,t[33]=v):v=t[33];const w=Ye(v);let j;t[34]!==n?(j=async B=>{const F=await Promise.allSettled(B.map($=>n.call("TASK_BOARD_ITEM_DELETE",{id:$})));return{total:B.length,failed:F.filter(Tf).length}},t[34]=n,t[35]=j):j=t[35];let C,T;t[36]!==s?(C=B=>{const{total:F,failed:$}=B;$!==0&&St.error(s("taskBoard.taskBoard.deleteBulkError",{failed:String($),total:String(F)}))},T=()=>St.error(s("taskBoard.taskBoard.deleteError")),t[36]=s,t[37]=C,t[38]=T):(C=t[37],T=t[38]);let D;t[39]!==a||t[40]!==j||t[41]!==C||t[42]!==T?(D={mutationFn:j,onSuccess:C,onError:T,onSettled:a},t[39]=a,t[40]=j,t[41]=C,t[42]=T,t[43]=D):D=t[43];const E=Ye(D);let N;t[44]!==n?(N=B=>n.call("TASK_BOARD_ITEM_UPDATE",B),t[44]=n,t[45]=N):N=t[45];let I;t[46]!==a||t[47]!==N?(I={mutationFn:N,onSuccess:a},t[46]=a,t[47]=N,t[48]=I):I=t[48];const A=Ye(I);let _;t[49]!==n?(_=B=>n.call("TASK_BOARD_ITEM_RERUN",B),t[49]=n,t[50]=_):_=t[50];let z;t[51]!==a||t[52]!==e||t[53]!==r?(z=(B,F,$)=>{a(),r.invalidateQueries({queryKey:xe.taskBoardActivity(e,$.id)})},t[51]=a,t[52]=e,t[53]=r,t[54]=z):z=t[54];let R;t[55]!==_||t[56]!==z?(R={mutationFn:_,onSettled:z},t[55]=_,t[56]=z,t[57]=R):R=t[57];const O=Ye(R);let L;return t[58]!==h||t[59]!==A||t[60]!==w||t[61]!==E||t[62]!==O||t[63]!==g?(L={create:h,update:g,remove:w,removeMany:E,link:A,rerun:O},t[58]=h,t[59]=A,t[60]=w,t[61]=E,t[62]=O,t[63]=g,t[64]=L):L=t[64],L}function Tf(t){return t.status==="rejected"}function rr(t){return t.threads.some(e=>e.status==="requires_action")}function wi(t){return t.status==="in_progress"&&rr(t)?"text-warning animate-pulse":Et[t.status].iconClassName}function Nf(t){return t.threads[0]}function so(t,e,n){const r=t.findIndex(f=>f.id===n),s=e===n?t[r+1]?.id??null:e,i=t.filter(f=>f.id!==n),o=s?i.findIndex(f=>f.id===s):-1,l=o===-1?i.length:o,a=i[l-1],d=i[l];return a&&d?(a.sortOrder+d.sortOrder)/2:a?a.sortOrder+1:d?d.sortOrder-1:0}function zl(t,e){return Array.from({length:e},(n,r)=>t-(e-1-r)*1e-4)}const ir=["triage","todo","in_progress","in_review","done"],Et={triage:{labelKey:"taskBoard.config.statusBacklog",icon:fr,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:oc,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:Ns,iconClassName:"text-primary animate-spin"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:lc,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:mn,iconClassName:"text-success"}},Si=["none","low","medium","high","urgent"],It={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive"}},Ur=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],Ll=Ur[0];function As(t){return t??Ll}function Df(t){return Ur[t%Ur.length]??Ll}function Pl(t){const e=U.c(11),{size:n,className:r}=t,s=n===void 0?16:n,i=oe();let o;e[0]!==i?(o=i("taskBoard.taskDialog.qaAgentLabel"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==s?(l={width:s,height:s},e[2]=s,e[3]=l):l=e[3];let a;e[4]!==r?(a=Z("shrink-0 rounded-full object-cover",r),e[4]=r,e[5]=a):a=e[5];let d;return e[6]!==s||e[7]!==o||e[8]!==l||e[9]!==a?(d=c.jsx("img",{src:Wa,alt:o,width:s,height:s,style:l,className:a}),e[6]=s,e[7]=o,e[8]=l,e[9]=a,e[10]=d):d=e[10],d}function Fl(t){const e=U.c(8),{size:n,className:r}=t,s=n===void 0?16:n;let i;e[0]!==s?(i={width:s,height:s},e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=Z("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==s||e[5]!==i||e[6]!==o?(l=c.jsx("img",{src:Va,alt:"Code Reviewer",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=l):l=e[7],l}let qr,Kr;if(typeof WeakMap<"u"){let t=new WeakMap;qr=e=>t.get(e),Kr=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;qr=r=>{for(let s=0;s<t.length;s+=2)if(t[s]==r)return t[s+1]},Kr=(r,s)=>(n==10&&(n=0),t[n++]=r,t[n++]=s)}var Jt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,s=e/this.width|0;let i=r+1,o=s+1;for(let l=1;i<this.width&&this.map[e+l]==n;l++)i++;for(let l=1;o<this.height&&this.map[e+this.width*l]==n;l++)o++;return{left:r,top:s,right:i,bottom:o}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:s,top:i,bottom:o}=this.findCell(t);return e=="horiz"?(n<0?r==0:s==this.width)?null:this.map[i*this.width+(n<0?r-1:s)]:(n<0?i==0:o==this.height)?null:this.map[r+this.width*(n<0?i-1:o)]}rectBetween(t,e){const{left:n,right:r,top:s,bottom:i}=this.findCell(t),{left:o,right:l,top:a,bottom:d}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(s,a),right:Math.max(r,l),bottom:Math.max(i,d)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let s=t.left;s<t.right;s++){const i=r*this.width+s,o=this.map[i];n[o]||(n[o]=!0,!(s==t.left&&s&&this.map[i-1]==o||r==t.top&&r&&this.map[i-this.width]==o)&&e.push(o))}return e}positionAt(t,e,n){for(let r=0,s=0;;r++){const i=s+n.child(r).nodeSize;if(r==t){let o=e+t*this.width;const l=(t+1)*this.width;for(;o<l&&this.map[o]<s;)o++;return o==l?i-1:this.map[o]}s=i}}static get(t){return qr(t)||Kr(t,Rf(t))}};function Rf(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Ef(t),n=t.childCount,r=[];let s=0,i=null;const o=[];for(let d=0,f=e*n;d<f;d++)r[d]=0;for(let d=0,f=0;d<n;d++){const h=t.child(d);f++;for(let m=0;;m++){for(;s<r.length&&r[s]!=0;)s++;if(m==h.childCount)break;const y=h.child(m),{colspan:b,rowspan:g,colwidth:x}=y.attrs;for(let k=0;k<g;k++){if(k+d>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:f,n:g-k});break}const v=s+k*e;for(let w=0;w<b;w++){r[v+w]==0?r[v+w]=f:(i||(i=[])).push({type:"collision",row:d,pos:f,n:b-w});const j=x&&x[w];if(j){const C=(v+w)%e*2,T=o[C];T==null||T!=j&&o[C+1]==1?(o[C]=j,o[C+1]=1):T==j&&o[C+1]++}}}s+=b,f+=y.nodeSize}const p=(d+1)*e;let u=0;for(;s<p;)r[s++]==0&&u++;u&&(i||(i=[])).push({type:"missing",row:d,n:u}),f++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const l=new Jt(e,n,r,i);let a=!1;for(let d=0;!a&&d<o.length;d+=2)o[d]!=null&&o[d+1]<n&&(a=!0);return a&&If(l,o,t),l}function Ef(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const s=t.child(r);let i=0;if(n)for(let o=0;o<r;o++){const l=t.child(o);for(let a=0;a<l.childCount;a++){const d=l.child(a);o+d.attrs.rowspan>r&&(i+=d.attrs.colspan)}}for(let o=0;o<s.childCount;o++){const l=s.child(o);i+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function If(t,e,n){t.problems||(t.problems=[]);const r={};for(let s=0;s<t.map.length;s++){const i=t.map[s];if(r[i])continue;r[i]=!0;const o=n.nodeAt(i);if(!o)throw new RangeError(`No cell with offset ${i} found`);let l=null;const a=o.attrs;for(let d=0;d<a.colspan;d++){const f=e[(s+d)%t.width*2];f!=null&&(!a.colwidth||a.colwidth[d]!=f)&&((l||(l=_f(a)))[d]=f)}l&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}function _f(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Ci(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],s=r.spec.tableRole;s&&(e[s]=r)}}return e}new rn("selectingCells");function Af(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Ul(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Bf(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Af(e.$head)||Of(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Of(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function ro(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function ql(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Kl(t,e,n){const r=t.node(-1),s=Jt.get(r),i=t.start(-1),o=s.nextCell(t.pos-i,e,n);return o==null?null:t.node(0).resolve(i+o)}function io(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(s=>s>0)||(r.colwidth=null)),r}var Qt=class Zt extends Vt{constructor(e,n=e){const r=e.node(-1),s=Jt.get(r),i=e.start(-1),o=s.rectBetween(e.pos-i,n.pos-i),l=e.node(0),a=s.cellsInRect(o).filter(f=>f!=n.pos-i);a.unshift(n.pos-i);const d=a.map(f=>{const h=r.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const p=i+f+1;return new pc(l.resolve(p),l.resolve(p+h.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),s=e.resolve(n.map(this.$headCell.pos));if(ro(r)&&ro(s)&&ql(r,s)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Zt.rowSelection(r,s):i&&this.isColSelection()?Zt.colSelection(r,s):new Zt(r,s)}return Go.between(r,s)}content(){const e=this.$anchorCell.node(-1),n=Jt.get(e),r=this.$anchorCell.start(-1),s=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},o=[];for(let a=s.top;a<s.bottom;a++){const d=[];for(let f=a*n.width+s.left,h=s.left;h<s.right;h++,f++){const p=n.map[f];if(i[p])continue;i[p]=!0;const u=n.findCell(p);let m=e.nodeAt(p);if(!m)throw new RangeError(`No cell with offset ${p} found`);const y=s.left-u.left,b=u.right-s.right;if(y>0||b>0){let g=m.attrs;if(y>0&&(g=io(g,0,y)),b>0&&(g=io(g,g.colspan-b,b)),u.left<s.left){if(m=m.type.createAndFill(g),!m)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(g)}`)}else m=m.type.create(g,m.content)}if(u.top<s.top||u.bottom>s.bottom){const g={...m.attrs,rowspan:Math.min(u.bottom,s.bottom)-Math.max(u.top,s.top)};u.top<s.top?m=m.type.createAndFill(g):m=m.type.create(g,m.content)}d.push(m)}o.push(e.child(a).copy(Nr.from(d)))}const l=this.isColSelection()&&this.isRowSelection()?e:o;return new ps(Nr.from(l),1,1)}replace(e,n=ps.empty){const r=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){const{$from:l,$to:a}=s[o],d=e.mapping.slice(r);e.replace(d.map(l.pos),d.map(a.pos),o?ps.empty:n)}const i=Vt.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new ps(Nr.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Jt.get(n),s=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-s,this.$headCell.pos-s));for(let o=0;o<i.length;o++)e(n.nodeAt(i[o]),s+i[o])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,s=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,s)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),s=Jt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),l=s.findCell(n.pos-i),a=e.node(0);return o.top<=l.top?(o.top>0&&(e=a.resolve(i+s.map[o.left])),l.bottom<s.height&&(n=a.resolve(i+s.map[s.width*(s.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(i+s.map[l.left])),o.bottom<s.height&&(e=a.resolve(i+s.map[s.width*(s.height-1)+o.right-1]))),new Zt(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Jt.get(e),r=this.$anchorCell.start(-1),s=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(s,i)>0)return!1;const o=s+this.$anchorCell.nodeAfter.attrs.colspan,l=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,l)==n.width}eq(e){return e instanceof Zt&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),s=Jt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),l=s.findCell(n.pos-i),a=e.node(0);return o.left<=l.left?(o.left>0&&(e=a.resolve(i+s.map[o.top*s.width])),l.right<s.width&&(n=a.resolve(i+s.map[s.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(i+s.map[l.top*s.width])),o.right<s.width&&(e=a.resolve(i+s.map[s.width*(o.top+1)-1]))),new Zt(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Zt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Zt(e.resolve(n),e.resolve(r))}getBookmark(){return new $f(this.$anchorCell.pos,this.$headCell.pos)}};Qt.prototype.visible=!1;Vt.jsonID("cell",Qt);var $f=class Hl{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Hl(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&ql(n,r)?new Qt(n,r):Vt.near(r,1)}};new rn("fix-tables");function Wl(t){const e=t.selection,n=Bf(t),r=n.node(-1),s=n.start(-1),i=Jt.get(r);return{...e instanceof Qt?i.rectBetween(e.$anchorCell.pos-s,e.$headCell.pos-s):i.findCell(n.pos-s),tableStart:s,map:i,table:r}}function Mf(t){return function(e,n){if(!Ul(e))return!1;if(n){const r=Ci(e.schema),s=Wl(e),i=e.tr,o=s.map.cellsInRect(t=="column"?{left:s.left,top:0,right:s.right,bottom:s.map.height}:t=="row"?{left:0,top:s.top,right:s.map.width,bottom:s.bottom}:s),l=o.map(a=>s.table.nodeAt(a));for(let a=0;a<o.length;a++)l[a].type==r.header_cell&&i.setNodeMarkup(s.tableStart+o[a],r.cell,l[a].attrs);if(i.steps.length===0)for(let a=0;a<o.length;a++)i.setNodeMarkup(s.tableStart+o[a],r.header_cell,l[a].attrs);n(i)}return!0}}function oo(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let s=0;s<r.length;s++){const i=e.table.nodeAt(r[s]);if(i&&i.type!==n.header_cell)return!1}return!0}function ji(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Mf(t):function(n,r){if(!Ul(n))return!1;if(r){const s=Ci(n.schema),i=Wl(n),o=n.tr,l=oo("row",i,s),a=oo("column",i,s),d=(t==="column"?l:t==="row"&&a)?1:0,f=t=="column"?{left:0,top:d,right:1,bottom:i.map.height}:t=="row"?{left:d,top:0,right:i.map.width,bottom:1}:i,h=t=="column"?a?s.cell:s.header_cell:t=="row"?l?s.cell:s.header_cell:s.cell;i.map.cellsInRect(f).forEach(p=>{const u=p+i.tableStart,m=o.doc.nodeAt(u);m&&o.setNodeMarkup(u,h,m.attrs)}),r(o)}return!0}}ji("row",{useDeprecatedLogic:!0});ji("column",{useDeprecatedLogic:!0});ji("cell",{useDeprecatedLogic:!0});function qs(t,e){const n=t.selection;if(!(n instanceof Qt))return!1;if(e){const r=t.tr,s=Ci(t.schema).cell.createAndFill().content;n.forEachCell((i,o)=>{i.content.eq(s)||r.replace(r.mapping.map(o+1),r.mapping.map(o+i.nodeSize-1),new ps(s,0,0))}),r.docChanged&&e(r)}return!0}gc({ArrowLeft:Ks("horiz",-1),ArrowRight:Ks("horiz",1),ArrowUp:Ks("vert",-1),ArrowDown:Ks("vert",1),"Shift-ArrowLeft":Hs("horiz",-1),"Shift-ArrowRight":Hs("horiz",1),"Shift-ArrowUp":Hs("vert",-1),"Shift-ArrowDown":Hs("vert",1),Backspace:qs,"Mod-Backspace":qs,Delete:qs,"Mod-Delete":qs});function Ys(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Ks(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;if(i instanceof Qt)return Ys(n,r,Vt.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const o=Vl(s,t,e);if(o==null)return!1;if(t=="horiz")return Ys(n,r,Vt.near(n.doc.resolve(i.head+e),e));{const l=n.doc.resolve(o),a=Kl(l,t,e);let d;return a?d=Vt.near(a,1):e<0?d=Vt.near(n.doc.resolve(l.before(-1)),-1):d=Vt.near(n.doc.resolve(l.after(-1)),1),Ys(n,r,d)}}}function Hs(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;let o;if(i instanceof Qt)o=i;else{const a=Vl(s,t,e);if(a==null)return!1;o=new Qt(n.doc.resolve(a))}const l=Kl(o.$headCell,t,e);return l?Ys(n,r,new Qt(o.$anchorCell,l)):!1}}function Vl(t,e,n){if(!(t.state.selection instanceof Go))return null;const{$head:r}=t.state.selection;for(let s=r.depth-1;s>=0;s--){const i=r.node(s);if((n<0?r.index(s):r.indexAfter(s))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const o=r.before(s),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?o:null}}return null}new rn("tableColumnResizing");function zf(t,e){const n=Math.min(t.top,e.top),r=Math.max(t.bottom,e.bottom),s=Math.min(t.left,e.left),o=Math.max(t.right,e.right)-s,l=r-n,a=s,d=n;return new DOMRect(a,d,o,l)}var Lf=class{constructor({editor:t,element:e,view:n,pluginKey:r="bubbleMenu",updateDelay:s=250,resizeDelay:i=60,shouldShow:o,appendTo:l,getReferencedVirtualElement:a,options:d}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:h,state:p,from:u,to:m})=>{const{doc:y,selection:b}=p,{empty:g}=b,x=!y.textBetween(u,m).length&&mc(p.selection),k=this.element.contains(document.activeElement);return!(!(h.hasFocus()||k)||g||x||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:h})=>{var p;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}h?.relatedTarget&&((p=this.element.parentNode)!=null&&p.contains(h.relatedTarget))||h?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(h,p)=>{const u=!p?.selection.eq(h.state.selection),m=!p?.doc.eq(h.state.doc);!u&&!m||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(h,u,m,p)},this.updateDelay))},this.updateHandler=(h,p,u,m)=>{const{composing:y}=h;if(y||!p&&!u)return;if(!this.getShouldShow(m)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:h})=>{const p=h.getMeta(this.pluginKey);p==="updatePosition"?this.updatePosition():p&&typeof p=="object"&&p.type==="updateOptions"?this.updateOptions(p.options):p==="hide"?this.hide():p==="show"&&(this.updatePosition(),this.show())};var f;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=s,this.resizeDelay=i,this.appendTo=l,this.scrollTarget=(f=d?.scrollTarget)!=null?f:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...d},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(Eo(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Io(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(_o(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(Ao(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Bo(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(Oo(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push($o(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(Mo(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t,e,n;const{selection:r}=this.editor.state,s=(t=this.getReferencedVirtualElement)==null?void 0:t.call(this);if(s)return s;if(!((n=(e=this.view)==null?void 0:e.dom)!=null&&n.parentNode))return;const i=Xo(this.view,r.from,r.to);let o={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(r instanceof xc){let l=this.view.nodeDOM(r.from);const a=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");a&&(l=a),l&&(o={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(r instanceof Qt){const{$anchorCell:l,$headCell:a}=r,d=l?l.pos:a.pos,f=a?a.pos:l.pos,h=this.view.nodeDOM(d),p=this.view.nodeDOM(f);if(!h||!p)return;const u=h===p?h.getBoundingClientRect():zf(h.getBoundingClientRect(),p.getBoundingClientRect());o={getBoundingClientRect:()=>u,getClientRects:()=>[u]}}return o}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&zo(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:n,strategy:r,middlewareData:s})=>{var i,o;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if((i=s.hide)!=null&&i.referenceHidden||(o=s.hide)!=null&&o.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${e}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(t,e){const{state:n}=t,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(t,e);return}const s=!e?.selection.eq(t.state.selection),i=!e?.doc.eq(t.state.doc);this.updateHandler(t,s,i,e)}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:s}=r,i=Math.min(...s.map(a=>a.$from.pos)),o=Math.max(...s.map(a=>a.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:t,from:i,to:o}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=t.getReferencedVirtualElement),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Ql=t=>new oi({key:typeof t.pluginKey=="string"?new rn(t.pluginKey):t.pluginKey,view:e=>new Lf({view:e,...t})});li.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Ql({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Pf=class{constructor({editor:t,element:e,view:n,pluginKey:r="floatingMenu",updateDelay:s=250,resizeDelay:i=60,options:o,appendTo:l,shouldShow:a}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:f,state:h})=>{const{selection:p}=h,{$anchor:u,empty:m}=p,y=u.depth===1,b=u.parent.isTextblock&&!u.parent.type.spec.code&&!u.parent.textContent&&u.parent.childCount===0&&!this.getTextContent(u.parent);return!(!f.hasFocus()||!m||!y||!b||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(f,h,p,u)=>{const{composing:m}=f;if(m||!h&&!p)return;if(!this.getShouldShow(u)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:f})=>{var h;if(this.preventHide){this.preventHide=!1;return}f?.relatedTarget&&((h=this.element.parentNode)!=null&&h.contains(f.relatedTarget))||f?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:f})=>{const h=f.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var d;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=s,this.resizeDelay=i,this.appendTo=l,this.scrollTarget=(d=o?.scrollTarget)!=null?d:window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(t){return bc(t,{textSerializers:yc(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(Eo(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Io(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(_o(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(Ao(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Bo(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(Oo(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push($o(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(Mo(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:s}=r,i=Math.min(...s.map(a=>a.$from.pos)),o=Math.max(...s.map(a=>a.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:n,oldState:t,from:i,to:o})}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){const{selection:t}=this.editor.state,e=Xo(this.view,t.from,t.to);zo({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:r,y:s,strategy:i,middlewareData:o})=>{var l,a;if((l=o.hide)!=null&&l.referenceHidden||(a=o.hide)!=null&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${r}px`,this.element.style.top=`${s}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const n=!e?.selection.eq(t.state.selection),r=!e?.doc.eq(t.state.doc);this.updateHandler(t,n,r,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Gl=t=>new oi({key:typeof t.pluginKey=="string"?new rn(t.pluginKey):t.pluginKey,view:e=>new Pf({view:e,...t})});li.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:t,dispatch:e})=>(e&&t.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Gl({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var Ff=Te.forwardRef(({pluginKey:t="bubbleMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,getReferencedVirtualElement:o,options:l,children:a,...d},f)=>{const h=S.useRef(document.createElement("div"));typeof f=="function"?f(h.current):f&&(f.current=h.current);const{editor:p}=Yo(),u=e||p,m={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,getReferencedVirtualElement:o,options:l},y=S.useRef(m);y.current=m;const[b,g]=S.useState(!1),x=S.useRef(!0);return S.useEffect(()=>{if(u?.isDestroyed)return;if(!u){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const k=h.current;k.style.visibility="hidden",k.style.position="absolute";const v=Ql({...y.current,editor:u,element:k});u.registerPlugin(v);const w=y.current.pluginKey;return x.current=!0,g(!0),()=>{g(!1),u.unregisterPlugin(w),window.requestAnimationFrame(()=>{k.parentNode&&k.parentNode.removeChild(k)})}},[u]),S.useEffect(()=>{if(!(!b||!u||u.isDestroyed)){if(x.current){x.current=!1;return}u.view.dispatch(u.state.tr.setMeta(t,{type:"updateOptions",options:y.current}))}},[b,u,n,r,i,l,s,o]),sn.createPortal(c.jsx("div",{...d,children:a}),h.current)});Te.forwardRef(({pluginKey:t="floatingMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,options:o,children:l,...a},d)=>{const f=S.useRef(document.createElement("div"));typeof d=="function"?d(f.current):d&&(d.current=f.current);const{editor:h}=Yo(),p=e||h,u={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,options:o},m=S.useRef(u);m.current=u;const[y,b]=S.useState(!1),g=S.useRef(!0);return S.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const x=f.current;x.style.visibility="hidden",x.style.position="absolute";const k=Gl({...m.current,editor:p,element:x});p.registerPlugin(k);const v=m.current.pluginKey;return g.current=!0,b(!0),()=>{b(!1),p.unregisterPlugin(v),window.requestAnimationFrame(()=>{x.parentNode&&x.parentNode.removeChild(x)})}},[p]),S.useEffect(()=>{if(!(!y||!p||p.isDestroyed)){if(g.current){g.current=!1;return}p.view.dispatch(p.state.tr.setMeta(t,{type:"updateOptions",options:m.current}))}},[y,p,n,r,i,o,s]),sn.createPortal(c.jsx("div",{...a,children:l}),f.current)});const Uf=new Set(["http:","https:","mailto:","tel:","ftp:"]);function Xl(t){if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const e=new URL(t,"https://placeholder.invalid");return Uf.has(e.protocol)}catch{return!1}}function Yl(t){const e=t.trim();return e?e.startsWith("/")||e.startsWith(".")||e.startsWith("#")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)?e:`https://${e}`:""}const qf="noopener noreferrer nofollow";function ct(t){const e=U.c(8),{active:n,label:r,onClick:s,children:i}=t,o=n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==o?(l=Z("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",o),e[0]=o,e[1]=l):l=e[1];let a;return e[2]!==n||e[3]!==i||e[4]!==r||e[5]!==s||e[6]!==l?(a=c.jsx("button",{type:"button","aria-label":r,"aria-pressed":n,onMouseDown:Kf,onClick:s,className:l,children:i}),e[2]=n,e[3]=i,e[4]=r,e[5]=s,e[6]=l,e[7]=a):a=e[7],a}function Kf(t){return t.preventDefault()}function lo(t){const e=U.c(7),{active:n,label:r,onSelect:s}=t,i=n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let o;e[0]!==i?(o=Z("flex-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer",i),e[0]=i,e[1]=o):o=e[1];let l;return e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==o?(l=c.jsx("button",{type:"button","aria-pressed":n,onMouseDown:Hf,onClick:s,className:o,children:r}),e[2]=n,e[3]=r,e[4]=s,e[5]=o,e[6]=l):l=e[6],l}function Hf(t){return t.preventDefault()}function u1(t){const e=U.c(36),{editor:n,active:r,open:s,onOpenChange:i}=t,o=oe(),[l,a]=S.useState(""),[d,f]=S.useState(!0),[h,p]=S.useState(!1);let u;e[0]!==r||e[1]!==n||e[2]!==i?(u=()=>{const N=n.getAttributes("link");a(typeof N.href=="string"?N.href:""),f(r?N.target==="_blank":!0),p(!1),i(!0)},e[0]=r,e[1]=n,e[2]=i,e[3]=u):u=e[3];const m=u;let y;e[4]!==n||e[5]!==i?(y=()=>{i(!1),n.chain().focus().run()},e[4]=n,e[5]=i,e[6]=y):y=e[6];const b=y;let g;e[7]!==l||e[8]!==n||e[9]!==d||e[10]!==i?(g=()=>{const N=Yl(l);if(N===""){n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1);return}if(!Xl(N)){p(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:N,target:d?"_blank":null,rel:d?qf:null}).run(),i(!1)},e[7]=l,e[8]=n,e[9]=d,e[10]=i,e[11]=g):g=e[11];const x=g;let k;e[12]!==n||e[13]!==i?(k=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[12]=n,e[13]=i,e[14]=k):k=e[14];const v=k;let w;e[15]!==o?(w=o("sectionsEditor.richTextLinkControl.linkButtonLabel"),e[15]=o,e[16]=w):w=e[16];const j=s?b:m;let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=c.jsx(il,{size:14}),e[17]=C):C=e[17];let T;e[18]!==r||e[19]!==w||e[20]!==j?(T=c.jsx(ct,{active:r,label:w,onClick:j,children:C}),e[18]=r,e[19]=w,e[20]=j,e[21]=T):T=e[21];let D;e[22]!==r||e[23]!==x||e[24]!==b||e[25]!==l||e[26]!==h||e[27]!==d||e[28]!==i||e[29]!==s||e[30]!==v||e[31]!==o?(D=s&&c.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 flex-col gap-1 rounded-md border bg-popover p-1 shadow-md",onBlur:N=>{N.currentTarget.contains(N.relatedTarget)||i(!1)},children:[c.jsxs("div",{className:"flex items-center gap-0.5",children:[c.jsx("input",{autoFocus:!0,type:"text","aria-label":o("sectionsEditor.richTextLinkControl.urlInputAriaLabel"),"aria-invalid":h,placeholder:o("sectionsEditor.richTextLinkControl.urlInputPlaceholder"),value:l,onChange:N=>{a(N.target.value),p(!1)},onKeyDown:N=>{N.key==="Enter"?(N.preventDefault(),x()):N.key==="Escape"&&(N.preventDefault(),b())},className:Z("h-7 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",h&&"text-destructive")}),c.jsx(ct,{active:!1,label:o("sectionsEditor.richTextLinkControl.applyLinkLabel"),onClick:x,children:c.jsx(Ds,{size:14})}),r&&c.jsx(ct,{active:!1,label:o("sectionsEditor.richTextLinkControl.removeLinkLabel"),onClick:v,children:c.jsx(ll,{size:14})})]}),c.jsxs("div",{className:"flex items-center gap-0.5 rounded bg-muted/40 p-0.5",children:[c.jsx(lo,{active:!d,label:o("sectionsEditor.richTextLinkControl.sameTabLabel"),onSelect:()=>f(!1)}),c.jsx(lo,{active:d,label:o("sectionsEditor.richTextLinkControl.newTabLabel"),onSelect:()=>f(!0)})]})]}),e[22]=r,e[23]=x,e[24]=b,e[25]=l,e[26]=h,e[27]=d,e[28]=i,e[29]=s,e[30]=v,e[31]=o,e[32]=D):D=e[32];let E;return e[33]!==T||e[34]!==D?(E=c.jsxs("div",{className:"relative",children:[T,D]}),e[33]=T,e[34]=D,e[35]=E):E=e[35],E}function Wf(t){const e=U.c(30),{editor:n}=t,r=oe(),[s,i]=S.useState(!1),[o,l]=S.useState(""),[a,d]=S.useState(!1);let f;e[0]!==n?(f=n.isActive("link"),e[0]=n,e[1]=f):f=e[1];const h=f;let p;e[2]!==n||e[3]!==s?(p=()=>{if(s){i(!1);return}const C=n.getAttributes("link").href;l(typeof C=="string"?C:""),d(!1),i(!0)},e[2]=n,e[3]=s,e[4]=p):p=e[4];const u=p;let m;e[5]!==n?(m=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=m):m=e[6];const y=m;let b;e[7]!==o||e[8]!==n||e[9]!==y?(b=()=>{const C=Yl(o);if(C===""){y();return}if(!Xl(C)){d(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:C}).run(),i(!1)},e[7]=o,e[8]=n,e[9]=y,e[10]=b):b=e[10];const g=b;let x;e[11]!==r?(x=r("markdownEditor.link"),e[11]=r,e[12]=x):x=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(il,{size:14}),e[13]=k):k=e[13];let v;e[14]!==h||e[15]!==x||e[16]!==u?(v=c.jsx(ct,{active:h,label:x,onClick:u,children:k}),e[14]=h,e[15]=x,e[16]=u,e[17]=v):v=e[17];let w;e[18]!==h||e[19]!==g||e[20]!==o||e[21]!==n||e[22]!==a||e[23]!==s||e[24]!==y||e[25]!==r?(w=s&&c.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:C=>{C.currentTarget.contains(C.relatedTarget)||i(!1)},children:[c.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":a,placeholder:r("markdownEditor.linkPlaceholder"),value:o,onChange:C=>{l(C.target.value),d(!1)},onKeyDown:C=>{C.key==="Enter"?(C.preventDefault(),g()):C.key==="Escape"&&(C.preventDefault(),i(!1),n.chain().focus().run())},className:Z("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",a&&"text-destructive")}),c.jsx(ct,{active:!1,label:r("markdownEditor.linkApply"),onClick:g,children:c.jsx(Ds,{size:14})}),h&&c.jsx(ct,{active:!1,label:r("markdownEditor.linkRemove"),onClick:y,children:c.jsx(ll,{size:14})})]}),e[18]=h,e[19]=g,e[20]=o,e[21]=n,e[22]=a,e[23]=s,e[24]=y,e[25]=r,e[26]=w):w=e[26];let j;return e[27]!==v||e[28]!==w?(j=c.jsxs("div",{className:"relative",children:[v,w]}),e[27]=v,e[28]=w,e[29]=j):j=e[29],j}const _r=()=>{const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},ao=t=>{const e=U.c(2),{children:n}=t;let r;return e[0]!==n?(r=c.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},Zl=[1,2,3],Vf=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function Qf(t){const e=U.c(20),{editor:n}=t,r=oe(),[s,i]=S.useState(null);let o;e[0]!==n?(o={editor:n,selector:Gf},e[0]=n,e[1]=o):o=e[1];const l=kc(o);let a;e[2]!==r?(a=r("markdownEditor.heading1"),e[2]=r,e[3]=a):a=e[3];let d;e[4]!==r?(d=r("markdownEditor.heading2"),e[4]=r,e[5]=d):d=e[5];let f;e[6]!==r?(f=r("markdownEditor.heading3"),e[6]=r,e[7]=f):f=e[7];let h;e[8]!==a||e[9]!==d||e[10]!==f?(h={1:a,2:d,3:f},e[8]=a,e[9]=d,e[10]=f,e[11]=h):h=e[11];const p=h;let u;e[12]!==n||e[13]!==p||e[14]!==s||e[15]!==l||e[16]!==r?(u=s&&c.jsxs(Ff,{editor:n,shouldShow:Vf,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[c.jsx(ct,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:c.jsx(Ea,{size:14})}),c.jsx(ct,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:c.jsx(Ia,{size:14})}),c.jsx(ct,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:c.jsx(_a,{size:14})}),c.jsx(ct,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:c.jsx(Aa,{size:14})}),c.jsx(_r,{}),Zl.map((y,b)=>c.jsx(ct,{active:l.headings[b]??!1,label:p[y],onClick:()=>n.chain().focus().toggleHeading({level:y}).run(),children:c.jsx(ao,{children:`H${y}`})},y)),c.jsx(_r,{}),c.jsx(ct,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:c.jsx(Uo,{size:14})}),c.jsx(ct,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:c.jsx(ao,{children:"1."})}),c.jsx(ct,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:c.jsx(Ba,{size:14})}),c.jsx(_r,{}),c.jsx(Wf,{editor:n})]}),e[12]=n,e[13]=p,e[14]=s,e[15]=l,e[16]=r,e[17]=u):u=e[17];let m;return e[18]!==u?(m=c.jsx("div",{ref:i,className:"relative z-20",children:u}),e[18]=u,e[19]=m):m=e[19],m}function Gf(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Zl.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}function Ti(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var xn=Ti();function Jl(t){xn=t}var an={exec:()=>null};function ce(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(rt.caret,"$1"),n=n.replace(s,o),r},getRegex:()=>new RegExp(n,e)};return r}var Xf=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),rt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Yf=/^(?:[ \t]*(?:\n|$))+/,Zf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Bs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,eh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ni=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ea=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ta=ce(ea).replace(/bull/g,Ni).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),th=ce(ea).replace(/bull/g,Ni).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Di=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nh=/^[^\n]+/,Ri=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sh=ce(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ri).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rh=ce(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ni).getRegex(),yr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ei=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ih=ce("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ei).replace("tag",yr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),na=ce(Di).replace("hr",Bs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yr).getRegex(),oh=ce(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",na).getRegex(),Ii={blockquote:oh,code:Zf,def:sh,fences:Jf,heading:eh,hr:Bs,html:ih,lheading:ta,list:rh,newline:Yf,paragraph:na,table:an,text:nh},co=ce("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Bs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yr).getRegex(),lh={...Ii,lheading:th,table:co,paragraph:ce(Di).replace("hr",Bs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",co).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yr).getRegex()},ah={...Ii,html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ei).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:an,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ce(Di).replace("hr",Bs).replace("heading",` *#{1,6} *[^
|
|
7
|
-
]`).replace("lheading",ta).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ch=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,dh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sa=/^( {2,}|\\)\n(?!\s*$)/,uh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,os=/[\p{P}\p{S}]/u,kr=/[\s\p{P}\p{S}]/u,_i=/[^\s\p{P}\p{S}]/u,fh=ce(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,kr).getRegex(),ra=/(?!~)[\p{P}\p{S}]/u,hh=/(?!~)[\s\p{P}\p{S}]/u,ph=/(?:[^\s\p{P}\p{S}]|~)/u,gh=ce(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ia=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,mh=ce(ia,"u").replace(/punct/g,os).getRegex(),xh=ce(ia,"u").replace(/punct/g,ra).getRegex(),oa="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bh=ce(oa,"gu").replace(/notPunctSpace/g,_i).replace(/punctSpace/g,kr).replace(/punct/g,os).getRegex(),yh=ce(oa,"gu").replace(/notPunctSpace/g,ph).replace(/punctSpace/g,hh).replace(/punct/g,ra).getRegex(),kh=ce("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_i).replace(/punctSpace/g,kr).replace(/punct/g,os).getRegex(),vh=ce(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,os).getRegex(),wh="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Sh=ce(wh,"gu").replace(/notPunctSpace/g,_i).replace(/punctSpace/g,kr).replace(/punct/g,os).getRegex(),Ch=ce(/\\(punct)/,"gu").replace(/punct/g,os).getRegex(),jh=ce(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Th=ce(Ei).replace("(?:-->|$)","-->").getRegex(),Nh=ce("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Th).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),or=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Dh=ce(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",or).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),la=ce(/^!?\[(label)\]\[(ref)\]/).replace("label",or).replace("ref",Ri).getRegex(),aa=ce(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ri).getRegex(),Rh=ce("reflink|nolink(?!\\()","g").replace("reflink",la).replace("nolink",aa).getRegex(),uo=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ai={_backpedal:an,anyPunctuation:Ch,autolink:jh,blockSkip:gh,br:sa,code:dh,del:an,delLDelim:an,delRDelim:an,emStrongLDelim:mh,emStrongRDelimAst:bh,emStrongRDelimUnd:kh,escape:ch,link:Dh,nolink:aa,punctuation:fh,reflink:la,reflinkSearch:Rh,tag:Nh,text:uh,url:an},Eh={...Ai,link:ce(/^!?\[(label)\]\((.*?)\)/).replace("label",or).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",or).getRegex()},Hr={...Ai,emStrongRDelimAst:yh,emStrongLDelim:xh,delLDelim:vh,delRDelim:Sh,url:ce(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",uo).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ce(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",uo).getRegex()},Ih={...Hr,br:ce(sa).replace("{2,}","*").getRegex(),text:ce(Hr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ws={normal:Ii,gfm:lh,pedantic:ah},us={normal:Ai,gfm:Hr,breaks:Ih,pedantic:Eh},_h={"&":"&","<":"<",">":">",'"':""","'":"'"},fo=t=>_h[t];function Wt(t,e){if(e){if(rt.escapeTest.test(t))return t.replace(rt.escapeReplace,fo)}else if(rt.escapeTestNoEncode.test(t))return t.replace(rt.escapeReplaceNoEncode,fo);return t}function ho(t){try{t=encodeURI(t).replace(rt.percentDecode,"%")}catch{return null}return t}function po(t,e){let n=t.replace(rt.findPipe,(i,o,l)=>{let a=!1,d=o;for(;--d>=0&&l[d]==="\\";)a=!a;return a?"|":" |"}),r=n.split(rt.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(rt.slashPipe,"|");return r}function fs(t,e,n){let r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function Ah(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Bh(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function go(t,e,n,r,s){let i=e.href,o=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}function Oh(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
|
|
8
|
-
`).map(i=>{let o=i.match(n.other.beginningSpace);if(o===null)return i;let[l]=o;return l.length>=s.length?i.slice(s.length):i}).join(`
|
|
9
|
-
`)}var lr=class{options;rules;lexer;constructor(t){this.options=t||xn}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:fs(n,`
|
|
10
|
-
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=Oh(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=fs(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:fs(e[0],`
|
|
11
|
-
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=fs(e[0],`
|
|
12
|
-
`).split(`
|
|
13
|
-
`),r="",s="",i=[];for(;n.length>0;){let o=!1,l=[],a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))l.push(n[a]),o=!0;else if(!o)l.push(n[a]);else break;n=n.slice(a);let d=l.join(`
|
|
14
|
-
`),f=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
15
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
16
|
-
${d}`:d,s=s?`${s}
|
|
17
|
-
${f}`:f;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,i,!0),this.lexer.state.top=h,n.length===0)break;let p=i.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let u=p,m=u.raw+`
|
|
18
|
-
`+n.join(`
|
|
19
|
-
`),y=this.blockquote(m);i[i.length-1]=y,r=r.substring(0,r.length-u.raw.length)+y.raw,s=s.substring(0,s.length-u.text.length)+y.text;break}else if(p?.type==="list"){let u=p,m=u.raw+`
|
|
20
|
-
`+n.join(`
|
|
21
|
-
`),y=this.list(m);i[i.length-1]=y,r=r.substring(0,r.length-p.raw.length)+y.raw,s=s.substring(0,s.length-u.raw.length)+y.raw,n=m.substring(i.at(-1).raw.length).split(`
|
|
22
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let i=this.rules.other.listItemRegex(n),o=!1;for(;t;){let a=!1,d="",f="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let h=Bh(e[2].split(`
|
|
23
|
-
`,1)[0],e[1].length),p=t.split(`
|
|
24
|
-
`,1)[0],u=!h.trim(),m=0;if(this.options.pedantic?(m=2,f=h.trimStart()):u?m=e[1].length+1:(m=h.search(this.rules.other.nonSpaceChar),m=m>4?1:m,f=h.slice(m),m+=e[1].length),u&&this.rules.other.blankLine.test(p)&&(d+=p+`
|
|
25
|
-
`,t=t.substring(p.length+1),a=!0),!a){let y=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),g=this.rules.other.fencesBeginRegex(m),x=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m),v=this.rules.other.blockquoteBeginRegex(m);for(;t;){let w=t.split(`
|
|
26
|
-
`,1)[0],j;if(p=w,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),j=p):j=p.replace(this.rules.other.tabCharGlobal," "),g.test(p)||x.test(p)||k.test(p)||v.test(p)||y.test(p)||b.test(p))break;if(j.search(this.rules.other.nonSpaceChar)>=m||!p.trim())f+=`
|
|
27
|
-
`+j.slice(m);else{if(u||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||g.test(h)||x.test(h)||b.test(h))break;f+=`
|
|
28
|
-
`+p}u=!p.trim(),d+=w+`
|
|
29
|
-
`,t=t.substring(w.length+1),h=j.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),s.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),s.raw+=d}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let a of s.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(a.raw);if(d){let f={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};a.checked=f.checked,s.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=f.raw+a.tokens[0].raw,a.tokens[0].text=f.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(f)):a.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):a.tokens.unshift(f)}}if(!s.loose){let d=a.tokens.filter(h=>h.type==="space"),f=d.length>0&&d.some(h=>this.rules.other.anyLine.test(h.raw));s.loose=f}}if(s.loose)for(let a of s.items){a.loose=!0;for(let d of a.tokens)d.type==="text"&&(d.type="paragraph")}return s}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:s}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=po(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
30
|
-
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<n.length;o++)i.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:i.align[o]});for(let o of s)i.rows.push(po(o,i.header.length).map((l,a)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[a]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
31
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=fs(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Ah(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),go(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return go(n,s,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,l=s,a=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+s);(r=d.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){a+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+a);let f=[...r[0]][0].length,h=t.slice(0,s+r.index+f+o);if(Math.min(s,o)%2){let u=h.slice(1,-1);return{type:"em",raw:h,text:u,tokens:this.lexer.inlineTokens(u)}}let p=h.slice(2,-2);return{type:"strong",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,l=s,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*t.length+s);(r=a.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(o=[...i].length,o!==s))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let d=[...r[0]][0].length,f=t.slice(0,s+r.index+d+o),h=f.slice(s,-s);return{type:"del",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},zt=class Wr{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||xn,this.options.tokenizer=this.options.tokenizer||new lr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:rt,block:Ws.normal,inline:us.normal};this.options.pedantic?(n.block=Ws.pedantic,n.inline=us.pedantic):this.options.gfm&&(n.block=Ws.gfm,this.options.breaks?n.inline=us.breaks:n.inline=us.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ws,inline:us}}static lex(e,n){return new Wr(n).lex(e)}static lexInline(e,n){return new Wr(n).inlineTokens(e)}lex(e){e=e.replace(rt.carriageReturn,`
|
|
32
|
-
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(rt.tabCharGlobal," ").replace(rt.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let o=n.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
|
|
33
|
-
`:n.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
34
|
-
`)?"":`
|
|
35
|
-
`)+s.raw,o.text+=`
|
|
36
|
-
`+s.text,this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
37
|
-
`)?"":`
|
|
38
|
-
`)+s.raw,o.text+=`
|
|
39
|
-
`+s.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),n.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),a;this.options.extensions.startBlock.forEach(d=>{a=d.call({lexer:this},l),typeof a=="number"&&a>=0&&(o=Math.min(o,a))}),o<1/0&&o>=0&&(i=e.substring(0,o+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){let o=n.at(-1);r&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
|
|
40
|
-
`)?"":`
|
|
41
|
-
`)+s.raw,o.text+=`
|
|
42
|
-
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s),r=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
43
|
-
`)?"":`
|
|
44
|
-
`)+s.raw,o.text+=`
|
|
45
|
-
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)a.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let o=!1,l="";for(;e;){o||(l=""),o=!1;let a;if(this.options.extensions?.inline?.some(f=>(a=f.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let f=n.at(-1);a.type==="text"&&f?.type==="text"?(f.raw+=a.raw,f.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,r,l)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,r,l)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let d=e;if(this.options.extensions?.startInline){let f=1/0,h=e.slice(1),p;this.options.extensions.startInline.forEach(u=>{p=u.call({lexer:this},h),typeof p=="number"&&p>=0&&(f=Math.min(f,p))}),f<1/0&&f>=0&&(d=e.substring(0,f+1))}if(a=this.tokenizer.inlineText(d)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),o=!0;let f=n.at(-1);f?.type==="text"?(f.raw+=a.raw,f.text+=a.text):n.push(a);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}},ar=class{options;parser;constructor(t){this.options=t||xn}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(rt.notSpaceStart)?.[0],s=t.replace(rt.endingNewline,"")+`
|
|
46
|
-
`;return r?'<pre><code class="language-'+Wt(r)+'">'+(n?s:Wt(s,!0))+`</code></pre>
|
|
47
|
-
`:"<pre><code>"+(n?s:Wt(s,!0))+`</code></pre>
|
|
48
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
49
|
-
${this.parser.parse(t)}</blockquote>
|
|
50
|
-
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
51
|
-
`}hr(t){return`<hr>
|
|
52
|
-
`}list(t){let e=t.ordered,n=t.start,r="";for(let o=0;o<t.items.length;o++){let l=t.items[o];r+=this.listitem(l)}let s=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+s+i+`>
|
|
53
|
-
`+r+"</"+s+`>
|
|
54
|
-
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
55
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
56
|
-
`}table(t){let e="",n="";for(let s=0;s<t.header.length;s++)n+=this.tablecell(t.header[s]);e+=this.tablerow({text:n});let r="";for(let s=0;s<t.rows.length;s++){let i=t.rows[s];n="";for(let o=0;o<i.length;o++)n+=this.tablecell(i[o]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
57
|
-
<thead>
|
|
58
|
-
`+e+`</thead>
|
|
59
|
-
`+r+`</table>
|
|
60
|
-
`}tablerow({text:t}){return`<tr>
|
|
61
|
-
${t}</tr>
|
|
62
|
-
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
63
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Wt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),s=ho(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+Wt(e)+'"'),i+=">"+r+"</a>",i}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=ho(t);if(s===null)return Wt(n);t=s;let i=`<img src="${t}" alt="${Wt(n)}"`;return e&&(i+=` title="${Wt(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Wt(t.text)}},Bi=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Lt=class Vr{options;renderer;textRenderer;constructor(e){this.options=e||xn,this.options.renderer=this.options.renderer||new ar,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Bi}static parse(e,n){return new Vr(n).parse(e)}static parseInline(e,n){return new Vr(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let o=s,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=l||"";continue}}let i=s;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=l||"";continue}}let o=i;switch(o.type){case"escape":{r+=n.text(o);break}case"html":{r+=n.html(o);break}case"link":{r+=n.link(o);break}case"image":{r+=n.image(o);break}case"checkbox":{r+=n.checkbox(o);break}case"strong":{r+=n.strong(o);break}case"em":{r+=n.em(o);break}case"codespan":{r+=n.codespan(o);break}case"br":{r+=n.br(o);break}case"del":{r+=n.del(o);break}case"text":{r+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},gs=class{options;block;constructor(t){this.options=t||xn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?zt.lex:zt.lexInline}provideParser(t=this.block){return t?Lt.parse:Lt.parseInline}},$h=class{defaults=Ti();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Lt;Renderer=ar;TextRenderer=Bi;Lexer=zt;Tokenizer=lr;Hooks=gs;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let i of s.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of s.rows)for(let o of i)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let s=r;n=n.concat(this.walkTokens(s.items,e));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{let o=s[i].flat(1/0);n=n.concat(this.walkTokens(o,e))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=i.apply(this,o)),l}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),n.renderer){let s=this.defaults.renderer||new ar(this.defaults);for(let i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,l=n.renderer[o],a=s[o];s[o]=(...d)=>{let f=l.apply(s,d);return f===!1&&(f=a.apply(s,d)),f||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new lr(this.defaults);for(let i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,l=n.tokenizer[o],a=s[o];s[o]=(...d)=>{let f=l.apply(s,d);return f===!1&&(f=a.apply(s,d)),f}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new gs;for(let i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,l=n.hooks[o],a=s[o];gs.passThroughHooks.has(i)?s[o]=d=>{if(this.defaults.async&&gs.passThroughHooksRespectAsync.has(i))return(async()=>{let h=await l.call(s,d);return a.call(s,h)})();let f=l.call(s,d);return a.call(s,f)}:s[o]=(...d)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(s,d);return h===!1&&(h=await a.apply(s,d)),h})();let f=l.apply(s,d);return f===!1&&(f=a.apply(s,d)),f}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(o){let l=[];return l.push(i.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return zt.lex(t,e??this.defaults)}parser(t,e){return Lt.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(e):e,l=await(s.hooks?await s.hooks.provideLexer(t):t?zt.lex:zt.lexInline)(o,s),a=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(a,s.walkTokens));let d=await(s.hooks?await s.hooks.provideParser(t):t?Lt.parse:Lt.parseInline)(a,s);return s.hooks?await s.hooks.postprocess(d):d})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let o=(s.hooks?s.hooks.provideLexer(t):t?zt.lex:zt.lexInline)(e,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(t):t?Lt.parse:Lt.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return i(o)}}}onError(t,e){return n=>{if(n.message+=`
|
|
64
|
-
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Wt(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},hn=new $h;function be(t,e){return hn.parse(t,e)}be.options=be.setOptions=function(t){return hn.setOptions(t),be.defaults=hn.defaults,Jl(be.defaults),be};be.getDefaults=Ti;be.defaults=xn;be.use=function(...t){return hn.use(...t),be.defaults=hn.defaults,Jl(be.defaults),be};be.walkTokens=function(t,e){return hn.walkTokens(t,e)};be.parseInline=hn.parseInline;be.Parser=Lt;be.parser=Lt.parse;be.Renderer=ar;be.TextRenderer=Bi;be.Lexer=zt;be.lexer=zt.lex;be.Tokenizer=lr;be.Hooks=gs;be.parse=be;be.options;be.setOptions;be.use;be.walkTokens;be.parseInline;Lt.parse;zt.lex;function Mh(t,e){const r=e.split(`
|
|
65
|
-
`).flatMap(s=>[s,""]).map(s=>`${t}${s}`).join(`
|
|
66
|
-
`);return r.slice(0,r.length-1)}function zh(t,e){const n=[];return Array.from(t.keys()).forEach(r=>{(!e||!e.marks||!e.marks.map(s=>s.type).includes(r))&&n.push(r)}),n}function Lh(t,e){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{t.has(r)||n.push({type:r,mark:s})}),n}function Ph(t,e,n,r){const s=!n,i=n&&n.type==="text"&&(!n.marks||n.marks.length===0),o=n&&n.type==="text"&&n.marks&&!r(e,new Map(n.marks.map(a=>[a.type,a]))),l=[];if(s||i||o)if(n&&n.type==="text"&&n.marks){const a=new Map(n.marks.map(d=>[d.type,d]));Array.from(t.keys()).forEach(d=>{a.has(d)||l.push(d)})}else(s||i)&&l.push(...Array.from(t.keys()));return l}function Fh(t,e){let n="";return Array.from(t.keys()).reverse().forEach(r=>{const s=t.get(r),i=e(r,s);i&&(n=i+n)}),t.clear(),n}function Uh(t,e,n){let r="";return Array.from(t.entries()).forEach(([s,i])=>{const o=n(s,i);o&&(r+=o),e.set(s,i)}),r}function Ar(t){const n=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return n?{isTask:!0,checked:n[2].toLowerCase()==="x",indentLevel:n[1].length}:{isTask:!1,indentLevel:0}}function Vs(t,e){return typeof t!="string"?"json":e}var qh=class{constructor(t){this.baseExtensions=[],this.extensions=[],this.lastParseResult=null;var e,n,r,s,i;this.markedInstance=(e=t?.marked)!=null?e:be,this.lexer=new this.markedInstance.Lexer,this.indentStyle=(r=(n=t?.indentation)==null?void 0:n.style)!=null?r:"space",this.indentSize=(i=(s=t?.indentation)==null?void 0:s.size)!=null?i:2,this.baseExtensions=t?.extensions||[],t?.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t?.extensions&&(this.baseExtensions=t.extensions,vc(t.extensions).forEach(l=>this.registerExtension(l,!1))),this.lexer=new this.markedInstance.Lexer}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t,e=!0){var n,r;this.extensions.push(t);const s=t.name,i=ds(t,"markdownTokenName")||s,o=ds(t,"parseMarkdown"),l=ds(t,"renderMarkdown"),a=ds(t,"markdownTokenizer"),d=(n=ds(t,"markdownOptions"))!=null?n:null,f=(r=d?.indentsContent)!=null?r:!1,h={tokenName:i,nodeName:s,parseMarkdown:o,renderMarkdown:l,isIndenting:f,tokenizer:a};if(i&&o){const p=this.registry.get(i)||[];p.push(h),this.registry.set(i,p)}if(l){const p=this.nodeTypeRegistry.get(s)||[];p.push(h),this.nodeTypeRegistry.set(s,p)}a&&this.hasMarked()&&(this.registerTokenizer(a),e&&(this.lexer=new this.markedInstance.Lexer))}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:n,level:r="inline",tokenize:s}=t,l={inlineTokens:f=>this.lexer.inlineTokens(f),blockTokens:f=>this.lexer.blockTokens(f)};let a;n?a=typeof n=="function"?n:f=>f.indexOf(n):a=f=>{const h=s(f,[],l);return h&&h.raw?f.indexOf(h.raw):-1};const d={name:e,level:r,start:a,tokenizer:(f,h)=>{const p=s(f,h,l);if(p&&p.type)return{...p,type:p.type||e,raw:p.raw||"",tokens:p.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[d]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const n=this.getHandlersForNodeType(t);return n.length>0?n[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.markedInstance.lexer(t);return{type:"doc",content:this.parseTokens(e,!0)}}parseTokens(t,e=!1){const n=t.reduce((i,o,l)=>(o.type!=="space"&&i.push(l),i),[]);let r=-1,s=0;return t.flatMap((i,o)=>{for(var l;s<n.length&&n[s]<o;)r=n[s],s+=1;if(e&&i.type==="space"){const d=(l=n[s])!=null?l:-1;return this.createImplicitEmptyParagraphsFromSpace(i,r,d)}const a=this.parseToken(i,e);return a===null?[]:Array.isArray(a)?a:[a]})}createImplicitEmptyParagraphsFromSpace(t,e,n){const r=this.countParagraphSeparators(t.raw||"");if(r===0)return[];const i=Math.max(r-(e===-1||n===-1?0:1),0);return Array.from({length:i},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,`
|
|
67
|
-
`).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const n=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(n.find(i=>{if(!i.parseMarkdown)return!1;const o=i.parseMarkdown(t,r),l=this.normalizeParseResult(o);return l&&(!Array.isArray(l)||l.length>0)?(this.lastParseResult=l,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(l=>Ar(l).isTask),n=t.items.some(l=>!Ar(l).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const r=[];let s=[],i=null;for(let l=0;l<t.items.length;l+=1){const a=t.items[l],{isTask:d,checked:f,indentLevel:h}=Ar(a);let p=a;if(d){const y=(a.raw||a.text||"").split(`
|
|
68
|
-
`),b=y[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),g=b?b[2]:"";let x=[];if(y.length>1&&y.slice(1).join(`
|
|
69
|
-
`).trim()){const v=y.slice(1),w=v.filter(j=>j.trim());if(w.length>0){const j=Math.min(...w.map(D=>D.length-D.trimStart().length)),T=v.map(D=>D.trim()?D.slice(j):"").join(`
|
|
70
|
-
`).trim();T&&(x=this.markedInstance.lexer(`${T}
|
|
71
|
-
`))}}p={type:"taskItem",raw:"",mainContent:g,indentLevel:h,checked:f??!1,text:g,tokens:this.lexer.inlineTokens(g),nestedTokens:x}}const u=d?"taskList":"list";i!==u?(s.length>0&&r.push({type:i,items:s}),s=[p],i=u):s.push(p)}s.length>0&&r.push({type:i,items:s});const o=[];for(let l=0;l<r.length;l+=1){const a=r[l],d={...t,type:a.type,items:a.items},f=this.parseToken(d);f&&(Array.isArray(f)?o.push(...f):o.push(f))}return o.length>0?o:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(s=>{if(!s.parseMarkdown)return!1;const i=s.parseMarkdown(t,n),o=this.normalizeParseResult(i);return o&&(!Array.isArray(o)||o.length>0)?(this.lastParseResult=o,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const r={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){var e,n,r,s;const i=[];for(let o=0;o<t.length;o+=1){const l=t[o];if(l.type==="text")i.push({type:"text",text:l.text||""});else if(l.type==="html"){const a=((n=(e=l.raw)!=null?e:l.text)!=null?n:"").toString(),d=/^<\/[\s]*[\w-]+/i.test(a),f=a.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!d&&f&&!/\/>$/.test(a)){const p=f[1],u=this.escapeRegex(p),m=new RegExp(`^<\\/\\s*${u}\\b`,"i");let y=-1;const b=[a];for(let g=o+1;g<t.length;g+=1){const x=t[g],k=((s=(r=x.raw)!=null?r:x.text)!=null?s:"").toString();if(b.push(k),x.type==="html"&&m.test(k)){y=g;break}}if(y!==-1){const g=b.join(""),x={type:"html",raw:g,text:g,block:!1},k=this.parseHTMLToken(x);if(k){const v=this.normalizeParseResult(k);Array.isArray(v)?i.push(...v):v&&i.push(v)}o=y;continue}}const h=this.parseHTMLToken(l);if(h){const p=this.normalizeParseResult(h);Array.isArray(p)?i.push(...p):p&&i.push(p)}}else if(l.type){const a=this.getHandlerForToken(l.type);if(a&&a.parseMarkdown){const d=this.createParseHelpers(),f=a.parseMarkdown(l,d);if(this.isMarkResult(f)){const h=this.applyMarkToContent(f.mark,f.content,f.attrs);i.push(...h)}else{const h=this.normalizeParseResult(f);Array.isArray(h)?i.push(...h):h&&i.push(h)}}else l.tokens&&i.push(...this.parseInlineTokens(l.tokens))}}return i}applyMarkToContent(t,e,n){return e.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:t,attrs:n}:{type:t};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(t,r.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:t.text||""};case"html":return this.parseHTMLToken(t);case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(typeof window>"u")return t.block?{type:"paragraph",content:[{type:"text",text:e}]}:{type:"text",text:e};try{const n=wc(e,this.baseExtensions);return n.type==="doc"&&n.content?t.block?n.content:n.content.length===1&&n.content[0].type==="paragraph"&&n.content[0].content?n.content[0].content:n.content:n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}renderNodeToMarkdown(t,e,n=0,r=0,s={}){var i;if(t.type==="text")return t.text||"";if(!t.type)return"";const o=this.getHandlerForToken(t.type);if(!o)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,a={renderChildren:(h,p)=>{const u=o.isIndenting?r+1:r;return!Array.isArray(h)&&h.content?this.renderNodes(h.content,t,p||"",n,u):this.renderNodes(h,t,p||"",n,u)},renderChild:(h,p)=>{const u=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(h,t,p,u)},indent:h=>this.indentString+h,wrapInBlock:Mh},d={index:n,level:r,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...s}};return((i=o.renderMarkdown)==null?void 0:i.call(o,t,a,d))||""}renderNodes(t,e,n="",r=0,s=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,s):t.type?this.renderNodeToMarkdown(t,e,r,s):""}renderNodesWithMarkBoundaries(t,e,n="",r=0){const s=[],i=new Map;return t.forEach((o,l)=>{const a=l<t.length-1?t[l+1]:null;if(o.type)if(o.type==="text"){let d=o.text||"";const f=new Map((o.marks||[]).map(g=>[g.type,g])),h=Lh(i,f),p=zh(f,a);let u="";if(p.length>0){const g=d.match(/(\s+)$/);g&&(u=g[1],d=d.slice(0,-u.length))}p.forEach(g=>{const x=f.get(g),k=this.getMarkClosing(g,x);k&&(d+=k),i.has(g)&&i.delete(g)});let m="";if(h.length>0){const g=d.match(/^(\s+)/);g&&(m=g[1],d=d.slice(m.length))}h.forEach(({type:g,mark:x})=>{const k=this.getMarkOpening(g,x);k&&(d=k+d),p.includes(g)||i.set(g,x)}),d=m+d;const y=Ph(i,f,a,this.markSetsEqual.bind(this));let b="";if(y.length>0){const g=d.match(/(\s+)$/);g&&(b=g[1],d=d.slice(0,-b.length))}y.forEach(g=>{const x=i.get(g),k=this.getMarkClosing(g,x);k&&(d+=k),i.delete(g)}),d+=b,d+=u,s.push(d)}else{const d=new Map(i),f=Fh(i,this.getMarkClosing.bind(this)),h=this.renderNodeToMarkdown(o,e,l,r),p=o.type==="hardBreak"?"":Uh(d,i,this.getMarkOpening.bind(this));s.push(f+h+p)}}),s.join(n)}getMarkOpening(t,e){const n=this.getHandlersForNodeType(t),r=n.length>0?n[0]:void 0;if(!r||!r.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",i={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const o=r.renderMarkdown(i,{renderChildren:()=>s,renderChild:()=>s,indent:a=>a,wrapInBlock:(a,d)=>a+d},{index:0,level:0,parentType:"text",meta:{}}),l=o.indexOf(s);return l>=0?o.substring(0,l):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e){const n=this.getHandlersForNodeType(t),r=n.length>0?n[0]:void 0;if(!r||!r.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",i={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const o=r.renderMarkdown(i,{renderChildren:()=>s,renderChild:()=>s,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{}}),l=o.indexOf(s),a=l+s.length;return l>=0?o.substring(a):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.keys()).every(n=>e.has(n))}},mo=qh,Kh=li.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return Yt.setContent(t,e);if(Vs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Yt.setContent(t,e);const r=this.editor.markdown.parse(t);return Yt.setContent(r,e)},insertContent:(t,e)=>{if(!e?.contentType)return Yt.insertContent(t,e);if(Vs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Yt.insertContent(t,e);const r=this.editor.markdown.parse(t);return Yt.insertContent(r,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return Yt.insertContentAt(t,e,n);if(Vs(e,n?.contentType)!=="markdown"||!this.editor.markdown)return Yt.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return Yt.insertContentAt(t,s,n)}}},addStorage(){return{manager:new mo({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new mo({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||Vs(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);this.editor.options.content=e}});function Hh(t){const e=U.c(25),{node:n,selected:r,editor:s,deleteNode:i}=t,o=oe(),l=typeof n.attrs.href=="string"?n.attrs.href:"",a=typeof n.attrs.name=="string"?n.attrs.name:"";let d;e[0]!==a||e[1]!==o?(d=a||o("markdownEditor.fileNameFallback"),e[0]=a,e[1]=o,e[2]=d):d=e[2];const f=d,h=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let p;e[3]!==h?(p=Z("mx-0.5 inline-flex max-w-full select-none items-center gap-1.5 rounded-lg border border-border bg-card px-2 py-1 align-middle text-sm text-foreground",h),e[3]=h,e[4]=p):p=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx(Oa,{size:14,className:"shrink-0 text-muted-foreground"}),e[5]=u):u=e[5];let m;e[6]!==f?(m=c.jsx("span",{className:"min-w-0 truncate",children:f}),e[6]=f,e[7]=m):m=e[7];let y;e[8]!==f||e[9]!==o?(y=o("markdownEditor.downloadFile",{name:f}),e[8]=f,e[9]=o,e[10]=y):y=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(Ac,{size:14}),e[11]=b):b=e[11];let g;e[12]!==l||e[13]!==f||e[14]!==y?(g=c.jsx("a",{href:l,download:f,"aria-label":y,onMouseDown:Vh,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:b}),e[12]=l,e[13]=f,e[14]=y,e[15]=g):g=e[15];let x;e[16]!==i||e[17]!==s.isEditable||e[18]!==o?(x=s.isEditable&&c.jsx("button",{type:"button","aria-label":o("markdownEditor.removeFile"),onMouseDown:Wh,onClick:i,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:c.jsx(cn,{size:14})}),e[16]=i,e[17]=s.isEditable,e[18]=o,e[19]=x):x=e[19];let k;return e[20]!==p||e[21]!==m||e[22]!==g||e[23]!==x?(k=c.jsxs(tl,{as:"span",className:p,children:[u,m,g,x]}),e[20]=p,e[21]=m,e[22]=g,e[23]=x,e[24]=k):k=e[24],k}function Wh(t){return t.preventDefault()}function Vh(t){return t.preventDefault()}function Qh(t){return t.replace(/([[\]])/g,"\\$1")}const Gh=Zo.create({name:"attachment",group:"inline",inline:!0,atom:!0,draggable:!0,addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href"),renderHTML:t=>t.href?{href:t.href}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||t.textContent,renderHTML:t=>t.name?{"data-name":t.name}:{}}}},parseHTML(){return[{tag:"a[data-attachment]"}]},renderHTML({HTMLAttributes:t,node:e}){return["a",el(t,{"data-attachment":""}),typeof e.attrs.name=="string"?e.attrs.name:""]},renderMarkdown:t=>{const e=typeof t.attrs?.href=="string"?t.attrs.href:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return`[${Qh(n)}](${e})`},addNodeView(){return Jo(Hh)}});var Xh=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Yh=Zo.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",el(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,o;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",a=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",d=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return d?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:l})=>{const a=document.createElement("img");Object.entries(o).forEach(([h,p])=>{if(p!=null)switch(h){case"width":case"height":break;default:a.setAttribute(h,p);break}}),a.src=o.src;const d=new Cc({element:a,editor:l,node:s,getPos:i,onResize:(h,p)=>{a.style.width=`${h}px`,a.style.height=`${p}px`},onCommit:(h,p)=>{const u=i();u!==void 0&&this.editor.chain().setNodeSelection(u).updateAttributes(this.name,{width:h,height:p}).run()},onUpdate:(h,p,u)=>h.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),f=d.dom;return f.style.visibility="hidden",f.style.pointerEvents="none",a.onload=()=>{f.style.visibility="",f.style.pointerEvents=""},d}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Sc({find:Xh,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Zh=Yh;function Jh(t){const e=U.c(16),{node:n,selected:r,editor:s,deleteNode:i}=t,o=oe(),l=typeof n.attrs.src=="string"?n.attrs.src:"",a=typeof n.attrs.alt=="string"?n.attrs.alt:"";let d;e[0]!==a||e[1]!==o?(d=a||o("markdownEditor.imageAltFallback"),e[0]=a,e[1]=o,e[2]=d):d=e[2];const f=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let h;e[3]!==f?(h=Z("max-h-[420px] max-w-full rounded-lg border border-border object-contain",f),e[3]=f,e[4]=h):h=e[4];let p;e[5]!==l||e[6]!==d||e[7]!==h?(p=c.jsx("img",{src:l,alt:d,draggable:!1,className:h}),e[5]=l,e[6]=d,e[7]=h,e[8]=p):p=e[8];let u;e[9]!==i||e[10]!==s.isEditable||e[11]!==o?(u=s.isEditable&&c.jsx("button",{type:"button","aria-label":o("markdownEditor.removeImage"),onMouseDown:ep,onClick:i,className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-md border border-border bg-card text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/image:opacity-100",children:c.jsx(cn,{size:14})}),e[9]=i,e[10]=s.isEditable,e[11]=o,e[12]=u):u=e[12];let m;return e[13]!==p||e[14]!==u?(m=c.jsxs(tl,{className:"group/image relative my-3 w-fit max-w-full",children:[p,u]}),e[13]=p,e[14]=u,e[15]=m):m=e[15],m}function ep(t){return t.preventDefault()}const tp=Zh.extend({addNodeView(){return Jo(Jh)}}).configure({inline:!1,allowBase64:!1}),Qr="uploads",np="editor-images",ca="editor-files",sp=new RegExp(`^/api/[^/]+/fs/${Qr}/read$`),xo="http://relative.invalid";function rp(t){let e;try{e=new URL(t,xo)}catch{return!1}return e.origin!==xo||!sp.test(e.pathname)?!1:(e.searchParams.get("path")??"").startsWith(`${ca}/`)}const ip={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},op=jc.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";return rp(n)?e.createNode("attachment",{href:n,name:t.text??""}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function lp(t=""){return[Tc.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),op.configure(ip),ed.configure({placeholder:t}),tp,Gh,Kh.configure({markedOptions:{breaks:!0}})]}const ap=10,cp=25,dp={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function up(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??dp[t.type]??(Oi(t)?".png":"")}function Oi(t){return t.type.startsWith("image/")}function fp(){const t=oe(),{upload:e}=kd(Qr),n=yd(Qr),[r,s]=S.useState(0);return{uploadFile:async o=>{const l=Oi(o),a=l?ap:cp;if(o.size>a*1024*1024)return St.error(t("markdownEditor.fileTooLarge",{name:o.name,max:String(a)})),null;const d=l?np:ca,f=`${crypto.randomUUID()}${up(o)}`;s(h=>h+1);try{return await e.mutateAsync({dir:d,files:[new File([o],f,{type:o.type})]}),n(`${d}/${f}`)}catch{return St.error(t("markdownEditor.uploadFailed",{name:o.name})),null}finally{s(h=>h-1)}},pending:r}}const hp=["outline-none","min-h-[200px] sm:min-h-[320px]","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0","[&_p]:my-2 [&_p]:leading-relaxed","[&_h1]:mb-2 [&_h1]:mt-5 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:leading-snug","[&_h2]:mb-1.5 [&_h2]:mt-4 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:leading-snug","[&_h3]:mb-1 [&_h3]:mt-3 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:leading-snug","[&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5","[&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5","[&_li]:my-0.5 [&_li>p]:my-0","[&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]","[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-[13px]","[&_pre_code]:bg-transparent [&_pre_code]:p-0","[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2","[&_hr]:my-4 [&_hr]:border-border","[&_strong]:font-semibold"].join(" "),pp=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/50","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function bo(t,e,n,r){const s=t.state.schema.nodes[n];if(!s)return e;const i=t.state.tr.replaceWith(e,e,s.create(r)),o=i.mapping.map(e,1);return i.setSelection(Vt.near(i.doc.resolve(o))),t.dispatch(i),t.state.selection.to}function gp({defaultValue:t,onChange:e,placeholder:n,editable:r=!0}){const s=oe(),{uploadFile:i,pending:o}=fp(),l=S.useRef(null),a=S.useRef(e),d=S.useRef(i);a.current=e,d.current=i;const f=(u,m,y)=>m.length===0?!1:((async()=>{let b=y;for(const g of m){const x=await d.current(g);x&&(b=Oi(g)?bo(u,b,"image",{src:x,alt:g.name}):bo(u,b,"attachment",{href:x,name:g.name}))}})(),!0),h=Nc({extensions:lp(n),content:t,contentType:"markdown",editable:r,editorProps:{attributes:{class:Z(hp,pp)},handlePaste:(u,m)=>f(u,Array.from(m.clipboardData?.files??[]),u.state.selection.to),handleDrop:(u,m,y,b)=>{if(b)return!1;const g=Array.from(m.dataTransfer?.files??[]),x=u.posAtCoords({left:m.clientX,top:m.clientY})?.pos;return x===void 0?!1:f(u,g,x)}},onUpdate:({editor:u})=>a.current(u.getMarkdown())});if(!h)return null;const p=u=>{!u||u.length===0||f(h.view,Array.from(u),h.state.selection.to)};return c.jsxs("div",{className:"flex flex-col",children:[c.jsx(Qf,{editor:h}),c.jsx(Dc,{editor:h,className:"text-[15px] text-foreground"}),c.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground",children:[r&&c.jsx(Ae,{type:"button",variant:"ghost",size:"icon-sm","aria-label":s("markdownEditor.attachFile"),onClick:()=>l.current?.click(),children:c.jsx($a,{size:14})}),o>0&&c.jsxs("span",{className:"inline-flex items-center gap-1.5","aria-live":"polite",role:"status",children:[c.jsx(Ns,{size:12,className:"animate-spin"}),o===1?s("markdownEditor.uploading"):s("markdownEditor.uploadingCount",{count:String(o)})]})]}),c.jsx("input",{ref:l,type:"file",multiple:!0,className:"hidden",onChange:u=>{p(u.target.files),u.target.value=""}})]})}const mp=1e4;function xp(t){const e=U.c(10),{locator:n}=Me(),r=gn();let s;e[0]!==t||e[1]!==n?(s=xe.taskBoardItemPrs(n,t??""),e[0]=t,e[1]=n,e[2]=s):s=e[2];const i=!!t;let o;e[3]!==t||e[4]!==r?(o=async()=>(await r.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:t})).prs,e[3]=t,e[4]=r,e[5]=o):o=e[5];let l;return e[6]!==s||e[7]!==i||e[8]!==o?(l={queryKey:s,enabled:i,refetchInterval:mp,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=l):l=e[9],Ze(l)}function da(t){const e=U.c(10),{locator:n}=Me(),r=gn();let s;e[0]!==t||e[1]!==n?(s=xe.taskBoardActivity(n,t??""),e[0]=t,e[1]=n,e[2]=s):s=e[2];const i=!!t;let o;e[3]!==t||e[4]!==r?(o=async()=>(await r.call("TASK_BOARD_ACTIVITY_LIST",{taskBoardItemId:t})).activity,e[3]=t,e[4]=r,e[5]=o):o=e[5];let l;return e[6]!==s||e[7]!==i||e[8]!==o?(l={queryKey:s,enabled:i,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=l):l=e[9],Ze(l)}function bp(t){const e=U.c(10),{locator:n}=Me(),r=gn(),s=pn();let i;e[0]!==t||e[1]!==r?(i=async()=>await r.call("TASK_BOARD_PROMOTE_TO_PRODUCTION",{taskBoardItemId:t}),e[0]=t,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==t||e[4]!==n||e[5]!==s?(o=()=>{s.invalidateQueries({queryKey:xe.taskBoardItemPrs(n,t)}),s.invalidateQueries({queryKey:xe.taskBoardActivity(n,t)})},e[3]=t,e[4]=n,e[5]=s,e[6]=o):o=e[6];let l;return e[7]!==i||e[8]!==o?(l={mutationFn:i,onSuccess:o},e[7]=i,e[8]=o,e[9]=l):l=e[9],Ye(l)}function yp(t){const e=[];return t.qa&&e.push("qa"),t.codeReview&&e.push("code_review"),e}function kp(t,e){return e.length===0?!0:rc(t,e)}function $i(t){const e=U.c(54),{members:n,onSelect:r}=t,s=oe();let i;e[0]!==s?(i=s("taskBoard.taskDialog.assignToPlaceholder"),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==i?(o=c.jsx(ai,{placeholder:i,className:"h-9"}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==s?(l=s("taskBoard.taskDialog.noMembersFound"),e[4]=s,e[5]=l):l=e[5];let a;e[6]!==l?(a=c.jsx(ci,{children:l}),e[6]=l,e[7]=a):a=e[7];let d;e[8]!==s?(d=s("taskBoard.taskDialog.superAgentLabel"),e[8]=s,e[9]=d):d=e[9];let f;e[10]!==r?(f=()=>r($e),e[10]=r,e[11]=f):f=e[11];let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Pt,{size:16}),e[12]=h):h=e[12];let p;e[13]!==s?(p=s("taskBoard.taskDialog.superAgentLabel"),e[13]=s,e[14]=p):p=e[14];let u;e[15]!==p?(u=c.jsx("span",{className:"truncate",children:p}),e[15]=p,e[16]=u):u=e[16];let m;e[17]!==d||e[18]!==f||e[19]!==u?(m=c.jsxs(en,{value:d,onSelect:f,className:"gap-2",children:[h,u]}),e[17]=d,e[18]=f,e[19]=u,e[20]=m):m=e[20];let y;e[21]!==s?(y=s("taskBoard.taskDialog.unassignedLabel"),e[21]=s,e[22]=y):y=e[22];let b;e[23]!==r?(b=()=>r(null),e[23]=r,e[24]=b):b=e[24];let g;e[25]===Symbol.for("react.memo_cache_sentinel")?(g=c.jsx(Mr,{size:16,className:"text-muted-foreground"}),e[25]=g):g=e[25];let x;e[26]!==s?(x=s("taskBoard.taskDialog.unassignedLabel"),e[26]=s,e[27]=x):x=e[27];let k;e[28]!==x?(k=c.jsx("span",{className:"truncate",children:x}),e[28]=x,e[29]=k):k=e[29];let v;e[30]!==y||e[31]!==b||e[32]!==k?(v=c.jsxs(en,{value:y,onSelect:b,className:"gap-2",children:[g,k]}),e[30]=y,e[31]=b,e[32]=k,e[33]=v):v=e[33];let w;e[34]!==m||e[35]!==v?(w=c.jsxs(ns,{children:[m,v]}),e[34]=m,e[35]=v,e[36]=w):w=e[36];let j;e[37]!==s?(j=s("taskBoard.taskDialog.membersGroupHeading"),e[37]=s,e[38]=j):j=e[38];let C;if(e[39]!==n||e[40]!==r){let N;e[42]!==r?(N=I=>c.jsxs(en,{value:I.user?.name??I.userId,onSelect:()=>r(I.userId),className:"gap-2",children:[c.jsx(At,{url:I.user?.image??void 0,fallback:_t(I.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:I.user?.name??I.userId})]},I.userId),e[42]=r,e[43]=N):N=e[43],C=n.map(N),e[39]=n,e[40]=r,e[41]=C}else C=e[41];let T;e[44]!==j||e[45]!==C?(T=c.jsx(ns,{heading:j,children:C}),e[44]=j,e[45]=C,e[46]=T):T=e[46];let D;e[47]!==w||e[48]!==T||e[49]!==a?(D=c.jsxs(di,{children:[a,w,T]}),e[47]=w,e[48]=T,e[49]=a,e[50]=D):D=e[50];let E;return e[51]!==o||e[52]!==D?(E=c.jsxs(ui,{children:[o,D]}),e[51]=o,e[52]=D,e[53]=E):E=e[53],E}function vp({tags:t,selectedIds:e,defaultColor:n,onToggle:r,onCreate:s,onDelete:i}){const o=oe(),[l,a]=S.useState(""),[d,f]=S.useState(!1),[h,p]=S.useState(n),u=l.trim(),m=t.some(b=>b.name.toLowerCase()===u.toLowerCase()),y=async()=>{if(!(!u||m||d)){f(!0);try{await s(u,h),a("")}finally{f(!1)}}};return c.jsxs(ui,{children:[c.jsx(ai,{value:l,onValueChange:a,placeholder:o("taskBoard.taskDialog.tagFilterPlaceholder"),className:"h-9"}),c.jsxs(di,{children:[u&&!m?c.jsx(ns,{children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{type:"color",value:h,onChange:b=>p(b.target.value),"aria-label":o("taskBoard.taskDialog.pickTagColorAriaLabel"),className:"ml-2 size-4 shrink-0 cursor-pointer appearance-none rounded-full border-0 bg-transparent p-0 [&::-moz-color-swatch]:rounded-full [&::-moz-color-swatch]:border-0 [&::-webkit-color-swatch]:rounded-full [&::-webkit-color-swatch]:border-0 [&::-webkit-color-swatch-wrapper]:p-0"}),c.jsxs(en,{value:`create-${u}`,disabled:d,onSelect:y,className:"flex-1 gap-2",children:[c.jsx(ws,{size:16,className:"text-muted-foreground"}),c.jsx("span",{className:"truncate",children:o("taskBoard.taskDialog.createTagOption",{name:u})})]})]})}):c.jsx(ci,{children:o("taskBoard.taskDialog.noTagsFound")}),c.jsx(ns,{children:t.map(b=>{const g=e.includes(b.id);return c.jsxs(en,{value:b.name,onSelect:()=>r(b.id),className:"group gap-2",children:[c.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:As(b.color)}}),c.jsx("span",{className:"flex-1 truncate",children:b.name}),c.jsx("button",{type:"button","aria-label":o("taskBoard.taskDialog.deleteTagAriaLabel",{name:b.name}),className:"flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground opacity-0 hover:bg-background hover:text-destructive group-hover:opacity-100",onClick:x=>{x.stopPropagation(),i(b.id)},children:c.jsx(Jr,{size:13})}),g&&c.jsx(Ds,{size:14,className:"shrink-0 text-foreground"})]},b.id)})})]})]})}function wp(t){if(!t)return[];const e=[],n=new Set,r=(o,l)=>{n.has(o)||(n.add(o),e.push({url:o,label:l.trim()||o}))},s=t.replace(/!\[[^\]]*\]\([^)]*\)/g,"");for(const o of s.matchAll(/\[([^\]]*)\]\((https?:\/\/[^)\s]+)[^)]*\)/g))r(o[2]??"",o[1]??"");const i=s.replace(/\[[^\]]*\]\([^)]*\)/g,"");for(const o of i.matchAll(/https?:\/\/[^\s)]+/g))r(o[0],o[0]);return e}function Sp(t){const e=U.c(40),{thread:n,me:r,onReply:s,onDelete:i,onToggleResolved:o}=t,l=oe(),[a,d]=S.useState(!1);if(n.resolved&&!a){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>d(!0),e[0]=x):x=e[0];let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(Ma,{size:16,className:"shrink-0 text-muted-foreground"}),e[1]=k):k=e[1];let v;e[2]!==l||e[3]!==n?(v=jp(n,l),e[2]=l,e[3]=n,e[4]=v):v=e[4];let w;e[5]!==v?(w=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:v}),e[5]=v,e[6]=w):w=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx($c,{size:16,className:"shrink-0 text-muted-foreground"}),e[7]=j):j=e[7];let C;return e[8]!==w?(C=c.jsxs("button",{type:"button",onClick:x,className:"flex w-full items-center gap-2.5 rounded-xl bg-card px-4 py-3 text-left card-shadow transition-colors hover:bg-muted/60",children:[k,w,j]}),e[8]=w,e[9]=C):C=e[9],C}let f;e[10]!==l||e[11]!==n.resolved?(f=n.resolved&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>d(!1),className:"flex items-center justify-between gap-2 rounded-t-xl bg-muted/40 px-4 py-2.5 text-left text-sm text-muted-foreground transition-colors hover:text-foreground",children:[l("taskBoard.taskDialog.commentCollapseThread"),c.jsx(cn,{size:14,"aria-hidden":!0})]}),c.jsx(Br,{})]}),e[10]=l,e[11]=n.resolved,e[12]=f):f=e[12];let h;e[13]!==r||e[14]!==i||e[15]!==n?(h=yo(n,r)?()=>i(n.id):void 0,e[13]=r,e[14]=i,e[15]=n,e[16]=h):h=e[16];let p;e[17]!==o||e[18]!==h||e[19]!==n?(p=c.jsx(ko,{comment:n,onDelete:h,resolved:n.resolved,onToggleResolved:o}),e[17]=o,e[18]=h,e[19]=n,e[20]=p):p=e[20];let u;if(e[21]!==r||e[22]!==i||e[23]!==n.replies){let x;e[25]!==r||e[26]!==i?(x=(k,v)=>c.jsxs(S.Fragment,{children:[c.jsx(Br,{inset:v>0}),c.jsx(ko,{comment:k,onDelete:yo(k,r)?()=>i(k.id):void 0,isReply:!0})]},k.id),e[25]=r,e[26]=i,e[27]=x):x=e[27],u=n.replies.map(x),e[21]=r,e[22]=i,e[23]=n.replies,e[24]=u}else u=e[24];let m;e[28]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Br,{}),e[28]=m):m=e[28];let y;e[29]!==l?(y=l("taskBoard.taskDialog.commentReplyPlaceholder"),e[29]=l,e[30]=y):y=e[30];let b;e[31]!==r||e[32]!==s||e[33]!==y?(b=c.jsx(fa,{variant:"reply",placeholder:y,author:r,onSubmit:s}),e[31]=r,e[32]=s,e[33]=y,e[34]=b):b=e[34];let g;return e[35]!==f||e[36]!==p||e[37]!==u||e[38]!==b?(g=c.jsxs("div",{className:"flex flex-col rounded-xl bg-card card-shadow",children:[f,p,u,m,b]}),e[35]=f,e[36]=p,e[37]=u,e[38]=b,e[39]=g):g=e[39],g}function yo(t,e){return t.author.id===e.id||t.author.isAgent===!0}const Cp=new Intl.ListFormat(void 0,{style:"long",type:"conjunction"});function jp(t,e){const n=[t,...t.replies],r=Cp.format([...new Set(n.map(s=>s.author.name))]);return n.length===1?e("taskBoard.taskDialog.commentResolvedSummaryOne",{names:r}):e("taskBoard.taskDialog.commentResolvedSummaryMany",{count:n.length,names:r})}function Tp(t){const e=U.c(6),{me:n,onSubmit:r}=t,s=oe();let i;e[0]!==s?(i=s("taskBoard.taskDialog.commentPlaceholder"),e[0]=s,e[1]=i):i=e[1];let o;return e[2]!==n||e[3]!==r||e[4]!==i?(o=c.jsx(fa,{variant:"root",placeholder:i,author:n,onSubmit:r}),e[2]=n,e[3]=r,e[4]=i,e[5]=o):o=e[5],o}function Br(t){const e=U.c(4),{inset:n}=t,r=n&&"ml-12";let s;e[0]!==r?(s=Z("h-px bg-border/50",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==s?(i=c.jsx("span",{className:s}),e[2]=s,e[3]=i):i=e[3],i}function ko(t){const e=U.c(25),{comment:n,isReply:r,resolved:s,onDelete:i,onToggleResolved:o}=t;let l;e[0]!==n.author?(l=c.jsx(ua,{author:n.author}),e[0]=n.author,e[1]=l):l=e[1];let a;e[2]!==n.author.name?(a=c.jsx("span",{className:"text-sm font-medium text-foreground",children:n.author.name}),e[2]=n.author.name,e[3]=a):a=e[3];let d;e[4]!==n.createdAt?(d=ii(new Date(n.createdAt)),e[4]=n.createdAt,e[5]=d):d=e[5];let f;e[6]!==d?(f=c.jsx("span",{className:"text-sm text-muted-foreground",children:d}),e[6]=d,e[7]=f):f=e[7];let h;e[8]!==i||e[9]!==o||e[10]!==s?(h=(i||o)&&c.jsx(Np,{resolved:s,onDelete:i,onToggleResolved:o}),e[8]=i,e[9]=o,e[10]=s,e[11]=h):h=e[11];let p;e[12]!==l||e[13]!==a||e[14]!==f||e[15]!==h?(p=c.jsxs("div",{className:"flex items-center gap-2",children:[l,a,f,h]}),e[12]=l,e[13]=a,e[14]=f,e[15]=h,e[16]=p):p=e[16];const u=r&&"pl-8";let m;e[17]!==u?(m=Z("whitespace-pre-wrap text-[15px] leading-relaxed text-foreground",u),e[17]=u,e[18]=m):m=e[18];let y;e[19]!==n.body||e[20]!==m?(y=c.jsx("div",{className:m,children:n.body}),e[19]=n.body,e[20]=m,e[21]=y):y=e[21];let b;return e[22]!==p||e[23]!==y?(b=c.jsxs("div",{className:"group flex flex-col gap-1.5 p-4",children:[p,y]}),e[22]=p,e[23]=y,e[24]=b):b=e[24],b}function Np(t){const e=U.c(18),{resolved:n,onDelete:r,onToggleResolved:s}=t,i=oe();let o;e[0]!==i?(o=i("taskBoard.taskDialog.commentActionsAriaLabel"),e[0]=i,e[1]=o):o=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(ei,{size:16}),e[2]=l):l=e[2];let a;e[3]!==o?(a=c.jsx(dn,{asChild:!0,children:c.jsx("button",{type:"button","aria-label":o,className:"ml-auto flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-colors hover:bg-muted hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100",children:l})}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==s||e[6]!==n||e[7]!==i?(d=s&&c.jsxs(c.Fragment,{children:[c.jsxs(Ct,{onSelect:s,children:[c.jsx(Ds,{size:16}),i(n?"taskBoard.taskDialog.commentUnresolveThread":"taskBoard.taskDialog.commentResolveThread")]}),c.jsx(qo,{})]}),e[5]=s,e[6]=n,e[7]=i,e[8]=d):d=e[8];let f;e[9]!==r||e[10]!==i?(f=r&&c.jsxs(Ct,{variant:"destructive",onSelect:r,children:[c.jsx(Jr,{size:16}),i("taskBoard.taskDialog.commentDelete")]}),e[9]=r,e[10]=i,e[11]=f):f=e[11];let h;e[12]!==d||e[13]!==f?(h=c.jsxs(un,{align:"end",className:"w-48",children:[d,f]}),e[12]=d,e[13]=f,e[14]=h):h=e[14];let p;return e[15]!==a||e[16]!==h?(p=c.jsxs(fn,{children:[a,h]}),e[15]=a,e[16]=h,e[17]=p):p=e[17],p}function ua(t){const e=U.c(6),{author:n}=t;if(n.isAgent){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(Pt,{size:24}),e[0]=o):o=e[0],o}const r=n.image??void 0;let s;e[1]!==n.name?(s=_t(n.name),e[1]=n.name,e[2]=s):s=e[2];let i;return e[3]!==r||e[4]!==s?(i=c.jsx(At,{url:r,fallback:s,shape:"circle",size:"xs"}),e[3]=r,e[4]=s,e[5]=i):i=e[5],i}function fa(t){const e=U.c(36),{variant:n,placeholder:r,author:s,onSubmit:i}=t,o=oe(),l=S.useRef(null),[a,d]=S.useState("");let f;e[0]!==i||e[1]!==a?(f=()=>{const _=a.trim();if(!_)return;i(_),d("");const z=l.current;z&&(z.value="",vo(z))},e[0]=i,e[1]=a,e[2]=f):f=e[2];const h=f;let p;e[3]!==h?(p=_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),h())},e[3]=h,e[4]=p):p=e[4];const u=p;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=_=>{d(_.currentTarget.value),vo(_.currentTarget)},e[5]=m):m=e[5];const y=n==="root"&&"min-h-10";let b;e[6]!==y?(b=Z("w-full resize-none overflow-hidden border-0 bg-transparent text-[15px] leading-relaxed text-foreground outline-none placeholder:text-muted-foreground",y),e[6]=y,e[7]=b):b=e[7];let g;e[8]!==u||e[9]!==r||e[10]!==b||e[11]!==a?(g=c.jsx("textarea",{ref:l,value:a,onChange:m,onKeyDown:u,placeholder:r,rows:1,className:b}),e[8]=u,e[9]=r,e[10]=b,e[11]=a,e[12]=g):g=e[12];const x=g;let k;e[13]!==a?(k=a.trim(),e[13]=a,e[14]=k):k=e[14];const v=!k;let w;e[15]!==o?(w=o("taskBoard.taskDialog.commentSubmitAriaLabel"),e[15]=o,e[16]=w):w=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(Oc,{size:16}),e[17]=j):j=e[17];let C;e[18]!==h||e[19]!==v||e[20]!==w?(C=c.jsx("button",{type:"button",disabled:v,onClick:h,"aria-label":w,className:"flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-40",children:j}),e[18]=h,e[19]=v,e[20]=w,e[21]=C):C=e[21];const T=C;let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=()=>l.current?.focus(),e[22]=D):D=e[22];const E=D;if(n==="root"){let _;e[23]!==T?(_=c.jsx("div",{className:"flex items-center justify-end",children:T}),e[23]=T,e[24]=_):_=e[24];let z;return e[25]!==_||e[26]!==x?(z=c.jsxs("div",{"data-testid":"new-comment-composer",onClick:E,className:"relative flex cursor-text flex-col gap-1 rounded-xl bg-card p-3 card-shadow",children:[x,_]}),e[25]=_,e[26]=x,e[27]=z):z=e[27],z}let N;e[28]!==s?(N=c.jsx("span",{className:"mt-0.5 shrink-0",children:c.jsx(ua,{author:s})}),e[28]=s,e[29]=N):N=e[29];let I;e[30]!==x?(I=c.jsx("div",{className:"min-w-0 flex-1 pt-0.5",children:x}),e[30]=x,e[31]=I):I=e[31];let A;return e[32]!==T||e[33]!==N||e[34]!==I?(A=c.jsxs("div",{"data-testid":"reply-composer",onClick:E,className:"relative flex cursor-text items-start gap-2 p-3",children:[N,I,T]}),e[32]=T,e[33]=N,e[34]=I,e[35]=A):A=e[35],A}function vo(t){t.style.height="auto",t.style.height=`${t.scrollHeight}px`}function Dp(t){const e=t.filter(r=>!r.parentId).map(r=>({...r,replies:[]})),n=new Map(e.map(r=>[r.id,r]));for(const r of t)r.parentId&&n.get(r.parentId)?.replies.push(r);return e}function Rp(t){const e=U.c(36),{locator:n}=Me(),r=gn(),s=pn();let i;e[0]!==t||e[1]!==n?(i=xe.taskBoardComments(n,t??""),e[0]=t,e[1]=n,e[2]=i):i=e[2];const o=i,l=!!t;let a;e[3]!==t||e[4]!==r?(a=async()=>Dp((await r.call("TASK_BOARD_COMMENT_LIST",{taskBoardItemId:t})).comments),e[3]=t,e[4]=r,e[5]=a):a=e[5];let d;e[6]!==o||e[7]!==l||e[8]!==a?(d={queryKey:o,enabled:l,queryFn:a},e[6]=o,e[7]=l,e[8]=a,e[9]=d):d=e[9];const f=Ze(d);let h;e[10]!==s||e[11]!==o?(h=()=>s.invalidateQueries({queryKey:o}),e[10]=s,e[11]=o,e[12]=h):h=e[12];const p=h;let u;e[13]!==t||e[14]!==r?(u=T=>r.call("TASK_BOARD_COMMENT_CREATE",{taskBoardItemId:t,...T}),e[13]=t,e[14]=r,e[15]=u):u=e[15];let m;e[16]!==p||e[17]!==u?(m={mutationFn:u,onSuccess:p},e[16]=p,e[17]=u,e[18]=m):m=e[18];const y=Ye(m);let b;e[19]!==r?(b=T=>r.call("TASK_BOARD_COMMENT_UPDATE",T),e[19]=r,e[20]=b):b=e[20];let g;e[21]!==p||e[22]!==b?(g={mutationFn:b,onSuccess:p},e[21]=p,e[22]=b,e[23]=g):g=e[23];const x=Ye(g);let k;e[24]!==r?(k=T=>r.call("TASK_BOARD_COMMENT_DELETE",{id:T}),e[24]=r,e[25]=k):k=e[25];let v;e[26]!==p||e[27]!==k?(v={mutationFn:k,onSuccess:p},e[26]=p,e[27]=k,e[28]=v):v=e[28];const w=Ye(v);let j;e[29]!==f.data?(j=f.data??[],e[29]=f.data,e[30]=j):j=e[30];let C;return e[31]!==y||e[32]!==w||e[33]!==x||e[34]!==j?(C={threads:j,post:y,setResolved:x,remove:w},e[31]=y,e[32]=w,e[33]=x,e[34]=j,e[35]=C):C=e[35],C}function Gr(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function Xr(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const ha=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),Qn="inline-flex h-9 items-center justify-start gap-2 rounded-lg border border-border px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted sm:border-transparent";function Ep(t){const e=U.c(305),{open:n,onClose:r,item:s,defaultStatus:i,onSubmit:o,onDelete:l,onOpenThread:a,onNewChat:d,onAutoFix:f,onRerun:h,isSaving:p}=t,u=oe(),{data:m}=Wo();let y;e[0]!==m?.data?.members?(y=m?.data?.members??[],e[0]=m?.data?.members,e[1]=y):y=e[1];const b=y,{handleCopy:g,copied:x}=Ic(),{data:k}=Qo();let v;e[2]!==k?(v=k===void 0?[]:k,e[2]=k,e[3]=v):v=e[3];const w=v,j=ac(),C=cc(),[T,D]=S.useState(s?.title??""),[E,N]=S.useState(s?.description??""),[I,A]=S.useState(s?.status??i??"triage"),[_,z]=S.useState(s?.priority??"medium"),[R,O]=S.useState(s?.assigneeId??null),L=s?.dueDate;let B;e[4]!==L?(B=Xr(L),e[4]=L,e[5]=B):B=e[5];const[F,$]=S.useState(B);let W;e[6]!==s?.tags?(W=s?.tags.map(Op)??[],e[6]=s?.tags,e[7]=W):W=e[7];const[K,Q]=S.useState(W),[G,Y]=S.useState(!1),[ee,se]=S.useState(!1),[re,q]=S.useState(!1);let V;e[8]!==i||e[9]!==s?.assigneeId||e[10]!==s?.description||e[11]!==s?.dueDate||e[12]!==s?.priority||e[13]!==s?.status||e[14]!==s?.tags||e[15]!==s?.title?(V=()=>{D(s?.title??""),N(s?.description??""),A(s?.status??i??"triage"),z(s?.priority??"medium"),O(s?.assigneeId??null),$(Xr(s?.dueDate)),Q(s?.tags.map(Bp)??[])},e[8]=i,e[9]=s?.assigneeId,e[10]=s?.description,e[11]=s?.dueDate,e[12]=s?.priority,e[13]=s?.status,e[14]=s?.tags,e[15]=s?.title,e[16]=V):V=e[16];const J=V;let ie;e[17]!==r||e[18]!==J?(ie=()=>{r(),J()},e[17]=r,e[18]=J,e[19]=ie):ie=e[19];const te=ie;let P;e[20]!==j?(P=async(X,je)=>{const Ke=await j.mutateAsync({name:X,color:je});Q(Dt=>[...Dt,Ke.id])},e[20]=j,e[21]=P):P=e[21];const H=P;let le;e[22]!==C?(le=X=>{C.mutate(X),Q(je=>je.filter(Ke=>Ke!==X))},e[22]=C,e[23]=le):le=e[23];const ge=le;let ke;e[24]!==R||e[25]!==E||e[26]!==F||e[27]!==o||e[28]!==_||e[29]!==I||e[30]!==K||e[31]!==T?(ke=()=>{const X=T.trim();X&&o({title:X,description:E.trim()||null,status:I,priority:_,assigneeId:R,dueDate:F?Gr(F):null,tagIds:K})},e[24]=R,e[25]=E,e[26]=F,e[27]=o,e[28]=_,e[29]=I,e[30]=K,e[31]=T,e[32]=ke):ke=e[32];const ye=ke,Ne=R===$e,Be=s&&f&&(I==="triage"||I==="todo")&&!Ne,et=s&&h&&s.assigneeId===$e;let dt;if(e[33]!==R||e[34]!==E||e[35]!==F||e[36]!==s||e[37]!==_||e[38]!==I||e[39]!==K||e[40]!==T){const X=s?.tags.map(Ap)??[];dt=!s||T.trim()!==s.title||(E.trim()||null)!==s.description||I!==s.status||_!==s.priority||R!==(s.assigneeId??null)||(F?Gr(F):null)!==(s.dueDate??null)||K.length!==X.length||!K.every(je=>X.includes(je)),e[33]=R,e[34]=E,e[35]=F,e[36]=s,e[37]=_,e[38]=I,e[39]=K,e[40]=T,e[41]=dt}else dt=e[41];const Gt=dt;let ot;if(e[42]!==R||e[43]!==b){let X;e[45]!==R?(X=je=>je.userId===R,e[45]=R,e[46]=X):X=e[46],ot=b.find(X),e[42]=R,e[43]=b,e[44]=ot}else ot=e[44];const ue=ot;let Qe;e[47]!==s||e[48]!==b?(Qe=s?.assignedBy?b.find(X=>X.userId===s.assignedBy):void 0,e[47]=s,e[48]=b,e[49]=Qe):Qe=e[49];const ze=Qe,Xt=Et[I].icon;let Le,de,De,ut,he,Bt,tt,We,nt,st,Tt,pe,ve,we,Fe,Re,Se,Ce,Oe,me,Ee;if(e[50]!==te||e[51]!==s||e[52]!==n||e[53]!==u||e[54]!==T){De=!!s&&Vo(s),de=Jn,me=n,e[76]!==te?(Ee=Dt=>!Dt&&te(),e[76]=te,e[77]=Ee):Ee=e[77],Le=es,Re="flex max-h-[92vh] flex-col gap-0 overflow-hidden rounded-2xl p-0 sm:h-[90vh] sm:max-h-[820px] sm:max-w-[1040px]",Se="hidden";let X;e[78]!==s||e[79]!==u?(X=u(s?"taskBoard.taskDialog.editTaskTitle":"taskBoard.taskDialog.newTaskTitle"),e[78]=s,e[79]=u,e[80]=X):X=e[80],e[81]!==X?(Ce=c.jsx(ts,{className:"sr-only",children:X}),e[81]=X,e[82]=Ce):Ce=e[82];let je;e[83]!==u?(je=u("taskBoard.taskDialog.closeAriaLabel"),e[83]=u,e[84]=je):je=e[84];let Ke;e[85]===Symbol.for("react.memo_cache_sentinel")?(Ke=c.jsx(cn,{size:16}),e[85]=Ke):Ke=e[85],e[86]!==te||e[87]!==je?(Oe=c.jsx("button",{type:"button","aria-label":je,onClick:te,className:"absolute right-2.5 top-2.5 z-10 flex size-10 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:Ke}),e[86]=te,e[87]=je,e[88]=Oe):Oe=e[88],Fe="flex min-h-0 flex-1 flex-col overflow-y-auto sm:flex-row sm:overflow-hidden",we="flex min-w-0 flex-col sm:flex-1 sm:overflow-y-auto",ve="sticky top-0 z-10 bg-background p-6 pb-0 sm:p-8 sm:pb-0",ut=_p,he=T,Bt=Dt=>{De||(D(Dt.target.value),Dt.target.style.height="auto",Dt.target.style.height=`${Dt.target.scrollHeight}px`)},tt=Ip,e[89]!==u?(We=u("taskBoard.taskDialog.taskTitlePlaceholder"),e[89]=u,e[90]=We):We=e[90],nt=!0,st=1,Tt=De,pe=Z("w-full resize-none overflow-hidden border-0 bg-transparent text-xl font-medium leading-snug text-foreground outline-none placeholder:text-foreground/30",De&&"cursor-default"),e[50]=te,e[51]=s,e[52]=n,e[53]=u,e[54]=T,e[55]=Le,e[56]=de,e[57]=De,e[58]=ut,e[59]=he,e[60]=Bt,e[61]=tt,e[62]=We,e[63]=nt,e[64]=st,e[65]=Tt,e[66]=pe,e[67]=ve,e[68]=we,e[69]=Fe,e[70]=Re,e[71]=Se,e[72]=Ce,e[73]=Oe,e[74]=me,e[75]=Ee}else Le=e[55],de=e[56],De=e[57],ut=e[58],he=e[59],Bt=e[60],tt=e[61],We=e[62],nt=e[63],st=e[64],Tt=e[65],pe=e[66],ve=e[67],we=e[68],Fe=e[69],Re=e[70],Se=e[71],Ce=e[72],Oe=e[73],me=e[74],Ee=e[75];let Ie;e[91]!==ut||e[92]!==he||e[93]!==Bt||e[94]!==tt||e[95]!==We||e[96]!==nt||e[97]!==st||e[98]!==Tt||e[99]!==pe?(Ie=c.jsx("textarea",{ref:ut,value:he,onChange:Bt,onKeyDown:tt,placeholder:We,autoFocus:nt,rows:st,readOnly:Tt,className:pe}),e[91]=ut,e[92]=he,e[93]=Bt,e[94]=tt,e[95]=We,e[96]=nt,e[97]=st,e[98]=Tt,e[99]=pe,e[100]=Ie):Ie=e[100];let _e;e[101]!==De||e[102]!==u?(_e=De&&c.jsxs("p",{className:"mb-3 mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(Ta,{size:12}),u("taskBoard.taskDialog.reportsContentLocked")]}),e[101]=De,e[102]=u,e[103]=_e):_e=e[103];let Ue;e[104]!==ve||e[105]!==Ie||e[106]!==_e?(Ue=c.jsxs("div",{className:ve,children:[Ie,_e]}),e[104]=ve,e[105]=Ie,e[106]=_e,e[107]=Ue):Ue=e[107];let qe;e[108]!==u?(qe=u("taskBoard.taskDialog.descriptionPlaceholder"),e[108]=u,e[109]=qe):qe=e[109];const Ge=!De;let Xe;e[110]!==E||e[111]!==qe||e[112]!==Ge?(Xe=c.jsx(gp,{defaultValue:E,onChange:N,placeholder:qe,editable:Ge}),e[110]=E,e[111]=qe,e[112]=Ge,e[113]=Xe):Xe=e[113];let lt;e[114]!==x||e[115]!==E||e[116]!==g||e[117]!==u?(lt=E&&c.jsx(Ae,{type:"button",variant:"ghost",size:"icon","aria-label":u("taskBoard.taskDialog.copyDescriptionAriaLabel"),className:"absolute right-0 top-0 size-7 rounded-md border border-border bg-card text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground group-hover:opacity-100",onClick:()=>g(E),children:x?c.jsx(Ds,{size:14}):c.jsx(_c,{size:14})}),e[114]=x,e[115]=E,e[116]=g,e[117]=u,e[118]=lt):lt=e[118];let qt;e[119]!==Xe||e[120]!==lt?(qt=c.jsxs("div",{className:"group relative flex flex-col",children:[Xe,lt]}),e[119]=Xe,e[120]=lt,e[121]=qt):qt=e[121];let Kt;e[122]!==s?(Kt=s&&c.jsx("hr",{className:"border-border"}),e[122]=s,e[123]=Kt):Kt=e[123];let ft;e[124]!==E||e[125]!==s||e[126]!==a?(ft=s?.id&&c.jsx(Hp,{item:s,description:E,onOpenThread:a}),e[124]=E,e[125]=s,e[126]=a,e[127]=ft):ft=e[127];let ht;e[128]!==ze||e[129]!==ue||e[130]!==s||e[131]!==b||e[132]!==a?(ht=s&&c.jsx(Qp,{item:s,members:b,startedBy:ze??ue,onOpenThread:a}),e[128]=ze,e[129]=ue,e[130]=s,e[131]=b,e[132]=a,e[133]=ht):ht=e[133];let pt;e[134]!==qt||e[135]!==Kt||e[136]!==ft||e[137]!==ht?(pt=c.jsxs("div",{className:"flex flex-col gap-6 p-6 pt-6 sm:p-8 sm:pt-6",children:[qt,Kt,ft,ht]}),e[134]=qt,e[135]=Kt,e[136]=ft,e[137]=ht,e[138]=pt):pt=e[138];let gt;e[139]!==we||e[140]!==Ue||e[141]!==pt?(gt=c.jsxs("div",{className:we,children:[Ue,pt]}),e[139]=we,e[140]=Ue,e[141]=pt,e[142]=gt):gt=e[142];let mt;e[143]!==u?(mt=u("taskBoard.taskDialog.propertiesLabel"),e[143]=u,e[144]=mt):mt=e[144];let xt;e[145]!==mt?(xt=c.jsx("span",{className:"hidden px-3 text-sm text-muted-foreground sm:block",children:mt}),e[145]=mt,e[146]=xt):xt=e[146];let bt;e[147]!==s||e[148]!==I?(bt=Z(s?wi({...s,status:I}):Et[I].iconClassName),e[147]=s,e[148]=I,e[149]=bt):bt=e[149];let Ot;e[150]!==Xt||e[151]!==bt?(Ot=c.jsx(Xt,{size:16,className:bt}),e[150]=Xt,e[151]=bt,e[152]=Ot):Ot=e[152];const Ht=Et[I];let yt;e[153]!==u||e[154]!==Ht.labelKey?(yt=u(Ht.labelKey),e[153]=u,e[154]=Ht.labelKey,e[155]=yt):yt=e[155];let $t;e[156]!==Ot||e[157]!==yt?($t=c.jsx(dn,{asChild:!0,children:c.jsxs("button",{type:"button",className:Qn,children:[Ot,yt]})}),e[156]=Ot,e[157]=yt,e[158]=$t):$t=e[158];let kt;e[159]!==u?(kt=ir.map(X=>{const je=Et[X].icon;return c.jsxs(Ct,{onSelect:()=>A(X),className:"gap-2",children:[c.jsx(je,{size:16,className:Et[X].iconClassName}),u(Et[X].labelKey)]},X)}),e[159]=u,e[160]=kt):kt=e[160];let Mt;e[161]!==kt?(Mt=c.jsx(un,{align:"start",className:"w-44",children:kt}),e[161]=kt,e[162]=Mt):Mt=e[162];let vt;e[163]!==$t||e[164]!==Mt?(vt=c.jsxs(fn,{children:[$t,Mt]}),e[163]=$t,e[164]=Mt,e[165]=vt):vt=e[165];let wt;e[166]!==De||e[167]!==u?(wt=De?u("taskBoard.taskDialog.reportsContentLocked"):void 0,e[166]=De,e[167]=u,e[168]=wt):wt=e[168];const tn=_==="none"&&"text-muted-foreground",M=De&&"cursor-default opacity-60";let ne;e[169]!==tn||e[170]!==M?(ne=Z(Qn,tn,M),e[169]=tn,e[170]=M,e[171]=ne):ne=e[171];let fe;e[172]!==_||e[173]!==u?(fe=_==="none"?c.jsxs(c.Fragment,{children:[c.jsx(ei,{size:16}),u("taskBoard.taskDialog.setPriorityButton")]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:Z("size-2 rounded-full",It[_].dotClassName)}),u(It[_].labelKey)]}),e[172]=_,e[173]=u,e[174]=fe):fe=e[174];let Pe;e[175]!==De||e[176]!==wt||e[177]!==ne||e[178]!==fe?(Pe=c.jsx(dn,{asChild:!0,children:c.jsx("button",{type:"button",disabled:De,title:wt,className:ne,children:fe})}),e[175]=De,e[176]=wt,e[177]=ne,e[178]=fe,e[179]=Pe):Pe=e[179];let at;e[180]!==u?(at=Si.map(X=>c.jsxs(Ct,{onSelect:()=>z(X),children:[c.jsx("span",{className:Z("size-2 rounded-full",It[X].dotClassName)}),u(It[X].labelKey)]},X)),e[180]=u,e[181]=at):at=e[181];let Nt;e[182]!==at?(Nt=c.jsx(un,{align:"start",className:"w-40",children:at}),e[182]=at,e[183]=Nt):Nt=e[183];let bn;e[184]!==Pe||e[185]!==Nt?(bn=c.jsxs(fn,{children:[Pe,Nt]}),e[184]=Pe,e[185]=Nt,e[186]=bn):bn=e[186];const wr=!R&&"text-muted-foreground";let yn;e[187]!==wr?(yn=Z(Qn,wr),e[187]=wr,e[188]=yn):yn=e[188];let kn;e[189]!==ze||e[190]!==ue||e[191]!==Ne||e[192]!==u?(kn=Ne&&ze?c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"hidden items-center gap-2 sm:flex",children:[c.jsx(At,{url:ze.user?.image??void 0,fallback:_t(ze.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:ze.user?.name??u("taskBoard.taskDialog.superAgentDefaultName")})]}),c.jsxs("span",{className:"flex items-center gap-2 sm:hidden",children:[c.jsxs("span",{className:"inline-flex items-center",children:[c.jsx(At,{url:ze.user?.image??void 0,fallback:_t(ze.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),c.jsx(Pt,{size:16,className:"ring-2 ring-background"})]}),u("taskBoard.taskDialog.superAgentLabel")]})]}):Ne?c.jsxs(c.Fragment,{children:[c.jsx(Pt,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]}):ue?c.jsxs(c.Fragment,{children:[c.jsx(At,{url:ue.user?.image??void 0,fallback:_t(ue.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:ue.user?.name??u("taskBoard.taskDialog.unassignedLabel")})]}):c.jsxs(c.Fragment,{children:[c.jsx(Po,{size:16,className:"text-muted-foreground"}),u("taskBoard.taskDialog.assignButton")]}),e[189]=ze,e[190]=ue,e[191]=Ne,e[192]=u,e[193]=kn):kn=e[193];let vn;e[194]!==yn||e[195]!==kn?(vn=c.jsx(Xn,{asChild:!0,children:c.jsx("button",{type:"button",className:yn,children:kn})}),e[194]=yn,e[195]=kn,e[196]=vn):vn=e[196];let $s;e[197]===Symbol.for("react.memo_cache_sentinel")?($s=X=>{O(X),se(!1)},e[197]=$s):$s=e[197];let wn;e[198]!==b?(wn=c.jsx(xs,{align:"start",className:"w-56 p-0",children:c.jsx($i,{members:b,onSelect:$s})}),e[198]=b,e[199]=wn):wn=e[199];let Sn;e[200]!==ee||e[201]!==vn||e[202]!==wn?(Sn=c.jsxs(bs,{open:ee,onOpenChange:se,modal:!0,children:[vn,wn]}),e[200]=ee,e[201]=vn,e[202]=wn,e[203]=Sn):Sn=e[203];let Cn;e[204]!==ze||e[205]!==Ne||e[206]!==u?(Cn=Ne&&ze&&c.jsxs("div",{className:"relative mt-1.5 hidden items-center pl-5 sm:flex",children:[c.jsx("span",{className:"absolute -top-1.5 left-5 h-[calc(50%+0.375rem)] w-2.5 rounded-bl-md border-b border-l border-border"}),c.jsxs("span",{className:Z(Qn,"pointer-events-none"),children:[c.jsx(Pt,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]})]}),e[204]=ze,e[205]=Ne,e[206]=u,e[207]=Cn):Cn=e[207];let jn;e[208]!==Sn||e[209]!==Cn?(jn=c.jsxs("div",{className:"flex flex-col",children:[Sn,Cn]}),e[208]=Sn,e[209]=Cn,e[210]=jn):jn=e[210];const Sr=!F&&"text-muted-foreground";let Tn;e[211]!==Sr?(Tn=Z(Qn,Sr),e[211]=Sr,e[212]=Tn):Tn=e[212];let Ms;e[213]===Symbol.for("react.memo_cache_sentinel")?(Ms=c.jsx(Yn,{size:16,className:"text-muted-foreground"}),e[213]=Ms):Ms=e[213];let Nn;e[214]!==F||e[215]!==u?(Nn=F?ha.format(F):u("taskBoard.taskDialog.dueDateLabel"),e[214]=F,e[215]=u,e[216]=Nn):Nn=e[216];let Dn;e[217]!==F||e[218]!==u?(Dn=F&&c.jsx("span",{role:"button",tabIndex:0,"aria-label":u("taskBoard.taskDialog.clearDueDateAriaLabel"),className:"-mr-1 ml-0.5 flex size-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground",onClick:X=>{X.stopPropagation(),$(null)},onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),X.stopPropagation(),$(null))},children:c.jsx(cn,{size:12})}),e[217]=F,e[218]=u,e[219]=Dn):Dn=e[219];let Rn;e[220]!==Tn||e[221]!==Nn||e[222]!==Dn?(Rn=c.jsx(Xn,{asChild:!0,children:c.jsxs("button",{type:"button",className:Tn,children:[Ms,Nn,Dn]})}),e[220]=Tn,e[221]=Nn,e[222]=Dn,e[223]=Rn):Rn=e[223];const Cr=F??void 0;let zs;e[224]===Symbol.for("react.memo_cache_sentinel")?(zs=X=>{$(X??null),X&&Y(!1)},e[224]=zs):zs=e[224];let En;e[225]!==Cr?(En=c.jsx(xs,{className:"w-auto p-0",align:"start",children:c.jsx(nl,{mode:"single",selected:Cr,onSelect:zs,initialFocus:!0})}),e[225]=Cr,e[226]=En):En=e[226];let In;e[227]!==G||e[228]!==Rn||e[229]!==En?(In=c.jsxs(bs,{open:G,onOpenChange:Y,children:[Rn,En]}),e[227]=G,e[228]=Rn,e[229]=En,e[230]=In):In=e[230];let _n;e[231]!==w||e[232]!==u||e[233]!==K?(_n=K.length===0?c.jsx(Xn,{asChild:!0,children:c.jsxs("button",{type:"button",className:Z(Qn,"text-muted-foreground"),children:[c.jsx(za,{size:16}),u("taskBoard.taskDialog.tagsButton")]})}):c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:px-3",children:[K.map(X=>{const je=w.find(Ke=>Ke.id===X);return je?c.jsxs("button",{type:"button",onClick:()=>q(!0),className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-sm font-medium text-foreground transition-colors hover:bg-muted",children:[c.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:As(je.color)}}),c.jsx("span",{className:"truncate",children:je.name}),c.jsx("span",{role:"button",tabIndex:0,"aria-label":u("taskBoard.taskDialog.removeTagAriaLabel",{name:je.name}),className:"-mr-0.5 flex size-3.5 items-center justify-center rounded-sm text-muted-foreground hover:bg-background hover:text-foreground",onClick:Ke=>{Ke.stopPropagation(),Q(Dt=>Dt.filter(jr=>jr!==X))},onKeyDown:Ke=>{(Ke.key==="Enter"||Ke.key===" ")&&(Ke.preventDefault(),Ke.stopPropagation(),Q(Dt=>Dt.filter(jr=>jr!==X)))},children:c.jsx(cn,{size:10})})]},X):null}),c.jsx(Xn,{asChild:!0,children:c.jsx("button",{type:"button","aria-label":u("taskBoard.taskDialog.addTagButton"),className:"flex size-7 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:c.jsx(ws,{size:14})})})]}),e[231]=w,e[232]=u,e[233]=K,e[234]=_n):_n=e[234];let An;e[235]!==w.length?(An=Df(w.length),e[235]=w.length,e[236]=An):An=e[236];let Ls;e[237]===Symbol.for("react.memo_cache_sentinel")?(Ls=X=>Q(je=>je.includes(X)?je.filter(Ke=>Ke!==X):[...je,X]),e[237]=Ls):Ls=e[237];let Bn;e[238]!==H||e[239]!==ge||e[240]!==w||e[241]!==An||e[242]!==K?(Bn=c.jsx(xs,{align:"start",className:"w-56 p-0",children:c.jsx(vp,{tags:w,selectedIds:K,defaultColor:An,onToggle:Ls,onCreate:H,onDelete:ge})}),e[238]=H,e[239]=ge,e[240]=w,e[241]=An,e[242]=K,e[243]=Bn):Bn=e[243];let On;e[244]!==_n||e[245]!==Bn||e[246]!==re?(On=c.jsxs(bs,{open:re,onOpenChange:q,modal:!0,children:[_n,Bn]}),e[244]=_n,e[245]=Bn,e[246]=re,e[247]=On):On=e[247];let $n;e[248]!==vt||e[249]!==bn||e[250]!==jn||e[251]!==In||e[252]!==On?($n=c.jsxs("div",{className:"flex flex-wrap gap-2 sm:flex-col",children:[vt,bn,jn,In,On]}),e[248]=vt,e[249]=bn,e[250]=jn,e[251]=In,e[252]=On,e[253]=$n):$n=e[253];let Mn;e[254]!==xt||e[255]!==$n?(Mn=c.jsxs("div",{className:"flex w-full shrink-0 flex-col gap-4 border-t border-border p-6 sm:w-[220px] sm:border-t-0 sm:border-l sm:px-6 sm:py-10",children:[xt,$n]}),e[254]=xt,e[255]=$n,e[256]=Mn):Mn=e[256];let zn;e[257]!==Fe||e[258]!==gt||e[259]!==Mn?(zn=c.jsxs("div",{className:Fe,children:[gt,Mn]}),e[257]=Fe,e[258]=gt,e[259]=Mn,e[260]=zn):zn=e[260];let Ln;e[261]!==s||e[262]!==l||e[263]!==u?(Ln=s&&l?c.jsx(Ae,{variant:"ghost",size:"icon","aria-label":u("taskBoard.taskDialog.deleteTaskAriaLabel"),className:"size-10 text-muted-foreground hover:text-destructive",onClick:l,children:c.jsx(Jr,{size:16})}):c.jsx("span",{}),e[261]=s,e[262]=l,e[263]=u,e[264]=Ln):Ln=e[264];let Pn;e[265]!==s||e[266]!==d||e[267]!==u?(Pn=s&&d&&c.jsxs(Ae,{variant:"outline",size:"sm",onClick:d,children:[c.jsx(Fo,{size:16}),u("taskBoard.taskDialog.newChatButton")]}),e[265]=s,e[266]=d,e[267]=u,e[268]=Pn):Pn=e[268];let Fn;e[269]!==f||e[270]!==Be||e[271]!==u?(Fn=Be&&c.jsxs(Ae,{variant:"outline",size:"sm",onClick:f,children:[c.jsx(ur,{size:16}),u("taskBoard.taskBoard.autoFix")]}),e[269]=f,e[270]=Be,e[271]=u,e[272]=Fn):Fn=e[272];let Un;e[273]!==h||e[274]!==et||e[275]!==u?(Un=et&&c.jsxs(Ae,{variant:"outline",size:"sm",onClick:h,children:[c.jsx(Zr,{size:16}),u("taskBoard.taskBoard.rerun")]}),e[273]=h,e[274]=et,e[275]=u,e[276]=Un):Un=e[276];let qn;e[277]!==Gt||e[278]!==p||e[279]!==s||e[280]!==ye||e[281]!==u||e[282]!==T?(qn=Gt&&c.jsxs(Ae,{size:"sm",disabled:!T.trim()||p,onClick:ye,children:[s?null:c.jsx(ws,{size:16}),u(s?"taskBoard.taskDialog.saveButton":"taskBoard.taskDialog.createTaskButton")]}),e[277]=Gt,e[278]=p,e[279]=s,e[280]=ye,e[281]=u,e[282]=T,e[283]=qn):qn=e[283];let Kn;e[284]!==Pn||e[285]!==Fn||e[286]!==Un||e[287]!==qn?(Kn=c.jsxs("div",{className:"flex items-center gap-2",children:[Pn,Fn,Un,qn]}),e[284]=Pn,e[285]=Fn,e[286]=Un,e[287]=qn,e[288]=Kn):Kn=e[288];let Hn;e[289]!==Ln||e[290]!==Kn?(Hn=c.jsxs("div",{className:"flex h-16 items-center justify-between border-t border-border px-4",children:[Ln,Kn]}),e[289]=Ln,e[290]=Kn,e[291]=Hn):Hn=e[291];let Wn;e[292]!==Le||e[293]!==Re||e[294]!==Se||e[295]!==Ce||e[296]!==Oe||e[297]!==zn||e[298]!==Hn?(Wn=c.jsxs(Le,{className:Re,closeButtonClassName:Se,children:[Ce,Oe,zn,Hn]}),e[292]=Le,e[293]=Re,e[294]=Se,e[295]=Ce,e[296]=Oe,e[297]=zn,e[298]=Hn,e[299]=Wn):Wn=e[299];let Ps;return e[300]!==de||e[301]!==me||e[302]!==Ee||e[303]!==Wn?(Ps=c.jsx(de,{open:me,onOpenChange:Ee,children:Wn}),e[300]=de,e[301]=me,e[302]=Ee,e[303]=Wn,e[304]=Ps):Ps=e[304],Ps}function Ip(t){t.key==="Enter"&&t.preventDefault()}function _p(t){t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}function Ap(t){return t.id}function Bp(t){return t.id}function Op(t){return t.id}function $p(t,e){switch(t){case"failed":return{label:e("taskBoard.taskDialog.threadStatusError"),className:"text-destructive",icon:Pa};case"requires_action":return{label:e("taskBoard.taskDialog.threadStatusNeedsInput"),className:"text-warning",icon:ti};case"in_progress":return{label:e("taskBoard.taskDialog.threadStatusRunning"),className:"text-primary",icon:Ns,spin:!0};case"completed":return{label:e("taskBoard.taskDialog.threadStatusCompleted"),className:"text-success",icon:mn};case"expired":return{label:e("taskBoard.taskDialog.threadStatusExpired"),className:"text-muted-foreground",icon:fr};default:return t}}function Mp(t){const e=U.c(31),{thread:n,startedBy:r,onOpen:s}=t,i=oe();let o;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){const l=n.status?$p(n.status,i):null,a=n.lastMessage;let d;e[5]!==n.title?(d=Li(n.title,"qa"),e[5]=n.title,e[6]=d):d=e[6];const f=d;let h;e[7]!==n.title?(h=Li(n.title,"code_review"),e[7]=n.title,e[8]=h):h=e[8];const p=h;let u;e[9]!==s||e[10]!==n?(u=()=>s?.(n),e[9]=s,e[10]=n,e[11]=u):u=e[11];let m;e[12]!==p||e[13]!==f?(m=f?c.jsx(Pl,{size:16,className:"shrink-0"}):p?c.jsx(Fl,{size:16,className:"shrink-0"}):c.jsx(Pt,{size:16,className:"shrink-0"}),e[12]=p,e[13]=f,e[14]=m):m=e[14];let y;e[15]!==i||e[16]!==n.title?(y=n.title||i("taskBoard.taskDialog.superAgentDefaultName"),e[15]=i,e[16]=n.title,e[17]=y):y=e[17];let b;e[18]!==y?(b=c.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:y}),e[18]=y,e[19]=b):b=e[19];let g;e[20]!==r||e[21]!==i?(g=r&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"shrink-0 text-sm text-muted-foreground/50",children:i("taskBoard.taskDialog.startedByLabel")}),c.jsx(At,{url:r.user?.image??void 0,fallback:_t(r.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate text-sm text-foreground",children:r.user?.name??i("taskBoard.taskDialog.someoneLabel")})]}),e[20]=r,e[21]=i,e[22]=g):g=e[22];let x;e[23]!==s||e[24]!==i?(x=s&&c.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1 text-xs text-muted-foreground/60 group-hover:text-foreground",children:[i("taskBoard.taskDialog.openThreadHint"),c.jsx(sl,{size:14})]}),e[23]=s,e[24]=i,e[25]=x):x=e[25];let k;e[26]!==m||e[27]!==b||e[28]!==g||e[29]!==x?(k=c.jsxs("div",{className:"flex items-center gap-2",children:[m,b,g,x]}),e[26]=m,e[27]=b,e[28]=g,e[29]=x,e[30]=k):k=e[30],o=c.jsxs("button",{type:"button",disabled:!s,onClick:u,className:"group flex w-full flex-col gap-2 rounded-xl bg-card p-4 text-left card-shadow transition-colors enabled:hover:bg-muted/60 disabled:cursor-default",children:[k,l&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:Z("flex shrink-0 items-center gap-1.5",l.className),children:[c.jsx(l.icon,{size:15,className:Z(l.spin&&"animate-spin")}),c.jsx("span",{className:"text-sm",children:l.label})]}),a&&c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:a})]})]}),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=o}else o=e[4];return o}function zp(t,e){return t.merged?{label:e("taskBoard.taskDialog.prStateMerged"),className:"text-special",icon:La}:t.state==="closed"?{label:e("taskBoard.taskDialog.prStateClosed"),className:"text-destructive",icon:Tr}:t.draft?{label:e("taskBoard.taskDialog.prStateDraft"),className:"text-muted-foreground",icon:Tr}:{label:e("taskBoard.taskDialog.prStateOpen"),className:"text-success",icon:Tr}}function Lp(t,e){switch(t){case"passing":return{label:e("taskBoard.taskDialog.prChecksPassing"),className:"text-success",icon:mn};case"failing":return{label:e("taskBoard.taskDialog.prChecksFailing"),className:"text-destructive",icon:fr};case"pending":return{label:e("taskBoard.taskDialog.prChecksPending"),className:"text-warning",icon:Ns};default:return null}}const Pp=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);function Fp(t){if(t.status!=="completed")return{icon:Ns,className:"text-warning",spin:!0};const e=t.conclusion;return e&&Pp.has(e)?{icon:fr,className:"text-destructive",spin:!1}:e==="success"||e==="neutral"||e==="skipped"?{icon:mn,className:"text-success",spin:!1}:{icon:ti,className:"text-muted-foreground",spin:!1}}function Up(t){const e=U.c(37),{pr:n,previewThread:r,reviewsReady:s,shipPending:i,onShip:o,onOpenThread:l}=t,a=oe(),[d,f]=S.useState(!1);let h;if(e[0]!==d||e[1]!==l||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==a){const p=zp(n,a),u=Lp(n.checksStatus,a),m=n.state==="open"&&!n.merged,y=n.checksStatus!=="failing"&&n.checksStatus!=="pending",b=s&&m&&y,g=!!r||!!n.previewUrl||b;let x;e[9]!==n.checks?(x=n.checks??[],e[9]=n.checks,e[10]=x):x=e[10];const k=x,v=k.length>0||u!=null,w=k.length>0;let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx($r,{className:"size-4 shrink-0 text-foreground"}),e[11]=j):j=e[11];const C=n.title??`${n.repoOwner}/${n.repoName}`;let T;e[12]!==C?(T=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:C}),e[12]=C,e[13]=T):T=e[13];const D=Z("flex shrink-0 items-center gap-1 text-xs font-medium",p.className);let E;e[14]!==p?(E=c.jsx(p.icon,{size:13}),e[14]=p,e[15]=E):E=e[15];let N;e[16]!==p||e[17]!==D||e[18]!==E?(N=c.jsxs("span",{className:D,children:[E,p.label]}),e[16]=p,e[17]=D,e[18]=E,e[19]=N):N=e[19];let I;e[20]===Symbol.for("react.memo_cache_sentinel")?(I=c.jsx(Gs,{size:12,className:"text-muted-foreground/60 group-hover:text-foreground"}),e[20]=I):I=e[20];let A;e[21]!==n.number||e[22]!==n.url?(A=c.jsxs("a",{href:n.url,target:"_blank",rel:"noreferrer",title:n.url,className:"group flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted",children:["#",n.number,I]}),e[21]=n.number,e[22]=n.url,e[23]=A):A=e[23];let _;e[24]!==A||e[25]!==T||e[26]!==N?(_=c.jsxs("div",{className:"flex items-center gap-3",children:[j,T,N,A]}),e[24]=A,e[25]=T,e[26]=N,e[27]=_):_=e[27];let z;e[28]!==g||e[29]!==l||e[30]!==o||e[31]!==n.previewUrl||e[32]!==r||e[33]!==i||e[34]!==b||e[35]!==a?(z=g&&c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r&&c.jsxs(Ae,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",title:a("taskBoard.taskDialog.openPreviewTitle"),onClick:()=>l?.(r),children:[c.jsx(Fo,{size:13}),a("taskBoard.taskDialog.openPreviewButton")]}),n.previewUrl&&c.jsx(Ae,{asChild:!0,type:"button",variant:"outline",size:"sm",className:"gap-1.5",children:c.jsxs("a",{href:n.previewUrl,target:"_blank",rel:"noreferrer",children:[c.jsx(rl,{size:14}),a("taskBoard.taskDialog.previewLabel"),c.jsx(Gs,{size:12})]})}),b&&c.jsx(Ae,{type:"button",variant:"success",size:"sm",disabled:i,onClick:o,children:a("taskBoard.taskDialog.shipToProductionButton")})]}),e[28]=g,e[29]=l,e[30]=o,e[31]=n.previewUrl,e[32]=r,e[33]=i,e[34]=b,e[35]=a,e[36]=z):z=e[36],h=c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[_,z,v&&c.jsxs("div",{className:"border-t border-border pt-2 text-xs",children:[c.jsxs("button",{type:"button",disabled:!w,onClick:()=>f(qp),className:"flex w-full items-center gap-1.5 font-medium disabled:cursor-default",children:[u?c.jsx(u.icon,{size:13,className:u.className}):c.jsx(mn,{size:13,className:"text-muted-foreground"}),c.jsx("span",{className:Z(u?.className??"text-muted-foreground"),children:u?.label??a("taskBoard.taskDialog.prChecksLabel")}),w&&c.jsx(sl,{size:14,className:Z("ml-auto text-muted-foreground/60 transition-transform",d&&"rotate-90")})]}),d&&c.jsx("div",{className:"mt-2 flex flex-col gap-2",children:k.map(R=>{const O=Fp(R);return c.jsxs("div",{className:"rounded-md bg-muted/40 p-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(O.icon,{size:13,className:Z("shrink-0",O.className,O.spin&&"animate-spin")}),c.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:R.name}),R.detailsUrl&&c.jsx("a",{href:R.detailsUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:c.jsx(Gs,{size:12})})]}),R.summary&&c.jsx("div",{className:"mt-1.5 max-h-64 overflow-auto text-muted-foreground",children:c.jsx(Rc,{id:`${n.url}-${R.name}`,text:R.summary})})]},R.name)})})]})]}),e[0]=d,e[1]=l,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=a,e[8]=h}else h=e[8];return h}function qp(t){return!t}function Kp(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Vn,{className:"size-4 shrink-0 rounded"}),c.jsx(Vn,{className:"h-4 min-w-0 flex-1"}),c.jsx(Vn,{className:"h-4 w-16 shrink-0"}),c.jsx(Vn,{className:"h-4 w-10 shrink-0"})]}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[e,c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Vn,{className:"h-7 w-20"}),c.jsx(Vn,{className:"h-7 w-28"})]})]}),t[1]=n):n=t[1],n}function Hp(t){const e=U.c(36),{item:n,description:r,onOpenThread:s}=t,i=oe(),{data:o,isLoading:l}=xp(n.id),{data:a}=da(n.id),d=Pi("qa_agent_enabled"),f=Pi("code_reviewer_enabled"),h=bp(n.id);let p,u;if(e[0]!==a||e[1]!==f||e[2]!==r||e[3]!==n.status||e[4]!==n.threads||e[5]!==s||e[6]!==h||e[7]!==o||e[8]!==l||e[9]!==d||e[10]!==i){u=Symbol.for("react.early_return_sentinel");e:{const m=wp(r),y=l&&!o;if(!y&&(!o||o.length===0)&&m.length===0){u=null;break e}let b;e[13]!==a||e[14]!==f||e[15]!==n.status||e[16]!==d?(b=n.status==="in_review"&&kp(a??[],yp({qa:d,codeReview:f})),e[13]=a,e[14]=f,e[15]=n.status,e[16]=d,e[17]=b):b=e[17];const g=b;let x;e[18]!==h||e[19]!==i?(x=()=>h.mutate(void 0,{onSuccess:D=>D?.merged?St.success(i("taskBoard.taskDialog.shipSuccess")):St.error(i("taskBoard.taskDialog.shipError")),onError:()=>St.error(i("taskBoard.taskDialog.shipError"))}),e[18]=h,e[19]=i,e[20]=x):x=e[20];const k=x;let v;e[21]!==n.threads||e[22]!==s?(v=s?n.threads.find(Vp):void 0,e[21]=n.threads,e[22]=s,e[23]=v):v=e[23];const w=v;let j;e[24]!==i?(j=i("taskBoard.taskDialog.linksLabel"),e[24]=i,e[25]=j):j=e[25];let C;e[26]!==j?(C=c.jsx("span",{className:"mb-1 text-xs font-medium text-muted-foreground",children:j}),e[26]=j,e[27]=C):C=e[27];let T;e[28]!==y||e[29]!==s||e[30]!==k||e[31]!==w||e[32]!==h||e[33]!==o||e[34]!==g?(T=y?c.jsx(Kp,{}):(o??[]).map(D=>c.jsx(Up,{pr:D,previewThread:w,reviewsReady:g,shipPending:h.isPending,onShip:k,onOpenThread:s},D.url)),e[28]=y,e[29]=s,e[30]=k,e[31]=w,e[32]=h,e[33]=o,e[34]=g,e[35]=T):T=e[35],p=c.jsxs("div",{className:"flex flex-col gap-1 pb-2",children:[C,T,m.map(Wp)]})}e[0]=a,e[1]=f,e[2]=r,e[3]=n.status,e[4]=n.threads,e[5]=s,e[6]=h,e[7]=o,e[8]=l,e[9]=d,e[10]=i,e[11]=p,e[12]=u}else p=e[11],u=e[12];return u!==Symbol.for("react.early_return_sentinel")?u:p}function Wp(t){return c.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"group flex items-center gap-2 rounded-md px-1 py-1.5 transition-colors hover:bg-muted",children:[c.jsx(rl,{size:15,className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:t.label}),c.jsx(Gs,{size:13,className:"shrink-0 text-muted-foreground/50 group-hover:text-foreground"})]},t.url)}function Vp(t){return t.hasPreview&&t.virtualMcpId}function Qp(t){const e=U.c(6),{item:n,members:r,startedBy:s,onOpenThread:i}=t,o=oe(),{data:l}=da(n.id),{data:a}=Ro.useSession(),d=new Map(r.map(Jp)),f={id:a?.user?.id??"me",name:a?.user?.name??o("taskBoard.taskDialog.commentYouLabel"),image:a?.user?.image},h=Rp(n.id),p=k=>{if(k===$e)return{id:k,name:o("taskBoard.taskDialog.superAgentLabel"),isAgent:!0};if(k===f.id)return f;const v=d.get(k);return{id:k,name:v?.user?.name??k,image:v?.user?.image}},u=h.threads.map(k=>({id:k.id,author:p(k.authorId),body:k.body,createdAt:k.createdAt,resolved:k.resolved,replies:k.replies.map(v=>({id:v.id,author:p(v.authorId),body:v.body,createdAt:v.createdAt,replies:[]}))})),m=[...(l??[]).map(Zp),...n.threads.map(Yp),...u.map(Xp)].sort(Gp),y=[];for(const k of m){if(k.kind==="thread"){y.push({type:"thread",thread:k.thread});continue}if(k.kind==="comment"){y.push({type:"comment",comment:k.comment});continue}const v=y[y.length-1];v?.type==="timeline"?v.items.push(k.activity):y.push({type:"timeline",items:[k.activity]})}let b;e[0]!==o?(b=o("taskBoard.taskDialog.activityLabel"),e[0]=o,e[1]=b):b=e[1];let g;e[2]!==b?(g=c.jsx("span",{className:"text-sm font-medium text-foreground",children:b}),e[2]=b,e[3]=g):g=e[3];let x;return e[4]!==h.post?(x=k=>h.post.mutate({body:k}),e[4]=h.post,e[5]=x):x=e[5],c.jsxs("div",{className:"flex flex-col gap-5 pb-2",children:[g,y.map((k,v)=>k.type==="timeline"?c.jsx(tg,{items:k.items,memberByUserId:d},`timeline-${v}`):k.type==="comment"?c.jsx(Sp,{thread:k.comment,me:f,onReply:w=>h.post.mutate({body:w,parentId:k.comment.id}),onDelete:w=>h.remove.mutate(w),onToggleResolved:()=>h.setResolved.mutate({id:k.comment.id,resolved:!k.comment.resolved})},`comment-${k.comment.id}`):c.jsx(Mp,{thread:k.thread,startedBy:s,onOpen:i},`thread-${k.thread.threadId}`)),c.jsx(Tp,{me:f,onSubmit:x})]})}function Gp(t,e){return t.at-e.at}function Xp(t){return{kind:"comment",at:new Date(t.createdAt).getTime(),comment:t}}function Yp(t){return{kind:"thread",at:new Date(t.createdAt).getTime(),thread:t}}function Zp(t){return{kind:"activity",at:new Date(t.occurredAt).getTime(),activity:t}}function Jp(t){return[t.userId,t]}function ln(t){const e=U.c(7),{icon:n,label:r}=t;let s;e[0]!==n?(s=c.jsx("span",{className:"ml-1 mr-1 inline-flex h-[1lh] items-center align-top",children:n}),e[0]=n,e[1]=s):s=e[1];let i;e[2]!==r?(i=c.jsx("span",{className:"mr-1",children:r}),e[2]=r,e[3]=i):i=e[3];let o;return e[4]!==s||e[5]!==i?(o=c.jsxs(c.Fragment,{children:[s,i]}),e[4]=s,e[5]=i,e[6]=o):o=e[6],o}const cr="\0";function Qs(t){return`${cr}${t}${cr}`}function Gn(t,e){return t.split(new RegExp(`${cr}(\\w+)${cr}`)).map((n,r)=>c.jsx(S.Fragment,{children:r%2===0?n:e[n]},r))}function hs(t,e){return e(t==="code_review"?"taskBoard.taskDialog.codeReviewerLabel":"taskBoard.taskDialog.qaAgentLabel")}function eg(t,e,n){const r=p=>{const u=typeof p=="string"?Et[p]:void 0;if(!u)return String(p??"");const m=u.icon;return c.jsx(ln,{icon:c.jsx(m,{size:14,className:u.iconClassName}),label:e(u.labelKey)})},s=p=>{const u=typeof p=="string"?It[p]:void 0;return u?c.jsx(ln,{icon:c.jsx("span",{className:Z("size-2 rounded-full",u.dotClassName)}),label:e(u.labelKey)}):String(p??"")},i=p=>{const u=Xr(typeof p=="string"?p:null);return u?c.jsx(ln,{icon:c.jsx(Yn,{size:14,className:"text-muted-foreground"}),label:ha.format(u)}):""},o=p=>!Array.isArray(p)||p.length===0?null:p.map((u,m)=>{const y=u;return c.jsx(ln,{icon:c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:As(y.color)}}),label:y.name??""},y.id??m)}),l=p=>{if(p===$e)return c.jsx(ln,{icon:c.jsx(Pt,{size:14}),label:e("taskBoard.taskDialog.superAgentLabel")});const u=typeof p=="string"?n.get(p):void 0;return c.jsx(ln,{icon:c.jsx(At,{url:u?.user?.image??void 0,fallback:_t(u?.user?.name),shape:"circle",size:"2xs"}),label:u?.user?.name??e("taskBoard.taskDialog.someoneLabel")})},a=p=>c.jsx(ln,{icon:p==="code_review"?c.jsx(Fl,{size:14}):c.jsx(Pl,{size:14}),label:hs(p,e)}),d=t.data,f=Qs("from"),h=Qs("to");switch(t.action){case"created":return e("taskBoard.taskDialog.activityCreated");case"status_changed":return Gn(d.from?e("taskBoard.taskDialog.activityMovedFromTo",{from:f,to:h}):e("taskBoard.taskDialog.activityMovedTo",{to:h}),{from:r(d.from),to:r(d.to)});case"assignee_changed":return d.to==null?e("taskBoard.taskDialog.activityUnassigned"):Gn(e(d.to===$e?"taskBoard.taskDialog.activityDelegated":"taskBoard.taskDialog.activityAssigned",{name:Qs("name")}),{name:l(d.to)});case"priority_changed":return d.to==="none"?e("taskBoard.taskDialog.activityPriorityCleared"):Gn(!d.from||d.from==="none"?e("taskBoard.taskDialog.activityPrioritySet",{to:h}):e("taskBoard.taskDialog.activityPriorityFromTo",{from:f,to:h}),{from:s(d.from),to:s(d.to)});case"due_date_changed":return d.to==null?e("taskBoard.taskDialog.activityDueDateCleared"):Gn(d.from==null?e("taskBoard.taskDialog.activityDueDateSet",{to:h}):e("taskBoard.taskDialog.activityDueDateFromTo",{from:f,to:h}),{from:i(d.from),to:i(d.to)});case"title_changed":return e("taskBoard.taskDialog.activityRenamed",{to:String(d.to??"")});case"description_changed":return e("taskBoard.taskDialog.activityDescriptionUpdated");case"tags_changed":return!Array.isArray(d.to)||d.to.length===0?e("taskBoard.taskDialog.activityTagsCleared"):Gn(e("taskBoard.taskDialog.activityTagsSet",{to:h}),{to:o(d.to)});case"review_requested":return Gn(e("taskBoard.taskDialog.activityDelegated",{name:Qs("name")}),{name:a(d.reviewer)});case"review_approved":return typeof d.notes=="string"&&d.notes.trim()?e("taskBoard.taskDialog.activityReviewApprovedWithNotes",{reviewer:hs(d.reviewer,e),notes:d.notes}):e("taskBoard.taskDialog.activityReviewApproved",{reviewer:hs(d.reviewer,e)});case"review_changes_requested":return typeof d.notes=="string"&&d.notes.trim()?e("taskBoard.taskDialog.activityReviewChangesRequestedWithNotes",{reviewer:hs(d.reviewer,e),notes:d.notes}):e("taskBoard.taskDialog.activityReviewChangesRequested",{reviewer:hs(d.reviewer,e)});case"merge_conflict_resolution":return e("taskBoard.taskDialog.activityMergeConflictResolution");default:{const p=t.action;return String(p)}}}function wo(t){return!t||t===$e}function tg(t){const e=U.c(21),{items:n,memberByUserId:r}=t,s=oe();let i;e[0]!==r||e[1]!==s?(i=p=>wo(p)?s("taskBoard.taskDialog.superAgentLabel"):r.get(p)?.user?.name??s("taskBoard.taskDialog.someoneLabel"),e[0]=r,e[1]=s,e[2]=i):i=e[2];const o=i;let l;e[3]!==r?(l=p=>{if(wo(p))return c.jsx("span",{className:"z-10 flex size-4 shrink-0 items-center justify-center bg-background",children:c.jsx(Pt,{size:16})});const u=r.get(p);return c.jsx("span",{className:"z-10 shrink-0 rounded-full bg-background",children:c.jsx(At,{url:u?.user?.image??void 0,fallback:_t(u?.user?.name),shape:"circle",size:"2xs"})})},e[3]=r,e[4]=l):l=e[4];const a=l;let d;e[5]!==n.length?(d=n.length>1&&c.jsx("span",{"aria-hidden":!0,className:"absolute bottom-3 left-2 top-3 w-px bg-border"}),e[5]=n.length,e[6]=d):d=e[6];let f;if(e[7]!==a||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==s){let p;e[13]!==a||e[14]!==o||e[15]!==r||e[16]!==s?(p=u=>c.jsxs("div",{className:"relative flex items-center gap-2.5",children:[a(u.actorId),c.jsxs("span",{className:"min-w-0 truncate text-sm text-muted-foreground",children:[c.jsx("span",{className:"font-medium text-foreground",children:o(u.actorId)})," ",eg(u,s,r),c.jsxs("span",{className:"text-muted-foreground/60",children:[" · ",ii(new Date(u.occurredAt))]})]})]},u.id),e[13]=a,e[14]=o,e[15]=r,e[16]=s,e[17]=p):p=e[17],f=n.map(p),e[7]=a,e[8]=o,e[9]=n,e[10]=r,e[11]=s,e[12]=f}else f=e[12];let h;return e[18]!==d||e[19]!==f?(h=c.jsxs("div",{className:"relative flex flex-col gap-4",children:[d,f]}),e[18]=d,e[19]=f,e[20]=h):h=e[20],h}const pa="https://decoims.com/image?src=decocms%2F7263a67f-fb83-410b-a5f2-e54e87deaaac%2Freport-kanban.png&quality=original&fit=cover",ng=["taskBoard.backlogPaywall.benefitPrioritizedTasks","taskBoard.backlogPaywall.benefitRecurringReport","taskBoard.backlogPaywall.benefitAgentResolves"],So={price:"R$ 99",anchor:"R$ 499"};function sg(t){const e=U.c(21),{onOpen:n}=t,r=oe();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-success/10",children:c.jsx(ur,{size:16,className:"text-success"})}),e[0]=s):s=e[0];let i;e[1]!==r?(i=r("taskBoard.backlogPaywall.bannerTitle"),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==i?(o=c.jsx("span",{className:"text-sm font-medium text-foreground",children:i}),e[3]=i,e[4]=o):o=e[4];let l;e[5]!==r?(l=r("taskBoard.backlogPaywall.bannerSubtitle"),e[5]=r,e[6]=l):l=e[6];let a;e[7]!==l?(a=c.jsx("span",{className:"text-sm text-muted-foreground",children:l}),e[7]=l,e[8]=a):a=e[8];let d;e[9]!==o||e[10]!==a?(d=c.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[s,c.jsxs("div",{className:"flex min-w-0 flex-col",children:[o,a]})]}),e[9]=o,e[10]=a,e[11]=d):d=e[11];let f;e[12]!==r?(f=r("taskBoard.backlogPaywall.unlockButton"),e[12]=r,e[13]=f):f=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(ol,{size:16}),e[14]=h):h=e[14];let p;e[15]!==n||e[16]!==f?(p=c.jsxs(Ae,{size:"sm",onClick:n,className:"w-full gap-2 sm:w-auto sm:shrink-0",children:[f,h]}),e[15]=n,e[16]=f,e[17]=p):p=e[17];let u;return e[18]!==d||e[19]!==p?(u=c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-4 card-shadow sm:flex-row sm:items-center sm:gap-4",children:[d,p]}),e[18]=d,e[19]=p,e[20]=u):u=e[20],u}function rg({open:t,onOpenChange:e,cdClient:n,onExpired:r}){const s=oe(),[i,o]=S.useState(!1),l=async()=>{if(!n){r();return}o(!0);try{const a=await n.callTool({name:"start_checkout",arguments:{}}),{url:d}=zr(a);if(new URL(d).protocol!=="https:")throw new Error("unsafe checkout url");window.open(d,"_blank","noopener,noreferrer"),e(!1)}catch{r()}finally{o(!1)}};return c.jsx(Jn,{open:t,onOpenChange:e,children:c.jsxs(es,{className:"gap-0 p-3 sm:max-w-[500px]",closeButtonClassName:"z-10 rounded-full bg-background/70 p-1 text-foreground backdrop-blur transition-colors hover:bg-background",children:[c.jsx("div",{className:"overflow-hidden rounded-xl bg-muted",children:c.jsx("img",{src:pa,alt:s("taskBoard.backlogPaywall.previewAlt"),className:"h-[208px] w-full object-cover object-left-top"})}),c.jsxs("div",{className:"flex flex-col gap-7 px-3 pb-3 pt-7",children:[c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsx(ts,{className:"text-xl font-semibold text-foreground",children:s("taskBoard.backlogPaywall.modalTitle")}),c.jsx("ul",{className:"flex flex-col gap-3.5",children:ng.map(a=>c.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[c.jsx(mn,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),c.jsx("span",{className:"leading-snug text-foreground",children:s(a)})]},a))})]}),c.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-2xl font-semibold text-foreground",children:So.price}),c.jsx("span",{className:"text-sm text-muted-foreground line-through",children:So.anchor})]}),c.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[c.jsx(Ae,{variant:"ghost",onClick:()=>e(!1),disabled:i,className:"order-2 w-full sm:order-none sm:w-auto",children:s("taskBoard.backlogPaywall.exploreButton")}),c.jsxs(Ae,{onClick:l,disabled:i,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[i?c.jsx(Ts,{size:16,className:"animate-spin"}):null,s("taskBoard.backlogPaywall.unlockButton"),!i&&c.jsx(ol,{size:16})]})]})]})]})]})})}function Or(t){return`board-paywall-seen:${t}`}function ig(){const t=U.c(26),{org:e}=Me(),n=Lo(),{diagnostic:r,cdClient:s,connectionId:i}=jd();let o;t[0]!==e.id?(o=()=>({orgId:e.id,open:!sessionStorage.getItem(Or(e.id))}),t[0]=e.id,t[1]=o):o=t[1];const[l,a]=S.useState(o);let d;t[2]!==l.open||t[3]!==l.orgId||t[4]!==e.id?(d=l.orgId===e.id?l.open:!sessionStorage.getItem(Or(e.id)),t[2]=l.open,t[3]=l.orgId,t[4]=e.id,t[5]=d):d=t[5];const f=d;if(!r?.locked)return null;let h;t[6]!==e.id?(h=v=>a({orgId:e.id,open:v}),t[6]=e.id,t[7]=h):h=t[7];const p=h;let u;t[8]!==e.id||t[9]!==p?(u=v=>{p(v),v||sessionStorage.setItem(Or(e.id),"1")},t[8]=e.id,t[9]=p,t[10]=u):u=t[10];const m=u;let y;t[11]!==i||t[12]!==n||t[13]!==e?(y=()=>{Mi("board_paywall_report_opened",{organization_id:e.id}),n(Nd(e,i))},t[11]=i,t[12]=n,t[13]=e,t[14]=y):y=t[14];const b=y;let g;t[15]!==e.id||t[16]!==p?(g=c.jsx(sg,{onOpen:()=>{Mi("board_paywall_banner_clicked",{organization_id:e.id}),p(!0)}}),t[15]=e.id,t[16]=p,t[17]=g):g=t[17];let x;t[18]!==s||t[19]!==m||t[20]!==f||t[21]!==b?(x=c.jsx(rg,{open:f,onOpenChange:m,cdClient:s,onExpired:b}),t[18]=s,t[19]=m,t[20]=f,t[21]=b,t[22]=x):x=t[22];let k;return t[23]!==g||t[24]!==x?(k=c.jsxs(c.Fragment,{children:[g,x]}),t[23]=g,t[24]=x,t[25]=k):k=t[25],k}function og(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(Na,{fallback:null,children:c.jsx(ig,{})}),t[0]=e):e=t[0],e}const lg=["taskBoard.subscriptionPaywall.trialBenefitMonitoring","taskBoard.subscriptionPaywall.trialBenefitAutoFix","taskBoard.subscriptionPaywall.trialBenefitRuns"];function ag(t){const e=U.c(83),{kind:n,onOpenChange:r}=t,s=oe(),{mutate:i,isPending:o}=Mc("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");if(n==="trial_exhausted"){let v;e[0]!==s?(v=s("taskBoard.subscriptionPaywall.previewAlt"),e[0]=s,e[1]=v):v=e[1];let w;e[2]!==v?(w=c.jsx("div",{className:"overflow-hidden rounded-xl bg-muted",children:c.jsx("img",{src:pa,alt:v,className:"h-[160px] w-full object-cover object-left-top"})}),e[2]=v,e[3]=w):w=e[3];let j;e[4]!==s?(j=s("taskBoard.subscriptionPaywall.trialTitle"),e[4]=s,e[5]=j):j=e[5];let C;e[6]!==j?(C=c.jsx(ts,{className:"text-xl font-semibold text-foreground",children:j}),e[6]=j,e[7]=C):C=e[7];let T;e[8]!==s?(T=lg.map(ee=>c.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[c.jsx(mn,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),c.jsx("span",{className:"leading-snug text-foreground",children:s(ee)})]},ee)),e[8]=s,e[9]=T):T=e[9];let D;e[10]!==T?(D=c.jsx("ul",{className:"flex flex-col gap-3",children:T}),e[10]=T,e[11]=D):D=e[11];let E;e[12]!==s?(E=s("taskBoard.subscriptionPaywall.trialPrice"),e[12]=s,e[13]=E):E=e[13];let N;e[14]!==E?(N=c.jsx("span",{className:"text-2xl font-semibold text-foreground",children:E}),e[14]=E,e[15]=N):N=e[15];let I;e[16]!==s?(I=s("taskBoard.subscriptionPaywall.trialPricePeriod"),e[16]=s,e[17]=I):I=e[17];let A;e[18]!==I?(A=c.jsx("span",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=A):A=e[19];let _;e[20]!==A||e[21]!==N?(_=c.jsxs("div",{className:"flex items-baseline gap-1.5",children:[N,A]}),e[20]=A,e[21]=N,e[22]=_):_=e[22];let z;e[23]!==r?(z=()=>r(!1),e[23]=r,e[24]=z):z=e[24];let R;e[25]!==s?(R=s("taskBoard.subscriptionPaywall.notNowButton"),e[25]=s,e[26]=R):R=e[26];let O;e[27]!==o||e[28]!==z||e[29]!==R?(O=c.jsx(Ae,{variant:"ghost",onClick:z,disabled:o,className:"order-2 w-full sm:order-none sm:w-auto",children:R}),e[27]=o,e[28]=z,e[29]=R,e[30]=O):O=e[30];let L;e[31]!==r||e[32]!==i?(L=()=>i(void 0,{onSuccess:()=>r(!1)}),e[31]=r,e[32]=i,e[33]=L):L=e[33];let B;e[34]!==o?(B=o&&c.jsx(Ts,{size:16,className:"animate-spin"}),e[34]=o,e[35]=B):B=e[35];let F;e[36]!==s?(F=s("taskBoard.subscriptionPaywall.subscribeButton"),e[36]=s,e[37]=F):F=e[37];let $;e[38]!==o||e[39]!==L||e[40]!==B||e[41]!==F?($=c.jsxs(Ae,{disabled:o,onClick:L,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[B,F]}),e[38]=o,e[39]=L,e[40]=B,e[41]=F,e[42]=$):$=e[42];let W;e[43]!==O||e[44]!==$?(W=c.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[O,$]}),e[43]=O,e[44]=$,e[45]=W):W=e[45];let K;e[46]!==_||e[47]!==W?(K=c.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[_,W]}),e[46]=_,e[47]=W,e[48]=K):K=e[48];let Q;e[49]!==K||e[50]!==C||e[51]!==D?(Q=c.jsxs("div",{className:"flex flex-col gap-6 px-3 pb-3 pt-7",children:[C,D,K]}),e[49]=K,e[50]=C,e[51]=D,e[52]=Q):Q=e[52];let G;e[53]!==w||e[54]!==Q?(G=c.jsxs(es,{className:"gap-0 p-3 sm:max-w-[440px]",closeButtonClassName:"z-10 rounded-full bg-background/70 p-1 text-foreground backdrop-blur transition-colors hover:bg-background",children:[w,Q]}),e[53]=w,e[54]=Q,e[55]=G):G=e[55];let Y;return e[56]!==r||e[57]!==G?(Y=c.jsx(Jn,{open:!0,onOpenChange:r,children:G}),e[56]=r,e[57]=G,e[58]=Y):Y=e[58],Y}let l;e[59]!==n||e[60]!==s?(l=n?{monthly_exhausted:{title:s("taskBoard.subscriptionPaywall.monthlyTitle"),description:s("taskBoard.subscriptionPaywall.monthlyDescription")},runs_exhausted:{title:s("taskBoard.subscriptionPaywall.runsTitle"),description:s("taskBoard.subscriptionPaywall.runsDescription")}}[n]:null,e[59]=n,e[60]=s,e[61]=l):l=e[61];const a=l,d=!!n,f=a?.title;let h;e[62]!==f?(h=c.jsx(ts,{children:f}),e[62]=f,e[63]=h):h=e[63];const p=a?.description;let u;e[64]!==p?(u=c.jsx(ni,{children:p}),e[64]=p,e[65]=u):u=e[65];let m;e[66]!==h||e[67]!==u?(m=c.jsxs(si,{children:[h,u]}),e[66]=h,e[67]=u,e[68]=m):m=e[68];let y;e[69]!==r?(y=()=>r(!1),e[69]=r,e[70]=y):y=e[70];let b;e[71]!==s?(b=s("taskBoard.subscriptionPaywall.dismissButton"),e[71]=s,e[72]=b):b=e[72];let g;e[73]!==y||e[74]!==b?(g=c.jsx(ri,{children:c.jsx(Ae,{variant:"ghost",onClick:y,children:b})}),e[73]=y,e[74]=b,e[75]=g):g=e[75];let x;e[76]!==g||e[77]!==m?(x=c.jsxs(es,{className:"sm:max-w-[440px]",children:[m,g]}),e[76]=g,e[77]=m,e[78]=x):x=e[78];let k;return e[79]!==r||e[80]!==x||e[81]!==d?(k=c.jsx(Jn,{open:d,onOpenChange:r,children:x}),e[79]=r,e[80]=x,e[81]=d,e[82]=k):k=e[82],k}const cg=new Set(["completed","failed","expired"]);function dg(t){return t.threads.some(e=>e.status!==null&&!cg.has(e.status))}function ug(t){const e=U.c(43),{items:n,pending:r,onOpenChange:s,onConfirm:i}=t,o=oe(),l=n.length;let a;e[0]!==n?(a=n.some(dg),e[0]=n,e[1]=a):a=e[1];const d=a,f=l>0;let h;e[2]!==l||e[3]!==o?(h=l>1?o("taskBoard.rerun.titleMany",{count:l}):o("taskBoard.rerun.title"),e[2]=l,e[3]=o,e[4]=h):h=e[4];let p;e[5]!==h?(p=c.jsx(ts,{children:h}),e[5]=h,e[6]=p):p=e[6];let u;e[7]!==l||e[8]!==o||e[9]!==d?(u=l>1?o("taskBoard.rerun.descriptionMany",{count:l}):o(d?"taskBoard.rerun.descriptionTakeover":"taskBoard.rerun.description"),e[7]=l,e[8]=o,e[9]=d,e[10]=u):u=e[10];let m;e[11]!==u?(m=c.jsx(ni,{children:u}),e[11]=u,e[12]=m):m=e[12];let y;e[13]!==p||e[14]!==m?(y=c.jsxs(si,{children:[p,m]}),e[13]=p,e[14]=m,e[15]=y):y=e[15];let b;e[16]!==s?(b=()=>s(!1),e[16]=s,e[17]=b):b=e[17];let g;e[18]!==o?(g=o("taskBoard.rerun.cancel"),e[18]=o,e[19]=g):g=e[19];let x;e[20]!==r||e[21]!==b||e[22]!==g?(x=c.jsx(Ae,{variant:"outline",onClick:b,disabled:r,children:g}),e[20]=r,e[21]=b,e[22]=g,e[23]=x):x=e[23];let k;e[24]!==r?(k=r&&c.jsx(Ts,{className:"size-4 animate-spin"}),e[24]=r,e[25]=k):k=e[25];let v;e[26]!==o?(v=o("taskBoard.rerun.confirm"),e[26]=o,e[27]=v):v=e[27];let w;e[28]!==i||e[29]!==r||e[30]!==k||e[31]!==v?(w=c.jsxs(Ae,{onClick:i,disabled:r,children:[k,v]}),e[28]=i,e[29]=r,e[30]=k,e[31]=v,e[32]=w):w=e[32];let j;e[33]!==x||e[34]!==w?(j=c.jsxs(ri,{children:[x,w]}),e[33]=x,e[34]=w,e[35]=j):j=e[35];let C;e[36]!==j||e[37]!==y?(C=c.jsxs(es,{className:"max-w-md",children:[y,j]}),e[36]=j,e[37]=y,e[38]=C):C=e[38];let T;return e[39]!==s||e[40]!==C||e[41]!==f?(T=c.jsx(Jn,{open:f,onOpenChange:s,children:C}),e[39]=s,e[40]=C,e[41]=f,e[42]=T):T=e[42],T}const Co=380,fg=90,jo=5,hg="cubic-bezier(0.22, 0.61, 0.36, 1)";function pg(t,e,n){const r=S.useRef(new Map),s=S.useRef(new Map);S.useLayoutEffect(()=>{const i=t.current;if(!i)return;const o=i.querySelectorAll("[data-flip-id]"),l=new Map,a=r.current;r.current=l;const d=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,f=[];for(const g of o){const x=g.dataset.flipId;if(!x)continue;const k=g.getBoundingClientRect(),v=g.dataset.flipLane;if(l.set(x,{rect:k,lane:v}),!n)continue;const w=a.get(x);if(!w)continue;const j=w.rect.left-k.left,C=w.rect.top-k.top;(j||C)&&f.push({el:g,dx:j,dy:C,lane:w.lane!==v})}if(!n||d||f.length===0)return;const h=s.current,p=g=>{g instanceof HTMLElement&&(h.set(g,(h.get(g)??0)+1),g.style.overflow="visible")},u=g=>{if(!(g instanceof HTMLElement))return;const x=(h.get(g)??1)-1;if(x>0){h.set(g,x);return}h.delete(g),g.style.overflow=""};for(const g of f){const x=g.lane?` rotate(${g.dx>0?jo:-jo}deg)`:"";g.el.style.transition="none",g.el.style.transform=`translate(${g.dx}px, ${g.dy}px)${x}`,g.lane&&(g.el.style.zIndex="10",p(g.el.closest("[data-lane-scroll]")))}let m=0;const y=[],b=requestAnimationFrame(()=>{for(const g of f){const x=g.lane?m++*fg:0;g.el.style.transition=`transform ${Co}ms ${hg} ${x}ms`,g.el.style.transform="",y.push(window.setTimeout(()=>{g.el.style.transition="",g.el.style.transform="",g.el.style.zIndex="",g.lane&&u(g.el.closest("[data-lane-scroll]"))},Co+x+30))}});return()=>{cancelAnimationFrame(b);for(const g of y)clearTimeout(g);for(const g of f)g.el.style.transition="",g.el.style.transform="",g.el.style.zIndex="",g.lane&&u(g.el.closest("[data-lane-scroll]"))}},[e,t,n])}function gg(t,e=[]){const n=[[`# Task: ${t.title}`,t.description?.trim()].filter(Boolean).join(`
|
|
72
|
-
|
|
73
|
-
`)];if(e.length>0){const r=e.map(s=>{const i=s.merged?"merged":s.state??(s.draft?"draft":"open"),o=s.title?.trim()||`${s.repoOwner}/${s.repoName}`;return`- #${s.number} ${o} [${i}] ${s.url}`});n.push(["## Linked pull requests",...r].join(`
|
|
74
|
-
`))}if(t.threads.length>0){const r=t.threads.map(s=>{const i=s.title?.trim()||"Untitled chat";return s.status?`- ${i} [${s.status}]`:`- ${i}`});n.push(["## Other chats on this task",...r].join(`
|
|
75
|
-
`))}return n.join(`
|
|
76
|
-
|
|
77
|
-
`)}const Yr="__unassigned__",dr={assignee:null,priority:null,due:null};function mg(t){return t.assignee!==null||t.priority!==null||t.due!==null}function xg(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)}const bg=864e5;function yg(t,e){const n=new Date(t),r=new Date(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function kg(t,e){if(e.assignee!==null){if(e.assignee===Yr){if(t.assigneeId!==null)return!1}else if(t.assigneeId!==e.assignee)return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const n=new Date(t.dueDate).getTime(),r=Date.now();if(e.due==="overdue"&&n>=r||e.due==="today"&&!yg(n,r)||e.due==="week"&&(n<r||n>r+7*bg))return!1}return!0}const To={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function vr(t,e=!1){return Z("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function vg(t){const e=U.c(95),{value:n,members:r,onChange:s,block:i}=t,o=oe(),[l,a]=S.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(Mr,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let f=d,h;e[1]!==o?(h=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=h):h=e[2];let p=h;if(n===Yr){let q;e[3]!==o?(q=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=q):q=e[4],p=q}else if(n===$e){let q;e[5]===Symbol.for("react.memo_cache_sentinel")?(q=c.jsx(Pt,{size:14}),e[5]=q):q=e[5],f=q;let V;e[6]!==o?(V=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=V):V=e[7],p=V}else if(n){let q,V,J,ie;if(e[8]!==r||e[9]!==n){let H;e[14]!==n?(H=le=>le.userId===n,e[14]=n,e[15]=H):H=e[15],V=r.find(H),q=At,J=V?.user?.image??void 0,ie=_t(V?.user?.name),e[8]=r,e[9]=n,e[10]=q,e[11]=V,e[12]=J,e[13]=ie}else q=e[10],V=e[11],J=e[12],ie=e[13];let te;e[16]!==q||e[17]!==J||e[18]!==ie?(te=c.jsx(q,{url:J,fallback:ie,shape:"circle",size:"2xs"}),e[16]=q,e[17]=J,e[18]=ie,e[19]=te):te=e[19],f=te;let P;e[20]!==V?.user?.name||e[21]!==o?(P=V?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=V?.user?.name,e[21]=o,e[22]=P):P=e[22],p=P}let u;e[23]!==s?(u=q=>{s(q),a(!1)},e[23]=s,e[24]=u):u=e[24];const m=u,y=n!==null;let b;e[25]!==i||e[26]!==y?(b=vr(y,i),e[25]=i,e[26]=y,e[27]=b):b=e[27];const g=b,x=i&&"ml-auto";let k;e[28]!==x?(k=Z("shrink-0 opacity-60",x),e[28]=x,e[29]=k):k=e[29];const v=k;let w;e[30]!==p?(w=c.jsx("span",{className:"max-w-[10rem] truncate",children:p}),e[30]=p,e[31]=w):w=e[31];let j;e[32]!==v?(j=c.jsx(fi,{size:12,className:v}),e[32]=v,e[33]=j):j=e[33];let C;e[34]!==f||e[35]!==w||e[36]!==j||e[37]!==g?(C=c.jsx(Xn,{asChild:!0,children:c.jsxs("button",{type:"button",className:g,children:[f,w,j]})}),e[34]=f,e[35]=w,e[36]=j,e[37]=g,e[38]=C):C=e[38];let T;e[39]!==o?(T=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=T):T=e[40];let D;e[41]!==T?(D=c.jsx(ai,{placeholder:T,className:"h-9"}),e[41]=T,e[42]=D):D=e[42];let E;e[43]!==o?(E=o("taskBoard.taskFilters.assigneeNoMembersFound"),e[43]=o,e[44]=E):E=e[44];let N;e[45]!==E?(N=c.jsx(ci,{children:E}),e[45]=E,e[46]=N):N=e[46];let I;e[47]!==m?(I=()=>m(null),e[47]=m,e[48]=I):I=e[48];let A;e[49]!==o?(A=o("taskBoard.taskFilters.assigneeAnyone"),e[49]=o,e[50]=A):A=e[50];let _;e[51]!==I||e[52]!==A?(_=c.jsx(en,{value:"Anyone",onSelect:I,children:A}),e[51]=I,e[52]=A,e[53]=_):_=e[53];let z;e[54]!==m?(z=()=>m(Yr),e[54]=m,e[55]=z):z=e[55];let R;e[56]===Symbol.for("react.memo_cache_sentinel")?(R=c.jsx(Mr,{size:16,className:"text-muted-foreground"}),e[56]=R):R=e[56];let O;e[57]!==o?(O=o("taskBoard.taskFilters.assigneeUnassigned"),e[57]=o,e[58]=O):O=e[58];let L;e[59]!==z||e[60]!==O?(L=c.jsxs(en,{value:"Unassigned",onSelect:z,className:"gap-2",children:[R,O]}),e[59]=z,e[60]=O,e[61]=L):L=e[61];let B;e[62]!==m?(B=()=>m($e),e[62]=m,e[63]=B):B=e[63];let F;e[64]===Symbol.for("react.memo_cache_sentinel")?(F=c.jsx(Pt,{size:16}),e[64]=F):F=e[64];let $;e[65]!==o?($=o("taskBoard.taskFilters.assigneeSuperAgent"),e[65]=o,e[66]=$):$=e[66];let W;e[67]!==B||e[68]!==$?(W=c.jsxs(en,{value:"Super Agent",onSelect:B,className:"gap-2",children:[F,$]}),e[67]=B,e[68]=$,e[69]=W):W=e[69];let K;e[70]!==_||e[71]!==L||e[72]!==W?(K=c.jsxs(ns,{children:[_,L,W]}),e[70]=_,e[71]=L,e[72]=W,e[73]=K):K=e[73];let Q;e[74]!==o?(Q=o("taskBoard.taskFilters.assigneeGroupMembers"),e[74]=o,e[75]=Q):Q=e[75];let G;if(e[76]!==r||e[77]!==m){let q;e[79]!==m?(q=V=>c.jsxs(en,{value:V.user?.name??V.userId,onSelect:()=>m(V.userId),className:"gap-2",children:[c.jsx(At,{url:V.user?.image??void 0,fallback:_t(V.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:V.user?.name??V.userId})]},V.userId),e[79]=m,e[80]=q):q=e[80],G=r.map(q),e[76]=r,e[77]=m,e[78]=G}else G=e[78];let Y;e[81]!==Q||e[82]!==G?(Y=c.jsx(ns,{heading:Q,children:G}),e[81]=Q,e[82]=G,e[83]=Y):Y=e[83];let ee;e[84]!==N||e[85]!==K||e[86]!==Y?(ee=c.jsxs(di,{children:[N,K,Y]}),e[84]=N,e[85]=K,e[86]=Y,e[87]=ee):ee=e[87];let se;e[88]!==D||e[89]!==ee?(se=c.jsx(xs,{align:"start",className:"w-56 p-0",children:c.jsxs(ui,{children:[D,ee]})}),e[88]=D,e[89]=ee,e[90]=se):se=e[90];let re;return e[91]!==l||e[92]!==C||e[93]!==se?(re=c.jsxs(bs,{open:l,onOpenChange:a,children:[C,se]}),e[91]=l,e[92]=C,e[93]=se,e[94]=re):re=e[94],re}function wg(t){const e=U.c(33),{value:n,onChange:r,block:s}=t,i=oe(),o=n!==null;let l;e[0]!==s||e[1]!==o?(l=vr(o,s),e[0]=s,e[1]=o,e[2]=l):l=e[2];const a=l,d=s&&"ml-auto";let f;e[3]!==d?(f=Z("shrink-0 opacity-60",d),e[3]=d,e[4]=f):f=e[4];const h=f;let p;e[5]!==n?(p=n?c.jsx("span",{className:Z("size-2 shrink-0 rounded-full",It[n].dotClassName)}):c.jsx(Hc,{size:14,className:"shrink-0"}),e[5]=n,e[6]=p):p=e[6];let u;e[7]!==i||e[8]!==n?(u=i(n?It[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=i,e[8]=n,e[9]=u):u=e[9];let m;e[10]!==h?(m=c.jsx(fi,{size:12,className:h}),e[10]=h,e[11]=m):m=e[11];let y;e[12]!==p||e[13]!==u||e[14]!==m||e[15]!==a?(y=c.jsx(dn,{asChild:!0,children:c.jsxs("button",{type:"button",className:a,children:[p,u,m]})}),e[12]=p,e[13]=u,e[14]=m,e[15]=a,e[16]=y):y=e[16];let b;e[17]!==r?(b=()=>r(null),e[17]=r,e[18]=b):b=e[18];let g;e[19]!==i?(g=i("taskBoard.taskFilters.priorityAnyPriority"),e[19]=i,e[20]=g):g=e[20];let x;e[21]!==g||e[22]!==b?(x=c.jsx(Ct,{onSelect:b,children:g}),e[21]=g,e[22]=b,e[23]=x):x=e[23];let k;e[24]!==r||e[25]!==i?(k=Si.map(j=>c.jsxs(Ct,{onSelect:()=>r(j),className:"gap-2",children:[c.jsx("span",{className:Z("size-2 rounded-full",It[j].dotClassName)}),i(It[j].labelKey)]},j)),e[24]=r,e[25]=i,e[26]=k):k=e[26];let v;e[27]!==x||e[28]!==k?(v=c.jsxs(un,{align:"start",className:"w-40",children:[x,k]}),e[27]=x,e[28]=k,e[29]=v):v=e[29];let w;return e[30]!==v||e[31]!==y?(w=c.jsxs(fn,{children:[y,v]}),e[30]=v,e[31]=y,e[32]=w):w=e[32],w}function Sg(t){const e=U.c(35),{value:n,onChange:r,block:s}=t,i=oe();let o;e[0]!==i||e[1]!==n?(o=n?i(To[n]):void 0,e[0]=i,e[1]=n,e[2]=o):o=e[2];const l=o,a=n!==null;let d;e[3]!==s||e[4]!==a?(d=vr(a,s),e[3]=s,e[4]=a,e[5]=d):d=e[5];const f=d,h=s&&"ml-auto";let p;e[6]!==h?(p=Z("shrink-0 opacity-60",h),e[6]=h,e[7]=p):p=e[7];const u=p;let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Yn,{size:14,className:"shrink-0"}),e[8]=m):m=e[8];let y;e[9]!==l||e[10]!==i?(y=l??i("taskBoard.taskFilters.dueDateLabel"),e[9]=l,e[10]=i,e[11]=y):y=e[11];let b;e[12]!==u?(b=c.jsx(fi,{size:12,className:u}),e[12]=u,e[13]=b):b=e[13];let g;e[14]!==y||e[15]!==b||e[16]!==f?(g=c.jsx(dn,{asChild:!0,children:c.jsxs("button",{type:"button",className:f,children:[m,y,b]})}),e[14]=y,e[15]=b,e[16]=f,e[17]=g):g=e[17];let x;e[18]!==r?(x=()=>r(null),e[18]=r,e[19]=x):x=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(Yn,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let v;e[21]!==i?(v=i("taskBoard.taskFilters.dueDateAnyTime"),e[21]=i,e[22]=v):v=e[22];let w;e[23]!==x||e[24]!==v?(w=c.jsxs(Ct,{onSelect:x,className:"gap-2",children:[k,v]}),e[23]=x,e[24]=v,e[25]=w):w=e[25];let j;e[26]!==r||e[27]!==i?(j=Object.entries(To).map(D=>{const[E,N]=D,I=E==="overdue";return c.jsxs(Ct,{onSelect:()=>r(E),className:Z("gap-2",I&&"text-destructive"),children:[c.jsx(Yn,{size:16,className:Z("shrink-0",I?"text-destructive":"text-muted-foreground")}),i(N)]},E)}),e[26]=r,e[27]=i,e[28]=j):j=e[28];let C;e[29]!==w||e[30]!==j?(C=c.jsxs(un,{align:"start",className:"w-44",children:[w,j]}),e[29]=w,e[30]=j,e[31]=C):C=e[31];let T;return e[32]!==C||e[33]!==g?(T=c.jsxs(fn,{children:[g,C]}),e[32]=C,e[33]=g,e[34]=T):T=e[34],T}function ga(t){const e=U.c(26),{filters:n,members:r,onChange:s,block:i}=t;let o;e[0]!==n||e[1]!==s?(o=u=>s({...n,assignee:u}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let l;e[3]!==i||e[4]!==n.assignee||e[5]!==r||e[6]!==o?(l=c.jsx(vg,{block:i,value:n.assignee,members:r,onChange:o}),e[3]=i,e[4]=n.assignee,e[5]=r,e[6]=o,e[7]=l):l=e[7];let a;e[8]!==n||e[9]!==s?(a=u=>s({...n,priority:u}),e[8]=n,e[9]=s,e[10]=a):a=e[10];let d;e[11]!==i||e[12]!==n.priority||e[13]!==a?(d=c.jsx(wg,{block:i,value:n.priority,onChange:a}),e[11]=i,e[12]=n.priority,e[13]=a,e[14]=d):d=e[14];let f;e[15]!==n||e[16]!==s?(f=u=>s({...n,due:u}),e[15]=n,e[16]=s,e[17]=f):f=e[17];let h;e[18]!==i||e[19]!==n.due||e[20]!==f?(h=c.jsx(Sg,{block:i,value:n.due,onChange:f}),e[18]=i,e[19]=n.due,e[20]=f,e[21]=h):h=e[21];let p;return e[22]!==l||e[23]!==d||e[24]!==h?(p=c.jsxs(c.Fragment,{children:[l,d,h]}),e[22]=l,e[23]=d,e[24]=h,e[25]=p):p=e[25],p}function Cg(t){const e=U.c(12),{filters:n,members:r,onChange:s}=t,i=oe();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(al,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=o):o=e[0];let l;e[1]!==n||e[2]!==r||e[3]!==s?(l=c.jsx(ga,{filters:n,members:r,onChange:s}),e[1]=n,e[2]=r,e[3]=s,e[4]=l):l=e[4];let a;e[5]!==n||e[6]!==s||e[7]!==i?(a=mg(n)&&c.jsx("button",{type:"button",onClick:()=>s(dr),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:i("taskBoard.taskFilters.clearButton")}),e[5]=n,e[6]=s,e[7]=i,e[8]=a):a=e[8];let d;return e[9]!==l||e[10]!==a?(d=c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,l,a]}),e[9]=l,e[10]=a,e[11]=d):d=e[11],d}function jg(t){const e=U.c(38),{filters:n,members:r,onChange:s}=t,i=oe(),[o,l]=S.useState(!1),a=xg(n),d=a>0;let f;e[0]!==d?(f=vr(d),e[0]=d,e[1]=f):f=e[1];const h=f;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(al,{size:14,className:"shrink-0"}),e[2]=p):p=e[2];let u;e[3]!==i?(u=i("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=i,e[4]=u):u=e[4];let m;e[5]!==a?(m=a>0&&c.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:a}),e[5]=a,e[6]=m):m=e[6];let y;e[7]!==u||e[8]!==m||e[9]!==h?(y=c.jsx(Lc,{asChild:!0,children:c.jsxs("button",{type:"button",className:h,children:[p,u,m]})}),e[7]=u,e[8]=m,e[9]=h,e[10]=y):y=e[10];let b;e[11]!==i?(b=i("taskBoard.taskFilters.filterDrawerTitle"),e[11]=i,e[12]=b):b=e[12];let g;e[13]!==b?(g=c.jsx(Pc,{className:"px-4 pt-4 text-base font-medium text-foreground",children:b}),e[13]=b,e[14]=g):g=e[14];let x;e[15]!==n||e[16]!==r||e[17]!==s?(x=c.jsx("div",{className:"flex flex-col gap-2 p-4",children:c.jsx(ga,{block:!0,filters:n,members:r,onChange:s})}),e[15]=n,e[16]=r,e[17]=s,e[18]=x):x=e[18];let k;e[19]!==a||e[20]!==s||e[21]!==i?(k=a>0&&c.jsx(Ae,{variant:"outline",className:"flex-1",onClick:()=>s(dr),children:i("taskBoard.taskFilters.clearAllButton")}),e[19]=a,e[20]=s,e[21]=i,e[22]=k):k=e[22];let v;e[23]!==i?(v=i("taskBoard.taskFilters.doneButton"),e[23]=i,e[24]=v):v=e[24];let w;e[25]!==v?(w=c.jsx(Fc,{asChild:!0,children:c.jsx(Ae,{className:"flex-1",children:v})}),e[25]=v,e[26]=w):w=e[26];let j;e[27]!==k||e[28]!==w?(j=c.jsxs(Uc,{className:"flex-row gap-2",children:[k,w]}),e[27]=k,e[28]=w,e[29]=j):j=e[29];let C;e[30]!==j||e[31]!==g||e[32]!==x?(C=c.jsxs(qc,{className:"p-0",children:[g,x,j]}),e[30]=j,e[31]=g,e[32]=x,e[33]=C):C=e[33];let T;return e[34]!==o||e[35]!==C||e[36]!==y?(T=c.jsxs(Kc,{open:o,onOpenChange:l,direction:"bottom",children:[y,C]}),e[34]=o,e[35]=C,e[36]=y,e[37]=T):T=e[37],T}Ra(()=>import("./index-D1QykbrQ.js").then(t=>t.bd),__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,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148])).catch(()=>{});function Tg(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("div",{className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:c.jsx("div",{className:"h-full p-0.5 pt-0.25",children:c.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:c.jsx(va,{})})})}),t[0]=e):e=t[0],e}const Ng=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function Dg(t){const e=new Date(t),n=e.getTime()<Date.now();return{label:Ng.format(e),overdue:n}}const Os="inline-flex items-center gap-1.5 rounded-lg border border-border bg-background px-2 py-1 text-xs font-medium text-muted-foreground";function ma(){const t=U.c(9),e=oe();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Z(Os,"border-warning/30 text-warning"),t[0]=n):n=t[0];let r;t[1]!==e?(r=e("taskBoard.taskBoard.blockedBadgeTitle"),t[1]=e,t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx(ti,{size:14}),t[3]=s):s=t[3];let i;t[4]!==e?(i=e("taskBoard.taskBoard.needsInput"),t[4]=e,t[5]=i):i=t[5];let o;return t[6]!==r||t[7]!==i?(o=c.jsxs("span",{className:n,title:r,children:[s,i]}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function xa(t){const e=U.c(10),{priority:n}=t,r=oe(),s=It[n];let i;e[0]!==s.dotClassName?(i=Z("size-2 rounded-full",s.dotClassName),e[0]=s.dotClassName,e[1]=i):i=e[1];let o;e[2]!==i?(o=c.jsx("span",{className:i}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==s.labelKey||e[5]!==r?(l=r(s.labelKey),e[4]=s.labelKey,e[5]=r,e[6]=l):l=e[6];let a;return e[7]!==o||e[8]!==l?(a=c.jsxs("span",{className:Os,children:[o,l]}),e[7]=o,e[8]=l,e[9]=a):a=e[9],a}function ba(t){const e=U.c(7),{iso:n}=t;let r,s;if(e[0]!==n){const{label:l,overdue:a}=Dg(n);r=l,s=Z(Os,a&&"border-destructive/30 text-destructive"),e[0]=n,e[1]=r,e[2]=s}else r=e[1],s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(Yn,{size:14}),e[3]=i):i=e[3];let o;return e[4]!==r||e[5]!==s?(o=c.jsxs("span",{className:s,children:[i,r]}),e[4]=r,e[5]=s,e[6]=o):o=e[6],o}function ya(t){const e=U.c(7),{tag:n}=t;let r;e[0]!==n.color?(r=As(n.color),e[0]=n.color,e[1]=r):r=e[1];let s;e[2]!==r?(s=c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:r}}),e[2]=r,e[3]=s):s=e[3];let i;return e[4]!==s||e[5]!==n.name?(i=c.jsxs("span",{className:Os,children:[s,n.name]}),e[4]=s,e[5]=n.name,e[6]=i):i=e[6],i}function ka(t){const e=U.c(32),{item:n,assignee:r,assignedBy:s,members:i,onAssign:o}=t,l=oe(),[a,d]=S.useState(!1);if(n.assigneeId===$e){let x;e[0]!==s||e[1]!==l?(x=s?.user?.name?l("taskBoard.taskBoard.assignedToSuperAgentBy",{name:s.user.name}):l("taskBoard.taskBoard.assignedToSuperAgent"),e[0]=s,e[1]=l,e[2]=x):x=e[2];let k;e[3]!==s?(k=s&&c.jsx(At,{url:s.user?.image??void 0,fallback:_t(s.user?.name),shape:"circle",size:"xs",className:"-mr-2 ring-2 ring-background"}),e[3]=s,e[4]=k):k=e[4];let v;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=c.jsx(Pt,{size:20,className:"ring-2 ring-background"}),e[5]=v):v=e[5];let w;return e[6]!==x||e[7]!==k?(w=c.jsxs("span",{className:"inline-flex items-center",title:x,children:[k,v]}),e[6]=x,e[7]=k,e[8]=w):w=e[8],w}if(r){const x=r.user?.image??void 0,k=r.user?.name;let v;e[9]!==k?(v=_t(k),e[9]=k,e[10]=v):v=e[10];let w;return e[11]!==x||e[12]!==v?(w=c.jsx(At,{url:x,fallback:v,shape:"circle",size:"xs"}),e[11]=x,e[12]=v,e[13]=w):w=e[13],w}if(!o||!i?.length)return null;let f;e[14]!==l?(f=l("taskBoard.taskBoard.assignButton"),e[14]=l,e[15]=f):f=e[15];let h;e[16]!==l?(h=l("taskBoard.taskBoard.assignButton"),e[16]=l,e[17]=h):h=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=x=>{x.stopPropagation(),d(!0)},e[18]=p):p=e[18];let u;e[19]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx(Po,{size:13}),e[19]=u):u=e[19];let m;e[20]!==f||e[21]!==h?(m=c.jsx(Xn,{asChild:!0,children:c.jsx("button",{type:"button",title:f,"aria-label":h,onClick:p,className:"flex size-6 shrink-0 items-center justify-center rounded-full border border-dashed border-muted-foreground/40 text-muted-foreground/40 transition-colors hover:border-muted-foreground hover:text-muted-foreground",children:u})}),e[20]=f,e[21]=h,e[22]=m):m=e[22];let y;e[23]!==o?(y=x=>{o(x),d(!1)},e[23]=o,e[24]=y):y=e[24];let b;e[25]!==i||e[26]!==y?(b=c.jsx(xs,{className:"w-56 p-0",align:"end",side:"bottom",onClick:Rg,children:c.jsx($i,{members:i,onSelect:y})}),e[25]=i,e[26]=y,e[27]=b):b=e[27];let g;return e[28]!==a||e[29]!==m||e[30]!==b?(g=c.jsxs(bs,{open:a,onOpenChange:d,children:[m,b]}),e[28]=a,e[29]=m,e[30]=b,e[31]=g):g=e[31],g}function Rg(t){return t.stopPropagation()}function va(){const t=U.c(147),e=oe(),{items:n,isLoading:r}=Cf(),s=jf(),i=Bc(),o=Za({slug:"mcp-github"})??[];let l;t[0]!==o?(l=o.some(Og),t[0]=o,t[1]=l):l=t[1];const a=l,[d,f]=S.useState(!1),[h,p]=S.useState(!1);let u;t[2]!==a?(u=M=>M===$e&&!a?(f(!0),!0):!1,t[2]=a,t[3]=u):u=t[3];const m=u,[y,b]=S.useState(null);let g;t[4]===Symbol.for("react.memo_cache_sentinel")?(g=M=>{const ne=Gc(M);ne&&b(ne)},t[4]=g):g=t[4];const x=g;let k;t[5]===Symbol.for("react.memo_cache_sentinel")?(k=[],t[5]=k):k=t[5];const[v,w]=S.useState(k),j=()=>{if(v.length!==0){if(m($e)){w([]);return}for(const M of v)s.rerun.mutate({id:M.id},{onError:ne=>x(ne)});w([]),$()}},{data:C}=Wo();let T,D;t[6]!==C?.data?.members?(T=C?.data?.members??[],D=new Map(T.map(Bg)),t[6]=C?.data?.members,t[7]=T,t[8]=D):(T=t[7],D=t[8]);const E=D,[N,I]=S.useState("board"),[A,_]=S.useState(dr);let z;t[9]===Symbol.for("react.memo_cache_sentinel")?(z=new Set,t[9]=z):z=t[9];const[R,O]=S.useState(z);let L;t[10]===Symbol.for("react.memo_cache_sentinel")?(L=M=>O(ne=>{const fe=new Set(ne);return fe.has(M)?fe.delete(M):fe.add(M),fe}),t[10]=L):L=t[10];const B=L,F=M=>O(ne=>{const fe=new Set(ne);for(const Pe of et)Pe.status===M&&fe.add(Pe.id);return fe}),$=()=>O(new Set),[W,K]=S.useState(!1),[Q,G]=S.useState(null),[Y,ee]=S.useState(null),{setTaskId:se}=Wc(),{create:re}=Vc(),q=gn(),{org:V,locator:J}=Me(),ie=Lo();let te;t[11]===Symbol.for("react.memo_cache_sentinel")?(te={strict:!1},t[11]=te):te=t[11];const{task:P}=Da(te);let H;t[12]!==P||t[13]!==n?(H=P?n.find(M=>M.id===P)??null:null,t[12]=P,t[13]=n,t[14]=H):H=t[14];const le=H;let ge;t[15]!==P||t[16]!==ie||t[17]!==V?(ge=()=>{P&&ie({to:"/$org/board",params:{org:V.slug},search:{},replace:!0})},t[15]=P,t[16]=ie,t[17]=V,t[18]=ge):ge=t[18];const ke=ge;let ye;t[19]!==s||t[20]!==re||t[21]!==J||t[22]!==V||t[23]!==se||t[24]!==q?(ye=async M=>{const ne=crypto.randomUUID(),fe=Qa(V.id).id,Pe=await q.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:M.id}).then(Ag).catch(_g),at=gg(M,Pe),Nt={type:"doc",content:[{type:"paragraph",content:[Ec({id:M.id,name:M.title,char:"@",kind:"task",metadata:{title:M.title,description:M.description,context:at}}),{type:"text",text:" "}]}]};Zc(sessionStorage,J,ne,Nt),K(!1);try{await re({id:ne,virtual_mcp_id:fe}),await s.link.mutateAsync({id:M.id,linkThreadId:ne})}catch{}se(ne,fe)},t[19]=s,t[20]=re,t[21]=J,t[22]=V,t[23]=se,t[24]=q,t[25]=ye):ye=t[25];const Ne=ye;let Be;t[26]!==A?(Be=M=>kg(M,A),t[26]=A,t[27]=Be):Be=t[27];const et=n.filter(Be);let dt;t[28]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>{G(null),ee(null),K(!0)},t[28]=dt):dt=t[28];const Gt=dt;let ot;t[29]===Symbol.for("react.memo_cache_sentinel")?(ot=M=>{G(null),ee(M),K(!0)},t[29]=ot):ot=t[29];const ue=ot;let Qe;t[30]===Symbol.for("react.memo_cache_sentinel")?(Qe=M=>{G(M),K(!0)},t[30]=Qe):Qe=t[30];const Xt=Qe;let Le;t[31]!==le||t[32]!==Q||t[33]!==n?(Le=(Q&&n.find(M=>M.id===Q.id))??Q??le,t[31]=le,t[32]=Q,t[33]=n,t[34]=Le):Le=t[34];const de=Le,De=W||!!le;let ut;t[35]!==ke?(ut=()=>{K(!1),G(null),ee(null),ke()},t[35]=ke,t[36]=ut):ut=t[36];const he=ut;if(r&&n.length===0){let M;return t[37]===Symbol.for("react.memo_cache_sentinel")?(M=c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(Ts,{size:20,className:"animate-spin text-muted-foreground"})}),t[37]=M):M=t[37],M}const Bt="relative flex min-h-0 flex-1 flex-col";let tt;t[38]!==e?(tt=e("taskBoard.taskBoard.tasksTitle"),t[38]=e,t[39]=tt):tt=t[39];let We;t[40]!==tt?(We=c.jsx("h1",{className:"text-xl font-medium text-foreground",children:tt}),t[40]=tt,t[41]=We):We=t[41];let nt;t[42]!==i?(nt=i&&c.jsx(og,{}),t[42]=i,t[43]=nt):nt=t[43];let st;t[44]!==A||t[45]!==n.length||t[46]!==T?(st=n.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sm:hidden",children:c.jsx(jg,{filters:A,members:T,onChange:_})}),c.jsx("div",{className:"hidden sm:block",children:c.jsx(Cg,{filters:A,members:T,onChange:_})})]}),t[44]=A,t[45]=n.length,t[46]=T,t[47]=st):st=t[47];const Tt=N==="list";let pe;t[48]!==$?(pe=()=>{I("list"),$()},t[48]=$,t[49]=pe):pe=t[49];let ve;t[50]!==e?(ve=e("common.taskBoard.listView"),t[50]=e,t[51]=ve):ve=t[51];let we;t[52]!==Tt||t[53]!==pe||t[54]!==ve?(we=c.jsx(No,{active:Tt,onClick:pe,icon:Uo,label:ve}),t[52]=Tt,t[53]=pe,t[54]=ve,t[55]=we):we=t[55];const Fe=N==="board";let Re;t[56]===Symbol.for("react.memo_cache_sentinel")?(Re=()=>I("board"),t[56]=Re):Re=t[56];let Se;t[57]!==e?(Se=e("common.taskBoard.boardView"),t[57]=e,t[58]=Se):Se=t[58];let Ce;t[59]!==Fe||t[60]!==Se?(Ce=c.jsx(No,{active:Fe,onClick:Re,icon:Fa,label:Se}),t[59]=Fe,t[60]=Se,t[61]=Ce):Ce=t[61];let Oe;t[62]!==we||t[63]!==Ce?(Oe=c.jsxs("div",{className:"inline-flex rounded-lg bg-muted p-0.5",children:[we,Ce]}),t[62]=we,t[63]=Ce,t[64]=Oe):Oe=t[64];let me;t[65]===Symbol.for("react.memo_cache_sentinel")?(me=c.jsx(ws,{size:16}),t[65]=me):me=t[65];let Ee;t[66]!==e?(Ee=e("taskBoard.taskBoard.newTask"),t[66]=e,t[67]=Ee):Ee=t[67];let Ie;t[68]!==Ee?(Ie=c.jsxs(Ae,{size:"sm",onClick:Gt,children:[me,Ee]}),t[68]=Ee,t[69]=Ie):Ie=t[69];let _e;t[70]!==Oe||t[71]!==Ie?(_e=c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[Oe,Ie]}),t[70]=Oe,t[71]=Ie,t[72]=_e):_e=t[72];let Ue;t[73]!==st||t[74]!==_e?(Ue=c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[st,_e]}),t[73]=st,t[74]=_e,t[75]=Ue):Ue=t[75];let qe;t[76]!==We||t[77]!==nt||t[78]!==Ue?(qe=c.jsxs("div",{className:"mx-auto flex w-full max-w-[1680px] flex-col gap-4 px-4 pt-6 sm:px-8 sm:pt-8",children:[We,nt,Ue]}),t[76]=We,t[77]=nt,t[78]=Ue,t[79]=qe):qe=t[79];const Ge=n.length===0?c.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:c.jsx("div",{className:"rounded-xl bg-card px-4 py-12 text-center text-sm text-muted-foreground card-shadow",children:e("taskBoard.taskBoard.noTasksYet")})}):et.length===0?c.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:c.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl bg-card px-4 py-12 text-center text-sm text-muted-foreground card-shadow",children:[e("taskBoard.taskBoard.noTasksMatch"),c.jsx(Ae,{variant:"outline",size:"sm",onClick:()=>_(dr),children:e("taskBoard.taskBoard.clearFilters")})]})}):N==="board"?c.jsx(zg,{items:et,members:T,memberByUserId:E,selectedIds:R,onToggleSelect:B,onSelectAllInLane:F,onOpen:Xt,onCreate:ue,onMove:(M,ne,fe)=>{const Pe=zl(fe,M.length);M.forEach((at,Nt)=>s.update.mutate({id:at,status:ne,sortOrder:Pe[Nt]}))},onAssign:(M,ne)=>{m(ne)||s.update.mutate({id:M,assigneeId:ne},{onError:x})},onAutoFix:M=>{m($e)||s.update.mutate({id:M.id,assigneeId:$e},{onError:x})},onRerun:M=>w([M])}):c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pt-6 pb-16 sm:px-8",children:c.jsx("div",{className:"mx-auto flex max-w-[820px] flex-col gap-2",children:et.map(M=>c.jsx(Vg,{item:M,assignee:M.assigneeId?E.get(M.assigneeId):void 0,assignedBy:M.assignedBy?E.get(M.assignedBy):void 0,onOpen:()=>Xt(M)},M.id))})}),Xe=De?de?.id??`new-${Y??"default"}`:"closed",lt=de??void 0,qt=Y??void 0,Kt=s.create.isPending||s.update.isPending;let ft;t[80]!==s.create||t[81]!==s.update||t[82]!==de||t[83]!==m||t[84]!==he?(ft=M=>{if(m(M.assigneeId)){he();return}if(de){const{title:ne,description:fe,priority:Pe,...at}=M,Nt=Vo(de)?{}:{title:ne,description:fe,priority:Pe};s.update.mutate({id:de.id,...at,...Nt},{onError:x})}else s.create.mutate(M);he()},t[80]=s.create,t[81]=s.update,t[82]=de,t[83]=m,t[84]=he,t[85]=ft):ft=t[85];let ht;t[86]!==s.remove||t[87]!==de||t[88]!==he?(ht=de?()=>{s.remove.mutate(de.id),he()}:void 0,t[86]=s.remove,t[87]=de,t[88]=he,t[89]=ht):ht=t[89];let pt;t[90]!==de||t[91]!==Ne?(pt=de?()=>{Ne(de)}:void 0,t[90]=de,t[91]=Ne,t[92]=pt):pt=t[92];let gt;t[93]!==s.update||t[94]!==de||t[95]!==m||t[96]!==he?(gt=de?()=>{m($e)||(s.update.mutate({id:de.id,assigneeId:$e},{onError:x}),he())}:void 0,t[93]=s.update,t[94]=de,t[95]=m,t[96]=he,t[97]=gt):gt=t[97];let mt;t[98]!==de||t[99]!==he?(mt=de?()=>{he(),w([de])}:void 0,t[98]=de,t[99]=he,t[100]=mt):mt=t[100];let xt;t[101]!==he||t[102]!==se?(xt=M=>{M.virtualMcpId&&(he(),se(M.threadId,M.virtualMcpId,{main:M.hasPreview?"preview":"board"}))},t[101]=he,t[102]=se,t[103]=xt):xt=t[103];let bt;t[104]!==he||t[105]!==De||t[106]!==Xe||t[107]!==lt||t[108]!==qt||t[109]!==Kt||t[110]!==ft||t[111]!==ht||t[112]!==pt||t[113]!==gt||t[114]!==mt||t[115]!==xt?(bt=c.jsx(Ep,{open:De,onClose:he,item:lt,defaultStatus:qt,isSaving:Kt,onSubmit:ft,onDelete:ht,onNewChat:pt,onAutoFix:gt,onRerun:mt,onOpenThread:xt},Xe),t[104]=he,t[105]=De,t[106]=Xe,t[107]=lt,t[108]=qt,t[109]=Kt,t[110]=ft,t[111]=ht,t[112]=pt,t[113]=gt,t[114]=mt,t[115]=xt,t[116]=bt):bt=t[116];let Ot;t[117]===Symbol.for("react.memo_cache_sentinel")?(Ot=()=>p(!0),t[117]=Ot):Ot=t[117];let Ht;t[118]!==d?(Ht=c.jsx($g,{open:d,onOpenChange:f,onConnected:Ot}),t[118]=d,t[119]=Ht):Ht=t[119];let yt;t[120]!==h?(yt=c.jsx(Xa,{mode:"connection",open:h,onOpenChange:p}),t[120]=h,t[121]=yt):yt=t[121];let $t;t[122]===Symbol.for("react.memo_cache_sentinel")?($t=M=>!M&&b(null),t[122]=$t):$t=t[122];let kt;t[123]!==y?(kt=c.jsx(ag,{kind:y,onOpenChange:$t}),t[123]=y,t[124]=kt):kt=t[124];let Mt;t[125]===Symbol.for("react.memo_cache_sentinel")?(Mt=M=>!M&&w([]),t[125]=Mt):Mt=t[125];let vt;t[126]!==s.rerun.isPending||t[127]!==j||t[128]!==v?(vt=c.jsx(ug,{items:v,pending:s.rerun.isPending,onOpenChange:Mt,onConfirm:j}),t[126]=s.rerun.isPending,t[127]=j,t[128]=v,t[129]=vt):vt=t[129];let wt;t[130]!==s.removeMany||t[131]!==s.update||t[132]!==m||t[133]!==$||t[134]!==n||t[135]!==T||t[136]!==R?(wt=R.size>0&&c.jsx(Mg,{count:R.size,members:T,onMoveTo:M=>{for(const ne of R)s.update.mutate({id:ne,status:M});$()},onSetPriority:M=>{for(const ne of R)s.update.mutate({id:ne,priority:M});$()},onAddTag:M=>{for(const ne of R){const fe=n.find(at=>at.id===ne);if(!fe)continue;const Pe=fe.tags.map(Ig);Pe.includes(M)||s.update.mutate({id:ne,tagIds:[...Pe,M]})}$()},onAssign:M=>{if(!m(M)){for(const ne of R)s.update.mutate({id:ne,assigneeId:M},{onError:x});$()}},onSetDueDate:M=>{const ne=Gr(M);for(const fe of R)s.update.mutate({id:fe,dueDate:ne});$()},onAutoFix:R.size>0&&Array.from(R).every(M=>{const ne=n.find(fe=>fe.id===M);return ne&&(ne.status==="triage"||ne.status==="todo")&&ne.assigneeId!==$e})?()=>{if(!m($e)){for(const M of R)s.update.mutate({id:M,assigneeId:$e},{onError:x});$()}}:void 0,onRerun:(()=>{const M=Array.from(R).flatMap(ne=>{const fe=n.find(Pe=>Pe.id===ne);return fe?[fe]:[]});return M.length===R.size&&M.every(Eg)?()=>w(M):void 0})(),onDelete:()=>{s.removeMany.mutate(Array.from(R)),$()},onClear:$}),t[130]=s.removeMany,t[131]=s.update,t[132]=m,t[133]=$,t[134]=n,t[135]=T,t[136]=R,t[137]=wt):wt=t[137];let tn;return t[138]!==qe||t[139]!==Ge||t[140]!==bt||t[141]!==Ht||t[142]!==yt||t[143]!==kt||t[144]!==vt||t[145]!==wt?(tn=c.jsxs("div",{className:Bt,children:[qe,Ge,bt,Ht,yt,kt,vt,wt]}),t[138]=qe,t[139]=Ge,t[140]=bt,t[141]=Ht,t[142]=yt,t[143]=kt,t[144]=vt,t[145]=wt,t[146]=tn):tn=t[146],tn}function Eg(t){return t.assigneeId===$e&&t.status!=="done"}function Ig(t){return t.id}function _g(){return[]}function Ag(t){return t.prs}function Bg(t){return[t.userId,t]}function Og(t){return t.status==="active"&&Ja(t)!==null}function $g(t){const e=U.c(32),{open:n,onOpenChange:r,onConnected:s}=t,i=oe(),{connect:o,isConnecting:l}=sf("deco/mcp-github");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx("div",{className:"flex h-28 items-center justify-center bg-gradient-to-br from-muted via-muted to-accent",children:c.jsx("div",{className:"flex size-14 items-center justify-center rounded-2xl bg-foreground text-background shadow-sm",children:c.jsx($r,{className:"size-7"})})}),e[0]=a):a=e[0];let d;e[1]!==i?(d=i("taskBoard.taskBoard.connectGithubTitle"),e[1]=i,e[2]=d):d=e[2];let f;e[3]!==d?(f=c.jsx(ts,{children:d}),e[3]=d,e[4]=f):f=e[4];let h;e[5]!==i?(h=i("taskBoard.taskBoard.connectGithubDescription"),e[5]=i,e[6]=h):h=e[6];let p;e[7]!==h?(p=c.jsx(ni,{children:h}),e[7]=h,e[8]=p):p=e[8];let u;e[9]!==f||e[10]!==p?(u=c.jsxs(si,{children:[f,p]}),e[9]=f,e[10]=p,e[11]=u):u=e[11];let m;e[12]!==o||e[13]!==s||e[14]!==r?(m=async()=>{await o(),r(!1),s()},e[12]=o,e[13]=s,e[14]=r,e[15]=m):m=e[15];let y;e[16]!==l?(y=l?c.jsx(Ts,{size:16,className:"animate-spin"}):c.jsx($r,{className:"size-4"}),e[16]=l,e[17]=y):y=e[17];let b;e[18]!==i?(b=i("taskBoard.taskBoard.connectGithubButton"),e[18]=i,e[19]=b):b=e[19];let g;e[20]!==l||e[21]!==m||e[22]!==y||e[23]!==b?(g=c.jsx(ri,{children:c.jsxs(Ae,{onClick:m,disabled:l,className:"gap-2",children:[y,b]})}),e[20]=l,e[21]=m,e[22]=y,e[23]=b,e[24]=g):g=e[24];let x;e[25]!==g||e[26]!==u?(x=c.jsxs(es,{className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[a,c.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[u,g]})]}),e[25]=g,e[26]=u,e[27]=x):x=e[27];let k;return e[28]!==r||e[29]!==n||e[30]!==x?(k=c.jsx(Jn,{open:n,onOpenChange:r,children:x}),e[28]=r,e[29]=n,e[30]=x,e[31]=k):k=e[31],k}function Mg(t){const e=U.c(95),{count:n,members:r,onMoveTo:s,onSetPriority:i,onAddTag:o,onAssign:l,onSetDueDate:a,onAutoFix:d,onRerun:f,onDelete:h,onClear:p}=t,u=oe(),{data:m}=Qo();let y;e[0]!==m?(y=m===void 0?[]:m,e[0]=m,e[1]=y):y=e[1];const b=y;let g;e[2]!==n||e[3]!==u?(g=u("taskBoard.taskBoard.selectedCount",{count:n}),e[2]=n,e[3]=u,e[4]=g):g=e[4];let x;e[5]!==g?(x=c.jsx("span",{className:"pl-1 text-sm font-medium text-foreground",children:g}),e[5]=g,e[6]=x):x=e[6];let k;e[7]!==u?(k=u("taskBoard.taskBoard.actionsButton"),e[7]=u,e[8]=k):k=e[8];let v;e[9]!==k?(v=c.jsx(dn,{asChild:!0,children:c.jsx("button",{type:"button",className:"flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-accent",children:k})}),e[9]=k,e[10]=v):v=e[10];let w;e[11]!==u?(w=u("taskBoard.taskBoard.moveToButton"),e[11]=u,e[12]=w):w=e[12];let j;e[13]!==w?(j=c.jsx(as,{children:w}),e[13]=w,e[14]=j):j=e[14];let C;e[15]!==s||e[16]!==u?(C=ir.map(H=>c.jsx(Ct,{onClick:()=>s(H),children:u(Et[H].labelKey)},H)),e[15]=s,e[16]=u,e[17]=C):C=e[17];let T;e[18]!==C?(T=c.jsx(cs,{children:C}),e[18]=C,e[19]=T):T=e[19];let D;e[20]!==T||e[21]!==j?(D=c.jsxs(ls,{children:[j,T]}),e[20]=T,e[21]=j,e[22]=D):D=e[22];let E;e[23]!==u?(E=u("taskBoard.taskBoard.changePriorityButton"),e[23]=u,e[24]=E):E=e[24];let N;e[25]!==E?(N=c.jsx(as,{children:E}),e[25]=E,e[26]=N):N=e[26];let I;e[27]!==i||e[28]!==u?(I=Si.map(H=>c.jsxs(Ct,{onClick:()=>i(H),children:[c.jsx("span",{className:Z("size-2 rounded-full",It[H].dotClassName)}),u(It[H].labelKey)]},H)),e[27]=i,e[28]=u,e[29]=I):I=e[29];let A;e[30]!==I?(A=c.jsx(cs,{children:I}),e[30]=I,e[31]=A):A=e[31];let _;e[32]!==N||e[33]!==A?(_=c.jsxs(ls,{children:[N,A]}),e[32]=N,e[33]=A,e[34]=_):_=e[34];let z;e[35]!==u?(z=u("taskBoard.taskBoard.assignButton"),e[35]=u,e[36]=z):z=e[36];let R;e[37]!==z?(R=c.jsx(as,{children:z}),e[37]=z,e[38]=R):R=e[38];let O;e[39]!==r||e[40]!==l?(O=c.jsx(cs,{className:"w-56 p-0",children:c.jsx($i,{members:r,onSelect:l})}),e[39]=r,e[40]=l,e[41]=O):O=e[41];let L;e[42]!==R||e[43]!==O?(L=c.jsxs(ls,{children:[R,O]}),e[42]=R,e[43]=O,e[44]=L):L=e[44];let B;e[45]!==u?(B=u("taskBoard.taskBoard.dueDateButton"),e[45]=u,e[46]=B):B=e[46];let F;e[47]!==B?(F=c.jsx(as,{children:B}),e[47]=B,e[48]=F):F=e[48];let $;e[49]!==a?($=c.jsx(cs,{className:"w-auto p-0",children:c.jsx(nl,{mode:"single",onSelect:H=>H&&a(H),initialFocus:!0})}),e[49]=a,e[50]=$):$=e[50];let W;e[51]!==F||e[52]!==$?(W=c.jsxs(ls,{children:[F,$]}),e[51]=F,e[52]=$,e[53]=W):W=e[53];let K;e[54]!==o||e[55]!==b||e[56]!==u?(K=b.length>0&&c.jsxs(ls,{children:[c.jsx(as,{children:u("taskBoard.taskBoard.addTagButton")}),c.jsx(cs,{children:b.map(H=>c.jsxs(Ct,{onClick:()=>o(H.id),children:[c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:As(H.color)}}),H.name]},H.id))})]}),e[54]=o,e[55]=b,e[56]=u,e[57]=K):K=e[57];let Q;e[58]===Symbol.for("react.memo_cache_sentinel")?(Q=c.jsx(qo,{}),e[58]=Q):Q=e[58];let G;e[59]!==u?(G=u("taskBoard.taskBoard.deleteSelectedButton"),e[59]=u,e[60]=G):G=e[60];let Y;e[61]!==h||e[62]!==G?(Y=c.jsx(Ct,{variant:"destructive",onClick:h,children:G}),e[61]=h,e[62]=G,e[63]=Y):Y=e[63];let ee;e[64]!==D||e[65]!==_||e[66]!==L||e[67]!==W||e[68]!==K||e[69]!==Y?(ee=c.jsxs(un,{align:"center",side:"top",children:[D,_,L,W,K,Q,Y]}),e[64]=D,e[65]=_,e[66]=L,e[67]=W,e[68]=K,e[69]=Y,e[70]=ee):ee=e[70];let se;e[71]!==ee||e[72]!==v?(se=c.jsxs(fn,{children:[v,ee]}),e[71]=ee,e[72]=v,e[73]=se):se=e[73];let re;e[74]!==d||e[75]!==u?(re=d&&c.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-accent",children:[c.jsx(ur,{size:14}),u("taskBoard.taskBoard.autoFix")]}),e[74]=d,e[75]=u,e[76]=re):re=e[76];let q;e[77]!==f||e[78]!==u?(q=f&&c.jsxs("button",{type:"button",onClick:f,className:"flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-accent",children:[c.jsx(Zr,{size:14}),u("taskBoard.taskBoard.rerun")]}),e[77]=f,e[78]=u,e[79]=q):q=e[79];let V;e[80]!==u?(V=u("taskBoard.taskBoard.clearSelectionButton"),e[80]=u,e[81]=V):V=e[81];let J;e[82]!==u?(J=u("taskBoard.taskBoard.clearSelectionButton"),e[82]=u,e[83]=J):J=e[83];let ie;e[84]===Symbol.for("react.memo_cache_sentinel")?(ie=c.jsx(cn,{size:16}),e[84]=ie):ie=e[84];let te;e[85]!==p||e[86]!==V||e[87]!==J?(te=c.jsx("button",{type:"button","aria-label":V,title:J,onClick:p,className:"flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:ie}),e[85]=p,e[86]=V,e[87]=J,e[88]=te):te=e[88];let P;return e[89]!==se||e[90]!==re||e[91]!==q||e[92]!==te||e[93]!==x?(P=c.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-6 z-20 flex justify-center",children:c.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 rounded-full bg-background px-3 py-2 card-shadow",children:[x,se,re,q,te]})}),e[89]=se,e[90]=re,e[91]=q,e[92]=te,e[93]=x,e[94]=P):P=e[94],P}function No(t){const e=U.c(14),{active:n,onClick:r,icon:s,label:i}=t,o=oe();let l;e[0]!==i||e[1]!==o?(l=o("taskBoard.taskBoard.layoutViewAriaLabel",{label:i}),e[0]=i,e[1]=o,e[2]=l):l=e[2];const a=n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground";let d;e[3]!==a?(d=Z("flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",a),e[3]=a,e[4]=d):d=e[4];let f;e[5]!==s?(f=c.jsx(s,{size:14}),e[5]=s,e[6]=f):f=e[6];let h;return e[7]!==n||e[8]!==i||e[9]!==r||e[10]!==l||e[11]!==d||e[12]!==f?(h=c.jsxs("button",{type:"button",onClick:r,"aria-label":l,"aria-pressed":n,className:d,children:[f,i]}),e[7]=n,e[8]=i,e[9]=r,e[10]=l,e[11]=d,e[12]=f,e[13]=h):h=e[13],h}const ms="lane:";function Do(t,e){return t.sortOrder-e.sortOrder}function zg(t){const e=U.c(30),{items:n,members:r,memberByUserId:s,selectedIds:i,onToggleSelect:o,onSelectAllInLane:l,onOpen:a,onCreate:d,onMove:f,onAutoFix:h,onRerun:p,onAssign:u}=t,[m,y]=S.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=[],e[0]=b):b=e[0];const[g,x]=S.useState(b);let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=new Map,e[1]=k):k=e[1];const[v,w]=S.useState(k),j=S.useRef(null),C=v.size>0?n.map(P=>{const H=v.get(P.id);return H?{...P,...H}:P}):n;if(v.size>0&&!m){const P=[...v].filter(H=>{const[le,ge]=H,ke=n.find(ye=>ye.id===le);return ke?.status===ge.status&&ke.sortOrder===ge.sortOrder});P.length>0&&w(H=>{const le=new Map(H);for(const[ge]of P)le.delete(ge);return le})}pg(j,C.map(Ug).join(","),m===null);const T=P=>C.filter(H=>H.status===P).sort(Do),D=P=>{if(P===void 0)return null;const H=String(P);if(H.startsWith(ms)){const le=H.slice(ms.length);return ir.find(ge=>ge===le)??null}return C.find(le=>le.id===H)?.status??null};let E;e[2]!==i?(E=P=>i.has(P)&&i.size>1?[P,...Array.from(i).filter(H=>H!==P)]:[P],e[2]=i,e[3]=E):E=e[3];const N=E;let I;e[4]===Symbol.for("react.memo_cache_sentinel")?(I=(P,H,le)=>{const ge=zl(le,P.length);w(ke=>{const ye=new Map(ke);return P.forEach((Ne,Be)=>ye.set(Ne,{status:H,sortOrder:ge[Be]})),ye})},e[4]=I):I=e[4];const A=I;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_={activationConstraint:{distance:4}},e[5]=_):_=e[5];let z;e[6]===Symbol.for("react.memo_cache_sentinel")?(z={coordinateGetter:vf},e[6]=z):z=e[6];const R=Ud(Ui(yi,_),Ui(xi,z)),O=P=>{const H=String(P.active.id),le=D(P.over?.id),ge=C.find(Be=>Be.id===H);if(!le||!ge||ge.status===le)return;const ke=N(H),ye=String(P.over?.id??""),Ne=T(le).filter(Be=>!ke.includes(Be.id));A(ke,le,so(Ne,ye.startsWith(ms)?null:ye,H))},L=P=>{const H=String(P.active.id);y(null);const le=D(P.over?.id)??C.find(ue=>ue.id===H)?.status;if(!le){w(new Map);return}const ge=N(H),ke=T(le),ye=String(P.over?.id??""),Ne=ke.findIndex(ue=>ue.id===H),Be=ye.startsWith(ms)?ke.length-1:ke.findIndex(ue=>ue.id===ye),et=Ne===-1||Be===-1?ke:vi(ke,Ne,Be);if(n.filter(ue=>ue.status===le).sort(Do).map(Fg).join()===et.map(Pg).join()){w(new Map);return}const Gt=et.slice(et.findIndex(ue=>ue.id===H)+1).find(ue=>!ge.includes(ue.id)),ot=so(ke.filter(ue=>!ge.includes(ue.id)),Gt?.id??null,H);A(ge,le,ot),x(ge),f(ge,le,ot)},B=m?C.find(P=>P.id===m):null;let F;e[7]!==m||e[8]!==N?(F=m?N(m):[],e[7]=m,e[8]=N,e[9]=F):F=e[9];const $=F,W=zu,K=gl;let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>{y(String(P.active.id)),x([])},e[10]=Q):Q=e[10];let G;e[11]===Symbol.for("react.memo_cache_sentinel")?(G=()=>{y(null),w(new Map)},e[11]=G):G=e[11];const Y=ir.map(P=>c.jsx(qg,{status:P,items:T(P),members:r,memberByUserId:s,selectedIds:i,isTarget:B?.status===P,hiddenIds:$,landedIds:g,onToggleSelect:o,onSelectAllInLane:l,onOpen:a,onCreate:d,onAutoFix:h,onRerun:p,onAssign:u},P));let ee;e[12]!==Y?(ee=c.jsx("div",{ref:j,className:"min-h-0 flex-1 overflow-x-auto",children:c.jsx("div",{className:"mx-auto flex h-full w-full max-w-[1680px] gap-3 px-4 pt-6 sm:px-8",children:Y})}),e[12]=Y,e[13]=ee):ee=e[13];const se=sn.createPortal,re=nf,q=null,V=B&&c.jsxs("div",{className:"relative w-[292px] cursor-grabbing",children:[c.jsx(wa,{item:B,assignee:B.assigneeId?s.get(B.assigneeId):void 0,assignedBy:B.assignedBy?s.get(B.assignedBy):void 0,selected:i.has(B.id),onOpen:Lg,className:"w-full shadow-lg"}),$.length>1&&c.jsx("span",{className:"absolute -top-2 -right-2 flex h-5 min-w-5 items-center justify-center rounded-full bg-foreground px-1.5 text-[11px] font-semibold text-background",children:$.length})]});let J;e[14]!==re||e[15]!==V?(J=c.jsx(re,{dropAnimation:q,children:V}),e[14]=re,e[15]=V,e[16]=J):J=e[16];let ie;e[17]!==se||e[18]!==J?(ie=se(J,document.body),e[17]=se,e[18]=J,e[19]=ie):ie=e[19];let te;return e[20]!==W||e[21]!==L||e[22]!==O||e[23]!==R||e[24]!==G||e[25]!==ee||e[26]!==ie||e[27]!==K||e[28]!==Q?(te=c.jsxs(W,{sensors:R,collisionDetection:K,onDragStart:Q,onDragOver:O,onDragEnd:L,onDragCancel:G,children:[ee,ie]}),e[20]=W,e[21]=L,e[22]=O,e[23]=R,e[24]=G,e[25]=ee,e[26]=ie,e[27]=K,e[28]=Q,e[29]=te):te=e[29],te}function Lg(){}function Pg(t){return t.id}function Fg(t){return t.id}function Ug(t){return`${t.id}:${t.status}`}function qg(t){const e=U.c(93),{status:n,items:r,members:s,memberByUserId:i,selectedIds:o,isTarget:l,hiddenIds:a,landedIds:d,onToggleSelect:f,onSelectAllInLane:h,onOpen:p,onCreate:u,onAutoFix:m,onRerun:y,onAssign:b}=t,g=oe(),x=Et[n],k=x.icon,v=`${ms}${n}`;let w;e[0]!==v?(w={id:v},e[0]=v,e[1]=w):w=e[1];const{setNodeRef:j}=_l(w),C=l&&"bg-muted/50";let T;e[2]!==C?(T=Z("flex h-full w-[300px] shrink-0 flex-col rounded-xl py-1 transition-colors",C),e[2]=C,e[3]=T):T=e[3];const D=l?"bg-muted":"bg-background";let E;e[4]!==D?(E=Z("sticky top-0 z-10 flex items-center gap-2 px-2 py-1.5 transition-colors",D),e[4]=D,e[5]=E):E=e[5];let N;e[6]!==x.iconClassName?(N=Z("shrink-0",x.iconClassName.replace(/\banimate-\S+\b/g,"").trim()),e[6]=x.iconClassName,e[7]=N):N=e[7];let I;e[8]!==k||e[9]!==N?(I=c.jsx(k,{size:15,className:N}),e[8]=k,e[9]=N,e[10]=I):I=e[10];let A;e[11]!==x.labelKey||e[12]!==g?(A=g(x.labelKey),e[11]=x.labelKey,e[12]=g,e[13]=A):A=e[13];let _;e[14]!==A?(_=c.jsx("span",{className:"text-sm font-medium text-foreground",children:A}),e[14]=A,e[15]=_):_=e[15];let z;e[16]!==r.length?(z=c.jsx("span",{className:"rounded-md bg-muted px-1.5 text-[11px] font-medium text-muted-foreground",children:r.length}),e[16]=r.length,e[17]=z):z=e[17];let R;e[18]!==x.labelKey||e[19]!==g?(R=g("taskBoard.taskBoard.laneMenuAriaLabel",{lane:g(x.labelKey)}),e[18]=x.labelKey,e[19]=g,e[20]=R):R=e[20];let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=c.jsx(ei,{size:15}),e[21]=O):O=e[21];let L;e[22]!==R?(L=c.jsx(dn,{asChild:!0,children:c.jsx("button",{type:"button","aria-label":R,className:"ml-auto flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:O})}),e[22]=R,e[23]=L):L=e[23];let B;e[24]!==h||e[25]!==n?(B=()=>h(n),e[24]=h,e[25]=n,e[26]=B):B=e[26];let F;e[27]!==g?(F=g("taskBoard.taskBoard.selectAllInLane"),e[27]=g,e[28]=F):F=e[28];let $;e[29]!==B||e[30]!==F?($=c.jsx(un,{align:"end",children:c.jsx(Ct,{onClick:B,children:F})}),e[29]=B,e[30]=F,e[31]=$):$=e[31];let W;e[32]!==L||e[33]!==$?(W=c.jsxs(fn,{children:[L,$]}),e[32]=L,e[33]=$,e[34]=W):W=e[34];let K;e[35]!==x.labelKey||e[36]!==g?(K=g("taskBoard.taskBoard.newTaskInLaneAriaLabel",{lane:g(x.labelKey)}),e[35]=x.labelKey,e[36]=g,e[37]=K):K=e[37];let Q;e[38]!==x.labelKey||e[39]!==g?(Q=g("taskBoard.taskBoard.newTaskInLaneTitle",{lane:g(x.labelKey)}),e[38]=x.labelKey,e[39]=g,e[40]=Q):Q=e[40];let G;e[41]!==u||e[42]!==n?(G=()=>u(n),e[41]=u,e[42]=n,e[43]=G):G=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=c.jsx(ws,{size:15}),e[44]=Y):Y=e[44];let ee;e[45]!==K||e[46]!==Q||e[47]!==G?(ee=c.jsx("button",{type:"button","aria-label":K,title:Q,onClick:G,className:"flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:Y}),e[45]=K,e[46]=Q,e[47]=G,e[48]=ee):ee=e[48];let se;e[49]!==_||e[50]!==z||e[51]!==W||e[52]!==ee||e[53]!==E||e[54]!==I?(se=c.jsxs("div",{className:E,children:[I,_,z,W,ee]}),e[49]=_,e[50]=z,e[51]=W,e[52]=ee,e[53]=E,e[54]=I,e[55]=se):se=e[55];let re;e[56]!==r?(re=r.map(Kg),e[56]=r,e[57]=re):re=e[57];let q;if(e[58]!==a||e[59]!==r||e[60]!==d||e[61]!==i||e[62]!==s||e[63]!==b||e[64]!==m||e[65]!==p||e[66]!==y||e[67]!==f||e[68]!==o){let te;e[70]!==a||e[71]!==d||e[72]!==i||e[73]!==s||e[74]!==b||e[75]!==m||e[76]!==p||e[77]!==y||e[78]!==f||e[79]!==o?(te=P=>c.jsx(Hg,{item:P,assignee:P.assigneeId?i.get(P.assigneeId):void 0,assignedBy:P.assignedBy?i.get(P.assignedBy):void 0,members:s,selected:o.has(P.id),hidden:a.includes(P.id),landed:d.includes(P.id),onToggleSelect:()=>f(P.id),onOpen:()=>p(P),onAutoFix:m?()=>m(P):void 0,onRerun:y?()=>y(P):void 0,onAssign:b?H=>b(P.id,H):void 0},P.id),e[70]=a,e[71]=d,e[72]=i,e[73]=s,e[74]=b,e[75]=m,e[76]=p,e[77]=y,e[78]=f,e[79]=o,e[80]=te):te=e[80],q=r.map(te),e[58]=a,e[59]=r,e[60]=d,e[61]=i,e[62]=s,e[63]=b,e[64]=m,e[65]=p,e[66]=y,e[67]=f,e[68]=o,e[69]=q}else q=e[69];let V;e[81]!==re||e[82]!==q?(V=c.jsx(uf,{items:re,strategy:cf,children:q}),e[81]=re,e[82]=q,e[83]=V):V=e[83];let J;e[84]!==j||e[85]!==n||e[86]!==V?(J=c.jsx("div",{ref:j,"data-lane-scroll":n,className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-1 pt-1 pb-16 [scrollbar-width:thin] [&::-webkit-scrollbar]:w-1",children:V}),e[84]=j,e[85]=n,e[86]=V,e[87]=J):J=e[87];let ie;return e[88]!==n||e[89]!==se||e[90]!==J||e[91]!==T?(ie=c.jsxs("div",{"data-lane":n,className:T,children:[se,J]}),e[88]=n,e[89]=se,e[90]=J,e[91]=T,e[92]=ie):ie=e[92],ie}function Kg(t){return t.id}function Hg(t){const e=U.c(29);let n,r,s,i;e[0]!==t?({item:r,hidden:n,landed:s,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=s,e[4]=i):(n=e[1],r=e[2],s=e[3],i=e[4]);let o;e[5]!==r.id?(o={id:r.id},e[5]=r.id,e[6]=o):o=e[6];const{attributes:l,listeners:a,setNodeRef:d,transform:f,transition:h,isDragging:p}=bf(o),u=r.id,m=r.status;let y;e[7]!==l||e[8]!==a?(y={attributes:l,listeners:a},e[7]=l,e[8]=a,e[9]=y):y=e[9];const b=s&&"animate-card-land";let g;e[10]!==b?(g=Z("w-full",b),e[10]=b,e[11]=g):g=e[11];let x;e[12]!==f?(x=on.Translate.toString(f),e[12]=f,e[13]=x):x=e[13];const k=p||n?0:void 0;let v;e[14]!==x||e[15]!==k||e[16]!==h?(v={transform:x,transition:h,opacity:k},e[14]=x,e[15]=k,e[16]=h,e[17]=v):v=e[17];let w;e[18]!==r||e[19]!==i||e[20]!==d||e[21]!==y||e[22]!==g||e[23]!==v?(w=c.jsx(wa,{...i,item:r,dragRef:d,bindings:y,className:g,style:v}),e[18]=r,e[19]=i,e[20]=d,e[21]=y,e[22]=g,e[23]=v,e[24]=w):w=e[24];let j;return e[25]!==r.id||e[26]!==r.status||e[27]!==w?(j=c.jsx("div",{className:"flex","data-flip-id":u,"data-flip-lane":m,children:w}),e[25]=r.id,e[26]=r.status,e[27]=w,e[28]=j):j=e[28],j}function wa(t){const e=U.c(48),{item:n,assignee:r,assignedBy:s,members:i,selected:o,className:l,dragRef:a,bindings:d,style:f,onToggleSelect:h,onOpen:p,onAutoFix:u,onRerun:m,onAssign:y}=t,b=oe(),g=Et[n.status].icon,x=Nf(n)?.lastMessage,k=u&&(n.status==="triage"||n.status==="todo")&&n.assigneeId!==$e,v=m&&!k&&n.assigneeId===$e&&n.status!=="done",w=d?.attributes,j=d?.listeners;let C;e[0]!==p||e[1]!==h?(C=$=>{$.shiftKey&&h?h():p()},e[0]=p,e[1]=h,e[2]=C):C=e[2];const T=o&&"bg-accent";let D;e[3]!==l||e[4]!==T?(D=Z("group flex shrink-0 cursor-grab flex-col gap-2 rounded-xl bg-card px-3 py-2.5 text-left card-shadow hover:bg-accent/60 active:cursor-grabbing",T,l),e[3]=l,e[4]=T,e[5]=D):D=e[5];const E=n.title;let N;e[6]!==n?(N=Z("mt-px shrink-0",wi(n)),e[6]=n,e[7]=N):N=e[7];let I;e[8]!==g||e[9]!==N?(I=c.jsx(g,{size:16,className:N}),e[8]=g,e[9]=N,e[10]=I):I=e[10];let A;e[11]!==n.title?(A=c.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium leading-snug text-foreground line-clamp-2",children:n.title}),e[11]=n.title,e[12]=A):A=e[12];let _;e[13]!==s||e[14]!==r||e[15]!==n||e[16]!==i||e[17]!==y?(_=c.jsx(ka,{item:n,assignee:r,assignedBy:s,members:i,onAssign:y}),e[13]=s,e[14]=r,e[15]=n,e[16]=i,e[17]=y,e[18]=_):_=e[18];let z;e[19]!==_||e[20]!==I||e[21]!==A?(z=c.jsxs("div",{className:"flex items-start gap-2",children:[I,A,_]}),e[19]=_,e[20]=I,e[21]=A,e[22]=z):z=e[22];let R;e[23]!==x?(R=x&&c.jsx("p",{className:"line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground",children:x}),e[23]=x,e[24]=R):R=e[24];let O;e[25]!==n?(O=(rr(n)||n.priority!=="none"||!!n.dueDate||n.tags.length>0)&&c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[rr(n)&&c.jsx(ma,{}),n.priority!=="none"&&c.jsx(xa,{priority:n.priority}),n.dueDate&&c.jsx(ba,{iso:n.dueDate}),n.tags.map(Wg)]}),e[25]=n,e[26]=O):O=e[26];let L;e[27]!==u||e[28]!==k||e[29]!==b?(L=k&&c.jsxs("button",{type:"button",onClick:$=>{$.stopPropagation(),u()},className:"flex items-center gap-1.5 self-end rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-accent",children:[c.jsx(ur,{size:12}),b("taskBoard.taskBoard.autoFix")]}),e[27]=u,e[28]=k,e[29]=b,e[30]=L):L=e[30];let B;e[31]!==m||e[32]!==v||e[33]!==b?(B=v&&c.jsxs("button",{type:"button",onClick:$=>{$.stopPropagation(),m()},className:"flex items-center gap-1.5 self-end rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-foreground opacity-0 transition-opacity hover:bg-accent focus-visible:opacity-100 group-hover:opacity-100",children:[c.jsx(Zr,{size:12}),b("taskBoard.taskBoard.rerun")]}),e[31]=m,e[32]=v,e[33]=b,e[34]=B):B=e[34];let F;return e[35]!==a||e[36]!==n.title||e[37]!==f||e[38]!==w||e[39]!==z||e[40]!==R||e[41]!==O||e[42]!==L||e[43]!==B||e[44]!==j||e[45]!==C||e[46]!==D?(F=c.jsxs("button",{type:"button",ref:a,style:f,...w,...j,onClick:C,className:D,title:E,children:[z,R,O,L,B]}),e[35]=a,e[36]=n.title,e[37]=f,e[38]=w,e[39]=z,e[40]=R,e[41]=O,e[42]=L,e[43]=B,e[44]=j,e[45]=C,e[46]=D,e[47]=F):F=e[47],F}function Wg(t){return c.jsx(ya,{tag:t},t.id)}function Vg(t){const e=U.c(33),{item:n,assignee:r,assignedBy:s,onOpen:i}=t,o=Et[n.status].icon;let l;e[0]!==n?(l=Z("shrink-0",wi(n)),e[0]=n,e[1]=l):l=e[1];let a;e[2]!==o||e[3]!==l?(a=c.jsx(o,{size:16,className:l}),e[2]=o,e[3]=l,e[4]=a):a=e[4];let d;e[5]!==n.title?(d=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let f;e[7]!==n?(f=rr(n)&&c.jsx(ma,{}),e[7]=n,e[8]=f):f=e[8];let h;e[9]!==n.priority?(h=n.priority!=="none"&&c.jsx("span",{className:"hidden sm:inline-flex",children:c.jsx(xa,{priority:n.priority})}),e[9]=n.priority,e[10]=h):h=e[10];let p;e[11]!==n.dueDate?(p=n.dueDate&&c.jsx("span",{className:"hidden sm:inline-flex",children:c.jsx(ba,{iso:n.dueDate})}),e[11]=n.dueDate,e[12]=p):p=e[12];let u;e[13]!==n.tags?(u=n.tags.length>0&&c.jsxs("span",{className:"hidden items-center gap-1.5 sm:inline-flex",children:[n.tags.slice(0,2).map(Qg),n.tags.length>2&&c.jsxs("span",{className:Os,children:["+",n.tags.length-2]})]}),e[13]=n.tags,e[14]=u):u=e[14];let m;e[15]!==s||e[16]!==r||e[17]!==n?(m=c.jsx(ka,{item:n,assignee:r,assignedBy:s}),e[15]=s,e[16]=r,e[17]=n,e[18]=m):m=e[18];let y;e[19]!==n.createdAt?(y=ii(new Date(n.createdAt)),e[19]=n.createdAt,e[20]=y):y=e[20];let b;e[21]!==y?(b=c.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted-foreground/70 sm:inline",children:y}),e[21]=y,e[22]=b):b=e[22];let g;return e[23]!==i||e[24]!==b||e[25]!==a||e[26]!==d||e[27]!==f||e[28]!==h||e[29]!==p||e[30]!==u||e[31]!==m?(g=c.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-xl bg-card px-4 py-3 text-left card-shadow transition-colors hover:bg-accent/60",children:[a,d,f,h,p,u,m,b]}),e[23]=i,e[24]=b,e[25]=a,e[26]=d,e[27]=f,e[28]=h,e[29]=p,e[30]=u,e[31]=m,e[32]=g):g=e[32],g}function Qg(t){return c.jsx(ya,{tag:t},t.id)}const f1=Object.freeze(Object.defineProperty({__proto__:null,TaskBoardPage:va,default:Tg},Symbol.toStringTag,{value:"Module"}));export{va as $,bf as A,vf as B,on as C,zu as D,vi as E,Cf as F,jf as G,Hm as H,Et as I,It as J,xi as K,Pt as L,ct as M,r1 as N,a1 as O,yi as P,Xm as Q,u1 as R,od as S,Ep as T,c1 as U,Zm as V,yd as W,Ym as X,t1 as Y,o1 as Z,Jm as _,ld as a,Al as a0,f1 as a1,Gm as b,s1 as c,Xc as d,Vm as e,i1 as f,kd as g,l1 as h,ed as i,e1 as j,n1 as k,jd as l,wd as m,Nd as n,Ud as o,Ui as p,nf as q,Wm as r,Gc as s,Fu as t,Qm as u,sf as v,Zc as w,d1 as x,uf as y,cf as z};
|