decocms 4.171.1 → 4.172.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CVBpDPt3.js → AlertCircle-DFaoZGth.js} +1 -1
- package/dist/client/assets/{AreaChart-DRqJi-oC.js → AreaChart-CdZ8y87H.js} +1 -1
- package/dist/client/assets/{ArrowUp-tJZmmdK7.js → ArrowUp-C61gbXqo.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DTjFentG.js → ArrowUpRight-C7M_LNeh.js} +1 -1
- package/dist/client/assets/{Check-Lud1IobS.js → Check-CrXR5QtL.js} +1 -1
- package/dist/client/assets/{CheckCircle-Ae-02N2r.js → CheckCircle-BWRCZsN3.js} +1 -1
- package/dist/client/assets/{ChevronDown-BKhdv-8z.js → ChevronDown-B8QQkCNd.js} +1 -1
- package/dist/client/assets/{ChevronRight-BlCb8D0N.js → ChevronRight-ZvDjoDRP.js} +1 -1
- package/dist/client/assets/{ChevronUp-KTZvSLBR.js → ChevronUp-D4wwUmSO.js} +1 -1
- package/dist/client/assets/{Copy01-CgTEhwnm.js → Copy01-Bxep1ZC2.js} +1 -1
- package/dist/client/assets/{CpuChip01-C46Y3Otz.js → CpuChip01-CoURano2.js} +1 -1
- package/dist/client/assets/{DotsVertical-COvd9Arj.js → DotsVertical-CwViri6f.js} +1 -1
- package/dist/client/assets/{Eye-C9Ptq4he.js → Eye-B_jdRJgs.js} +1 -1
- package/dist/client/assets/{FilterLines-BUpbMgmA.js → FilterLines-DJvSrNJZ.js} +1 -1
- package/dist/client/assets/{HardDrive-DRW4e6iW.js → HardDrive-mRXyda97.js} +1 -1
- package/dist/client/assets/{Key01-aqgX7MKp.js → Key01-B4i-gjCR.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DHguNiuu.js → LayoutLeft-CDsVE7ZI.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B5rQOZBq.js → LinkExternal01-CFWNLxVb.js} +1 -1
- package/dist/client/assets/{LogOut01-Jva09SKI.js → LogOut01-IMp3Y2Ns.js} +1 -1
- package/dist/client/assets/{Monitor01-tbJfXgSN.js → Monitor01-BZdbLcqw.js} +1 -1
- package/dist/client/assets/{Palette-CRezm9eZ.js → Palette-BLBHbxj3.js} +1 -1
- package/dist/client/assets/{Play-CTlR0Pi-.js → Play-COx-RL1j.js} +1 -1
- package/dist/client/assets/{Plus-GR79fuvw.js → Plus-C-01xS2L.js} +1 -1
- package/dist/client/assets/{SearchLg-D1LOBTnW.js → SearchLg-BrsBc92t.js} +1 -1
- package/dist/client/assets/{SearchMd-BGkPQmmQ.js → SearchMd-B6AFInty.js} +1 -1
- package/dist/client/assets/{Settings02-CUAaVVIC.js → Settings02-CWrgv8tk.js} +1 -1
- package/dist/client/assets/{Shield01-BLtkImLk.js → Shield01-Chq1qwNK.js} +1 -1
- package/dist/client/assets/{Star01-B-b4uJAO.js → Star01-5msVwJW-.js} +1 -1
- package/dist/client/assets/{Stars01-DE1al-JT.js → Stars01-DAZqcDEZ.js} +1 -1
- package/dist/client/assets/{Stars02-pdk8gQRt.js → Stars02-80kwJrfw.js} +1 -1
- package/dist/client/assets/{Sun-DsTdjgsg.js → Sun-DOCBIRz7.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BwYC-3Pg.js → SwitchHorizontal01-ux3vbCoi.js} +1 -1
- package/dist/client/assets/{Tool01-d9ZKTWzl.js → Tool01-CfYmRAEf.js} +1 -1
- package/dist/client/assets/{Tool02-4we4UV7L.js → Tool02-C_dzRDkv.js} +1 -1
- package/dist/client/assets/{Trash01-BITjicwC.js → Trash01-BVuMwmUz.js} +1 -1
- package/dist/client/assets/{TrendUp01-AmsLyTIH.js → TrendUp01-DMmOb2g6.js} +1 -1
- package/dist/client/assets/{Upload01-ewIfaOYW.js → Upload01-DWSD88mj.js} +1 -1
- package/dist/client/assets/{User01-BO0Bx82i.js → User01-CsU5MfMu.js} +1 -1
- package/dist/client/assets/{Users01-CekplcKY.js → Users01-Q6OTyE8c.js} +1 -1
- package/dist/client/assets/{Users03-CHPQpsCk.js → Users03-AVLOfciM.js} +1 -1
- package/dist/client/assets/{X-BP98bjB9.js → X-CWc_ekdN.js} +1 -1
- package/dist/client/assets/{XCircle-C_CjdhjN.js → XCircle-AJko-lVE.js} +1 -1
- package/dist/client/assets/{XClose-BGGTFHJU.js → XClose-CEI8Rz0P.js} +1 -1
- package/dist/client/assets/{Zap-Ua0l464e.js → Zap-D3IzRhsD.js} +1 -1
- package/dist/client/assets/{ZapSquare-AVahmkwC.js → ZapSquare-Bc3zYUJA.js} +1 -1
- package/dist/client/assets/{access-gate-x-zfkSHD.js → access-gate-JYjpkqyI.js} +1 -1
- package/dist/client/assets/{add-section-modal-CSKj7obx.js → add-section-modal-quz9rqZr.js} +1 -1
- package/dist/client/assets/{agent-icon-izjCJSsn.js → agent-icon-BVNrPIs2.js} +1 -1
- package/dist/client/assets/{agents-list-DtoAy1lG.js → agents-list-lGesrPq9.js} +1 -1
- package/dist/client/assets/{ai-providers-CPCj8197.js → ai-providers-WJhdnetm.js} +1 -1
- package/dist/client/assets/{alert-DkERm3_Z.js → alert-BJCSC5E2.js} +1 -1
- package/dist/client/assets/{alert-dialog-DOCPJ4wz.js → alert-dialog-CCQ8grPT.js} +1 -1
- package/dist/client/assets/{app-editor-D8d4gmJ1.js → app-editor-GOOESsx3.js} +1 -1
- package/dist/client/assets/{auth-kpSkiHlu.js → auth-Ct1h8zXa.js} +1 -1
- package/dist/client/assets/{auth-catchall-k6tvqUSu.js → auth-catchall-CLyUAKiH.js} +1 -1
- package/dist/client/assets/{auth-entry-DAaW-JP1.js → auth-entry-B3o-cx5V.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BL6c-m_k.js → auth-split-layout-DkmSP8Tf.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BY1UluTl.js → authenticate-and-persist-oauth-BikbhI1A.js} +1 -1
- package/dist/client/assets/{automation-list-row-B4YkAQxX.js → automation-list-row-CUlhfWL2.js} +1 -1
- package/dist/client/assets/{automation-runs-hQbvp86K.js → automation-runs-D2g4Fr08.js} +7 -7
- package/dist/client/assets/{automations-CUA_GQO0.js → automations-DYyQ9G1N.js} +1 -1
- package/dist/client/assets/{avatar-CcMM96-K.js → avatar-GYVtqDcp.js} +1 -1
- package/dist/client/assets/{badge-hLYfluoO.js → badge-CE4o4kP-.js} +1 -1
- package/dist/client/assets/{block-document-BE-pajan.js → block-document-DeBSfQOo.js} +1 -1
- package/dist/client/assets/{brand-context-D92w6ycG.js → brand-context-iMYkJCE6.js} +1 -1
- package/dist/client/assets/{buckets-ChX0BRmi.js → buckets-BG7JtAQq.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BMku8ZJl.js → bulk-category-panel-BdR88tcu.js} +1 -1
- package/dist/client/assets/{calendar-B3ryfp2a.js → calendar-21IQANpv.js} +1 -1
- package/dist/client/assets/{capability-load-error-DzxUGf6C.js → capability-load-error--VQST21H.js} +1 -1
- package/dist/client/assets/{card-CkThmjm3.js → card-v6cetdMl.js} +1 -1
- package/dist/client/assets/{category-editor-BRUSL8RO.js → category-editor-K6y5ZpT0.js} +1 -1
- package/dist/client/assets/{chat-context-wJnxG7_p.js → chat-context-CEIN1yOp.js} +1 -1
- package/dist/client/assets/{checkbox-CCWvKk34.js → checkbox-DKtoq6Xg.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B0_BZ0kZ.js → cli-auth-success-DH_n7t0b.js} +1 -1
- package/dist/client/assets/{collection-detail-DLn1ZCTZ.js → collection-detail-DbPWPKU0.js} +1 -1
- package/dist/client/assets/{collection-display-button-CMmDcoNA.js → collection-display-button-7qntO4Z4.js} +1 -1
- package/dist/client/assets/{collection-search-BpDU1NK0.js → collection-search-C7TBz5po.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DjHIPOEC.js → collection-table-wrapper-g72FCyPm.js} +1 -1
- package/dist/client/assets/{collection-tabs-Bb7uYT8l.js → collection-tabs-De6ztjPi.js} +1 -1
- package/dist/client/assets/{command-f5cqNj2M.js → command-BoxD5Pf9.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Chhc0OZr.js → commerce-onboarding-BVZWrfKg.js} +1 -1
- package/dist/client/assets/{companions-core-CP0x2RPb.js → companions-core-D_LKf9um.js} +1 -1
- package/dist/client/assets/{connect-C6TpLvAo.js → connect-w9pGQBcp.js} +1 -1
- package/dist/client/assets/{connection-De9GbGZT.js → connection-E982aK5S.js} +1 -1
- package/dist/client/assets/{connection-card-qE9X_cKq.js → connection-card-CKr_yuPH.js} +1 -1
- package/dist/client/assets/{connection-detail-DhDD5LCi.js → connection-detail-B51nA0jC.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BDu0APGs.js → connection-form-helpers-Dm8tN4qD.js} +1 -1
- package/dist/client/assets/{connections-ZXpOKmJi.js → connections-14UPeuOx.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Cnb_ojRo.js → decopilot-sse-pool-B9c9I9BR.js} +1 -1
- package/dist/client/assets/{dialog-BWi5szbF.js → dialog-BZPeQgxS.js} +1 -1
- package/dist/client/assets/{domain-settings-DVdLSZJn.js → domain-settings-BQbNcht-.js} +1 -1
- package/dist/client/assets/{drawer-DpUxGlcD.js → drawer-CoWbYmD0.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Bl08rQ8M.js → dropdown-menu-ChZO55uo.js} +1 -1
- package/dist/client/assets/{empty-state-DY7-rR_N.js → empty-state-BOcNRGTT.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Brlr04AE.js → extract-connection-data-ClvPt4d9.js} +1 -1
- package/dist/client/assets/{file-explorer-C3m1OPvI.js → file-explorer-CLsug9Lw.js} +1 -1
- package/dist/client/assets/{form-DcPM-unG.js → form-DLUrs8rJ.js} +1 -1
- package/dist/client/assets/{general-BB6XpmZy.js → general-Bhl0Av3E.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DhV2rMyo.js → github-repo-picker-DTY8mmL0.js} +1 -1
- package/dist/client/assets/{hooks-Bhc3IHZ2.js → hooks-CMatjzSO.js} +1 -1
- package/dist/client/assets/{index-Ds7ZYgSi.js → index-B-55x-9C.js} +1 -1
- package/dist/client/assets/{index-t0Ueibjt.js → index-BDrEbe-G.js} +1 -1
- package/dist/client/assets/{index-DhOLS10R.js → index-COFxNjns.js} +1 -1
- package/dist/client/assets/{index-D66M2LLf.js → index-CSj5cXy0.js} +1 -1
- package/dist/client/assets/index-Cb2VTVkW.css +1 -0
- package/dist/client/assets/{index-BsvEfmuO.js → index-D0qRx1pf.js} +1 -1
- package/dist/client/assets/index-DJXXW7-f.js +77 -0
- package/dist/client/assets/{index-DkXDZFMu.js → index-DVYX_fOx.js} +8 -8
- package/dist/client/assets/{index-Bl9ur93k.js → index-DocGqplh.js} +1 -1
- package/dist/client/assets/{index-DTl3y3hQ.js → index-DzykUVIF.js} +1 -1
- package/dist/client/assets/{index-jDyc0OAS.js → index-oCdSbKU3.js} +1 -1
- package/dist/client/assets/{index-redirect-3jVQgdn1.js → index-redirect-ZexxbKxf.js} +1 -1
- package/dist/client/assets/{index-qwHJMlNP.js → index-zmQQah_K.js} +5 -5
- package/dist/client/assets/{input-CrtGwGgM.js → input-CQpLwHIV.js} +1 -1
- package/dist/client/assets/{integration-icon-JF87TWPT.js → integration-icon-C3oBTwr-.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DDr6y-lR.js → invite-member-dialog-RSfSqbbE.js} +1 -1
- package/dist/client/assets/{label-BcnSxg-o.js → label-cXGq7tc8.js} +1 -1
- package/dist/client/assets/{layout-RyED_O7P.js → layout-Dl_NjxXq.js} +1 -1
- package/dist/client/assets/{login-B52hW3NZ.js → login-BAEUMmBj.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D8ppyulg.js → mcp-oauth-Bht8yjdm.js} +1 -1
- package/dist/client/assets/{members-zL6CMB7H.js → members-BSAGJuHi.js} +1 -1
- package/dist/client/assets/{monaco-editor-DC-XxNDc.js → monaco-editor-BFQkgA7A.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D8268GI9.js → monitoring-stats-row-eIzhQGAw.js} +1 -1
- package/dist/client/assets/{multi-select-DZ3tA8av.js → multi-select-CUQDNGnw.js} +1 -1
- package/dist/client/assets/{oauth-callback-kjHP_5nx.js → oauth-callback-CzSlzABp.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-D09tFs9t.js → oauth-callback-ai-provider-BoPcbny5.js} +1 -1
- package/dist/client/assets/{onboarding-B4tD0aAh.js → onboarding-32mNTxi9.js} +1 -1
- package/dist/client/assets/{org-layout-Cn1Ho97o.js → org-layout-Bazm54e2.js} +1 -1
- package/dist/client/assets/{organization-choice-DmL5np4L.js → organization-choice-B3f1EmB3.js} +1 -1
- package/dist/client/assets/{orgs-4JSHY1YD.js → orgs-CRpJZDJ9.js} +1 -1
- package/dist/client/assets/{page-seo-form-BG0ms_Ra.js → page-seo-form-AQ_jn5lh.js} +1 -1
- package/dist/client/assets/{popover-CbQ2jeJL.js → popover-CSP96JCd.js} +1 -1
- package/dist/client/assets/{post-editor-PC8gVNvR.js → post-editor-GaZ3x0s1.js} +1 -1
- package/dist/client/assets/{primitives-OEDlnm0p.js → primitives-BnG-2ryU.js} +1 -1
- package/dist/client/assets/{profile-CD4v608e.js → profile-bBzTMvQ_.js} +1 -1
- package/dist/client/assets/project-app-view-BGvZdDPW.js +1 -0
- package/dist/client/assets/record-editor-BXzkgsOB.js +1 -0
- package/dist/client/assets/{redirect-editor-Dlb5O_D3.js → redirect-editor-CUMOXM6G.js} +1 -1
- package/dist/client/assets/registry-D9aYw-RP.js +2 -0
- package/dist/client/assets/{registry-layout-C8_QByAd.js → registry-layout-BtrfOk_W.js} +1 -1
- package/dist/client/assets/{reports-x-OehXQK.js → reports-z5Qu0E7H.js} +1 -1
- package/dist/client/assets/{require-capability-DmKM21Zc.js → require-capability-DqNr39-S.js} +1 -1
- package/dist/client/assets/{required-auth-layout-5pa59daV.js → required-auth-layout-c9y2mpaN.js} +1 -1
- package/dist/client/assets/{reset-password-DRD_ofJm.js → reset-password-C1rb1QOD.js} +1 -1
- package/dist/client/assets/roles-BfVezRHA.js +1 -0
- package/dist/client/assets/{search-input-CuDeXTfL.js → search-input-xVY8kcO_.js} +1 -1
- package/dist/client/assets/{secrets-ByhK1wuh.js → secrets-CqNbQzme.js} +1 -1
- package/dist/client/assets/{sections-editor-Cgsmx9O7.js → sections-editor-HoDLn379.js} +1 -1
- package/dist/client/assets/{select-BLWWoure.js → select-D1SECHLQ.js} +1 -1
- package/dist/client/assets/{select-model-VQ28Yu2G.js → select-model-BpbyAuRD.js} +1 -1
- package/dist/client/assets/{self-tool-result-DFOdRI3_.js → self-tool-result-CJkxgggb.js} +1 -1
- package/dist/client/assets/{seo-editor-Ba6Qis2R.js → seo-editor-hUTKyTrn.js} +1 -1
- package/dist/client/assets/{settings-layout-BWwDxanH.js → settings-layout-qweZa5vB.js} +1 -1
- package/dist/client/assets/{settings-section-DdO3nUAk.js → settings-section-BQljYI_U.js} +1 -1
- package/dist/client/assets/{shell-controls-DRC1El_P.js → shell-controls-Bw2YGu_8.js} +1 -1
- package/dist/client/assets/{shell-layout-R3LvZuDO.js → shell-layout-p6wte0dm.js} +1 -1
- package/dist/client/assets/{sidebar-Rhn_7iDM.js → sidebar-BUuSerGF.js} +1 -1
- package/dist/client/assets/{skeleton-BW0Q2Tma.js → skeleton-VPdSRVA-.js} +1 -1
- package/dist/client/assets/{spinner-BmpiwYGK.js → spinner-RtnhKa-B.js} +1 -1
- package/dist/client/assets/{sso-DPUfip-P.js → sso-CsFm8sxz.js} +1 -1
- package/dist/client/assets/{store-DGKCZB7s.js → store-RHLyS7hz.js} +1 -1
- package/dist/client/assets/store-registry-B4WCVmlq.js +2 -0
- package/dist/client/assets/{studio-tools-Bn4stufd.js → studio-tools-DPc55i_W.js} +1 -1
- package/dist/client/assets/{switch-DaHYJ2Nc.js → switch-viq_FXJ8.js} +1 -1
- package/dist/client/assets/{tab-id-BEtCnmin.js → tab-id-DxVr54Mk.js} +1 -1
- package/dist/client/assets/{table-Cs3ugNks.js → table-CORYZwlA.js} +1 -1
- package/dist/client/assets/{tabs-CiYLJzj3.js → tabs-x3dP861V.js} +1 -1
- package/dist/client/assets/{textarea-DTx-rOHo.js → textarea-CYJswwFi.js} +1 -1
- package/dist/client/assets/{toggle-group-CQlXvhKw.js → toggle-group-Dil2gcHF.js} +1 -1
- package/dist/client/assets/{toolbar-B0We7Oqc.js → toolbar-MvqSiTrB.js} +1 -1
- package/dist/client/assets/{tooltip-D_ecIBLw.js → tooltip-C1w400OV.js} +1 -1
- package/dist/client/assets/{use-ai-providers--WypThoj.js → use-ai-providers-DM-F5Qtg.js} +1 -1
- package/dist/client/assets/{use-automations-Dcew0thN.js → use-automations-CfEo-5QD.js} +1 -1
- package/dist/client/assets/{use-autosave-K_nI-aBR.js → use-autosave-ABaTg-ya.js} +1 -1
- package/dist/client/assets/{use-capability-C32Enaot.js → use-capability-CtI_PuDl.js} +1 -1
- package/dist/client/assets/{use-clock-tick-D0z_i74b.js → use-clock-tick-BtXHj471.js} +1 -1
- package/dist/client/assets/{use-connection-Bfjm5Tbm.js → use-connection-BJMndhX6.js} +1 -1
- package/dist/client/assets/{use-copy-Cu2_ezTr.js → use-copy-BpQtyfCx.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DoJdPo_T.js → use-create-virtual-mcp-DIbp_-Tq.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DH7ZFaQ5.js → use-debounced-autosave-DN8Oab1X.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Diesi6Z-.js → use-debounced-value-_QZluvSY.js} +1 -1
- package/dist/client/assets/{use-deco-credits-B_2rhwbQ.js → use-deco-credits-Be0uMUlR.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-45QmOG11.js → use-decopilot-events-Bqjj2r54.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DpvTSGn9.js → use-delete-connection-CKuD860J.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-C8hg4oPX.js → use-deployment-admin-BSZkEdt5.js} +1 -1
- package/dist/client/assets/{use-file-configs-Dr0ZDV3u.js → use-file-configs-W-Fvz8Dt.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-lSEemmvT.js → use-infinite-scroll-BKDTLqUC.js} +1 -1
- package/dist/client/assets/{use-join-requests-C7tH29qb.js → use-join-requests-BT1UTqbn.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BtdghHwY.js → use-mcp-auth-status-B6vAaipE.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CoWBKVf9.js → use-mcp-client-BE9lGzil.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C0L0FBpi.js → use-mcp-tools-CX5F5nwR.js} +1 -1
- package/dist/client/assets/{use-members-CPCQUqiH.js → use-members-WQeGsrXQ.js} +1 -1
- package/dist/client/assets/{use-mobile-DDCfnL3u.js → use-mobile-CnIF6Jdn.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CX9QfUMC.js → use-navigate-to-agent-DDA2RT4F.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BGZST-La.js → use-org-auth-client-DsUpqXni.js} +1 -1
- package/dist/client/assets/{use-org-sso-6cdxPwv-.js → use-org-sso-7O5CjDC8.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cjvsx-dV.js → use-organization-roles-CPvAyMSx.js} +1 -1
- package/dist/client/assets/{use-organization-settings-fwrxLtAV.js → use-organization-settings-BJyGI8Wn.js} +1 -1
- package/dist/client/assets/{use-registry-connections-rJnN0MPh.js → use-registry-connections-DKgfAXKL.js} +1 -1
- package/dist/client/assets/{use-secrets-B7cbeLIM.js → use-secrets-CWfzR3ZK.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DwGG33_g.js → use-status-sounds-BKNhzyax.js} +1 -1
- package/dist/client/assets/{use-tags-DciZl2W0.js → use-tags-Bd2NGWoV.js} +1 -1
- package/dist/client/assets/{use-view-mode-BPxsn8_u.js → use-view-mode-DK5K_S1u.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CL6eR_SN.js → use-virtual-mcp-Q48N4cvA.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DU67eEB0.js +1 -0
- package/dist/client/assets/{useQueries-Alwoh8js.js → useQueries-C-Idcczs.js} +1 -1
- package/dist/client/assets/{useRouterState-CFLdW9OT.js → useRouterState-DZiL3YaY.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BjtR8P1Y.js +1 -0
- package/dist/client/assets/{users-CeevisBn.js → users-I6Wm_qmM.js} +1 -1
- package/dist/client/assets/{variant-calendar-DpWCsHkk.js → variant-calendar-CLRUJV--.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-VplROZiz.js → view-mode-toggle-B3CzIHev.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +502 -502
- package/dist/server/migrate.js +109 -109
- package/dist/server/server.js +323 -323
- package/package.json +1 -1
- package/dist/client/assets/index-B8LE3AFs.js +0 -77
- package/dist/client/assets/index-BD6FLXxu.css +0 -1
- package/dist/client/assets/project-app-view-BnBsstVA.js +0 -1
- package/dist/client/assets/record-editor-CSB1xHo0.js +0 -1
- package/dist/client/assets/registry-CSg52n70.js +0 -2
- package/dist/client/assets/roles-HxAXHNs1.js +0 -1
- package/dist/client/assets/store-registry-B3gG9XON.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Dhze2qs5.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-fPLjIp7Q.js +0 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-zmQQah_K.js","assets/index-DVYX_fOx.js","assets/index-Cb2VTVkW.css","assets/ArrowUp-C61gbXqo.js","assets/chat-context-CEIN1yOp.js","assets/tab-id-DxVr54Mk.js","assets/dialog-BZPeQgxS.js","assets/X-CWc_ekdN.js","assets/Check-CrXR5QtL.js","assets/Copy01-Bxep1ZC2.js","assets/hooks-CMatjzSO.js","assets/use-mcp-client-BE9lGzil.js","assets/auth-Ct1h8zXa.js","assets/decopilot-sse-pool-B9c9I9BR.js","assets/backoff-CrEUbyZT.js","assets/delay-CnY5UFtP.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-virtual-mcp-Q48N4cvA.js","assets/use-ai-providers-DM-F5Qtg.js","assets/studio-tools-DPc55i_W.js","assets/use-decopilot-events-Bqjj2r54.js","assets/use-organization-settings-BJyGI8Wn.js","assets/automation-runs-D2g4Fr08.js","assets/select-D1SECHLQ.js","assets/tooltip-C1w400OV.js","assets/ChevronDown-B8QQkCNd.js","assets/ChevronUp-D4wwUmSO.js","assets/useInfiniteQuery-DU67eEB0.js","assets/use-infinite-scroll-BKDTLqUC.js","assets/use-connection-BJMndhX6.js","assets/card-v6cetdMl.js","assets/sidebar-BUuSerGF.js","assets/LayoutLeft-CDsVE7ZI.js","assets/use-mobile-CnIF6Jdn.js","assets/table-CORYZwlA.js","assets/empty-state-BOcNRGTT.js","assets/use-members-WQeGsrXQ.js","assets/use-org-auth-client-DsUpqXni.js","assets/use-clock-tick-BtXHj471.js","assets/AlertCircle-DFaoZGth.js","assets/CheckCircle-BWRCZsN3.js","assets/DotsVertical-CwViri6f.js","assets/agent-icon-BVNrPIs2.js","assets/Tool01-CfYmRAEf.js","assets/Settings02-CWrgv8tk.js","assets/Tool02-C_dzRDkv.js","assets/XCircle-AJko-lVE.js","assets/ArrowUpRight-C7M_LNeh.js","assets/TrendUp01-DMmOb2g6.js","assets/ZapSquare-Bc3zYUJA.js","assets/Users03-AVLOfciM.js","assets/ChevronRight-ZvDjoDRP.js","assets/Stars02-80kwJrfw.js","assets/CpuChip01-CoURano2.js","assets/Eye-B_jdRJgs.js","assets/FilterLines-DJvSrNJZ.js","assets/Star01-5msVwJW-.js","assets/Palette-BLBHbxj3.js","assets/SwitchHorizontal01-ux3vbCoi.js","assets/HardDrive-mRXyda97.js","assets/Key01-B4i-gjCR.js","assets/LinkExternal01-CFWNLxVb.js","assets/LogOut01-IMp3Y2Ns.js","assets/Monitor01-BZdbLcqw.js","assets/Sun-DOCBIRz7.js","assets/Play-COx-RL1j.js","assets/Plus-C-01xS2L.js","assets/SearchLg-BrsBc92t.js","assets/SearchMd-B6AFInty.js","assets/Shield01-Chq1qwNK.js","assets/Stars01-DAZqcDEZ.js","assets/Trash01-BVuMwmUz.js","assets/Upload01-DWSD88mj.js","assets/User01-CsU5MfMu.js","assets/Users01-Q6OTyE8c.js","assets/XClose-CEI8Rz0P.js","assets/Zap-D3IzRhsD.js","assets/use-automations-CfEo-5QD.js","assets/useSuspenseInfiniteQuery-BjtR8P1Y.js","assets/avatar-GYVtqDcp.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-BpQtyfCx.js","assets/calendar-21IQANpv.js","assets/monaco-editor-BFQkgA7A.js","assets/spinner-RtnhKa-B.js","assets/index-COFxNjns.js","assets/shell-layout-p6wte0dm.js","assets/required-auth-layout-c9y2mpaN.js","assets/use-org-sso-7O5CjDC8.js","assets/integration-icon-C3oBTwr-.js","assets/use-navigate-to-agent-DDA2RT4F.js","assets/reusable-new-chat-CouMjkYR.js","assets/AreaChart-CdZ8y87H.js","assets/form-DLUrs8rJ.js","assets/label-cXGq7tc8.js","assets/input-CQpLwHIV.js","assets/drawer-CoWbYmD0.js","assets/collection-search-C7TBz5po.js","assets/tabs-x3dP861V.js","assets/toggle-group-Dil2gcHF.js","assets/use-deco-credits-Be0uMUlR.js","assets/popover-CSP96JCd.js","assets/alert-dialog-CCQ8grPT.js","assets/toolbar-MvqSiTrB.js","assets/skeleton-VPdSRVA-.js","assets/github-repo-picker-DTY8mmL0.js","assets/use-debounced-value-_QZluvSY.js","assets/authenticate-and-persist-oauth-BikbhI1A.js","assets/mcp-oauth-Bht8yjdm.js","assets/use-mcp-tools-CX5F5nwR.js","assets/extract-connection-data-ClvPt4d9.js","assets/metadata-dUsYcpuu.js","assets/provision-repo-scoped-github-connection-B2s3ApVy.js","assets/agent-capabilities-cXfbMfjV.js","assets/connection-card-CKr_yuPH.js","assets/use-registry-connections-DKgfAXKL.js","assets/retry-CErkP7V6.js","assets/connection-slug-eyAPH6o3.js","assets/textarea-CYJswwFi.js","assets/connection-form-helpers-Dm8tN4qD.js","assets/collection-tabs-De6ztjPi.js","assets/badge-CE4o4kP-.js","assets/select-model-BpbyAuRD.js","assets/checkbox-DKtoq6Xg.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-BQljYI_U.js","assets/dropdown-menu-ChZO55uo.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-BKNhzyax.js","assets/deco-site-production-url-CaKZ7xBn.js","assets/use-capability-CtI_PuDl.js","assets/pt-BR-CLy76QW2.js","assets/use-mcp-auth-status-B6vAaipE.js","assets/use-debounced-autosave-DN8Oab1X.js","assets/index-DzykUVIF.js","assets/search-input-xVY8kcO_.js","assets/switch-viq_FXJ8.js","assets/use-secrets-CWfzR3ZK.js","assets/command-BoxD5Pf9.js","assets/index-oCdSbKU3.js","assets/useQueries-C-Idcczs.js","assets/use-file-configs-W-Fvz8Dt.js","assets/automation-list-row-CUlhfWL2.js","assets/get-initials-D-f_fDFw.js","assets/index-CiP0VfIv.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{G as Va,r as w,c as L,x as Ga,K as be,F as Ee,o as Jt,e as ct,n as st,ax as Se,ag as Ut,a as Ji,t as Bt,a0 as Qa,m as X,j as c,b as oe,aW as eo,aX as to,aY as no,aZ as so,a_ as ro,a$ as io,b0 as oo,b1 as ao,b2 as lo,B as Xe,E as Xa,d as co,p as ci,k as Sr,u as Ya,aG as Za}from"./index-DVYX_fOx.js";import{g as St}from"./get-initials-D-f_fDFw.js";import{A as Ct}from"./avatar-GYVtqDcp.js";import{aC as ss,af as Ja,ag as el,ai as tl,a6 as nl,aD as sl,B as rl,p as il,aE as Cr,aF as ol,X as jr,e as uo,ae as al,j as fo,aG as ll,aB as Zs,as as Tr,_ as Rn,aH as cl,n as Dr,az as dl}from"./agent-icon-BVNrPIs2.js";import{i as ho}from"./SwitchHorizontal01-ux3vbCoi.js";import{s as Jn}from"./Plus-C-01xS2L.js";import{i as Gt}from"./X-CWc_ekdN.js";import{a as Nn,b as Gn,P as Qn}from"./popover-CSP96JCd.js";import{a as gt,i as po,D as Qt,b as Xt,c as Yt,d as zn,e as Ln,f as Pn}from"./dropdown-menu-ChZO55uo.js";import{W as ul,m as di,S as go,C as mo,g as fl,u as hl,h as pl,Q as gl,j as ml,a as xl}from"./use-mcp-client-BE9lGzil.js";import{u as bl,G as lr,a as yl}from"./github-repo-picker-DTY8mmL0.js";import{b as Nr,d as Rr,e as Er,h as kl,a as vl,c as wl}from"./dialog-BZPeQgxS.js";import{b as Sl,u as Cl}from"./use-connection-BJMndhX6.js";import{b as jl}from"./provision-repo-scoped-github-connection-B2s3ApVy.js";import{a as Tl}from"./authenticate-and-persist-oauth-BikbhI1A.js";import{e as Dl}from"./extract-connection-data-ClvPt4d9.js";import{u as xo}from"./use-members-WQeGsrXQ.js";import{u as en}from"./studio-tools-DPc55i_W.js";import{t as Nl,T as Rl,a as El,S as nt,i as ui}from"./decopilot-sse-pool-B9c9I9BR.js";import{u as Il}from"./use-decopilot-events-Bqjj2r54.js";import{a as Ir}from"./format-time-BnbuEtat.js";import{i as Ps}from"./AlertCircle-DFaoZGth.js";import{i as _n}from"./CheckCircle-BWRCZsN3.js";import{i as _l}from"./DotsVertical-CwViri6f.js";import{s as Al}from"./Eye-B_jdRJgs.js";import{u as bo,a as Bl,b as Ol}from"./use-tags-Bd2NGWoV.js";import{o as $l,P as qt,a as _r,D as Ml,p as zl,q as Ll,S as Ot,r as Pl,T as yo,F as Js,s as Kn,v as Fl,w as Ul,x as ko,N as ql,k as Ar,y as Hl,z as Kl,d as vo,n as Wl,A as Mt,B as Vl,G as Fn,H as Gl,I as wo,R as So,m as Co,J as jo,K as Ql,L as Xl,Q as Yl,e as Zl,u as Jl,f as ec,j as tc,C as To,c as nc}from"./calendar-21IQANpv.js";import{S as jn}from"./skeleton-VPdSRVA-.js";import{u as sc}from"./use-copy-BpQtyfCx.js";import{i as rs}from"./Check-CrXR5QtL.js";import{i as Do}from"./ChevronRight-ZvDjoDRP.js";import{a as rc}from"./Copy01-Bxep1ZC2.js";import{n as ic,i as No}from"./Tool02-C_dzRDkv.js";import{n as Cs}from"./LinkExternal01-CFWNLxVb.js";import{b as Ro,i as Eo}from"./XCircle-AJko-lVE.js";import{s as Io}from"./Trash01-BVuMwmUz.js";import{u as fi,a as oc}from"./use-organization-settings-BJyGI8Wn.js";import{d as Br,a as Or,c as Pt,b as In,C as $r,e as Mr}from"./command-BoxD5Pf9.js";import{s as cr}from"./User01-CsU5MfMu.js";import{i as ac}from"./ArrowUp-C61gbXqo.js";import{i as lc}from"./Tool01-CfYmRAEf.js";import{d as cc,b as dc,f as uc,g as fc,a as hc,D as pc}from"./drawer-CoWbYmD0.js";import{t as zr}from"./ChevronDown-B8QQkCNd.js";import{i as _o}from"./FilterLines-DJvSrNJZ.js";import{s as gc}from"./TrendUp01-DMmOb2g6.js";import{u as mc}from"./shell-layout-p6wte0dm.js";import{b as xc}from"./hooks-CMatjzSO.js";import{f as bc}from"./tab-id-DxVr54Mk.js";import{u as dr}from"./companions-core-D_LKf9um.js";function yc(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 om="__home__";function Lr(t,e){return Va.chatDraft(t,e)}function kc(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 vc(t,e,n,r,s){const i=Lr(e,n);if(yc(r)){t.removeItem(i);return}const o={tiptapDoc:r,updatedAt:Date.now()},a=JSON.stringify(o);try{t.setItem(i,a)}catch(l){if(wc(l)){const d=new TextEncoder().encode(a).byteLength;s?.onQuotaExceeded?.({docSizeBytes:d});return}throw l}}function am(t,e,n){const r=Lr(e,n),s=t.getItem(r),i=kc(s);return s!==null&&i===null&&t.removeItem(r),i}function lm(t,e,n){t.removeItem(Lr(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 Sc=$l;function Cc(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:a}=t,l=r&&!s,d=Ll(n),f=new RegExp(`\\s${d}$`),u=o?"^":"",h=s?"":d,p=l?new RegExp(`${u}${d}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${u}(?:^)?${d}[^\\s${h}]*`,"gm"),m=((e=a.nodeBefore)==null?void 0:e.isText)&&a.nodeBefore.text;if(!m)return null;const y=a.pos-m.length,x=Array.from(m.matchAll(p)).pop();if(!x||x.input===void 0||x.index===void 0)return null;const g=x.input.slice(Math.max(0,x.index-1),x.index),b=new RegExp(`^[${i?.join("")}\0]?$`).test(g);if(i!==null&&!b)return null;const k=y+x.index;let v=k+x[0].length;return l&&f.test(m.slice(v-1,v+1))&&(x[0]+=" ",v+=1),k<a.pos&&v>=a.pos?{range:{from:k,to:v},query:x[0].slice(n.length),text:x[0]}:null}var jc=new qt("suggestion");function Tc({pluginKey:t=jc,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:d="",decorationEmptyClass:f="is-empty",command:u=()=>null,items:h=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:y=Cc,shouldShow:x}){let g;const b=p?.(),k=()=>{const C=e.state.selection.$anchor.pos,T=e.view.coordsAtPos(C),{top:N,right:R,bottom:D,left:I}=T;try{return new DOMRect(I,N,R-I,D-N)}catch{return null}},v=(C,T)=>T?()=>{const N=t.getState(e.state),R=N?.decorationId,D=C.dom.querySelector(`[data-decoration-id="${R}"]`);return D?.getBoundingClientRect()||null}:k;function S(C,T){var N;try{const D=t.getState(C.state),I=D?.decorationId?C.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`):null,O={editor:e,range:D?.range||{from:0,to:0},query:D?.query||null,text:D?.text||null,items:[],command:E=>u({editor:e,range:D?.range||{from:0,to:0},props:E}),decorationNode:I,clientRect:v(C,I)};(N=b?.onExit)==null||N.call(b,O)}catch{}const R=C.state.tr.setMeta(T,{exit:!0});C.dispatch(R)}const j=new _r({key:t,view(){return{update:async(C,T)=>{var N,R,D,I,O,E,P;const _=(N=this.key)==null?void 0:N.getState(T),B=(R=this.key)==null?void 0:R.getState(C.state),$=_.active&&B.active&&_.range.from!==B.range.from,K=!_.active&&B.active,Z=_.active&&!B.active,F=!K&&!Z&&_.query!==B.query,q=K||$&&F,Q=F||$,G=Z||$&&F;if(!q&&!Q&&!G)return;const ee=G&&!q?_:B,W=C.dom.querySelector(`[data-decoration-id="${ee.decorationId}"]`);g={editor:e,range:ee.range,query:ee.query,text:ee.text,items:[],command:ne=>u({editor:e,range:ee.range,props:ne}),decorationNode:W,clientRect:v(C,W)},q&&((D=b?.onBeforeStart)==null||D.call(b,g)),Q&&((I=b?.onBeforeUpdate)==null||I.call(b,g)),(Q||q)&&(g.items=await h({editor:e,query:ee.query})),G&&((O=b?.onExit)==null||O.call(b,g)),Q&&((E=b?.onUpdate)==null||E.call(b,g)),q&&((P=b?.onStart)==null||P.call(b,g))},destroy:()=>{var C;g&&((C=b?.onExit)==null||C.call(b,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,T,N,R){const{isEditable:D}=e,{composing:I}=e.view,{selection:O}=C,{empty:E,from:P}=O,_={...T},B=C.getMeta(t);if(B&&B.exit)return _.active=!1,_.decorationId=null,_.range={from:0,to:0},_.query=null,_.text=null,_;if(_.composing=I,D&&(E||e.view.composing)){(P<T.range.from||P>T.range.to)&&!I&&!T.composing&&(_.active=!1);const $=y({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:O.$from}),K=`id_${Math.floor(Math.random()*4294967295)}`;$&&m({editor:e,state:R,range:$.range,isActive:T.active})&&(!x||x({editor:e,range:$.range,query:$.query,text:$.text,transaction:C}))?(_.active=!0,_.decorationId=T.decorationId?T.decorationId:K,_.range=$.range,_.query=$.query,_.text=$.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={from:0,to:0},_.query=null,_.text=null),_}},props:{handleKeyDown(C,T){var N,R,D,I;const{active:O,range:E}=j.getState(C.state);if(!O)return!1;if(T.key==="Escape"||T.key==="Esc"){const _=j.getState(C.state),B=(N=g?.decorationNode)!=null?N:null,$=B??(_?.decorationId?C.dom.querySelector(`[data-decoration-id="${_.decorationId}"]`):null);if(((R=b?.onKeyDown)==null?void 0:R.call(b,{view:C,event:T,range:_.range}))||!1)return!0;const Z={editor:e,range:_.range,query:_.query,text:_.text,items:[],command:F=>u({editor:e,range:_.range,props:F}),decorationNode:$,clientRect:$?()=>$.getBoundingClientRect()||null:null};return(D=b?.onExit)==null||D.call(b,Z),S(C,t),!0}return((I=b?.onKeyDown)==null?void 0:I.call(b,{view:C,event:T,range:E}))||!1},decorations(C){const{active:T,range:N,decorationId:R,query:D}=j.getState(C);if(!T)return null;const I=!D?.length,O=[l];return I&&O.push(f),Ml.create(C.doc,[zl.inline(N.from,N.to,{nodeName:a,class:O.join(" "),"data-decoration-id":R,"data-decoration-content":d})])}}});return j}function Dc(t){const e=L.c(24),{editor:n,query:r,items:s,onSelect:i,onClose:o}=t,[a,l]=w.useState(0),d=w.useRef(s),f=w.useRef(a),u=w.useRef(i),h=w.useRef(o),p=w.useDeferredValue(r);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{l(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 x,g;e[3]!==s.length||e[4]!==a?(x=()=>{a>=s.length&&s.length>0&&l(0)},g=[s.length,a],e[3]=s.length,e[4]=a,e[5]=x,e[6]=g):(x=e[5],g=e[6]),w.useEffect(x,g);let b,k;e[7]!==s?(b=()=>{d.current=s},k=[s],e[7]=s,e[8]=b,e[9]=k):(b=e[8],k=e[9]),w.useEffect(b,k);let v,S;e[10]!==a?(v=()=>{f.current=a},S=[a],e[10]=a,e[11]=v,e[12]=S):(v=e[11],S=e[12]),w.useEffect(v,S);let j,C;e[13]!==i?(C=()=>{u.current=i},j=[i],e[13]=i,e[14]=j,e[15]=C):(j=e[14],C=e[15]),w.useEffect(C,j);let T,N;e[16]!==o?(T=()=>{h.current=o},N=[o],e[16]=o,e[17]=T,e[18]=N):(T=e[17],N=e[18]),w.useEffect(T,N);let R,D;e[19]!==n?(R=()=>{if(n?.isDestroyed)return;let E;try{E=n.view.dom}catch{return}if(!E)return;const P=B=>{const $=d.current;if(!$.length)return!1;const K=()=>l(F=>(F+1)%$.length),Z=()=>l(F=>(F-1+$.length)%$.length);switch(B.key){case"ArrowUp":return B.preventDefault(),Z(),!0;case"ArrowDown":return B.preventDefault(),K(),!0;case"Tab":return B.preventDefault(),B.shiftKey?Z():K(),!0;case"Home":return B.preventDefault(),l(0),!0;case"End":return B.preventDefault(),l($.length-1),!0;case"Enter":{if(B.isComposing)return!1;B.preventDefault();const F=f.current;return F!==-1&&$[F]&&u.current?.($[F],F),!0}case"Escape":return B.preventDefault(),h.current?.(),!0;default:return!1}},_=B=>{P(B)};return E.addEventListener("keydown",_,!0),()=>{E?.removeEventListener("keydown",_,!0)}},D=[n],e[19]=n,e[20]=R,e[21]=D):(R=e[20],D=e[21]),w.useEffect(R,D);const I=s.length?a:void 0;let O;return e[22]!==I?(O={selectedIndex:I,setSelectedIndex:l},e[22]=I,e[23]=O):O=e[23],O}function Nc(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 Rc=w.createContext(void 0);function Ec(){const t=w.useContext(Rc);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function cm(t){const e=L.c(16),{editor:n,char:r,pluginKey:s,allow:i,onOpenChange:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=a):a=e[0];const[l,d]=w.useReducer(Nc,a);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 qt?s:new qt(s);n.state.plugins.find(b=>b.spec.key===y)&&n.unregisterPlugin(y);const g=Tc({pluginKey:y,editor:n,char:r,allow(b){const k=n.state.doc.resolve(b.range.from);for(let v=k.depth;v>0;v--)if(k.node(v).type.name==="image")return!1;return!(i&&!i(b))},command(){},render:()=>({onStart:b=>{d({type:"ON_START",payload:{element:b.decorationNode??null,query:b.query,range:b.range}}),u(!0)},onUpdate:b=>{d({type:"ON_UPDATE",payload:{element:b.decorationNode??null,query:b.query,range:b.range}})},onKeyDown:b=>b.event.key==="Escape"?(d({type:"ON_EXIT"}),!0):!1,onExit:()=>{d({type:"ON_EXIT"}),u(!1)}}),items:Ic});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]!==l?(m={state:l,dispatch:d},e[14]=l,e[15]=m):m=e[15],m}function Ic(){return[]}function dm({editor:t,queryKey:e,queryFn:n,onSelect:r}){const{state:s,dispatch:i}=Ec(),o=w.useDeferredValue(s.query),{data:a}=Ga({queryKey:be.suggestionItems(e,s.open,o),queryFn:()=>s.open?n({query:o}):[]}),l=()=>{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(" "),x=s.range?{...s.range}:{from:0,to:0};y&&s.range&&(x.to+=1),await r({range:x,item:u})===!1?i({type:"SET_SELECTED_ITEM",payload:null}):l()}catch{l()}}},{selectedIndex:f}=Dc({editor:t,query:o,items:a,onSelect:d,onClose:l});return{selectedItem:s.selectedItem,items:a,selectedIndex:f,close:l,onSelect:d}}function um(t){return t.contentHash??`${t.size}-${t.updatedAt}`}function mt(t,e,n,r){const s=new URLSearchParams(r).toString();return`/api/${encodeURIComponent(t)}/fs/${encodeURIComponent(e)}/${n}${s?`?${s}`:""}`}async function Ye(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 fm(t,e){const n=L.c(15),{org:r}=Ee();let s;n[0]!==r.id||n[1]!==e||n[2]!==t?(s=be.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=(l,d)=>d?.queryKey[1]===r.id&&d.queryKey[2]===t?l: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 Ye(mt(r.slug,t,"list",{path:e}))).json()).entries.toSorted(_c),n[7]=r.slug,n[8]=e,n[9]=t,n[10]=o):o=n[10];let a;return n[11]!==s||n[12]!==i||n[13]!==o?(a={queryKey:s,placeholderData:i,queryFn:o},n[11]=s,n[12]=i,n[13]=o,n[14]=a):a=n[14],st(a)}function _c(t,e){return t.kind!==e.kind?t.kind==="dir"?-1:1:t.path.localeCompare(e.path)}function hm(t,e,n){const r=L.c(15),{org:s}=Ee();let i;r[0]!==s.id||r[1]!==e||r[2]!==t?(i=be.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 a;r[4]!==n?(a=n?.refetchIntervalWhenAbsent?f=>f.state.data?!1:n.refetchIntervalWhenAbsent??!1:void 0,r[4]=n,r[5]=a):a=r[5];let l;r[6]!==s.slug||r[7]!==e||r[8]!==t?(l=async()=>{const f=await Ye(mt(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]=l):l=r[9];let d;return r[10]!==i||r[11]!==o||r[12]!==a||r[13]!==l?(d={queryKey:i,enabled:o,refetchInterval:a,queryFn:l},r[10]=i,r[11]=o,r[12]=a,r[13]=l,r[14]=d):d=r[14],st(d)}function pm(t){const e=L.c(9),{org:n}=Ee();let r;e[0]!==n.id||e[1]!==t?(r=be.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 Ye(mt(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],st(i)}function gm(t,e){const n=L.c(9),r=t===void 0?60:t,{org:s}=Ee();let i;n[0]!==s.id?(i=be.orgFsRecent(s.id),n[0]=s.id,n[1]=i):i=n[1];const o=e?.enabled;let a;n[2]!==r||n[3]!==s.slug?(a=async()=>(await(await Ye(`/api/${encodeURIComponent(s.slug)}/fs/recent?limit=${r}`)).json()).entries,n[2]=r,n[3]=s.slug,n[4]=a):a=n[4];let l;return n[5]!==i||n[6]!==o||n[7]!==a?(l={queryKey:i,enabled:o,queryFn:a},n[5]=i,n[6]=o,n[7]=a,n[8]=l):l=n[8],st(l)}const Ac=50;function mm(t,e){const n=L.c(16),{org:r}=Ee();let s;n[0]!==r.id||n[1]!==t||n[2]!==e?.prefix||n[3]!==e?.volume?(s=be.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 a;n[7]!==r.slug||n[8]!==t||n[9]!==e?(a=async()=>{const d=new URLSearchParams({q:t,limit:String(Ac)});return e&&(d.set("volume",e.volume),e.prefix&&d.set("prefix",e.prefix)),(await(await Ye(`/api/${encodeURIComponent(r.slug)}/fs/search?${d}`)).json()).entries},n[7]=r.slug,n[8]=t,n[9]=e,n[10]=a):a=n[10];let l;return n[11]!==s||n[12]!==i||n[13]!==o||n[14]!==a?(l={queryKey:s,enabled:i,placeholderData:o,queryFn:a},n[11]=s,n[12]=i,n[13]=o,n[14]=a,n[15]=l):l=n[15],st(l)}function xm(t){const e=L.c(8),{org:n}=Ee();let r;e[0]!==n.id?(r=be.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 a=await Ye(`/api/${encodeURIComponent(n.slug)}/fs/skills`),{skills:l}=await a.json();return l.map(Bc)},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],st(o)}function Bc(t){return{volume:t.volume,path:t.path}}async function bm(t){const e=await Ye(`/api/${encodeURIComponent(t)}/fs/skills`),{skills:n}=await e.json();return n}async function Oc(t,e,n){return(await Ye(mt(t,e,"read",{path:n}))).text()}const $c=new Set(["md","mdx","markdown","txt","text"]),Mc=25,zc=64*1024,Lc=256*1024,Pc=4;function Fc(t){const e=t.lastIndexOf(".");return e===-1?!1:$c.has(t.slice(e+1).toLowerCase())}async function ym(t,e,n){const r=n?`${n}/`:"",s=u=>u.startsWith(r)?u.slice(r.length):u,i=[],o=[],a=[{path:n,depth:0}];for(;a.length>0;){const u=a.shift();if(!u)break;let h;try{h=(await(await Ye(mt(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<Pc&&a.push({path:p.path,depth:u.depth+1});continue}Fc(p.path)&&p.size<=zc&&i.length<Mc?i.push(p.path):o.push(s(p.path))}}const l=await Promise.all(i.map(u=>Oc(t,e,u).catch(()=>null))),d=[];let f=0;return i.forEach((u,h)=>{const p=l[h];if(p==null||f+p.length>Lc){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 km(){const t=L.c(7),{org:e}=Ee();let n;t[0]!==e.id?(n=be.orgFsPublicSets(e.id),t[0]=e.id,t[1]=n):n=t[1];let r;t[2]!==e.slug?(r=async()=>(await(await Ye(`/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],st(s)}function Uc(t){const e=L.c(3),{org:n}=Ee();let r;return e[0]!==n.slug||e[1]!==t?(r=s=>mt(n.slug,t,"read",{path:s}),e[0]=n.slug,e[1]=t,e[2]=r):r=e[2],r}function vm(){const t=L.c(2),{org:e}=Ee();let n;return t[0]!==e.slug?(n=(r,s)=>mt(e.slug,r,"read",{path:s}),t[0]=e.slug,t[1]=n):n=t[1],n}function wm(t){const e=L.c(3),{org:n}=Ee();let r;return e[0]!==n||e[1]!==t?(r={mutationFn:async s=>(await(await Ye(mt(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],ct(r)}function Sm(t){const e=L.c(18),{org:n}=Ee(),r=Jt();let s;e[0]!==n||e[1]!==t?(s=async d=>(await(await Ye(mt(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=be.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 a;e[9]!==n||e[10]!==r||e[11]!==t?(a=(d,f,u)=>{r.invalidateQueries({queryKey:be.orgFsStat(n.id,t,u.path)}),r.invalidateQueries({queryKey:be.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:be.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:be.orgFsSearchRoot(n.id)})},e[9]=n,e[10]=r,e[11]=t,e[12]=a):a=e[12];let l;return e[13]!==s||e[14]!==i||e[15]!==o||e[16]!==a?(l={mutationFn:s,onMutate:i,onError:o,onSettled:a},e[13]=s,e[14]=i,e[15]=o,e[16]=a,e[17]=l):l=e[17],ct(l)}function qc(t){const e=L.c(33),{org:n}=Ee(),r=Jt();let s;e[0]!==n||e[1]!==r||e[2]!==t?(s=()=>{r.invalidateQueries({queryKey:be.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:be.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:be.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 S=(await Promise.allSettled(k.files.map(j=>{const C=k.dir?`${k.dir}/${j.name}`:j.name;return Ye(mt(n.slug,t,"file",{path:C}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find(Hc);if(S)throw S.reason},e[4]=n,e[5]=t,e[6]=o):o=e[6];let a;e[7]!==i||e[8]!==o?(a={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=a):a=e[9];const l=ct(a);let d;e[10]!==n||e[11]!==t?(d=async k=>{await Ye(mt(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=ct(f);let h;e[16]!==n||e[17]!==t?(h=async k=>{await Ye(mt(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=ct(p);let y;e[22]!==n||e[23]!==t?(y=async k=>{await Ye(mt(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 x;e[25]!==i||e[26]!==y?(x={mutationFn:y,onSuccess:i},e[25]=i,e[26]=y,e[27]=x):x=e[27];const g=ct(x);let b;return e[28]!==u||e[29]!==g||e[30]!==m||e[31]!==l?(b={upload:l,mkdir:u,remove:m,move:g},e[28]=u,e[29]=g,e[30]=m,e[31]=l,e[32]=b):b=e[32],b}function Hc(t){return t.status==="rejected"}function Kc(t){return t?t.run_in_progress?"generating":t.scanned_at?"ready":"none":"none"}const Wc=2e4;function Vc(t){if(typeof t!="string"||!t)return null;try{return new URL(t).hostname||null}catch{return null}}function Gc(){const t=L.c(17),{org:e}=Ee(),n=ul.COMMERCE_DISCOVERY(e.id);let r;t[0]!==e.id||t[1]!==e.slug?(r=di({connectionId:go,orgId:e.id,orgSlug:e.slug}),t[0]=e.id,t[1]=e.slug,t[2]=r):r=t[2];const{data:s}=st(r),o=st({queryKey:be.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 dr(k)}}).data?.item??null,{data:a}=st({...di({connectionId:n,orgId:e.id,orgSlug:e.slug}),enabled:!!o}),l=be.commerceDiscoveryDiagnostic(e.id,n),d=!!a;let f;t[3]!==a?(f=async()=>{if(!a)throw new Error("cdClient not ready");const k=await a.callTool({name:mo,arguments:{}});return dr(k).diagnostic??null},t[3]=a,t[4]=f):f=t[4];let u;t[5]!==l||t[6]!==d||t[7]!==f?(u={queryKey:l,enabled:d,retry:1,refetchInterval:Qc,queryFn:f},t[5]=l,t[6]=d,t[7]=f,t[8]=u):u=t[8];const h=st(u),p=h.data??null,m=h.isSuccess,y=o?.metadata?.siteUrl;let x;t[9]!==y?(x=Vc(y),t[9]=y,t[10]=x):x=t[10];const g=a??null;let b;return t[11]!==n||t[12]!==h.isSuccess||t[13]!==p||t[14]!==x||t[15]!==g?(b={diagnostic:p,isSuccess:m,host:x,connectionId:n,cdClient:g},t[11]=n,t[12]=h.isSuccess,t[13]=p,t[14]=x,t[15]=g,t[16]=b):b=t[16],b}function Qc(t){return t.state.status!=="error"&&Kc(t.state.data)==="generating"?Wc:!1}function Xc(t,e){return{to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:fl(t.id),main:bc(e,mo)}}}function Yc(){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 Fs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function An(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function Pr(t){return"nodeType"in t}function it(t){var e,n;return t?An(t)?t:Pr(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Fr(t){const{Document:e}=it(t);return t instanceof e}function is(t){return An(t)?!1:t instanceof it(t).HTMLElement}function Ao(t){return t instanceof it(t).SVGElement}function Bn(t){return t?An(t)?t.document:Pr(t)?Fr(t)?t:is(t)||Ao(t)?t.ownerDocument:document:document:document}const Et=Fs?w.useLayoutEffect:w.useEffect;function Us(t){const e=w.useRef(t);return Et(()=>{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 Zc(){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 es(t,e){e===void 0&&(e=[t]);const n=w.useRef(t);return Et(()=>{n.current!==t&&(n.current=t)},e),n}function os(t,e){const n=w.useRef();return w.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Ds(t){const e=Us(t),n=w.useRef(null),r=w.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function Ns(t){const e=w.useRef();return w.useEffect(()=>{e.current=t},[t]),e.current}let er={};function as(t,e){return w.useMemo(()=>{if(e)return e;const n=er[t]==null?0:er[t]+1;return er[t]=n,t+"-"+n},[t,e])}function Bo(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 a=Object.entries(o);for(const[l,d]of a){const f=i[l];f!=null&&(i[l]=f+t*d)}return i},{...e})}}const En=Bo(1),ts=Bo(-1);function Jc(t){return"clientX"in t&&"clientY"in t}function qs(t){if(!t)return!1;const{KeyboardEvent:e}=it(t.target);return e&&t instanceof e}function ed(t){if(!t)return!1;const{TouchEvent:e}=it(t.target);return e&&t instanceof e}function Rs(t){if(ed(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 Jc(t)?{x:t.clientX,y:t.clientY}:null}const Ht=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[Ht.Translate.toString(t),Ht.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),hi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function td(t){return t.matches(hi)?t:t.querySelector(hi)}const nd={display:"none"};function sd(t){let{id:e,value:n}=t;return Se.createElement("div",{id:e,style:nd},n)}function rd(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 Se.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function id(){const[t,e]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const Oo=w.createContext(null);function od(t){const e=w.useContext(Oo);w.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function ad(){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 a;return(a=o[s])==null?void 0:a.call(o,i)})},[t]),e]}const ld={draggable:`
|
|
3
|
+
To pick up a draggable item, press the space bar.
|
|
4
|
+
While dragging, use the arrow keys to move the item.
|
|
5
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
6
|
+
`},cd={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 dd(t){let{announcements:e=cd,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=ld}=t;const{announce:i,announcement:o}=id(),a=as("DndLiveRegion"),[l,d]=w.useState(!1);if(w.useEffect(()=>{d(!0)},[]),od(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])),!l)return null;const f=Se.createElement(Se.Fragment,null,Se.createElement(sd,{id:r,value:s.draggable}),Se.createElement(rd,{id:a,announcement:o}));return n?Ut.createPortal(f,n):f}var ze;(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"})(ze||(ze={}));function Es(){}function pi(t,e){return w.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function ud(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return w.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const It=Object.freeze({x:0,y:0});function $o(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function fd(t,e){const n=Rs(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 Mo(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function hd(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function gi(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 zo(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function mi(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 Cm=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=mi(e,e.left,e.top),i=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const d=$o(mi(l),s);i.push({id:a,data:{droppableContainer:o,value:d}})}}return i.sort(Mo)},Lo=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=gi(e),i=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const d=gi(l),f=s.reduce((h,p,m)=>h+$o(d[m],p),0),u=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(Mo)};function pd(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,a=i-n;if(r<s&&n<i){const l=e.width*e.height,d=t.width*t.height,f=o*a,u=f/(l+d-f);return Number(u.toFixed(4))}return 0}const gd=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const l=pd(a,e);l>0&&s.push({id:o,data:{droppableContainer:i,value:l}})}}return s.sort(hd)};function md(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function Po(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:It}function xd(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,a)=>({...o,top:o.top+t*a.y,bottom:o.bottom+t*a.y,left:o.left+t*a.x,right:o.right+t*a.x}),{...n})}}const bd=xd(1);function Fo(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 yd(t,e,n){const r=Fo(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:a}=r,l=t.left-o-(1-s)*parseFloat(n),d=t.top-a-(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:l+f,bottom:d+u,left:l}}const kd={ignoreTransform:!1};function On(t,e){e===void 0&&(e=kd);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:f}=it(t).getComputedStyle(t);d&&(n=yd(n,d,f))}const{top:r,left:s,width:i,height:o,bottom:a,right:l}=n;return{top:r,left:s,width:i,height:o,bottom:a,right:l}}function xi(t){return On(t,{ignoreTransform:!0})}function vd(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=it(t).getComputedStyle(t)),e.position==="fixed"}function Sd(t,e){e===void 0&&(e=it(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function Hs(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(Fr(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!is(s)||Ao(s)||n.includes(s))return n;const i=it(t).getComputedStyle(s);return s!==t&&Sd(s,i)&&n.push(s),wd(s,i)?n:r(s.parentNode)}return t?r(t):n}function Uo(t){const[e]=Hs(t,1);return e??null}function tr(t){return!Fs||!t?null:An(t)?t:Pr(t)?Fr(t)||t===Bn(t).scrollingElement?window:is(t)?t:null:null}function qo(t){return An(t)?t.scrollX:t.scrollLeft}function Ho(t){return An(t)?t.scrollY:t.scrollTop}function ur(t){return{x:qo(t),y:Ho(t)}}var Pe;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Pe||(Pe={}));function Ko(t){return!Fs||!t?!1:t===document.scrollingElement}function Wo(t){const e={x:0,y:0},n=Ko(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,a=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:e}}const Cd={x:.2,y:.2};function jd(t,e,n,r,s){let{top:i,left:o,right:a,bottom:l}=n;r===void 0&&(r=10),s===void 0&&(s=Cd);const{isTop:d,isBottom:f,isLeft:u,isRight:h}=Wo(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=Pe.Backward,m.y=r*Math.abs((e.top+y.height-i)/y.height)):!f&&l>=e.bottom-y.height&&(p.y=Pe.Forward,m.y=r*Math.abs((e.bottom-y.height-l)/y.height)),!h&&a>=e.right-y.width?(p.x=Pe.Forward,m.x=r*Math.abs((e.right-y.width-a)/y.width)):!u&&o<=e.left+y.width&&(p.x=Pe.Backward,m.x=r*Math.abs((e.left+y.width-o)/y.width)),{direction:p,speed:m}}function Td(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 Vo(t){return t.reduce((e,n)=>En(e,ur(n)),It)}function Dd(t){return t.reduce((e,n)=>e+qo(n),0)}function Nd(t){return t.reduce((e,n)=>e+Ho(n),0)}function Go(t,e){if(e===void 0&&(e=On),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);Uo(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const Rd=[["x",["left","right"],Dd],["y",["top","bottom"],Nd]];class Ur{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=Hs(n),s=Vo(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,a]of Rd)for(const l of o)Object.defineProperty(this,l,{get:()=>{const d=a(r),f=s[i]-d;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Xn{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 Ed(t){const{EventTarget:e}=it(t);return t instanceof e?t:Bn(t)}function nr(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 kt;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(kt||(kt={}));function bi(t){t.preventDefault()}function Id(t){t.stopPropagation()}var ae;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(ae||(ae={}));const Qo={start:[ae.Space,ae.Enter],cancel:[ae.Esc],end:[ae.Space,ae.Enter,ae.Tab]},_d=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case ae.Right:return{...n,x:n.x+25};case ae.Left:return{...n,x:n.x-25};case ae.Down:return{...n,y:n.y+25};case ae.Up:return{...n,y:n.y-25}}};class qr{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 Xn(Bn(n)),this.windowListeners=new Xn(it(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(kt.Resize,this.handleCancel),this.windowListeners.add(kt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(kt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&Go(r),n(It)}handleKeyDown(e){if(qs(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=Qo,coordinateGetter:o=_d,scrollBehavior:a="smooth"}=s,{code:l}=e;if(i.end.includes(l)){this.handleEnd(e);return}if(i.cancel.includes(l)){this.handleCancel(e);return}const{collisionRect:d}=r.current,f=d?{x:d.left,y:d.top}:It;this.referenceCoordinates||(this.referenceCoordinates=f);const u=o(e,{active:n,context:r.current,currentCoordinates:f});if(u){const h=ts(u,f),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const y of m){const x=e.code,{isTop:g,isRight:b,isLeft:k,isBottom:v,maxScroll:S,minScroll:j}=Wo(y),C=Td(y),T={x:Math.min(x===ae.Right?C.right-C.width/2:C.right,Math.max(x===ae.Right?C.left:C.left+C.width/2,u.x)),y:Math.min(x===ae.Down?C.bottom-C.height/2:C.bottom,Math.max(x===ae.Down?C.top:C.top+C.height/2,u.y))},N=x===ae.Right&&!b||x===ae.Left&&!k,R=x===ae.Down&&!v||x===ae.Up&&!g;if(N&&T.x!==u.x){const D=y.scrollLeft+h.x,I=x===ae.Right&&D<=S.x||x===ae.Left&&D>=j.x;if(I&&!h.y){y.scrollTo({left:D,behavior:a});return}I?p.x=y.scrollLeft-D:p.x=x===ae.Right?y.scrollLeft-S.x:y.scrollLeft-j.x,p.x&&y.scrollBy({left:-p.x,behavior:a});break}else if(R&&T.y!==u.y){const D=y.scrollTop+h.y,I=x===ae.Down&&D<=S.y||x===ae.Up&&D>=j.y;if(I&&!h.x){y.scrollTo({top:D,behavior:a});return}I?p.y=y.scrollTop-D:p.y=x===ae.Down?y.scrollTop-S.y:y.scrollTop-j.y,p.y&&y.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(e,En(ts(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()}}qr.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=Qo,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function yi(t){return!!(t&&"distance"in t)}function ki(t){return!!(t&&"delay"in t)}class Hr{constructor(e,n,r){var s;r===void 0&&(r=Ed(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=Bn(o),this.documentListeners=new Xn(this.document),this.listeners=new Xn(r),this.windowListeners=new Xn(it(o)),this.initialCoordinates=(s=Rs(i))!=null?s:It,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(kt.Resize,this.handleCancel),this.windowListeners.add(kt.DragStart,bi),this.windowListeners.add(kt.VisibilityChange,this.handleCancel),this.windowListeners.add(kt.ContextMenu,bi),this.documentListeners.add(kt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ki(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(yi(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(kt.Click,Id,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(kt.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const l=(n=Rs(e))!=null?n:It,d=ts(s,l);if(!r&&a){if(yi(a)){if(a.tolerance!=null&&nr(d,a.tolerance))return this.handleCancel();if(nr(d,a.distance))return this.handleStart()}if(ki(a)&&nr(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}e.cancelable&&e.preventDefault(),o(l)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===ae.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const Ad={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Kr extends Hr{constructor(e){const{event:n}=e,r=Bn(n.target);super(e,Ad,r)}}Kr.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 Bd={move:{name:"mousemove"},end:{name:"mouseup"}};var fr;(function(t){t[t.RightClick=2]="RightClick"})(fr||(fr={}));class Od extends Hr{constructor(e){super(e,Bd,Bn(e.event.target))}}Od.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===fr.RightClick?!1:(r?.({event:n}),!0)}}];const sr={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class $d extends Hr{constructor(e){super(e,sr)}static setup(){return window.addEventListener(sr.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(sr.move.name,e)};function e(){}}}$d.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 Yn;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Yn||(Yn={}));var Is;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Is||(Is={}));function Md(t){let{acceleration:e,activator:n=Yn.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=Is.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:f,delta:u,threshold:h}=t;const p=Ld({delta:u,disabled:!i}),[m,y]=Zc(),x=w.useRef({x:0,y:0}),g=w.useRef({x:0,y:0}),b=w.useMemo(()=>{switch(n){case Yn.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Yn.DraggableRect:return s}},[n,s,l]),k=w.useRef(null),v=w.useCallback(()=>{const j=k.current;if(!j)return;const C=x.current.x*g.current.x,T=x.current.y*g.current.y;j.scrollBy(C,T)},[]),S=w.useMemo(()=>a===Is.TreeOrder?[...d].reverse():d,[a,d]);w.useEffect(()=>{if(!i||!d.length||!b){y();return}for(const j of S){if(r?.(j)===!1)continue;const C=d.indexOf(j),T=f[C];if(!T)continue;const{direction:N,speed:R}=jd(j,T,b,e,h);for(const D of["x","y"])p[D][N[D]]||(R[D]=0,N[D]=0);if(R.x>0||R.y>0){y(),k.current=j,m(v,o),x.current=R,g.current=N;return}}x.current={x:0,y:0},g.current={x:0,y:0},y()},[e,v,r,y,i,o,JSON.stringify(b),JSON.stringify(p),m,d,S,f,JSON.stringify(h)])}const zd={x:{[Pe.Backward]:!1,[Pe.Forward]:!1},y:{[Pe.Backward]:!1,[Pe.Forward]:!1}};function Ld(t){let{delta:e,disabled:n}=t;const r=Ns(e);return os(s=>{if(n||!r||!s)return zd;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Pe.Backward]:s.x[Pe.Backward]||i.x===-1,[Pe.Forward]:s.x[Pe.Forward]||i.x===1},y:{[Pe.Backward]:s.y[Pe.Backward]||i.y===-1,[Pe.Forward]:s.y[Pe.Forward]||i.y===1}}},[n,e,r])}function Pd(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return os(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function Fd(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 ns;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ns||(ns={}));var hr;(function(t){t.Optimized="optimized"})(hr||(hr={}));const vi=new Map;function Ud(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=w.useState(null),{frequency:a,measure:l,strategy:d}=s,f=w.useRef(t),u=x(),h=es(u),p=w.useCallback(function(g){g===void 0&&(g=[]),!h.current&&o(b=>b===null?g:b.concat(g.filter(k=>!b.includes(k))))},[h]),m=w.useRef(null),y=os(g=>{if(u&&!n)return vi;if(!g||g===vi||f.current!==t||i!=null){const b=new Map;for(let k of t){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){b.set(k.id,k.rect.current);continue}const v=k.node.current,S=v?new Ur(l(v),v):null;k.rect.current=S,S&&b.set(k.id,S)}return b}return g},[t,i,n,u,l]);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 a!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},a))},[a,u,p,...r]),{droppableRects:y,measureDroppableContainers:p,measuringScheduled:i!=null};function x(){switch(d){case ns.Always:return!1;case ns.BeforeDragging:return n;default:return!n}}}function Wr(t,e){return os(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function qd(t,e){return Wr(t,e)}function Hd(t){let{callback:e,disabled:n}=t;const r=Us(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 Ks(t){let{callback:e,disabled:n}=t;const r=Us(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 Kd(t){return new Ur(On(t),t)}function wi(t,e,n){e===void 0&&(e=Kd);const[r,s]=w.useState(null);function i(){s(l=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=l??n)!=null?d:null}const f=e(t);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const o=Hd({callback(l){if(t)for(const d of l){const{type:f,target:u}=d;if(f==="childList"&&u instanceof HTMLElement&&u.contains(t)){i();break}}}}),a=Ks({callback:i});return Et(()=>{i(),t?(a?.observe(t),o?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),o?.disconnect())},[t]),r}function Wd(t){const e=Wr(t);return Po(t,e)}const Si=[];function Vd(t){const e=w.useRef(t),n=os(r=>t?r&&r!==Si&&t&&e.current&&t.parentNode===e.current.parentNode?r:Hs(t):Si,[t]);return w.useEffect(()=>{e.current=t},[t]),n}function Gd(t){const[e,n]=w.useState(null),r=w.useRef(t),s=w.useCallback(i=>{const o=tr(i.target);o&&n(a=>a?(a.set(o,ur(o)),new Map(a)):null)},[]);return w.useEffect(()=>{const i=r.current;if(t!==i){o(i);const a=t.map(l=>{const d=tr(l);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,ur(d)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=t}return()=>{o(t),o(i)};function o(a){a.forEach(l=>{const d=tr(l);d?.removeEventListener("scroll",s)})}},[s,t]),w.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>En(i,o),It):Vo(t):It,[t,e])}function Ci(t,e){e===void 0&&(e=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},e),w.useEffect(()=>{const r=t!==It;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?ts(t,n.current):It}function Qd(t){w.useEffect(()=>{if(!Fs)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 Xd(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 Xo(t){return w.useMemo(()=>t?vd(t):null,[t])}const ji=[];function Yd(t,e){e===void 0&&(e=On);const[n]=t,r=Xo(n?it(n):null),[s,i]=w.useState(ji);function o(){i(()=>t.length?t.map(l=>Ko(l)?r:new Ur(e(l),l)):ji)}const a=Ks({callback:o});return Et(()=>{a?.disconnect(),o(),t.forEach(l=>a?.observe(l))},[t]),s}function Yo(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return is(e)?e:t}function Zd(t){let{measure:e}=t;const[n,r]=w.useState(null),s=w.useCallback(d=>{for(const{target:f}of d)if(is(f)){r(u=>{const h=e(f);return u?{...u,width:h.width,height:h.height}:h});break}},[e]),i=Ks({callback:s}),o=w.useCallback(d=>{const f=Yo(d);i?.disconnect(),f&&i?.observe(f),r(f?e(f):null)},[e,i]),[a,l]=Ds(o);return w.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Jd=[{sensor:Kr,options:{}},{sensor:qr,options:{}}],eu={current:{}},js={draggable:{measure:xi},droppable:{measure:xi,strategy:ns.WhileDragging,frequency:hr.Optimized},dragOverlay:{measure:On}};class Zn 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 tu={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Zn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Es},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:js,measureDroppableContainers:Es,windowRect:null,measuringScheduled:!1},Zo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Es,draggableNodes:new Map,over:null,measureDroppableContainers:Es},ls=w.createContext(Zo),Jo=w.createContext(tu);function nu(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Zn}}}function su(t,e){switch(e.type){case ze.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case ze.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 ze.DragEnd:case ze.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ze.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new Zn(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case ze.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 Zn(t.droppable.containers);return o.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:o}}}case ze.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new Zn(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function ru(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=w.useContext(ls),i=Ns(r),o=Ns(n?.id);return w.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!qs(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:l,node:d}=a;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[l.current,d.current]){if(!f)continue;const u=td(f);if(u){u.focus();break}}})}},[r,e,s,o,i]),null}function ea(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function iu(t){return w.useMemo(()=>({draggable:{...js.draggable,...t?.draggable},droppable:{...js.droppable,...t?.droppable},dragOverlay:{...js.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function ou(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=w.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;Et(()=>{if(!o&&!a||!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=Po(f,r);if(o||(u.x=0),a||(u.y=0),i.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const h=Uo(d);h&&h.scrollBy({top:u.y,left:u.x})}},[e,o,a,r,n])}const Ws=w.createContext({...It,scaleX:1,scaleY:1});var Ft;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ft||(Ft={}));const au=w.memo(function(e){var n,r,s,i;let{id:o,accessibility:a,autoScroll:l=!0,children:d,sensors:f=Jd,collisionDetection:u=gd,measuring:h,modifiers:p,...m}=e;const y=w.useReducer(su,void 0,nu),[x,g]=y,[b,k]=ad(),[v,S]=w.useState(Ft.Uninitialized),j=v===Ft.Initialized,{draggable:{active:C,nodes:T,translate:N},droppable:{containers:R}}=x,D=C!=null?T.get(C):null,I=w.useRef({initial:null,translated:null}),O=w.useMemo(()=>{var de;return C!=null?{id:C,data:(de=D?.data)!=null?de:eu,rect:I}:null},[C,D]),E=w.useRef(null),[P,_]=w.useState(null),[B,$]=w.useState(null),K=es(m,Object.values(m)),Z=as("DndDescribedBy",o),F=w.useMemo(()=>R.getEnabled(),[R]),q=iu(h),{droppableRects:Q,measureDroppableContainers:G,measuringScheduled:ee}=Ud(F,{dragging:j,dependencies:[N.x,N.y],config:q.droppable}),W=Pd(T,C),ne=w.useMemo(()=>B?Rs(B):null,[B]),J=tt(),se=qd(W,q.draggable.measure);ou({activeNode:C!=null?T.get(C):null,config:J.layoutShiftCompensation,initialRect:se,measure:q.draggable.measure});const M=wi(W,q.draggable.measure,se),U=wi(W?W.parentElement:null),Y=w.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=R.getNodeFor((n=Y.current.over)==null?void 0:n.id),A=Zd({measure:q.dragOverlay.measure}),V=(r=A.nodeRef.current)!=null?r:W,te=j?(s=A.rect)!=null?s:M:null,ce=!!(A.nodeRef.current&&A.rect),Te=Wd(ce?null:M),pe=Xo(V?it(V):null),De=Vd(j?re??W:null),fe=Yd(De),ot=ea(p,{transform:{x:N.x-Te.x,y:N.y-Te.y,scaleX:1,scaleY:1},activatorEvent:B,active:O,activeNodeRect:M,containerNodeRect:U,draggingNodeRect:te,over:Y.current.over,overlayNodeRect:A.rect,scrollableAncestors:De,scrollableAncestorRects:fe,windowRect:pe}),Ie=ne?En(ne,N):null,dt=Gd(De),ye=Ci(dt),ge=Ci(dt,[M]),Le=En(ot,ye),me=te?bd(te,ot):null,xt=O&&me?u({active:O,collisionRect:me,droppableRects:Q,droppableContainers:F,pointerCoordinates:Ie}):null,Ke=zo(xt,"id"),[Ae,We]=w.useState(null),Ze=ce?ot:En(ot,ge),bt=md(Ze,(i=Ae?.rect)!=null?i:null,M),Fe=w.useRef(null),Ve=w.useCallback((de,we)=>{let{sensor:xe,options:Ne}=we;if(E.current==null)return;const ke=T.get(E.current);if(!ke)return;const Ce=de.nativeEvent,je=new xe({active:E.current,activeNode:ke,event:Ce,options:Ne,context:Y,onAbort(he){if(!T.get(he))return;const{onDragAbort:_e}=K.current,qe={id:he};_e?.(qe),b({type:"onDragAbort",event:qe})},onPending(he,Be,_e,qe){if(!T.get(he))return;const{onDragPending:$e}=K.current,Re={id:he,constraint:Be,initialCoordinates:_e,offset:qe};$e?.(Re),b({type:"onDragPending",event:Re})},onStart(he){const Be=E.current;if(Be==null)return;const _e=T.get(Be);if(!_e)return;const{onDragStart:qe}=K.current,Oe={activatorEvent:Ce,active:{id:Be,data:_e.data,rect:I}};Ut.unstable_batchedUpdates(()=>{qe?.(Oe),S(Ft.Initializing),g({type:ze.DragStart,initialCoordinates:he,active:Be}),b({type:"onDragStart",event:Oe}),_(Fe.current),$(Ce)})},onMove(he){g({type:ze.DragMove,coordinates:he})},onEnd:Ue(ze.DragEnd),onCancel:Ue(ze.DragCancel)});Fe.current=je;function Ue(he){return async function(){const{active:_e,collisions:qe,over:Oe,scrollAdjustedTranslate:$e}=Y.current;let Re=null;if(_e&&$e){const{cancelDrop:Me}=K.current;Re={activatorEvent:Ce,active:_e,collisions:qe,delta:$e,over:Oe},he===ze.DragEnd&&typeof Me=="function"&&await Promise.resolve(Me(Re))&&(he=ze.DragCancel)}E.current=null,Ut.unstable_batchedUpdates(()=>{g({type:he}),S(Ft.Uninitialized),We(null),_(null),$(null),Fe.current=null;const Me=he===ze.DragEnd?"onDragEnd":"onDragCancel";if(Re){const He=K.current[Me];He?.(Re),b({type:Me,event:Re})}})}}},[T]),Je=w.useCallback((de,we)=>(xe,Ne)=>{const ke=xe.nativeEvent,Ce=T.get(Ne);if(E.current!==null||!Ce||ke.dndKit||ke.defaultPrevented)return;const je={active:Ce};de(xe,we.options,je)===!0&&(ke.dndKit={capturedBy:we.sensor},E.current=Ne,Ve(xe,we))},[T,Ve]),ut=Fd(f,Je);Qd(f),Et(()=>{M&&v===Ft.Initializing&&S(Ft.Initialized)},[M,v]),w.useEffect(()=>{const{onDragMove:de}=K.current,{active:we,activatorEvent:xe,collisions:Ne,over:ke}=Y.current;if(!we||!xe)return;const Ce={active:we,activatorEvent:xe,collisions:Ne,delta:{x:Le.x,y:Le.y},over:ke};Ut.unstable_batchedUpdates(()=>{de?.(Ce),b({type:"onDragMove",event:Ce})})},[Le.x,Le.y]),w.useEffect(()=>{const{active:de,activatorEvent:we,collisions:xe,droppableContainers:Ne,scrollAdjustedTranslate:ke}=Y.current;if(!de||E.current==null||!we||!ke)return;const{onDragOver:Ce}=K.current,je=Ne.get(Ke),Ue=je&&je.rect.current?{id:je.id,rect:je.rect.current,data:je.data,disabled:je.disabled}:null,he={active:de,activatorEvent:we,collisions:xe,delta:{x:ke.x,y:ke.y},over:Ue};Ut.unstable_batchedUpdates(()=>{We(Ue),Ce?.(he),b({type:"onDragOver",event:he})})},[Ke]),Et(()=>{Y.current={activatorEvent:B,active:O,activeNode:W,collisionRect:me,collisions:xt,droppableRects:Q,draggableNodes:T,draggingNode:V,draggingNodeRect:te,droppableContainers:R,over:Ae,scrollableAncestors:De,scrollAdjustedTranslate:Le},I.current={initial:te,translated:me}},[O,W,xt,me,T,V,te,Q,R,Ae,De,Le]),Md({...J,delta:N,draggingRect:me,pointerCoordinates:Ie,scrollableAncestors:De,scrollableAncestorRects:fe});const ft=w.useMemo(()=>({active:O,activeNode:W,activeNodeRect:M,activatorEvent:B,collisions:xt,containerNodeRect:U,dragOverlay:A,draggableNodes:T,droppableContainers:R,droppableRects:Q,over:Ae,measureDroppableContainers:G,scrollableAncestors:De,scrollableAncestorRects:fe,measuringConfiguration:q,measuringScheduled:ee,windowRect:pe}),[O,W,M,B,xt,U,A,T,R,Q,Ae,G,De,fe,q,ee,pe]),et=w.useMemo(()=>({activatorEvent:B,activators:ut,active:O,activeNodeRect:M,ariaDescribedById:{draggable:Z},dispatch:g,draggableNodes:T,over:Ae,measureDroppableContainers:G}),[B,ut,O,M,g,Z,T,Ae,G]);return Se.createElement(Oo.Provider,{value:k},Se.createElement(ls.Provider,{value:et},Se.createElement(Jo.Provider,{value:ft},Se.createElement(Ws.Provider,{value:bt},d)),Se.createElement(ru,{disabled:a?.restoreFocus===!1})),Se.createElement(dd,{...a,hiddenTextDescribedById:Z}));function tt(){const de=P?.autoScrollEnabled===!1,we=typeof l=="object"?l.enabled===!1:l===!1,xe=j&&!de&&!we;return typeof l=="object"?{...l,enabled:xe}:{enabled:xe}}}),lu=w.createContext(null),Ti="button",cu="Draggable";function du(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=as(cu),{activators:o,activatorEvent:a,active:l,activeNodeRect:d,ariaDescribedById:f,draggableNodes:u,over:h}=w.useContext(ls),{role:p=Ti,roleDescription:m="draggable",tabIndex:y=0}=s??{},x=l?.id===e,g=w.useContext(x?Ws:lu),[b,k]=Ds(),[v,S]=Ds(),j=Xd(o,e),C=es(n);Et(()=>(u.set(e,{id:e,key:i,node:b,activatorNode:v,data:C}),()=>{const N=u.get(e);N&&N.key===i&&u.delete(e)}),[u,e]);const T=w.useMemo(()=>({role:p,tabIndex:y,"aria-disabled":r,"aria-pressed":x&&p===Ti?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,p,y,x,m,f.draggable]);return{active:l,activatorEvent:a,activeNodeRect:d,attributes:T,isDragging:x,listeners:r?void 0:j,node:b,over:h,setNodeRef:k,setActivatorNodeRef:S,transform:g}}function ta(){return w.useContext(Jo)}const uu="Droppable",fu={timeout:25};function na(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=as(uu),{active:o,dispatch:a,over:l,measureDroppableContainers:d}=w.useContext(ls),f=w.useRef({disabled:n}),u=w.useRef(!1),h=w.useRef(null),p=w.useRef(null),{disabled:m,updateMeasurementsFor:y,timeout:x}={...fu,...s},g=es(y??r),b=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},x)},[x]),k=Ks({callback:b,disabled:m||!o}),v=w.useCallback((T,N)=>{k&&(N&&(k.unobserve(N),u.current=!1),T&&k.observe(T))},[k]),[S,j]=Ds(v),C=es(e);return w.useEffect(()=>{!k||!S.current||(k.disconnect(),u.current=!1,k.observe(S.current))},[S,k]),w.useEffect(()=>(a({type:ze.RegisterDroppable,element:{id:r,key:i,disabled:n,node:S,rect:h,data:C}}),()=>a({type:ze.UnregisterDroppable,key:i,id:r})),[r]),w.useEffect(()=>{n!==f.current.disabled&&(a({type:ze.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:o,rect:h,isOver:l?.id===r,node:S,over:l,setNodeRef:j}}function hu(t){let{animation:e,children:n}=t;const[r,s]=w.useState(null),[i,o]=w.useState(null),a=Ns(n);return!n&&!r&&a&&s(a),Et(()=>{if(!i)return;const l=r?.key,d=r?.props.id;if(l==null||d==null){s(null);return}Promise.resolve(e(d,i)).then(()=>{s(null)})},[e,r,i]),Se.createElement(Se.Fragment,null,n,r?w.cloneElement(r,{ref:o}):null)}const pu={x:0,y:0,scaleX:1,scaleY:1};function gu(t){let{children:e}=t;return Se.createElement(ls.Provider,{value:Zo},Se.createElement(Ws.Provider,{value:pu},e))}const mu={position:"fixed",touchAction:"none"},xu=t=>qs(t)?"transform 250ms ease":void 0,bu=w.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:a,style:l,transform:d,transition:f=xu}=t;if(!a)return null;const u=s?d:{...d,scaleX:1,scaleY:1},h={...mu,width:a.width,height:a.height,top:a.top,left:a.left,transform:Ht.Transform.toString(u),transformOrigin:s&&r?fd(r,a):void 0,transition:typeof f=="function"?f(r):f,...l};return Se.createElement(n,{className:o,style:h,ref:e},i)}),yu=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[l,d]of Object.entries(s))n.node.style.setProperty(l,d);o!=null&&o.active&&n.node.classList.remove(o.active)}},ku=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Ht.Transform.toString(e)},{transform:Ht.Transform.toString(n)}]},vu={duration:250,easing:"ease",keyframes:ku,sideEffects:yu({styles:{active:{opacity:"0"}}})};function wu(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return Us((i,o)=>{if(e===null)return;const a=n.get(i);if(!a)return;const l=a.node.current;if(!l)return;const d=Yo(o);if(!d)return;const{transform:f}=it(o).getComputedStyle(o),u=Fo(f);if(!u)return;const h=typeof e=="function"?e:Su(e);return Go(l,s.draggable.measure),h({active:{id:i,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:s,transform:u})})}function Su(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...vu,...t};return i=>{let{active:o,dragOverlay:a,transform:l,...d}=i;if(!e)return;const f={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},u={scaleX:l.scaleX!==1?o.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?o.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-f.x,y:l.y-f.y,...u},p=s({...d,active:o,dragOverlay:a,transform:{initial:l,final:h}}),[m]=p,y=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(y))return;const x=r?.({active:o,dragOverlay:a,...d}),g=a.node.animate(p,{duration:e,easing:n,fill:"forwards"});return new Promise(b=>{g.onfinish=()=>{x?.(),b()}})}}let Di=0;function Cu(t){return w.useMemo(()=>{if(t!=null)return Di++,Di},[t])}const ju=Se.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:l,zIndex:d=999}=t;const{activatorEvent:f,active:u,activeNodeRect:h,containerNodeRect:p,draggableNodes:m,droppableContainers:y,dragOverlay:x,over:g,measuringConfiguration:b,scrollableAncestors:k,scrollableAncestorRects:v,windowRect:S}=ta(),j=w.useContext(Ws),C=Cu(u?.id),T=ea(o,{activatorEvent:f,active:u,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:x.rect,over:g,overlayNodeRect:x.rect,scrollableAncestors:k,scrollableAncestorRects:v,transform:j,windowRect:S}),N=Wr(h),R=wu({config:r,draggableNodes:m,droppableContainers:y,measuringConfiguration:b}),D=N?x.setRef:void 0;return Se.createElement(gu,null,Se.createElement(hu,{animation:R},u&&C?Se.createElement(bu,{key:C,id:u.id,ref:D,as:a,activatorEvent:f,adjustScale:e,className:l,transition:i,rect:N,style:{zIndex:d,...s},transform:T},n):null))});function Tu(t){const{org:e}=Ee(),{data:n}=Ji.useSession(),r=Sl(),s=Jt(),i=hl({connectionId:go,orgId:e.id,orgSlug:e.slug}),[o,a]=w.useState(!1),l=bl(t,{enabled:!1});return{connect:async()=>{if(!(o||!n?.user?.id||!e)){a(!0);try{const f=l.data??(await l.refetch()).data;if(!f){Bt.error("Could not find this integration in the registry");return}const u=Dl(f,e.id,n.user.id,{remoteIndex:0});if(!u.connection_url){Bt.error("This integration has no connection method available");return}const h=u.app_name?await Du(i,u.app_name):null,p=!h,m=h?.id??(await r.create.mutateAsync(u)).id,y=await Tl({connectionId:m,orgId:e.id,orgSlug:e.slug,persistFallback:x=>r.update.mutateAsync({id:m,data:{connection_token:x}}).then(()=>{})});if(y.ran&&!y.ok){if(p)try{await r.delete.mutateAsync(m)}catch{}Bt.error(`Authentication failed: ${y.error??"no token"}`);return}Qa(s,e.id),Bt.success(p?"Connected successfully":"Already connected")}catch(f){Bt.error(`Failed to connect: ${f instanceof Error?f.message:String(f)}`)}finally{a(!1)}}},isConnecting:o}}async function Du(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 Vr(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function Nu(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function ms(t){return t!==null&&t>=0}function Ru(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 Eu(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const sa=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=Vr(e,r,n),o=e[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},xs={scaleX:1,scaleY:1},Iu=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const a=(e=i[n])!=null?e:r;if(!a)return null;if(s===n){const d=i[o];return d?{x:0,y:n<o?d.top+d.height-(a.top+a.height):d.top-a.top,...xs}:null}const l=_u(i,s,n);return s>n&&s<=o?{x:0,y:-a.height-l,...xs}:s<n&&s>=o?{x:0,y:a.height+l,...xs}:{x:0,y:0,...xs}};function _u(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 ra="Sortable",ia=Se.createContext({activeIndex:-1,containerId:ra,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sa,disabled:{draggable:!1,droppable:!1}});function Au(t){let{children:e,id:n,items:r,strategy:s=sa,disabled:i=!1}=t;const{active:o,dragOverlay:a,droppableRects:l,over:d,measureDroppableContainers:f}=ta(),u=as(ra,n),h=a.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,x=d?p.indexOf(d.id):-1,g=w.useRef(p),b=!Ru(p,g.current),k=x!==-1&&y===-1||b,v=Eu(i);Et(()=>{b&&m&&f(p)},[b,p,m,f]),w.useEffect(()=>{g.current=p},[p]);const S=w.useMemo(()=>({activeIndex:y,containerId:u,disabled:v,disableTransforms:k,items:p,overIndex:x,useDragOverlay:h,sortedRects:Nu(p,l),strategy:s}),[y,u,v.draggable,v.droppable,k,p,x,l,h,s]);return Se.createElement(ia.Provider,{value:S},e)}const Bu=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return Vr(n,r,s).indexOf(e)},Ou=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:l,transition:d}=t;return!d||!r||a!==i&&s===o?!1:n?!0:o!==s&&e===l},$u={duration:200,easing:"ease"},oa="transform",Mu=Ht.Transition.toString({property:oa,duration:0,easing:"linear"}),zu={roleDescription:"sortable"};function Lu(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=w.useState(null),a=w.useRef(n);return Et(()=>{if(!e&&n!==a.current&&r.current){const l=s.current;if(l){const d=On(r.current,{ignoreTransform:!0}),f={x:l.left-d.left,y:l.top-d.top,scaleX:l.width/d.width,scaleY:l.height/d.height};(f.x||f.y)&&o(f)}}n!==a.current&&(a.current=n)},[e,n,r,s]),w.useEffect(()=>{i&&o(null)},[i]),i}function Pu(t){let{animateLayoutChanges:e=Ou,attributes:n,disabled:r,data:s,getNewIndex:i=Bu,id:o,strategy:a,resizeObserverConfig:l,transition:d=$u}=t;const{items:f,containerId:u,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:y,overIndex:x,useDragOverlay:g,strategy:b}=w.useContext(ia),k=Fu(r,p),v=f.indexOf(o),S=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:C,node:T,isOver:N,setNodeRef:R}=na({id:o,data:S,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...l}}),{active:D,activatorEvent:I,activeNodeRect:O,attributes:E,setNodeRef:P,listeners:_,isDragging:B,over:$,setActivatorNodeRef:K,transform:Z}=du({id:o,data:S,attributes:{...zu,...n},disabled:k.draggable}),F=Yc(R,P),q=!!D,Q=q&&!m&&ms(h)&&ms(x),G=!g&&B,ee=G&&Q?Z:null,ne=Q?ee??(a??b)({rects:y,activeNodeRect:O,activeIndex:h,overIndex:x,index:v}):null,J=ms(h)&&ms(x)?i({id:o,items:f,activeIndex:h,overIndex:x}):v,se=D?.id,M=w.useRef({activeId:se,items:f,newIndex:J,containerId:u}),U=f!==M.current.items,Y=e({active:D,containerId:u,isDragging:B,isSorting:q,id:o,index:v,items:f,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:d,wasDragging:M.current.activeId!=null}),re=Lu({disabled:!Y,index:v,node:T,rect:C});return w.useEffect(()=>{q&&M.current.newIndex!==J&&(M.current.newIndex=J),u!==M.current.containerId&&(M.current.containerId=u),f!==M.current.items&&(M.current.items=f)},[q,J,u,f]),w.useEffect(()=>{if(se===M.current.activeId)return;if(se!=null&&M.current.activeId==null){M.current.activeId=se;return}const V=setTimeout(()=>{M.current.activeId=se},50);return()=>clearTimeout(V)},[se]),{active:D,activeIndex:h,attributes:E,data:S,rect:C,index:v,newIndex:J,items:f,isOver:N,isSorting:q,isDragging:B,listeners:_,node:T,overIndex:x,over:$,setNodeRef:F,setActivatorNodeRef:K,setDroppableNodeRef:R,setDraggableNodeRef:P,transform:re??ne,transition:A()};function A(){if(re||U&&M.current.newIndex===v)return Mu;if(!(G&&!qs(I)||!d)&&(q||Y))return Ht.Transition.toString({...d,property:oa})}}function Fu(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 _s(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 Uu=[ae.Down,ae.Right,ae.Up,ae.Left],qu=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:a}}=e;if(Uu.includes(t.code)){if(t.preventDefault(),!n||!r)return;const l=[];i.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const h=s.get(u.id);if(h)switch(t.code){case ae.Down:r.top<h.top&&l.push(u);break;case ae.Up:r.top>h.top&&l.push(u);break;case ae.Left:r.left>h.left&&l.push(u);break;case ae.Right:r.left<h.left&&l.push(u);break}});const d=Lo({collisionRect:r,droppableRects:s,droppableContainers:l});let f=zo(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 x=Hs(m).some((j,C)=>a[C]!==j),g=aa(u,h),b=Hu(u,h),k=x||!g?{x:0,y:0}:{x:b?r.width-p.width:0,y:b?r.height-p.height:0},v={x:p.left,y:p.top};return k.x&&k.y?v:ts(v,k)}}}};function aa(t,e){return!_s(t)||!_s(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function Hu(t,e){return!_s(t)||!_s(e)||!aa(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}function Rt(t){const e=L.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=X("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==o?(a=c.jsx("img",{src:pl,alt:"Super Agent",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=a):a=e[7],a}const Ni=()=>0;function Ku(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 a=w.useRef(null),l=w.useRef(n),d=w.useRef(e);(!a.current||l.current!==n||d.current!==e)&&(l.current=n,d.current=e,a.current=u=>{if(!n||!e)return()=>{};const h=p=>{let m;try{m=JSON.parse(p.data)}catch{return}m.data&&(p.type===Rl?o.current?.(m.data.id):i.current(m.data)),u()};return Nl.subscribe(e,h)}),w.useSyncExternalStore(a.current,Ni,Ni)}function Wu(){const t=L.c(30),{org:e,locator:n}=Ee(),r=en(),s=Jt();let i;t[0]!==n?(i=be.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const o=i;let a;t[2]!==r?(a=async()=>(await r.call("TASK_BOARD_ITEM_LIST",{})).items,t[2]=r,t[3]=a):a=t[3];let l;t[4]!==o||t[5]!==a?(l={queryKey:o,queryFn:a},t[4]=o,t[5]=a,t[6]=l):l=t[6];const d=st(l);let f;t[7]!==n||t[8]!==s||t[9]!==o?(f=g=>{s.setQueryData(o,b=>{const k=b??[];return k.some(v=>v.id===g.id)?k.map(v=>v.id===g.id?g:v):[g,...k]}),s.invalidateQueries({queryKey:be.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,b=>b?.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],Ku(h);let p;t[18]!==s||t[19]!==o?(p=g=>{const b=g.subject,k=g.data.status;s.setQueryData(o,v=>v?.map(S=>S.threads.some(j=>j.threadId===b)?{...S,threads:S.threads.map(j=>j.threadId===b?{...j,status:k}:j)}:S))},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],Il(m);let y;t[24]!==d.data?(y=d.data??[],t[24]=d.data,t[25]=y):y=t[25];let x;return t[26]!==d.error||t[27]!==d.isLoading||t[28]!==y?(x={items:y,isLoading:d.isLoading,error:d.error},t[26]=d.error,t[27]=d.isLoading,t[28]=y,t[29]=x):x=t[29],x}function Vu(){const t=L.c(40),{locator:e}=Ee(),n=en(),r=Jt();let s;t[0]!==e?(s=be.taskBoardItems(e),t[0]=e,t[1]=s):s=t[1];const i=s;let o;t[2]!==r||t[3]!==i?(o=()=>r.invalidateQueries({queryKey:i}),t[2]=r,t[3]=i,t[4]=o):o=t[4];const a=o;let l;t[5]!==n?(l=T=>n.call("TASK_BOARD_ITEM_CREATE",T),t[5]=n,t[6]=l):l=t[6];let d;t[7]!==a||t[8]!==l?(d={mutationFn:l,onSuccess:a},t[7]=a,t[8]=l,t[9]=d):d=t[9];const f=ct(d);let u;t[10]!==n?(u=T=>n.call("TASK_BOARD_ITEM_UPDATE",T),t[10]=n,t[11]=u):u=t[11];let h,p;t[12]!==r||t[13]!==i?(h=async T=>{await r.cancelQueries({queryKey:i});const N=r.getQueryData(i);return r.setQueryData(i,R=>R?.map(D=>D.id===T.id?{...D,...T}:D)),{previous:N}},p=(T,N,R)=>{R?.previous&&r.setQueryData(i,R.previous)},t[12]=r,t[13]=i,t[14]=h,t[15]=p):(h=t[14],p=t[15]);let m;t[16]!==a||t[17]!==e||t[18]!==r?(m=(T,N,R)=>{a(),r.invalidateQueries({queryKey:be.taskBoardActivity(e,R.id)})},t[16]=a,t[17]=e,t[18]=r,t[19]=m):m=t[19];let y;t[20]!==u||t[21]!==h||t[22]!==p||t[23]!==m?(y={mutationFn:u,onMutate:h,onError:p,onSettled:m},t[20]=u,t[21]=h,t[22]=p,t[23]=m,t[24]=y):y=t[24];const x=ct(y);let g;t[25]!==n?(g=T=>n.call("TASK_BOARD_ITEM_DELETE",{id:T}),t[25]=n,t[26]=g):g=t[26];let b;t[27]!==a||t[28]!==g?(b={mutationFn:g,onSuccess:a},t[27]=a,t[28]=g,t[29]=b):b=t[29];const k=ct(b);let v;t[30]!==n?(v=T=>n.call("TASK_BOARD_ITEM_UPDATE",T),t[30]=n,t[31]=v):v=t[31];let S;t[32]!==a||t[33]!==v?(S={mutationFn:v,onSuccess:a},t[32]=a,t[33]=v,t[34]=S):S=t[34];const j=ct(S);let C;return t[35]!==f||t[36]!==j||t[37]!==k||t[38]!==x?(C={create:f,update:x,remove:k,link:j},t[35]=f,t[36]=j,t[37]=k,t[38]=x,t[39]=C):C=t[39],C}function As(t){return t.threads.some(e=>e.status==="requires_action")}function Gr(t){return t.status==="in_progress"&&As(t)?"text-warning animate-pulse":vt[t.status].iconClassName}function Gu(t){return t.threads[0]}function Ri(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,a=o===-1?i.length:o,l=i[a-1],d=i[a];return l&&d?(l.sortOrder+d.sortOrder)/2:l?l.sortOrder+1:d?d.sortOrder-1:0}function la(t,e){return Array.from({length:e},(n,r)=>t-(e-1-r)*1e-4)}const Bs=["triage","todo","in_progress","in_review","done"],vt={triage:{labelKey:"taskBoard.config.statusBacklog",icon:Ps,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:_l,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:ss,iconClassName:"text-primary animate-spin"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Al,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:_n,iconClassName:"text-success"}},Qr=["none","low","medium","high","urgent"],wt={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"}},pr=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],ca=pr[0];function cs(t){return t??ca}function Qu(t){return pr[t%pr.length]??ca}function da(t){const e=L.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 a;e[2]!==s?(a={width:s,height:s},e[2]=s,e[3]=a):a=e[3];let l;e[4]!==r?(l=X("shrink-0 rounded-full object-cover",r),e[4]=r,e[5]=l):l=e[5];let d;return e[6]!==s||e[7]!==o||e[8]!==a||e[9]!==l?(d=c.jsx("img",{src:gl,alt:o,width:s,height:s,style:a,className:l}),e[6]=s,e[7]=o,e[8]=a,e[9]=l,e[10]=d):d=e[10],d}function ua(t){const e=L.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=X("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==o?(a=c.jsx("img",{src:ml,alt:"Code Reviewer",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=a):a=e[7],a}let gr,mr;if(typeof WeakMap<"u"){let t=new WeakMap;gr=e=>t.get(e),mr=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;gr=r=>{for(let s=0;s<t.length;s+=2)if(t[s]==r)return t[s+1]},mr=(r,s)=>(n==10&&(n=0),t[n++]=r,t[n++]=s)}var Lt=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 a=1;i<this.width&&this.map[e+a]==n;a++)i++;for(let a=1;o<this.height&&this.map[e+this.width*a]==n;a++)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:a,top:l,bottom:d}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(s,l),right:Math.max(r,a),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 a=(t+1)*this.width;for(;o<a&&this.map[o]<s;)o++;return o==a?i-1:this.map[o]}s=i}}static get(t){return gr(t)||mr(t,Xu(t))}};function Xu(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Yu(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:x,rowspan:g,colwidth:b}=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 S=0;S<x;S++){r[v+S]==0?r[v+S]=f:(i||(i=[])).push({type:"collision",row:d,pos:f,n:x-S});const j=b&&b[S];if(j){const C=(v+S)%e*2,T=o[C];T==null||T!=j&&o[C+1]==1?(o[C]=j,o[C+1]=1):T==j&&o[C+1]++}}}s+=x,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 a=new Lt(e,n,r,i);let l=!1;for(let d=0;!l&&d<o.length;d+=2)o[d]!=null&&o[d+1]<n&&(l=!0);return l&&Zu(a,o,t),a}function Yu(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 a=t.child(o);for(let l=0;l<a.childCount;l++){const d=a.child(l);o+d.attrs.rowspan>r&&(i+=d.attrs.colspan)}}for(let o=0;o<s.childCount;o++){const a=s.child(o);i+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function Zu(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 a=null;const l=o.attrs;for(let d=0;d<l.colspan;d++){const f=e[(s+d)%t.width*2];f!=null&&(!l.colwidth||l.colwidth[d]!=f)&&((a||(a=Ju(l)))[d]=f)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function Ju(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Xr(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 qt("selectingCells");function ef(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 fa(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 tf(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=ef(e.$head)||nf(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function nf(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 Ei(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function ha(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function pa(t,e,n){const r=t.node(-1),s=Lt.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 Ii(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 $t=class zt extends Ot{constructor(e,n=e){const r=e.node(-1),s=Lt.get(r),i=e.start(-1),o=s.rectBetween(e.pos-i,n.pos-i),a=e.node(0),l=s.cellsInRect(o).filter(f=>f!=n.pos-i);l.unshift(n.pos-i);const d=l.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 Pl(a.resolve(h),a.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(Ei(r)&&Ei(s)&&ha(r,s)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?zt.rowSelection(r,s):i&&this.isColSelection()?zt.colSelection(r,s):new zt(r,s)}return yo.between(r,s)}content(){const e=this.$anchorCell.node(-1),n=Lt.get(e),r=this.$anchorCell.start(-1),s=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},o=[];for(let l=s.top;l<s.bottom;l++){const d=[];for(let f=l*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,x=p.right-s.right;if(y>0||x>0){let g=m.attrs;if(y>0&&(g=Ii(g,0,y)),x>0&&(g=Ii(g,g.colspan-x,x)),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(l).copy(Js.from(d)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new Kn(Js.from(a),1,1)}replace(e,n=Kn.empty){const r=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){const{$from:a,$to:l}=s[o],d=e.mapping.slice(r);e.replace(d.map(a.pos),d.map(l.pos),o?Kn.empty:n)}const i=Ot.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new Kn(Js.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Lt.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=Lt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),a=s.findCell(n.pos-i),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(i+s.map[o.left])),a.bottom<s.height&&(n=l.resolve(i+s.map[s.width*(s.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(i+s.map[a.left])),o.bottom<s.height&&(e=l.resolve(i+s.map[s.width*(s.height-1)+o.right-1]))),new zt(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Lt.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,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==n.width}eq(e){return e instanceof zt&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),s=Lt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),a=s.findCell(n.pos-i),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(i+s.map[o.top*s.width])),a.right<s.width&&(n=l.resolve(i+s.map[s.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(i+s.map[a.top*s.width])),o.right<s.width&&(e=l.resolve(i+s.map[s.width*(o.top+1)-1]))),new zt(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new zt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new zt(e.resolve(n),e.resolve(r))}getBookmark(){return new sf(this.$anchorCell.pos,this.$headCell.pos)}};$t.prototype.visible=!1;Ot.jsonID("cell",$t);var sf=class ga{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ga(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&&ha(n,r)?new $t(n,r):Ot.near(r,1)}};new qt("fix-tables");function ma(t){const e=t.selection,n=tf(t),r=n.node(-1),s=n.start(-1),i=Lt.get(r);return{...e instanceof $t?i.rectBetween(e.$anchorCell.pos-s,e.$headCell.pos-s):i.findCell(n.pos-s),tableStart:s,map:i,table:r}}function rf(t){return function(e,n){if(!fa(e))return!1;if(n){const r=Xr(e.schema),s=ma(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),a=o.map(l=>s.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==r.header_cell&&i.setNodeMarkup(s.tableStart+o[l],r.cell,a[l].attrs);if(i.steps.length===0)for(let l=0;l<o.length;l++)i.setNodeMarkup(s.tableStart+o[l],r.header_cell,a[l].attrs);n(i)}return!0}}function _i(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 Yr(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?rf(t):function(n,r){if(!fa(n))return!1;if(r){const s=Xr(n.schema),i=ma(n),o=n.tr,a=_i("row",i,s),l=_i("column",i,s),d=(t==="column"?a:t==="row"&&l)?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"?l?s.cell:s.header_cell:t=="row"?a?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}}Yr("row",{useDeprecatedLogic:!0});Yr("column",{useDeprecatedLogic:!0});Yr("cell",{useDeprecatedLogic:!0});function bs(t,e){const n=t.selection;if(!(n instanceof $t))return!1;if(e){const r=t.tr,s=Xr(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 Kn(s,0,0))}),r.docChanged&&e(r)}return!0}Fl({ArrowLeft:ys("horiz",-1),ArrowRight:ys("horiz",1),ArrowUp:ys("vert",-1),ArrowDown:ys("vert",1),"Shift-ArrowLeft":ks("horiz",-1),"Shift-ArrowRight":ks("horiz",1),"Shift-ArrowUp":ks("vert",-1),"Shift-ArrowDown":ks("vert",1),Backspace:bs,"Mod-Backspace":bs,Delete:bs,"Mod-Delete":bs});function Ts(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function ys(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;if(i instanceof $t)return Ts(n,r,Ot.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const o=xa(s,t,e);if(o==null)return!1;if(t=="horiz")return Ts(n,r,Ot.near(n.doc.resolve(i.head+e),e));{const a=n.doc.resolve(o),l=pa(a,t,e);let d;return l?d=Ot.near(l,1):e<0?d=Ot.near(n.doc.resolve(a.before(-1)),-1):d=Ot.near(n.doc.resolve(a.after(-1)),1),Ts(n,r,d)}}}function ks(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;let o;if(i instanceof $t)o=i;else{const l=xa(s,t,e);if(l==null)return!1;o=new $t(n.doc.resolve(l))}const a=pa(o.$headCell,t,e);return a?Ts(n,r,new $t(o.$anchorCell,a)):!1}}function xa(t,e,n){if(!(t.state.selection instanceof yo))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),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?o:null}}return null}new qt("tableColumnResizing");function of(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,a=r-n,l=s,d=n;return new DOMRect(l,d,o,a)}var af=class{constructor({editor:t,element:e,view:n,pluginKey:r="bubbleMenu",updateDelay:s=250,resizeDelay:i=60,shouldShow:o,appendTo:a,getReferencedVirtualElement:l,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:x}=h,{empty:g}=x,b=!y.textBetween(p,m).length&&Ul(h.selection),k=this.element.contains(document.activeElement);return!(!(u.hasFocus()||k)||g||b||!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=a,this.scrollTarget=(f=d?.scrollTarget)!=null?f:window,this.getReferencedVirtualElement=l,this.floatingUIOptions={...this.floatingUIOptions,...d},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(eo(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(to(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(no(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(so(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(ro(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(io(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(oo(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(ao(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=ko(this.view,r.from,r.to);let o={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(r instanceof ql){let a=this.view.nodeDOM(r.from);const l=a.dataset.nodeViewWrapper?a:a.querySelector("[data-node-view-wrapper]");l&&(a=l),a&&(o={getBoundingClientRect:()=>a.getBoundingClientRect(),getClientRects:()=>[a.getBoundingClientRect()]})}if(r instanceof $t){const{$anchorCell:a,$headCell:l}=r,d=a?a.pos:l.pos,f=l?l.pos:a.pos,u=this.view.nodeDOM(d),h=this.view.nodeDOM(f);if(!u||!h)return;const p=u===h?u.getBoundingClientRect():of(u.getBoundingClientRect(),h.getBoundingClientRect());o={getBoundingClientRect:()=>p,getClientRects:()=>[p]}}return o}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&lo(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(l=>l.$from.pos)),o=Math.max(...s.map(l=>l.$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()}},ba=t=>new _r({key:typeof t.pluginKey=="string"?new qt(t.pluginKey):t.pluginKey,view:e=>new af({view:e,...t})});Ar.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ba({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 lf=class{constructor({editor:t,element:e,view:n,pluginKey:r="floatingMenu",updateDelay:s=250,resizeDelay:i=60,options:o,appendTo:a,shouldShow:l}){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,x=p.parent.isTextblock&&!p.parent.type.spec.code&&!p.parent.textContent&&p.parent.childCount===0&&!this.getTextContent(p.parent);return!(!f.hasFocus()||!m||!y||!x||!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=a,this.scrollTarget=(d=o?.scrollTarget)!=null?d:window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,l&&(this.shouldShow=l),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 Hl(t,{textSerializers:Kl(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(eo(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(to(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(no(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(so(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(ro(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(io(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(oo(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(ao(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(l=>l.$from.pos)),o=Math.max(...s.map(l=>l.$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=ko(this.view,t.from,t.to);lo({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 a,l;if((a=o.hide)!=null&&a.referenceHidden||(l=o.hide)!=null&&l.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()}},ya=t=>new _r({key:typeof t.pluginKey=="string"?new qt(t.pluginKey):t.pluginKey,view:e=>new lf({view:e,...t})});Ar.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?[ya({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 cf=Se.forwardRef(({pluginKey:t="bubbleMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,getReferencedVirtualElement:o,options:a,children:l,...d},f)=>{const u=w.useRef(document.createElement("div"));typeof f=="function"?f(u.current):f&&(f.current=u.current);const{editor:h}=vo(),p=e||h,m={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,getReferencedVirtualElement:o,options:a},y=w.useRef(m);y.current=m;const[x,g]=w.useState(!1),b=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=ba({...y.current,editor:p,element:k});p.registerPlugin(v);const S=y.current.pluginKey;return b.current=!0,g(!0),()=>{g(!1),p.unregisterPlugin(S),window.requestAnimationFrame(()=>{k.parentNode&&k.parentNode.removeChild(k)})}},[p]),w.useEffect(()=>{if(!(!x||!p||p.isDestroyed)){if(b.current){b.current=!1;return}p.view.dispatch(p.state.tr.setMeta(t,{type:"updateOptions",options:y.current}))}},[x,p,n,r,i,a,s,o]),Ut.createPortal(c.jsx("div",{...d,children:l}),u.current)});Se.forwardRef(({pluginKey:t="floatingMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,options:o,children:a,...l},d)=>{const f=w.useRef(document.createElement("div"));typeof d=="function"?d(f.current):d&&(d.current=f.current);const{editor:u}=vo(),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,x]=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 b=f.current;b.style.visibility="hidden",b.style.position="absolute";const k=ya({...m.current,editor:h,element:b});h.registerPlugin(k);const v=m.current.pluginKey;return g.current=!0,x(!0),()=>{x(!1),h.unregisterPlugin(v),window.requestAnimationFrame(()=>{b.parentNode&&b.parentNode.removeChild(b)})}},[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]),Ut.createPortal(c.jsx("div",{...l,children:a}),f.current)});const df=new Set(["http:","https:","mailto:","tel:","ftp:"]);function ka(t){if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const e=new URL(t,"https://placeholder.invalid");return df.has(e.protocol)}catch{return!1}}function va(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 uf="noopener noreferrer nofollow";function lt(t){const e=L.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 a;e[0]!==o?(a=X("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",o),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==n||e[3]!==i||e[4]!==r||e[5]!==s||e[6]!==a?(l=c.jsx("button",{type:"button","aria-label":r,"aria-pressed":n,onMouseDown:ff,onClick:s,className:a,children:i}),e[2]=n,e[3]=i,e[4]=r,e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function ff(t){return t.preventDefault()}function Ai(t){const e=L.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=X("flex-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer",i),e[0]=i,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==o?(a=c.jsx("button",{type:"button","aria-pressed":n,onMouseDown:hf,onClick:s,className:o,children:r}),e[2]=n,e[3]=r,e[4]=s,e[5]=o,e[6]=a):a=e[6],a}function hf(t){return t.preventDefault()}function jm(t){const e=L.c(36),{editor:n,active:r,open:s,onOpenChange:i}=t,o=oe(),[a,l]=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 D=n.getAttributes("link");l(typeof D.href=="string"?D.href:""),f(r?D.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 x=y;let g;e[7]!==a||e[8]!==n||e[9]!==d||e[10]!==i?(g=()=>{const D=va(a);if(D===""){n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1);return}if(!ka(D)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:D,target:d?"_blank":null,rel:d?uf:null}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=d,e[10]=i,e[11]=g):g=e[11];const b=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 S;e[15]!==o?(S=o("sectionsEditor.richTextLinkControl.linkButtonLabel"),e[15]=o,e[16]=S):S=e[16];const j=s?x:m;let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=c.jsx(Ro,{size:14}),e[17]=C):C=e[17];let T;e[18]!==r||e[19]!==S||e[20]!==j?(T=c.jsx(lt,{active:r,label:S,onClick:j,children:C}),e[18]=r,e[19]=S,e[20]=j,e[21]=T):T=e[21];let N;e[22]!==r||e[23]!==b||e[24]!==x||e[25]!==a||e[26]!==u||e[27]!==d||e[28]!==i||e[29]!==s||e[30]!==v||e[31]!==o?(N=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:D=>{D.currentTarget.contains(D.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:a,onChange:D=>{l(D.target.value),h(!1)},onKeyDown:D=>{D.key==="Enter"?(D.preventDefault(),b()):D.key==="Escape"&&(D.preventDefault(),x())},className:X("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(lt,{active:!1,label:o("sectionsEditor.richTextLinkControl.applyLinkLabel"),onClick:b,children:c.jsx(rs,{size:14})}),r&&c.jsx(lt,{active:!1,label:o("sectionsEditor.richTextLinkControl.removeLinkLabel"),onClick:v,children:c.jsx(Io,{size:14})})]}),c.jsxs("div",{className:"flex items-center gap-0.5 rounded bg-muted/40 p-0.5",children:[c.jsx(Ai,{active:!d,label:o("sectionsEditor.richTextLinkControl.sameTabLabel"),onSelect:()=>f(!1)}),c.jsx(Ai,{active:d,label:o("sectionsEditor.richTextLinkControl.newTabLabel"),onSelect:()=>f(!0)})]})]}),e[22]=r,e[23]=b,e[24]=x,e[25]=a,e[26]=u,e[27]=d,e[28]=i,e[29]=s,e[30]=v,e[31]=o,e[32]=N):N=e[32];let R;return e[33]!==T||e[34]!==N?(R=c.jsxs("div",{className:"relative",children:[T,N]}),e[33]=T,e[34]=N,e[35]=R):R=e[35],R}function pf(t){const e=L.c(30),{editor:n}=t,r=oe(),[s,i]=w.useState(!1),[o,a]=w.useState(""),[l,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 C=n.getAttributes("link").href;a(typeof C=="string"?C:""),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 x;e[7]!==o||e[8]!==n||e[9]!==y?(x=()=>{const C=va(o);if(C===""){y();return}if(!ka(C)){d(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:C}).run(),i(!1)},e[7]=o,e[8]=n,e[9]=y,e[10]=x):x=e[10];const g=x;let b;e[11]!==r?(b=r("markdownEditor.link"),e[11]=r,e[12]=b):b=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(Ro,{size:14}),e[13]=k):k=e[13];let v;e[14]!==u||e[15]!==b||e[16]!==p?(v=c.jsx(lt,{active:u,label:b,onClick:p,children:k}),e[14]=u,e[15]=b,e[16]=p,e[17]=v):v=e[17];let S;e[18]!==u||e[19]!==g||e[20]!==o||e[21]!==n||e[22]!==l||e[23]!==s||e[24]!==y||e[25]!==r?(S=s&&c.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:C=>{C.currentTarget.contains(C.relatedTarget)||i(!1)},children:[c.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":l,placeholder:r("markdownEditor.linkPlaceholder"),value:o,onChange:C=>{a(C.target.value),d(!1)},onKeyDown:C=>{C.key==="Enter"?(C.preventDefault(),g()):C.key==="Escape"&&(C.preventDefault(),i(!1),n.chain().focus().run())},className:X("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",l&&"text-destructive")}),c.jsx(lt,{active:!1,label:r("markdownEditor.linkApply"),onClick:g,children:c.jsx(rs,{size:14})}),u&&c.jsx(lt,{active:!1,label:r("markdownEditor.linkRemove"),onClick:y,children:c.jsx(Io,{size:14})})]}),e[18]=u,e[19]=g,e[20]=o,e[21]=n,e[22]=l,e[23]=s,e[24]=y,e[25]=r,e[26]=S):S=e[26];let j;return e[27]!==v||e[28]!==S?(j=c.jsxs("div",{className:"relative",children:[v,S]}),e[27]=v,e[28]=S,e[29]=j):j=e[29],j}const rr=()=>{const t=L.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},Bi=t=>{const e=L.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},wa=[1,2,3],gf=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function mf(t){const e=L.c(20),{editor:n}=t,r=oe(),[s,i]=w.useState(null);let o;e[0]!==n?(o={editor:n,selector:xf},e[0]=n,e[1]=o):o=e[1];const a=Wl(o);let l;e[2]!==r?(l=r("markdownEditor.heading1"),e[2]=r,e[3]=l):l=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]!==l||e[9]!==d||e[10]!==f?(u={1:l,2:d,3:f},e[8]=l,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]!==a||e[16]!==r?(p=s&&c.jsxs(cf,{editor:n,shouldShow:gf,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(lt,{active:a.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:c.jsx(Ja,{size:14})}),c.jsx(lt,{active:a.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:c.jsx(el,{size:14})}),c.jsx(lt,{active:a.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:c.jsx(tl,{size:14})}),c.jsx(lt,{active:a.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:c.jsx(nl,{size:14})}),c.jsx(rr,{}),wa.map((y,x)=>c.jsx(lt,{active:a.headings[x]??!1,label:h[y],onClick:()=>n.chain().focus().toggleHeading({level:y}).run(),children:c.jsx(Bi,{children:`H${y}`})},y)),c.jsx(rr,{}),c.jsx(lt,{active:a.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:c.jsx(ho,{size:14})}),c.jsx(lt,{active:a.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:c.jsx(Bi,{children:"1."})}),c.jsx(lt,{active:a.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:c.jsx(sl,{size:14})}),c.jsx(rr,{}),c.jsx(pf,{editor:n})]}),e[12]=n,e[13]=h,e[14]=s,e[15]=a,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 xf(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:wa.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}function Zr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tn=Zr();function Sa(t){tn=t}var Vt={exec:()=>null};function le(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(rt.caret,"$1"),n=n.replace(s,o),r},getRegex:()=>new RegExp(n,e)};return r}var bf=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),rt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},yf=/^(?:[ \t]*(?:\n|$))+/,kf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,vf=/^ {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+|$)/,wf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Jr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ca=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ja=le(Ca).replace(/bull/g,Jr).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(),Sf=le(Ca).replace(/bull/g,Jr).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(),ei=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Cf=/^[^\n]+/,ti=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,jf=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ti).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Tf=le(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Jr).getRegex(),Vs="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",ni=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Df=le("^ {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",ni).replace("tag",Vs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ta=le(ei).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",Vs).getRegex(),Nf=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ta).getRegex(),si={blockquote:Nf,code:kf,def:jf,fences:vf,heading:wf,hr:ds,html:Df,lheading:ja,list:Tf,newline:yf,paragraph:Ta,table:Vt,text:Cf},Oi=le("^ *([^\\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",Vs).getRegex(),Rf={...si,lheading:Sf,table:Oi,paragraph:le(ei).replace("hr",ds).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Oi).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",Vs).getRegex()},Ef={...si,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ni).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:Vt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(ei).replace("hr",ds).replace("heading",` *#{1,6} *[^
|
|
7
|
+
]`).replace("lheading",ja).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},If=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_f=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Da=/^( {2,}|\\)\n(?!\s*$)/,Af=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$n=/[\p{P}\p{S}]/u,Gs=/[\s\p{P}\p{S}]/u,ri=/[^\s\p{P}\p{S}]/u,Bf=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Gs).getRegex(),Na=/(?!~)[\p{P}\p{S}]/u,Of=/(?!~)[\s\p{P}\p{S}]/u,$f=/(?:[^\s\p{P}\p{S}]|~)/u,Mf=le(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",bf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ra=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,zf=le(Ra,"u").replace(/punct/g,$n).getRegex(),Lf=le(Ra,"u").replace(/punct/g,Na).getRegex(),Ea="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Pf=le(Ea,"gu").replace(/notPunctSpace/g,ri).replace(/punctSpace/g,Gs).replace(/punct/g,$n).getRegex(),Ff=le(Ea,"gu").replace(/notPunctSpace/g,$f).replace(/punctSpace/g,Of).replace(/punct/g,Na).getRegex(),Uf=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ri).replace(/punctSpace/g,Gs).replace(/punct/g,$n).getRegex(),qf=le(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,$n).getRegex(),Hf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Kf=le(Hf,"gu").replace(/notPunctSpace/g,ri).replace(/punctSpace/g,Gs).replace(/punct/g,$n).getRegex(),Wf=le(/\\(punct)/,"gu").replace(/punct/g,$n).getRegex(),Vf=le(/^<(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(),Gf=le(ni).replace("(?:-->|$)","-->").getRegex(),Qf=le("^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",Gf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Os=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Xf=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Os).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ia=le(/^!?\[(label)\]\[(ref)\]/).replace("label",Os).replace("ref",ti).getRegex(),_a=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",ti).getRegex(),Yf=le("reflink|nolink(?!\\()","g").replace("reflink",Ia).replace("nolink",_a).getRegex(),$i=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ii={_backpedal:Vt,anyPunctuation:Wf,autolink:Vf,blockSkip:Mf,br:Da,code:_f,del:Vt,delLDelim:Vt,delRDelim:Vt,emStrongLDelim:zf,emStrongRDelimAst:Pf,emStrongRDelimUnd:Uf,escape:If,link:Xf,nolink:_a,punctuation:Bf,reflink:Ia,reflinkSearch:Yf,tag:Qf,text:Af,url:Vt},Zf={...ii,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",Os).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Os).getRegex()},xr={...ii,emStrongRDelimAst:Ff,emStrongLDelim:Lf,delLDelim:qf,delRDelim:Kf,url:le(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",$i).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:le(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",$i).getRegex()},Jf={...xr,br:le(Da).replace("{2,}","*").getRegex(),text:le(xr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},vs={normal:si,gfm:Rf,pedantic:Ef},Un={normal:ii,gfm:xr,breaks:Jf,pedantic:Zf},eh={"&":"&","<":"<",">":">",'"':""","'":"'"},Mi=t=>eh[t];function At(t,e){if(e){if(rt.escapeTest.test(t))return t.replace(rt.escapeReplace,Mi)}else if(rt.escapeTestNoEncode.test(t))return t.replace(rt.escapeReplaceNoEncode,Mi);return t}function zi(t){try{t=encodeURI(t).replace(rt.percentDecode,"%")}catch{return null}return t}function Li(t,e){let n=t.replace(rt.findPipe,(i,o,a)=>{let l=!1,d=o;for(;--d>=0&&a[d]==="\\";)l=!l;return l?"|":" |"}),r=n.split(rt.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(rt.slashPipe,"|");return r}function qn(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 Pi(t,e,n,r,s){let i=e.href,o=e.title||null,a=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function sh(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[a]=o;return a.length>=s.length?i.slice(s.length):i}).join(`
|
|
9
|
+
`)}var $s=class{options;rules;lexer;constructor(t){this.options=t||tn}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:qn(n,`
|
|
10
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=sh(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=qn(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:qn(e[0],`
|
|
11
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=qn(e[0],`
|
|
12
|
+
`).split(`
|
|
13
|
+
`),r="",s="",i=[];for(;n.length>0;){let o=!1,a=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),o=!0;else if(!o)a.push(n[l]);else break;n=n.slice(l);let d=a.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 l=!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),l=!0),!l){let y=this.rules.other.nextBulletRegex(m),x=this.rules.other.hrRegex(m),g=this.rules.other.fencesBeginRegex(m),b=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m),v=this.rules.other.blockquoteBeginRegex(m);for(;t;){let S=t.split(`
|
|
26
|
+
`,1)[0],j;if(h=S,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),j=h):j=h.replace(this.rules.other.tabCharGlobal," "),g.test(h)||b.test(h)||k.test(h)||v.test(h)||y.test(h)||x.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)||b.test(u)||x.test(u))break;f+=`
|
|
28
|
+
`+h}p=!h.trim(),d+=S+`
|
|
29
|
+
`,t=t.substring(S.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 a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.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(l.raw);if(d){let f={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};l.checked=f.checked,s.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=f.raw+l.tokens[0].raw,l.tokens[0].text=f.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(f)):l.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):l.tokens.unshift(f)}}if(!s.loose){let d=l.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 l of s.items){l.loose=!0;for(let d of l.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=Li(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(Li(o,i.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[l]})));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=qn(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)),Pi(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 Pi(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,a=s,l=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]){a+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);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,a=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+s);(r=l.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]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);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}}}},Dt=class br{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||tn,this.options.tokenizer=this.options.tokenizer||new $s,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:rt,block:vs.normal,inline:Un.normal};this.options.pedantic?(n.block=vs.pedantic,n.inline=Un.pedantic):this.options.gfm&&(n.block=vs.gfm,this.options.breaks?n.inline=Un.breaks:n.inline=Un.gfm),this.tokenizer.rules=n}static get rules(){return{block:vs,inline:Un}}static lex(e,n){return new br(n).lex(e)}static lexInline(e,n){return new br(n).inlineTokens(e)}lex(e){e=e.replace(rt.carriageReturn,`
|
|
32
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(rt.tabCharGlobal," ").replace(rt.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let o=n.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
|
|
33
|
+
`:n.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
34
|
+
`)?"":`
|
|
35
|
+
`)+s.raw,o.text+=`
|
|
36
|
+
`+s.text,this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
37
|
+
`)?"":`
|
|
38
|
+
`)+s.raw,o.text+=`
|
|
39
|
+
`+s.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),n.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let o=1/0,a=e.slice(1),l;this.options.extensions.startBlock.forEach(d=>{l=d.call({lexer:this},a),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),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 l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)l.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,a="";for(;e;){o||(a=""),o=!1;let l;if(this.options.extensions?.inline?.some(f=>(l=f.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let f=n.at(-1);l.type==="text"&&f?.type==="text"?(f.raw+=l.raw,f.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,r,a)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e,r,a)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);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(l=this.tokenizer.inlineText(d)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),o=!0;let f=n.at(-1);f?.type==="text"?(f.raw+=l.raw,f.text+=l.text):n.push(l);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}},Ms=class{options;parser;constructor(t){this.options=t||tn}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(rt.notSpaceStart)?.[0],s=t.replace(rt.endingNewline,"")+`
|
|
46
|
+
`;return r?'<pre><code class="language-'+At(r)+'">'+(n?s:At(s,!0))+`</code></pre>
|
|
47
|
+
`:"<pre><code>"+(n?s:At(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 a=t.items[o];r+=this.listitem(a)}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>${At(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=zi(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+At(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=zi(t);if(s===null)return At(n);t=s;let i=`<img src="${t}" alt="${At(n)}"`;return e&&(i+=` title="${At(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:At(t.text)}},oi=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}},Nt=class yr{options;renderer;textRenderer;constructor(e){this.options=e||tn,this.options.renderer=this.options.renderer||new Ms,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new oi}static parse(e,n){return new yr(n).parse(e)}static parseInline(e,n){return new yr(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,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=a||"";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 a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=a||"";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 a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},Wn=class{options;block;constructor(t){this.options=t||tn}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?Dt.lex:Dt.lexInline}provideParser(t=this.block){return t?Nt.parse:Nt.parseInline}},rh=class{defaults=Zr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Nt;Renderer=Ms;TextRenderer=oi;Lexer=Dt;Tokenizer=$s;Hooks=Wn;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 a=s.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}: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 Ms(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,a=n.renderer[o],l=s[o];s[o]=(...d)=>{let f=a.apply(s,d);return f===!1&&(f=l.apply(s,d)),f||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new $s(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,a=n.tokenizer[o],l=s[o];s[o]=(...d)=>{let f=a.apply(s,d);return f===!1&&(f=l.apply(s,d)),f}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new Wn;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,a=n.hooks[o],l=s[o];Wn.passThroughHooks.has(i)?s[o]=d=>{if(this.defaults.async&&Wn.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await a.call(s,d);return l.call(s,u)})();let f=a.call(s,d);return l.call(s,f)}:s[o]=(...d)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(s,d);return u===!1&&(u=await l.apply(s,d)),u})();let f=a.apply(s,d);return f===!1&&(f=l.apply(s,d)),f}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Dt.lex(t,e??this.defaults)}parser(t,e){return Nt.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,a=await(s.hooks?await s.hooks.provideLexer(t):t?Dt.lex:Dt.lexInline)(o,s),l=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let d=await(s.hooks?await s.hooks.provideParser(t):t?Nt.parse:Nt.parseInline)(l,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?Dt.lex:Dt.lexInline)(e,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(t):t?Nt.parse:Nt.parseInline)(o,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}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>"+At(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Zt=new rh;function ue(t,e){return Zt.parse(t,e)}ue.options=ue.setOptions=function(t){return Zt.setOptions(t),ue.defaults=Zt.defaults,Sa(ue.defaults),ue};ue.getDefaults=Zr;ue.defaults=tn;ue.use=function(...t){return Zt.use(...t),ue.defaults=Zt.defaults,Sa(ue.defaults),ue};ue.walkTokens=function(t,e){return Zt.walkTokens(t,e)};ue.parseInline=Zt.parseInline;ue.Parser=Nt;ue.parser=Nt.parse;ue.Renderer=Ms;ue.TextRenderer=oi;ue.Lexer=Dt;ue.lexer=Dt.lex;ue.Tokenizer=$s;ue.Hooks=Wn;ue.parse=ue;ue.options;ue.setOptions;ue.use;ue.walkTokens;ue.parseInline;Nt.parse;Dt.lex;function ih(t,e){const r=e.split(`
|
|
65
|
+
`).flatMap(s=>[s,""]).map(s=>`${t}${s}`).join(`
|
|
66
|
+
`);return r.slice(0,r.length-1)}function oh(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 ah(t,e){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{t.has(r)||n.push({type:r,mark:s})}),n}function lh(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(l=>[l.type,l]))),a=[];if(s||i||o)if(n&&n.type==="text"&&n.marks){const l=new Map(n.marks.map(d=>[d.type,d]));Array.from(t.keys()).forEach(d=>{l.has(d)||a.push(d)})}else(s||i)&&a.push(...Array.from(t.keys()));return a}function ch(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 dh(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 ir(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 ws(t,e){return typeof t!="string"?"json":e}var uh=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,Vl(t.extensions).forEach(a=>this.registerExtension(a,!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=Fn(t,"markdownTokenName")||s,o=Fn(t,"parseMarkdown"),a=Fn(t,"renderMarkdown"),l=Fn(t,"markdownTokenizer"),d=(n=Fn(t,"markdownOptions"))!=null?n:null,f=(r=d?.indentsContent)!=null?r:!1,u={tokenName:i,nodeName:s,parseMarkdown:o,renderMarkdown:a,isIndenting:f,tokenizer:l};if(i&&o){const h=this.registry.get(i)||[];h.push(u),this.registry.set(i,h)}if(a){const h=this.nodeTypeRegistry.get(s)||[];h.push(u),this.nodeTypeRegistry.set(s,h)}l&&this.hasMarked()&&(this.registerTokenizer(l),e&&(this.lexer=new this.markedInstance.Lexer))}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:n,level:r="inline",tokenize:s}=t,a={inlineTokens:f=>this.lexer.inlineTokens(f),blockTokens:f=>this.lexer.blockTokens(f)};let l;n?l=typeof n=="function"?n:f=>f.indexOf(n):l=f=>{const u=s(f,[],a);return u&&u.raw?f.indexOf(u.raw):-1};const d={name:e,level:r,start:l,tokenizer:(f,u)=>{const h=s(f,u,a);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,a)=>(o.type!=="space"&&i.push(a),i),[]);let r=-1,s=0;return t.flatMap((i,o)=>{for(var a;s<n.length&&n[s]<o;)r=n[s],s+=1;if(e&&i.type==="space"){const d=(a=n[s])!=null?a:-1;return this.createImplicitEmptyParagraphsFromSpace(i,r,d)}const l=this.parseToken(i,e);return l===null?[]:Array.isArray(l)?l:[l]})}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),a=this.normalizeParseResult(o);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!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(a=>ir(a).isTask),n=t.items.some(a=>!ir(a).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const r=[];let s=[],i=null;for(let a=0;a<t.items.length;a+=1){const l=t.items[a],{isTask:d,checked:f,indentLevel:u}=ir(l);let h=l;if(d){const y=(l.raw||l.text||"").split(`
|
|
68
|
+
`),x=y[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),g=x?x[2]:"";let b=[];if(y.length>1&&y.slice(1).join(`
|
|
69
|
+
`).trim()){const v=y.slice(1),S=v.filter(j=>j.trim());if(S.length>0){const j=Math.min(...S.map(N=>N.length-N.trimStart().length)),T=v.map(N=>N.trim()?N.slice(j):"").join(`
|
|
70
|
+
`).trim();T&&(b=this.markedInstance.lexer(`${T}
|
|
71
|
+
`))}}h={type:"taskItem",raw:"",mainContent:g,indentLevel:u,checked:f??!1,text:g,tokens:this.lexer.inlineTokens(g),nestedTokens:b}}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 a=0;a<r.length;a+=1){const l=r[a],d={...t,type:l.type,items:l.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 a=t[o];if(a.type==="text")i.push({type:"text",text:a.text||""});else if(a.type==="html"){const l=((n=(e=a.raw)!=null?e:a.text)!=null?n:"").toString(),d=/^<\/[\s]*[\w-]+/i.test(l),f=l.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!d&&f&&!/\/>$/.test(l)){const h=f[1],p=this.escapeRegex(h),m=new RegExp(`^<\\/\\s*${p}\\b`,"i");let y=-1;const x=[l];for(let g=o+1;g<t.length;g+=1){const b=t[g],k=((s=(r=b.raw)!=null?r:b.text)!=null?s:"").toString();if(x.push(k),b.type==="html"&&m.test(k)){y=g;break}}if(y!==-1){const g=x.join(""),b={type:"html",raw:g,text:g,block:!1},k=this.parseHTMLToken(b);if(k){const v=this.normalizeParseResult(k);Array.isArray(v)?i.push(...v):v&&i.push(v)}o=y;continue}}const u=this.parseHTMLToken(a);if(u){const h=this.normalizeParseResult(u);Array.isArray(h)?i.push(...h):h&&i.push(h)}}else if(a.type){const l=this.getHandlerForToken(a.type);if(l&&l.parseMarkdown){const d=this.createParseHelpers(),f=l.parseMarkdown(a,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 a.tokens&&i.push(...this.parseInlineTokens(a.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=Gl(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 a=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,l={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:ih},d={index:n,level:r,parentType:e?.type,previousNode:a,meta:{parentAttrs:e?.attrs,...s}};return((i=o.renderMarkdown)==null?void 0:i.call(o,t,l,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,a)=>{const l=a<t.length-1?t[a+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=ah(i,f),h=oh(f,l);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 b=f.get(g),k=this.getMarkClosing(g,b);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:b})=>{const k=this.getMarkOpening(g,b);k&&(d=k+d),h.includes(g)||i.set(g,b)}),d=m+d;const y=lh(i,f,l,this.markSetsEqual.bind(this));let x="";if(y.length>0){const g=d.match(/(\s+)$/);g&&(x=g[1],d=d.slice(0,-x.length))}y.forEach(g=>{const b=i.get(g),k=this.getMarkClosing(g,b);k&&(d+=k),i.delete(g)}),d+=x,d+=p,s.push(d)}else{const d=new Map(i),f=ch(i,this.getMarkClosing.bind(this)),u=this.renderNodeToMarkdown(o,e,a,r),h=o.type==="hardBreak"?"":dh(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:l=>l,wrapInBlock:(l,d)=>l+d},{index:0,level:0,parentType:"text",meta:{}}),a=o.indexOf(s);return a>=0?o.substring(0,a):""}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:{}}),a=o.indexOf(s),l=a+s.length;return a>=0?o.substring(l):""}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))}},Fi=uh,fh=Ar.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return Mt.setContent(t,e);if(ws(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Mt.setContent(t,e);const r=this.editor.markdown.parse(t);return Mt.setContent(r,e)},insertContent:(t,e)=>{if(!e?.contentType)return Mt.insertContent(t,e);if(ws(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Mt.insertContent(t,e);const r=this.editor.markdown.parse(t);return Mt.insertContent(r,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return Mt.insertContentAt(t,e,n);if(ws(e,n?.contentType)!=="markdown"||!this.editor.markdown)return Mt.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return Mt.insertContentAt(t,s,n)}}},addStorage(){return{manager:new Fi({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 Fi({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||ws(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);this.editor.options.content=e}});function hh(t){const e=L.c(25),{node:n,selected:r,editor:s,deleteNode:i}=t,o=oe(),a=typeof n.attrs.href=="string"?n.attrs.href:"",l=typeof n.attrs.name=="string"?n.attrs.name:"";let d;e[0]!==l||e[1]!==o?(d=l||o("markdownEditor.fileNameFallback"),e[0]=l,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=X("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(rl,{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 x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=c.jsx(ic,{size:14}),e[11]=x):x=e[11];let g;e[12]!==a||e[13]!==f||e[14]!==y?(g=c.jsx("a",{href:a,download:f,"aria-label":y,onMouseDown:gh,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:x}),e[12]=a,e[13]=f,e[14]=y,e[15]=g):g=e[15];let b;e[16]!==i||e[17]!==s.isEditable||e[18]!==o?(b=s.isEditable&&c.jsx("button",{type:"button","aria-label":o("markdownEditor.removeFile"),onMouseDown:ph,onClick:i,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:c.jsx(Gt,{size:14})}),e[16]=i,e[17]=s.isEditable,e[18]=o,e[19]=b):b=e[19];let k;return e[20]!==h||e[21]!==m||e[22]!==g||e[23]!==b?(k=c.jsxs(jo,{as:"span",className:h,children:[p,m,g,b]}),e[20]=h,e[21]=m,e[22]=g,e[23]=b,e[24]=k):k=e[24],k}function ph(t){return t.preventDefault()}function gh(t){return t.preventDefault()}function mh(t){return t.replace(/([[\]])/g,"\\$1")}const xh=wo.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",Co(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`[${mh(n)}](${e})`},addNodeView(){return So(hh)}});var bh=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,yh=wo.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",Co(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 a=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",l=(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:a})=>{const l=document.createElement("img");Object.entries(o).forEach(([u,h])=>{if(h!=null)switch(u){case"width":case"height":break;default:l.setAttribute(u,h);break}}),l.src=o.src;const d=new Xl({element:l,editor:a,node:s,getPos:i,onResize:(u,h)=>{l.style.width=`${u}px`,l.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",l.onload=()=>{f.style.visibility="",f.style.pointerEvents=""},d}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Ql({find:bh,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),kh=yh;function vh(t){const e=L.c(16),{node:n,selected:r,editor:s,deleteNode:i}=t,o=oe(),a=typeof n.attrs.src=="string"?n.attrs.src:"",l=typeof n.attrs.alt=="string"?n.attrs.alt:"";let d;e[0]!==l||e[1]!==o?(d=l||o("markdownEditor.imageAltFallback"),e[0]=l,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=X("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]!==a||e[6]!==d||e[7]!==u?(h=c.jsx("img",{src:a,alt:d,draggable:!1,className:u}),e[5]=a,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:wh,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(Gt,{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(jo,{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 wh(t){return t.preventDefault()}const Sh=kh.extend({addNodeView(){return So(vh)}}).configure({inline:!1,allowBase64:!1}),kr="uploads",Ch="editor-images",Aa="editor-files",jh=new RegExp(`^/api/[^/]+/fs/${kr}/read$`),Ui="http://relative.invalid";function Th(t){let e;try{e=new URL(t,Ui)}catch{return!1}return e.origin!==Ui||!jh.test(e.pathname)?!1:(e.searchParams.get("path")??"").startsWith(`${Aa}/`)}const Dh={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},Nh=Yl.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";return Th(n)?e.createNode("attachment",{href:n,name:t.text??""}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function Rh(t=""){return[Zl.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),Nh.configure(Dh),Sc.configure({placeholder:t}),Sh,xh,fh.configure({markedOptions:{breaks:!0}})]}const Eh=10,Ih=25,_h={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Ah(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??_h[t.type]??(ai(t)?".png":"")}function ai(t){return t.type.startsWith("image/")}function Bh(){const t=oe(),{upload:e}=qc(kr),n=Uc(kr),[r,s]=w.useState(0);return{uploadFile:async o=>{const a=ai(o),l=a?Eh:Ih;if(o.size>l*1024*1024)return Bt.error(t("markdownEditor.fileTooLarge",{name:o.name,max:String(l)})),null;const d=a?Ch:Aa,f=`${crypto.randomUUID()}${Ah(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 Bt.error(t("markdownEditor.uploadFailed",{name:o.name})),null}finally{s(u=>u-1)}},pending:r}}const Oh=["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(" "),$h=["[&_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 qi(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(Ot.near(i.doc.resolve(o))),t.dispatch(i),t.state.selection.to}function Mh({defaultValue:t,onChange:e,placeholder:n}){const r=oe(),{uploadFile:s,pending:i}=Bh(),o=w.useRef(null),a=w.useRef(e),l=w.useRef(s);a.current=e,l.current=s;const d=(h,p,m)=>p.length===0?!1:((async()=>{let y=m;for(const x of p){const g=await l.current(x);g&&(y=ai(x)?qi(h,y,"image",{src:g,alt:x.name}):qi(h,y,"attachment",{href:g,name:x.name}))}})(),!0),f=Jl({extensions:Rh(n),content:t,contentType:"markdown",editorProps:{attributes:{class:X(Oh,$h)},handlePaste:(h,p)=>d(h,Array.from(p.clipboardData?.files??[]),h.state.selection.to),handleDrop:(h,p,m,y)=>{if(y)return!1;const x=Array.from(p.dataTransfer?.files??[]),g=h.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return g===void 0?!1:d(h,x,g)}},onUpdate:({editor:h})=>a.current(h.getMarkdown())});if(!f)return null;const u=h=>{!h||h.length===0||d(f.view,Array.from(h),f.state.selection.to)};return c.jsxs("div",{className:"flex flex-col",children:[c.jsx(mf,{editor:f}),c.jsx(ec,{editor:f,className:"text-[15px] text-foreground"}),c.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground",children:[c.jsx(Xe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":r("markdownEditor.attachFile"),onClick:()=>o.current?.click(),children:c.jsx(il,{size:14})}),i>0&&c.jsxs("span",{className:"inline-flex items-center gap-1.5","aria-live":"polite",role:"status",children:[c.jsx(ss,{size:12,className:"animate-spin"}),i===1?r("markdownEditor.uploading"):r("markdownEditor.uploadingCount",{count:String(i)})]})]}),c.jsx("input",{ref:o,type:"file",multiple:!0,className:"hidden",onChange:h=>{u(h.target.files),h.target.value=""}})]})}const zh=1e4;function Lh(t){const e=L.c(10),{locator:n}=Ee(),r=en();let s;e[0]!==t||e[1]!==n?(s=be.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 a;return e[6]!==s||e[7]!==i||e[8]!==o?(a={queryKey:s,enabled:i,refetchInterval:zh,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=a):a=e[9],st(a)}function Ba(t){const e=L.c(10),{locator:n}=Ee(),r=en();let s;e[0]!==t||e[1]!==n?(s=be.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 a;return e[6]!==s||e[7]!==i||e[8]!==o?(a={queryKey:s,enabled:i,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=a):a=e[9],st(a)}function Ph(t){const e=L.c(10),{locator:n}=Ee(),r=en(),s=Jt();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:be.taskBoardItemPrs(n,t)}),s.invalidateQueries({queryKey:be.taskBoardActivity(n,t)})},e[3]=t,e[4]=n,e[5]=s,e[6]=o):o=e[6];let a;return e[7]!==i||e[8]!==o?(a={mutationFn:i,onSuccess:o},e[7]=i,e[8]=o,e[9]=a):a=e[9],ct(a)}function Fh(t){const e=[];return t.qa&&e.push("qa"),t.codeReview&&e.push("code_review"),e}function Uh(t,e){return e.length===0?!0:El(t,e)}function li(t){const e=L.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(Br,{placeholder:i,className:"h-9"}),e[2]=i,e[3]=o):o=e[3];let a;e[4]!==s?(a=s("taskBoard.taskDialog.noMembersFound"),e[4]=s,e[5]=a):a=e[5];let l;e[6]!==a?(l=c.jsx(Or,{children:a}),e[6]=a,e[7]=l):l=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(nt),e[10]=r,e[11]=f):f=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx(Rt,{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(Pt,{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 x;e[23]!==r?(x=()=>r(null),e[23]=r,e[24]=x):x=e[24];let g;e[25]===Symbol.for("react.memo_cache_sentinel")?(g=c.jsx(cr,{size:16,className:"text-muted-foreground"}),e[25]=g):g=e[25];let b;e[26]!==s?(b=s("taskBoard.taskDialog.unassignedLabel"),e[26]=s,e[27]=b):b=e[27];let k;e[28]!==b?(k=c.jsx("span",{className:"truncate",children:b}),e[28]=b,e[29]=k):k=e[29];let v;e[30]!==y||e[31]!==x||e[32]!==k?(v=c.jsxs(Pt,{value:y,onSelect:x,className:"gap-2",children:[g,k]}),e[30]=y,e[31]=x,e[32]=k,e[33]=v):v=e[33];let S;e[34]!==m||e[35]!==v?(S=c.jsxs(In,{children:[m,v]}),e[34]=m,e[35]=v,e[36]=S):S=e[36];let j;e[37]!==s?(j=s("taskBoard.taskDialog.membersGroupHeading"),e[37]=s,e[38]=j):j=e[38];let C;if(e[39]!==n||e[40]!==r){let D;e[42]!==r?(D=I=>c.jsxs(Pt,{value:I.user?.name??I.userId,onSelect:()=>r(I.userId),className:"gap-2",children:[c.jsx(Ct,{url:I.user?.image??void 0,fallback:St(I.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:I.user?.name??I.userId})]},I.userId),e[42]=r,e[43]=D):D=e[43],C=n.map(D),e[39]=n,e[40]=r,e[41]=C}else C=e[41];let T;e[44]!==j||e[45]!==C?(T=c.jsx(In,{heading:j,children:C}),e[44]=j,e[45]=C,e[46]=T):T=e[46];let N;e[47]!==S||e[48]!==T||e[49]!==l?(N=c.jsxs($r,{children:[l,S,T]}),e[47]=S,e[48]=T,e[49]=l,e[50]=N):N=e[50];let R;return e[51]!==o||e[52]!==N?(R=c.jsxs(Mr,{children:[o,N]}),e[51]=o,e[52]=N,e[53]=R):R=e[53],R}function qh({tags:t,selectedIds:e,defaultColor:n,onToggle:r,onCreate:s,onDelete:i}){const o=oe(),[a,l]=w.useState(""),[d,f]=w.useState(!1),[u,h]=w.useState(n),p=a.trim(),m=t.some(x=>x.name.toLowerCase()===p.toLowerCase()),y=async()=>{if(!(!p||m||d)){f(!0);try{await s(p,u),l("")}finally{f(!1)}}};return c.jsxs(Mr,{children:[c.jsx(Br,{value:a,onValueChange:l,placeholder:o("taskBoard.taskDialog.tagFilterPlaceholder"),className:"h-9"}),c.jsxs($r,{children:[p&&!m?c.jsx(In,{children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{type:"color",value:u,onChange:x=>h(x.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(Pt,{value:`create-${p}`,disabled:d,onSelect:y,className:"flex-1 gap-2",children:[c.jsx(Jn,{size:16,className:"text-muted-foreground"}),c.jsx("span",{className:"truncate",children:o("taskBoard.taskDialog.createTagOption",{name:p})})]})]})}):c.jsx(Or,{children:o("taskBoard.taskDialog.noTagsFound")}),c.jsx(In,{children:t.map(x=>{const g=e.includes(x.id);return c.jsxs(Pt,{value:x.name,onSelect:()=>r(x.id),className:"group gap-2",children:[c.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:cs(x.color)}}),c.jsx("span",{className:"flex-1 truncate",children:x.name}),c.jsx("button",{type:"button","aria-label":o("taskBoard.taskDialog.deleteTagAriaLabel",{name:x.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:b=>{b.stopPropagation(),i(x.id)},children:c.jsx(Cr,{size:13})}),g&&c.jsx(rs,{size:14,className:"shrink-0 text-foreground"})]},x.id)})})]})]})}function Hh(t){if(!t)return[];const e=[],n=new Set,r=(o,a)=>{n.has(o)||(n.add(o),e.push({url:o,label:a.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 Kh(t){const e=L.c(37),{thread:n,me:r,onReply:s,onDelete:i,onToggleResolved:o}=t,a=oe(),[l,d]=w.useState(!1);if(n.resolved&&!l){let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=()=>d(!0),e[0]=b):b=e[0];let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(ol,{size:16,className:"shrink-0 text-muted-foreground"}),e[1]=k):k=e[1];let v;e[2]!==a||e[3]!==n?(v=Vh(n,a),e[2]=a,e[3]=n,e[4]=v):v=e[4];let S;e[5]!==v?(S=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:v}),e[5]=v,e[6]=S):S=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(lc,{size:16,className:"shrink-0 text-muted-foreground"}),e[7]=j):j=e[7];let C;return e[8]!==S?(C=c.jsxs("button",{type:"button",onClick:b,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,S,j]}),e[8]=S,e[9]=C):C=e[9],C}let f;e[10]!==a||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:[a("taskBoard.taskDialog.commentCollapseThread"),c.jsx(Gt,{size:14,"aria-hidden":!0})]}),c.jsx(or,{})]}),e[10]=a,e[11]=n.resolved,e[12]=f):f=e[12];let u;e[13]!==i||e[14]!==n.id?(u=()=>i(n.id),e[13]=i,e[14]=n.id,e[15]=u):u=e[15];let h;e[16]!==o||e[17]!==u||e[18]!==n?(h=c.jsx(Hi,{comment:n,onDelete:u,resolved:n.resolved,onToggleResolved:o}),e[16]=o,e[17]=u,e[18]=n,e[19]=h):h=e[19];let p;if(e[20]!==i||e[21]!==n.replies){let b;e[23]!==i?(b=(k,v)=>c.jsxs(w.Fragment,{children:[c.jsx(or,{inset:v>0}),c.jsx(Hi,{comment:k,onDelete:()=>i(k.id),isReply:!0})]},k.id),e[23]=i,e[24]=b):b=e[24],p=n.replies.map(b),e[20]=i,e[21]=n.replies,e[22]=p}else p=e[22];let m;e[25]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(or,{}),e[25]=m):m=e[25];let y;e[26]!==a?(y=a("taskBoard.taskDialog.commentReplyPlaceholder"),e[26]=a,e[27]=y):y=e[27];let x;e[28]!==r||e[29]!==s||e[30]!==y?(x=c.jsx($a,{variant:"reply",placeholder:y,author:r,onSubmit:s}),e[28]=r,e[29]=s,e[30]=y,e[31]=x):x=e[31];let g;return e[32]!==f||e[33]!==h||e[34]!==p||e[35]!==x?(g=c.jsxs("div",{className:"flex flex-col rounded-xl bg-card card-shadow",children:[f,h,p,m,x]}),e[32]=f,e[33]=h,e[34]=p,e[35]=x,e[36]=g):g=e[36],g}const Wh=new Intl.ListFormat(void 0,{style:"long",type:"conjunction"});function Vh(t,e){const n=[t,...t.replies],r=Wh.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 Gh(t){const e=L.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($a,{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 or(t){const e=L.c(4),{inset:n}=t,r=n&&"ml-12";let s;e[0]!==r?(s=X("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 Hi(t){const e=L.c(25),{comment:n,isReply:r,resolved:s,onDelete:i,onToggleResolved:o}=t;let a;e[0]!==n.author?(a=c.jsx(Oa,{author:n.author}),e[0]=n.author,e[1]=a):a=e[1];let l;e[2]!==n.author.name?(l=c.jsx("span",{className:"text-sm font-medium text-foreground",children:n.author.name}),e[2]=n.author.name,e[3]=l):l=e[3];let d;e[4]!==n.createdAt?(d=Ir(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=c.jsx(Qh,{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]!==a||e[13]!==l||e[14]!==f||e[15]!==u?(h=c.jsxs("div",{className:"flex items-center gap-2",children:[a,l,f,u]}),e[12]=a,e[13]=l,e[14]=f,e[15]=u,e[16]=h):h=e[16];const p=r&&"pl-8";let m;e[17]!==p?(m=X("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 x;return e[22]!==h||e[23]!==y?(x=c.jsxs("div",{className:"group flex flex-col gap-1.5 p-4",children:[h,y]}),e[22]=h,e[23]=y,e[24]=x):x=e[24],x}function Qh(t){const e=L.c(21),{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 a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(jr,{size:16}),e[2]=a):a=e[2];let l;e[3]!==o?(l=c.jsx(Qt,{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:a})}),e[3]=o,e[4]=l):l=e[4];let d;e[5]!==s||e[6]!==n||e[7]!==i?(d=s&&c.jsxs(c.Fragment,{children:[c.jsxs(gt,{onSelect:s,children:[c.jsx(rs,{size:16}),i(n?"taskBoard.taskDialog.commentUnresolveThread":"taskBoard.taskDialog.commentResolveThread")]}),c.jsx(po,{})]}),e[5]=s,e[6]=n,e[7]=i,e[8]=d):d=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(Cr,{size:16}),e[9]=f):f=e[9];let u;e[10]!==i?(u=i("taskBoard.taskDialog.commentDelete"),e[10]=i,e[11]=u):u=e[11];let h;e[12]!==r||e[13]!==u?(h=c.jsxs(gt,{variant:"destructive",onSelect:r,children:[f,u]}),e[12]=r,e[13]=u,e[14]=h):h=e[14];let p;e[15]!==d||e[16]!==h?(p=c.jsxs(Xt,{align:"end",className:"w-48",children:[d,h]}),e[15]=d,e[16]=h,e[17]=p):p=e[17];let m;return e[18]!==l||e[19]!==p?(m=c.jsxs(Yt,{children:[l,p]}),e[18]=l,e[19]=p,e[20]=m):m=e[20],m}function Oa(t){const e=L.c(6),{author:n}=t;if(n.isAgent){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(Rt,{size:24}),e[0]=o):o=e[0],o}const r=n.image??void 0;let s;e[1]!==n.name?(s=St(n.name),e[1]=n.name,e[2]=s):s=e[2];let i;return e[3]!==r||e[4]!==s?(i=c.jsx(Ct,{url:r,fallback:s,shape:"circle",size:"xs"}),e[3]=r,e[4]=s,e[5]=i):i=e[5],i}function $a(t){const e=L.c(36),{variant:n,placeholder:r,author:s,onSubmit:i}=t,o=oe(),a=w.useRef(null),[l,d]=w.useState("");let f;e[0]!==i||e[1]!==l?(f=()=>{const E=l.trim();if(!E)return;i(E),d("");const P=a.current;P&&(P.value="",Ki(P))},e[0]=i,e[1]=l,e[2]=f):f=e[2];const u=f;let h;e[3]!==u?(h=E=>{E.key==="Enter"&&!E.shiftKey&&(E.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=E=>{d(E.currentTarget.value),Ki(E.currentTarget)},e[5]=m):m=e[5];const y=n==="root"&&"min-h-10";let x;e[6]!==y?(x=X("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]=x):x=e[7];let g;e[8]!==p||e[9]!==r||e[10]!==x||e[11]!==l?(g=c.jsx("textarea",{ref:a,value:l,onChange:m,onKeyDown:p,placeholder:r,rows:1,className:x}),e[8]=p,e[9]=r,e[10]=x,e[11]=l,e[12]=g):g=e[12];const b=g;let k;e[13]!==l?(k=l.trim(),e[13]=l,e[14]=k):k=e[14];const v=!k;let S;e[15]!==o?(S=o("taskBoard.taskDialog.commentSubmitAriaLabel"),e[15]=o,e[16]=S):S=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(ac,{size:16}),e[17]=j):j=e[17];let C;e[18]!==u||e[19]!==v||e[20]!==S?(C=c.jsx("button",{type:"button",disabled:v,onClick:u,"aria-label":S,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]=S,e[21]=C):C=e[21];const T=C;let N;e[22]===Symbol.for("react.memo_cache_sentinel")?(N=()=>a.current?.focus(),e[22]=N):N=e[22];const R=N;if(n==="root"){let E;e[23]!==T?(E=c.jsx("div",{className:"flex items-center justify-end",children:T}),e[23]=T,e[24]=E):E=e[24];let P;return e[25]!==E||e[26]!==b?(P=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:[b,E]}),e[25]=E,e[26]=b,e[27]=P):P=e[27],P}let D;e[28]!==s?(D=c.jsx("span",{className:"mt-0.5 shrink-0",children:c.jsx(Oa,{author:s})}),e[28]=s,e[29]=D):D=e[29];let I;e[30]!==b?(I=c.jsx("div",{className:"min-w-0 flex-1 pt-0.5",children:b}),e[30]=b,e[31]=I):I=e[31];let O;return e[32]!==T||e[33]!==D||e[34]!==I?(O=c.jsxs("div",{"data-testid":"reply-composer",onClick:R,className:"relative flex cursor-text items-start gap-2 p-3",children:[D,I,T]}),e[32]=T,e[33]=D,e[34]=I,e[35]=O):O=e[35],O}function Ki(t){t.style.height="auto",t.style.height=`${t.scrollHeight}px`}function Xh(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 Yh(t){const e=L.c(36),{locator:n}=Ee(),r=en(),s=Jt();let i;e[0]!==t||e[1]!==n?(i=be.taskBoardComments(n,t??""),e[0]=t,e[1]=n,e[2]=i):i=e[2];const o=i,a=!!t;let l;e[3]!==t||e[4]!==r?(l=async()=>Xh((await r.call("TASK_BOARD_COMMENT_LIST",{taskBoardItemId:t})).comments),e[3]=t,e[4]=r,e[5]=l):l=e[5];let d;e[6]!==o||e[7]!==a||e[8]!==l?(d={queryKey:o,enabled:a,queryFn:l},e[6]=o,e[7]=a,e[8]=l,e[9]=d):d=e[9];const f=st(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=ct(m);let x;e[19]!==r?(x=T=>r.call("TASK_BOARD_COMMENT_UPDATE",T),e[19]=r,e[20]=x):x=e[20];let g;e[21]!==h||e[22]!==x?(g={mutationFn:x,onSuccess:h},e[21]=h,e[22]=x,e[23]=g):g=e[23];const b=ct(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 S=ct(v);let j;e[29]!==f.data?(j=f.data??[],e[29]=f.data,e[30]=j):j=e[30];let C;return e[31]!==y||e[32]!==S||e[33]!==b||e[34]!==j?(C={threads:j,post:y,setResolved:b,remove:S},e[31]=y,e[32]=S,e[33]=b,e[34]=j,e[35]=C):C=e[35],C}function Ma(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function vr(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const za=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),Tn="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 Zh(t){const e=L.c(240),{open:n,onClose:r,item:s,defaultStatus:i,onSubmit:o,onDelete:a,onOpenThread:l,onNewChat:d,isSaving:f}=t,u=oe(),{data:h}=xo();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:x}=sc(),{data:g}=bo();let b;e[2]!==g?(b=g===void 0?[]:g,e[2]=g,e[3]=b):b=e[3];const k=b,v=Bl(),S=Ol(),[j,C]=w.useState(s?.title??""),[T,N]=w.useState(s?.description??""),[R,D]=w.useState(s?.status??i??"triage"),[I,O]=w.useState(s?.priority??"medium"),[E,P]=w.useState(s?.assigneeId??null),_=s?.dueDate;let B;e[4]!==_?(B=vr(_),e[4]=_,e[5]=B):B=e[5];const[$,K]=w.useState(B);let Z;e[6]!==s?.tags?(Z=s?.tags.map(np)??[],e[6]=s?.tags,e[7]=Z):Z=e[7];const[F,q]=w.useState(Z),[Q,G]=w.useState(!1),[ee,W]=w.useState(!1),[ne,J]=w.useState(!1);let se;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?(se=()=>{C(s?.title??""),N(s?.description??""),D(s?.status??i??"triage"),O(s?.priority??"medium"),P(s?.assigneeId??null),K(vr(s?.dueDate)),q(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]=se):se=e[16];const M=se;let U;e[17]!==r||e[18]!==M?(U=()=>{r(),M()},e[17]=r,e[18]=M,e[19]=U):U=e[19];const Y=U;let re;e[20]!==v?(re=async(H,Qe)=>{const at=await v.mutateAsync({name:H,color:Qe});q(Mn=>[...Mn,at.id])},e[20]=v,e[21]=re):re=e[21];const A=re;let V;e[22]!==S?(V=H=>{S.mutate(H),q(Qe=>Qe.filter(at=>at!==H))},e[22]=S,e[23]=V):V=e[23];const te=V;let ce;e[24]!==E||e[25]!==T||e[26]!==$||e[27]!==o||e[28]!==I||e[29]!==R||e[30]!==F||e[31]!==j?(ce=()=>{const H=j.trim();H&&o({title:H,description:T.trim()||null,status:R,priority:I,assigneeId:E,dueDate:$?Ma($):null,tagIds:F})},e[24]=E,e[25]=T,e[26]=$,e[27]=o,e[28]=I,e[29]=R,e[30]=F,e[31]=j,e[32]=ce):ce=e[32];const Te=ce,pe=E===nt;let De;if(e[33]!==E||e[34]!==m){let H;e[36]!==E?(H=Qe=>Qe.userId===E,e[36]=E,e[37]=H):H=e[37],De=m.find(H),e[33]=E,e[34]=m,e[35]=De}else De=e[35];const fe=De;let ot;e[38]!==s||e[39]!==m?(ot=s?.assignedBy?m.find(H=>H.userId===s.assignedBy):void 0,e[38]=s,e[39]=m,e[40]=ot):ot=e[40];const Ie=ot,dt=vt[R].icon;let ye;e[41]!==Y?(ye=H=>!H&&Y(),e[41]=Y,e[42]=ye):ye=e[42];let ge;e[43]!==s||e[44]!==u?(ge=u(s?"taskBoard.taskDialog.editTaskTitle":"taskBoard.taskDialog.newTaskTitle"),e[43]=s,e[44]=u,e[45]=ge):ge=e[45];let Le;e[46]!==ge?(Le=c.jsx(Nr,{className:"sr-only",children:ge}),e[46]=ge,e[47]=Le):Le=e[47];let me;e[48]!==u?(me=u("taskBoard.taskDialog.closeAriaLabel"),e[48]=u,e[49]=me):me=e[49];let xt;e[50]===Symbol.for("react.memo_cache_sentinel")?(xt=c.jsx(Gt,{size:16}),e[50]=xt):xt=e[50];let Ke;e[51]!==Y||e[52]!==me?(Ke=c.jsx("button",{type:"button","aria-label":me,onClick:Y,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:xt}),e[51]=Y,e[52]=me,e[53]=Ke):Ke=e[53];let Ae;e[54]===Symbol.for("react.memo_cache_sentinel")?(Ae=H=>{C(H.target.value),H.target.style.height="auto",H.target.style.height=`${H.target.scrollHeight}px`},e[54]=Ae):Ae=e[54];let We;e[55]!==u?(We=u("taskBoard.taskDialog.taskTitlePlaceholder"),e[55]=u,e[56]=We):We=e[56];let Ze;e[57]!==We||e[58]!==j?(Ze=c.jsx("div",{className:"sticky top-0 z-10 bg-background p-6 pb-0 sm:p-8 sm:pb-0",children:c.jsx("textarea",{ref:ep,value:j,onChange:Ae,onKeyDown:Jh,placeholder:We,autoFocus:!0,rows:1,className:"w-full resize-none overflow-hidden border-0 bg-transparent text-xl font-medium leading-snug text-foreground outline-none placeholder:text-foreground/30"})}),e[57]=We,e[58]=j,e[59]=Ze):Ze=e[59];let bt;e[60]!==u?(bt=u("taskBoard.taskDialog.descriptionPlaceholder"),e[60]=u,e[61]=bt):bt=e[61];let Fe;e[62]!==T||e[63]!==bt?(Fe=c.jsx(Mh,{defaultValue:T,onChange:N,placeholder:bt}),e[62]=T,e[63]=bt,e[64]=Fe):Fe=e[64];let Ve;e[65]!==x||e[66]!==T||e[67]!==y||e[68]!==u?(Ve=T&&c.jsx(Xe,{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:x?c.jsx(rs,{size:14}):c.jsx(rc,{size:14})}),e[65]=x,e[66]=T,e[67]=y,e[68]=u,e[69]=Ve):Ve=e[69];let Je;e[70]!==Fe||e[71]!==Ve?(Je=c.jsxs("div",{className:"group relative flex flex-col",children:[Fe,Ve]}),e[70]=Fe,e[71]=Ve,e[72]=Je):Je=e[72];let ut;e[73]!==s?(ut=s&&c.jsx("hr",{className:"border-border"}),e[73]=s,e[74]=ut):ut=e[74];let ft;e[75]!==T||e[76]!==s||e[77]!==l?(ft=s?.id&&c.jsx(fp,{item:s,description:T,onOpenThread:l}),e[75]=T,e[76]=s,e[77]=l,e[78]=ft):ft=e[78];let et;e[79]!==Ie||e[80]!==fe||e[81]!==s||e[82]!==m||e[83]!==l?(et=s&&c.jsx(gp,{item:s,members:m,startedBy:Ie??fe,onOpenThread:l}),e[79]=Ie,e[80]=fe,e[81]=s,e[82]=m,e[83]=l,e[84]=et):et=e[84];let tt;e[85]!==Je||e[86]!==ut||e[87]!==ft||e[88]!==et?(tt=c.jsxs("div",{className:"flex flex-col gap-6 p-6 pt-6 sm:p-8 sm:pt-6",children:[Je,ut,ft,et]}),e[85]=Je,e[86]=ut,e[87]=ft,e[88]=et,e[89]=tt):tt=e[89];let de;e[90]!==Ze||e[91]!==tt?(de=c.jsxs("div",{className:"flex min-w-0 flex-col sm:flex-1 sm:overflow-y-auto",children:[Ze,tt]}),e[90]=Ze,e[91]=tt,e[92]=de):de=e[92];let we;e[93]!==u?(we=u("taskBoard.taskDialog.propertiesLabel"),e[93]=u,e[94]=we):we=e[94];let xe;e[95]!==we?(xe=c.jsx("span",{className:"hidden px-3 text-sm text-muted-foreground sm:block",children:we}),e[95]=we,e[96]=xe):xe=e[96];let Ne;e[97]!==s||e[98]!==R?(Ne=X(s?Gr({...s,status:R}):vt[R].iconClassName),e[97]=s,e[98]=R,e[99]=Ne):Ne=e[99];let ke;e[100]!==dt||e[101]!==Ne?(ke=c.jsx(dt,{size:16,className:Ne}),e[100]=dt,e[101]=Ne,e[102]=ke):ke=e[102];const Ce=vt[R];let je;e[103]!==u||e[104]!==Ce.labelKey?(je=u(Ce.labelKey),e[103]=u,e[104]=Ce.labelKey,e[105]=je):je=e[105];let Ue;e[106]!==ke||e[107]!==je?(Ue=c.jsx(Qt,{asChild:!0,children:c.jsxs("button",{type:"button",className:Tn,children:[ke,je]})}),e[106]=ke,e[107]=je,e[108]=Ue):Ue=e[108];let he;e[109]!==u?(he=Bs.map(H=>{const Qe=vt[H].icon;return c.jsxs(gt,{onSelect:()=>D(H),className:"gap-2",children:[c.jsx(Qe,{size:16,className:vt[H].iconClassName}),u(vt[H].labelKey)]},H)}),e[109]=u,e[110]=he):he=e[110];let Be;e[111]!==he?(Be=c.jsx(Xt,{align:"start",className:"w-44",children:he}),e[111]=he,e[112]=Be):Be=e[112];let _e;e[113]!==Ue||e[114]!==Be?(_e=c.jsxs(Yt,{children:[Ue,Be]}),e[113]=Ue,e[114]=Be,e[115]=_e):_e=e[115];const qe=I==="none"&&"text-muted-foreground";let Oe;e[116]!==qe?(Oe=X(Tn,qe),e[116]=qe,e[117]=Oe):Oe=e[117];let $e;e[118]!==I||e[119]!==u?($e=I==="none"?c.jsxs(c.Fragment,{children:[c.jsx(jr,{size:16}),u("taskBoard.taskDialog.setPriorityButton")]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:X("size-2 rounded-full",wt[I].dotClassName)}),u(wt[I].labelKey)]}),e[118]=I,e[119]=u,e[120]=$e):$e=e[120];let Re;e[121]!==Oe||e[122]!==$e?(Re=c.jsx(Qt,{asChild:!0,children:c.jsx("button",{type:"button",className:Oe,children:$e})}),e[121]=Oe,e[122]=$e,e[123]=Re):Re=e[123];let Me;e[124]!==u?(Me=Qr.map(H=>c.jsxs(gt,{onSelect:()=>O(H),children:[c.jsx("span",{className:X("size-2 rounded-full",wt[H].dotClassName)}),u(wt[H].labelKey)]},H)),e[124]=u,e[125]=Me):Me=e[125];let He;e[126]!==Me?(He=c.jsx(Xt,{align:"start",className:"w-40",children:Me}),e[126]=Me,e[127]=He):He=e[127];let jt;e[128]!==Re||e[129]!==He?(jt=c.jsxs(Yt,{children:[Re,He]}),e[128]=Re,e[129]=He,e[130]=jt):jt=e[130];const _t=!E&&"text-muted-foreground";let ht;e[131]!==_t?(ht=X(Tn,_t),e[131]=_t,e[132]=ht):ht=e[132];let pt;e[133]!==Ie||e[134]!==fe||e[135]!==pe||e[136]!==u?(pt=pe&&Ie?c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"hidden items-center gap-2 sm:flex",children:[c.jsx(Ct,{url:Ie.user?.image??void 0,fallback:St(Ie.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:Ie.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(Ct,{url:Ie.user?.image??void 0,fallback:St(Ie.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),c.jsx(Rt,{size:16,className:"ring-2 ring-background"})]}),u("taskBoard.taskDialog.superAgentLabel")]})]}):pe?c.jsxs(c.Fragment,{children:[c.jsx(Rt,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]}):fe?c.jsxs(c.Fragment,{children:[c.jsx(Ct,{url:fe.user?.image??void 0,fallback:St(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(uo,{size:16,className:"text-muted-foreground"}),u("taskBoard.taskDialog.assignButton")]}),e[133]=Ie,e[134]=fe,e[135]=pe,e[136]=u,e[137]=pt):pt=e[137];let Tt;e[138]!==ht||e[139]!==pt?(Tt=c.jsx(Nn,{asChild:!0,children:c.jsx("button",{type:"button",className:ht,children:pt})}),e[138]=ht,e[139]=pt,e[140]=Tt):Tt=e[140];let z;e[141]===Symbol.for("react.memo_cache_sentinel")?(z=H=>{P(H),W(!1)},e[141]=z):z=e[141];let ie;e[142]!==m?(ie=c.jsx(Gn,{align:"start",className:"w-56 p-0",children:c.jsx(li,{members:m,onSelect:z})}),e[142]=m,e[143]=ie):ie=e[143];let ve;e[144]!==ee||e[145]!==Tt||e[146]!==ie?(ve=c.jsxs(Qn,{open:ee,onOpenChange:W,modal:!0,children:[Tt,ie]}),e[144]=ee,e[145]=Tt,e[146]=ie,e[147]=ve):ve=e[147];let Ge;e[148]!==Ie||e[149]!==pe||e[150]!==u?(Ge=pe&&Ie&&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:X(Tn,"pointer-events-none"),children:[c.jsx(Rt,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]})]}),e[148]=Ie,e[149]=pe,e[150]=u,e[151]=Ge):Ge=e[151];let yt;e[152]!==ve||e[153]!==Ge?(yt=c.jsxs("div",{className:"flex flex-col",children:[ve,Ge]}),e[152]=ve,e[153]=Ge,e[154]=yt):yt=e[154];const Kt=!$&&"text-muted-foreground";let nn;e[155]!==Kt?(nn=X(Tn,Kt),e[155]=Kt,e[156]=nn):nn=e[156];let fs;e[157]===Symbol.for("react.memo_cache_sentinel")?(fs=c.jsx(Rn,{size:16,className:"text-muted-foreground"}),e[157]=fs):fs=e[157];let sn;e[158]!==$||e[159]!==u?(sn=$?za.format($):u("taskBoard.taskDialog.dueDateLabel"),e[158]=$,e[159]=u,e[160]=sn):sn=e[160];let rn;e[161]!==$||e[162]!==u?(rn=$&&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:H=>{H.stopPropagation(),K(null)},onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),H.stopPropagation(),K(null))},children:c.jsx(Gt,{size:12})}),e[161]=$,e[162]=u,e[163]=rn):rn=e[163];let on;e[164]!==nn||e[165]!==sn||e[166]!==rn?(on=c.jsx(Nn,{asChild:!0,children:c.jsxs("button",{type:"button",className:nn,children:[fs,sn,rn]})}),e[164]=nn,e[165]=sn,e[166]=rn,e[167]=on):on=e[167];const Xs=$??void 0;let hs;e[168]===Symbol.for("react.memo_cache_sentinel")?(hs=H=>{K(H??null),H&&G(!1)},e[168]=hs):hs=e[168];let an;e[169]!==Xs?(an=c.jsx(Gn,{className:"w-auto p-0",align:"start",children:c.jsx(To,{mode:"single",selected:Xs,onSelect:hs,initialFocus:!0})}),e[169]=Xs,e[170]=an):an=e[170];let ln;e[171]!==Q||e[172]!==on||e[173]!==an?(ln=c.jsxs(Qn,{open:Q,onOpenChange:G,children:[on,an]}),e[171]=Q,e[172]=on,e[173]=an,e[174]=ln):ln=e[174];let cn;e[175]!==k||e[176]!==u||e[177]!==F?(cn=F.length===0?c.jsx(Nn,{asChild:!0,children:c.jsxs("button",{type:"button",className:X(Tn,"text-muted-foreground"),children:[c.jsx(al,{size:16}),u("taskBoard.taskDialog.tagsButton")]})}):c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:px-3",children:[F.map(H=>{const Qe=k.find(at=>at.id===H);return Qe?c.jsxs("button",{type:"button",onClick:()=>J(!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:cs(Qe.color)}}),c.jsx("span",{className:"truncate",children:Qe.name}),c.jsx("span",{role:"button",tabIndex:0,"aria-label":u("taskBoard.taskDialog.removeTagAriaLabel",{name:Qe.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:at=>{at.stopPropagation(),q(Mn=>Mn.filter(Ys=>Ys!==H))},onKeyDown:at=>{(at.key==="Enter"||at.key===" ")&&(at.preventDefault(),at.stopPropagation(),q(Mn=>Mn.filter(Ys=>Ys!==H)))},children:c.jsx(Gt,{size:10})})]},H):null}),c.jsx(Nn,{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(Jn,{size:14})})})]}),e[175]=k,e[176]=u,e[177]=F,e[178]=cn):cn=e[178];let dn;e[179]!==k.length?(dn=Qu(k.length),e[179]=k.length,e[180]=dn):dn=e[180];let ps;e[181]===Symbol.for("react.memo_cache_sentinel")?(ps=H=>q(Qe=>Qe.includes(H)?Qe.filter(at=>at!==H):[...Qe,H]),e[181]=ps):ps=e[181];let un;e[182]!==A||e[183]!==te||e[184]!==k||e[185]!==dn||e[186]!==F?(un=c.jsx(Gn,{align:"start",className:"w-56 p-0",children:c.jsx(qh,{tags:k,selectedIds:F,defaultColor:dn,onToggle:ps,onCreate:A,onDelete:te})}),e[182]=A,e[183]=te,e[184]=k,e[185]=dn,e[186]=F,e[187]=un):un=e[187];let fn;e[188]!==cn||e[189]!==un||e[190]!==ne?(fn=c.jsxs(Qn,{open:ne,onOpenChange:J,modal:!0,children:[cn,un]}),e[188]=cn,e[189]=un,e[190]=ne,e[191]=fn):fn=e[191];let hn;e[192]!==_e||e[193]!==jt||e[194]!==yt||e[195]!==ln||e[196]!==fn?(hn=c.jsxs("div",{className:"flex flex-wrap gap-2 sm:flex-col",children:[_e,jt,yt,ln,fn]}),e[192]=_e,e[193]=jt,e[194]=yt,e[195]=ln,e[196]=fn,e[197]=hn):hn=e[197];let pn;e[198]!==xe||e[199]!==hn?(pn=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:[xe,hn]}),e[198]=xe,e[199]=hn,e[200]=pn):pn=e[200];let gn;e[201]!==de||e[202]!==pn?(gn=c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto sm:flex-row sm:overflow-hidden",children:[de,pn]}),e[201]=de,e[202]=pn,e[203]=gn):gn=e[203];let mn;e[204]!==s||e[205]!==a||e[206]!==u?(mn=s&&a?c.jsx(Xe,{variant:"ghost",size:"icon","aria-label":u("taskBoard.taskDialog.deleteTaskAriaLabel"),className:"size-10 text-muted-foreground hover:text-destructive",onClick:a,children:c.jsx(Cr,{size:16})}):c.jsx("span",{}),e[204]=s,e[205]=a,e[206]=u,e[207]=mn):mn=e[207];let xn;e[208]!==s||e[209]!==d||e[210]!==u?(xn=s&&d&&c.jsxs(Xe,{variant:"outline",size:"sm",onClick:d,children:[c.jsx(fo,{size:16}),u("taskBoard.taskDialog.newChatButton")]}),e[208]=s,e[209]=d,e[210]=u,e[211]=xn):xn=e[211];let bn;e[212]!==f||e[213]!==j?(bn=!j.trim()||f,e[212]=f,e[213]=j,e[214]=bn):bn=e[214];let yn;e[215]!==s?(yn=s?null:c.jsx(Jn,{size:16}),e[215]=s,e[216]=yn):yn=e[216];let kn;e[217]!==s||e[218]!==u?(kn=u(s?"taskBoard.taskDialog.saveButton":"taskBoard.taskDialog.createTaskButton"),e[217]=s,e[218]=u,e[219]=kn):kn=e[219];let vn;e[220]!==Te||e[221]!==bn||e[222]!==yn||e[223]!==kn?(vn=c.jsxs(Xe,{size:"sm",disabled:bn,onClick:Te,children:[yn,kn]}),e[220]=Te,e[221]=bn,e[222]=yn,e[223]=kn,e[224]=vn):vn=e[224];let wn;e[225]!==xn||e[226]!==vn?(wn=c.jsxs("div",{className:"flex items-center gap-2",children:[xn,vn]}),e[225]=xn,e[226]=vn,e[227]=wn):wn=e[227];let Sn;e[228]!==mn||e[229]!==wn?(Sn=c.jsxs("div",{className:"flex h-16 items-center justify-between border-t border-border px-4",children:[mn,wn]}),e[228]=mn,e[229]=wn,e[230]=Sn):Sn=e[230];let Cn;e[231]!==Le||e[232]!==Ke||e[233]!==gn||e[234]!==Sn?(Cn=c.jsxs(Rr,{className:"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]",closeButtonClassName:"hidden",children:[Le,Ke,gn,Sn]}),e[231]=Le,e[232]=Ke,e[233]=gn,e[234]=Sn,e[235]=Cn):Cn=e[235];let gs;return e[236]!==n||e[237]!==ye||e[238]!==Cn?(gs=c.jsx(Er,{open:n,onOpenChange:ye,children:Cn}),e[236]=n,e[237]=ye,e[238]=Cn,e[239]=gs):gs=e[239],gs}function Jh(t){t.key==="Enter"&&t.preventDefault()}function ep(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 sp(t,e){switch(t){case"failed":return{label:e("taskBoard.taskDialog.threadStatusError"),className:"text-destructive",icon:cl};case"requires_action":return{label:e("taskBoard.taskDialog.threadStatusNeedsInput"),className:"text-warning",icon:Tr};case"in_progress":return{label:e("taskBoard.taskDialog.threadStatusRunning"),className:"text-primary",icon:ss,spin:!0};case"completed":return{label:e("taskBoard.taskDialog.threadStatusCompleted"),className:"text-success",icon:_n};case"expired":return{label:e("taskBoard.taskDialog.threadStatusExpired"),className:"text-muted-foreground",icon:Ps};default:return t}}function rp(t){const e=L.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 a=n.status?sp(n.status,i):null,l=n.lastMessage;let d;e[5]!==n.title?(d=ui(n.title,"qa"),e[5]=n.title,e[6]=d):d=e[6];const f=d;let u;e[7]!==n.title?(u=ui(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(da,{size:16,className:"shrink-0"}):h?c.jsx(ua,{size:16,className:"shrink-0"}):c.jsx(Rt,{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 x;e[18]!==y?(x=c.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:y}),e[18]=y,e[19]=x):x=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(Ct,{url:r.user?.image??void 0,fallback:St(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 b;e[23]!==s||e[24]!==i?(b=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(Do,{size:14})]}),e[23]=s,e[24]=i,e[25]=b):b=e[25];let k;e[26]!==m||e[27]!==x||e[28]!==g||e[29]!==b?(k=c.jsxs("div",{className:"flex items-center gap-2",children:[m,x,g,b]}),e[26]=m,e[27]=x,e[28]=g,e[29]=b,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,a&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:X("flex shrink-0 items-center gap-1.5",a.className),children:[c.jsx(a.icon,{size:15,className:X(a.spin&&"animate-spin")}),c.jsx("span",{className:"text-sm",children:a.label})]}),l&&c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:l})]})]}),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=o}else o=e[4];return o}function ip(t,e){return t.merged?{label:e("taskBoard.taskDialog.prStateMerged"),className:"text-special",icon:ll}:t.state==="closed"?{label:e("taskBoard.taskDialog.prStateClosed"),className:"text-destructive",icon:Zs}:t.draft?{label:e("taskBoard.taskDialog.prStateDraft"),className:"text-muted-foreground",icon:Zs}:{label:e("taskBoard.taskDialog.prStateOpen"),className:"text-success",icon:Zs}}function op(t,e){switch(t){case"passing":return{label:e("taskBoard.taskDialog.prChecksPassing"),className:"text-success",icon:_n};case"failing":return{label:e("taskBoard.taskDialog.prChecksFailing"),className:"text-destructive",icon:Ps};case"pending":return{label:e("taskBoard.taskDialog.prChecksPending"),className:"text-warning",icon:ss};default:return null}}const ap=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);function lp(t){if(t.status!=="completed")return{icon:ss,className:"text-warning",spin:!0};const e=t.conclusion;return e&&ap.has(e)?{icon:Ps,className:"text-destructive",spin:!1}:e==="success"||e==="neutral"||e==="skipped"?{icon:_n,className:"text-success",spin:!1}:{icon:Tr,className:"text-muted-foreground",spin:!1}}function cp(t){const e=L.c(37),{pr:n,previewThread:r,reviewsReady:s,shipPending:i,onShip:o,onOpenThread:a}=t,l=oe(),[d,f]=w.useState(!1);let u;if(e[0]!==d||e[1]!==a||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==l){const h=ip(n,l),p=op(n.checksStatus,l),m=n.state==="open"&&!n.merged,y=n.checksStatus!=="failing"&&n.checksStatus!=="pending",x=s&&m&&y,g=!!r||!!n.previewUrl||x;let b;e[9]!==n.checks?(b=n.checks??[],e[9]=n.checks,e[10]=b):b=e[10];const k=b,v=k.length>0||p!=null,S=k.length>0;let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(lr,{className:"size-4 shrink-0 text-foreground"}),e[11]=j):j=e[11];const C=n.title??`${n.repoOwner}/${n.repoName}`;let T;e[12]!==C?(T=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:C}),e[12]=C,e[13]=T):T=e[13];const N=X("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 D;e[16]!==h||e[17]!==N||e[18]!==R?(D=c.jsxs("span",{className:N,children:[R,h.label]}),e[16]=h,e[17]=N,e[18]=R,e[19]=D):D=e[19];let I;e[20]===Symbol.for("react.memo_cache_sentinel")?(I=c.jsx(Cs,{size:12,className:"text-muted-foreground/60 group-hover:text-foreground"}),e[20]=I):I=e[20];let O;e[21]!==n.number||e[22]!==n.url?(O=c.jsxs("a",{href:n.url,target:"_blank",rel:"noreferrer",title:n.url,className:"group flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted",children:["#",n.number,I]}),e[21]=n.number,e[22]=n.url,e[23]=O):O=e[23];let E;e[24]!==O||e[25]!==T||e[26]!==D?(E=c.jsxs("div",{className:"flex items-center gap-3",children:[j,T,D,O]}),e[24]=O,e[25]=T,e[26]=D,e[27]=E):E=e[27];let P;e[28]!==g||e[29]!==a||e[30]!==o||e[31]!==n.previewUrl||e[32]!==r||e[33]!==i||e[34]!==x||e[35]!==l?(P=g&&c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r&&c.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",title:l("taskBoard.taskDialog.openPreviewTitle"),onClick:()=>a?.(r),children:[c.jsx(fo,{size:13}),l("taskBoard.taskDialog.openPreviewButton")]}),n.previewUrl&&c.jsx(Xe,{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(No,{size:14}),l("taskBoard.taskDialog.previewLabel"),c.jsx(Cs,{size:12})]})}),x&&c.jsx(Xe,{type:"button",variant:"success",size:"sm",disabled:i,onClick:o,children:l("taskBoard.taskDialog.shipToProductionButton")})]}),e[28]=g,e[29]=a,e[30]=o,e[31]=n.previewUrl,e[32]=r,e[33]=i,e[34]=x,e[35]=l,e[36]=P):P=e[36],u=c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[E,P,v&&c.jsxs("div",{className:"border-t border-border pt-2 text-xs",children:[c.jsxs("button",{type:"button",disabled:!S,onClick:()=>f(dp),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(_n,{size:13,className:"text-muted-foreground"}),c.jsx("span",{className:X(p?.className??"text-muted-foreground"),children:p?.label??l("taskBoard.taskDialog.prChecksLabel")}),S&&c.jsx(Do,{size:14,className:X("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 B=lp(_);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(B.icon,{size:13,className:X("shrink-0",B.className,B.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(Cs,{size:12})})]}),_.summary&&c.jsx("div",{className:"mt-1.5 max-h-64 overflow-auto text-muted-foreground",children:c.jsx(tc,{id:`${n.url}-${_.name}`,text:_.summary})})]},_.name)})})]})]}),e[0]=d,e[1]=a,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=l,e[8]=u}else u=e[8];return u}function dp(t){return!t}function up(){const t=L.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(jn,{className:"size-4 shrink-0 rounded"}),c.jsx(jn,{className:"h-4 min-w-0 flex-1"}),c.jsx(jn,{className:"h-4 w-16 shrink-0"}),c.jsx(jn,{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(jn,{className:"h-7 w-20"}),c.jsx(jn,{className:"h-7 w-28"})]})]}),t[1]=n):n=t[1],n}function fp(t){const e=L.c(36),{item:n,description:r,onOpenThread:s}=t,i=oe(),{data:o,isLoading:a}=Lh(n.id),{data:l}=Ba(n.id),d=fi("qa_agent_enabled"),f=fi("code_reviewer_enabled"),u=Ph(n.id);let h,p;if(e[0]!==l||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]!==a||e[9]!==d||e[10]!==i){p=Symbol.for("react.early_return_sentinel");e:{const m=Hh(r),y=a&&!o;if(!y&&(!o||o.length===0)&&m.length===0){p=null;break e}let x;e[13]!==l||e[14]!==f||e[15]!==n.status||e[16]!==d?(x=n.status==="in_review"&&Uh(l??[],Fh({qa:d,codeReview:f})),e[13]=l,e[14]=f,e[15]=n.status,e[16]=d,e[17]=x):x=e[17];const g=x;let b;e[18]!==u||e[19]!==i?(b=()=>u.mutate(void 0,{onSuccess:N=>N?.merged?Bt.success(i("taskBoard.taskDialog.shipSuccess")):Bt.error(i("taskBoard.taskDialog.shipError")),onError:()=>Bt.error(i("taskBoard.taskDialog.shipError"))}),e[18]=u,e[19]=i,e[20]=b):b=e[20];const k=b;let v;e[21]!==n.threads||e[22]!==s?(v=s?n.threads.find(pp):void 0,e[21]=n.threads,e[22]=s,e[23]=v):v=e[23];const S=v;let j;e[24]!==i?(j=i("taskBoard.taskDialog.linksLabel"),e[24]=i,e[25]=j):j=e[25];let C;e[26]!==j?(C=c.jsx("span",{className:"mb-1 text-xs font-medium text-muted-foreground",children:j}),e[26]=j,e[27]=C):C=e[27];let T;e[28]!==y||e[29]!==s||e[30]!==k||e[31]!==S||e[32]!==u||e[33]!==o||e[34]!==g?(T=y?c.jsx(up,{}):(o??[]).map(N=>c.jsx(cp,{pr:N,previewThread:S,reviewsReady:g,shipPending:u.isPending,onShip:k,onOpenThread:s},N.url)),e[28]=y,e[29]=s,e[30]=k,e[31]=S,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:[C,T,m.map(hp)]})}e[0]=l,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]=a,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 hp(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(No,{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(Cs,{size:13,className:"shrink-0 text-muted-foreground/50 group-hover:text-foreground"})]},t.url)}function pp(t){return t.hasPreview&&t.virtualMcpId}function gp(t){const e=L.c(6),{item:n,members:r,startedBy:s,onOpenThread:i}=t,o=oe(),{data:a}=Ba(n.id),{data:l}=Ji.useSession(),d=new Map(r.map(kp)),f={id:l?.user?.id??"me",name:l?.user?.name??o("taskBoard.taskDialog.commentYouLabel"),image:l?.user?.image},u=Yh(n.id),h=k=>{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=[...(a??[]).map(yp),...n.threads.map(bp),...p.map(xp)].sort(mp),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 x;e[0]!==o?(x=o("taskBoard.taskDialog.activityLabel"),e[0]=o,e[1]=x):x=e[1];let g;e[2]!==x?(g=c.jsx("span",{className:"text-sm font-medium text-foreground",children:x}),e[2]=x,e[3]=g):g=e[3];let b;return e[4]!==u.post?(b=k=>u.post.mutate({body:k}),e[4]=u.post,e[5]=b):b=e[5],c.jsxs("div",{className:"flex flex-col gap-5 pb-2",children:[g,y.map((k,v)=>k.type==="timeline"?c.jsx(wp,{items:k.items,memberByUserId:d},`timeline-${v}`):k.type==="comment"?c.jsx(Kh,{thread:k.comment,me:f,onReply:S=>u.post.mutate({body:S,parentId:k.comment.id}),onDelete:S=>u.remove.mutate(S),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(Gh,{me:f,onSubmit:b})]})}function mp(t,e){return t.at-e.at}function xp(t){return{kind:"comment",at:new Date(t.createdAt).getTime(),comment:t}}function bp(t){return{kind:"thread",at:new Date(t.createdAt).getTime(),thread:t}}function yp(t){return{kind:"activity",at:new Date(t.occurredAt).getTime(),activity:t}}function kp(t){return[t.userId,t]}function Wt(t){const e=L.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 zs="\0";function Ss(t){return`${zs}${t}${zs}`}function Dn(t,e){return t.split(new RegExp(`${zs}(\\w+)${zs}`)).map((n,r)=>c.jsx(w.Fragment,{children:r%2===0?n:e[n]},r))}function Hn(t,e){return e(t==="code_review"?"taskBoard.taskDialog.codeReviewerLabel":"taskBoard.taskDialog.qaAgentLabel")}function vp(t,e,n){const r=h=>{const p=typeof h=="string"?vt[h]:void 0;if(!p)return String(h??"");const m=p.icon;return c.jsx(Wt,{icon:c.jsx(m,{size:14,className:p.iconClassName}),label:e(p.labelKey)})},s=h=>{const p=typeof h=="string"?wt[h]:void 0;return p?c.jsx(Wt,{icon:c.jsx("span",{className:X("size-2 rounded-full",p.dotClassName)}),label:e(p.labelKey)}):String(h??"")},i=h=>{const p=vr(typeof h=="string"?h:null);return p?c.jsx(Wt,{icon:c.jsx(Rn,{size:14,className:"text-muted-foreground"}),label:za.format(p)}):""},o=h=>!Array.isArray(h)||h.length===0?null:h.map((p,m)=>{const y=p;return c.jsx(Wt,{icon:c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:cs(y.color)}}),label:y.name??""},y.id??m)}),a=h=>{if(h===nt)return c.jsx(Wt,{icon:c.jsx(Rt,{size:14}),label:e("taskBoard.taskDialog.superAgentLabel")});const p=typeof h=="string"?n.get(h):void 0;return c.jsx(Wt,{icon:c.jsx(Ct,{url:p?.user?.image??void 0,fallback:St(p?.user?.name),shape:"circle",size:"2xs"}),label:p?.user?.name??e("taskBoard.taskDialog.someoneLabel")})},l=h=>c.jsx(Wt,{icon:h==="code_review"?c.jsx(ua,{size:14}):c.jsx(da,{size:14}),label:Hn(h,e)}),d=t.data,f=Ss("from"),u=Ss("to");switch(t.action){case"created":return e("taskBoard.taskDialog.activityCreated");case"status_changed":return Dn(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"):Dn(e(d.to===nt?"taskBoard.taskDialog.activityDelegated":"taskBoard.taskDialog.activityAssigned",{name:Ss("name")}),{name:a(d.to)});case"priority_changed":return d.to==="none"?e("taskBoard.taskDialog.activityPriorityCleared"):Dn(!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"):Dn(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"):Dn(e("taskBoard.taskDialog.activityTagsSet",{to:u}),{to:o(d.to)});case"review_requested":return Dn(e("taskBoard.taskDialog.activityDelegated",{name:Ss("name")}),{name:l(d.reviewer)});case"review_approved":return typeof d.notes=="string"&&d.notes.trim()?e("taskBoard.taskDialog.activityReviewApprovedWithNotes",{reviewer:Hn(d.reviewer,e),notes:d.notes}):e("taskBoard.taskDialog.activityReviewApproved",{reviewer:Hn(d.reviewer,e)});case"review_changes_requested":return typeof d.notes=="string"&&d.notes.trim()?e("taskBoard.taskDialog.activityReviewChangesRequestedWithNotes",{reviewer:Hn(d.reviewer,e),notes:d.notes}):e("taskBoard.taskDialog.activityReviewChangesRequested",{reviewer:Hn(d.reviewer,e)});case"merge_conflict_resolution":return e("taskBoard.taskDialog.activityMergeConflictResolution");default:{const h=t.action;return String(h)}}}function Wi(t){return!t||t===nt}function wp(t){const e=L.c(21),{items:n,memberByUserId:r}=t,s=oe();let i;e[0]!==r||e[1]!==s?(i=h=>Wi(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 a;e[3]!==r?(a=h=>{if(Wi(h))return c.jsx("span",{className:"z-10 flex size-4 shrink-0 items-center justify-center bg-background",children:c.jsx(Rt,{size:16})});const p=r.get(h);return c.jsx("span",{className:"z-10 shrink-0 rounded-full bg-background",children:c.jsx(Ct,{url:p?.user?.image??void 0,fallback:St(p?.user?.name),shape:"circle",size:"2xs"})})},e[3]=r,e[4]=a):a=e[4];const l=a;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]!==l||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==s){let h;e[13]!==l||e[14]!==o||e[15]!==r||e[16]!==s?(h=p=>c.jsxs("div",{className:"relative flex items-center gap-2.5",children:[l(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)})," ",vp(p,s,r),c.jsxs("span",{className:"text-muted-foreground/60",children:[" · ",Ir(new Date(p.occurredAt))]})]})]},p.id),e[13]=l,e[14]=o,e[15]=r,e[16]=s,e[17]=h):h=e[17],f=n.map(h),e[7]=l,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 Vi=380,Sp=90,Gi=5,Cp="cubic-bezier(0.22, 0.61, 0.36, 1)";function jp(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]"),a=new Map,l=r.current;r.current=a;const d=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,f=[];for(const g of o){const b=g.dataset.flipId;if(!b)continue;const k=g.getBoundingClientRect(),v=g.dataset.flipLane;if(a.set(b,{rect:k,lane:v}),!n)continue;const S=l.get(b);if(!S)continue;const j=S.rect.left-k.left,C=S.rect.top-k.top;(j||C)&&f.push({el:g,dx:j,dy:C,lane:S.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 b=(u.get(g)??1)-1;if(b>0){u.set(g,b);return}u.delete(g),g.style.overflow=""};for(const g of f){const b=g.lane?` rotate(${g.dx>0?Gi:-Gi}deg)`:"";g.el.style.transition="none",g.el.style.transform=`translate(${g.dx}px, ${g.dy}px)${b}`,g.lane&&(g.el.style.zIndex="10",h(g.el.closest("[data-lane-scroll]")))}let m=0;const y=[],x=requestAnimationFrame(()=>{for(const g of f){const b=g.lane?m++*Sp:0;g.el.style.transition=`transform ${Vi}ms ${Cp} ${b}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]"))},Vi+b+30))}});return()=>{cancelAnimationFrame(x);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 Tp(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 wr="__unassigned__",Ls={assignee:null,priority:null,due:null};function Dp(t){return t.assignee!==null||t.priority!==null||t.due!==null}function Np(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)}const Rp=864e5;function Ep(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 Ip(t,e){if(e.assignee!==null){if(e.assignee===wr){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"&&!Ep(n,r)||e.due==="week"&&(n<r||n>r+7*Rp))return!1}return!0}const Qi={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function Qs(t,e=!1){return X("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 _p(t){const e=L.c(95),{value:n,members:r,onChange:s,block:i}=t,o=oe(),[a,l]=w.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(cr,{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===wr){let M;e[3]!==o?(M=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=M):M=e[4],h=M}else if(n===nt){let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M=c.jsx(Rt,{size:14}),e[5]=M):M=e[5],f=M;let U;e[6]!==o?(U=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=U):U=e[7],h=U}else if(n){let M,U,Y,re;if(e[8]!==r||e[9]!==n){let te;e[14]!==n?(te=ce=>ce.userId===n,e[14]=n,e[15]=te):te=e[15],U=r.find(te),M=Ct,Y=U?.user?.image??void 0,re=St(U?.user?.name),e[8]=r,e[9]=n,e[10]=M,e[11]=U,e[12]=Y,e[13]=re}else M=e[10],U=e[11],Y=e[12],re=e[13];let A;e[16]!==M||e[17]!==Y||e[18]!==re?(A=c.jsx(M,{url:Y,fallback:re,shape:"circle",size:"2xs"}),e[16]=M,e[17]=Y,e[18]=re,e[19]=A):A=e[19],f=A;let V;e[20]!==U?.user?.name||e[21]!==o?(V=U?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=U?.user?.name,e[21]=o,e[22]=V):V=e[22],h=V}let p;e[23]!==s?(p=M=>{s(M),l(!1)},e[23]=s,e[24]=p):p=e[24];const m=p,y=n!==null;let x;e[25]!==i||e[26]!==y?(x=Qs(y,i),e[25]=i,e[26]=y,e[27]=x):x=e[27];const g=x,b=i&&"ml-auto";let k;e[28]!==b?(k=X("shrink-0 opacity-60",b),e[28]=b,e[29]=k):k=e[29];const v=k;let S;e[30]!==h?(S=c.jsx("span",{className:"max-w-[10rem] truncate",children:h}),e[30]=h,e[31]=S):S=e[31];let j;e[32]!==v?(j=c.jsx(zr,{size:12,className:v}),e[32]=v,e[33]=j):j=e[33];let C;e[34]!==f||e[35]!==S||e[36]!==j||e[37]!==g?(C=c.jsx(Nn,{asChild:!0,children:c.jsxs("button",{type:"button",className:g,children:[f,S,j]})}),e[34]=f,e[35]=S,e[36]=j,e[37]=g,e[38]=C):C=e[38];let T;e[39]!==o?(T=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=T):T=e[40];let N;e[41]!==T?(N=c.jsx(Br,{placeholder:T,className:"h-9"}),e[41]=T,e[42]=N):N=e[42];let R;e[43]!==o?(R=o("taskBoard.taskFilters.assigneeNoMembersFound"),e[43]=o,e[44]=R):R=e[44];let D;e[45]!==R?(D=c.jsx(Or,{children:R}),e[45]=R,e[46]=D):D=e[46];let I;e[47]!==m?(I=()=>m(null),e[47]=m,e[48]=I):I=e[48];let O;e[49]!==o?(O=o("taskBoard.taskFilters.assigneeAnyone"),e[49]=o,e[50]=O):O=e[50];let E;e[51]!==I||e[52]!==O?(E=c.jsx(Pt,{value:"Anyone",onSelect:I,children:O}),e[51]=I,e[52]=O,e[53]=E):E=e[53];let P;e[54]!==m?(P=()=>m(wr),e[54]=m,e[55]=P):P=e[55];let _;e[56]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx(cr,{size:16,className:"text-muted-foreground"}),e[56]=_):_=e[56];let B;e[57]!==o?(B=o("taskBoard.taskFilters.assigneeUnassigned"),e[57]=o,e[58]=B):B=e[58];let $;e[59]!==P||e[60]!==B?($=c.jsxs(Pt,{value:"Unassigned",onSelect:P,className:"gap-2",children:[_,B]}),e[59]=P,e[60]=B,e[61]=$):$=e[61];let K;e[62]!==m?(K=()=>m(nt),e[62]=m,e[63]=K):K=e[63];let Z;e[64]===Symbol.for("react.memo_cache_sentinel")?(Z=c.jsx(Rt,{size:16}),e[64]=Z):Z=e[64];let F;e[65]!==o?(F=o("taskBoard.taskFilters.assigneeSuperAgent"),e[65]=o,e[66]=F):F=e[66];let q;e[67]!==K||e[68]!==F?(q=c.jsxs(Pt,{value:"Super Agent",onSelect:K,className:"gap-2",children:[Z,F]}),e[67]=K,e[68]=F,e[69]=q):q=e[69];let Q;e[70]!==E||e[71]!==$||e[72]!==q?(Q=c.jsxs(In,{children:[E,$,q]}),e[70]=E,e[71]=$,e[72]=q,e[73]=Q):Q=e[73];let G;e[74]!==o?(G=o("taskBoard.taskFilters.assigneeGroupMembers"),e[74]=o,e[75]=G):G=e[75];let ee;if(e[76]!==r||e[77]!==m){let M;e[79]!==m?(M=U=>c.jsxs(Pt,{value:U.user?.name??U.userId,onSelect:()=>m(U.userId),className:"gap-2",children:[c.jsx(Ct,{url:U.user?.image??void 0,fallback:St(U.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:U.user?.name??U.userId})]},U.userId),e[79]=m,e[80]=M):M=e[80],ee=r.map(M),e[76]=r,e[77]=m,e[78]=ee}else ee=e[78];let W;e[81]!==G||e[82]!==ee?(W=c.jsx(In,{heading:G,children:ee}),e[81]=G,e[82]=ee,e[83]=W):W=e[83];let ne;e[84]!==D||e[85]!==Q||e[86]!==W?(ne=c.jsxs($r,{children:[D,Q,W]}),e[84]=D,e[85]=Q,e[86]=W,e[87]=ne):ne=e[87];let J;e[88]!==N||e[89]!==ne?(J=c.jsx(Gn,{align:"start",className:"w-56 p-0",children:c.jsxs(Mr,{children:[N,ne]})}),e[88]=N,e[89]=ne,e[90]=J):J=e[90];let se;return e[91]!==a||e[92]!==C||e[93]!==J?(se=c.jsxs(Qn,{open:a,onOpenChange:l,children:[C,J]}),e[91]=a,e[92]=C,e[93]=J,e[94]=se):se=e[94],se}function Ap(t){const e=L.c(33),{value:n,onChange:r,block:s}=t,i=oe(),o=n!==null;let a;e[0]!==s||e[1]!==o?(a=Qs(o,s),e[0]=s,e[1]=o,e[2]=a):a=e[2];const l=a,d=s&&"ml-auto";let f;e[3]!==d?(f=X("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:X("size-2 shrink-0 rounded-full",wt[n].dotClassName)}):c.jsx(gc,{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?wt[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(zr,{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]!==l?(y=c.jsx(Qt,{asChild:!0,children:c.jsxs("button",{type:"button",className:l,children:[h,p,m]})}),e[12]=h,e[13]=p,e[14]=m,e[15]=l,e[16]=y):y=e[16];let x;e[17]!==r?(x=()=>r(null),e[17]=r,e[18]=x):x=e[18];let g;e[19]!==i?(g=i("taskBoard.taskFilters.priorityAnyPriority"),e[19]=i,e[20]=g):g=e[20];let b;e[21]!==g||e[22]!==x?(b=c.jsx(gt,{onSelect:x,children:g}),e[21]=g,e[22]=x,e[23]=b):b=e[23];let k;e[24]!==r||e[25]!==i?(k=Qr.map(j=>c.jsxs(gt,{onSelect:()=>r(j),className:"gap-2",children:[c.jsx("span",{className:X("size-2 rounded-full",wt[j].dotClassName)}),i(wt[j].labelKey)]},j)),e[24]=r,e[25]=i,e[26]=k):k=e[26];let v;e[27]!==b||e[28]!==k?(v=c.jsxs(Xt,{align:"start",className:"w-40",children:[b,k]}),e[27]=b,e[28]=k,e[29]=v):v=e[29];let S;return e[30]!==v||e[31]!==y?(S=c.jsxs(Yt,{children:[y,v]}),e[30]=v,e[31]=y,e[32]=S):S=e[32],S}function Bp(t){const e=L.c(35),{value:n,onChange:r,block:s}=t,i=oe();let o;e[0]!==i||e[1]!==n?(o=n?i(Qi[n]):void 0,e[0]=i,e[1]=n,e[2]=o):o=e[2];const a=o,l=n!==null;let d;e[3]!==s||e[4]!==l?(d=Qs(l,s),e[3]=s,e[4]=l,e[5]=d):d=e[5];const f=d,u=s&&"ml-auto";let h;e[6]!==u?(h=X("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(Rn,{size:14,className:"shrink-0"}),e[8]=m):m=e[8];let y;e[9]!==a||e[10]!==i?(y=a??i("taskBoard.taskFilters.dueDateLabel"),e[9]=a,e[10]=i,e[11]=y):y=e[11];let x;e[12]!==p?(x=c.jsx(zr,{size:12,className:p}),e[12]=p,e[13]=x):x=e[13];let g;e[14]!==y||e[15]!==x||e[16]!==f?(g=c.jsx(Qt,{asChild:!0,children:c.jsxs("button",{type:"button",className:f,children:[m,y,x]})}),e[14]=y,e[15]=x,e[16]=f,e[17]=g):g=e[17];let b;e[18]!==r?(b=()=>r(null),e[18]=r,e[19]=b):b=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(Rn,{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 S;e[23]!==b||e[24]!==v?(S=c.jsxs(gt,{onSelect:b,className:"gap-2",children:[k,v]}),e[23]=b,e[24]=v,e[25]=S):S=e[25];let j;e[26]!==r||e[27]!==i?(j=Object.entries(Qi).map(N=>{const[R,D]=N,I=R==="overdue";return c.jsxs(gt,{onSelect:()=>r(R),className:X("gap-2",I&&"text-destructive"),children:[c.jsx(Rn,{size:16,className:X("shrink-0",I?"text-destructive":"text-muted-foreground")}),i(D)]},R)}),e[26]=r,e[27]=i,e[28]=j):j=e[28];let C;e[29]!==S||e[30]!==j?(C=c.jsxs(Xt,{align:"start",className:"w-44",children:[S,j]}),e[29]=S,e[30]=j,e[31]=C):C=e[31];let T;return e[32]!==C||e[33]!==g?(T=c.jsxs(Yt,{children:[g,C]}),e[32]=C,e[33]=g,e[34]=T):T=e[34],T}function La(t){const e=L.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 a;e[3]!==i||e[4]!==n.assignee||e[5]!==r||e[6]!==o?(a=c.jsx(_p,{block:i,value:n.assignee,members:r,onChange:o}),e[3]=i,e[4]=n.assignee,e[5]=r,e[6]=o,e[7]=a):a=e[7];let l;e[8]!==n||e[9]!==s?(l=p=>s({...n,priority:p}),e[8]=n,e[9]=s,e[10]=l):l=e[10];let d;e[11]!==i||e[12]!==n.priority||e[13]!==l?(d=c.jsx(Ap,{block:i,value:n.priority,onChange:l}),e[11]=i,e[12]=n.priority,e[13]=l,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(Bp,{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]!==a||e[23]!==d||e[24]!==u?(h=c.jsxs(c.Fragment,{children:[a,d,u]}),e[22]=a,e[23]=d,e[24]=u,e[25]=h):h=e[25],h}function Op(t){const e=L.c(12),{filters:n,members:r,onChange:s}=t,i=oe();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(_o,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=o):o=e[0];let a;e[1]!==n||e[2]!==r||e[3]!==s?(a=c.jsx(La,{filters:n,members:r,onChange:s}),e[1]=n,e[2]=r,e[3]=s,e[4]=a):a=e[4];let l;e[5]!==n||e[6]!==s||e[7]!==i?(l=Dp(n)&&c.jsx("button",{type:"button",onClick:()=>s(Ls),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]=l):l=e[8];let d;return e[9]!==a||e[10]!==l?(d=c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,a,l]}),e[9]=a,e[10]=l,e[11]=d):d=e[11],d}function $p(t){const e=L.c(38),{filters:n,members:r,onChange:s}=t,i=oe(),[o,a]=w.useState(!1),l=Np(n),d=l>0;let f;e[0]!==d?(f=Qs(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(_o,{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]!==l?(m=l>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:l}),e[5]=l,e[6]=m):m=e[6];let y;e[7]!==p||e[8]!==m||e[9]!==u?(y=c.jsx(cc,{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 x;e[11]!==i?(x=i("taskBoard.taskFilters.filterDrawerTitle"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==x?(g=c.jsx(dc,{className:"px-4 pt-4 text-base font-medium text-foreground",children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==n||e[16]!==r||e[17]!==s?(b=c.jsx("div",{className:"flex flex-col gap-2 p-4",children:c.jsx(La,{block:!0,filters:n,members:r,onChange:s})}),e[15]=n,e[16]=r,e[17]=s,e[18]=b):b=e[18];let k;e[19]!==l||e[20]!==s||e[21]!==i?(k=l>0&&c.jsx(Xe,{variant:"outline",className:"flex-1",onClick:()=>s(Ls),children:i("taskBoard.taskFilters.clearAllButton")}),e[19]=l,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 S;e[25]!==v?(S=c.jsx(uc,{asChild:!0,children:c.jsx(Xe,{className:"flex-1",children:v})}),e[25]=v,e[26]=S):S=e[26];let j;e[27]!==k||e[28]!==S?(j=c.jsxs(fc,{className:"flex-row gap-2",children:[k,S]}),e[27]=k,e[28]=S,e[29]=j):j=e[29];let C;e[30]!==j||e[31]!==g||e[32]!==b?(C=c.jsxs(hc,{className:"p-0",children:[g,b,j]}),e[30]=j,e[31]=g,e[32]=b,e[33]=C):C=e[33];let T;return e[34]!==o||e[35]!==C||e[36]!==y?(T=c.jsxs(pc,{open:o,onOpenChange:a,direction:"bottom",children:[y,C]}),e[34]=o,e[35]=C,e[36]=y,e[37]=T):T=e[37],T}const Mp="https://decoims.com/image?src=decocms%2F7263a67f-fb83-410b-a5f2-e54e87deaaac%2Freport-kanban.png&quality=original&fit=cover",zp=["taskBoard.backlogPaywall.benefitPrioritizedTasks","taskBoard.backlogPaywall.benefitRecurringReport","taskBoard.backlogPaywall.benefitAgentResolves"],Xi={price:"R$ 99",anchor:"R$ 499"};function Lp(t){const e=L.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(Dr,{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 a;e[5]!==r?(a=r("taskBoard.backlogPaywall.bannerSubtitle"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==a?(l=c.jsx("span",{className:"text-sm text-muted-foreground",children:a}),e[7]=a,e[8]=l):l=e[8];let d;e[9]!==o||e[10]!==l?(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,l]})]}),e[9]=o,e[10]=l,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(Eo,{size:16}),e[14]=u):u=e[14];let h;e[15]!==n||e[16]!==f?(h=c.jsxs(Xe,{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 Pp({open:t,onOpenChange:e,cdClient:n,onExpired:r}){const s=oe(),[i,o]=w.useState(!1),a=async()=>{if(!n){r();return}o(!0);try{const l=await n.callTool({name:"start_checkout",arguments:{}}),{url:d}=dr(l);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(Er,{open:t,onOpenChange:e,children:c.jsxs(Rr,{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:Mp,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(Nr,{className:"text-xl font-semibold text-foreground",children:s("taskBoard.backlogPaywall.modalTitle")}),c.jsx("ul",{className:"flex flex-col gap-3.5",children:zp.map(l=>c.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[c.jsx(_n,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),c.jsx("span",{className:"leading-snug text-foreground",children:s(l)})]},l))})]}),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:Xi.price}),c.jsx("span",{className:"text-sm text-muted-foreground line-through",children:Xi.anchor})]}),c.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[c.jsx(Xe,{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(Xe,{onClick:a,disabled:i,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[i?c.jsx(Sr,{size:16,className:"animate-spin"}):null,s("taskBoard.backlogPaywall.unlockButton"),!i&&c.jsx(Eo,{size:16})]})]})]})]})]})})}function ar(t){return`board-paywall-seen:${t}`}function Fp(){const t=L.c(26),{org:e}=Ee(),n=co(),{diagnostic:r,cdClient:s,connectionId:i}=Gc();let o;t[0]!==e.id?(o=()=>({orgId:e.id,open:!sessionStorage.getItem(ar(e.id))}),t[0]=e.id,t[1]=o):o=t[1];const[a,l]=w.useState(o);let d;t[2]!==a.open||t[3]!==a.orgId||t[4]!==e.id?(d=a.orgId===e.id?a.open:!sessionStorage.getItem(ar(e.id)),t[2]=a.open,t[3]=a.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=>l({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(ar(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=()=>{ci("board_paywall_report_opened",{organization_id:e.id}),n(Xc(e,i))},t[11]=i,t[12]=n,t[13]=e,t[14]=y):y=t[14];const x=y;let g;t[15]!==e.id||t[16]!==h?(g=c.jsx(Lp,{onOpen:()=>{ci("board_paywall_banner_clicked",{organization_id:e.id}),h(!0)}}),t[15]=e.id,t[16]=h,t[17]=g):g=t[17];let b;t[18]!==s||t[19]!==m||t[20]!==f||t[21]!==x?(b=c.jsx(Pp,{open:f,onOpenChange:m,cdClient:s,onExpired:x}),t[18]=s,t[19]=m,t[20]=f,t[21]=x,t[22]=b):b=t[22];let k;return t[23]!==g||t[24]!==b?(k=c.jsxs(c.Fragment,{children:[g,b]}),t[23]=g,t[24]=b,t[25]=k):k=t[25],k}function Up(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(Xa,{fallback:null,children:c.jsx(Fp,{})}),t[0]=e):e=t[0],e}Za(()=>import("./index-zmQQah_K.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])).catch(()=>{});function qp(){const t=L.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(Ka,{})})})}),t[0]=e):e=t[0],e}const Hp=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function Kp(t){const e=new Date(t),n=e.getTime()<Date.now();return{label:Hp.format(e),overdue:n}}const us="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 Pa(){const t=L.c(9),e=oe();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=X(us,"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(Tr,{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 Fa(t){const e=L.c(10),{priority:n}=t,r=oe(),s=wt[n];let i;e[0]!==s.dotClassName?(i=X("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 a;e[4]!==s.labelKey||e[5]!==r?(a=r(s.labelKey),e[4]=s.labelKey,e[5]=r,e[6]=a):a=e[6];let l;return e[7]!==o||e[8]!==a?(l=c.jsxs("span",{className:us,children:[o,a]}),e[7]=o,e[8]=a,e[9]=l):l=e[9],l}function Ua(t){const e=L.c(7),{iso:n}=t;let r,s;if(e[0]!==n){const{label:a,overdue:l}=Kp(n);r=a,s=X(us,l&&"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(Rn,{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 qa(t){const e=L.c(7),{tag:n}=t;let r;e[0]!==n.color?(r=cs(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:us,children:[s,n.name]}),e[4]=s,e[5]=n.name,e[6]=i):i=e[6],i}function Ha(t){const e=L.c(32),{item:n,assignee:r,assignedBy:s,members:i,onAssign:o}=t,a=oe(),[l,d]=w.useState(!1);if(n.assigneeId===nt){let b;e[0]!==s||e[1]!==a?(b=s?.user?.name?a("taskBoard.taskBoard.assignedToSuperAgentBy",{name:s.user.name}):a("taskBoard.taskBoard.assignedToSuperAgent"),e[0]=s,e[1]=a,e[2]=b):b=e[2];let k;e[3]!==s?(k=s&&c.jsx(Ct,{url:s.user?.image??void 0,fallback:St(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(Rt,{size:20,className:"ring-2 ring-background"}),e[5]=v):v=e[5];let S;return e[6]!==b||e[7]!==k?(S=c.jsxs("span",{className:"inline-flex items-center",title:b,children:[k,v]}),e[6]=b,e[7]=k,e[8]=S):S=e[8],S}if(r){const b=r.user?.image??void 0,k=r.user?.name;let v;e[9]!==k?(v=St(k),e[9]=k,e[10]=v):v=e[10];let S;return e[11]!==b||e[12]!==v?(S=c.jsx(Ct,{url:b,fallback:v,shape:"circle",size:"xs"}),e[11]=b,e[12]=v,e[13]=S):S=e[13],S}if(!o||!i?.length)return null;let f;e[14]!==a?(f=a("taskBoard.taskBoard.assignButton"),e[14]=a,e[15]=f):f=e[15];let u;e[16]!==a?(u=a("taskBoard.taskBoard.assignButton"),e[16]=a,e[17]=u):u=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=b=>{b.stopPropagation(),d(!0)},e[18]=h):h=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(uo,{size:13}),e[19]=p):p=e[19];let m;e[20]!==f||e[21]!==u?(m=c.jsx(Nn,{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=b=>{o(b),d(!1)},e[23]=o,e[24]=y):y=e[24];let x;e[25]!==i||e[26]!==y?(x=c.jsx(Gn,{className:"w-56 p-0",align:"end",side:"bottom",onClick:Wp,children:c.jsx(li,{members:i,onSelect:y})}),e[25]=i,e[26]=y,e[27]=x):x=e[27];let g;return e[28]!==l||e[29]!==m||e[30]!==x?(g=c.jsxs(Qn,{open:l,onOpenChange:d,children:[m,x]}),e[28]=l,e[29]=m,e[30]=x,e[31]=g):g=e[31],g}function Wp(t){return t.stopPropagation()}function Ka(){const t=L.c(126),e=oe(),{items:n,isLoading:r}=Wu(),s=Vu(),i=oc(),o=Cl({slug:"mcp-github"})??[];let a;t[0]!==o?(a=o.some(Yp),t[0]=o,t[1]=a):a=t[1];const l=a,[d,f]=w.useState(!1),[u,h]=w.useState(!1);let p;t[2]!==l?(p=z=>z===nt&&!l?(f(!0),!0):!1,t[2]=l,t[3]=p):p=t[3];const m=p,{data:y}=xo();let x,g;t[4]!==y?.data?.members?(x=y?.data?.members??[],g=new Map(x.map(Xp)),t[4]=y?.data?.members,t[5]=x,t[6]=g):(x=t[5],g=t[6]);const b=g,[k,v]=w.useState("board"),[S,j]=w.useState(Ls);let C;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=new Set,t[7]=C):C=t[7];const[T,N]=w.useState(C);let R;t[8]===Symbol.for("react.memo_cache_sentinel")?(R=z=>N(ie=>{const ve=new Set(ie);return ve.has(z)?ve.delete(z):ve.add(z),ve}),t[8]=R):R=t[8];const D=R,I=z=>N(ie=>{const ve=new Set(ie);for(const Ge of te)Ge.status===z&&ve.add(Ge.id);return ve});let O;t[9]===Symbol.for("react.memo_cache_sentinel")?(O=()=>N(new Set),t[9]=O):O=t[9];const E=O,[P,_]=w.useState(!1),[B,$]=w.useState(null),[K,Z]=w.useState(null),{setTaskId:F}=mc(),{create:q}=xc(),Q=en(),{org:G,locator:ee}=Ee(),W=co();let ne;t[10]===Symbol.for("react.memo_cache_sentinel")?(ne={strict:!1},t[10]=ne):ne=t[10];const{task:J}=Ya(ne);let se;t[11]!==J||t[12]!==n?(se=J?n.find(z=>z.id===J)??null:null,t[11]=J,t[12]=n,t[13]=se):se=t[13];const M=se;let U;t[14]!==J||t[15]!==W||t[16]!==G?(U=()=>{J&&W({to:"/$org/board",params:{org:G.slug},search:{},replace:!0})},t[14]=J,t[15]=W,t[16]=G,t[17]=U):U=t[17];const Y=U;let re;t[18]!==s||t[19]!==q||t[20]!==ee||t[21]!==G||t[22]!==F||t[23]!==Q?(re=async z=>{const ie=crypto.randomUUID(),ve=xl(G.id).id,Ge=await Q.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:z.id}).then(Qp).catch(Gp),yt=Tp(z,Ge),Kt={type:"doc",content:[{type:"paragraph",content:[nc({id:z.id,name:z.title,char:"@",kind:"task",metadata:{title:z.title,description:z.description,context:yt}}),{type:"text",text:" "}]}]};vc(sessionStorage,ee,ie,Kt),_(!1);try{await q({id:ie,virtual_mcp_id:ve}),await s.link.mutateAsync({id:z.id,linkThreadId:ie})}catch{}F(ie,ve)},t[18]=s,t[19]=q,t[20]=ee,t[21]=G,t[22]=F,t[23]=Q,t[24]=re):re=t[24];const A=re;let V;t[25]!==S?(V=z=>Ip(z,S),t[25]=S,t[26]=V):V=t[26];const te=n.filter(V);let ce;t[27]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>{$(null),Z(null),_(!0)},t[27]=ce):ce=t[27];const Te=ce;let pe;t[28]===Symbol.for("react.memo_cache_sentinel")?(pe=z=>{$(null),Z(z),_(!0)},t[28]=pe):pe=t[28];const De=pe;let fe;t[29]===Symbol.for("react.memo_cache_sentinel")?(fe=z=>{$(z),_(!0)},t[29]=fe):fe=t[29];const Ie=fe;let dt;t[30]!==M||t[31]!==B||t[32]!==n?(dt=(B&&n.find(z=>z.id===B.id))??B??M,t[30]=M,t[31]=B,t[32]=n,t[33]=dt):dt=t[33];const ye=dt,ge=P||!!M;let Le;t[34]!==Y?(Le=()=>{_(!1),$(null),Z(null),Y()},t[34]=Y,t[35]=Le):Le=t[35];const me=Le;if(r&&n.length===0){let z;return t[36]===Symbol.for("react.memo_cache_sentinel")?(z=c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(Sr,{size:20,className:"animate-spin text-muted-foreground"})}),t[36]=z):z=t[36],z}const xt="relative flex min-h-0 flex-1 flex-col";let Ke;t[37]!==e?(Ke=e("taskBoard.taskBoard.tasksTitle"),t[37]=e,t[38]=Ke):Ke=t[38];let Ae;t[39]!==Ke?(Ae=c.jsx("h1",{className:"text-xl font-medium text-foreground",children:Ke}),t[39]=Ke,t[40]=Ae):Ae=t[40];let We;t[41]!==i?(We=i&&c.jsx(Up,{}),t[41]=i,t[42]=We):We=t[42];let Ze;t[43]!==S||t[44]!==n.length||t[45]!==x?(Ze=n.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sm:hidden",children:c.jsx($p,{filters:S,members:x,onChange:j})}),c.jsx("div",{className:"hidden sm:block",children:c.jsx(Op,{filters:S,members:x,onChange:j})})]}),t[43]=S,t[44]=n.length,t[45]=x,t[46]=Ze):Ze=t[46];const bt=k==="list";let Fe;t[47]!==E?(Fe=()=>{v("list"),E()},t[47]=E,t[48]=Fe):Fe=t[48];let Ve;t[49]!==e?(Ve=e("common.taskBoard.listView"),t[49]=e,t[50]=Ve):Ve=t[50];let Je;t[51]!==bt||t[52]!==Fe||t[53]!==Ve?(Je=c.jsx(Yi,{active:bt,onClick:Fe,icon:ho,label:Ve}),t[51]=bt,t[52]=Fe,t[53]=Ve,t[54]=Je):Je=t[54];const ut=k==="board";let ft;t[55]===Symbol.for("react.memo_cache_sentinel")?(ft=()=>v("board"),t[55]=ft):ft=t[55];let et;t[56]!==e?(et=e("common.taskBoard.boardView"),t[56]=e,t[57]=et):et=t[57];let tt;t[58]!==ut||t[59]!==et?(tt=c.jsx(Yi,{active:ut,onClick:ft,icon:dl,label:et}),t[58]=ut,t[59]=et,t[60]=tt):tt=t[60];let de;t[61]!==Je||t[62]!==tt?(de=c.jsxs("div",{className:"inline-flex rounded-lg bg-muted p-0.5",children:[Je,tt]}),t[61]=Je,t[62]=tt,t[63]=de):de=t[63];let we;t[64]===Symbol.for("react.memo_cache_sentinel")?(we=c.jsx(Jn,{size:16}),t[64]=we):we=t[64];let xe;t[65]!==e?(xe=e("taskBoard.taskBoard.newTask"),t[65]=e,t[66]=xe):xe=t[66];let Ne;t[67]!==xe?(Ne=c.jsxs(Xe,{size:"sm",onClick:Te,children:[we,xe]}),t[67]=xe,t[68]=Ne):Ne=t[68];let ke;t[69]!==de||t[70]!==Ne?(ke=c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[de,Ne]}),t[69]=de,t[70]=Ne,t[71]=ke):ke=t[71];let Ce;t[72]!==Ze||t[73]!==ke?(Ce=c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Ze,ke]}),t[72]=Ze,t[73]=ke,t[74]=Ce):Ce=t[74];let je;t[75]!==Ae||t[76]!==We||t[77]!==Ce?(je=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:[Ae,We,Ce]}),t[75]=Ae,t[76]=We,t[77]=Ce,t[78]=je):je=t[78];const Ue=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")})}):te.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(Xe,{variant:"outline",size:"sm",onClick:()=>j(Ls),children:e("taskBoard.taskBoard.clearFilters")})]})}):k==="board"?c.jsx(eg,{items:te,members:x,memberByUserId:b,selectedIds:T,onToggleSelect:D,onSelectAllInLane:I,onOpen:Ie,onCreate:De,onMove:(z,ie,ve)=>{const Ge=la(ve,z.length);z.forEach((yt,Kt)=>s.update.mutate({id:yt,status:ie,sortOrder:Ge[Kt]}))},onAssign:(z,ie)=>{m(ie)||s.update.mutate({id:z,assigneeId:ie})},onAutoFix:i?z=>{m(nt)||s.update.mutate({id:z.id,assigneeId:nt})}: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:te.map(z=>c.jsx(cg,{item:z,assignee:z.assigneeId?b.get(z.assigneeId):void 0,assignedBy:z.assignedBy?b.get(z.assignedBy):void 0,onOpen:()=>Ie(z)},z.id))})}),he=ge?ye?.id??`new-${K??"default"}`:"closed",Be=ye??void 0,_e=K??void 0,qe=s.create.isPending||s.update.isPending;let Oe;t[79]!==s.create||t[80]!==s.update||t[81]!==ye||t[82]!==m||t[83]!==me?(Oe=z=>{if(m(z.assigneeId)){me();return}ye?s.update.mutate({id:ye.id,...z}):s.create.mutate(z),me()},t[79]=s.create,t[80]=s.update,t[81]=ye,t[82]=m,t[83]=me,t[84]=Oe):Oe=t[84];let $e;t[85]!==s.remove||t[86]!==ye||t[87]!==me?($e=ye?()=>{s.remove.mutate(ye.id),me()}:void 0,t[85]=s.remove,t[86]=ye,t[87]=me,t[88]=$e):$e=t[88];let Re;t[89]!==ye||t[90]!==A?(Re=ye?()=>{A(ye)}:void 0,t[89]=ye,t[90]=A,t[91]=Re):Re=t[91];let Me;t[92]!==me||t[93]!==F?(Me=z=>{z.virtualMcpId&&(me(),F(z.threadId,z.virtualMcpId,{main:z.hasPreview?"preview":"board"}))},t[92]=me,t[93]=F,t[94]=Me):Me=t[94];let He;t[95]!==me||t[96]!==ge||t[97]!==he||t[98]!==Be||t[99]!==_e||t[100]!==qe||t[101]!==Oe||t[102]!==$e||t[103]!==Re||t[104]!==Me?(He=c.jsx(Zh,{open:ge,onClose:me,item:Be,defaultStatus:_e,isSaving:qe,onSubmit:Oe,onDelete:$e,onNewChat:Re,onOpenThread:Me},he),t[95]=me,t[96]=ge,t[97]=he,t[98]=Be,t[99]=_e,t[100]=qe,t[101]=Oe,t[102]=$e,t[103]=Re,t[104]=Me,t[105]=He):He=t[105];let jt;t[106]===Symbol.for("react.memo_cache_sentinel")?(jt=()=>h(!0),t[106]=jt):jt=t[106];let _t;t[107]!==d?(_t=c.jsx(Zp,{open:d,onOpenChange:f,onConnected:jt}),t[107]=d,t[108]=_t):_t=t[108];let ht;t[109]!==u?(ht=c.jsx(yl,{mode:"connection",open:u,onOpenChange:h}),t[109]=u,t[110]=ht):ht=t[110];let pt;t[111]!==s.remove||t[112]!==s.update||t[113]!==m||t[114]!==E||t[115]!==n||t[116]!==x||t[117]!==T?(pt=T.size>0&&c.jsx(Jp,{count:T.size,members:x,onMoveTo:z=>{for(const ie of T)s.update.mutate({id:ie,status:z});E()},onSetPriority:z=>{for(const ie of T)s.update.mutate({id:ie,priority:z});E()},onAddTag:z=>{for(const ie of T){const ve=n.find(yt=>yt.id===ie);if(!ve)continue;const Ge=ve.tags.map(Vp);Ge.includes(z)||s.update.mutate({id:ie,tagIds:[...Ge,z]})}E()},onAssign:z=>{if(!m(z)){for(const ie of T)s.update.mutate({id:ie,assigneeId:z});E()}},onSetDueDate:z=>{const ie=Ma(z);for(const ve of T)s.update.mutate({id:ve,dueDate:ie});E()},onAutoFix:T.size>0&&Array.from(T).every(z=>{const ie=n.find(ve=>ve.id===z);return ie&&(ie.status==="triage"||ie.status==="todo")&&ie.assigneeId!==nt})?()=>{if(!m(nt)){for(const z of T)s.update.mutate({id:z,assigneeId:nt});E()}}:void 0,onDelete:()=>{for(const z of T)s.remove.mutate(z);E()},onClear:E}),t[111]=s.remove,t[112]=s.update,t[113]=m,t[114]=E,t[115]=n,t[116]=x,t[117]=T,t[118]=pt):pt=t[118];let Tt;return t[119]!==je||t[120]!==Ue||t[121]!==He||t[122]!==_t||t[123]!==ht||t[124]!==pt?(Tt=c.jsxs("div",{className:xt,children:[je,Ue,He,_t,ht,pt]}),t[119]=je,t[120]=Ue,t[121]=He,t[122]=_t,t[123]=ht,t[124]=pt,t[125]=Tt):Tt=t[125],Tt}function Vp(t){return t.id}function Gp(){return[]}function Qp(t){return t.prs}function Xp(t){return[t.userId,t]}function Yp(t){return t.status==="active"&&jl(t)!==null}function Zp(t){const e=L.c(32),{open:n,onOpenChange:r,onConnected:s}=t,i=oe(),{connect:o,isConnecting:a}=Tu("deco/mcp-github");let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=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(lr,{className:"size-7"})})}),e[0]=l):l=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(Nr,{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(kl,{children:u}),e[7]=u,e[8]=h):h=e[8];let p;e[9]!==f||e[10]!==h?(p=c.jsxs(vl,{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]!==a?(y=a?c.jsx(Sr,{size:16,className:"animate-spin"}):c.jsx(lr,{className:"size-4"}),e[16]=a,e[17]=y):y=e[17];let x;e[18]!==i?(x=i("taskBoard.taskBoard.connectGithubButton"),e[18]=i,e[19]=x):x=e[19];let g;e[20]!==a||e[21]!==m||e[22]!==y||e[23]!==x?(g=c.jsx(wl,{children:c.jsxs(Xe,{onClick:m,disabled:a,className:"gap-2",children:[y,x]})}),e[20]=a,e[21]=m,e[22]=y,e[23]=x,e[24]=g):g=e[24];let b;e[25]!==g||e[26]!==p?(b=c.jsxs(Rr,{className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[l,c.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[p,g]})]}),e[25]=g,e[26]=p,e[27]=b):b=e[27];let k;return e[28]!==r||e[29]!==n||e[30]!==b?(k=c.jsx(Er,{open:n,onOpenChange:r,children:b}),e[28]=r,e[29]=n,e[30]=b,e[31]=k):k=e[31],k}function Jp(t){const e=L.c(91),{count:n,members:r,onMoveTo:s,onSetPriority:i,onAddTag:o,onAssign:a,onSetDueDate:l,onAutoFix:d,onDelete:f,onClear:u}=t,h=oe(),{data:p}=bo();let m;e[0]!==p?(m=p===void 0?[]:p,e[0]=p,e[1]=m):m=e[1];const y=m;let x;e[2]!==n||e[3]!==h?(x=h("taskBoard.taskBoard.selectedCount",{count:n}),e[2]=n,e[3]=h,e[4]=x):x=e[4];let g;e[5]!==x?(g=c.jsx("span",{className:"pl-1 text-sm font-medium text-foreground",children:x}),e[5]=x,e[6]=g):g=e[6];let b;e[7]!==h?(b=h("taskBoard.taskBoard.actionsButton"),e[7]=h,e[8]=b):b=e[8];let k;e[9]!==b?(k=c.jsx(Qt,{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:b})}),e[9]=b,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 S;e[13]!==v?(S=c.jsx(Ln,{children:v}),e[13]=v,e[14]=S):S=e[14];let j;e[15]!==s||e[16]!==h?(j=Bs.map(A=>c.jsx(gt,{onClick:()=>s(A),children:h(vt[A].labelKey)},A)),e[15]=s,e[16]=h,e[17]=j):j=e[17];let C;e[18]!==j?(C=c.jsx(Pn,{children:j}),e[18]=j,e[19]=C):C=e[19];let T;e[20]!==C||e[21]!==S?(T=c.jsxs(zn,{children:[S,C]}),e[20]=C,e[21]=S,e[22]=T):T=e[22];let N;e[23]!==h?(N=h("taskBoard.taskBoard.changePriorityButton"),e[23]=h,e[24]=N):N=e[24];let R;e[25]!==N?(R=c.jsx(Ln,{children:N}),e[25]=N,e[26]=R):R=e[26];let D;e[27]!==i||e[28]!==h?(D=Qr.map(A=>c.jsxs(gt,{onClick:()=>i(A),children:[c.jsx("span",{className:X("size-2 rounded-full",wt[A].dotClassName)}),h(wt[A].labelKey)]},A)),e[27]=i,e[28]=h,e[29]=D):D=e[29];let I;e[30]!==D?(I=c.jsx(Pn,{children:D}),e[30]=D,e[31]=I):I=e[31];let O;e[32]!==R||e[33]!==I?(O=c.jsxs(zn,{children:[R,I]}),e[32]=R,e[33]=I,e[34]=O):O=e[34];let E;e[35]!==h?(E=h("taskBoard.taskBoard.assignButton"),e[35]=h,e[36]=E):E=e[36];let P;e[37]!==E?(P=c.jsx(Ln,{children:E}),e[37]=E,e[38]=P):P=e[38];let _;e[39]!==r||e[40]!==a?(_=c.jsx(Pn,{className:"w-56 p-0",children:c.jsx(li,{members:r,onSelect:a})}),e[39]=r,e[40]=a,e[41]=_):_=e[41];let B;e[42]!==P||e[43]!==_?(B=c.jsxs(zn,{children:[P,_]}),e[42]=P,e[43]=_,e[44]=B):B=e[44];let $;e[45]!==h?($=h("taskBoard.taskBoard.dueDateButton"),e[45]=h,e[46]=$):$=e[46];let K;e[47]!==$?(K=c.jsx(Ln,{children:$}),e[47]=$,e[48]=K):K=e[48];let Z;e[49]!==l?(Z=c.jsx(Pn,{className:"w-auto p-0",children:c.jsx(To,{mode:"single",onSelect:A=>A&&l(A),initialFocus:!0})}),e[49]=l,e[50]=Z):Z=e[50];let F;e[51]!==K||e[52]!==Z?(F=c.jsxs(zn,{children:[K,Z]}),e[51]=K,e[52]=Z,e[53]=F):F=e[53];let q;e[54]!==o||e[55]!==y||e[56]!==h?(q=y.length>0&&c.jsxs(zn,{children:[c.jsx(Ln,{children:h("taskBoard.taskBoard.addTagButton")}),c.jsx(Pn,{children:y.map(A=>c.jsxs(gt,{onClick:()=>o(A.id),children:[c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:cs(A.color)}}),A.name]},A.id))})]}),e[54]=o,e[55]=y,e[56]=h,e[57]=q):q=e[57];let Q;e[58]===Symbol.for("react.memo_cache_sentinel")?(Q=c.jsx(po,{}),e[58]=Q):Q=e[58];let G;e[59]!==h?(G=h("taskBoard.taskBoard.deleteSelectedButton"),e[59]=h,e[60]=G):G=e[60];let ee;e[61]!==f||e[62]!==G?(ee=c.jsx(gt,{variant:"destructive",onClick:f,children:G}),e[61]=f,e[62]=G,e[63]=ee):ee=e[63];let W;e[64]!==T||e[65]!==O||e[66]!==B||e[67]!==F||e[68]!==q||e[69]!==ee?(W=c.jsxs(Xt,{align:"center",side:"top",children:[T,O,B,F,q,Q,ee]}),e[64]=T,e[65]=O,e[66]=B,e[67]=F,e[68]=q,e[69]=ee,e[70]=W):W=e[70];let ne;e[71]!==W||e[72]!==k?(ne=c.jsxs(Yt,{children:[k,W]}),e[71]=W,e[72]=k,e[73]=ne):ne=e[73];let J;e[74]!==d||e[75]!==h?(J=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(Dr,{size:14}),h("taskBoard.taskBoard.autoFix")]}),e[74]=d,e[75]=h,e[76]=J):J=e[76];let se;e[77]!==h?(se=h("taskBoard.taskBoard.clearSelectionButton"),e[77]=h,e[78]=se):se=e[78];let M;e[79]!==h?(M=h("taskBoard.taskBoard.clearSelectionButton"),e[79]=h,e[80]=M):M=e[80];let U;e[81]===Symbol.for("react.memo_cache_sentinel")?(U=c.jsx(Gt,{size:16}),e[81]=U):U=e[81];let Y;e[82]!==u||e[83]!==se||e[84]!==M?(Y=c.jsx("button",{type:"button","aria-label":se,title:M,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:U}),e[82]=u,e[83]=se,e[84]=M,e[85]=Y):Y=e[85];let re;return e[86]!==ne||e[87]!==J||e[88]!==Y||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,ne,J,Y]})}),e[86]=ne,e[87]=J,e[88]=Y,e[89]=g,e[90]=re):re=e[90],re}function Yi(t){const e=L.c(14),{active:n,onClick:r,icon:s,label:i}=t,o=oe();let a;e[0]!==i||e[1]!==o?(a=o("taskBoard.taskBoard.layoutViewAriaLabel",{label:i}),e[0]=i,e[1]=o,e[2]=a):a=e[2];const l=n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground";let d;e[3]!==l?(d=X("flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",l),e[3]=l,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]!==a||e[11]!==d||e[12]!==f?(u=c.jsxs("button",{type:"button",onClick:r,"aria-label":a,"aria-pressed":n,className:d,children:[f,i]}),e[7]=n,e[8]=i,e[9]=r,e[10]=a,e[11]=d,e[12]=f,e[13]=u):u=e[13],u}const Vn="lane:";function Zi(t,e){return t.sortOrder-e.sortOrder}function eg(t){const e=L.c(30),{items:n,members:r,memberByUserId:s,selectedIds:i,onToggleSelect:o,onSelectAllInLane:a,onOpen:l,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[x,g]=w.useState(y);let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=new Map,e[1]=b):b=e[1];const[k,v]=w.useState(b),S=w.useRef(null),j=k.size>0?n.map(A=>{const V=k.get(A.id);return V?{...A,...V}:A}):n;if(k.size>0&&!p){const A=[...k].filter(V=>{const[te,ce]=V,Te=n.find(pe=>pe.id===te);return Te?.status===ce.status&&Te.sortOrder===ce.sortOrder});A.length>0&&v(V=>{const te=new Map(V);for(const[ce]of A)te.delete(ce);return te})}jp(S,j.map(rg).join(","),p===null);const C=A=>j.filter(V=>V.status===A).sort(Zi),T=A=>{if(A===void 0)return null;const V=String(A);if(V.startsWith(Vn)){const te=V.slice(Vn.length);return Bs.find(ce=>ce===te)??null}return j.find(te=>te.id===V)?.status??null};let N;e[2]!==i?(N=A=>i.has(A)&&i.size>1?[A,...Array.from(i).filter(V=>V!==A)]:[A],e[2]=i,e[3]=N):N=e[3];const R=N;let D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D=(A,V,te)=>{const ce=la(te,A.length);v(Te=>{const pe=new Map(Te);return A.forEach((De,fe)=>pe.set(De,{status:V,sortOrder:ce[fe]})),pe})},e[4]=D):D=e[4];const I=D;let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:4}},e[5]=O):O=e[5];let E;e[6]===Symbol.for("react.memo_cache_sentinel")?(E={coordinateGetter:qu},e[6]=E):E=e[6];const P=ud(pi(Kr,O),pi(qr,E)),_=A=>{const V=String(A.active.id),te=T(A.over?.id),ce=j.find(fe=>fe.id===V);if(!te||!ce||ce.status===te)return;const Te=R(V),pe=String(A.over?.id??""),De=C(te).filter(fe=>!Te.includes(fe.id));I(Te,te,Ri(De,pe.startsWith(Vn)?null:pe,V))},B=A=>{const V=String(A.active.id);m(null);const te=T(A.over?.id)??j.find(ge=>ge.id===V)?.status;if(!te){v(new Map);return}const ce=R(V),Te=C(te),pe=String(A.over?.id??""),De=Te.findIndex(ge=>ge.id===V),fe=pe.startsWith(Vn)?Te.length-1:Te.findIndex(ge=>ge.id===pe),ot=De===-1||fe===-1?Te:Vr(Te,De,fe);if(n.filter(ge=>ge.status===te).sort(Zi).map(sg).join()===ot.map(ng).join()){v(new Map);return}const dt=ot.slice(ot.findIndex(ge=>ge.id===V)+1).find(ge=>!ce.includes(ge.id)),ye=Ri(Te.filter(ge=>!ce.includes(ge.id)),dt?.id??null,V);I(ce,te,ye),g(ce),f(ce,te,ye)},$=p?j.find(A=>A.id===p):null;let K;e[7]!==p||e[8]!==R?(K=p?R(p):[],e[7]=p,e[8]=R,e[9]=K):K=e[9];const Z=K,F=au,q=Lo;let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q=A=>{m(String(A.active.id)),g([])},e[10]=Q):Q=e[10];let G;e[11]===Symbol.for("react.memo_cache_sentinel")?(G=()=>{m(null),v(new Map)},e[11]=G):G=e[11];const ee=Bs.map(A=>c.jsx(ig,{status:A,items:C(A),members:r,memberByUserId:s,selectedIds:i,isTarget:$?.status===A,hiddenIds:Z,landedIds:x,onToggleSelect:o,onSelectAllInLane:a,onOpen:l,onCreate:d,onAutoFix:u,onAssign:h},A));let W;e[12]!==ee?(W=c.jsx("div",{ref:S,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:ee})}),e[12]=ee,e[13]=W):W=e[13];const ne=Ut.createPortal,J=ju,se=null,M=$&&c.jsxs("div",{className:"relative w-[292px] cursor-grabbing",children:[c.jsx(Wa,{item:$,assignee:$.assigneeId?s.get($.assigneeId):void 0,assignedBy:$.assignedBy?s.get($.assignedBy):void 0,selected:i.has($.id),onOpen:tg,className:"w-full shadow-lg"}),Z.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:Z.length})]});let U;e[14]!==J||e[15]!==M?(U=c.jsx(J,{dropAnimation:se,children:M}),e[14]=J,e[15]=M,e[16]=U):U=e[16];let Y;e[17]!==ne||e[18]!==U?(Y=ne(U,document.body),e[17]=ne,e[18]=U,e[19]=Y):Y=e[19];let re;return e[20]!==F||e[21]!==B||e[22]!==_||e[23]!==P||e[24]!==G||e[25]!==W||e[26]!==Y||e[27]!==q||e[28]!==Q?(re=c.jsxs(F,{sensors:P,collisionDetection:q,onDragStart:Q,onDragOver:_,onDragEnd:B,onDragCancel:G,children:[W,Y]}),e[20]=F,e[21]=B,e[22]=_,e[23]=P,e[24]=G,e[25]=W,e[26]=Y,e[27]=q,e[28]=Q,e[29]=re):re=e[29],re}function tg(){}function ng(t){return t.id}function sg(t){return t.id}function rg(t){return`${t.id}:${t.status}`}function ig(t){const e=L.c(91),{status:n,items:r,members:s,memberByUserId:i,selectedIds:o,isTarget:a,hiddenIds:l,landedIds:d,onToggleSelect:f,onSelectAllInLane:u,onOpen:h,onCreate:p,onAutoFix:m,onAssign:y}=t,x=oe(),g=vt[n],b=g.icon,k=`${Vn}${n}`;let v;e[0]!==k?(v={id:k},e[0]=k,e[1]=v):v=e[1];const{setNodeRef:S}=na(v),j=a&&"bg-muted/50";let C;e[2]!==j?(C=X("flex h-full w-[300px] shrink-0 flex-col rounded-xl py-1 transition-colors",j),e[2]=j,e[3]=C):C=e[3];const T=a?"bg-muted":"bg-background";let N;e[4]!==T?(N=X("sticky top-0 z-10 flex items-center gap-2 px-2 py-1.5 transition-colors",T),e[4]=T,e[5]=N):N=e[5];let R;e[6]!==g.iconClassName?(R=X("shrink-0",g.iconClassName.replace(/\banimate-\S+\b/g,"").trim()),e[6]=g.iconClassName,e[7]=R):R=e[7];let D;e[8]!==b||e[9]!==R?(D=c.jsx(b,{size:15,className:R}),e[8]=b,e[9]=R,e[10]=D):D=e[10];let I;e[11]!==g.labelKey||e[12]!==x?(I=x(g.labelKey),e[11]=g.labelKey,e[12]=x,e[13]=I):I=e[13];let O;e[14]!==I?(O=c.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[14]=I,e[15]=O):O=e[15];let E;e[16]!==r.length?(E=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]=E):E=e[17];let P;e[18]!==g.labelKey||e[19]!==x?(P=x("taskBoard.taskBoard.laneMenuAriaLabel",{lane:x(g.labelKey)}),e[18]=g.labelKey,e[19]=x,e[20]=P):P=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=c.jsx(jr,{size:15}),e[21]=_):_=e[21];let B;e[22]!==P?(B=c.jsx(Qt,{asChild:!0,children:c.jsx("button",{type:"button","aria-label":P,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]=P,e[23]=B):B=e[23];let $;e[24]!==u||e[25]!==n?($=()=>u(n),e[24]=u,e[25]=n,e[26]=$):$=e[26];let K;e[27]!==x?(K=x("taskBoard.taskBoard.selectAllInLane"),e[27]=x,e[28]=K):K=e[28];let Z;e[29]!==$||e[30]!==K?(Z=c.jsx(Xt,{align:"end",children:c.jsx(gt,{onClick:$,children:K})}),e[29]=$,e[30]=K,e[31]=Z):Z=e[31];let F;e[32]!==B||e[33]!==Z?(F=c.jsxs(Yt,{children:[B,Z]}),e[32]=B,e[33]=Z,e[34]=F):F=e[34];let q;e[35]!==g.labelKey||e[36]!==x?(q=x("taskBoard.taskBoard.newTaskInLaneAriaLabel",{lane:x(g.labelKey)}),e[35]=g.labelKey,e[36]=x,e[37]=q):q=e[37];let Q;e[38]!==g.labelKey||e[39]!==x?(Q=x("taskBoard.taskBoard.newTaskInLaneTitle",{lane:x(g.labelKey)}),e[38]=g.labelKey,e[39]=x,e[40]=Q):Q=e[40];let G;e[41]!==p||e[42]!==n?(G=()=>p(n),e[41]=p,e[42]=n,e[43]=G):G=e[43];let ee;e[44]===Symbol.for("react.memo_cache_sentinel")?(ee=c.jsx(Jn,{size:15}),e[44]=ee):ee=e[44];let W;e[45]!==q||e[46]!==Q||e[47]!==G?(W=c.jsx("button",{type:"button","aria-label":q,title:Q,onClick:G,className:"flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:ee}),e[45]=q,e[46]=Q,e[47]=G,e[48]=W):W=e[48];let ne;e[49]!==O||e[50]!==E||e[51]!==F||e[52]!==W||e[53]!==N||e[54]!==D?(ne=c.jsxs("div",{className:N,children:[D,O,E,F,W]}),e[49]=O,e[50]=E,e[51]=F,e[52]=W,e[53]=N,e[54]=D,e[55]=ne):ne=e[55];let J;e[56]!==r?(J=r.map(og),e[56]=r,e[57]=J):J=e[57];let se;if(e[58]!==l||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]!==l||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=A=>c.jsx(ag,{item:A,assignee:A.assigneeId?i.get(A.assigneeId):void 0,assignedBy:A.assignedBy?i.get(A.assignedBy):void 0,members:s,selected:o.has(A.id),hidden:l.includes(A.id),landed:d.includes(A.id),onToggleSelect:()=>f(A.id),onOpen:()=>h(A),onAutoFix:m?()=>m(A):void 0,onAssign:y?V=>y(A.id,V):void 0},A.id),e[69]=l,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],se=r.map(re),e[58]=l,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]=se}else se=e[68];let M;e[79]!==J||e[80]!==se?(M=c.jsx(Au,{items:J,strategy:Iu,children:se}),e[79]=J,e[80]=se,e[81]=M):M=e[81];let U;e[82]!==S||e[83]!==n||e[84]!==M?(U=c.jsx("div",{ref:S,"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:M}),e[82]=S,e[83]=n,e[84]=M,e[85]=U):U=e[85];let Y;return e[86]!==n||e[87]!==ne||e[88]!==U||e[89]!==C?(Y=c.jsxs("div",{"data-lane":n,className:C,children:[ne,U]}),e[86]=n,e[87]=ne,e[88]=U,e[89]=C,e[90]=Y):Y=e[90],Y}function og(t){return t.id}function ag(t){const e=L.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:a,listeners:l,setNodeRef:d,transform:f,transition:u,isDragging:h}=Pu(o),p=r.id,m=r.status;let y;e[7]!==a||e[8]!==l?(y={attributes:a,listeners:l},e[7]=a,e[8]=l,e[9]=y):y=e[9];const x=s&&"animate-card-land";let g;e[10]!==x?(g=X("w-full",x),e[10]=x,e[11]=g):g=e[11];let b;e[12]!==f?(b=Ht.Translate.toString(f),e[12]=f,e[13]=b):b=e[13];const k=h||n?0:void 0;let v;e[14]!==b||e[15]!==k||e[16]!==u?(v={transform:b,transition:u,opacity:k},e[14]=b,e[15]=k,e[16]=u,e[17]=v):v=e[17];let S;e[18]!==r||e[19]!==i||e[20]!==d||e[21]!==y||e[22]!==g||e[23]!==v?(S=c.jsx(Wa,{...i,item:r,dragRef:d,bindings:y,className:g,style:v}),e[18]=r,e[19]=i,e[20]=d,e[21]=y,e[22]=g,e[23]=v,e[24]=S):S=e[24];let j;return e[25]!==r.id||e[26]!==r.status||e[27]!==S?(j=c.jsx("div",{className:"flex","data-flip-id":p,"data-flip-lane":m,children:S}),e[25]=r.id,e[26]=r.status,e[27]=S,e[28]=j):j=e[28],j}function Wa(t){const e=L.c(43),{item:n,assignee:r,assignedBy:s,members:i,selected:o,className:a,dragRef:l,bindings:d,style:f,onToggleSelect:u,onOpen:h,onAutoFix:p,onAssign:m}=t,y=oe(),x=vt[n.status].icon,g=Gu(n)?.lastMessage,b=p&&(n.status==="triage"||n.status==="todo")&&n.assigneeId!==nt,k=d?.attributes,v=d?.listeners;let S;e[0]!==h||e[1]!==u?(S=$=>{$.shiftKey&&u?u():h()},e[0]=h,e[1]=u,e[2]=S):S=e[2];const j=o&&"bg-accent";let C;e[3]!==a||e[4]!==j?(C=X("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,a),e[3]=a,e[4]=j,e[5]=C):C=e[5];const T=n.title;let N;e[6]!==n?(N=X("mt-px shrink-0",Gr(n)),e[6]=n,e[7]=N):N=e[7];let R;e[8]!==x||e[9]!==N?(R=c.jsx(x,{size:16,className:N}),e[8]=x,e[9]=N,e[10]=R):R=e[10];let D;e[11]!==n.title?(D=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]=D):D=e[12];let I;e[13]!==s||e[14]!==r||e[15]!==n||e[16]!==i||e[17]!==m?(I=c.jsx(Ha,{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]=I):I=e[18];let O;e[19]!==I||e[20]!==R||e[21]!==D?(O=c.jsxs("div",{className:"flex items-start gap-2",children:[R,D,I]}),e[19]=I,e[20]=R,e[21]=D,e[22]=O):O=e[22];let E;e[23]!==g?(E=g&&c.jsx("p",{className:"line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground",children:g}),e[23]=g,e[24]=E):E=e[24];let P;e[25]!==n?(P=(As(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:[As(n)&&c.jsx(Pa,{}),n.priority!=="none"&&c.jsx(Fa,{priority:n.priority}),n.dueDate&&c.jsx(Ua,{iso:n.dueDate}),n.tags.map(lg)]}),e[25]=n,e[26]=P):P=e[26];let _;e[27]!==p||e[28]!==b||e[29]!==y?(_=b&&c.jsxs("button",{type:"button",onClick:$=>{$.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(Dr,{size:12}),y("taskBoard.taskBoard.autoFix")]}),e[27]=p,e[28]=b,e[29]=y,e[30]=_):_=e[30];let B;return e[31]!==l||e[32]!==n.title||e[33]!==f||e[34]!==k||e[35]!==O||e[36]!==E||e[37]!==P||e[38]!==_||e[39]!==v||e[40]!==S||e[41]!==C?(B=c.jsxs("button",{type:"button",ref:l,style:f,...k,...v,onClick:S,className:C,title:T,children:[O,E,P,_]}),e[31]=l,e[32]=n.title,e[33]=f,e[34]=k,e[35]=O,e[36]=E,e[37]=P,e[38]=_,e[39]=v,e[40]=S,e[41]=C,e[42]=B):B=e[42],B}function lg(t){return c.jsx(qa,{tag:t},t.id)}function cg(t){const e=L.c(33),{item:n,assignee:r,assignedBy:s,onOpen:i}=t,o=vt[n.status].icon;let a;e[0]!==n?(a=X("shrink-0",Gr(n)),e[0]=n,e[1]=a):a=e[1];let l;e[2]!==o||e[3]!==a?(l=c.jsx(o,{size:16,className:a}),e[2]=o,e[3]=a,e[4]=l):l=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=As(n)&&c.jsx(Pa,{}),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(Fa,{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(Ua,{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(dg),n.tags.length>2&&c.jsxs("span",{className:us,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(Ha,{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=Ir(new Date(n.createdAt)),e[19]=n.createdAt,e[20]=y):y=e[20];let x;e[21]!==y?(x=c.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted-foreground/70 sm:inline",children:y}),e[21]=y,e[22]=x):x=e[22];let g;return e[23]!==i||e[24]!==x||e[25]!==l||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:[l,d,f,u,h,p,m,x]}),e[23]=i,e[24]=x,e[25]=l,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 dg(t){return c.jsx(qa,{tag:t},t.id)}const Tm=Object.freeze(Object.defineProperty({__proto__:null,TaskBoardPage:Ka,default:qp},Symbol.toStringTag,{value:"Module"}));export{Tm as $,qu as A,Vr as B,Ht as C,au as D,Wu as E,Vu as F,vt as G,om as H,wt as I,Rt as J,qr as K,lt as L,wm as M,um as N,Sm as O,Kr as P,hm as Q,jm as R,Rc as S,Zh as T,Uc as U,fm as V,mm as W,km as X,pm as Y,Ka as Z,sa as _,Ec as a,dm as b,bm as c,yc as d,lm as e,ym as f,qc as g,vm as h,Sc as i,gm as j,xm as k,Gc as l,Kc as m,Xc as n,ud as o,pi as p,ju as q,am as r,du as s,Tu as t,cm as u,Cm as v,vc as w,Au as x,Iu as y,Pu as z};
|