decocms 4.181.2 → 4.181.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-DhwfTi65.js → AlertCircle-CoDXlJfQ.js} +1 -1
- package/dist/client/assets/{AreaChart-CXKI3JpY.js → AreaChart-DtqNZyBO.js} +1 -1
- package/dist/client/assets/{ArrowUp-BWR9dQl8.js → ArrowUp-DzfdS3AP.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-D4qu9qE6.js → ArrowUpRight-DjsHhUlZ.js} +1 -1
- package/dist/client/assets/{Check-7fe09mMg.js → Check-DI_6pNdk.js} +1 -1
- package/dist/client/assets/{CheckCircle-D5saJ3-2.js → CheckCircle-BSFO3b73.js} +1 -1
- package/dist/client/assets/{ChevronDown-DFqNx4Ma.js → ChevronDown-BwM0X3Lv.js} +1 -1
- package/dist/client/assets/{ChevronRight-CRnb0aSS.js → ChevronRight-CTbTO73Q.js} +1 -1
- package/dist/client/assets/{ChevronUp-CvH3Jbpe.js → ChevronUp-Cwzjy6X3.js} +1 -1
- package/dist/client/assets/{Copy01-CCrRD_v-.js → Copy01-7VI3n1x-.js} +1 -1
- package/dist/client/assets/{CpuChip01-Cm6Xgyie.js → CpuChip01-BN0rbNJS.js} +1 -1
- package/dist/client/assets/{CreditCard01-CNzw0ddZ.js → CreditCard01-CSLH62wc.js} +1 -1
- package/dist/client/assets/{DotsVertical-6MyHH5sK.js → DotsVertical-EB14YMVh.js} +1 -1
- package/dist/client/assets/{Eye-D2tsgwEB.js → Eye-DINm0uLy.js} +1 -1
- package/dist/client/assets/{FilterLines--Qcv2fTv.js → FilterLines-BJuXgX-U.js} +1 -1
- package/dist/client/assets/{HardDrive-_f2c9Jkk.js → HardDrive-mjyPSUZo.js} +1 -1
- package/dist/client/assets/{Key01-1xwZnZcu.js → Key01-BDhVzHQl.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D19TYd87.js → LayoutLeft-DvUn9Rfo.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dw7qYNHV.js → LinkExternal01-DHgvfD-u.js} +1 -1
- package/dist/client/assets/{LogOut01-BLN2nxXZ.js → LogOut01-BkaI9bsE.js} +1 -1
- package/dist/client/assets/{Monitor01-DoHemlFB.js → Monitor01-m26Bkt8-.js} +1 -1
- package/dist/client/assets/{Palette-DQn4hdOZ.js → Palette-CZEbJkf3.js} +1 -1
- package/dist/client/assets/{Play-Dtsx6JqS.js → Play-DNhPZ0zd.js} +1 -1
- package/dist/client/assets/{Plus-fsakZj2i.js → Plus-B81Kmsvq.js} +1 -1
- package/dist/client/assets/{SearchLg-B6A7YmGB.js → SearchLg-D6RI0hoW.js} +1 -1
- package/dist/client/assets/{SearchMd-Yh9NWGHH.js → SearchMd-DiAJ6_xd.js} +1 -1
- package/dist/client/assets/{Settings02-Lx-1u3Bn.js → Settings02-BSOfJdnI.js} +1 -1
- package/dist/client/assets/{Shield01-BJ3TiyrY.js → Shield01-DELZfYhd.js} +1 -1
- package/dist/client/assets/{Star01-D56V4TVC.js → Star01-Dlpf7047.js} +1 -1
- package/dist/client/assets/{Stars01-BV53-GPu.js → Stars01-F8Z91iCj.js} +1 -1
- package/dist/client/assets/{Stars02-B2Wf8VG1.js → Stars02-DFyqMz7m.js} +1 -1
- package/dist/client/assets/{Sun-DfSj0AwW.js → Sun-BJ8Bkr6l.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-0vB7r3W7.js → SwitchHorizontal01-DyBdX2K6.js} +1 -1
- package/dist/client/assets/{Tool01-Krxro8Eb.js → Tool01-C1PnI1l2.js} +1 -1
- package/dist/client/assets/{Tool02-BYunryUZ.js → Tool02-CluH7azC.js} +1 -1
- package/dist/client/assets/{Trash01-EgpeoR-H.js → Trash01-k_h_Tggg.js} +1 -1
- package/dist/client/assets/{TrendUp01-DXZnUZEU.js → TrendUp01-NM4dpGZ4.js} +1 -1
- package/dist/client/assets/{Upload01-B_YOepEj.js → Upload01-BYIhCx3Z.js} +1 -1
- package/dist/client/assets/{User01-BVhAcPFu.js → User01-CjTC4Ds9.js} +1 -1
- package/dist/client/assets/{Users01-CfMh8jDn.js → Users01-eC8BAkrP.js} +1 -1
- package/dist/client/assets/{Users03-v7hzkYQA.js → Users03-CAzfWqj_.js} +1 -1
- package/dist/client/assets/{X-Cv0UCoHc.js → X-B0BGtJWX.js} +1 -1
- package/dist/client/assets/{XCircle-DHmH1ofD.js → XCircle-Bs7nQ8ND.js} +1 -1
- package/dist/client/assets/{XClose-C028jAbZ.js → XClose-DoLGTjTv.js} +1 -1
- package/dist/client/assets/{Zap-DWrOJOIs.js → Zap-B_A4GU2C.js} +1 -1
- package/dist/client/assets/{ZapSquare-CK872AWs.js → ZapSquare-BCJFJSNK.js} +1 -1
- package/dist/client/assets/{access-gate-BgnqMDuH.js → access-gate-3o7Fxz7A.js} +1 -1
- package/dist/client/assets/{add-section-modal-CMGW4M05.js → add-section-modal-BQSeDYh8.js} +1 -1
- package/dist/client/assets/{agent-icon-ClQ6MFoq.js → agent-icon-Cp2zkusx.js} +1 -1
- package/dist/client/assets/{agents-list-D4encQ2B.js → agents-list-fbKp7W8r.js} +1 -1
- package/dist/client/assets/{ai-providers-CtnxxO-g.js → ai-providers-BDfvcd5z.js} +1 -1
- package/dist/client/assets/{alert-D--gPplk.js → alert-DAsfiHLl.js} +1 -1
- package/dist/client/assets/{alert-dialog-BmxMiJzj.js → alert-dialog-Cs4aDt3P.js} +1 -1
- package/dist/client/assets/app-editor-sxEKRC1f.js +1 -0
- package/dist/client/assets/{auth-BKrzkQE7.js → auth-BMv6ws0Q.js} +1 -1
- package/dist/client/assets/{auth-catchall-JkfMFsIl.js → auth-catchall-BV-ShEH0.js} +1 -1
- package/dist/client/assets/{auth-entry-bs5kljRR.js → auth-entry-CdV0yOYx.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Focpghx1.js → auth-split-layout-CagxWH9r.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BpB5Oaek.js → authenticate-and-persist-oauth-DijvaOaZ.js} +1 -1
- package/dist/client/assets/{automation-list-row-CWhy6hWm.js → automation-list-row-C7NACULR.js} +1 -1
- package/dist/client/assets/{automation-runs-B2FWi9UR.js → automation-runs-DhTJGBwT.js} +1 -1
- package/dist/client/assets/{automations-pgwbDNQF.js → automations-0ykMO47a.js} +1 -1
- package/dist/client/assets/{avatar-DPeJxtUT.js → avatar-B70WS_I4.js} +1 -1
- package/dist/client/assets/{badge-BON79ftm.js → badge-C24L-Prv.js} +1 -1
- package/dist/client/assets/billing-DNvuhOBv.js +6 -0
- package/dist/client/assets/{block-document-sNv31PCH.js → block-document-BJ420alM.js} +1 -1
- package/dist/client/assets/{brand-context-BnwI3qzC.js → brand-context-Qucn2Xsj.js} +1 -1
- package/dist/client/assets/{buckets-DnBKR3GG.js → buckets-DdHF8G3P.js} +1 -1
- package/dist/client/assets/bulk-category-panel-BtkQTad7.js +1 -0
- package/dist/client/assets/{calendar-DDTH236u.js → calendar-CAfHfTmu.js} +1 -1
- package/dist/client/assets/{capability-load-error-DaWbWNmk.js → capability-load-error-ChEAZwzL.js} +1 -1
- package/dist/client/assets/{card-_M-bn-6c.js → card-BKElrnBc.js} +1 -1
- package/dist/client/assets/category-editor-CLqlhywG.js +1 -0
- package/dist/client/assets/{chat-context-tVEHCSX5.js → chat-context-Bw7SDxGs.js} +6 -6
- package/dist/client/assets/{checkbox-YqK6rwSF.js → checkbox-CFSUO6it.js} +1 -1
- package/dist/client/assets/{cli-auth-success-zUMcbAKo.js → cli-auth-success-D6Es4_O8.js} +1 -1
- package/dist/client/assets/{collection-detail-RpRySuf7.js → collection-detail-CbcPEQz3.js} +1 -1
- package/dist/client/assets/{collection-display-button-KsZ-MLPt.js → collection-display-button-BJhGqViy.js} +1 -1
- package/dist/client/assets/{collection-search-BjSxnSjJ.js → collection-search-ChLfje4B.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BWtp84vf.js → collection-table-wrapper-D6vyICk_.js} +1 -1
- package/dist/client/assets/{collection-tabs-5nGCOfxk.js → collection-tabs-Cs-EMZJI.js} +1 -1
- package/dist/client/assets/{command-BfEiAydz.js → command-PnS9-KkJ.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-B0MLztec.js → commerce-onboarding-BFliR3_E.js} +1 -1
- package/dist/client/assets/{companions-core-EBpmeIUx.js → companions-core-BEk0bI5I.js} +1 -1
- package/dist/client/assets/{connect-C7QBnQPp.js → connect-Tz0_q97h.js} +1 -1
- package/dist/client/assets/{connection-iwdkv-CM.js → connection-B1s_uL8d.js} +1 -1
- package/dist/client/assets/{connection-card-DSAVcix6.js → connection-card-B8CKrJsN.js} +1 -1
- package/dist/client/assets/{connection-detail-CXbDLJBm.js → connection-detail-NFG3cS8L.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CNuWl6PY.js → connection-form-helpers-BiyFYIQA.js} +1 -1
- package/dist/client/assets/{connections-BiRKuv9V.js → connections-DbqXTRKp.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-C_7bumAG.js → decopilot-sse-pool-C_mYTLoK.js} +1 -1
- package/dist/client/assets/{dialog-BaQ3_w8_.js → dialog-BlrnnfmP.js} +1 -1
- package/dist/client/assets/{domain-settings-CdoOjSht.js → domain-settings-CqgkCnG9.js} +1 -1
- package/dist/client/assets/{drawer-DzfGx-oA.js → drawer-D3ba3yLz.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BlQ1KaCg.js → dropdown-menu-Bx7ltfaz.js} +1 -1
- package/dist/client/assets/{empty-state-CLumFPMt.js → empty-state-Ch5-qN6i.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B3R7rEs4.js → extract-connection-data-DWzl0TVG.js} +1 -1
- package/dist/client/assets/file-explorer-CRpY-v2P.js +2 -0
- package/dist/client/assets/{form-Cz3JG_Nj.js → form-QPeVr96w.js} +1 -1
- package/dist/client/assets/general-c3VcV2nT.js +1 -0
- package/dist/client/assets/{github-repo-picker-CHXo4WUU.js → github-repo-picker-_ZnF776T.js} +1 -1
- package/dist/client/assets/{hooks-DuSycRtz.js → hooks-C5MdZvD4.js} +1 -1
- package/dist/client/assets/index-3-LMqfQ2.js +77 -0
- package/dist/client/assets/{index-Cte3Qotw.js → index-BKdsYgJk.js} +1 -1
- package/dist/client/assets/{index-BYAu2SO4.js → index-BN6mjWFs.js} +1 -1
- package/dist/client/assets/{index-6Wy7SN7a.js → index-By7f4dxu.js} +1 -1
- package/dist/client/assets/{index-BLiCxBFm.js → index-CPa17j_1.js} +1 -1
- package/dist/client/assets/{index-CM5jFPpd.js → index-CwRZ2eRJ.js} +35 -35
- package/dist/client/assets/{index-C_tlTFTQ.js → index-D4oq2KWo.js} +1 -1
- package/dist/client/assets/{index-D6gquhyQ.js → index-DPt9op1f.js} +1 -1
- package/dist/client/assets/{index-Dc-kHG2N.js → index-DY47_3bP.js} +1 -1
- package/dist/client/assets/{index-Csj4ulP-.js → index-D_qN7ztl.js} +5 -5
- package/dist/client/assets/{index-BbV1LXbP.js → index-Dyko4qaC.js} +1 -1
- package/dist/client/assets/{index-QHgw-nQE.js → index-OSPPmtTZ.js} +1 -1
- package/dist/client/assets/{index-redirect-DlRa9qk7.js → index-redirect-DdSC2EvH.js} +1 -1
- package/dist/client/assets/{input-5_ihaBYH.js → input-D9Jkg0Ts.js} +1 -1
- package/dist/client/assets/{integration-icon-B_iJXwRI.js → integration-icon-rZyJJxlQ.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-d5R9AKjX.js → invite-member-dialog-ChjW_rxM.js} +1 -1
- package/dist/client/assets/{label-BXyWlH3c.js → label-ZNBaIWEv.js} +1 -1
- package/dist/client/assets/{layout-BqmRqncM.js → layout-8Z2jUN00.js} +1 -1
- package/dist/client/assets/{login-BHf7tXQm.js → login-CsWF7180.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DpJ3kn83.js → mcp-oauth-C7dcOLuW.js} +1 -1
- package/dist/client/assets/members-BN1GNZMG.js +1 -0
- package/dist/client/assets/{monaco-editor-B4SGDglp.js → monaco-editor-D77M7bec.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C7ZDGWU8.js → monitoring-stats-row-DKR_TjL0.js} +1 -1
- package/dist/client/assets/{multi-select-C3t1eBvR.js → multi-select-uAHTiP2r.js} +1 -1
- package/dist/client/assets/{oauth-callback-6_hjYEY8.js → oauth-callback-CLUUMHBU.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CZuQoiSC.js → oauth-callback-ai-provider-wb-h-pia.js} +1 -1
- package/dist/client/assets/{onboarding-BcHzqLxX.js → onboarding-BWjBskCT.js} +1 -1
- package/dist/client/assets/{org-layout-C_p3W9up.js → org-layout-CL0ZKqte.js} +1 -1
- package/dist/client/assets/{organization-choice-CVhAwuDa.js → organization-choice-BbKtFXAC.js} +1 -1
- package/dist/client/assets/{orgs-9OqOkv9x.js → orgs-Or9kyiju.js} +1 -1
- package/dist/client/assets/{page-seo-form-hf_pWp_F.js → page-seo-form-BndAvZ9u.js} +1 -1
- package/dist/client/assets/{popover-Byln4TuQ.js → popover-DQ75zYg5.js} +1 -1
- package/dist/client/assets/post-editor-C9EHuxMH.js +1 -0
- package/dist/client/assets/{primitives-Df3Bn_ya.js → primitives-DIcxOhBZ.js} +1 -1
- package/dist/client/assets/{profile-CS_iAKkm.js → profile-7pKp2rOM.js} +1 -1
- package/dist/client/assets/project-app-view-BXHpuIWL.js +1 -0
- package/dist/client/assets/record-editor-B0lY4ATs.js +1 -0
- package/dist/client/assets/redirect-editor-CvtWY3HB.js +1 -0
- package/dist/client/assets/registry-B7D6Ql17.js +2 -0
- package/dist/client/assets/{registry-layout-vt4vhU8c.js → registry-layout-Bn2lgUai.js} +1 -1
- package/dist/client/assets/{reports-_cLV6W7t.js → reports-7tXOKFVI.js} +1 -1
- package/dist/client/assets/{require-capability-BmrfZmFk.js → require-capability-B6LMVGHv.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DssttDRY.js → required-auth-layout-CogeMTvH.js} +1 -1
- package/dist/client/assets/{reset-password-J-GZyivg.js → reset-password-CPEOmW50.js} +1 -1
- package/dist/client/assets/{roles-DcqOrq9D.js → roles-C27KypL_.js} +1 -1
- package/dist/client/assets/{search-input-BcMesWuB.js → search-input-BNnWzMLc.js} +1 -1
- package/dist/client/assets/{secrets-3-rsElai.js → secrets-CTCckJMX.js} +1 -1
- package/dist/client/assets/{sections-editor-G2RgoSGR.js → sections-editor-a2lgUSp0.js} +2 -2
- package/dist/client/assets/{select-SGu4_FtX.js → select-Rt6PHNLS.js} +1 -1
- package/dist/client/assets/{select-model-cIVouYTm.js → select-model-SPVuQjmD.js} +1 -1
- package/dist/client/assets/{self-tool-result-CACndU_u.js → self-tool-result-BO5xY3K8.js} +1 -1
- package/dist/client/assets/seo-editor-CdGMZ5D1.js +1 -0
- package/dist/client/assets/{settings-layout-JwWYh0P3.js → settings-layout-D7E7ki7W.js} +1 -1
- package/dist/client/assets/{settings-section-CXUhMVs1.js → settings-section-C-TQNwV0.js} +1 -1
- package/dist/client/assets/{shell-controls-y6dmq3Ut.js → shell-controls-CR8pGOJY.js} +1 -1
- package/dist/client/assets/{shell-layout-DLhKvUEj.js → shell-layout-Ce7M8XgS.js} +1 -1
- package/dist/client/assets/{sidebar-QbwqQIu3.js → sidebar-CzS9qRLM.js} +1 -1
- package/dist/client/assets/{skeleton-s6ngmE7x.js → skeleton-D3cVH2Ir.js} +1 -1
- package/dist/client/assets/{spinner-DzW40heC.js → spinner-BprurTJe.js} +1 -1
- package/dist/client/assets/{sso-BMlDhirk.js → sso-DJOzyPMU.js} +1 -1
- package/dist/client/assets/{store-BKcscc7a.js → store-12c6YOsA.js} +1 -1
- package/dist/client/assets/store-registry-D4GQNhaq.js +2 -0
- package/dist/client/assets/{studio-tools-ByQe0nxW.js → studio-tools-CmR4bmJa.js} +1 -1
- package/dist/client/assets/{switch-DFCKdzt7.js → switch-PbC9_T5E.js} +1 -1
- package/dist/client/assets/{tab-id-BiTYDOcZ.js → tab-id-Cpj2BYHk.js} +1 -1
- package/dist/client/assets/{table-DlRW6FZv.js → table-CNsHXRlz.js} +1 -1
- package/dist/client/assets/{tabs-C5vm-_nz.js → tabs-C3Es5g8C.js} +1 -1
- package/dist/client/assets/{textarea-CKeVZVzt.js → textarea-Bm-UZKbN.js} +1 -1
- package/dist/client/assets/{toggle-group-DnYIxYbk.js → toggle-group-27ep7cd-.js} +1 -1
- package/dist/client/assets/{toolbar-DwU8FQW4.js → toolbar-DNyY1X0W.js} +1 -1
- package/dist/client/assets/{tooltip-CxHFa6IC.js → tooltip-Bqc21s4V.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Co7pb7Qr.js → use-ai-providers-CzKbxhup.js} +1 -1
- package/dist/client/assets/{use-automations-BP5ujW2a.js → use-automations-rRRSxnoZ.js} +1 -1
- package/dist/client/assets/{use-autosave-D8ji2Fa4.js → use-autosave-DrBeJOpe.js} +1 -1
- package/dist/client/assets/{use-capability-DqWvGlPP.js → use-capability-VnR-Twlo.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DSZ3Gm8N.js → use-clock-tick-CUyOHcGd.js} +1 -1
- package/dist/client/assets/{use-connection-DyO48bWG.js → use-connection-D3-WOivL.js} +1 -1
- package/dist/client/assets/{use-copy-6Jj0xxnI.js → use-copy-Cjfxc3lq.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bmy5mqEA.js → use-create-virtual-mcp-CRDZzFsT.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D_DmEb8w.js → use-debounced-autosave-BpiVpYEy.js} +1 -1
- package/dist/client/assets/{use-debounced-value-_FeINZsD.js → use-debounced-value-Bu743rfC.js} +1 -1
- package/dist/client/assets/{use-deco-credits-C_lnLrG5.js → use-deco-credits-CP_p1OYX.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-L_uDUkvt.js → use-decopilot-events-Delyy2tX.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CMqGCbIX.js → use-delete-connection-C1FVu_kj.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DnjeA_1_.js → use-deployment-admin-CcCT1pCe.js} +1 -1
- package/dist/client/assets/{use-file-configs-BHd6zoJg.js → use-file-configs-Df4t2Af8.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D_VL9wUU.js → use-infinite-scroll-D2k2RfjH.js} +1 -1
- package/dist/client/assets/{use-join-requests-yfo1t6jl.js → use-join-requests-YHxzWRzU.js} +1 -1
- package/dist/client/assets/{use-mcp-client-D_w4YfXz.js → use-mcp-client-CnwXp_2G.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-ApQ-yd9r.js → use-mcp-tools-D5PDAbX3.js} +1 -1
- package/dist/client/assets/{use-members-BHIh4BMi.js → use-members-CsrR9sVE.js} +1 -1
- package/dist/client/assets/{use-mobile-BTbk3OtS.js → use-mobile-D5XNhGmt.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DlOybjQl.js → use-navigate-to-agent-CY1Sg2mI.js} +1 -1
- package/dist/client/assets/use-open-billing-url-7wNr3nsC.js +1 -0
- package/dist/client/assets/{use-org-auth-client-B81bJ_PA.js → use-org-auth-client-DsEUDhGt.js} +1 -1
- package/dist/client/assets/{use-org-sso-DA_tV60t.js → use-org-sso-BMMGsez5.js} +1 -1
- package/dist/client/assets/{use-organization-roles--CkNNivC.js → use-organization-roles-D98NHp0f.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BIlGedqq.js → use-organization-settings-CkydqUPj.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CS7FZ6vE.js → use-registry-connections-DvnxAxTA.js} +1 -1
- package/dist/client/assets/{use-secrets-YHPDYoG0.js → use-secrets-DlAqH1JF.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Dmzs3AZM.js → use-status-sounds-U-yjXYPT.js} +1 -1
- package/dist/client/assets/{use-tags-BwYUEYku.js → use-tags-BZHcYzsF.js} +1 -1
- package/dist/client/assets/{use-view-mode-BrMghI3p.js → use-view-mode-BA8gjl_j.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CSlt6IBv.js → use-virtual-mcp-BwEqvBeg.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CaECIb_7.js +1 -0
- package/dist/client/assets/{useQueries-y3ZS11ts.js → useQueries-WiRQeQU4.js} +1 -1
- package/dist/client/assets/{useRouterState-BWggJFL2.js → useRouterState-B84y8ONz.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C6u02L7d.js +1 -0
- package/dist/client/assets/{users-u61YI361.js → users-CStj2qH-.js} +1 -1
- package/dist/client/assets/{variant-calendar-CesD7nTB.js → variant-calendar-B0iPSTvz.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D5P-Fw97.js → view-mode-toggle-dBtur0IN.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +143 -143
- package/dist/server/migrate.js +1 -1
- package/dist/server/server.js +121 -121
- package/package.json +1 -1
- package/dist/client/assets/app-editor-DL3n5aIo.js +0 -1
- package/dist/client/assets/billing-CSRO_Xhf.js +0 -6
- package/dist/client/assets/bulk-category-panel-D6Bqf27J.js +0 -1
- package/dist/client/assets/category-editor-8aLxI0zu.js +0 -1
- package/dist/client/assets/file-explorer-C8bBTplO.js +0 -2
- package/dist/client/assets/general-BMPq4RKk.js +0 -1
- package/dist/client/assets/index-DmMjm15X.js +0 -77
- package/dist/client/assets/members-GtIKQUzd.js +0 -1
- package/dist/client/assets/post-editor-MzsGcDsk.js +0 -1
- package/dist/client/assets/project-app-view-BGhZ4HbH.js +0 -1
- package/dist/client/assets/record-editor-5tOBqSaF.js +0 -1
- package/dist/client/assets/redirect-editor-DV_7QC_m.js +0 -1
- package/dist/client/assets/registry-CCbAvu-S.js +0 -2
- package/dist/client/assets/seo-editor-CRdRftoa.js +0 -1
- package/dist/client/assets/store-registry-CATZt53a.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DRBWKJK0.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CfunhPPn.js +0 -1
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CM5jFPpd.js","assets/index-Csj4ulP-.js","assets/index-CUIiLem4.css","assets/ArrowUp-BWR9dQl8.js","assets/chat-context-tVEHCSX5.js","assets/tab-id-BiTYDOcZ.js","assets/dialog-BaQ3_w8_.js","assets/X-Cv0UCoHc.js","assets/Check-7fe09mMg.js","assets/Copy01-CCrRD_v-.js","assets/hooks-DuSycRtz.js","assets/use-mcp-client-D_w4YfXz.js","assets/auth-BKrzkQE7.js","assets/decopilot-sse-pool-C_7bumAG.js","assets/backoff-CrEUbyZT.js","assets/delay-CnY5UFtP.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-virtual-mcp-CSlt6IBv.js","assets/use-ai-providers-Co7pb7Qr.js","assets/studio-tools-ByQe0nxW.js","assets/use-decopilot-events-L_uDUkvt.js","assets/use-organization-settings-BIlGedqq.js","assets/automation-runs-B2FWi9UR.js","assets/select-SGu4_FtX.js","assets/tooltip-CxHFa6IC.js","assets/ChevronDown-DFqNx4Ma.js","assets/ChevronUp-CvH3Jbpe.js","assets/useInfiniteQuery-DRBWKJK0.js","assets/use-infinite-scroll-D_VL9wUU.js","assets/use-connection-DyO48bWG.js","assets/card-_M-bn-6c.js","assets/sidebar-QbwqQIu3.js","assets/LayoutLeft-D19TYd87.js","assets/use-mobile-BTbk3OtS.js","assets/table-DlRW6FZv.js","assets/empty-state-CLumFPMt.js","assets/use-members-BHIh4BMi.js","assets/use-org-auth-client-B81bJ_PA.js","assets/use-clock-tick-DSZ3Gm8N.js","assets/AlertCircle-DhwfTi65.js","assets/CheckCircle-D5saJ3-2.js","assets/DotsVertical-6MyHH5sK.js","assets/agent-icon-ClQ6MFoq.js","assets/Tool01-Krxro8Eb.js","assets/Settings02-Lx-1u3Bn.js","assets/Tool02-BYunryUZ.js","assets/XCircle-DHmH1ofD.js","assets/ArrowUpRight-D4qu9qE6.js","assets/TrendUp01-DXZnUZEU.js","assets/ZapSquare-CK872AWs.js","assets/Users03-v7hzkYQA.js","assets/ChevronRight-CRnb0aSS.js","assets/Stars02-B2Wf8VG1.js","assets/CpuChip01-Cm6Xgyie.js","assets/CreditCard01-CNzw0ddZ.js","assets/Eye-D2tsgwEB.js","assets/FilterLines--Qcv2fTv.js","assets/Star01-D56V4TVC.js","assets/Palette-DQn4hdOZ.js","assets/SwitchHorizontal01-0vB7r3W7.js","assets/HardDrive-_f2c9Jkk.js","assets/Key01-1xwZnZcu.js","assets/LinkExternal01-Dw7qYNHV.js","assets/LogOut01-BLN2nxXZ.js","assets/Monitor01-DoHemlFB.js","assets/Sun-DfSj0AwW.js","assets/Play-Dtsx6JqS.js","assets/Plus-fsakZj2i.js","assets/SearchLg-B6A7YmGB.js","assets/SearchMd-Yh9NWGHH.js","assets/Shield01-BJ3TiyrY.js","assets/Stars01-BV53-GPu.js","assets/Trash01-EgpeoR-H.js","assets/Upload01-B_YOepEj.js","assets/User01-BVhAcPFu.js","assets/Users01-CfMh8jDn.js","assets/XClose-C028jAbZ.js","assets/Zap-DWrOJOIs.js","assets/use-automations-BP5ujW2a.js","assets/useSuspenseInfiniteQuery-CfunhPPn.js","assets/avatar-DPeJxtUT.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-6Jj0xxnI.js","assets/calendar-DDTH236u.js","assets/monaco-editor-B4SGDglp.js","assets/spinner-DzW40heC.js","assets/index-C_tlTFTQ.js","assets/shell-layout-DLhKvUEj.js","assets/required-auth-layout-DssttDRY.js","assets/use-org-sso-DA_tV60t.js","assets/integration-icon-B_iJXwRI.js","assets/use-navigate-to-agent-DlOybjQl.js","assets/reusable-new-chat-CouMjkYR.js","assets/AreaChart-CXKI3JpY.js","assets/form-Cz3JG_Nj.js","assets/label-BXyWlH3c.js","assets/input-5_ihaBYH.js","assets/drawer-DzfGx-oA.js","assets/collection-search-BjSxnSjJ.js","assets/tabs-C5vm-_nz.js","assets/toggle-group-DnYIxYbk.js","assets/use-deco-credits-C_lnLrG5.js","assets/popover-Byln4TuQ.js","assets/alert-dialog-BmxMiJzj.js","assets/toolbar-DwU8FQW4.js","assets/skeleton-s6ngmE7x.js","assets/github-repo-picker-CHXo4WUU.js","assets/use-debounced-value-_FeINZsD.js","assets/authenticate-and-persist-oauth-BpB5Oaek.js","assets/mcp-oauth-DpJ3kn83.js","assets/use-mcp-tools-ApQ-yd9r.js","assets/extract-connection-data-B3R7rEs4.js","assets/metadata-dUsYcpuu.js","assets/provision-repo-scoped-github-connection-B2s3ApVy.js","assets/agent-capabilities-cXfbMfjV.js","assets/connection-card-DSAVcix6.js","assets/use-registry-connections-CS7FZ6vE.js","assets/retry-CErkP7V6.js","assets/connection-slug-eyAPH6o3.js","assets/textarea-CKeVZVzt.js","assets/connection-form-helpers-CNuWl6PY.js","assets/collection-tabs-5nGCOfxk.js","assets/badge-BON79ftm.js","assets/select-model-cIVouYTm.js","assets/checkbox-YqK6rwSF.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-CXUhMVs1.js","assets/dropdown-menu-BlQ1KaCg.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-Dmzs3AZM.js","assets/deco-site-production-url-CaKZ7xBn.js","assets/use-capability-DqWvGlPP.js","assets/pt-BR-CLy76QW2.js","assets/switch-DFCKdzt7.js","assets/use-debounced-autosave-D_DmEb8w.js","assets/index-Dc-kHG2N.js","assets/search-input-BcMesWuB.js","assets/index-6Wy7SN7a.js","assets/use-secrets-YHPDYoG0.js","assets/command-BfEiAydz.js","assets/index-BYAu2SO4.js","assets/useQueries-y3ZS11ts.js","assets/use-file-configs-BHd6zoJg.js","assets/automation-list-row-CWhy6hWm.js","assets/get-initials-D-f_fDFw.js","assets/index-CiP0VfIv.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{G as xa,r as w,c as P,x as ba,K as ke,F as Be,o as an,e as Je,n as lt,ax as Te,ag as Xt,a as yo,t as ht,a0 as ya,m as ee,j as c,b as oe,aW as ko,aX as vo,aY as wo,aZ as So,a_ as Co,a$ as jo,b0 as To,b1 as No,b2 as Do,B as Fe,y as ka,E as va,d as Ro,p as Ni,k as ir,u as wa,aG as Sa}from"./index-Csj4ulP-.js";import{g as Et}from"./get-initials-D-f_fDFw.js";import{A as It}from"./avatar-DPeJxtUT.js";import{aC as vs,af as Ca,ag as ja,ai as Ta,a6 as Na,aD as Da,B as Ra,p as Ea,aE as Kr,aF as Ia,X as Wr,e as Eo,ae as _a,j as Io,aG as Aa,aB as kr,as as Vr,_ as Wn,aH as Ba,n as Gr,az as Oa}from"./agent-icon-ClQ6MFoq.js";import{i as _o}from"./SwitchHorizontal01-0vB7r3W7.js";import{s as ps}from"./Plus-fsakZj2i.js";import{i as nn}from"./X-Cv0UCoHc.js";import{a as Kn,b as cs,P as ds}from"./popover-Byln4TuQ.js";import{a as St,i as Ao,D as sn,b as rn,c as on,d as Jn,e as es,f as ts}from"./dropdown-menu-BlQ1KaCg.js";import{W as $a,m as Di,S as Bo,C as Oo,g as Ma,u as za,h as La,Q as Pa,j as Fa,a as Ua}from"./use-mcp-client-D_w4YfXz.js";import{u as qa,G as Er,a as Ha}from"./github-repo-picker-CHXo4WUU.js";import{e as gs,d as ms,b as xs,h as $o,a as Mo,c as zo}from"./dialog-BaQ3_w8_.js";import{b as Ka,u as Wa}from"./use-connection-DyO48bWG.js";import{b as Va}from"./provision-repo-scoped-github-connection-B2s3ApVy.js";import{a as Ga}from"./authenticate-and-persist-oauth-BpB5Oaek.js";import{e as Qa}from"./extract-connection-data-B3R7rEs4.js";import{u as Lo}from"./use-members-BHIh4BMi.js";import{u as Jt}from"./studio-tools-ByQe0nxW.js";import{t as Xa,T as Ya,a as Za,S as Ze,i as Po,b as Ri}from"./decopilot-sse-pool-C_7bumAG.js";import{u as Ja}from"./use-decopilot-events-L_uDUkvt.js";import{a as Qr}from"./format-time-BnbuEtat.js";import{i as or}from"./AlertCircle-DhwfTi65.js";import{i as cn}from"./CheckCircle-D5saJ3-2.js";import{i as ec}from"./DotsVertical-6MyHH5sK.js";import{s as tc}from"./Eye-D2tsgwEB.js";import{u as Fo,a as nc,b as sc}from"./use-tags-BwYUEYku.js";import{o as rc,P as Yt,a as Xr,D as ic,p as oc,q as lc,S as Ut,r as ac,T as Uo,F as vr,s as os,v as cc,w as dc,x as qo,N as uc,k as Yr,y as fc,z as hc,d as Ho,n as pc,A as Ht,B as gc,G as ns,H as mc,I as Ko,R as Wo,m as Vo,J as Go,K as xc,L as bc,Q as yc,e as kc,u as vc,f as wc,j as Sc,C as Qo,c as Cc}from"./calendar-DDTH236u.js";import{S as Un}from"./skeleton-s6ngmE7x.js";import{u as jc}from"./use-copy-6Jj0xxnI.js";import{i as ws}from"./Check-7fe09mMg.js";import{i as Xo}from"./ChevronRight-CRnb0aSS.js";import{a as Tc}from"./Copy01-CCrRD_v-.js";import{n as Nc,i as Yo}from"./Tool02-BYunryUZ.js";import{n as qs}from"./LinkExternal01-Dw7qYNHV.js";import{b as Zo,i as Jo}from"./XCircle-DHmH1ofD.js";import{s as el}from"./Trash01-EgpeoR-H.js";import{u as Ei,a as Dc}from"./use-organization-settings-BIlGedqq.js";import{d as Zr,a as Jr,c as Vt,b as Gn,C as ei,e as ti}from"./command-BfEiAydz.js";import{s as Ir}from"./User01-BVhAcPFu.js";import{i as Rc}from"./ArrowUp-BWR9dQl8.js";import{i as Ec}from"./Tool01-Krxro8Eb.js";import{f as Ic}from"./tab-id-BiTYDOcZ.js";import{u as _r}from"./companions-core-EBpmeIUx.js";import{d as _c,b as Ac,f as Bc,g as Oc,a as $c,D as Mc}from"./drawer-DzfGx-oA.js";import{t as ni}from"./ChevronDown-DFqNx4Ma.js";import{i as tl}from"./FilterLines--Qcv2fTv.js";import{s as zc}from"./TrendUp01-DXZnUZEU.js";import{u as Lc}from"./shell-layout-DLhKvUEj.js";import{b as Pc}from"./hooks-DuSycRtz.js";const Fc="[SUBSCRIPTION_REQUIRED]";function Uc(t){return t?.message.startsWith(Fc)?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 qc(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 _m="__home__";function si(t,e){return xa.chatDraft(t,e)}function Hc(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 Kc(t,e,n,r,s){const i=si(e,n);if(qc(r)){t.removeItem(i);return}const o={tiptapDoc:r,updatedAt:Date.now()},l=JSON.stringify(o);try{t.setItem(i,l)}catch(a){if(Wc(a)){const d=new TextEncoder().encode(l).byteLength;s?.onQuotaExceeded?.({docSizeBytes:d});return}throw a}}function Am(t,e,n){const r=si(e,n),s=t.getItem(r),i=Hc(s);return s!==null&&i===null&&t.removeItem(r),i}function Bm(t,e,n){t.removeItem(si(e,n))}function Wc(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}var Vc=rc;function Gc(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=t,a=r&&!s,d=lc(n),f=new RegExp(`\\s${d}$`),u=o?"^":"",h=s?"":d,p=a?new RegExp(`${u}${d}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${u}(?:^)?${d}[^\\s${h}]*`,"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(p)).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 Qc=new Yt("suggestion");function Xc({pluginKey:t=Qc,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:u=()=>null,items:h=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:y=Gc,shouldShow:b}){let g;const x=p?.(),k=()=>{const S=e.state.selection.$anchor.pos,T=e.view.coordsAtPos(S),{top:D,right:R,bottom:N,left:E}=T;try{return new DOMRect(E,D,R-E,N-D)}catch{return null}},v=(S,T)=>T?()=>{const D=t.getState(e.state),R=D?.decorationId,N=S.dom.querySelector(`[data-decoration-id="${R}"]`);return N?.getBoundingClientRect()||null}:k;function C(S,T){var D;try{const N=t.getState(S.state),E=N?.decorationId?S.dom.querySelector(`[data-decoration-id="${N.decorationId}"]`):null,$={editor:e,range:N?.range||{from:0,to:0},query:N?.query||null,text:N?.text||null,items:[],command:I=>u({editor:e,range:N?.range||{from:0,to:0},props:I}),decorationNode:E,clientRect:v(S,E)};(D=x?.onExit)==null||D.call(x,$)}catch{}const R=S.state.tr.setMeta(T,{exit:!0});S.dispatch(R)}const j=new Xr({key:t,view(){return{update:async(S,T)=>{var D,R,N,E,$,I,O;const _=(D=this.key)==null?void 0:D.getState(T),A=(R=this.key)==null?void 0:R.getState(S.state),B=_.active&&A.active&&_.range.from!==A.range.from,H=!_.active&&A.active,V=_.active&&!A.active,F=!H&&!V&&_.query!==A.query,U=H||B&&F,G=F||B,Q=V||B&&F;if(!U&&!G&&!Q)return;const X=Q&&!U?_:A,K=S.dom.querySelector(`[data-decoration-id="${X.decorationId}"]`);g={editor:e,range:X.range,query:X.query,text:X.text,items:[],command:te=>u({editor:e,range:X.range,props:te}),decorationNode:K,clientRect:v(S,K)},U&&((N=x?.onBeforeStart)==null||N.call(x,g)),G&&((E=x?.onBeforeUpdate)==null||E.call(x,g)),(G||U)&&(g.items=await h({editor:e,query:X.query})),Q&&(($=x?.onExit)==null||$.call(x,g)),G&&((I=x?.onUpdate)==null||I.call(x,g)),U&&((O=x?.onStart)==null||O.call(x,g))},destroy:()=>{var S;g&&((S=x?.onExit)==null||S.call(x,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,T,D,R){const{isEditable:N}=e,{composing:E}=e.view,{selection:$}=S,{empty:I,from:O}=$,_={...T},A=S.getMeta(t);if(A&&A.exit)return _.active=!1,_.decorationId=null,_.range={from:0,to:0},_.query=null,_.text=null,_;if(_.composing=E,N&&(I||e.view.composing)){(O<T.range.from||O>T.range.to)&&!E&&!T.composing&&(_.active=!1);const B=y({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:$.$from}),H=`id_${Math.floor(Math.random()*4294967295)}`;B&&m({editor:e,state:R,range:B.range,isActive:T.active})&&(!b||b({editor:e,range:B.range,query:B.query,text:B.text,transaction:S}))?(_.active=!0,_.decorationId=T.decorationId?T.decorationId:H,_.range=B.range,_.query=B.query,_.text=B.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={from:0,to:0},_.query=null,_.text=null),_}},props:{handleKeyDown(S,T){var D,R,N,E;const{active:$,range:I}=j.getState(S.state);if(!$)return!1;if(T.key==="Escape"||T.key==="Esc"){const _=j.getState(S.state),A=(D=g?.decorationNode)!=null?D:null,B=A??(_?.decorationId?S.dom.querySelector(`[data-decoration-id="${_.decorationId}"]`):null);if(((R=x?.onKeyDown)==null?void 0:R.call(x,{view:S,event:T,range:_.range}))||!1)return!0;const V={editor:e,range:_.range,query:_.query,text:_.text,items:[],command:F=>u({editor:e,range:_.range,props:F}),decorationNode:B,clientRect:B?()=>B.getBoundingClientRect()||null:null};return(N=x?.onExit)==null||N.call(x,V),C(S,t),!0}return((E=x?.onKeyDown)==null?void 0:E.call(x,{view:S,event:T,range:I}))||!1},decorations(S){const{active:T,range:D,decorationId:R,query:N}=j.getState(S);if(!T)return null;const E=!N?.length,$=[a];return E&&$.push(f),ic.create(S.doc,[oc.inline(D.from,D.to,{nodeName:l,class:$.join(" "),"data-decoration-id":R,"data-decoration-content":d})])}}});return j}function Yc(t){const e=P.c(24),{editor:n,query:r,items:s,onSelect:i,onClose:o}=t,[l,a]=w.useState(0),d=w.useRef(s),f=w.useRef(l),u=w.useRef(i),h=w.useRef(o),p=w.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]!==p?(y=[p],e[1]=p,e[2]=y):y=e[2],w.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]),w.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]),w.useEffect(x,k);let v,C;e[10]!==l?(v=()=>{f.current=l},C=[l],e[10]=l,e[11]=v,e[12]=C):(v=e[11],C=e[12]),w.useEffect(v,C);let j,S;e[13]!==i?(S=()=>{u.current=i},j=[i],e[13]=i,e[14]=j,e[15]=S):(j=e[14],S=e[15]),w.useEffect(S,j);let T,D;e[16]!==o?(T=()=>{h.current=o},D=[o],e[16]=o,e[17]=T,e[18]=D):(T=e[17],D=e[18]),w.useEffect(T,D);let R,N;e[19]!==n?(R=()=>{if(n?.isDestroyed)return;let I;try{I=n.view.dom}catch{return}if(!I)return;const O=A=>{const B=d.current;if(!B.length)return!1;const H=()=>a(F=>(F+1)%B.length),V=()=>a(F=>(F-1+B.length)%B.length);switch(A.key){case"ArrowUp":return A.preventDefault(),V(),!0;case"ArrowDown":return A.preventDefault(),H(),!0;case"Tab":return A.preventDefault(),A.shiftKey?V():H(),!0;case"Home":return A.preventDefault(),a(0),!0;case"End":return A.preventDefault(),a(B.length-1),!0;case"Enter":{if(A.isComposing)return!1;A.preventDefault();const F=f.current;return F!==-1&&B[F]&&u.current?.(B[F],F),!0}case"Escape":return A.preventDefault(),h.current?.(),!0;default:return!1}},_=A=>{O(A)};return I.addEventListener("keydown",_,!0),()=>{I?.removeEventListener("keydown",_,!0)}},N=[n],e[19]=n,e[20]=R,e[21]=N):(R=e[20],N=e[21]),w.useEffect(R,N);const E=s.length?l:void 0;let $;return e[22]!==E?($={selectedIndex:E,setSelectedIndex:a},e[22]=E,e[23]=$):$=e[23],$}function Zc(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 Jc=w.createContext(void 0);function ed(){const t=w.useContext(Jc);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function Om(t){const e=P.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]=w.useReducer(Zc,l);let f;e[1]!==o?(f=y=>{o?.(y)},e[1]=o,e[2]=f):f=e[2];const u=w.useEffectEvent(f);let h;e[3]!==r||e[4]!==i||e[5]!==n||e[6]!==u||e[7]!==s?(h=()=>{if(n?.isDestroyed)return;const y=s instanceof Yt?s:new Yt(s);n.state.plugins.find(x=>x.spec.key===y)&&n.unregisterPlugin(y);const g=Xc({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}}),u(!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"}),u(!1)}}),items:td});return n.registerPlugin(g),()=>{n?.isDestroyed||n.unregisterPlugin(y)}},e[3]=r,e[4]=i,e[5]=n,e[6]=u,e[7]=s,e[8]=h):h=e[8];let p;e[9]!==r||e[10]!==i||e[11]!==n||e[12]!==s?(p=[n,s,r,d,i],e[9]=r,e[10]=i,e[11]=n,e[12]=s,e[13]=p):p=e[13],w.useEffect(h,p);let m;return e[14]!==a?(m={state:a,dispatch:d},e[14]=a,e[15]=m):m=e[15],m}function td(){return[]}function $m({editor:t,queryKey:e,queryFn:n,onSelect:r}){const{state:s,dispatch:i}=ed(),o=w.useDeferredValue(s.query),{data:l}=ba({queryKey:ke.suggestionItems(e,s.open,o),queryFn:()=>s.open?n({query:o}):[]}),a=()=>{i({type:"ON_EXIT"})},d=async(u,h)=>{if(!(s.selectedItem!==null||!s.range)){i({type:"SET_SELECTED_ITEM",payload:u});try{const{view:p}=t,y=p.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:u})===!1?i({type:"SET_SELECTED_ITEM",payload:null}):a()}catch{a()}}},{selectedIndex:f}=Yc({editor:t,query:o,items:l,onSelect:d,onClose:a});return{selectedItem:s.selectedItem,items:l,selectedIndex:f,close:a,onSelect:d}}function Mm(t){return t.contentHash??`${t.size}-${t.updatedAt}`}function Ct(t,e,n,r){const s=new URLSearchParams(r).toString();return`/api/${encodeURIComponent(t)}/fs/${encodeURIComponent(e)}/${n}${s?`?${s}`:""}`}async function et(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 zm(t,e){const n=P.c(15),{org:r}=Be();let s;n[0]!==r.id||n[1]!==e||n[2]!==t?(s=ke.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 et(Ct(r.slug,t,"list",{path:e}))).json()).entries.toSorted(nd),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],lt(l)}function nd(t,e){return t.kind!==e.kind?t.kind==="dir"?-1:1:t.path.localeCompare(e.path)}function Lm(t,e,n){const r=P.c(15),{org:s}=Be();let i;r[0]!==s.id||r[1]!==e||r[2]!==t?(i=ke.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 et(Ct(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],lt(d)}function Pm(t){const e=P.c(9),{org:n}=Be();let r;e[0]!==n.id||e[1]!==t?(r=ke.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 et(Ct(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],lt(i)}function Fm(t,e){const n=P.c(9),r=t===void 0?60:t,{org:s}=Be();let i;n[0]!==s.id?(i=ke.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 et(`/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],lt(a)}const sd=50;function Um(t,e){const n=P.c(16),{org:r}=Be();let s;n[0]!==r.id||n[1]!==t||n[2]!==e?.prefix||n[3]!==e?.volume?(s=ke.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(sd)});return e&&(d.set("volume",e.volume),e.prefix&&d.set("prefix",e.prefix)),(await(await et(`/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],lt(a)}function qm(t){const e=P.c(8),{org:n}=Be();let r;e[0]!==n.id?(r=ke.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 et(`/api/${encodeURIComponent(n.slug)}/fs/skills`),{skills:a}=await l.json();return a.map(rd)},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],lt(o)}function rd(t){return{volume:t.volume,path:t.path}}async function Hm(t){const e=await et(`/api/${encodeURIComponent(t)}/fs/skills`),{skills:n}=await e.json();return n}async function id(t,e,n){return(await et(Ct(t,e,"read",{path:n}))).text()}const od=new Set(["md","mdx","markdown","txt","text"]),ld=25,ad=64*1024,cd=256*1024,dd=4;function ud(t){const e=t.lastIndexOf(".");return e===-1?!1:od.has(t.slice(e+1).toLowerCase())}async function Km(t,e,n){const r=n?`${n}/`:"",s=u=>u.startsWith(r)?u.slice(r.length):u,i=[],o=[],l=[{path:n,depth:0}];for(;l.length>0;){const u=l.shift();if(!u)break;let h;try{h=(await(await et(Ct(t,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const p of[...h].sort((m,y)=>m.path.localeCompare(y.path))){if(p.kind==="dir"){u.depth<dd&&l.push({path:p.path,depth:u.depth+1});continue}ud(p.path)&&p.size<=ad&&i.length<ld?i.push(p.path):o.push(s(p.path))}}const a=await Promise.all(i.map(u=>id(t,e,u).catch(()=>null))),d=[];let f=0;return i.forEach((u,h)=>{const p=a[h];if(p==null||f+p.length>cd){o.push(s(u));return}f+=p.length,d.push({relPath:s(u),content:p})}),d.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),o.sort(),{files:d,omittedPaths:o}}function Wm(){const t=P.c(7),{org:e}=Be();let n;t[0]!==e.id?(n=ke.orgFsPublicSets(e.id),t[0]=e.id,t[1]=n):n=t[1];let r;t[2]!==e.slug?(r=async()=>(await(await et(`/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],lt(s)}function fd(t){const e=P.c(3),{org:n}=Be();let r;return e[0]!==n.slug||e[1]!==t?(r=s=>Ct(n.slug,t,"read",{path:s}),e[0]=n.slug,e[1]=t,e[2]=r):r=e[2],r}function Vm(){const t=P.c(2),{org:e}=Be();let n;return t[0]!==e.slug?(n=(r,s)=>Ct(e.slug,r,"read",{path:s}),t[0]=e.slug,t[1]=n):n=t[1],n}function Gm(t){const e=P.c(3),{org:n}=Be();let r;return e[0]!==n||e[1]!==t?(r={mutationFn:async s=>(await(await et(Ct(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],Je(r)}function Qm(t){const e=P.c(18),{org:n}=Be(),r=an();let s;e[0]!==n||e[1]!==t?(s=async d=>(await(await et(Ct(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=ke.orgFsStat(n.id,t,d.path);await r.cancelQueries({queryKey:f});const u=r.getQueryData(f),h=d.mode!=="private";return r.setQueryData(f,p=>p&&{...p,readPublic:h,effectivePublic:h,shareMode:d.mode}),{key:f,previous:u}},e[3]=n,e[4]=r,e[5]=t,e[6]=i):i=e[6];let o;e[7]!==r?(o=(d,f,u)=>{u&&r.setQueryData(u.key,u.previous)},e[7]=r,e[8]=o):o=e[8];let l;e[9]!==n||e[10]!==r||e[11]!==t?(l=(d,f,u)=>{r.invalidateQueries({queryKey:ke.orgFsStat(n.id,t,u.path)}),r.invalidateQueries({queryKey:ke.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:ke.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:ke.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],Je(a)}function hd(t){const e=P.c(33),{org:n}=Be(),r=an();let s;e[0]!==n||e[1]!==r||e[2]!==t?(s=()=>{r.invalidateQueries({queryKey:ke.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:ke.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:ke.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 C=(await Promise.allSettled(k.files.map(j=>{const S=k.dir?`${k.dir}/${j.name}`:j.name;return et(Ct(n.slug,t,"file",{path:S}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find(pd);if(C)throw C.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=Je(l);let d;e[10]!==n||e[11]!==t?(d=async k=>{await et(Ct(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 u=Je(f);let h;e[16]!==n||e[17]!==t?(h=async k=>{await et(Ct(n.slug,t,"file",{path:k}),{method:"DELETE"})},e[16]=n,e[17]=t,e[18]=h):h=e[18];let p;e[19]!==i||e[20]!==h?(p={mutationFn:h,onSuccess:i},e[19]=i,e[20]=h,e[21]=p):p=e[21];const m=Je(p);let y;e[22]!==n||e[23]!==t?(y=async k=>{await et(Ct(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=Je(b);let x;return e[28]!==u||e[29]!==g||e[30]!==m||e[31]!==a?(x={upload:a,mkdir:u,remove:m,move:g},e[28]=u,e[29]=g,e[30]=m,e[31]=a,e[32]=x):x=e[32],x}function pd(t){return t.status==="rejected"}function gd(t){return t?t.run_in_progress?"generating":t.scanned_at?"ready":"none":"none"}const md=2e4;function xd(t){if(typeof t!="string"||!t)return null;try{return new URL(t).hostname||null}catch{return null}}function bd(){const t=P.c(17),{org:e}=Be(),n=$a.COMMERCE_DISCOVERY(e.id);let r;t[0]!==e.id||t[1]!==e.slug?(r=Di({connectionId:Bo,orgId:e.id,orgSlug:e.slug}),t[0]=e.id,t[1]=e.slug,t[2]=r):r=t[2];const{data:s}=lt(r),o=lt({queryKey:ke.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 _r(k)}}).data?.item??null,{data:l}=lt({...Di({connectionId:n,orgId:e.id,orgSlug:e.slug}),enabled:!!o}),a=ke.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:Oo,arguments:{}});return _r(k).diagnostic??null},t[3]=l,t[4]=f):f=t[4];let u;t[5]!==a||t[6]!==d||t[7]!==f?(u={queryKey:a,enabled:d,retry:1,refetchInterval:yd,queryFn:f},t[5]=a,t[6]=d,t[7]=f,t[8]=u):u=t[8];const h=lt(u),p=h.data??null,m=h.isSuccess,y=o?.metadata?.siteUrl;let b;t[9]!==y?(b=xd(y),t[9]=y,t[10]=b):b=t[10];const g=l??null;let x;return t[11]!==n||t[12]!==h.isSuccess||t[13]!==p||t[14]!==b||t[15]!==g?(x={diagnostic:p,isSuccess:m,host:b,connectionId:n,cdClient:g},t[11]=n,t[12]=h.isSuccess,t[13]=p,t[14]=b,t[15]=g,t[16]=x):x=t[16],x}function yd(t){return t.state.status!=="error"&&gd(t.state.data)==="generating"?md:!1}function kd(t,e){return{to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:Ma(t.id),main:Ic(e,Oo)}}}function vd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return w.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const lr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qn(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function ri(t){return"nodeType"in t}function ct(t){var e,n;return t?Qn(t)?t:ri(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function ii(t){const{Document:e}=ct(t);return t instanceof e}function Ss(t){return Qn(t)?!1:t instanceof ct(t).HTMLElement}function nl(t){return t instanceof ct(t).SVGElement}function Xn(t){return t?Qn(t)?t.document:ri(t)?ii(t)?t:Ss(t)||nl(t)?t.ownerDocument:document:document:document}const Mt=lr?w.useLayoutEffect:w.useEffect;function ar(t){const e=w.useRef(t);return Mt(()=>{e.current=t}),w.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 wd(){const t=w.useRef(null),e=w.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=w.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function bs(t,e){e===void 0&&(e=[t]);const n=w.useRef(t);return Mt(()=>{n.current!==t&&(n.current=t)},e),n}function Cs(t,e){const n=w.useRef();return w.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Ws(t){const e=ar(t),n=w.useRef(null),r=w.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function Vs(t){const e=w.useRef();return w.useEffect(()=>{e.current=t},[t]),e.current}let wr={};function js(t,e){return w.useMemo(()=>{if(e)return e;const n=wr[t]==null?0:wr[t]+1;return wr[t]=n,t+"-"+n},[t,e])}function sl(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 Vn=sl(1),ys=sl(-1);function Sd(t){return"clientX"in t&&"clientY"in t}function cr(t){if(!t)return!1;const{KeyboardEvent:e}=ct(t.target);return e&&t instanceof e}function Cd(t){if(!t)return!1;const{TouchEvent:e}=ct(t.target);return e&&t instanceof e}function Gs(t){if(Cd(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 Sd(t)?{x:t.clientX,y:t.clientY}:null}const Zt=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[Zt.Translate.toString(t),Zt.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),Ii="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function jd(t){return t.matches(Ii)?t:t.querySelector(Ii)}const Td={display:"none"};function Nd(t){let{id:e,value:n}=t;return Te.createElement("div",{id:e,style:Td},n)}function Dd(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 Rd(){const[t,e]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const rl=w.createContext(null);function Ed(t){const e=w.useContext(rl);w.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function Id(){const[t]=w.useState(()=>new Set),e=w.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[w.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 _d={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
|
-
`},Ad={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 Bd(t){let{announcements:e=Ad,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=_d}=t;const{announce:i,announcement:o}=Rd(),l=js("DndLiveRegion"),[a,d]=w.useState(!1);if(w.useEffect(()=>{d(!0)},[]),Ed(w.useMemo(()=>({onDragStart(u){let{active:h}=u;i(e.onDragStart({active:h}))},onDragMove(u){let{active:h,over:p}=u;e.onDragMove&&i(e.onDragMove({active:h,over:p}))},onDragOver(u){let{active:h,over:p}=u;i(e.onDragOver({active:h,over:p}))},onDragEnd(u){let{active:h,over:p}=u;i(e.onDragEnd({active:h,over:p}))},onDragCancel(u){let{active:h,over:p}=u;i(e.onDragCancel({active:h,over:p}))}}),[i,e])),!a)return null;const f=Te.createElement(Te.Fragment,null,Te.createElement(Nd,{id:r,value:s.draggable}),Te.createElement(Dd,{id:l,announcement:o}));return n?Xt.createPortal(f,n):f}var Pe;(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"})(Pe||(Pe={}));function Qs(){}function _i(t,e){return w.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Od(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return w.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const zt=Object.freeze({x:0,y:0});function il(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function $d(t,e){const n=Gs(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 ol(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function Md(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function Ai(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 ll(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function Bi(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 Xm=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=Bi(e,e.left,e.top),i=[];for(const o of r){const{id:l}=o,a=n.get(l);if(a){const d=il(Bi(a),s);i.push({id:l,data:{droppableContainer:o,value:d}})}}return i.sort(ol)},al=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=Ai(e),i=[];for(const o of r){const{id:l}=o,a=n.get(l);if(a){const d=Ai(a),f=s.reduce((h,p,m)=>h+il(d[m],p),0),u=Number((f/4).toFixed(4));i.push({id:l,data:{droppableContainer:o,value:u}})}}return i.sort(ol)};function zd(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,u=f/(a+d-f);return Number(u.toFixed(4))}return 0}const Ld=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=zd(l,e);a>0&&s.push({id:o,data:{droppableContainer:i,value:a}})}}return s.sort(Md)};function Pd(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function cl(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:zt}function Fd(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 Ud=Fd(1);function dl(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 qd(t,e,n){const r=dl(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,u=i?t.height/i:t.height;return{width:f,height:u,top:d,right:a+f,bottom:d+u,left:a}}const Hd={ignoreTransform:!1};function Yn(t,e){e===void 0&&(e=Hd);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:f}=ct(t).getComputedStyle(t);d&&(n=qd(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 Oi(t){return Yn(t,{ignoreTransform:!0})}function Kd(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function Wd(t,e){return e===void 0&&(e=ct(t).getComputedStyle(t)),e.position==="fixed"}function Vd(t,e){e===void 0&&(e=ct(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 dr(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(ii(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Ss(s)||nl(s)||n.includes(s))return n;const i=ct(t).getComputedStyle(s);return s!==t&&Vd(s,i)&&n.push(s),Wd(s,i)?n:r(s.parentNode)}return t?r(t):n}function ul(t){const[e]=dr(t,1);return e??null}function Sr(t){return!lr||!t?null:Qn(t)?t:ri(t)?ii(t)||t===Xn(t).scrollingElement?window:Ss(t)?t:null:null}function fl(t){return Qn(t)?t.scrollX:t.scrollLeft}function hl(t){return Qn(t)?t.scrollY:t.scrollTop}function Ar(t){return{x:fl(t),y:hl(t)}}var He;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(He||(He={}));function pl(t){return!lr||!t?!1:t===document.scrollingElement}function gl(t){const e={x:0,y:0},n=pl(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 Gd={x:.2,y:.2};function Qd(t,e,n,r,s){let{top:i,left:o,right:l,bottom:a}=n;r===void 0&&(r=10),s===void 0&&(s=Gd);const{isTop:d,isBottom:f,isLeft:u,isRight:h}=gl(t),p={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?(p.y=He.Backward,m.y=r*Math.abs((e.top+y.height-i)/y.height)):!f&&a>=e.bottom-y.height&&(p.y=He.Forward,m.y=r*Math.abs((e.bottom-y.height-a)/y.height)),!h&&l>=e.right-y.width?(p.x=He.Forward,m.x=r*Math.abs((e.right-y.width-l)/y.width)):!u&&o<=e.left+y.width&&(p.x=He.Backward,m.x=r*Math.abs((e.left+y.width-o)/y.width)),{direction:p,speed:m}}function Xd(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 ml(t){return t.reduce((e,n)=>Vn(e,Ar(n)),zt)}function Yd(t){return t.reduce((e,n)=>e+fl(n),0)}function Zd(t){return t.reduce((e,n)=>e+hl(n),0)}function xl(t,e){if(e===void 0&&(e=Yn),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);ul(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const Jd=[["x",["left","right"],Yd],["y",["top","bottom"],Zd]];class oi{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=dr(n),s=ml(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,l]of Jd)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 us{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 eu(t){const{EventTarget:e}=ct(t);return t instanceof e?t:Xn(t)}function Cr(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 Nt;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Nt||(Nt={}));function $i(t){t.preventDefault()}function tu(t){t.stopPropagation()}var le;(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"})(le||(le={}));const bl={start:[le.Space,le.Enter],cancel:[le.Esc],end:[le.Space,le.Enter,le.Tab]},nu=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case le.Right:return{...n,x:n.x+25};case le.Left:return{...n,x:n.x-25};case le.Down:return{...n,y:n.y+25};case le.Up:return{...n,y:n.y-25}}};class li{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 us(Xn(n)),this.windowListeners=new us(ct(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Nt.Resize,this.handleCancel),this.windowListeners.add(Nt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Nt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&xl(r),n(zt)}handleKeyDown(e){if(cr(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=bl,coordinateGetter:o=nu,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}:zt;this.referenceCoordinates||(this.referenceCoordinates=f);const u=o(e,{active:n,context:r.current,currentCoordinates:f});if(u){const h=ys(u,f),p={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:C,minScroll:j}=gl(y),S=Xd(y),T={x:Math.min(b===le.Right?S.right-S.width/2:S.right,Math.max(b===le.Right?S.left:S.left+S.width/2,u.x)),y:Math.min(b===le.Down?S.bottom-S.height/2:S.bottom,Math.max(b===le.Down?S.top:S.top+S.height/2,u.y))},D=b===le.Right&&!x||b===le.Left&&!k,R=b===le.Down&&!v||b===le.Up&&!g;if(D&&T.x!==u.x){const N=y.scrollLeft+h.x,E=b===le.Right&&N<=C.x||b===le.Left&&N>=j.x;if(E&&!h.y){y.scrollTo({left:N,behavior:l});return}E?p.x=y.scrollLeft-N:p.x=b===le.Right?y.scrollLeft-C.x:y.scrollLeft-j.x,p.x&&y.scrollBy({left:-p.x,behavior:l});break}else if(R&&T.y!==u.y){const N=y.scrollTop+h.y,E=b===le.Down&&N<=C.y||b===le.Up&&N>=j.y;if(E&&!h.x){y.scrollTo({top:N,behavior:l});return}E?p.y=y.scrollTop-N:p.y=b===le.Down?y.scrollTop-C.y:y.scrollTop-j.y,p.y&&y.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(e,Vn(ys(u,this.referenceCoordinates),p))}}}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()}}li.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=bl,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 Mi(t){return!!(t&&"distance"in t)}function zi(t){return!!(t&&"delay"in t)}class ai{constructor(e,n,r){var s;r===void 0&&(r=eu(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=Xn(o),this.documentListeners=new us(this.document),this.listeners=new us(r),this.windowListeners=new us(ct(o)),this.initialCoordinates=(s=Gs(i))!=null?s:zt,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(Nt.Resize,this.handleCancel),this.windowListeners.add(Nt.DragStart,$i),this.windowListeners.add(Nt.VisibilityChange,this.handleCancel),this.windowListeners.add(Nt.ContextMenu,$i),this.documentListeners.add(Nt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zi(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Mi(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(Nt.Click,tu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Nt.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=Gs(e))!=null?n:zt,d=ys(s,a);if(!r&&l){if(Mi(l)){if(l.tolerance!=null&&Cr(d,l.tolerance))return this.handleCancel();if(Cr(d,l.distance))return this.handleStart()}if(zi(l)&&Cr(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===le.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const su={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ci extends ai{constructor(e){const{event:n}=e,r=Xn(n.target);super(e,su,r)}}ci.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 ru={move:{name:"mousemove"},end:{name:"mouseup"}};var Br;(function(t){t[t.RightClick=2]="RightClick"})(Br||(Br={}));class iu extends ai{constructor(e){super(e,ru,Xn(e.event.target))}}iu.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===Br.RightClick?!1:(r?.({event:n}),!0)}}];const jr={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ou extends ai{constructor(e){super(e,jr)}static setup(){return window.addEventListener(jr.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(jr.move.name,e)};function e(){}}}ou.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 fs;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(fs||(fs={}));var Xs;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Xs||(Xs={}));function lu(t){let{acceleration:e,activator:n=fs.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:l=Xs.TreeOrder,pointerCoordinates:a,scrollableAncestors:d,scrollableAncestorRects:f,delta:u,threshold:h}=t;const p=cu({delta:u,disabled:!i}),[m,y]=wd(),b=w.useRef({x:0,y:0}),g=w.useRef({x:0,y:0}),x=w.useMemo(()=>{switch(n){case fs.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case fs.DraggableRect:return s}},[n,s,a]),k=w.useRef(null),v=w.useCallback(()=>{const j=k.current;if(!j)return;const S=b.current.x*g.current.x,T=b.current.y*g.current.y;j.scrollBy(S,T)},[]),C=w.useMemo(()=>l===Xs.TreeOrder?[...d].reverse():d,[l,d]);w.useEffect(()=>{if(!i||!d.length||!x){y();return}for(const j of C){if(r?.(j)===!1)continue;const S=d.indexOf(j),T=f[S];if(!T)continue;const{direction:D,speed:R}=Qd(j,T,x,e,h);for(const N of["x","y"])p[N][D[N]]||(R[N]=0,D[N]=0);if(R.x>0||R.y>0){y(),k.current=j,m(v,o),b.current=R,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(p),m,d,C,f,JSON.stringify(h)])}const au={x:{[He.Backward]:!1,[He.Forward]:!1},y:{[He.Backward]:!1,[He.Forward]:!1}};function cu(t){let{delta:e,disabled:n}=t;const r=Vs(e);return Cs(s=>{if(n||!r||!s)return au;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[He.Backward]:s.x[He.Backward]||i.x===-1,[He.Forward]:s.x[He.Forward]||i.x===1},y:{[He.Backward]:s.y[He.Backward]||i.y===-1,[He.Forward]:s.y[He.Forward]||i.y===1}}},[n,e,r])}function du(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Cs(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function uu(t,e){return w.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 ks;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ks||(ks={}));var Or;(function(t){t.Optimized="optimized"})(Or||(Or={}));const Li=new Map;function fu(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=w.useState(null),{frequency:l,measure:a,strategy:d}=s,f=w.useRef(t),u=b(),h=bs(u),p=w.useCallback(function(g){g===void 0&&(g=[]),!h.current&&o(x=>x===null?g:x.concat(g.filter(k=>!x.includes(k))))},[h]),m=w.useRef(null),y=Cs(g=>{if(u&&!n)return Li;if(!g||g===Li||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,C=v?new oi(a(v),v):null;k.rect.current=C,C&&x.set(k.id,C)}return x}return g},[t,i,n,u,a]);return w.useEffect(()=>{f.current=t},[t]),w.useEffect(()=>{u||p()},[n,u]),w.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),w.useEffect(()=>{u||typeof l!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},l))},[l,u,p,...r]),{droppableRects:y,measureDroppableContainers:p,measuringScheduled:i!=null};function b(){switch(d){case ks.Always:return!1;case ks.BeforeDragging:return n;default:return!n}}}function di(t,e){return Cs(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function hu(t,e){return di(t,e)}function pu(t){let{callback:e,disabled:n}=t;const r=ar(e),s=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return w.useEffect(()=>()=>s?.disconnect(),[s]),s}function ur(t){let{callback:e,disabled:n}=t;const r=ar(e),s=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return w.useEffect(()=>()=>s?.disconnect(),[s]),s}function gu(t){return new oi(Yn(t),t)}function Pi(t,e,n){e===void 0&&(e=gu);const[r,s]=w.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=pu({callback(a){if(t)for(const d of a){const{type:f,target:u}=d;if(f==="childList"&&u instanceof HTMLElement&&u.contains(t)){i();break}}}}),l=ur({callback:i});return Mt(()=>{i(),t?(l?.observe(t),o?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),o?.disconnect())},[t]),r}function mu(t){const e=di(t);return cl(t,e)}const Fi=[];function xu(t){const e=w.useRef(t),n=Cs(r=>t?r&&r!==Fi&&t&&e.current&&t.parentNode===e.current.parentNode?r:dr(t):Fi,[t]);return w.useEffect(()=>{e.current=t},[t]),n}function bu(t){const[e,n]=w.useState(null),r=w.useRef(t),s=w.useCallback(i=>{const o=Sr(i.target);o&&n(l=>l?(l.set(o,Ar(o)),new Map(l)):null)},[]);return w.useEffect(()=>{const i=r.current;if(t!==i){o(i);const l=t.map(a=>{const d=Sr(a);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,Ar(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=Sr(a);d?.removeEventListener("scroll",s)})}},[s,t]),w.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>Vn(i,o),zt):ml(t):zt,[t,e])}function Ui(t,e){e===void 0&&(e=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},e),w.useEffect(()=>{const r=t!==zt;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?ys(t,n.current):zt}function yu(t){w.useEffect(()=>{if(!lr)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 ku(t,e){return w.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function yl(t){return w.useMemo(()=>t?Kd(t):null,[t])}const qi=[];function vu(t,e){e===void 0&&(e=Yn);const[n]=t,r=yl(n?ct(n):null),[s,i]=w.useState(qi);function o(){i(()=>t.length?t.map(a=>pl(a)?r:new oi(e(a),a)):qi)}const l=ur({callback:o});return Mt(()=>{l?.disconnect(),o(),t.forEach(a=>l?.observe(a))},[t]),s}function kl(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Ss(e)?e:t}function wu(t){let{measure:e}=t;const[n,r]=w.useState(null),s=w.useCallback(d=>{for(const{target:f}of d)if(Ss(f)){r(u=>{const h=e(f);return u?{...u,width:h.width,height:h.height}:h});break}},[e]),i=ur({callback:s}),o=w.useCallback(d=>{const f=kl(d);i?.disconnect(),f&&i?.observe(f),r(f?e(f):null)},[e,i]),[l,a]=Ws(o);return w.useMemo(()=>({nodeRef:l,rect:n,setRef:a}),[n,l,a])}const Su=[{sensor:ci,options:{}},{sensor:li,options:{}}],Cu={current:{}},Hs={draggable:{measure:Oi},droppable:{measure:Oi,strategy:ks.WhileDragging,frequency:Or.Optimized},dragOverlay:{measure:Yn}};class hs 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 ju={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new hs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qs},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Hs,measureDroppableContainers:Qs,windowRect:null,measuringScheduled:!1},vl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qs,draggableNodes:new Map,over:null,measureDroppableContainers:Qs},Ts=w.createContext(vl),wl=w.createContext(ju);function Tu(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new hs}}}function Nu(t,e){switch(e.type){case Pe.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Pe.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 Pe.DragEnd:case Pe.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Pe.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new hs(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case Pe.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 hs(t.droppable.containers);return o.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:o}}}case Pe.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new hs(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Du(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=w.useContext(Ts),i=Vs(r),o=Vs(n?.id);return w.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!cr(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 u=jd(f);if(u){u.focus();break}}})}},[r,e,s,o,i]),null}function Sl(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function Ru(t){return w.useMemo(()=>({draggable:{...Hs.draggable,...t?.draggable},droppable:{...Hs.droppable,...t?.droppable},dragOverlay:{...Hs.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Eu(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=w.useRef(!1),{x:o,y:l}=typeof s=="boolean"?{x:s,y:s}:s;Mt(()=>{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),u=cl(f,r);if(o||(u.x=0),l||(u.y=0),i.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const h=ul(d);h&&h.scrollBy({top:u.y,left:u.x})}},[e,o,l,r,n])}const fr=w.createContext({...zt,scaleX:1,scaleY:1});var Qt;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Qt||(Qt={}));const Iu=w.memo(function(e){var n,r,s,i;let{id:o,accessibility:l,autoScroll:a=!0,children:d,sensors:f=Su,collisionDetection:u=Ld,measuring:h,modifiers:p,...m}=e;const y=w.useReducer(Nu,void 0,Tu),[b,g]=y,[x,k]=Id(),[v,C]=w.useState(Qt.Uninitialized),j=v===Qt.Initialized,{draggable:{active:S,nodes:T,translate:D},droppable:{containers:R}}=b,N=S!=null?T.get(S):null,E=w.useRef({initial:null,translated:null}),$=w.useMemo(()=>{var de;return S!=null?{id:S,data:(de=N?.data)!=null?de:Cu,rect:E}:null},[S,N]),I=w.useRef(null),[O,_]=w.useState(null),[A,B]=w.useState(null),H=bs(m,Object.values(m)),V=js("DndDescribedBy",o),F=w.useMemo(()=>R.getEnabled(),[R]),U=Ru(h),{droppableRects:G,measureDroppableContainers:Q,measuringScheduled:X}=fu(F,{dragging:j,dependencies:[D.x,D.y],config:U.droppable}),K=du(T,S),te=w.useMemo(()=>A?Gs(A):null,[A]),Z=ot(),ne=hu(K,U.draggable.measure);Eu({activeNode:S!=null?T.get(S):null,config:Z.layoutShiftCompensation,initialRect:ne,measure:U.draggable.measure});const z=Pi(K,U.draggable.measure,ne),q=Pi(K?K.parentElement:null),W=w.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:G,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=R.getNodeFor((n=W.current.over)==null?void 0:n.id),M=wu({measure:U.dragOverlay.measure}),J=(r=M.nodeRef.current)!=null?r:K,se=j?(s=M.rect)!=null?s:z:null,ce=!!(M.nodeRef.current&&M.rect),we=mu(ce?null:z),me=yl(J?ct(J):null),Se=xu(j?re??K:null),fe=vu(Se),tt=Sl(p,{transform:{x:D.x-we.x,y:D.y-we.y,scaleX:1,scaleY:1},activatorEvent:A,active:$,activeNodeRect:z,containerNodeRect:q,draggingNodeRect:se,over:W.current.over,overlayNodeRect:M.rect,scrollableAncestors:Se,scrollableAncestorRects:fe,windowRect:me}),Ee=te?Vn(te,D):null,Lt=bu(Se),Ve=Ui(Lt),Ie=Ui(Lt,[z]),xe=Vn(tt,Ve),Ue=se?Ud(se,tt):null,he=$&&Ue?u({active:$,collisionRect:Ue,droppableRects:G,droppableContainers:F,pointerCoordinates:Ee}):null,dt=ll(he,"id"),[Oe,Ce]=w.useState(null),Pt=ce?tt:Vn(tt,Ie),nt=Pd(Pt,(i=Oe?.rect)!=null?i:null,z),Ke=w.useRef(null),Ge=w.useCallback((de,be)=>{let{sensor:ye,options:Ne}=be;if(I.current==null)return;const ve=T.get(I.current);if(!ve)return;const je=de.nativeEvent,De=new ye({active:I.current,activeNode:ve,event:je,options:Ne,context:W,onAbort(pe){if(!T.get(pe))return;const{onDragAbort:Re}=H.current,Me={id:pe};Re?.(Me),x({type:"onDragAbort",event:Me})},onPending(pe,Ae,Re,Me){if(!T.get(pe))return;const{onDragPending:Xe}=H.current,ze={id:pe,constraint:Ae,initialCoordinates:Re,offset:Me};Xe?.(ze),x({type:"onDragPending",event:ze})},onStart(pe){const Ae=I.current;if(Ae==null)return;const Re=T.get(Ae);if(!Re)return;const{onDragStart:Me}=H.current,Qe={activatorEvent:je,active:{id:Ae,data:Re.data,rect:E}};Xt.unstable_batchedUpdates(()=>{Me?.(Qe),C(Qt.Initializing),g({type:Pe.DragStart,initialCoordinates:pe,active:Ae}),x({type:"onDragStart",event:Qe}),_(Ke.current),B(je)})},onMove(pe){g({type:Pe.DragMove,coordinates:pe})},onEnd:$e(Pe.DragEnd),onCancel:$e(Pe.DragCancel)});Ke.current=De;function $e(pe){return async function(){const{active:Re,collisions:Me,over:Qe,scrollAdjustedTranslate:Xe}=W.current;let ze=null;if(Re&&Xe){const{cancelDrop:Ye}=H.current;ze={activatorEvent:je,active:Re,collisions:Me,delta:Xe,over:Qe},pe===Pe.DragEnd&&typeof Ye=="function"&&await Promise.resolve(Ye(ze))&&(pe=Pe.DragCancel)}I.current=null,Xt.unstable_batchedUpdates(()=>{g({type:pe}),C(Qt.Uninitialized),Ce(null),_(null),B(null),Ke.current=null;const Ye=pe===Pe.DragEnd?"onDragEnd":"onDragCancel";if(ze){const We=H.current[Ye];We?.(ze),x({type:Ye,event:ze})}})}}},[T]),st=w.useCallback((de,be)=>(ye,Ne)=>{const ve=ye.nativeEvent,je=T.get(Ne);if(I.current!==null||!je||ve.dndKit||ve.defaultPrevented)return;const De={active:je};de(ye,be.options,De)===!0&&(ve.dndKit={capturedBy:be.sensor},I.current=Ne,Ge(ye,be))},[T,Ge]),pt=uu(f,st);yu(f),Mt(()=>{z&&v===Qt.Initializing&&C(Qt.Initialized)},[z,v]),w.useEffect(()=>{const{onDragMove:de}=H.current,{active:be,activatorEvent:ye,collisions:Ne,over:ve}=W.current;if(!be||!ye)return;const je={active:be,activatorEvent:ye,collisions:Ne,delta:{x:xe.x,y:xe.y},over:ve};Xt.unstable_batchedUpdates(()=>{de?.(je),x({type:"onDragMove",event:je})})},[xe.x,xe.y]),w.useEffect(()=>{const{active:de,activatorEvent:be,collisions:ye,droppableContainers:Ne,scrollAdjustedTranslate:ve}=W.current;if(!de||I.current==null||!be||!ve)return;const{onDragOver:je}=H.current,De=Ne.get(dt),$e=De&&De.rect.current?{id:De.id,rect:De.rect.current,data:De.data,disabled:De.disabled}:null,pe={active:de,activatorEvent:be,collisions:ye,delta:{x:ve.x,y:ve.y},over:$e};Xt.unstable_batchedUpdates(()=>{Ce($e),je?.(pe),x({type:"onDragOver",event:pe})})},[dt]),Mt(()=>{W.current={activatorEvent:A,active:$,activeNode:K,collisionRect:Ue,collisions:he,droppableRects:G,draggableNodes:T,draggingNode:J,draggingNodeRect:se,droppableContainers:R,over:Oe,scrollableAncestors:Se,scrollAdjustedTranslate:xe},E.current={initial:se,translated:Ue}},[$,K,he,Ue,T,J,se,G,R,Oe,Se,xe]),lu({...Z,delta:D,draggingRect:Ue,pointerCoordinates:Ee,scrollableAncestors:Se,scrollableAncestorRects:fe});const rt=w.useMemo(()=>({active:$,activeNode:K,activeNodeRect:z,activatorEvent:A,collisions:he,containerNodeRect:q,dragOverlay:M,draggableNodes:T,droppableContainers:R,droppableRects:G,over:Oe,measureDroppableContainers:Q,scrollableAncestors:Se,scrollableAncestorRects:fe,measuringConfiguration:U,measuringScheduled:X,windowRect:me}),[$,K,z,A,he,q,M,T,R,G,Oe,Q,Se,fe,U,X,me]),it=w.useMemo(()=>({activatorEvent:A,activators:pt,active:$,activeNodeRect:z,ariaDescribedById:{draggable:V},dispatch:g,draggableNodes:T,over:Oe,measureDroppableContainers:Q}),[A,pt,$,z,g,V,T,Oe,Q]);return Te.createElement(rl.Provider,{value:k},Te.createElement(Ts.Provider,{value:it},Te.createElement(wl.Provider,{value:rt},Te.createElement(fr.Provider,{value:nt},d)),Te.createElement(Du,{disabled:l?.restoreFocus===!1})),Te.createElement(Bd,{...l,hiddenTextDescribedById:V}));function ot(){const de=O?.autoScrollEnabled===!1,be=typeof a=="object"?a.enabled===!1:a===!1,ye=j&&!de&&!be;return typeof a=="object"?{...a,enabled:ye}:{enabled:ye}}}),_u=w.createContext(null),Hi="button",Au="Draggable";function Bu(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=js(Au),{activators:o,activatorEvent:l,active:a,activeNodeRect:d,ariaDescribedById:f,draggableNodes:u,over:h}=w.useContext(Ts),{role:p=Hi,roleDescription:m="draggable",tabIndex:y=0}=s??{},b=a?.id===e,g=w.useContext(b?fr:_u),[x,k]=Ws(),[v,C]=Ws(),j=ku(o,e),S=bs(n);Mt(()=>(u.set(e,{id:e,key:i,node:x,activatorNode:v,data:S}),()=>{const D=u.get(e);D&&D.key===i&&u.delete(e)}),[u,e]);const T=w.useMemo(()=>({role:p,tabIndex:y,"aria-disabled":r,"aria-pressed":b&&p===Hi?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,p,y,b,m,f.draggable]);return{active:a,activatorEvent:l,activeNodeRect:d,attributes:T,isDragging:b,listeners:r?void 0:j,node:x,over:h,setNodeRef:k,setActivatorNodeRef:C,transform:g}}function Cl(){return w.useContext(wl)}const Ou="Droppable",$u={timeout:25};function jl(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=js(Ou),{active:o,dispatch:l,over:a,measureDroppableContainers:d}=w.useContext(Ts),f=w.useRef({disabled:n}),u=w.useRef(!1),h=w.useRef(null),p=w.useRef(null),{disabled:m,updateMeasurementsFor:y,timeout:b}={...$u,...s},g=bs(y??r),x=w.useCallback(()=>{if(!u.current){u.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(g.current)?g.current:[g.current]),p.current=null},b)},[b]),k=ur({callback:x,disabled:m||!o}),v=w.useCallback((T,D)=>{k&&(D&&(k.unobserve(D),u.current=!1),T&&k.observe(T))},[k]),[C,j]=Ws(v),S=bs(e);return w.useEffect(()=>{!k||!C.current||(k.disconnect(),u.current=!1,k.observe(C.current))},[C,k]),w.useEffect(()=>(l({type:Pe.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:h,data:S}}),()=>l({type:Pe.UnregisterDroppable,key:i,id:r})),[r]),w.useEffect(()=>{n!==f.current.disabled&&(l({type:Pe.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,l]),{active:o,rect:h,isOver:a?.id===r,node:C,over:a,setNodeRef:j}}function Mu(t){let{animation:e,children:n}=t;const[r,s]=w.useState(null),[i,o]=w.useState(null),l=Vs(n);return!n&&!r&&l&&s(l),Mt(()=>{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?w.cloneElement(r,{ref:o}):null)}const zu={x:0,y:0,scaleX:1,scaleY:1};function Lu(t){let{children:e}=t;return Te.createElement(Ts.Provider,{value:vl},Te.createElement(fr.Provider,{value:zu},e))}const Pu={position:"fixed",touchAction:"none"},Fu=t=>cr(t)?"transform 250ms ease":void 0,Uu=w.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:l,style:a,transform:d,transition:f=Fu}=t;if(!l)return null;const u=s?d:{...d,scaleX:1,scaleY:1},h={...Pu,width:l.width,height:l.height,top:l.top,left:l.left,transform:Zt.Transform.toString(u),transformOrigin:s&&r?$d(r,l):void 0,transition:typeof f=="function"?f(r):f,...a};return Te.createElement(n,{className:o,style:h,ref:e},i)}),qu=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)}},Hu=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Zt.Transform.toString(e)},{transform:Zt.Transform.toString(n)}]},Ku={duration:250,easing:"ease",keyframes:Hu,sideEffects:qu({styles:{active:{opacity:"0"}}})};function Wu(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return ar((i,o)=>{if(e===null)return;const l=n.get(i);if(!l)return;const a=l.node.current;if(!a)return;const d=kl(o);if(!d)return;const{transform:f}=ct(o).getComputedStyle(o),u=dl(f);if(!u)return;const h=typeof e=="function"?e:Vu(e);return xl(a,s.draggable.measure),h({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:u})})}function Vu(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...Ku,...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},u={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},h={x:a.x-f.x,y:a.y-f.y,...u},p=s({...d,active:o,dragOverlay:l,transform:{initial:a,final:h}}),[m]=p,y=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(y))return;const b=r?.({active:o,dragOverlay:l,...d}),g=l.node.animate(p,{duration:e,easing:n,fill:"forwards"});return new Promise(x=>{g.onfinish=()=>{b?.(),x()}})}}let Ki=0;function Gu(t){return w.useMemo(()=>{if(t!=null)return Ki++,Ki},[t])}const Qu=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:u,activeNodeRect:h,containerNodeRect:p,draggableNodes:m,droppableContainers:y,dragOverlay:b,over:g,measuringConfiguration:x,scrollableAncestors:k,scrollableAncestorRects:v,windowRect:C}=Cl(),j=w.useContext(fr),S=Gu(u?.id),T=Sl(o,{activatorEvent:f,active:u,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:b.rect,over:g,overlayNodeRect:b.rect,scrollableAncestors:k,scrollableAncestorRects:v,transform:j,windowRect:C}),D=di(h),R=Wu({config:r,draggableNodes:m,droppableContainers:y,measuringConfiguration:x}),N=D?b.setRef:void 0;return Te.createElement(Lu,null,Te.createElement(Mu,{animation:R},u&&S?Te.createElement(Uu,{key:S,id:u.id,ref:N,as:l,activatorEvent:f,adjustScale:e,className:a,transition:i,rect:D,style:{zIndex:d,...s},transform:T},n):null))});function Xu(t){const{org:e}=Be(),{data:n}=yo.useSession(),r=Ka(),s=an(),i=za({connectionId:Bo,orgId:e.id,orgSlug:e.slug}),[o,l]=w.useState(!1),a=qa(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){ht.error("Could not find this integration in the registry");return}const u=Qa(f,e.id,n.user.id,{remoteIndex:0});if(!u.connection_url){ht.error("This integration has no connection method available");return}const h=u.app_name?await Yu(i,u.app_name):null,p=!h,m=h?.id??(await r.create.mutateAsync(u)).id,y=await Ga({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(p)try{await r.delete.mutateAsync(m)}catch{}ht.error(`Authentication failed: ${y.error??"no token"}`);return}ya(s,e.id),ht.success(p?"Connected successfully":"Already connected")}catch(f){ht.error(`Failed to connect: ${f instanceof Error?f.message:String(f)}`)}finally{l(!1)}}},isConnecting:o}}async function Yu(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 ui(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function Zu(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function Os(t){return t!==null&&t>=0}function Ju(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 ef(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Tl=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=ui(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}},$s={scaleX:1,scaleY:1},tf=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,...$s}:null}const a=nf(i,s,n);return s>n&&s<=o?{x:0,y:-l.height-a,...$s}:s<n&&s>=o?{x:0,y:l.height+a,...$s}:{x:0,y:0,...$s}};function nf(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 Nl="Sortable",Dl=Te.createContext({activeIndex:-1,containerId:Nl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Tl,disabled:{draggable:!1,droppable:!1}});function sf(t){let{children:e,id:n,items:r,strategy:s=Tl,disabled:i=!1}=t;const{active:o,dragOverlay:l,droppableRects:a,over:d,measureDroppableContainers:f}=Cl(),u=js(Nl,n),h=l.rect!==null,p=w.useMemo(()=>r.map(j=>typeof j=="object"&&"id"in j?j.id:j),[r]),m=o!=null,y=o?p.indexOf(o.id):-1,b=d?p.indexOf(d.id):-1,g=w.useRef(p),x=!Ju(p,g.current),k=b!==-1&&y===-1||x,v=ef(i);Mt(()=>{x&&m&&f(p)},[x,p,m,f]),w.useEffect(()=>{g.current=p},[p]);const C=w.useMemo(()=>({activeIndex:y,containerId:u,disabled:v,disableTransforms:k,items:p,overIndex:b,useDragOverlay:h,sortedRects:Zu(p,a),strategy:s}),[y,u,v.draggable,v.droppable,k,p,b,a,h,s]);return Te.createElement(Dl.Provider,{value:C},e)}const rf=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return ui(n,r,s).indexOf(e)},of=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},lf={duration:200,easing:"ease"},Rl="transform",af=Zt.Transition.toString({property:Rl,duration:0,easing:"linear"}),cf={roleDescription:"sortable"};function df(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=w.useState(null),l=w.useRef(n);return Mt(()=>{if(!e&&n!==l.current&&r.current){const a=s.current;if(a){const d=Yn(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]),w.useEffect(()=>{i&&o(null)},[i]),i}function uf(t){let{animateLayoutChanges:e=of,attributes:n,disabled:r,data:s,getNewIndex:i=rf,id:o,strategy:l,resizeObserverConfig:a,transition:d=lf}=t;const{items:f,containerId:u,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:y,overIndex:b,useDragOverlay:g,strategy:x}=w.useContext(Dl),k=ff(r,p),v=f.indexOf(o),C=w.useMemo(()=>({sortable:{containerId:u,index:v,items:f},...s}),[u,s,v,f]),j=w.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:S,node:T,isOver:D,setNodeRef:R}=jl({id:o,data:C,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...a}}),{active:N,activatorEvent:E,activeNodeRect:$,attributes:I,setNodeRef:O,listeners:_,isDragging:A,over:B,setActivatorNodeRef:H,transform:V}=Bu({id:o,data:C,attributes:{...cf,...n},disabled:k.draggable}),F=vd(R,O),U=!!N,G=U&&!m&&Os(h)&&Os(b),Q=!g&&A,X=Q&&G?V:null,te=G?X??(l??x)({rects:y,activeNodeRect:$,activeIndex:h,overIndex:b,index:v}):null,Z=Os(h)&&Os(b)?i({id:o,items:f,activeIndex:h,overIndex:b}):v,ne=N?.id,z=w.useRef({activeId:ne,items:f,newIndex:Z,containerId:u}),q=f!==z.current.items,W=e({active:N,containerId:u,isDragging:A,isSorting:U,id:o,index:v,items:f,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:d,wasDragging:z.current.activeId!=null}),re=df({disabled:!W,index:v,node:T,rect:S});return w.useEffect(()=>{U&&z.current.newIndex!==Z&&(z.current.newIndex=Z),u!==z.current.containerId&&(z.current.containerId=u),f!==z.current.items&&(z.current.items=f)},[U,Z,u,f]),w.useEffect(()=>{if(ne===z.current.activeId)return;if(ne!=null&&z.current.activeId==null){z.current.activeId=ne;return}const J=setTimeout(()=>{z.current.activeId=ne},50);return()=>clearTimeout(J)},[ne]),{active:N,activeIndex:h,attributes:I,data:C,rect:S,index:v,newIndex:Z,items:f,isOver:D,isSorting:U,isDragging:A,listeners:_,node:T,overIndex:b,over:B,setNodeRef:F,setActivatorNodeRef:H,setDroppableNodeRef:R,setDraggableNodeRef:O,transform:re??te,transition:M()};function M(){if(re||q&&z.current.newIndex===v)return af;if(!(Q&&!cr(E)||!d)&&(U||W))return Zt.Transition.toString({...d,property:Rl})}}function ff(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 Ys(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 hf=[le.Down,le.Right,le.Up,le.Left],pf=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:l}}=e;if(hf.includes(t.code)){if(t.preventDefault(),!n||!r)return;const a=[];i.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const h=s.get(u.id);if(h)switch(t.code){case le.Down:r.top<h.top&&a.push(u);break;case le.Up:r.top>h.top&&a.push(u);break;case le.Left:r.left>h.left&&a.push(u);break;case le.Right:r.left<h.left&&a.push(u);break}});const d=al({collisionRect:r,droppableRects:s,droppableContainers:a});let f=ll(d,"id");if(f===o?.id&&d.length>1&&(f=d[1].id),f!=null){const u=i.get(n.id),h=i.get(f),p=h?s.get(h.id):null,m=h?.node.current;if(m&&p&&u&&h){const b=dr(m).some((j,S)=>l[S]!==j),g=El(u,h),x=gf(u,h),k=b||!g?{x:0,y:0}:{x:x?r.width-p.width:0,y:x?r.height-p.height:0},v={x:p.left,y:p.top};return k.x&&k.y?v:ys(v,k)}}}};function El(t,e){return!Ys(t)||!Ys(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function gf(t,e){return!Ys(t)||!Ys(e)||!El(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}function $t(t){const e=P.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=ee("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:La,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 Wi=()=>0;function mf(t){const{orgSlug:e,enabled:n=!0,onUpdate:r,onDelete:s}=t,i=w.useRef(r);i.current=r;const o=w.useRef(s);o.current=s;const l=w.useRef(null),a=w.useRef(n),d=w.useRef(e);(!l.current||a.current!==n||d.current!==e)&&(a.current=n,d.current=e,l.current=u=>{if(!n||!e)return()=>{};const h=p=>{let m;try{m=JSON.parse(p.data)}catch{return}m.data&&(p.type===Ya?o.current?.(m.data.id):i.current(m.data)),u()};return Xa.subscribe(e,h)}),w.useSyncExternalStore(l.current,Wi,Wi)}function xf(){const t=P.c(30),{org:e,locator:n}=Be(),r=Jt(),s=an();let i;t[0]!==n?(i=ke.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=lt(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:ke.taskBoardActivity(n,g.id)})},t[7]=n,t[8]=s,t[9]=o,t[10]=f):f=t[10];let u;t[11]!==s||t[12]!==o?(u=g=>{s.setQueryData(o,x=>x?.filter(k=>k.id!==g))},t[11]=s,t[12]=o,t[13]=u):u=t[13];let h;t[14]!==e.slug||t[15]!==f||t[16]!==u?(h={orgSlug:e.slug,onUpdate:f,onDelete:u},t[14]=e.slug,t[15]=f,t[16]=u,t[17]=h):h=t[17],mf(h);let p;t[18]!==s||t[19]!==o?(p=g=>{const x=g.subject,k=g.data.status;s.setQueryData(o,v=>v?.map(C=>C.threads.some(j=>j.threadId===x)?{...C,threads:C.threads.map(j=>j.threadId===x?{...j,status:k}:j)}:C))},t[18]=s,t[19]=o,t[20]=p):p=t[20];let m;t[21]!==e.slug||t[22]!==p?(m={orgSlug:e.slug,onTaskStatus:p},t[21]=e.slug,t[22]=p,t[23]=m):m=t[23],Ja(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 bf(){const t=P.c(55),{locator:e}=Be(),n=Jt(),r=an(),s=oe();let i;t[0]!==e?(i=ke.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=O=>n.call("TASK_BOARD_ITEM_CREATE",O),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 u=Je(f);let h;t[10]!==n?(h=O=>n.call("TASK_BOARD_ITEM_UPDATE",O),t[10]=n,t[11]=h):h=t[11];let p,m;t[12]!==r||t[13]!==o?(p=async O=>{await r.cancelQueries({queryKey:o});const _=r.getQueryData(o);return r.setQueryData(o,A=>A?.map(B=>B.id===O.id?{...B,...O}:B)),{previous:_}},m=(O,_,A)=>{A?.previous&&r.setQueryData(o,A.previous)},t[12]=r,t[13]=o,t[14]=p,t[15]=m):(p=t[14],m=t[15]);let y;t[16]!==a||t[17]!==e||t[18]!==r?(y=(O,_,A)=>{a(),r.invalidateQueries({queryKey:ke.taskBoardActivity(e,A.id)})},t[16]=a,t[17]=e,t[18]=r,t[19]=y):y=t[19];let b;t[20]!==h||t[21]!==p||t[22]!==m||t[23]!==y?(b={mutationFn:h,onMutate:p,onError:m,onSettled:y},t[20]=h,t[21]=p,t[22]=m,t[23]=y,t[24]=b):b=t[24];const g=Je(b);let x;t[25]!==n?(x=O=>n.call("TASK_BOARD_ITEM_DELETE",{id:O}),t[25]=n,t[26]=x):x=t[26];let k;t[27]!==a||t[28]!==s?(k=O=>{ht.error(O instanceof Error&&O.message?O.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 C=Je(v);let j;t[34]!==n?(j=async O=>{const _=await Promise.allSettled(O.map(A=>n.call("TASK_BOARD_ITEM_DELETE",{id:A})));return{total:O.length,failed:_.filter(yf).length}},t[34]=n,t[35]=j):j=t[35];let S,T;t[36]!==s?(S=O=>{const{total:_,failed:A}=O;A!==0&&ht.error(s("taskBoard.taskBoard.deleteBulkError",{failed:String(A),total:String(_)}))},T=()=>ht.error(s("taskBoard.taskBoard.deleteError")),t[36]=s,t[37]=S,t[38]=T):(S=t[37],T=t[38]);let D;t[39]!==a||t[40]!==j||t[41]!==S||t[42]!==T?(D={mutationFn:j,onSuccess:S,onError:T,onSettled:a},t[39]=a,t[40]=j,t[41]=S,t[42]=T,t[43]=D):D=t[43];const R=Je(D);let N;t[44]!==n?(N=O=>n.call("TASK_BOARD_ITEM_UPDATE",O),t[44]=n,t[45]=N):N=t[45];let E;t[46]!==a||t[47]!==N?(E={mutationFn:N,onSuccess:a},t[46]=a,t[47]=N,t[48]=E):E=t[48];const $=Je(E);let I;return t[49]!==u||t[50]!==$||t[51]!==C||t[52]!==R||t[53]!==g?(I={create:u,update:g,remove:C,removeMany:R,link:$},t[49]=u,t[50]=$,t[51]=C,t[52]=R,t[53]=g,t[54]=I):I=t[54],I}function yf(t){return t.status==="rejected"}function Zs(t){return t.threads.some(e=>e.status==="requires_action")}function fi(t){return t.status==="in_progress"&&Zs(t)?"text-warning animate-pulse":Dt[t.status].iconClassName}function kf(t){return t.threads[0]}function Vi(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 Il(t,e){return Array.from({length:e},(n,r)=>t-(e-1-r)*1e-4)}const Js=["triage","todo","in_progress","in_review","done"],Dt={triage:{labelKey:"taskBoard.config.statusBacklog",icon:or,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:ec,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:vs,iconClassName:"text-primary animate-spin"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:tc,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:cn,iconClassName:"text-success"}},hi=["none","low","medium","high","urgent"],Rt={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"}},$r=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],_l=$r[0];function Ns(t){return t??_l}function vf(t){return $r[t%$r.length]??_l}function Al(t){const e=P.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=ee("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:Pa,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 Bl(t){const e=P.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=ee("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:Fa,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 Mr,zr;if(typeof WeakMap<"u"){let t=new WeakMap;Mr=e=>t.get(e),zr=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Mr=r=>{for(let s=0;s<t.length;s+=2)if(t[s]==r)return t[s+1]},zr=(r,s)=>(n==10&&(n=0),t[n++]=r,t[n++]=s)}var Wt=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 Mr(t)||zr(t,wf(t))}};function wf(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Sf(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 u=t.child(d);f++;for(let m=0;;m++){for(;s<r.length&&r[s]!=0;)s++;if(m==u.childCount)break;const y=u.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 C=0;C<b;C++){r[v+C]==0?r[v+C]=f:(i||(i=[])).push({type:"collision",row:d,pos:f,n:b-C});const j=x&&x[C];if(j){const S=(v+C)%e*2,T=o[S];T==null||T!=j&&o[S+1]==1?(o[S]=j,o[S+1]=1):T==j&&o[S+1]++}}}s+=b,f+=y.nodeSize}const h=(d+1)*e;let p=0;for(;s<h;)r[s++]==0&&p++;p&&(i||(i=[])).push({type:"missing",row:d,n:p}),f++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const l=new Wt(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&&Cf(l,o,t),l}function Sf(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 Cf(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=jf(a)))[d]=f)}l&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}function jf(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function pi(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 Yt("selectingCells");function Tf(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 Ol(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 Nf(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=Tf(e.$head)||Df(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Df(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 Gi(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function $l(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Ml(t,e,n){const r=t.node(-1),s=Wt.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 Qi(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 Kt extends Ut{constructor(e,n=e){const r=e.node(-1),s=Wt.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 u=r.nodeAt(f);if(!u)throw new RangeError(`No cell with offset ${f} found`);const h=i+f+1;return new ac(l.resolve(h),l.resolve(h+u.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(Gi(r)&&Gi(s)&&$l(r,s)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Kt.rowSelection(r,s):i&&this.isColSelection()?Kt.colSelection(r,s):new Kt(r,s)}return Uo.between(r,s)}content(){const e=this.$anchorCell.node(-1),n=Wt.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,u=s.left;u<s.right;u++,f++){const h=n.map[f];if(i[h])continue;i[h]=!0;const p=n.findCell(h);let m=e.nodeAt(h);if(!m)throw new RangeError(`No cell with offset ${h} found`);const y=s.left-p.left,b=p.right-s.right;if(y>0||b>0){let g=m.attrs;if(y>0&&(g=Qi(g,0,y)),b>0&&(g=Qi(g,g.colspan-b,b)),p.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(p.top<s.top||p.bottom>s.bottom){const g={...m.attrs,rowspan:Math.min(p.bottom,s.bottom)-Math.max(p.top,s.top)};p.top<s.top?m=m.type.createAndFill(g):m=m.type.create(g,m.content)}d.push(m)}o.push(e.child(a).copy(vr.from(d)))}const l=this.isColSelection()&&this.isRowSelection()?e:o;return new os(vr.from(l),1,1)}replace(e,n=os.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?os.empty:n)}const i=Ut.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new os(vr.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Wt.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=Wt.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 Kt(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Wt.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 Kt&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),s=Wt.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 Kt(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Kt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Kt(e.resolve(n),e.resolve(r))}getBookmark(){return new Rf(this.$anchorCell.pos,this.$headCell.pos)}};qt.prototype.visible=!1;Ut.jsonID("cell",qt);var Rf=class zl{constructor(e,n){this.anchor=e,this.head=n}map(e){return new zl(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&&$l(n,r)?new qt(n,r):Ut.near(r,1)}};new Yt("fix-tables");function Ll(t){const e=t.selection,n=Nf(t),r=n.node(-1),s=n.start(-1),i=Wt.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 Ef(t){return function(e,n){if(!Ol(e))return!1;if(n){const r=pi(e.schema),s=Ll(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 Xi(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 gi(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Ef(t):function(n,r){if(!Ol(n))return!1;if(r){const s=pi(n.schema),i=Ll(n),o=n.tr,l=Xi("row",i,s),a=Xi("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,u=t=="column"?a?s.cell:s.header_cell:t=="row"?l?s.cell:s.header_cell:s.cell;i.map.cellsInRect(f).forEach(h=>{const p=h+i.tableStart,m=o.doc.nodeAt(p);m&&o.setNodeMarkup(p,u,m.attrs)}),r(o)}return!0}}gi("row",{useDeprecatedLogic:!0});gi("column",{useDeprecatedLogic:!0});gi("cell",{useDeprecatedLogic:!0});function Ms(t,e){const n=t.selection;if(!(n instanceof qt))return!1;if(e){const r=t.tr,s=pi(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 os(s,0,0))}),r.docChanged&&e(r)}return!0}cc({ArrowLeft:zs("horiz",-1),ArrowRight:zs("horiz",1),ArrowUp:zs("vert",-1),ArrowDown:zs("vert",1),"Shift-ArrowLeft":Ls("horiz",-1),"Shift-ArrowRight":Ls("horiz",1),"Shift-ArrowUp":Ls("vert",-1),"Shift-ArrowDown":Ls("vert",1),Backspace:Ms,"Mod-Backspace":Ms,Delete:Ms,"Mod-Delete":Ms});function Ks(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function zs(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;if(i instanceof qt)return Ks(n,r,Ut.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const o=Pl(s,t,e);if(o==null)return!1;if(t=="horiz")return Ks(n,r,Ut.near(n.doc.resolve(i.head+e),e));{const l=n.doc.resolve(o),a=Ml(l,t,e);let d;return a?d=Ut.near(a,1):e<0?d=Ut.near(n.doc.resolve(l.before(-1)),-1):d=Ut.near(n.doc.resolve(l.after(-1)),1),Ks(n,r,d)}}}function Ls(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=Pl(s,t,e);if(a==null)return!1;o=new qt(n.doc.resolve(a))}const l=Ml(o.$headCell,t,e);return l?Ks(n,r,new qt(o.$anchorCell,l)):!1}}function Pl(t,e,n){if(!(t.state.selection instanceof Uo))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 Yt("tableColumnResizing");function If(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 _f=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:u,state:h,from:p,to:m})=>{const{doc:y,selection:b}=h,{empty:g}=b,x=!y.textBetween(p,m).length&&dc(h.selection),k=this.element.contains(document.activeElement);return!(!(u.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:u})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&((h=this.element.parentNode)!=null&&h.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(u,h)=>{const p=!h?.selection.eq(u.state.selection),m=!h?.doc.eq(u.state.doc);!p&&!m||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,p,m,h)},this.updateDelay))},this.updateHandler=(u,h,p,m)=>{const{composing:y}=u;if(y||!h&&!p)return;if(!this.getShouldShow(m)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:u})=>{const h=u.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())};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(ko(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(vo(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(wo(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(So(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Co(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(jo(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(To(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(No(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=qo(this.view,r.from,r.to);let o={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(r instanceof uc){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,u=this.view.nodeDOM(d),h=this.view.nodeDOM(f);if(!u||!h)return;const p=u===h?u.getBoundingClientRect():If(u.getBoundingClientRect(),h.getBoundingClientRect());o={getBoundingClientRect:()=>p,getClientRects:()=>[p]}}return o}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&Do(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()}},Fl=t=>new Xr({key:typeof t.pluginKey=="string"?new Yt(t.pluginKey):t.pluginKey,view:e=>new _f({view:e,...t})});Yr.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Fl({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 Af=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:u})=>{const{selection:h}=u,{$anchor:p,empty:m}=h,y=p.depth===1,b=p.parent.isTextblock&&!p.parent.type.spec.code&&!p.parent.textContent&&p.parent.childCount===0&&!this.getTextContent(p.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,u,h,p)=>{const{composing:m}=f;if(m||!u&&!h)return;if(!this.getShouldShow(p)){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 u;if(this.preventHide){this.preventHide=!1;return}f?.relatedTarget&&((u=this.element.parentNode)!=null&&u.contains(f.relatedTarget))||f?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:f})=>{const u=f.getMeta(this.pluginKey);u==="updatePosition"?this.updatePosition():u&&typeof u=="object"&&u.type==="updateOptions"?this.updateOptions(u.options):u==="hide"?this.hide():u==="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 fc(t,{textSerializers:hc(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(ko(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(vo(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(wo(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(So(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Co(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(jo(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(To(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(No(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=qo(this.view,t.from,t.to);Do({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()}},Ul=t=>new Xr({key:typeof t.pluginKey=="string"?new Yt(t.pluginKey):t.pluginKey,view:e=>new Af({view:e,...t})});Yr.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?[Ul({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 Bf=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 u=w.useRef(document.createElement("div"));typeof f=="function"?f(u.current):f&&(f.current=u.current);const{editor:h}=Ho(),p=e||h,m={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,getReferencedVirtualElement:o,options:l},y=w.useRef(m);y.current=m;const[b,g]=w.useState(!1),x=w.useRef(!0);return w.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const k=u.current;k.style.visibility="hidden",k.style.position="absolute";const v=Fl({...y.current,editor:p,element:k});p.registerPlugin(v);const C=y.current.pluginKey;return x.current=!0,g(!0),()=>{g(!1),p.unregisterPlugin(C),window.requestAnimationFrame(()=>{k.parentNode&&k.parentNode.removeChild(k)})}},[p]),w.useEffect(()=>{if(!(!b||!p||p.isDestroyed)){if(x.current){x.current=!1;return}p.view.dispatch(p.state.tr.setMeta(t,{type:"updateOptions",options:y.current}))}},[b,p,n,r,i,l,s,o]),Xt.createPortal(c.jsx("div",{...d,children:a}),u.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=w.useRef(document.createElement("div"));typeof d=="function"?d(f.current):d&&(d.current=f.current);const{editor:u}=Ho(),h=e||u,p={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,options:o},m=w.useRef(p);m.current=p;const[y,b]=w.useState(!1),g=w.useRef(!0);return w.useEffect(()=>{if(h?.isDestroyed)return;if(!h){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=Ul({...m.current,editor:h,element:x});h.registerPlugin(k);const v=m.current.pluginKey;return g.current=!0,b(!0),()=>{b(!1),h.unregisterPlugin(v),window.requestAnimationFrame(()=>{x.parentNode&&x.parentNode.removeChild(x)})}},[h]),w.useEffect(()=>{if(!(!y||!h||h.isDestroyed)){if(g.current){g.current=!1;return}h.view.dispatch(h.state.tr.setMeta(t,{type:"updateOptions",options:m.current}))}},[y,h,n,r,i,o,s]),Xt.createPortal(c.jsx("div",{...a,children:l}),f.current)});const Of=new Set(["http:","https:","mailto:","tel:","ftp:"]);function ql(t){if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const e=new URL(t,"https://placeholder.invalid");return Of.has(e.protocol)}catch{return!1}}function Hl(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 $f="noopener noreferrer nofollow";function ft(t){const e=P.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=ee("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:Mf,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 Mf(t){return t.preventDefault()}function Yi(t){const e=P.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=ee("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:zf,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 zf(t){return t.preventDefault()}function Ym(t){const e=P.c(36),{editor:n,active:r,open:s,onOpenChange:i}=t,o=oe(),[l,a]=w.useState(""),[d,f]=w.useState(!0),[u,h]=w.useState(!1);let p;e[0]!==r||e[1]!==n||e[2]!==i?(p=()=>{const N=n.getAttributes("link");a(typeof N.href=="string"?N.href:""),f(r?N.target==="_blank":!0),h(!1),i(!0)},e[0]=r,e[1]=n,e[2]=i,e[3]=p):p=e[3];const m=p;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=Hl(l);if(N===""){n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1);return}if(!ql(N)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:N,target:d?"_blank":null,rel:d?$f: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 C;e[15]!==o?(C=o("sectionsEditor.richTextLinkControl.linkButtonLabel"),e[15]=o,e[16]=C):C=e[16];const j=s?b:m;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(Zo,{size:14}),e[17]=S):S=e[17];let T;e[18]!==r||e[19]!==C||e[20]!==j?(T=c.jsx(ft,{active:r,label:C,onClick:j,children:S}),e[18]=r,e[19]=C,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]!==u||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":u,placeholder:o("sectionsEditor.richTextLinkControl.urlInputPlaceholder"),value:l,onChange:N=>{a(N.target.value),h(!1)},onKeyDown:N=>{N.key==="Enter"?(N.preventDefault(),x()):N.key==="Escape"&&(N.preventDefault(),b())},className:ee("h-7 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",u&&"text-destructive")}),c.jsx(ft,{active:!1,label:o("sectionsEditor.richTextLinkControl.applyLinkLabel"),onClick:x,children:c.jsx(ws,{size:14})}),r&&c.jsx(ft,{active:!1,label:o("sectionsEditor.richTextLinkControl.removeLinkLabel"),onClick:v,children:c.jsx(el,{size:14})})]}),c.jsxs("div",{className:"flex items-center gap-0.5 rounded bg-muted/40 p-0.5",children:[c.jsx(Yi,{active:!d,label:o("sectionsEditor.richTextLinkControl.sameTabLabel"),onSelect:()=>f(!1)}),c.jsx(Yi,{active:d,label:o("sectionsEditor.richTextLinkControl.newTabLabel"),onSelect:()=>f(!0)})]})]}),e[22]=r,e[23]=x,e[24]=b,e[25]=l,e[26]=u,e[27]=d,e[28]=i,e[29]=s,e[30]=v,e[31]=o,e[32]=D):D=e[32];let R;return e[33]!==T||e[34]!==D?(R=c.jsxs("div",{className:"relative",children:[T,D]}),e[33]=T,e[34]=D,e[35]=R):R=e[35],R}function Lf(t){const e=P.c(30),{editor:n}=t,r=oe(),[s,i]=w.useState(!1),[o,l]=w.useState(""),[a,d]=w.useState(!1);let f;e[0]!==n?(f=n.isActive("link"),e[0]=n,e[1]=f):f=e[1];const u=f;let h;e[2]!==n||e[3]!==s?(h=()=>{if(s){i(!1);return}const S=n.getAttributes("link").href;l(typeof S=="string"?S:""),d(!1),i(!0)},e[2]=n,e[3]=s,e[4]=h):h=e[4];const p=h;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 S=Hl(o);if(S===""){y();return}if(!ql(S)){d(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:S}).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(Zo,{size:14}),e[13]=k):k=e[13];let v;e[14]!==u||e[15]!==x||e[16]!==p?(v=c.jsx(ft,{active:u,label:x,onClick:p,children:k}),e[14]=u,e[15]=x,e[16]=p,e[17]=v):v=e[17];let C;e[18]!==u||e[19]!==g||e[20]!==o||e[21]!==n||e[22]!==a||e[23]!==s||e[24]!==y||e[25]!==r?(C=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:S=>{S.currentTarget.contains(S.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:S=>{l(S.target.value),d(!1)},onKeyDown:S=>{S.key==="Enter"?(S.preventDefault(),g()):S.key==="Escape"&&(S.preventDefault(),i(!1),n.chain().focus().run())},className:ee("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(ft,{active:!1,label:r("markdownEditor.linkApply"),onClick:g,children:c.jsx(ws,{size:14})}),u&&c.jsx(ft,{active:!1,label:r("markdownEditor.linkRemove"),onClick:y,children:c.jsx(el,{size:14})})]}),e[18]=u,e[19]=g,e[20]=o,e[21]=n,e[22]=a,e[23]=s,e[24]=y,e[25]=r,e[26]=C):C=e[26];let j;return e[27]!==v||e[28]!==C?(j=c.jsxs("div",{className:"relative",children:[v,C]}),e[27]=v,e[28]=C,e[29]=j):j=e[29],j}const Tr=()=>{const t=P.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},Zi=t=>{const e=P.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},Kl=[1,2,3],Pf=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function Ff(t){const e=P.c(20),{editor:n}=t,r=oe(),[s,i]=w.useState(null);let o;e[0]!==n?(o={editor:n,selector:Uf},e[0]=n,e[1]=o):o=e[1];const l=pc(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 u;e[8]!==a||e[9]!==d||e[10]!==f?(u={1:a,2:d,3:f},e[8]=a,e[9]=d,e[10]=f,e[11]=u):u=e[11];const h=u;let p;e[12]!==n||e[13]!==h||e[14]!==s||e[15]!==l||e[16]!==r?(p=s&&c.jsxs(Bf,{editor:n,shouldShow:Pf,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(ft,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:c.jsx(Ca,{size:14})}),c.jsx(ft,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:c.jsx(ja,{size:14})}),c.jsx(ft,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:c.jsx(Ta,{size:14})}),c.jsx(ft,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:c.jsx(Na,{size:14})}),c.jsx(Tr,{}),Kl.map((y,b)=>c.jsx(ft,{active:l.headings[b]??!1,label:h[y],onClick:()=>n.chain().focus().toggleHeading({level:y}).run(),children:c.jsx(Zi,{children:`H${y}`})},y)),c.jsx(Tr,{}),c.jsx(ft,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:c.jsx(_o,{size:14})}),c.jsx(ft,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:c.jsx(Zi,{children:"1."})}),c.jsx(ft,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:c.jsx(Da,{size:14})}),c.jsx(Tr,{}),c.jsx(Lf,{editor:n})]}),e[12]=n,e[13]=h,e[14]=s,e[15]=l,e[16]=r,e[17]=p):p=e[17];let m;return e[18]!==p?(m=c.jsx("div",{ref:i,className:"relative z-20",children:p}),e[18]=p,e[19]=m):m=e[19],m}function Uf(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Kl.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}function mi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var dn=mi();function Wl(t){dn=t}var tn={exec:()=>null};function ae(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(at.caret,"$1"),n=n.replace(s,o),r},getRegex:()=>new RegExp(n,e)};return r}var qf=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),at={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)}}>`)},Hf=/^(?:[ \t]*(?:\n|$))+/,Kf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Wf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ds=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Vf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,xi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Vl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Gl=ae(Vl).replace(/bull/g,xi).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(),Gf=ae(Vl).replace(/bull/g,xi).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(),bi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Qf=/^[^\n]+/,yi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Xf=ae(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",yi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yf=ae(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,xi).getRegex(),hr="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",ki=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Zf=ae("^ {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",ki).replace("tag",hr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ql=ae(bi).replace("hr",Ds).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",hr).getRegex(),Jf=ae(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ql).getRegex(),vi={blockquote:Jf,code:Kf,def:Xf,fences:Wf,heading:Vf,hr:Ds,html:Zf,lheading:Gl,list:Yf,newline:Hf,paragraph:Ql,table:tn,text:Qf},Ji=ae("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ds).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",hr).getRegex(),eh={...vi,lheading:Gf,table:Ji,paragraph:ae(bi).replace("hr",Ds).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ji).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",hr).getRegex()},th={...vi,html:ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ki).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:tn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ae(bi).replace("hr",Ds).replace("heading",` *#{1,6} *[^
|
|
7
|
-
]`).replace("lheading",Gl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},nh=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,sh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xl=/^( {2,}|\\)\n(?!\s*$)/,rh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Zn=/[\p{P}\p{S}]/u,pr=/[\s\p{P}\p{S}]/u,wi=/[^\s\p{P}\p{S}]/u,ih=ae(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,pr).getRegex(),Yl=/(?!~)[\p{P}\p{S}]/u,oh=/(?!~)[\s\p{P}\p{S}]/u,lh=/(?:[^\s\p{P}\p{S}]|~)/u,ah=ae(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",qf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Zl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ch=ae(Zl,"u").replace(/punct/g,Zn).getRegex(),dh=ae(Zl,"u").replace(/punct/g,Yl).getRegex(),Jl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",uh=ae(Jl,"gu").replace(/notPunctSpace/g,wi).replace(/punctSpace/g,pr).replace(/punct/g,Zn).getRegex(),fh=ae(Jl,"gu").replace(/notPunctSpace/g,lh).replace(/punctSpace/g,oh).replace(/punct/g,Yl).getRegex(),hh=ae("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wi).replace(/punctSpace/g,pr).replace(/punct/g,Zn).getRegex(),ph=ae(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Zn).getRegex(),gh="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",mh=ae(gh,"gu").replace(/notPunctSpace/g,wi).replace(/punctSpace/g,pr).replace(/punct/g,Zn).getRegex(),xh=ae(/\\(punct)/,"gu").replace(/punct/g,Zn).getRegex(),bh=ae(/^<(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(),yh=ae(ki).replace("(?:-->|$)","-->").getRegex(),kh=ae("^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",yh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),er=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,vh=ae(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",er).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ea=ae(/^!?\[(label)\]\[(ref)\]/).replace("label",er).replace("ref",yi).getRegex(),ta=ae(/^!?\[(ref)\](?:\[\])?/).replace("ref",yi).getRegex(),wh=ae("reflink|nolink(?!\\()","g").replace("reflink",ea).replace("nolink",ta).getRegex(),eo=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Si={_backpedal:tn,anyPunctuation:xh,autolink:bh,blockSkip:ah,br:Xl,code:sh,del:tn,delLDelim:tn,delRDelim:tn,emStrongLDelim:ch,emStrongRDelimAst:uh,emStrongRDelimUnd:hh,escape:nh,link:vh,nolink:ta,punctuation:ih,reflink:ea,reflinkSearch:wh,tag:kh,text:rh,url:tn},Sh={...Si,link:ae(/^!?\[(label)\]\((.*?)\)/).replace("label",er).getRegex(),reflink:ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",er).getRegex()},Lr={...Si,emStrongRDelimAst:fh,emStrongLDelim:dh,delLDelim:ph,delRDelim:mh,url:ae(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",eo).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:ae(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",eo).getRegex()},Ch={...Lr,br:ae(Xl).replace("{2,}","*").getRegex(),text:ae(Lr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ps={normal:vi,gfm:eh,pedantic:th},ss={normal:Si,gfm:Lr,breaks:Ch,pedantic:Sh},jh={"&":"&","<":"<",">":">",'"':""","'":"'"},to=t=>jh[t];function Ft(t,e){if(e){if(at.escapeTest.test(t))return t.replace(at.escapeReplace,to)}else if(at.escapeTestNoEncode.test(t))return t.replace(at.escapeReplaceNoEncode,to);return t}function no(t){try{t=encodeURI(t).replace(at.percentDecode,"%")}catch{return null}return t}function so(t,e){let n=t.replace(at.findPipe,(i,o,l)=>{let a=!1,d=o;for(;--d>=0&&l[d]==="\\";)a=!a;return a?"|":" |"}),r=n.split(at.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(at.slashPipe,"|");return r}function rs(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 Th(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 Nh(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 ro(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 Dh(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 tr=class{options;rules;lexer;constructor(t){this.options=t||dn}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:rs(n,`
|
|
10
|
-
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=Dh(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=rs(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:rs(e[0],`
|
|
11
|
-
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=rs(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 u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,i,!0),this.lexer.state.top=u,n.length===0)break;let h=i.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let p=h,m=p.raw+`
|
|
18
|
-
`+n.join(`
|
|
19
|
-
`),y=this.blockquote(m);i[i.length-1]=y,r=r.substring(0,r.length-p.raw.length)+y.raw,s=s.substring(0,s.length-p.text.length)+y.text;break}else if(h?.type==="list"){let p=h,m=p.raw+`
|
|
20
|
-
`+n.join(`
|
|
21
|
-
`),y=this.list(m);i[i.length-1]=y,r=r.substring(0,r.length-h.raw.length)+y.raw,s=s.substring(0,s.length-p.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 u=Nh(e[2].split(`
|
|
23
|
-
`,1)[0],e[1].length),h=t.split(`
|
|
24
|
-
`,1)[0],p=!u.trim(),m=0;if(this.options.pedantic?(m=2,f=u.trimStart()):p?m=e[1].length+1:(m=u.search(this.rules.other.nonSpaceChar),m=m>4?1:m,f=u.slice(m),m+=e[1].length),p&&this.rules.other.blankLine.test(h)&&(d+=h+`
|
|
25
|
-
`,t=t.substring(h.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 C=t.split(`
|
|
26
|
-
`,1)[0],j;if(h=C,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),j=h):j=h.replace(this.rules.other.tabCharGlobal," "),g.test(h)||x.test(h)||k.test(h)||v.test(h)||y.test(h)||b.test(h))break;if(j.search(this.rules.other.nonSpaceChar)>=m||!h.trim())f+=`
|
|
27
|
-
`+j.slice(m);else{if(p||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||g.test(u)||x.test(u)||b.test(u))break;f+=`
|
|
28
|
-
`+h}p=!h.trim(),d+=C+`
|
|
29
|
-
`,t=t.substring(C.length+1),u=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(u=>u.type==="space"),f=d.length>0&&d.some(u=>this.rules.other.anyLine.test(u.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=so(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(so(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=rs(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Th(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)),ro(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 ro(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,u=t.slice(0,s+r.index+f+o);if(Math.min(s,o)%2){let p=u.slice(1,-1);return{type:"em",raw:u,text:p,tokens:this.lexer.inlineTokens(p)}}let h=u.slice(2,-2);return{type:"strong",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}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),u=f.slice(s,-s);return{type:"del",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}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}}}},Bt=class Pr{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||dn,this.options.tokenizer=this.options.tokenizer||new tr,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:at,block:Ps.normal,inline:ss.normal};this.options.pedantic?(n.block=Ps.pedantic,n.inline=ss.pedantic):this.options.gfm&&(n.block=Ps.gfm,this.options.breaks?n.inline=ss.breaks:n.inline=ss.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ps,inline:ss}}static lex(e,n){return new Pr(n).lex(e)}static lexInline(e,n){return new Pr(n).inlineTokens(e)}lex(e){e=e.replace(at.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(at.tabCharGlobal," ").replace(at.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,u=e.slice(1),h;this.options.extensions.startInline.forEach(p=>{h=p.call({lexer:this},u),typeof h=="number"&&h>=0&&(f=Math.min(f,h))}),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}},nr=class{options;parser;constructor(t){this.options=t||dn}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(at.notSpaceStart)?.[0],s=t.replace(at.endingNewline,"")+`
|
|
46
|
-
`;return r?'<pre><code class="language-'+Ft(r)+'">'+(n?s:Ft(s,!0))+`</code></pre>
|
|
47
|
-
`:"<pre><code>"+(n?s:Ft(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>${Ft(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=no(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+Ft(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=no(t);if(s===null)return Ft(n);t=s;let i=`<img src="${t}" alt="${Ft(n)}"`;return e&&(i+=` title="${Ft(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ft(t.text)}},Ci=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}},Ot=class Fr{options;renderer;textRenderer;constructor(e){this.options=e||dn,this.options.renderer=this.options.renderer||new nr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ci}static parse(e,n){return new Fr(n).parse(e)}static parseInline(e,n){return new Fr(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}},ls=class{options;block;constructor(t){this.options=t||dn}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?Bt.lex:Bt.lexInline}provideParser(t=this.block){return t?Ot.parse:Ot.parseInline}},Rh=class{defaults=mi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ot;Renderer=nr;TextRenderer=Ci;Lexer=Bt;Tokenizer=tr;Hooks=ls;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 nr(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 tr(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 ls;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];ls.passThroughHooks.has(i)?s[o]=d=>{if(this.defaults.async&&ls.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await l.call(s,d);return a.call(s,u)})();let f=l.call(s,d);return a.call(s,f)}:s[o]=(...d)=>{if(this.defaults.async)return(async()=>{let u=await l.apply(s,d);return u===!1&&(u=await a.apply(s,d)),u})();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 Bt.lex(t,e??this.defaults)}parser(t,e){return Ot.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?Bt.lex:Bt.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?Ot.parse:Ot.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?Bt.lex:Bt.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?Ot.parse:Ot.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>"+Ft(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},ln=new Rh;function ue(t,e){return ln.parse(t,e)}ue.options=ue.setOptions=function(t){return ln.setOptions(t),ue.defaults=ln.defaults,Wl(ue.defaults),ue};ue.getDefaults=mi;ue.defaults=dn;ue.use=function(...t){return ln.use(...t),ue.defaults=ln.defaults,Wl(ue.defaults),ue};ue.walkTokens=function(t,e){return ln.walkTokens(t,e)};ue.parseInline=ln.parseInline;ue.Parser=Ot;ue.parser=Ot.parse;ue.Renderer=nr;ue.TextRenderer=Ci;ue.Lexer=Bt;ue.lexer=Bt.lex;ue.Tokenizer=tr;ue.Hooks=ls;ue.parse=ue;ue.options;ue.setOptions;ue.use;ue.walkTokens;ue.parseInline;Ot.parse;Bt.lex;function Eh(t,e){const r=e.split(`
|
|
65
|
-
`).flatMap(s=>[s,""]).map(s=>`${t}${s}`).join(`
|
|
66
|
-
`);return r.slice(0,r.length-1)}function Ih(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 _h(t,e){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{t.has(r)||n.push({type:r,mark:s})}),n}function Ah(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 Bh(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 Oh(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 Nr(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 Fs(t,e){return typeof t!="string"?"json":e}var $h=class{constructor(t){this.baseExtensions=[],this.extensions=[],this.lastParseResult=null;var e,n,r,s,i;this.markedInstance=(e=t?.marked)!=null?e:ue,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,gc(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=ns(t,"markdownTokenName")||s,o=ns(t,"parseMarkdown"),l=ns(t,"renderMarkdown"),a=ns(t,"markdownTokenizer"),d=(n=ns(t,"markdownOptions"))!=null?n:null,f=(r=d?.indentsContent)!=null?r:!1,u={tokenName:i,nodeName:s,parseMarkdown:o,renderMarkdown:l,isIndenting:f,tokenizer:a};if(i&&o){const h=this.registry.get(i)||[];h.push(u),this.registry.set(i,h)}if(l){const h=this.nodeTypeRegistry.get(s)||[];h.push(u),this.nodeTypeRegistry.set(s,h)}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 u=s(f,[],l);return u&&u.raw?f.indexOf(u.raw):-1};const d={name:e,level:r,start:a,tokenizer:(f,u)=>{const h=s(f,u,l);if(h&&h.type)return{...h,type:h.type||e,raw:h.raw||"",tokens:h.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=>Nr(l).isTask),n=t.items.some(l=>!Nr(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:u}=Nr(a);let h=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),C=v.filter(j=>j.trim());if(C.length>0){const j=Math.min(...C.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
|
-
`))}}h={type:"taskItem",raw:"",mainContent:g,indentLevel:u,checked:f??!1,text:g,tokens:this.lexer.inlineTokens(g),nestedTokens:x}}const p=d?"taskList":"list";i!==p?(s.length>0&&r.push({type:i,items:s}),s=[h],i=p):s.push(h)}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 h=f[1],p=this.escapeRegex(h),m=new RegExp(`^<\\/\\s*${p}\\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 u=this.parseHTMLToken(l);if(u){const h=this.normalizeParseResult(u);Array.isArray(h)?i.push(...h):h&&i.push(h)}}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 u=this.applyMarkToContent(f.mark,f.content,f.attrs);i.push(...u)}else{const u=this.normalizeParseResult(f);Array.isArray(u)?i.push(...u):u&&i.push(u)}}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=mc(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:(u,h)=>{const p=o.isIndenting?r+1:r;return!Array.isArray(u)&&u.content?this.renderNodes(u.content,t,h||"",n,p):this.renderNodes(u,t,h||"",n,p)},renderChild:(u,h)=>{const p=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(u,t,h,p)},indent:u=>this.indentString+u,wrapInBlock:Eh},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])),u=_h(i,f),h=Ih(f,a);let p="";if(h.length>0){const g=d.match(/(\s+)$/);g&&(p=g[1],d=d.slice(0,-p.length))}h.forEach(g=>{const x=f.get(g),k=this.getMarkClosing(g,x);k&&(d+=k),i.has(g)&&i.delete(g)});let m="";if(u.length>0){const g=d.match(/^(\s+)/);g&&(m=g[1],d=d.slice(m.length))}u.forEach(({type:g,mark:x})=>{const k=this.getMarkOpening(g,x);k&&(d=k+d),h.includes(g)||i.set(g,x)}),d=m+d;const y=Ah(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+=p,s.push(d)}else{const d=new Map(i),f=Bh(i,this.getMarkClosing.bind(this)),u=this.renderNodeToMarkdown(o,e,l,r),h=o.type==="hardBreak"?"":Oh(d,i,this.getMarkOpening.bind(this));s.push(f+u+h)}}),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))}},io=$h,Mh=Yr.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return Ht.setContent(t,e);if(Fs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Ht.setContent(t,e);const r=this.editor.markdown.parse(t);return Ht.setContent(r,e)},insertContent:(t,e)=>{if(!e?.contentType)return Ht.insertContent(t,e);if(Fs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Ht.insertContent(t,e);const r=this.editor.markdown.parse(t);return Ht.insertContent(r,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return Ht.insertContentAt(t,e,n);if(Fs(e,n?.contentType)!=="markdown"||!this.editor.markdown)return Ht.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return Ht.insertContentAt(t,s,n)}}},addStorage(){return{manager:new io({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 io({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||Fs(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 zh(t){const e=P.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,u=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let h;e[3]!==u?(h=ee("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",u),e[3]=u,e[4]=h):h=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Ra,{size:14,className:"shrink-0 text-muted-foreground"}),e[5]=p):p=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(Nc,{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:Ph,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:Lh,onClick:i,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:c.jsx(nn,{size:14})}),e[16]=i,e[17]=s.isEditable,e[18]=o,e[19]=x):x=e[19];let k;return e[20]!==h||e[21]!==m||e[22]!==g||e[23]!==x?(k=c.jsxs(Go,{as:"span",className:h,children:[p,m,g,x]}),e[20]=h,e[21]=m,e[22]=g,e[23]=x,e[24]=k):k=e[24],k}function Lh(t){return t.preventDefault()}function Ph(t){return t.preventDefault()}function Fh(t){return t.replace(/([[\]])/g,"\\$1")}const Uh=Ko.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",Vo(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`[${Fh(n)}](${e})`},addNodeView(){return Wo(zh)}});var qh=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Hh=Ko.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",Vo(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(([u,h])=>{if(h!=null)switch(u){case"width":case"height":break;default:a.setAttribute(u,h);break}}),a.src=o.src;const d=new bc({element:a,editor:l,node:s,getPos:i,onResize:(u,h)=>{a.style.width=`${u}px`,a.style.height=`${h}px`},onCommit:(u,h)=>{const p=i();p!==void 0&&this.editor.chain().setNodeSelection(p).updateAttributes(this.name,{width:u,height:h}).run()},onUpdate:(u,h,p)=>u.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[xc({find:qh,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Kh=Hh;function Wh(t){const e=P.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 u;e[3]!==f?(u=ee("max-h-[420px] max-w-full rounded-lg border border-border object-contain",f),e[3]=f,e[4]=u):u=e[4];let h;e[5]!==l||e[6]!==d||e[7]!==u?(h=c.jsx("img",{src:l,alt:d,draggable:!1,className:u}),e[5]=l,e[6]=d,e[7]=u,e[8]=h):h=e[8];let p;e[9]!==i||e[10]!==s.isEditable||e[11]!==o?(p=s.isEditable&&c.jsx("button",{type:"button","aria-label":o("markdownEditor.removeImage"),onMouseDown:Vh,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(nn,{size:14})}),e[9]=i,e[10]=s.isEditable,e[11]=o,e[12]=p):p=e[12];let m;return e[13]!==h||e[14]!==p?(m=c.jsxs(Go,{className:"group/image relative my-3 w-fit max-w-full",children:[h,p]}),e[13]=h,e[14]=p,e[15]=m):m=e[15],m}function Vh(t){return t.preventDefault()}const Gh=Kh.extend({addNodeView(){return Wo(Wh)}}).configure({inline:!1,allowBase64:!1}),Ur="uploads",Qh="editor-images",na="editor-files",Xh=new RegExp(`^/api/[^/]+/fs/${Ur}/read$`),oo="http://relative.invalid";function Yh(t){let e;try{e=new URL(t,oo)}catch{return!1}return e.origin!==oo||!Xh.test(e.pathname)?!1:(e.searchParams.get("path")??"").startsWith(`${na}/`)}const Zh={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},Jh=yc.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";return Yh(n)?e.createNode("attachment",{href:n,name:t.text??""}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function ep(t=""){return[kc.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),Jh.configure(Zh),Vc.configure({placeholder:t}),Gh,Uh,Mh.configure({markedOptions:{breaks:!0}})]}const tp=10,np=25,sp={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function rp(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??sp[t.type]??(ji(t)?".png":"")}function ji(t){return t.type.startsWith("image/")}function ip(){const t=oe(),{upload:e}=hd(Ur),n=fd(Ur),[r,s]=w.useState(0);return{uploadFile:async o=>{const l=ji(o),a=l?tp:np;if(o.size>a*1024*1024)return ht.error(t("markdownEditor.fileTooLarge",{name:o.name,max:String(a)})),null;const d=l?Qh:na,f=`${crypto.randomUUID()}${rp(o)}`;s(u=>u+1);try{return await e.mutateAsync({dir:d,files:[new File([o],f,{type:o.type})]}),n(`${d}/${f}`)}catch{return ht.error(t("markdownEditor.uploadFailed",{name:o.name})),null}finally{s(u=>u-1)}},pending:r}}const op=["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(" "),lp=["[&_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 lo(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(Ut.near(i.doc.resolve(o))),t.dispatch(i),t.state.selection.to}function ap({defaultValue:t,onChange:e,placeholder:n,editable:r=!0}){const s=oe(),{uploadFile:i,pending:o}=ip(),l=w.useRef(null),a=w.useRef(e),d=w.useRef(i);a.current=e,d.current=i;const f=(p,m,y)=>m.length===0?!1:((async()=>{let b=y;for(const g of m){const x=await d.current(g);x&&(b=ji(g)?lo(p,b,"image",{src:x,alt:g.name}):lo(p,b,"attachment",{href:x,name:g.name}))}})(),!0),u=vc({extensions:ep(n),content:t,contentType:"markdown",editable:r,editorProps:{attributes:{class:ee(op,lp)},handlePaste:(p,m)=>f(p,Array.from(m.clipboardData?.files??[]),p.state.selection.to),handleDrop:(p,m,y,b)=>{if(b)return!1;const g=Array.from(m.dataTransfer?.files??[]),x=p.posAtCoords({left:m.clientX,top:m.clientY})?.pos;return x===void 0?!1:f(p,g,x)}},onUpdate:({editor:p})=>a.current(p.getMarkdown())});if(!u)return null;const h=p=>{!p||p.length===0||f(u.view,Array.from(p),u.state.selection.to)};return c.jsxs("div",{className:"flex flex-col",children:[c.jsx(Ff,{editor:u}),c.jsx(wc,{editor:u,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(Fe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":s("markdownEditor.attachFile"),onClick:()=>l.current?.click(),children:c.jsx(Ea,{size:14})}),o>0&&c.jsxs("span",{className:"inline-flex items-center gap-1.5","aria-live":"polite",role:"status",children:[c.jsx(vs,{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:p=>{h(p.target.files),p.target.value=""}})]})}const cp=1e4;function dp(t){const e=P.c(10),{locator:n}=Be(),r=Jt();let s;e[0]!==t||e[1]!==n?(s=ke.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:cp,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=l):l=e[9],lt(l)}function sa(t){const e=P.c(10),{locator:n}=Be(),r=Jt();let s;e[0]!==t||e[1]!==n?(s=ke.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],lt(l)}function up(t){const e=P.c(10),{locator:n}=Be(),r=Jt(),s=an();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:ke.taskBoardItemPrs(n,t)}),s.invalidateQueries({queryKey:ke.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],Je(l)}function fp(t){const e=[];return t.qa&&e.push("qa"),t.codeReview&&e.push("code_review"),e}function hp(t,e){return e.length===0?!0:Za(t,e)}function Ti(t){const e=P.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(Zr,{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(Jr,{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(Ze),e[10]=r,e[11]=f):f=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx($t,{size:16}),e[12]=u):u=e[12];let h;e[13]!==s?(h=s("taskBoard.taskDialog.superAgentLabel"),e[13]=s,e[14]=h):h=e[14];let p;e[15]!==h?(p=c.jsx("span",{className:"truncate",children:h}),e[15]=h,e[16]=p):p=e[16];let m;e[17]!==d||e[18]!==f||e[19]!==p?(m=c.jsxs(Vt,{value:d,onSelect:f,className:"gap-2",children:[u,p]}),e[17]=d,e[18]=f,e[19]=p,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(Ir,{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(Vt,{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 C;e[34]!==m||e[35]!==v?(C=c.jsxs(Gn,{children:[m,v]}),e[34]=m,e[35]=v,e[36]=C):C=e[36];let j;e[37]!==s?(j=s("taskBoard.taskDialog.membersGroupHeading"),e[37]=s,e[38]=j):j=e[38];let S;if(e[39]!==n||e[40]!==r){let N;e[42]!==r?(N=E=>c.jsxs(Vt,{value:E.user?.name??E.userId,onSelect:()=>r(E.userId),className:"gap-2",children:[c.jsx(It,{url:E.user?.image??void 0,fallback:Et(E.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:E.user?.name??E.userId})]},E.userId),e[42]=r,e[43]=N):N=e[43],S=n.map(N),e[39]=n,e[40]=r,e[41]=S}else S=e[41];let T;e[44]!==j||e[45]!==S?(T=c.jsx(Gn,{heading:j,children:S}),e[44]=j,e[45]=S,e[46]=T):T=e[46];let D;e[47]!==C||e[48]!==T||e[49]!==a?(D=c.jsxs(ei,{children:[a,C,T]}),e[47]=C,e[48]=T,e[49]=a,e[50]=D):D=e[50];let R;return e[51]!==o||e[52]!==D?(R=c.jsxs(ti,{children:[o,D]}),e[51]=o,e[52]=D,e[53]=R):R=e[53],R}function pp({tags:t,selectedIds:e,defaultColor:n,onToggle:r,onCreate:s,onDelete:i}){const o=oe(),[l,a]=w.useState(""),[d,f]=w.useState(!1),[u,h]=w.useState(n),p=l.trim(),m=t.some(b=>b.name.toLowerCase()===p.toLowerCase()),y=async()=>{if(!(!p||m||d)){f(!0);try{await s(p,u),a("")}finally{f(!1)}}};return c.jsxs(ti,{children:[c.jsx(Zr,{value:l,onValueChange:a,placeholder:o("taskBoard.taskDialog.tagFilterPlaceholder"),className:"h-9"}),c.jsxs(ei,{children:[p&&!m?c.jsx(Gn,{children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{type:"color",value:u,onChange:b=>h(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(Vt,{value:`create-${p}`,disabled:d,onSelect:y,className:"flex-1 gap-2",children:[c.jsx(ps,{size:16,className:"text-muted-foreground"}),c.jsx("span",{className:"truncate",children:o("taskBoard.taskDialog.createTagOption",{name:p})})]})]})}):c.jsx(Jr,{children:o("taskBoard.taskDialog.noTagsFound")}),c.jsx(Gn,{children:t.map(b=>{const g=e.includes(b.id);return c.jsxs(Vt,{value:b.name,onSelect:()=>r(b.id),className:"group gap-2",children:[c.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ns(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(Kr,{size:13})}),g&&c.jsx(ws,{size:14,className:"shrink-0 text-foreground"})]},b.id)})})]})]})}function gp(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 mp(t){const e=P.c(40),{thread:n,me:r,onReply:s,onDelete:i,onToggleResolved:o}=t,l=oe(),[a,d]=w.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(Ia,{size:16,className:"shrink-0 text-muted-foreground"}),e[1]=k):k=e[1];let v;e[2]!==l||e[3]!==n?(v=bp(n,l),e[2]=l,e[3]=n,e[4]=v):v=e[4];let C;e[5]!==v?(C=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:v}),e[5]=v,e[6]=C):C=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(Ec,{size:16,className:"shrink-0 text-muted-foreground"}),e[7]=j):j=e[7];let S;return e[8]!==C?(S=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,C,j]}),e[8]=C,e[9]=S):S=e[9],S}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(nn,{size:14,"aria-hidden":!0})]}),c.jsx(Dr,{})]}),e[10]=l,e[11]=n.resolved,e[12]=f):f=e[12];let u;e[13]!==r||e[14]!==i||e[15]!==n?(u=ao(n,r)?()=>i(n.id):void 0,e[13]=r,e[14]=i,e[15]=n,e[16]=u):u=e[16];let h;e[17]!==o||e[18]!==u||e[19]!==n?(h=c.jsx(co,{comment:n,onDelete:u,resolved:n.resolved,onToggleResolved:o}),e[17]=o,e[18]=u,e[19]=n,e[20]=h):h=e[20];let p;if(e[21]!==r||e[22]!==i||e[23]!==n.replies){let x;e[25]!==r||e[26]!==i?(x=(k,v)=>c.jsxs(w.Fragment,{children:[c.jsx(Dr,{inset:v>0}),c.jsx(co,{comment:k,onDelete:ao(k,r)?()=>i(k.id):void 0,isReply:!0})]},k.id),e[25]=r,e[26]=i,e[27]=x):x=e[27],p=n.replies.map(x),e[21]=r,e[22]=i,e[23]=n.replies,e[24]=p}else p=e[24];let m;e[28]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Dr,{}),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(ia,{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]!==h||e[37]!==p||e[38]!==b?(g=c.jsxs("div",{className:"flex flex-col rounded-xl bg-card card-shadow",children:[f,h,p,m,b]}),e[35]=f,e[36]=h,e[37]=p,e[38]=b,e[39]=g):g=e[39],g}function ao(t,e){return t.author.id===e.id||t.author.isAgent===!0}const xp=new Intl.ListFormat(void 0,{style:"long",type:"conjunction"});function bp(t,e){const n=[t,...t.replies],r=xp.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 yp(t){const e=P.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(ia,{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 Dr(t){const e=P.c(4),{inset:n}=t,r=n&&"ml-12";let s;e[0]!==r?(s=ee("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 co(t){const e=P.c(25),{comment:n,isReply:r,resolved:s,onDelete:i,onToggleResolved:o}=t;let l;e[0]!==n.author?(l=c.jsx(ra,{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=Qr(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 u;e[8]!==i||e[9]!==o||e[10]!==s?(u=(i||o)&&c.jsx(kp,{resolved:s,onDelete:i,onToggleResolved:o}),e[8]=i,e[9]=o,e[10]=s,e[11]=u):u=e[11];let h;e[12]!==l||e[13]!==a||e[14]!==f||e[15]!==u?(h=c.jsxs("div",{className:"flex items-center gap-2",children:[l,a,f,u]}),e[12]=l,e[13]=a,e[14]=f,e[15]=u,e[16]=h):h=e[16];const p=r&&"pl-8";let m;e[17]!==p?(m=ee("whitespace-pre-wrap text-[15px] leading-relaxed text-foreground",p),e[17]=p,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]!==h||e[23]!==y?(b=c.jsxs("div",{className:"group flex flex-col gap-1.5 p-4",children:[h,y]}),e[22]=h,e[23]=y,e[24]=b):b=e[24],b}function kp(t){const e=P.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(Wr,{size:16}),e[2]=l):l=e[2];let a;e[3]!==o?(a=c.jsx(sn,{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(St,{onSelect:s,children:[c.jsx(ws,{size:16}),i(n?"taskBoard.taskDialog.commentUnresolveThread":"taskBoard.taskDialog.commentResolveThread")]}),c.jsx(Ao,{})]}),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(St,{variant:"destructive",onSelect:r,children:[c.jsx(Kr,{size:16}),i("taskBoard.taskDialog.commentDelete")]}),e[9]=r,e[10]=i,e[11]=f):f=e[11];let u;e[12]!==d||e[13]!==f?(u=c.jsxs(rn,{align:"end",className:"w-48",children:[d,f]}),e[12]=d,e[13]=f,e[14]=u):u=e[14];let h;return e[15]!==a||e[16]!==u?(h=c.jsxs(on,{children:[a,u]}),e[15]=a,e[16]=u,e[17]=h):h=e[17],h}function ra(t){const e=P.c(6),{author:n}=t;if(n.isAgent){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx($t,{size:24}),e[0]=o):o=e[0],o}const r=n.image??void 0;let s;e[1]!==n.name?(s=Et(n.name),e[1]=n.name,e[2]=s):s=e[2];let i;return e[3]!==r||e[4]!==s?(i=c.jsx(It,{url:r,fallback:s,shape:"circle",size:"xs"}),e[3]=r,e[4]=s,e[5]=i):i=e[5],i}function ia(t){const e=P.c(36),{variant:n,placeholder:r,author:s,onSubmit:i}=t,o=oe(),l=w.useRef(null),[a,d]=w.useState("");let f;e[0]!==i||e[1]!==a?(f=()=>{const I=a.trim();if(!I)return;i(I),d("");const O=l.current;O&&(O.value="",uo(O))},e[0]=i,e[1]=a,e[2]=f):f=e[2];const u=f;let h;e[3]!==u?(h=I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),u())},e[3]=u,e[4]=h):h=e[4];const p=h;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=I=>{d(I.currentTarget.value),uo(I.currentTarget)},e[5]=m):m=e[5];const y=n==="root"&&"min-h-10";let b;e[6]!==y?(b=ee("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]!==p||e[9]!==r||e[10]!==b||e[11]!==a?(g=c.jsx("textarea",{ref:l,value:a,onChange:m,onKeyDown:p,placeholder:r,rows:1,className:b}),e[8]=p,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 C;e[15]!==o?(C=o("taskBoard.taskDialog.commentSubmitAriaLabel"),e[15]=o,e[16]=C):C=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(Rc,{size:16}),e[17]=j):j=e[17];let S;e[18]!==u||e[19]!==v||e[20]!==C?(S=c.jsx("button",{type:"button",disabled:v,onClick:u,"aria-label":C,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]=u,e[19]=v,e[20]=C,e[21]=S):S=e[21];const T=S;let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=()=>l.current?.focus(),e[22]=D):D=e[22];const R=D;if(n==="root"){let I;e[23]!==T?(I=c.jsx("div",{className:"flex items-center justify-end",children:T}),e[23]=T,e[24]=I):I=e[24];let O;return e[25]!==I||e[26]!==x?(O=c.jsxs("div",{"data-testid":"new-comment-composer",onClick:R,className:"relative flex cursor-text flex-col gap-1 rounded-xl bg-card p-3 card-shadow",children:[x,I]}),e[25]=I,e[26]=x,e[27]=O):O=e[27],O}let N;e[28]!==s?(N=c.jsx("span",{className:"mt-0.5 shrink-0",children:c.jsx(ra,{author:s})}),e[28]=s,e[29]=N):N=e[29];let E;e[30]!==x?(E=c.jsx("div",{className:"min-w-0 flex-1 pt-0.5",children:x}),e[30]=x,e[31]=E):E=e[31];let $;return e[32]!==T||e[33]!==N||e[34]!==E?($=c.jsxs("div",{"data-testid":"reply-composer",onClick:R,className:"relative flex cursor-text items-start gap-2 p-3",children:[N,E,T]}),e[32]=T,e[33]=N,e[34]=E,e[35]=$):$=e[35],$}function uo(t){t.style.height="auto",t.style.height=`${t.scrollHeight}px`}function vp(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 wp(t){const e=P.c(36),{locator:n}=Be(),r=Jt(),s=an();let i;e[0]!==t||e[1]!==n?(i=ke.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()=>vp((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=lt(d);let u;e[10]!==s||e[11]!==o?(u=()=>s.invalidateQueries({queryKey:o}),e[10]=s,e[11]=o,e[12]=u):u=e[12];const h=u;let p;e[13]!==t||e[14]!==r?(p=T=>r.call("TASK_BOARD_COMMENT_CREATE",{taskBoardItemId:t,...T}),e[13]=t,e[14]=r,e[15]=p):p=e[15];let m;e[16]!==h||e[17]!==p?(m={mutationFn:p,onSuccess:h},e[16]=h,e[17]=p,e[18]=m):m=e[18];const y=Je(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]!==h||e[22]!==b?(g={mutationFn:b,onSuccess:h},e[21]=h,e[22]=b,e[23]=g):g=e[23];const x=Je(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]!==h||e[27]!==k?(v={mutationFn:k,onSuccess:h},e[26]=h,e[27]=k,e[28]=v):v=e[28];const C=Je(v);let j;e[29]!==f.data?(j=f.data??[],e[29]=f.data,e[30]=j):j=e[30];let S;return e[31]!==y||e[32]!==C||e[33]!==x||e[34]!==j?(S={threads:j,post:y,setResolved:x,remove:C},e[31]=y,e[32]=C,e[33]=x,e[34]=j,e[35]=S):S=e[35],S}function oa(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function qr(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const la=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 Sp(t){const e=P.c(292),{open:n,onClose:r,item:s,defaultStatus:i,onSubmit:o,onDelete:l,onOpenThread:a,onNewChat:d,isSaving:f}=t,u=oe(),{data:h}=Lo();let p;e[0]!==h?.data?.members?(p=h?.data?.members??[],e[0]=h?.data?.members,e[1]=p):p=e[1];const m=p,{handleCopy:y,copied:b}=jc(),{data:g}=Fo();let x;e[2]!==g?(x=g===void 0?[]:g,e[2]=g,e[3]=x):x=e[3];const k=x,v=nc(),C=sc(),[j,S]=w.useState(s?.title??""),[T,D]=w.useState(s?.description??""),[R,N]=w.useState(s?.status??i??"triage"),[E,$]=w.useState(s?.priority??"medium"),[I,O]=w.useState(s?.assigneeId??null),_=s?.dueDate;let A;e[4]!==_?(A=qr(_),e[4]=_,e[5]=A):A=e[5];const[B,H]=w.useState(A);let V;e[6]!==s?.tags?(V=s?.tags.map(Np)??[],e[6]=s?.tags,e[7]=V):V=e[7];const[F,U]=w.useState(V),[G,Q]=w.useState(!1),[X,K]=w.useState(!1),[te,Z]=w.useState(!1);let ne;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?(ne=()=>{S(s?.title??""),D(s?.description??""),N(s?.status??i??"triage"),$(s?.priority??"medium"),O(s?.assigneeId??null),H(qr(s?.dueDate)),U(s?.tags.map(Tp)??[])},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]=ne):ne=e[16];const z=ne;let q;e[17]!==r||e[18]!==z?(q=()=>{r(),z()},e[17]=r,e[18]=z,e[19]=q):q=e[19];const W=q;let re;e[20]!==v?(re=async(Y,_e)=>{const Le=await v.mutateAsync({name:Y,color:_e});U(Tt=>[...Tt,Le.id])},e[20]=v,e[21]=re):re=e[21];const M=re;let J;e[22]!==C?(J=Y=>{C.mutate(Y),U(_e=>_e.filter(Le=>Le!==Y))},e[22]=C,e[23]=J):J=e[23];const se=J;let ce;e[24]!==I||e[25]!==T||e[26]!==B||e[27]!==o||e[28]!==E||e[29]!==R||e[30]!==F||e[31]!==j?(ce=()=>{const Y=j.trim();Y&&o({title:Y,description:T.trim()||null,status:R,priority:E,assigneeId:I,dueDate:B?oa(B):null,tagIds:F})},e[24]=I,e[25]=T,e[26]=B,e[27]=o,e[28]=E,e[29]=R,e[30]=F,e[31]=j,e[32]=ce):ce=e[32];const we=ce,me=I===Ze;let Se;if(e[33]!==I||e[34]!==m){let Y;e[36]!==I?(Y=_e=>_e.userId===I,e[36]=I,e[37]=Y):Y=e[37],Se=m.find(Y),e[33]=I,e[34]=m,e[35]=Se}else Se=e[35];const fe=Se;let tt;e[38]!==s||e[39]!==m?(tt=s?.assignedBy?m.find(Y=>Y.userId===s.assignedBy):void 0,e[38]=s,e[39]=m,e[40]=tt):tt=e[40];const Ee=tt,Lt=Dt[R].icon;let Ve,Ie,xe,Ue,he,dt,Oe,Ce,Pt,nt,Ke,Ge,st,pt,rt,it,ot,de,be,ye,Ne;if(e[41]!==W||e[42]!==s||e[43]!==n||e[44]!==u||e[45]!==j){xe=!!s&&Po(s),Ie=gs,ye=n,e[67]!==W?(Ne=Tt=>!Tt&&W(),e[67]=W,e[68]=Ne):Ne=e[68],Ve=ms,it="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]",ot="hidden";let Y;e[69]!==s||e[70]!==u?(Y=u(s?"taskBoard.taskDialog.editTaskTitle":"taskBoard.taskDialog.newTaskTitle"),e[69]=s,e[70]=u,e[71]=Y):Y=e[71],e[72]!==Y?(de=c.jsx(xs,{className:"sr-only",children:Y}),e[72]=Y,e[73]=de):de=e[73];let _e;e[74]!==u?(_e=u("taskBoard.taskDialog.closeAriaLabel"),e[74]=u,e[75]=_e):_e=e[75];let Le;e[76]===Symbol.for("react.memo_cache_sentinel")?(Le=c.jsx(nn,{size:16}),e[76]=Le):Le=e[76],e[77]!==W||e[78]!==_e?(be=c.jsx("button",{type:"button","aria-label":_e,onClick:W,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:Le}),e[77]=W,e[78]=_e,e[79]=be):be=e[79],rt="flex min-h-0 flex-1 flex-col overflow-y-auto sm:flex-row sm:overflow-hidden",pt="flex min-w-0 flex-col sm:flex-1 sm:overflow-y-auto",st="sticky top-0 z-10 bg-background p-6 pb-0 sm:p-8 sm:pb-0",Ue=jp,he=j,dt=Tt=>{xe||(S(Tt.target.value),Tt.target.style.height="auto",Tt.target.style.height=`${Tt.target.scrollHeight}px`)},Oe=Cp,e[80]!==u?(Ce=u("taskBoard.taskDialog.taskTitlePlaceholder"),e[80]=u,e[81]=Ce):Ce=e[81],Pt=!0,nt=1,Ke=xe,Ge=ee("w-full resize-none overflow-hidden border-0 bg-transparent text-xl font-medium leading-snug text-foreground outline-none placeholder:text-foreground/30",xe&&"cursor-default"),e[41]=W,e[42]=s,e[43]=n,e[44]=u,e[45]=j,e[46]=Ve,e[47]=Ie,e[48]=xe,e[49]=Ue,e[50]=he,e[51]=dt,e[52]=Oe,e[53]=Ce,e[54]=Pt,e[55]=nt,e[56]=Ke,e[57]=Ge,e[58]=st,e[59]=pt,e[60]=rt,e[61]=it,e[62]=ot,e[63]=de,e[64]=be,e[65]=ye,e[66]=Ne}else Ve=e[46],Ie=e[47],xe=e[48],Ue=e[49],he=e[50],dt=e[51],Oe=e[52],Ce=e[53],Pt=e[54],nt=e[55],Ke=e[56],Ge=e[57],st=e[58],pt=e[59],rt=e[60],it=e[61],ot=e[62],de=e[63],be=e[64],ye=e[65],Ne=e[66];let ve;e[82]!==Ue||e[83]!==he||e[84]!==dt||e[85]!==Oe||e[86]!==Ce||e[87]!==Pt||e[88]!==nt||e[89]!==Ke||e[90]!==Ge?(ve=c.jsx("textarea",{ref:Ue,value:he,onChange:dt,onKeyDown:Oe,placeholder:Ce,autoFocus:Pt,rows:nt,readOnly:Ke,className:Ge}),e[82]=Ue,e[83]=he,e[84]=dt,e[85]=Oe,e[86]=Ce,e[87]=Pt,e[88]=nt,e[89]=Ke,e[90]=Ge,e[91]=ve):ve=e[91];let je;e[92]!==xe||e[93]!==u?(je=xe&&c.jsxs("p",{className:"mb-3 mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(ka,{size:12}),u("taskBoard.taskDialog.reportsContentLocked")]}),e[92]=xe,e[93]=u,e[94]=je):je=e[94];let De;e[95]!==st||e[96]!==ve||e[97]!==je?(De=c.jsxs("div",{className:st,children:[ve,je]}),e[95]=st,e[96]=ve,e[97]=je,e[98]=De):De=e[98];let $e;e[99]!==u?($e=u("taskBoard.taskDialog.descriptionPlaceholder"),e[99]=u,e[100]=$e):$e=e[100];const pe=!xe;let Ae;e[101]!==T||e[102]!==$e||e[103]!==pe?(Ae=c.jsx(ap,{defaultValue:T,onChange:D,placeholder:$e,editable:pe}),e[101]=T,e[102]=$e,e[103]=pe,e[104]=Ae):Ae=e[104];let Re;e[105]!==b||e[106]!==T||e[107]!==y||e[108]!==u?(Re=T&&c.jsx(Fe,{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:()=>y(T),children:b?c.jsx(ws,{size:14}):c.jsx(Tc,{size:14})}),e[105]=b,e[106]=T,e[107]=y,e[108]=u,e[109]=Re):Re=e[109];let Me;e[110]!==Ae||e[111]!==Re?(Me=c.jsxs("div",{className:"group relative flex flex-col",children:[Ae,Re]}),e[110]=Ae,e[111]=Re,e[112]=Me):Me=e[112];let Qe;e[113]!==s?(Qe=s&&c.jsx("hr",{className:"border-border"}),e[113]=s,e[114]=Qe):Qe=e[114];let Xe;e[115]!==T||e[116]!==s||e[117]!==a?(Xe=s?.id&&c.jsx(Mp,{item:s,description:T,onOpenThread:a}),e[115]=T,e[116]=s,e[117]=a,e[118]=Xe):Xe=e[118];let ze;e[119]!==Ee||e[120]!==fe||e[121]!==s||e[122]!==m||e[123]!==a?(ze=s&&c.jsx(Pp,{item:s,members:m,startedBy:Ee??fe,onOpenThread:a}),e[119]=Ee,e[120]=fe,e[121]=s,e[122]=m,e[123]=a,e[124]=ze):ze=e[124];let Ye;e[125]!==Me||e[126]!==Qe||e[127]!==Xe||e[128]!==ze?(Ye=c.jsxs("div",{className:"flex flex-col gap-6 p-6 pt-6 sm:p-8 sm:pt-6",children:[Me,Qe,Xe,ze]}),e[125]=Me,e[126]=Qe,e[127]=Xe,e[128]=ze,e[129]=Ye):Ye=e[129];let We;e[130]!==pt||e[131]!==De||e[132]!==Ye?(We=c.jsxs("div",{className:pt,children:[De,Ye]}),e[130]=pt,e[131]=De,e[132]=Ye,e[133]=We):We=e[133];let gt;e[134]!==u?(gt=u("taskBoard.taskDialog.propertiesLabel"),e[134]=u,e[135]=gt):gt=e[135];let mt;e[136]!==gt?(mt=c.jsx("span",{className:"hidden px-3 text-sm text-muted-foreground sm:block",children:gt}),e[136]=gt,e[137]=mt):mt=e[137];let xt;e[138]!==s||e[139]!==R?(xt=ee(s?fi({...s,status:R}):Dt[R].iconClassName),e[138]=s,e[139]=R,e[140]=xt):xt=e[140];let bt;e[141]!==Lt||e[142]!==xt?(bt=c.jsx(Lt,{size:16,className:xt}),e[141]=Lt,e[142]=xt,e[143]=bt):bt=e[143];const Gt=Dt[R];let yt;e[144]!==u||e[145]!==Gt.labelKey?(yt=u(Gt.labelKey),e[144]=u,e[145]=Gt.labelKey,e[146]=yt):yt=e[146];let kt;e[147]!==bt||e[148]!==yt?(kt=c.jsx(sn,{asChild:!0,children:c.jsxs("button",{type:"button",className:qn,children:[bt,yt]})}),e[147]=bt,e[148]=yt,e[149]=kt):kt=e[149];let _t;e[150]!==u?(_t=Js.map(Y=>{const _e=Dt[Y].icon;return c.jsxs(St,{onSelect:()=>N(Y),className:"gap-2",children:[c.jsx(_e,{size:16,className:Dt[Y].iconClassName}),u(Dt[Y].labelKey)]},Y)}),e[150]=u,e[151]=_t):_t=e[151];let vt;e[152]!==_t?(vt=c.jsx(rn,{align:"start",className:"w-44",children:_t}),e[152]=_t,e[153]=vt):vt=e[153];let wt;e[154]!==kt||e[155]!==vt?(wt=c.jsxs(on,{children:[kt,vt]}),e[154]=kt,e[155]=vt,e[156]=wt):wt=e[156];let At;e[157]!==xe||e[158]!==u?(At=xe?u("taskBoard.taskDialog.reportsContentLocked"):void 0,e[157]=xe,e[158]=u,e[159]=At):At=e[159];const L=E==="none"&&"text-muted-foreground",ie=xe&&"cursor-default opacity-60";let ge;e[160]!==L||e[161]!==ie?(ge=ee(qn,L,ie),e[160]=L,e[161]=ie,e[162]=ge):ge=e[162];let qe;e[163]!==E||e[164]!==u?(qe=E==="none"?c.jsxs(c.Fragment,{children:[c.jsx(Wr,{size:16}),u("taskBoard.taskDialog.setPriorityButton")]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:ee("size-2 rounded-full",Rt[E].dotClassName)}),u(Rt[E].labelKey)]}),e[163]=E,e[164]=u,e[165]=qe):qe=e[165];let ut;e[166]!==xe||e[167]!==At||e[168]!==ge||e[169]!==qe?(ut=c.jsx(sn,{asChild:!0,children:c.jsx("button",{type:"button",disabled:xe,title:At,className:ge,children:qe})}),e[166]=xe,e[167]=At,e[168]=ge,e[169]=qe,e[170]=ut):ut=e[170];let jt;e[171]!==u?(jt=hi.map(Y=>c.jsxs(St,{onSelect:()=>$(Y),children:[c.jsx("span",{className:ee("size-2 rounded-full",Rt[Y].dotClassName)}),u(Rt[Y].labelKey)]},Y)),e[171]=u,e[172]=jt):jt=e[172];let un;e[173]!==jt?(un=c.jsx(rn,{align:"start",className:"w-40",children:jt}),e[173]=jt,e[174]=un):un=e[174];let fn;e[175]!==ut||e[176]!==un?(fn=c.jsxs(on,{children:[ut,un]}),e[175]=ut,e[176]=un,e[177]=fn):fn=e[177];const mr=!I&&"text-muted-foreground";let hn;e[178]!==mr?(hn=ee(qn,mr),e[178]=mr,e[179]=hn):hn=e[179];let pn;e[180]!==Ee||e[181]!==fe||e[182]!==me||e[183]!==u?(pn=me&&Ee?c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"hidden items-center gap-2 sm:flex",children:[c.jsx(It,{url:Ee.user?.image??void 0,fallback:Et(Ee.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:Ee.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(It,{url:Ee.user?.image??void 0,fallback:Et(Ee.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),c.jsx($t,{size:16,className:"ring-2 ring-background"})]}),u("taskBoard.taskDialog.superAgentLabel")]})]}):me?c.jsxs(c.Fragment,{children:[c.jsx($t,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]}):fe?c.jsxs(c.Fragment,{children:[c.jsx(It,{url:fe.user?.image??void 0,fallback:Et(fe.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:fe.user?.name??u("taskBoard.taskDialog.unassignedLabel")})]}):c.jsxs(c.Fragment,{children:[c.jsx(Eo,{size:16,className:"text-muted-foreground"}),u("taskBoard.taskDialog.assignButton")]}),e[180]=Ee,e[181]=fe,e[182]=me,e[183]=u,e[184]=pn):pn=e[184];let gn;e[185]!==hn||e[186]!==pn?(gn=c.jsx(Kn,{asChild:!0,children:c.jsx("button",{type:"button",className:hn,children:pn})}),e[185]=hn,e[186]=pn,e[187]=gn):gn=e[187];let Es;e[188]===Symbol.for("react.memo_cache_sentinel")?(Es=Y=>{O(Y),K(!1)},e[188]=Es):Es=e[188];let mn;e[189]!==m?(mn=c.jsx(cs,{align:"start",className:"w-56 p-0",children:c.jsx(Ti,{members:m,onSelect:Es})}),e[189]=m,e[190]=mn):mn=e[190];let xn;e[191]!==X||e[192]!==gn||e[193]!==mn?(xn=c.jsxs(ds,{open:X,onOpenChange:K,modal:!0,children:[gn,mn]}),e[191]=X,e[192]=gn,e[193]=mn,e[194]=xn):xn=e[194];let bn;e[195]!==Ee||e[196]!==me||e[197]!==u?(bn=me&&Ee&&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:ee(qn,"pointer-events-none"),children:[c.jsx($t,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]})]}),e[195]=Ee,e[196]=me,e[197]=u,e[198]=bn):bn=e[198];let yn;e[199]!==xn||e[200]!==bn?(yn=c.jsxs("div",{className:"flex flex-col",children:[xn,bn]}),e[199]=xn,e[200]=bn,e[201]=yn):yn=e[201];const xr=!B&&"text-muted-foreground";let kn;e[202]!==xr?(kn=ee(qn,xr),e[202]=xr,e[203]=kn):kn=e[203];let Is;e[204]===Symbol.for("react.memo_cache_sentinel")?(Is=c.jsx(Wn,{size:16,className:"text-muted-foreground"}),e[204]=Is):Is=e[204];let vn;e[205]!==B||e[206]!==u?(vn=B?la.format(B):u("taskBoard.taskDialog.dueDateLabel"),e[205]=B,e[206]=u,e[207]=vn):vn=e[207];let wn;e[208]!==B||e[209]!==u?(wn=B&&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:Y=>{Y.stopPropagation(),H(null)},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),Y.stopPropagation(),H(null))},children:c.jsx(nn,{size:12})}),e[208]=B,e[209]=u,e[210]=wn):wn=e[210];let Sn;e[211]!==kn||e[212]!==vn||e[213]!==wn?(Sn=c.jsx(Kn,{asChild:!0,children:c.jsxs("button",{type:"button",className:kn,children:[Is,vn,wn]})}),e[211]=kn,e[212]=vn,e[213]=wn,e[214]=Sn):Sn=e[214];const br=B??void 0;let _s;e[215]===Symbol.for("react.memo_cache_sentinel")?(_s=Y=>{H(Y??null),Y&&Q(!1)},e[215]=_s):_s=e[215];let Cn;e[216]!==br?(Cn=c.jsx(cs,{className:"w-auto p-0",align:"start",children:c.jsx(Qo,{mode:"single",selected:br,onSelect:_s,initialFocus:!0})}),e[216]=br,e[217]=Cn):Cn=e[217];let jn;e[218]!==G||e[219]!==Sn||e[220]!==Cn?(jn=c.jsxs(ds,{open:G,onOpenChange:Q,children:[Sn,Cn]}),e[218]=G,e[219]=Sn,e[220]=Cn,e[221]=jn):jn=e[221];let Tn;e[222]!==k||e[223]!==u||e[224]!==F?(Tn=F.length===0?c.jsx(Kn,{asChild:!0,children:c.jsxs("button",{type:"button",className:ee(qn,"text-muted-foreground"),children:[c.jsx(_a,{size:16}),u("taskBoard.taskDialog.tagsButton")]})}):c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:px-3",children:[F.map(Y=>{const _e=k.find(Le=>Le.id===Y);return _e?c.jsxs("button",{type:"button",onClick:()=>Z(!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:Ns(_e.color)}}),c.jsx("span",{className:"truncate",children:_e.name}),c.jsx("span",{role:"button",tabIndex:0,"aria-label":u("taskBoard.taskDialog.removeTagAriaLabel",{name:_e.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:Le=>{Le.stopPropagation(),U(Tt=>Tt.filter(yr=>yr!==Y))},onKeyDown:Le=>{(Le.key==="Enter"||Le.key===" ")&&(Le.preventDefault(),Le.stopPropagation(),U(Tt=>Tt.filter(yr=>yr!==Y)))},children:c.jsx(nn,{size:10})})]},Y):null}),c.jsx(Kn,{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(ps,{size:14})})})]}),e[222]=k,e[223]=u,e[224]=F,e[225]=Tn):Tn=e[225];let Nn;e[226]!==k.length?(Nn=vf(k.length),e[226]=k.length,e[227]=Nn):Nn=e[227];let As;e[228]===Symbol.for("react.memo_cache_sentinel")?(As=Y=>U(_e=>_e.includes(Y)?_e.filter(Le=>Le!==Y):[..._e,Y]),e[228]=As):As=e[228];let Dn;e[229]!==M||e[230]!==se||e[231]!==k||e[232]!==Nn||e[233]!==F?(Dn=c.jsx(cs,{align:"start",className:"w-56 p-0",children:c.jsx(pp,{tags:k,selectedIds:F,defaultColor:Nn,onToggle:As,onCreate:M,onDelete:se})}),e[229]=M,e[230]=se,e[231]=k,e[232]=Nn,e[233]=F,e[234]=Dn):Dn=e[234];let Rn;e[235]!==Tn||e[236]!==Dn||e[237]!==te?(Rn=c.jsxs(ds,{open:te,onOpenChange:Z,modal:!0,children:[Tn,Dn]}),e[235]=Tn,e[236]=Dn,e[237]=te,e[238]=Rn):Rn=e[238];let En;e[239]!==wt||e[240]!==fn||e[241]!==yn||e[242]!==jn||e[243]!==Rn?(En=c.jsxs("div",{className:"flex flex-wrap gap-2 sm:flex-col",children:[wt,fn,yn,jn,Rn]}),e[239]=wt,e[240]=fn,e[241]=yn,e[242]=jn,e[243]=Rn,e[244]=En):En=e[244];let In;e[245]!==mt||e[246]!==En?(In=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:[mt,En]}),e[245]=mt,e[246]=En,e[247]=In):In=e[247];let _n;e[248]!==rt||e[249]!==We||e[250]!==In?(_n=c.jsxs("div",{className:rt,children:[We,In]}),e[248]=rt,e[249]=We,e[250]=In,e[251]=_n):_n=e[251];let An;e[252]!==s||e[253]!==l||e[254]!==u?(An=s&&l?c.jsx(Fe,{variant:"ghost",size:"icon","aria-label":u("taskBoard.taskDialog.deleteTaskAriaLabel"),className:"size-10 text-muted-foreground hover:text-destructive",onClick:l,children:c.jsx(Kr,{size:16})}):c.jsx("span",{}),e[252]=s,e[253]=l,e[254]=u,e[255]=An):An=e[255];let Bn;e[256]!==s||e[257]!==d||e[258]!==u?(Bn=s&&d&&c.jsxs(Fe,{variant:"outline",size:"sm",onClick:d,children:[c.jsx(Io,{size:16}),u("taskBoard.taskDialog.newChatButton")]}),e[256]=s,e[257]=d,e[258]=u,e[259]=Bn):Bn=e[259];let On;e[260]!==f||e[261]!==j?(On=!j.trim()||f,e[260]=f,e[261]=j,e[262]=On):On=e[262];let $n;e[263]!==s?($n=s?null:c.jsx(ps,{size:16}),e[263]=s,e[264]=$n):$n=e[264];let Mn;e[265]!==s||e[266]!==u?(Mn=u(s?"taskBoard.taskDialog.saveButton":"taskBoard.taskDialog.createTaskButton"),e[265]=s,e[266]=u,e[267]=Mn):Mn=e[267];let zn;e[268]!==we||e[269]!==On||e[270]!==$n||e[271]!==Mn?(zn=c.jsxs(Fe,{size:"sm",disabled:On,onClick:we,children:[$n,Mn]}),e[268]=we,e[269]=On,e[270]=$n,e[271]=Mn,e[272]=zn):zn=e[272];let Ln;e[273]!==Bn||e[274]!==zn?(Ln=c.jsxs("div",{className:"flex items-center gap-2",children:[Bn,zn]}),e[273]=Bn,e[274]=zn,e[275]=Ln):Ln=e[275];let Pn;e[276]!==An||e[277]!==Ln?(Pn=c.jsxs("div",{className:"flex h-16 items-center justify-between border-t border-border px-4",children:[An,Ln]}),e[276]=An,e[277]=Ln,e[278]=Pn):Pn=e[278];let Fn;e[279]!==Ve||e[280]!==it||e[281]!==ot||e[282]!==de||e[283]!==be||e[284]!==_n||e[285]!==Pn?(Fn=c.jsxs(Ve,{className:it,closeButtonClassName:ot,children:[de,be,_n,Pn]}),e[279]=Ve,e[280]=it,e[281]=ot,e[282]=de,e[283]=be,e[284]=_n,e[285]=Pn,e[286]=Fn):Fn=e[286];let Bs;return e[287]!==Ie||e[288]!==ye||e[289]!==Ne||e[290]!==Fn?(Bs=c.jsx(Ie,{open:ye,onOpenChange:Ne,children:Fn}),e[287]=Ie,e[288]=ye,e[289]=Ne,e[290]=Fn,e[291]=Bs):Bs=e[291],Bs}function Cp(t){t.key==="Enter"&&t.preventDefault()}function jp(t){t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}function Tp(t){return t.id}function Np(t){return t.id}function Dp(t,e){switch(t){case"failed":return{label:e("taskBoard.taskDialog.threadStatusError"),className:"text-destructive",icon:Ba};case"requires_action":return{label:e("taskBoard.taskDialog.threadStatusNeedsInput"),className:"text-warning",icon:Vr};case"in_progress":return{label:e("taskBoard.taskDialog.threadStatusRunning"),className:"text-primary",icon:vs,spin:!0};case"completed":return{label:e("taskBoard.taskDialog.threadStatusCompleted"),className:"text-success",icon:cn};case"expired":return{label:e("taskBoard.taskDialog.threadStatusExpired"),className:"text-muted-foreground",icon:or};default:return t}}function Rp(t){const e=P.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?Dp(n.status,i):null,a=n.lastMessage;let d;e[5]!==n.title?(d=Ri(n.title,"qa"),e[5]=n.title,e[6]=d):d=e[6];const f=d;let u;e[7]!==n.title?(u=Ri(n.title,"code_review"),e[7]=n.title,e[8]=u):u=e[8];const h=u;let p;e[9]!==s||e[10]!==n?(p=()=>s?.(n),e[9]=s,e[10]=n,e[11]=p):p=e[11];let m;e[12]!==h||e[13]!==f?(m=f?c.jsx(Al,{size:16,className:"shrink-0"}):h?c.jsx(Bl,{size:16,className:"shrink-0"}):c.jsx($t,{size:16,className:"shrink-0"}),e[12]=h,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(It,{url:r.user?.image??void 0,fallback:Et(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(Xo,{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:p,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:ee("flex shrink-0 items-center gap-1.5",l.className),children:[c.jsx(l.icon,{size:15,className:ee(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 Ep(t,e){return t.merged?{label:e("taskBoard.taskDialog.prStateMerged"),className:"text-special",icon:Aa}:t.state==="closed"?{label:e("taskBoard.taskDialog.prStateClosed"),className:"text-destructive",icon:kr}:t.draft?{label:e("taskBoard.taskDialog.prStateDraft"),className:"text-muted-foreground",icon:kr}:{label:e("taskBoard.taskDialog.prStateOpen"),className:"text-success",icon:kr}}function Ip(t,e){switch(t){case"passing":return{label:e("taskBoard.taskDialog.prChecksPassing"),className:"text-success",icon:cn};case"failing":return{label:e("taskBoard.taskDialog.prChecksFailing"),className:"text-destructive",icon:or};case"pending":return{label:e("taskBoard.taskDialog.prChecksPending"),className:"text-warning",icon:vs};default:return null}}const _p=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);function Ap(t){if(t.status!=="completed")return{icon:vs,className:"text-warning",spin:!0};const e=t.conclusion;return e&&_p.has(e)?{icon:or,className:"text-destructive",spin:!1}:e==="success"||e==="neutral"||e==="skipped"?{icon:cn,className:"text-success",spin:!1}:{icon:Vr,className:"text-muted-foreground",spin:!1}}function Bp(t){const e=P.c(37),{pr:n,previewThread:r,reviewsReady:s,shipPending:i,onShip:o,onOpenThread:l}=t,a=oe(),[d,f]=w.useState(!1);let u;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 h=Ep(n,a),p=Ip(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||p!=null,C=k.length>0;let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(Er,{className:"size-4 shrink-0 text-foreground"}),e[11]=j):j=e[11];const S=n.title??`${n.repoOwner}/${n.repoName}`;let T;e[12]!==S?(T=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:S}),e[12]=S,e[13]=T):T=e[13];const D=ee("flex shrink-0 items-center gap-1 text-xs font-medium",h.className);let R;e[14]!==h?(R=c.jsx(h.icon,{size:13}),e[14]=h,e[15]=R):R=e[15];let N;e[16]!==h||e[17]!==D||e[18]!==R?(N=c.jsxs("span",{className:D,children:[R,h.label]}),e[16]=h,e[17]=D,e[18]=R,e[19]=N):N=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(qs,{size:12,className:"text-muted-foreground/60 group-hover:text-foreground"}),e[20]=E):E=e[20];let $;e[21]!==n.number||e[22]!==n.url?($=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,E]}),e[21]=n.number,e[22]=n.url,e[23]=$):$=e[23];let I;e[24]!==$||e[25]!==T||e[26]!==N?(I=c.jsxs("div",{className:"flex items-center gap-3",children:[j,T,N,$]}),e[24]=$,e[25]=T,e[26]=N,e[27]=I):I=e[27];let O;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?(O=g&&c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r&&c.jsxs(Fe,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",title:a("taskBoard.taskDialog.openPreviewTitle"),onClick:()=>l?.(r),children:[c.jsx(Io,{size:13}),a("taskBoard.taskDialog.openPreviewButton")]}),n.previewUrl&&c.jsx(Fe,{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(Yo,{size:14}),a("taskBoard.taskDialog.previewLabel"),c.jsx(qs,{size:12})]})}),b&&c.jsx(Fe,{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]=O):O=e[36],u=c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[I,O,v&&c.jsxs("div",{className:"border-t border-border pt-2 text-xs",children:[c.jsxs("button",{type:"button",disabled:!C,onClick:()=>f(Op),className:"flex w-full items-center gap-1.5 font-medium disabled:cursor-default",children:[p?c.jsx(p.icon,{size:13,className:p.className}):c.jsx(cn,{size:13,className:"text-muted-foreground"}),c.jsx("span",{className:ee(p?.className??"text-muted-foreground"),children:p?.label??a("taskBoard.taskDialog.prChecksLabel")}),C&&c.jsx(Xo,{size:14,className:ee("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(_=>{const A=Ap(_);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(A.icon,{size:13,className:ee("shrink-0",A.className,A.spin&&"animate-spin")}),c.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:_.name}),_.detailsUrl&&c.jsx("a",{href:_.detailsUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:c.jsx(qs,{size:12})})]}),_.summary&&c.jsx("div",{className:"mt-1.5 max-h-64 overflow-auto text-muted-foreground",children:c.jsx(Sc,{id:`${n.url}-${_.name}`,text:_.summary})})]},_.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]=u}else u=e[8];return u}function Op(t){return!t}function $p(){const t=P.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(Un,{className:"size-4 shrink-0 rounded"}),c.jsx(Un,{className:"h-4 min-w-0 flex-1"}),c.jsx(Un,{className:"h-4 w-16 shrink-0"}),c.jsx(Un,{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(Un,{className:"h-7 w-20"}),c.jsx(Un,{className:"h-7 w-28"})]})]}),t[1]=n):n=t[1],n}function Mp(t){const e=P.c(36),{item:n,description:r,onOpenThread:s}=t,i=oe(),{data:o,isLoading:l}=dp(n.id),{data:a}=sa(n.id),d=Ei("qa_agent_enabled"),f=Ei("code_reviewer_enabled"),u=up(n.id);let h,p;if(e[0]!==a||e[1]!==f||e[2]!==r||e[3]!==n.status||e[4]!==n.threads||e[5]!==s||e[6]!==u||e[7]!==o||e[8]!==l||e[9]!==d||e[10]!==i){p=Symbol.for("react.early_return_sentinel");e:{const m=gp(r),y=l&&!o;if(!y&&(!o||o.length===0)&&m.length===0){p=null;break e}let b;e[13]!==a||e[14]!==f||e[15]!==n.status||e[16]!==d?(b=n.status==="in_review"&&hp(a??[],fp({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]!==u||e[19]!==i?(x=()=>u.mutate(void 0,{onSuccess:D=>D?.merged?ht.success(i("taskBoard.taskDialog.shipSuccess")):ht.error(i("taskBoard.taskDialog.shipError")),onError:()=>ht.error(i("taskBoard.taskDialog.shipError"))}),e[18]=u,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(Lp):void 0,e[21]=n.threads,e[22]=s,e[23]=v):v=e[23];const C=v;let j;e[24]!==i?(j=i("taskBoard.taskDialog.linksLabel"),e[24]=i,e[25]=j):j=e[25];let S;e[26]!==j?(S=c.jsx("span",{className:"mb-1 text-xs font-medium text-muted-foreground",children:j}),e[26]=j,e[27]=S):S=e[27];let T;e[28]!==y||e[29]!==s||e[30]!==k||e[31]!==C||e[32]!==u||e[33]!==o||e[34]!==g?(T=y?c.jsx($p,{}):(o??[]).map(D=>c.jsx(Bp,{pr:D,previewThread:C,reviewsReady:g,shipPending:u.isPending,onShip:k,onOpenThread:s},D.url)),e[28]=y,e[29]=s,e[30]=k,e[31]=C,e[32]=u,e[33]=o,e[34]=g,e[35]=T):T=e[35],h=c.jsxs("div",{className:"flex flex-col gap-1 pb-2",children:[S,T,m.map(zp)]})}e[0]=a,e[1]=f,e[2]=r,e[3]=n.status,e[4]=n.threads,e[5]=s,e[6]=u,e[7]=o,e[8]=l,e[9]=d,e[10]=i,e[11]=h,e[12]=p}else h=e[11],p=e[12];return p!==Symbol.for("react.early_return_sentinel")?p:h}function zp(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(Yo,{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(qs,{size:13,className:"shrink-0 text-muted-foreground/50 group-hover:text-foreground"})]},t.url)}function Lp(t){return t.hasPreview&&t.virtualMcpId}function Pp(t){const e=P.c(6),{item:n,members:r,startedBy:s,onOpenThread:i}=t,o=oe(),{data:l}=sa(n.id),{data:a}=yo.useSession(),d=new Map(r.map(Kp)),f={id:a?.user?.id??"me",name:a?.user?.name??o("taskBoard.taskDialog.commentYouLabel"),image:a?.user?.image},u=wp(n.id),h=k=>{if(k===Ze)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}},p=u.threads.map(k=>({id:k.id,author:h(k.authorId),body:k.body,createdAt:k.createdAt,resolved:k.resolved,replies:k.replies.map(v=>({id:v.id,author:h(v.authorId),body:v.body,createdAt:v.createdAt,replies:[]}))})),m=[...(l??[]).map(Hp),...n.threads.map(qp),...p.map(Up)].sort(Fp),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]!==u.post?(x=k=>u.post.mutate({body:k}),e[4]=u.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(Vp,{items:k.items,memberByUserId:d},`timeline-${v}`):k.type==="comment"?c.jsx(mp,{thread:k.comment,me:f,onReply:C=>u.post.mutate({body:C,parentId:k.comment.id}),onDelete:C=>u.remove.mutate(C),onToggleResolved:()=>u.setResolved.mutate({id:k.comment.id,resolved:!k.comment.resolved})},`comment-${k.comment.id}`):c.jsx(Rp,{thread:k.thread,startedBy:s,onOpen:i},`thread-${k.thread.threadId}`)),c.jsx(yp,{me:f,onSubmit:x})]})}function Fp(t,e){return t.at-e.at}function Up(t){return{kind:"comment",at:new Date(t.createdAt).getTime(),comment:t}}function qp(t){return{kind:"thread",at:new Date(t.createdAt).getTime(),thread:t}}function Hp(t){return{kind:"activity",at:new Date(t.occurredAt).getTime(),activity:t}}function Kp(t){return[t.userId,t]}function en(t){const e=P.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 sr="\0";function Us(t){return`${sr}${t}${sr}`}function Hn(t,e){return t.split(new RegExp(`${sr}(\\w+)${sr}`)).map((n,r)=>c.jsx(w.Fragment,{children:r%2===0?n:e[n]},r))}function is(t,e){return e(t==="code_review"?"taskBoard.taskDialog.codeReviewerLabel":"taskBoard.taskDialog.qaAgentLabel")}function Wp(t,e,n){const r=h=>{const p=typeof h=="string"?Dt[h]:void 0;if(!p)return String(h??"");const m=p.icon;return c.jsx(en,{icon:c.jsx(m,{size:14,className:p.iconClassName}),label:e(p.labelKey)})},s=h=>{const p=typeof h=="string"?Rt[h]:void 0;return p?c.jsx(en,{icon:c.jsx("span",{className:ee("size-2 rounded-full",p.dotClassName)}),label:e(p.labelKey)}):String(h??"")},i=h=>{const p=qr(typeof h=="string"?h:null);return p?c.jsx(en,{icon:c.jsx(Wn,{size:14,className:"text-muted-foreground"}),label:la.format(p)}):""},o=h=>!Array.isArray(h)||h.length===0?null:h.map((p,m)=>{const y=p;return c.jsx(en,{icon:c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:Ns(y.color)}}),label:y.name??""},y.id??m)}),l=h=>{if(h===Ze)return c.jsx(en,{icon:c.jsx($t,{size:14}),label:e("taskBoard.taskDialog.superAgentLabel")});const p=typeof h=="string"?n.get(h):void 0;return c.jsx(en,{icon:c.jsx(It,{url:p?.user?.image??void 0,fallback:Et(p?.user?.name),shape:"circle",size:"2xs"}),label:p?.user?.name??e("taskBoard.taskDialog.someoneLabel")})},a=h=>c.jsx(en,{icon:h==="code_review"?c.jsx(Bl,{size:14}):c.jsx(Al,{size:14}),label:is(h,e)}),d=t.data,f=Us("from"),u=Us("to");switch(t.action){case"created":return e("taskBoard.taskDialog.activityCreated");case"status_changed":return Hn(d.from?e("taskBoard.taskDialog.activityMovedFromTo",{from:f,to:u}):e("taskBoard.taskDialog.activityMovedTo",{to:u}),{from:r(d.from),to:r(d.to)});case"assignee_changed":return d.to==null?e("taskBoard.taskDialog.activityUnassigned"):Hn(e(d.to===Ze?"taskBoard.taskDialog.activityDelegated":"taskBoard.taskDialog.activityAssigned",{name:Us("name")}),{name:l(d.to)});case"priority_changed":return d.to==="none"?e("taskBoard.taskDialog.activityPriorityCleared"):Hn(!d.from||d.from==="none"?e("taskBoard.taskDialog.activityPrioritySet",{to:u}):e("taskBoard.taskDialog.activityPriorityFromTo",{from:f,to:u}),{from:s(d.from),to:s(d.to)});case"due_date_changed":return d.to==null?e("taskBoard.taskDialog.activityDueDateCleared"):Hn(d.from==null?e("taskBoard.taskDialog.activityDueDateSet",{to:u}):e("taskBoard.taskDialog.activityDueDateFromTo",{from:f,to:u}),{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"):Hn(e("taskBoard.taskDialog.activityTagsSet",{to:u}),{to:o(d.to)});case"review_requested":return Hn(e("taskBoard.taskDialog.activityDelegated",{name:Us("name")}),{name:a(d.reviewer)});case"review_approved":return typeof d.notes=="string"&&d.notes.trim()?e("taskBoard.taskDialog.activityReviewApprovedWithNotes",{reviewer:is(d.reviewer,e),notes:d.notes}):e("taskBoard.taskDialog.activityReviewApproved",{reviewer:is(d.reviewer,e)});case"review_changes_requested":return typeof d.notes=="string"&&d.notes.trim()?e("taskBoard.taskDialog.activityReviewChangesRequestedWithNotes",{reviewer:is(d.reviewer,e),notes:d.notes}):e("taskBoard.taskDialog.activityReviewChangesRequested",{reviewer:is(d.reviewer,e)});case"merge_conflict_resolution":return e("taskBoard.taskDialog.activityMergeConflictResolution");default:{const h=t.action;return String(h)}}}function fo(t){return!t||t===Ze}function Vp(t){const e=P.c(21),{items:n,memberByUserId:r}=t,s=oe();let i;e[0]!==r||e[1]!==s?(i=h=>fo(h)?s("taskBoard.taskDialog.superAgentLabel"):r.get(h)?.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=h=>{if(fo(h))return c.jsx("span",{className:"z-10 flex size-4 shrink-0 items-center justify-center bg-background",children:c.jsx($t,{size:16})});const p=r.get(h);return c.jsx("span",{className:"z-10 shrink-0 rounded-full bg-background",children:c.jsx(It,{url:p?.user?.image??void 0,fallback:Et(p?.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 h;e[13]!==a||e[14]!==o||e[15]!==r||e[16]!==s?(h=p=>c.jsxs("div",{className:"relative flex items-center gap-2.5",children:[a(p.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(p.actorId)})," ",Wp(p,s,r),c.jsxs("span",{className:"text-muted-foreground/60",children:[" · ",Qr(new Date(p.occurredAt))]})]})]},p.id),e[13]=a,e[14]=o,e[15]=r,e[16]=s,e[17]=h):h=e[17],f=n.map(h),e[7]=a,e[8]=o,e[9]=n,e[10]=r,e[11]=s,e[12]=f}else f=e[12];let u;return e[18]!==d||e[19]!==f?(u=c.jsxs("div",{className:"relative flex flex-col gap-4",children:[d,f]}),e[18]=d,e[19]=f,e[20]=u):u=e[20],u}const aa="https://decoims.com/image?src=decocms%2F7263a67f-fb83-410b-a5f2-e54e87deaaac%2Freport-kanban.png&quality=original&fit=cover",Gp=["taskBoard.backlogPaywall.benefitPrioritizedTasks","taskBoard.backlogPaywall.benefitRecurringReport","taskBoard.backlogPaywall.benefitAgentResolves"],ho={price:"R$ 99",anchor:"R$ 499"};function Qp(t){const e=P.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(Gr,{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 u;e[14]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx(Jo,{size:16}),e[14]=u):u=e[14];let h;e[15]!==n||e[16]!==f?(h=c.jsxs(Fe,{size:"sm",onClick:n,className:"w-full gap-2 sm:w-auto sm:shrink-0",children:[f,u]}),e[15]=n,e[16]=f,e[17]=h):h=e[17];let p;return e[18]!==d||e[19]!==h?(p=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,h]}),e[18]=d,e[19]=h,e[20]=p):p=e[20],p}function Xp({open:t,onOpenChange:e,cdClient:n,onExpired:r}){const s=oe(),[i,o]=w.useState(!1),l=async()=>{if(!n){r();return}o(!0);try{const a=await n.callTool({name:"start_checkout",arguments:{}}),{url:d}=_r(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(gs,{open:t,onOpenChange:e,children:c.jsxs(ms,{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:aa,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(xs,{className:"text-xl font-semibold text-foreground",children:s("taskBoard.backlogPaywall.modalTitle")}),c.jsx("ul",{className:"flex flex-col gap-3.5",children:Gp.map(a=>c.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[c.jsx(cn,{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:ho.price}),c.jsx("span",{className:"text-sm text-muted-foreground line-through",children:ho.anchor})]}),c.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[c.jsx(Fe,{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(Fe,{onClick:l,disabled:i,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[i?c.jsx(ir,{size:16,className:"animate-spin"}):null,s("taskBoard.backlogPaywall.unlockButton"),!i&&c.jsx(Jo,{size:16})]})]})]})]})]})})}function Rr(t){return`board-paywall-seen:${t}`}function Yp(){const t=P.c(26),{org:e}=Be(),n=Ro(),{diagnostic:r,cdClient:s,connectionId:i}=bd();let o;t[0]!==e.id?(o=()=>({orgId:e.id,open:!sessionStorage.getItem(Rr(e.id))}),t[0]=e.id,t[1]=o):o=t[1];const[l,a]=w.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(Rr(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 u;t[6]!==e.id?(u=v=>a({orgId:e.id,open:v}),t[6]=e.id,t[7]=u):u=t[7];const h=u;let p;t[8]!==e.id||t[9]!==h?(p=v=>{h(v),v||sessionStorage.setItem(Rr(e.id),"1")},t[8]=e.id,t[9]=h,t[10]=p):p=t[10];const m=p;let y;t[11]!==i||t[12]!==n||t[13]!==e?(y=()=>{Ni("board_paywall_report_opened",{organization_id:e.id}),n(kd(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]!==h?(g=c.jsx(Qp,{onOpen:()=>{Ni("board_paywall_banner_clicked",{organization_id:e.id}),h(!0)}}),t[15]=e.id,t[16]=h,t[17]=g):g=t[17];let x;t[18]!==s||t[19]!==m||t[20]!==f||t[21]!==b?(x=c.jsx(Xp,{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 Zp(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(va,{fallback:null,children:c.jsx(Yp,{})}),t[0]=e):e=t[0],e}const Jp=["taskBoard.subscriptionPaywall.trialBenefitMonitoring","taskBoard.subscriptionPaywall.trialBenefitAutoFix","taskBoard.subscriptionPaywall.trialBenefitRuns"];function eg(t){const e=P.c(92),{kind:n,onOpenChange:r}=t,s=oe(),i=Jt();let o;e[0]!==i?(o=async()=>{const{url:D}=await i.call("ORGANIZATION_BILLING_CHECKOUT_START",{});return D},e[0]=i,e[1]=o):o=e[1];let l;e[2]!==r?(l=D=>{window.open(D,"_blank","noopener,noreferrer"),r(!1)},e[2]=r,e[3]=l):l=e[3];let a;e[4]!==s?(a=D=>{ht.error(s("taskBoard.subscriptionPaywall.checkoutError",{message:D.message}))},e[4]=s,e[5]=a):a=e[5];let d;e[6]!==o||e[7]!==l||e[8]!==a?(d={mutationFn:o,onSuccess:l,onError:a},e[6]=o,e[7]=l,e[8]=a,e[9]=d):d=e[9];const{mutate:f,isPending:u}=Je(d);if(n==="trial_exhausted"){let D;e[10]!==s?(D=s("taskBoard.subscriptionPaywall.previewAlt"),e[10]=s,e[11]=D):D=e[11];let R;e[12]!==D?(R=c.jsx("div",{className:"overflow-hidden rounded-xl bg-muted",children:c.jsx("img",{src:aa,alt:D,className:"h-[160px] w-full object-cover object-left-top"})}),e[12]=D,e[13]=R):R=e[13];let N;e[14]!==s?(N=s("taskBoard.subscriptionPaywall.trialTitle"),e[14]=s,e[15]=N):N=e[15];let E;e[16]!==N?(E=c.jsx(xs,{className:"text-xl font-semibold text-foreground",children:N}),e[16]=N,e[17]=E):E=e[17];let $;e[18]!==s?($=Jp.map(W=>c.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[c.jsx(cn,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),c.jsx("span",{className:"leading-snug text-foreground",children:s(W)})]},W)),e[18]=s,e[19]=$):$=e[19];let I;e[20]!==$?(I=c.jsx("ul",{className:"flex flex-col gap-3",children:$}),e[20]=$,e[21]=I):I=e[21];let O;e[22]!==s?(O=s("taskBoard.subscriptionPaywall.trialPrice"),e[22]=s,e[23]=O):O=e[23];let _;e[24]!==O?(_=c.jsx("span",{className:"text-2xl font-semibold text-foreground",children:O}),e[24]=O,e[25]=_):_=e[25];let A;e[26]!==s?(A=s("taskBoard.subscriptionPaywall.trialPricePeriod"),e[26]=s,e[27]=A):A=e[27];let B;e[28]!==A?(B=c.jsx("span",{className:"text-sm text-muted-foreground",children:A}),e[28]=A,e[29]=B):B=e[29];let H;e[30]!==_||e[31]!==B?(H=c.jsxs("div",{className:"flex items-baseline gap-1.5",children:[_,B]}),e[30]=_,e[31]=B,e[32]=H):H=e[32];let V;e[33]!==r?(V=()=>r(!1),e[33]=r,e[34]=V):V=e[34];let F;e[35]!==s?(F=s("taskBoard.subscriptionPaywall.notNowButton"),e[35]=s,e[36]=F):F=e[36];let U;e[37]!==u||e[38]!==V||e[39]!==F?(U=c.jsx(Fe,{variant:"ghost",onClick:V,disabled:u,className:"order-2 w-full sm:order-none sm:w-auto",children:F}),e[37]=u,e[38]=V,e[39]=F,e[40]=U):U=e[40];let G;e[41]!==f?(G=()=>f(),e[41]=f,e[42]=G):G=e[42];let Q;e[43]!==u?(Q=u&&c.jsx(ir,{size:16,className:"animate-spin"}),e[43]=u,e[44]=Q):Q=e[44];let X;e[45]!==s?(X=s("taskBoard.subscriptionPaywall.subscribeButton"),e[45]=s,e[46]=X):X=e[46];let K;e[47]!==u||e[48]!==G||e[49]!==Q||e[50]!==X?(K=c.jsxs(Fe,{disabled:u,onClick:G,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[Q,X]}),e[47]=u,e[48]=G,e[49]=Q,e[50]=X,e[51]=K):K=e[51];let te;e[52]!==U||e[53]!==K?(te=c.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[U,K]}),e[52]=U,e[53]=K,e[54]=te):te=e[54];let Z;e[55]!==H||e[56]!==te?(Z=c.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[H,te]}),e[55]=H,e[56]=te,e[57]=Z):Z=e[57];let ne;e[58]!==I||e[59]!==Z||e[60]!==E?(ne=c.jsxs("div",{className:"flex flex-col gap-6 px-3 pb-3 pt-7",children:[E,I,Z]}),e[58]=I,e[59]=Z,e[60]=E,e[61]=ne):ne=e[61];let z;e[62]!==ne||e[63]!==R?(z=c.jsxs(ms,{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:[R,ne]}),e[62]=ne,e[63]=R,e[64]=z):z=e[64];let q;return e[65]!==r||e[66]!==z?(q=c.jsx(gs,{open:!0,onOpenChange:r,children:z}),e[65]=r,e[66]=z,e[67]=q):q=e[67],q}let h;e[68]!==n||e[69]!==s?(h=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[68]=n,e[69]=s,e[70]=h):h=e[70];const p=h,m=!!n,y=p?.title;let b;e[71]!==y?(b=c.jsx(xs,{children:y}),e[71]=y,e[72]=b):b=e[72];const g=p?.description;let x;e[73]!==g?(x=c.jsx($o,{children:g}),e[73]=g,e[74]=x):x=e[74];let k;e[75]!==x||e[76]!==b?(k=c.jsxs(Mo,{children:[b,x]}),e[75]=x,e[76]=b,e[77]=k):k=e[77];let v;e[78]!==r?(v=()=>r(!1),e[78]=r,e[79]=v):v=e[79];let C;e[80]!==s?(C=s("taskBoard.subscriptionPaywall.dismissButton"),e[80]=s,e[81]=C):C=e[81];let j;e[82]!==v||e[83]!==C?(j=c.jsx(zo,{children:c.jsx(Fe,{variant:"ghost",onClick:v,children:C})}),e[82]=v,e[83]=C,e[84]=j):j=e[84];let S;e[85]!==k||e[86]!==j?(S=c.jsxs(ms,{className:"sm:max-w-[440px]",children:[k,j]}),e[85]=k,e[86]=j,e[87]=S):S=e[87];let T;return e[88]!==r||e[89]!==S||e[90]!==m?(T=c.jsx(gs,{open:m,onOpenChange:r,children:S}),e[88]=r,e[89]=S,e[90]=m,e[91]=T):T=e[91],T}const po=380,tg=90,go=5,ng="cubic-bezier(0.22, 0.61, 0.36, 1)";function sg(t,e,n){const r=w.useRef(new Map),s=w.useRef(new Map);w.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 C=a.get(x);if(!C)continue;const j=C.rect.left-k.left,S=C.rect.top-k.top;(j||S)&&f.push({el:g,dx:j,dy:S,lane:C.lane!==v})}if(!n||d||f.length===0)return;const u=s.current,h=g=>{g instanceof HTMLElement&&(u.set(g,(u.get(g)??0)+1),g.style.overflow="visible")},p=g=>{if(!(g instanceof HTMLElement))return;const x=(u.get(g)??1)-1;if(x>0){u.set(g,x);return}u.delete(g),g.style.overflow=""};for(const g of f){const x=g.lane?` rotate(${g.dx>0?go:-go}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",h(g.el.closest("[data-lane-scroll]")))}let m=0;const y=[],b=requestAnimationFrame(()=>{for(const g of f){const x=g.lane?m++*tg:0;g.el.style.transition=`transform ${po}ms ${ng} ${x}ms`,g.el.style.transform="",y.push(window.setTimeout(()=>{g.el.style.transition="",g.el.style.transform="",g.el.style.zIndex="",g.lane&&p(g.el.closest("[data-lane-scroll]"))},po+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&&p(g.el.closest("[data-lane-scroll]"))}},[e,t,n])}function rg(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 Hr="__unassigned__",rr={assignee:null,priority:null,due:null};function ig(t){return t.assignee!==null||t.priority!==null||t.due!==null}function og(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)}const lg=864e5;function ag(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 cg(t,e){if(e.assignee!==null){if(e.assignee===Hr){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"&&!ag(n,r)||e.due==="week"&&(n<r||n>r+7*lg))return!1}return!0}const mo={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function gr(t,e=!1){return ee("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 dg(t){const e=P.c(95),{value:n,members:r,onChange:s,block:i}=t,o=oe(),[l,a]=w.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(Ir,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let f=d,u;e[1]!==o?(u=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=u):u=e[2];let h=u;if(n===Hr){let z;e[3]!==o?(z=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=z):z=e[4],h=z}else if(n===Ze){let z;e[5]===Symbol.for("react.memo_cache_sentinel")?(z=c.jsx($t,{size:14}),e[5]=z):z=e[5],f=z;let q;e[6]!==o?(q=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=q):q=e[7],h=q}else if(n){let z,q,W,re;if(e[8]!==r||e[9]!==n){let se;e[14]!==n?(se=ce=>ce.userId===n,e[14]=n,e[15]=se):se=e[15],q=r.find(se),z=It,W=q?.user?.image??void 0,re=Et(q?.user?.name),e[8]=r,e[9]=n,e[10]=z,e[11]=q,e[12]=W,e[13]=re}else z=e[10],q=e[11],W=e[12],re=e[13];let M;e[16]!==z||e[17]!==W||e[18]!==re?(M=c.jsx(z,{url:W,fallback:re,shape:"circle",size:"2xs"}),e[16]=z,e[17]=W,e[18]=re,e[19]=M):M=e[19],f=M;let J;e[20]!==q?.user?.name||e[21]!==o?(J=q?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=q?.user?.name,e[21]=o,e[22]=J):J=e[22],h=J}let p;e[23]!==s?(p=z=>{s(z),a(!1)},e[23]=s,e[24]=p):p=e[24];const m=p,y=n!==null;let b;e[25]!==i||e[26]!==y?(b=gr(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=ee("shrink-0 opacity-60",x),e[28]=x,e[29]=k):k=e[29];const v=k;let C;e[30]!==h?(C=c.jsx("span",{className:"max-w-[10rem] truncate",children:h}),e[30]=h,e[31]=C):C=e[31];let j;e[32]!==v?(j=c.jsx(ni,{size:12,className:v}),e[32]=v,e[33]=j):j=e[33];let S;e[34]!==f||e[35]!==C||e[36]!==j||e[37]!==g?(S=c.jsx(Kn,{asChild:!0,children:c.jsxs("button",{type:"button",className:g,children:[f,C,j]})}),e[34]=f,e[35]=C,e[36]=j,e[37]=g,e[38]=S):S=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(Zr,{placeholder:T,className:"h-9"}),e[41]=T,e[42]=D):D=e[42];let R;e[43]!==o?(R=o("taskBoard.taskFilters.assigneeNoMembersFound"),e[43]=o,e[44]=R):R=e[44];let N;e[45]!==R?(N=c.jsx(Jr,{children:R}),e[45]=R,e[46]=N):N=e[46];let E;e[47]!==m?(E=()=>m(null),e[47]=m,e[48]=E):E=e[48];let $;e[49]!==o?($=o("taskBoard.taskFilters.assigneeAnyone"),e[49]=o,e[50]=$):$=e[50];let I;e[51]!==E||e[52]!==$?(I=c.jsx(Vt,{value:"Anyone",onSelect:E,children:$}),e[51]=E,e[52]=$,e[53]=I):I=e[53];let O;e[54]!==m?(O=()=>m(Hr),e[54]=m,e[55]=O):O=e[55];let _;e[56]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx(Ir,{size:16,className:"text-muted-foreground"}),e[56]=_):_=e[56];let A;e[57]!==o?(A=o("taskBoard.taskFilters.assigneeUnassigned"),e[57]=o,e[58]=A):A=e[58];let B;e[59]!==O||e[60]!==A?(B=c.jsxs(Vt,{value:"Unassigned",onSelect:O,className:"gap-2",children:[_,A]}),e[59]=O,e[60]=A,e[61]=B):B=e[61];let H;e[62]!==m?(H=()=>m(Ze),e[62]=m,e[63]=H):H=e[63];let V;e[64]===Symbol.for("react.memo_cache_sentinel")?(V=c.jsx($t,{size:16}),e[64]=V):V=e[64];let F;e[65]!==o?(F=o("taskBoard.taskFilters.assigneeSuperAgent"),e[65]=o,e[66]=F):F=e[66];let U;e[67]!==H||e[68]!==F?(U=c.jsxs(Vt,{value:"Super Agent",onSelect:H,className:"gap-2",children:[V,F]}),e[67]=H,e[68]=F,e[69]=U):U=e[69];let G;e[70]!==I||e[71]!==B||e[72]!==U?(G=c.jsxs(Gn,{children:[I,B,U]}),e[70]=I,e[71]=B,e[72]=U,e[73]=G):G=e[73];let Q;e[74]!==o?(Q=o("taskBoard.taskFilters.assigneeGroupMembers"),e[74]=o,e[75]=Q):Q=e[75];let X;if(e[76]!==r||e[77]!==m){let z;e[79]!==m?(z=q=>c.jsxs(Vt,{value:q.user?.name??q.userId,onSelect:()=>m(q.userId),className:"gap-2",children:[c.jsx(It,{url:q.user?.image??void 0,fallback:Et(q.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:q.user?.name??q.userId})]},q.userId),e[79]=m,e[80]=z):z=e[80],X=r.map(z),e[76]=r,e[77]=m,e[78]=X}else X=e[78];let K;e[81]!==Q||e[82]!==X?(K=c.jsx(Gn,{heading:Q,children:X}),e[81]=Q,e[82]=X,e[83]=K):K=e[83];let te;e[84]!==N||e[85]!==G||e[86]!==K?(te=c.jsxs(ei,{children:[N,G,K]}),e[84]=N,e[85]=G,e[86]=K,e[87]=te):te=e[87];let Z;e[88]!==D||e[89]!==te?(Z=c.jsx(cs,{align:"start",className:"w-56 p-0",children:c.jsxs(ti,{children:[D,te]})}),e[88]=D,e[89]=te,e[90]=Z):Z=e[90];let ne;return e[91]!==l||e[92]!==S||e[93]!==Z?(ne=c.jsxs(ds,{open:l,onOpenChange:a,children:[S,Z]}),e[91]=l,e[92]=S,e[93]=Z,e[94]=ne):ne=e[94],ne}function ug(t){const e=P.c(33),{value:n,onChange:r,block:s}=t,i=oe(),o=n!==null;let l;e[0]!==s||e[1]!==o?(l=gr(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=ee("shrink-0 opacity-60",d),e[3]=d,e[4]=f):f=e[4];const u=f;let h;e[5]!==n?(h=n?c.jsx("span",{className:ee("size-2 shrink-0 rounded-full",Rt[n].dotClassName)}):c.jsx(zc,{size:14,className:"shrink-0"}),e[5]=n,e[6]=h):h=e[6];let p;e[7]!==i||e[8]!==n?(p=i(n?Rt[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=i,e[8]=n,e[9]=p):p=e[9];let m;e[10]!==u?(m=c.jsx(ni,{size:12,className:u}),e[10]=u,e[11]=m):m=e[11];let y;e[12]!==h||e[13]!==p||e[14]!==m||e[15]!==a?(y=c.jsx(sn,{asChild:!0,children:c.jsxs("button",{type:"button",className:a,children:[h,p,m]})}),e[12]=h,e[13]=p,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(St,{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=hi.map(j=>c.jsxs(St,{onSelect:()=>r(j),className:"gap-2",children:[c.jsx("span",{className:ee("size-2 rounded-full",Rt[j].dotClassName)}),i(Rt[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(rn,{align:"start",className:"w-40",children:[x,k]}),e[27]=x,e[28]=k,e[29]=v):v=e[29];let C;return e[30]!==v||e[31]!==y?(C=c.jsxs(on,{children:[y,v]}),e[30]=v,e[31]=y,e[32]=C):C=e[32],C}function fg(t){const e=P.c(35),{value:n,onChange:r,block:s}=t,i=oe();let o;e[0]!==i||e[1]!==n?(o=n?i(mo[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=gr(a,s),e[3]=s,e[4]=a,e[5]=d):d=e[5];const f=d,u=s&&"ml-auto";let h;e[6]!==u?(h=ee("shrink-0 opacity-60",u),e[6]=u,e[7]=h):h=e[7];const p=h;let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Wn,{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]!==p?(b=c.jsx(ni,{size:12,className:p}),e[12]=p,e[13]=b):b=e[13];let g;e[14]!==y||e[15]!==b||e[16]!==f?(g=c.jsx(sn,{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(Wn,{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 C;e[23]!==x||e[24]!==v?(C=c.jsxs(St,{onSelect:x,className:"gap-2",children:[k,v]}),e[23]=x,e[24]=v,e[25]=C):C=e[25];let j;e[26]!==r||e[27]!==i?(j=Object.entries(mo).map(D=>{const[R,N]=D,E=R==="overdue";return c.jsxs(St,{onSelect:()=>r(R),className:ee("gap-2",E&&"text-destructive"),children:[c.jsx(Wn,{size:16,className:ee("shrink-0",E?"text-destructive":"text-muted-foreground")}),i(N)]},R)}),e[26]=r,e[27]=i,e[28]=j):j=e[28];let S;e[29]!==C||e[30]!==j?(S=c.jsxs(rn,{align:"start",className:"w-44",children:[C,j]}),e[29]=C,e[30]=j,e[31]=S):S=e[31];let T;return e[32]!==S||e[33]!==g?(T=c.jsxs(on,{children:[g,S]}),e[32]=S,e[33]=g,e[34]=T):T=e[34],T}function ca(t){const e=P.c(26),{filters:n,members:r,onChange:s,block:i}=t;let o;e[0]!==n||e[1]!==s?(o=p=>s({...n,assignee:p}),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(dg,{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=p=>s({...n,priority:p}),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(ug,{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=p=>s({...n,due:p}),e[15]=n,e[16]=s,e[17]=f):f=e[17];let u;e[18]!==i||e[19]!==n.due||e[20]!==f?(u=c.jsx(fg,{block:i,value:n.due,onChange:f}),e[18]=i,e[19]=n.due,e[20]=f,e[21]=u):u=e[21];let h;return e[22]!==l||e[23]!==d||e[24]!==u?(h=c.jsxs(c.Fragment,{children:[l,d,u]}),e[22]=l,e[23]=d,e[24]=u,e[25]=h):h=e[25],h}function hg(t){const e=P.c(12),{filters:n,members:r,onChange:s}=t,i=oe();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(tl,{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(ca,{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=ig(n)&&c.jsx("button",{type:"button",onClick:()=>s(rr),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 pg(t){const e=P.c(38),{filters:n,members:r,onChange:s}=t,i=oe(),[o,l]=w.useState(!1),a=og(n),d=a>0;let f;e[0]!==d?(f=gr(d),e[0]=d,e[1]=f):f=e[1];const u=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(tl,{size:14,className:"shrink-0"}),e[2]=h):h=e[2];let p;e[3]!==i?(p=i("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=i,e[4]=p):p=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]!==p||e[8]!==m||e[9]!==u?(y=c.jsx(_c,{asChild:!0,children:c.jsxs("button",{type:"button",className:u,children:[h,p,m]})}),e[7]=p,e[8]=m,e[9]=u,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(Ac,{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(ca,{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(Fe,{variant:"outline",className:"flex-1",onClick:()=>s(rr),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 C;e[25]!==v?(C=c.jsx(Bc,{asChild:!0,children:c.jsx(Fe,{className:"flex-1",children:v})}),e[25]=v,e[26]=C):C=e[26];let j;e[27]!==k||e[28]!==C?(j=c.jsxs(Oc,{className:"flex-row gap-2",children:[k,C]}),e[27]=k,e[28]=C,e[29]=j):j=e[29];let S;e[30]!==j||e[31]!==g||e[32]!==x?(S=c.jsxs($c,{className:"p-0",children:[g,x,j]}),e[30]=j,e[31]=g,e[32]=x,e[33]=S):S=e[33];let T;return e[34]!==o||e[35]!==S||e[36]!==y?(T=c.jsxs(Mc,{open:o,onOpenChange:l,direction:"bottom",children:[y,S]}),e[34]=o,e[35]=S,e[36]=y,e[37]=T):T=e[37],T}Sa(()=>import("./index-CM5jFPpd.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])).catch(()=>{});function gg(){const t=P.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(ga,{})})})}),t[0]=e):e=t[0],e}const mg=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function xg(t){const e=new Date(t),n=e.getTime()<Date.now();return{label:mg.format(e),overdue:n}}const Rs="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 da(){const t=P.c(9),e=oe();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=ee(Rs,"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(Vr,{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 ua(t){const e=P.c(10),{priority:n}=t,r=oe(),s=Rt[n];let i;e[0]!==s.dotClassName?(i=ee("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:Rs,children:[o,l]}),e[7]=o,e[8]=l,e[9]=a):a=e[9],a}function fa(t){const e=P.c(7),{iso:n}=t;let r,s;if(e[0]!==n){const{label:l,overdue:a}=xg(n);r=l,s=ee(Rs,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(Wn,{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 ha(t){const e=P.c(7),{tag:n}=t;let r;e[0]!==n.color?(r=Ns(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:Rs,children:[s,n.name]}),e[4]=s,e[5]=n.name,e[6]=i):i=e[6],i}function pa(t){const e=P.c(32),{item:n,assignee:r,assignedBy:s,members:i,onAssign:o}=t,l=oe(),[a,d]=w.useState(!1);if(n.assigneeId===Ze){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(It,{url:s.user?.image??void 0,fallback:Et(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($t,{size:20,className:"ring-2 ring-background"}),e[5]=v):v=e[5];let C;return e[6]!==x||e[7]!==k?(C=c.jsxs("span",{className:"inline-flex items-center",title:x,children:[k,v]}),e[6]=x,e[7]=k,e[8]=C):C=e[8],C}if(r){const x=r.user?.image??void 0,k=r.user?.name;let v;e[9]!==k?(v=Et(k),e[9]=k,e[10]=v):v=e[10];let C;return e[11]!==x||e[12]!==v?(C=c.jsx(It,{url:x,fallback:v,shape:"circle",size:"xs"}),e[11]=x,e[12]=v,e[13]=C):C=e[13],C}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 u;e[16]!==l?(u=l("taskBoard.taskBoard.assignButton"),e[16]=l,e[17]=u):u=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=x=>{x.stopPropagation(),d(!0)},e[18]=h):h=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Eo,{size:13}),e[19]=p):p=e[19];let m;e[20]!==f||e[21]!==u?(m=c.jsx(Kn,{asChild:!0,children:c.jsx("button",{type:"button",title:f,"aria-label":u,onClick:h,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:p})}),e[20]=f,e[21]=u,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(cs,{className:"w-56 p-0",align:"end",side:"bottom",onClick:bg,children:c.jsx(Ti,{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(ds,{open:a,onOpenChange:d,children:[m,b]}),e[28]=a,e[29]=m,e[30]=b,e[31]=g):g=e[31],g}function bg(t){return t.stopPropagation()}function ga(){const t=P.c(131),e=oe(),{items:n,isLoading:r}=xf(),s=bf(),i=Dc(),o=Wa({slug:"mcp-github"})??[];let l;t[0]!==o?(l=o.some(Sg),t[0]=o,t[1]=l):l=t[1];const a=l,[d,f]=w.useState(!1),[u,h]=w.useState(!1);let p;t[2]!==a?(p=L=>L===Ze&&!a?(f(!0),!0):!1,t[2]=a,t[3]=p):p=t[3];const m=p,[y,b]=w.useState(null);let g;t[4]===Symbol.for("react.memo_cache_sentinel")?(g=L=>{const ie=Uc(L);ie&&b(ie)},t[4]=g):g=t[4];const x=g,{data:k}=Lo();let v,C;t[5]!==k?.data?.members?(v=k?.data?.members??[],C=new Map(v.map(wg)),t[5]=k?.data?.members,t[6]=v,t[7]=C):(v=t[6],C=t[7]);const j=C,[S,T]=w.useState("board"),[D,R]=w.useState(rr);let N;t[8]===Symbol.for("react.memo_cache_sentinel")?(N=new Set,t[8]=N):N=t[8];const[E,$]=w.useState(N);let I;t[9]===Symbol.for("react.memo_cache_sentinel")?(I=L=>$(ie=>{const ge=new Set(ie);return ge.has(L)?ge.delete(L):ge.add(L),ge}),t[9]=I):I=t[9];const O=I,_=L=>$(ie=>{const ge=new Set(ie);for(const qe of Se)qe.status===L&&ge.add(qe.id);return ge});let A;t[10]===Symbol.for("react.memo_cache_sentinel")?(A=()=>$(new Set),t[10]=A):A=t[10];const B=A,[H,V]=w.useState(!1),[F,U]=w.useState(null),[G,Q]=w.useState(null),{setTaskId:X}=Lc(),{create:K}=Pc(),te=Jt(),{org:Z,locator:ne}=Be(),z=Ro();let q;t[11]===Symbol.for("react.memo_cache_sentinel")?(q={strict:!1},t[11]=q):q=t[11];const{task:W}=wa(q);let re;t[12]!==W||t[13]!==n?(re=W?n.find(L=>L.id===W)??null:null,t[12]=W,t[13]=n,t[14]=re):re=t[14];const M=re;let J;t[15]!==W||t[16]!==z||t[17]!==Z?(J=()=>{W&&z({to:"/$org/board",params:{org:Z.slug},search:{},replace:!0})},t[15]=W,t[16]=z,t[17]=Z,t[18]=J):J=t[18];const se=J;let ce;t[19]!==s||t[20]!==K||t[21]!==ne||t[22]!==Z||t[23]!==X||t[24]!==te?(ce=async L=>{const ie=crypto.randomUUID(),ge=Ua(Z.id).id,qe=await te.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:L.id}).then(vg).catch(kg),ut=rg(L,qe),jt={type:"doc",content:[{type:"paragraph",content:[Cc({id:L.id,name:L.title,char:"@",kind:"task",metadata:{title:L.title,description:L.description,context:ut}}),{type:"text",text:" "}]}]};Kc(sessionStorage,ne,ie,jt),V(!1);try{await K({id:ie,virtual_mcp_id:ge}),await s.link.mutateAsync({id:L.id,linkThreadId:ie})}catch{}X(ie,ge)},t[19]=s,t[20]=K,t[21]=ne,t[22]=Z,t[23]=X,t[24]=te,t[25]=ce):ce=t[25];const we=ce;let me;t[26]!==D?(me=L=>cg(L,D),t[26]=D,t[27]=me):me=t[27];const Se=n.filter(me);let fe;t[28]===Symbol.for("react.memo_cache_sentinel")?(fe=()=>{U(null),Q(null),V(!0)},t[28]=fe):fe=t[28];const tt=fe;let Ee;t[29]===Symbol.for("react.memo_cache_sentinel")?(Ee=L=>{U(null),Q(L),V(!0)},t[29]=Ee):Ee=t[29];const Lt=Ee;let Ve;t[30]===Symbol.for("react.memo_cache_sentinel")?(Ve=L=>{U(L),V(!0)},t[30]=Ve):Ve=t[30];const xe=Ve;let Ue;t[31]!==M||t[32]!==F||t[33]!==n?(Ue=(F&&n.find(L=>L.id===F.id))??F??M,t[31]=M,t[32]=F,t[33]=n,t[34]=Ue):Ue=t[34];const he=Ue,dt=H||!!M;let Oe;t[35]!==se?(Oe=()=>{V(!1),U(null),Q(null),se()},t[35]=se,t[36]=Oe):Oe=t[36];const Ce=Oe;if(r&&n.length===0){let L;return t[37]===Symbol.for("react.memo_cache_sentinel")?(L=c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(ir,{size:20,className:"animate-spin text-muted-foreground"})}),t[37]=L):L=t[37],L}const Pt="relative flex min-h-0 flex-1 flex-col";let nt;t[38]!==e?(nt=e("taskBoard.taskBoard.tasksTitle"),t[38]=e,t[39]=nt):nt=t[39];let Ke;t[40]!==nt?(Ke=c.jsx("h1",{className:"text-xl font-medium text-foreground",children:nt}),t[40]=nt,t[41]=Ke):Ke=t[41];let Ge;t[42]!==i?(Ge=i&&c.jsx(Zp,{}),t[42]=i,t[43]=Ge):Ge=t[43];let st;t[44]!==D||t[45]!==n.length||t[46]!==v?(st=n.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sm:hidden",children:c.jsx(pg,{filters:D,members:v,onChange:R})}),c.jsx("div",{className:"hidden sm:block",children:c.jsx(hg,{filters:D,members:v,onChange:R})})]}),t[44]=D,t[45]=n.length,t[46]=v,t[47]=st):st=t[47];const pt=S==="list";let rt;t[48]!==B?(rt=()=>{T("list"),B()},t[48]=B,t[49]=rt):rt=t[49];let it;t[50]!==e?(it=e("common.taskBoard.listView"),t[50]=e,t[51]=it):it=t[51];let ot;t[52]!==pt||t[53]!==rt||t[54]!==it?(ot=c.jsx(xo,{active:pt,onClick:rt,icon:_o,label:it}),t[52]=pt,t[53]=rt,t[54]=it,t[55]=ot):ot=t[55];const de=S==="board";let be;t[56]===Symbol.for("react.memo_cache_sentinel")?(be=()=>T("board"),t[56]=be):be=t[56];let ye;t[57]!==e?(ye=e("common.taskBoard.boardView"),t[57]=e,t[58]=ye):ye=t[58];let Ne;t[59]!==de||t[60]!==ye?(Ne=c.jsx(xo,{active:de,onClick:be,icon:Oa,label:ye}),t[59]=de,t[60]=ye,t[61]=Ne):Ne=t[61];let ve;t[62]!==ot||t[63]!==Ne?(ve=c.jsxs("div",{className:"inline-flex rounded-lg bg-muted p-0.5",children:[ot,Ne]}),t[62]=ot,t[63]=Ne,t[64]=ve):ve=t[64];let je;t[65]===Symbol.for("react.memo_cache_sentinel")?(je=c.jsx(ps,{size:16}),t[65]=je):je=t[65];let De;t[66]!==e?(De=e("taskBoard.taskBoard.newTask"),t[66]=e,t[67]=De):De=t[67];let $e;t[68]!==De?($e=c.jsxs(Fe,{size:"sm",onClick:tt,children:[je,De]}),t[68]=De,t[69]=$e):$e=t[69];let pe;t[70]!==ve||t[71]!==$e?(pe=c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[ve,$e]}),t[70]=ve,t[71]=$e,t[72]=pe):pe=t[72];let Ae;t[73]!==st||t[74]!==pe?(Ae=c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[st,pe]}),t[73]=st,t[74]=pe,t[75]=Ae):Ae=t[75];let Re;t[76]!==Ke||t[77]!==Ge||t[78]!==Ae?(Re=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:[Ke,Ge,Ae]}),t[76]=Ke,t[77]=Ge,t[78]=Ae,t[79]=Re):Re=t[79];const Me=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")})}):Se.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(Fe,{variant:"outline",size:"sm",onClick:()=>R(rr),children:e("taskBoard.taskBoard.clearFilters")})]})}):S==="board"?c.jsx(Tg,{items:Se,members:v,memberByUserId:j,selectedIds:E,onToggleSelect:O,onSelectAllInLane:_,onOpen:xe,onCreate:Lt,onMove:(L,ie,ge)=>{const qe=Il(ge,L.length);L.forEach((ut,jt)=>s.update.mutate({id:ut,status:ie,sortOrder:qe[jt]}))},onAssign:(L,ie)=>{m(ie)||s.update.mutate({id:L,assigneeId:ie},{onError:x})},onAutoFix:i?L=>{m(Ze)||s.update.mutate({id:L.id,assigneeId:Ze},{onError:x})}:void 0}):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:Se.map(L=>c.jsx(Og,{item:L,assignee:L.assigneeId?j.get(L.assigneeId):void 0,assignedBy:L.assignedBy?j.get(L.assignedBy):void 0,onOpen:()=>xe(L)},L.id))})}),Qe=dt?he?.id??`new-${G??"default"}`:"closed",Xe=he??void 0,ze=G??void 0,Ye=s.create.isPending||s.update.isPending;let We;t[80]!==s.create||t[81]!==s.update||t[82]!==he||t[83]!==m||t[84]!==Ce?(We=L=>{if(m(L.assigneeId)){Ce();return}if(he){const{title:ie,description:ge,priority:qe,...ut}=L,jt=Po(he)?{}:{title:ie,description:ge,priority:qe};s.update.mutate({id:he.id,...ut,...jt},{onError:x})}else s.create.mutate(L);Ce()},t[80]=s.create,t[81]=s.update,t[82]=he,t[83]=m,t[84]=Ce,t[85]=We):We=t[85];let gt;t[86]!==s.remove||t[87]!==he||t[88]!==Ce?(gt=he?()=>{s.remove.mutate(he.id),Ce()}:void 0,t[86]=s.remove,t[87]=he,t[88]=Ce,t[89]=gt):gt=t[89];let mt;t[90]!==he||t[91]!==we?(mt=he?()=>{we(he)}:void 0,t[90]=he,t[91]=we,t[92]=mt):mt=t[92];let xt;t[93]!==Ce||t[94]!==X?(xt=L=>{L.virtualMcpId&&(Ce(),X(L.threadId,L.virtualMcpId,{main:L.hasPreview?"preview":"board"}))},t[93]=Ce,t[94]=X,t[95]=xt):xt=t[95];let bt;t[96]!==Ce||t[97]!==dt||t[98]!==Qe||t[99]!==Xe||t[100]!==ze||t[101]!==Ye||t[102]!==We||t[103]!==gt||t[104]!==mt||t[105]!==xt?(bt=c.jsx(Sp,{open:dt,onClose:Ce,item:Xe,defaultStatus:ze,isSaving:Ye,onSubmit:We,onDelete:gt,onNewChat:mt,onOpenThread:xt},Qe),t[96]=Ce,t[97]=dt,t[98]=Qe,t[99]=Xe,t[100]=ze,t[101]=Ye,t[102]=We,t[103]=gt,t[104]=mt,t[105]=xt,t[106]=bt):bt=t[106];let Gt;t[107]===Symbol.for("react.memo_cache_sentinel")?(Gt=()=>h(!0),t[107]=Gt):Gt=t[107];let yt;t[108]!==d?(yt=c.jsx(Cg,{open:d,onOpenChange:f,onConnected:Gt}),t[108]=d,t[109]=yt):yt=t[109];let kt;t[110]!==u?(kt=c.jsx(Ha,{mode:"connection",open:u,onOpenChange:h}),t[110]=u,t[111]=kt):kt=t[111];let _t;t[112]===Symbol.for("react.memo_cache_sentinel")?(_t=L=>!L&&b(null),t[112]=_t):_t=t[112];let vt;t[113]!==y?(vt=c.jsx(eg,{kind:y,onOpenChange:_t}),t[113]=y,t[114]=vt):vt=t[114];let wt;t[115]!==s.removeMany||t[116]!==s.update||t[117]!==m||t[118]!==B||t[119]!==n||t[120]!==v||t[121]!==E?(wt=E.size>0&&c.jsx(jg,{count:E.size,members:v,onMoveTo:L=>{for(const ie of E)s.update.mutate({id:ie,status:L});B()},onSetPriority:L=>{for(const ie of E)s.update.mutate({id:ie,priority:L});B()},onAddTag:L=>{for(const ie of E){const ge=n.find(ut=>ut.id===ie);if(!ge)continue;const qe=ge.tags.map(yg);qe.includes(L)||s.update.mutate({id:ie,tagIds:[...qe,L]})}B()},onAssign:L=>{if(!m(L)){for(const ie of E)s.update.mutate({id:ie,assigneeId:L},{onError:x});B()}},onSetDueDate:L=>{const ie=oa(L);for(const ge of E)s.update.mutate({id:ge,dueDate:ie});B()},onAutoFix:E.size>0&&Array.from(E).every(L=>{const ie=n.find(ge=>ge.id===L);return ie&&(ie.status==="triage"||ie.status==="todo")&&ie.assigneeId!==Ze})?()=>{if(!m(Ze)){for(const L of E)s.update.mutate({id:L,assigneeId:Ze},{onError:x});B()}}:void 0,onDelete:()=>{s.removeMany.mutate(Array.from(E)),B()},onClear:B}),t[115]=s.removeMany,t[116]=s.update,t[117]=m,t[118]=B,t[119]=n,t[120]=v,t[121]=E,t[122]=wt):wt=t[122];let At;return t[123]!==Re||t[124]!==Me||t[125]!==bt||t[126]!==yt||t[127]!==kt||t[128]!==vt||t[129]!==wt?(At=c.jsxs("div",{className:Pt,children:[Re,Me,bt,yt,kt,vt,wt]}),t[123]=Re,t[124]=Me,t[125]=bt,t[126]=yt,t[127]=kt,t[128]=vt,t[129]=wt,t[130]=At):At=t[130],At}function yg(t){return t.id}function kg(){return[]}function vg(t){return t.prs}function wg(t){return[t.userId,t]}function Sg(t){return t.status==="active"&&Va(t)!==null}function Cg(t){const e=P.c(32),{open:n,onOpenChange:r,onConnected:s}=t,i=oe(),{connect:o,isConnecting:l}=Xu("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(Er,{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(xs,{children:d}),e[3]=d,e[4]=f):f=e[4];let u;e[5]!==i?(u=i("taskBoard.taskBoard.connectGithubDescription"),e[5]=i,e[6]=u):u=e[6];let h;e[7]!==u?(h=c.jsx($o,{children:u}),e[7]=u,e[8]=h):h=e[8];let p;e[9]!==f||e[10]!==h?(p=c.jsxs(Mo,{children:[f,h]}),e[9]=f,e[10]=h,e[11]=p):p=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(ir,{size:16,className:"animate-spin"}):c.jsx(Er,{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(zo,{children:c.jsxs(Fe,{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]!==p?(x=c.jsxs(ms,{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:[p,g]})]}),e[25]=g,e[26]=p,e[27]=x):x=e[27];let k;return e[28]!==r||e[29]!==n||e[30]!==x?(k=c.jsx(gs,{open:n,onOpenChange:r,children:x}),e[28]=r,e[29]=n,e[30]=x,e[31]=k):k=e[31],k}function jg(t){const e=P.c(91),{count:n,members:r,onMoveTo:s,onSetPriority:i,onAddTag:o,onAssign:l,onSetDueDate:a,onAutoFix:d,onDelete:f,onClear:u}=t,h=oe(),{data:p}=Fo();let m;e[0]!==p?(m=p===void 0?[]:p,e[0]=p,e[1]=m):m=e[1];const y=m;let b;e[2]!==n||e[3]!==h?(b=h("taskBoard.taskBoard.selectedCount",{count:n}),e[2]=n,e[3]=h,e[4]=b):b=e[4];let g;e[5]!==b?(g=c.jsx("span",{className:"pl-1 text-sm font-medium text-foreground",children:b}),e[5]=b,e[6]=g):g=e[6];let x;e[7]!==h?(x=h("taskBoard.taskBoard.actionsButton"),e[7]=h,e[8]=x):x=e[8];let k;e[9]!==x?(k=c.jsx(sn,{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:x})}),e[9]=x,e[10]=k):k=e[10];let v;e[11]!==h?(v=h("taskBoard.taskBoard.moveToButton"),e[11]=h,e[12]=v):v=e[12];let C;e[13]!==v?(C=c.jsx(es,{children:v}),e[13]=v,e[14]=C):C=e[14];let j;e[15]!==s||e[16]!==h?(j=Js.map(M=>c.jsx(St,{onClick:()=>s(M),children:h(Dt[M].labelKey)},M)),e[15]=s,e[16]=h,e[17]=j):j=e[17];let S;e[18]!==j?(S=c.jsx(ts,{children:j}),e[18]=j,e[19]=S):S=e[19];let T;e[20]!==S||e[21]!==C?(T=c.jsxs(Jn,{children:[C,S]}),e[20]=S,e[21]=C,e[22]=T):T=e[22];let D;e[23]!==h?(D=h("taskBoard.taskBoard.changePriorityButton"),e[23]=h,e[24]=D):D=e[24];let R;e[25]!==D?(R=c.jsx(es,{children:D}),e[25]=D,e[26]=R):R=e[26];let N;e[27]!==i||e[28]!==h?(N=hi.map(M=>c.jsxs(St,{onClick:()=>i(M),children:[c.jsx("span",{className:ee("size-2 rounded-full",Rt[M].dotClassName)}),h(Rt[M].labelKey)]},M)),e[27]=i,e[28]=h,e[29]=N):N=e[29];let E;e[30]!==N?(E=c.jsx(ts,{children:N}),e[30]=N,e[31]=E):E=e[31];let $;e[32]!==R||e[33]!==E?($=c.jsxs(Jn,{children:[R,E]}),e[32]=R,e[33]=E,e[34]=$):$=e[34];let I;e[35]!==h?(I=h("taskBoard.taskBoard.assignButton"),e[35]=h,e[36]=I):I=e[36];let O;e[37]!==I?(O=c.jsx(es,{children:I}),e[37]=I,e[38]=O):O=e[38];let _;e[39]!==r||e[40]!==l?(_=c.jsx(ts,{className:"w-56 p-0",children:c.jsx(Ti,{members:r,onSelect:l})}),e[39]=r,e[40]=l,e[41]=_):_=e[41];let A;e[42]!==O||e[43]!==_?(A=c.jsxs(Jn,{children:[O,_]}),e[42]=O,e[43]=_,e[44]=A):A=e[44];let B;e[45]!==h?(B=h("taskBoard.taskBoard.dueDateButton"),e[45]=h,e[46]=B):B=e[46];let H;e[47]!==B?(H=c.jsx(es,{children:B}),e[47]=B,e[48]=H):H=e[48];let V;e[49]!==a?(V=c.jsx(ts,{className:"w-auto p-0",children:c.jsx(Qo,{mode:"single",onSelect:M=>M&&a(M),initialFocus:!0})}),e[49]=a,e[50]=V):V=e[50];let F;e[51]!==H||e[52]!==V?(F=c.jsxs(Jn,{children:[H,V]}),e[51]=H,e[52]=V,e[53]=F):F=e[53];let U;e[54]!==o||e[55]!==y||e[56]!==h?(U=y.length>0&&c.jsxs(Jn,{children:[c.jsx(es,{children:h("taskBoard.taskBoard.addTagButton")}),c.jsx(ts,{children:y.map(M=>c.jsxs(St,{onClick:()=>o(M.id),children:[c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:Ns(M.color)}}),M.name]},M.id))})]}),e[54]=o,e[55]=y,e[56]=h,e[57]=U):U=e[57];let G;e[58]===Symbol.for("react.memo_cache_sentinel")?(G=c.jsx(Ao,{}),e[58]=G):G=e[58];let Q;e[59]!==h?(Q=h("taskBoard.taskBoard.deleteSelectedButton"),e[59]=h,e[60]=Q):Q=e[60];let X;e[61]!==f||e[62]!==Q?(X=c.jsx(St,{variant:"destructive",onClick:f,children:Q}),e[61]=f,e[62]=Q,e[63]=X):X=e[63];let K;e[64]!==T||e[65]!==$||e[66]!==A||e[67]!==F||e[68]!==U||e[69]!==X?(K=c.jsxs(rn,{align:"center",side:"top",children:[T,$,A,F,U,G,X]}),e[64]=T,e[65]=$,e[66]=A,e[67]=F,e[68]=U,e[69]=X,e[70]=K):K=e[70];let te;e[71]!==K||e[72]!==k?(te=c.jsxs(on,{children:[k,K]}),e[71]=K,e[72]=k,e[73]=te):te=e[73];let Z;e[74]!==d||e[75]!==h?(Z=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(Gr,{size:14}),h("taskBoard.taskBoard.autoFix")]}),e[74]=d,e[75]=h,e[76]=Z):Z=e[76];let ne;e[77]!==h?(ne=h("taskBoard.taskBoard.clearSelectionButton"),e[77]=h,e[78]=ne):ne=e[78];let z;e[79]!==h?(z=h("taskBoard.taskBoard.clearSelectionButton"),e[79]=h,e[80]=z):z=e[80];let q;e[81]===Symbol.for("react.memo_cache_sentinel")?(q=c.jsx(nn,{size:16}),e[81]=q):q=e[81];let W;e[82]!==u||e[83]!==ne||e[84]!==z?(W=c.jsx("button",{type:"button","aria-label":ne,title:z,onClick:u,className:"flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:q}),e[82]=u,e[83]=ne,e[84]=z,e[85]=W):W=e[85];let re;return e[86]!==te||e[87]!==Z||e[88]!==W||e[89]!==g?(re=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:[g,te,Z,W]})}),e[86]=te,e[87]=Z,e[88]=W,e[89]=g,e[90]=re):re=e[90],re}function xo(t){const e=P.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=ee("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 u;return e[7]!==n||e[8]!==i||e[9]!==r||e[10]!==l||e[11]!==d||e[12]!==f?(u=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]=u):u=e[13],u}const as="lane:";function bo(t,e){return t.sortOrder-e.sortOrder}function Tg(t){const e=P.c(30),{items:n,members:r,memberByUserId:s,selectedIds:i,onToggleSelect:o,onSelectAllInLane:l,onOpen:a,onCreate:d,onMove:f,onAutoFix:u,onAssign:h}=t,[p,m]=w.useState(null);let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[b,g]=w.useState(y);let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=new Map,e[1]=x):x=e[1];const[k,v]=w.useState(x),C=w.useRef(null),j=k.size>0?n.map(M=>{const J=k.get(M.id);return J?{...M,...J}:M}):n;if(k.size>0&&!p){const M=[...k].filter(J=>{const[se,ce]=J,we=n.find(me=>me.id===se);return we?.status===ce.status&&we.sortOrder===ce.sortOrder});M.length>0&&v(J=>{const se=new Map(J);for(const[ce]of M)se.delete(ce);return se})}sg(C,j.map(Eg).join(","),p===null);const S=M=>j.filter(J=>J.status===M).sort(bo),T=M=>{if(M===void 0)return null;const J=String(M);if(J.startsWith(as)){const se=J.slice(as.length);return Js.find(ce=>ce===se)??null}return j.find(se=>se.id===J)?.status??null};let D;e[2]!==i?(D=M=>i.has(M)&&i.size>1?[M,...Array.from(i).filter(J=>J!==M)]:[M],e[2]=i,e[3]=D):D=e[3];const R=D;let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=(M,J,se)=>{const ce=Il(se,M.length);v(we=>{const me=new Map(we);return M.forEach((Se,fe)=>me.set(Se,{status:J,sortOrder:ce[fe]})),me})},e[4]=N):N=e[4];const E=N;let $;e[5]===Symbol.for("react.memo_cache_sentinel")?($={activationConstraint:{distance:4}},e[5]=$):$=e[5];let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I={coordinateGetter:pf},e[6]=I):I=e[6];const O=Od(_i(ci,$),_i(li,I)),_=M=>{const J=String(M.active.id),se=T(M.over?.id),ce=j.find(fe=>fe.id===J);if(!se||!ce||ce.status===se)return;const we=R(J),me=String(M.over?.id??""),Se=S(se).filter(fe=>!we.includes(fe.id));E(we,se,Vi(Se,me.startsWith(as)?null:me,J))},A=M=>{const J=String(M.active.id);m(null);const se=T(M.over?.id)??j.find(Ie=>Ie.id===J)?.status;if(!se){v(new Map);return}const ce=R(J),we=S(se),me=String(M.over?.id??""),Se=we.findIndex(Ie=>Ie.id===J),fe=me.startsWith(as)?we.length-1:we.findIndex(Ie=>Ie.id===me),tt=Se===-1||fe===-1?we:ui(we,Se,fe);if(n.filter(Ie=>Ie.status===se).sort(bo).map(Rg).join()===tt.map(Dg).join()){v(new Map);return}const Lt=tt.slice(tt.findIndex(Ie=>Ie.id===J)+1).find(Ie=>!ce.includes(Ie.id)),Ve=Vi(we.filter(Ie=>!ce.includes(Ie.id)),Lt?.id??null,J);E(ce,se,Ve),g(ce),f(ce,se,Ve)},B=p?j.find(M=>M.id===p):null;let H;e[7]!==p||e[8]!==R?(H=p?R(p):[],e[7]=p,e[8]=R,e[9]=H):H=e[9];const V=H,F=Iu,U=al;let G;e[10]===Symbol.for("react.memo_cache_sentinel")?(G=M=>{m(String(M.active.id)),g([])},e[10]=G):G=e[10];let Q;e[11]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{m(null),v(new Map)},e[11]=Q):Q=e[11];const X=Js.map(M=>c.jsx(Ig,{status:M,items:S(M),members:r,memberByUserId:s,selectedIds:i,isTarget:B?.status===M,hiddenIds:V,landedIds:b,onToggleSelect:o,onSelectAllInLane:l,onOpen:a,onCreate:d,onAutoFix:u,onAssign:h},M));let K;e[12]!==X?(K=c.jsx("div",{ref:C,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:X})}),e[12]=X,e[13]=K):K=e[13];const te=Xt.createPortal,Z=Qu,ne=null,z=B&&c.jsxs("div",{className:"relative w-[292px] cursor-grabbing",children:[c.jsx(ma,{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:Ng,className:"w-full shadow-lg"}),V.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:V.length})]});let q;e[14]!==Z||e[15]!==z?(q=c.jsx(Z,{dropAnimation:ne,children:z}),e[14]=Z,e[15]=z,e[16]=q):q=e[16];let W;e[17]!==te||e[18]!==q?(W=te(q,document.body),e[17]=te,e[18]=q,e[19]=W):W=e[19];let re;return e[20]!==F||e[21]!==A||e[22]!==_||e[23]!==O||e[24]!==Q||e[25]!==K||e[26]!==W||e[27]!==U||e[28]!==G?(re=c.jsxs(F,{sensors:O,collisionDetection:U,onDragStart:G,onDragOver:_,onDragEnd:A,onDragCancel:Q,children:[K,W]}),e[20]=F,e[21]=A,e[22]=_,e[23]=O,e[24]=Q,e[25]=K,e[26]=W,e[27]=U,e[28]=G,e[29]=re):re=e[29],re}function Ng(){}function Dg(t){return t.id}function Rg(t){return t.id}function Eg(t){return`${t.id}:${t.status}`}function Ig(t){const e=P.c(91),{status:n,items:r,members:s,memberByUserId:i,selectedIds:o,isTarget:l,hiddenIds:a,landedIds:d,onToggleSelect:f,onSelectAllInLane:u,onOpen:h,onCreate:p,onAutoFix:m,onAssign:y}=t,b=oe(),g=Dt[n],x=g.icon,k=`${as}${n}`;let v;e[0]!==k?(v={id:k},e[0]=k,e[1]=v):v=e[1];const{setNodeRef:C}=jl(v),j=l&&"bg-muted/50";let S;e[2]!==j?(S=ee("flex h-full w-[300px] shrink-0 flex-col rounded-xl py-1 transition-colors",j),e[2]=j,e[3]=S):S=e[3];const T=l?"bg-muted":"bg-background";let D;e[4]!==T?(D=ee("sticky top-0 z-10 flex items-center gap-2 px-2 py-1.5 transition-colors",T),e[4]=T,e[5]=D):D=e[5];let R;e[6]!==g.iconClassName?(R=ee("shrink-0",g.iconClassName.replace(/\banimate-\S+\b/g,"").trim()),e[6]=g.iconClassName,e[7]=R):R=e[7];let N;e[8]!==x||e[9]!==R?(N=c.jsx(x,{size:15,className:R}),e[8]=x,e[9]=R,e[10]=N):N=e[10];let E;e[11]!==g.labelKey||e[12]!==b?(E=b(g.labelKey),e[11]=g.labelKey,e[12]=b,e[13]=E):E=e[13];let $;e[14]!==E?($=c.jsx("span",{className:"text-sm font-medium text-foreground",children:E}),e[14]=E,e[15]=$):$=e[15];let I;e[16]!==r.length?(I=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]=I):I=e[17];let O;e[18]!==g.labelKey||e[19]!==b?(O=b("taskBoard.taskBoard.laneMenuAriaLabel",{lane:b(g.labelKey)}),e[18]=g.labelKey,e[19]=b,e[20]=O):O=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx(Wr,{size:15}),e[21]=_):_=e[21];let A;e[22]!==O?(A=c.jsx(sn,{asChild:!0,children:c.jsx("button",{type:"button","aria-label":O,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:_})}),e[22]=O,e[23]=A):A=e[23];let B;e[24]!==u||e[25]!==n?(B=()=>u(n),e[24]=u,e[25]=n,e[26]=B):B=e[26];let H;e[27]!==b?(H=b("taskBoard.taskBoard.selectAllInLane"),e[27]=b,e[28]=H):H=e[28];let V;e[29]!==B||e[30]!==H?(V=c.jsx(rn,{align:"end",children:c.jsx(St,{onClick:B,children:H})}),e[29]=B,e[30]=H,e[31]=V):V=e[31];let F;e[32]!==A||e[33]!==V?(F=c.jsxs(on,{children:[A,V]}),e[32]=A,e[33]=V,e[34]=F):F=e[34];let U;e[35]!==g.labelKey||e[36]!==b?(U=b("taskBoard.taskBoard.newTaskInLaneAriaLabel",{lane:b(g.labelKey)}),e[35]=g.labelKey,e[36]=b,e[37]=U):U=e[37];let G;e[38]!==g.labelKey||e[39]!==b?(G=b("taskBoard.taskBoard.newTaskInLaneTitle",{lane:b(g.labelKey)}),e[38]=g.labelKey,e[39]=b,e[40]=G):G=e[40];let Q;e[41]!==p||e[42]!==n?(Q=()=>p(n),e[41]=p,e[42]=n,e[43]=Q):Q=e[43];let X;e[44]===Symbol.for("react.memo_cache_sentinel")?(X=c.jsx(ps,{size:15}),e[44]=X):X=e[44];let K;e[45]!==U||e[46]!==G||e[47]!==Q?(K=c.jsx("button",{type:"button","aria-label":U,title:G,onClick:Q,className:"flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:X}),e[45]=U,e[46]=G,e[47]=Q,e[48]=K):K=e[48];let te;e[49]!==$||e[50]!==I||e[51]!==F||e[52]!==K||e[53]!==D||e[54]!==N?(te=c.jsxs("div",{className:D,children:[N,$,I,F,K]}),e[49]=$,e[50]=I,e[51]=F,e[52]=K,e[53]=D,e[54]=N,e[55]=te):te=e[55];let Z;e[56]!==r?(Z=r.map(_g),e[56]=r,e[57]=Z):Z=e[57];let ne;if(e[58]!==a||e[59]!==r||e[60]!==d||e[61]!==i||e[62]!==s||e[63]!==y||e[64]!==m||e[65]!==h||e[66]!==f||e[67]!==o){let re;e[69]!==a||e[70]!==d||e[71]!==i||e[72]!==s||e[73]!==y||e[74]!==m||e[75]!==h||e[76]!==f||e[77]!==o?(re=M=>c.jsx(Ag,{item:M,assignee:M.assigneeId?i.get(M.assigneeId):void 0,assignedBy:M.assignedBy?i.get(M.assignedBy):void 0,members:s,selected:o.has(M.id),hidden:a.includes(M.id),landed:d.includes(M.id),onToggleSelect:()=>f(M.id),onOpen:()=>h(M),onAutoFix:m?()=>m(M):void 0,onAssign:y?J=>y(M.id,J):void 0},M.id),e[69]=a,e[70]=d,e[71]=i,e[72]=s,e[73]=y,e[74]=m,e[75]=h,e[76]=f,e[77]=o,e[78]=re):re=e[78],ne=r.map(re),e[58]=a,e[59]=r,e[60]=d,e[61]=i,e[62]=s,e[63]=y,e[64]=m,e[65]=h,e[66]=f,e[67]=o,e[68]=ne}else ne=e[68];let z;e[79]!==Z||e[80]!==ne?(z=c.jsx(sf,{items:Z,strategy:tf,children:ne}),e[79]=Z,e[80]=ne,e[81]=z):z=e[81];let q;e[82]!==C||e[83]!==n||e[84]!==z?(q=c.jsx("div",{ref:C,"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:z}),e[82]=C,e[83]=n,e[84]=z,e[85]=q):q=e[85];let W;return e[86]!==n||e[87]!==te||e[88]!==q||e[89]!==S?(W=c.jsxs("div",{"data-lane":n,className:S,children:[te,q]}),e[86]=n,e[87]=te,e[88]=q,e[89]=S,e[90]=W):W=e[90],W}function _g(t){return t.id}function Ag(t){const e=P.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:u,isDragging:h}=uf(o),p=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=ee("w-full",b),e[10]=b,e[11]=g):g=e[11];let x;e[12]!==f?(x=Zt.Translate.toString(f),e[12]=f,e[13]=x):x=e[13];const k=h||n?0:void 0;let v;e[14]!==x||e[15]!==k||e[16]!==u?(v={transform:x,transition:u,opacity:k},e[14]=x,e[15]=k,e[16]=u,e[17]=v):v=e[17];let C;e[18]!==r||e[19]!==i||e[20]!==d||e[21]!==y||e[22]!==g||e[23]!==v?(C=c.jsx(ma,{...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]=C):C=e[24];let j;return e[25]!==r.id||e[26]!==r.status||e[27]!==C?(j=c.jsx("div",{className:"flex","data-flip-id":p,"data-flip-lane":m,children:C}),e[25]=r.id,e[26]=r.status,e[27]=C,e[28]=j):j=e[28],j}function ma(t){const e=P.c(43),{item:n,assignee:r,assignedBy:s,members:i,selected:o,className:l,dragRef:a,bindings:d,style:f,onToggleSelect:u,onOpen:h,onAutoFix:p,onAssign:m}=t,y=oe(),b=Dt[n.status].icon,g=kf(n)?.lastMessage,x=p&&(n.status==="triage"||n.status==="todo")&&n.assigneeId!==Ze,k=d?.attributes,v=d?.listeners;let C;e[0]!==h||e[1]!==u?(C=B=>{B.shiftKey&&u?u():h()},e[0]=h,e[1]=u,e[2]=C):C=e[2];const j=o&&"bg-accent";let S;e[3]!==l||e[4]!==j?(S=ee("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",j,l),e[3]=l,e[4]=j,e[5]=S):S=e[5];const T=n.title;let D;e[6]!==n?(D=ee("mt-px shrink-0",fi(n)),e[6]=n,e[7]=D):D=e[7];let R;e[8]!==b||e[9]!==D?(R=c.jsx(b,{size:16,className:D}),e[8]=b,e[9]=D,e[10]=R):R=e[10];let N;e[11]!==n.title?(N=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]=N):N=e[12];let E;e[13]!==s||e[14]!==r||e[15]!==n||e[16]!==i||e[17]!==m?(E=c.jsx(pa,{item:n,assignee:r,assignedBy:s,members:i,onAssign:m}),e[13]=s,e[14]=r,e[15]=n,e[16]=i,e[17]=m,e[18]=E):E=e[18];let $;e[19]!==E||e[20]!==R||e[21]!==N?($=c.jsxs("div",{className:"flex items-start gap-2",children:[R,N,E]}),e[19]=E,e[20]=R,e[21]=N,e[22]=$):$=e[22];let I;e[23]!==g?(I=g&&c.jsx("p",{className:"line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground",children:g}),e[23]=g,e[24]=I):I=e[24];let O;e[25]!==n?(O=(Zs(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:[Zs(n)&&c.jsx(da,{}),n.priority!=="none"&&c.jsx(ua,{priority:n.priority}),n.dueDate&&c.jsx(fa,{iso:n.dueDate}),n.tags.map(Bg)]}),e[25]=n,e[26]=O):O=e[26];let _;e[27]!==p||e[28]!==x||e[29]!==y?(_=x&&c.jsxs("button",{type:"button",onClick:B=>{B.stopPropagation(),p()},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(Gr,{size:12}),y("taskBoard.taskBoard.autoFix")]}),e[27]=p,e[28]=x,e[29]=y,e[30]=_):_=e[30];let A;return e[31]!==a||e[32]!==n.title||e[33]!==f||e[34]!==k||e[35]!==$||e[36]!==I||e[37]!==O||e[38]!==_||e[39]!==v||e[40]!==C||e[41]!==S?(A=c.jsxs("button",{type:"button",ref:a,style:f,...k,...v,onClick:C,className:S,title:T,children:[$,I,O,_]}),e[31]=a,e[32]=n.title,e[33]=f,e[34]=k,e[35]=$,e[36]=I,e[37]=O,e[38]=_,e[39]=v,e[40]=C,e[41]=S,e[42]=A):A=e[42],A}function Bg(t){return c.jsx(ha,{tag:t},t.id)}function Og(t){const e=P.c(33),{item:n,assignee:r,assignedBy:s,onOpen:i}=t,o=Dt[n.status].icon;let l;e[0]!==n?(l=ee("shrink-0",fi(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=Zs(n)&&c.jsx(da,{}),e[7]=n,e[8]=f):f=e[8];let u;e[9]!==n.priority?(u=n.priority!=="none"&&c.jsx("span",{className:"hidden sm:inline-flex",children:c.jsx(ua,{priority:n.priority})}),e[9]=n.priority,e[10]=u):u=e[10];let h;e[11]!==n.dueDate?(h=n.dueDate&&c.jsx("span",{className:"hidden sm:inline-flex",children:c.jsx(fa,{iso:n.dueDate})}),e[11]=n.dueDate,e[12]=h):h=e[12];let p;e[13]!==n.tags?(p=n.tags.length>0&&c.jsxs("span",{className:"hidden items-center gap-1.5 sm:inline-flex",children:[n.tags.slice(0,2).map($g),n.tags.length>2&&c.jsxs("span",{className:Rs,children:["+",n.tags.length-2]})]}),e[13]=n.tags,e[14]=p):p=e[14];let m;e[15]!==s||e[16]!==r||e[17]!==n?(m=c.jsx(pa,{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=Qr(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]!==u||e[29]!==h||e[30]!==p||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,u,h,p,m,b]}),e[23]=i,e[24]=b,e[25]=a,e[26]=d,e[27]=f,e[28]=u,e[29]=h,e[30]=p,e[31]=m,e[32]=g):g=e[32],g}function $g(t){return c.jsx(ha,{tag:t},t.id)}const Zm=Object.freeze(Object.defineProperty({__proto__:null,TaskBoardPage:ga,default:gg},Symbol.toStringTag,{value:"Module"}));export{Tl as $,uf as A,pf as B,Zt as C,Iu as D,ui as E,xf as F,bf as G,_m as H,Dt as I,Rt as J,li as K,$t as L,ft as M,Gm as N,Mm as O,ci as P,Qm as Q,Ym as R,Jc as S,Sp as T,Lm as U,fd as V,zm as W,Um as X,Wm as Y,Pm as Z,ga as _,ed as a,Zm as a0,$m as b,Hm as c,qc as d,Bm as e,Km as f,hd as g,Vm as h,Vc as i,Fm as j,qm as k,bd as l,gd as m,kd as n,Od as o,_i as p,Qu as q,Am as r,Uc as s,Bu as t,Om as u,Xu as v,Kc as w,Xm as x,sf as y,tf as z};
|